Bug 8435: (follow-up) prevent t/00-load.t failing
[koha.git] / reports / issues_stats.pl
index ea87aa2..ddc3740 100755 (executable)
@@ -72,7 +72,6 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({
 our $sep     = $input->param("sep");
 $sep = "\t" if ($sep eq 'tabulation');
 $template->param(do_it => $do_it,
-       DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
 );
 
 my $itemtypes = GetItemTypes();
@@ -123,7 +122,7 @@ if ($do_it) {
                print map {$sep.$_->{totalcol}} @$cols;
         print $sep.@$results[0]->{total};
        }
-       exit(1); # exit either way after $do_it
+       exit; # exit either way after $do_it
 }
 
 my $dbh = C4::Context->dbh;
@@ -187,7 +186,7 @@ sub calculate {
 # Checking filters
 #
        my @loopfilter;
-       for (my $i=0;$i<=10;$i++) {
+       for (my $i=0;$i<=12;$i++) {
                my %cell;
                (@$filters[$i]) or next;
         if (($i==1) and (@$filters[$i-1])) {
@@ -211,8 +210,8 @@ sub calculate {
           : ( $i == 8 )  ? "Item callnumber <"
           : ( $i == 9 )  ? "sort1 ="
           : ( $i == 10 ) ? "sort2 ="
-          : ( $i == 11 ) ? "Home branch ="
-          : ( $i == 12 )? "Holding branch ="
+          : ( $i == 11 ) ? "Home library ="
+          : ( $i == 12 )? "Holding library ="
           :                "UNKNOWN FILTER ($i)";
 
                # FIXME - no translation mechanism !
@@ -231,7 +230,7 @@ sub calculate {
            ( $line =~ /datetime/ ) ? @$filters[0]
       : ( $line =~ /category/ ) ? @$filters[2]
       : ( $line =~ /itemtype/ ) ? @$filters[3]
-      : ( $line =~ /branch/ )   ? @$filters[4]
+      : ( $line =~ /^branch/ )   ? @$filters[4]
       : ( $line =~ /ccode/ )    ? @$filters[5]
       : ( $line =~ /location/ ) ? @$filters[6]
       : ( $line =~ /sort1/ )    ? @$filters[9]
@@ -250,7 +249,7 @@ sub calculate {
         ( $column =~ /datetime/ ) ? @$filters[0]
       : ( $column =~ /category/ ) ? @$filters[2]
       : ( $column =~ /itemtype/ ) ? @$filters[3]
-      : ( $column =~ /branch/ )   ? @$filters[4]
+      : ( $column =~ /^branch/ )   ? @$filters[4]
       : ( $column =~ /ccode/ )    ? @$filters[5]
       : ( $column =~ /location/ ) ? @$filters[6]
       : ( $column =~ /sort1/ )    ? @$filters[9]