summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorivan <ivan>2010-07-23 00:11:51 +0000
committerivan <ivan>2010-07-23 00:11:51 +0000
commit75a2e8dbba40070ced5503457696baf5d538b953 (patch)
tree563215b9d65d2b9e60da25bc7100470899281f10 /httemplate/elements
parent8c2973184d9e8e357f433b7380c7884454cc0293 (diff)
'View customers of all agents' doesn't mean create them, or upload inventory, RT#7010
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/tr-select-agent.html33
1 files changed, 30 insertions, 3 deletions
diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html
index fcfa9f300..9f2f76a6c 100644
--- a/httemplate/elements/tr-select-agent.html
+++ b/httemplate/elements/tr-select-agent.html
@@ -1,3 +1,27 @@
+<%doc>
+
+Example:
+
+ include( '/elements/tr-select-agent.html',
+
+ #recommended to keep things "sticky" on errors
+ 'curr_value' => $curr_value,
+
+ ##
+ # optional
+ ##
+
+ 'label' => 'Agent for this thing',
+ 'empty_label' => 'Select agent', #override default
+ 'disable_empty' => 1,
+
+ #set to 'None' or something to override default of showing all agents
+ #for employees w/ 'View customers of all agents' right
+ viewall_right => 'None',
+
+ );
+
+</%doc>
% if ( scalar(@agents) == 1 ) {
<INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'agentnum' %>" VALUE="<% $agents[0]->agentnum %>">
@@ -26,8 +50,11 @@
my %opt = @_;
my $agentnum = $opt{'curr_value'} || $opt{'value'};
-my @agents = $opt{'agents'}
- ? @{ $opt{'agents'} }
- : $FS::CurrentUser::CurrentUser->agents;
+my @agents =
+ $opt{'agents'}
+ ? @{ $opt{'agents'} }
+ : $FS::CurrentUser::CurrentUser->agents(
+ 'viewall_right' => $opt{'viewall_right'},
+ );
</%init>