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