| 1 | <!DOCTYPE html |
|---|
| 2 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|---|
| 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|---|
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" |
|---|
| 5 | xmlns:xi="http://www.w3.org/2001/XInclude" |
|---|
| 6 | xmlns:py="http://genshi.edgewall.org/"> |
|---|
| 7 | |
|---|
| 8 | <xi:include href="admin.html"/> |
|---|
| 9 | |
|---|
| 10 | <head> |
|---|
| 11 | <title>Workflow Admin</title> |
|---|
| 12 | <script py:if="view == 'detail'" type="text/javascript"> |
|---|
| 13 | jQuery(document).ready(function ($) { |
|---|
| 14 | $("#workflow-actions").autoPreviewWorkflow("${href()}/multipleworkflow/workflow_render", "", |
|---|
| 15 | function (textarea, text, rendered) { |
|---|
| 16 | if (rendered) { |
|---|
| 17 | $('#workflow-graph').html(rendered['html']); |
|---|
| 18 | var graphdiv = $('.multiple-workflow-graph'); |
|---|
| 19 | var data = rendered['graph_data']; |
|---|
| 20 | window.drawWorkflows(data, graphdiv); |
|---|
| 21 | } |
|---|
| 22 | }); |
|---|
| 23 | $('#name').bind('input', function () { |
|---|
| 24 | /* trac_types holds all the known ticket types */ |
|---|
| 25 | if ($.inArray($(this).val(), trac_types) == -1) { |
|---|
| 26 | $('#trac-type-hint').show(); |
|---|
| 27 | } |
|---|
| 28 | else { |
|---|
| 29 | $('#trac-type-hint').hide(); |
|---|
| 30 | } |
|---|
| 31 | ; |
|---|
| 32 | }); |
|---|
| 33 | }); |
|---|
| 34 | </script> |
|---|
| 35 | |
|---|
| 36 | </head> |
|---|
| 37 | <body> |
|---|
| 38 | <h2>Manage Workflows</h2> |
|---|
| 39 | <div id="content"> |
|---|
| 40 | <py:choose test="view"> |
|---|
| 41 | <py:when test="'detail'"> |
|---|
| 42 | |
|---|
| 43 | <form class="mod" id="modworkflow" method="post" action=""> |
|---|
| 44 | <fieldset> |
|---|
| 45 | <legend>Modify Workflow:</legend> |
|---|
| 46 | <div class="field"> |
|---|
| 47 | <label>Name:<br/> |
|---|
| 48 | <input name="name" value="$name" type="text" id="name" |
|---|
| 49 | disabled="${name == 'default' or None}"/> |
|---|
| 50 | </label> |
|---|
| 51 | </div> |
|---|
| 52 | <div class="field"> |
|---|
| 53 | <textarea id="workflow-actions" |
|---|
| 54 | name="workflow-actions" |
|---|
| 55 | class="wikitext trac-resizable" rows="15" |
|---|
| 56 | cols="78">$workflow</textarea> |
|---|
| 57 | </div> |
|---|
| 58 | <p style='${(name in trac_types or name == "default") and "display: none" or None}' |
|---|
| 59 | class="help" id="trac-type-hint"> |
|---|
| 60 | There is currently no ticket type matching this workflow. |
|---|
| 61 | </p> |
|---|
| 62 | <div class="buttons"> |
|---|
| 63 | <input type="submit" name="cancel" value="${_('Cancel')}"/> |
|---|
| 64 | <input type="submit" name="save" value="${_('Save')}"/> |
|---|
| 65 | </div> |
|---|
| 66 | |
|---|
| 67 | <h3>Workflow Graph</h3> |
|---|
| 68 | <div id="workflow-graph"> |
|---|
| 69 | $workflowgraph |
|---|
| 70 | </div> |
|---|
| 71 | </fieldset> |
|---|
| 72 | </form> |
|---|
| 73 | </py:when> |
|---|
| 74 | <py:otherwise> |
|---|
| 75 | <py:if test="not wf_controller_installed"> |
|---|
| 76 | <div class="system-message warning"> |
|---|
| 77 | Workflow controller <strong>MultipleWorkflowPlugin</strong> is not set in trac.ini. |
|---|
| 78 | </div> |
|---|
| 79 | <div> |
|---|
| 80 | <p class="help">${_("It must be added as a workflow controller in section [ticket]. Only the default ticket workflow will currently be used.")} |
|---|
| 81 | </p> |
|---|
| 82 | </div> |
|---|
| 83 | <form class="addnew" id="install-controller" method="post" action=""> |
|---|
| 84 | <fieldset> |
|---|
| 85 | <legend>${_("Install Workflow Controller:")}</legend> |
|---|
| 86 | <p>${_("You may install the workflow controller by clicking the following button.")}</p> |
|---|
| 87 | <div class="buttons"> |
|---|
| 88 | <input type="submit" name="install" value="${_('Install')}"/> |
|---|
| 89 | </div> |
|---|
| 90 | </fieldset> |
|---|
| 91 | </form> |
|---|
| 92 | <hr/> |
|---|
| 93 | </py:if> |
|---|
| 94 | |
|---|
| 95 | <form class="addnew" id="addworkflow" method="post" action=""> |
|---|
| 96 | <fieldset> |
|---|
| 97 | <legend>Add Workflow:</legend> |
|---|
| 98 | <div class="field"> |
|---|
| 99 | <label>Name:<br/><input type="text" name="name"/></label> |
|---|
| 100 | </div> |
|---|
| 101 | <label>Copy from:<br/> |
|---|
| 102 | <select name="type" id="tkt-types" style="margin-left: 1em;"> |
|---|
| 103 | <option value="default">Default workflow</option> |
|---|
| 104 | <option py:for="tkt_type in types" value="$tkt_type" |
|---|
| 105 | selected="${tkt_type == selected and 'selected' or None}"> |
|---|
| 106 | $tkt_type |
|---|
| 107 | </option> |
|---|
| 108 | </select> |
|---|
| 109 | </label> |
|---|
| 110 | |
|---|
| 111 | <div class="buttons"> |
|---|
| 112 | <input type="submit" name="add" value="${_('Add')}"/> |
|---|
| 113 | </div> |
|---|
| 114 | </fieldset> |
|---|
| 115 | </form> |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | <form id="workflow_table" method="post" action=""> |
|---|
| 119 | <table class="listing" id="workflowlist"> |
|---|
| 120 | <thead> |
|---|
| 121 | <tr> |
|---|
| 122 | <th class="sel"> </th> |
|---|
| 123 | <th>Ticket Workflow</th> |
|---|
| 124 | <th>Description</th> |
|---|
| 125 | </tr> |
|---|
| 126 | </thead> |
|---|
| 127 | <tbody> |
|---|
| 128 | <tr> |
|---|
| 129 | <td class="sel"></td> |
|---|
| 130 | <td class="name"> |
|---|
| 131 | <a href="${panel_href('default')}">default</a> |
|---|
| 132 | </td> |
|---|
| 133 | <td> |
|---|
| 134 | Trac default workflow. It is used for ticket types without any |
|---|
| 135 | specific workflow. |
|---|
| 136 | </td> |
|---|
| 137 | </tr> |
|---|
| 138 | <tr py:for="tkt_type in types"> |
|---|
| 139 | <td class="sel"><input type="checkbox" name="sel" |
|---|
| 140 | value="$tkt_type"/></td> |
|---|
| 141 | <td class="name"> |
|---|
| 142 | <a href="${panel_href(tkt_type)}">$tkt_type</a> |
|---|
| 143 | </td> |
|---|
| 144 | <td> |
|---|
| 145 | Workflow for tickets of type <strong>$tkt_type</strong>. |
|---|
| 146 | <p py:if="tkt_type not in trac_types" class="help"> |
|---|
| 147 | There is currently no ticket type matching this workflow. |
|---|
| 148 | </p> |
|---|
| 149 | </td> |
|---|
| 150 | </tr> |
|---|
| 151 | </tbody> |
|---|
| 152 | </table> |
|---|
| 153 | <div class="buttons"> |
|---|
| 154 | <input type="submit" name="remove" |
|---|
| 155 | value="${_('Remove selected items')}"/> |
|---|
| 156 | </div> |
|---|
| 157 | <p class="help"> |
|---|
| 158 | You can't remove the default workflow. |
|---|
| 159 | </p> |
|---|
| 160 | </form> |
|---|
| 161 | </py:otherwise> |
|---|
| 162 | </py:choose> |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | </div> |
|---|
| 166 | |
|---|
| 167 | <!-- |
|---|
| 168 | <form action="${panel_href()}" method="post"> |
|---|
| 169 | <select name="type" id="tkt-types" style="margin-left: 1em;"> |
|---|
| 170 | <option value="default">Default workflow</option> |
|---|
| 171 | <option py:for="type in types" value="$type" selected="${type==selected and 'selected' or None}">$type</option> |
|---|
| 172 | </select> |
|---|
| 173 | <div class="field"> |
|---|
| 174 | <textarea id="workflow-actions" name="workflow-actions" |
|---|
| 175 | class="wikitext trac-resizable" rows="10" cols="78">$workflow</textarea> |
|---|
| 176 | </div> |
|---|
| 177 | <div class="buttons"> |
|---|
| 178 | <input type="submit" id="wf-submit" name="wf-save" value="Save changes"/> |
|---|
| 179 | </div> |
|---|
| 180 | </form> |
|---|
| 181 | <hr /> |
|---|
| 182 | |
|---|
| 183 | <h3>Workflow Graph</h3> |
|---|
| 184 | |
|---|
| 185 | <div id="workflow-graph"> |
|---|
| 186 | $workflowgraph |
|---|
| 187 | </div> |
|---|
| 188 | --> |
|---|
| 189 | </body> |
|---|
| 190 | </html> |
|---|
| 191 | |
|---|