From e536fd087d540065d2ccbe12925695bb770d4314 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 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 Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- 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 dd1c5c8763..ffc6c5e016 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 73e44beac5..8eadb77fa6 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 b5135a9b00..3f71a875f7 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -414,9 +414,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 7f994f640b..39a5102782 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 20a73d0cd5..95788b01b9 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 8b07f153fb..28deb3bf64 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 e0830759ae..0f6906ba04 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}; -- 2.39.5