Bugzilla – Attachment 133353 Details for
Bug 30226
Add system preference to disable auto-renew checkbox at checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30226: Add system preference AllowSetAutomaticRenewal
Bug-30226-Add-system-preference-AllowSetAutomaticR.patch (text/plain), 10.13 KB, created by
Marcel de Rooy
on 2022-04-15 09:47:39 UTC
(
hide
)
Description:
Bug 30226: Add system preference AllowSetAutomaticRenewal
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-04-15 09:47:39 UTC
Size:
10.13 KB
patch
obsolete
>From 489be9bc2581a38827f98cdc7eb50056643cbed6 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 4 Mar 2022 21:06:17 +0000 >Subject: [PATCH] Bug 30226: Add system preference AllowSetAutomaticRenewal >Content-Type: text/plain; charset=utf-8 > >To test: >1. Apply patch, restart the things, and run updatedatabase >2. Look for the system preference 'AllowSetAutomaticRenewal'. >3. To preserve current behavior the system preference should be set to allow by default. >4. Go to the circulation page and see that under 'Checkout settings' there is the option to set a particular item for auto renewal. >5. Set 'AllowSetAutomaticRenewal' to 'don't allow'. >6. Go back to the circulation page and under checkout settings you should no longer see the option to set an item for auto renewal. > >Signed-off-by: Kelly mcElligott <kelly@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../data/mysql/atomicupdate/bug_30226.pl | 16 +++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../admin/preferences/circulation.pref | 6 +++ > .../prog/en/modules/circ/circulation.tt | 42 ++++++++++--------- > 4 files changed, 45 insertions(+), 20 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_30226.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_30226.pl b/installer/data/mysql/atomicupdate/bug_30226.pl >new file mode 100755 >index 0000000000..2b7538059a >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30226.pl >@@ -0,0 +1,16 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "30226", >+ description => "Add the system preference AllowSetAutomaticRenewal", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ # Add system preference AllowSetAutomaticRenewal >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type` ) VALUES('AllowSetAutomaticRenewal', '1', '|yes|no', 'Allow or Prevent staff from flagging items for autorenewal on the checkout page', 'YesNo') >+ }); >+ # Finished adding system preference AllowSetAutomaticRenewal >+ say $out "Added system preference AllowSetAutomaticRenewal"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 34523550c0..81c6f0cc92 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -43,6 +43,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'), > ('AllowRenewalOnHoldOverride','0',NULL,'If ON, allow items on hold to be renewed with a specified due date','YesNo'), > ('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'), >+('AllowSetAutomaticRenewal','1',NULL,'If ON, allows staff to set items for automatic renewal on the check out page','YesNo'), > ('AllowStaffToSetCheckoutsVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo'), > ('AllowStaffToSetFinesVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s fines to be visible to linked patrons from the opac.', 'YesNo'), > ('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 7a05ccdf1a..8f77412eb4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -182,6 +182,12 @@ Circulation: > 1: Don't > 0: Do > - require librarians to manually confirm a checkout where the item is already checked out to another patron. >+ - >+ - pref: AllowSetAutomaticRenewal >+ choices: >+ 1: Allow >+ 0: "Don't allow" >+ - staff to flag items for autorenewal on the checkout page. > - > - pref: AllowTooManyOverride > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index c2b4e9ee89..c30c6170e2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -666,31 +666,33 @@ > [% END %] > > [% UNLESS ( noissues ) %] >- <div id="set-automatic-renewal" class="circ-setting"> >- [% IF NEEDSCONFIRMATION %] >- [% IF auto_renew %] >- [% IF patron.autorenew_checkouts %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >- title="Patron has opted out of auto-renewal"/> >+ [% IF Koha.Preference('AllowSetAutomaticRenewal') %] >+ <div id="set-automatic-renewal" class="circ-setting"> >+ [% IF NEEDSCONFIRMATION %] >+ [% IF auto_renew %] >+ [% IF patron.autorenew_checkouts %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >+ title="Patron has opted out of auto-renewal"/> >+ [% ELSE %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" /> >+ [% END %] > [% ELSE %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" /> >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" /> > [% END %] > [% ELSE %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" /> >- [% END %] >- [% ELSE %] >- [% IF ( auto_renew && patron.autorenew_checkouts ) %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" /> >- [% ELSIF patron.autorenew_checkouts %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" /> >- [% ELSE %] >- <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >- title="Patron has opted out of auto-renewal"/> >+ [% IF ( auto_renew && patron.autorenew_checkouts ) %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" /> >+ [% ELSIF patron.autorenew_checkouts %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" /> >+ [% ELSE %] >+ <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" >+ title="Patron has opted out of auto-renewal"/> >+ [% END %] > [% END %] >- [% END %] > >- <label for="auto_renew">Automatic renewal</label> >- </div> >+ <label for="auto_renew">Automatic renewal</label> >+ </div> >+ [% END %] > [% IF Koha.Preference('decreaseLoanHighHolds') %] > <div id="set_high_holds_overrride" class="circ-setting"> > [% IF NEEDSCONFIRMATION %] >-- >2.20.1
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 30226
:
131388
|
131389
|
131618
| 133353 |
133354
|
133507