bugfixing holidays.pl
authorPaul POULAIN <paul.poulain@biblibre.com>
Fri, 29 Feb 2008 17:09:49 +0000 (06:09 +1300)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 29 Feb 2008 17:59:36 +0000 (11:59 -0600)
+ let the superlibrarians choose their branch even if IndepBranches is ON

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
tools/holidays.pl

index 9f81511..9dd93f0 100755 (executable)
@@ -114,8 +114,9 @@ foreach my $yearMonthDay (keys %$single_holidays) {
 
 # Replace the template values with the real ones
 # If we have independent branches on we need to only let the user set holidays for their branch
-if ( C4::Context->preference("IndependantBranches") ) { 
-       $template->param(BRANCHES => C4::Context->userenv->{'branchname'});             
+# (except if the user is superlibrarian, in which case he can choose the branch anyway)
+if ( C4::Context->preference("IndependantBranches") && !(C4::Context->userenv->{'flags'} % 2) ) { 
+       $template->param(BRANCHES => C4::Context->userenv->{'branchname'}."<input type='hidden' id='branch' value='".C4::Context->userenv->{'branch'}."'>");
 }
 else {
        $template->param(BRANCHES => $branchesList);