Bugzilla – Attachment 189370 Details for
Bug 34069
Add ability to restore a recently deleted borrower from deletedborrowers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34069: Add restore_deleted_borrowers permission and new system preference
Bug-34069-Add-restoredeletedborrowers-permission-a.patch (text/plain), 6.58 KB, created by
Lucas Gass (lukeg)
on 2025-11-07 20:22:05 UTC
(
hide
)
Description:
Bug 34069: Add restore_deleted_borrowers permission and new system preference
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-11-07 20:22:05 UTC
Size:
6.58 KB
patch
obsolete
>From 9d585304136f4237b7e454bc0ec679ffb3a05c73 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 22 Oct 2025 15:18:34 +0000 >Subject: [PATCH] Bug 34069: Add restore_deleted_borrowers permission and new > system preference > >--- > .../data/mysql/atomicupdate/bug_34069.pl | 22 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../prog/en/includes/permissions.inc | 3 +++ > .../en/modules/admin/preferences/patrons.pref | 7 ++++++ > t/Koha/Auth/Permissions.t | 1 + > 6 files changed, 35 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_34069.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_34069.pl b/installer/data/mysql/atomicupdate/bug_34069.pl >new file mode 100755 >index 00000000000..8d35866e136 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_34069.pl >@@ -0,0 +1,22 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "34069", >+ description => "Add new permission restore_deleted_borrowers", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{INSERT IGNORE permissions (module_bit, code, description) VALUES (13, 'restore_deleted_borrowers', 'Restore deleted patrons')} >+ ); >+ say_success( $out, "Added new permission 'restore_deleted_borrowers'" ); >+ >+ $dbh->do( >+ q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AllowDeletedPatronRestoration','0',NULL,'If enabled, allows for the restoration of deleted borrowers from the deletedborrowers table','YesNo')} >+ ); >+ >+ say_success( $out, "Added new system preference 'AllowDeletedPatronRestoration'" ); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index b47f27df977..0dfbb8c541d 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -29,6 +29,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('AllFinesNeedOverride','1','0','If on, staff will be asked to override every fine, even if it is below noissuescharge.','YesNo'), > ('AllowAllMessageDeletion','0','','Allow any Library to delete any message','YesNo'), > ('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'), >+('AllowDeletedPatronRestoration', '0', NULL, 'If enabled, allows for the restoration of deleted borrowers from the deletedborrowers table','YesNo'), > ('AllowFineOverride','0','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','YesNo'), > ('AllowHoldDateInFuture','0','','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','YesNo'), > ('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'), >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 34b868d2d53..a95fb103512 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -130,6 +130,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > (13, 'records_batchmod', 'Perform batch modification of records (biblios or authorities)'), > (13, 'marc_modification_templates', 'Manage marc modification templates'), > (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), >+ (13, 'restore_deleted_borrowers', 'Restore deleted patrons'), > (13, 'access_files', 'Access to the files stored on the server'), > (13, 'upload_general_files', 'Upload any file'), > (13, 'upload_manage', 'Manage uploaded files'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index e98875fc4e6..22c91108d16 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -248,6 +248,9 @@ > [%- CASE 'send_messages_to_borrowers' -%] > <span class="sub_permission send_messages_to_borrowers_subpermission"> Send messages to patrons </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'restore_deleted_borrowers' -%] >+ <span class="sub_permission restore_deleted_borrowers_subpermission"> Restore deleted patrons </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'modify_holds_priority' -%] > <span class="sub_permission modify_holds_priority_subpermission"> Modify holds priority </span> > <span class="permissioncode">([% name | html %])</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 533578e5b5b..0cc754bda91 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -448,6 +448,13 @@ Patrons: > - days and remove anonymized patron accounts after > - pref: PatronRemovalDelay > - "days.<br>IMPORTANT: No action is performed when these delays are empty (no text). But a zero value ('0') is interpreted as no delay (do it now)! The actions are performed by the cleanup database cron job." >+ - >+ - pref: AllowDeletedPatronRestoration >+ choices: >+ 1: "Allow" >+ 0: "Don't allow" >+ - 'for the restoration of deleted borrowers from the deletedborrowers table.' >+ Security: > - > - pref: CookieConsent > choices: >diff --git a/t/Koha/Auth/Permissions.t b/t/Koha/Auth/Permissions.t >index ed684c2ffcd..fa869c63314 100755 >--- a/t/Koha/Auth/Permissions.t >+++ b/t/Koha/Auth/Permissions.t >@@ -131,6 +131,7 @@ subtest 'superlibrarian tests' => sub { > 'CAN_user_borrowers_edit_borrowers' => 1, > 'CAN_user_borrowers_list_borrowers' => 1, > 'CAN_user_borrowers_api_validate_password' => 1, >+ 'CAN_user_borrowers_restore_deleted_borrowers' => 1, > 'CAN_user_borrowers_view_borrower_infos_from_any_libraries' => 1, > 'CAN_user_borrowers' => 1, > 'CAN_user_cash_management_anonymous_refund' => 1, >-- >2.39.5
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 34069
:
188299
|
188302
|
188988
|
188989
|
188990
|
189027
|
189028
|
189029
|
189030
|
189037
|
189066
|
189067
|
189370
|
189371
|
189372
|
189373
|
189374
|
189375
|
189376
|
189377
|
189642
|
189645
|
189718
|
189773
|
189774
|
189779
|
189780
|
189781
|
189782
|
189783
|
189784
|
189785
|
189786
|
189787
|
189788
|
189789
|
189790
|
189791
|
189792
|
189793
|
189794
|
189795
|
189940
|
189941
|
189942
|
189943
|
189944
|
189945
|
189946
|
189947
|
189948
|
189949
|
189950
|
189951
|
189952
|
189953
|
189954