<%@ page contentType="text/html; charset=ISO-8859-15" language="java" %>
<%@ include file="/header.jsp" %>

<h2>>> Issues >> Edit</h2>

<%@ include file="navigation.jsp" %>

<%@ include file="errors.jsp" %>
<br>

<html:form action="/issue/edit/IssueRH.do" method="post">
<html:hidden property="issueId"/>

<table cellpadding="2">
	<tr>
		<td align="right" width="500">
			<c:if test="${mayEditIssue || mayProcessIssue}">
				<html:submit property="Save" value=" Save "/>&nbsp;
			</c:if>
			<html:submit property="Back" value=" Back "/>
		</td>
	</tr>
</table>

<table cellpadding="2">
	<tr>
		<td align="right"><b>ID</b></td>
		<td align="left">
			<c:choose>
				<c:when test="${issueForm.issueId == 0}">-</c:when>
				<c:otherwise><c:out value="${issueForm.issueId}"/></c:otherwise>
			</c:choose>
			</td>
	</tr>
	<tr>
		<td align="right"><b>Project</b></td>
		<c:choose>
			<c:when test="${mayEditIssue}">
				<td align="left">
				<html:select property="projectId">
					<html:options collection="projectIdOptions" property="value" labelProperty="label"/>
				</html:select></td>
			</c:when>
			<c:otherwise>
				<html:hidden property="projectId"/>
				<td align="left">
					<c:out value="${issueForm.projectName}"/></td>
			</c:otherwise>
		</c:choose>
	</tr>
	<tr>
		<td align="right"><b>Type</b></td>
		<c:choose>
			<c:when test="${mayEditIssue}">
				<td align="left">
					<html:radio property="type" value="1"/>Bug report
					<html:radio property="type" value="2"/>Feature/Change Request</td>
			</c:when>
			<c:otherwise>
				<html:hidden property="type"/>
				<td align="left">
					<c:out value="${issueForm.typeName}"/></td>
			</c:otherwise>
		</c:choose>
	</tr>
	<tr>
		<td align="right"><b>Priority</b></td>
		<c:choose>
			<c:when test="${mayEditIssue}">
				<td align="left">
					<html:radio property="priority" value="1"/>1
					<html:radio property="priority" value="2"/>2
					<html:radio property="priority" value="3"/>3
					<html:radio property="priority" value="4"/>4
					<html:radio property="priority" value="5"/>5</td>
			</c:when>
			<c:otherwise>
				<html:hidden property="priority"/>
				<td align="left">
					<c:out value="${issueForm.priority}"/></td>
			</c:otherwise>
		</c:choose>
	</tr>
	<c:if test="${not newIssue}">
		<tr>
			<td align="right"><b>Status</b></td>
			<c:choose>
				<c:when test="${mayEditIssue}">
					<td align="left">
						<html:radio property="status" value="1"/>New
						<html:radio property="status" value="2"/>Open
						<html:radio property="status" value="3"/>Processed
						<html:radio property="status" value="6"/>Tested
						<html:radio property="status" value="4"/>Closed
						<html:radio property="status" value="5"/>Rejected</td>
				</c:when>
				<c:otherwise>
					<c:choose>
						<c:when test="${mayProcessIssue}">
							<td align="left">
								<html:radio property="status" value="2"/>Open
								<html:radio property="status" value="3"/>Processed</td>
						</c:when>
						<c:otherwise>
							<html:hidden property="status"/>
							<td align="left">
								<c:out value="${issueForm.statusName}"/></td>
						</c:otherwise>
					</c:choose>
				</c:otherwise>
			</c:choose>
		</tr>
	</c:if>
	<c:if test="${not newIssue}">
		<tr>
			<td align="right"><b>Reported by</b></td>
			<td align="left">
				<c:out value="${issueForm.reporterName}"/></td>
		</tr>
		<tr>
			<td align="right"><b>Developer</b></td>
			<c:choose>
				<c:when test="${mayEditIssue}">
					<td align="left">
						<html:select property="developerId">
							<html:options collection="developerOptions" property="value" labelProperty="label"/>
						</html:select></td>
				</c:when>
				<c:otherwise>
					<html:hidden property="developerId"/>
					<td align="left">
						<c:out value="${issueForm.developerName}"/></td>
				</c:otherwise>
			</c:choose>
		</tr>
	</c:if>
	<tr>
		<td align="right"><b>Subject</b></td>
		<c:choose>
			<c:when test="${mayEditIssue}">
				<td align="left">
					<html:text property="name" size="40" maxlength="64"/></td>
			</c:when>
			<c:otherwise>
				<html:hidden property="name"/>
				<td align="left">
					<c:out value="${issueForm.name}"/></td>
			</c:otherwise>
		</c:choose>
	</tr>
	<tr>
		<td align="right" valign="top"><b>Description</b></td>
		<c:choose>
			<c:when test="${mayEditIssue}">
				<td align="left" valign="top">
					<html:textarea cols="50" rows="6" property="description"/></td>
			</c:when>
			<c:otherwise>
				<html:hidden property="description"/>
				<td align="left">
					<c:out value="${issueForm.description}"/></td>
			</c:otherwise>
		</c:choose>
	</tr>
	<c:if test="${mayProcessIssue and not newIssue}">
		<tr>
			<td align="right" valign="top"><b>Comment</b></td>
			<td align="left" valign="top">
				<html:textarea cols="50" rows="4" property="comment"/></td>
		</tr>
	</c:if>
</table>

<c:if test="${not empty issueForm.historyEntries}">
	<table cellpadding="2">
		<tr>
			<td height="20"><spacer height="20"></td>
		</tr>
		<tr>
			<td align="left" valign="top"><b>History</b></td>
		</tr>
		<c:forEach items="${issueForm.historyEntries}" var="entry">
			<tr>
				<td align="left" valign="top"><c:out value="${entry.date}"/> - <b><c:out value="${entry.editor}"/></b> - <c:out value="${entry.status}"/>: <c:out value="${entry.comment}"/></td>
			</tr>
		</c:forEach>
	</table>
</c:if>

</html:form>

<%@ include file="/footer.jsp" %>
