Summary :: By Date (days)

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
eryjus
Posts: 3
Joined: 26 Sep 2005, 00:49

Summary :: By Date (days)

Post by eryjus »

I noticed that there is a possibility for bugs to "fall off" the end of the "Summary by Date" chart when the bug has been open for more then 365 days.

The workaround for this is simple. In the config_inc.php file, I added the following line:
$g_date_partitions = array( 1, 2, 3, 7, 30, 60, 90, 180, 365, 999999);
where 999999 represents bugs open more than 2700 years, and we should take a while to reach that limit. The original code is in config_defaults_inc.php for anyone that would submit a "permanent" change.
eryjus
Posts: 3
Joined: 26 Sep 2005, 00:49

More granular data by date

Post by eryjus »

Version - 1.0.0rc2

I added the following code to separate the number of issues by the number of days open. Specifically, the value in "1" is the number of bugs open for 1 day or less. The value in the "2" row is the number of bugs open for 2 days or less. The issue I ran into was that a bug can exist in both instances.

The following code addresses this concern and separates the counts into their respective buckets:
function summary_print_by_date( $p_date_array ) {
$t_total_count = 0; # -- Added
$arr_count = count( $p_date_array );
for ($i=0;$i<$arr_count;$i++) {
$t_enum_count = summary_bug_count_by_date( $p_date_array[$i] );
$t_enum_count -= $t_total_count; # -- Added
$t_total_count += $t_enum_count; # -- Added

$t_start_date = mktime( 0, 0, 0, date( 'm' ), ( date( 'd' ) - $p_date_array[$i] ), date( 'Y' ) );
$t_bug_link = '<a class="subtle" href="' . config_get( 'bug_count_hyperlink_prefix' ) . '&do_filter_by_date=on&start_year=' . date( 'Y', $t_start_date ) . '&start_month=' . date( 'm', $t_start_date ) . '&start_day=' . date( 'd', $t_start_date ) . '&hide_status=">';

printf( '<tr %s>', helper_alternate_class() );
printf( '<td width="50%%">%s</td>', $p_date_array[$i] );
if ( 0 < $t_enum_count ) {
printf( '<td class="right">%s</td>', $t_bug_link . $t_enum_count . '</a>' );
} else {
printf( '<td class="right">%s</td>', $t_enum_count );
}
print( '</tr>' );
} # end for
}
The function summary_print_by_date has been copied here in its entirity as modified on my system (1.0.0rc2). I added 3 lines to this function noted by the "# -- Added" comment.
atomoid
Posts: 108
Joined: 18 Aug 2005, 00:46
Location: santa cruz, ca

Post by atomoid »

The code above goes in the "summary_api.php" file.
It is intended to separate the entries under the "By Date (days)" heading on the "summary_page.php" page as described. It is meant to change the filter so that instead of, for instance, producing a list of all bugs logged withing the last 30 days it will only yield a list of bugs logged between 30 days and the date range next to it.

However, for instance in my example below, when i click on the "13" which should be the number of bugs logged 2 days ago, i get a list of 23 bugs which include bugs logged over the last three days (today, yesterday and the day before yesterday). So it doesnt look like the filter made it into the link.

By Date (days)
1 10 => produces a list of 10
2 13 => produces a list of 23
3 12 => produces a list of 35
7 76 => produces a list of 111
30 182 => produces a list of 293
60 88 => produces a list of 381
90 66 => produces a list of 447
180 197 => produces a list of 644
365 418 => produces a list of 1062
9999 2074 => produces a list of 3136
Post Reply