<%@ include file="/project/include.jsp" %>
<script type="text/javascript">	
	function setGiorniSettimanaCheck(giorni) {
		for (var i=0; i<7; i++) {
			document.getElementById("gsCheck_" + i).checked = (giorni.charAt(i) == 1);
		}	
	}
</script>	
<shell:fieldset title="Informazioni generali">	
	<table border="0" cellpadding="0" cellspacing="3" width="100%">	
		<tr>
			<td class="form-label">
				<shell:label prop="struttura" />
			</td>
			<td class="form-data">
				<bui:out modes="view, update">
					<j:tile name="shell.plaintext" prop="struttura" />
				</bui:out>
				<bui:out modes="create">
					<j:bind prop="struttura">
						<j:select class="form-input" emptyOptionDescr="" /> 
						<shell:error />
					</j:bind>	
				</bui:out>
			</td>
		</tr>		
		<tr>
			<td class="form-label">
				<shell:label prop="giorniSettimana" />
			</td>
			<td class="form-values">
				<table><tr>
				<td class="form-values">
					<bui:out modes="view">
						<j:tile name="shell.plaintext" prop="giorniSettimana" />
					</bui:out>				
					<bui:out modes="create,update">									
						<j:bind prop="giorniSettimana">
							<j:valueSetIterator>
								<j:checkbox id="gsCheck"/>${j:getValueSetItem().description}<br>
					        </j:valueSetIterator>
							<shell:error />
						</j:bind>
					</bui:out>
				</td>
				<td style="vertical-align:top;">
					<bui:out modes="create,update">
						&nbsp;&nbsp;<button class="generic-button ui-state-default ui-corner-all" onClick="javascript:setGiorniSettimanaCheck('1111100'); return false;">&nbsp;Lun-Ven&nbsp;</button>
						<br><div style="height:5px;"></div>
						&nbsp;&nbsp;<button class="generic-button ui-state-default ui-corner-all" onClick="javascript:setGiorniSettimanaCheck('1111110'); return false;">&nbsp;Lun-Sab&nbsp;</button>
						<br><div style="height:5px;"></div>
						&nbsp;&nbsp;<button class="generic-button ui-state-default ui-corner-all" onClick="javascript:setGiorniSettimanaCheck('1111111'); return false;">&nbsp;Lun-Dom&nbsp;</button>
					</bui:out>
					&nbsp;
				</td>
				
				</tr></table>
				
			</td>
		</tr>	
		<tr>
			<td class="form-label">
				<shell:label prop="includiGiorniFestivi" />
			</td>
			<td class="form-values" colspan="2">
				<bui:out modes="view">
					<j:tile  name="shell.plaintext" prop="includiGiorniFestivi" />
				</bui:out>				
				<bui:out modes="create,update">									
					<j:bind prop="includiGiorniFestivi">
						<j:radio displayValue="si"/>${j:bundle('LBL_si')}
						<j:radio displayValue="no"/>${j:bundle('LBL_no')}
						<shell:error />
						<shell:error />
					</j:bind>
				</bui:out>
			</td>
		</tr>		
		<tr>
			<td class="form-label">
				<shell:label prop="apertureStraordinarie" />
			</td>
			<td class="form-values">
				<bui:out modes="view">
					<j:tile  name="shell.plaintext" prop="apertureStraordinarie" />
				</bui:out>				
				<bui:out modes="create,update">									
					<j:bind prop="apertureStraordinarie">
						<j:textarea class="form-normal-textarea" />						
					</j:bind>
				</bui:out>
			</td>
		</tr>
 		<tr>
			<td class="form-label">
				<shell:label prop="numeroPostiLetto" />
			</td>
			<td class="form-values">
				<bui:out modes="view">
					<j:tile name="shell.plaintext" prop="numeroPostiLetto" />
				</bui:out>
				<bui:out modes="create, update">
					<j:bind prop="numeroPostiLetto">
						<j:text class="form-short-text" />
						<shell:error />
					</j:bind>
				</bui:out>
			</td>
 		</tr>		
		<bui:out modes="view">
			<tr>
				<td class="form-label">${j:bundle('LBL_anagrafiche_soggetto_visualizzaStorico')}</td>
				<td class="form-values">									
					<icare:viewStorico prop="vsInfoApe" provider="it.cedaf.icare.interventi.commons.InfoAperturaStrutturaStoricoInfoProvider"
										params="storicoPropertyName=storicoInfoApertura" 
										idField="id" />
				</td>
			</tr>
		</bui:out>	
		<bui:out modes="create, update">					
			<icare:storicizza2 prop="storicizzaInfoApertura" showDateOnCreate="true" />
		</bui:out>
	</table>
</shell:fieldset>