From b1ac660a7cc832d46a27f078f371e78ca5e08b24 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 13 Sep 2013 14:45:50 -0400 Subject: [PATCH] Bug 10888 - Don't hide authorities module from users without permission to edit authorities Content-Type: text/plain; charset="utf-8" It should be possible for staff client users to search and view authority records even if they don't have permission to edit them. To test, apply the patch and view the staff client as a user with and without "editauthorities" permission. With "editauthorities" permission, authority search results should show both an edit and delete link. Viewing the details of an authority record, one should see a toolbar with edit/delete/new options. The detail view has been altered to use the term "record" in place of "biblio" ("Used in X record(s)). Without "editauthorities" permission, authority search results should show no edit or delete link. Viewing the details of an authority, the only option shown in the toolbar should be "Save." On the staff client home page and in the header's "More" menu the link to the authorities module should now appear with and without permission to edit authorities. Revision: Corrected permissions in export script to allow saving of authority records by users who do not have permission to edit. --- authorities/export.pl | 2 +- .../prog/en/includes/authorities-toolbar.inc | 15 ++++++++++++--- .../intranet-tmpl/prog/en/includes/header.inc | 2 -- .../en/modules/authorities/searchresultlist.tt | 19 ++++++++++++------- .../intranet-tmpl/prog/en/modules/intranet-main.tt | 2 -- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/authorities/export.pl b/authorities/export.pl index 9c8ae17..dc886c0 100755 --- a/authorities/export.pl +++ b/authorities/export.pl @@ -15,7 +15,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $query, type => "intranet", authnotrequired => 0, - flagsrequired => { editauthorities => 1 }, + flagsrequired => { catalogue => 1 }, debug => 1, } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc index e25f49f..f927ec5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc @@ -9,12 +9,17 @@ //]]> + +[% IF ( authid || CAN_user_editauthorities) %] +
[% IF ( authid ) %] - - [% UNLESS ( count ) %] - + [% IF ( CAN_user_editauthorities ) %] + + [% UNLESS ( count ) %] + + [% END %] [% END %]
@@ -30,6 +35,7 @@
[% END %] +[% IF ( CAN_user_editauthorities ) %] +[% END %]
+ +[% END %] \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 58f721f..b6bc660 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -18,9 +18,7 @@ [% IF ( CAN_user_acquisition ) %]
  • Acquisitions
  • [% END %] - [% IF ( CAN_user_editauthorities ) %]
  • Authorities
  • - [% END %] [% IF ( CAN_user_serials ) %]
  • Serials
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt index 445b541..6cee118 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -67,7 +67,9 @@ function searchauthority() { [% UNLESS ( isEDITORS ) %] Used in [% END %] - Delete + [% IF ( CAN_user_editauthorities ) %] +   + [% END %] [% FOREACH resul IN result %] [% UNLESS ( loop.odd ) %] @@ -79,14 +81,17 @@ function searchauthority() { Details [% UNLESS ( resul.isEDITORS ) %] - [% resul.used %] biblio(s) + [% resul.used %] records(s) [% END %] - - [% UNLESS ( resul.used ) %] - Delete - [% END %] - + [% IF ( CAN_user_editauthorities ) %] + + Edit + [% UNLESS ( resul.used ) %] + | Delete + [% END %] + + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index 1a43357..8fc64fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -54,11 +54,9 @@ [% END %] - [% IF ( CAN_user_editauthorities ) %]
  • Authorities
  • - [% END %] -- 1.7.9.5