Changes between Version 34 and Version 35 of QueuesPlugin


Ignore:
Timestamp:
Aug 10, 2016, 5:06:03 PM (8 years ago)
Author:
figaro
Comment:

Further cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • QueuesPlugin

    v34 v35  
    2727You can check out QueuesPlugin from [/svn/queuesplugin here] using Subversion, or [source:queuesplugin browse the source] with Trac.
    2828
    29 == Configuration
     29== Installation / Configuration
    3030
    3131 1. Install the plugin (after downloading and unzipping):
     
    7373{{{#!sql
    7474SELECT s.value AS __color__,
    75        p.value as position, t.id AS ticket, summary,
    76        t.type AS type, t.severity, t.owner
     75   p.value AS position, t.id AS ticket, summary,
     76   t.type AS type, t.severity, t.owner
    7777FROM ticket t
    78 LEFT JOIN enum s ON s.name = t.severity AND s.type = 'severity'
    79 LEFT OUTER JOIN ticket_custom p ON p.ticket = t.id AND p.name = 'position'
     78   LEFT JOIN enum s ON s.name = t.severity AND s.type = 'severity'
     79   LEFT OUTER JOIN ticket_custom p ON p.ticket = t.id AND p.name = 'position'
    8080WHERE t.status <> 'closed'
    8181ORDER BY CAST((CASE p.value
    82                 WHEN '' THEN '0'
    83                 ELSE COALESCE(p.value, '0') END) AS UNSIGNED) ASC,
    84          t.changetime DESC
    85 }}}
    86 
    87 Notice that the first column is the {{{position}}} custom field and is defined as {{{p.value as position}}} - this is ''required''  The first column's name must always match the name of the custom field used to maintain the queue position. You can name them whatever you want; they just have to match. In the ORDER BY clause, we cast the position field to an integer. This example is for sqlite3; you'll need to check the syntax for the database you're using. If your database does not support casting, you can use position padding option described below. There are no other restrictions to the SQL you use for your reports, as far as I'm aware!
     82               WHEN '' THEN '0'
     83               ELSE COALESCE(p.value, '0') END) AS UNSIGNED) ASC,
     84   t.changetime DESC
     85}}}
     86
     87Notice that the first column is the {{{position}}} custom field and is defined as {{{p.value as position}}} - this is ''required''. The first column's name must always match the name of the custom field used to maintain the queue position. You can name them whatever you want; they just have to match. In the ORDER BY clause, we cast the position field to an integer. This example is for sqlite3; you'll need to check the syntax for the database you're using. If your database does not support casting, you can use position padding option described below. There are no other restrictions to the SQL you use for your reports, as far as I'm aware!
    8888
    8989If the report above was created as, say, report {{{13}}}, then you would need to add it to the {{{[queues]}}} section of the `trac.ini` file:
     
    9595You may need to restart your Trac web server afterwards. Here is a screenshot of the result with a few sample tickets:
    9696
    97 [[Image(example1.png)]]
     97[[Image(example1.png, border=2)]]
    9898
    9999To reorder the tickets, simply drag and drop them to their desired position in the queue.
     
    104104{{{#!sql
    105105SELECT s.value AS __color__,
    106        p.value as position, t.id AS ticket, summary,
    107        t.type AS type, t.severity, t.owner
     106   p.value AS position, t.id AS ticket, summary,
     107   t.type AS type, t.severity, t.owner
    108108FROM ticket t
    109 LEFT JOIN enum s ON s.name = t.severity AND s.type = 'severity'
    110 LEFT OUTER JOIN ticket_custom p ON p.ticket = t.id AND p.name = 'position'
     109   LEFT JOIN enum s ON s.name = t.severity AND s.type = 'severity'
     110   LEFT OUTER JOIN ticket_custom p ON p.ticket = t.id AND p.name = 'position'
    111111WHERE t.status <> 'closed' AND t.milestone = '$MILESTONE'
    112112ORDER BY CAST((CASE p.value
    113                  WHEN '' THEN '0'
    114                  ELSE COALESCE(p.value, '0') END) AS UNSIGNED) ASC,
    115          t.changetime DESC
     113               WHEN '' THEN '0'
     114               ELSE COALESCE(p.value, '0') END) AS UNSIGNED) ASC,
     115   t.changetime DESC
    116116}}}
    117117
     
    126126Here's the screenshot of the report:
    127127
    128 [[Image(example2.png)]]
     128[[Image(example2.png, border=2)]]
    129129
    130130In this example, the optional DynamicVariablesPlugin is used, which converts the {{{MILESTONE}}} dynamic variable (aka argument) from a freeform textbox to a convenient dropdown menu at the right.
     
    140140             ELSE '$MILESTONE'
    141141            END) AS __group__,
    142        p.value AS position, t.id AS ticket, summary,
    143        t.type AS type, t.severity, t.owner
     142   p.value AS position, t.id AS ticket, summary,
     143   t.type AS type, t.severity, t.owner
    144144FROM ticket t
    145 LEFT JOIN enum s ON s.name = t.severity AND s.type = 'severity'
    146 LEFT OUTER JOIN ticket_custom p ON p.ticket = t.id AND p.name = 'position'
     145   LEFT JOIN enum s ON s.name = t.severity AND s.type = 'severity'
     146   LEFT OUTER JOIN ticket_custom p ON p.ticket = t.id AND p.name = 'position'
    147147WHERE t.status <> 'closed' AND t.milestone = '$MILESTONE'
    148148ORDER BY (CASE p.value
    149                  WHEN '' THEN 'Triage'
    150                  WHEN NULL THEN 'Triage'
    151                  ELSE $MILESTONE END = 'Triage') DESC,
    152          CAST((CASE p.value
    153                  WHEN '' THEN '0'
    154                  ELSE COALESCE(p.value, '0') END) AS UNSIGNED) ASC,
    155          t.changetime DESC
     149          WHEN '' THEN 'Triage'
     150          WHEN NULL THEN 'Triage'
     151          ELSE $MILESTONE END = 'Triage') DESC,
     152   CAST((CASE p.value
     153         WHEN '' THEN '0'
     154         ELSE COALESCE(p.value, '0') END) AS UNSIGNED) ASC,
     155   t.changetime DESC
    156156}}}
    157157
     
    165165The {{{group.triage = clear}}} tells the plugin that the {{{Triage}}} group shouldn't reorder positions (reordering is the default operation).  The group name {{{Triage}}} is just an example - you can use any name as long as you make the config match it. Here's the screenshot of the report:
    166166
    167 [[Image(example3.png)]]
     167[[Image(example3.png, border=2)]]
    168168
    169169The tickets are now grouped with the Triage group at the top. You can drag-and-drop tickets from the {{{Triage}}} group to anywhere in the {{{milestone1}}} group. Furthermore, you can also clear the position from any ticket by dragging-and-dropping it from the {{{milestone1}}} group to anywhere in the {{{Triage}}} group (hence the full meaning of the {{{clear}}} operation described above). Note that currently a group must have at least one ticket in it to be able to drag-and-drop tickets into it.