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