| | |
| | | currentUser = UserModel.ANONYMOUS;
|
| | | }
|
| | |
|
| | | if (!currentUser.isAuthenticated || !app().tickets().isAcceptingTicketUpdates(getRepositoryModel())) {
|
| | | // tickets prohibited
|
| | | setResponsePage(TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName));
|
| | | }
|
| | |
|
| | | long ticketId = 0L;
|
| | | try {
|
| | | String h = WicketUtils.getObject(params);
|
| | |
| | | }
|
| | |
|
| | | TicketModel ticket = app().tickets().getTicket(getRepositoryModel(), ticketId);
|
| | | if (ticket == null) {
|
| | | setResponsePage(TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName));
|
| | | if (ticket == null
|
| | | || !currentUser.canEdit(ticket, getRepositoryModel())
|
| | | || !app().tickets().isAcceptingTicketUpdates(getRepositoryModel())) {
|
| | | setResponsePage(TicketsPage.class, WicketUtils.newObjectParameter(repositoryName, "" + ticketId));
|
| | | }
|
| | |
|
| | | typeModel = Model.of(ticket.type);
|
| | |
| | | }
|
| | | 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));
|
| | |
|
| | |
| | | descriptionEditor.setText(ticket.body);
|
| | | form.add(descriptionEditor);
|
| | |
|
| | | if (currentUser != null && currentUser.isAuthenticated && currentUser.canPush(getRepositoryModel())) {
|
| | | // status
|
| | | 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);
|
| | | }
|
| | | Fragment status = new Fragment("status", "statusFragment", this);
|
| | | status.add(new DropDownChoice<TicketModel.Status>("status", statusModel, statusChoices));
|
| | | form.add(status);
|
| | |
|
| | | // responsible
|
| | | Set<String> userlist = new TreeSet<String>(ticket.getParticipants());
|
| | |
|
| | |
| | | Fragment mergeto = new Fragment("mergeto", "mergeToFragment", this);
|
| | | mergeto.add(new DropDownChoice<String>("mergeto", mergeToModel, branches));
|
| | | form.add(mergeto.setVisible(!branches.isEmpty()));
|
| | |
|
| | | } else {
|
| | | // user does not have permission to assign milestone or responsible
|
| | | form.add(new Label("responsible").setVisible(false));
|
| | | form.add(new Label("milestone").setVisible(false));
|
| | | form.add(new Label("mergeto").setVisible(false));
|
| | | }
|
| | |
|
| | | form.add(new Button("update"));
|
| | | Button cancel = new Button("cancel") {
|