RT# 21110 - fixed bad link on license.html
[freeside.git] / httemplate / elements / tr-select-agent-sales.html
1 <%doc>
2
3 Example:
4
5   <& /elements/tr-select-agent-sales.html,
6        'agent_empty_label'   => '(any)', #defaults to "all"
7        'sales_disable_empty' => 1,       #defaults with empty enabled
8   &>
9
10 </%doc>
11 % if ( $curuser->report_salesnum ) {
12
13     <INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $curuser->report_sales->agentnum %>">
14     <INPUT TYPE="hidden" NAME="salesnum" VALUE="<% $curuser->report_salesnum %>">
15
16 % } else {
17
18     <& /elements/tr-select-agent.html,
19          'onchange'      => 'agent_changed(this)',
20          'empty_label'   => $opt{agent_empty_label},
21     &>
22
23     <SCRIPT TYPE="text/javascript">
24
25       function agent_changed(what) {
26         salesnum_agentnum_changed(what);
27       }
28
29       <&| /elements/onload.js &>
30       agent_changed(document.getElementById('agentnum'))
31       </&>
32
33     </SCRIPT>
34
35     <& /elements/tr-select-sales.html,
36         'empty_label'   => 'all',
37         'disable_empty' => $opt{sales_disable_empty},
38     &>
39
40 % }
41 <%init>
42
43 my %opt = @_;
44
45 my $curuser = $FS::CurrentUser::CurrentUser;
46
47 </%init>