From e31b7bd9a524a52097ce79421cee9ef2fc96bf26 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 10 Feb 2010 16:18:58 -0500 Subject: [PATCH] Fix for Bug 2970, Create a permission for modifying holds priority Adding two new granular permissions under 'reserveforothers,' place_holds and modify_holds_priority. If a user does not have modify_holds_priority permission, the option to change the priority of a hold is hidden. Revised patch includes changes to mandatory data files including properly translated fr-FR version. Signed-off-by: Galen Charlton --- .../data/mysql/en/mandatory/userflags.sql | 2 +- .../mysql/en/mandatory/userpermissions.sql | 2 + .../mysql/fr-FR/1-Obligatoire/userflags.sql | 2 +- .../fr-FR/1-Obligatoire/userpermissions.sql | 2 + .../data/mysql/pl-PL/mandatory/userflags.sql | 2 +- .../mysql/pl-PL/mandatory/userpermissions.sql | 2 + .../data/mysql/ru-RU/mandatory/user_flags.sql | 2 +- .../mysql/ru-RU/mandatory/userpermissions.sql | 2 + .../data/mysql/uk-UA/mandatory/user_flags.sql | 2 +- .../mysql/uk-UA/mandatory/userpermissions.sql | 40 +++++++++++++++++++ .../mysql/uk-UA/mandatory/userpermissions.txt | 1 + installer/data/mysql/updatedatabase.pl | 12 ++++++ .../prog/en/modules/reserve/request.tmpl | 14 +++---- reserve/request.pl | 2 +- 14 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 installer/data/mysql/uk-UA/mandatory/userpermissions.sql create mode 100644 installer/data/mysql/uk-UA/mandatory/userpermissions.txt diff --git a/installer/data/mysql/en/mandatory/userflags.sql b/installer/data/mysql/en/mandatory/userflags.sql index 9f84d78a2e..e9d9b2e62b 100644 --- a/installer/data/mysql/en/mandatory/userflags.sql +++ b/installer/data/mysql/en/mandatory/userflags.sql @@ -4,7 +4,7 @@ INSERT INTO `userflags` VALUES(2,'catalogue','View Catalog (Librarian Interface) INSERT INTO `userflags` VALUES(3,'parameters','Set Koha system parameters',0); INSERT INTO `userflags` VALUES(4,'borrowers','Add or modify borrowers',0); INSERT INTO `userflags` VALUES(5,'permissions','Set user permissions',0); -INSERT INTO `userflags` VALUES(6,'reserveforothers','Reserve books for patrons',0); +INSERT INTO `userflags` VALUES(6,'reserveforothers','Place and modify holds for patrons',0); INSERT INTO `userflags` VALUES(7,'borrow','Borrow books',1); INSERT INTO `userflags` VALUES(9,'editcatalogue','Edit Catalog (Modify bibliographic/holdings data)',0); INSERT INTO `userflags` VALUES(10,'updatecharges','Update borrower charges',0); diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index fc9f30551a..d737ae6f6e 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -1,6 +1,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'), ( 1, 'override_renewals', 'Override blocked renewals'), + ( 6, 'place_holds', 'Place holds for patrons'), + ( 6, 'modify_holds_priority', 'Modify holds priority'), ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), ( 9, 'fast_cataloging', 'Fast cataloging'), (11, 'vendors_manage', 'Manage vendors'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql index 2cd644f230..68fea6e610 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userflags.sql @@ -6,7 +6,7 @@ INSERT INTO `userflags` VALUES(2,'catalogue','Consultation du catalogue (interfa INSERT INTO `userflags` VALUES(3,'parameters','Définition des paramètres de l''application',0); INSERT INTO `userflags` VALUES(4,'borrowers','Gestion des lecteurs',0); INSERT INTO `userflags` VALUES(5,'permissions','Définition des habilitations',0); -INSERT INTO `userflags` VALUES(6,'reserveforothers','Gestion des réservations',0); +INSERT INTO `userflags` VALUES(6,'reserveforothers','Ajout et modifications des réservations des adhérents',0); INSERT INTO `userflags` VALUES(7,'borrow','Circulation (inutile normalement)',1); INSERT INTO `userflags` VALUES(9,'editcatalogue','fonctions de catalogage',0); INSERT INTO `userflags` VALUES(10,'updatecharges','Gestion des pénalités financières',0); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql index 4e1902db69..364469bd6a 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -1,6 +1,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'), ( 1, 'override_renewals', 'Override blocked renewals'), + ( 6, 'place_holds', 'Réserver pour des adhérents'), + ( 6, 'modify_holds_priority', 'Modifier la priorité des réservations'), ( 9, 'edit_catalogue', 'Editer le catalogue'), ( 9, 'fast_cataloging', 'Catalogage rapide'), (13, 'edit_news', 'Write news for the OPAC and staff interfaces'), diff --git a/installer/data/mysql/pl-PL/mandatory/userflags.sql b/installer/data/mysql/pl-PL/mandatory/userflags.sql index 9f84d78a2e..e9d9b2e62b 100755 --- a/installer/data/mysql/pl-PL/mandatory/userflags.sql +++ b/installer/data/mysql/pl-PL/mandatory/userflags.sql @@ -4,7 +4,7 @@ INSERT INTO `userflags` VALUES(2,'catalogue','View Catalog (Librarian Interface) INSERT INTO `userflags` VALUES(3,'parameters','Set Koha system parameters',0); INSERT INTO `userflags` VALUES(4,'borrowers','Add or modify borrowers',0); INSERT INTO `userflags` VALUES(5,'permissions','Set user permissions',0); -INSERT INTO `userflags` VALUES(6,'reserveforothers','Reserve books for patrons',0); +INSERT INTO `userflags` VALUES(6,'reserveforothers','Place and modify holds for patrons',0); INSERT INTO `userflags` VALUES(7,'borrow','Borrow books',1); INSERT INTO `userflags` VALUES(9,'editcatalogue','Edit Catalog (Modify bibliographic/holdings data)',0); INSERT INTO `userflags` VALUES(10,'updatecharges','Update borrower charges',0); diff --git a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql index 110656a2a2..5e787ee57d 100755 --- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql +++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql @@ -1,6 +1,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'), ( 1, 'override_renewals', 'Override blocked renewals'), + ( 6, 'place_holds', 'Place holds for patrons'), + ( 6, 'modify_holds_priority', 'Modify holds priority'), ( 9, 'edit_catalogue', 'Edit catalogue'), ( 9, 'fast_cataloging', 'Szybkie katalogowanie'), (11, 'vendors_manage', 'Zarządzanei dostawcami'), diff --git a/installer/data/mysql/ru-RU/mandatory/user_flags.sql b/installer/data/mysql/ru-RU/mandatory/user_flags.sql index 087cdd94cb..5bc337a71a 100644 --- a/installer/data/mysql/ru-RU/mandatory/user_flags.sql +++ b/installer/data/mysql/ru-RU/mandatory/user_flags.sql @@ -6,7 +6,7 @@ INSERT INTO `userflags` VALUES(2, 'catalogue', 'Просмотр ката INSERT INTO `userflags` VALUES(3, 'parameters', 'Установка системных настроек Koha',0); INSERT INTO `userflags` VALUES(4, 'borrowers', 'Внесение и изменение посетителей',0); INSERT INTO `userflags` VALUES(5, 'permissions', 'Установка привилегий пользователя',0); -INSERT INTO `userflags` VALUES(6, 'reserveforothers','Резервирование книжек для посетителей',0); +INSERT INTO `userflags` VALUES(6, 'reserveforothers','Place and modify holds for patrons',0); INSERT INTO `userflags` VALUES(7, 'borrow', 'Заем книг',1); INSERT INTO `userflags` VALUES(9, 'editcatalogue', 'Изменение каталога (изменение библиографических/локальных данных)',0); INSERT INTO `userflags` VALUES(10,'updatecharges', 'Обновление оплат пользователей',0); diff --git a/installer/data/mysql/ru-RU/mandatory/userpermissions.sql b/installer/data/mysql/ru-RU/mandatory/userpermissions.sql index c58bc933a6..eca6738c11 100644 --- a/installer/data/mysql/ru-RU/mandatory/userpermissions.sql +++ b/installer/data/mysql/ru-RU/mandatory/userpermissions.sql @@ -1,6 +1,8 @@ TRUNCATE permissions; INSERT INTO permissions (module_bit, code, description) VALUES + ( 6, 'place_holds', 'Place holds for patrons'), + ( 6, 'modify_holds_priority', 'Modify holds priority'), (13, 'edit_news', 'Написание новостей для электронного каталога и интерфейса библиотекарей'), (13, 'label_creator', 'Создание печатных наклеек и штрихкодов из каталога и с данными о пользователях'), (13, 'edit_calendar', 'Определение дней, когда библиотека закрыта'), diff --git a/installer/data/mysql/uk-UA/mandatory/user_flags.sql b/installer/data/mysql/uk-UA/mandatory/user_flags.sql index 167c716efa..3cea5d0278 100644 --- a/installer/data/mysql/uk-UA/mandatory/user_flags.sql +++ b/installer/data/mysql/uk-UA/mandatory/user_flags.sql @@ -6,7 +6,7 @@ INSERT INTO `userflags` VALUES(2, 'catalogue', 'Перегляд ката INSERT INTO `userflags` VALUES(3, 'parameters', 'Встановлення системних налаштувань Koha',0); INSERT INTO `userflags` VALUES(4, 'borrowers', 'Внесення та зміна відвідувачів',0); INSERT INTO `userflags` VALUES(5, 'permissions', 'Встановлення привілеїв користувача',0); -INSERT INTO `userflags` VALUES(6, 'reserveforothers','Резервування книжок для відвідувачів',0); +INSERT INTO `userflags` VALUES(6, 'reserveforothers','Place and modify holds for patrons',0); INSERT INTO `userflags` VALUES(7, 'borrow', 'Випозичання книжок',1); INSERT INTO `userflags` VALUES(9, 'editcatalogue', 'Редагування каталогу (зміна бібліографічних/локальних даних)',0); INSERT INTO `userflags` VALUES(10,'updatecharges', 'Оновлення сплат користувачів',0); diff --git a/installer/data/mysql/uk-UA/mandatory/userpermissions.sql b/installer/data/mysql/uk-UA/mandatory/userpermissions.sql new file mode 100644 index 0000000000..d737ae6f6e --- /dev/null +++ b/installer/data/mysql/uk-UA/mandatory/userpermissions.sql @@ -0,0 +1,40 @@ +INSERT INTO permissions (module_bit, code, description) VALUES + ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions'), + ( 1, 'override_renewals', 'Override blocked renewals'), + ( 6, 'place_holds', 'Place holds for patrons'), + ( 6, 'modify_holds_priority', 'Modify holds priority'), + ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), + ( 9, 'fast_cataloging', 'Fast cataloging'), + (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'), + (13, 'moderate_comments', 'Moderate patron comments'), + (13, 'edit_notices', 'Define notices'), + (13, 'edit_notice_status_triggers', 'Set notice/status triggers for overdue items'), + (13, 'view_system_logs', 'Browse the system logs'), + (13, 'inventory', 'Perform inventory (stocktaking) of your catalog'), + (13, 'stage_marc_import', 'Stage MARC records into the reservoir'), + (13, 'manage_staged_marc', 'Managed staged MARC records, including completing and reversing imports'), + (13, 'export_catalog', 'Export bibliographic and holdings data'), + (13, 'import_patrons', 'Import patron data'), + (13, 'delete_anonymize_patrons', 'Delete old borrowers and anonymize circulation history (deletes borrower reading history)'), + (13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'), + (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'), + (13, 'moderate_tags', 'Moderate patron tags'), + (13, 'rotating_collections', 'Manage rotating collections'), + (16, 'execute_reports', 'Execute SQL reports'), + (16, 'create_reports', 'Create SQL Reports') +; diff --git a/installer/data/mysql/uk-UA/mandatory/userpermissions.txt b/installer/data/mysql/uk-UA/mandatory/userpermissions.txt new file mode 100644 index 0000000000..59b7ce1b19 --- /dev/null +++ b/installer/data/mysql/uk-UA/mandatory/userpermissions.txt @@ -0,0 +1 @@ +Detailed staff user permissions diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d1f01e2e3a..da1ad890d1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3500,6 +3500,18 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.01.00.123"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `permissions` (`module_bit`, `code`, `description`) VALUES + (6, 'place_holds', 'Place holds for patrons')"); + $dbh->do("INSERT INTO `permissions` (`module_bit`, `code`, `description`) VALUES + (6, 'modify_holds_priority', 'Modify holds priority')"); + $dbh->do("UPDATE `userflags` SET `flagdesc` = 'Place and modify holds for patrons' WHERE `flag` = 'reserveforothers'"); + print "Upgrade to $DBversion done (Add granular permission for holds modification and update description of reserveforothers permission)\n"; + SetVersion ($DBversion); +} + + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl index 6fbdf0c3b3..b6d3f44f2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -270,7 +270,7 @@ function checkMultiHold() {
  • - Priority: + Priority:
  • @@ -495,7 +495,7 @@ function checkMultiHold() { " alt="" title="" /> - +