. # -------------------------------------------------------- # $Id: summary_page.php,v 1.54.2.1 2007-10-13 22:34:43 giallu Exp $ # -------------------------------------------------------- ?> 1'; } elseif ( 1 == count( $t_project_ids ) ) { $specific_where = ' project_id=' . $t_project_ids[0]; } else { $specific_where = ' project_id IN (' . join( ',', $t_project_ids ) . ')'; } # end @@@ block $t_bug_table = config_get( 'mantis_bug_table' ); $t_history_table = config_get( 'mantis_bug_history_table' ); $t_resolved = config_get( 'bug_resolved_status_threshold' ); # the issue may have passed through the status we consider resolved # (e.g., bug is CLOSED, not RESOLVED). The linkage to the history field # will look up the most recent 'resolved' status change and return it as well $query = "SELECT b.id, b.date_submitted, b.last_updated, MAX(h.date_modified) as hist_update, b.status FROM $t_bug_table b LEFT JOIN $t_history_table h ON b.id = h.bug_id AND h.type=0 AND h.field_name='status' AND h.new_value='$t_resolved' WHERE b.status >='$t_resolved' AND $specific_where GROUP BY b.id, b.status, b.date_submitted, b.last_updated ORDER BY b.id ASC"; $result = db_query( $query ); $bug_count = db_num_rows( $result ); $t_bug_id = 0; $t_largest_diff = 0; $t_total_time = 0; for ($i=0;$i<$bug_count;$i++) { $row = db_fetch_array( $result ); $t_date_submitted = db_unixtimestamp( $row['date_submitted'] ); $t_id = $row['id']; $t_status = $row['status']; if ( $row['hist_update'] !== NULL ) { $t_last_updated = db_unixtimestamp( $row['hist_update'] ); } else { $t_last_updated = db_unixtimestamp( $row['last_updated'] ); } if ($t_last_updated < $t_date_submitted) { $t_last_updated = 0; $t_date_submitted = 0; } $t_diff = $t_last_updated - $t_date_submitted; $t_total_time = $t_total_time + $t_diff; if ( $t_diff > $t_largest_diff ) { $t_largest_diff = $t_diff; $t_bug_id = $row['id']; } } if ( $bug_count < 1 ) { $bug_count = 1; } $t_average_time = $t_total_time / $bug_count; $t_largest_diff = number_format( $t_largest_diff / 86400, 2 ); $t_total_time = number_format( $t_total_time / 86400, 2 ); $t_average_time = number_format( $t_average_time / 86400, 2 ); $t_orct_arr = preg_split( '/[\)\/\(]/', lang_get( 'orct' ), -1, PREG_SPLIT_NO_EMPTY ); $t_orcttab = ""; foreach ( $t_orct_arr as $t_orct_s ) { $t_orcttab .= ''; $t_orcttab .= $t_orct_s; $t_orcttab .= ''; } ?>





0) { print_bug_link( $t_bug_id ); } ?>







'; $t_s = explode_enum_arr( $t_arr[$i] ); $c_s[0] = db_prepare_string( $t_s[0] ); echo get_enum_element( 'resolution', $c_s[0] ); print ''; } print ''; ?>
'; print lang_get( 'percentage_errors' ); print '
'; $t_s = explode_enum_arr( $t_arr[$i] ); $c_s[0] = db_prepare_string( $t_s[0] ); echo get_enum_element( 'resolution', $c_s[0] ); print ''; } print ''; ?>
'; print lang_get( 'percentage_fixed' ); print '