[Koha-patches] [PATCH] smart-rules load users library instead of default

Michael Hafen mdhafen at tech.washk12.org
Tue Sep 1 19:18:05 CEST 2009


If the user isn't a super librarian load their library by default instead of
the default settings.

This would eliminate some confusion amoung my librarians.
---
 admin/smart-rules.pl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl
index 40e9084..6086636 100755
--- a/admin/smart-rules.pl
+++ b/admin/smart-rules.pl
@@ -29,10 +29,6 @@ use C4::Branch; # GetBranches
 my $input = new CGI;
 my $dbh = C4::Context->dbh;
 
-my $type=$input->param('type');
-my $branch = $input->param('branch') || '*';
-my $op = $input->param('op');
-
 # my $flagsrequired;
 # $flagsrequired->{circulation}=1;
 my ($template, $loggedinuser, $cookie)
@@ -44,6 +40,10 @@ my ($template, $loggedinuser, $cookie)
                             debug => 1,
                             });
 
+my $type=$input->param('type');
+my $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' );
+my $op = $input->param('op');
+
 if ($op eq 'delete') {
     my $itemtype     = $input->param('itemtype');
     my $categorycode = $input->param('categorycode');
-- 
1.6.0.4




More information about the Koha-patches mailing list