From 9a43a47755c43a58c8cf6303cf7bfb678bb017d6 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Fri, 16 Oct 2009 17:43:56 +0200 Subject: [PATCH] MT 2051 : granular permissions for guided reports --- .../mysql/en/mandatory/userpermissions.sql | 24 ++++++++++--------- installer/data/mysql/updatedatabase.pl | 14 +++++++++++ .../prog/en/includes/guided-reports-view.inc | 6 ++--- .../modules/reports/guided_reports_start.tmpl | 22 ++++++++++------- .../prog/en/modules/reports/reports-home.tmpl | 6 ++--- reports/acquisitions_stats.pl | 2 +- reports/bor_issues_top.pl | 2 +- reports/borrowers_out.pl | 2 +- reports/borrowers_stats.pl | 2 +- reports/cat_issues_top.pl | 2 +- reports/catalogue_out.pl | 2 +- reports/catalogue_stats.pl | 2 +- reports/dictionary.pl | 2 +- reports/guided_reports.pl | 14 +++++++++-- reports/issues_avg_stats.pl | 2 +- reports/issues_stats.pl | 2 +- reports/itemslost.pl | 2 +- reports/manager.pl | 2 +- reports/reports-home.pl | 2 +- reports/reservereport.pl | 2 +- reports/serials_stats.pl | 2 +- reports/stats.screen.pl | 2 +- 22 files changed, 75 insertions(+), 43 deletions(-) diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index 6f4c23004f..3ae0953e28 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -1,6 +1,16 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'), ( 1, 'override_renewals', 'Override blocked renewals'), + (11, 'vendors_manage', 'Manage vendors'), + (11, 'contracts_manage', 'Manage contracts'), + (11, 'period_manage', 'Manage periods'), + (11, 'budget_manage', 'Manage budgets'), + (11, 'budget_modify', 'Modify budget (can''t create lines, but can modify existing ones)'), + (11, 'planning_manage', 'Manage budget plannings'), + (11, 'order_manage', 'Manage orders & basket'), + (11, 'group_manage', 'Manage orders & basketgroups'), + (11, 'order_receive', 'Manage orders & basket'), + (11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)'), (13, 'edit_news', 'Write news for the OPAC and staff interfaces'), (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'), (13, 'edit_calendar', 'Define days when the library is closed'), @@ -18,15 +28,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'schedule_tasks', 'Schedule tasks to run'), (13, 'batchmod', 'Perform batch modification of items'), (13, 'batchdel', 'Perform batch deletion of items'), - (13, 'manage_csv_profiles', 'Manage CSV export profiles') - (11, 'vendors_manage', 'Manage vendors'), - (11, 'contracts_manage', 'Manage contracts'), - (11, 'period_manage', 'Manage periods'), - (11, 'budget_manage', 'Manage budgets'), - (11, 'budget_modify', 'Modify budget (can''t create lines, but can modify existing ones)'), - (11, 'planning_manage', 'Manage budget plannings'), - (11, 'order_manage', 'Manage orders & basket'), - (11, 'group_manage', 'Manage orders & basketgroups'), - (11, 'order_receive', 'Manage orders & basket'), - (11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)') + (13, 'manage_csv_profiles', 'Manage CSV export profiles'), + (16, 'execute_reports', 'Execute SQL reports'), + (16, 'create_reports', 'Create SQL Reports') ; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index fc46f61428..89505f14fc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3071,6 +3071,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (intranetbookbag syspref added)\n"; SetVersion ($DBversion); } + $DBversion = "3.01.00.117"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do( qq# ALTER TABLE authorised_values ADD COLUMN `lib_opac` VARCHAR(80) default NULL AFTER `lib` #); @@ -3079,6 +3080,19 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.01.00.118"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { +$dbh->do(" + INSERT INTO `permissions` (`module_bit`, `code`, `description`) VALUES + (16, 'execute_reports', 'Execute SQL reports'), + (16, 'create_reports', 'Create SQL Reports') + "); + + print "Upgrade to $DBversion done (granular permissions for guided reports added)\n"; + SetVersion ($DBversion); +} + + =item DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc index f9ad7bf496..f4940525a9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc @@ -1,8 +1,8 @@
Build and Run Reports
Reports Dictionary