| | |
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.MarkdownTextArea;
|
| | | import com.google.common.base.Optional;
|
| | |
|
| | | /**
|
| | | * Page for editing a ticket.
|
| | |
| | | change.setField(Field.title, title);
|
| | | }
|
| | |
|
| | | String description = descriptionEditor.getText();
|
| | | String description = Optional.fromNullable(descriptionEditor.getText()).or("");
|
| | | if ((StringUtils.isEmpty(ticket.body) && !StringUtils.isEmpty(description))
|
| | | || (!StringUtils.isEmpty(ticket.body) && !ticket.body.equals(description))) {
|
| | | // description change
|
| | |
| | | change.setField(Field.type, type);
|
| | | }
|
| | |
|
| | | String topic = topicModel.getObject();
|
| | | String topic = Optional.fromNullable(topicModel.getObject()).or("");
|
| | | if ((StringUtils.isEmpty(ticket.topic) && !StringUtils.isEmpty(topic))
|
| | | || (!StringUtils.isEmpty(topic) && !topic.equals(ticket.topic))) {
|
| | | || (!StringUtils.isEmpty(ticket.topic) && !ticket.topic.equals(topic))) {
|
| | | // topic change
|
| | | change.setField(Field.topic, topic);
|
| | | }
|
| | |
| | | if (ticket != null) {
|
| | | TicketNotifier notifier = app().tickets().createNotifier();
|
| | | notifier.sendMailing(ticket);
|
| | | setResponsePage(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number));
|
| | | redirectTo(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number));
|
| | | } else {
|
| | | // TODO error
|
| | | }
|
| | | } else {
|
| | | // nothing to change?!
|
| | | setResponsePage(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number));
|
| | | redirectTo(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number));
|
| | | }
|
| | | }
|
| | | });
|