From 64b689fcc810fbfc20b6483b43e05f60e968b9ed Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 19 Apr 2018 07:25:29 -0300 Subject: [PATCH] Bug 18426: Make sure the logged in user can edit the subscriptions Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/serials/serials-search.tt | 28 ++++++++++++------- serials/subscription-batchedit.pl | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt index 18364bc4f1..491b8404c3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt @@ -34,15 +34,17 @@ [% ELSE %] [% SET tab = 'opened' %] [% END %] -
- Select all - | - Clear all - - | Actions: - Modify selected serials - -
+ [% IF CAN_user_serials_edit_subscription %] +
+ Select all + | + Clear all + + | Actions: + Modify selected serials + +
+ [% END %] @@ -84,7 +86,13 @@ [% FOREACH subscription IN subscriptions %] [% UNLESS subscription.cannotdisplay %] - +
+ [% UNLESS subscription.cannotedit %] + + [% ELSE %] + + [% END %] + [% IF ( subscription.issn ) %][% subscription.issn %] [% END %] diff --git a/serials/subscription-batchedit.pl b/serials/subscription-batchedit.pl index 865116ab51..9483ac6b60 100755 --- a/serials/subscription-batchedit.pl +++ b/serials/subscription-batchedit.pl @@ -69,6 +69,7 @@ if ($batchedit) { } foreach my $subscription (@subscriptions) { + next unless C4::Serials::can_edit_subscription( $subscription->unblessed ); # This should be moved to Koha::Subscription->can_edit while (my ($key, $value) = each %params) { if (defined $value and $value ne '') { $subscription->$key($value); -- 2.39.5