<%@ include file="/project/include.jsp" %> <c:if test="${!empty refreshAgenda}"> <script type="text/javascript" >opener.loadGrid(true, true); window.close();</script> </c:if> <c:if test="${!empty refreshCalendario}"> <script type="text/javascript" >opener.refreshCalendario(); window.close();</script> </c:if> <script type="text/javascript" src="${j:getResourceUrlOfModule('anagrafiche','js/soggettoUtils.js')}"></script> <script type="text/javascript" > var _PIANIFICATO = true; var _EROGATO = false; registerOnLoadMaster(function() { if (bui_datamanagement.getMode().isView()) { var dataErogazione = cpGetMasterColumnValueOfCurrentRow('dataErogazione'); if (dataErogazione == '') { visualizzaSezioni(true, false, false); } else { var dataPianificata = cpGetMasterColumnValueOfCurrentRow('dataPianificata'); if (dataPianificata == '') { visualizzaSezioni(false, false, true); } else { visualizzaSezioni(true, false, true); } } } else if (bui_datamanagement.getMode().isUpdate()) { var dataErogazione = document.getElementById('dataErogazioneCld'); if (dataErogazione.value == '') { visualizzaSezioni(true, false, false); abilitaSezione(_PIANIFICATO, true); } else { abilitaSezione(_EROGATO, true); abilitaSezione(_PIANIFICATO, false); var dataPianificazione = document.getElementById('dataPianificataCld'); if (dataPianificazione.value == '') { visualizzaSezioni(false, false, true); document.getElementById('trButtonAnnulla').style.display = 'none'; } else { copiaPianificato(); visualizzaSezioni(false, true, true); } } } else { visualizzaSezioni(true, false, false); } if (bui_datamanagement.getMode().isCreate() || bui_datamanagement.getMode().isUpdate()) { loadOperatoreAbilitatoHidden(); } }); function getOperatoriAttivita(pianificato) { var params = 'dataCollocazione='; var dateObj = document.getElementById(pianificato ? "dataPianificataCld" : "dataErogazioneCld"); if (dateObj && isDate(dateObj.value)) { params += dateObj.value; } var idComboOperatore = pianificato ? 'opRifPian' : 'opRifErog'; var comboOperatore = document.getElementById(idComboOperatore); var idOperatore = -1; if (comboOperatore.length > 0){ idOperatore = comboOperatore.options[comboOperatore.selectedIndex].value; } loadStandardSelectOptionsAndFill(idComboOperatore, 'it.cedaf.icare.attivita.control.binding.requestbean.valuesetproviders.OperatoreAttivitaDelegateValueSetProvider(dataCollocazione)', params, ' ', idOperatore, 'true'); } function riparaOra(aa) { if((aa.value.length==4)&&(/^\d+$/.test(aa.value))){ var inizio = aa.value.substring(0, 2); var fine = aa.value.substring(2,4); aa.value = inizio +":"+ fine; }else if((aa.value.length==3)&&(/^\d+$/.test(aa.value))){ var inizio = aa.value.substring(0, 1); var fine = aa.value.substring(1,4); aa.value = "0"+inizio +":"+ fine; } } function copiaSezione(pianToErog) { document.getElementById(pianToErog ? "dataErogazioneCld" : "dataPianificataCld").value = document.getElementById(pianToErog ? "dataPianificataCld" : "dataErogazioneCld").value; copyCombo(pianToErog ? 'opRifPian' : 'opRifErog', pianToErog ? 'opRifErog' : 'opRifPian'); document.getElementById(pianToErog ? "oraInizioErog" : "oraInizioPian").value = document.getElementById(pianToErog ? "oraInizioPian" : "oraInizioErog").value; document.getElementById(pianToErog ? "oraFineErog" : "oraFinePian").value = document.getElementById(pianToErog ? "oraFinePian" : "oraFineErog").value; copyCombo(pianToErog ? 'tipoAttivitaPian' : 'tipoAttivitaErog', pianToErog ? 'tipoAttivitaErog' : 'tipoAttivitaPian'); } function copiaPianificato() { document.getElementById("dataPianificataDspl").innerHTML = document.getElementById("dataPianificataCld").value; document.getElementById("opRifPianDspl").innerHTML = getComboDescription('opRifPian'); document.getElementById("oraInizioPianDspl").innerHTML = document.getElementById("oraInizioPian").value; document.getElementById("oraFinePianDspl").innerHTML = document.getElementById("oraFinePian").value; document.getElementById("tipoAttivitaPianDspl").innerHTML = getComboDescription('tipoAttivitaPian'); } function pulisciSezione(pian) { document.getElementById(pian ? "dataPianificataCld" : "dataErogazioneCld").value = ''; clearCombo(pian ? "opRifPian" : 'opRifErog'); document.getElementById(pian ? "oraInizioPian" : "oraInizioErog").value = ''; document.getElementById(pian ? "oraFinePian" : "oraFineErog").value = ''; clearCombo(pian ? "tipoAttivitaPian" : 'tipoAttivitaErog'); } function abilitaSezione(pian, abilita) { document.getElementById(pian ? 'trButtonEroga': 'trButtonAnnulla').style.display = (abilita ? '': 'none'); } function copyCombo(idSource, idDest) { var source = document.getElementById(idSource); var destination = document.getElementById(idDest); clearCombo(idDest); var count = source.length; for (var i = 0; i < count; i++){ var opt = source.options[i]; destination.options[i] = new Option(opt.text, opt.value); } destination.selectedIndex = source.selectedIndex; } function getComboDescription(idSource) { var source = document.getElementById(idSource); var index = source.selectedIndex; if (index == -1) return ''; return source.options[index].text; } function visualizzaSezioni(pianificato, pianDisplay, erogato) { var sezPian = document.getElementById('tdPian'); var sezPianDspl = document.getElementById('tdPianDspl'); var sezErog = document.getElementById('tdErog'); sezPian.style.display = (pianificato ? '' : 'none'); sezPianDspl.style.display = (pianDisplay ? '' : 'none'); sezErog.style.display = (erogato ? '' : 'none'); } function erogaOnCreate(eroga) { if (eroga) { copiaSezione(true); pulisciSezione(_PIANIFICATO); visualizzaSezioni(false, false, true); } else { copiaSezione(false); pulisciSezione(_EROGATO); visualizzaSezioni(true, false, false); } } function eroga() { abilitaSezione(_EROGATO, true); copiaSezione(true); copiaPianificato(); abilitaSezione(_PIANIFICATO, false); visualizzaSezioni(false, true, true); } function annullaEroga() { pulisciSezione(_EROGATO); abilitaSezione(_PIANIFICATO, true); abilitaSezione(_EROGATO, false); visualizzaSezioni(true, false, false); } function changeOperatore(id) { var value = getComboValueById(id); selectElementByValue('opAb',value); getUnitaOperativeAbilitate('opAb','uoAb'); } function loadOperatoreAbilitatoHidden() { var sezPian = document.getElementById('tdPian'); var sezErog = document.getElementById('tdErog'); var comboOpPian = document.getElementById('opRifPian'); if (comboOpPian && comboOpPian.disabled==true && sezPian.style.display=='') { changeOperatore('opRifPian'); } var comboOpErog = document.getElementById('opRifErog'); if (comboOpErog && comboOpErog.disabled==true && sezErog.style.display=='') { changeOperatore('opRifErog'); } } function enableDisableComboOperatore(enable) { var comboOpPian = document.getElementById('opRifPian'); if (comboOpPian) { comboOpPian.disabled = !enable; } var comboOpErog = document.getElementById('opRifErog'); if (comboOpErog) { comboOpErog.disabled = !enable; } } function sceltaRapida(soggetto) { if (soggetto) { shellSingleChoose('componentiNucleoAttivita', 'it.cedaf.icare.attivita.control.action.ComponentiNucleoMultipleChooseInitializer', 'key=' + bui_datamanagement.getKey(), null, 700, 300); } else { var result = jsLoadString('it.cedaf.icare.attivita.control.action.ImpostaNucleoSelezionatoAction'); if (result == '') { alert('Il soggetto non ha un nucleo valido.'); return; } var values = result.split('|'); document.getElementById('id_nucleoLookup').value = values[0]; document.getElementById('denominazione_nucleoLookup').value = values[1]; } } function onChangeMultipleChoose_componentiNucleoAttivita() { var valueId = getMultipleChooseColumnValues("id"); if (valueId != '') { document.getElementById('id_soggettoLookup').value = valueId; document.getElementById('nominativo_soggettoLookup').value = getMultipleChooseColumnValues("Nominativo"); } } function clearSceltaRapida(soggetto) { var idField = null; var descrField = null; if (soggetto) { idField = document.getElementById('id_soggettoLookup'); descrField = document.getElementById('nominativo_soggettoLookup'); } else { idField = document.getElementById('id_nucleoLookup'); descrField = document.getElementById('denominazione_nucleoLookup'); } if (idField) idField.value = ''; if (descrField) descrField.value = ''; } <bui:out modes="view"> var _isFromAgenda=${isFromAgenda}; function eformat_cpmt_soggetto(element, value, name) { if (value !='' && value!='@null') { if (_isFromAgenda) { element.innerHTML =''; element.innerHTML = '<A HREF="javascript:openDMSoggetto();" class="form-data-link">' + value + '</A>'; } else { linkToSoggetto('idSoggetto', element, value); } } else { // altrimenti non lo sbianca se passo a uno che non ce l'ha element.innerHTML = value; } } function openDMSoggetto() { opener.openSoggettoFunction(cpGetMasterColumnValueOfCurrentRow('idSoggetto')); window.close(); } </bui:out> </script> <c:choose> <c:when test="${!empty isFromAgenda && isFromAgenda == 'true'}"> <script type="text/javascript" > var jsSubmitForm = shellSubmitAndCommit; var jsChangeSelectedTab = tabOnChangeSelectedTab; window.shellSubmitAndCommit = function(confirmWarning) { enableDisableComboOperatore(true); jsSubmitForm(confirmWarning); enableDisableComboOperatore(false); } <%-- riabilito il combo dell'operatore quando cambio TAB nel caso uno slave inviasse la form al server --%> window.tabOnChangeSelectedTab = function(group, tab) { var enableComboOperatore = (tab != 'Detail'); enableDisableComboOperatore(enableComboOperatore); jsChangeSelectedTab(group, tab); } </script> </c:when> </c:choose> <center> <bui:out modes="create"> <table border="0" cellspacing="3" cellpadding="0" width="100%" > <tr> <td class="form-label"> <shell:label prop="erogazioneAttivita"/> </td> <td class="form-values"> <input name="erogazione" value="no" type="radio" onclick="erogaOnCreate(false);" checked="checked">${j:bundle('LBL_attivita_pianificata')} <input name="erogazione" value="si" type="radio" onclick="erogaOnCreate(true);">${j:bundle('LBL_attivita_erogata')} </td> </tr> </table> </bui:out> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <tr> <td id="tdPian" valign="top" width="50%" style="display:none"> <shell:fieldset title="${j:bundle('LBL_attivita_attivita_pianific_SET')}"> <table border="0" cellspacing="3" cellpadding="0" width="100%" > <tr> <td class="form-label"> <shell:label prop="data" forceRequired="true"/> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="dataPianificata" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="dataPianificata"> <j:text class="form-date" id="dataPianificataCld" onChange="getOperatoriAttivita(true);"/> <span id="dataPianificataSpan"><shell:calendar inputId="dataPianificataCld" /></span> <shell:error /> </j:bind> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="operatore" forceRequired="true"/> </td> <bui:out modes="view"> <td class="form-values"> <j:tile name="shell.plaintext" prop="opRifPianificato" /> </td> </bui:out> <bui:out modes="update,create"> <c:choose> <c:when test="${empty isFromAgenda || isFromAgenda == 'false'}"> <j:bind prop="opRifPianificato"> <td class="form-values"> <j:select class="form-input" id="opRifPian" emptyOptionDescr=" " onchange="changeOperatore('opRifPian');"/> <shell:error /> </td> </j:bind> </c:when> <c:otherwise> <j:bind prop="opRifPianificato"> <td class="form-values"> <j:select class="form-input" id="opRifPian" emptyOptionDescr=" " disabled="true" /> <shell:error /> </td> </j:bind> </c:otherwise> </c:choose> </bui:out> </tr> <tr> <td class="form-label"> <shell:label prop="tipoAttivita" forceRequired="true"/> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="tipoAttivitaPianificata" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="tipoAttivitaPianificata"> <j:select class="form-input" id="tipoAttivitaPian" emptyOptionDescr=" " /> <shell:error /> </j:bind> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="oraInizio" /> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="oraInizioPianificata" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="oraInizioPianificata"> <j:text id="oraInizioPian" class="form-short-text" maxlength="5" onBlur = "riparaOra(this)"/> <shell:error /> </j:bind> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="oraFine" /> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="oraFinePianificata" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="oraFinePianificata"> <j:text id="oraFinePian" class="form-short-text" maxlength="5" onBlur = "riparaOra(this)"/> <shell:error /> </j:bind> </bui:out> </td> </tr> <bui:out modes="create, update"> <tr id="trButtonEroga" style="display:none"> <td> </td> <td> <shell:button id="ErogaButton" text="${j:bundle('LBL_attivita_eroga_BUTTON')}" img="shell.check" title="Eroga l'attivit�" href="javascript:eroga();" enabled="true" ext="true" onclick="coordinates(event);"/> </td> </tr> </bui:out> </table> </shell:fieldset> </td> <td id="tdPianDspl" valign="top" width="50%" style="display:none"> <shell:fieldset title="${j:bundle('LBL_attivita_attivita_pianific_SET')}"> <table border="0" cellspacing="3" cellpadding="0" width="100%" > <tr> <td class="form-label"> <shell:label prop="data"/> </td> <td class="form-values"> <span id="dataPianificataDspl" class="form-data"></span> </td> </tr> <tr> <td class="form-label"> <shell:label prop="operatore"/> </td> <td class="form-values"> <span id="opRifPianDspl" class="form-data"></span> </td> </tr> <tr> <td class="form-label"> <shell:label prop="tipoAttivita"/> </td> <td class="form-values"> <span id="tipoAttivitaPianDspl" class="form-data"></span> </td> </tr> <tr> <td class="form-label"> <shell:label prop="oraInizio" /> </td> <td class="form-values"> <span id="oraInizioPianDspl" class="form-data"></span> </td> </tr> <tr> <td class="form-label"> <shell:label prop="oraFine" /> </td> <td class="form-values"> <span id="oraFinePianDspl" class="form-data"></span> </td> </tr> </table> </shell:fieldset> </td> <td id="tdErog" valign="top" width="50%" style="display:none"> <shell:fieldset title="${j:bundle('LBL_attivita_eroga_SET')}"> <table border="0" cellspacing="3" cellpadding="0" width="100%" > <tr> <td class="form-label"> <shell:label prop="data" forceRequired="true"/> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="dataErogazione" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="dataErogazione"> <j:text class="form-date" id="dataErogazioneCld" onChange="getOperatoriAttivita(false);"/> <span id="dataErogazioneSpan"><shell:calendar inputId="dataErogazioneCld" /></span> <shell:error /> </j:bind> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="operatore" forceRequired="true"/> </td> <bui:out modes="view"> <td class="form-values"> <j:tile name="shell.plaintext" prop="opRifErogazione" /> </td> </bui:out> <bui:out modes="update,create"> <c:choose> <c:when test="${empty isFromAgenda || isFromAgenda == 'false'}"> <j:bind prop="opRifErogazione"> <td class="form-values"> <j:select class="form-input" id="opRifErog" emptyOptionDescr=" " onchange="changeOperatore('opRifErog');"/> <shell:error /> </td> </j:bind> </c:when> <c:otherwise> <j:bind prop="opRifErogazione"> <td class="form-values"> <j:select class="form-input" id="opRifErog" emptyOptionDescr=" " disabled="true" /> <shell:error /> </td> </j:bind> </c:otherwise> </c:choose> </bui:out> </tr> <tr> <td class="form-label"> <shell:label prop="tipoAttivita" forceRequired="true"/> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="tipoAttivita" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="tipoAttivita"> <j:select class="form-input" id="tipoAttivitaErog" emptyOptionDescr=" " /> <shell:error /> </j:bind> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="oraInizio" /> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="oraInizio" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="oraInizio"> <j:text id="oraInizioErog" class="form-short-text" maxlength="5" onBlur = "riparaOra(this)"/> <shell:error /> </j:bind> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="oraFine" /> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="oraFine" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="oraFine"> <j:text id="oraFineErog" class="form-short-text" maxlength="5" onBlur = "riparaOra(this)"/> <shell:error /> </j:bind> </bui:out> </td> </tr> <bui:out modes="create, update"> <tr id="trButtonAnnulla" style="display:none"> <td> </td> <td> <shell:button id="annullaErogaButton" text="${j:bundle('LBL_attivita_anneroga_BUTTON')}" img="shell.cancel" title="Annulla l'erogazione dell'attivit�" href="javascript:annullaEroga();" enabled="true" ext="true" onclick="coordinates(event);"/> </td> </tr> </bui:out> </table> </shell:fieldset> </td> </tr> </table> <shell:fieldset title="${j:bundle('LBL_attivita_attivita_infoGen_SET')}"> <table border="0" cellspacing="3" cellpadding="0" > <tr> <td class="form-label"> <shell:label prop="soggetto" /> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="soggetto" /> </bui:out> <bui:out modes="create, update"> <c:choose> <c:when test="${!empty nascondiLookUpSoggetto && nascondiLookUpSoggetto == 'true'}"> <j:tile name="shell.plaintext" prop="soggetto" /> <j:bind prop="idSoggetto"> <j:hidden id="id_soggettoLookup"/> <shell:error /> </j:bind> </c:when> <c:otherwise> <j:bind prop="nominativoSoggetto"> <j:text class="form-normal-text" readonly="true" id="nominativo_soggettoLookup" /> <shell:error /> </j:bind> <j:bind prop="idSoggetto"> <j:hidden id="id_soggettoLookup"/> <shell:error /> </j:bind> <c:choose> <c:when test="${!empty mostraPulsanteSceltaDto && mostraPulsanteSceltaDto == 'true'}"> <a href="javascript:sceltaRapida(true);"><img src="${j:getResourceUrlOfModule('anagrafiche', 'img/user_small.gif')}" alt="Elenco soggetti del nucleo" align="absmiddle" border="0"></a> <a href="javascript:clearSceltaRapida(true);"><img src="${j:getResourceUrlOfModule('shell', 'img/lookup/clear.gif')}" alt="Cancella" align="absmiddle" border="0"></a> </c:when> <c:otherwise> <shell:lookup lookupId="soggettoLookup" identifier="anagrafiche.soggetto" init="it.cedaf.icare.anagrafiche.model.datamanagement.SoggettoLookupInitializer" params="importNucleo=true&disableComplete=true" noCommitOnCreate="id=-1" /> </c:otherwise> </c:choose> </c:otherwise> </c:choose> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="nucleoFamiliare" /> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="nucleoFamiliare" /> </bui:out> <bui:out modes="create, update"> <c:choose> <c:when test="${!empty nascondiLookUpNucleo && nascondiLookUpNucleo == 'true'}"> <j:tile name="shell.plaintext" prop="nucleoFamiliare" /> <j:bind prop="idNucleo"> <j:hidden id="id_nucleoLookup"/> <shell:error /> </j:bind> </c:when> <c:otherwise> <j:bind prop="denominazioneNucleo"> <j:text class="form-normal-text" readonly="true" id="denominazione_nucleoLookup" /> <shell:error /> </j:bind> <j:bind prop="idNucleo"> <j:hidden id="id_nucleoLookup"/> <shell:error /> </j:bind> <c:choose> <c:when test="${!empty mostraPulsanteSceltaDto && mostraPulsanteSceltaDto == 'true'}"> <a href="javascript:sceltaRapida(false);"><img src="${j:getResourceUrlOfModule('anagrafiche', 'img/nucleo_small.gif')}" alt="Nucleo predefinito" align="absmiddle" border="0"></a> <a href="javascript:clearSceltaRapida(false);"><img src="${j:getResourceUrlOfModule('shell', 'img/lookup/clear.gif')}" alt="Cancella" align="absmiddle" border="0"></a> </c:when> <c:otherwise> <shell:lookup lookupId="nucleoLookup" identifier="anagrafiche.nucleoFamiliare" init="it.cedaf.icare.anagrafiche.model.datamanagement.NucleoFamiliareFromAffidiAdozioniLookupInitializer" /> </c:otherwise> </c:choose> </c:otherwise> </c:choose> </bui:out> </td> </tr> <tr> <td class="form-label"> <shell:label prop="descrizione" /> </td> <td class="form-values"> <bui:out modes="view"> <j:tile name="shell.plaintext" prop="descrizione" /> </bui:out> <bui:out modes="create, update"> <j:bind prop="descrizione"> <j:textarea class="form-long-textarea" /> <shell:error /> </j:bind> </bui:out> </td> </tr> <icare:ifOptional prop="Sede [p]"> <tr> <td class="form-label"> <shell:label prop="sede"/> </td> <bui:out modes="view"> <td class="form-values"> <j:tile name="shell.plaintext" prop="sede" /> </td> </bui:out> <bui:out modes="update,create"> <j:bind prop="sede"> <td class="form-values"> <j:select class="form-input" id="idSede" emptyOptionDescr=" " /> <shell:error /> </td> </j:bind> </bui:out> </tr> </icare:ifOptional> </table> </shell:fieldset> <shell:fieldset title="${j:bundle('LBL_attivita_attivita_opAbil_SET')}"> <table border="0" cellspacing="3" cellpadding="0" > <tr> <td class="form-label"> <shell:label prop="opCreazione" /> </td> <td class="form-values"> <j:tile name="shell.plaintext" prop="opCreazione" /> </td> </tr> <j:tile name="commons.opAbilitato" objectName="Attivita" idField="id" displayOperatore="none" /> </table> </shell:fieldset> </center>