Bug Fixing : Browse shelves not displaying results
[koha.git] / reports / serials_stats.pl
index 70d4111..ff98f34 100755 (executable)
@@ -49,7 +49,7 @@ my $order      = $input->param("order");
 my $output     = $input->param("output");
 my $basename   = $input->param("basename");
 my $mime       = $input->param("MIME");
-our $sep       = $input->param("sep");
+our $sep       = $input->param("sep") || '';
 $sep = "\t" if ($sep eq 'tabulation');
 
 my ($template, $borrowernumber, $cookie)
@@ -145,7 +145,7 @@ if($do_it){
     ## We generate branchlist
     my $branches=GetBranches();
        my @branchloop;
-       foreach (keys %$branches) {
+       foreach (sort {$branches->{$a}->{'branchname'} cmp $branches->{$b}->{'branchname'}} keys %$branches) {
                my $thisbranch = ''; # FIXME: populate $thisbranch to preselect one
                my %row = (branchcode => $_,
                        selected => ($thisbranch eq $_ ? 1 : 0),
@@ -170,4 +170,4 @@ if($do_it){
         branches     => \@branchloop);
 }
 
-output_html_with_http_headers $input, $cookie, $template->output;
\ No newline at end of file
+output_html_with_http_headers $input, $cookie, $template->output;