Bugzilla – Attachment 120521 Details for
Bug 28286
Place hold button not displayed when biblio has only Ordered items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28286: show "Place hold" button if item is holdable
Bug-28286-show-Place-hold-button-if-item-is-holdab.patch (text/plain), 2.18 KB, created by
Peter Vashchuk
on 2021-05-05 13:49:13 UTC
(
hide
)
Description:
Bug 28286: show "Place hold" button if item is holdable
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2021-05-05 13:49:13 UTC
Size:
2.18 KB
patch
obsolete
>From 295506bb7efe639c3e68fe6c395ab91ee2474af8 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Wed, 5 May 2021 16:30:26 +0300 >Subject: [PATCH] Bug 28286: show "Place hold" button if item is holdable > >This patch adds "filter_by_for_hold" method in "Items.pm" and >uses it in "cat-toolbar.inc" instead of "filter_by_for_load". > >To reproduce the bug: >1) go to /cgi-bin/koha/catalogue/detail.pl?biblionumber=XXX that has >item with notforloan value set as "Ordered" (-1) >2) see that button "Place hold" is not present >3) apply the patch >4) refresh the page and ensure that "Place hold" button appears even if >item is "Ordered" >--- > Koha/Items.pm | 13 +++++++++++++ > .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- > 2 files changed, 14 insertions(+), 1 deletion(-) > >diff --git a/Koha/Items.pm b/Koha/Items.pm >index 2d81a24c59..0d661580ad 100644 >--- a/Koha/Items.pm >+++ b/Koha/Items.pm >@@ -50,6 +50,19 @@ sub filter_by_for_loan { > return $self->search( { notforloan => [ 0, undef ] } ); > } > >+=head3 filter_by_for_hold >+ >+ my $filtered_items = $items->filter_by_for_hold; >+ >+Return the items of the set that are holdable >+ >+=cut >+ >+sub filter_by_for_hold { >+ my ($self) = @_; >+ return $self->search( { notforloan => { '<' => 1 } } ); >+} >+ > =head3 filter_by_visible_in_opac > > my $filered_items = $items->filter_by_visible_in_opac( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index a467c7a27f..e0ba1e8b18 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -168,7 +168,7 @@ CAN_user_serials_create_subscription ) %] > [% IF ( CAN_user_reserveforothers ) %] > [%# biblio.items.filter_by_for_loan.count %] > [% SET items = biblio.items %] >- [% IF Context.Scalar(Context.Scalar(items, "filter_by_for_loan"), "count") %] >+ [% IF Context.Scalar(Context.Scalar(items, "filter_by_for_hold"), "count") %] > [% IF ( holdfor ) %] > <div class="btn-group"> > <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> >-- >2.31.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 28286
:
120521
|
120618
|
120619
|
120668
|
120672
|
120674
|
120701
|
120768