Bugzilla – Attachment 78305 Details for
Bug 15565
Place multiple item-level holds at once for the same record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15565: Allow up to (and including) maxreserves number of OPAC item levelholds
Bug-15565-Allow-up-to-and-including-maxreserves-nu.patch (text/plain), 5.37 KB, created by
Alex Buckley
on 2018-08-30 06:18:33 UTC
(
hide
)
Description:
Bug 15565: Allow up to (and including) maxreserves number of OPAC item levelholds
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2018-08-30 06:18:33 UTC
Size:
5.37 KB
patch
obsolete
>From 91164f66dba084ce4447495251d3b3c074992e9a Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Thu, 30 Aug 2018 10:33:25 +1200 >Subject: [PATCH] Bug 15565: Allow up to (and including) maxreserves number of > OPAC item levelholds > >This commit implements changes to opac-reserve.tt and opac-reserve.pl. > >1. The change to opac-reserve.tt JS fixes the total_requested() function which returns an output which is always 2 digits higher than the actual number of selected item checkboxes. > >i.e. if the 'maxreserves' syspref (limit for the overall >number of reserves allowed by a user) is 4 and a user has no previous >holds and ticks 3 item checkboxes and submits the form. > >The 'Maximum number of reserve exceded.' popup message is displayed, >however as they have selected 3 items for reservation this is less than >the maxreserves value of 4. > >The popup is displayed because total_requested() JS function is >returning 5 (i.e. 2 on top of the actual number of requested holds). > >This commit usbtracts 2 from the number of holds calculated by >total_requested() so that the accurate number of requested holds is >being used to determine whether or not to display the excess holds >popup. > >2. When the 'Holds per record (count)' (circulation rule) and >'maxreserves' syspref are the same value (e.g. 4) you can tick 4 item >checkboxes in opac-reserve.pl and submit the form. > >The form will submit successfully and to the user everything looks to >have worked however the holds will not be >successfully created. > >This is because after the form is submitted to opac-reserve.pl a check is >done: > >If 'number of submitted hold requests' + 'number of previous existing holds' >greater than or equal to maxreserves syspref then set the variable >'$canreserve' to 0. > >If the $canreserve variable is 0 the form will submit, no warning/error >message is displayed to the user but the holds are not created. > >Users should be able to place 4 holds if the maxreserves syspref is 4 >(just not more than 4 holds). This commit changes this check to: > >If 'number of submitted hold requests' + 'number of previous existing >holds' greater than maxreserves syspref then set the variable '$canreserve' to 0.. > >i.e. notice we only check for greater than (not equal to). > >Which solves the bug of the form submitting and no holds being created >when the maxreserves syspref and 'Holds per record (count)' (circulation >rule) are the same. > >Test plan (in two parts to test fix #1 and #2 (above)): > >Test plan for fix #1: >1. Apply all patches on this bug report (15565) and follow and confirm >the feature works as described in the test plan in the first commit > >2. Set the 'maxreserves' syspref to 3 (and 'Holds per record (count)' >(circulation rule) to 5) > >3. Ensure your logged in patron account has no existing reserves > >4. In the OPAC go to a biblio page with 3 or more items > >5. In the reservation page (opac-reserve.pl) for that biblio select 2 >item checkboes to place 2 item level holds and notice the 'Maximum >number of reserve exceded.' popup message is displayed. > >As the maxreserves syspref value is 3 you should be able to place 2 >holds without exceeding that value > >6. Apply this patch > >7. Repeat step 5 and notice the form submits without the exceeding popup >message and the holds are successfully placed. > >Test plan for fix #2: >1. Apply all patches attached to this bug report (bug 15565) and perform >the test plan in the first commit and verify it works. > >2. Set your 'Holds per record (count)' (circulation rule) and >'maxreserves' syspref to the same value 3 > >3. Go to a biblio in the OPAC with 3 or more items > >4. In the opac-reserve.pl reservation interface for that biblio tick 3 >item checkboxes to place 3 item level holds and submit the form. > >5. Notice the form submits and no warning/error message is displayed > >6. In the opac user summary page that is displayed after the reserve >form is submitted notice the holds are not displayed this is because >they have not been placed > >7. Apply this patch > >8. Repeat step 4 and 5 and notice the holds have been successfully >placed and are displayed in your opac user summary page. > >Sponsored-By: Brimbank Library >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 1 + > opac/opac-reserve.pl | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 4372454..40be579 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -563,6 +563,7 @@ > var biblioNum = $(this).val(); > if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) { > total += parseInt($("input[name='checkitem_'"+biblioNum+"]:checked").length); >+ total -= 2; > } else { > total += parseInt($("select[name='holds_to_place_count_"+biblioNum+"']").val()); > } >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index ce424b2..ba35678 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -220,7 +220,7 @@ if ( $query->param('place_reserve') ) { > > my $canreserve = 1; > if ( $maxreserves >- && $reserve_cnt + $nbRequested >= $maxreserves ) >+ && $reserve_cnt + $nbRequested > $maxreserves ) > { > $canreserve = 0; > } >-- >2.1.4
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 15565
:
47527
|
47551
|
47552
|
50068
|
50069
|
50392
|
50393
|
56229
|
56230
|
56231
|
56232
|
56458
|
56510
|
56511
|
56512
|
56513
|
56514
|
56515
|
56517
|
56518
|
56519
|
56520
|
56521
|
56522
|
56523
|
56524
|
61244
|
61245
|
61246
|
61247
|
61248
|
61576
|
61577
|
61578
|
61579
|
61580
|
64590
|
64591
|
64592
|
64593
|
64594
|
66594
|
66595
|
66596
|
66597
|
66598
|
68759
|
68760
|
68761
|
68762
|
68763
|
71643
|
71644
|
71645
|
71646
|
71647
|
71648
|
72644
|
72645
|
72646
|
72647
|
72648
|
72649
|
78242
|
78243
|
78244
|
78245
|
78246
|
78247
|
78248
|
78266
|
78305
|
78417
|
78418
|
78419
|
78420
|
78421
|
78422
|
78423
|
78424
|
78425
|
78426
|
78712
|
78713
|
78714
|
78715
|
78716
|
78717
|
78718
|
78719
|
78720
|
78815
|
78816
|
78817
|
78818
|
78819
|
78820
|
78821
|
78822
|
78823
|
81419
|
81420
|
81421
|
81422
|
81423
|
81424
|
81425
|
81426
|
81427
|
81431
|
81449
|
81570
|
81571
|
81572
|
81573
|
81574
|
81575
|
81576
|
81577
|
81578
|
81579
|
81580
|
81581
|
82205
|
82206
|
82207
|
82208
|
82209
|
82210
|
82211
|
82212
|
82213
|
82214
|
82215
|
82216
|
82220
|
82221
|
83331
|
83332
|
83333
|
83334
|
83335
|
83336
|
83337
|
83338
|
83339
|
83340
|
83341
|
83342
|
83378
|
83380
|
83381
|
84541
|
84542
|
84543
|
84544
|
84545
|
84546
|
84547
|
84548
|
84549
|
84550
|
84551
|
84552
|
84553
|
87979
|
87980
|
87981
|
87982
|
87983
|
87984
|
87985
|
87986
|
87987
|
87988
|
87989
|
87990
|
87991
|
117128
|
117129
|
117130
|
117131
|
117132
|
117133
|
120365
|
120366
|
120367
|
120639
|
120640
|
120641
|
121941
|
122098
|
162071
|
162072
|
162073
|
162074
|
163052
|
163053
|
163054
|
163055
|
163092
|
163093
|
166005
|
166006
|
166007
|
166008
|
166009