Lines 169-176
if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' )
Link Here
|
169 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
169 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
170 |
next unless exists $newdata{$_}; |
170 |
next unless exists $newdata{$_}; |
171 |
my $userdate = $newdata{$_} or next; |
171 |
my $userdate = $newdata{$_} or next; |
172 |
if ( $userdate ) { |
172 |
|
173 |
$newdata{$_} = output_pref({ dt => dt_from_string( $userdate ), dateformat => 'iso', dateonly => 1 }); |
173 |
my $formatteddate = eval { output_pref({ dt => dt_from_string( $userdate ), dateformat => 'iso', dateonly => 1 } ); }; |
|
|
174 |
if ( $formatteddate ) { |
175 |
$newdata{$_} = $formatteddate; |
176 |
} else { |
177 |
($userdate eq '0000-00-00') and warn "Data error: $_ is '0000-00-00'"; |
178 |
$template->param( "ERROR_$_" => 1 ); |
179 |
push(@errors,"ERROR_$_"); |
174 |
} |
180 |
} |
175 |
} |
181 |
} |
176 |
# check permission to modify login info. |
182 |
# check permission to modify login info. |
Lines 646-652
if (C4::Context->preference('uppercasesurnames')) {
Link Here
|
646 |
|
652 |
|
647 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
653 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
648 |
if ( $data{$_} ) { |
654 |
if ( $data{$_} ) { |
649 |
$data{$_} = output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 }); # back to syspref for display |
655 |
$data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); }; # back to syspref for display |
650 |
} |
656 |
} |
651 |
$template->param( $_ => $data{$_}); |
657 |
$template->param( $_ => $data{$_}); |
652 |
} |
658 |
} |
653 |
- |
|
|