Update of /cvsroot/mantisbt/mantisbt/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5800/core
Modified Files:
html_api.php
Log Message:
fix for 0005153: Divide by 0 error in status_percentage_legend
Index: html_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/html_api.php,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- html_api.php 22 Dec 2004 20:25:55 -0000 1.145
+++ html_api.php 24 Jan 2005 14:18:42 -0000 1.146
@@ -730,32 +730,33 @@
$t_arr = explode_enum_string( config_get(
'status_enum_string' ) );
$enum_count = count( $t_arr );
- echo '<br />';
- echo '<table class="width100" cellspacing="1">';
- echo '<tr>';
- echo '<td colspan="'.$enum_count.'"><strong>'.lang_get(
'issue_status_percentage' ).'</strong></td>';
- echo '</tr>';
- echo '<tr>';
-
- for ( $i=0; $i < $enum_count; $i++) {
- $t_s = explode_enum_arr( $t_arr[$i] );
- $t_color = get_status_color( $t_s[0] );
- $t_status = $t_s[0];
+ if ( $t_bug_count > 0 ) {
+ echo '<br />';
+ echo '<table class="width100" cellspacing="1">';
+ echo '<tr>';
+ echo '<td colspan="'.$enum_count.'"><strong>'.lang_get(
'issue_status_percentage' ).'</strong></td>';
+ echo '</tr>';
+ echo '<tr>';
+ for ( $i=0; $i < $enum_count; $i++) {
+ $t_s = explode_enum_arr( $t_arr[$i] );
+ $t_color = get_status_color( $t_s[0] );
+ $t_status = $t_s[0];
- if ( !isset( $t_status_count_array[ $t_status ] ) ) {
- $t_status_count_array[ $t_status ] = 0;
- }
+ if ( !isset( $t_status_count_array[ $t_status ]
) ) {
+ $t_status_count_array[ $t_status ] = 0;
+ }
- $width = round( ( $t_status_count_array[ $t_status ] /
$t_bug_count ) * 100 );
+ $width = round( ( $t_status_count_array[
$t_status ] / $t_bug_count ) * 100 );
- if ($width > 0) {
- echo "<td class=\"small-caption-center\"
width=\"$width%\" bgcolor=\"$t_color\">$width%</td>";
+ if ($width > 0) {
+ echo "<td
class=\"small-caption-center\" width=\"$width%\"
bgcolor=\"$t_color\">$width%</td>";
+ }
}
- }
- echo '</tr>';
- echo '</table>';
+ echo '</tr>';
+ echo '</table>';
+ }
}
# --------------------
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
|