From c035a61ca07a5fc5ba26cbc0feab63fb9146d247 Mon Sep 17 00:00:00 2001 From: marcoalderighi Date: Thu, 2 Mar 2023 14:58:57 +0100 Subject: [PATCH] - modifica step fine lavori --- .../html/fascicolo/navigator/header.jsp | 6 + .../html/fascicolo/navigator/page_fl_dati.jsp | 1 + .../WEB-INF/src/content/Language.properties | 7 ++ .../portos/fe/portlet/FascicoloFePortlet.java | 52 +++++++- .../html/fascicolofe/edit_fine-lavori.jsp | 12 +- .../edit_first-step-fine-lavori.jsp | 113 ++++++++++++++++++ .../html/fascicolofe/fascicolo_action.jsp | 10 +- 7 files changed, 188 insertions(+), 13 deletions(-) create mode 100644 liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_first-step-fine-lavori.jsp diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/header.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/header.jsp index a11da8ca..29dc9460 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/header.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/header.jsp @@ -77,6 +77,12 @@ PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica))%> +
+
Data Inizio Lavori:
+
+ <%= dateFormatDate.format(dettPratica.getDataInizioLavoriOpera()) %> +
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_fl_dati.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_fl_dati.jsp index 4e398fd7..bad1d829 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_fl_dati.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_fl_dati.jsp @@ -27,6 +27,7 @@ > + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties index f002e120..54dbe8e0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties @@ -107,3 +107,10 @@ error.geniocivilefe.pagamento.allegato.length.valid=Nome del file troppo lungo ( error.geniocivilefe.pagamento.allegato.is.request=Nessun allegato inviato avviso-destinazione=Le classi III e IV non sono selezionabili per le pratiche di tipo B o C, le stesse devono essere presentate quali pratiche di Tipo A - Autorizzazione. + +## Fine lavori ## +add-fine-lavori-key=Comunica data fine lavori parziale/totale +data-inizio-lavori-key=Data Inizio Lavori +add-inizio-lavory-key=Comunica inizio lavori +edit-fine-lavori-key=Inserisci relazione fine lavori +edit-fine-lavori-title-key=Inserisci relazione Fine Lavori \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java index 8f79f646..f272cafa 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java @@ -584,6 +584,7 @@ public class FascicoloFePortlet extends MVCPortlet { try { FineLavori fineLavori = FineLavoriServiceUtil.addFineLavori(intPraticaId, serviceContext); fineLavori.setNormEsenteCollaudo(dettPratica.getCollaudoStatico()); + fineLavori.setRichiestaAttestazione(true); fineLavori = FineLavoriServiceUtil.updateFineLavori(fineLavori); successURL = HttpUtil.addParameter(successURL, response.getNamespace() + "fineLavoriId", String.valueOf(fineLavori.getFineLavoriId())); @@ -771,14 +772,57 @@ public class FascicoloFePortlet extends MVCPortlet { } PortalUtil.copyRequestParameters(request, response); } + + public void salvaFirstStepFineLavori(ActionRequest request, ActionResponse response) throws Exception { + long fineLavoriId = ParamUtil.getLong(request, "fineLavoriId"); + boolean parziale = ParamUtil.getBoolean(request, "tipoFineLavori"); + Date dataFineLavori = ParamUtil.getDate(request, "dataFineLavori", + DateFormatFactoryUtil.getDate(request.getLocale()), null); + long userId = PortalUtil.getUserId(request); + + try { + FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(fineLavoriId); + if (!fineLavori.isCompletata()) { + fineLavori.setParziale(parziale); + fineLavori.setDataFineLavori(dataFineLavori); + FineLavoriServiceUtil.updateFineLavori(fineLavori); + } + String redirect = ParamUtil.getString(request, "redirect"); + if (Validator.isNull(redirect)) { + String successURL = ParamUtil.getString(request, "successURL"); + if (Validator.isNotNull(successURL)) { + successURL = HttpUtil.removeParameter(successURL, response.getNamespace() + "fineLavoriId"); + successURL = HttpUtil.addParameter(successURL, response.getNamespace() + "fineLavoriId", + String.valueOf(fineLavoriId)); + /* + * SDB: forse non è più necessario distinguere la fase i creazione di una nuovo fineLavori da un + * editing + */ + response.sendRedirect(successURL); + } + } + } catch (PortalException e) { + _log.error(e, e); + PortalUtil.copyRequestParameters(request, response); + response.setRenderParameter("mvcPath", "/html/fascicolofe/edit_fine-lavori.jsp"); + response.setRenderParameter("fineLavoriId", String.valueOf(fineLavoriId)); + throw e; + } catch (Exception e) { + _log.error(e, e); + PortalUtil.copyRequestParameters(request, response); + response.setRenderParameter("mvcPath", "/html/fascicolofe/edit_fine-lavori.jsp"); + response.setRenderParameter("fineLavoriId", String.valueOf(fineLavoriId)); + throw e; + } + } public void saveFineLavori(ActionRequest request, ActionResponse response) throws Exception { long fineLavoriId = ParamUtil.getLong(request, "fineLavoriId"); boolean bozza = ParamUtil.getBoolean(request, "bozza"); - boolean parziale = ParamUtil.getBoolean(request, "tipoFineLavori"); - Date dataFineLavori = ParamUtil.getDate(request, "dataFineLavori", - DateFormatFactoryUtil.getDate(request.getLocale()), null); +// boolean parziale = ParamUtil.getBoolean(request, "tipoFineLavori"); +// Date dataFineLavori = ParamUtil.getDate(request, "dataFineLavori", +// DateFormatFactoryUtil.getDate(request.getLocale()), null); String codiceFiscaleDelegato = ParamUtil.getString(request, "direttoreLavori"); boolean normEsenteBollo = ParamUtil.getBoolean(request, "normEsenteBollo"); boolean normEsenteSpese = ParamUtil.getBoolean(request, "normEsenteSpese"); @@ -792,7 +836,7 @@ public class FascicoloFePortlet extends MVCPortlet { FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(fineLavoriId); if (!fineLavori.isCompletata()) { FineLavoriServiceUtil.updateFineLavori(userId, fineLavori.getFineLavoriId(), - fineLavori.getIntPraticaId(), parziale, false, dataFineLavori, codiceFiscaleDelegato, + fineLavori.getIntPraticaId(), fineLavori.getParziale(), false, fineLavori.getDataFineLavori(), codiceFiscaleDelegato, normEsenteBollo, normEsenteSpese, normEsenteCollaudo, comunicazioneDirettoreLavori, richiestaAttestazione); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fine-lavori.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fine-lavori.jsp index 1bcea7d2..686c68f5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fine-lavori.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fine-lavori.jsp @@ -68,7 +68,7 @@ request.setAttribute("bean.fineLavori", fineLavori); } else if (Validator.isNull(fineLavori.getFineLavoriId())) { label = "new-fine-lavori"; } else { - label = "edit-fine-lavori"; + label = "edit-fine-lavori-title-key"; } %>
+ disabled="<%= true %>" > - +

- - * <%= LanguageUtil.get(pageContext, "fl-attestazione-note") %> + * <%= LanguageUtil.get(pageContext, "fl-attestazione-note-1") %> + * <%= LanguageUtil.get(pageContext, "fl-attestazione-note-2") %> + * <%= LanguageUtil.get(pageContext, "fl-attestazione-note-3") %>

diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_first-step-fine-lavori.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_first-step-fine-lavori.jsp new file mode 100644 index 00000000..727a3218 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_first-step-fine-lavori.jsp @@ -0,0 +1,113 @@ +<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%> +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.model.FineLavori"%> +<%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%> +<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> +<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> +<%@include file="/html/fascicolofe/init.jsp"%> +<% +String backURL = ParamUtil.getString(request, "backURL"); +long fineLavoriId = ParamUtil.getLong(request, "fineLavoriId", 0L); +FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(fineLavoriId); +long intPraticaId = fineLavori.getIntPraticaId(); +IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); +DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); +if (dettPratica == null) { + dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); +} +String fmName = "fmFirstStepFineLavori"; +%> + + + + + + +
+
+ +
+
+
+ + + +
+
+
+
+
+
+
+ + +
+
+
+ <%= dateFormatDate.format(dettPratica.getDataInizioLavoriOpera()) %> +
+
+
+
+ +
+
+
+ <%= LanguageUtil.get(pageContext, "fl-tipo") %> +
+
+ + + + + + + + + + + + +
+
+
+
+ <%= LanguageUtil.get(pageContext, "fl-data-fine") %> +
+
+ + + + + + +
+
+
+
+
+
+
+
+ + +Liferay.provide( + window, + 'saveFirstStepFineLavori', + function () { + submitForm(document.<%= fmName %>); + }, + ['aui-base'] +); + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp index a8175132..0addde23 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp @@ -236,7 +236,7 @@ String randomId = StringUtil.randomId() + StringPool.UNDERLINE + intPraticaIdStr - @@ -245,14 +245,14 @@ String randomId = StringUtil.randomId() + StringPool.UNDERLINE + intPraticaIdStr || AzioniPraticheUtil.isAllowedAction(intPraticaId, AzioniPraticheUtil.ACTION_FL_TOTALE)) && ValidazionePraticaUtil.praticaCanAddFineLavori(intPraticaId, user.getScreenName()) %>"> - + - @@ -264,8 +264,9 @@ String randomId = StringUtil.randomId() + StringPool.UNDERLINE + intPraticaIdStr - + + <%-- @@ -276,6 +277,7 @@ String randomId = StringUtil.randomId() + StringPool.UNDERLINE + intPraticaIdStr + --%>