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

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

Return to bug 20256