<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jspf/taglibs.jsp"%>

<c:set var="item" value="${frd.item}"/>

<html:form action="${form.requestURI}" styleClass="box">
	<input type="hidden" name="method" value="itemUpdate"/>
	<input type="hidden" name="id" value="${empty item ? '' : item.id}"/>
	<input type="hidden" name="returnUrl" value="${form.returnUrl}"/>

	<h3><c:choose>
		<c:when test="${not empty item}">${l.l('Редактировать позицию')}: ${item.title}</c:when>
		<c:otherwise>${l.l('Добавить позицию')}</c:otherwise>
	</c:choose></h3>

	<table class="data">
		<tr>
			<td class="label">${l.l('Наименование')} *</td>
			<td><input type="text" name="title" class="w100p" required
				value="${empty item ? '' : item.title}"/></td>
		</tr>
		<tr>
			<td class="label">${l.l('Тип номенклатуры')}</td>
			<td>
				<ui:combo-single name="itemTypeId" value="${empty item ? 0 : item.itemTypeId}" widthTextValue="20em">
					<jsp:attribute name="valuesHtml">
						<li value="0">—</li>
						<c:forEach var="t" items="${frd.typeList}">
							<li value="${t.id}">${t.title}</li>
						</c:forEach>
					</jsp:attribute>
				</ui:combo-single>
			</td>
		</tr>
	</table>

	<div class="mt1"><ui:form-ok-cancel/></div>
</html:form>

<%-- Parameters from item type --%>
<c:if test="${not empty frd.paramList}">
	<c:set var="list" value="${frd.paramList}"/>
	<c:set var="id" value="${item.id}"/>
	<c:set var="tableId" value="${u:uiid()}"/>
	<%@ include file="/WEB-INF/jspf/parameter_list.jsp"%>
</c:if>

<shell:state text="${l.l('Номенклатура')}"/>
