Bugzilla – Attachment 133761 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.11 KB, created by
Nick Clemens (kidclamp)
on 2022-04-25 12:05:29 UTC
(
hide
)
Description:
Bug 29926: Add ability for superlibrarians to batch edit password expiration dates
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-04-25 12:05:29 UTC
Size:
6.11 KB
patch
obsolete
>From 8e789da6dace1076dc139d5ce29c735f999ad3d9 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 > >Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> >--- > .../prog/en/modules/tools/modborrowers.tt | 13 +++++++++++++ > tools/modborrowers.pl | 10 ++++++++-- > 2 files changed, 21 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 1a69521b97..aae7fa29df 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> >@@ -312,6 +324,7 @@ > [% CASE 'opacnote' %]<span>OPAC note:</span> > [% CASE 'debarred' %]<span>Restriction expiration:</span> > [% CASE 'debarredcomment' %]<span>Restriction comment:</span> >+ [% CASE 'password_expiration_date' %]<span>Password expiration date:</span> > [% END %] > </label> > [% IF ( field.type == 'text' ) %] >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index 8aed3f4b4b..bb35b8e1c0 100755 >--- a/tools/modborrowers.pl >+++ b/tools/modborrowers.pl >@@ -51,6 +51,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 $dbh = C4::Context->dbh; > > # Show borrower informations >@@ -330,6 +332,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); > >@@ -341,16 +345,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