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

<script type="text/javascript">
	function onClickCheckbox(checkbox) {
		var id = checkbox.value;
		var img = document.getElementById(id + "_a");
		if (img) img.style.display =  checkbox.checked ? 'inline' : 'none'; 
		img = document.getElementById(id + "_b");
		if (img) img.style.display =  checkbox.checked ? 'none' : 'inline'; 
	}
</script>

<form name="entityForm">
<table border="0" cellpadding="0" cellspacing="3" width="100%">
	<tr>
		<td width="40%" style="text-align: left;">
			<shell:highlight>
			<img src="${j:getResourceUrlOfModule('commons','img/entities/soggetto.gif')}" width="24" height="24" border="0" align="absmiddle"><span class="generic-label" style="font-size: 12px;">&nbsp;Soggetto A</span>
			<br><a href="javascript:updateSoggetto(${dto_main.idSoggettoA});" class="form-data-link" style="font-size: 12px;">${dto_main.nominativoA}</a><span class="form-data" style="font-size: 12px;">&nbsp;[${dto_main.icaroCodeA}]</span> 			 
			</shell:highlight>		   
		</td>
		<td width="4%">&nbsp;</td>
		<td width="40%" style="text-align: left;">
			<shell:highlight>
			<img src="${j:getResourceUrlOfModule('commons','img/entities/soggettoB.gif')}" width="24" height="24" border="0" align="absmiddle"><span class="generic-label" style="font-size: 12px;">&nbsp;Soggetto B</span>
			<br><a href="javascript:updateSoggetto(${dto_main.idSoggettoB});" class="form-data-link" style="font-size: 12px;">${dto_main.nominativoB}</a><span class="form-data" style="font-size: 12px;">&nbsp;[${dto_main.icaroCodeB}]</span> 	
			</shell:highlight>		    
		</td>
		<td width="4%">&nbsp;</td>
	</tr>
	<c:choose>
		<c:when test="${dto_main.eliminazioneSoggettoA}">
			<c:set var="elimina_descr" value="Elimina" /> 
		</c:when>
		<c:otherwise>
			<c:set var="elimina_descr" value="&nbsp;" /> 
		</c:otherwise>
	</c:choose>
	<c:forEach var="sez" items="${dto_main.sezioniEntita}">					
		<tr>
			<td class="form-data" style="padding-top: 16px; border-bottom: 1px dashed rgb(210, 210, 210);">${sez.titolo}</td>
			<td class="form-values" valign="bottom" style="padding-top: 16px; border-bottom: 1px dashed rgb(210, 210, 210);">Trasferisci</td>
			<td style="padding-top: 16px; border-bottom: 1px dashed rgb(210, 210, 210);">&nbsp;</td>
			<td class="form-values" valign="bottom" style="padding-top: 16px; border-bottom: 1px dashed rgb(210, 210, 210);">${elimina_descr}</td>
		</tr>  
		<c:forEach var="riga" items="${sez.elencoRighe}">
			<tr> 
				<c:choose>
					<c:when test="${riga.codA == null}">
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</c:when>
					<c:otherwise>
						<td class="form-values">${riga.valoreA}</td>
						<td>
						<input type="checkbox" name="entA" value="${riga.codA}" onclick="onClickCheckbox(this)"/>
						<img style="display: none" id="${riga.codA}_a" src="${j:getResourceUrlOfModule('commons','img/arrow_right_small.gif')}" width="16" height="16" border="0" align="absmiddle">
						<%--  <img style="display: inline;" id="${riga.codA}_b" src="${j:getResourceUrlOfModule('commons','img/delete-small.gif')}" width="16" height="16" border="0" align="absmiddle">--%>
						</td>
					</c:otherwise>
				</c:choose>
				<c:choose>
					<c:when test="${riga.codB == null}">
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</c:when>
					<c:otherwise>
						<td class="form-values">${riga.valoreB}</td>
						<c:choose>
							<c:when test="${dto_main.eliminazioneSoggettoA}">
								<td>
								<input type="checkbox" name="entB" value="${riga.codB}" onclick="onClickCheckbox(this)" />
								<img style="display: none" id="${riga.codB}_a" src="${j:getResourceUrlOfModule('commons','img/delete-small.gif')}" width="16" height="16" border="0" align="absmiddle">
								</td>
							</c:when>
							<c:otherwise>
								<td>&nbsp;</td>
							</c:otherwise>
						</c:choose>						
					</c:otherwise>
				</c:choose>
			</tr>
		</c:forEach>							
	</c:forEach>
</table>
</form>

<c:choose>
	<c:when test="${dto_main.eliminazioneSoggettoA}">
		<c:set var="attr_disabled" value="${dto_main.continua ? 'false' : 'true'}" /> 
		<c:set var="class_disabled" value="${dto_main.continua ? '' : ' ui-state-disabled'}" /> 
		<c:set var="js_onclick" value="${dto_main.continua ? 'javascript:eseguiOperazione(true);' : 'javascript://;'}" /> 
		<center>
		<button ${attr_disabled} class="generic-button ui-state-default ui-corner-all${class_disabled}" onclick="${js_onclick}">
			<img src="${j:getResourceUrlOfModule('commons', 'img/gears.gif')}" width="24" height="24" border="0" align="absmiddle">&nbsp;
			<span class="generic-label">Esegui l'unione dei soggetti, eliminando il soggetto A</span>
		</button>
		</center>
	</c:when>
	<c:otherwise>
		<center>
		<button class="generic-button ui-state-default ui-corner-all" onclick="javascript:eseguiOperazione(false);">
			<img src="${j:getResourceUrlOfModule('commons', 'img/gears.gif')}" width="24" height="24" border="0" align="absmiddle">&nbsp;
			<span class="generic-label">Esegui il trasferimento delle entit dal soggetto A al soggetto B</span>
		</button>
		</center>
	</c:otherwise>
</c:choose>