|
Lines 170-177
if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' )
Link Here
|
| 170 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
170 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
| 171 |
next unless exists $newdata{$_}; |
171 |
next unless exists $newdata{$_}; |
| 172 |
my $userdate = $newdata{$_} or next; |
172 |
my $userdate = $newdata{$_} or next; |
| 173 |
if ( $userdate ) { |
173 |
|
| 174 |
$newdata{$_} = output_pref({ dt => dt_from_string( $userdate ), dateformat => 'iso', dateonly => 1 }); |
174 |
my $formatteddate = eval { output_pref({ dt => dt_from_string( $userdate ), dateformat => 'iso', dateonly => 1 } ); }; |
|
|
175 |
if ( $formatteddate ) { |
| 176 |
$newdata{$_} = $formatteddate; |
| 177 |
} else { |
| 178 |
($userdate eq '0000-00-00') and warn "Data error: $_ is '0000-00-00'"; |
| 179 |
$template->param( "ERROR_$_" => 1 ); |
| 180 |
push(@errors,"ERROR_$_"); |
| 175 |
} |
181 |
} |
| 176 |
} |
182 |
} |
| 177 |
# check permission to modify login info. |
183 |
# check permission to modify login info. |
|
Lines 660-666
if (C4::Context->preference('uppercasesurnames')) {
Link Here
|
| 660 |
|
666 |
|
| 661 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
667 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
| 662 |
if ( $data{$_} ) { |
668 |
if ( $data{$_} ) { |
| 663 |
$data{$_} = output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 }); # back to syspref for display |
669 |
$data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); }; # back to syspref for display |
| 664 |
} |
670 |
} |
| 665 |
$template->param( $_ => $data{$_}); |
671 |
$template->param( $_ => $data{$_}); |
| 666 |
} |
672 |
} |
| 667 |
- |
|
|