From 8d70ea948717325212501d8a301ebff93f4ecd17 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 22 Sep 2015 09:47:25 +0100 Subject: [PATCH] Bug 13632: Use an include file to display permissions This patch set moves the permissions' descriptions to the po files instead of having them in the DB. Test plan: 0/ Apply all patches 1/ Create a new installation 2/ Confirm the userflags and permissions tables are correctly populated 3/ Update the po file for a translated language 4/ Confirm you are able to translate the permissions descriptions 5/ Install the template files for this language 6/ Switch the interface to use this language and confirm the string are correctly translated. QA Note: At this point we could remove the userflags.flagdesc and permissions.description DB fields, but I would prefer to keep them: developers will know what the permission do without the need to go and see the include file (we have it in the sql files and so, in the DB). Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/includes/permissions.inc | 103 ++++++++++++++++++ .../prog/en/modules/members/member-flags.tt | 5 +- 2 files changed, 106 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 0000000000..9db7388c2a --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -0,0 +1,103 @@ +[%- 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 '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 'lists' -%]Lists + [%- 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 'records_batchmod' -%]Perform batch modification of records (biblios or authorities) + [%- 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 'delete_public_lists' -%]Delete public lists + [%- 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 c1e751e39f..f68027a010 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 ) %]
    [% FOREACH sub_perm_loo IN loo.sub_perm_loop %] @@ -142,7 +143,7 @@ [% END %] - [% sub_perm_loo.description %] + [% PROCESS sub_permissions name=sub_perm_loo.code %] [% END %]
-- 2.39.5