Bugzilla – Attachment 28366 Details for
Bug 10276
Extend IndependentBranches to support groups of libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10276 [QA Followup 4] - Fix edit links on catalogue/detail.pl
Bug-10276-QA-Followup-4---Fix-edit-links-on-catalo.patch (text/plain), 3.28 KB, created by
Kyle M Hall (khall)
on 2014-05-20 13:42:19 UTC
(
hide
)
Description:
Bug 10276 [QA Followup 4] - Fix edit links on catalogue/detail.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-05-20 13:42:19 UTC
Size:
3.28 KB
patch
obsolete
>From 158eb86727607f0425eff596a19a6f293d57fec5 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 20 May 2014 09:37:26 -0400 >Subject: [PATCH] Bug 10276 [QA Followup 4] - Fix edit links on catalogue/detail.pl > >Bug 11746 has been pushed to master, which is good. However, this means >that the links displayed in the catalogue/details.pl page are displaying >Edit on items which the user should not have edit links for. >--- > Koha/Template/Plugin/Branches.pm | 10 +++++++++- > catalogue/detail.pl | 3 ++- > .../prog/en/modules/catalogue/detail.tt | 7 ++++++- > 3 files changed, 17 insertions(+), 3 deletions(-) > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index ddf5f2f..03e8323 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/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; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 3f71a87..1ba5008 100755 >--- a/catalogue/detail.pl >+++ b/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 ) ); >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 b041bbf..80b2dfc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/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() { > </td> > [% END %] > [% IF ( CAN_user_editcatalogue_edit_items ) %] >- <td><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber %]&itemnumber=[% item.itemnumber %]#edititem">Edit</a></td> >+ [% IF Branches.HasRights( item.homebranchcode ) %] >+ <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 %] > [% END %] > </tr> > [% END %] >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10276
:
18205
|
18479
|
18519
|
18716
|
18717
|
18850
|
20773
|
21145
|
22791
|
23037
|
23484
|
23489
|
23637
|
23641
|
23953
|
23992
|
24427
|
24428
|
25722
|
25723
|
25724
|
26015
|
26026
|
26027
|
26028
|
26029
|
28354
|
28355
|
28356
|
28357
|
28358
|
28359
|
28360
|
28361
|
28365
|
28366
|
28367
|
36027
|
36028
|
36029
|
36030
|
36031
|
36032
|
41064
|
41065
|
41066
|
41067
|
41068
|
41069
|
41070