default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / cust_main / name.html
1 <%def .namepart>
2 % my ($field, $value, $label, $extra, $unmask_field) = @_;
3 <DIV STYLE="display: inline-block" ID="<% $field %>_input">
4   <INPUT TYPE="text" NAME="<% $field %>" VALUE="<% $value |h %>" <%$extra%>>
5 % if (
6 %   $value
7 %   && ref $unmask_field
8 %   && $FS::CurrentUser::CurrentUser->access_right( $unmask_field->{access_right} )
9 % ) {
10   <& /elements/link-replace_element_text.html, {
11       target_id    => $unmask_field->{target_id},
12       replace_text => $unmask_field->{replace_text},
13   } &>
14 % }
15   <BR><FONT SIZE="-1" COLOR="#333333"><% emt($label) %></FONT>
16 </DIV>
17 </%def>
18
19 <TR>
20   <TH CLASS="required label" ALIGN="right"><% mt('Contact name') |h %></TD>
21   <TD COLSPAN=6 STYLE="vertical-align:top">
22         <& .namepart, 'last', $cust_main->last, 'Last', ',' &>
23         <& .namepart, 'first', $cust_main->first, 'First' &>
24 % if ( $conf->exists('show_ss') ) {
25         &nbsp;
26         <& .namepart, 'ss', $ss, 'SS#', "SIZE=11 ID='ss'", {
27           target_id    => 'ss',
28           replace_text => $cust_main->ss,
29           access_right => 'Unmask customer SSN',
30         } &>
31 % } else  {
32         <INPUT TYPE="hidden" NAME="ss" VALUE="<% $ss %>">
33 % }
34   </TD>
35 </TR>
36 % if ( $conf->exists('cust_main-enable_spouse') ) {
37 <TR ID="spouse_row">
38   <TH CLASS="label" ALIGN="right"><DIV ID="spouse_label"><% mt('Spouse\'s name') |h %></DIV></TD>
39   <TD COLSPAN=6>
40         <& .namepart, 'spouse_last', $cust_main->spouse_last, 'Last', ',' &>
41         <& .namepart, 'spouse_first', $cust_main->spouse_first, 'First' &>
42   </TD>
43 </TR>
44 % }
45
46 <TR>
47   <TH ALIGN="right">
48     <SPAN ID="invoice_email_label" CLASS="
49     <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum)
50         ? 'required label'
51         : 'label' %>">Email address(es)</SPAN>
52   </TH>
53   <TD COLSPAN=6>
54     <INPUT TYPE="text" NAME="invoice_email"  ID="invoice_email_input" SIZE=40
55            VALUE="<% $cust_main->invoicing_list_emailonly_scalar %>">
56   </TD>
57 </TR>
58 <%init>
59 my $cust_main = shift;
60 my $agentnum = $cust_main->agentnum if $cust_main->custnum;
61 my $conf = FS::Conf->new;
62 my $ss;
63
64 if ( $cgi->param('error') ) {
65   $ss = $cust_main->ss;
66 } else {
67   $ss = $cust_main->masked('ss');
68 }
69 </%init>