Bug 9823: QA follow-up for GetReservesFromBiblionumber calls
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 24 Jan 2014 08:59:03 +0000 (09:59 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 30 Jan 2014 16:23:34 +0000 (16:23 +0000)
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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
catalogue/ISBDdetail.pl
catalogue/MARCdetail.pl
catalogue/detail.pl
catalogue/imageviewer.pl
catalogue/labeledMARCdetail.pl
catalogue/moredetail.pl
opac/opac-detail.pl

index dd1c5c8..ffc6c5e 100755 (executable)
@@ -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;
 
index 73e44be..8eadb77 100755 (executable)
@@ -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;
index b5135a9..3f71a87 100755 (executable)
@@ -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
index 7f994f6..39a5102 100755 (executable)
@@ -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;
index 20a73d0..95788b0 100755 (executable)
@@ -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;
index 8b07f15..28deb3b 100755 (executable)
@@ -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;
 
index e083075..0f6906b 100755 (executable)
@@ -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};