Closed Bug 108608 Opened 23 years ago Closed 12 years ago

Add days since bug created and last changed columns to buglist

Categories

(Bugzilla :: Query/Bug List, enhancement, P3)

2.14
enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: kevin.brannen, Unassigned)

References

Details

Attachments

(1 file)

It would be very useful to have a column in reports (next to opendate and
changedate) that shows the length of time in days-hours:minutes:seconds since
the bug was opened (OK, maybe # of seconds is overkill. :-)

It might be also be cool to have length of time since last change, but I won't
ask for it as this time, but if someone should want to add it too... :-)
Bug 97760 may be related.
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.18
Attachment #56633 - Flags: review-
Comment on attachment 56633 [details] [diff] [review]
a diff -u patch of 2 files as a potential fix

This won't apply any more because of the templatisation.
Assignee: endico → nobody
I have a mini fix for 2.17.6 - it does mean losing the Votes field (I dont use
it in my installation). You probably could change this to any field and just
update the patch below...

Open up buglist.cgi and add the TimeBugOpen function as shown below

sub DiffDate {
    my ($datestr) = @_;
    my $date = str2time($datestr);
    my $age = time() - $date;
    my ($s,$m,$h,$d,$mo,$y,$wd)= localtime $date;
    if( $age < 18*60*60 ) {
        $date = sprintf "%02d:%02d:%02d", $h,$m,$s;
    } elsif( $age < 6*24*60*60 ) {
        $date = sprintf "%s %02d:%02d", $weekday[$wd],$h,$m;
    } else {
        $date = sprintf "%04d-%02d-%02d", 1900+$y,$mo+1,$d;
    }
    return $date;
}

sub TimeBugOpen {
    my ($datestr) = @_;		
    my $date = str2time($datestr);	#This is the UNIX time the bug was created
    my $age = time() - $date;
    my ($s,$m,$h,$d,$mo,$y,$wd)= localtime $age;

    my $agestring;

    if( $age < 24*60*60 ) {	#24 Hours
        $agestring = "Less than a day";#sprintf "%02dh:%02dm", $h,$m;
    } 
    else {
        $agestring = sprintf "%2dy-%02dm-%02dd", $y-70,$mo,$d;
    }
    return $agestring;
}


sub LookupNamedQuery {
    my ($name) = @_;
    confirm_login();
    my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
    my $qname = SqlQuote($name);
    SendSQL("SELECT query FROM namedqueries WHERE userid = $userid AND name =
$qname");
    my $result = FetchOneColumn();
    $result || ThrowUserError("missing_query", {'queryname' => $name});
    return $result;
}




Near the bottom of buglist.cgi add the bug votes line in as shown below.


    # Process certain values further (i.e. date format conversion).
    if ($bug->{'changeddate'}) {
        $bug->{'changeddate'} =~ 
          s/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/$1-$2-$3 $4:$5:$6/;
        $bug->{'changeddate'} = DiffDate($bug->{'changeddate'});
    }
    ($bug->{'opendate'} = DiffDate($bug->{'opendate'})) if $bug->{'opendate'};

    #Hack to make the Votes column become the Time Issue Open column
    ($bug->{'votes'} = TimeBugOpen($bug->{'opendate'}));

    # Record the owner, product, and status in the big hashes of those things.
    $bugowners->{$bug->{'assigned_to'}} = 1 if $bug->{'assigned_to'};
    $bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'};
    $bugstatuses->{$bug->{'bug_status'}} = 1 if $bug->{'bug_status'};

Now open up /template/en/default/global/field_descs_none.tmpl and change the
"Votes" text to "Time Open".

And that should now give you a Time Open column in the Search window :)
Target Milestone: Bugzilla 2.18 → Bugzilla 2.20
Bugzilla 2.20 feature set is now frozen as of 15 Sept 2004.  Anything flagged
enhancement that hasn't already landed is being pushed out.  If this bug is
otherwise ready to land, we'll handle it on a case-by-case basis, please set the
blocking2.20 flag to '?' if you think it qualifies.
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
Is this "mini fix" still valid in the current version?
The trunk is now frozen to prepare Bugzilla 2.22. Only bug fixes are accepted, no enhancement bugs. As this bug has a pretty low activity (especially from the assignee), it's retargetted to ---. If you want to work on it and you think you can have it fixed for 2.24, please retarget it accordingly (to 2.24).
Target Milestone: Bugzilla 2.22 → ---
QA Contact: mattyt-bugzilla → default-qa
Blocks: 418953
Assignee: nobody → query-and-buglist
OS: Linux → All
Hardware: x86 → All
Summary: would like reporting to have a "length of time bug is open" column → Add days since bug created and last changed columns to buglist
(In reply to Kevin Brannen from comment #0)
> It would be very useful to have a column in reports (next to opendate and
> changedate) that shows the length of time in days-hours:minutes:seconds since
> the bug was opened (OK, maybe # of seconds is overkill. :-)

I don't understand the rationale to have two "opendate" and "changedate" columns, one with the date and the other one with the number of days spent. "It would be very useful" could have been elaborated a bit more. "143 days ago" isn't of great help compared to "2012-04-26". And the time wasted to compute the number of days doesn't worth the effort.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: