Bugzilla – Attachment 97296 Details for
Bug 16547
Can't place item level hold directly from search results screen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16547: Do not display "multi holds" view if only one is selected
Bug-16547-Do-not-display-multi-holds-view-if-only-.patch (text/plain), 10.91 KB, created by
Jonathan Druart
on 2020-01-13 10:24:19 UTC
(
hide
)
Description:
Bug 16547: Do not display "multi holds" view if only one is selected
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-13 10:24:19 UTC
Size:
10.91 KB
patch
obsolete
>From ab72e6b7f909e0dafb7044271bb7580905fb5fa3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 13 Jan 2020 10:48:11 +0100 >Subject: [PATCH] Bug 16547: Do not display "multi holds" view if only one is > selected > >If a hold is selected from the result list, we should let the ability to >select an item-level hold. > >Test plan: >I. Detail page >1/ Go to a bibliographic record detail page >2/ Click "Place hold" >3/ Select a patron >=> No change expected, you can select an item > >II. Search result, multiple holds >1/ Search for an item with more than one search result >2/ Select several items, click 'Place hold' >3/ Enter a patron card number >=> No change expected, item level holds are not available. > >III. Search result, single hold >1/ Search for an item with more than one search result >2/ Select only one item, click 'Place hold' >3/ Enter a patron card number >=> With this patch applied, item level hold is available. The screen is the same >as when you place a hold from the bibliographic record detail page >=> Without this patch you cannot place an item-level hold > >QA notes: We could go a bit further and remove the 2 biblionumbers and >biblionumber from hold script, as well as remove the checkMultiHold in >request.tt. We should not have a biblionumbers param that contain a list >of biblionumber separated by '/' but several biblionumber parameters >instead. > >QA notes 2: About placerequest.pl, see bug 19618 comment 27. >--- > .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 1 - > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 13 ------------- > .../prog/en/modules/virtualshelves/shelves.tt | 1 - > reserve/modrequest.pl | 3 +-- > reserve/placerequest.pl | 18 +++++++----------- > reserve/request.pl | 7 +++---- > 6 files changed, 11 insertions(+), 32 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index fe22771aa1..ec4a4b7d63 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -645,7 +645,6 @@ > <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" /> > <input type="hidden" name="findborrower" id="holdFor" value="" /> > <input type="hidden" name="club" id="holdForClub" value="" /> >- <input type="hidden" name="multi_hold" value="1"/> > </form> > > <form id="list_form" method="get" action="/cgi-bin/koha/reserve/request.pl"> >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 8c34184557..2786aff4fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -101,16 +101,10 @@ > <input type="text" size="40" id="patron" class="focus" name="findborrower" autocomplete="off" /> > <input type="submit" value="Search" /> > [% IF multi_hold %] >- <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/> > <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/> > [% ELSE %] > <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> > [% END %] >- >- [% IF ( multi_hold ) %] >- <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/> >- <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/> >- [% END %] > </form> <!-- /#holds_patronsearch --> > </div> > <div role="tabpanel" class="tab-pane" id="holds_clubsearch_pane"> >@@ -119,16 +113,11 @@ > <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" /> > <input type="submit" value="Search" /> > [% IF multi_hold %] >- <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/> > <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/> > [% ELSE %] > <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> > [% END %] > >- [% IF ( multi_hold ) %] >- <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/> >- <input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]"/> >- [% END %] > </form> <!-- /#holds_patronsearch --> > </div> > </div> >@@ -149,7 +138,6 @@ > <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form"> > > [% IF ( multi_hold ) %] >- <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/> > <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/> > <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/> > <input type="hidden" name="request" value="any"/> >@@ -386,7 +374,6 @@ > <input type="hidden" name="type" value="str8" /> > > [% IF ( multi_hold ) %] >- <input type="hidden" name="multi_hold" value="[% multi_hold | html %]"/> > <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/> > <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/> > <input type="hidden" name="request" value="any"/> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 72420dd08c..5beada8871 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -382,7 +382,6 @@ > <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl"> > <!-- Value will be set here by placeHold() --> > <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" /> >- <input type="hidden" name="multi_hold" value="1"/> > </form> > > </main> >diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl >index e75fac73ac..790fcbd9ad 100755 >--- a/reserve/modrequest.pl >+++ b/reserve/modrequest.pl >@@ -50,7 +50,6 @@ my @expirationdates = $query->multi_param('expirationdate'); > my @branch = $query->multi_param('pickup'); > my @itemnumber = $query->multi_param('itemnumber'); > my @suspend_until=$query->multi_param('suspend_until'); >-my $multi_hold = $query->param('multi_hold'); > my $biblionumbers = $query->param('biblionumbers'); > my $count=@rank; > >@@ -94,7 +93,7 @@ if ( $from eq 'borrower'){ > print $query->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrower[0]"); > } else { > my $url = "/cgi-bin/koha/reserve/request.pl?"; >- if ($multi_hold) { >+ if (@biblionumber > 1) { > $url .= "multi_hold=1&biblionumbers=$biblionumbers"; > } else { > $url .= "biblionumber=$biblionumber[0]"; >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 89c591d55b..d6f28b4e25 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -56,8 +56,9 @@ my $itemtype = $input->param('itemtype') || undef; > my $borrower = Koha::Patrons->find( $borrowernumber ); > $borrower = $borrower->unblessed if $borrower; > >-my $multi_hold = $input->param('multi_hold'); >-my $biblionumbers = $multi_hold ? $input->param('biblionumbers') : ($biblionumber . '/'); >+my $biblionumbers = $input->param('biblionumbers'); >+$biblionumbers ||= $biblionumber . '/'; >+ > my $bad_bibs = $input->param('bad_bibs'); > my $holds_to_place_count = $input->param('holds_to_place_count') || 1; > >@@ -105,7 +106,7 @@ if ( $type eq 'str8' && $borrower ) { > $checkitem, $found, $itemtype ); > } > >- } elsif ($multi_hold) { >+ } elsif (@biblionumbers > 1) { > my $bibinfo = $bibinfos{$biblionumber}; > if ( $can_override || CanBookBeReserved($borrower->{'borrowernumber'}, $biblionumber)->{status} eq 'OK' ) { > AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,[$biblionumber], >@@ -123,15 +124,10 @@ if ( $type eq 'str8' && $borrower ) { > } > } > >- if ($multi_hold) { >- if ($bad_bibs) { >- $biblionumbers .= $bad_bibs; >- } >- print $input->redirect("request.pl?biblionumbers=$biblionumbers&multi_hold=1"); >- } >- else { >- print $input->redirect("request.pl?biblionumber=$biblionumber"); >+ if ($bad_bibs) { >+ $biblionumbers .= $bad_bibs; > } >+ print $input->redirect("request.pl?biblionumber=$biblionumber"); > } > elsif ( $borrowernumber eq '' ) { > print $input->header(); >diff --git a/reserve/request.pl b/reserve/request.pl >index c7376c2857..f8afa33d21 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -168,9 +168,8 @@ if ( $biblionumbers ) { > push @biblionumbers, $input->multi_param('biblionumber'); > } > >-my $multihold = scalar $input->param('multi_hold'); >-# FIXME multi_hold should not be a variable but depends on the number of elements in @biblionumbers >-$template->param(multi_hold => scalar $input->param('multi_hold')); >+my $multi_hold = @biblionumbers > 1; >+$template->param(multi_hold => $multi_hold); > > # If we have the borrowernumber because we've performed an action, then we > # don't want to try to place another reserve. >@@ -451,7 +450,7 @@ foreach my $biblionumber (@biblionumbers) { > $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check; > if ( $do_check && $wants_check ) { > $item->{checked_previously} = $do_check; >- if ( $multihold ) { >+ if ( $multi_hold ) { > $biblioloopiter{checked_previously} = $do_check; > } else { > $template->param( checked_previously => $do_check ); >-- >2.11.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 16547
:
97296
|
99072
|
99121
|
101992
|
102002
|
102570
|
102571
|
102573
|
102608