Bugzilla – Attachment 17892 Details for
Bug 8735
Expire holds waiting only on days the library is open
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8735 - Expire holds waiting only on days the library is open
Bug-8735---Expire-holds-waiting-only-on-days-the-l.patch (text/plain), 5.54 KB, created by
Kyle M Hall (khall)
on 2013-05-02 11:48:32 UTC
(
hide
)
Description:
Bug 8735 - Expire holds waiting only on days the library is open
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-02 11:48:32 UTC
Size:
5.54 KB
patch
obsolete
>From c8fe520d34b13938445ee8542928c7719ec353f8 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 6 Sep 2012 11:15:21 -0400 >Subject: [PATCH] Bug 8735 - Expire holds waiting only on days the library is open > >Signed-off-by: Leila <koha.aixmarseille@gmail.com> >--- > C4/Reserves.pm | 24 ++++++++++++++++--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 6 +++++ > .../en/modules/admin/preferences/circulation.pref | 6 +++++ > 4 files changed, 33 insertions(+), 4 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index c8b0cdd..2738677 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -36,6 +36,7 @@ use C4::Members qw(); > use C4::Letters; > use C4::Branch qw( GetBranchDetail ); > use C4::Dates qw( format_date_in_iso ); >+use C4::Calendar; > > use Koha::DateUtils; > >@@ -911,17 +912,32 @@ sub CancelExpiredReserves { > if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) { > my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); > my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); >+ my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); >+ >+ my $today = C4::Dates->new(); > > my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; > $sth = $dbh->prepare( $query ); > $sth->execute( $max_pickup_delay ); > >- while (my $res = $sth->fetchrow_hashref ) { >- if ( $charge ) { >- manualinvoice($res->{'borrowernumber'}, $res->{'itemnumber'}, 'Hold waiting too long', 'F', $charge); >+ while ( my $res = $sth->fetchrow_hashref ) { >+ my $do_cancel = 1; >+ unless ( $cancel_on_holidays ) { >+ my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} ); >+ my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) ); >+ >+ if ( $is_holiday ) { >+ $do_cancel = 0; >+ } > } > >- CancelReserve( $res->{'biblionumber'}, '', $res->{'borrowernumber'} ); >+ if ( $do_cancel ) { >+ if ( $charge ) { >+ manualinvoice($res->{'borrowernumber'}, $res->{'itemnumber'}, 'Hold waiting too long', 'F', $charge); >+ } >+ >+ CancelReserve( $res->{'biblionumber'}, '', $res->{'borrowernumber'} ); >+ } > } > } > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 34e2ca0..34f2006 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -424,3 +424,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES(' > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UniqueItemFields', 'barcode', 'Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table', '', 'Free'); >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index be4dfa2..de7b823 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6784,6 +6784,12 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.11.00.XXX"; >+if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo')"); >+ print "Upgrade to $DBversion done (Add syspref ExpireReservesOnHolidays\n"; >+ SetVersion ($DBversion); >+} > > =head1 FUNCTIONS > >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 f88d964..7beb117 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 >@@ -442,6 +442,12 @@ Circulation: > no: "Don't allow" > - holds to be suspended from the OPAC. > - >+ - pref: ExpireReservesOnHolidays >+ choices: >+ yes: Allow >+ no: "Don't allow" >+ - expired holds to be canceled on days the library is closed.. >+ - > - pref: decreaseLoanHighHolds > choices: > yes: Enable >-- >1.7.2.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 8735
:
12019
|
12020
|
13364
|
13365
|
15074
|
15075
|
15096
|
15097
|
15098
|
16508
|
17625
|
17892
|
17893
|
24598
|
24599
|
24898
|
24899
|
27268
|
28660
|
28661
|
28662
|
28663
|
30395
|
30396
|
30397
|
30398
|
30399
|
30400
|
30401
|
30402