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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
1edb8cbeee
commit
7963796978
|
|
@ -75,4 +75,9 @@ sub all {
|
|||
return $libraries;
|
||||
}
|
||||
|
||||
sub InIndependentBranchesMode {
|
||||
my ( $self ) = @_;
|
||||
return ( not C4::Context->preference("IndependentBranches") or C4::Context::IsSuperLibrarian );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -652,8 +652,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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 %]
|
||||
|
|
|
|||
|
|
@ -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 %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue