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

<script type="text/javascript">	
	function scaricaFile() {
		var idDocumento = cpGetSlaveColumnValueOfCurrentRow('documenti', 'idDocumento');
		if (idDocumento) {
			juiceDownload('it.cedaf.icare.attivita.etc.DocAllegatiFileContentProvider', 'id=' + idDocumento);
		}		
	}
	
	function allegaFile() {				
		shellFileUploadDialog(
			'it.cedaf.icare.attivita.control.action.AllegaDocumentoExecutor', 
			'Scegliere il file...', 
			'Seleziona il Documento che si intende allegare:');		
	}
	
	function onUploadFile(fileName) {
		document.getElementById('idNomeFile').value = fileName;	
		shellSetBuiFormAsChanged();	
    }			

</script>

<j:tile slave="${_slave}" name="shell.slaveToolbar" />
<shell:grid description="nomeFile,60%; dimensione,10%; dataInserimento,30%" slave="${_slave}" />


<shell:fieldset title="${j:bundle('LBL_attivita_attivita_docAllegato_SET')}">
	<table border="0" cellpadding="0" cellspacing="3" width="100%">
		<tr>
			<td class="form-label">
				<shell:label prop="nomeFile" />
			</td>
			<td class="form-values">
				<bui:out modes="view" slave="${_slave}">
					<j:tile name="shell.plaintext" slave="${_slave}" prop="nomeFile" />
					<shell:button img="documentiallegati.download" text="Scarica file" href="javascript:scaricaFile();" />
				</bui:out>
				<bui:out modes="update" slave="${_slave}">
					<j:tile name="shell.plaintext" slave="${_slave}" prop="nomeFile" />
					<j:bind prop="nomeFile">
						<j:hidden />
					</j:bind>
				</bui:out>
				<bui:out modes="create" slave="${_slave}">
					<j:bind prop="nomeFile">
						<j:text class="form-normal-text" id="idNomeFile" readonly="true"/>
					</j:bind>
					<shell:button img="documentiallegati.browse" text="${j:bundle('LBL_attivita_attivita_docAllegatoSelect_BUTTON')}" 
						title="${j:bundle('LBL_attivita_attivita_docAllegatoSelect_TOOLTIP')}" href="javascript:allegaFile();" />				
				</bui:out>
			</td>			
		</tr>
		<bui:out modes="view, update" slave="${_slave}">
			<tr>
				<td class="form-label">
					<shell:label prop="dimensione" />
				</td>
				<td class="form-values">
					<j:tile name="shell.plaintext" slave="${_slave}" prop="dimensione" />
				</td>
			</tr>
			<tr>
				<td class="form-label">
					<shell:label prop="dataInserimento" />
				</td>
				<td class="form-values">
					<j:tile name="shell.plaintext" slave="${_slave}" prop="dataInserimento" />
				</td>
			</tr>
		</bui:out>
		<tr>
			<td class="form-label">
				<shell:label prop="note" />
			</td>
			<td class="form-values">
				<bui:out modes="view" slave="${_slave}">
					<j:tile name="shell.plaintext" slave="${_slave}" prop="note" />
				</bui:out>
				<bui:out modes="create,update" slave="${_slave}">
					<j:bind prop="note">
						<j:textarea class="form-long-textarea" />
						<shell:error />
					</j:bind>
				</bui:out>
			</td>
		</tr>
	</table>
</shell:fieldset>