Bug 18426: Make sure the logged in user can edit the subscriptions

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-04-19 07:25:29 -03:00
parent b366d8d4de
commit 64b689fcc8
2 changed files with 19 additions and 10 deletions

View file

@ -34,6 +34,7 @@
[% ELSE %]
[% SET tab = 'opened' %]
[% END %]
[% IF CAN_user_serials_edit_subscription %]
<div class="actions">
<a class="select-all" href="#" data-tab="[% tab %]"><i class="fa fa-check"></i> Select all</a>
|
@ -43,6 +44,7 @@
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected serials</a>
</span>
</div>
[% END %]
<table>
<thead>
<tr>
@ -84,7 +86,13 @@
[% FOREACH subscription IN subscriptions %]
[% UNLESS subscription.cannotdisplay %]
<tr>
<td><input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid %]"/></td>
<td>
[% UNLESS subscription.cannotedit %]
<input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid %]" />
[% ELSE %]
<input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid %]" disabled="disabled" title="You cannot edit this subscription" />
[% END %]
</td>
<td>
[% IF ( subscription.issn ) %][% subscription.issn %]
[% END %]

View file

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