Lines 51-56
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
51 |
|
51 |
|
52 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
52 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
53 |
|
53 |
|
|
|
54 |
$template->param( CanUpdatePasswordExpiration => 1 ) if $logged_in_user->is_superlibrarian; |
55 |
|
54 |
my $dbh = C4::Context->dbh; |
56 |
my $dbh = C4::Context->dbh; |
55 |
|
57 |
|
56 |
# Show borrower informations |
58 |
# Show borrower informations |
Lines 330-335
if ( $op eq 'show' ) {
Link Here
|
330 |
}, |
332 |
}, |
331 |
); |
333 |
); |
332 |
|
334 |
|
|
|
335 |
push @fields, { name => "password_expiration_date", type => "date" } if $logged_in_user->is_superlibrarian; |
336 |
|
333 |
$template->param('patron_attributes_codes', \@patron_attributes_codes); |
337 |
$template->param('patron_attributes_codes', \@patron_attributes_codes); |
334 |
$template->param('patron_attributes_values', \@patron_attributes_values); |
338 |
$template->param('patron_attributes_values', \@patron_attributes_values); |
335 |
|
339 |
|
Lines 341-356
if ( $op eq 'do' ) {
Link Here
|
341 |
|
345 |
|
342 |
my @disabled = $input->multi_param('disable_input'); |
346 |
my @disabled = $input->multi_param('disable_input'); |
343 |
my $infos; |
347 |
my $infos; |
344 |
for my $field ( qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote debarred debarredcomment/ ) { |
348 |
for my $field ( qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile sort1 sort2 dateenrolled dateexpiry password_expiration_date borrowernotes opacnote debarred debarredcomment/ ) { |
345 |
my $value = $input->param($field); |
349 |
my $value = $input->param($field); |
346 |
$infos->{$field} = $value if $value; |
350 |
$infos->{$field} = $value if $value; |
347 |
$infos->{$field} = "" if grep { $_ eq $field } @disabled; |
351 |
$infos->{$field} = "" if grep { $_ eq $field } @disabled; |
348 |
} |
352 |
} |
349 |
|
353 |
|
350 |
for my $field ( qw( dateenrolled dateexpiry debarred ) ) { |
354 |
for my $field ( qw( dateenrolled dateexpiry debarred password_expiration_date ) ) { |
351 |
$infos->{$field} = dt_from_string($infos->{$field}) if $infos->{$field}; |
355 |
$infos->{$field} = dt_from_string($infos->{$field}) if $infos->{$field}; |
352 |
} |
356 |
} |
353 |
|
357 |
|
|
|
358 |
delete $infos->{password_expiration_date} unless $logged_in_user->is_superlibrarian; |
359 |
|
354 |
my @attributes = $input->multi_param('patron_attributes'); |
360 |
my @attributes = $input->multi_param('patron_attributes'); |
355 |
my @attr_values = $input->multi_param('patron_attributes_value'); |
361 |
my @attr_values = $input->multi_param('patron_attributes_value'); |
356 |
|
362 |
|
357 |
- |
|
|