summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/pages
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-03-05 11:19:50 -0500
committerJames Moger <james.moger@gitblit.com>2014-03-05 11:42:34 -0500
commit7ae1fac1236d61c6b60d295bdc06caa654fa8098 (patch)
tree73c64c4868b92d300b8b25ecd5346b4458e09427 /src/main/java/com/gitblit/wicket/pages
parent1626c6e7d590a238d02dd8b64fc18e6eea6afbee (diff)
downloadgitblit-7ae1fac1236d61c6b60d295bdc06caa654fa8098.tar.gz
gitblit-7ae1fac1236d61c6b60d295bdc06caa654fa8098.zip
Allow changing status from edit ticket page
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/EditTicketPage.html1
-rw-r--r--src/main/java/com/gitblit/wicket/pages/EditTicketPage.java22
-rw-r--r--src/main/java/com/gitblit/wicket/pages/TicketPage.java5
3 files changed, 27 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.html b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.html
index 424eece3..b3c102d9 100644
--- a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.html
+++ b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.html
@@ -39,6 +39,7 @@
</div>
</td></tr>
<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>
+ <tr><th><wicket:message key="gb.status"></wicket:message><span style="color:red;">*</span></th><td class="edit"><select class="input-large" wicket:id="status"></select></td></tr>
<tr wicket:id="responsible"></tr>
<tr wicket:id="milestone"></tr>
<tr wicket:id="mergeto"></tr>
diff --git a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java
index aad1d6fe..32b202fb 100644
--- a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java
@@ -72,6 +72,8 @@ public class EditTicketPage extends RepositoryPage {
private IModel<String> mergeToModel;
+ private IModel<Status> statusModel;
+
private IModel<TicketResponsible> responsibleModel;
private IModel<TicketMilestone> milestoneModel;
@@ -110,6 +112,7 @@ public class EditTicketPage extends RepositoryPage {
responsibleModel = Model.of();
milestoneModel = Model.of();
mergeToModel = Model.of(ticket.mergeTo == null ? "" : ticket.mergeTo);
+ statusModel = Model.of(ticket.status);
setStatelessHint(false);
setOutputMarkupId(true);
@@ -145,6 +148,12 @@ public class EditTicketPage extends RepositoryPage {
change.setField(Field.body, description);
}
+ Status status = statusModel.getObject();
+ if (!ticket.status.equals(status)) {
+ // status change
+ change.setField(Field.status, status);
+ }
+
Type type = typeModel.getObject();
if (!ticket.type.equals(type)) {
// type change
@@ -213,6 +222,19 @@ public class EditTicketPage extends RepositoryPage {
typeChoices = Arrays.asList(TicketModel.Type.choices());
}
form.add(new DropDownChoice<TicketModel.Type>("type", typeModel, typeChoices));
+
+ List<Status> statusChoices;
+ if (ticket.isClosed()) {
+ statusChoices = Arrays.asList(ticket.status, Status.Open);
+ } else if (ticket.isProposal()) {
+ statusChoices = Arrays.asList(TicketModel.Status.proposalWorkflow);
+ } else if (ticket.isBug()) {
+ statusChoices = Arrays.asList(TicketModel.Status.bugWorkflow);
+ } else {
+ statusChoices = Arrays.asList(TicketModel.Status.requestWorkflow);
+ }
+ form.add(new DropDownChoice<TicketModel.Status>("status", statusModel, statusChoices));
+
form.add(new TextField<String>("title", titleModel));
form.add(new TextField<String>("topic", topicModel));
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java
index 3c1dbdf9..07382ad9 100644
--- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java
@@ -335,7 +335,10 @@ public class TicketPage extends TicketBasePage {
* STATUS
*/
List<Status> choices = new ArrayList<Status>();
- if (ticket.isProposal()) {
+ if (ticket.isClosed()) {
+ // re-open
+ choices.addAll(Arrays.asList(TicketModel.Status.Open));
+ } else if (ticket.isProposal()) {
choices.addAll(Arrays.asList(TicketModel.Status.proposalWorkflow));
} else if (ticket.isBug()) {
choices.addAll(Arrays.asList(TicketModel.Status.bugWorkflow));