Merge remote branch 'kc/new/pending_qa/enh/bug_3644' into kcmaster
[koha_gimpoz] / misc / cronjobs / longoverdue.pl
index 5560c94..651b9d2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #-----------------------------------
 # Copyright 2008 LibLime
 #
@@ -39,7 +39,7 @@ use C4::Accounts;
 use Getopt::Long;
 
 my  $lost;  #  key=lost value,  value=num days.
-my ($charge, $verbose, $confirm);
+my ($charge, $verbose, $confirm, $quiet);
 my $endrange = 366;  # FIXME hardcoded - don't deal with anything overdue by more than this num days.
 
 GetOptions( 
@@ -47,6 +47,7 @@ GetOptions(
     'c|charge=s' => \$charge,
     'confirm'    => \$confirm,
     'verbose'    => \$verbose,
+    'quiet'      => \$quiet,
 );
 
 my $usage = << 'ENDUSAGE';
@@ -81,7 +82,7 @@ WARNING:  Flippant use of this script could set all or most of the items in your
 patrons for them!
 
 WARNING:  This script is known to be faulty.  It is NOT recommended to use multiple --lost options.
-          See http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=2881
+          See http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2883
 
 ENDUSAGE
 
@@ -184,6 +185,8 @@ sub summarize ($$) {
     }
 }
 
-print "\n### LONGOVERDUE SUMMARY ###";
-summarize (\@report, 1);
-print "\nTOTAL: $total items\n";
+if (!$quiet){
+    print "\n### LONGOVERDUE SUMMARY ###";
+    summarize (\@report, 1);
+    print "\nTOTAL: $total items\n";
+}