Lines 80-86
my ($template, $loggedinuser, $cookie)
Link Here
|
80 |
$template->param( searchid => scalar $input->param('searchid'), ); |
80 |
$template->param( searchid => scalar $input->param('searchid'), ); |
81 |
|
81 |
|
82 |
# Does the user have a restricted item edition permission? |
82 |
# Does the user have a restricted item edition permission? |
83 |
my $uid = $loggedinuser ? Koha::Patrons->find( $loggedinuser )->userid : undef; |
83 |
my $patron = Koha::Patrons->find( $loggedinuser ); |
|
|
84 |
my $uid = $loggedinuser ? $patron->userid : undef; |
84 |
my $restrictededition = $uid ? haspermission($uid, {'tools' => 'items_batchmod_restricted'}) : undef; |
85 |
my $restrictededition = $uid ? haspermission($uid, {'tools' => 'items_batchmod_restricted'}) : undef; |
85 |
# In case user is a superlibrarian, edition is not restricted |
86 |
# In case user is a superlibrarian, edition is not restricted |
86 |
$restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); |
87 |
$restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrarian()); |
Lines 642-662
sub BuildItemsData{
Link Here
|
642 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
643 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
643 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
644 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
644 |
foreach my $itemnumber (@itemnumbers){ |
645 |
foreach my $itemnumber (@itemnumbers){ |
645 |
my $itemdata = Koha::Items->find($itemnumber); |
646 |
my $item = Koha::Items->find($itemnumber); |
646 |
next unless $itemdata; # Should have been tested earlier, but just in case... |
647 |
next unless $item; # Should have been tested earlier, but just in case... |
647 |
$itemdata = $itemdata->unblessed; |
648 |
my $itemdata = $item->unblessed; |
648 |
my $itemmarc=Item2Marc($itemdata); |
649 |
my $itemmarc=Item2Marc($itemdata); |
649 |
my %this_row; |
650 |
my %this_row; |
650 |
foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) { |
651 |
foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) { |
651 |
# loop through each subfield |
652 |
# loop through each subfield |
652 |
my $itembranchcode=$field->subfield($branchtagsubfield); |
653 |
my $itembranchcode=$field->subfield($branchtagsubfield); |
653 |
if ($itembranchcode && C4::Context->preference("IndependentBranches")) { |
654 |
if ($itembranchcode) { |
654 |
#verifying rights |
655 |
$this_row{'nomod'} = !$patron->can_edit_item($item); |
655 |
my $userenv = C4::Context->userenv(); |
656 |
} |
656 |
unless (C4::Context->IsSuperLibrarian() or (($userenv->{'branch'} eq $itembranchcode))){ |
|
|
657 |
$this_row{'nomod'}=1; |
658 |
} |
659 |
} |
660 |
my $tag=$field->tag(); |
657 |
my $tag=$field->tag(); |
661 |
foreach my $subfield ($field->subfields) { |
658 |
foreach my $subfield ($field->subfields) { |
662 |
my ($subfcode,$subfvalue)=@$subfield; |
659 |
my ($subfcode,$subfvalue)=@$subfield; |
663 |
- |
|
|