--- db2gantt.cgi 2002/12/02 14:35:17 1.25 +++ db2gantt.cgi 2002/12/02 17:14:48 1.26 @@ -36,7 +36,6 @@ #--- no user servicable parts below this line -my $dbh = DBI->connect("DBI:Pg:dbname=gantt","","") || die $DBI::errstr; my $q=new CGI; my ($from_t,$to_t) = (time()-$int_t,time()); @@ -90,6 +89,9 @@ exit; } +# open DBI connection +my $dbh = DBI->connect("DBI:Pg:dbname=gantt","","") || die $DBI::errstr; + print "Content-type: text/html Cache-Control: max-age=60, must-revalidate @@ -251,6 +253,7 @@ "; my $sth = $dbh->prepare($sql) || die "sql: $sql ".$dbh->errstr; +print STDERR "sql: $sql\n" if ($debug); my %spec; # specification hash @@ -335,7 +338,10 @@ # init vars for next line ($fix_s,$fix_d) = (0,0); # init fix vars for bar - html_spec if ($curr_spec ne ""); + if ($curr_spec ne "") { + $curr_spec =~ s/ +/ /g; + html_spec; + } $curr_t = $from_t; # init timeline $curr_spec = $row->{specification}; @@ -428,10 +434,15 @@ # label and usage -$len_t = 50; # disable bar scaling print "
\nColors for statuses and usage (#):\n"; print "\n"; +my $max = 0; +foreach my $status (keys %count) { + $max = $count{$status} if ($count{$status} > $max); +} +$len_t = $max ; # disable bar scaling + foreach my $status (keys %count) { #foreach my $status (keys %cols) { print "\n" if ($status ne ""); @@ -441,4 +452,3 @@ # then display number (wrongly). } print "
status#color
$status",$count{$status}*1,"",bar($count{$status},$status),"
\n

Reload url(-relative=>1),"\">current or see help.

"; -