Bugzilla – Attachment 47746 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: Koha::Libraries - Remove GetBranchName
Bug-15758-KohaLibraries---Remove-GetBranchName.patch (text/plain), 83.05 KB, created by
Jonathan Druart
on 2016-02-08 17:32:39 UTC
(
hide
)
Description:
Bug 15758: Koha::Libraries - Remove GetBranchName
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-02-08 17:32:39 UTC
Size:
83.05 KB
patch
obsolete
>From ef63d21a48a8a3221ba4c31c1498ed889ff3c55c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 2 Feb 2016 17:28:30 +0000 >Subject: [PATCH] Bug 15758: Koha::Libraries - Remove GetBranchName > >This is the fourth and last patch set to remove C4::Branch. >The real purpose of this patch is to standardise and refactor some code >which is related to the libraries selection/display. >Its unconfessed purpose is to remove the C4::Branch package. > >Before this patch set, only 6 subroutines still existed in the C4::Branch >package: >- GetBranchName >- GetBranchesLoop >- mybranch >- onlymine >- GetBranches >- GetBranch > >GetBranchName basically returns the branchname for a given branchcode. >The branchname is only used for a display purpose and we don't need to >retrieve it in package or pl scripts (unless for a few exceptions). >We have a `Branches` template plugin with a `GetName` method which does >exactly this job. >To achieve this removal, we will use this template plugin and delete the >GetBranchName from pl and pm files. >The `Branches.all()` will now select the library of the logged in user >if no `selected` parameter has been passed. >This new behavior could cause regressions, for instance there are some >places where we do not want an option preselected (batch item >modification for instance), keep that in mind when testing. > >GetBranchesLoop took 3 parameters: $branch and $onlymine. >The first one was used to set a "selected" flag, for a display purpose: >select an option in the libraries dropdown lists. >The second one was useless: If not passed or set to 0, the >`C4::Branch::onlymine` subroutine was called. >This onlymine flag was use to know if the logged in user was able to see >other libraries infos. >A patron can see the infos from other libraries if IndependentBranches >is not set OR if he has the superlibrarian permission. >Prior to this patch set, the "onlymine test" was done on different >places (neworderempty.pl, additem.pl, holidays.pl, etc.), including the >Branches TT plugin. In this patch set, this test is only done on one >place (C4::Context::only_my_library, code moved from >C4::Branch::onlymine). >To accomplish the same job as this subroutine, we just need to call the >`Branches.all()` method from the `Branches` TT plugin. It already >accepts a `selected` parameter to set a flag on the option to select. >To avoid the repetitive > [% IF selected %]<option selected="selected">[% ELSE %]<option>[% END %] >pattern, a new `html_helpers` TT include file has been created, it >defines an `options_for_libraries` block, which takes a `selected` >parameter. We could imagine to use this include file for other >selects. > >The 'mybranch` and `onlymine` subroutines of the C4::Branch package have >been moved to C4::Context. onlymine has been renamed with >only_my_library. There are only 4 occurrences of it, against 11 before >this patch set. >There 2 subroutines are Context-centric and it makes sense to put them >in `C4::Context` (at least it's the least worst place!) > >GetBranches is the tricky part of this patch set: It retrieves all the >libraries, independently of the value of IndependentBranches. >To keep the same way as the existing calls of `Branches.all()`, I have >added a `unfiltered` parameter. If set, the `Branches.all()` will call >a usual Koha::Libraries->search method, otherwise >Koha::Libraries->search_filtered will be called. This new method will >check if the logged in user is allowed to see other libraries or only >its library. >Note that this `GetBranches` subroutine also created a `category` key: >it allowed to get the list of groups (of libraries) where this library >existed. Thanks to a previous patch set (bug 15295), this value was >not used anymore (I may have missed something!). > >Note that the only use of `GetBranch` was buggy (see bug 15746). > >Test plan (for the whole patch set): >The best way to test this whole patch set is to test with 2 instances: 1 >with the patch set applied, 1 using master, to be sure there is no >regression. >It would be good to test the same with `IndependentBranches` and the >without `IndependentBranches`. >No difference should be found. >The tester must focus on the library dropdowns on as many forms as >possible. >You will notice changes in the order of the options: the libraries will >now be ordered by branchname (instead of branchcode in some places). >A special attention will be given to the following page: >- acqui/neworderempty.pl >- catalogue/search.pl >- members/members-home.pl (header?) >- opac/opac-topissues.pl >- tools/holidays.pl >- admin/branch_transfer_limits.pl >- admin/item_circulation_alerts.pl >- rotating_collections/transferCollection.pl >- suggestion/suggestion.pl >- tools/export.pl > >Notes for QA: >- There are 2 FIXMEs in the patch set, I have kept the existing behavior, >but I am not sure it's the good one. Feel free to open a bug report and >I will fill a patch if you think it's not correct. Otherwise, remove the >FIXME lines in a follow-up patch. >- The whole patch set is huge and makes a lot of changes. >But it finally will tremendously reduce the number of lines: >716 insertions for 1910 deletions >--- > C4/Acquisition.pm | 20 +++++++++++++------ > C4/Auth.pm | 5 +++-- > C4/Biblio.pm | 3 ++- > C4/Branch.pm | 15 -------------- > C4/Circulation.pm | 7 +++---- > C4/ILSDI/Services.pm | 23 +++++++++++++++------- > C4/Items.pm | 13 +++++------- > C4/Koha.pm | 3 +-- > C4/Labels/Label.pm | 7 ++++--- > C4/SIP/ILS/Patron.pm | 6 ++++-- > C4/Search.pm | 7 ++++--- > acqui/acqui-home.pl | 7 ------- > acqui/basket.pl | 8 +++----- > acqui/orderreceive.pl | 6 ------ > acqui/pdfformat/layout3pages.pm | 12 +++++------ > acqui/pdfformat/layout3pagesfr.pm | 10 +++++----- > admin/branch_transfer_limits.pl | 4 ---- > admin/clone-rules.pl | 4 +--- > catalogue/detail.pl | 1 - > catalogue/getitem-ajax.pl | 6 +++--- > catalogue/moredetail.pl | 2 -- > circ/branchoverdues.pl | 2 +- > circ/circulation.pl | 2 -- > circ/returns.pl | 5 ++--- > circ/selectbranchprinter.pl | 4 +++- > circ/waitingreserves.pl | 4 +--- > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- > .../prog/en/modules/acqui/acqui-home.tt | 5 +++-- > .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 13 ++++++------ > .../prog/en/modules/acqui/orderreceive.tt | 5 +++-- > .../en/modules/admin/branch_transfer_limits.tt | 5 +++-- > .../prog/en/modules/admin/clone-rules.tt | 7 +++---- > .../prog/en/modules/catalogue/detail.tt | 7 ++++--- > .../prog/en/modules/catalogue/moredetail.tt | 5 +++-- > .../prog/en/modules/circ/branchoverdues.tt | 5 +++-- > .../prog/en/modules/circ/circulation.tt | 6 +++--- > .../en/modules/circ/circulation_batch_checkouts.tt | 2 +- > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 2 +- > .../prog/en/modules/circ/waitingreserves.tt | 6 +++--- > .../prog/en/modules/reports/itemtypes.tt | 3 ++- > .../prog/en/modules/suggestion/suggestion.tt | 2 +- > .../prog/en/modules/tools/holidays.tt | 7 ++++--- > .../prog/en/modules/tools/modborrowers.tt | 3 ++- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- > members/boraccount.pl | 1 - > members/deletemem.pl | 1 - > members/files.pl | 1 - > members/mancredit.pl | 1 - > members/maninvoice.pl | 1 - > members/member-flags.pl | 1 - > members/member-password.pl | 1 - > members/moremember.pl | 1 - > members/notices.pl | 2 -- > members/pay.pl | 1 - > members/paycollect.pl | 1 - > members/printfeercpt.pl | 1 - > members/printinvoice.pl | 1 - > members/purchase-suggestions.pl | 1 - > members/routing-lists.pl | 2 -- > members/statistics.pl | 1 - > opac/opac-detail.pl | 1 - > reports/itemtypes.plugin | 1 - > reports/reserves_stats.pl | 3 ++- > serials/routing-preview.pl | 3 ++- > suggestion/suggestion.pl | 5 +++-- > svc/holds | 3 +-- > t/db_dependent/Branch.t | 7 +------ > t/db_dependent/NewsChannels.t | 4 ++-- > t/db_dependent/Reserves.t | 3 ++- > tools/holidays.pl | 3 --- > tools/import_borrowers.pl | 5 +++-- > tools/modborrowers.pl | 1 - > tools/viewlog.pl | 1 - > 73 files changed, 146 insertions(+), 187 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 512924b..3594762 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -304,9 +304,12 @@ sub GetBasketAsCSV { > notes => $order->{'order_vendornote'}, > quantity => $order->{'quantity'}, > rrp => $order->{'rrp'}, >- deliveryplace => C4::Branch::GetBranchName( $basket->{'deliveryplace'} ), >- billingplace => C4::Branch::GetBranchName( $basket->{'billingplace'} ), > }; >+ for my $place ( qw( deliveryplace billingplace ) ) { >+ if ( my $library = Koha::Libraries->find( $row->{deliveryplace} ) ) { >+ $row->{$place} = $library->branchname >+ } >+ } > foreach(qw( > contractname author title publishercode collectiontitle notes > deliveryplace billingplace >@@ -377,11 +380,16 @@ sub GetBasketGroupAsCSV { > booksellerpostal => $bookseller->{postal}, > contractnumber => $contract->{contractnumber}, > contractname => $contract->{contractname}, >- basketgroupdeliveryplace => C4::Branch::GetBranchName( $basketgroup->{deliveryplace} ), >- basketgroupbillingplace => C4::Branch::GetBranchName( $basketgroup->{billingplace} ), >- basketdeliveryplace => C4::Branch::GetBranchName( $basket->{deliveryplace} ), >- basketbillingplace => C4::Branch::GetBranchName( $basket->{billingplace} ), >+ basketgroupdeliveryplace => $basketgroup->{deliveryplace}, >+ basketgroupbillingplace => $basketgroup->{billingplace}, >+ basketdeliveryplace => $basket->{deliveryplace}, >+ basketbillingplace => $basket->{billingplace}, > }; >+ for my $place (qw( basketgroupdeliveryplace basketgroupbillingplace basketdeliveryplace basketbillingplace )) { >+ if ( my $library = Koha::Libraries->find( $row->{deliveryplace} ) ) { >+ $row->{$place} = $library->branchname; >+ } >+ } > foreach(qw( > basketname author title publishercode collectiontitle notes > booksellername bookselleraddress booksellerpostal contractname >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 9481f73..7ef60e5 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -33,6 +33,7 @@ use C4::Branch; # GetBranches > use C4::Search::History; > use Koha; > use Koha::AuthUtils qw(hash_password); >+use Koha::Libraries; > use Koha::LibraryCategories; > use POSIX qw/strftime/; > use List::MoreUtils qw/ any /; >@@ -1071,7 +1072,7 @@ sub checkauth { > # if they specify at login, use that > if ( $query->param('branch') ) { > $branchcode = $query->param('branch'); >- $branchname = GetBranchName($branchcode); >+ $branchname = Koha::Libraries->find($branchcode)->branchname; > } > my $branches = GetBranches(); > if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) { >@@ -1512,7 +1513,7 @@ sub check_api_auth { > # if they specify at login, use that > if ( $query->param('branch') ) { > $branchcode = $query->param('branch'); >- $branchname = GetBranchName($branchcode); >+ $branchname = Koha::Libraries->find($branchcode)->branchname; > } > my $branches = GetBranches(); > my @branchesloop; >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 10faa83..f416f09 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -40,6 +40,7 @@ use C4::OAI::Sets; > > use Koha::Cache; > use Koha::Authority::Types; >+use Koha::Libraries; > > use vars qw($VERSION @ISA @EXPORT); > >@@ -1653,7 +1654,7 @@ sub GetAuthorisedValueDesc { > > #---- branch > if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { >- return C4::Branch::GetBranchName($value); >+ return Koha::Libraries->find($value)->branchname; > } > > #---- itemtypes >diff --git a/C4/Branch.pm b/C4/Branch.pm >index 9f82638..d63c4db 100644 >--- a/C4/Branch.pm >+++ b/C4/Branch.pm >@@ -29,7 +29,6 @@ BEGIN { > $VERSION = 3.07.00.049; > @ISA = qw(Exporter); > @EXPORT = qw( >- &GetBranchName > &GetBranch > &GetBranches > &GetBranchesLoop >@@ -154,20 +153,6 @@ sub GetBranchesLoop { # since this is what most pages want anyway > return \@loop; > } > >-=head2 GetBranchName >- >-=cut >- >-sub GetBranchName { >- my ($branchcode) = @_; >- my $dbh = C4::Context->dbh; >- my $sth; >- $sth = $dbh->prepare("Select branchname from branches where branchcode=?"); >- $sth->execute($branchcode); >- my $branchname = $sth->fetchrow_array; >- return ($branchname); >-} >- > =head2 GetBranch > > $branch = GetBranch( $query, $branches ); >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index fe891e4..c02b47c 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -966,7 +966,7 @@ sub CanBookBeIssued { > $issuingimpossible{ITEMNOTSAMEBRANCH} = 1; > $issuingimpossible{'itemhomebranch'} = $item->{C4::Context->preference("HomeOrHoldingBranch")}; > } >- $needsconfirmation{BORRNOTSAMEBRANCH} = GetBranchName( $borrower->{'branchcode'} ) >+ $needsconfirmation{BORRNOTSAMEBRANCH} = $borrower->{'branchcode'} > if ( $borrower->{'branchcode'} ne $userenv->{branch} ); > } > } >@@ -1026,7 +1026,6 @@ sub CanBookBeIssued { > my $resbor = $res->{'borrowernumber'}; > if ( $resbor ne $borrower->{'borrowernumber'} ) { > my ( $resborrower ) = C4::Members::GetMember( borrowernumber => $resbor ); >- my $branchname = GetBranchName( $res->{'branchcode'} ); > if ( $restype eq "Waiting" ) > { > # The item is on reserve and waiting, but has been >@@ -1036,7 +1035,7 @@ sub CanBookBeIssued { > $needsconfirmation{'ressurname'} = $resborrower->{'surname'}; > $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'}; > $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'}; >- $needsconfirmation{'resbranchname'} = $branchname; >+ $needsconfirmation{'resbranchcode'} = $res->{branchcode}; > $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'}; > } > elsif ( $restype eq "Reserved" ) { >@@ -1046,7 +1045,7 @@ sub CanBookBeIssued { > $needsconfirmation{'ressurname'} = $resborrower->{'surname'}; > $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'}; > $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'}; >- $needsconfirmation{'resbranchname'} = $branchname; >+ $needsconfirmation{'resbranchcode'} = $res->{branchcode}; > $needsconfirmation{'resreservedate'} = $res->{'reservedate'}; > } > } >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index e69c070..60cbc62 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -35,6 +35,8 @@ use CGI qw ( -utf8 ); > use DateTime; > use C4::Auth; > >+use Koha::Libraries; >+ > =head1 NAME > > C4::ILS-DI::Services - ILS-DI Services >@@ -219,8 +221,10 @@ sub GetRecords { > delete $item->{'more_subfields_xml'}; > > # Display branch names instead of branch codes >- $item->{'homebranchname'} = GetBranchName( $item->{'homebranch'} ); >- $item->{'holdingbranchname'} = GetBranchName( $item->{'holdingbranch'} ); >+ my $home_library = Koha::Libraries->find( $item->{homebranch} ); >+ my $holding_library = Koha::Libraries->find( $item->{holdingbranch} ); >+ $item->{'homebranchname'} = $home_library ? $home_library->branchname : ''; >+ $item->{'holdingbranchname'} = $holding_library ? $holding_library->branchname : ''; > } > > # Hashref building... >@@ -363,7 +367,8 @@ sub GetPatronInfo { > > # Cleaning the borrower hashref > $borrower->{'charges'} = $borrower->{'flags'}->{'CHARGES'}->{'amount'}; >- $borrower->{'branchname'} = GetBranchName( $borrower->{'branchcode'} ); >+ my $library = Koha::Libraries->find( $borrower->{branchcode} ); >+ $borrower->{'branchname'} = $library ? $library->branchname : ''; > delete $borrower->{'flags'}; > delete $borrower->{'userid'}; > delete $borrower->{'password'}; >@@ -403,7 +408,8 @@ sub GetPatronInfo { > > # Get additional informations > my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef ); >- my $branchname = GetBranchName( $reserve->{'branchcode'} ); >+ my $library = Koha::Libraries->find( $reserve->{branchcode} ); >+ my $branchname = $library ? $library->branchname : ''; > > # Remove unwanted fields > delete $item->{'marc'}; >@@ -632,7 +638,8 @@ sub HoldTitle { > # Hashref building > my $out; > $out->{'title'} = $title; >- $out->{'pickup_location'} = GetBranchName($branch); >+ my $library = Koha::Libraries->find( $branch ); >+ $out->{'pickup_location'} = $library ? $library->branchname : ''; > > # TODO $out->{'date_available'} = ''; > >@@ -708,7 +715,8 @@ sub HoldItem { > > # Hashref building > my $out; >- $out->{'pickup_location'} = GetBranchName($branch); >+ my $library = Koha::Libraries->find( $branch ); >+ $out->{'pickup_location'} = $library ? $library->branchname : ''; > > # TODO $out->{'date_available'} = ''; > >@@ -764,7 +772,8 @@ sub _availability { > } > > my $biblionumber = $item->{'biblioitemnumber'}; >- my $location = GetBranchName( $item->{'holdingbranch'} ); >+ my $library = Koha::Libraries->find( $item->{holdingbranch} ); >+ my $location = $library ? $library->branchname : ''; > > if ( $item->{'notforloan'} ) { > return ( $biblionumber, 'not available', 'Not for loan', $location ); >diff --git a/C4/Items.pm b/C4/Items.pm >index 26e9342..125f81d 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -37,6 +37,7 @@ use Data::Dumper; # used as part of logging item record changes, not just for > use Koha::DateUtils qw/dt_from_string/; > > use Koha::Database; >+use Koha::Libraries; > > use vars qw($VERSION @ISA @EXPORT); > >@@ -746,20 +747,16 @@ sub CheckItemPreSave { > > # check for valid home branch > if (exists $item_ref->{'homebranch'} and defined $item_ref->{'homebranch'}) { >- my $branch_name = C4::Branch::GetBranchName($item_ref->{'homebranch'}); >- unless (defined $branch_name) { >- # relies on fact that branches.branchname is a non-NULL column, >- # so GetBranchName returns undef only if branch does not exist >+ my $home_library = Koha::Libraries->find( $item_ref->{homebranch} ); >+ unless (defined $home_library) { > $errors{'invalid_homebranch'} = $item_ref->{'homebranch'}; > } > } > > # check for valid holding branch > if (exists $item_ref->{'holdingbranch'} and defined $item_ref->{'holdingbranch'}) { >- my $branch_name = C4::Branch::GetBranchName($item_ref->{'holdingbranch'}); >- unless (defined $branch_name) { >- # relies on fact that branches.branchname is a non-NULL column, >- # so GetBranchName returns undef only if branch does not exist >+ my $holding_library = Koha::Libraries->find( $item_ref->{holdingbranch} ); >+ unless (defined $holding_library) { > $errors{'invalid_holdingbranch'} = $item_ref->{'holdingbranch'}; > } > } >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 7171f16..a167ada 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -32,10 +32,9 @@ use DateTime::Format::MySQL; > use Business::ISBN; > use autouse 'Data::cselectall_arrayref' => qw(Dumper); > use DBI qw(:sql_types); >-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $DEBUG); >+use vars qw(@ISA @EXPORT @EXPORT_OK $DEBUG); > > BEGIN { >- $VERSION = 3.07.00.049; > require Exporter; > @ISA = qw(Exporter); > @EXPORT = qw( >diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm >index 9a405af..fc7b01e 100644 >--- a/C4/Labels/Label.pm >+++ b/C4/Labels/Label.pm >@@ -100,9 +100,10 @@ sub _get_label_item { > $data->{'itype'} = $data1->{'description'}; > # add *_description fields > if ($data->{'homebranch'} || $data->{'holdingbranch'}){ >- require C4::Branch; >- $data->{'homebranch_description'} = C4::Branch::GetBranchName($data->{'homebranch'}) if $data->{'homebranch'}; >- $data->{'holdingbranch_description'} = C4::Branch::GetBranchName($data->{'holdingbranch'}) if $data->{'holdingbranch'}; >+ require Koha::Libraries; >+ # FIXME Is this used?? >+ $data->{'homebranch_description'} = Koha::Libraries->find($data->{'homebranch'})->branchname if $data->{'homebranch'}; >+ $data->{'holdingbranch_description'} = Koha::Libraries->find($data->{'holdingbranch'})->branchname if $data->{'holdingbranch'}; > } > $data->{'ccode_description'} = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'ccode'} ,'','','CCODE', 1) if $data->{'ccode'}; > $data->{'location_description'} = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'location'} ,'','','LOC', 1) if $data->{'location'}; >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index 4e9c152..66ddfaa 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -20,10 +20,11 @@ use C4::Context; > use C4::Koha; > use C4::Members; > use C4::Reserves; >-use C4::Branch qw(GetBranchName); > use C4::Items qw( GetBarcodeFromItemnumber GetItemnumbersForBiblio); > use C4::Auth qw(checkpw_hash); > >+use Koha::Libraries; >+ > our $VERSION = 3.07.00.049; > > our $kp; # koha patron >@@ -357,7 +358,8 @@ sub holds_blocked_by_excessive_fees { > sub library_name { > my $self = shift; > unless ($self->{library_name}) { >- $self->{library_name} = GetBranchName($self->{branchcode}); >+ my $library = Koha::Libraries->find( $self->{branchcode} ); >+ $self->{library_name} = $library ? $library->branchname : ''; > } > return $self->{library_name}; > } >diff --git a/C4/Search.pm b/C4/Search.pm >index f52e0ee..d8b72da 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -22,6 +22,7 @@ use C4::Context; > use C4::Biblio; # GetMarcFromKohaField, GetBiblioData > use C4::Koha; # getFacets > use Koha::DateUtils; >+use Koha::Libraries; > use Lingua::Stem; > use C4::Search::PazPar2; > use XML::Simple; >@@ -1689,9 +1690,9 @@ sub buildQuery { > $limit_cgi .= "&limit=" . uri_escape_utf8($this_limit); > if ($this_limit =~ /^branch:(.+)/) { > my $branchcode = $1; >- my $branchname = GetBranchName($branchcode); >- if (defined $branchname) { >- $limit_desc .= " branch:$branchname"; >+ my $library = Koha::Libraries->find( $branchcode ); >+ if (defined $library) { >+ $limit_desc .= " branch:" . $library->branchname; > } else { > $limit_desc .= " $this_limit"; > } >diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl >index 393a131..a474f95 100755 >--- a/acqui/acqui-home.pl >+++ b/acqui/acqui-home.pl >@@ -50,9 +50,6 @@ my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( > } > ); > >-my $user = GetMember( 'borrowernumber' => $loggedinuser ); >-my $branchname = GetBranchName($user->{branchcode}); >- > my $status = $query->param('status') || "ASKED"; > my $suggestions_count = CountSuggestion($status); > >@@ -73,9 +70,6 @@ my @budget_loop; > foreach my $budget ( @{$budget_arr} ) { > next unless (CanUserUseBudget($loggedinuser, $budget, $userflags)); > >- $budget->{'budget_branchname'} = >- GetBranchName( $budget->{'budget_branchcode'} ); >- > my $member = GetMember( borrowernumber => $budget->{budget_owner_id} ); > if ($member) { > $budget->{budget_owner_firstname} = $member->{'firstname'}; >@@ -116,7 +110,6 @@ foreach my $budget ( @{$budget_arr} ) { > $template->param( > type => 'intranet', > loop_budget => \@budget_loop, >- branchname => $branchname, > total => $total, > totspent => $totspent, > totordered => $totordered, >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 5fa94f8..decf0f4 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -340,8 +340,6 @@ if ( $op eq 'delete_confirm' ) { > > if ($basket->{basketgroupid}){ > $basketgroup = GetBasketgroup($basket->{basketgroupid}); >- $basketgroup->{deliveryplacename} = C4::Branch::GetBranchName( $basketgroup->{deliveryplace} ); >- $basketgroup->{billingplacename} = C4::Branch::GetBranchName( $basketgroup->{billingplace} ); > } > my $borrower= GetMember('borrowernumber' => $loggedinuser); > my $budgets = GetBudgetHierarchy; >@@ -359,7 +357,7 @@ if ( $op eq 'delete_confirm' ) { > $template->param( > basketno => $basketno, > basketname => $basket->{'basketname'}, >- basketbranchname => C4::Branch::GetBranchName($basket->{branch}), >+ basketbranchcode => $basket->{branch}, > basketnote => $basket->{note}, > basketbooksellernote => $basket->{booksellernote}, > basketcontractno => $basket->{contractnumber}, >@@ -372,8 +370,8 @@ if ( $op eq 'delete_confirm' ) { > users => \@basketusers, > closedate => $basket->{closedate}, > estimateddeliverydate=> $estimateddeliverydate, >- deliveryplace => C4::Branch::GetBranchName( $basket->{deliveryplace} ), >- billingplace => C4::Branch::GetBranchName( $basket->{billingplace} ), >+ deliveryplace => $basket->{deliveryplace}, >+ billingplace => $basket->{billingplace}, > active => $bookseller->{'active'}, > booksellerid => $bookseller->{'id'}, > name => $bookseller->{'name'}, >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index a75a624..b07ee0f 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -129,12 +129,6 @@ if ($AcqCreateItem eq 'receiving') { > my @items; > foreach (@itemnumbers) { > my $item = GetItem($_); >- if($item->{homebranch}) { >- $item->{homebranchname} = GetBranchName($item->{homebranch}); >- } >- if($item->{holdingbranch}) { >- $item->{holdingbranchname} = GetBranchName($item->{holdingbranch}); >- } > if(my $code = GetAuthValCode("items.notforloan", $fw)) { > $item->{notforloan} = GetKohaAuthorisedValueLib($code, $item->{notforloan}); > } >diff --git a/acqui/pdfformat/layout3pages.pm b/acqui/pdfformat/layout3pages.pm >index ffec723..15a478d 100644 >--- a/acqui/pdfformat/layout3pages.pm >+++ b/acqui/pdfformat/layout3pages.pm >@@ -29,8 +29,6 @@ use strict; > use warnings; > use utf8; > >-use C4::Branch qw(GetBranchName); >- > use Koha::Number::Price; > use Koha::DateUtils; > use Koha::Libraries; >@@ -65,7 +63,9 @@ sub printorders { > my $number = 3; > for my $basket (@$baskets){ > my $page = $pdf->page(); >- >+ my $billing_library = Koha::Libraries->find( $basket->{billingplace} ); >+ my $delivery_library = Koha::Libraries->find( $basket->{deliveryplace} ); >+ > # print basket header (box) > my $box = $page->gfx; > $box->rectxy(($width - 10)/mm, ($height - 5)/mm, 10/mm, ($height - 25)/mm); >@@ -80,9 +80,9 @@ sub printorders { > $text->text("Order no. ".$basketgroup->{'id'}.". Basket no. ".$basket->{basketno}.". ".$basket->{booksellernote}); > $text->translate(20/mm, ($height-20)/mm); > $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm ); >- $text->text( ( $basket->{billingplace} ? "Billing at " . C4::Branch::GetBranchName( $basket->{billingplace} ) : "" ) >- . ( $basket->{billingplace} and $basket->{deliveryplace} ? " and " : "" ) >- . ( $basket->{deliveryplace} ? "delivery at " . C4::Branch::GetBranchName( $basket->{deliveryplace}) : "" ) >+ $text->text( ( $billing_library ? "Billing at " . $billing_library->branchname : "" ) >+ . ( $billing_library and $delivery_library ? " and " : "" ) >+ . ( $delivery_library ? "delivery at " . $delivery_library->branchname : "" ) > ); > > my $pdftable = new PDF::Table(); >diff --git a/acqui/pdfformat/layout3pagesfr.pm b/acqui/pdfformat/layout3pagesfr.pm >index 66ba608..ba54783 100644 >--- a/acqui/pdfformat/layout3pagesfr.pm >+++ b/acqui/pdfformat/layout3pagesfr.pm >@@ -28,8 +28,6 @@ use strict; > use warnings; > use utf8; > >-use C4::Branch qw(GetBranchName); >- > use Koha::Number::Price; > use Koha::DateUtils; > use Koha::Libraries; >@@ -64,6 +62,8 @@ sub printorders { > my $number = 3; > for my $basket (@$baskets){ > my $page = $pdf->page(); >+ my $billing_library = Koha::Libraries->find( $basket->{billingplace} ); >+ my $delivery_library = Koha::Libraries->find( $basket->{deliveryplace} ); > > # print basket header (box) > my $box = $page->gfx; >@@ -79,9 +79,9 @@ sub printorders { > $text->text("Commande N°".$basketgroup->{'id'}.". Panier N° ".$basket->{basketno}.". ".$basket->{booksellernote}); > $text->translate(20/mm, ($height-20)/mm); > $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm ); >- $text->text( ( $basket->{billingplace} ? "Facturation à " . C4::Branch::GetBranchName( $basket->{billingplace} ) : "" ) >- . ( $basket->{billingplace} and $basket->{deliveryplace} ? " et " : "" ) >- . ( $basket->{deliveryplace} ? "livraison à " . C4::Branch::GetBranchName( $basket->{deliveryplace}) : "" ) >+ $text->text( ( $billing_library ? "Facturation à " . $billing_library->branchname : "" ) >+ . ( $billing_library and $delivery_library ? " et " : "" ) >+ . ( $delivery_library ? "livraison à " . $delivery_library->branchname : "" ) > ); > > my $pdftable = new PDF::Table(); >diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl >index 0adc958..d1e59c7 100755 >--- a/admin/branch_transfer_limits.pl >+++ b/admin/branch_transfer_limits.pl >@@ -50,8 +50,6 @@ else > $branchcode = $input->param('branchcode'); > } > >-my $branchname = GetBranchName($branchcode); >- > # Getting the branches for user selection > my $branches = GetBranches(); > my @branch_loop; >@@ -124,7 +122,6 @@ foreach my $code ( @codes ) { > $row_data{ code } = $code; > $row_data{ toBranch } = $toBranch; > $row_data{ isChecked } = $isChecked; >- $row_data{ toBranchname } = GetBranchName($toBranch); > push( @to_branch_loop, \%row_data ); > } > >@@ -138,7 +135,6 @@ $template->param( > branch_loop => \@branch_loop, > branchcode_loop => \@branchcode_loop, > branchcode => $branchcode, >- branchname => $branchname, > limitType => $limitType, > ); > >diff --git a/admin/clone-rules.pl b/admin/clone-rules.pl >index 41f4ad6..d2412ae 100755 >--- a/admin/clone-rules.pl >+++ b/admin/clone-rules.pl >@@ -33,7 +33,7 @@ use C4::Output; > use C4::Auth; > use C4::Koha; > use C4::Debug; >-use C4::Branch; # GetBranches >+use C4::Branch; # GetBranchesLoop > > my $input = new CGI; > my $dbh = C4::Context->dbh; >@@ -52,9 +52,7 @@ my $tobranch = $input->param("tobranch"); > my $branchloop = GetBranchesLoop; > > $template->param(frombranch => $frombranch) if ($frombranch); >-$template->param(frombranchname => GetBranchName($frombranch)) if ($frombranch); > $template->param(tobranch => $tobranch) if ($tobranch); >-$template->param(tobranchname => GetBranchName($tobranch)) if ($tobranch); > > $template->param(branchloop => $branchloop); > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 96e7752..fe8a15d 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -152,7 +152,6 @@ foreach my $subscription (@subscriptions) { > $cell{missinglist} = $subscription->{missinglist}; > $cell{librariannote} = $subscription->{librariannote}; > $cell{branchcode} = $subscription->{branchcode}; >- $cell{branchname} = GetBranchName($subscription->{branchcode}); > $cell{hasalert} = $subscription->{hasalert}; > $cell{callnumber} = $subscription->{callnumber}; > $cell{closed} = $subscription->{closed}; >diff --git a/catalogue/getitem-ajax.pl b/catalogue/getitem-ajax.pl >index fd69a74..fa0aa61 100755 >--- a/catalogue/getitem-ajax.pl >+++ b/catalogue/getitem-ajax.pl >@@ -23,10 +23,10 @@ use JSON; > > use C4::Auth; > use C4::Biblio; >-use C4::Branch; > use C4::Items; > use C4::Koha; > use C4::Output; >+use Koha::Libraries; > > my $cgi = new CGI; > >@@ -46,11 +46,11 @@ if($itemnumber) { > $item = GetItem($itemnumber); > > if($item->{homebranch}) { >- $item->{homebranchname} = GetBranchName($item->{homebranch}); >+ $item->{homebranchname} = Koha::Libraries->find($item->{homebranch})->branchname; > } > > if($item->{holdingbranch}) { >- $item->{holdingbranchname} = GetBranchName($item->{holdingbranch}); >+ $item->{holdingbranchname} = Koha::Libraries->find($item->{holdingbranch})->branchname; > } > > if(my $code = GetAuthValCode("items.notforloan", $fw)) { >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index aa23799..547e984 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -186,8 +186,6 @@ foreach my $item (@items){ > $item->{'nomod'}=1; > } > } >- $item->{'homebranchname'} = GetBranchName($item->{'homebranch'}); >- $item->{'holdingbranchname'} = GetBranchName($item->{'holdingbranch'}); > if ($item->{'datedue'}) { > $item->{'issue'}= 1; > } else { >diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl >index d04f5e4..22c46f0 100755 >--- a/circ/branchoverdues.pl >+++ b/circ/branchoverdues.pl >@@ -125,7 +125,7 @@ foreach my $num (@getoverdues) { > $overdueforbranch{'borrowerfirstname'} = $num->{'firstname'}; > $overdueforbranch{'borrowerphone'} = $num->{'phone'}; > $overdueforbranch{'borroweremail'} = $num->{'email'}; >- $overdueforbranch{'homebranch'} = GetBranchName($num->{'homebranch'}); >+ $overdueforbranch{'homebranch'} = $num->{'homebranch'}; > $overdueforbranch{'itemcallnumber'} = $num->{'itemcallnumber'}; > $overdueforbranch{'borrowernumber'} = $num->{'borrowernumber'}; > $overdueforbranch{'itemnumber'} = $num->{'itemnumber'}; >diff --git a/circ/circulation.pl b/circ/circulation.pl >index bbf43c3..3944cc7 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -70,7 +70,6 @@ my $branch = $query->param('branch'); > if ($branch){ > # update our session so the userenv is updated > $session->param('branch', $branch); >- $session->param('branchname', GetBranchName($branch)); > } > > my $printer = $query->param('printer'); >@@ -605,7 +604,6 @@ $template->param( > borrowernumber => $borrowernumber, > categoryname => $borrower->{'description'}, > branch => $branch, >- branchname => GetBranchName($borrower->{'branchcode'}), > printer => $printer, > printername => $printer, > was_renewed => $query->param('was_renewed') ? 1 : 0, >diff --git a/circ/returns.pl b/circ/returns.pl >index 8ff9350..b294124 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -44,7 +44,7 @@ use C4::Reserves; > use C4::Biblio; > use C4::Items; > use C4::Members; >-use C4::Branch; # GetBranches GetBranchName >+use C4::Branch; # GetBranches > use C4::Koha; # FIXME : is it still useful ? > use C4::RotatingCollections; > use Koha::DateUtils; >@@ -171,7 +171,6 @@ if ( $query->param('resbarcode') ) { > itemnumber => $iteminfo->{'itemnumber'}, > itembiblionumber => $iteminfo->{'biblionumber'}, > iteminfo => $iteminfo->{'author'}, >- tobranchname => GetBranchName($messages->{'transfert'}), > name => $name, > borrowernumber => $borrowernumber, > borcnum => $borr->{'cardnumber'}, >@@ -633,7 +632,7 @@ if ( $itemnumber ) { > if ( ! ( $holdingBranch eq $collectionBranch ) ) { > $template->param( > collectionItemNeedsTransferred => 1, >- collectionBranch => GetBranchName($collectionBranch), >+ collectionBranch => $collectionBranch, > ); > } > } >diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl >index 7c0c6d7..09b41d3 100755 >--- a/circ/selectbranchprinter.pl >+++ b/circ/selectbranchprinter.pl >@@ -28,6 +28,8 @@ use C4::Print; # GetPrinters > use C4::Koha; > use C4::Branch; # GetBranches GetBranchesLoop > >+use Koha::Libraries; >+ > # this will be the script that chooses branch and printer settings.... > > my $query = CGI->new(); >@@ -58,7 +60,7 @@ my @updated; > # $session lddines here are doing the updating > if ($branch and $branches->{$branch}) { > if (! $userenv_branch or $userenv_branch ne $branch ) { >- my $branchname = GetBranchName($branch); >+ my $branchname = Koha::Libraries->find($branch)->branchname; > $template->param(LoginBranchname => $branchname); # update template for new branch > $template->param(LoginBranchcode => $branch); # update template for new branch > $session->param('branchname', $branchname); # update sesssion in DB >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 268213a..046e0df 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -23,7 +23,6 @@ use warnings; > use CGI qw ( -utf8 ); > use C4::Context; > use C4::Output; >-use C4::Branch; # GetBranchName > use C4::Auth; > use C4::Circulation; > use C4::Members; >@@ -115,7 +114,6 @@ foreach my $num (@getreserves) { > $getreserv{'subtitle'} = GetRecordValue('subtitle', GetMarcBiblio($gettitle->{'biblionumber'}), GetFrameworkCode($gettitle->{'biblionumber'})); > $getreserv{'biblionumber'} = $gettitle->{'biblionumber'}; > $getreserv{'barcode'} = $gettitle->{'barcode'}; >- $getreserv{'branchname'} = GetBranchName($gettitle->{'homebranch'}); > $getreserv{'homebranch'} = $gettitle->{'homebranch'}; > $getreserv{'holdingbranch'} = $gettitle->{'holdingbranch'}; > $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'}; >@@ -190,7 +188,7 @@ sub cancel { > my $iteminfo = GetBiblioFromItemNumber($item); > if ( $messages->{'transfert'} ) { > $res{messagetransfert} = $messages->{'transfert'}; >- $res{branchname} = GetBranchName($messages->{'transfert'}); >+ $res{branchcode} = $messages->{'transfert'}; > } > > $res{message} = 1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index 7c52ce5..ec70d84 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -60,7 +60,7 @@ > [% END %] > [% END %][% END %] > <li class="patroncategory">Category: [% categoryname %] ([% categorycode %])</li> >- <li class="patronlibrary">Home library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]</li> >+ <li class="patronlibrary">Home library: [% LoginBranchname %]</li> > </ul></div> > <div id="menu"> > <ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >index 82f201f..61e4651 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >@@ -1,4 +1,5 @@ > [% USE Price %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -135,7 +136,7 @@ $(document).ready(function() { > > [% IF ( loop_budget ) %] > >- <h3>All available funds[% IF ( branchname ) %] for [% branchname %][% END %]</h3> >+ <h3>All available funds[% IF LoginBranchname %] for [% LoginBranchname %][% END %]</h3> > > <div id="BudgetsAndFunds"> > <table id="accounts"> >@@ -195,7 +196,7 @@ $(document).ready(function() { > > [% END %] > </td> >- <td>[% loop_budge.budget_branchname %]</td> >+ <td>[% Branches.GetName( loop_budge.budget_branchcode ) %]</td> > <td class="data"> > [% IF loop_budge.budget_parent_id %] > [% loop_budge.budget_amount | $Price %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index 00f001b..50344c8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE Branches %] > [% USE Price %] > [% USE AuthorisedValues %] > >@@ -255,8 +256,8 @@ > [% IF ( basketcontractno ) %] > <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]&booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li> > [% END %] >- [% IF ( deliveryplace ) %]<li><span class="label">Delivery place:</span> [% deliveryplace %]</li>[% END %] >- [% IF ( billingplace ) %]<li><span class="label">Billing place:</span> [% billingplace %]</li>[% END %] >+ [% IF deliveryplace %]<li><span class="label">Delivery place:</span> [% Branches.GetName( deliveryplace ) %]</li>[% END %] >+ [% IF billingplace %]<li><span class="label">Billing place:</span> [% Branches.GetName( billingplace ) %]</li>[% END %] > [% IF ( authorisedbyname ) %]<li><span class="label">Created by:</span> [% authorisedbyname %]</li>[% END %] > <li id="managedby"> > <form action="" method="post"> >@@ -280,8 +281,8 @@ > </li> > <li id="branch"> > <span class="label">Library:</span> >- [% IF basketbranchname %] >- [% basketbranchname %] >+ [% IF basketbranchcode %] >+ [% Branches.GetName( basketbranchcode ) %] > [% ELSE %] > No library > [% END %] >@@ -354,8 +355,8 @@ > <input type="submit" value="Change basket group" /> > [% END %] > </li> >- [% IF ( basketgroup.deliveryplacename ) %]<li><span class="label">Basket group delivery placename:</span> [% basketgroup.deliveryplacename %]</li>[% END %] >- [% IF ( basketgroup.billingplacename ) %]<li><span class="label">Basket group billing place:</span> [% basketgroup.billingplacename %]</li>[% END %] >+ [% IF basketgroup.deliveryplace %]<li><span class="label">Basket group delivery placename:</span> [% Branches.GetName( basketgroup.deliveryplace ) %]</li>[% END %] >+ [% IF basketgroup.billingplace %]<li><span class="label">Basket group billing place:</span> [% Branches.GetName( basketgroup.billingplace ) %]</li>[% END %] > </ol> > [% IF ( CAN_user_acquisition_group_manage ) %] > </form> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index 26da5fc..54afee0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -238,8 +239,8 @@ > <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber %]" /></td> > <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber %],[% item.itemnumber %]);">Edit</a></td> > <td>[% item.barcode %]</td> >- <td>[% item.homebranchname %]</td> >- <td>[% item.holdingbranchname %]</td> >+ <td>[% Branches.GetName( item.homebranch )%]</td> >+ <td>[% Branches.GetName( item.holdingbranch ) %]</td> > <td>[% item.notforloan %]</td> > <td>[% item.restricted %]</td> > <td>[% item.location %]</td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >index 1a335a2..1cc394e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Library checkin and transfer policy</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -54,7 +55,7 @@ > <div id="yui-main"> > <div class="yui-b"> > >-<h1>Library [% branchcode %] - [% branchname %] Checkin and transfer policy</h1> >+<h1>Library [% branchcode %] - [% Branches.GetName( branchcode ) %] Checkin and transfer policy</h1> > <form method="get" action="/cgi-bin/koha/admin/branch_transfer_limits.pl" id="selectlibrary"> > <label for="branchselect">Select a library :</label> > <select name="branchcode" id="branchselect"> >@@ -96,7 +97,7 @@ > <tbody> > [% FOREACH to_branch_loo IN codes_loo.to_branch_loop %] > <tr> >- <td><label style="min-width:400px;" for="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row">[% to_branch_loo.toBranch %] - [% to_branch_loo.toBranchname %]</label></td> >+ <td><label style="min-width:400px;" for="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row">[% to_branch_loo.toBranch %] - [% Branches.GetName( to_branch_loo.toBranch ) %]</label></td> > <td> > [% IF ( to_branch_loo.isChecked ) %] > <input type="checkbox" id="[% to_branch_loo.code %][% to_branch_loo.toBranch %]row" name="[% to_branch_loo.code %]_[% to_branch_loo.toBranch %]" checked="checked" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt >index a9268cb..1326dbc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Issuing rules › Clone issuing rules</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -14,10 +15,8 @@ > <div id="yui-main"> > <div class="yui-b"> > <h2>Cloning issuing rules >- [% IF ( frombranchname || tobranchname ) %] >- [% IF ( frombranchname ) %] from "[% frombranchname %]"[% END %] >- [% IF ( tobranchname ) %] to "[% tobranchname %]"[% END %] >- [% END %] >+ [% IF frombranch %] from "[% Branches.GetName( frombranch ) %]"[% END %] >+ [% IF tobranch %] to "[% Branches.GetName( tobranch ) %]"[% END %] > </h2> > > [% IF ( result ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 5cb1cc3..d32cc50 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -616,7 +616,7 @@ function verify_images() { > [% item.translated_description %] > </td> > [% END %] >- <td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td> >+ <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) %] [% END %]</td> > <td class="homebranch">[% Branches.GetName(item.homebranch) %]<span class="shelvingloc">[% item.location %]</span> </td> > [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %] > <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td> >@@ -875,8 +875,9 @@ function verify_images() { > <h2>This is a serial subscription</h2> > <p> (There are [% subscriptionsnumber %] subscriptions associated with this title).</p> > [% FOREACH subscription IN subscriptions %] >- [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %] >- [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %] >+ [% IF subscription.branchcode %] >+ <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode %]</h3> >+ [% END %] > [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %] > [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %] </p>[% END %] > [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index 801460e..5df2b02 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Catalog › Item details for [% title %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -62,7 +63,7 @@ > [% END %] > [% END %][% END %]</h4> > <ol class="bibliodetails"> >- <li><span class="label">Home library:</span> [% ITEM_DAT.homebranchname %] </li> >+ <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) %] </li> > [% IF ( item_level_itypes ) %] > <li><span class="label">Item type:</span> [% ITEM_DAT.itype %] </li> > [% END %] >@@ -80,7 +81,7 @@ > )[% END %]</h4> > > <ol class="bibliodetails"> >- <li><span class="label">Current location:</span> [% ITEM_DAT.holdingbranchname %] </li> >+ <li><span class="label">Current location:</span> [% Branches.GetName( ITEM_DAT.holdingbranch ) %] </li> > <li><span class="label">Checkout status:</span> > [% IF ( ITEM_DAT.issue ) %]Checked out to > [% IF ( hidepatronname ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >index eaef667..d4ba723 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Circulation › Overdues at [% LoginBranchname %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -54,7 +55,7 @@ > [% IF ( overduesloo.borroweremail ) %]<a href="mailto:[% overduesloo.borroweremail %]?subject=Overdue: [% overduesloo.title %]"> > [% overduesloo.borroweremail %]</a>[% END %] > </td> >- <td>[% overduesloo.homebranch %] [% overduesloo.itemcallnumber %] >+ <td>[% Branches.GetName( overduesloo.homebranch ) %] [% overduesloo.itemcallnumber %] > </td> > <td align="center"> > <b> >@@ -132,7 +133,7 @@ > [% todayoverduesloo.borroweremail %]</a>[% END %] > </p> > </td> >- <td><p>[% todayoverduesloo.homebranch %] [% todayoverduesloo.itemcallnumber %]</p> >+ <td><p>[% Branches.GetName( todayoverduesloo.homebranch ) %] [% todayoverduesloo.itemcallnumber %]</p> > </td> > <td align="center"> > <b> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 633e756..8782cbb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -238,11 +238,11 @@ $(document).ready(function() { > [% END %] > > [% IF ( RESERVE_WAITING ) %] >- <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% resbranchname %] since [% reswaitingdate | $KohaDates %]</li> >+ <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% Branches.GetName( resbranchcode ) %] since [% reswaitingdate | $KohaDates %]</li> > [% END %] > > [% IF ( RESERVED ) %] >- <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% resbranchname %] since [% resreservedate | $KohaDates %]</li> >+ <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% Branches.GetName( resbranchcode ) %] since [% resreservedate | $KohaDates %]</li> > [% END %] > > [% IF ( ISSUED_TO_ANOTHER ) %] >@@ -262,7 +262,7 @@ $(document).ready(function() { > [% END %] > > [% IF ( BORRNOTSAMEBRANCH ) %] >- <li>This patron is from a different library ([% BORRNOTSAMEBRANCH %])</li> >+ <li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) %])</li> > [% END %] > > [% IF ( PATRON_CANT ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >index c09f87f..bc47de8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >@@ -156,7 +156,7 @@ $(document).ready(function() { > Too many checked out. > [% END %] > [% IF checkout_info.BORRNOTSAMEBRANCH %] >- This patron is from a different library ([% checkout_info.BORRNOTSAMEBRANCH %])</li> >+ This patron is from a different library ([% Branches.GetName( checkout_info.BORRNOTSAMEBRANCH ) %]) > [% END %] > [% IF checkout_ino.PATRON_CANT %] > This patron can't check out this item per library circulation policy. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index aace2fb..cbe445d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -134,7 +134,7 @@ $(document).ready(function () { > > [% IF ( collectionItemNeedsTransferred ) %] > <div id="rotating-collection" class="dialog message"> >- <h3>Please transfer item to: [% collectionBranch %]</h3> >+ <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) %]</h3> > <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber %]">[% itembarcode %]: [% title %]</a></p> > <p>This item is part of a rotating collection.</p> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index 3ec4f1b..4c1a5eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -47,7 +47,7 @@ > [% FOREACH cancel_result %] > [% IF ( messagetransfert ) %] > <div class="dialog message"> >- <h2>This item is on hold for pick-up at [% branchname %]</h2> >+ <h2>This item is on hold for pick-up at [% Branches.GetName( branchname ) %]</h2> > <p><strong>[% nextreservtitle %]</strong> is on hold for <strong> [% nextreservsurname %], [% nextreservfirstname %]</strong>. > Please retain this item and check it in to process the hold. > </p> >@@ -111,7 +111,7 @@ > <input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" /> > <input type="hidden" name="tab" value="holdswaiting"> > [% IF ( reserveloo.dotransfer ) %] >- <input type="submit" value="Cancel hold and return to : [% reserveloo.branchname %]" /> >+ <input type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) %]" /> > [% ELSE %] > <input type="submit" value="Cancel hold" /> > [% END %] >@@ -171,7 +171,7 @@ > <input type="hidden" name="tbr" value="[% overloo.homebranch %]" /> > <input type="hidden" name="tab" value="holdsover"> > [% IF ( overloo.dotransfer ) %] >- <input type="submit" value="Cancel hold and return to : [% overloo.branchname %]" /> >+ <input type="submit" value="Cancel hold and return to : [% Branches.GetName( overloo.homebranch ) %]" /> > [% ELSE %] > <input type="submit" value="Cancel hold" /> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >index 014d5aa..bc1c3bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% USE ItemTypes %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Reports › Catalog by item types</title> >@@ -31,7 +32,7 @@ $(document).ready(function(){ > > [% IF ( do_it ) %] > [% FOREACH mainloo IN mainloop %] >- <h1>Reports on item types [% IF ( mainloo.branchname ) %] held at [% mainloo.branchname %][% END %]</h1> >+ <h1>Reports on item types [% IF branch %] held at [% Branches.GetName( branch ) %][% END %]</h1> > <table id="itemtypest"> > <thead> > <tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 92389ac..395dd2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -278,7 +278,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <fieldset class="rows"> <legend>Acquisition information</legend> > <ol> > <li> >- <span class="label">Library:</span> [% branchname %] >+ <span class="label">Library:</span> [% Branches.GetName( branchcode ) %] > </li> > <li> > <span class="label">Fund:</span> [% budgetname %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >index 4f77b04..61779b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >@@ -1,5 +1,6 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Tools › [% branchname %] calendar</title> >+<title>Koha › Tools › [% Branches.GetName( branch ) %] calendar</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >@@ -219,14 +220,14 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% branchname %] calendar</div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% Branches.GetName( branchname ) %] calendar</div> > > <div id="doc3" class="yui-t1"> > > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >- <h2>[% branchname %] calendar</h2> >+ <h2>[% Branches.GetName( branchname ) %] calendar</h2> > <div class="yui-g"> > <div class="yui-u first"> > <label for="branch">Define the holidays for:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index 3bd2bf5..85774de 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc'%] > <title>Koha › Tools › Batch patron modification</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -253,7 +254,7 @@ > <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">[% borrower.cardnumber %]</a></td> > <td>[% borrower.surname %]</td> > <td>[% borrower.firstname %]</td> >- <td>[% borrower.branchname %]</td> >+ <td>[% Branches.GetName( borrower.branchcode ) %]</td> > <td>[% borrower.categorycode %]</td> > <td>[% borrower.city %]</td> > <td>[% borrower.state %]</td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index b9ab8cb..998ed70 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -798,8 +798,8 @@ > <h2>This is a serial</h2> > <p>There are [% subscriptionsnumber %] subscription(s) associated with this title.</p> > [% FOREACH subscription IN subscriptions %] >- [% IF ( subscription.branchname ) %] >- <h3>At library: [% subscription.branchname %]</h3> >+ [% IF ( subscription.branchcode ) %] >+ <h3>At library: [% Branches.GetName( subscription.branchname ) %]</h3> > [% ELSE %] > [% IF ( subscription.branchcode ) %] > <h3>At library: [% subscription.branchcode %]</h3> >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 2c03ce2..0f0313d 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -110,7 +110,6 @@ $template->param(%$data); > $template->param( > finesview => 1, > borrowernumber => $borrowernumber, >- branchname => GetBranchName($data->{'branchcode'}), > total => sprintf("%.2f",$total), > totalcredit => $totalcredit, > is_child => ($data->{'category_type'} eq 'C'), >diff --git a/members/deletemem.pl b/members/deletemem.pl >index 869ebf3..192eef3 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -126,7 +126,6 @@ if ($countissues > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'} or $de > phone => $bor->{'phone'}, > email => $bor->{'email'}, > branchcode => $bor->{'branchcode'}, >- branchname => GetBranchName($bor->{'branchcode'}), > activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), > RoutingSerials => C4::Context->preference('RoutingSerials'), > ); >diff --git a/members/files.pl b/members/files.pl >index 45ed50d..40d5d31 100755 >--- a/members/files.pl >+++ b/members/files.pl >@@ -103,7 +103,6 @@ else { > > $template->param( > categoryname => $data->{'description'}, >- branchname => GetBranchName($data->{'branchcode'}), > RoutingSerials => C4::Context->preference('RoutingSerials'), > ); > >diff --git a/members/mancredit.pl b/members/mancredit.pl >index dc13d1f..e3a9e26 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -98,7 +98,6 @@ if ($add){ > finesview => 1, > borrowernumber => $borrowernumber, > categoryname => $data->{'description'}, >- branchname => GetBranchName($data->{'branchcode'}), > is_child => ($data->{'category_type'} eq 'C'), > activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), > RoutingSerials => C4::Context->preference('RoutingSerials'), >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 7762f5c..d645607 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -123,7 +123,6 @@ if ($add){ > finesview => 1, > borrowernumber => $borrowernumber, > categoryname => $data->{'description'}, >- branchname => GetBranchName($data->{'branchcode'}), > is_child => ($data->{'category_type'} eq 'C'), > activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), > RoutingSerials => C4::Context->preference('RoutingSerials'), >diff --git a/members/member-flags.pl b/members/member-flags.pl >index 090ebc7..d3c699a 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -191,7 +191,6 @@ $template->param( > email => $bor->{'email'}, > emailpro => $bor->{'emailpro'}, > branchcode => $bor->{'branchcode'}, >- branchname => GetBranchName($bor->{'branchcode'}), > loop => \@loop, > is_child => ($bor->{'category_type'} eq 'C'), > activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), >diff --git a/members/member-password.pl b/members/member-password.pl >index 95d5f8f..b918ae9 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -134,7 +134,6 @@ $template->param( > email => $bor->{'email'}, > emailpro => $bor->{'emailpro'}, > branchcode => $bor->{'branchcode'}, >- branchname => GetBranchName( $bor->{'branchcode'} ), > userid => $bor->{'userid'}, > destination => $destination, > is_child => ( $bor->{'category_type'} eq 'C' ), >diff --git a/members/moremember.pl b/members/moremember.pl >index 7b44ecc..ae1bc73 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -47,7 +47,6 @@ use C4::Circulation; > use C4::Koha; > use C4::Letters; > use C4::Biblio; >-use C4::Branch; # GetBranchName > use C4::Form::MessagingPreferences; > use List::MoreUtils qw/uniq/; > use C4::Members::Attributes qw(GetBorrowerAttributes); >diff --git a/members/notices.pl b/members/notices.pl >index f7e1f70..dd8b98c 100755 >--- a/members/notices.pl >+++ b/members/notices.pl >@@ -25,7 +25,6 @@ use C4::Auth; > use C4::Output; > use CGI qw ( -utf8 ); > use C4::Members; >-use C4::Branch; > use C4::Letters; > use C4::Members::Attributes qw(GetBorrowerAttributes); > >@@ -66,7 +65,6 @@ $template->param( > QUEUED_MESSAGES => $queued_messages, > borrowernumber => $borrowernumber, > sentnotices => 1, >- branchname => GetBranchName($borrower->{'branchcode'}), > categoryname => $borrower->{'description'}, > activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), > RoutingSerials => C4::Context->preference('RoutingSerials'), >diff --git a/members/pay.pl b/members/pay.pl >index 66f9929..6632053 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -234,7 +234,6 @@ sub borrower_add_additional_fields { > ); > } > >- $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); > return; > } > >diff --git a/members/paycollect.pl b/members/paycollect.pl >index e4dc80b..72b435c 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -178,6 +178,5 @@ sub borrower_add_additional_fields { > $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); > } > >- $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); > return; > } >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index 91e8af6..78137ab 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -134,7 +134,6 @@ $template->param( > phone => $data->{'phone'}, > email => $data->{'email'}, > branchcode => $data->{'branchcode'}, >- branchname => GetBranchName($data->{'branchcode'}), > total => sprintf("%.2f",$total), > totalcredit => $totalcredit, > is_child => ($data->{'category_type'} eq 'C'), >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >index b789fdb..bd8de48 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -133,7 +133,6 @@ $template->param( > phone => $data->{'phone'}, > email => $data->{'email'}, > branchcode => $data->{'branchcode'}, >- branchname => GetBranchName( $data->{'branchcode'} ), > total => sprintf( "%.2f", $total ), > totalcredit => $totalcredit, > is_child => ( $data->{'category_type'} eq 'C' ), >diff --git a/members/purchase-suggestions.pl b/members/purchase-suggestions.pl >index 11e806e..0ebe584 100755 >--- a/members/purchase-suggestions.pl >+++ b/members/purchase-suggestions.pl >@@ -50,7 +50,6 @@ foreach my $key ( keys %$borrower ) { > $template->param( > suggestionsview => 1, > categoryname => $borrower->{'description'}, >- branchname => GetBranchName( $borrower->{'branchcode'} ), > RoutingSerials => C4::Context->preference('RoutingSerials'), > ); > >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index a68ef40..af6d4bb 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -41,7 +41,6 @@ my $branch = $query->param('branch'); > if ($branch){ > # update our session so the userenv is updated > $session->param('branch', $branch); >- $session->param('branchname', GetBranchName($branch)); > } > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( >@@ -108,7 +107,6 @@ $template->param( > borrower => $borrower, > borrowernumber => $borrowernumber, > branch => $branch, >- branchname => GetBranchName($borrower->{'branchcode'}), > categoryname => $borrower->{description}, > RoutingSerials => C4::Context->preference('RoutingSerials'), > ); >diff --git a/members/statistics.pl b/members/statistics.pl >index e875cef..5fac36f 100755 >--- a/members/statistics.pl >+++ b/members/statistics.pl >@@ -60,7 +60,6 @@ foreach my $key ( keys %$borrower ) { > } > $template->param( > categoryname => $borrower->{'description'}, >- branchname => GetBranchName($borrower->{'branchcode'}), > ); > # Construct column names > my $fields = C4::Members::Statistics::get_fields(); >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 6d71bed..5db728b 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -544,7 +544,6 @@ foreach my $subscription (@subscriptions) { > $cell{histstartdate} = $subscription->{histstartdate}; > $cell{histenddate} = $subscription->{histenddate}; > $cell{branchcode} = $subscription->{branchcode}; >- $cell{branchname} = GetBranchName($subscription->{branchcode}); > $cell{hasalert} = $subscription->{hasalert}; > $cell{callnumber} = $subscription->{callnumber}; > $cell{closed} = $subscription->{closed}; >diff --git a/reports/itemtypes.plugin b/reports/itemtypes.plugin >index 2da9a88..b1b7c3d 100755 >--- a/reports/itemtypes.plugin >+++ b/reports/itemtypes.plugin >@@ -108,7 +108,6 @@ sub calculate { > $globalline{loopitemtype} = \@results; > $globalline{total} = $grantotal; > $globalline{branch} = $branch; >- $globalline{branchname} = GetBranchName($branch); > push @mainloop,\%globalline; > return \@mainloop; > } >diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl >index b335cf4..d550824 100755 >--- a/reports/reserves_stats.pl >+++ b/reports/reserves_stats.pl >@@ -32,6 +32,7 @@ use C4::Output; > use C4::Reports; > use C4::Members; > use Koha::DateUtils; >+use Koha::Libraries; > use Koha::Patron::Categories; > use List::MoreUtils qw/any/; > use YAML; >@@ -338,7 +339,7 @@ sub display_value { > ( $crit =~ /ccode/ ) ? $ccodes->{$value} > : ( $crit =~ /location/ ) ? $locations->{$value} > : ( $crit =~ /itemtype/ ) ? $itemtypes->{$value}->{description} >- : ( $crit =~ /branch/ ) ? GetBranchName($value) >+ : ( $crit =~ /branch/ ) ? Koha::Libraries->find($value)->branchname > : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value) > : $value; # default fallback > if ($crit =~ /sort1/) { >diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl >index bed5091..e0cf0aa 100755 >--- a/serials/routing-preview.pl >+++ b/serials/routing-preview.pl >@@ -34,6 +34,7 @@ use C4::Items; > use C4::Serials; > use URI::Escape; > use C4::Branch; >+use Koha::Libraries; > > my $query = new CGI; > my $subscriptionid = $query->param('subscriptionid'); >@@ -66,7 +67,7 @@ if($ok){ > my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio); > my @itemresults = GetItemsInfo( $subs->{biblionumber} ); > my $branch = $itemresults[0]->{'holdingbranch'}; >- my $branchname = GetBranchName($branch); >+ my $branchname = Koha::Libraries->find($branch)->branchname; > > if (C4::Context->preference('RoutingListAddReserves')){ > # get existing reserves ..... >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 936149f..b40251e 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -32,6 +32,7 @@ use C4::Members; > use C4::Debug; > > use Koha::DateUtils qw( dt_from_string ); >+use Koha::Libraries; > > use URI::Escape; > >@@ -59,7 +60,8 @@ sub GetCriteriumDesc{ > } > return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i); > } >- return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/); >+ return Koha::Libraries->find($criteriumvalue)->branchname; >+ if $displayby =~ /branchcode/; > return GetAuthorisedValueByCode('SUGGEST_FORMAT', $criteriumvalue) || "Unknown" if ($displayby =~/itemtype/); > if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){ > my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue); >@@ -212,7 +214,6 @@ elsif ($op eq "change" ) { > } > elsif ( $op eq 'show' ) { > $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'}); >- $$suggestion_ref{branchname} = GetBranchName $$suggestion_ref{branchcode}; > my $budget = GetBudget $$suggestion_ref{budgetid}; > $$suggestion_ref{budgetname} = $$budget{budget_name}; > Init($suggestion_ref); >diff --git a/svc/holds b/svc/holds >index 9c90f8c..fd7be1c 100755 >--- a/svc/holds >+++ b/svc/holds >@@ -24,7 +24,6 @@ use JSON qw(to_json); > > use C4::Auth qw(check_cookie_auth); > use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); >-use C4::Branch qw(GetBranchName); > use C4::Charset; > use C4::Circulation qw(GetTransfers); > use C4::Context; >@@ -127,7 +126,7 @@ while ( my $h = $holds_rs->next() ) { > $hold->{color} = 'transferred'; > $hold->{transferred} = 1; > $hold->{date_sent} = output_pref( dt_from_string($transferred_when) ); >- $hold->{from_branch} = GetBranchName($transferred_from); >+ $hold->{from_branch} = Koha::Libraries->find($transferred_from)->branchname; > } > elsif ( $item->holding_branch() && $item->holding_branch()->branchcode() ne > $h->branch()->branchcode() ) >diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t >index 3d5243c..51c629e 100644 >--- a/t/db_dependent/Branch.t >+++ b/t/db_dependent/Branch.t >@@ -21,7 +21,7 @@ use Modern::Perl; > use C4::Context; > use Data::Dumper; > >-use Test::More tests => 17; >+use Test::More tests => 16; > > use C4::Branch; > use Koha::Database; >@@ -36,7 +36,6 @@ BEGIN { > } > can_ok( > 'C4::Branch', qw( >- GetBranchName > GetBranch > GetBranches > GetBranchesLoop >@@ -110,10 +109,6 @@ is( Koha::Libraries->search->count, $count + 2, "two branches added" ); > is( Koha::Libraries->find( $b2->{branchcode} )->delete, 1, "One row affected" ); > is( Koha::Libraries->search->count, $count + 1, "branch BRB deleted" ); > >-#Test GetBranchName >-is( GetBranchName( $b1->{branchcode} ), >- $b1->{branchname}, "GetBranchName returns the right name" ); >- > #Test Getbranches > my $branches = GetBranches(); > is( scalar( keys %$branches ), >diff --git a/t/db_dependent/NewsChannels.t b/t/db_dependent/NewsChannels.t >index 2f38c78..e6daebc 100644 >--- a/t/db_dependent/NewsChannels.t >+++ b/t/db_dependent/NewsChannels.t >@@ -1,8 +1,8 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use C4::Branch qw(GetBranchName); > use Koha::DateUtils; >+use Koha::Libraries; > > use Test::More tests => 12; > >@@ -18,7 +18,7 @@ $dbh->{RaiseError} = 1; > > # Add LIB1, if it doesn't exist. > my $addbra = 'LIB1'; >-if ( !GetBranchName($addbra) ) { >+unless ( Koha::Libraries->find($addbra) ) { > $dbh->do( q{ INSERT INTO branches (branchcode,branchname) VALUES (?,?) }, > undef, ( $addbra, "$addbra branch" ) ); > } >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index ec56b49..9ef0710 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -32,6 +32,7 @@ use Koha::Holds; > use t::lib::Mocks; > > use Koha::DateUtils; >+use Koha::Libraries; > use Koha::Patron::Categories; > > use Data::Dumper; >@@ -57,7 +58,7 @@ $dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestricti > > # Add branches if not existing > foreach my $addbra ('CPL', 'FPL', 'RPL') { >- $dbh->do("INSERT INTO branches (branchcode,branchname) VALUES (?,?)", undef, ($addbra,"$addbra branch")) unless GetBranchName($addbra); >+ $dbh->do("INSERT INTO branches (branchcode,branchname) VALUES (?,?)", undef, ($addbra,"$addbra branch")) unless Koha::Libraries->find($addbra); > } > > # Add categories if not existing >diff --git a/tools/holidays.pl b/tools/holidays.pl >index 109aa7c..f4509e7 100755 >--- a/tools/holidays.pl >+++ b/tools/holidays.pl >@@ -60,7 +60,6 @@ my $onlymine = > if ( $onlymine ) { > $branch = C4::Context->userenv->{'branch'}; > } >-my $branchname = GetBranchName($branch); > my $branches = GetBranches($onlymine); > my @branchloop; > for my $thisbranch ( >@@ -154,8 +153,6 @@ $template->param( > keydate => $keydate, > branchcodes => $branchcodes, > branch => $branch, >- branchname => $branchname, >- branch => $branch, > ); > > # Shows the template with the real values replaced >diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl >index 1bb3652..7224cac 100755 >--- a/tools/import_borrowers.pl >+++ b/tools/import_borrowers.pl >@@ -40,7 +40,7 @@ use warnings; > use C4::Auth; > use C4::Output; > use C4::Context; >-use C4::Branch qw/GetBranchesLoop GetBranchName/; >+use C4::Branch qw/GetBranchesLoop/; > use C4::Members; > use C4::Members::Attributes qw(:all); > use C4::Members::AttributeTypes; >@@ -49,6 +49,7 @@ use C4::Reports::Guided; > use C4::Templates; > use Koha::Borrower::Debarments; > use Koha::DateUtils; >+use Koha::Libraries; > use Koha::Patron::Categories; > > use Text::CSV; >@@ -185,7 +186,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { > } > if ($borrower{branchcode}) { > push @missing_criticals, {key=>'branchcode', line=>$. , lineraw=>$borrowerline, value=>$borrower{branchcode}, branch_map=>1} >- unless GetBranchName($borrower{branchcode}); >+ unless Koha::Libraries->find($borrower{branchcode}); > } else { > push @missing_criticals, {key=>'branchcode', line=>$. , lineraw=>$borrowerline}; > } >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index 89d57c2..7ff0954 100755 >--- a/tools/modborrowers.pl >+++ b/tools/modborrowers.pl >@@ -362,7 +362,6 @@ sub GetBorrowerInfos { > my ( %info ) = @_; > my $borrower = GetMember( %info ); > if ( $borrower ) { >- $borrower->{branchname} = GetBranchName( $borrower->{branchcode} ); > for ( qw(dateenrolled dateexpiry) ) { > my $userdate = $borrower->{$_}; > unless ($userdate && $userdate ne "0000-00-00" and $userdate ne "9999-12-31") { >diff --git a/tools/viewlog.pl b/tools/viewlog.pl >index f6816d7..e146b79 100755 >--- a/tools/viewlog.pl >+++ b/tools/viewlog.pl >@@ -90,7 +90,6 @@ if ( $src eq 'circ' ) { > menu => 1, > borrowernumber => $borrowernumber, > categoryname => $data->{'description'}, >- branchname => GetBranchName( $data->{'branchcode'} ), > RoutingSerials => C4::Context->preference('RoutingSerials'), > ); > } >-- >2.1.0
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