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 ) . ')'; } $t_bug_table = config_get( 'mantis_bug_table' ); $t_history_table = config_get( 'mantis_bug_history_table' ); $t_clo_val = config_get( 'bug_resolved_status_threshold' ); $query = "SELECT id, date_submitted, last_updated, status FROM $t_bug_table WHERE $specific_where AND status>='$t_clo_val'"; $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_last_updated = db_unixtimestamp( $row['last_updated'] ); $t_id = $row['id']; $t_status = $row['status']; # if the status is not the closed value, it may have passed through the # status we consider closed (e.g., bug is CLOSED, not RESOLVED) # we should look for the last time it was RESOLVED in the history if ( $t_status <> $t_clo_val ) { $query2 = "SELECT date_modified FROM " . $t_history_table . " WHERE bug_id=$t_id AND type=" . NORMAL_TYPE . " AND field_name='status' AND new_value='$t_clo_val' ORDER BY date_modified DESC"; $result2 = db_query( $query2 ); if ( db_num_rows( $result2 ) >= 1 ) { # if any were found, read the first (oldest) one and update the timestamp $row2 = db_fetch_array( $result2 ); $t_last_updated = db_unixtimestamp( $row2['date_modified'] ); } } 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 .= ucwords( $t_orct_s ); $t_orcttab .= ''; } //Added 2005.03.24 if(config_get('display_totals')) { //Displays the header for the new tables $t_nfaaifrcttt_arr = preg_split( '/[\)\/\(]/',lang_get( 'nfaaifrcttt' ), -1, PREG_SPLIT_NO_EMPTY ); $t_detail_tab = ""; foreach ( $t_nfaaifrcttt_arr as $t_nfaaifrcttt_s ) { $t_detail_tab .= ''; $t_detail_tab .= ucwords( $t_nfaaifrcttt_s ); $t_detail_tab .= ''; } } else { //Displays the header for the new tables $t_nfacafrci_arr = preg_split( '/[\)\/\(]/',lang_get( 'nfaairc' ), -1, PREG_SPLIT_NO_EMPTY ); $t_detail_tab = ""; foreach ( $t_nfacafrci_arr as $t_nfacafrci_s ) { $t_detail_tab .= ''; $t_detail_tab .= ucwords( $t_nfacafrci_s ); $t_detail_tab .= ''; } } ?>





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 ucwords( 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 ucwords( get_enum_element( 'resolution', $c_s[0] ) ); print ''; } print ''; ?>
'; print lang_get( 'percentage_fixed' ); print '