Adding a custom report column

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding a custom report column

Christian Robottom Reis

Here's an interesting question for this breezy Friday: how do I add a
column to the reports that indicates the /date/ a bug was created? I've
done the trivial modification as per the patch below, which adds
creation_ts to the list of available options, but the main issues are:

    - I would like the label to say "Bug creation date", not "time"

    - It follows that I am abusing the creation_ts' column, so even if I
      was to hack in an evil rename somewhere, I wouldn't allow the
      actual creation_ts to be offered as a potential column.

Any hints from the master?

Index: report.cgi
===================================================================
RCS file: /cvs/bugzilla/report.cgi,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 report.cgi
--- report.cgi 3 Mar 2004 04:33:30 -0000 1.1.1.2
+++ report.cgi 10 Jun 2005 17:58:42 -0000
@@ -119,6 +119,7 @@ $columns{'op_sys'}           = "bugs.op_
 $columns{'votes'}            = "bugs.votes";
 $columns{'keywords'}         = "bugs.keywords";
 $columns{'target_milestone'} = "bugs.target_milestone";
+$columns{'creation_ts'}      = "DATE_FORMAT(bugs.creation_ts, '%Y-%m-%d')";
 # One which means "nothing". Any number would do, really. It just gets SELECTed
 # so that we always select 3 items in the query.
 $columns{''}                 = "42217354";
Index: template/en/default/search/search-report-select.html.tmpl
===================================================================
RCS file: /cvs/bugzilla/template/en/default/search/search-report-select.html.tmpl,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 search-report-select.html.tmpl
--- template/en/default/search/search-report-select.html.tmpl 24 Jun 2004 14:37:12 -0000 1.1.1.2
+++ template/en/default/search/search-report-select.html.tmpl 10 Jun 2005 17:58:42 -0000
@@ -30,7 +30,7 @@
   [% rep_fields = ["product", "component", "version", "rep_platform",  
                    "op_sys", "bug_status", "resolution", "bug_severity",
                    "priority", "target_milestone", "assigned_to",
-                   "reporter", "qa_contact", "votes" ] %]
+                   "reporter", "qa_contact", "votes", "creation_ts" ] %]
 
   <select name="[% name FILTER html %]">
     <option value="">&lt;none&gt;</option>

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: Adding a custom report column

Gervase Markham
Christian Reis wrote:
> Here's an interesting question for this breezy Friday: how do I add a
> column to the reports that indicates the /date/ a bug was created?

I don't understand the question. Every bug (just about) has a unique
creation date. The reports system is all about aggregating bugs, where
the cells of the table contain bug counts. How would this work with the
date thing?

Gerv
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: Adding a custom report column

Christian Robottom Reis
On Fri, Jun 10, 2005 at 11:36:44PM +0100, Gervase Markham wrote:
> Christian Reis wrote:
> >Here's an interesting question for this breezy Friday: how do I add a
> >column to the reports that indicates the /date/ a bug was created?
>
> I don't understand the question. Every bug (just about) has a unique
> creation date. The reports system is all about aggregating bugs, where
> the cells of the table contain bug counts. How would this work with the
> date thing?

Actually, the creation /date/ is not really unique -- the creation
/timestamp/ may be unique, but if you look at the patch I actually
DATE_FORMAT() the timestamp into a date.

The report essentially shows how many bugs were opened on a certain day,
which is a report that is surprisingly interesting.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3376 0125
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: Adding a custom report column

Gervase Markham
Christian Robottom Reis wrote:
> Actually, the creation /date/ is not really unique -- the creation
> /timestamp/ may be unique, but if you look at the patch I actually
> DATE_FORMAT() the timestamp into a date.
>
> The report essentially shows how many bugs were opened on a certain day,
> which is a report that is surprisingly interesting.

Oh, I see. No, there's no reason why a patch to add that as a possible
row/column wouldn't be accepted.

Gerv
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: Adding a custom report column

Christian Robottom Reis
On Sun, Jun 12, 2005 at 04:57:22PM +0100, Gervase Markham wrote:

> Christian Robottom Reis wrote:
> >Actually, the creation /date/ is not really unique -- the creation
> >/timestamp/ may be unique, but if you look at the patch I actually
> >DATE_FORMAT() the timestamp into a date.
> >
> >The report essentially shows how many bugs were opened on a certain day,
> >which is a report that is surprisingly interesting.
>
> Oh, I see. No, there's no reason why a patch to add that as a possible
> row/column wouldn't be accepted.

Could you take a look at my original mail, patch and question there?
There was a specific issue I was curious about -- how to name the column
properly (it was a bit of a hack).

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3376 0125
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>