Bugzilla – Attachment 59808 Details for
Bug 16530
Add a circ sidebar navigation menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16530: Add a new method to the Branches TT Plugin to avoid c/p
Bug-16530-Add-a-new-method-to-the-Branches-TT-Plug.patch (text/plain), 9.97 KB, created by
Jonathan Druart
on 2017-02-02 11:47:37 UTC
(
hide
)
Description:
Bug 16530: Add a new method to the Branches TT Plugin to avoid c/p
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-02-02 11:47:37 UTC
Size:
9.97 KB
patch
obsolete
>From bfa919aff1c4ee4082eded713ef20ce2ec577804 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 Feb 2017 17:54:43 +0100 >Subject: [PATCH] Bug 16530: Add a new method to the Branches TT Plugin to > avoid c/p > >We should do the same for the other check (FA exists), but cannot find a >good and quick way to implement. > >Doing it this way will avoid regression later, we will no have to check >if the variable is correctly passed to the template. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Template/Plugin/Branches.pm | 5 +++++ > circ/branchoverdues.pl | 3 --- > circ/branchtransfers.pl | 3 --- > circ/circulation-home.pl | 2 -- > circ/on-site_checkouts.pl | 2 -- > circ/renew.pl | 3 --- > circ/returns.pl | 3 --- > circ/selectbranchprinter.pl | 3 --- > circ/transferstoreceive.pl | 3 --- > circ/view_holdsqueue.pl | 3 --- > circ/waitingreserves.pl | 3 --- > koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc | 3 ++- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt | 3 ++- > 13 files changed, 9 insertions(+), 30 deletions(-) > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index 3d17edc..edbad11 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -75,4 +75,9 @@ sub all { > return $libraries; > } > >+sub InIndependentBranchesMode { >+ my ( $self ) = @_; >+ return ( not C4::Context->preference("IndependentBranches") or C4::Context::IsSuperLibrarian ); >+} >+ > 1; >diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl >index fe96caa..f334dd1 100755 >--- a/circ/branchoverdues.pl >+++ b/circ/branchoverdues.pl >@@ -159,7 +159,4 @@ $template->param( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl >index 64a5c10..0022e27 100755 >--- a/circ/branchtransfers.pl >+++ b/circ/branchtransfers.pl >@@ -240,8 +240,5 @@ $template->param( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > output_html_with_http_headers $query, $cookie, $template->output; > >diff --git a/circ/circulation-home.pl b/circ/circulation-home.pl >index 4f29f49..7d24d79 100755 >--- a/circ/circulation-home.pl >+++ b/circ/circulation-home.pl >@@ -37,8 +37,6 @@ my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); > $template->{'VARS'}->{'AllowOfflineCirculation'} = C4::Context->preference('AllowOfflineCirculation'); > > >diff --git a/circ/on-site_checkouts.pl b/circ/on-site_checkouts.pl >index cf630c9..aac5e79 100755 >--- a/circ/on-site_checkouts.pl >+++ b/circ/on-site_checkouts.pl >@@ -39,8 +39,6 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); > > my $pending_onsite_checkouts = C4::Circulation::GetPendingOnSiteCheckouts(); > >diff --git a/circ/renew.pl b/circ/renew.pl >index d68247e..246c266 100755 >--- a/circ/renew.pl >+++ b/circ/renew.pl >@@ -121,7 +121,4 @@ if ($barcode) { > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > output_html_with_http_headers( $cgi, $cookie, $template->output ); >diff --git a/circ/returns.pl b/circ/returns.pl >index 0ce5dc8..604779a 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -651,8 +651,5 @@ if ( $itemnumber ) { > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > # actually print the page! > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl >index cf0af68..8099a38 100755 >--- a/circ/selectbranchprinter.pl >+++ b/circ/selectbranchprinter.pl >@@ -137,7 +137,4 @@ $template->param( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/circ/transferstoreceive.pl b/circ/transferstoreceive.pl >index 3f89f59..20f14d1 100755 >--- a/circ/transferstoreceive.pl >+++ b/circ/transferstoreceive.pl >@@ -128,8 +128,5 @@ $template->param( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > output_html_with_http_headers $input, $cookie, $template->output; > >diff --git a/circ/view_holdsqueue.pl b/circ/view_holdsqueue.pl >index 6738c70..72457e0 100755 >--- a/circ/view_holdsqueue.pl >+++ b/circ/view_holdsqueue.pl >@@ -78,8 +78,5 @@ $template->param( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > # writing the template > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 6f12376..d0b3942 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -167,9 +167,6 @@ $template->param( > # Checking if there is a Fast Cataloging Framework > $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); > >-# Checking if the transfer page needs to be displayed >-$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); >- > if ($item && $tab eq 'holdsover' && !@cancel_result) { > print $input->redirect("/cgi-bin/koha/circ/waitingreserves.pl#holdsover"); > } elsif ($cancelall) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >index 7bcd94c..844926c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >@@ -1,3 +1,4 @@ >+[% USE Branches %] > <script type="text/javascript">//<![CDATA[ > $(document).ready(function() { > var path = location.pathname.substring(1); >@@ -23,7 +24,7 @@ > <li><a href="/cgi-bin/koha/circ/circulation.pl">Check out</a></li> > <li><a href="/cgi-bin/koha/circ/returns.pl">Check in</a></li> > <li><a href="/cgi-bin/koha/circ/renew.pl">Renew</a></li> >- [% IF ( display_transfer ) %] >+ [% IF Branches.InIndependentBranchesMode %] > <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li> > [% END %] > [% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependentBranches ) %][% ELSE %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >index e2a129c..fa49df9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Circulation</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -21,7 +22,7 @@ > <li><a href="/cgi-bin/koha/circ/circulation.pl">Check out</a></li> > <li><a href="/cgi-bin/koha/circ/returns.pl">Check in</a></li> > <li><a href="/cgi-bin/koha/circ/renew.pl">Renew</a></li> >- [% IF ( display_transfer ) %] >+ [% IF Branches.InIndependentBranchesMode %] > <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li> > [% END %] > [% UNLESS IndependentBranches %]<li><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a></li>[% END %] >-- >2.1.4
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 16530
:
51555
|
51777
|
53008
|
53072
|
57869
|
57901
|
59807
| 59808