Merge remote branch 'kc/master' into new/enh/bug_5917
[koha_gimpoz] / misc / cronjobs / longoverdue.pl
index ee0c8e9..651b9d2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #-----------------------------------
 # Copyright 2008 LibLime
 #
@@ -13,9 +13,9 @@
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #-----------------------------------
 
 =head1 NAME
@@ -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";
+}