From 906042570f8a3444a6708d9a7b49f2dd32569c47 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 28 Jan 2015 14:47:49 +1100 Subject: [PATCH] Bug 13632 - Use a translateable file instead of the database for managing permission descriptions This patch defines a couple of blocks in "permissions.inc", which is included/processed in member-flags.tt to show the descriptions for the permissions and sub-permissions. _TEST PLAN_ Before applying: 1) Look at the descriptions for permissions and subpermissions 2) Open another tab/window and load the same page Apply the patch 3) Reload the second tab/window 4) Note that the descriptions are exactly the same as before If you're feeling bold, you can change the text in `permissions.description` and `userflags.flagdesc` and notice that the text on the page doesn't change. However, you should not delete the `permissions.description` column or change the text to NULL or blank. C4::Auth::get_all_subpermissions() uses the description for creating a hashref of subpermissions. If it can't get the column, Koha will explode. If there is nothing in the column, your subpermissions won't work correctly. --- .../intranet-tmpl/prog/en/includes/permissions.inc | 195 +++++++++++++++++++++ .../prog/en/modules/members/member-flags.tt | 5 +- 2 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc new file mode 100644 index 0000000..f052499 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -0,0 +1,195 @@ +[%- BLOCK main_permissions -%] +[% SWITCH name %] +[%- CASE 'superlibrarian' -%] +Access to all librarian functions +[%- CASE 'circulate' -%] +Check out and check in items +[%- CASE 'catalogue' -%] +Required for staff login. Staff access, allows viewing of catalogue in staff client. +[%- CASE 'parameters' -%] +Manage Koha system settings (Administration panel) +[%- CASE 'borrowers' -%] +Add or modify patrons +[%- CASE 'permissions' -%] +Set user permissions +[%- CASE 'reserveforothers' -%] +Place and modify holds for patrons +[%- CASE 'borrow' -%] +Borrow books +[%- CASE 'editcatalogue' -%] +Edit catalog (Modify bibliographic/holdings data) +[%- CASE 'updatecharges' -%] +Manage patrons fines and fees +[%- CASE 'acquisition' -%] +Acquisition and/or suggestion management +[%- CASE 'management' -%] +Set library management parameters (deprecated) +[%- CASE 'tools' -%] +Use all tools (expand for granular tools permissions) +[%- CASE 'editauthorities' -%] +Edit authorities +[%- CASE 'serials' -%] +Manage serial subscriptions +[%- CASE 'reports' -%] +Allow access to the reports module +[%- CASE 'staffaccess' -%] +Allow staff members to modify permissions for other staff members +[%- CASE 'coursereserves' -%] +Course reserves +[%- CASE 'plugins' -%] +Koha plugins +[%- CASE -%] +[%- END -%] +[%- END -%] + +[%- BLOCK sub_permissions -%] +[% SWITCH name %] +[%- CASE 'circulate_remaining_permissions' -%] +Remaining circulation permissions +[%- CASE 'force_checkout' -%] +Force checkout if a limitation exists +[%- CASE 'manage_restrictions' -%] +Manage restrictions for accounts +[%- CASE 'overdues_report' -%] +Execute overdue items report +[%- CASE 'override_renewals' -%] +Override blocked renewals +[%- CASE 'manage_circ_rules' -%] +manage circulation rules +[%- CASE 'parameters_remaining_permissions' -%] +Remaining system parameters permissions +[%- CASE 'modify_holds_priority' -%] +Modify holds priority +[%- CASE 'place_holds' -%] +Place holds for patrons +[%- CASE 'delete_all_items' -%] +Delete all items at once +[%- CASE 'edit_catalogue' -%] +Edit catalog (Modify bibliographic/holdings data) +[%- CASE 'edit_items' -%] +Edit items +[%- CASE 'edit_items_restricted' -%] +Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required) +[%- CASE 'fast_cataloging' -%] +Fast cataloging +[%- CASE 'remaining_permissions' -%] +Remaining permissions for managing fines and fees +[%- CASE 'writeoff' -%] +Write off fines and fees +[%- CASE 'budget_add_del' -%] +Add and delete budgets (but can't modify budgets) +[%- CASE 'budget_manage' -%] +Manage budgets +[%- CASE 'budget_manage_all' -%] +Manage all budgets +[%- CASE 'budget_modify' -%] +Modify budget (can't create lines, but can modify existing ones) +[%- CASE 'contracts_manage' -%] +Manage contracts +[%- CASE 'group_manage' -%] +Manage orders & basketgroups +[%- CASE 'order_manage' -%] +Manage orders & basket +[%- CASE 'order_manage_all' -%] +Manage all orders and baskets, regardless of restrictions on them +[%- CASE 'order_receive' -%] +Manage orders & basket +[%- CASE 'period_manage' -%] +Manage periods +[%- CASE 'planning_manage' -%] +Manage budget plannings +[%- CASE 'vendors_manage' -%] +Manage vendors +[%- CASE 'batch_upload_patron_images' -%] +Upload patron images in a batch or one at a time +[%- CASE 'delete_anonymize_patrons' -%] +Delete old borrowers and anonymize circulation history (deletes borrower reading history) +[%- CASE 'edit_calendar' -%] +Define days when the library is closed +[%- CASE 'edit_news' -%] +Write news for the OPAC and staff interfaces +[%- CASE 'edit_notice_status_triggers' -%] +Set notice/status triggers for overdue items +[%- CASE 'edit_notices' -%] +Define notices +[%- CASE 'edit_patrons' -%] +Perform batch modification of patrons +[%- CASE 'edit_quotes' -%] +Edit quotes for quote-of-the-day feature +[%- CASE 'export_catalog' -%] +Export bibliographic and holdings data +[%- CASE 'import_patrons' -%] +Import patron data +[%- CASE 'inventory' -%] +Perform inventory (stocktaking) of your catalog +[%- CASE 'items_batchdel' -%] +Perform batch deletion of items +[%- CASE 'items_batchmod' -%] +Perform batch modification of items +[%- CASE 'items_batchmod_restricted' -%] +Limit batch item modification to subfields defined in the SubfieldsToAllowForRestrictedBatchmod preference (please note that items_batchmod is still required) +[%- CASE 'label_creator' -%] +Create printable labels and barcodes from catalog and patron data +[%- CASE 'manage_csv_profiles' -%] +Manage CSV export profiles +[%- CASE 'manage_patron_lists' -%] +Add, edit and delete patron lists and their contents +[%- CASE 'manage_staged_marc' -%] +Managed staged MARC records, including completing and reversing imports +[%- CASE 'marc_modification_templates' -%] +Manage marc modification templates +[%- CASE 'moderate_comments' -%] +Moderate patron comments +[%- CASE 'moderate_tags' -%] +Moderate patron tags +[%- CASE 'records_batchdel' -%] +Perform batch deletion of records (bibliographic or authority) +[%- CASE 'rotating_collections' -%] +Manage rotating collections +[%- CASE 'schedule_tasks' -%] +Schedule tasks to run +[%- CASE 'stage_marc_import' -%] +Stage MARC records into the reservoir +[%- CASE 'upload_local_cover_images' -%] +Upload local cover images +[%- CASE 'view_system_logs' -%] +Browse the system logs +[%- CASE 'check_expiration' -%] +Check the expiration of a serial +[%- CASE 'claim_serials' -%] +Claim missing serials +[%- CASE 'create_subscription' -%] +Create a new subscription +[%- CASE 'delete_subscription' -%] +Delete an existing subscription +[%- CASE 'edit_subscription' -%] +Edit an existing subscription +[%- CASE 'receive_serials' -%] +Serials receiving +[%- CASE 'renew_subscription' -%] +Renew a subscription +[%- CASE 'routing' -%] +Routing +[%- CASE 'superserials' -%] +Manage subscriptions from any branch (only applies when IndependentBranches is used) +[%- CASE 'create_reports' -%] +Create SQL reports +[%- CASE 'execute_reports' -%] +Execute SQL reports +[%- CASE 'add_reserves' -%] +Add course reserves +[%- CASE 'delete_reserves' -%] +Remove course reserves +[%- CASE 'manage_courses' -%] +Add, edit and delete courses +[%- CASE 'configure' -%] +Configure plugins +[%- CASE 'manage' -%] +Manage plugins ( install / uninstall ) +[%- CASE 'report' -%] +Use report plugins +[%- CASE 'tool' -%] +Use tool plugins +[%- CASE -%] +[%- END -%] +[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt index c1e751e..f68027a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt @@ -1,3 +1,4 @@ +[% PROCESS 'permissions.inc' %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Set permissions for [% surname %], [% firstname %] @@ -131,7 +132,7 @@ [% END %] - [% loo.flagdesc %] + [% PROCESS main_permissions name=loo.flag %] [% IF ( loo.sub_perm_loop ) %] -- 2.1.4