Bugzilla – Attachment 118259 Details for
Bug 24194
Add system preference to disable the use of expiration dates for holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24914: (follow-up) Clarifying sysprefs, hiding columns, and more
Bug-24914-follow-up-Clarifying-sysprefs-hiding-col.patch (text/plain), 10.58 KB, created by
Aleisha Amohia
on 2021-03-16 01:41:06 UTC
(
hide
)
Description:
Bug 24914: (follow-up) Clarifying sysprefs, hiding columns, and more
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2021-03-16 01:41:06 UTC
Size:
10.58 KB
patch
obsolete
>From e45c7780cb99cb309059dbb5faa5aedf5a19af86 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 9 Nov 2020 09:10:15 +1300 >Subject: [PATCH] Bug 24914: (follow-up) Clarifying sysprefs, hiding columns, > and more > >- change syspref description to say 'holds' instead of reserves >- clarify descriptions of related sysprefs >- hide expiration column on reserves page >- move syspref to 'hold policy' section >- fix cancel_expired_holds.pl cron to consider syspref >- set expirationdate to undef always > >https://bugs.koha-community.org/show_bug.cgi?id=24194 > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Reserves.pm | 29 +++++++--------------- > ...24194-add-DisableReserveExpiration-syspref.perl | 2 +- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../en/modules/admin/preferences/circulation.pref | 20 +++++++-------- > .../prog/en/modules/reserve/request.tt | 2 +- > misc/cronjobs/holds/cancel_expired_holds.pl | 4 ++- > t/db_dependent/Reserves.t | 2 +- > 7 files changed, 26 insertions(+), 35 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index c2b5f4b4ec..93e3d4276b 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -2071,26 +2071,15 @@ sub RevertWaitingStatus { > ->update({ priority => \'priority + 1' }, { no_triggers => 1 }); > > ## Fix up the currently waiting reserve >- if ( C4::Context->preference('DisableReserveExpiration') ){ >- $hold->set( >- { >- priority => 1, >- found => undef, >- waitingdate => undef, >- expirationdate => undef, >- itemnumber => $hold->item_level_hold ? $hold->itemnumber : undef, >- } >- )->store(); >- } else { >- $hold->set( >- { >- priority => 1, >- found => undef, >- waitingdate => undef, >- itemnumber => $hold->item_level_hold ? $hold->itemnumber : undef, >- } >- )->store(); >- } >+ $hold->set( >+ { >+ priority => 1, >+ found => undef, >+ waitingdate => undef, >+ expirationdate => undef, >+ itemnumber => $hold->item_level_hold ? $hold->itemnumber : undef, >+ } >+ )->store(); > > _FixPriority( { biblionumber => $hold->biblionumber } ); > >diff --git a/installer/data/mysql/atomicupdate/bug24194-add-DisableReserveExpiration-syspref.perl b/installer/data/mysql/atomicupdate/bug24194-add-DisableReserveExpiration-syspref.perl >index a5fe773c18..bed084b3ce 100644 >--- a/installer/data/mysql/atomicupdate/bug24194-add-DisableReserveExpiration-syspref.perl >+++ b/installer/data/mysql/atomicupdate/bug24194-add-DisableReserveExpiration-syspref.perl >@@ -1,6 +1,6 @@ > $DBversion = 'XXX'; # will be replaced by the RM > if( CheckVersion( $DBversion ) ) { >- $dbh->do(q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ( "DisableReserveExpiration", 0, NULL, "Disable the use of expiration date in reserves module.", "YesNo" ) }); >+ $dbh->do(q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ( "DisableReserveExpiration", 0, NULL, "Disable the use of expiration date in holds module.", "YesNo" ) }); > > SetVersion( $DBversion ); > print "Upgrade to $DBversion done (Bug 24194 - DisableReserveExpiration system preference)\n"; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index d99d8582e5..66a67d2fcd 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -165,7 +165,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('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'), > ('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'), >-('DisableReserveExpiration', 0, NULL, 'Disable the use of expiration date in reserves module.', 'YesNo'), >+('DisableReserveExpiration', 0, NULL, 'Disable the use of expiration date in holds module.', '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','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'), > ('displayFacetCount','0',NULL,NULL,'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 1dd7f262bb..fcea0d644d 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 >@@ -168,12 +168,6 @@ Circulation: > 1: "Use" > 0: "Don't use" > - circulation desks with circulation. >- - >- - pref: DisableReserveExpiration >- choices: >- yes: Disable >- no: "Don't disable" >- - the use of expiration dates in reserves. > > Checkout policy: > - >@@ -732,18 +726,18 @@ Circulation: > - Mark a hold as problematic if it has been waiting for more than > - pref: ReservesMaxPickUpDelay > class: integer >- - days. >+ - "days.<br><strong>NOTE:</strong> If DisableReserveExpiration is enabled, holds marked as problematic must be dealt with manually as they will never automatically expire." > - > - pref: ExpireReservesMaxPickUpDelay > choices: > 1: Allow > 0: "Don't allow" >- - 'holds to expire automatically if they have not been picked by within the time period specified in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesMaxPickUpDelay">ReservesMaxPickUpDelay</a> system preference.<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.' >+ - 'holds to expire automatically if they have not been picked by within the time period specified in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesMaxPickUpDelay">ReservesMaxPickUpDelay</a> system preference.<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled.' > - > - If using <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ExpireReservesMaxPickUpDelay">ExpireReservesMaxPickUpDelay</a>, charge a patron who allows their waiting hold to expire a fee of > - pref: ExpireReservesMaxPickUpDelayCharge > class: currency >- - "." >+ - ".<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled." > - > - Satisfy holds using items from the libraries > - pref: StaticHoldsQueueWeight >@@ -825,7 +819,7 @@ Circulation: > choices: > 1: Allow > 0: "Don't allow" >- - expired holds to be canceled on days the library is closed. >+ - expired holds to be canceled on days the library is closed.<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled. > - > - pref: ExcludeHolidaysFromMaxPickUpDelay > choices: >@@ -901,6 +895,12 @@ Circulation: > - pref: UpdateItemWhenLostFromHoldList > type: textarea > syntax: text/x-yaml >+ - >+ - pref: DisableReserveExpiration >+ choices: >+ yes: Disable >+ no: "Don't disable" >+ - the use of expiration dates in holds. This means patrons will not be able to specify a date when their hold is not needed, and any hold awaiting pickup will not automatically expire after it has been waiting for a problematic number of days. The expiration date will be hidden from both the OPAC and staff interface. > Interlibrary loans: > - > - pref: ILLModule >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index c272823f75..7fcfa3b21c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -447,7 +447,7 @@ > </li> > [% END %] > >- [% IF !Koha.Preference('DisableReserveExpiration') %] >+ [% UNLESS Koha.Preference('DisableReserveExpiration') %] > <li> > <label for="to">Hold expires on date:</label> > <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" /> >diff --git a/misc/cronjobs/holds/cancel_expired_holds.pl b/misc/cronjobs/holds/cancel_expired_holds.pl >index 4932bbf346..587a6de1da 100755 >--- a/misc/cronjobs/holds/cancel_expired_holds.pl >+++ b/misc/cronjobs/holds/cancel_expired_holds.pl >@@ -80,4 +80,6 @@ pod2usage(1) if $help; > > cronlogaction(); > >-CancelExpiredReserves($reason); >+unless( C4::Context->preference('DisableReserveExpiration') ) { >+ CancelExpiredReserves($reason); >+} >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 2076b5b081..7d789b1e67 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -1249,7 +1249,7 @@ subtest 'DisableReserveExpiration syspref tests' => sub { > > $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber }); > >- is( $reverted->expirationdate, $expirationdate->ymd, "Expiration date remains as expected" ); >+ is( $reverted->expirationdate, undef, "Expiration date is still removed because we can't reset to the original expiration date" ); > }; > > sub count_hold_print_messages { >-- >2.11.0
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 24194
:
96120
|
96121
|
98048
|
98368
|
100927
|
110082
|
110127
|
111443
|
113284
|
113285
|
116626
|
116627
|
117016
|
117085
|
117089
|
117097
|
117098
|
117099
|
117100
|
117101
|
118258
|
118259
|
118260
|
118261
|
118262
|
118263
|
128301
|
128302
|
128303
|
128304
|
128305
|
128306
|
128307
|
128308
|
140646
|
140647
|
144076
|
147527
|
147528
|
150799
|
150800
|
159060
|
159061
|
167796
|
167797
|
169174
|
174650
|
174651
|
174652