From 8b777921fb6f094feb9ca5868cf90bb3cc61341a Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Thu, 6 Jul 2017 16:34:32 +0200 Subject: [PATCH] Bug 11897: Follow up: Check syspref before stockrotation access. * koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc: Add check for syspref. * koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc: Add check for syspref. * koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt: Add check for syspref. * tools/stockrotation.pl: Add check for syspref. * catalogue/stockrotation.pl: Add check for syspref. Signed-off-by: Kathleen Milne --- catalogue/stockrotation.pl | 6 ++++++ .../prog/en/includes/biblio-view-menu.inc | 2 +- .../intranet-tmpl/prog/en/includes/tools-menu.inc | 21 ++++++++++++++++++++- .../prog/en/modules/tools/tools-home.tt | 4 +++- tools/stockrotation.pl | 7 +++++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/catalogue/stockrotation.pl b/catalogue/stockrotation.pl index 8969b5bb12..ff63b8a270 100755 --- a/catalogue/stockrotation.pl +++ b/catalogue/stockrotation.pl @@ -39,6 +39,12 @@ use Koha::Util::StockRotation qw(:ALL); my $input = new CGI; +unless (C4::Context->preference('StockRotation')) { + # redirect to Intranet home if self-check is not enabled + print $input->redirect("/cgi-bin/koha/mainpage.pl"); + exit; +} + my %params = $input->Vars(); my $op = $params{op}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc index 0253b8c90a..b32f60939e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc @@ -40,7 +40,7 @@ [% IF ( issuehistoryview ) %]
  • [% ELSE %]
  • [% END %] Checkout history
  • [% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]
  • [% ELSE %]
  • [% END %]Modification log
  • [% END %] -[% IF ( CAN_user_stockrotation_can_add_items_rotas ) %][% IF ( stockrotationview ) %]
  • [% ELSE %]
  • [% END %]Rota
  • [% END %] +[% IF ( CAN_user_stockrotation_can_add_items_rotas && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]
  • [% ELSE %]
  • [% END %]Rota
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc index 217f1a1cd3..d4a6ad2b1c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -1,3 +1,22 @@ +[% USE Koha %] + +