Bugzilla – Attachment 55354 Details for
Bug 15758
Move the C4::Branch related code to Koha::Libraries - part 4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15758: [QA Follow-up] Remove onlymine from Plugin/Branches.pm
Bug-15758-QA-Follow-up-Remove-onlymine-from-Plugin.patch (text/plain), 3.07 KB, created by
Jonathan Druart
on 2016-09-08 15:33:06 UTC
(
hide
)
Description:
Bug 15758: [QA Follow-up] Remove onlymine from Plugin/Branches.pm
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-08 15:33:06 UTC
Size:
3.07 KB
patch
obsolete
>From 5554934a340a1750f04658c22aae59093b133288 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 26 Aug 2016 08:01:07 +0200 >Subject: [PATCH] Bug 15758: [QA Follow-up] Remove onlymine from > Plugin/Branches.pm > >Hard to miss that one: >Template process failed: plugin error - Bareword "C4::Branch::onlymine" not allowed while "strict subs" in use at Koha/Template/Plugin/Branches.pm line 59. >Compilation failed in require at /usr/lib/perl5/Template/Plugins.pm line 206. > >Removed OnlyMine from Plugin/Branches. Replaced by a template var in >cleanborrowers; it was used only once. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Context.pm | 13 +++++++++++-- > Koha/Template/Plugin/Branches.pm | 4 ---- > .../intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt | 2 +- > tools/cleanborrowers.pl | 1 + > 4 files changed, 13 insertions(+), 7 deletions(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index c84230d..5f49bbe 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -1035,6 +1035,16 @@ sub mybranch { > C4::Context->userenv or return ''; > return C4::Context->userenv->{branch} || ''; > } >+ >+=head2 only_my_library >+ >+ my $test = C4::Context->only_my_library; >+ >+ Returns true if you enabled IndependentBranches and the current user >+ does not have superlibrarian permissions. >+ >+=cut >+ > sub only_my_library { > return > C4::Context->preference('IndependentBranches') >@@ -1043,9 +1053,8 @@ sub only_my_library { > && C4::Context->userenv->{branch}; > } > >- >- > 1; >+ > __END__ > > =head1 ENVIRONMENT >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index 3f62f1e..3d17edc 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -55,10 +55,6 @@ sub GetURL { > return $b->{branchurl}; > } > >-sub OnlyMine { >- return C4::Branch::onlymine; >-} >- > sub all { > my ( $self, $params ) = @_; > my $selected = $params->{selected}; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >index ae7df4e..7ff66d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >@@ -60,7 +60,7 @@ > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >-[% IF !Branches.OnlyMine %] >+[% IF !OnlyMine %] > <form method="get" action="/cgi-bin/koha/tools/cleanborrowers.pl" id="selectlibrary"> > Select a library : > <select name="branch" id="branch" style="width:20em;"> >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index ccf13ca..5d392a5 100755 >--- a/tools/cleanborrowers.pl >+++ b/tools/cleanborrowers.pl >@@ -80,6 +80,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > > my $branch = $params->{ branch } || '*'; > $template->param( current_branch => $branch ); >+$template->param( OnlyMine => C4::Context->only_my_library ); > > if ( $step == 2 ) { > >-- >2.8.1
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 15758
:
47746
|
47747
|
47748
|
47749
|
47750
|
47751
|
47752
|
47753
|
47759
|
47760
|
47761
|
47762
|
47763
|
47764
|
47765
|
52723
|
52724
|
52726
|
52727
|
52728
|
52729
|
52730
|
52731
|
52736
|
52788
|
52789
|
52790
|
52791
|
52792
|
52793
|
52794
|
52795
|
52913
|
52914
|
52915
|
52916
|
52917
|
52918
|
52919
|
52920
|
53893
|
53894
|
53895
|
53896
|
53897
|
53898
|
53899
|
53900
|
53997
|
53998
|
53999
|
54000
|
54001
|
54002
|
54003
|
54004
|
54029
|
54030
|
54031
|
54032
|
54033
|
54034
|
54035
|
54036
|
54037
|
54038
|
54039
|
54040
|
54041
|
54042
|
54043
|
54044
|
54861
|
54862
|
54863
|
54864
|
54865
|
54866
|
54867
|
54868
|
54908
|
54909
|
54921
|
54925
|
55061
|
55062
|
55063
|
55064
|
55065
|
55066
|
55067
|
55068
|
55069
|
55070
|
55071
|
55072
|
55073
|
55346
|
55347
|
55348
|
55349
|
55350
|
55351
|
55352
|
55353
| 55354 |
55355
|
55356
|
55357
|
55358
|
55445