From 76424d9b7e0362fa46080857713db70189e64c54 Mon Sep 17 00:00:00 2001 From: Blou Date: Thu, 4 Oct 2018 13:00:08 -0400 Subject: [PATCH] Bug 21291: (follow up) Pass subscriptionsnumber to all tools in staff detail's sidebar The subscriptionsnumber is required in biblio-view-menu.inc to display the Subscription(s) tab. In detail.pl, if you click any of Hold(s) Article requests Checkout history Modification log you lose the Subscription(s) tab. This patch fixes the display by having each feature script generate that value to be passed to the UI. I keep this separated from the first patch since it's not exactly the same issue, and the solution might not please. --- catalogue/issuehistory.pl | 2 ++ circ/request-article.pl | 2 ++ reserve/request.pl | 2 ++ tools/viewlog.pl | 2 ++ 4 files changed, 8 insertions(+) diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index f704402..0c50dcb 100755 --- a/catalogue/issuehistory.pl +++ b/catalogue/issuehistory.pl @@ -24,6 +24,7 @@ use C4::Output; use C4::Biblio; # GetBiblio use C4::Search; # enabled_staff_search_views +use C4::Serials; use Koha::Checkouts; use Koha::Old::Checkouts; @@ -64,6 +65,7 @@ $template->param( biblio => $biblio, issuehistoryview => 1, C4::Search::enabled_staff_search_views, + subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber), ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/circ/request-article.pl b/circ/request-article.pl index d325818..7c0877b 100755 --- a/circ/request-article.pl +++ b/circ/request-article.pl @@ -23,6 +23,7 @@ use C4::Output; use C4::Auth; use C4::Utils::DataTables::Members; use C4::Search; +use C4::Serials; use Koha::Biblios; use Koha::Patrons; use Koha::ArticleRequests; @@ -110,6 +111,7 @@ if ( !$patron && $patron_cardnumber ) { $template->param( biblio => $biblio, patron => $patron, + subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber), C4::Search::enabled_staff_search_views, ); diff --git a/reserve/request.pl b/reserve/request.pl index 3ebd873..9e21963 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -37,6 +37,7 @@ use C4::Reserves; use C4::Biblio; use C4::Items; use C4::Koha; +use C4::Serials; use C4::Circulation; use Koha::DateUtils; use C4::Utils::DataTables::Members; @@ -633,6 +634,7 @@ $template->param( biblioloop => \@biblioloop ); $template->param( biblionumbers => $biblionumbers ); $template->param( exceeded_maxreserves => $exceeded_maxreserves ); $template->param( exceeded_holds_per_record => $exceeded_holds_per_record ); +$template->param( subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber)); if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { $template->param( reserve_in_future => 1 ); diff --git a/tools/viewlog.pl b/tools/viewlog.pl index e9e9f42..02931c0 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -28,6 +28,7 @@ use C4::Koha; use C4::Output; use C4::Log; use C4::Items; +use C4::Serials; use C4::Debug; use C4::Search; # enabled_staff_search_views use Koha::Patrons; @@ -94,6 +95,7 @@ if ( $src eq 'circ' ) { $template->param( debug => $debug, C4::Search::enabled_staff_search_views, + subscriptionsnumber => CountSubscriptionFromBiblionumber($input->param('biblionumber')), object => $object, ); -- 2.7.4