proper use of date_format config for international date formats, RT#7009
[freeside.git] / httemplate / edit / cust_main / top_misc.html
1 <% &ntable("#cccccc") %>
2
3 %# agent
4 <% include('/elements/tr-select-agent.html', 
5               'curr_value'    => $cust_main->agentnum,
6               'label'         => "<B>${r}Agent</B>",
7               'empty_label'   => 'Select agent',
8               'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ),
9            )
10 %>
11
12 %# agent_custid
13 % if ( $conf->exists('cust_main-edit_agent_custid') ) {
14
15     <TR>
16       <TD ALIGN="right">Customer identifier</TD>
17       <TD><INPUT TYPE="text" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>"></TD>
18     </TR>
19
20 % } else {
21
22     <INPUT TYPE="hidden" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>">
23
24 % }
25
26 %# referral (advertising source)
27 %my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
28 %if ( $custnum && ! $conf->exists('editreferrals') ) {
29
30   <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
31
32 % } else { 
33
34    <% include('/elements/tr-select-part_referral.html',
35                 'curr_value' => $refnum
36              )
37    %>
38 % } 
39
40
41 %# referring customer
42 %my $referring_cust_main = '';
43 %if ( $cust_main->referral_custnum
44 %     and $referring_cust_main =
45 %           qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
46 %     and ! $curuser->access_right('Edit referring customer')
47 %) {
48
49   <TR>
50     <TD ALIGN="right">Referring customer</TD>
51     <TD>
52       <A HREF="<% popurl(1) %>/cust_main.cgi?<% $cust_main->referral_custnum %>"><% $cust_main->referral_custnum %>: <% $referring_cust_main->name %></A>
53     </TD>
54   </TR>
55   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<% $cust_main->referral_custnum %>">
56
57 % } elsif ( ! $conf->exists('disable_customer_referrals') ) { 
58
59   <TR>
60     <TD ALIGN="right">Referring customer</TD>
61     <TD>
62       <!-- <INPUT TYPE="text" NAME="referral_custnum" VALUE=""> -->
63       <% include('/elements/search-cust_main.html',
64                     'field_name' => 'referral_custnum',
65                     'curr_value' => $cust_main->referral_custnum,
66                  )
67       %>
68     </TD>
69   </TR>
70
71 % } else { 
72   <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">
73 % } 
74
75 %# signup date
76 % if ( $conf->exists('cust_main-edit_signupdate') ) {
77     <% include('/elements/tr-input-date-field.html', {
78                   'name'        => 'signupdate',
79                   'value'       => $cust_main->signupdate,
80                   'label'       => 'Signup date',
81                   'format'      => $conf->config('date_format') || "%m/%d/%Y",
82               })
83     %>
84 % }
85
86 </TABLE>
87
88 <%init>
89
90 my( $cust_main, %opt ) = @_;
91
92 my $custnum = $opt{'custnum'};
93
94 my $conf = new FS::Conf;
95
96 my $curuser = $FS::CurrentUser::CurrentUser;
97
98 my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
99
100 </%init>