Bugzilla – Attachment 157638 Details for
Bug 25711
Move ExpireReservesMaxPickUpDelayCharge to the circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25711: Deprecate ExpireReservesMaxPickUpDelayCharge
Bug-25711-Deprecate-ExpireReservesMaxPickUpDelayCh.patch (text/plain), 6.42 KB, created by
Andrii Nugged
on 2023-10-23 08:45:53 UTC
(
hide
)
Description:
Bug 25711: Deprecate ExpireReservesMaxPickUpDelayCharge
Filename:
MIME Type:
Creator:
Andrii Nugged
Created:
2023-10-23 08:45:53 UTC
Size:
6.42 KB
patch
obsolete
>From dc71eecfc2c07f457ab4d3b5c5653841288067e5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 28 Jun 2022 12:14:41 -0300 >Subject: [PATCH] Bug 25711: Deprecate ExpireReservesMaxPickUpDelayCharge > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/CirculationRules.pm | 8 +----- > Koha/Hold.pm | 2 +- > .../data/mysql/atomicupdate/bug_25711.pl | 26 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../admin/preferences/circulation.pref | 5 ---- > 5 files changed, 28 insertions(+), 14 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_25711.pl > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index dc157c12de..728dc7d3c5 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -750,7 +750,6 @@ sub get_effective_daysmode { > =head3 get_effective_expire_reserves_charge > > Return the value for expire_reserves_charge defined in the circulation rules. >-If not defined (or empty string), the value of the system preference ExpireReservesMaxPickUpDelayCharge is returned > > =cut > >@@ -761,7 +760,7 @@ sub get_effective_expire_reserves_charge { > my $branchcode = $params->{branchcode}; > my $categorycode = $params->{categorycode}; > >- my $expire_reserves_charge_rule = $class->get_effective_rule( >+ return $class->get_effective_rule( > { > itemtype => $itemtype, > branchcode => $branchcode, >@@ -769,11 +768,6 @@ sub get_effective_expire_reserves_charge { > rule_name => 'expire_reserves_charge', > } > ); >- >- # return the rule value (incl. 0) if rule found so there's an object in the variable, >- # or return default value from sysprefs when rule wasn't found and there's undef >- return $expire_reserves_charge_rule ? $expire_reserves_charge_rule->rule_value : C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); >- > } > > =head3 type >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 62648edbf4..b01fe4a341 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -672,7 +672,7 @@ my $cancel_hold = $hold->cancel( > Cancel a hold: > - The hold will be moved to the old_reserves table with a priority=0 > - The priority of other holds will be updated >-- The patron will be charge (see ExpireReservesMaxPickUpDelayCharge) if the charge_cancel_fee parameter is set >+- The patron will be charged if charge_cancel_fee parameter is set (controlled by the expire_reserves_charge circ rule) > - The canceled hold will have the cancellation reason added to old_reserves.cancellation_reason if one is passed in > - a CANCEL HOLDS log will be done if the pref HoldsLog is on > >diff --git a/installer/data/mysql/atomicupdate/bug_25711.pl b/installer/data/mysql/atomicupdate/bug_25711.pl >new file mode 100755 >index 0000000000..10e682c4d4 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_25711.pl >@@ -0,0 +1,26 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "25711", >+ description => "Move ExpireReservesMaxPickUpDelayCharge to the circulation rules", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ my ($expire_reserves_charge) = $dbh->selectrow_array( q{ >+ SELECT value FROM systempreferences >+ WHERE variable='ExpireReservesMaxPickUpDelayCharge'; >+ }); >+ >+ $expire_reserves_charge //= 0; >+ >+ $dbh->do(qq{ >+ INSERT INTO circulation_rules >+ ( categorycode, branchcode, itemtype, rule_name, rule_value ) >+ VALUES >+ ( NULL, NULL, NULL, 'expire_reserves_charge', $expire_reserves_charge ); >+ }); >+ >+ say $out "ExpireReservesMaxPickUpDelayCharge migrated to the expire_reserves_charge circulation rule"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 8a7aec0d27..cb4911fa5f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -240,7 +240,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'), > ('ExpireReservesAutoFillEmail','', NULL,'Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply-to address','Free'), > ('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'), >-('ExpireReservesMaxPickUpDelayCharge','0',NULL,'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.','free'), > ('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'), > ('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'), > ('ExportCircHistory', 0, NULL, "Display the export circulation options", '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 cc11c87a14..ddffdd0c9c 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 >@@ -773,11 +773,6 @@ Circulation: > class: email > - . If no address is defined here, the email will be sent to the library's reply-to address. > - '<br><strong>NOTE:</strong> These system preferences require the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.<br>' >- - >- - 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 >- - "." > - > - The holds queue should prioritize filling a hold by matching the patron's home library with an item having a matching > - pref: HoldsQueuePrioritizeBranch >-- >2.42.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 25711
:
107144
|
107407
|
107683
|
107844
|
108689
|
119851
|
119911
|
119912
|
120164
|
123309
|
123310
|
123326
|
123327
|
123328
|
123452
|
123456
|
123498
|
123568
|
123610
|
123653
|
123661
|
135060
|
135061
|
135062
|
135063
|
135064
|
135065
|
135156
|
135157
|
135158
|
135159
|
135160
|
135161
|
135950
|
135951
|
135952
|
135953
|
135954
|
135955
|
136769
|
140377
|
140378
|
140379
|
140380
|
140381
|
140382
|
140383
|
141270
|
157632
|
157633
|
157634
|
157635
|
157636
|
157637
|
157638
|
157639
|
171054
|
171055
|
171056
|
171057
|
171058
|
171059
|
176243
|
176244
|
176245
|
176246
|
176247
|
176248
|
176408
|
176409
|
176410
|
176411
|
176412
|
176413
|
176414
|
176415
|
176416
|
176417
|
176418
|
176419
|
176420
|
176421