From ee0958e73fec19736220f0db0f86c1a4ad7eeb8b Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 10 Feb 2012 07:17:33 +0100 Subject: [PATCH] Bug 7521: Templates should use receive_serials permission Corrects templates to use permission receive_serials. Before patch: 1) Serial receive page (/cgi-bin/koha/serials/serials-edit.pl...) can only be accessed with full serials permissions. When one permission is missing, page can not be accessed. 2) Serial collection/Issue History page (/cgi-bin/koha/serials/serials-collection.pl...) can only be accessed with full serials permissions. After applying patch: 1) Serial receive page can only be accessed when user has receive_serials permission. 2) Edit and serial receive links are hidden, when user doesn't have serials_receive permission. Page is accessible with at least 1 serials permission. I will send a another patch to correct behaviour for the routing permission. Signed-off-by: Jared Camins-Esakov Signed-off-by: Paul Poulain (cherry picked from commit d9d364516b0bd5363c95b134520bb0379836be51) Signed-off-by: Chris Nighswonger --- .../prog/en/modules/serials/serials-collection.tt | 13 ++++++++++--- serials/serials-collection.pl | 2 +- serials/serials-edit.pl | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt index 3777f47d62..7b8efefecb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt @@ -201,8 +201,8 @@ $(document).ready(function() { Routing - Edit - + + [% IF ( CAN_user_serials_receive_serials ) %]Edit[% END %] [% FOREACH serial IN year.serials %] [% UNLESS ( loop.odd ) %][% ELSE %][% END %] @@ -230,6 +230,7 @@ $(document).ready(function() { Print list + [% IF ( CAN_user_serials_receive_serials ) %] [% IF ( serial.cannotedit ) %] disabled @@ -245,10 +246,16 @@ $(document).ready(function() { [% END %] [% END %] + [% END %] [% END %] -

 

+ [% IF ( CAN_user_serials_receive_serials ) %] +

+   + +

+ [% END %] [% END %] diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index a67db7a31f..4fe55f0fcd 100755 --- a/serials/serials-collection.pl +++ b/serials/serials-collection.pl @@ -42,7 +42,7 @@ my ($template, $loggedinuser, $cookie); query => $query, type => "intranet", authnotrequired => 0, - flagsrequired => {serials => 'receive_serials'}, + flagsrequired => {serials => '*'}, debug => 1, }); my $biblionumber = $query->param('biblionumber'); diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 1a606323ad..5c87851a32 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -116,7 +116,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $query, type => 'intranet', authnotrequired => 0, - flagsrequired => { serials => 1 }, + flagsrequired => { serials => 'receive_serials' }, debug => 1, } ); -- 2.39.5