Bug 7829 - reports/ remove all exit(1) for plack
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 26 Mar 2012 14:49:12 +0000 (16:49 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 28 Mar 2012 14:25:24 +0000 (16:25 +0200)
In Bug 7772 Ian correctly noted that reports have exit(1) all over the place.
This is left over from old code, and this patch changes them to exit(0).

I decided to use plain exit as opposed to explicit exit(0) since it produces
cleaner code, but I'm welcoming suggestion on this.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
reports/acquisitions_stats.pl
reports/bor_issues_top.pl
reports/borrowers_out.pl
reports/borrowers_stats.pl
reports/cat_issues_top.pl
reports/catalogue_out.pl
reports/catalogue_stats.pl
reports/issues_avg_stats.pl
reports/issues_stats.pl
reports/reserves_stats.pl
reports/serials_stats.pl

index ad0ac3f..7207e64 100755 (executable)
@@ -108,7 +108,7 @@ if ($do_it) {
         }
         print $sep. @$results[0]->{total};
     }
-    exit(1);
+    exit;
 }
 else {
     my $dbh = C4::Context->dbh;
index 126cdef..6ad3495 100755 (executable)
@@ -102,7 +102,7 @@ if ($do_it) {
                print join($sep, map {$_->{totalcol}} @$cols);
         print $sep.@$results[0]->{total};
     }
-    exit(0);
+    exit;
 }
 
 my $dbh = C4::Context->dbh;
index 278e412..722faba 100755 (executable)
@@ -69,7 +69,7 @@ if ($do_it) {
 # Printing results to screen
         $template->param(mainloop => $results);
         output_html_with_http_headers $input, $cookie, $template->output;
-        exit(1);
+        exit;
     } else {
 # Printing to a csv file
         print $input->header(-type => 'application/vnd.sun.xml.calc',
@@ -103,7 +103,7 @@ if ($do_it) {
             print $sep.$col->{totalcol};
         }
         print $sep.@$results[0]->{total};
-        exit(1);
+        exit;
     }
 # Displaying choices
 } else {
index c17a326..9e00ea3 100755 (executable)
@@ -107,7 +107,7 @@ if ($do_it) {
                }
                print $sep.@$results[0]->{total};
        }
-       exit(1);        # exit after do_it, regardless
+       exit;   # exit after do_it, regardless
 } else {
        my $dbh = C4::Context->dbh;
        my $req;
index 606106d..2a6409d 100755 (executable)
@@ -75,7 +75,7 @@ if ($do_it) {
         $template->param(mainloop => $results,
                         limit => $limit);
         output_html_with_http_headers $input, $cookie, $template->output;
-        exit(1);
+        exit;
     } else {
 # Printing to a csv file
         print $input->header(-type => 'application/vnd.sun.xml.calc',
@@ -108,7 +108,7 @@ if ($do_it) {
             print $sep.$col->{totalcol};
         }
         print $sep.@$results[0]->{total};
-        exit(1);
+        exit;
     }
 # Displaying choices
 } else {
index 87990c1..8a22a18 100755 (executable)
@@ -96,7 +96,7 @@ if ($do_it) {
         }
         print $sep.@$results[0]->{total};
     }
-       exit(1); # in either case, exit after do_it
+    exit; # in either case, exit after do_it
 }
 
 # Displaying choices (i.e., not do_it)
index 11dff4d..c8e2194 100755 (executable)
@@ -74,7 +74,7 @@ if ($do_it) {
        if ($output eq "screen"){
                $template->param(mainloop => $results);
                output_html_with_http_headers $input, $cookie, $template->output;
-               exit(1);
+               exit;
        } else {
                print $input->header(-type => 'application/vnd.sun.xml.calc',
                                      -encoding    => 'utf-8',
@@ -102,7 +102,7 @@ if ($do_it) {
                        print $sep.$col->{totalcol};
                }
                print $sep.@$results[0]->{total};
-               exit(1);
+               exit;
        }
 } else {
        my $dbh = C4::Context->dbh;
index c6a3859..372f3c0 100755 (executable)
@@ -77,7 +77,7 @@ if ($do_it) {
 # Printing results to screen
         $template->param(mainloop => $results);
         output_html_with_http_headers $input, $cookie, $template->output;
-        exit(1);
+        exit;
     } else {
 # Printing to a csv file
         print $input->header(-type => 'application/vnd.sun.xml.calc',
@@ -110,7 +110,7 @@ if ($do_it) {
             print $sep.$col->{totalcol};
         }
         print $sep.@$results[0]->{total};
-        exit(1);
+        exit;
     }
 # Displaying choices
 } else {
index 2f8a7e3..4b6aa42 100755 (executable)
@@ -123,7 +123,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;
index a2b3737..c20a676 100755 (executable)
@@ -130,7 +130,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;
index 88918cc..ff80b2f 100755 (executable)
@@ -125,7 +125,7 @@ if($do_it){
             print $item->{startdate}.$sep;
             print $item->{enddate}."\n";
         }
-        exit(1);
+        exit;
     }
 }else{
     ## We generate booksellers list