Bugzilla – Attachment 52791 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 GetBranches
Bug-15758-KohaLibraries---Remove-GetBranches.patch (text/plain), 134.97 KB, created by
Jonathan Druart
on 2016-06-24 12:47:41 UTC
(
hide
)
Description:
Bug 15758: Koha::Libraries - Remove GetBranches
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-06-24 12:47:41 UTC
Size:
134.97 KB
patch
obsolete
>From e8a0e6aef595200e96735e0985628050531a30cd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 4 Feb 2016 15:24:23 +0000 >Subject: [PATCH] Bug 15758: Koha::Libraries - Remove GetBranches > >--- > C4/Auth.pm | 4 +- > C4/Branch.pm | 69 ---------------------- > C4/Circulation.pm | 13 ++-- > C4/Context.pm | 6 ++ > C4/ILSDI/Services.pm | 7 +-- > C4/Items.pm | 1 + > C4/Overdues.pm | 4 +- > C4/Search.pm | 15 ++--- > C4/ShelfBrowser.pm | 5 +- > C4/XSLT.pm | 7 ++- > Koha/Libraries.pm | 21 ++++++- > Koha/Template/Plugin/Branches.pm | 21 ++----- > acqui/add_user_search.pl | 5 -- > acqui/addorderiso2709.pl | 1 - > acqui/basket.pl | 18 +++--- > acqui/basketheader.pl | 2 - > acqui/invoices.pl | 21 ------- > acqui/lateorders.pl | 1 - > acqui/neworderempty.pl | 1 - > acqui/newordersubscription.pl | 14 ----- > acqui/orderreceive.pl | 1 - > admin/add_user_search.pl | 5 -- > admin/aqbudgets.pl | 15 ----- > admin/authorised_values.pl | 15 +++-- > admin/branch_transfer_limits.pl | 14 ----- > admin/categories.pl | 12 ++-- > admin/item_circulation_alerts.pl | 16 ----- > admin/patron-attr-types.pl | 14 ++--- > admin/smart-rules.pl | 2 +- > admin/transport-cost-matrix.pl | 9 +-- > catalogue/detail.pl | 8 +-- > catalogue/itemsearch.pl | 11 +--- > catalogue/search.pl | 8 ++- > cataloguing/addbiblio.pl | 18 ++---- > cataloguing/value_builder/unimarc_field_4XX.pl | 1 - > circ/bookcount.pl | 9 +-- > circ/branchtransfers.pl | 15 ++--- > circ/circulation.pl | 1 - > circ/returns.pl | 23 ++------ > circ/selectbranchprinter.pl | 10 +--- > circ/transferstoreceive.pl | 12 ++-- > .../prog/en/includes/branch-selector.inc | 6 +- > .../prog/en/includes/subscriptions-search.inc | 9 +-- > .../prog/en/modules/acqui/invoices.tt | 11 +--- > .../prog/en/modules/admin/aqbudgets.tt | 3 +- > .../en/modules/admin/branch_transfer_limits.tt | 12 +--- > .../en/modules/admin/item_circulation_alerts.tt | 12 ++-- > .../prog/en/modules/admin/smart-rules.tt | 4 +- > koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 3 +- > .../prog/en/modules/catalogue/advsearch.tt | 4 +- > .../prog/en/modules/catalogue/detail.tt | 4 +- > .../prog/en/modules/circ/bookcount.tt | 7 ++- > .../prog/en/modules/circ/branchtransfers.tt | 6 +- > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 10 ++-- > .../prog/en/modules/common/patron_search.tt | 8 ++- > .../prog/en/modules/reports/borrowers_stats.tt | 2 +- > .../prog/en/modules/reserve/request.tt | 14 ++--- > .../rotating_collections/transferCollection.tt | 11 +--- > .../prog/en/modules/serials/serials-search.tt | 9 +-- > .../prog/en/modules/serials/subscription-add.tt | 10 ++-- > .../prog/en/modules/suggestion/suggestion.tt | 17 ++++-- > .../intranet-tmpl/prog/en/modules/tools/export.tt | 3 +- > .../prog/en/modules/tools/holidays.tt | 1 - > .../prog/en/modules/tools/inventory.tt | 2 +- > .../prog/en/modules/tools/koha-news.tt | 31 +++------- > .../bootstrap/en/includes/item-status.inc | 4 +- > .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 6 +- > .../bootstrap/en/modules/opac-topissues.tt | 3 +- > members/deletemem.pl | 1 - > members/guarantor_search.pl | 5 -- > members/memberentry.pl | 1 - > members/pay.pl | 1 - > members/paycollect.pl | 1 - > members/readingrec.pl | 4 -- > members/routing-lists.pl | 3 - > opac/opac-basket.pl | 6 +- > opac/opac-detail.pl | 16 +++-- > opac/opac-reserve.pl | 15 ++--- > opac/opac-search.pl | 14 ++--- > opac/opac-topissues.pl | 3 +- > opac/opac-user.pl | 1 - > patroncards/add_user_search.pl | 5 -- > reports/acquisitions_stats.pl | 8 +-- > reports/borrowers_stats.pl | 5 +- > reports/issues_avg_stats.pl | 1 - > reports/issues_by_borrower_category.plugin | 2 - > reserve/request.pl | 20 ++----- > rotating_collections/transferCollection.pl | 13 ---- > serials/add_user_search.pl | 5 -- > serials/serials-search.pl | 15 ----- > serials/subscription-add.pl | 24 +------- > suggestion/suggestion.pl | 31 ++-------- > svc/cataloguing/framework | 8 +-- > t/db_dependent/Circulation/GetIssues.t | 8 +-- > t/db_dependent/Overdues.t | 5 +- > tools/export.pl | 53 ++++++----------- > tools/holidays.pl | 5 -- > tools/inventory.pl | 1 - > tools/koha-news.pl | 4 -- > tools/letter.pl | 1 - > tools/newHolidays.pl | 11 ++-- > 101 files changed, 287 insertions(+), 676 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index afdca5c..9e3fd26 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1077,7 +1077,7 @@ sub checkauth { > $branchcode = $query->param('branch'); > $branchname = Koha::Libraries->find($branchcode)->branchname; > } >- my $branches = C4::Branch::GetBranches(); >+ my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; > if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) { > > # we have to check they are coming from the right ip range >@@ -1527,7 +1527,7 @@ sub check_api_auth { > $branchcode = $query->param('branch'); > $branchname = Koha::Libraries->find($branchcode)->branchname; > } >- my $branches = C4::Branch::GetBranches(); >+ my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; > foreach my $br ( keys %$branches ) { > > # now we work with the treatment of ip >diff --git a/C4/Branch.pm b/C4/Branch.pm >index 7f1b713..a4f6b2f 100644 >--- a/C4/Branch.pm >+++ b/C4/Branch.pm >@@ -28,7 +28,6 @@ BEGIN { > @ISA = qw(Exporter); > @EXPORT = qw( > &GetBranch >- &GetBranches > ); > @EXPORT_OK = qw( &onlymine ); > } >@@ -47,76 +46,8 @@ The functions in this module deal with branches. > > =head1 FUNCTIONS > >-=head2 GetBranches >- >- $branches = &GetBranches(); >- >-Returns informations about ALL branches, IndependentBranches Insensitive. >- >-Create a branch selector with the following code. >- >-=head3 in PERL SCRIPT >- >- my $branches = GetBranches; >- my @branchloop; >- foreach my $thisbranch (sort keys %$branches) { >- my $selected = 1 if $thisbranch eq $branch; >- my %row =(value => $thisbranch, >- selected => $selected, >- branchname => $branches->{$thisbranch}->{branchname}, >- ); >- push @branchloop, \%row; >- } >- >-=head3 in TEMPLATE >- >- <select name="branch" id="branch"> >- <option value=""></option> >- [% FOREACH branchloo IN branchloop %] >- [% IF ( branchloo.selected ) %] >- <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option> >- [% ELSE %] >- <option value="[% branchloo.value %]" >[% branchloo.branchname %]</option> >- [% END %] >- [% END %] >- </select> >- > =cut > >-sub GetBranches { >- my ($onlymine) = @_; >- >- # returns a reference to a hash of references to ALL branches... >- my %branches; >- my $dbh = C4::Context->dbh; >- my $sth; >- my $query = "SELECT * FROM branches"; >- my @bind_parameters; >- if ( $onlymine && C4::Context->userenv && C4::Context->userenv->{branch} ) { >- $query .= ' WHERE branchcode = ? '; >- push @bind_parameters, C4::Context->userenv->{branch}; >- } >- $query .= " ORDER BY branchname"; >- $sth = $dbh->prepare($query); >- $sth->execute(@bind_parameters); >- >- my $relations_sth = >- $dbh->prepare("SELECT branchcode,categorycode FROM branchrelations"); >- $relations_sth->execute(); >- my %relations; >- while ( my $rel = $relations_sth->fetchrow_hashref ) { >- push @{ $relations{ $rel->{branchcode} } }, $rel->{categorycode}; >- } >- >- while ( my $branch = $sth->fetchrow_hashref ) { >- foreach my $cat ( @{ $relations{ $branch->{branchcode} } } ) { >- $branch->{category}{$cat} = 1; >- } >- $branches{ $branch->{'branchcode'} } = $branch; >- } >- return ( \%branches ); >-} >- > sub onlymine { > return > C4::Context->preference('IndependentBranches') >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index e9f0a3d..ef3f315 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -33,7 +33,6 @@ use C4::Accounts; > use C4::ItemCirculationAlertPreference; > use C4::Message; > use C4::Debug; >-use C4::Branch; # GetBranches > use C4::Log; # logaction > use C4::Koha qw( > GetAuthorisedValueByCode >@@ -308,7 +307,6 @@ sub transferbook { > my ( $tbr, $barcode, $ignoreRs ) = @_; > my $messages; > my $dotransfer = 1; >- my $branches = GetBranches(); > my $itemnumber = GetItemnumberFromBarcode( $barcode ); > my $issue = GetItemIssue($itemnumber); > my $biblio = GetBiblioFromItemNumber($itemnumber); >@@ -337,7 +335,10 @@ sub transferbook { > } > > # if is permanent... >- if ( $hbr && $branches->{$hbr}->{'PE'} ) { >+ # FIXME Is this still used by someone? >+ # See other FIXME in AddReturn >+ my $library = Koha::Libraries->find($hbr); >+ if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) { > $messages->{'IsPermanent'} = $hbr; > $dotransfer = 0; > } >@@ -1966,8 +1967,10 @@ sub AddReturn { > # check if the book is in a permanent collection.... > # FIXME -- This 'PE' attribute is largely undocumented. afaict, there's no user interface that reflects this functionality. > if ( $returnbranch ) { >- my $branches = GetBranches(); # a potentially expensive call for a non-feature. >- $branches->{$returnbranch}->{PE} and $messages->{'IsPermanent'} = $returnbranch; >+ my $library = Koha::Libraries->find($returnbranch); >+ if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) { >+ $messages->{'IsPermanent'} = $returnbranch; >+ } > } > > # check if the return is allowed at this branch >diff --git a/C4/Context.pm b/C4/Context.pm >index c80647a..3136b6e 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -1180,6 +1180,12 @@ sub interface { > return $context->{interface} // 'opac'; > } > >+# always returns a string for OK comparison via "eq" or "ne" >+sub mybranch { >+ C4::Context->userenv or return ''; >+ return C4::Context->userenv->{branch} || ''; >+} >+ > 1; > __END__ > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 65c26b3..c94fef3 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -23,7 +23,6 @@ use warnings; > use C4::Members; > use C4::Items; > use C4::Circulation; >-use C4::Branch; > use C4::Accounts; > use C4::Biblio; > use C4::Reserves qw(AddReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber CanBookBeReserved CanItemBeReserved IsAvailableForItemLevelRequest); >@@ -628,8 +627,7 @@ sub HoldTitle { > # Pickup branch management > if ( $cgi->param('pickup_location') ) { > $branch = $cgi->param('pickup_location'); >- my $branches = GetBranches; >- return { code => 'LocationNotFound' } unless $$branches{$branch}; >+ return { code => 'LocationNotFound' } unless Koha::Libraries->find($branch); > } else { # if the request provide no branch, use the borrower's branch > $branch = $$borrower{branchcode}; > } >@@ -706,8 +704,7 @@ sub HoldItem { > my $branch; > if ( $cgi->param('pickup_location') ) { > $branch = $cgi->param('pickup_location'); >- my $branches = GetBranches(); >- return { code => 'LocationNotFound' } unless $$branches{$branch}; >+ return { code => 'LocationNotFound' } unless Koha::Libraries->find($branch); > } else { # if the request provide no branch, use the borrower's branch > $branch = $$borrower{branchcode}; > } >diff --git a/C4/Items.pm b/C4/Items.pm >index 9c7c56d..f7cd685 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1335,6 +1335,7 @@ sub GetItemsInfo { > COALESCE( localization.translation, itemtypes.description ) AS translated_description, > itemtypes.notforloan as notforloan_per_itemtype, > holding.branchurl, >+ holding.branchcode, > holding.branchname, > holding.opac_info as holding_branch_opac_info, > home.opac_info as home_branch_opac_info >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 3f0c32d..42846aa 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -36,6 +36,7 @@ use C4::Debug; > use Koha::DateUtils; > use Koha::Account::Line; > use Koha::Account::Lines; >+use Koha::Libraries; > > use vars qw(@ISA @EXPORT); > >@@ -786,8 +787,7 @@ sub GetBranchcodesWithOverdueRules { > |); > if ( $branchcodes->[0] eq '' ) { > # If a default rule exists, all branches should be returned >- my $availbranches = C4::Branch::GetBranches(); >- return keys %$availbranches; >+ return map { $_->branchcode } Koha::Libraries->search({}, { order_by => 'branchname' }); > } > return @$branchcodes; > } >diff --git a/C4/Search.pm b/C4/Search.pm >index a5b3561..e8ac8e4 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -28,7 +28,6 @@ use C4::Search::PazPar2; > use XML::Simple; > use C4::Members qw(GetHideLostItemsPreference); > use C4::XSLT; >-use C4::Branch; > use C4::Reserves; # GetReserveStatus > use C4::Debug; > use C4::Charset; >@@ -331,6 +330,8 @@ sub getRecords { > my @servers = @$servers_ref; > my @sort_by = @$sort_by_ref; > >+ $branches ||= { map { $_->branchcode => $_->branchname } Koha::Libraries->search }; >+ > # Initialize variables for the ZOOM connection and results object > my $zconn; > my @zconns; >@@ -854,6 +855,8 @@ sub pazGetRecords { > $query_type, $scan > ) = @_; > >+ $branches ||= { map { $_->branchcode => $_->branchname } Koha::Libraries->search }; >+ > my $paz = C4::Search::PazPar2->new(C4::Context->config('pazpar2url')); > $paz->init(); > $paz->search($simple_query); >@@ -1837,14 +1840,8 @@ sub searchResults { > } > > #Build branchnames hash >- #find branchname >- #get branch information..... >- my %branches; >- my $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches"); # FIXME : use C4::Branch::GetBranches >- $bsth->execute(); >- while ( my $bdata = $bsth->fetchrow_hashref ) { >- $branches{ $bdata->{'branchcode'} } = $bdata->{'branchname'}; >- } >+ my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' }); >+ > # FIXME - We build an authorised values hash here, using the default framework > # though it is possible to have different authvals for different fws. > >diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm >index 923b7fe..8ae813a 100644 >--- a/C4/ShelfBrowser.pm >+++ b/C4/ShelfBrowser.pm >@@ -23,9 +23,9 @@ use strict; > use warnings; > > use C4::Biblio; >-use C4::Branch; > use C4::Context; > use C4::Koha; >+use Koha::Libraries; > > use vars qw(@ISA @EXPORT @EXPORT_OK); > >@@ -117,7 +117,6 @@ sub GetNearbyItems { > if $gap <= $num_each_side; > > my $dbh = C4::Context->dbh; >- my $branches = GetBranches(); > > my $sth_get_item_details = $dbh->prepare("SELECT cn_sort,homebranch,location,ccode from items where itemnumber=?"); > $sth_get_item_details->execute($itemnumber); >@@ -129,7 +128,7 @@ sub GetNearbyItems { > if (C4::Context->preference('ShelfBrowserUsesHomeBranch') && > defined($item_details_result->{'homebranch'})) { > $start_homebranch->{code} = $item_details_result->{'homebranch'}; >- $start_homebranch->{description} = $branches->{$item_details_result->{'homebranch'}}{branchname}; >+ $start_homebranch->{description} = Koha::Libraries->find($item_details_result->{'homebranch'})->branchname; > } > if (C4::Context->preference('ShelfBrowserUsesLocation') && > defined($item_details_result->{'location'})) { >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index a2bbaab..5272283 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -264,7 +264,8 @@ sub buildKohaItemsNamespace { > my $shelflocations = GetKohaAuthorisedValues('items.location',GetFrameworkCode($biblionumber), 'opac'); > my $ccodes = GetKohaAuthorisedValues('items.ccode',GetFrameworkCode($biblionumber), 'opac'); > >- my $branches = GetBranches(); >+ my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' }); >+ > my $itemtypes = GetItemTypes(); > my $location = ""; > my $ccode = ""; >@@ -305,8 +306,8 @@ sub buildKohaItemsNamespace { > } else { > $status = "available"; > } >- my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):''; >- my $holdingbranch = $item->{holdingbranch}? xml_escape($branches->{$item->{holdingbranch}}->{'branchname'}):''; >+ my $homebranch = $item->{homebranch}? xml_escape($branches{$item->{homebranch}}):''; >+ my $holdingbranch = $item->{holdingbranch}? xml_escape($branches{$item->{holdingbranch}}):''; > $location = $item->{location}? xml_escape($shelflocations->{$item->{location}}||$item->{location}):''; > $ccode = $item->{ccode}? xml_escape($ccodes->{$item->{ccode}}||$item->{ccode}):''; > my $itemcallnumber = xml_escape($item->{itemcallnumber}); >diff --git a/Koha/Libraries.pm b/Koha/Libraries.pm >index 9f4831c..fefc3ab 100644 >--- a/Koha/Libraries.pm >+++ b/Koha/Libraries.pm >@@ -21,8 +21,9 @@ use Modern::Perl; > > use Carp; > >-use Koha::Database; >+use C4::Context; > >+use Koha::Database; > use Koha::Library; > > use base qw(Koha::Objects); >@@ -37,6 +38,24 @@ Koha::Libraries - Koha Library Object set class > > =cut > >+=head3 search_filtered >+ >+=cut >+ >+sub search_filtered { >+ my ( $self, $params, $attributes ) = @_; >+ >+ if ( C4::Context->preference('IndependentBranches') >+ and C4::Context->userenv >+ and not C4::Context->IsSuperLibrarian() >+ and C4::Context->userenv->{branch} >+ ) { >+ $params->{branchcode} = C4::Context->userenv->{branch}; >+ } >+ >+ return $self->SUPER::search( $params, $attributes ); >+} >+ > =head3 type > > =cut >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index df9d04e..b41d3e4 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -25,6 +25,7 @@ use base qw( Template::Plugin ); > > use C4::Koha; > use C4::Context; >+use Koha::Libraries; > > sub GetName { > my ( $self, $branchcode ) = @_; >@@ -57,21 +58,11 @@ sub GetURL { > sub all { > my ( $self, $params ) = @_; > my $selected = $params->{selected}; >- my $dbh = C4::Context->dbh; >- my @params; >- my $query = q| >- SELECT branchcode, branchname >- FROM branches >- |; >- if ( C4::Context->preference('IndependentBranches') >- and C4::Context->userenv >- && !C4::Context->IsSuperLibrarian() >- and C4::Context->userenv->{branch} ) >- { >- $query .= q| WHERE branchcode = ? |; >- push @params, C4::Context->userenv->{branch}; >- } >- my $libraries = $dbh->selectall_arrayref( $query, { Slice => {} }, @params ); >+ my $unfiltered = $params->{unfiltered} || 0; >+ >+ my $libraries = $unfiltered >+ ? Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed >+ : Koha::Libraries->search_filtered( {}, { order_by => ['branchname'] } )->unblessed; > > for my $l ( @$libraries ) { > if ( $selected and $l->{branchcode} eq $selected >diff --git a/acqui/add_user_search.pl b/acqui/add_user_search.pl >index ab1f1ca..d2481c6 100755 >--- a/acqui/add_user_search.pl >+++ b/acqui/add_user_search.pl >@@ -21,7 +21,6 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth; >-use C4::Branch qw( GetBranches ); > use C4::Output; > use C4::Members; > >@@ -52,9 +51,6 @@ my $search_patrons_with_acq_perm_only = > ( $referer =~ m|acqui/basket.pl| ) > ? 1 : 0; > >-my $onlymine = C4::Branch::onlymine; >-my $branches = C4::Branch::GetBranches( $onlymine ); >- > my $patron_categories = Koha::Patron::Categories->search_limited; > $template->param( > patrons_with_acq_perm_only => $search_patrons_with_acq_perm_only, >@@ -64,7 +60,6 @@ $template->param( > selection_type => 'add', > alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), > categories => $patron_categories, >- branches => [ map { { branchcode => $_->{branchcode}, branchname => $_->{branchname} } } values %$branches ], > aaSorting => 1, > ); > output_html_with_http_headers( $input, $cookie, $template->output ); >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 552754c..d2c2e25 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -39,7 +39,6 @@ use C4::Koha; > use C4::Budgets; > use C4::Acquisition; > use C4::Suggestions; # GetSuggestion >-use C4::Branch; # GetBranches > use C4::Members; > > use Koha::Number::Price; >diff --git a/acqui/basket.pl b/acqui/basket.pl >index afc0ec0..f3bf36a 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -28,13 +28,13 @@ use C4::Output; > use CGI qw ( -utf8 ); > use C4::Acquisition; > use C4::Budgets; >-use C4::Branch; > use C4::Contract; > use C4::Debug; > use C4::Biblio; > use C4::Members qw/GetMember/; #needed for permissions checking for changing basketgroup of a basket > use C4::Items; > use C4::Suggestions; >+use Koha::Libraries; > use Date::Calc qw/Add_Delta_Days/; > use Koha::Database; > use Koha::EDI qw( create_edi_order get_edifact_ean ); >@@ -236,6 +236,7 @@ elsif ( $op eq 'ediorder' ) { > exit 1; > } > } >+ > if (!defined $basket->{branch} or $basket->{branch} eq $userenv->{branch}) { > push @branches_loop, { > branchcode => $userenv->{branch}, >@@ -245,20 +246,17 @@ elsif ( $op eq 'ediorder' ) { > } > } else { > # get branches >- my $branches = C4::Branch::GetBranches; >- my @branchcodes = sort { >- $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} >- } keys %$branches; >- foreach my $branch (@branchcodes) { >+ my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; >+ foreach my $branch (@$branches) { > my $selected = 0; > if (defined $basket->{branch}) { >- $selected = 1 if $branch eq $basket->{branch}; >+ $selected = 1 if $branch->{branchcode} eq $basket->{branch}; > } else { >- $selected = 1 if $branch eq C4::Context->userenv->{branch}; >+ $selected = 1 if $branch->{branchcode} eq C4::Context->userenv->{branch}; > } > push @branches_loop, { >- branchcode => $branch, >- branchname => $branches->{$branch}->{branchname}, >+ branchcode => $branch->{branchcode}, >+ branchname => $branch->{branchname}, > selected => $selected > }; > } >diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl >index cdef0df..c0db854 100755 >--- a/acqui/basketheader.pl >+++ b/acqui/basketheader.pl >@@ -50,7 +50,6 @@ use warnings; > use CGI qw ( -utf8 ); > use C4::Context; > use C4::Auth; >-use C4::Branch; > use C4::Output; > use C4::Acquisition qw/GetBasket NewBasket ModBasketHeader/; > use C4::Contract qw/GetContracts/; >@@ -72,7 +71,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > #parameters: > my $booksellerid = $input->param('booksellerid'); > my $basketno = $input->param('basketno'); >-my $branches = GetBranches; > my $basket; > my $op = $input ->param('op'); > my $is_an_edit= $input ->param('is_an_edit'); >diff --git a/acqui/invoices.pl b/acqui/invoices.pl >index 3048fb5..7f0ed5d 100755 >--- a/acqui/invoices.pl >+++ b/acqui/invoices.pl >@@ -34,7 +34,6 @@ use C4::Auth; > use C4::Output; > > use C4::Acquisition qw/GetInvoices/; >-use C4::Branch qw/GetBranches/; > use C4::Budgets; > use Koha::DateUtils; > >@@ -107,24 +106,6 @@ foreach (@suppliers) { > }; > } > >-# Build branches list >-my $branches = GetBranches(); >-my $branches_loop = []; >-my $branchname; >-foreach ( sort keys %$branches ) { >- my $selected = 0; >- if ( $branch && $branch eq $_ ) { >- $selected = 1; >- $branchname = $branches->{$_}->{'branchname'}; >- } >- push @{$branches_loop}, >- { >- branchcode => $_, >- branchname => $branches->{$_}->{branchname}, >- selected => $selected, >- }; >-} >- > my $budgets = GetBudgets(); > my @budgets_loop; > foreach my $budget (@$budgets) { >@@ -149,9 +130,7 @@ $template->param( > publisher => $publisher, > publicationyear => $publicationyear, > branch => $branch, >- branchname => $branchname, > suppliers_loop => $suppliers_loop, >- branches_loop => $branches_loop, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl >index 872d0af..2b2ed17 100755 >--- a/acqui/lateorders.pl >+++ b/acqui/lateorders.pl >@@ -52,7 +52,6 @@ use C4::Output; > use C4::Context; > use C4::Acquisition; > use C4::Letters; >-use C4::Branch; # GetBranches > use Koha::DateUtils; > > my $input = new CGI; >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 72cab5a..10f6074 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -81,7 +81,6 @@ use C4::Biblio; # GetBiblioData GetMarcPrice > use C4::Items; #PrepareItemRecord > use C4::Output; > use C4::Koha; >-use C4::Branch; # GetBranches > use C4::Members; > use C4::Search qw/FindDuplicate/; > >diff --git a/acqui/newordersubscription.pl b/acqui/newordersubscription.pl >index 7353dc9..81bc18d 100755 >--- a/acqui/newordersubscription.pl >+++ b/acqui/newordersubscription.pl >@@ -21,7 +21,6 @@ use Modern::Perl; > use CGI qw ( -utf8 ); > use C4::Acquisition; > use C4::Auth; >-use C4::Branch; > use C4::Context; > use C4::Output; > use C4::Serials; >@@ -76,18 +75,6 @@ foreach my $sub (@subscriptions) { > } > } > >-my $branches = GetBranches(); >-my @branches_loop; >-foreach (sort keys %$branches){ >- my $selected = 0; >- $selected = 1 if defined $branch && $branch eq $_; >- push @branches_loop, { >- branchcode => $_, >- branchname => $branches->{$_}->{branchname}, >- selected => $selected, >- }; >-} >- > $template->param( > subs_loop => \@subscriptions, > title_filter => $title, >@@ -96,7 +83,6 @@ $template->param( > publisher_filter => $publisher, > supplier_filter => $supplier, > branch_filter => $branch, >- branches_loop => \@branches_loop, > done_searched => $searched, > routing => $routing, > booksellerid => $booksellerid, >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index b07ee0f..d815022 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -69,7 +69,6 @@ use C4::Auth; > use C4::Output; > use C4::Budgets qw/ GetBudget GetBudgetHierarchy CanUserUseBudget GetBudgetPeriods /; > use C4::Members; >-use C4::Branch; # GetBranches > use C4::Items; > use C4::Biblio; > use C4::Suggestions; >diff --git a/admin/add_user_search.pl b/admin/add_user_search.pl >index 4f0391a..ba3989a 100755 >--- a/admin/add_user_search.pl >+++ b/admin/add_user_search.pl >@@ -21,7 +21,6 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth; >-use C4::Branch qw( GetBranches ); > use C4::Output; > use C4::Members; > >@@ -53,9 +52,6 @@ my $search_patrons_with_acq_perm_only = > ( $referer =~ m|admin/aqbudgets.pl| ) > ? 1 : 0; > >-my $onlymine = C4::Branch::onlymine; >-my $branches = C4::Branch::GetBranches( $onlymine ); >- > my $patron_categories = Koha::Patron::Categories->search_limited; > $template->param( > patrons_with_acq_perm_only => $search_patrons_with_acq_perm_only, >@@ -65,7 +61,6 @@ $template->param( > selection_type => $selection_type, > alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), > categories => $patron_categories, >- branches => [ map { { branchcode => $_->{branchcode}, branchname => $_->{branchname} } } values %$branches ], > aaSorting => 1, > ); > output_html_with_http_headers( $input, $cookie, $template->output ); >diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl >index c9baad7..e7dd2bb 100755 >--- a/admin/aqbudgets.pl >+++ b/admin/aqbudgets.pl >@@ -26,7 +26,6 @@ use List::Util qw/min/; > > use Koha::Database; > use C4::Auth qw/get_user_subpermissions/; >-use C4::Branch; # GetBranches > use C4::Auth; > use C4::Acquisition; > use C4::Budgets; >@@ -141,18 +140,6 @@ if ($op eq 'add_form') { > } > $budget_parent = GetBudget($budget_parent_id); > >- # build branches select >- my $branches = GetBranches; >- my @branchloop_select; >- foreach my $thisbranch ( sort keys %$branches ) { >- my %row = ( >- value => $thisbranch, >- branchname => $branches->{$thisbranch}->{'branchname'}, >- ); >- $row{selected} = 1 if $budget and $thisbranch eq $budget->{'budget_branchcode'}; >- push @branchloop_select, \%row; >- } >- > # populates the YUI planning button > my $categories = GetAuthorisedValueCategories(); > my @auth_cats_loop1 = (); >@@ -200,7 +187,6 @@ if ($op eq 'add_form') { > budget_has_children => BudgetHasChildren( $budget->{budget_id} ), > budget_parent_id => $budget_parent->{'budget_id'}, > budget_parent_name => $budget_parent->{'budget_name'}, >- branchloop_select => \@branchloop_select, > %$period, > %$budget, > ); >@@ -258,7 +244,6 @@ if ($op eq 'add_form') { > } > > if ( $op eq 'list' ) { >- my $branches = GetBranches(); > $template->param( > budget_id => $budget_id, > %$period, >diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl >index b782901..49fb661 100755 >--- a/admin/authorised_values.pl >+++ b/admin/authorised_values.pl >@@ -21,12 +21,12 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth; >-use C4::Branch; > use C4::Context; > use C4::Koha; > use C4::Output; > > use Koha::AuthorisedValues; >+use Koha::Libraries; > > my $input = new CGI; > my $id = $input->param('id'); >@@ -56,15 +56,14 @@ if ($op eq 'add_form') { > $category = $input->param('category'); > } > >- my $branches = GetBranches; >+ my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; > my @branches_loop; >- >- foreach my $branchcode ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) { >- my $selected = ( grep {$_ eq $branchcode} @$selected_branches ) ? 1 : 0; >+ foreach my $branch ( @$branches ) { >+ my $selected = ( grep {$_ eq $branch->{branchcode}} @$selected_branches ) ? 1 : 0; > push @branches_loop, { >- branchcode => $branchcode, >- branchname => $branches->{$branchcode}->{branchname}, >- selected => $selected, >+ branchcode => $branch->{branchcode}, >+ branchname => $branch->{branchname}, >+ selected => $selected, > }; > } > >diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl >index b745136..84d7210 100755 >--- a/admin/branch_transfer_limits.pl >+++ b/admin/branch_transfer_limits.pl >@@ -26,7 +26,6 @@ use C4::Auth; > use C4::Context; > use C4::Output; > use C4::Koha; >-use C4::Branch; > use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; > > my $input = new CGI; >@@ -50,18 +49,6 @@ else > $branchcode = $input->param('branchcode'); > } > >-# Getting the branches for user selection >-my $branches = GetBranches(); >-my @branch_loop; >-for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { >- my %row =(value => $thisbranch, >- branchname => $branches->{$thisbranch}->{'branchname'}, >- selected => $thisbranch eq $branchcode ? 1 : 0, >- ); >- push @branch_loop, \%row; >-} >- >- > # Set the template language for the correct limit type using $limitType > my $limitType = C4::Context->preference("BranchTransferLimitsType") || "ccode"; > >@@ -132,7 +119,6 @@ foreach my $code ( @codes ) { > $template->param( > branchcount => $branchcount, > codes_loop => \@codes_loop, >- branch_loop => \@branch_loop, > branchcode_loop => \@branchcode_loop, > branchcode => $branchcode, > limitType => $limitType, >diff --git a/admin/categories.pl b/admin/categories.pl >index 7d4e8d3..ff2cb6b 100755 >--- a/admin/categories.pl >+++ b/admin/categories.pl >@@ -23,13 +23,13 @@ use Modern::Perl; > use CGI qw ( -utf8 ); > use C4::Context; > use C4::Auth; >-use C4::Branch; > use C4::Output; > use C4::Form::MessagingPreferences; > use Koha::Patrons; > use Koha::Database; > use Koha::DateUtils; > use Koha::Patron::Categories; >+use Koha::Libraries; > > my $input = new CGI; > my $searchfield = $input->param('description') // q||; >@@ -55,13 +55,13 @@ if ( $op eq 'add_form' ) { > $selected_branches = $category->branch_limitations; > } > >- my $branches = GetBranches; >+ my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; > my @branches_loop; >- foreach my $branchcode ( sort { uc( $branches->{$a}->{branchname} ) cmp uc( $branches->{$b}->{branchname} ) } keys %$branches ) { >- my $selected = ( grep { $_ eq $branchcode } @$selected_branches ) ? 1 : 0; >+ foreach my $branch ( @$branches ) { >+ my $selected = ( grep { $_ eq $branch->{branchcode} } @$selected_branches ) ? 1 : 0; > push @branches_loop, >- { branchcode => $branchcode, >- branchname => $branches->{$branchcode}->{branchname}, >+ { branchcode => $branch->{branchcode}, >+ branchname => $branch->{branchname}, > selected => $selected, > }; > } >diff --git a/admin/item_circulation_alerts.pl b/admin/item_circulation_alerts.pl >index 3e6e6dd..5e9c463 100755 >--- a/admin/item_circulation_alerts.pl >+++ b/admin/item_circulation_alerts.pl >@@ -26,7 +26,6 @@ use JSON; > > use C4::Auth; > use C4::Context; >-use C4::Branch; > use C4::ItemCirculationAlertPreference; > use C4::Output; > >@@ -51,28 +50,13 @@ sub show { > } > ); > >- my $br = GetBranches; > my $branch = $input->param('branch') || '*'; >- my @branches = ( >- { >- branchcode => '*', >- branchname => 'Default', >- }, >- sort { $a->{branchname} cmp $b->{branchname} } values %$br, >- ); >- for (@branches) { >- $_->{selected} = "selected" if ($branch eq $_->{branchcode}); >- } >- my $branch_name = exists($br->{$branch}) && $br->{$branch}->{branchname}; >- > my @categories = Koha::Patron::Categories->search_limited; > my @item_types = Koha::ItemTypes->search; > my $grid_checkout = $preferences->grid({ branchcode => $branch, notification => 'CHECKOUT' }); > my $grid_checkin = $preferences->grid({ branchcode => $branch, notification => 'CHECKIN' }); > > $template->param(branch => $branch); >- $template->param(branch_name => $branch_name || 'Default'); >- $template->param(branches => \@branches); > $template->param(categories => \@categories); > $template->param(item_types => \@item_types); > $template->param(grid_checkout => $grid_checkout); >diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl >index 8d44f70..6071df1 100755 >--- a/admin/patron-attr-types.pl >+++ b/admin/patron-attr-types.pl >@@ -25,12 +25,12 @@ use CGI qw ( -utf8 ); > use List::MoreUtils qw/uniq/; > > use C4::Auth; >-use C4::Branch; > use C4::Context; > use C4::Output; > use C4::Koha; > use C4::Members::AttributeTypes; > >+use Koha::Libraries; > use Koha::Patron::Categories; > > my $script_name = "/cgi-bin/koha/admin/patron-attr-types.pl"; >@@ -84,7 +84,7 @@ exit 0; > sub add_attribute_type_form { > my $template = shift; > >- my $branches = GetBranches; >+ my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; > my @branches_loop; > foreach my $branch (sort keys %$branches) { > push @branches_loop, { >@@ -252,14 +252,14 @@ sub edit_attribute_type_form { > $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' )); > > >- my $branches = GetBranches; >+ my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; > my @branches_loop; > my $selected_branches = $attr_type->branches; >- foreach my $branch (sort keys %$branches) { >- my $selected = ( grep {$$_{branchcode} eq $branch} @$selected_branches ) ? 1 : 0; >+ foreach my $branch (@$branches) { >+ my $selected = ( grep {$_->{branchcode} eq $branch->{branchcode}} @$selected_branches ) ? 1 : 0; > push @branches_loop, { >- branchcode => $branches->{$branch}{branchcode}, >- branchname => $branches->{$branch}{branchname}, >+ branchcode => $branch->{branchcode}, >+ branchname => $branch->{branchname}, > selected => $selected, > }; > } >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index b161244..813d3ae 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -25,7 +25,7 @@ use C4::Output; > use C4::Auth; > use C4::Koha; > use C4::Debug; >-use C4::Branch; # GetBranches >+use C4::Branch; > use Koha::DateUtils; > use Koha::Database; > use Koha::IssuingRule; >diff --git a/admin/transport-cost-matrix.pl b/admin/transport-cost-matrix.pl >index 55fd912..0aab030 100755 >--- a/admin/transport-cost-matrix.pl >+++ b/admin/transport-cost-matrix.pl >@@ -25,9 +25,10 @@ use C4::Output; > use C4::Auth; > use C4::Koha; > use C4::Debug; >-use C4::Branch; # GetBranches > use C4::HoldsQueue qw(TransportCostMatrix UpdateTransportCostMatrix); > >+use Koha::Libraries; >+ > use Data::Dumper; > > my $input = new CGI; >@@ -50,11 +51,7 @@ unless ($update) { > $have_matrix = keys %$cost_matrix if $cost_matrix; > } > >-my $branches = GetBranches(); >-my @branchloop = map { code => $_, >- name => $branches->{$_}->{'branchname'} }, >- sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } >- keys %$branches; >+my @branchloop = map { code => $_->branchcode, name => $_->branchname }, Koha::Libraries->search({}, { order_by => 'branchname' }); > my (@branchfromloop, @errors); > foreach my $branchfrom ( @branchloop ) { > my $fromcode = $branchfrom->{code}; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index ef9817e..37d2599 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -27,7 +27,6 @@ use C4::Output; > use C4::Biblio; > use C4::Items; > use C4::Circulation; >-use C4::Branch; > use C4::Reserves; > use C4::Members; # to use GetMember > use C4::Serials; >@@ -125,7 +124,6 @@ my $marchostsarray = GetMarcHosts($record,$marcflavour); > my $subtitle = GetRecordValue('subtitle', $record, $fw); > > # Get Branches, Itemtypes and Locations >-my $branches = GetBranches(); > my $itemtypes = GetItemTypes(); > my $dbh = C4::Context->dbh; > >@@ -256,7 +254,7 @@ foreach my $item (@items) { > $item->{ReservedForBorrowernumber} = $reservedfor; > $item->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; > $item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; >- $item->{ExpectedAtLibrary} = $branches->{$expectedAt}{branchname}; >+ $item->{ExpectedAtLibrary} = $expectedAt; > $item->{Reservedcardnumber} = $ItemBorrowerReserveInfo->{'cardnumber'}; > # Check waiting status > $item->{waitingdate} = $wait; >@@ -267,8 +265,8 @@ foreach my $item (@items) { > my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber}); > if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) { > $item->{transfertwhen} = $transfertwhen; >- $item->{transfertfrom} = $branches->{$transfertfrom}{branchname}; >- $item->{transfertto} = $branches->{$transfertto}{branchname}; >+ $item->{transfertfrom} = $transfertfrom; >+ $item->{transfertto} = $transfertto; > $item->{nocancel} = 1; > } > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 2e6608b..27c899a 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -25,11 +25,11 @@ use C4::Auth; > use C4::Output; > use C4::Items; > use C4::Biblio; >-use C4::Branch; > use C4::Koha; > > use Koha::Item::Search::Field qw(GetItemSearchFields); > use Koha::ItemTypes; >+use Koha::Libraries; > > my $cgi = new CGI; > my %params = $cgi->Vars; >@@ -247,14 +247,7 @@ if (scalar keys %params > 0) { > if ($format eq 'html') { > # Retrieve data required for the form. > >- my $branches = GetBranches(); >- my @branches; >- foreach my $branchcode ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches) { >- push @branches, { >- value => $branchcode, >- label => $branches->{$branchcode}->{branchname}, >- }; >- } >+ my @branches = map { value => $_->branchcode => label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } ); > my @locations; > foreach my $location (@$location_values) { > push @locations, { >diff --git a/catalogue/search.pl b/catalogue/search.pl >index c48bb8b..8accfa4 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -149,7 +149,6 @@ use C4::Koha; > use C4::Members qw(GetMember); > use URI::Escape; > use POSIX qw(ceil floor); >-use C4::Branch; # GetBranches > use C4::Search::History; > > use Koha::LibraryCategories; >@@ -207,7 +206,10 @@ if($cgi->cookie("holdfor")){ > > my $categories = Koha::LibraryCategories->search( { categorytype => 'searchdomain' }, { order_by => [ 'categorytype', 'categorycode' ] } ); > >-$template->param(searchdomainloop => $categories); >+$template->param( >+ selected_branchcode => ( C4::Context->IsSuperLibrarian ? C4::Context->userenv : '' ), >+ searchdomainloop => $categories >+); > > # load the Type stuff > my $itemtypes = GetItemTypes; >@@ -507,7 +509,7 @@ eval { > my $itemtypes = GetItemTypes; > ( $error, $results_hashref, $facets ) = $searcher->search_compat( > $query, $simple_query, \@sort_by, \@servers, >- $results_per_page, $offset, $expanded_facet, $branches, >+ $results_per_page, $offset, $expanded_facet, undef, > $itemtypes, $query_type, $scan > ); > }; >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index f0263ef..ccf4a70 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -31,11 +31,12 @@ use C4::Context; > use MARC::Record; > use C4::Log; > use C4::Koha; >-use C4::Branch; > use C4::ClassSource; > use C4::ImportBatch; > use C4::Charset; > >+use Koha::Libraries; >+ > use Date::Calc qw(Today); > use MARC::File::USMARC; > use MARC::File::XML; >@@ -171,18 +172,11 @@ sub build_authorized_values_list { > > #---- branch > if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { >- #Use GetBranches($onlymine) >- my $onlymine = >- C4::Context->preference('IndependentBranches') >- && C4::Context->userenv >- && !C4::Context->IsSuperLibrarian() >- && C4::Context->userenv->{branch}; >- my $branches = GetBranches($onlymine); >- foreach my $thisbranch ( sort keys %$branches ) { >- push @authorised_values, $thisbranch; >- $authorised_lib{$thisbranch} = $branches->{$thisbranch}->{'branchname'}; >+ my $libraries = Koha::Libraries->search_filtered({}, {order_by => ['branchname']}); >+ while ( my $l = $libraries->next ) { >+ push @authorised_values, $l->branchcode;; >+ $authorised_lib{$l->branchcode} = $l->branchname; > } >- > } > elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) { > push @authorised_values, "" >diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl >index a5f2103..75c9dec 100755 >--- a/cataloguing/value_builder/unimarc_field_4XX.pl >+++ b/cataloguing/value_builder/unimarc_field_4XX.pl >@@ -31,7 +31,6 @@ use C4::Output; > use C4::Biblio; > use C4::Koha; > use MARC::Record; >-use C4::Branch; # GetBranches > > use Koha::ItemTypes; > >diff --git a/circ/bookcount.pl b/circ/bookcount.pl >index d4d3e54..2976a05 100755 >--- a/circ/bookcount.pl >+++ b/circ/bookcount.pl >@@ -29,7 +29,6 @@ use C4::Circulation; > use C4::Output; > use C4::Koha; > use C4::Auth; >-use C4::Branch; # GetBranches > use C4::Biblio; # GetBiblioItemData > use Koha::DateUtils; > use Koha::Libraries; >@@ -38,14 +37,10 @@ my $input = new CGI; > my $itm = $input->param('itm'); > my $bi = $input->param('bi'); > my $biblionumber = $input->param('biblionumber'); >-my $branches = GetBranches; > > my $idata = itemdatanum($itm); > my $data = GetBiblioItemData($bi); > >-my $homebranch = $branches->{ $idata->{'homebranch'} }->{'branchname'}; >-my $holdingbranch = $branches->{ $idata->{'holdingbranch'} }->{'branchname'}; >- > my $lastmove = lastmove($itm); > > my $lastdate; >@@ -83,8 +78,8 @@ $template->param( > author => $data->{'author'}, > barcode => $idata->{'barcode'}, > biblioitemnumber => $bi, >- homebranch => $homebranch, >- holdingbranch => $holdingbranch, >+ homebranch => $idata->{homebranch}, >+ holdingbranch => $idata->{holdingbranch}, > lastdate => $lastdate ? $lastdate : 0, > count => $count, > libraries => $libraries, >diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl >index 8b7bddd..eb0a4f7 100755 >--- a/circ/branchtransfers.pl >+++ b/circ/branchtransfers.pl >@@ -29,7 +29,6 @@ use C4::Reserves; > use C4::Biblio; > use C4::Items; > use C4::Auth qw/:DEFAULT get_session/; >-use C4::Branch; # GetBranches > use C4::Koha; > use C4::Members; > >@@ -61,8 +60,6 @@ my ($template, $user, $cookie) = get_template_and_user( > } > ); > >-my $branches = GetBranches; >- > my $messages; > my $found; > my $reserved; >@@ -131,8 +128,7 @@ if ($barcode) { > $item{'ccode'} = $iteminformation->{'ccode'}; > $item{'itemcallnumber'} = $iteminformation->{'itemcallnumber'}; > $item{'location'} = GetKohaAuthorisedValueLib("LOC",$iteminformation->{'location'}); >- $item{'frbrname'} = $branches->{$frbranchcd}->{'branchname'}; >- $item{'tobrname'} = $branches->{$tobranchcd}->{'branchname'}; >+ $item{'tobrname'} = $tobranchcd; > # } > $item{counter} = 0; > $item{barcode} = $barcode; >@@ -164,8 +160,7 @@ foreach ( $query->param ) { > $item{'ccode'} = $iteminformation->{'ccode'}; > $item{'itemcallnumber'} = $iteminformation->{'itemcallnumber'}; > $item{'location'} = GetKohaAuthorisedValueLib("LOC",$iteminformation->{'location'}); >- $item{'frbrname'} = $branches->{$frbcd}->{'branchname'}; >- $item{'tobrname'} = $branches->{$tobcd}->{'branchname'}; >+ $item{'tobrname'} = $tobcd; > push( @trsfitemloop, \%item ); > } > >@@ -196,16 +191,16 @@ foreach my $code ( keys %$messages ) { > $err{errbadcode} = 1; > } > elsif ( $code eq "NotAllowed" ) { >- warn "NotAllowed: $messages->{'NotAllowed'} to " . $branches->{ $messages->{'NotAllowed'} }->{'branchname'}; >+ warn "NotAllowed: $messages->{'NotAllowed'} to branchcode " . $messages->{'NotAllowed'}; > # Do we really want a error log message here? --atz > $err{errnotallowed} = 1; > my ( $tbr, $typecode ) = split( /::/, $messages->{'NotAllowed'} ); >- $err{tbr} = $branches->{ $tbr }->{'branchname'}; >+ $err{tbr} = $tbr; > $err{code} = $typecode; > } > elsif ( $code eq 'IsPermanent' ) { > $err{errispermanent} = 1; >- $err{msg} = $branches->{ $messages->{'IsPermanent'} }->{'branchname'}; >+ $err{msg} = $messages->{'IsPermanent'}; > } > elsif ( $code eq 'WasReturned' ) { > $err{errwasreturned} = 1; >diff --git a/circ/circulation.pl b/circ/circulation.pl >index ed9cfb9..8775d6c 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -30,7 +30,6 @@ use DateTime::Duration; > use C4::Output; > use C4::Print; > use C4::Auth qw/:DEFAULT get_session haspermission/; >-use C4::Branch; # GetBranches > use C4::Koha; # GetPrinter > use C4::Circulation; > use C4::Utils::DataTables::Members; >diff --git a/circ/returns.pl b/circ/returns.pl >index f2873a5..6cba49a 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -45,7 +45,6 @@ use C4::Biblio; > use C4::Items; > use C4::Members; > use C4::Members::Messaging; >-use C4::Branch; # GetBranches > use C4::Koha; # FIXME : is it still useful ? > use C4::RotatingCollections; > use Koha::DateUtils; >@@ -83,7 +82,6 @@ if ( $query->param('print_slip') ) { > > ##################### > #Global vars >-my $branches = GetBranches(); > my $printers = GetPrinters(); > my $userenv = C4::Context->userenv; > my $userenv_branch = $userenv->{'branch'} // ''; >@@ -401,7 +399,6 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) { > ); > > my $reserve = $messages->{'ResFound'}; >- my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'}; > my $borr = C4::Members::GetMember( borrowernumber => $reserve->{'borrowernumber'} ); > my $name = $borr->{'surname'} . ", " . $borr->{'title'} . " " . $borr->{'firstname'}; > $template->param( >@@ -427,7 +424,6 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) { > # > if ( $messages->{'ResFound'}) { > my $reserve = $messages->{'ResFound'}; >- my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'}; > my $borr = C4::Members::GetMember( borrowernumber => $reserve->{'borrowernumber'} ); > my $holdmsgpreferences = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name => 'Hold_Filled' } ); > if ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) { >@@ -447,8 +443,7 @@ if ( $messages->{'ResFound'}) { > # same params for Waiting or Reserved > $template->param( > found => 1, >- currentbranch => $branches->{$userenv_branch}->{'branchname'}, >- destbranchname => $branches->{ $reserve->{'branchcode'} }->{'branchname'}, >+ destbranchname => $reserve->{'branchcode'}, > name => $borr->{'surname'} . ", " . $borr->{'title'} . " " . $borr->{'firstname'}, > borfirstname => $borr->{'firstname'}, > borsurname => $borr->{'surname'}, >@@ -485,7 +480,7 @@ foreach my $code ( keys %$messages ) { > elsif ( $code eq 'NotIssued' ) { > $err{notissued} = 1; > $err{msg} = ''; >- $err{msg} = $branches->{ $messages->{'IsPermanent'} }->{'branchname'} if $messages->{'IsPermanent'}; >+ $err{msg} = $messages->{'IsPermanent'} if $messages->{'IsPermanent'}; > } > elsif ( $code eq 'LocalUse' ) { > $err{localuse} = 1; >@@ -512,8 +507,7 @@ foreach my $code ( keys %$messages ) { > elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) { > if ( $messages->{'IsPermanent'} ne $userenv_branch ) { > $err{ispermanent} = 1; >- $err{msg} = >- $branches->{ $messages->{'IsPermanent'} }->{'branchname'}; >+ $err{msg} = $messages->{'IsPermanent'}; > } > } > elsif ( $code eq 'WrongTransfer' ) { >@@ -616,18 +610,9 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { > } > push @riloop, \%ri; > } >-my ($genbrname, $genprname); >-if (my $b = $branches->{$userenv_branch}) { >- $genbrname = $b->{'branchname'}; >-} >-if (my $p = $printers->{$printer}) { >- $genprname = $p->{'printername'}; >-} >+ > $template->param( > riloop => \@riloop, >- genbrname => $genbrname, >- genprname => $genprname, >- branchname => $genbrname, > printer => $printer, > errmsgloop => \@errmsgloop, > exemptfine => $exemptfine, >diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl >index d87261d..e037e9e 100755 >--- a/circ/selectbranchprinter.pl >+++ b/circ/selectbranchprinter.pl >@@ -26,7 +26,6 @@ use C4::Output; > use C4::Auth qw/:DEFAULT get_session/; > use C4::Print; # GetPrinters > use C4::Koha; >-use C4::Branch; # GetBranches > > use Koha::Libraries; > >@@ -47,7 +46,6 @@ my $sessionID = $query->cookie("CGISESSID"); > my $session = get_session($sessionID); > > # try to get the branch and printer settings from http, fallback to userenv >-my $branches = GetBranches(); > my $printers = GetPrinters(); > my $branch = $query->param('branch' ); > my $printer = $query->param('printer'); >@@ -58,9 +56,9 @@ my $userenv_printer = C4::Context->userenv->{'branchprinter'} || ''; > my @updated; > > # $session lddines here are doing the updating >-if ($branch and $branches->{$branch}) { >+if ( $branch and my $library = Koha::Libraries->find($branch) ) { > if (! $userenv_branch or $userenv_branch ne $branch ) { >- my $branchname = Koha::Libraries->find($branch)->branchname; >+ my $branchname = $library->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 >@@ -94,10 +92,6 @@ if ($printer) { > > $template->param(updated => \@updated) if (scalar @updated); > >-unless ($branches->{$branch}) { >- $branch = (keys %$branches)[0]; # if branch didn't really exist, then replace it w/ one that does >-} >- > my @printkeys = sort keys %$printers; > if (scalar(@printkeys) == 1 or not $printers->{$printer}) { > $printer = $printkeys[0]; # if printer didn't really exist, or there is only 1 anyway, then replace it w/ one that does >diff --git a/circ/transferstoreceive.pl b/circ/transferstoreceive.pl >index 4be2bcb..a67f799 100755 >--- a/circ/transferstoreceive.pl >+++ b/circ/transferstoreceive.pl >@@ -23,7 +23,6 @@ use warnings; > use CGI qw ( -utf8 ); > use C4::Context; > use C4::Output; >-use C4::Branch; # GetBranches > use C4::Auth; > use Koha::DateUtils; > use C4::Biblio; >@@ -37,6 +36,7 @@ use Date::Calc qw( > > use C4::Koha; > use C4::Reserves; >+use Koha::Libraries; > > my $input = new CGI; > my $itemnumber = $input->param('itemnumber'); >@@ -56,18 +56,18 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > my $default = C4::Context->userenv->{'branch'}; > > # get the all the branches for reference >-my $branches = GetBranches(); >+my $libraries = Koha::Libraries->search({}, { order_by => 'branchname' }); > my @branchesloop; > my $latetransfers; >-foreach my $br ( keys %$branches ) { >+while ( my $library = $libraries->next ) { > my @transferloop; > my %branchloop; > my @gettransfers = >- GetTransfersFromTo( $branches->{$br}->{'branchcode'}, $default ); >+ GetTransfersFromTo( $library->branchcode, $default ); > > if (@gettransfers) { >- $branchloop{'branchname'} = $branches->{$br}->{'branchname'}; >- $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'}; >+ $branchloop{'branchname'} = $library->branchname; >+ $branchloop{'branchcode'} = $library->branchcode; > foreach my $num (@gettransfers) { > my %getransf; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/branch-selector.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/branch-selector.inc >index cd5760c..e6dfdb7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/branch-selector.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/branch-selector.inc >@@ -11,12 +11,12 @@ END %] > [% FOREACH branch IN branches %] > <div class="branchgriditem"> > [% IF branch.selected || (selectall == 1) %] >- <input id="branch_[% branch.value %]" class="branch_select" type="checkbox" name="branch" value="[% branch.value %]" checked="checked" /> >+ <input id="branch_[% branch.branchcode %]" class="branch_select" type="checkbox" name="branch" value="[% branch.branchcode %]" checked="checked" /> > [% ELSE %] >- <input id="branch_[% branch.value %]" class="branch_select" type="checkbox" name="branch" value="[% branch.value %]" /> >+ <input id="branch_[% branch.branchcode %]" class="branch-select" type="checkbox" name="branch" value="[% branch.branchcode %]" /> > [% END %] > >- <label for="branch_[% branch.value %]">[% branch.branchname %]</label> >+ <label for="branch_[% branch.branchcode %]">[% branch.branchname %]</label> > </div> > [% IF loop.count() % 4 == 0 && !loop.last() %] > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc >index 4f6f1ca..94650f6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc >@@ -30,13 +30,8 @@ > <label for="branch">Library:</label> > <select id="branch" name="branch_filter"> > <option value="">All</option> >- [% FOREACH branch IN branches_loop %] >- [% IF (branch.selected) %] >- <option selected="branch.selected" value="[% branch.branchcode %]">[% branch.branchname %]</option> >- [% ELSE %] >- <option value="[% branch.branchcode %]">[% branch.branchname %]</option> >- [% END %] >- [% END %] >+ [%# FIXME Should not we filter the libraries? %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %] > </select> > </li> > </ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >index e94f2c0..c6ada40 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >@@ -262,7 +262,7 @@ $(document).ready(function() { > <li>Publication year: [% publicationyear %]</li> > [% END %] > [% IF ( branch ) %] >- <li>Library: [% branchname %]</li> >+ <li>Library: [% Branches.GetName( branch ) %]</li> > [% END %] > </ul> > </p> >@@ -348,13 +348,8 @@ $(document).ready(function() { > <label for="branch">Library:</label> > <select id="branch" name="branch"> > <option value="">All</option> >- [% FOREACH branch IN branches_loop %] >- [% IF ( branch.selected ) %] >- <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option> >- [% ELSE %] >- <option value="[% branch.branchcode %]">[% branch.branchname %]</option> >- [% END %] >- [% END %] >+ [%# FIXME Should not we filter the libraries %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %] > </select> > </li> > </ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >index 4454734..8f90305 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% USE Price %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Funds[% IF op == 'add_form' %] › [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title> >@@ -522,7 +523,7 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > <label for="budget_branchcode">Library: </label> > <select name="budget_branchcode" id="budget_branchcode"> > <option value=""></option> >- [% PROCESS options_for_libraries libraries => branchloop_select %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => budget_branchcode, unfiltered => 1 ) %] > </select> > </li> > >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 c1309c3..4df8bd3 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 >@@ -58,15 +58,9 @@ > <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"> >- [% FOREACH branch_loo IN branch_loop %] >- [% IF ( branch_loo.selected ) %] >- <option value="[% branch_loo.value %]" selected="selected">[% branch_loo.branchname %]</option> >- [% ELSE %] >- <option value="[% branch_loo.value %]">[% branch_loo.branchname %]</option> >- [% END %] >- [% END %] >- </select> >+ <select name="branchcode" id="branchselect"> >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1 ) %] >+ </select> > </form> > > <p class="help">Check the boxes for the libraries you accept to checkin items from.</p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt >index b55709c..d55801f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Item circulation alerts</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -103,13 +104,8 @@ $(function(){ > <h2>Select a library:</h2> > <form id="branch_selector" method="get" action="/cgi-bin/koha/admin/item_circulation_alerts.pl"> > <select id="branch" name="branch"> >-[% FOREACH branche IN branches %] >-[% IF ( branche.selected ) %] >-<option value="[% branche.branchcode %]" selected="selected">[% branche.branchname %]</option> >-[% ELSE %] >-<option value="[% branche.branchcode %]">[% branche.branchname %]</option> >-[% END %] >-[% END %] >+ <option value="*">Default</option> >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %] > </select> > <input type="submit" name="pick" value="Pick" /> > </form> >@@ -141,7 +137,7 @@ $(function(){ > </div> > </div> > >-<h2>Circulation alerts for [% branch_name %]</h2> >+<h2>Circulation alerts for [% Branches.GetName( branch ) || 'Default' %]</h2> > <p>Click on the grid to toggle the settings.</p> > > <div id="alerttabs" class="toptabs"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 4024918..3fe379d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -142,7 +142,7 @@ $(document).ready(function() { > Select a library : > <select name="branch" id="branch" style="width:20em;"> > <option value="*">All libraries</option> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch ) %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %] > </select> > </form> > [% IF ( definedbranch ) %] >@@ -150,7 +150,7 @@ $(document).ready(function() { > <label for="tobranch"><strong>Clone these rules to:</strong></label> > <input type="hidden" name="frombranch" value="[% current_branch %]" /> > <select name="tobranch" id="tobranch"> >- [% FOREACH l IN Branches.all() %] >+ [% FOREACH l IN Branches.all( unfiltered => 1 ) %] > <option value="[% l.value %]">[% l.branchname %]</option> > [% END %] > </select> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index a5c419a..8d0e58f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › > [% IF ( nopermission ) %]Access denied[% END %] >@@ -57,7 +58,7 @@ > <p><label for="branch">Library:</label> > <select name="branch" id="branch" class="input" tabindex="3"> > <option value="">My library</option> >- [% FOREACH l IN Branches.all() %] >+ [% FOREACH l IN Branches.all( unfiltered => 1 ) %] > <option value="[% l.branchcode %]">[% l.branchname %]</option> > [% END %] > </select> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index 987d4c9..c6bdc23 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Catalog › Advanced search</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -252,7 +253,8 @@ > <fieldset id="select-libs"> > <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'> > <option value="">All libraries</option> >- [% PROCESS options_for_libraries libraries => Branches.all() %] >+ [%# FIXME Should not we filter the libraries displayed? %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %] > </select></p> > <!-- <input type="hidden" name="limit" value="branch: MAIN" /> --> > [% IF ( searchdomainloop ) %] >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 5703478..5df6f72 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -651,7 +651,7 @@ function verify_images() { > : due [% item.datedue %] > </span> > [% ELSIF ( item.transfertwhen ) %] >- <span class="intransit">In transit from [% item.transfertfrom %] to [% item.transfertto %] since [% item.transfertwhen | $KohaDates %]</span> >+ <span class="intransit">In transit from [% Branches.GetName( item.transfertfrom ) %] to [% Branches.GetName( item.transfertto ) %] since [% item.transfertwhen | $KohaDates %]</span> > [% END %] > > [% IF ( item.itemlost ) %] >@@ -707,7 +707,7 @@ function verify_images() { > [% IF ( item.waitingdate ) %] > at[% ELSE %]for delivery at > [% END %] >- [% item.ExpectedAtLibrary %] >+ [% Branches.GetName( item.ExpectedAtLibrary ) %] > [% IF ( item.waitingdate ) %] > since [% item.waitingdate | $KohaDates %] > [% ELSE %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt >index 60b3f52..9257027 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Circulation › Circulation statistics for [% title |html %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -25,9 +26,9 @@ $(document).ready(function(){ > <h3>Barcode [% barcode %]</h3> > <table> > <tr><th>Home library</th><th>Current library</th><th>Date arrived<br />at current library </th><th>Number of checkouts<br />since last transfer</th></tr> >- >- <tr><td>[% homebranch %]</td> >- <td>[% holdingbranch %]</td> >+ >+ <tr><td>[% Branches.GetName( homebranch ) %]</td> >+ <td>[% Branches.GetName( holdingbranch ) %]</td> > <td>[% IF ( lastdate ) %][% lastdate | $KohaDates %][% ELSE %]Item has no transfer record[% END %]</td> > <td>[% count %]</td> > </tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >index d68a39f..bbc8861 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >@@ -111,7 +111,7 @@ > <li>No Item with barcode: [% errmsgloo.msg %]</li> > [% END %] > [% IF ( errmsgloo.errispermanent ) %] >- <li>Please return item to home library: [% errmsgloo.msg %]</li> >+ <li>Please return item to home library: [% Branches.GetName( errmsgloo.msg ) %]</li> > [% END %] > [% IF ( errmsgloo.errnotallowed ) %] > <li>Transfer is not allowed for: >@@ -121,7 +121,7 @@ > [% ELSE %] > <li>Collection code: <b>[% AuthorisedValues.GetByCode( 'CCODE', errmsgloo.code ) %]</b></li> > [% END %] >- <li>Destination library: <b>[% errmsgloo.tbr %]</b></li> >+ <li>Destination library: <b>[% Branches.GetName( errmsgloo.tbr ) %]</b></li> > </ol> > </li> > [% END %] >@@ -187,7 +187,7 @@ > <td class="tf-itemcallnumber">[% trsfitemloo.itemcallnumber %]</td> > <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.itemtype ) %]</td> > <td class="tf-ccode">[% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.ccode ) %]</td> >- <td class="tf-destination">[% trsfitemloo.tobrname %]</td> >+ <td class="tf-destination">[% Branches.GetName( trsfitemloo.tobrname ) %]</td> > </tr> > [% END %] > </table> >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 fe462c6..a913d90 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -256,10 +256,10 @@ $(document).ready(function () { > [% INCLUDE display_bormessagepref %] > [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %] > [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]</ul> >- [% IF ( transfertodo ) %] >- <h4><strong>Transfer to:</strong> [% destbranchname %]</h4> >- [% ELSE %] >- <h4><strong>Hold at</strong> [% destbranchname %]</h4> >+ [% IF ( transfertodo ) %] >+ <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranchname ) %]</h4> >+ [% ELSE %] >+ <h4><strong>Hold at</strong> [% Branches.GetName( destbranchname ) %]</h4> > [% END %] > <form method="post" action="returns.pl" class="confirm"> > <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button> >@@ -482,7 +482,7 @@ $(document).ready(function () { > <p class="problem">No item with barcode: [% errmsgloo.msg %]</p> > [% END %] > [% IF ( errmsgloo.ispermanent ) %] >- <p class="problem">Please return item to: [% errmsgloo.msg %]</p> >+ <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) %]</p> > [% END %] > [% IF ( errmsgloo.notissued ) %] > <p class="problem">Not checked out.</p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >index 1dd4151..9af0510 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Patron search</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -194,11 +195,12 @@ function filterByFirstLetterSurname(letter) { > <li> > <label for="branchcode_filter">Library:</label> > <select id="branchcode_filter"> >- [% IF branches.size != 1 %] >+ [% SET libraries = Branches.all() %] >+ [% IF libraries.size != 1 %] > <option value="">Any</option> > [% END %] >- [% FOREACH branch IN branches %] >- <option value="[% branch.branchcode %]">[% branch.branchname %]</option> >+ [% FOREACH l IN libraries %] >+ <option value="[% l.branchcode %]">[% l.branchname %]</option> > [% END %] > </select> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >index 2c14305..005886d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >@@ -142,7 +142,7 @@ > <td> > <select name="Filter" size="1" id="branch"> > <option value=""></option> >- [% FOREACH l IN Branches.all() %] >+ [% FOREACH l IN Branches.all( unfiltered => 1 ) %] > <option value="[% l.branchcode %]">[% l.branchcode %] - [% l.branchname || 'UNKNOWN' %]</option> > [% END %] > </select> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 8926ec5..99849c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -16,10 +16,10 @@ > <script type="text/javascript"> > // <![CDATA[ > var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?"); >-var patron_homebranch = "[% borrower_branchname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"; >+var patron_homebranch = "[% Branches.GetName( borrower_branchcode ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"; > var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %] > [% itemloo.itemnumber %]: { >- homebranch: "[% itemloo.homebranchname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]", >+ homebranch: "[% Branches.GetName( itemloo.homebranch ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]", > holdallowed: [% itemloo.holdallowed %] > }, > [% END %][% END %][% END %] >@@ -472,10 +472,10 @@ function checkMultiHold() { > [% itemloo.barcode %] > </td> > <td> >- [% itemloo.homebranchname %] >+ [% Branches.GetName( itemloo.homebranch ) %] > </td> > <td> >- [% itemloo.holdingbranchname %] >+ [% Branches.GetName( itemloo.holdingbranch ) %] > </td> > <td> > [% itemloo.itemcallnumber %] >@@ -494,8 +494,8 @@ function checkMultiHold() { > [% ELSE %] > <span title="0000-00-00"> > [% IF ( itemloo.transfertwhen ) %] >- In transit from [% itemloo.transfertfrom %], >- to [% itemloo.transfertto %], since [% itemloo.transfertwhen %] >+ In transit from [% Branches.GetName( itemloo.transfertfrom ) %], >+ to [% Branches.GetName( itemloo.transfertto ) %], since [% itemloo.transfertwhen %] > [% END %] > </span> > [% END %] >@@ -513,7 +513,7 @@ function checkMultiHold() { > Can't be cancelled when item is in transit > [% ELSE %] > [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] >- [% IF ( itemloo.canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">[% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]</a>[% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemloo.ExpectedAtLibrary %] >+ [% IF ( itemloo.canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">[% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]</a>[% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% Branches.GetName( itemloo.ExpectedAtLibrary ) %] > since > [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate %][% END %][% END %]. <a class="info" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber %]&CancelBorrowerNumber=[% itemloo.ReservedForBorrowernumber %]&CancelItemnumber=[% itemloo.itemnumber %]" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);">Cancel hold</a> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt >index 1228827..43f76a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Rotating collections › Transfer collection</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -37,13 +38,7 @@ > <li> > <label for="toBranch">Choose your library:</label> > <select id="toBranch" name="toBranch"> >- [% FOREACH branchoptionloo IN branchoptionloop %] >- [% IF ( branchoptionloo.selected ) %] >- <option value="[% branchoptionloo.code %]" selected="selected">[% branchoptionloo.name %]</option> >- [% ELSE %] >- <option value="[% branchoptionloo.code %]">[% branchoptionloo.name %]</option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %] > </select> > </li> > </ol> >@@ -61,4 +56,4 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> <!-- /#bd --> >-[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >index aa0ad03..2e3168b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -89,13 +89,8 @@ > <label for="branch">Library:</label> > <select id="branch" name="branch_filter"> > <option value="">All</option> >- [% FOREACH branch IN branches_loop %] >- [% IF ( branch.selected ) %] >- <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option> >- [% ELSE %] >- <option value="[% branch.branchcode %]">[% branch.branchname %]</option> >- [% END %] >- [% END %] >+ [%# FIXME Should not we filter the libraries? %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %] > </select> > </li> > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index 637c843..948d8af 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -559,12 +559,10 @@ $(document).ready(function() { > [% UNLESS ( Independentbranches ) %] > <option value="">None</option> > [% END %] >- [% FOREACH branchloo IN branchloop %] >- [% IF ( branchloo.selected ) %] >- <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option> >- [% ELSE %] >- <option value="[% branchloo.value %]">[% branchloo.branchname %]</option> >- [% END %] >+ [% IF CAN_user_serials_superserials %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1 ) %] >+ [% ELSE %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %] > [% END %] > </select> (select a library) > </li> >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 a59cecc..990786c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -421,8 +421,12 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <fieldset class="rows"> <legend>Acquisition information</legend><ol> > <li><label for="branchcode">Library:</label> > <select name="branchcode" id="branchcode"> >- <option value="">Any</option>[% FOREACH branchloo IN branchloop %] >- [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %][% END %] >+ <option value="">Any</option> >+ [% IF branchfilter %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter ) %] >+ [% ELSE %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %] >+ [% END %] > </select> > </li> > <li><label for="budgetid">Fund:</label> >@@ -787,9 +791,12 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > </select></li> > <li><label for="branchcode"> For:</label> > <select name="branchcode" id="branchcode"> >- <option value="__ANY__">Any</option>[% FOREACH branchloo IN branchloop %] >- [% IF ( branchloo.selected ) %] <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %] <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %] >- [% END %] >+ <option value="__ANY__">Any</option> >+ [% IF branchfilter %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter ) %] >+ [% ELSE %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %] >+ [% END %] > </select></li><li><input type="submit" value="Go" /></li></ol> > </fieldset> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >index cf41e5f..8f19cba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Export data</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -92,7 +93,7 @@ $(document).ready(function() { > <li> > <label>Library: </label> > [% INCLUDE 'branch-selector.inc' >- branches = branchloop %] >+ branches = libraries %] > </li> > </ol> > >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 4bd4f5d..2178364 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >@@ -313,7 +313,6 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl > <!-- ***************************** Panel to deal with new holidays ********************** --> > <div class="panel" id="newHoliday"> > <form action="/cgi-bin/koha/tools/newHolidays.pl" method="post"> >- <input type="hidden" name="branchCodes" id="branchCodes" value="[% branchcodes %]" /> > <fieldset class="brief"> > <h3>Add new holiday</h3> > <ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >index 7563827..f3ce125 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -139,7 +139,7 @@ $(document).ready(function(){ > </li><li> > <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;"> > <option value="">All libraries</option> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %] > </select> > </li> > [% IF (authorised_values) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >index 62dd962..1cf4313 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › News</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -112,18 +113,12 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> > <li> > <label for="branch">Library: </label> > <select id="branch" name="branch"> >- [% IF ( new_detail.branchcode == '' ) %] >- <option value="" selected="selected">All libraries</option> >- [% ELSE %] >- <option value="" >All libraries</option> >- [% END %] >- [% FOREACH branch_item IN branch_list %] >- [% IF ( branch_item.value.branchcode == new_detail.branchcode ) %] >- <option value="[% branch_item.value.branchcode %]" selected="selected">[% branch_item.value.branchname %]</option> >- [% ELSE %] >- <option value="[% branch_item.value.branchcode %]">[% branch_item.value.branchname %]</option> >- [% END %] >- [% END %] >+ [% IF ( new_detail.branchcode == '' ) %] >+ <option value="" selected="selected">All libraries</option> >+ [% ELSE %] >+ <option value="" >All libraries</option> >+ [% END %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %] > </select> > </li> > <li> >@@ -191,17 +186,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> > [% ELSE %] > <option value="" >All libraries</option> > [% END %] >- [% FOREACH branch_item IN branch_list %] >- [% IF ( branch_item.value.branchcode == branchcode ) %] >- <option value="[% branch_item.value.branchcode %]" >- selected="selected">[% branch_item.value.branchname %] >- </option> >- [% ELSE %] >- <option value="[% branch_item.value.branchcode %]" >- >[% branch_item.value.branchname %] >- </option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %] > </select> > <input type="submit" class="button" value="Filter" /> > </form> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 5bb76ec..843fcf6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -37,8 +37,8 @@ not use an API to fetch items that populates item.datedue. > > [% IF ( item.transfertwhen ) %] > [% SET itemavailable = 0 %] >- <span class="item-status intransit">In transit from [% item.transfertfrom %] >- to [% item.transfertto %] since [% item.transfertwhen | $KohaDates %]</span> >+ <span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) %] >+ to [% Branches.GetName( item.transfertto ) %] since [% item.transfertwhen | $KohaDates %]</span> > [% END %] > > [% IF ( item.waiting ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index bc39173..31e1be7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -338,8 +338,8 @@ > > <td class="barcode">[% itemLoo.barcode %]</td> > [% UNLESS ( singleBranchMode ) %] >- <td class="homebranch">[% itemLoo.homeBranchName %]</td> >- <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td> >+ <td class="homebranch">[% Branches.GetName( itemLoo.homeBranchName ) %]</td> >+ <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingBranchName ) %]</td> > [% END %] > <td class="call_no">[% itemLoo.callNumber %]</td> > [% IF ( itemdata_enumchron ) %] >@@ -349,7 +349,7 @@ > [% IF ( itemLoo.dateDue ) %] > <span class="checkedout">Due [% itemLoo.dateDue %]</span> > [% ELSIF ( itemLoo.transfertwhen ) %] >- <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span> >+ <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) %] to [% Branches.GetName( itemLoo.transfertto ) %] since [% itemLoo.transfertwhen %]</span> > [% END %] > > [% IF ( itemLoo.message ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt >index 672e241..09fa0e3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% USE Branches %] > [% USE AuthorisedValues %] > [% USE ItemTypes %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -41,7 +42,7 @@ > [% END %] > [% IF ( branch ) %] > at >- [% branch %] >+ [% Branches.GetName( branch ) %] > [% END %] > [% IF ( timeLimit != 999 ) %] > in the past [% timeLimit |html %] months >diff --git a/members/deletemem.pl b/members/deletemem.pl >index ef7429c..70fd010 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -29,7 +29,6 @@ use C4::Context; > use C4::Output; > use C4::Auth; > use C4::Members; >-use C4::Branch; # GetBranches > use Module::Load; > use Koha::Patron::Images; > if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { >diff --git a/members/guarantor_search.pl b/members/guarantor_search.pl >index d34b828..352f124 100755 >--- a/members/guarantor_search.pl >+++ b/members/guarantor_search.pl >@@ -21,7 +21,6 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth; >-use C4::Branch qw( GetBranches ); > use C4::Output; > use C4::Members; > >@@ -45,9 +44,6 @@ my $op = $input->param('op') || ''; > > my $referer = $input->referer(); > >-my $onlymine = C4::Branch::onlymine; >-my $branches = C4::Branch::GetBranches( $onlymine ); >- > my $patron_categories = Koha::Patron::Categories->search_limited; > $template->param( > view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", >@@ -56,7 +52,6 @@ $template->param( > selection_type => 'select', > alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), > categories => $patron_categories, >- branches => [ map { { branchcode => $_->{branchcode}, branchname => $_->{branchname} } } values %$branches ], > aaSorting => 1, > ); > output_html_with_http_headers( $input, $cookie, $template->output ); >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 898a6fd..e1744c7 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -37,7 +37,6 @@ use C4::Members::AttributeTypes; > use C4::Koha; > use C4::Log; > use C4::Letters; >-use C4::Branch; # GetBranches > use C4::Form::MessagingPreferences; > use Koha::Patron::Debarments; > use Koha::Cities; >diff --git a/members/pay.pl b/members/pay.pl >index 6507498..6ee652c 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -39,7 +39,6 @@ use C4::Accounts; > use C4::Stats; > use C4::Koha; > use C4::Overdues; >-use C4::Branch; > use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Patron::Images; > >diff --git a/members/paycollect.pl b/members/paycollect.pl >index ade9b3c..36c6f05 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -28,7 +28,6 @@ use C4::Members; > use C4::Members::Attributes qw(GetBorrowerAttributes); > use C4::Accounts; > use C4::Koha; >-use C4::Branch; > use Koha::Patron::Images; > > use Koha::Patron::Categories; >diff --git a/members/readingrec.pl b/members/readingrec.pl >index a89dab6..5e570b3 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -28,7 +28,6 @@ use CGI qw ( -utf8 ); > use C4::Auth; > use C4::Output; > use C4::Members; >-use C4::Branch qw(GetBranches); > use List::MoreUtils qw/any uniq/; > use Koha::DateUtils; > use C4::Members::Attributes qw(GetBorrowerAttributes); >@@ -74,8 +73,6 @@ if ( $borrowernumber eq C4::Context->preference('AnonymousPatron') ){ > $issues = GetAllIssues($borrowernumber,$order,$limit); > } > >-my $branches = GetBranches(); >- > # barcode export > if ( $op eq 'export_barcodes' ) { > if ( $data->{'privacy'} < 2) { >@@ -129,7 +126,6 @@ $template->param( > privacy => $data->{'privacy'}, > categoryname => $data->{description}, > is_child => ( $data->{category_type} eq 'C' ), >- branchname => $branches->{ $data->{branchcode} }->{branchname}, > loop_reading => $issues, > activeBorrowerRelationship => > ( C4::Context->preference('borrowerRelationship') ne '' ), >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index db4987e..2df231d 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -22,7 +22,6 @@ use strict; > use CGI qw ( -utf8 ); > use C4::Output; > use C4::Auth qw/:DEFAULT/; >-use C4::Branch; # GetBranches > use C4::Members; > use C4::Members::Attributes qw(GetBorrowerAttributes); > use C4::Context; >@@ -42,8 +41,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( > } > ); > >-my $branches = GetBranches(); >- > my $findborrower = $query->param('findborrower'); > $findborrower =~ s|,| |g; > >diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl >index d41b7a7..f87f8c6 100755 >--- a/opac/opac-basket.pl >+++ b/opac/opac-basket.pl >@@ -21,7 +21,6 @@ use warnings; > use CGI qw ( -utf8 ); > use C4::Koha; > use C4::Biblio; >-use C4::Branch; > use C4::Items; > use C4::Circulation; > use C4::Auth; >@@ -91,7 +90,6 @@ foreach my $biblionumber ( @bibs ) { > $dat->{'even'} = 1; > } > >-my $branches = GetBranches(); > for my $itm (@items) { > if ($itm->{'location'}){ > $itm->{'location_opac'} = $shelflocations->{$itm->{'location'} }; >@@ -99,8 +97,8 @@ my $branches = GetBranches(); > my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber}); > if ( defined( $transfertwhen ) && $transfertwhen ne '' ) { > $itm->{transfertwhen} = $transfertwhen; >- $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname}; >- $itm->{transfertto} = $branches->{$transfertto}{branchname}; >+ $itm->{transfertfrom} = $transfertfrom; >+ $itm->{transfertto} = $transfertto; > } > } > $num++; >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 157d08d..60c373b 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -196,7 +196,6 @@ if ($session->param('busc')) { > my ($arrParamsBusc, $offset, $results_per_page) = @_; > > my $expanded_facet = $arrParamsBusc->{'expand'}; >- my $branches = GetBranches(); > my $itemtypes = GetItemTypes; > my @servers; > @servers = @{$arrParamsBusc->{'server'}} if $arrParamsBusc->{'server'}; >@@ -208,7 +207,7 @@ if ($session->param('busc')) { > $sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by); > my ($error, $results_hashref, $facets); > eval { >- ($error, $results_hashref, $facets) = getRecords($arrParamsBusc->{'query'},$arrParamsBusc->{'simple_query'},\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$arrParamsBusc->{'query_type'},$arrParamsBusc->{'scan'}); >+ ($error, $results_hashref, $facets) = getRecords($arrParamsBusc->{'query'},$arrParamsBusc->{'simple_query'},\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,undef,$itemtypes,$arrParamsBusc->{'query_type'},$arrParamsBusc->{'scan'}); > }; > my $hits; > my @newresults; >@@ -488,7 +487,6 @@ if ($hideitems) { > @items = @all_items; > } > >-my $branches = GetBranches(); > my $branch = ''; > if (C4::Context->userenv){ > $branch = C4::Context->userenv->{branch}; >@@ -499,19 +497,19 @@ if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) { > || > C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' > ) { >- my $branchname; >+ my $branchcode; > if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) { >- $branchname = $branches->{$branch}->{'branchname'}; >+ $branchcode = $branch; > } > elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) { >- $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'}; >+ $branchcode = $ENV{'BRANCHCODE'}; > } > > my @our_items; > my @other_items; > > foreach my $item ( @items ) { >- if ( $item->{'branchname'} eq $branchname ) { >+ if ( $item->{branchcode} eq $branchcode ) { > $item->{'this_branch'} = 1; > push( @our_items, $item ); > } else { >@@ -666,8 +664,8 @@ if ( not $viewallitems and @items > $max_items_to_display ) { > my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber}); > if ( defined( $transfertwhen ) && $transfertwhen ne '' ) { > $itm->{transfertwhen} = $transfertwhen; >- $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname}; >- $itm->{transfertto} = $branches->{$transfertto}{branchname}; >+ $itm->{transfertfrom} = $transfertfrom; >+ $itm->{transfertto} = $transfertto; > } > > if ( C4::Context->preference('OPACAcquisitionDetails') >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 301c852..3f20543 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -30,7 +30,6 @@ use C4::Items; > use C4::Output; > use C4::Context; > use C4::Members; >-use C4::Branch; # GetBranches > use C4::Overdues; > use C4::Debug; > use Koha::DateUtils; >@@ -88,8 +87,7 @@ if ( $borr->{'BlockExpiredPatronOpacActions'} ) { > if ($borr->{reservefee} > 0){ > $template->param( RESERVE_CHARGE => sprintf("%.2f",$borr->{reservefee})); > } >-# get branches and itemtypes >-my $branches = GetBranches(); >+ > my $itemTypes = GetItemTypes(); > > # There are two ways of calling this script, with a single biblio num >@@ -124,7 +122,6 @@ if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { > > # pass the pickup branch along.... > my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; >-($branches->{$branch}) or $branch = ""; # Confirm branch is real > $template->param( branch => $branch ); > > # Is the person allowed to choose their branch >@@ -434,7 +431,7 @@ foreach my $biblioNum (@biblionumbers) { > > $itemLoopIter->{itemnumber} = $itemNum; > $itemLoopIter->{barcode} = $itemInfo->{barcode}; >- $itemLoopIter->{homeBranchName} = $branches->{$itemInfo->{homebranch}}{branchname}; >+ $itemLoopIter->{homeBranchName} = $itemInfo->{homebranch}; > $itemLoopIter->{callNumber} = $itemInfo->{itemcallnumber}; > $itemLoopIter->{enumchron} = $itemInfo->{enumchron}; > $itemLoopIter->{copynumber} = $itemInfo->{copynumber}; >@@ -447,8 +444,7 @@ foreach my $biblioNum (@biblionumbers) { > # If the holdingbranch is different than the homebranch, we show the > # holdingbranch of the document too. > if ( $itemInfo->{homebranch} ne $itemInfo->{holdingbranch} ) { >- $itemLoopIter->{holdingBranchName} = >- $branches->{ $itemInfo->{holdingbranch} }{branchname}; >+ $itemLoopIter->{holdingBranchName} = $itemInfo->{holdingbranch}; > } > > # If the item is currently on loan, we display its return date and >@@ -506,9 +502,8 @@ foreach my $biblioNum (@biblionumbers) { > GetTransfers($itemNum); > if ( $transfertwhen && ($transfertwhen ne '') ) { > $itemLoopIter->{transfertwhen} = output_pref({ dt => dt_from_string($transfertwhen), dateonly => 1 }); >- $itemLoopIter->{transfertfrom} = >- $branches->{$transfertfrom}{branchname}; >- $itemLoopIter->{transfertto} = $branches->{$transfertto}{branchname}; >+ $itemLoopIter->{transfertfrom} = $transfertfrom; >+ $itemLoopIter->{transfertto} = $transfertto; > $itemLoopIter->{nocancel} = 1; > } > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 64b8800..8dda1f0 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -49,7 +49,6 @@ use C4::Search::History; > use C4::Biblio; # GetBiblioData > use C4::Koha; > use C4::Tags qw(get_tags); >-use C4::Branch; # GetBranches > use C4::SocialData; > use C4::Ratings; > use C4::External::OverDrive; >@@ -213,7 +212,6 @@ if ($cgi->cookie("search_path_code")) { > } > } > >-my $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established > my $library_categories = Koha::LibraryCategories->search( { categorytype => 'searchdomain' }, { order_by => [ 'categorytype', 'categorycode' ] } ); > $template->param( searchdomainloop => $library_categories ); > >@@ -608,7 +606,7 @@ if ($tag) { > # FIXME: No facets for tags search. > } elsif ($build_grouped_results) { > eval { >- ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan); >+ ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,undef,$query_type,$scan); > }; > } else { > $pasarParams .= '&query=' . uri_escape_utf8($query); >@@ -616,7 +614,7 @@ if ($tag) { > $pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query); > $pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type); > eval { >- ($error, $results_hashref, $facets) = $searcher->search_compat($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1); >+ ($error, $results_hashref, $facets) = $searcher->search_compat($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,undef,$itemtypes,$query_type,$scan,1); > }; > } > >@@ -798,12 +796,12 @@ for (my $i=0;$i<@servers;$i++) { > || > C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' > ) { >- my $branchname; >+ my $branchcode; > if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) { >- $branchname = $branches->{$branch}->{'branchname'}; >+ $branchcode = $branch; > } > elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) { >- $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'}; >+ $branchcode = $ENV{'BRANCHCODE'}; > } > > foreach my $res ( @newresults ) { >@@ -811,7 +809,7 @@ for (my $i=0;$i<@servers;$i++) { > my @top_loop; > my @old_loop = @{$res->{'available_items_loop'}}; > foreach my $item ( @old_loop ) { >- if ( $item->{'branchname'} eq $branchname ) { >+ if ( $item->{'branchcode'} eq $branchcode ) { > $item->{'this_branch'} = 1; > push( @top_loop, $item ); > } else { >diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl >index 9e2f613..75e76d2 100755 >--- a/opac/opac-topissues.pl >+++ b/opac/opac-topissues.pl >@@ -49,7 +49,6 @@ if ( ! C4::Context->preference('OpacTopissue') ) { > exit; > } > >-my $branches = GetBranches(); > my $itemtypes = GetItemTypes(); > > my ($template, $borrowernumber, $cookie) = get_template_and_user( >@@ -95,7 +94,7 @@ my @results = GetTopIssues($params); > > $template->param( > limit => $limit, >- branch => $branches->{$branch}->{branchname}, >+ branch => $branch, > timeLimit => $timeLimit, > results => \@results, > ); >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index ed13663..e19be8d 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -33,7 +33,6 @@ use C4::Output; > use C4::Biblio; > use C4::Items; > use C4::Letters; >-use C4::Branch; # GetBranches > use Koha::DateUtils; > use Koha::Patron::Debarments qw(IsDebarred); > use Koha::Holds; >diff --git a/patroncards/add_user_search.pl b/patroncards/add_user_search.pl >index 67fa687..331ad31 100755 >--- a/patroncards/add_user_search.pl >+++ b/patroncards/add_user_search.pl >@@ -21,7 +21,6 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth; >-use C4::Branch qw( GetBranches ); > use C4::Output; > use C4::Members; > >@@ -45,9 +44,6 @@ my $op = $input->param('op') || ''; > > my $referer = $input->referer(); > >-my $onlymine = C4::Branch::onlymine; >-my $branches = C4::Branch::GetBranches( $onlymine ); >- > my $patron_categories = Koha::Patron::Categories->search_limited; > $template->param( > view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", >@@ -56,7 +52,6 @@ $template->param( > selection_type => 'add', > alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), > categories => $patron_categories, >- branches => [ map { { branchcode => $_->{branchcode}, branchname => $_->{branchname} } } values %$branches ], > aaSorting => 1, > ); > output_html_with_http_headers( $input, $cookie, $template->output ); >diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl >index 8fd8067..a4f2e24 100755 >--- a/reports/acquisitions_stats.pl >+++ b/reports/acquisitions_stats.pl >@@ -26,9 +26,9 @@ use C4::Reports; > use C4::Output; > use C4::Koha; > use C4::Circulation; >-use C4::Branch; > use C4::Biblio; > use Koha::DateUtils; >+use Koha::Libraries; > > =head1 NAME > >@@ -185,11 +185,7 @@ else { > > my $CGIsepChoice = GetDelimiterChoices; > >- my $branches = GetBranches; >- my @branches; >- foreach ( sort keys %$branches ) { >- push @branches, $branches->{$_}; >- } >+ my @branches = Koha::Libraries->search({}, { order_by => 'branchname' }); > > my $ccode_subfield_structure = GetMarcSubfieldStructureFromKohaField('items.ccode', ''); > my $ccode_label; >diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl >index 5d1ec65..438a190 100755 >--- a/reports/borrowers_stats.pl >+++ b/reports/borrowers_stats.pl >@@ -23,7 +23,6 @@ use List::MoreUtils qw/uniq/; > > use C4::Auth; > use C4::Context; >-use C4::Branch; # GetBranches > use C4::Koha; > use Koha::DateUtils; > use C4::Acquisition; >@@ -32,6 +31,7 @@ use C4::Reports; > use C4::Circulation; > use C4::Members::AttributeTypes; > >+use Koha::Libraries; > use Koha::Patron::Categories; > > use Date::Calc qw( >@@ -228,9 +228,10 @@ sub calculate { > } > } > >+ my @branchcodes = map { $_->branchcode } Koha::Libraries->search; > ($status ) and push @loopfilter,{crit=>"Status", filter=>$status }; > ($activity) and push @loopfilter,{crit=>"Activity",filter=>$activity}; >- push @loopfilter,{debug=>1, crit=>"Branches",filter=>join(" ", sort keys %$branches)}; >+ push @loopfilter,{debug=>1, crit=>"Branches",filter=>join(" ", sort @branchcodes)}; > push @loopfilter,{debug=>1, crit=>"(line, column)", filter=>"($line,$column)"}; > # year of activity > my ( $period_year, $period_month, $period_day )=Add_Delta_YM( Today(),-$period, 0); >diff --git a/reports/issues_avg_stats.pl b/reports/issues_avg_stats.pl >index cf2686a..4274f16 100755 >--- a/reports/issues_avg_stats.pl >+++ b/reports/issues_avg_stats.pl >@@ -23,7 +23,6 @@ use strict; > use C4::Auth; > use CGI qw ( -utf8 ); > use C4::Context; >-use C4::Branch; # GetBranches > use C4::Output; > use C4::Koha; > use C4::Circulation; >diff --git a/reports/issues_by_borrower_category.plugin b/reports/issues_by_borrower_category.plugin >index 27d837c..1c2d1d1 100755 >--- a/reports/issues_by_borrower_category.plugin >+++ b/reports/issues_by_borrower_category.plugin >@@ -27,8 +27,6 @@ use C4::Output; > use C4::Koha; > use C4::Members; > >-use C4::Branch; # GetBranches >- > use Koha::Patron::Categories; > > =head1 NAME >diff --git a/reserve/request.pl b/reserve/request.pl >index b1607ce..0b0297a 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -28,7 +28,6 @@ script to place reserves/requests > > use strict; > use warnings; >-use C4::Branch; > use CGI qw ( -utf8 ); > use List::MoreUtils qw/uniq/; > use Date::Calc qw/Date_to_Days/; >@@ -64,8 +63,6 @@ my $multihold = $input->param('multi_hold'); > $template->param(multi_hold => $multihold); > my $showallitems = $input->param('showallitems'); > >-# get Branches and Itemtypes >-my $branches = GetBranches(); > my $itemtypes = GetItemTypes(); > > # Select borrowers infos >@@ -347,13 +344,12 @@ foreach my $biblionumber (@biblionumbers) { > > $item->{itypename} = $itemtypes->{ $item->{itype} }{description}; > $item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} ); >- $item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname}; >+ $item->{homebranch} = $item->{homebranch}; > > # if the holdingbranch is different than the homebranch, we show the > # holdingbranch of the document too > if ( $item->{homebranch} ne $item->{holdingbranch} ) { >- $item->{holdingbranchname} = >- $branches->{ $item->{holdingbranch} }{branchname}; >+ $item->{holdingbranch} = $item->{holdingbranch}; > } > > if($item->{biblionumber} ne $biblionumber){ >@@ -379,7 +375,7 @@ foreach my $biblionumber (@biblionumbers) { > $item->{ReservedForBorrowernumber} = $reservedfor; > $item->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; > $item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; >- $item->{ExpectedAtLibrary} = $branches->{$expectedAt}{branchname}; >+ $item->{ExpectedAtLibrary} = $expectedAt; > $item->{waitingdate} = $wait; > } > >@@ -411,9 +407,8 @@ foreach my $biblionumber (@biblionumbers) { > > if ( defined $transfertwhen && $transfertwhen ne '' ) { > $item->{transfertwhen} = output_pref({ dt => dt_from_string( $transfertwhen ), dateonly => 1 }); >- $item->{transfertfrom} = >- $branches->{$transfertfrom}{branchname}; >- $item->{transfertto} = $branches->{$transfertto}{branchname}; >+ $item->{transfertfrom} = $transfertfrom; >+ $item->{transfertto} = $transfertto; > $item->{nocancel} = 1; > } > >@@ -589,10 +584,7 @@ foreach my $biblionumber (@biblionumbers) { > C4::Search::enabled_staff_search_views, > ); > if (defined $borrowerinfo && exists $borrowerinfo->{'branchcode'}) { >- $template->param( >- borrower_branchname => $branches->{$borrowerinfo->{'branchcode'}}->{'branchname'}, >- borrower_branchcode => $borrowerinfo->{'branchcode'}, >- ); >+ $template->param( borrower_branchcode => $borrowerinfo->{'branchcode'},); > } > > $biblioloopiter{biblionumber} = $biblionumber; >diff --git a/rotating_collections/transferCollection.pl b/rotating_collections/transferCollection.pl >index fc29a4b..49b09b3 100755 >--- a/rotating_collections/transferCollection.pl >+++ b/rotating_collections/transferCollection.pl >@@ -22,7 +22,6 @@ use C4::Output; > use C4::Auth; > use C4::Context; > use C4::RotatingCollections; >-use C4::Branch; > > use CGI qw ( -utf8 ); > >@@ -60,17 +59,6 @@ if ($toBranch) { > } > } > >-## Set up the toBranch select options >-my $branches = GetBranches(); >-my @branchoptionloop; >-foreach my $br ( keys %$branches ) { >- my %branch; >- $branch{code} = $br; >- $branch{name} = $branches->{$br}->{'branchname'}; >- push( @branchoptionloop, \%branch ); >-} >-@branchoptionloop = sort {$a->{name} cmp $b->{name}} @branchoptionloop; >- > ## Get data about collection > my ( $colTitle, $colDesc, $colBranchcode ); > ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection($colId); >@@ -79,7 +67,6 @@ $template->param( > colTitle => $colTitle, > colDesc => $colDesc, > colBranchcode => $colBranchcode, >- branchoptionloop => \@branchoptionloop > ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/serials/add_user_search.pl b/serials/add_user_search.pl >index 6441a78..6cb177a 100755 >--- a/serials/add_user_search.pl >+++ b/serials/add_user_search.pl >@@ -21,7 +21,6 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth; >-use C4::Branch qw( GetBranches ); > use C4::Output; > use C4::Members; > >@@ -45,10 +44,7 @@ my $op = $input->param('op') || ''; > > my $referer = $input->referer(); > >-my $onlymine = C4::Branch::onlymine; >-my $branches = C4::Branch::GetBranches( $onlymine ); > my $patron_categories = Koha::Patron::Categories->search_limited; >- > $template->param( > view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", > columns => ['cardnumber', 'name', 'branch', 'action'], >@@ -56,7 +52,6 @@ $template->param( > selection_type => 'add', > alphabet => ( C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ), > categories => $patron_categories, >- branches => [ map { { branchcode => $_->{branchcode}, branchname => $_->{branchname} } } values %$branches ], > aaSorting => 1, > ); > output_html_with_http_headers( $input, $cookie, $template->output ); >diff --git a/serials/serials-search.pl b/serials/serials-search.pl >index afa24b1..30bf7db 100755 >--- a/serials/serials-search.pl >+++ b/serials/serials-search.pl >@@ -31,7 +31,6 @@ this script is the search page for serials > use Modern::Perl; > use CGI qw ( -utf8 ); > use C4::Auth; >-use C4::Branch; > use C4::Context; > use C4::Koha qw( GetAuthorisedValues ); > use C4::Output; >@@ -131,19 +130,6 @@ for my $sub ( @subscriptions ) { > } > } > >-my $branches = GetBranches(); >-my @branches_loop; >-foreach (sort keys %$branches){ >- my $selected = 0; >- $selected = 1 if( defined $branch and $branch eq $_ ); >- push @branches_loop, { >- branchcode => $_, >- branchname => $branches->{$_}->{'branchname'}, >- selected => $selected, >- }; >-} >- >- > $template->param( > openedsubscriptions => \@openedsubscriptions, > closedsubscriptions => \@closedsubscriptions, >@@ -157,7 +143,6 @@ $template->param( > branch_filter => $branch, > location_filter => $location, > expiration_date_filter => $expiration_date_dt, >- branches_loop => \@branches_loop, > done_searched => $searched, > routing => $routing, > additional_field_filters => $additional_field_filters, >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 31a6b6b..43815bb 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -26,7 +26,6 @@ use C4::Auth; > use C4::Acquisition; > use C4::Output; > use C4::Context; >-use C4::Branch; # GetBranches > use C4::Serials; > use C4::Serials::Frequency; > use C4::Serials::Numberpattern; >@@ -126,29 +125,10 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { > > } > >-my $onlymine = >- C4::Context->preference('IndependentBranches') >- && C4::Context->userenv >- && !C4::Context->IsSuperLibrarian >- && ( >- not C4::Auth::haspermission( C4::Context->userenv->{id}, { serials => 'superserials' } ) >- ) >- && C4::Context->userenv->{branch}; >-my $branches = GetBranches($onlymine); >-my $branchloop; >-for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %{$branches}) { >- my $selected = 0; >- $selected = 1 if (defined($subs) && $thisbranch eq $subs->{'branchcode'}); >- push @{$branchloop}, { >- value => $thisbranch, >- selected => $selected, >- branchname => $branches->{$thisbranch}->{'branchname'}, >- }; >-} >- > my $locations_loop = GetAuthorisedValues("LOC"); > >-$template->param(branchloop => $branchloop, >+$template->param( >+ branchcode => $subs->{branchcode}, > locations_loop=>$locations_loop, > ); > >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 01d77a2..472ab64 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -25,7 +25,6 @@ use C4::Auth; # get_template_and_user > use C4::Output; > use C4::Suggestions; > use C4::Koha; #GetItemTypes >-use C4::Branch; > use C4::Budgets; > use C4::Search; > use C4::Members; >@@ -61,7 +60,7 @@ sub GetCriteriumDesc{ > } > return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i); > } >- return Koha::Libraries->find($criteriumvalue)->branchname; >+ 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/){ >@@ -299,31 +298,11 @@ if(defined($returnsuggested) and $returnsuggested ne "noone") > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=".$returnsuggested."#suggestions"); > } > >-#################### >-## Initializing selection lists >- >-#branch display management >-my $branchfilter = ($displayby ne "branchcode") ? $input->param('branchcode') : ''; >-my $onlymine = >- C4::Context->preference('IndependentBranches') >- && C4::Context->userenv >- && !C4::Context->IsSuperLibrarian() >- && C4::Context->userenv->{branch}; >-my $branches = GetBranches($onlymine); >-my @branchloop; >- >-foreach my $thisbranch ( sort {$branches->{$a}->{'branchname'} cmp $branches->{$b}->{'branchname'}} keys %$branches ) { >- my %row = ( >- value => $thisbranch, >- branchname => $branches->{$thisbranch}->{'branchname'}, >- selected => ($branchfilter and $branches->{$thisbranch}->{'branchcode'} eq $branchfilter ) || ( $$suggestion_ref{'branchcode'} and $branches->{$thisbranch}->{'branchcode'} eq $$suggestion_ref{'branchcode'} ) >- ); >- push @branchloop, \%row; >-} >-$branchfilter=C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter); >+my $branchfilter = ($displayby ne "branchcode") ? $input->param('branchcode') : C4::Context->userenv->{'branch'}; > >-$template->param( branchloop => \@branchloop, >- branchfilter => $branchfilter); >+$template->param( >+ branchfilter => $branchfilter, >+); > > $template->param( returnsuggestedby => $returnsuggestedby ); > >diff --git a/svc/cataloguing/framework b/svc/cataloguing/framework >index 49d341d..b0099e8 100755 >--- a/svc/cataloguing/framework >+++ b/svc/cataloguing/framework >@@ -3,12 +3,12 @@ > use Modern::Perl '2009'; > > use CGI; >-use C4::Branch; > use C4::ClassSource; > use C4::Context; > use C4::Biblio; > use C4::Service; > use Koha::Database; >+use Koha::Libraries; > > my ( $query, $response ) = C4::Service->init( editcatalogue => 'edit_catalogue' ); > >@@ -29,12 +29,8 @@ foreach my $tag ( sort keys %$tagslib ) { > my $schema = Koha::Database->new->schema; > my $authorised_values = {}; > >+my $branches = { map { $_->branchcode => $_->branchname } Koha::Libraries->search_filtered }; > $authorised_values->{branches} = []; >-my $onlymine=C4::Context->preference('IndependentBranches') && >- C4::Context->userenv && >- C4::Context->userenv->{flags} % 2 == 0 && >- C4::Context->userenv->{branch}; >-my $branches = GetBranches($onlymine); > foreach my $thisbranch ( sort keys %$branches ) { > push @{ $authorised_values->{branches} }, { value => $thisbranch, lib => $branches->{$thisbranch}->{'branchname'} }; > } >diff --git a/t/db_dependent/Circulation/GetIssues.t b/t/db_dependent/Circulation/GetIssues.t >index b687045..3eee5df 100644 >--- a/t/db_dependent/Circulation/GetIssues.t >+++ b/t/db_dependent/Circulation/GetIssues.t >@@ -7,9 +7,9 @@ use Test::MockModule; > use C4::Biblio; > use C4::Items; > use C4::Members; >-use C4::Branch; > use C4::Circulation; > use Koha::Library; >+use Koha::Libraries; > use Koha::Patron::Categories; > use MARC::Record; > >@@ -21,9 +21,9 @@ $dbh->do(q|DELETE FROM issues|); > > my $branchcode; > my $branch_created; >-my @branches = keys %{ GetBranches() }; >-if (@branches) { >- $branchcode = $branches[0]; >+my @libraries = Koha::Libraries->search; >+if (@libraries) { >+ $branchcode = $libraries[0]->branchcode; > } else { > $branchcode = 'B'; > Koha::Library->new({ branchcode => $branchcode, branchname => 'Branch' })->store; >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >index 7c53e97..bb5265f 100644 >--- a/t/db_dependent/Overdues.t >+++ b/t/db_dependent/Overdues.t >@@ -4,7 +4,7 @@ use Modern::Perl; > use Test::More tests => 16; > > use C4::Context; >-use C4::Branch; >+use Koha::Libraries; > use_ok('C4::Overdues'); > can_ok('C4::Overdues', 'GetOverdueMessageTransportTypes'); > can_ok('C4::Overdues', 'GetBranchcodesWithOverdueRules'); >@@ -83,8 +83,7 @@ $dbh->do(q| > ( '', '', 1, 'LETTER_CODE1', 1, 5, 'LETTER_CODE2', 1, 10, 'LETTER_CODE3', 1 ) > |); > >-my $all_branches = C4::Branch::GetBranches; >-my @branchcodes = keys %$all_branches; >+my @branchcodes = map { $_->branchcode } Koha::Libraries->search; > > my @overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules(); > is_deeply( [ sort @overdue_branches ], [ sort @branchcodes ], 'If a default rule exists, all branches should be returned' ); >diff --git a/tools/export.pl b/tools/export.pl >index 4794d05..e2ffc29 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -21,7 +21,6 @@ use CGI qw ( -utf8 ); > use MARC::File::XML; > use List::MoreUtils qw(uniq); > use C4::Auth; >-use C4::Branch; # GetBranches > use C4::Csv; > use C4::Koha; # GetItemTypes > use C4::Output; >@@ -31,6 +30,7 @@ use Koha::Biblioitems; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Exporter::Record; >+use Koha::Libraries; > > my $query = new CGI; > >@@ -68,32 +68,26 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( > ); > > my @branch = $query->multi_param("branch"); >-my $only_my_branch; >-# Limit to local branch if IndependentBranches and not superlibrarian >-if ( >- ( >- C4::Context->preference('IndependentBranches') >- && C4::Context->userenv >- && !C4::Context->IsSuperLibrarian() >- && C4::Context->userenv->{branch} >- ) >- # Limit result to local branch strip_nonlocal_items >- or $query->param('strip_nonlocal_items') >-) { >- $only_my_branch = 1; >- @branch = ( C4::Context->userenv->{'branch'} ); >-} >- >-my %branchmap = map { $_ => 1 } @branch; # for quick lookups > > if ( $op eq "export" ) { > > my $export_remove_fields = $query->param("export_remove_fields") || q||; > my @biblionumbers = $query->multi_param("biblionumbers"); > my @itemnumbers = $query->multi_param("itemnumbers"); >+ my $strip_nonlocal_items = $query->param('strip_nonlocal_items'); > my @sql_params; > my $sql_query; > >+ my $libraries = $strip_nonlocal_items >+ ? [ Koha::Libraries->find(C4::Context->userenv->{branch})->unblessed ] >+ : Koha::Libraries->search_filtered->unblessed; >+ my @branchcodes; >+ for my $branchcode ( @branch ) { >+ if ( grep { $_->{branchcode} eq $branchcode } @$libraries ) { >+ push @branchcodes, $branchcode; >+ } >+ } >+ > if ( $record_type eq 'bibs' or $record_type eq 'auths' ) { > # No need to retrieve the record_ids if we already get them > unless ( @record_ids ) { >@@ -138,7 +132,7 @@ if ( $op eq "export" ) { > } > ) > : (), >- ( @branch ? ( 'items.homebranch' => { in => \@branch } ) : () ), >+ ( @branchcodes ? ( 'items.homebranch' => { in => \@branchcodes } ) : () ), > ( $itemtype > ? > C4::Context->preference('item-level_itypes') >@@ -265,23 +259,14 @@ else { > ); > push @itemtypesloop, \%row; > } >- my $branches = GetBranches($only_my_branch); >- my @branchloop; >- for my $thisbranch ( >- sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } >- keys %{$branches} >- ) >- { >- push @branchloop, >- { >- value => $thisbranch, >- selected => %branchmap ? $branchmap{$thisbranch} : 1, >- branchname => $branches->{$thisbranch}->{'branchname'}, >- }; >- } > > my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypecode'] } ); > >+ my $libraries = Koha::Libraries->search_filtered({}, { order_by => ['branchname'] })->unblessed; >+ for my $library ( @$libraries ) { >+ $library->{selected} = 1 if grep { $library->{branchcode} eq $_ } @branch; >+ } >+ > if ( $flags->{superlibrarian} > && C4::Context->config('backup_db_via_tools') > && $backupdir >@@ -303,7 +288,7 @@ else { > } > > $template->param( >- branchloop => \@branchloop, >+ libraries => $libraries, > itemtypeloop => \@itemtypesloop, > authority_types => $authority_types, > export_remove_fields => C4::Context->preference("ExportRemoveFields"), >diff --git a/tools/holidays.pl b/tools/holidays.pl >index 4de6886..fb4272b 100755 >--- a/tools/holidays.pl >+++ b/tools/holidays.pl >@@ -24,7 +24,6 @@ use CGI qw ( -utf8 ); > use C4::Auth; > use C4::Output; > >-use C4::Branch; # GetBranches > use C4::Calendar; > use Koha::DateUtils; > >@@ -52,9 +51,6 @@ $keydate =~ s/-/\//g; > > my $branch= $input->param('branch') || C4::Context->userenv->{'branch'}; > >-# branches calculated - put branch codes in a single string so they can be passed in a form >-my $branchcodes = join '|', keys %{$branches}; >- > # Get all the holidays > > my $calendar = C4::Calendar->new(branchcode => $branch); >@@ -130,7 +126,6 @@ $template->param( > DAY_MONTH_HOLIDAYS_LOOP => \@day_month_holidays, > calendardate => $calendardate, > keydate => $keydate, >- branchcodes => $branchcodes, > branch => $branch, > ); > >diff --git a/tools/inventory.pl b/tools/inventory.pl >index 5e5a5e3..74069e5 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -32,7 +32,6 @@ use C4::Output; > use C4::Biblio; > use C4::Items; > use C4::Koha; >-use C4::Branch; # GetBranches > use C4::Circulation; > use C4::Reports::Guided; #_get_column_defs > use C4::Charset; >diff --git a/tools/koha-news.pl b/tools/koha-news.pl >index 65ea813..53b943d 100755 >--- a/tools/koha-news.pl >+++ b/tools/koha-news.pl >@@ -32,7 +32,6 @@ use C4::Output; > use C4::NewsChannels; > use C4::Languages qw(getTranslatedLanguages); > use Date::Calc qw/Date_to_Days Today/; >-use C4::Branch qw/GetBranches/; > use Koha::DateUtils; > > my $cgi = new CGI; >@@ -84,10 +83,7 @@ foreach my $language ( @$tlangs ) { > } > } > >-my $branches = GetBranches; >- > $template->param( lang_list => \@lang_list, >- branch_list => $branches, > branchcode => $branchcode ); > > my $op = $cgi->param('op') // ''; >diff --git a/tools/letter.pl b/tools/letter.pl >index 39b2aa2..2e5c037 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -46,7 +46,6 @@ use CGI qw ( -utf8 ); > use C4::Auth; > use C4::Context; > use C4::Output; >-use C4::Branch; # GetBranches > use C4::Letters; > use C4::Members::Attributes; > >diff --git a/tools/newHolidays.pl b/tools/newHolidays.pl >index eda4c1b..4776d65 100755 >--- a/tools/newHolidays.pl >+++ b/tools/newHolidays.pl >@@ -57,13 +57,12 @@ if ($end_dt){ > } > > if($allbranches) { >- my $branch; >- my @branchcodes = split(/\|/, $input->param('branchCodes')); >- foreach $branch (@branchcodes) { >- add_holiday($newoperation, $branch, $weekday, $day, $month, $year, $title, $description); >- } >+ my $libraries = Koha::Libraries->search; >+ while ( my $library = $libraries->next ) { >+ add_holiday($newoperation, $library->branchcode, $weekday, $day, $month, $year, $title, $description); >+ } > } else { >- add_holiday($newoperation, $branchcode, $weekday, $day, $month, $year, $title, $description); >+ add_holiday($newoperation, $branchcode, $weekday, $day, $month, $year, $title, $description); > } > > print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$originalbranchcode&calendardate=$calendardate"); >-- >2.8.1
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