@@ -, +, @@ KohaBranchName and Branches --- Koha/Template/Plugin/Branches.pm | 2 +- Koha/Template/Plugin/KohaBranchName.pm | 33 -------------------- .../prog/en/modules/acqui/basketgroup.tt | 10 +++--- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 4 +-- .../prog/en/modules/serials/subscription-detail.tt | 4 +-- .../prog/en/modules/suggestion/suggestion.tt | 16 +++++----- ...ranchName.t => Koha_template_plugin_Branches.t} | 12 +++---- 7 files changed, 24 insertions(+), 57 deletions(-) delete mode 100644 Koha/Template/Plugin/KohaBranchName.pm rename t/db_dependent/{Koha_template_plugin_KohaBranchName.t => Koha_template_plugin_Branches.t} (78%) --- a/Koha/Template/Plugin/Branches.pm +++ a/Koha/Template/Plugin/Branches.pm @@ -32,7 +32,7 @@ sub GetName { my $sth = C4::Context->dbh->prepare($query); $sth->execute($branchcode); my $b = $sth->fetchrow_hashref(); - return encode( 'UTF-8', $b->{'branchname'} ); + return $b ? encode( 'UTF-8', $b->{'branchname'} ) : q{}; } 1; --- a/Koha/Template/Plugin/KohaBranchName.pm +++ a/Koha/Template/Plugin/KohaBranchName.pm @@ -1,33 +0,0 @@ -package Koha::Template::Plugin::KohaBranchName; - -# Copyright Bywater Solutions 2012 - -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -use Modern::Perl; - -use Template::Plugin::Filter; -use base qw( Template::Plugin::Filter ); - -use C4::Branch qw( GetBranchName );; - -sub filter { - my ($self, $branchcode) = @_; - my $name = GetBranchName( $branchcode ); - return defined($name) ? $name : ''; -} - -1; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt @@ -1,4 +1,4 @@ -[% USE KohaBranchName %] +[% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] Koha › Basket grouping for [% booksellername |html %] @@ -273,8 +273,8 @@ function submitForm(form) { [% END %] [% basketgroup.id %] - [% basketgroup.billingplace | $KohaBranchName %] - [% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %] + [% Branches.GetName( basketgroup.billingplace ) %] + [% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) %][% END %] [% basketgroup.basketsqty %] @@ -311,8 +311,8 @@ function submitForm(form) { [% END %] [% basketgroup.id %] - [% basketgroup.billingplace | $KohaBranchName %] - [% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplace | $KohaBranchName %][% END %] + [% Branches.GetName( basketgroup.billingplace ) %] + [% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% Branches.GetName( basketgroup.deliveryplace ) %][% END %] [% basketgroup.basketsqty %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1,5 +1,5 @@ [% USE KohaDates %] -[% USE KohaBranchName %] +[% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] Koha › Circulation › Check in [% title |html %] @@ -92,7 +92,7 @@ $(document).ready(function () { [% END %] -[% IF ( WrongTransfer ) %]

Please return [% title |html %] to [% TransferWaitingAt | $KohaBranchName %]

Print slip or Cancel transfer

+[% IF ( WrongTransfer ) %]

Please return [% title |html %] to [% Branches.GetName( TransferWaitingAt ) %]

Print slip or Cancel transfer

[% IF ( wborcnum ) %]
Hold for: