Bug 37775: Spelling and tidy
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
dba9dd4053
commit
d785fb1c1e
1 changed files with 17 additions and 22 deletions
|
@ -52,7 +52,7 @@ my $incremental = 0;
|
|||
my $progress = 100;
|
||||
my $unit;
|
||||
|
||||
my $command_line_options = join(" ",@ARGV);
|
||||
my $command_line_options = join( " ", @ARGV );
|
||||
|
||||
my $result = GetOptions(
|
||||
'v|verbose' => \$verbose,
|
||||
|
@ -74,8 +74,7 @@ if ( defined $since && defined $interval ) {
|
|||
}
|
||||
|
||||
if ( $useitems && $incremental ) {
|
||||
print
|
||||
"The --use-items and --incremental options are mutually exclusive.\n\n";
|
||||
print "The --use-items and --incremental options are mutually exclusive.\n\n";
|
||||
$want_help = 1;
|
||||
}
|
||||
|
||||
|
@ -90,7 +89,7 @@ unless ( $usestats || $useitems ) {
|
|||
|
||||
usage() if $want_help;
|
||||
|
||||
cronlogaction({ info => $command_line_options });
|
||||
cronlogaction( { info => $command_line_options } );
|
||||
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
|
@ -105,13 +104,12 @@ process_stats() if $usestats;
|
|||
|
||||
report();
|
||||
|
||||
cronlogaction({ action => 'End', info => "COMPLETED" });
|
||||
cronlogaction( { action => 'End', info => "COMPLETED" } );
|
||||
|
||||
exit 0;
|
||||
|
||||
sub process_items {
|
||||
my $query =
|
||||
"SELECT items.biblionumber, SUM(items.issues) FROM items GROUP BY items.biblionumber;";
|
||||
my $query = "SELECT items.biblionumber, SUM(items.issues) FROM items GROUP BY items.biblionumber;";
|
||||
process_query($query);
|
||||
}
|
||||
|
||||
|
@ -129,14 +127,12 @@ sub process_stats {
|
|||
|
||||
$interval =~ m/([0-9]*)([hdwmy]?)$/;
|
||||
$unit = $2 || 'd';
|
||||
$since = DateTime::Format::MySQL->format_datetime(
|
||||
$dt->subtract( $units{$unit} => $1 ) );
|
||||
$since = DateTime::Format::MySQL->format_datetime( $dt->subtract( $units{$unit} => $1 ) );
|
||||
}
|
||||
my $limit = '';
|
||||
$limit = " WHERE statistics.datetime >= ?" if ( $interval || $since );
|
||||
|
||||
my $query =
|
||||
"SELECT biblio.biblionumber, COUNT(statistics.itemnumber) FROM biblio\
|
||||
my $query = "SELECT biblio.biblionumber, COUNT(statistics.itemnumber) FROM biblio\
|
||||
LEFT JOIN items ON (biblio.biblionumber=items.biblionumber)\
|
||||
LEFT JOIN statistics ON (items.itemnumber=statistics.itemnumber AND statistics.type = 'issue')
|
||||
$limit\
|
||||
|
@ -152,8 +148,7 @@ sub process_query {
|
|||
|
||||
if ( $since && $uselimit ) {
|
||||
$sth->execute($since);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sth->execute();
|
||||
}
|
||||
|
||||
|
@ -269,7 +264,7 @@ processing the last twenty-four hours.
|
|||
|
||||
=item B<--progress=N>
|
||||
|
||||
Print the progress to standart output after every N records are processed.
|
||||
Print the progress to standard output after every N records are processed.
|
||||
|
||||
=item B<--test>
|
||||
|
||||
|
|
Loading…
Reference in a new issue