richiediProtocollazioneExt.jsp 2.12 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
<%@ include file="/project/include.jsp" %>		

<script type="text/javascript">

	registerOnDocumentLoad(
		function impostaFascicolo() {
			try{
				var cookies=document.cookie.split(';');
				for (var i=0;i<cookies.length;i++){
					var cook=cookies[i].split('=');
					if (cook[0].trim()=="annoFascicolo"){
						$("#annoFascicolo").val(cook[1]);
					} else if (cook[0].trim()=="cFascicolo"){
						$("#cFascicolo").val(cook[1]);
					} else if (cook[0].trim()=="nFascicolo"){
						$("#nFascicolo").val(cook[1]);
					}
				}
			}
			catch(err){
				alert(err);
			}
			
			return false;
		}
	);
	
	
	function verificaFascicolo() {
		try{
			var nf=$("#nFascicolo").val();
			var i=nf.indexOf("-");
			if (i<0)
				nf=lpad(6,'0',nf);
			else
				nf=lpad(6,'0',nf.substring(0,i))+nf.substring(i);
			$("#numeroFascicolo").val($("#cFascicolo").val() + "/" + nf);
			
			var r=jsLoadString('it.cedaf.icare.wsiride20.control.action.LeggiFascicoloExecutor', '&anno='+$("#annoFascicolo").val()+'&num='+$("#numeroFascicolo").val());
			$("#oggettoFascicolo").text(r);
			
			document.cookie = "annoFascicolo="+$("#annoFascicolo").val();
			document.cookie = "cFascicolo="+$("#cFascicolo").val();
			document.cookie = "nFascicolo="+$("#nFascicolo").val();
		} catch(err){
			alert(err);
		}
		
		return false;
	}
	
	
	function lpad(width, padding, string) {
		return (width <= string.length) ? string : lpad(width, padding, padding + string);
	}

</script>

<tr>
	<td class="form-label">
		${j:bundle('LBL_commons_protocollo_fasc')}
	</td>
	<td class="form-values">
		<j:bind prop="annoFascicolo" >
			<j:text class="form-text" id="annoFascicolo" style="width:60px"/>
		</j:bind>
		<input type="text" class="form-text" id="cFascicolo" style="width:60px"/> 
		<input type="text" class="form-text" id="nFascicolo" style="width:100px"/> 
		<j:bind prop="numeroFascicolo" >
			<j:hidden id="numeroFascicolo"/> 
		</j:bind>
		<button onclick="return verificaFascicolo();" class="generic-button toolbar-extra-button ui-state-default ui-corner-all helper">verifica</button>
	</td>
</tr>

<tr>
	<td></td>
	<td>
		<span class="form-data" id="oggettoFascicolo"/>
    </td> 
</tr>