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 <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit d9d364516b)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Katrin Fischer 2012-02-10 07:17:33 +01:00 committed by Chris Nighswonger
parent fb666678a1
commit ee0958e73f
3 changed files with 12 additions and 5 deletions

View File

@ -201,8 +201,8 @@ $(document).ready(function() {
</th>
<th>Routing
</th>
<th>Edit
</th>
[% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
</tr>
[% FOREACH serial IN year.serials %]
[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
@ -230,6 +230,7 @@ $(document).ready(function() {
<td>
<a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %]'); return false" >Print list</a>
</td>
[% IF ( CAN_user_serials_receive_serials ) %]
<td>
[% IF ( serial.cannotedit ) %]
disabled
@ -245,10 +246,16 @@ $(document).ready(function() {
[% END %]
[% END %]
</td>
[% END %]
</tr>
[% END %]
</table>
<p><input type="submit" value="Edit serials" />&nbsp;<input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" /></p>
[% IF ( CAN_user_serials_receive_serials ) %]
<p>
<input type="submit" value="Edit serials" />&nbsp;
<input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
</p>
[% END %]
</div>
[% END %]
<input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" />

View File

@ -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');

View File

@ -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,
}
);