Sat, 23 May 2020 13:24:49 +0200
issue and version form now also work if no project is selected in the session
universe@75 | 1 | <%-- |
universe@75 | 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
universe@75 | 3 | |
universe@75 | 4 | Copyright 2018 Mike Becker. All rights reserved. |
universe@75 | 5 | |
universe@75 | 6 | Redistribution and use in source and binary forms, with or without |
universe@75 | 7 | modification, are permitted provided that the following conditions are met: |
universe@75 | 8 | |
universe@75 | 9 | 1. Redistributions of source code must retain the above copyright |
universe@75 | 10 | notice, this list of conditions and the following disclaimer. |
universe@75 | 11 | |
universe@75 | 12 | 2. Redistributions in binary form must reproduce the above copyright |
universe@75 | 13 | notice, this list of conditions and the following disclaimer in the |
universe@75 | 14 | documentation and/or other materials provided with the distribution. |
universe@75 | 15 | |
universe@75 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
universe@75 | 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
universe@75 | 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
universe@75 | 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
universe@75 | 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
universe@75 | 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
universe@75 | 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
universe@75 | 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
universe@75 | 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
universe@75 | 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
universe@75 | 26 | --%> |
universe@75 | 27 | <%@page pageEncoding="UTF-8" %> |
universe@75 | 28 | <%@page import="de.uapcore.lightpit.Constants" %> |
universe@75 | 29 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> |
universe@75 | 30 | <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> |
universe@75 | 31 | |
universe@75 | 32 | <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/> |
universe@75 | 33 | |
universe@76 | 34 | <jsp:useBean id="projects" type="java.util.List<de.uapcore.lightpit.entities.Project>" scope="request" /> |
universe@75 | 35 | <jsp:useBean id="issue" type="de.uapcore.lightpit.entities.Issue" scope="request"/> |
universe@75 | 36 | <jsp:useBean id="issueStatusEnum" type="de.uapcore.lightpit.entities.IssueStatus[]" scope="request"/> |
universe@75 | 37 | <jsp:useBean id="issueCategoryEnum" type="de.uapcore.lightpit.entities.IssueCategory[]" scope="request"/> |
universe@75 | 38 | <jsp:useBean id="users" type="java.util.List<de.uapcore.lightpit.entities.User>" scope="request"/> |
universe@75 | 39 | |
universe@75 | 40 | <form action="./${moduleInfo.modulePath}/issues/commit" method="post"> |
universe@75 | 41 | <table class="formtable"> |
universe@75 | 42 | <colgroup> |
universe@75 | 43 | <col> |
universe@75 | 44 | <col style="width: 75ch"> |
universe@75 | 45 | </colgroup> |
universe@75 | 46 | <tbody> |
universe@75 | 47 | <tr> |
universe@76 | 48 | <th><fmt:message key="thead.issue.project"/></th> |
universe@76 | 49 | <td> |
universe@76 | 50 | <select name="pid" required> |
universe@76 | 51 | <c:forEach var="project" items="${projects}"> |
universe@76 | 52 | <option value="${project.id}" <c:if test="${project eq issue.project}">selected</c:if> > |
universe@76 | 53 | <c:out value="${project.name}" /> |
universe@76 | 54 | </option> |
universe@76 | 55 | </c:forEach> |
universe@76 | 56 | </select> |
universe@76 | 57 | </td> |
universe@76 | 58 | </tr> |
universe@76 | 59 | <tr> |
universe@75 | 60 | <th><fmt:message key="thead.issue.category"/></th> |
universe@75 | 61 | <td> |
universe@75 | 62 | <select name="category"> |
universe@75 | 63 | <c:forEach var="category" items="${issueCategoryEnum}"> |
universe@75 | 64 | <option |
universe@75 | 65 | <c:if test="${category eq issue.category}">selected</c:if> |
universe@75 | 66 | value="${category}"> |
universe@75 | 67 | <fmt:message key="issue.category.${category}" /> |
universe@75 | 68 | </option> |
universe@75 | 69 | </c:forEach> |
universe@75 | 70 | </select> |
universe@75 | 71 | </td> |
universe@75 | 72 | </tr> |
universe@75 | 73 | <tr> |
universe@75 | 74 | <th><fmt:message key="thead.issue.status"/></th> |
universe@75 | 75 | <td> |
universe@75 | 76 | <select name="status"> |
universe@75 | 77 | <c:forEach var="status" items="${issueStatusEnum}"> |
universe@75 | 78 | <option |
universe@75 | 79 | <c:if test="${status eq issue.status}">selected</c:if> |
universe@75 | 80 | value="${status}"> |
universe@75 | 81 | <fmt:message key="issue.status.${status}" /> |
universe@75 | 82 | </option> |
universe@75 | 83 | </c:forEach> |
universe@75 | 84 | </select> |
universe@75 | 85 | </td> |
universe@75 | 86 | </tr> |
universe@75 | 87 | <tr> |
universe@75 | 88 | <th><fmt:message key="thead.issue.subject"/></th> |
universe@75 | 89 | <td><input name="subject" type="text" maxlength="20" required value="<c:out value="${issue.subject}"/>" /></td> |
universe@75 | 90 | </tr> |
universe@75 | 91 | <tr> |
universe@75 | 92 | <th class="vtop"><fmt:message key="thead.issue.description"/></th> |
universe@75 | 93 | <td> |
universe@75 | 94 | <textarea name="description"><c:out value="${issue.description}"/></textarea> |
universe@75 | 95 | </td> |
universe@75 | 96 | </tr> |
universe@75 | 97 | <tr> |
universe@75 | 98 | <th><fmt:message key="thead.issue.assignee"/></th> |
universe@75 | 99 | <td> |
universe@75 | 100 | <select name="assignee"> |
universe@75 | 101 | <option value="-1"><fmt:message key="placeholder.null-assignee"/></option> |
universe@75 | 102 | <c:forEach var="user" items="${users}"> |
universe@75 | 103 | <option |
universe@75 | 104 | <c:if test="${not empty issue.assignee and user eq issue.assignee}">selected</c:if> |
universe@75 | 105 | value="${user.id}"><c:out value="${user.displayname}"/></option> |
universe@75 | 106 | </c:forEach> |
universe@75 | 107 | </select> |
universe@75 | 108 | </td> |
universe@75 | 109 | </tr> |
universe@75 | 110 | <tr> |
universe@75 | 111 | <th> |
universe@75 | 112 | <c:choose> |
universe@75 | 113 | <c:when test="${issue.affectedVersions.size() gt 1}"> |
universe@75 | 114 | <fmt:message key="thead.issue.affected-versions"/> |
universe@75 | 115 | </c:when> |
universe@75 | 116 | <c:otherwise> |
universe@75 | 117 | <fmt:message key="thead.issue.affected-version"/> |
universe@75 | 118 | </c:otherwise> |
universe@75 | 119 | </c:choose> |
universe@75 | 120 | </th> |
universe@75 | 121 | <td>TODO</td> |
universe@75 | 122 | </tr> |
universe@75 | 123 | <tr> |
universe@75 | 124 | <th> |
universe@75 | 125 | <c:choose> |
universe@75 | 126 | <c:when test="${issue.scheduledVersions.size() gt 1}"> |
universe@75 | 127 | <fmt:message key="thead.issue.scheduled-versions"/> |
universe@75 | 128 | </c:when> |
universe@75 | 129 | <c:otherwise> |
universe@75 | 130 | <fmt:message key="thead.issue.scheduled-version"/> |
universe@75 | 131 | </c:otherwise> |
universe@75 | 132 | </c:choose> |
universe@75 | 133 | </th> |
universe@75 | 134 | <td>TODO</td> |
universe@75 | 135 | </tr> |
universe@75 | 136 | <tr> |
universe@75 | 137 | <th> |
universe@75 | 138 | <c:choose> |
universe@75 | 139 | <c:when test="${issue.resolvedVersions.size() gt 1}"> |
universe@75 | 140 | <fmt:message key="thead.issue.resolved-versions"/> |
universe@75 | 141 | </c:when> |
universe@75 | 142 | <c:otherwise> |
universe@75 | 143 | <fmt:message key="thead.issue.resolved-version"/> |
universe@75 | 144 | </c:otherwise> |
universe@75 | 145 | </c:choose> |
universe@75 | 146 | </th> |
universe@75 | 147 | <td>TODO</td> |
universe@75 | 148 | </tr> |
universe@75 | 149 | <tr> |
universe@75 | 150 | <th><fmt:message key="thead.issue.eta"/></th> |
universe@75 | 151 | <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td> |
universe@75 | 152 | </tr> |
universe@75 | 153 | <tr> |
universe@75 | 154 | <th><fmt:message key="thead.issue.created"/></th> |
universe@75 | 155 | <td><fmt:formatDate value="${issue.created}" /></td> |
universe@75 | 156 | </tr> |
universe@75 | 157 | <tr> |
universe@75 | 158 | <th><fmt:message key="thead.issue.updated"/></th> |
universe@75 | 159 | <td><fmt:formatDate value="${issue.updated}" /></td> |
universe@75 | 160 | </tr> |
universe@75 | 161 | </tbody> |
universe@75 | 162 | <tfoot> |
universe@75 | 163 | <tr> |
universe@75 | 164 | <td colspan="2"> |
universe@75 | 165 | <input type="hidden" name="id" value="${issue.id}"/> |
universe@76 | 166 | <c:choose> |
universe@76 | 167 | <c:when test="${not empty issue.project and issue.project.id ge 0}"> |
universe@76 | 168 | <c:set var="cancelUrl">./${moduleInfo.modulePath}/view?pid=${issue.project.id}</c:set> |
universe@76 | 169 | </c:when> |
universe@76 | 170 | <c:otherwise> |
universe@76 | 171 | <c:set var="cancelUrl">./${moduleInfo.modulePath}/</c:set> |
universe@76 | 172 | </c:otherwise> |
universe@76 | 173 | </c:choose> |
universe@76 | 174 | <a href="${cancelUrl}" class="button"> |
universe@75 | 175 | <fmt:message bundle="${lightpit_bundle}" key="button.cancel"/> |
universe@75 | 176 | </a> |
universe@75 | 177 | <button type="submit"><fmt:message bundle="${lightpit_bundle}" key="button.okay"/></button> |
universe@75 | 178 | </td> |
universe@75 | 179 | </tr> |
universe@75 | 180 | </tfoot> |
universe@75 | 181 | </table> |
universe@75 | 182 | </form> |