From 55aebb21146978764a0062a8288abba0e56d4d8b 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 Labeled MARC (you need to set the syspref viewLabeledMARC) Hold(s) Article requests Checkout history Modification log Rota (you need to set the syspref StockRotation) 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. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit c6c4d82325eb7d11b34a113c69acbff18e283542) Signed-off-by: Martin Renvoize --- catalogue/issuehistory.pl | 2 ++ catalogue/labeledMARCdetail.pl | 2 ++ circ/request-article.pl | 2 ++ reserve/request.pl | 2 ++ tools/viewlog.pl | 2 ++ 5 files changed, 10 insertions(+) diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index f7044022f0..0c50dcbb88 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/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index a033b07181..9b5105103c 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/catalogue/labeledMARCdetail.pl @@ -27,6 +27,7 @@ use C4::Output; use C4::Biblio; use C4::Items; use C4::Search; # enabled_staff_search_views +use C4::Serials; use C4::Acquisition qw(GetOrdersByBiblionumber); use Koha::Biblios; @@ -121,6 +122,7 @@ $template->param ( labeledmarcview => 1, z3950_search_params => C4::Search::z3950_search_args($biblio), C4::Search::enabled_staff_search_views, + subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber), searchid => scalar $query->param('searchid'), ); diff --git a/circ/request-article.pl b/circ/request-article.pl index d32581809c..7c0877bff8 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 2902de09ae..ca2ddfe789 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; @@ -627,6 +628,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 e9e9f423ef..b8979ec776 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('object')), object => $object, ); -- 2.39.5