my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
foreach my $item (@items) {
my $itembranchcode = $item->{$separatebranch};
- $item->{homebranch} = GetBranchName($item->{homebranch});
# can place holds defaults to yes
$norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
$item->{'course_reserves'} = GetItemCourseReservesInfo( itemnumber => $item->{'itemnumber'} );
}
+ if ( C4::Context->preference('IndependentBranches') ) {
+ my $userenv = C4::Context->userenv();
+ if ( not C4::Context->IsSuperLibrarian()
+ and $userenv->{branch} ne $item->{homebranch} ) {
+ $item->{cannot_be_edited} = 1;
+ }
+ }
+
if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
and C4::Context->preference('SeparateHoldings')) {
if ($itembranchcode and $itembranchcode eq $currentbranch) {
[% USE Koha %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
+[% USE Branches %]
[% ShowCourseReserves = 0 %]
[% IF UseCourseReserves %]
</td>
[% END %]
<td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td>
- <td class="homebranch">[% item.homebranch %]<span class="shelvingloc">[% item.location %]</span> </td>
+ <td class="homebranch">[% Branches.GetName(item.homebranch) %]<span class="shelvingloc">[% item.location %]</span> </td>
[% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
<td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
<td class="status">
[% END %]
</td>
[% END %]
- [% IF ( CAN_user_editcatalogue_edit_items ) %]
+ [% IF CAN_user_editcatalogue_edit_items and not item.cannot_be_edited %]
<td><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber %]&itemnumber=[% item.itemnumber %]#edititem">Edit</a></td>
+ [% ELSE %]
+ <td></td>
[% END %]
</tr>
[% END %]