Lines 92-97
my @errors;
Link Here
|
92 |
my $borrower_data; |
92 |
my $borrower_data; |
93 |
my $NoUpdateLogin; |
93 |
my $NoUpdateLogin; |
94 |
my $NoUpdateEmail; |
94 |
my $NoUpdateEmail; |
|
|
95 |
my $CanUpdatePasswordExpiration; |
95 |
my $userenv = C4::Context->userenv; |
96 |
my $userenv = C4::Context->userenv; |
96 |
my @messages; |
97 |
my @messages; |
97 |
|
98 |
|
Lines 166-171
if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) {
Link Here
|
166 |
if ( $patron->is_superlibrarian && !$logged_in_user->is_superlibrarian ) { |
167 |
if ( $patron->is_superlibrarian && !$logged_in_user->is_superlibrarian ) { |
167 |
$NoUpdateEmail = 1; |
168 |
$NoUpdateEmail = 1; |
168 |
} |
169 |
} |
|
|
170 |
if ($logged_in_user->is_superlibrarian) { |
171 |
$CanUpdatePasswordExpiration = 1; |
172 |
} |
169 |
|
173 |
|
170 |
$borrower_data = $patron->unblessed; |
174 |
$borrower_data = $patron->unblessed; |
171 |
$borrower_data->{category_type} = $patron->category->category_type; |
175 |
$borrower_data->{category_type} = $patron->category->category_type; |
Lines 194-200
if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' )
Link Here
|
194 |
} |
198 |
} |
195 |
} |
199 |
} |
196 |
|
200 |
|
197 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
201 |
foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) { |
198 |
next unless exists $newdata{$_}; |
202 |
next unless exists $newdata{$_}; |
199 |
my $userdate = $newdata{$_} or next; |
203 |
my $userdate = $newdata{$_} or next; |
200 |
|
204 |
|
Lines 244-249
if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' )
Link Here
|
244 |
qr/^delete_guarantor$/, |
248 |
qr/^delete_guarantor$/, |
245 |
); |
249 |
); |
246 |
push @keys_to_delete, map { qr/^$_$/ } split( /\s*\|\s*/, C4::Context->preference('BorrowerUnwantedField') || q{} ); |
250 |
push @keys_to_delete, map { qr/^$_$/ } split( /\s*\|\s*/, C4::Context->preference('BorrowerUnwantedField') || q{} ); |
|
|
251 |
push @keys_to_delete, qr/^password_expiration_date$/ unless $CanUpdatePasswordExpiration; |
247 |
for my $regexp (@keys_to_delete) { |
252 |
for my $regexp (@keys_to_delete) { |
248 |
for (keys %newdata) { |
253 |
for (keys %newdata) { |
249 |
delete($newdata{$_}) if /$regexp/; |
254 |
delete($newdata{$_}) if /$regexp/; |
Lines 790-796
if (C4::Context->preference('uppercasesurnames')) {
Link Here
|
790 |
$data{'contactname'} &&= uc( $data{'contactname'} ); |
795 |
$data{'contactname'} &&= uc( $data{'contactname'} ); |
791 |
} |
796 |
} |
792 |
|
797 |
|
793 |
foreach (qw(dateenrolled dateexpiry dateofbirth)) { |
798 |
foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) { |
794 |
if ( $data{$_} ) { |
799 |
if ( $data{$_} ) { |
795 |
$data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); }; # back to syspref for display |
800 |
$data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); }; # back to syspref for display |
796 |
} |
801 |
} |
Lines 837-842
$template->param(
Link Here
|
837 |
nok => $nok,#flag to know if an error |
842 |
nok => $nok,#flag to know if an error |
838 |
NoUpdateLogin => $NoUpdateLogin, |
843 |
NoUpdateLogin => $NoUpdateLogin, |
839 |
NoUpdateEmail => $NoUpdateEmail, |
844 |
NoUpdateEmail => $NoUpdateEmail, |
|
|
845 |
CanUpdatePasswordExpiration => $CanUpdatePasswordExpiration, |
840 |
); |
846 |
); |
841 |
|
847 |
|
842 |
# Generate CSRF token |
848 |
# Generate CSRF token |
843 |
- |
|
|