From 165c946a1c5eb48af8c04b7705a3fb483bc0717e 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 1a90401..fb08daf 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -43,7 +43,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 9de95fb..23d8a25 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -109,6 +109,7 @@ my $op = $input->param('op') || ''; our $branchcode = $input->param('branchcode') eq '*' ? undef : $input->param('branchcode') ? $input->param('branchcode') + : GetBranchesCount() == 1 ? undef : $op ? $input->param('branchcode') : C4::Branch::mybranch(); -- 1.7.2.5