Followup updating translation process
[koha.git] / circ / branchtransfers.pl
index 36f4da3..85ad30e 100755 (executable)
@@ -40,8 +40,9 @@ my $query = new CGI;
 
 if (!C4::Context->userenv){
        my $sessionID = $query->cookie("CGISESSID");
-       my $session = get_session($sessionID);
-       if ($session->param('branch') eq 'NO_LIBRARY_SET'){
+        my $session;
+       $session = get_session($sessionID) if $sessionID;
+       if (!$session or $session->param('branch') eq 'NO_LIBRARY_SET'){
                # no branch set we can't transfer
                print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
                exit;
@@ -59,7 +60,7 @@ my $user;
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { circulate => 1 },
+        flagsrequired   => { circulate => "circulate_remaining_permissions" },
     }
 );
 
@@ -105,7 +106,7 @@ if ( $request eq 'KillReserved' ) {
 
 # set up the branchselect options....
 my @branchoptionloop;
-foreach my $br ( keys %$branches ) {
+foreach my $br (sort {$branches->{$a}->{branchname} cmp $branches->{$b}->{branchname}} keys %$branches ) {
     my %branch;
     $branch{selected} = ( $br eq $tobranchcd );
     $branch{code}     = $br;