diff options
author | ivan <ivan> | 2006-06-19 02:33:52 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-06-19 02:33:52 +0000 |
commit | c0e8da2f1e89729efa1032241e4239765a296514 (patch) | |
tree | 68af748a3dc0c983e3ed255ad1bc05e9bf2eb8e7 /httemplate/elements/tr-select-agent.html | |
parent | bb65b62d3d68ac0788f230fe2e35ebe1913fc0f5 (diff) |
agent virtualization, take one (stuff from "inactive" changeset snuck into cust_main.pm and the package reporting changeset in search/cust_pkg.cgi here too)
Diffstat (limited to 'httemplate/elements/tr-select-agent.html')
-rw-r--r-- | httemplate/elements/tr-select-agent.html | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html index 2227262b6..83c8d1758 100644 --- a/httemplate/elements/tr-select-agent.html +++ b/httemplate/elements/tr-select-agent.html @@ -3,9 +3,16 @@ my @agents; if ( $opt{'agents'} ) { - @agents = @{ $opt{'agents'} }; + #@agents = @{ $opt{'agents'} }; + #here is the agent virtualization + my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href; + @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} }; } else { - @agents = qsearch( 'agent', { disabled=>'' } ); + @agents = qsearch( { + 'table' => 'agent', + 'hashref' => { disabled=>'' }, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, + }); } %> |