logo       

mantisbt/core html_api.php,1.145,1.146: msg#00036

Subject: mantisbt/core html_api.php,1.145,1.146
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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe