From 3f7f19a191386770d3fe5a0d12546e778a67c0ed Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 12 Feb 2014 08:00:14 -0500 Subject: [PATCH] Bug 11747 - Default to logged in library for Overdue notice/status triggers 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 --- tools/overduerules.pl | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/overduerules.pl b/tools/overduerules.pl index cc90d0b..b11c4d7 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -58,20 +58,27 @@ 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.tmpl", + 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') + : 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.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { tools => 'edit_notice_status_triggers'}, - debug => 1, - }); my $err=0; # save the values entered into tables -- 1.7.2.5