Bug 11625 - Implement DefaultToLoggedInLibraryCircRules

This patch set 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 Administration/Circulation and fines rules
4) Note the rule set selected is for your library
5) Select "All libraries"
6) Note the rule set selected is for "All libraries"
7) Browse to Toos/Notices & slips
8) Note the notice set selected is for your library
9) Select "All libraries"
10) Not the rule set selected is for "All libraries"
11) Click "New Notice"
12) Note the Library field is set to "All libraries"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Kyle Hall 2015-04-21 11:03:27 -04:00
parent 651ba2bac3
commit 83e913f8c2

View file

@ -44,7 +44,16 @@ my ($template, $loggedinuser, $cookie)
});
my $type=$input->param('type');
my $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' );
my $branch;
if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) {
$branch = $input->param('branch') || GetBranchesCount() == 1 ? undef : C4::Branch::mybranch();
}
else {
$branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' );
}
$branch = '*' if $branch eq 'NO_LIBRARY_SET';
my $op = $input->param('op') || q{};
my $language = C4::Languages::getlanguage();