Changes between Version 34 and Version 35 of QueuesPlugin
- Timestamp:
- Aug 10, 2016, 5:06:03 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QueuesPlugin
v34 v35 27 27 You can check out QueuesPlugin from [/svn/queuesplugin here] using Subversion, or [source:queuesplugin browse the source] with Trac. 28 28 29 == Configuration29 == Installation / Configuration 30 30 31 31 1. Install the plugin (after downloading and unzipping): … … 73 73 {{{#!sql 74 74 SELECT s.value AS __color__, 75 p.value asposition, t.id AS ticket, summary,76 75 p.value AS position, t.id AS ticket, summary, 76 t.type AS type, t.severity, t.owner 77 77 FROM 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' 80 80 WHERE t.status <> 'closed' 81 81 ORDER BY CAST((CASE p.value 82 83 84 85 }}} 86 87 Notice that the first column is the {{{position}}} custom field and is defined as {{{p.value as position}}} - this is ''required'' 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! 88 88 89 89 If 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: … … 95 95 You may need to restart your Trac web server afterwards. Here is a screenshot of the result with a few sample tickets: 96 96 97 [[Image(example1.png )]]97 [[Image(example1.png, border=2)]] 98 98 99 99 To reorder the tickets, simply drag and drop them to their desired position in the queue. … … 104 104 {{{#!sql 105 105 SELECT s.value AS __color__, 106 p.value asposition, t.id AS ticket, summary,107 106 p.value AS position, t.id AS ticket, summary, 107 t.type AS type, t.severity, t.owner 108 108 FROM 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' 111 111 WHERE t.status <> 'closed' AND t.milestone = '$MILESTONE' 112 112 ORDER BY CAST((CASE p.value 113 114 115 113 WHEN '' THEN '0' 114 ELSE COALESCE(p.value, '0') END) AS UNSIGNED) ASC, 115 t.changetime DESC 116 116 }}} 117 117 … … 126 126 Here's the screenshot of the report: 127 127 128 [[Image(example2.png )]]128 [[Image(example2.png, border=2)]] 129 129 130 130 In 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. … … 140 140 ELSE '$MILESTONE' 141 141 END) AS __group__, 142 143 142 p.value AS position, t.id AS ticket, summary, 143 t.type AS type, t.severity, t.owner 144 144 FROM 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' 147 147 WHERE t.status <> 'closed' AND t.milestone = '$MILESTONE' 148 148 ORDER BY (CASE p.value 149 150 151 152 153 154 155 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 156 156 }}} 157 157 … … 165 165 The {{{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: 166 166 167 [[Image(example3.png )]]167 [[Image(example3.png, border=2)]] 168 168 169 169 The 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.