@@ -, +, @@
---
Koha/Template/Plugin/Branches.pm | 2 +-
.../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 ++++++------
6 files changed, 24 insertions(+), 24 deletions(-)
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-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 %]
@@ -274,8 +274,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 %] |
@@ -312,8 +312,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 %]
+[% IF ( WrongTransfer ) %] Please return [% title |html %] to [% Branches.GetName( TransferWaitingAt ) %]
[% IF ( wborcnum ) %] Hold for:
-
[% borsurname %], [% borfirstname %] ([% borcnum %])
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
@@ -1,4 +1,4 @@
-[% USE KohaBranchName %]
+[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
Koha › Serials › Details for subscription #[% subscriptionid %]
[% INCLUDE 'doc-head-close.inc' %]
@@ -102,7 +102,7 @@ $(document).ready(function() {
- Librarian identity: [% librarian %]
- Vendor: [% aqbooksellername %]
- Biblio: [% bibliotitle %] ([% bibnum %])
-[% IF ( branchcode ) %]- Library: [% branchcode | $KohaBranchName %]
[% END %]
+[% IF ( branchcode ) %]- Library: [% Branches.GetName( branchcode ) %]
[% END %]
[% IF ( serialsadditems ) %]
- Items: Serial receipt creates an item record.
[% ELSE %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -1,5 +1,5 @@
[% USE AuthorisedValues %]
-[% USE KohaBranchName %]
+[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
Koha › Acquisitions ›
[% IF ( op_save ) %]
@@ -226,18 +226,18 @@ $(document).ready(function() { calcNewsuggTotal(); });
Suggestion creation |
[% suggesteddate %] |
- [% IF ( suggestedby_borrowernumber ) %][% suggestedby_surname %], [% suggestedby_firstname %] [% suggestedby_branchcode | $KohaBranchName %] ([% suggestedby_description %])[% END %]
+ | [% IF ( suggestedby_borrowernumber ) %][% suggestedby_surname %], [% suggestedby_firstname %] [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %]
|
Suggestion management |
[% manageddate %] |
- [% IF ( managedby_borrowernumber ) %][% managedby_surname %], [% managedby_firstname %] [% managedby_branchcode | $KohaBranchName %] ([% managedby_description %])[% END %] |
+ [% IF ( managedby_borrowernumber ) %][% managedby_surname %], [% managedby_firstname %] [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])[% END %] |
Suggestion accepted |
[% accepteddate %] |
- [% IF ( acceptedby_borrowernumber ) %][% acceptedby_surname %], [% acceptedby_firstname %] [% acceptedby_branchcode | $KohaBranchName %] ([% acceptedby_description %])[% END %] |
+ [% IF ( acceptedby_borrowernumber ) %][% acceptedby_surname %], [% acceptedby_firstname %] [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %] |
@@ -354,18 +354,18 @@ $(document).ready(function() { calcNewsuggTotal(); });
|
|
- [% IF ( suggestedby_borrowernumber ) %][% suggestedby_surname %], [% suggestedby_firstname %] [% suggestedby_branchcode | $KohaBranchName %] ([% suggestedby_description %])[% END %]
+ | [% IF ( suggestedby_borrowernumber ) %][% suggestedby_surname %], [% suggestedby_firstname %] [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %]
|
|
|
- [% IF ( managedby_borrowernumber ) %][% managedby_surname %], [% managedby_firstname %] [% managedby_branchcode | $KohaBranchName %] ([% managedby_description %])[% END %] |
+ [% IF ( managedby_borrowernumber ) %][% managedby_surname %], [% managedby_firstname %] [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])[% END %] |
|
|
- [% IF ( acceptedby_borrowernumber ) %][% acceptedby_surname %], [% acceptedby_firstname %] [% acceptedby_branchcode | $KohaBranchName %] ([% acceptedby_description %])[% END %] |
+ [% IF ( acceptedby_borrowernumber ) %][% acceptedby_surname %], [% acceptedby_firstname %] [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %] |
@@ -482,7 +482,7 @@ $(document).ready(function() { calcNewsuggTotal(); });
[% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate %][% END %]
|
- [% suggestions_loo.branchcode | $KohaBranchName %]
+ [% Branches.GetName( suggestions_loo.branchcode ) %]
|
[% suggestions_loo.budget_name %]
--- a/t/db_dependent/Koha_template_plugin_KohaBranchName.t
+++ a/t/db_dependent/Koha_template_plugin_KohaBranchName.t
@@ -21,17 +21,17 @@ use Modern::Perl;
use Test::More tests => 5;
BEGIN {
- use_ok('Koha::Template::Plugin::KohaBranchName');
+ use_ok('Koha::Template::Plugin::Branches');
}
-my $filter = Koha::Template::Plugin::KohaBranchName->new();
-ok($filter, "initialized KohaBranchName plugin");
+my $plugin = Koha::Template::Plugin::Branches->new();
+ok($plugin, "initialized Branches plugin");
-my $name = $filter->filter('CPL');
+my $name = $plugin->GetName('CPL');
is($name, 'Centerville', 'retrieved expected name for CPL');
-$name = $filter->filter('__ANY__');
+$name = $plugin->GetName('__ANY__');
is($name, '', 'received empty string as name of the "__ANY__" placeholder library code');
-$name = $filter->filter(undef);
+$name = $plugin->GetName(undef);
is($name, '', 'received empty string as name of NULL/undefined library code');
--
|