--- db2gantt.cgi 2002/12/02 17:14:48 1.26 +++ db2gantt.cgi 2003/06/26 20:36:48 1.28 @@ -10,6 +10,10 @@ my $debug = 0; +# comment out following field if you don't want links to omni reports +# or haven't installed repgen.pl +my $repgen_url="/omni/"; # URL to pages with rptgen.pl + my $width = 600; # width of bar my $height = 15; # height of bar my $use_js = 1; # use JavaScript pop-up @@ -232,14 +236,23 @@ print STDERR "bar[$col] len:$l s scale:",($len_t/$width)," size:$size px
alt:$alt\n" if ($debug); - my $html = "url(-relative=>1)."/$col\" width=\"$size\" height=\"$h\""; + my $html; + + my ($html_end, $img_end) = ("",""); + if ($repgen_url && $alt =~ m#(\d\d\d\d)/(\d\d)/(\d\d)-(\d+)#) { + $html .= ""; + $html_end .= ""; + $img_end .= " border=0"; + } + + $html .= "url(-relative=>1)."/$col\" width=\"$size\" height=\"$h\""; if ($use_js && $alt) { $html .= " onmouseover=\"T('$alt')\" onmouseout=\"T()\""; } elsif ($alt) { $html .= " alt=\"$alt\""; } - $html .= ">"; + $html .= "$img_end>$html_end"; return($html); } @@ -289,6 +302,8 @@ $last_var = $v; } } + # fix division by zero + $max_use++ if ($max_use == 0); my $h = $last_var / $max_use * $height; my $c = 255 - int (255 * $last_var / $max_use); print color_bar($len,"$c,$c,$c","$last_var concurrent jobs",1,$h+1) if ($len);