From 6656856d87b136a55614a22e6a1f69214ec53126 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 21 Apr 2015 11:19:24 -0400 Subject: [PATCH] Bug 11747 - Implement DefaultToLoggedInLibraryOverdueTriggers This patch makes the default circ rules and notices/slips to edit the logged in branch, if one is set. Test Plan: 1) Apply this patch 2) Log into staff side, and set your library 3) Browse to Tools/Overdue notice/status triggers 4) Note the actions displayed are for your library 5) Select "All libraries" 6) Note the actions displayed are for "All libraries" Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- tools/overduerules.pl | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tools/overduerules.pl b/tools/overduerules.pl index 463c73e1a7..b844a9a28e 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -59,20 +59,29 @@ sub blank_row { return 1; } -my $type=$input->param('type'); -my $branch = $input->param('branch'); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "tools/overduerules.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { tools => 'edit_notice_status_triggers' }, + debug => 1, + } +); + +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'; $branch ||= q{}; + my $op = $input->param('op'); $op ||= q{}; -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "tools/overduerules.tt", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { tools => 'edit_notice_status_triggers'}, - debug => 1, - }); my $err=0; # save the values entered into tables -- 2.39.5