From 6274e158578a2cdf4e61f474febe43d941c26440 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 18 Jun 2018 14:42:28 +0100 Subject: [PATCH] Bug 11897: (follow-up) Make permissions more consistent --- catalogue/stockrotation.pl | 2 +- installer/data/mysql/atomicupdate/stockrot_tables.sql | 4 ++-- installer/data/mysql/userpermissions.sql | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc | 2 +- .../intranet-tmpl/prog/en/modules/tools/stockrotation.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/catalogue/stockrotation.pl b/catalogue/stockrotation.pl index cc3008d97c..30660d79ce 100755 --- a/catalogue/stockrotation.pl +++ b/catalogue/stockrotation.pl @@ -59,7 +59,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user( authnotrequired => 0, flagsrequired => { catalogue => 1, - stockrotation => 'can_add_items_rotas', + stockrotation => 'manage_rota_items', }, } ); diff --git a/installer/data/mysql/atomicupdate/stockrot_tables.sql b/installer/data/mysql/atomicupdate/stockrot_tables.sql index 8ca89a0c6b..68b2021995 100644 --- a/installer/data/mysql/atomicupdate/stockrot_tables.sql +++ b/installer/data/mysql/atomicupdate/stockrot_tables.sql @@ -60,8 +60,8 @@ INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (23, 'stockrotation', 'Manage stockrotation operations', 0); INSERT IGNORE INTO permissions (module_bit, code, description) VALUES - (23, 'can_edit_rotas', 'Create, edit and delete rotas'), - (23, 'can_add_items_rotas', 'Add and remove items from rotas'); + (23, 'manage_rotas', 'Create, edit and delete rotas'), + (23, 'manage_rota_items', 'Add and remove items from rotas'); -- Notices diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql index 40001e5d77..e1c60f85eb 100644 --- a/installer/data/mysql/userpermissions.sql +++ b/installer/data/mysql/userpermissions.sql @@ -86,6 +86,6 @@ INSERT INTO permissions (module_bit, code, description) VALUES (21, 'enroll', 'Enroll patrons in clubs'), (23, 'self_checkin_module', 'Log into the self check-in module'), (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID') - (24, 'can_edit_rotas', 'Create, edit and delete rotas'), - (24, 'can_add_items_rotas', 'Add and remove items from rotas') + (24, 'manage_rotas', 'Create, edit and delete rotas'), + (24, 'manage_rota_items', 'Add and remove items from rotas') ; 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 a6230f323f..6556615a8f 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 && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]
  • [% ELSE %]
  • [% END %]Rota
  • [% END %] +[% IF ( CAN_user_stockrotation_manage_rota_items && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]
  • [% ELSE %]
  • [% END %]Rota
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index e590787ab5..6f6cf76058 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -115,7 +115,7 @@ [%# self_check %] [%- CASE 'self_checkin_module' -%]Log into the self check-in module. Note: this permission prevents the patron from using any other OPAC functionality [%- CASE 'self_checkout_module' -%]Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID - [%- CASE 'can_add_items_rotas' -%]Add and remove items from rotas - [%- CASE 'can_edit_rotas' -%]Create, edit and delete rotas + [%- CASE 'manage_rota_items' -%]Add and remove items from rotas + [%- CASE 'manage_rotas' -%]Create, edit and delete rotas [%- END -%] [%- 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 5660878970..bef464c37b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -40,7 +40,7 @@ [% IF ( CAN_user_tools_batch_upload_patron_images ) %]
  • Upload patron images
  • [% END %] - [% IF ( CAN_user_stockrotation_can_edit_rotas && Koha.Preference('StockRotation') ) %] + [% IF ( CAN_user_stockrotation_manage_rotas && Koha.Preference('StockRotation') ) %]
  • Stock rotation
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt index f4a2c5a0d2..3560e568cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt @@ -97,7 +97,7 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt index d7efdf82ec..baaf67f200 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -72,7 +72,7 @@
    Upload patron images in a batch or one at a time
    [% END %] - [% IF ( CAN_user_stockrotation_can_edit_rotas && Koha.Preference('StockRotation') ) %] + [% IF ( CAN_user_stockrotation_manage_rotas && Koha.Preference('StockRotation') ) %]
    Stock rotation
    Manage Stock rotation rotas, rota stages and rota items
    [% END %] -- 2.17.1