viewSendTo.jsp 5.64 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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
<%@ include file="/project/include.jsp"%>
 
<script type="text/javascript" src="${j:getResourceUrlOfModule('commons','js/utils.js') }"></script>
<script type="text/javascript">
	function sendToNuovoOperatore() {
		var idEntita = document.getElementById('idEntita').value;
		var blnSerRif = document.getElementById('rdOpRif').checked ? 'true' : 'false';
		var result = jsLoadString('it.cedaf.icare.commons.control.action.CheckSendToExecutor', 
			'&idEntita=' + idEntita + '&changeOpRif=' + blnSerRif + '&dmKey=' + parent.bui_datamanagement.getKey());
	
		if(result != "OK") {
			alert(result);
			return false;
		}
		
		document.getElementById('selectNuovoOperatore').disabled = false;
		var form = document.getElementById('formSendTo');
		juiceSubmitForm(form);
	}

	registerOnDocumentLoad(function() {
		var idUo = getComboValueById('selectNuovaUnitaOperativa');
		if (idUo && idUo != '') {
			var selectUo = document.getElementById('selectNuovaUnitaOperativa');
			var idOpDefault = '${dto_idOpDefault}';

			juiceClearSelectTitleOptions(selectUo); 
			getOperatoriSendToByUO('selectNuovoOperatore','selectNuovaUnitaOperativa', idOpDefault);
			
			var bloccaUo = ${dto_bloccaUo};
			selectUo.disabled = bloccaUo;
	
			var selectOp = document.getElementById('selectNuovoOperatore');						
			
			if (selectOp) {
				selectOp.disabled = false;
				
				if (idOpDefault && idOpDefault != '') {
					selectComboElementByValue(selectOp, idOpDefault);
					if (getComboValueById('selectNuovoOperatore') != '') {
						var bloccaOp = ${dto_bloccaOp};
						selectOp.disabled = bloccaUo;
					}
				}
			}
		}
		
	}
	);
	
	function onChangeSelect_selectNuovoOperatore() {
		if (getComboValueById('selectNuovoOperatore') != '') {
			var bloccaOp = ${dto_bloccaOp};
			document.getElementById('selectNuovoOperatore').disabled = bloccaOp;
		} else {
			document.getElementById('selectNuovoOperatore').disabled = false;
		}
	}
	
	function getOperatoriSendToByUO(idComboOperatore, idComboUO, idOp) {;
		var params = '';
		params += 'idServizio=' + document.getElementById('idServizio').value;
		params += '&dmIdentifier=' + document.getElementById('dmIdentifier').value;
		params += '&idEntita=' + document.getElementById('idEntita').value;
		params += '&tipoEntita=' + document.getElementById('tipoEntita').value;
					
		var dateObj = document.getElementById("dataCollocazioneCLD");
		if (dateObj && isDate(dateObj.value)) {
			params += '&dataCollocazione=' + dateObj.value;
		}
		var comboUO = document.getElementById(idComboUO);
		var selectedValue = comboUO.options[comboUO.selectedIndex].value;
		var existsUO = false;
		if(selectedValue && selectedValue != ''){
			existsUO = true;
			if (params.length > 0)
				params += '&idUo=' + selectedValue;
			else
				params += 'idUo=' + selectedValue;
		} 
		var comboOperatore = document.getElementById(idComboOperatore);
		var idOperatore = -1;
		if (comboOperatore.length > 0){
			idOperatore = comboOperatore.options[comboOperatore.selectedIndex].value;
			clearCombo(idComboOperatore);
		}
		if (existsUO) { 
			var selOpValue = null;
			if (idOp && idOp != '') {
				selOpValue = idOp;
			}
			
			jsLoadSelectOptionsAndFill(idComboOperatore, 'it.cedaf.icare.commons.OperatoriInvioByUOSelectOptions', params, ' ', null, selOpValue, 'false');
			
		}
	}
</script>

<j:form id="formSendTo" name="formSendTo" event="sendToAction" method="POST">
<table border="0" cellspacing="3" cellpadding="0" width="99%">

	<tr>
		<td class="form-label">
			<span>${j:bundle('LBL_commons_nuovoUOAbil')}</span>
		</td>
		<td class="form-values">
			<j:bind prop="nuovaUnitaOperativa">
				<j:select id="selectNuovaUnitaOperativa" class="form-input" onchange="juiceClearSelectTitleOptions(this); getOperatoriSendToByUO('selectNuovoOperatore','selectNuovaUnitaOperativa')"/>
				<shell:error />
			</j:bind>
		</td>
	</tr>
	
	<tr>
		<td class="form-label">
			<span>${j:bundle('LBL_commons_nuovoOPAbil')}</span>
		</td>
		<td class="form-values">
			<j:bind prop="nuovoOperatore">
				<j:select id="selectNuovoOperatore" class="form-input" emptyOptionDescr=" " />
				<shell:error />
			</j:bind>
		</td>
	</tr>
	<% String displayOpRif = ""; %>
	<c:choose>
		<c:when test="${dto_abilitaSceltaCambioOpRif == 'true'}">
			<% displayOpRif = "display:normal"; %>
		</c:when>
		<c:otherwise>
			<% displayOpRif = "display:none"; %>
		</c:otherwise>
	</c:choose>	
	<tr style="<%=displayOpRif%>">
		<td class="form-label">
			<span>${j:bundle('LBL_commons_cambiaOPRif')}</span>
		</td>
		<td class="form-values">
			<j:bind prop="cambiaOperatoreRiferimento">
				<j:radio id="rdOpRif" displayValue="si" />${j:bundle('LBL_si')}
				<j:radio displayValue="no" />${j:bundle('LBL_no')}
				<shell:error />
			</j:bind>			
		</td>
	</tr>
	<tr>
		<td class="form-label">
			<span>${j:bundle('LBL_autorizzazioni_invii_noteInvio')}</span>
		</td>
		<td class="form-values">
		<j:bind prop="noteInvio">
			<j:textarea class="form-normal-textarea" id="noteInvio"/>
				<shell:error />
		</j:bind>
		</td>
	</tr>
	<tr>
		<td class="form-values" colspan="2" align="center">
		<br>
			&nbsp;&nbsp;
			<button class="generic-button ui-state-default ui-corner-all" onclick="javascript:return sendToNuovoOperatore();">
				<img src="${j:getResourceUrlOfModule('commons','img/inviaA.gif')}" width="16" height="16" border="0" align="absmiddle"/>&nbsp;
				${j:bundle('LBL_commons_invia')}
			</button>
		</td>
	</tr>
	
</table>


<j:bind prop="idOggetto">
	<j:hidden id="idEntita"/>
</j:bind>
<j:bind prop="tipoOggetto">
	<j:hidden id="tipoEntita" />
</j:bind>
<j:bind prop="idServizio">
	<j:hidden id="idServizio" />
</j:bind>
<j:bind prop="dmIdentifier">
	<j:hidden id="dmIdentifier" />
</j:bind>
<j:bind prop="descrizioneOggetto">
	<j:hidden />
</j:bind>

</j:form>