View | Details | Raw Unified | Return to bug 20256
Collapse All | Expand All

(-)a/cataloguing/additem.pl (-1 / +14 lines)
Lines 125-130 my ($template, $loggedinuser, $cookie) Link Here
125
125
126
# Does the user have a restricted item editing permission?
126
# Does the user have a restricted item editing permission?
127
my $patron = Koha::Patrons->find( $loggedinuser );
127
my $patron = Koha::Patrons->find( $loggedinuser );
128
129
my $item = $itemnumber ? Koha::Items->find( $itemnumber ) : undef;
130
if ( $item && !$patron->can_edit_item( $item ) ) {
131
    print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber");
132
    exit;
133
}
134
128
my $uid = $patron->userid;
135
my $uid = $patron->userid;
129
my $restrictededition = $uid ? haspermission($uid,  {'editcatalogue' => 'edit_items_restricted'}) : undef;
136
my $restrictededition = $uid ? haspermission($uid,  {'editcatalogue' => 'edit_items_restricted'}) : undef;
130
# In case user is a superlibrarian, editing is not restricted
137
# In case user is a superlibrarian, editing is not restricted
Lines 466-472 if ($op eq "additem") { Link Here
466
        push @errors,"barcode_not_unique";
473
        push @errors,"barcode_not_unique";
467
        $current_item = $item->unblessed; # Restore edit form for the same item
474
        $current_item = $item->unblessed; # Restore edit form for the same item
468
    } else {
475
    } else {
476
<<<<<<< HEAD
469
        my $newitemlost = $item->itemlost;
477
        my $newitemlost = $item->itemlost;
478
=======
479
        my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber);
480
        $itemnumber = q{};
481
        my $olditemlost = $item->itemlost;
482
        my $newitemlost = $newitem->{itemlost};
483
>>>>>>> 5b37193b6fe (Bug 20256: (QA follow-up) Redirect to record details page if user cannot edit this item)
470
        if ( $newitemlost && $newitemlost ge '1' && !$olditemlost ) {
484
        if ( $newitemlost && $newitemlost ge '1' && !$olditemlost ) {
471
            LostItem( $item->itemnumber, 'additem' );
485
            LostItem( $item->itemnumber, 'additem' );
472
        }
486
        }
473
- 

Return to bug 20256