diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java index 3b7c9d5f..c20b4b7e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java @@ -259,8 +259,7 @@ public class DelegheUtil { public static Soggetto getPersonaDelegaCompilazioneDomanda(long dettPraticaId) throws SystemException, PortalException { Soggetto soggetto = null; - boolean praticaIsEditable = ValidazionePraticaUtil.praticaIsEditable(dettPraticaId); - if (praticaIsEditable) { + if (ValidazionePraticaUtil.praticaIsEditable(dettPraticaId)) { DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List deleghe = DelegaLocalServiceUtil.findByIntPratica_Tipologia_InEsito( dettPratica.getIntPraticaId(), DelegheUtil.TIPO_COMPILAZIONE, diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index a4b303e5..f62bce9b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_bo - build.number=2524 - build.date=1606994032983 + build.number=2526 + build.date=1608047904204 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp index 32167b08..70ff3493 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp @@ -1,4 +1,7 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> +<%@page import="java.util.HashMap"%> +<%@page import="java.util.Map"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%> @@ -30,102 +33,110 @@ <%@page import="it.tref.liferay.portos.bo.service.persistence.SoggettoUtil"%> <%@page import="java.util.ArrayList"%> -<%@ include file="/html/soggettipratica/init.jsp" %> +<%@ include file="/html/soggettipratica/init.jsp"%> <% - String comingFrom = ParamUtil.getString(request,"comingFrom", - GetterUtil.getString( - PortalUtil.getOriginalServletRequest(request).getParameter("comingFrom"), - "page_allegati") - ); +String comingFrom = ParamUtil.getString( + request, + "comingFrom", + GetterUtil.getString(PortalUtil.getOriginalServletRequest(request).getParameter("comingFrom"), "page_allegati") +); - long classPk = ParamUtil.getLong(request, "classPk"); - String className = ParamUtil.getString(request, "className"); - long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); +long classPk = ParamUtil.getLong(request, "classPk"); +String className = ParamUtil.getString(request, "className"); +long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); - - if(FineLavori.class.getName().equalsIgnoreCase(className)){ - FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk); - intPraticaId = fineLavori.getIntPraticaId(); - } else if(Collaudo.class.getName().equalsIgnoreCase(className)){ - Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk); - intPraticaId = collaudo.getIntPraticaId(); - }else{ - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); - HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(request); - if(dettPratica==null){ - long dettPraticaIdParam = ParamUtil.getLong(request, "classPk"); - if(dettPraticaIdParam==0){ - dettPraticaIdParam = GetterUtil.getLong( httpServletRequest.getParameter("classPk")); - } - dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaIdParam); - } - if(dettPratica == null){ - dettPratica = DettPraticaServiceUtil.getDettPratica(classPk); +if (FineLavori.class.getName().equalsIgnoreCase(className)) { + FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk); + intPraticaId = fineLavori.getIntPraticaId(); +} else if (Collaudo.class.getName().equalsIgnoreCase(className)) { + Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk); + intPraticaId = collaudo.getIntPraticaId(); +} else { + DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); + HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(request); + if (dettPratica == null) { + long dettPraticaIdParam = ParamUtil.getLong(request, "classPk"); + if (dettPraticaIdParam == 0) { + dettPraticaIdParam = GetterUtil.getLong(httpServletRequest.getParameter("classPk")); } - - request.setAttribute("bean.dettPratica",dettPratica); - classPk = dettPratica.getDettPraticaId(); - intPraticaId = dettPratica.getIntPraticaId(); + dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaIdParam); } - + if (dettPratica == null) { + dettPratica = DettPraticaServiceUtil.getDettPratica(classPk); + } + + request.setAttribute("bean.dettPratica", dettPratica); + classPk = dettPratica.getDettPraticaId(); + intPraticaId = dettPratica.getIntPraticaId(); +} +Map cfNome = new HashMap(); +for (Soggetto soggetto : SoggettoLocalServiceUtil.findByIntPratica(intPraticaId)) { + cfNome.put(soggetto.getCodiceFiscale(), soggetto.getNome() + StringPool.SPACE + soggetto.getCognome()); +} +Map dettPraticas = new HashMap(); - boolean inBO = ParamUtil.getBoolean(request,"inBO",false); - boolean disabled = ParamUtil.getBoolean(request,"disabled"); +boolean inBO = ParamUtil.getBoolean(request, "inBO", false); +boolean disabled = ParamUtil.getBoolean(request, "disabled"); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); - Soggetto soggettoDelegato = null; +IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); +Soggetto soggettoDelegato = null; - boolean disabledInput = true; - boolean canSignGeoDocs = false; - if(Validator.isNotNull(request.getParameter("disabled"))){ - disabledInput = disabled; - } else if("page_allegati".equalsIgnoreCase(comingFrom)){ - disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk) - && !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk); - soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(classPk); - } else if ("page_geologica".equalsIgnoreCase(comingFrom)) { - disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(),classPk); - soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(classPk); - canSignGeoDocs = true; - } else if ("page_fine_lavori".equalsIgnoreCase(comingFrom)) { - disabledInput = disabled; - } else if ("page_collaudo".equalsIgnoreCase(comingFrom)) { - disabledInput = disabled; +boolean disabledInput = true; +boolean canSignGeoDocs = false; +if (Validator.isNotNull(request.getParameter("disabled"))) { + disabledInput = disabled; +} else if ("page_allegati".equalsIgnoreCase(comingFrom)) { + Boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda"); + if (null == hasDelegaCompilazioneDomanda) { + hasDelegaCompilazioneDomanda = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk); + SessionUtil.setDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda", hasDelegaCompilazioneDomanda); } -%> - - - - - - - - - + disabledInput = !hasDelegaCompilazioneDomanda + && !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk); + soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(classPk); +} else if ("page_geologica".equalsIgnoreCase(comingFrom)) { + disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(),classPk); + soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(classPk); + canSignGeoDocs = true; +} else if ("page_fine_lavori".equalsIgnoreCase(comingFrom)) { + disabledInput = disabled; +} else if ("page_collaudo".equalsIgnoreCase(comingFrom)) { + disabledInput = disabled; +} +%> + + + + + + + + - - - - - - - + + + + + + + <% - String refresh="Liferay.fire('allegati-"+comingFrom+"-open');Liferay.Portlet.refresh('#p_p_id"+renderResponse.getNamespace()+"');"; +String refresh = "Liferay.fire('allegati-" + comingFrom + "-open');Liferay.Portlet.refresh('#p_p_id" + + renderResponse.getNamespace() + "');"; %> - +
<% - List tipologiaAllegati = new ArrayList(); - if("page_geologica".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo(); - }else if("page_allegati".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda(); - }else if("page_fine_lavori".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori(); - }else if("page_collaudo".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo(); - } - +List tipologiaAllegati = new ArrayList(); +if ("page_geologica".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo(); +}else if ("page_allegati".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda(); +}else if ("page_fine_lavori".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori(); +}else if ("page_collaudo".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo(); +} %>
- -
+ +
Descrizione
@@ -182,7 +188,7 @@
Rimosso da
Firme -
+
Presenti
Le tue firme
@@ -192,297 +198,276 @@
- - -
-
- Descrizione -
-
- Firme presenti -
+ + +
+
Descrizione
+
Firme presenti
Azioni
- -
-
- Descrizione -
-
- Provenienza -
-
- Firme presenti -
+ +
+
Descrizione
+
Provenienza
+
Firme presenti
Azioni
- - - - <% - for(String codiceDoc:tipologiaAllegati){ - List docPraticas = new ArrayList(); - if(FineLavori.class.getName().equalsIgnoreCase(className) || Collaudo.class.getName().equalsIgnoreCase(className)){ - docPraticas = DocPraticaServiceUtil.findByClassPk_Tipologia(classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); - } else { - docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPratica.getIntPraticaId(), classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); - } - %> -
- <%=docPraticas.size()%> - + - <% - /* List docPraticas = DocPraticaServiceUtil.findByIntPratica_Tipologia(intPratica.getIntPraticaId(),codiceDoc, - QueryUtil.ALL_POS,QueryUtil.ALL_POS, OrderByComparatorFactoryUtil.create("portos_bo_DocPratica", "dettPraticaIdRimozione", true)); */ +<% +for (String codiceDoc:tipologiaAllegati) { + List docPraticas = new ArrayList(); - if(docPraticas.isEmpty()){ - %> + if(FineLavori.class.getName().equals(className) || Collaudo.class.getName().equals(className)) { + docPraticas = DocPraticaServiceUtil.findByClassPk_Tipologia(classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); + } else { + docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); + } +%> +
+ <%=docPraticas.size()%> + + <% + if (docPraticas.isEmpty()) { + %>
-
- Nessun allegato presente per la tipologia -
+
Nessun allegato presente per la + tipologia
- <% - } else { - for(DocPratica docPratica:docPraticas){ - - FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari()); - - StringBuilder title = new StringBuilder(); - - String cssIcon = StringPool.BLANK; - String cssColor= StringPool.BLANK; - String testoFirme = "Non ci sono firme sul file"; - if(firme.getFirmeDigitali().size()> 0){ - cssIcon = "fa-check"; - cssColor= "txt-green"; - testoFirme=""; - } else if(docPratica.getStatus() == 1){ - cssIcon= "fa-cog fa-spin"; - cssColor= "txt-orange"; - testoFirme="Estrazione firme in corso"; - }else if(docPratica.getStatus() == 4){ - cssIcon= "fa-alert"; - cssColor= "txt-red"; - testoFirme="Errore nell'estrazione delle firme"; + <% } else { - cssIcon = "fa-close"; - testoFirme="Nessuna firma digitale rilevata"; - if(firme.numeroFirme()>0){ - cssColor= "txt-green"; + for (DocPratica docPratica : docPraticas) { + FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari()); + + StringBuilder title = new StringBuilder(); + String cssIcon = StringPool.BLANK; + String cssColor= StringPool.BLANK; + String testoFirme = "Non ci sono firme sul file"; + if (firme.getFirmeDigitali().size() > 0) { + cssIcon = "fa-check"; + cssColor= "txt-green"; + testoFirme = StringPool.BLANK; + } else if (docPratica.getStatus() == 1) { + cssIcon= "fa-cog fa-spin"; + cssColor= "txt-orange"; + testoFirme = "Estrazione firme in corso"; + } else if (docPratica.getStatus() == 4) { + cssIcon= "fa-alert"; + cssColor= "txt-red"; + testoFirme = "Errore nell'estrazione delle firme"; + } else { + cssIcon = "fa-close"; + testoFirme = "Nessuna firma digitale rilevata"; + if (firme.numeroFirme() > 0) { + cssColor= "txt-green"; + } + } + if (firme.numeroFirme() > 0) { + cssIcon = "fa-check"; + } + title.append("Firma sul file:
    "); + title.append("
  • " + testoFirme + "
  • "); + if (!firme.getFirmeDigitali().isEmpty()) { + for (FirmeDetail firma: firme.getFirmeDigitali()) { + if (cfNome.containsKey(firma.getCfFirmatario())) { + title.append("
  • " + cfNome.get(firma.getCfFirmatario()) + "
  • "); + } + title.append("
  • " + firma.getCfFirmatario()); + if (Validator.isNotNull(firma.getDtFirma())) { + title.append(" del " + dateFormatDate.format(firma.getDtFirma())); + } + title.append("
  • "); + } + } + title.append("
"); + if (!firme.getFirmeApplicativo().isEmpty()) { + title.append("Firme da applicativo:
    "); + for (FirmeDetail firma: firme.getFirmeApplicativo()) { + if (cfNome.containsKey(firma.getCfFirmatario())) { + title.append("
  • " + cfNome.get(firma.getCfFirmatario()) + "
  • "); + } + title.append("
  • "+firma.getCfFirmatario()); + if (Validator.isNotNull(firma.getDtFirma())) { + title.append(" del "+dateFormatDate.format(firma.getDtFirma())); + } + title.append("
  • "); + } + title.append("
"); + } + %> +
+ +
+ + +
+ + <% + String color = "txt-red"; + if (Validator.isNull(docPratica.getDettPraticaIdRimozione())) { + color = "txt-green"; } - } - if(firme.numeroFirme()>0){ - cssIcon = "fa-check"; - } + %> + + <%= docPratica.getDescLong() %> +
- //if(firme.numeroFirme()>0){ - title.append("Firma sul file:
    "); - title.append("
  • "+testoFirme+"
  • "); - if(!firme.getFirmeDigitali().isEmpty()){ +
    + <% + String adding = StringPool.BLANK; + if (FineLavori.class.getName().equals(className)) { + FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk()); + if (fineLavori != null) { + adding = fineLavori.getFullDescription(); + } + } else if (Collaudo.class.getName().equalsIgnoreCase(className)) { + Collaudo collaudo = CollaudoLocalServiceUtil.fetchCollaudo(docPratica.getClassPk()); + if (collaudo != null) { + adding = collaudo.getFullDescription(); + } + } else { + long pk = docPratica.getClassPk(); + if (!dettPraticas.containsKey(pk)) { + dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk)); + } + adding = dettPraticas.get(pk).getFullDescription(); + } + out.print(adding); + %> +
    - for(FirmeDetail firma: firme.getFirmeDigitali()){ - //TODO nome e cognome - List soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(docPratica.getIntPraticaId(), firma.getCfFirmatario()); - if (soggetti.size() > 0 ){ - title.append("
  • "+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"
  • "); - } - title.append("
  • "+firma.getCfFirmatario()); - if(Validator.isNotNull(firma.getDtFirma())){ - title.append(" del "+dateFormatDate.format(firma.getDtFirma())); - } - title.append("
  • "); - } - } - title.append("
"); - if(!firme.getFirmeApplicativo().isEmpty()){ - title.append("Firme da applicativo:
    "); - for(FirmeDetail firma: firme.getFirmeApplicativo()){ - //TODO nome e cognome - List soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(docPratica.getIntPraticaId(), firma.getCfFirmatario()); - if (soggetti.size() > 0 ){ - title.append("
  • "+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"
  • "); - } - title.append("
  • "+firma.getCfFirmatario()); - if(Validator.isNotNull(firma.getDtFirma())){ - title.append(" del "+dateFormatDate.format(firma.getDtFirma())); - } - title.append("
  • "); - } - title.append("
"); - } - //} +
+ <% + //Lasciato solo dettpratica perche' fine lavori e collaudo non possono rimuovere gli allegati + long pk = docPratica.getDettPraticaIdRimozione(); + if (0 != pk) { + if (!dettPraticas.containsKey(pk)) { + dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk)); + } + out.print(dettPraticas.get(pk).getFullDescription()); + } + %> +
- %> -
- -
- - -
- - <% - String color = ""; - if( Validator.isNotNull(docPratica.getDettPraticaIdRimozione()) ){ - color = "txt-red"; + +
+ + <% + if (className.equals(DettPratica.class.getName())) { + pk = docPratica.getClassPk(); + if (!dettPraticas.containsKey(pk)) { + dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk)); + } + DettPratica dett = dettPraticas.get(pk); + if (dett != null) { + if (dett.getIntegrazione() == 0) { + out.print("Pratica Originale"); } else { - color = "txt-green"; - } - %> - <%=docPratica.getDescLong() %> -
- -
- <% - String adding = StringPool.BLANK; - if(FineLavori.class.getName().equalsIgnoreCase(className)){ - FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk()); - if(fineLavori!=null){ - adding = fineLavori.getFullDescription(); - } - } else if(Collaudo.class.getName().equalsIgnoreCase(className)){ - Collaudo collaudo = CollaudoLocalServiceUtil.fetchCollaudo(docPratica.getClassPk()); - if(collaudo!=null){ - adding = collaudo.getFullDescription(); - } - }else{ - DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk()); - if(dettPratica!=null){ - adding = dettPratica.getFullDescription(); - } + if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) { + out.print("Ric Integrazione # " + dett.getIntegrazione()); + } else if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)) { + out.print("Variante # " + dett.getVarianteNumero()); + } } + } + } + %> + +
+
- out.print(adding); - %> -
- -
- <% - //Lasciato solo dettpratica perche' fine lavori e collaudo non possono rimuovere gli allegati - DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getDettPraticaIdRimozione()); - if(removing != null){ - out.print(removing.getFullDescription()); - } - %> -
- - -
- - <% - StringBuilder sbProvenienza = new StringBuilder(); - - if(className.equals(DettPratica.class.getName())){ - DettPratica dett = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk()); - if(dett != null){ - if(dett.getIntegrazione() == 0){ - sbProvenienza.append("Pratica Originale"); - } else { - if(dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)){ - sbProvenienza.append("Ric Integrazione # " + dett.getIntegrazione()); - } else if(dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)){ - sbProvenienza.append("Variante # " + dett.getVarianteNumero()); - } - } - } - } - %> - <%=sbProvenienza.toString() %> - - -
- -
+ + + +
+ + +
+ + + - - -
- - -
- - - - -
- + +
+ -
- - - <%= firme.numeroFirme() %> - - -
-
- <% - if(firme.firmaIsPresent(user.getScreenName())){ - %> - - <% - }else{ - %> - - <% - } - %> -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
+
+ + + <%= firme.numeroFirme() %> + + +
+
+ + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + - <% - } - } - %> - + + + + +
- <% - } - %>
+ + <% + } + } + %> +
- +<% + } +%> +
+
+