stampaBarcodeMassivo.jsp 2.62 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
<%@ include file="/project/include.jsp" %>

<script type="text/javascript">
	var tipoIntervento = null;
	var dataInizio = null;
	var dataFine = null;
	
	function stampaBarcodeMassivoJSAction() {
		tipoIntervento = $('#tipoInterventoID').val();
		dataInizio = $('#dataInizioCLD').val();
		dataFine = $('#dataFineCLD').val();
		
		if(stampaBarcodeMassivoFormValidator()){
			parent.hideModal('stampaBarcodeMassivo');
			
			shellDownload('it.cedaf.icare.customers.zcmgp.etc.StampaBarcodeMassivoContentProvider', 
					'tipoIntervento=' + tipoIntervento + '&dataInizio=' + dataInizio + '&dataFine=' + dataFine);
		}
	}	
	
	function stampaBarcodeMassivoFormValidator(){
		return isCorrectDate(dataInizio) && isCorrectDate(dataFine) && checkTipoIntervento();
	}
	
	function checkTipoIntervento(){
		var result = tipoIntervento.length > 0;
		if(!result){
			alert('Selezionare un tipo intervento');
			return result;
		}
		return result;
	}
	
	function isCorrectDate(date) {
		var dateToCheck = date;
		dateToCheck = completeDateString(dateToCheck);
		var result = dateToCheck != null;
		if (!result) {
			alert('Inserire una data nel formato: gg/mm/aaaa');
			return result;
		}
		return result;
	}
</script>

<table border="0" cellpadding="0" cellspacing="3" width="100%">
	<tr>
			<td class="form-label">
				Tipo intervento<span class="form-label-required">*</span>
			</td>
			<td class="form-values">
			<select id="tipoInterventoID">
				<option value="">Seleziona un tipo intervento...</option>
				<c:forEach items="${tipiInterventiDto.tipiInterventiItems}" var="tipoIntervento" varStatus="status">
					<option value="${tipoIntervento.id}">${tipoIntervento.codice} - ${tipoIntervento.descrizione}</option>
				</c:forEach>
			</select>
			</td>
		</tr>	
		<tr>
      		<td class="form-label">
    			Dal<span class="form-label-required">*</span>
    		</td>
    		<td class="form-values">
		    	<input type="text" class="form-date" id="dataInizioCLD" />
				<shell:calendar inputId="dataInizioCLD" />
		   	</td>
		</tr>
		<tr>
      		<td class="form-label">
    			Al<span class="form-label-required">*</span>
    		</td>
    		<td class="form-values">
		    	<input type="text" class="form-date" id="dataFineCLD" />
				<shell:calendar inputId="dataFineCLD" />
		   	</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td style="padding: 15px 4px 5px 4px;">
				<button class="generic-button ui-state-default ui-corner-all" onclick="stampaBarcodeMassivoJSAction();return false;"><img src="${j:getResourceUrlOfModule('shell', 'img/misc/confirm-small.gif')}" width="16" height="16" border="0" align="absmiddle">&nbsp;Stampa</button> 													
			</td>
		</tr>							
	</table>