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

(-)a/cataloguing/additem.pl (-6 / +9 lines)
Lines 419-424 my ($template, $loggedinuser, $cookie) Link Here
419
419
420
# Does the user have a restricted item editing permission?
420
# Does the user have a restricted item editing permission?
421
my $patron = Koha::Patrons->find( $loggedinuser );
421
my $patron = Koha::Patrons->find( $loggedinuser );
422
423
my $item = $itemnumber ? Koha::Items->find( $itemnumber ) : undef;
424
if ( $item && !$patron->can_edit_item( $item ) ) {
425
    print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber");
426
    exit;
427
}
428
422
my $uid = $patron->userid;
429
my $uid = $patron->userid;
423
my $restrictededition = $uid ? haspermission($uid,  {'editcatalogue' => 'edit_items_restricted'}) : undef;
430
my $restrictededition = $uid ? haspermission($uid,  {'editcatalogue' => 'edit_items_restricted'}) : undef;
424
# In case user is a superlibrarian, editing is not restricted
431
# In case user is a superlibrarian, editing is not restricted
Lines 727-733 if ($op eq "additem") { Link Here
727
    if ($exist_itemnumber && $exist_itemnumber != $itemnumber) {
734
    if ($exist_itemnumber && $exist_itemnumber != $itemnumber) {
728
        push @errors,"barcode_not_unique";
735
        push @errors,"barcode_not_unique";
729
    } else {
736
    } else {
730
        my $item = Koha::Items->find($itemnumber );
731
        my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber);
737
        my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber);
732
        $itemnumber = q{};
738
        $itemnumber = q{};
733
        my $olditemlost = $item->itemlost;
739
        my $olditemlost = $item->itemlost;
Lines 837-846 foreach my $field (@fields) { Link Here
837
843
838
        if ( C4::Context->preference('EasyAnalyticalRecords') ) {
844
        if ( C4::Context->preference('EasyAnalyticalRecords') ) {
839
            foreach my $hostitemnumber (@hostitemnumbers) {
845
            foreach my $hostitemnumber (@hostitemnumbers) {
840
                my $item = Koha::Items->find( $hostitemnumber );
846
                my $hostitem = Koha::Items->find( $hostitemnumber );
841
                if ($this_row{itemnumber} eq $hostitemnumber) {
847
                if ($this_row{itemnumber} eq $hostitemnumber) {
842
                    $this_row{hostitemflag} = 1;
848
                    $this_row{hostitemflag} = 1;
843
                    $this_row{hostbiblionumber}= $item->biblio->biblionumber;
849
                    $this_row{hostbiblionumber}= $hostitem->biblio->biblionumber;
844
                    last;
850
                    last;
845
                }
851
                }
846
            }
852
            }
Lines 940-947 foreach my $tag ( keys %{$tagslib}){ Link Here
940
}
946
}
941
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data;
947
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data;
942
948
943
my $item = Koha::Items->find($itemnumber); # We certainly want to fetch it earlier
944
945
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
949
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
946
$template->param(
950
$template->param(
947
    biblionumber => $biblionumber,
951
    biblionumber => $biblionumber,
948
- 

Return to bug 20256