Bugzilla – Attachment 88691 Details for
Bug 22650
Can place multiple item level holds on a single item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22650: Prevent multiple holds on individual items
Bug-22650-Prevent-multiple-holds-on-individual-ite.patch (text/plain), 3.88 KB, created by
Martin Renvoize (ashimema)
on 2019-04-25 07:08:43 UTC
(
hide
)
Description:
Bug 22650: Prevent multiple holds on individual items
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-25 07:08:43 UTC
Size:
3.88 KB
patch
obsolete
>From c1be83f5ff90244e0c7b245aa76c48bfb4220422 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 24 Apr 2019 15:12:17 +0000 >Subject: [PATCH] Bug 22650: Prevent multiple holds on individual items > >This patch corrects a missing id on the holds_to_place field and adds code to disable the box when an item is checked > >Additionally script login now places a single hold if an itemnumebr is passed and checks for holdability of the specific item > >To test: > 1 - Allow multiple holds per record in circ rules > 2 - In staff client, go to place a hold on a record > 3 - Select a patron > 4 - Increase the number of holds > 5 - Then select a specific item to hold > 6 - Patron now has multiple holds on a single item > 7 - Apply patch > 8 - Repeat, notice that count is disabled when item checked > 9 - Confirm count is enabled when 'Hold next available item' is checked >10 - Set number to more than 1 >11 - Check an item and submit >12 - Confirm only one item is reserved >13 - Hit the script directly (with valid info): > http://localhost:8081/cgi-bin/koha/reserve/placerequest.pl?biblionumber=1&checkitem=1&holds_to_place_count=2&borrowernumber=5 >14 - Confirm only one hold is placed >15 - Confirm multiple hits of the url do not generate further holds > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 4 +++- > reserve/placerequest.pl | 9 ++++++--- > 2 files changed, 9 insertions(+), 4 deletions(-) > >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 c33f33f9b0..c18ea1068b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -252,7 +252,7 @@ > [% IF remaining_holds_for_record > 1 %] > <li> > <label for="holds_to_place_count">Holds to place (count)</label> >- <input type="number" name="holds_to_place_count" min="1" max="[% remaining_holds_for_record | html %]" step="1" value="1" /> >+ <input id="holds_to_place_count" type="number" name="holds_to_place_count" min="1" max="[% remaining_holds_for_record | html %]" step="1" value="1" /> > </li> > [% ELSE %] > <input type="hidden" name="holds_to_place_count" value="1" /> >@@ -827,8 +827,10 @@ > }); > if(onechecked == 1){ > $("#requestany").prop("checked", false); >+ $("#holds_to_place_count").prop('disabled', true); > } else { > $("#requestany").prop("checked",true); >+ $("#holds_to_place_count").prop('disabled', false); > } > }); > var prev_rank_request; >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 1e49a4bd78..35add4829a 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -93,9 +93,12 @@ if ( $type eq 'str8' && $borrower ) { > if ( $item->biblionumber ne $biblionumber ) { > $biblionumber = $item->biblionumber; > } >- } >- >- if ($multi_hold) { >+ if ( CanItemBeReserved($borrower->{'borrowernumber'}, $item->itemnumber, $branch)->{status} eq 'OK' ) { >+ AddReserve( $branch, $borrower->{'borrowernumber'}, >+ $biblionumber, \@realbi, $rank[0], $startdate, $expirationdate, $notes, $title, >+ $checkitem, $found, $itemtype ); >+ } >+ } elsif ($multi_hold) { > my $bibinfo = $bibinfos{$biblionumber}; > if ( CanBookBeReserved($borrower->{'borrowernumber'}, $biblionumber)->{status} eq 'OK' ) { > AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,[$biblionumber], >-- >2.20.1
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 22650
:
88639
|
88640
| 88691