@@ -, +, @@
password expiration dates
---
.../prog/en/modules/tools/modborrowers.tt | 14 ++++++++++++++
tools/modborrowers.pl | 10 ++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
@@ -221,6 +221,9 @@
Mobile |
Registration date |
Expiry date |
+ [% IF CanUpdatePasswordExpiration %]
+ Password expiration date |
+ [% END %]
Circulation note |
OPAC note |
Restriction expiration |
@@ -257,6 +260,15 @@
[% borrower.mobile | html %] |
[% borrower.dateenrolled | $KohaDates %] |
[% borrower.dateexpiry | $KohaDates %] |
+ [% IF CanUpdatePasswordExpiration %]
+ [% IF borrower.password_expiration_date %]
+
+ [% borrower.password_expiration_date | $KohaDates %]
+ |
+ [% ELSE %]
+ Never |
+ [% END %]
+ [% END %]
[% borrower.borrowernotes | html %] |
[% borrower.opacnote | html %] |
[% borrower.debarred | $KohaDates %] |
@@ -334,6 +346,8 @@
Restriction expiration:
[% CASE 'debarredcomment' %]
Restriction comment:
+ [% CASE 'password_expiration_date' %]
+ Password expiration date:
[% END %]
[% IF ( field.type == 'text' ) %]
--- a/tools/modborrowers.pl
+++ a/tools/modborrowers.pl
@@ -50,6 +50,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
+$template->param( CanUpdatePasswordExpiration => 1 ) if $logged_in_user->is_superlibrarian;
+
my %cookies = parse CGI::Cookie($cookie);
my $sessionID = $cookies{'CGISESSID'}->value;
my $dbh = C4::Context->dbh;
@@ -328,6 +330,8 @@ if ( $op eq 'show' ) {
},
);
+ push @fields, { name => "password_expiration_date", type => "date" } if $logged_in_user->is_superlibrarian;
+
$template->param('patron_attributes_codes', \@patron_attributes_codes);
$template->param('patron_attributes_values', \@patron_attributes_values);
@@ -339,16 +343,18 @@ if ( $op eq 'do' ) {
my @disabled = $input->multi_param('disable_input');
my $infos;
- 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/ ) {
+ 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/ ) {
my $value = $input->param($field);
$infos->{$field} = $value if $value;
$infos->{$field} = "" if grep { $_ eq $field } @disabled;
}
- for my $field ( qw( dateenrolled dateexpiry debarred ) ) {
+ for my $field ( qw( dateenrolled dateexpiry debarred password_expiration_date ) ) {
$infos->{$field} = dt_from_string($infos->{$field}) if $infos->{$field};
}
+ delete $infos->{password_expiration_date} unless $logged_in_user->is_superlibrarian;
+
my @attributes = $input->multi_param('patron_attributes');
my @attr_values = $input->multi_param('patron_attributes_value');
--