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