Edgewall Software
Modify

Opened 15 years ago

Closed 13 years ago

Last modified 5 years ago

#8789 closed defect (duplicate)

Column header links disabled on reports using __group__

Reported by: glc <glc.nwl@…> Owned by:
Priority: normal Milestone:
Component: report system Version: 0.11.5
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When a report uses a group field in SQL, and therefore displays multiple ticket tables, the column headers of each group are not clickable anymore, so that users cannot sort manually, this is really annoying.

Fortunately, the custom queries let users escape from this issue in some way, as header columns remain sortable in custom queries even if a group is set.

Please, could you fix this on next version ? Or just tell me if there is a way to fix this myself in my Trac installation.

Thanks in advance.

Attachments (0)

Change History (8)

comment:1 by glc <glecoz@…>, 15 years ago

Sorry, I meant :

When a report uses a __group__ field in SQL, and therefore displays multiple ticket tables, the column headers of each group are not clickable anymore, so that users cannot sort manually, this is really annoying.

Fortunately, the custom queries let users escape from this issue in some way, as header columns remain sortable in custom queries even if a group is set.

comment:2 by Christian Boos, 15 years ago

Milestone: 0.11.6next-minor-0.12.x
Severity: majornormal

comment:3 by Carsten Klein <carsten.klein@…>, 15 years ago

Should this really be fixed, because I already did this for #9125 but then reverted the change.

If you like I could include this with #9125.

comment:4 by Carsten Klein <carsten.klein@…>, 15 years ago

to the original poster:

for a starter, simply change line 102 (as of trac-0.12dev) in /trac/ticket/templates/report_view.html from

<a py:strip="not sorting_enabled"

to

<a 

This will effectfully enable sorting in your local installation.

comment:5 by spackard@…, 13 years ago

Sorry to drudge up a 2 year old ticket, but we just upgraded from TRAC 0.12.0 on Ubuntu to TRAC 0.12.3 on Arch Linux and ran into this issue with one of our reports that used to be sortable and now is not. Making the change in comment:4 made the columns clickable, but clicking on them resulted in no change to the report. ie the columns were linkable for sorting, but the report doesn't actually sort when clicking on the header. The SQL generating the report (not written by me, original author is no longer with the company) is using group in the SQL, but our actual report only ever has one group box. Below is the SQL for the report. Maybe there's a way to rewrite the SQL to not use group? Please let me know. Thanks in advance.

SELECT __group__, __style__,  keywords, ticket, summary,
 severity, __milestone__, status, owner, Estimated_work

FROM (
SELECT t.milestone AS __group__,
      (CASE 
                             WHEN (status='new' AND (owner='nobody' OR owner='djohnston')) OR (status='assigned' AND owner='nobody') THEN 'font-weight: bold; background: white;' 
                             WHEN status='assigned' OR (status='new' AND owner<>'nobody' AND owner<>'djohnston') THEN 'font-weight: bold; background: khaki;' 
                             WHEN status='reopened' THEN 'font-weight: bold; background: yellow;' 
                             WHEN status='resolved' THEN 'font-weight: bold; background: palegreen;' 
                             WHEN status='sprint_verified' THEN 'font-weight: bold; background: green;' 
                             WHEN status='merged' THEN 'font-weight: bold; background: forestgreen;' 
                             WHEN status='verified' THEN 'font-weight: bold; background: deepskyblue;' 
                             WHEN status='closed' THEN 'font-weight: bold; background: darkblue;' 
                             ELSE '' END) AS __style__,
      keywords,
      t.id AS ticket, summary AS summary,             
      severity, milestone as __milestone__, status, owner,
      CASE WHEN EstimatedHours.value = '' OR EstimatedHours.value IS NULL THEN 0
        ELSE CAST( EstimatedHours.value AS DECIMAL ) END as Estimated_work,
      description AS _description_
 FROM ticket as t

LEFT JOIN ticket_custom as EstimatedHours ON EstimatedHours.name='estimatedhours'
     AND EstimatedHours.Ticket = t.Id

 WHERE t.milestone = $MILESTONE

UNION
SELECT t.milestone AS __group__,
      'background-color:#DFE;' as __style__,
      'Sprint Total' as keywords,
      NULL as ticket, ' ' AS summary, 
      NULL as severity, t.milestone as  __milestone__, 
      ' ' as status,
      'Time Remaining: ' as owner,
      SUM(CASE WHEN EstimatedHours.value = '' OR EstimatedHours.value IS NULL THEN 0
        ELSE CAST( EstimatedHours.value AS DECIMAL ) END) as Estimated_work,
      NULL AS _description_
 FROM ticket as t

LEFT JOIN ticket_custom as EstimatedHours ON EstimatedHours.name='estimatedhours'
     AND EstimatedHours.Ticket = t.Id

 WHERE t.milestone = $MILESTONE
 GROUP BY t.milestone
)  as tbl
ORDER BY CAST(SUBSTRING (keywords, 'S([0-9]{1,3})') AS int4), 
                  CAST(SUBSTRING (keywords, 'T([0-9]{1,3})') AS int4), 
                  ticket

comment:6 by Christian Boos, 13 years ago

Milestone: next-minor-0.12.x
Resolution: duplicate
Status: newclosed

Actually, this should be solved by #10540. It would be nice if you could test the patch posted there and report if it worked for you.

Easiest way for you would be to make a backup of your existing Trac 0.12.3 environment, then upgrade that copy to 0.13dev, then apply the patch. Otherwise you could try to apply the 0.12.3 version of the patch that you can find in #10530 (in multiple parts…).

comment:7 by anonymous, 13 years ago

We have a VM copy of the TRAC server that we used to test the upgrade that I can probably make a copy of and try upgrading to TRAC 0.13dev and seeing if it's fixed. If it does, I think we can wait until 0.13 is officially released and available through Arch Linux pacman package manager.

in reply to:  7 comment:8 by Christian Boos, 13 years ago

Replying to anonymous:

We have a VM copy of the TRAC server that we used to test the upgrade that I can probably make a copy of and try upgrading to TRAC 0.13dev and seeing if it's fixed.

Just to be 100% clear: you need 0.13dev + the patch attachment:ticket:10540:10530-support-SORT_COLUMN-in-__group__-reports-r10928.patch​.


[OT] the new style attachment link doesn't work for that attachment! attachment:10530-support-SORT_COLUMN-in-__group__-reports-r10928.patch​:ticket:10540 (no idea why)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.