From adbf9409ccc6a70ff24fa8b4a2ec9cfb0fb84ae3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 5 Mar 2014 07:49:05 -0500 Subject: [PATCH] Bug 11625 [QA Followup 2] - Don't default to branch specific rules if only one branch exists --- admin/smart-rules.pl | 2 +- tools/letter.pl | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index e86dd5a..bb48a66 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -44,7 +44,7 @@ my ($template, $loggedinuser, $cookie) }); my $type=$input->param('type'); -my $branch = $input->param('branch') || C4::Branch::mybranch(); +my $branch = $input->param('branch') || GetBranchesCount() == 1 ? undef : C4::Branch::mybranch(); $branch = '*' if $branch eq 'NO_LIBRARY_SET'; my $op = $input->param('op') || q{}; diff --git a/tools/letter.pl b/tools/letter.pl index 7ad55cf..86487ba 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -83,6 +83,7 @@ our $branchcode = $input->param('branchcode') eq '*' ? undef : $input->param('branchcode') ? $input->param('branchcode') : $op ? $input->param('branchcode') + : GetBranchesCount() == 1 ? undef : C4::Branch::mybranch(); my $dbh = C4::Context->dbh; -- 1.7.2.5