From d7e76f99749dc6ff6e3f66d350494ff9619f3461 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 15 Jan 2016 09:35:26 +0000 Subject: [PATCH] Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount Fix conflict with bug 11625 --- admin/smart-rules.pl | 3 ++- tools/overduerules.pl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 9c903da..ff8c67a 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -30,6 +30,7 @@ use Koha::DateUtils; use Koha::Database; use Koha::IssuingRule; use Koha::IssuingRules; +use Koha::Libraries; my $input = CGI->new; my $dbh = C4::Context->dbh; @@ -49,7 +50,7 @@ my $type=$input->param('type'); my $branch; if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { - $branch = $input->param('branch') || GetBranchesCount() == 1 ? undef : C4::Branch::mybranch(); + $branch = $input->param('branch') || Koha::Libraries->search->count() == 1 ? undef : C4::Branch::mybranch(); } else { $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' ); diff --git a/tools/overduerules.pl b/tools/overduerules.pl index 5657b19..369ac9c 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -28,6 +28,7 @@ use C4::Branch; use C4::Letters; use C4::Members; use C4::Overdues; +use Koha::Libraries; our $input = new CGI; my $dbh = C4::Context->dbh; @@ -76,7 +77,7 @@ my $branch = $input->param('branch'); $branch = defined $branch ? $branch : C4::Context->preference('DefaultToLoggedInLibraryOverdueTriggers') ? C4::Branch::mybranch() - : GetBranchesCount() == 1 ? undef + : Koha::Libraries->search->count() == 1 ? undef : undef; $branch ||= q{}; $branch = q{} if $branch eq 'NO_LIBRARY_SET'; -- 2.1.0