fix conf callback (align with v3/master), RT#25239 weirdness?
[freeside.git] / httemplate / edit / cust_main / birthdate.html
1 <% ntable("#cccccc", 2) %>
2
3 % my $id_country = $conf->config('national_id-country');
4 %  if ( $id_country ) {
5 %   if ( $id_country eq 'MY' ) {
6 %     my($old, $nric) = ( '', '');
7 %     if ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) {
8 %       $nric = $cust_main->national_id;
9 %     } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) {
10 %       $old = $cust_main->national_id;
11 %     #} else {
12 %     #  warn "unknown national_id format";
13 %#       <INPUT TYPE="hidden" NAME="national_id0" VALUE="<% $cust_main->national_id |h %>">
14 %     }
15
16       <% include( '/elements/tr-input-text.html',
17                     'field' => 'national_id1',
18                     'value' => $nric,
19                     'label' => 'NRIC',
20                 )
21       %>
22       <% include( '/elements/tr-input-text.html',
23                     'field' => 'national_id2',
24                     'value' => $old,
25                     'label' => 'Old IC/Passport',
26                 )
27       %>
28
29 %   } else {
30 %     warn "unknown national_id-country $id_country";
31 %   }
32 % }
33
34 % if ( $conf->exists('cust_main-enable_birthdate') ) {
35   <% include( '/elements/tr-input-date-field.html', {
36                 'name'        => 'birthdate',
37                 'value'       => $cust_main->birthdate,
38                 'label'       => 'Date of Birth',
39                 'format'      => ( $conf->config('date_format') || "%m/%d/%Y" ),
40                 'usedatetime' => 1,
41                 'noinit'      => $noinit++,
42             })
43   %>
44 % }
45
46 % if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
47   <% include( '/elements/tr-input-date-field.html', {
48                 'name'        => 'spouse_birthdate',
49                 'value'       => $cust_main->spouse_birthdate,
50                 'label'       => 'Spouse Date of Birth',
51                 'format'      => ( $conf->config('date_format') || "%m/%d/%Y" ),
52                 'usedatetime' => 1,
53                 'noinit'      => $noinit++,
54             })
55   %>
56 % }
57
58 % if ( $conf->exists('cust_main-enable_anniversary_date') ) {
59   <% include( '/elements/tr-input-date-field.html', {
60                 'name'        => 'anniversary_date',
61                 'value'       => $cust_main->anniversary_date,
62                 'label'       => 'Anniversary Date',
63                 'format'      => ( $conf->config('date_format') || "%m/%d/%Y" ),
64                 'usedatetime' => 1,
65                 'noinit'      => $noinit++,
66             })
67   %>
68 % }
69
70 </TABLE>
71 <%init>
72
73 my( $cust_main, %opt ) = @_;
74 my $conf = new FS::Conf;
75
76 my $noinit = 0;
77
78 </%init>