From 6655568a2481c59491479cbc0b35562e6566b2ef Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 24 Jan 2014 09:59:03 +0100 Subject: [PATCH] Bug 9823: QA follow-up for GetReservesFromBiblionumber calls Content-Type: text/plain; charset=utf-8 The template params holds and holdcount are not used in the ISBD template. Removed the associated code from catalogue/ISBDdetail.pl. Same applies for catalogue/MARCdetail.pl and labeledMARCdetail.pl. Same applies also for catalogue/imageviewer.pl. Same applies also for catalogue/moredetail.pl. In catalogue detail.tt only the number of holds is used. Removed the code that passed the holds array to the template. For consistency opac-detail should also incorporate future holds into its holds count; added the all_dates parameter for that reason. The Reserves module is no longer needed in moredetail. Removed it. Checked the other scripts also. Signed-off-by: Marcel de Rooy --- catalogue/ISBDdetail.pl | 3 --- catalogue/MARCdetail.pl | 3 --- catalogue/detail.pl | 5 +++-- catalogue/imageviewer.pl | 3 --- catalogue/labeledMARCdetail.pl | 3 --- catalogue/moredetail.pl | 4 ---- opac/opac-detail.pl | 2 +- 7 files changed, 4 insertions(+), 19 deletions(-) diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index dd1c5c8..ffc6c5e 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -113,9 +113,6 @@ $template->param ( ); -my $holds = C4::Reserves::GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); -my $holdcount = scalar( @$holds ); -$template->param( holdcount => $holdcount, holds => $holds ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 73e44be..8eadb77 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -336,8 +336,5 @@ $template->param ( searchid => $query->param('searchid'), ); -my $holds = C4::Reserves::GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); -my $holdcount = scalar( @$holds ); -$template->param( holdcount => $holdcount, holds => $holds ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 7099656..9118c9d 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -418,9 +418,10 @@ if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref 'sort'=>'-weight', limit=>$tag_quantity})); } +#we only need to pass the number of holds to the template my $holds = C4::Reserves::GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); -my $holdcount = scalar ( @$holds ); -$template->param( holdcount => $holdcount, holds => $holds ); +$template->param( holdcount => scalar ( @$holds ) ); + my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection'); if ($StaffDetailItemSelection) { # Only enable item selection if user can execute at least one action diff --git a/catalogue/imageviewer.pl b/catalogue/imageviewer.pl index 7f994f6..39a5102 100755 --- a/catalogue/imageviewer.pl +++ b/catalogue/imageviewer.pl @@ -78,8 +78,5 @@ $template->{VARS}->{'norequests'} = $norequests; $template->param(C4::Search::enabled_staff_search_views); $template->{VARS}->{'biblio'} = $biblio; -my $holds = C4::Reserves::GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); -my $holdcount = scalar( @$holds ); -$template->param( holdcount => $holdcount, holds => $holds ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index 20a73d0..95788b0 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/catalogue/labeledMARCdetail.pl @@ -137,8 +137,5 @@ $template->param ( searchid => $query->param('searchid'), ); -my $holds= C4::Reserves::GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); -my $holdcount = scalar( @$holds ); -$template->param( holdcount => $holdcount, holds => $holds ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 8b07f15..28deb3b 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -35,7 +35,6 @@ use C4::Circulation; # to use itemissues use C4::Members; # to use GetMember use C4::Search; # enabled_staff_search_views use C4::Members qw/GetHideLostItemsPreference/; -use C4::Reserves qw(GetReservesFromBiblionumber); use Koha::DateUtils; my $query=new CGI; @@ -217,9 +216,6 @@ $template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items ); $template->{'VARS'}->{'searchid'} = $query->param('searchid'); -my $holds = GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); -my $holdcount = scalar( @$holds ); -$template->param( holdcount => $holdcount, holds => $holds ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index e083075..0f6906b 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -539,7 +539,7 @@ for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { } my $has_hold; if ( $show_holds_count || $show_priority) { - my $reserves = GetReservesFromBiblionumber({ biblionumber => $biblionumber }); + my $reserves = GetReservesFromBiblionumber({ biblionumber => $biblionumber, all_dates => 1 }); $template->param( holds_count => scalar( @$reserves ) ) if $show_holds_count; foreach (@$reserves) { $item_reserves{ $_->{itemnumber} }++ if $_->{itemnumber}; -- 1.7.7.6