summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_main/stateid.html
blob: 0f288099bd7ee78749a66de0ce1047b461cce5dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% if ( $conf->exists('show_stateid') ) {
<TR>
  <TH ALIGN="right"><% $stateid_label %></TH>
  <TD>
    <INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>" SIZE=12 ID="stateid">
% if ( $stateid && $FS::CurrentUser::CurrentUser->access_right( 'Unmask customer DL' )) {
    <& /elements/link-replace_element_text.html, {target_id => 'stateid', replace_text => $cust_main->stateid} &>
% }
  </TD>
  <TD><& /elements/select-state.html,
          state   => $cust_main->stateid_state,
          country => $cust_main->country, # how does this work on new customer?
          prefix  => 'stateid_',
          disable_countyupdate => 1,
      &></TD>
</TR>
% } else {
<INPUT TYPE="hidden" NAME="stateid" VALUE="<% $stateid %>">
<INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $cust_main->stateid_state %>">
% }

<%init>
my $cust_main = shift;
my $conf = FS::Conf->new;
my $stateid;
if ( $cgi->param('error') ) {
  $stateid = $cust_main->stateid;
} elsif ( $cust_main->custnum ) {
  $stateid = $cust_main->masked('stateid');
} else {
  $stateid = '';
}
$cust_main->set('stateid_state' => $cust_main->state) 
  unless $cust_main->stateid_state;

my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
                  ? 'Driver&rsquo;s License'
                  : FS::Msgcat::_gettext('stateid') || 'Driver&rsquo;s License';

my $stateid_state_label = 
                  FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
                  ? 'Driver&rsquo;s License State'
                  : FS::Msgcat::_gettext('stateid') || 'Driver&rsquo;s License State';
</%init>