Bugzilla – Attachment 49003 Details for
Bug 15261
Verify if checkout or hold request periods overlap with existing holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15261: Add PreventChechoutOnSameReservePeriod and PreventReservesOnSamePeriod system preferences
Bug-15261-Add-PreventChechoutOnSameReservePeriod-a.patch (text/plain), 6.57 KB, created by
Alex Arnaud
on 2016-03-11 11:19:07 UTC
(
hide
)
Description:
Bug 15261: Add PreventChechoutOnSameReservePeriod and PreventReservesOnSamePeriod system preferences
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2016-03-11 11:19:07 UTC
Size:
6.57 KB
patch
obsolete
>From 07cfeb5f72f4c89c8607c77657a395cc3ff35bcc Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Fri, 11 Mar 2016 11:53:36 +0100 >Subject: [PATCH] Bug 15261: Add PreventChechoutOnSameReservePeriod and > PreventReservesOnSamePeriod system preferences > >--- > C4/Circulation.pm | 4 +++- > ..._15261-add_preventchechoutonsamereserveperiod_syspref.sql | 1 + > .../bug_15261-add_preventreservesonsameperiod_syspref.sql | 1 + > installer/data/mysql/sysprefs.sql | 4 +++- > .../prog/en/modules/admin/preferences/circulation.pref | 12 ++++++++++++ > opac/opac-reserve.pl | 3 ++- > reserve/placerequest.pl | 4 +++- > 7 files changed, 25 insertions(+), 4 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_15261-add_preventchechoutonsamereserveperiod_syspref.sql > create mode 100644 installer/data/mysql/atomicupdate/bug_15261-add_preventreservesonsameperiod_syspref.sql > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 4d2a6a8..24ebb81 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1059,9 +1059,11 @@ sub CanBookBeIssued { > } > > my $now = dt_from_string(); >+ my $preventChechoutOnSameReservePeriod = >+ C4::Context->preference("PreventChechoutOnSameReservePeriod"); > my $reserves_on_same_period = > ReservesOnSamePeriod($item->{biblionumber}, $item->{itemnumber}, $now->ymd, $duedate); >- if ($reserves_on_same_period) { >+ if ($preventChechoutOnSameReservePeriod && $reserves_on_same_period) { > my $reserve = $reserves_on_same_period->[0]; > my $borrower = C4::Members::GetMember(borrowernumber => $reserve->{borrowernumber}); > my $branchname = GetBranchName( $reserve->{branchcode} ); >diff --git a/installer/data/mysql/atomicupdate/bug_15261-add_preventchechoutonsamereserveperiod_syspref.sql b/installer/data/mysql/atomicupdate/bug_15261-add_preventchechoutonsamereserveperiod_syspref.sql >new file mode 100644 >index 0000000..5413265 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_15261-add_preventchechoutonsamereserveperiod_syspref.sql >@@ -0,0 +1 @@ >+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('PreventChechoutOnSameReservePeriod', '0', 'Prevent to checkout a document if a reserve on same period exists', NULL, 'YesNo'); >\ No newline at end of file >diff --git a/installer/data/mysql/atomicupdate/bug_15261-add_preventreservesonsameperiod_syspref.sql b/installer/data/mysql/atomicupdate/bug_15261-add_preventreservesonsameperiod_syspref.sql >new file mode 100644 >index 0000000..6f69486 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_15261-add_preventreservesonsameperiod_syspref.sql >@@ -0,0 +1 @@ >+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('PreventReservesOnSamePeriod', '0', 'Prevent to hold a document if a reserve on same period exists', NULL, 'YesNo'); >\ No newline at end of file >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index e2e3ad2..deb9eff 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -525,5 +525,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), > ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), > ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), >-('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') >+('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), >+('PreventChechoutOnSameReservePeriod','0','','Prevent to checkout a document if a reserve on same period exists','YesNo'), >+('PreventReservesOnSamePeriod','0','','Prevent to hold a document if a reserve on same period exists','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 8cdba08..537c18e 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 >@@ -421,6 +421,12 @@ Circulation: > yes: Block > no: Allow > - renewing of items. >+ - >+ - pref: PreventChechoutOnSameReservePeriod >+ choices: >+ yes: Do >+ no: "Don't" >+ - If yes, checkouts periods can't overlap with a reserve period. > Checkin Policy: > - > - pref: BlockReturnOfWithdrawnItems >@@ -624,6 +630,12 @@ Circulation: > choices: > homebranch: "home library" > holdingbranch: "holding library" >+ - >+ - pref: PreventReservesOnSamePeriod >+ choices: >+ yes: Do >+ no: "Don't" >+ - If yes, Reserves periods for the same document can't overlap. > Fines Policy: > - > - Calculate fines based on days overdue >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 884f3e2..c196064 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -275,7 +275,8 @@ if ( $query->param('place_reserve') ) { > } > > if ($canreserve) { >- if (ReservesOnSamePeriod($biblioNum, $itemNum, $startdate, $expiration_date)) { >+ if (C4::Context->preference("PreventReservesOnSamePeriod") && >+ ReservesOnSamePeriod($biblioNum, $itemNum, $startdate, $expiration_date)) { > $canreserve = 0; > $failed_holds++; > } >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index dffa3fa..e08a523 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -112,7 +112,9 @@ foreach my $biblionumber (keys %bibinfos) { > } > } > >- if (!$confirm && ReservesOnSamePeriod($biblionumber, $checkitem, $startdate, $expirationdate)) { >+ if (!$confirm && >+ ReservesOnSamePeriod($biblionumber, $checkitem, $startdate, $expirationdate) && >+ C4::Context->preference("PreventReservesOnSamePeriod")) { > $overlap_reserves->{$biblionumber} = { > title => $reserve_title , > checkitem => $checkitem, >-- >2.7.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 15261
:
45216
|
45833
|
45841
|
46432
|
46433
|
46441
|
46442
|
49001
|
49002
|
49003
|
52704
|
59643
|
61534
|
61539
|
61544
|
67088
|
67094
|
67143
|
68660
|
68661
|
68662
|
68663
|
68664
|
68852
|
68853
|
72956
|
72957
|
76221
|
76222
|
88292
|
88293
|
88297
|
88298
|
92376
|
92377
|
92584
|
92585
|
92664
|
93136
|
94871
|
98383
|
98424
|
98672
|
106944
|
106949
|
120822
|
123405
|
125793
|
125794
|
125795
|
125796
|
131569
|
131570
|
131571
|
131572
|
131573