Bugzilla – Attachment 171486 Details for
Bug 37587
Wrong priority when placing multiple item-level holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37587: (QA follow-up) Tidy reserve/placerequest.pl
Bug-37587-QA-follow-up-Tidy-reserveplacerequestpl.patch (text/plain), 4.90 KB, created by
Paul Derscheid
on 2024-09-13 15:49:39 UTC
(
hide
)
Description:
Bug 37587: (QA follow-up) Tidy reserve/placerequest.pl
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-09-13 15:49:39 UTC
Size:
4.90 KB
patch
obsolete
>From 24a7679902f2691dfb9c8213d5e2e4d1407e80f6 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Fri, 13 Sep 2024 15:48:34 +0000 >Subject: [PATCH] Bug 37587: (QA follow-up) Tidy reserve/placerequest.pl > >--- > reserve/placerequest.pl | 35 ++++++++++++++++------------------- > 1 file changed, 16 insertions(+), 19 deletions(-) > >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 72b604565d..11aa387672 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -3,7 +3,6 @@ > #script to place reserves/requests > #written 2/1/00 by chris@katipo.oc.nz > >- > # Copyright 2000-2002 Katipo Communications > # > # This file is part of Koha. >@@ -26,17 +25,17 @@ use Modern::Perl; > use CGI qw ( -utf8 ); > use URI; > use C4::Reserves qw( CanItemBeReserved AddReserve CanBookBeReserved ); >-use C4::Auth qw( checkauth ); >+use C4::Auth qw( checkauth ); > > use Koha::Items; > use Koha::Patrons; > > my $input = CGI->new(); > >-checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet'); >+checkauth( $input, 0, { reserveforothers => 'place_holds' }, 'intranet' ); > > my @reqbib = $input->multi_param('reqbib'); >-my @biblionumbers = $input->multi_param('biblionumber'); >+my @biblionumbers = $input->multi_param('biblionumber'); > my @holdable_bibs = $input->multi_param('holdable_bibs'); > my $borrowernumber = $input->param('borrowernumber'); > my $notes = $input->param('notes'); >@@ -44,7 +43,7 @@ my $branch = $input->param('pickup'); > my $startdate = $input->param('reserve_date') || ''; > my @rank = $input->multi_param('rank-request'); > my $title = $input->param('title'); >-my @checkitems = $input->multi_param('checkitem'); >+my @checkitems = $input->multi_param('checkitem'); > my $item_group_id = $input->param('item_group_id'); > my $expirationdate = $input->param('expiration_date'); > my $itemtype = $input->param('itemtype') || undef; >@@ -52,27 +51,25 @@ my $non_priority = $input->param('non_priority'); > my $op = $input->param('op') || q{}; > my $multi_holds = $input->param('multi_holds'); > >-my $patron = Koha::Patrons->find( $borrowernumber ); >+my $patron = Koha::Patrons->find($borrowernumber); > > my $holds_to_place_count = $input->param('holds_to_place_count') || 1; > > my %bibinfos = (); >-foreach my $bibnum ( @holdable_bibs ) { >+foreach my $bibnum (@holdable_bibs) { > my %bibinfo = (); >- $bibinfo{title} = $input->param("title_$bibnum"); >- $bibinfo{rank} = $input->param("rank_$bibnum"); >- $bibinfo{pickup} = $input->param("pickup_$bibnum"); >+ $bibinfo{title} = $input->param("title_$bibnum"); >+ $bibinfo{rank} = $input->param("rank_$bibnum"); >+ $bibinfo{pickup} = $input->param("pickup_$bibnum"); > $bibinfos{$bibnum} = \%bibinfo; > } > >- >- > if ( $op eq 'cud-placerequest' && $patron ) { > my %failed_holds; > foreach my $biblionumber ( keys %bibinfos ) { > > my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); >- if ( @checkitems ) { >+ if (@checkitems) { > > my $hold_priority = $rank[0]; > >@@ -116,9 +113,9 @@ if ( $op eq 'cud-placerequest' && $patron ) { > } > } > >- } elsif (@biblionumbers > 1 || $multi_holds) { >+ } elsif ( @biblionumbers > 1 || $multi_holds ) { > my $bibinfo = $bibinfos{$biblionumber}; >- if ( $can_override || CanBookBeReserved($patron->borrowernumber, $biblionumber)->{status} eq 'OK' ) { >+ if ( $can_override || CanBookBeReserved( $patron->borrowernumber, $biblionumber )->{status} eq 'OK' ) { > AddReserve( > { > branchcode => $bibinfo->{pickup}, >@@ -137,9 +134,10 @@ if ( $op eq 'cud-placerequest' && $patron ) { > ); > } > } else { >+ > # place a request on 1st available > for ( my $i = 0 ; $i < $holds_to_place_count ; $i++ ) { >- if ( $can_override || CanBookBeReserved($patron->borrowernumber, $biblionumber)->{status} eq 'OK' ) { >+ if ( $can_override || CanBookBeReserved( $patron->borrowernumber, $biblionumber )->{status} eq 'OK' ) { > AddReserve( > { > branchcode => $branch, >@@ -162,7 +160,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > } > } > >- my $redirect_url = URI->new("request.pl"); >+ my $redirect_url = URI->new("request.pl"); > my @failed_hold_msgs = (); > > #NOTE: Deduplicate failed hold reason statuses/codes >@@ -171,8 +169,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > } > $redirect_url->query_form( biblionumber => [@biblionumbers], failed_holds => \@failed_hold_msgs ); > print $input->redirect($redirect_url); >-} >-elsif ( $borrowernumber eq '' ) { >+} elsif ( $borrowernumber eq '' ) { > print $input->header(); > print "Invalid borrower number please try again"; > >-- >2.46.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 37587
:
170117
|
170224
|
171485
| 171486