@@ -, +, @@ --- Koha/Template/Plugin/Branches.pm | 10 +++++++++- catalogue/detail.pl | 3 ++- .../prog/en/modules/catalogue/detail.tt | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) --- a/Koha/Template/Plugin/Branches.pm +++ a/Koha/Template/Plugin/Branches.pm @@ -21,10 +21,11 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use Encode qw{encode decode}; +use Encode qw( encode decode ); use C4::Koha; use C4::Context; +use C4::Branch qw( GetIndependentGroupModificationRights ); sub GetName { my ( $self, $branchcode ) = @_; @@ -44,4 +45,11 @@ sub GetLoggedInBranchcode { ''; } +sub HasRights { + my( $self, $for ) = @_; + + my $has_rights = GetIndependentGroupModificationRights({ for => $for }); + return $has_rights; +} + 1; --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -199,7 +199,8 @@ 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}); + $item->{homebranchcode} = $item->{homebranch}; + $item->{homebranch} = GetBranchName( $item->{homebranch} ); # can place holds defaults to yes $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) ); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1,4 +1,5 @@ [% USE Koha %] +[% USE Branches %] [% USE KohaDates %] [% USE AuthorisedValues %] [% USE KohaDates %] @@ -723,7 +724,11 @@ function verify_images() { [% END %] [% IF ( CAN_user_editcatalogue_edit_items ) %] - Edit + [% IF !Koha.Preference('IndependentBranches') || Branches.HasRights( item.homebranchcode ) %] + Edit + [% ELSE %] +   + [% END %] [% END %] [% END %] --