4.x styling customer edit cleanup
[freeside.git] / httemplate / edit / cust_main / stateid.html
1 % if ( $conf->exists('show_stateid') ) {
2 <TR>
3   <TH ALIGN="right"><% $stateid_label %></TH>
4   <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>" SIZE=12></TD>
5   <TD><& /elements/select-state.html,
6           state   => $cust_main->stateid_state,
7           country => $cust_main->country, # how does this work on new customer?
8           prefix  => 'stateid_',
9           disable_countyupdate => 1,
10       &></TD>
11 </TR>
12 % } else {
13 <INPUT TYPE="hidden" NAME="stateid" VALUE="<% $stateid %>">
14 <INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $cust_main->stateid_state %>">
15 % }
16
17 <%init>
18 my $cust_main = shift;
19 my $conf = FS::Conf->new;
20 my $stateid;
21 if ( $cgi->param('error') ) {
22   $stateid = $cust_main->stateid;
23 } elsif ( $cust_main->custnum ) {
24   $stateid = $cust_main->masked('stateid');
25 } else {
26   $stateid = '';
27 }
28 $cust_main->set('stateid_state' => $cust_main->state) 
29   unless $cust_main->stateid_state;
30
31 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
32                   ? 'Driver&rsquo;s License'
33                   : FS::Msgcat::_gettext('stateid') || 'Driver&rsquo;s License';
34
35 my $stateid_state_label = 
36                   FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
37                   ? 'Driver&rsquo;s License State'
38                   : FS::Msgcat::_gettext('stateid') || 'Driver&rsquo;s License State';
39 </%init>