diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2018-10-15 09:24:05 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2018-10-15 09:24:05 -0700 |
| commit | 793766b8e51bf0bf4c61cbb0fb613d746db3b4fa (patch) | |
| tree | cec125da7240c058cc880e2594f42c984d1adbd1 /FS | |
| parent | 342650d7d4d9e4aafa5c749cff39561a1c5a993a (diff) | |
| parent | e07e59d2463eae2cdd421401a2d98f3879dc97f3 (diff) | |
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/access_user.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm index 37871c552..9f4c34ddb 100644 --- a/FS/FS/access_user.pm +++ b/FS/FS/access_user.pm @@ -397,6 +397,12 @@ user has the provided access right Optional table name in which agentnum is being checked. Sometimes required to resolve 'column reference "agentnum" is ambiguous' errors. +=item column + +Optional column name in which agentnum is being checked. + +e.g: column => 'COALESCE ( cust_main.agentnum, prospect_main.agentnum )' + =item viewall_right All agents will be viewable if the current user has the provided access right. @@ -410,7 +416,14 @@ sub agentnums_sql { my( $self ) = shift; my %opt = ref($_[0]) ? %{$_[0]} : @_; - my $agentnum = $opt{'table'} ? $opt{'table'}.'.agentnum' : 'agentnum'; + my $agentnum; + if ( $opt{column} ) { + $agentnum = $opt{column}; + } elsif ( $opt{table} ) { + $agentnum = "$opt{table}.agentnum" + } else { + $agentnum = 'agentnum'; + } my @or = (); |
