This commit was manufactured by cvs2svn to create tag 'freeside_2_1_1'.
[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 <% include('/elements/tr-select-agent.html', 
12               'curr_value'    => $cust_main->agentnum,
13               'label'         => "<B>${r}Agent</B>",
14               'empty_label'   => 'Select agent',
15               'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ),
16               'viewall_right' => 'None', #override default 'View customers of all agents'
17            )
18 %>
19
20 %# agent_custid
21 % if ( $conf->exists('cust_main-edit_agent_custid') ) {
22
23     <TR>
24       <TD ALIGN="right">Customer identifier</TD>
25       <TD><INPUT TYPE="text" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>"></TD>
26     </TR>
27
28 % } else {
29
30     <INPUT TYPE="hidden" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>">
31
32 % }
33
34 %# class
35 <% include('/elements/tr-select-cust_class.html',
36              'curr_value'  => $cust_main->classnum,
37              'label'       => "Class",
38              #'empty_label' => '(none)',
39              #'disable_empty' => 
40           )
41 %>
42
43 %# referral (advertising source)
44 %my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
45 %if ( $custnum && ! $conf->exists('editreferrals') ) {
46
47   <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
48
49 % } else { 
50
51    <% include('/elements/tr-select-part_referral.html',
52                 'curr_value' => $refnum
53              )
54    %>
55 % } 
56
57
58 %# referring customer
59 %my $referring_cust_main = '';
60 %if ( $cust_main->referral_custnum
61 %     and $referring_cust_main =
62 %           qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
63 %     and ! $curuser->access_right('Edit referring customer')
64 %) {
65
66   <TR>
67     <TD ALIGN="right">Referring customer</TD>
68     <TD>
69       <A HREF="<% popurl(1) %>/cust_main.cgi?<% $cust_main->referral_custnum %>"><% $cust_main->referral_custnum %>: <% $referring_cust_main->name %></A>
70     </TD>
71   </TR>
72   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<% $cust_main->referral_custnum %>">
73
74 % } elsif ( ! $conf->exists('disable_customer_referrals') ) { 
75
76   <TR>
77     <TD ALIGN="right">Referring customer</TD>
78     <TD>
79       <!-- <INPUT TYPE="text" NAME="referral_custnum" VALUE=""> -->
80       <% include('/elements/search-cust_main.html',
81                     'field_name' => 'referral_custnum',
82                     'curr_value' => $cust_main->referral_custnum,
83                  )
84       %>
85     </TD>
86   </TR>
87
88 % } else { 
89   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">
90 % } 
91
92 %# signup date
93 % if ( $conf->exists('cust_main-edit_signupdate') ) {
94     <% include('/elements/tr-input-date-field.html', {
95                   'name'        => 'signupdate',
96                   'value'       => $cust_main->signupdate,
97                   'label'       => 'Signup date',
98                   'format'      => ( $conf->config('date_format') || "%m/%d/%Y" ),
99               })
100     %>
101 % }
102
103 </TABLE>
104
105 <%init>
106
107 my( $cust_main, %opt ) = @_;
108
109 my $custnum = $opt{'custnum'};
110
111 my $conf = new FS::Conf;
112
113 my $curuser = $FS::CurrentUser::CurrentUser;
114
115 my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
116
117 </%init>