@@ -, +, @@ IndependentBranches is on Set homebranch to L1 for item I1. Set homebranch to L2 for item I2. --- catalogue/detail.pl | 9 ++++++++- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -199,7 +199,6 @@ if ($currentbranch and C4::Context->preference('SeparateHoldings')) { 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 ) ); @@ -279,6 +278,14 @@ foreach my $item (@items) { $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) { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1,6 +1,7 @@ [% USE Koha %] [% USE KohaDates %] [% USE AuthorisedValues %] +[% USE Branches %] [% ShowCourseReserves = 0 %] [% IF UseCourseReserves %] @@ -624,7 +625,7 @@ function verify_images() { [% END %] [% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %] - [% item.homebranch %][% item.location %] + [% Branches.GetName(item.homebranch) %][% item.location %] [% IF ( itemdata_ccode ) %][% item.ccode %][% END %] [% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %] @@ -806,8 +807,10 @@ function verify_images() { [% END %] [% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %] + [% IF CAN_user_editcatalogue_edit_items and not item.cannot_be_edited %] Edit + [% ELSE %] + [% END %] [% END %] --