Bugzilla – Attachment 130553 Details for
Bug 29926
Add ability for superlibrarians to edit password expiration dates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29926: Add ability for superlibrarians to batch edit password expiration dates
Bug-29926-Add-ability-for-superlibrarians-to-batch.patch (text/plain), 6.07 KB, created by
Nick Clemens (kidclamp)
on 2022-02-14 16:41:38 UTC
(
hide
)
Description:
Bug 29926: Add ability for superlibrarians to batch edit password expiration dates
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-02-14 16:41:38 UTC
Size:
6.07 KB
patch
obsolete
>From d6657f467b349bc5bfa459688af9de80690da21c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 14 Feb 2022 16:34:23 +0000 >Subject: [PATCH] Bug 29926: Add ability for superlibrarians to batch edit > password expiration dates > >To test: >1 - Sign in as a superlibrarian >2 - Tools->Batch patron modification >3 - Add patrons with and without pasword expiration set >4 - Confirm dates display correctly on modification page, or show never >5 - Check the box to delete all dates >6 - Confirm patrons now show 'Never' >7 - Edit patrons again, set a date >8 - Confirm date is set correctly >9 - Sign in as a user with catalogue/tools/borrowers permissions, but not superlibrarian >10 - Confirm y9ou do not see, and cannnot edit password expiration dates >--- > .../prog/en/modules/tools/modborrowers.tt | 14 ++++++++++++++ > tools/modborrowers.pl | 10 ++++++++-- > 2 files changed, 22 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index f60a917a9b..c21371f04b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -221,6 +221,9 @@ > <th>Mobile</th> > <th>Registration date</th> > <th>Expiry date</th> >+ [% IF CanUpdatePasswordExpiration %] >+ <th>Password expiration date</th> >+ [% END %] > <th>Circulation note</th> > <th>OPAC note</th> > <th>Restriction expiration</th> >@@ -257,6 +260,15 @@ > <td>[% borrower.mobile | html %]</td> > <td data-order="[% borrower.dateenrolled | html %]">[% borrower.dateenrolled | $KohaDates %]</td> > <td data-order="[% borrower.dateexpiry | html %]">[% borrower.dateexpiry | $KohaDates %]</td> >+ [% IF CanUpdatePasswordExpiration %] >+ [% IF borrower.password_expiration_date %] >+ <td data-order="[% borrower.password_expiration_date | html %]"> >+ [% borrower.password_expiration_date | $KohaDates %] >+ </td> >+ [% ELSE %] >+ <td data-order="9999-99-99">Never</td> >+ [% END %] >+ [% END %] > <td>[% borrower.borrowernotes | html %]</td> > <td>[% borrower.opacnote | html %]</td> > <td data-order="[% borrower.debarred | html %]">[% borrower.debarred | $KohaDates %]</td> >@@ -334,6 +346,8 @@ > Restriction expiration: > [% CASE 'debarredcomment' %] > Restriction comment: >+ [% CASE 'password_expiration_date' %] >+ Password expiration date: > [% END %] > </label> > [% IF ( field.type == 'text' ) %] >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index 769c9a4738..55495a1a48 100755 >--- a/tools/modborrowers.pl >+++ b/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'); > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29926
:
130551
|
130552
|
130553
|
130686
|
130687
|
130688
|
133759
|
133760
|
133761
|
133887
|
133888
|
133889
|
133890
|
133891