Lines 413-418
my ($template, $loggedinuser, $cookie)
Link Here
|
413 |
|
413 |
|
414 |
# Does the user have a restricted item editing permission? |
414 |
# Does the user have a restricted item editing permission? |
415 |
my $patron = Koha::Patrons->find( $loggedinuser ); |
415 |
my $patron = Koha::Patrons->find( $loggedinuser ); |
|
|
416 |
|
417 |
my $item = $itemnumber ? Koha::Items->find( $itemnumber ) : undef; |
418 |
if ( $item && !$patron->can_edit_item( $item ) ) { |
419 |
print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); |
420 |
exit; |
421 |
} |
422 |
|
416 |
my $uid = $patron->userid; |
423 |
my $uid = $patron->userid; |
417 |
my $restrictededition = $uid ? haspermission($uid, {'editcatalogue' => 'edit_items_restricted'}) : undef; |
424 |
my $restrictededition = $uid ? haspermission($uid, {'editcatalogue' => 'edit_items_restricted'}) : undef; |
418 |
# In case user is a superlibrarian, editing is not restricted |
425 |
# In case user is a superlibrarian, editing is not restricted |
Lines 707-713
if ($op eq "additem") {
Link Here
|
707 |
if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { |
714 |
if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { |
708 |
push @errors,"barcode_not_unique"; |
715 |
push @errors,"barcode_not_unique"; |
709 |
} else { |
716 |
} else { |
710 |
my $item = Koha::Items->find($itemnumber ); |
|
|
711 |
my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber); |
717 |
my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber); |
712 |
$itemnumber = q{}; |
718 |
$itemnumber = q{}; |
713 |
my $olditemlost = $item->itemlost; |
719 |
my $olditemlost = $item->itemlost; |
Lines 817-826
foreach my $field (@fields) {
Link Here
|
817 |
|
823 |
|
818 |
if ( C4::Context->preference('EasyAnalyticalRecords') ) { |
824 |
if ( C4::Context->preference('EasyAnalyticalRecords') ) { |
819 |
foreach my $hostitemnumber (@hostitemnumbers) { |
825 |
foreach my $hostitemnumber (@hostitemnumbers) { |
820 |
my $item = Koha::Items->find( $hostitemnumber ); |
826 |
my $hostitem = Koha::Items->find( $hostitemnumber ); |
821 |
if ($this_row{itemnumber} eq $hostitemnumber) { |
827 |
if ($this_row{itemnumber} eq $hostitemnumber) { |
822 |
$this_row{hostitemflag} = 1; |
828 |
$this_row{hostitemflag} = 1; |
823 |
$this_row{hostbiblionumber}= $item->biblio->biblionumber; |
829 |
$this_row{hostbiblionumber}= $hostitem->biblio->biblionumber; |
824 |
last; |
830 |
last; |
825 |
} |
831 |
} |
826 |
} |
832 |
} |
Lines 920-927
foreach my $tag ( keys %{$tagslib}){
Link Here
|
920 |
} |
926 |
} |
921 |
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data; |
927 |
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data; |
922 |
|
928 |
|
923 |
my $item = Koha::Items->find($itemnumber); # We certainly want to fetch it earlier |
|
|
924 |
|
925 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
929 |
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. |
926 |
$template->param( |
930 |
$template->param( |
927 |
biblionumber => $biblionumber, |
931 |
biblionumber => $biblionumber, |
928 |
- |
|
|