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 724-730
if ($op eq "additem") {
Link Here
|
724 |
if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { |
731 |
if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { |
725 |
push @errors,"barcode_not_unique"; |
732 |
push @errors,"barcode_not_unique"; |
726 |
} else { |
733 |
} else { |
727 |
my $item = Koha::Items->find($itemnumber ); |
|
|
728 |
my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber); |
734 |
my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber); |
729 |
$itemnumber = q{}; |
735 |
$itemnumber = q{}; |
730 |
my $olditemlost = $item->itemlost; |
736 |
my $olditemlost = $item->itemlost; |
Lines 833-842
foreach my $field (@fields) {
Link Here
|
833 |
|
839 |
|
834 |
if ( C4::Context->preference('EasyAnalyticalRecords') ) { |
840 |
if ( C4::Context->preference('EasyAnalyticalRecords') ) { |
835 |
foreach my $hostitemnumber (@hostitemnumbers) { |
841 |
foreach my $hostitemnumber (@hostitemnumbers) { |
836 |
my $item = Koha::Items->find( $hostitemnumber ); |
842 |
my $hostitem = Koha::Items->find( $hostitemnumber ); |
837 |
if ($this_row{itemnumber} eq $hostitemnumber) { |
843 |
if ($this_row{itemnumber} eq $hostitemnumber) { |
838 |
$this_row{hostitemflag} = 1; |
844 |
$this_row{hostitemflag} = 1; |
839 |
$this_row{hostbiblionumber}= $item->biblio->biblionumber; |
845 |
$this_row{hostbiblionumber}= $hostitem->biblio->biblionumber; |
840 |
last; |
846 |
last; |
841 |
} |
847 |
} |
842 |
} |
848 |
} |
Lines 953-960
foreach my $tag ( keys %{$tagslib}){
Link Here
|
953 |
} |
959 |
} |
954 |
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data; |
960 |
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data; |
955 |
|
961 |
|
956 |
my $item = Koha::Items->find($itemnumber); # We certainly want to fetch it earlier |
|
|
957 |
|
958 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
962 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
959 |
$template->param( |
963 |
$template->param( |
960 |
biblionumber => $biblionumber, |
964 |
biblionumber => $biblionumber, |
961 |
- |
|
|