projects
/
clearscm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/adefaria/clearscm
[clearscm.git]
/
maps
/
bin
/
stats.cgi
diff --git
a/maps/bin/stats.cgi
b/maps/bin/stats.cgi
index
b68a5dd
..
8163c41
100755
(executable)
--- a/
maps/bin/stats.cgi
+++ b/
maps/bin/stats.cgi
@@
-17,16
+17,18
@@
use strict;
use warnings;
use FindBin;
use warnings;
use FindBin;
-$0 = $FindBin::Script;
+
+local $0 = $FindBin::Script;
use lib "$FindBin::Bin/../lib";
use lib "$FindBin::Bin/../lib";
+use lib "$FindBin::Bin/../../lib";
use MAPS;
use MAPSLog;
use MAPS;
use MAPSLog;
-use MAPSUtil;
use MAPSWeb;
use MAPSWeb;
+use DateUtils;
-use CGI qw (:standard *table start_Tr end_Tr);
+use CGI qw (:standard *table start_Tr end_Tr
start_div end_div
);
use CGI::Carp 'fatalsToBrowser';
my $nbr_days = param('nbr_days');
use CGI::Carp 'fatalsToBrowser';
my $nbr_days = param('nbr_days');
@@
-36,7
+38,11
@@
my $table_name = 'stats';
$date = defined $date ? $date : Today2SQLDatetime;
$date = defined $date ? $date : Today2SQLDatetime;
-sub Body {
+sub Body($) {
+ my ($userid) = @_;
+
+ print start_div {-id => 'highlightrow'};
+
print start_table ({-align => 'center',
-id => $table_name,
-border => 0,
print start_table ({-align => 'center',
-id => $table_name,
-border => 0,
@@
-53,13
+59,17
@@
sub Body {
print th {-class => 'tablerightend'}, 'Total';
print th {-class => 'tablerightend'}, 'Total';
- my %dates = GetStats($nbr_days, $date);
+ my %dates = GetStats(
+ userid => $userid,
+ days => $nbr_days,
+ date => $date
+ );
my %totals;
for my $date (sort {$b cmp $a} (keys (%dates))) {
print start_Tr;
print td {-class => 'tablerightleftdata',
my %totals;
for my $date (sort {$b cmp $a} (keys (%dates))) {
print start_Tr;
print td {-class => 'tablerightleftdata',
- -align => 'center'}, FormatDate $date;
+ -align => 'center'}, FormatDate $date
, 1
;
my $day_total = 0;
my $day_total = 0;
@@
-90,11
+100,11
@@
sub Body {
my $grand_total = 0;
print start_Tr;
my $grand_total = 0;
print start_Tr;
- print th {-class
=> 'tablebottomlefttotal'}, 'Totals';
+ print th {-class => 'tablebottomlefttotal'}, 'Totals';
for (@Types) {
for (@Types) {
- if ($totals{$_}
eq
0) {
- print td {-class => 'tablebottomtotal'}, ' ';
+ if ($totals{$_}
==
0) {
+ print td {-class => 'tablebottomtotal'}, ' ';
} else {
print td {-class => 'tablebottomtotal',
-align => 'center'},
} else {
print td {-class => 'tablebottomtotal',
-align => 'center'},
@@
-109,6
+119,9
@@
sub Body {
print end_Tr;
print end_table;
print end_Tr;
print end_table;
+ print end_div;
+
+ return;
} # Body
# Main
} # Body
# Main
@@
-121,16
+134,18
@@
my $userid = Heading (
$table_name
);
$table_name
);
+$userid //= $ENV{USER};
+
SetContext($userid);
SetContext($userid);
-
if (!
$nbr_days) {
+
unless (
$nbr_days) {
my %options = GetUserOptions $userid;
$nbr_days = $options{Dates};
my %options = GetUserOptions $userid;
$nbr_days = $options{Dates};
-} #
if
+} #
unless
NavigationBar($userid);
NavigationBar($userid);
-Body;
+Body
($userid)
;
Footing($table_name);
Footing($table_name);