From 149cb5014932749cb0c13a2a8ae3ff18bfd4dc52 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 22 Dec 2017 09:07:50 +0100 Subject: [PATCH] Bug 19301: (QA follow-up) Add POD, use statements and correct typo Add POD for new sub in Koha/IssuingRules.pm. Adding use Koha::IssuingRules to opac-detail and opac-MARCdetail. Adding use Koha::Items to opac-detail and opac-MARCdetail. Correct typo $items => $item in opac-MARCdetail.pl. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- Koha/IssuingRules.pm | 6 ++++++ opac/opac-MARCdetail.pl | 4 +++- opac/opac-detail.pl | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Koha/IssuingRules.pm b/Koha/IssuingRules.pm index ff40c1c874..e0fffd1727 100644 --- a/Koha/IssuingRules.pm +++ b/Koha/IssuingRules.pm @@ -100,6 +100,12 @@ sub get_opacitemholds_policy { return $issuing_rule ? $issuing_rule->opacitemholds : undef; } +=head3 get_onshelfholds_policy + + my $on_shelf_holds = Koha::IssuingRules->get_onshelfholds_policy({ item => $item, patron => $patron }); + +=cut + sub get_onshelfholds_policy { my ( $class, $params ) = @_; my $item = $params->{item}; diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index c44c5df2bb..ebb78a2982 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -58,6 +58,8 @@ use C4::Acquisition; use C4::Koha; use List::MoreUtils qw( any uniq ); use Koha::Biblios; +use Koha::IssuingRules; +use Koha::Items; use Koha::Patrons; use Koha::RecordProcessor; @@ -132,7 +134,7 @@ if(my $cart_list = $query->cookie("bib_list")){ my $allow_onshelf_holds; my $patron = Koha::Patrons->find( $loggedinuser ); for my $itm (@all_items) { - my $items = Koha::Items->find( $itm->{itemnumber} ); + my $item = Koha::Items->find( $itm->{itemnumber} ); $allow_onshelf_holds = Koha::IssuingRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); last if $allow_onshelf_holds; } diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 81edc1533e..2f32e4449f 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -52,6 +52,8 @@ use C4::CourseReserves qw(GetItemCourseReservesInfo); use Koha::Biblios; use Koha::RecordProcessor; use Koha::AuthorisedValues; +use Koha::IssuingRules; +use Koha::Items; use Koha::ItemTypes; use Koha::Acquisition::Orders; use Koha::Virtualshelves; -- 2.39.5