From c6c4d82325eb7d11b34a113c69acbff18e283542 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 --- catalogue/issuehistory.pl | 2 ++ catalogue/labeledMARCdetail.pl | 2 ++ catalogue/stockrotation.pl | 3 +++ circ/request-article.pl | 2 ++ reserve/request.pl | 2 ++ tools/viewlog.pl | 2 ++ 6 files changed, 13 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/catalogue/stockrotation.pl b/catalogue/stockrotation.pl index 8b6a32451f..250167c28a 100755 --- a/catalogue/stockrotation.pl +++ b/catalogue/stockrotation.pl @@ -30,6 +30,7 @@ use CGI; use C4::Auth; use C4::Output; use C4::Search; +use C4::Serials; use Koha::Biblio; use Koha::Item; @@ -123,6 +124,7 @@ if (!defined $op) { biblio => $biblio, biblionumber => $biblio->biblionumber, stockrotationview => 1, + subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber), C4::Search::enabled_staff_search_views ); @@ -165,6 +167,7 @@ if (!defined $op) { item_id => $params{item_id}, biblionumber => $params{biblionumber}, stockrotationview => 1, + subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber), C4::Search::enabled_staff_search_views ); 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 3ebd8733bc..9e21963939 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 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