Lines 75-81
my ($template, $loggedinuser, $cookie)
Link Here
|
75 |
}); |
75 |
}); |
76 |
|
76 |
|
77 |
# Does the user have a restricted item edition permission? |
77 |
# Does the user have a restricted item edition permission? |
78 |
my $uid = $loggedinuser ? Koha::Patrons->find( $loggedinuser )->userid : undef; |
78 |
my $patron = Koha::Patrons->find( $loggedinuser ); |
|
|
79 |
my $uid = $loggedinuser ? $patron->userid : undef; |
79 |
my $restrictededition = $uid ? haspermission($uid, {'tools' => 'items_batchmod_restricted'}) : undef; |
80 |
my $restrictededition = $uid ? haspermission($uid, {'tools' => 'items_batchmod_restricted'}) : undef; |
80 |
# In case user is a superlibrarian, edition is not restricted |
81 |
# In case user is a superlibrarian, edition is not restricted |
81 |
$restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); |
82 |
$restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); |
Lines 551-571
sub BuildItemsData{
Link Here
|
551 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
552 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
552 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
553 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
553 |
foreach my $itemnumber (@itemnumbers){ |
554 |
foreach my $itemnumber (@itemnumbers){ |
554 |
my $itemdata = Koha::Items->find($itemnumber); |
555 |
my $item = Koha::Items->find($itemnumber); |
555 |
next unless $itemdata; # Should have been tested earlier, but just in case... |
556 |
next unless $item; # Should have been tested earlier, but just in case... |
556 |
$itemdata = $itemdata->unblessed; |
557 |
my $itemdata = $item->unblessed; |
557 |
my $itemmarc=Item2Marc($itemdata); |
558 |
my $itemmarc=Item2Marc($itemdata); |
558 |
my %this_row; |
559 |
my %this_row; |
559 |
foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) { |
560 |
foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) { |
560 |
# loop through each subfield |
561 |
# loop through each subfield |
561 |
my $itembranchcode=$field->subfield($branchtagsubfield); |
562 |
my $itembranchcode=$field->subfield($branchtagsubfield); |
562 |
if ($itembranchcode && C4::Context->preference("IndependentBranches")) { |
563 |
if ($itembranchcode) { |
563 |
#verifying rights |
564 |
$this_row{'nomod'} = !$patron->can_edit_item($item); |
564 |
my $userenv = C4::Context->userenv(); |
565 |
} |
565 |
unless (C4::Context->IsSuperLibrarian() or (($userenv->{'branch'} eq $itembranchcode))){ |
|
|
566 |
$this_row{'nomod'}=1; |
567 |
} |
568 |
} |
569 |
my $tag=$field->tag(); |
566 |
my $tag=$field->tag(); |
570 |
foreach my $subfield ($field->subfields) { |
567 |
foreach my $subfield ($field->subfields) { |
571 |
my ($subfcode,$subfvalue)=@$subfield; |
568 |
my ($subfcode,$subfvalue)=@$subfield; |
572 |
- |
|
|