internationalization/localization, RT12515
[freeside.git] / httemplate / edit / cust_main / top_misc.html
1 <% &ntable("#cccccc") %>
2
3 %# tags
4 <& /elements/tr-select-cust_tag.html,
5              'custnum' => $custnum,
6              'cgi'     => $cgi,
7 &>
8
9 %# agent
10 % if ( $cgi->param('lock_agentnum') =~ /^(\d+)$/ && $curuser->agentnum($1) ) {
11 %
12 %   my $agentnum = $1;
13 %   $cust_main->agentnum($agentnum);
14
15     <INPUT TYPE="hidden" NAME="lock_agentnum" VALUE="<% $agentnum %>">
16     <INPUT TYPE="hidden" NAME="agentnum"      VALUE="<% $agentnum %>">
17     <TR>
18       <TD ALIGN="right"><% mt('Agent') |h %></TD>
19       <TD CLASS="fsdisabled"><% $cust_main->agent->agent |h %></TD>
20     </TR>
21  
22 % } else {
23
24   <& /elements/tr-select-agent.html, 
25                 'curr_value'    => $cust_main->agentnum,
26                 'label'         => "<B>${r}".emt('Agent')."</B>",
27                 'empty_label'   => emt('Select agent'),
28                 'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ),
29                 'viewall_right' => emt('None'), 
30   &>
31
32 % }
33
34 %# agent_custid
35 % if ( $conf->exists('cust_main-edit_agent_custid') ) {
36
37     <TR>
38       <TD ALIGN="right"><% mt('Customer identifier') |h %></TD>
39       <TD><INPUT TYPE="text" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>"></TD>
40     </TR>
41
42 % } else {
43
44     <INPUT TYPE="hidden" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>">
45
46 % }
47
48 %# class
49 <& /elements/tr-select-cust_class.html,
50              'curr_value'  => $cust_main->classnum,
51              'label'       => emt("Class"),
52 &>
53
54 %# referral (advertising source)
55 %my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
56 %if ( $custnum && ! $conf->exists('editreferrals') ) {
57
58   <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
59
60 % } else { 
61
62    <& /elements/tr-select-part_referral.html,
63                 'curr_value' => $refnum
64    &>
65 % } 
66
67
68 %# referring customer
69 %my $referring_cust_main = '';
70 %if ( $cust_main->referral_custnum
71 %     and $referring_cust_main =
72 %           qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
73 %     and ! $curuser->access_right('Edit referring customer')
74 %) {
75
76   <TR>
77     <TD ALIGN="right"><% mt('Referring customer') |h %></TD>
78     <TD>
79       <A HREF="<% popurl(1) %>/cust_main.cgi?<% $cust_main->referral_custnum %>"><% $cust_main->referral_custnum %>: <% $referring_cust_main->name %></A>
80     </TD>
81   </TR>
82   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<% $cust_main->referral_custnum %>">
83
84 % } elsif ( ! $conf->exists('disable_customer_referrals') ) { 
85
86   <TR>
87     <TD ALIGN="right">Referring customer</TD>
88     <TD>
89       <& /elements/search-cust_main.html,
90                     'field_name' => 'referral_custnum',
91                     'curr_value' => $cust_main->referral_custnum,
92       &>
93     </TD>
94   </TR>
95
96 % } else { 
97   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">
98 % } 
99
100 %# signup date
101 % if ( $conf->exists('cust_main-edit_signupdate') ) {
102     <& /elements/tr-input-date-field.html, {
103                   'name'        => 'signupdate',
104                   'value'       => $cust_main->signupdate,
105                   'label'       => emt('Signup date'),
106                   'format'      => ( $conf->config('date_format') || "%m/%d/%Y" ),
107               }
108     &>
109 % }
110
111 </TABLE>
112
113 <%init>
114
115 my( $cust_main, %opt ) = @_;
116
117 my $custnum = $opt{'custnum'};
118
119 my $conf = new FS::Conf;
120
121 my $curuser = $FS::CurrentUser::CurrentUser;
122
123 my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
124
125 </%init>