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

<script type="text/javascript">	
	function changeCondizione(combo) {
		var codCondizione = combo.value;
		if (codCondizione == '') {
			clearCombo('idParamCondizione');
			return;
		}
		
		var params = 'codCondizione=' + codCondizione;
		loadStandardSelectOptionsAndFill('idParamCondizione',
			'it.cedaf.icare.notifiche.control.binding.requestbean.valuesetproviders.ParamCondizioneNotificaValueSetProvider(codCondizione)', 
			params, ' ');
	}
</script>
 		
<center> 	
<shell:fieldset title="Condizioni generali">
	<table border="0" cellspacing="3" cellpadding="0" >		
		<tr>
			<td class="form-label">
				<shell:label prop="codice" />
			</td>
			<td class="form-values">
				<c:choose>
					<c:when test="${bui:isMode(null, 'record_created')}">
						<j:bind prop="codice">
							<j:text class="form-normal-text" />
							<shell:error />
						</j:bind>
					</c:when>
					<c:otherwise>
						<j:tile name="shell.plaintext" prop="codice" />
					</c:otherwise>
				</c:choose>
			</td>
		</tr>
		<tr>
			<td class="form-label">
				<shell:label prop="descrizione" />
			</td>
			<td class="form-values">
				<bui:out modes="view">
					<j:tile name="shell.plaintext" prop="descrizione" />
				</bui:out>
				<bui:out modes="create, update">
					<j:bind prop="descrizione">
						<j:text class="form-long-text" />
						<shell:error />
					</j:bind>
				</bui:out>
			</td>
		</tr>	
		<tr>
			<td class="form-label">
				<shell:label prop="ente" />
			</td>
			<td class="form-data">
				<bui:out modes="view">
					<j:tile name="shell.plaintext" prop="ente" />
				</bui:out>
				<bui:out modes="create, update">
					<c:choose>
						<c:when test="${!empty bloccaEnte && bloccaEnte == 'true'}">
							<j:tile name="shell.plaintext" prop="ente" />
							<j:bind prop="ente">
								<j:hidden />
							</j:bind>
						</c:when>
						<c:otherwise>
							<j:bind prop="ente">
								<j:select id="idEnte" class="form-input" emptyOptionDescr="" onChange="getServiziOnChangeEnte('idEnte', 'idServizio');"/> 
								<shell:error />
							</j:bind>
						</c:otherwise>
					</c:choose>		
				</bui:out>
			</td>
		</tr>
		<tr>
			<td class="form-label">
				<shell:label prop="servizio" />
			</td>
			<td class="form-data">
				<bui:out modes="view">
					<j:tile name="shell.plaintext" prop="servizio" />
				</bui:out>
				<bui:out modes="create, update">
					<c:choose>
						<c:when test="${!empty bloccaServizio && bloccaServizio == 'true'}">
							<j:tile name="shell.plaintext" prop="servizio" />
							<j:bind prop="servizio">
								<j:hidden />
							</j:bind>
						</c:when>
						<c:otherwise>
							<j:bind prop="servizio">
								<j:select id="idServizio" class="form-input" emptyOptionDescr="" /> 
								<shell:error />
							</j:bind>
						</c:otherwise>
					</c:choose>						
				</bui:out>
			</td>
		</tr>	
		<tr>
			<td class="form-label">
				<shell:label prop="condizione" />
			</td>
			<td class="form-values">
				<bui:out modes="view, update">
					<j:tile name="shell.plaintext" prop="condizione" />
				</bui:out>
				<bui:out modes="create">
					<j:bind prop="condizione">
						<j:select id="idCondizione" class="form-input" emptyOptionDescr="" onChange="changeCondizione(this);"/> 
						<shell:error />
					</j:bind>
				</bui:out>
			</td>
		</tr>	
		<tr>
			<td class="form-label">
				<shell:label prop="paramCondizione" />
			</td>
			<td class="form-values">
				<bui:out modes="view">
					<j:tile name="shell.plaintext" prop="paramCondizione" />
				</bui:out>
				<bui:out modes="create, update">
					<j:bind prop="paramCondizione">
						<j:select id="idParamCondizione" class="form-input" emptyOptionDescr=""/>
						<shell:error />
					</j:bind>
				</bui:out>
			</td>
		</tr>
		<tr>
			<td class="form-label">
				<shell:label prop="note" />
			</td>
			<td class="form-values">
				<bui:out modes="view">
					<j:tile name="shell.plaintext" prop="note" />
				</bui:out>
				<bui:out modes="create, update">
					<j:bind prop="note">
						<j:textarea class="form-normal-textarea" />
						<shell:error />
					</j:bind>
				</bui:out>
			</td>
		</tr>
 	</table>
</shell:fieldset>
</center>