Bugzilla – Attachment 134983 Details for
Bug 30742
Confusion when placing hold on record with no items available because of not for loan
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30742: Remove 'bad_bibs' and send a list of holdable bibs
Bug-30742-Remove-badbibs-and-send-a-list-of-holdab.patch (text/plain), 6.29 KB, created by
Nick Clemens (kidclamp)
on 2022-05-13 15:27:19 UTC
(
hide
)
Description:
Bug 30742: Remove 'bad_bibs' and send a list of holdable bibs
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-05-13 15:27:19 UTC
Size:
6.29 KB
patch
obsolete
>From 6b80cda4c9dc3d519975114068b9e9927e2fa113 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 13 May 2022 15:23:30 +0000 >Subject: [PATCH] Bug 30742: Remove 'bad_bibs' and send a list of holdable bibs > >Currently place request gets a list of bad_bibs that is created via javascript on the >template. It ignores this list > >Ths patch instead doesn't add info for bad bibs, and provides a list of the bibs that >can be held > >To test: >1 - Attempt multi hold with some items that can be held, and one that cannot due to notforloan >2 - Fill in pickup locations and place hold >3 - Note hold is place on bib with no avilable items and hsows twice in results >4 - Apply patch >5 - repeat with another patron >6 - Note no aidditonal hold on record with notforloan items >7 - Note with with not for loan items appears only once in results >--- > .../prog/en/modules/reserve/request.tt | 27 ++++++++----------- > reserve/placerequest.pl | 8 ++---- > 2 files changed, 13 insertions(+), 22 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 f4812ad94e..96faff5868 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -200,11 +200,13 @@ > <form action="/api/v1/clubs/[% club.id | html %]/holds" method="post" name="form" id="club-request-form"> > > [% IF ( multi_hold ) %] >- <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/> > <input type="hidden" name="request" value="any"/> > [% FOREACH biblioloo IN biblioloop %] >- <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/> >- <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/> >+ [% UNLESS biblioloo.none_avail %] >+ <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/> >+ <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/> >+ <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/> >+ [% END %] > [% END %] > [% ELSE %] > <input type="hidden" name="title" value="[% biblio.title | html %]" /> >@@ -446,15 +448,17 @@ > <input type="hidden" name="type" value="str8" /> > > [% FOREACH biblionumber IN biblionumbers %] >- <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/> > [% END %] > [% IF ( multi_hold ) %] > <input type="hidden" name="multi_holds" id="multi_holds" value="1" /> >- <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/> > <input type="hidden" name="request" value="any"/> > [% FOREACH biblioloo IN biblioloop %] >- <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/> >- <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/> >+ [% UNLESS biblioloo.none_avail %] >+ <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/> >+ <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/> >+ <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/> >+ [% END %] > [% END %] > [% ELSE %] > <input type="hidden" name="title" value="[% biblio.title | html %]" /> >@@ -1411,15 +1415,6 @@ > return false; > } > >- var badSpans = $(".not_holdable"); >- var badBibs = ""; >- $(badSpans).each(function() { >- var bibnum = $(this).attr("title"); >- badBibs += bibnum + "/"; >- }); >- >- $("#bad_bibs").val(badBibs); >- > $('#hold-request-form').preventDoubleFormSubmit(); > > return true; >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 0a8d6dd64e..7b8f7f84ac 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -37,6 +37,7 @@ checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet'); > > my @reqbib = $input->multi_param('reqbib'); > my @biblionumbers = $input->multi_param('biblionumber'); >+my @holdable_bibs = $input->multi_param('holdable_bibs'); > my $borrowernumber = $input->param('borrowernumber'); > my $notes = $input->param('notes'); > my $branch = $input->param('pickup'); >@@ -51,12 +52,10 @@ my $non_priority = $input->param('non_priority'); > > my $patron = Koha::Patrons->find( $borrowernumber ); > >-my $bad_bibs_param = $input->param('bad_bibs'); >-my @bad_bibs = split '/', $bad_bibs_param; > my $holds_to_place_count = $input->param('holds_to_place_count') || 1; > > my %bibinfos = (); >-foreach my $bibnum (@biblionumbers) { >+foreach my $bibnum ( @holdable_bibs ) { > my %bibinfo = (); > $bibinfo{title} = $input->param("title_$bibnum"); > $bibinfo{rank} = $input->param("rank_$bibnum"); >@@ -148,9 +147,6 @@ if ( $type eq 'str8' && $patron ) { > } > } > >- if (@bad_bibs) { >- push @biblionumbers, @bad_bibs; >- } > my $redirect_url = URI->new("request.pl"); > $redirect_url->query_form( biblionumber => [@biblionumbers]); > print $input->redirect($redirect_url); >-- >2.30.2
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 30742
:
134982
|
134983
|
135002
|
135003
|
135255
|
135256
|
135906