\r
private IModel<String> mergeToModel;\r
\r
+ private IModel<Status> statusModel;\r
+\r
private IModel<TicketResponsible> responsibleModel;\r
\r
private IModel<TicketMilestone> milestoneModel;\r
responsibleModel = Model.of();\r
milestoneModel = Model.of();\r
mergeToModel = Model.of(ticket.mergeTo == null ? "" : ticket.mergeTo);\r
+ statusModel = Model.of(ticket.status);\r
\r
setStatelessHint(false);\r
setOutputMarkupId(true);\r
change.setField(Field.body, description);\r
}\r
\r
+ Status status = statusModel.getObject();\r
+ if (!ticket.status.equals(status)) {\r
+ // status change\r
+ change.setField(Field.status, status);\r
+ }\r
+\r
Type type = typeModel.getObject();\r
if (!ticket.type.equals(type)) {\r
// type change\r
typeChoices = Arrays.asList(TicketModel.Type.choices());\r
}\r
form.add(new DropDownChoice<TicketModel.Type>("type", typeModel, typeChoices));\r
+\r
+ List<Status> statusChoices;\r
+ if (ticket.isClosed()) {\r
+ statusChoices = Arrays.asList(ticket.status, Status.Open);\r
+ } else if (ticket.isProposal()) {\r
+ statusChoices = Arrays.asList(TicketModel.Status.proposalWorkflow);\r
+ } else if (ticket.isBug()) {\r
+ statusChoices = Arrays.asList(TicketModel.Status.bugWorkflow);\r
+ } else {\r
+ statusChoices = Arrays.asList(TicketModel.Status.requestWorkflow);\r
+ }\r
+ form.add(new DropDownChoice<TicketModel.Status>("status", statusModel, statusChoices));\r
+\r
form.add(new TextField<String>("title", titleModel));\r
form.add(new TextField<String>("topic", topicModel));\r
\r
* STATUS\r
*/\r
List<Status> choices = new ArrayList<Status>();\r
- if (ticket.isProposal()) {\r
+ if (ticket.isClosed()) {\r
+ // re-open\r
+ choices.addAll(Arrays.asList(TicketModel.Status.Open));\r
+ } else if (ticket.isProposal()) {\r
choices.addAll(Arrays.asList(TicketModel.Status.proposalWorkflow));\r
} else if (ticket.isBug()) {\r
choices.addAll(Arrays.asList(TicketModel.Status.bugWorkflow));\r