diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 3f71a875f7..2037ef99aa 100755 --- a/catalogue/detail.pl +++ b/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) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index fe8d32e5d5..8e26f85b5d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/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 %] @@ -559,7 +560,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 %] @@ -721,8 +722,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 %]