From 9b284c224ff1f04604217f6943e39ebd45fe5e90 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 22 Apr 2015 11:21:53 -0400 Subject: [PATCH] Bug 11747 [QA Followup] - Use system preference Signed-off-by: Jonathan Druart --- tools/overduerules.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/overduerules.pl b/tools/overduerules.pl index b844a9a..c745861 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -72,12 +72,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $type = $input->param('type'); -my $branch = - defined( $input->param('branch') ) ? $input->param('branch') - : GetBranchesCount() == 1 ? undef - : C4::Branch::mybranch(); -$branch = q{} if $branch eq 'NO_LIBRARY_SET'; +my $branch = $input->param('branch'); +$branch = + defined $branch ? $branch + : C4::Context->preference('DefaultToLoggedInLibraryOverdueTriggers') ? C4::Branch::mybranch() + : GetBranchesCount() == 1 ? undef + : undef; $branch ||= q{}; +$branch = q{} if $branch eq 'NO_LIBRARY_SET'; my $op = $input->param('op'); $op ||= q{}; -- 2.1.0