5 include( '/elements/tr-select-agent.html',
7 #recommended to keep things "sticky" on errors
8 'curr_value' => $curr_value,
14 'label' => 'Agent for this thing',
15 'empty_label' => 'Select agent', #override default
18 #set to 'None' or something to override default of showing all agents
19 #for employees w/ 'View customers of all agents' right
20 viewall_right => 'None',
25 % if ( scalar(@agents) == 1 || $opt{'fixed'} ) {
27 <INPUT TYPE = "hidden"
28 NAME = "<% $opt{'field'} || 'agentnum' %>"
29 ID = "<% $opt{'field'} || 'agentnum' %>"
30 VALUE = "<% $agents[0]->agentnum %>"
33 % if ( scalar(@agents) != 1 ) {
35 <TD ALIGN="right"><% $opt{'label'} || emt('Agent') %></TD>
36 <TD BGCOLOR="#dddddd" <% $colspan %>>
37 % my $agent = qsearchs('agent', { 'agentnum' => $agentnum });
38 <% $agent ? $agent->agent : '(all)' |h %>
42 % } else { # YUCK. empty row so we don't throw g_row in edit.html off :/
50 <TD ALIGN="right"><% $opt{'label'} || emt('Agent') %></TD>
52 <& /elements/select-agent.html,
53 'curr_value' => $agentnum,
65 my $agentnum = $opt{'curr_value'} || $opt{'value'};
70 : $FS::CurrentUser::CurrentUser->agents(
71 'viewall_right' => $opt{'viewall_right'},
74 my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : '';