Bug Fixing : export would export no biblios when
[koha.git] / tools / holidays.pl
index 21e791c..6cc26fa 100755 (executable)
@@ -27,10 +27,6 @@ use C4::Calendar;
 
 my $input = new CGI;
 
-my $branch=C4::Context->preference('defaultbranch') || $input->param('branch');
-
-
-
 my $dbh = C4::Context->dbh();
 # Get the template to use
 my ($template, $loggedinuser, $cookie)
@@ -42,12 +38,13 @@ my ($template, $loggedinuser, $cookie)
                              debug => 1,
                            });
 
+my $branch= $input->param('branch') || C4::Context->userenv->{'branch'};
 # Set all the branches.
 my $onlymine=(C4::Context->preference('IndependantBranches') &&
               C4::Context->userenv &&
               C4::Context->userenv->{flags} !=1  &&
               C4::Context->userenv->{branch}?1:0);
-if ( C4::Context->preference("IndependantBranches") ) { 
+if ( $onlymine ) { 
     $branch = C4::Context->userenv->{'branch'};
 }
 my $branches = GetBranches($onlymine);