Lines 50-55
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
50 |
|
50 |
|
51 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
51 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
52 |
|
52 |
|
|
|
53 |
$template->param( CanUpdatePasswordExpiration => 1 ) if $logged_in_user->is_superlibrarian; |
54 |
|
53 |
my %cookies = parse CGI::Cookie($cookie); |
55 |
my %cookies = parse CGI::Cookie($cookie); |
54 |
my $sessionID = $cookies{'CGISESSID'}->value; |
56 |
my $sessionID = $cookies{'CGISESSID'}->value; |
55 |
my $dbh = C4::Context->dbh; |
57 |
my $dbh = C4::Context->dbh; |
Lines 328-333
if ( $op eq 'show' ) {
Link Here
|
328 |
}, |
330 |
}, |
329 |
); |
331 |
); |
330 |
|
332 |
|
|
|
333 |
push @fields, { name => "password_expiration_date", type => "date" } if $logged_in_user->is_superlibrarian; |
334 |
|
331 |
$template->param('patron_attributes_codes', \@patron_attributes_codes); |
335 |
$template->param('patron_attributes_codes', \@patron_attributes_codes); |
332 |
$template->param('patron_attributes_values', \@patron_attributes_values); |
336 |
$template->param('patron_attributes_values', \@patron_attributes_values); |
333 |
|
337 |
|
Lines 339-354
if ( $op eq 'do' ) {
Link Here
|
339 |
|
343 |
|
340 |
my @disabled = $input->multi_param('disable_input'); |
344 |
my @disabled = $input->multi_param('disable_input'); |
341 |
my $infos; |
345 |
my $infos; |
342 |
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/ ) { |
346 |
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/ ) { |
343 |
my $value = $input->param($field); |
347 |
my $value = $input->param($field); |
344 |
$infos->{$field} = $value if $value; |
348 |
$infos->{$field} = $value if $value; |
345 |
$infos->{$field} = "" if grep { $_ eq $field } @disabled; |
349 |
$infos->{$field} = "" if grep { $_ eq $field } @disabled; |
346 |
} |
350 |
} |
347 |
|
351 |
|
348 |
for my $field ( qw( dateenrolled dateexpiry debarred ) ) { |
352 |
for my $field ( qw( dateenrolled dateexpiry debarred password_expiration_date ) ) { |
349 |
$infos->{$field} = dt_from_string($infos->{$field}) if $infos->{$field}; |
353 |
$infos->{$field} = dt_from_string($infos->{$field}) if $infos->{$field}; |
350 |
} |
354 |
} |
351 |
|
355 |
|
|
|
356 |
delete $infos->{password_expiration_date} unless $logged_in_user->is_superlibrarian; |
357 |
|
352 |
my @attributes = $input->multi_param('patron_attributes'); |
358 |
my @attributes = $input->multi_param('patron_attributes'); |
353 |
my @attr_values = $input->multi_param('patron_attributes_value'); |
359 |
my @attr_values = $input->multi_param('patron_attributes_value'); |
354 |
|
360 |
|
355 |
- |
|
|