Bugzilla – Attachment 179393 Details for
Bug 37451
Restrictions due to discharge should not be able to be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37451: (follow-up) Add the syspref DischargeOverride
Bug-37451-follow-up-Add-the-syspref-DischargeOverr.patch (text/plain), 4.87 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-03-17 14:31:50 UTC
(
hide
)
Description:
Bug 37451: (follow-up) Add the syspref DischargeOverride
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-03-17 14:31:50 UTC
Size:
4.87 KB
patch
obsolete
>From 8adf6212bb4b7e0738f24c7ce174fb5d23c00143 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Mon, 17 Mar 2025 15:29:30 +0100 >Subject: [PATCH] Bug 37451: (follow-up) Add the syspref DischargeOverride > >--- > .../data/mysql/atomicupdate/bug_37451.pl | 27 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../en/includes/patron-restrictions-tab.inc | 2 +- > .../en/modules/admin/preferences/patrons.pref | 6 +++++ > 4 files changed, 35 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_37451.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_37451.pl b/installer/data/mysql/atomicupdate/bug_37451.pl >new file mode 100755 >index 00000000..bd96e0e2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_37451.pl >@@ -0,0 +1,27 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "37451", >+ description => "Add the syspref DischargeOverride", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Do you stuffs here >+ my $syspref_exists = $dbh->do( >+ "select * from systempreferences where variable = 'DischargeOverride'", undef >+ ) eq "0E0" ? '0' : '1'; >+ >+ if ($syspref_exists){ >+ say $out "System preference 'DischargeOverride' already added"; >+ } else { >+ $dbh->do(" >+ INSERT INTO systempreferences >+ (variable, value, options, explanation, type) >+ VALUES ('DischargeOverride', '', NULL, 'Allow librarians to override the discharge suspension.', 'YesNo') >+ "); >+ say $out "Added new system preference 'DischargeOverride'"; >+ } >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index c4bb3ca9..0b36bbd8 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -215,6 +215,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('DefaultToLoggedInLibraryCircRules', '0', NULL , 'If enabled, circ rules editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'), > ('DefaultToLoggedInLibraryNoticesSlips', '0', NULL , 'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'), > ('DefaultToLoggedInLibraryOverdueTriggers', '0', NULL , 'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.', 'YesNo'), >+('DischargeOverride', '', NULL, 'Allow librarians to override the discharge suspension.', "YesNo"), > ('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'), > ('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'), > ('displayFacetCount','0',NULL,NULL,'YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc >index df2a1e55..5cbd4326 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc >@@ -40,7 +40,7 @@ > <td>[% restriction.created | $KohaDates %]</td> > [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] > <td> >- [% IF restriction.type.code != "DISCHARGE" %] >+ [% IF restriction.type.code != "DISCHARGE" || Koha.Preference("DischargeOverride") %] > <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl"> > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-del" /> >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 671b4f4d..71968c1b 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 >@@ -92,6 +92,12 @@ Patrons: > 1: Allow > 0: "Don't allow" > - librarians to discharge borrowers and borrowers to request a discharge. >+ - >+ - pref: DischargeOverride >+ choices: >+ 1: Allow >+ 0: "Don't allow" >+ - librarians override suspensions due to discharges. > - > - pref: FeeOnChangePatronCategory > choices: >-- >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 37451
:
169491
|
172020
|
176455
|
176468
|
179392
|
179393
|
179394
|
180621