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 591-611
sub BuildItemsData{
Link Here
|
591 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
592 |
my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); |
592 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
593 |
my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField( "items.homebranch" ); |
593 |
foreach my $itemnumber (@itemnumbers){ |
594 |
foreach my $itemnumber (@itemnumbers){ |
594 |
my $itemdata = Koha::Items->find($itemnumber); |
595 |
my $item = Koha::Items->find($itemnumber); |
595 |
next unless $itemdata; # Should have been tested earlier, but just in case... |
596 |
next unless $item; # Should have been tested earlier, but just in case... |
596 |
$itemdata = $itemdata->unblessed; |
597 |
my $itemdata = $item->unblessed; |
597 |
my $itemmarc=Item2Marc($itemdata); |
598 |
my $itemmarc=Item2Marc($itemdata); |
598 |
my %this_row; |
599 |
my %this_row; |
599 |
foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) { |
600 |
foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) { |
600 |
# loop through each subfield |
601 |
# loop through each subfield |
601 |
my $itembranchcode=$field->subfield($branchtagsubfield); |
602 |
my $itembranchcode=$field->subfield($branchtagsubfield); |
602 |
if ($itembranchcode && C4::Context->preference("IndependentBranches")) { |
603 |
if ($itembranchcode) { |
603 |
#verifying rights |
604 |
$this_row{'nomod'} = !$patron->can_edit_item($item); |
604 |
my $userenv = C4::Context->userenv(); |
605 |
} |
605 |
unless (C4::Context->IsSuperLibrarian() or (($userenv->{'branch'} eq $itembranchcode))){ |
|
|
606 |
$this_row{'nomod'}=1; |
607 |
} |
608 |
} |
609 |
my $tag=$field->tag(); |
606 |
my $tag=$field->tag(); |
610 |
foreach my $subfield ($field->subfields) { |
607 |
foreach my $subfield ($field->subfields) { |
611 |
my ($subfcode,$subfvalue)=@$subfield; |
608 |
my ($subfcode,$subfvalue)=@$subfield; |
612 |
- |
|
|