Ticket reporters should be able to specify severity whereas only those with repository push access should be able to specify priority. This also fixes a bug related to non-admin users creating tickets.
</div>\r
</td></tr>\r
<tr wicket:id="status"></tr>\r
+ <tr><th><wicket:message key="gb.severity"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="severity"></select></td></tr>\r
+ <tr wicket:id="priority"></tr>\r
<tr wicket:id="responsible"></tr>\r
<tr wicket:id="milestone"></tr>\r
- <tr><th><wicket:message key="gb.priority"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="priority"></select></td></tr>\r
- <tr><th><wicket:message key="gb.severity"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="severity"></select></td></tr>\r
<tr wicket:id="mergeto"></tr>\r
</table>\r
</div>\r
<th><wicket:message key="gb.mergeTo"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="mergeto"></select></td>\r
</wicket:fragment>\r
\r
+<wicket:fragment wicket:id="priorityFragment">\r
+ <th><wicket:message key="gb.priority"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="priority"></select></td>\r
+</wicket:fragment>\r
+\r
</wicket:extend>\r
</html>
\ No newline at end of file
private IModel<TicketMilestone> milestoneModel;\r
\r
private Label descriptionPreview;\r
- \r
+\r
private IModel<TicketModel.Priority> priorityModel;\r
- \r
+\r
private IModel<TicketModel.Severity> severityModel;\r
\r
public EditTicketPage(PageParameters params) {\r
status.add(new DropDownChoice<TicketModel.Status>("status", statusModel, statusChoices));\r
form.add(status);\r
\r
+ List<TicketModel.Severity> severityChoices = Arrays.asList(TicketModel.Severity.choices());\r
+ form.add(new DropDownChoice<TicketModel.Severity>("severity", severityModel, severityChoices));\r
+\r
if (currentUser.canAdmin(ticket, getRepositoryModel())) {\r
// responsible\r
Set<String> userlist = new TreeSet<String>(ticket.getParticipants());\r
milestones.add(new TicketMilestone(NIL));\r
}\r
\r
+ // milestone\r
Fragment milestone = new Fragment("milestone", "milestoneFragment", this);\r
-\r
milestone.add(new DropDownChoice<TicketMilestone>("milestone", milestoneModel, milestones));\r
form.add(milestone.setVisible(!milestones.isEmpty()));\r
\r
// priority\r
+ Fragment priority = new Fragment("priority", "priorityFragment", this);\r
List<TicketModel.Priority> priorityChoices = Arrays.asList(TicketModel.Priority.choices());\r
- form.add(new DropDownChoice<TicketModel.Priority>("priority", priorityModel, priorityChoices));\r
- \r
- // severity\r
- List<TicketModel.Severity> severityChoices = Arrays.asList(TicketModel.Severity.choices());\r
- form.add(new DropDownChoice<TicketModel.Severity>("severity", severityModel, severityChoices));\r
- \r
+ priority.add(new DropDownChoice<TicketModel.Priority>("priority", priorityModel, priorityChoices));\r
+ form.add(priority);\r
+\r
// mergeTo (integration branch)\r
List<String> branches = new ArrayList<String>();\r
for (String branch : getRepositoryModel().getLocalBranches()) {\r
form.add(new Label("responsible").setVisible(false));\r
form.add(new Label("milestone").setVisible(false));\r
form.add(new Label("mergeto").setVisible(false));\r
+ form.add(new Label("priority").setVisible(false));\r
}\r
\r
form.add(new AjaxButton("update") {\r
change.setField(Field.milestone, milestone.name);\r
}\r
}\r
- \r
+\r
TicketModel.Priority priority = priorityModel.getObject();\r
if (!ticket.priority.equals(priority))\r
{\r
{\r
change.setField(Field.severity, severity);\r
}\r
- \r
+\r
String mergeTo = mergeToModel.getObject();\r
if ((StringUtils.isEmpty(ticket.mergeTo) && !StringUtils.isEmpty(mergeTo))\r
|| (!StringUtils.isEmpty(mergeTo) && !mergeTo.equals(ticket.mergeTo))) {\r
</div>\r
</td></tr>\r
<tr><th><wicket:message key="gb.type"></wicket:message><span style="color:red;">*</span></th><td class="edit"><select class="input-large" wicket:id="type"></select></td></tr>\r
+ <tr><th><wicket:message key="gb.severity"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="severity"></select></td></tr>\r
+ <tr wicket:id="priority"></tr>\r
<tr wicket:id="responsible"></tr>\r
<tr wicket:id="milestone"></tr>\r
- <tr><th><wicket:message key="gb.priority"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="priority"></select></td></tr>\r
- <tr><th><wicket:message key="gb.severity"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="severity"></select></td></tr>\r
<tr wicket:id="mergeto"></tr>\r
</table>\r
</div>\r
<th><wicket:message key="gb.mergeTo"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="mergeto"></select></td>\r
</wicket:fragment>\r
\r
+<wicket:fragment wicket:id="priorityFragment">\r
+ <th><wicket:message key="gb.priority"></wicket:message></th><td class="edit"><select class="input-large" wicket:id="priority"></select></td>\r
+</wicket:fragment>\r
+\r
</wicket:extend>\r
</html>
\ No newline at end of file
private IModel<TicketMilestone> milestoneModel;\r
\r
private Label descriptionPreview;\r
- \r
+\r
private IModel<TicketModel.Priority> priorityModel;\r
- \r
+\r
private IModel<TicketModel.Severity> severityModel;\r
\r
public NewTicketPage(PageParameters params) {\r
form.add(new DropDownChoice<TicketModel.Type>("type", typeModel, Arrays.asList(TicketModel.Type.choices())));\r
form.add(new TextField<String>("title", titleModel));\r
form.add(new TextField<String>("topic", topicModel));\r
+ form.add(new DropDownChoice<TicketModel.Severity>("severity", severityModel, Arrays.asList(TicketModel.Severity.choices())));\r
\r
final IModel<String> markdownPreviewModel = Model.of();\r
descriptionPreview = new Label("descriptionPreview", markdownPreviewModel);\r
form.add(milestone.setVisible(!milestones.isEmpty()));\r
\r
// priority\r
- form.add(new DropDownChoice<TicketModel.Priority>("priority", priorityModel, Arrays.asList(TicketModel.Priority.choices())));\r
- \r
- //severity\r
- form.add(new DropDownChoice<TicketModel.Severity>("severity", severityModel, Arrays.asList(TicketModel.Severity.choices())));\r
- \r
+ Fragment priority = new Fragment("priority", "priorityFragment", this);\r
+ priority.add(new DropDownChoice<TicketModel.Priority>("priority", priorityModel, Arrays.asList(TicketModel.Priority.choices())));\r
+ form.add(priority);\r
+\r
// integration branch\r
List<String> branches = new ArrayList<String>();\r
for (String branch : getRepositoryModel().getLocalBranches()) {\r
form.add(new Label("responsible").setVisible(false));\r
form.add(new Label("milestone").setVisible(false));\r
form.add(new Label("mergeto").setVisible(false));\r
+ form.add(new Label("priority").setVisible(false));\r
}\r
\r
form.add(new AjaxButton("create") {\r
if (milestone != null) {\r
change.setField(Field.milestone, milestone.name);\r
}\r
- \r
+\r
// severity\r
TicketModel.Severity severity = TicketModel.Severity.defaultSeverity;\r
if (severityModel.getObject() != null) {\r
severity = severityModel.getObject();\r
}\r
change.setField(Field.severity, severity);\r
- \r
+\r
// priority\r
TicketModel.Priority priority = TicketModel.Priority.defaultPriority;\r
if (priorityModel.getObject() != null) {\r