From 265bee141c36a853451010d6e31eb4e04ccd42b4 Mon Sep 17 00:00:00 2001 From: Blou Date: Tue, 19 Apr 2016 11:20:00 -0400 Subject: [PATCH] Bug 11317 - Move file access under Tools and add specific permission - Moves the .pl and .tt under tools/ instead of reports/ and adds tools/access_files permission. - Remove datatables-strings.inc from .tt - Allow sorting on date column in file access tool. For some reason, the table was blocking sorting based on timestamp, even though most users would probably want that since the feature is used primarily to access generated (daily) reports i and finding the last ones is very important. Testing -1) Having done requirements of previous patches, like adding 'accessdir' to koha-conf... 0) apply patch, update database to add permission option. 1) Login as NON-superadmin. Go under tools, see no Report/Log under the third column 2) Go to add tools/access_file permission to user 3) See new entry under tools third column. 4) validate link is ok. --- .../bz11317-add-permission-for-tools-access-file.sql | 1 + installer/data/mysql/userpermissions.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 1 + .../{reports/report_files.tt => tools/access_files.tt} | 9 ++++----- koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt | 4 +++- reports/report_files.pl => tools/access_files.pl | 11 ++++++----- 6 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bz11317-add-permission-for-tools-access-file.sql rename koha-tmpl/intranet-tmpl/prog/en/modules/{reports/report_files.tt => tools/access_files.tt} (82%) rename reports/report_files.pl => tools/access_files.pl (93%) diff --git a/installer/data/mysql/atomicupdate/bz11317-add-permission-for-tools-access-file.sql b/installer/data/mysql/atomicupdate/bz11317-add-permission-for-tools-access-file.sql new file mode 100644 index 0000000..dc49a78 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bz11317-add-permission-for-tools-access-file.sql @@ -0,0 +1 @@ +INSERT INTO permissions (module_bit, code, description) VALUES (13, 'access_files', 'Access to the files stored on the server'); diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql index 172f4c6..90fe6c0 100644 --- a/installer/data/mysql/userpermissions.sql +++ b/installer/data/mysql/userpermissions.sql @@ -57,6 +57,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'records_batchmod', 'Perform batch modification of records (biblios or authorities)'), (13, 'marc_modification_templates', 'Manage marc modification templates'), (13, 'records_batchdel', 'Perform batch deletion of records (bibliographic or authority)'), + (13, 'access_files', 'Access to the files stored on the server'), (13, 'upload_general_files', 'Upload any file'), (13, 'upload_manage', 'Manage uploaded files'), (15, 'check_expiration', 'Check the expiration of a serial'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 7c6275a..3145938 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -104,6 +104,7 @@ [%- CASE 'delete_public_lists' -%]Delete public lists [%- CASE 'upload_general_files' -%]Upload any file [%- CASE 'upload_manage' -%]Manage uploaded files (Useless without upload_general_files) + [%- CASE 'access_files' -%]Access to the files stored on the server [%- CASE 'edit_clubs' -%]Create and edit clubs [%- CASE 'edit_templates' -%]Create and edit club templates [%- CASE 'enroll' -%]Enroll patrons in clubs diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt similarity index 82% rename from koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt rename to koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt index 06de9d1..1f8a394 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/report_files.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt @@ -3,14 +3,13 @@ [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] -[% INCLUDE 'datatables-strings.inc' %]