Sfoglia il codice sorgente

Ottimizzazione prestazioni per pratiche con molti allegati

Salvatore La Manna 4 anni fa
parent
commit
ea6590b781
  1. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java
  2. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  3. 721
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp
  4. 114
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp
  5. 6
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/html_top_pagamento.jspf
  6. 84
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf
  7. 21
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_allegati.jsp
  8. 14
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_asseverazioni_riepilogo.jsp
  9. 15
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_desc_edificio.jsp
  10. 695
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp
  11. 37
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_geologica.jsp
  12. 45
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_soggetti.jsp
  13. 23
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp
  14. 33
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo.jsp
  15. 4
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java
  16. 95
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FirmeUtil.java
  17. 66
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SessionUtil.java

3
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, public static Soggetto getPersonaDelegaCompilazioneDomanda(long dettPraticaId) throws SystemException,
PortalException { PortalException {
Soggetto soggetto = null; Soggetto soggetto = null;
boolean praticaIsEditable = ValidazionePraticaUtil.praticaIsEditable(dettPraticaId); if (ValidazionePraticaUtil.praticaIsEditable(dettPraticaId)) {
if (praticaIsEditable) {
DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
List<Delega> deleghe = DelegaLocalServiceUtil.findByIntPratica_Tipologia_InEsito( List<Delega> deleghe = DelegaLocalServiceUtil.findByIntPratica_Tipologia_InEsito(
dettPratica.getIntPraticaId(), DelegheUtil.TIPO_COMPILAZIONE, dettPratica.getIntPraticaId(), DelegheUtil.TIPO_COMPILAZIONE,

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=2524 build.number=2526
build.date=1606994032983 build.date=1608047904204
build.auto.upgrade=true build.auto.upgrade=true
## ##

721
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 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.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%> <%@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="it.tref.liferay.portos.bo.service.persistence.SoggettoUtil"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@ include file="/html/soggettipratica/init.jsp" %> <%@ include file="/html/soggettipratica/init.jsp"%>
<% <%
String comingFrom = ParamUtil.getString(request,"comingFrom", String comingFrom = ParamUtil.getString(
GetterUtil.getString( request,
PortalUtil.getOriginalServletRequest(request).getParameter("comingFrom"), "comingFrom",
"page_allegati") GetterUtil.getString(PortalUtil.getOriginalServletRequest(request).getParameter("comingFrom"), "page_allegati")
); );
long classPk = ParamUtil.getLong(request, "classPk"); long classPk = ParamUtil.getLong(request, "classPk");
String className = ParamUtil.getString(request, "className"); String className = ParamUtil.getString(request, "className");
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
if (FineLavori.class.getName().equalsIgnoreCase(className)) {
if(FineLavori.class.getName().equalsIgnoreCase(className)){ FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk);
FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk); intPraticaId = fineLavori.getIntPraticaId();
intPraticaId = fineLavori.getIntPraticaId(); } else if (Collaudo.class.getName().equalsIgnoreCase(className)) {
} else if(Collaudo.class.getName().equalsIgnoreCase(className)){ Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk);
Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk); intPraticaId = collaudo.getIntPraticaId();
intPraticaId = collaudo.getIntPraticaId(); } else {
}else{ DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica");
DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(request);
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(request); if (dettPratica == null) {
if(dettPratica==null){ long dettPraticaIdParam = ParamUtil.getLong(request, "classPk");
long dettPraticaIdParam = ParamUtil.getLong(request, "classPk"); if (dettPraticaIdParam == 0) {
if(dettPraticaIdParam==0){ dettPraticaIdParam = GetterUtil.getLong(httpServletRequest.getParameter("classPk"));
dettPraticaIdParam = GetterUtil.getLong( httpServletRequest.getParameter("classPk"));
}
dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaIdParam);
}
if(dettPratica == null){
dettPratica = DettPraticaServiceUtil.getDettPratica(classPk);
} }
dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaIdParam);
request.setAttribute("bean.dettPratica",dettPratica); }
classPk = dettPratica.getDettPraticaId(); if (dettPratica == null) {
intPraticaId = dettPratica.getIntPraticaId(); dettPratica = DettPraticaServiceUtil.getDettPratica(classPk);
} }
request.setAttribute("bean.dettPratica", dettPratica);
boolean inBO = ParamUtil.getBoolean(request,"inBO",false); classPk = dettPratica.getDettPraticaId();
boolean disabled = ParamUtil.getBoolean(request,"disabled"); intPraticaId = dettPratica.getIntPraticaId();
}
IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); Map<String, String> cfNome = new HashMap<String, String>();
Soggetto soggettoDelegato = null; for (Soggetto soggetto : SoggettoLocalServiceUtil.findByIntPratica(intPraticaId)) {
cfNome.put(soggetto.getCodiceFiscale(), soggetto.getNome() + StringPool.SPACE + soggetto.getCognome());
boolean disabledInput = true; }
boolean canSignGeoDocs = false; Map<Long, DettPratica> dettPraticas = new HashMap<Long, DettPratica>();
if(Validator.isNotNull(request.getParameter("disabled"))){
disabledInput = disabled; boolean inBO = ParamUtil.getBoolean(request, "inBO", false);
} else if("page_allegati".equalsIgnoreCase(comingFrom)){ boolean disabled = ParamUtil.getBoolean(request, "disabled");
disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk)
&& !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk); IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId);
soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(classPk); Soggetto soggettoDelegato = null;
} else if ("page_geologica".equalsIgnoreCase(comingFrom)) {
disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(),classPk); boolean disabledInput = true;
soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(classPk); boolean canSignGeoDocs = false;
canSignGeoDocs = true; if (Validator.isNotNull(request.getParameter("disabled"))) {
} else if ("page_fine_lavori".equalsIgnoreCase(comingFrom)) { disabledInput = disabled;
disabledInput = disabled; } else if ("page_allegati".equalsIgnoreCase(comingFrom)) {
} else if ("page_collaudo".equalsIgnoreCase(comingFrom)) { Boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda");
disabledInput = disabled; 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;
}
%> %>
<c:if test="<%= DettPratica.class.getName().equalsIgnoreCase(className) %>"> <c:if test="<%= DettPratica.class.getName().equals(className) %>">
<liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application %>"> <liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application%>">
<liferay-util:param name="disabledInput" value="<%=String.valueOf(disabledInput) %>"/> <liferay-util:param name="disabledInput" value="<%= String.valueOf(disabledInput) %>" />
<c:if test="<%= soggettoDelegato!=null %>"> <c:if test="<%=soggettoDelegato!=null%>">
<liferay-util:param name="soggettoId" value="<%=String.valueOf(soggettoDelegato.getSoggettoId()) %>"/> <liferay-util:param name="soggettoId" value="<%= String.valueOf(soggettoDelegato.getSoggettoId()) %>" />
</c:if> </c:if>
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
<liferay-portlet:renderURL var="addAllegato" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="addAllegato" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/allegatipratica/edit_allegato.jsp"/> <liferay-portlet:param name="mvcPath" value="/html/allegatipratica/edit_allegato.jsp" />
<liferay-portlet:param name="backURL" value="<%=currentURL %>"/> <liferay-portlet:param name="backURL" value="<%= currentURL %>" />
<liferay-portlet:param name="classPk" value="<%=String.valueOf(classPk) %>"/> <liferay-portlet:param name="classPk" value="<%= String.valueOf(classPk) %>" />
<liferay-portlet:param name="className" value="<%=className %>"/> <liferay-portlet:param name="className" value="<%= className %>" />
<liferay-portlet:param name="comingFrom" value="<%=comingFrom %>"/> <liferay-portlet:param name="comingFrom" value="<%= comingFrom %>" />
<liferay-portlet:param name="inBO" value="<%=String.valueOf(inBO) %>"/> <liferay-portlet:param name="inBO" value="<%= String.valueOf(inBO) %>" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<% <%
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() + "');";
%> %>
<liferay-portlet:resourceURL var="downloadAllURL" id="downloadAllDocPratica"> <liferay-portlet:resourceURL var="downloadAllURL" id="downloadAllDocPratica">
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" /> <liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="classPk" value="<%= String.valueOf(classPk) %>" /> <liferay-portlet:param name="classPk" value="<%= String.valueOf(classPk) %>" />
<liferay-portlet:param name="comingFrom" value="<%= comingFrom %>" /> <liferay-portlet:param name="comingFrom" value="<%= comingFrom %>" />
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<div class="navbar-container header_allegati_table"> <div class="navbar-container header_allegati_table">
<c:if test="<%=!inBO%>"> <c:if test="<%= !inBO %>">
<c:choose> <c:choose>
<c:when test='<%=comingFrom.equals("page_geologica") %>'> <c:when test='<%= comingFrom.equals("page_geologica") %>'>
<h3 class="title-table">Allegati Geologici</h3> <h3 class="title-table">Allegati Geologici</h3>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
@ -134,47 +145,42 @@
</c:choose> </c:choose>
</c:if> </c:if>
<div class="container_btn_all_allegati padding_right_bottom"> <div class="container_btn_all_allegati padding_right_bottom">
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true"
<c:if test="<%=!inBO%>"> cssClass="inline_toolbar">
<c:if test="<%= !inBO %>">
<c:if test="<%= !disabledInput %>"> <c:if test="<%= !disabledInput %>">
<aui:button useDialog="true" value="add-allegato" id='<%=renderResponse.getNamespace()+"add-allegato"%>' icon="fa fa-plus" href="<%=addAllegato %>" cssClass="btn btn-primary btn-action"/> <aui:button useDialog="true" value="add-allegato" id='<%= renderResponse.getNamespace() + "add-allegato" %>'
icon="fa fa-plus" href="<%= addAllegato %>" cssClass="btn btn-primary btn-action" />
</c:if> </c:if>
<aui:button value="Aggiorna Dati" id='<%= renderResponse.getNamespace() + "aggiorna-allegato" %>'
<aui:button value="Aggiorna Dati" id='<%=renderResponse.getNamespace()+"aggiorna-allegato"%>' icon="fa fa-refresh" type="button" icon="fa fa-refresh" type="button" onClick="<%= refresh %>" cssClass="btn btn-primary btn-action" />
onClick="<%=refresh%>" cssClass="btn btn-primary btn-action"/>
</c:if> </c:if>
<span class="tooltip-info" title="Download Allegati"> <aui:button
id='<%= renderResponse.getNamespace() + "download_all" %>' icon="fa fa-download"
<span class="tooltip-info" title="Download Allegati"> cssClass="btn btn-primary btn-action" href="<%= downloadAllURL %>" />
<aui:button id='<%=renderResponse.getNamespace()+"download_all"%>'
icon="fa fa-download" cssClass="btn btn-primary btn-action"
href="<%= downloadAllURL %>"
/>
</span> </span>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</div> </div>
</div> </div>
<div class='separator <%= inBO ? "hidden" : "" %>'></div> <div class='separator <%= inBO ? "hidden" : "" %>'></div>
<% <%
List<String> tipologiaAllegati = new ArrayList<String>(); List<String> tipologiaAllegati = new ArrayList<String>();
if("page_geologica".equals(comingFrom)){ if ("page_geologica".equals(comingFrom)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo(); tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo();
}else if("page_allegati".equals(comingFrom)){ }else if ("page_allegati".equals(comingFrom)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda(); tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda();
}else if("page_fine_lavori".equals(comingFrom)){ }else if ("page_fine_lavori".equals(comingFrom)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori(); tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori();
}else if("page_collaudo".equals(comingFrom)){ }else if ("page_collaudo".equals(comingFrom)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo(); tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo();
} }
%> %>
<div class="container-fluid clearfix " id="<portlet:namespace/>allegati-table"> <div class="container-fluid clearfix " id="<portlet:namespace/>allegati-table">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 asseverazioni allegati_table"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 asseverazioni allegati_table">
<c:if test="<%=!inBO %>"> <c:if test="<%=!inBO%>">
<div class='row asseverazioni-header' > <div class='row asseverazioni-header'>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 asserazioni-header-title"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 asserazioni-header-title">
<div class='row asseverazion-header-row' style="display: flex; align-items: center"> <div class='row asseverazion-header-row' style="display: flex; align-items: center">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 txt-bold text-uppercase">Descrizione</div> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 txt-bold text-uppercase">Descrizione</div>
@ -182,7 +188,7 @@
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 txt-bold text-uppercase">Rimosso da</div> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 txt-bold text-uppercase">Rimosso da</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 txt-bold text-center"> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 txt-bold text-center">
<span class="text-uppercase asseverazion-header-top-row">Firme</span> <span class="text-uppercase asseverazion-header-top-row">Firme</span>
<div class='row' > <div class='row'>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">Presenti</div> <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">Presenti</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">Le tue firme</div> <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">Le tue firme</div>
</div> </div>
@ -192,29 +198,19 @@
</div> </div>
</div> </div>
</c:if> </c:if>
<c:if test="<%=inBO %>"> <c:if test="<%=inBO%>">
<c:if test='<%=!"page_geologica".equals(comingFrom) %>'> <c:if test='<%= !"page_geologica".equals(comingFrom) %>'>
<div class='row asseverazioni-header' > <div class='row asseverazioni-header'>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">Descrizione</div>
Descrizione <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 asserazioni-header-title">Firme presenti</div>
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 asserazioni-header-title">
Firme presenti
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">Azioni</div> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">Azioni</div>
</div> </div>
</c:if> </c:if>
<c:if test='<%="page_geologica".equals(comingFrom) %>'> <c:if test='<%=" page_geologica".equals(comingFrom) %>'>
<div class='row asseverazioni-header' > <div class='row asseverazioni-header'>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">Descrizione</div>
Descrizione <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-header-title">Provenienza</div>
</div> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-header-title">Firme presenti</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-header-title">
Provenienza
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-header-title">
Firme presenti
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">Azioni</div> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">Azioni</div>
</div> </div>
</c:if> </c:if>
@ -222,265 +218,254 @@
</c:if> </c:if>
<% <%
for(String codiceDoc:tipologiaAllegati){ for (String codiceDoc:tipologiaAllegati) {
List<DocPratica> docPraticas = new ArrayList<DocPratica>(); List<DocPratica> docPraticas = new ArrayList<DocPratica>();
if(FineLavori.class.getName().equalsIgnoreCase(className) || Collaudo.class.getName().equalsIgnoreCase(className)){ if(FineLavori.class.getName().equals(className) || Collaudo.class.getName().equals(className)) {
docPraticas = DocPraticaServiceUtil.findByClassPk_Tipologia(classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); docPraticas = DocPraticaServiceUtil.findByClassPk_Tipologia(classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS);
} else { } else {
docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPratica.getIntPraticaId(), classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS);
} }
%> %>
<div class="allegati_wrapper row"> <div class="allegati_wrapper row">
<span class='num_allegati <%= docPraticas.size()>0 ? "green" : "orange" %>'><%=docPraticas.size()%></span> <span class='num_allegati <%=docPraticas.size()>0 ? "green" : "orange"%>'><%=docPraticas.size()%></span>
<liferay-ui:panel extended="false" defaultState="close" collapsible="true" title='<%="label-documenti-tipologia-"+codiceDoc %>' id='<%=codiceDoc+"_panel_allegati_"+comingFrom %>' persistState="true"> <liferay-ui:panel extended="false" defaultState="close" collapsible="true"
title='<%="label-documenti-tipologia-"+codiceDoc%>' id='<%=codiceDoc+"_panel_allegati_"+comingFrom%>'
<% persistState="true">
/* List<DocPratica> docPraticas = DocPraticaServiceUtil.findByIntPratica_Tipologia(intPratica.getIntPraticaId(),codiceDoc, <%
QueryUtil.ALL_POS,QueryUtil.ALL_POS, OrderByComparatorFactoryUtil.create("portos_bo_DocPratica", "dettPraticaIdRimozione", true)); */ if (docPraticas.isEmpty()) {
%>
if(docPraticas.isEmpty()){
%>
<div class="nome_file"> <div class="nome_file">
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8 nessun_allegato"> <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8 nessun_allegato">Nessun allegato presente per la
Nessun allegato presente per la tipologia tipologia</div>
</div>
</div> </div>
<% <%
} 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 { } else {
cssIcon = "fa-close"; for (DocPratica docPratica : docPraticas) {
testoFirme="Nessuna firma digitale rilevata"; FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari());
if(firme.numeroFirme()>0){
cssColor= "txt-green"; StringBuilder title = new StringBuilder();
} String cssIcon = StringPool.BLANK;
} String cssColor= StringPool.BLANK;
if(firme.numeroFirme()>0){ String testoFirme = "Non ci sono firme sul file";
cssIcon = "fa-check"; if (firme.getFirmeDigitali().size() > 0) {
} cssIcon = "fa-check";
cssColor= "txt-green";
//if(firme.numeroFirme()>0){ testoFirme = StringPool.BLANK;
title.append("Firma sul file:<ul>"); } else if (docPratica.getStatus() == 1) {
title.append("<li>"+testoFirme+"</li>"); cssIcon= "fa-cog fa-spin";
if(!firme.getFirmeDigitali().isEmpty()){ cssColor= "txt-orange";
testoFirme = "Estrazione firme in corso";
for(FirmeDetail firma: firme.getFirmeDigitali()){ } else if (docPratica.getStatus() == 4) {
//TODO nome e cognome cssIcon= "fa-alert";
List<Soggetto> soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(docPratica.getIntPraticaId(), firma.getCfFirmatario()); cssColor= "txt-red";
if (soggetti.size() > 0 ){ testoFirme = "Errore nell'estrazione delle firme";
title.append("<li>"+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"</li>"); } else {
} cssIcon = "fa-close";
title.append("<li>"+firma.getCfFirmatario()); testoFirme = "Nessuna firma digitale rilevata";
if(Validator.isNotNull(firma.getDtFirma())){ if (firme.numeroFirme() > 0) {
title.append(" del "+dateFormatDate.format(firma.getDtFirma())); cssColor= "txt-green";
}
title.append("</li>");
}
}
title.append("</ul>");
if(!firme.getFirmeApplicativo().isEmpty()){
title.append("Firme da applicativo:<ul>");
for(FirmeDetail firma: firme.getFirmeApplicativo()){
//TODO nome e cognome
List<Soggetto> soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(docPratica.getIntPraticaId(), firma.getCfFirmatario());
if (soggetti.size() > 0 ){
title.append("<li>"+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"</li>");
}
title.append("<li>"+firma.getCfFirmatario());
if(Validator.isNotNull(firma.getDtFirma())){
title.append(" del "+dateFormatDate.format(firma.getDtFirma()));
}
title.append("</li>");
}
title.append("</ul>");
}
//}
%>
<div class="nome_file">
<c:if test="<%= !inBO %>">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
</c:if>
<c:if test="<%= inBO %>">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
</c:if>
<%
String color = "";
if( Validator.isNotNull(docPratica.getDettPraticaIdRimozione()) ){
color = "txt-red";
} else {
color = "txt-green";
} }
%> }
<i class="fa fa-circle file-icon <%= color %>" aria-hidden="true"></i> <%=docPratica.getDescLong() %> if (firme.numeroFirme() > 0) {
</div> cssIcon = "fa-check";
}
<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2 <%= inBO ? "hidden" : "" %> asserazioni-body-title'> title.append("Firma sul file:<ul>");
<% title.append("<li>" + testoFirme + "</li>");
String adding = StringPool.BLANK; if (!firme.getFirmeDigitali().isEmpty()) {
if(FineLavori.class.getName().equalsIgnoreCase(className)){ for (FirmeDetail firma: firme.getFirmeDigitali()) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk()); if (cfNome.containsKey(firma.getCfFirmatario())) {
if(fineLavori!=null){ title.append("<li>" + cfNome.get(firma.getCfFirmatario()) + "</li>");
adding = fineLavori.getFullDescription(); }
} title.append("<li>" + firma.getCfFirmatario());
} else if(Collaudo.class.getName().equalsIgnoreCase(className)){ if (Validator.isNotNull(firma.getDtFirma())) {
Collaudo collaudo = CollaudoLocalServiceUtil.fetchCollaudo(docPratica.getClassPk()); title.append(" del " + dateFormatDate.format(firma.getDtFirma()));
if(collaudo!=null){ }
adding = collaudo.getFullDescription(); title.append("</li>");
}
}else{
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk());
if(dettPratica!=null){
adding = dettPratica.getFullDescription();
}
} }
}
out.print(adding); title.append("</ul>");
%> if (!firme.getFirmeApplicativo().isEmpty()) {
</div> title.append("Firme da applicativo:<ul>");
for (FirmeDetail firma: firme.getFirmeApplicativo()) {
<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2 <%= inBO ? "hidden" : "" %> asserazioni-body-title'> if (cfNome.containsKey(firma.getCfFirmatario())) {
<% title.append("<li>" + cfNome.get(firma.getCfFirmatario()) + "</li>");
//Lasciato solo dettpratica perche' fine lavori e collaudo non possono rimuovere gli allegati }
DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getDettPraticaIdRimozione()); title.append("<li>"+firma.getCfFirmatario());
if(removing != null){ if (Validator.isNotNull(firma.getDtFirma())) {
out.print(removing.getFullDescription()); title.append(" del "+dateFormatDate.format(firma.getDtFirma()));
}
%>
</div>
<c:if test='<%= inBO && "page_geologica".equals(comingFrom) %>' >
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<span>
<%
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());
}
}
}
} }
%> title.append("</li>");
<%=sbProvenienza.toString() %> }
title.append("</ul>");
</span> }
</div> %>
<div class="nome_file">
</c:if> <c:if test="<%=!inBO%>">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<c:if test='<%= inBO %>' > </c:if>
<c:if test='<%="page_geologica".equals(comingFrom) %>' > <c:if test="<%=inBO%>">
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-body-title text-center"> <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
</c:if> </c:if>
<c:if test='<%=!"page_geologica".equals(comingFrom) %>' > <%
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 asserazioni-body-title text-center"> String color = "txt-red";
</c:if> if (Validator.isNull(docPratica.getDettPraticaIdRimozione())) {
</c:if> color = "txt-green";
}
%>
<i class="fa fa-circle file-icon <%= color %>" aria-hidden="true"></i>
<%= docPratica.getDescLong() %>
</div>
<c:if test='<%= !inBO %>' > <div class='col-xs-2 col-sm-2 col-md-2 col-lg-2 <%=inBO ? "hidden" : ""%> asserazioni-body-title'>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-body-title text-center"> <%
</c:if> 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);
%>
</div>
<div class='<%= inBO ? "col-xs-12 col-sm-12 col-md-12 col-lg-12" : "col-xs-6 col-sm-6 col-md-6 col-lg-6" %>'> <div class='col-xs-2 col-sm-2 col-md-2 col-lg-2 <%= inBO ? "hidden" : "" %> asserazioni-body-title'>
<span class='<%="fa "+cssIcon+" asseverazioni-icon tooltip-info "+cssColor %>' title="<%=title%>"> <%
<c:if test="<%=firme.numeroFirme()>0 %>"> //Lasciato solo dettpratica perche' fine lavori e collaudo non possono rimuovere gli allegati
<sub class="txt-bold"><%= firme.numeroFirme() %></sub> long pk = docPratica.getDettPraticaIdRimozione();
</c:if> if (0 != pk) {
</span> if (!dettPraticas.containsKey(pk)) {
</div> dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk));
<div class='col-xs-6 col-sm-6 col-md-6 col-lg-6 <%= inBO ? "hidden" : "" %>'> }
<% out.print(dettPraticas.get(pk).getFullDescription());
if(firme.firmaIsPresent(user.getScreenName())){ }
%> %>
<span class="fa fa-check asseverazioni-icon tooltip-info txt-green" title="La tua firma è presente"></span> </div>
<%
}else{
%>
<span class="fa fa-close asseverazioni-icon tooltip-info txt-red" title="La tua firma non è presente"></span>
<%
}
%>
</div>
</div>
<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-btn text-center'>
<c:choose> <c:if test='<%= inBO && "page_geologica".equals(comingFrom) %>'>
<c:when test="<%= Validator.isNull(docPratica.getDlFileEntryId()) && Validator.isNotNull(docPratica.getOldDlFileEntryId()) %>"> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<liferay-util:include page="/html/common/import_window.jsp" servletContext="<%= application %>" portletId="<%= PortletKeys.FASCICOLO %>" > <span>
<liferay-util:param name="classPK" value="<%= String.valueOf(docPratica.getDocPraticaId()) %>" /> <%
<liferay-util:param name="classNAME" value="<%= DocPratica.class.getName() %>" /> if (className.equals(DettPratica.class.getName())) {
<liferay-util:param name="message" value="import-documento"></liferay-util:param> pk = docPratica.getClassPk();
</liferay-util:include> if (!dettPraticas.containsKey(pk)) {
</c:when> dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk));
<c:otherwise> }
<c:if test="<%= !inBO %>"> DettPratica dett = dettPraticas.get(pk);
<c:if test="<%= !disabledInput || canSignGeoDocs %>"> if (dett != null) {
<liferay-util:include page="/html/allegatipratica/allegati_action.jsp" servletContext="<%=application %>"> if (dett.getIntegrazione() == 0) {
<liferay-util:param name="backUrl" value="<%=currentURL %>"/> out.print("Pratica Originale");
<liferay-util:param name="comingFrom" value="<%=comingFrom %>"/> } else {
<liferay-util:param name="classPk" value="<%=String.valueOf(classPk) %>"/> if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) {
<liferay-util:param name="className" value="<%=className %>"/> out.print("Ric Integrazione # " + dett.getIntegrazione());
<liferay-util:param name="docPraticaId" value="<%=String.valueOf(docPratica.getDocPraticaId()) %>"/> } else if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)) {
<liferay-util:param name="disabledInput" value="<%=String.valueOf(disabledInput) %>"/> out.print("Variante # " + dett.getVarianteNumero());
</liferay-util:include> }
</c:if> }
</c:if> }
<c:if test="<%= inBO %>"> }
<liferay-portlet:renderURL var="previewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> %>
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(docPratica.getDlFileEntryId()) %>" /> </span>
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" /> </div>
</liferay-portlet:renderURL> </c:if>
<liferay-ui:icon id='<%="open_"+docPratica.getDocPraticaId() %>' linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" message="Visualizza" url="<%=previewURL%>" useDialog="true"/> <c:if test='<%= inBO %>'>
<liferay-ui:icon id='<%="download_"+docPratica.getDocPraticaId() %>' linkCssClass="btn btn-action" iconCssClass="fa fa-download" message="Download" url="<%=docPratica.getDownloadUrl(themeDisplay)%>"/> <c:choose>
<c:when test='<%= "page_geologica".equals(comingFrom) %>'>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-body-title text-center">
</c:when>
<c:otherwise>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 asserazioni-body-title text-center">
</c:otherwise>
</c:choose>
</c:if>
</c:if> <c:if test='<%= !inBO %>'>
</c:otherwise> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-body-title text-center">
</c:choose> </c:if>
</div>
</div>
<% <div class='<%= inBO ? "col-xs-12 col-sm-12 col-md-12 col-lg-12" : "col-xs-6 col-sm-6 col-md-6 col-lg-6" %>'>
} <span class='<%="fa "+cssIcon+" asseverazioni-icon tooltip-info "+cssColor%>' title="<%=title%>">
} <c:if test="<%= firme.numeroFirme() > 0 %>">
%> <sub class="txt-bold"><%= firme.numeroFirme() %></sub>
</liferay-ui:panel> </c:if>
</span>
</div>
<div class='col-xs-6 col-sm-6 col-md-6 col-lg-6 <%=inBO ? "hidden" : ""%>'>
<c:choose>
<c:when test="<%= (firme.firmaIsPresent(user.getScreenName())) %>">
<span class="fa fa-check asseverazioni-icon tooltip-info txt-green" title="La tua firma è presente"></span>
</c:when>
<c:otherwise>
<span class="fa fa-close asseverazioni-icon tooltip-info txt-red" title="La tua firma non è presente"></span>
</c:otherwise>
</c:choose>
</div>
</div>
<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-btn text-center'>
<c:choose>
<c:when
test="<%= Validator.isNull(docPratica.getDlFileEntryId()) && Validator.isNotNull(docPratica.getOldDlFileEntryId()) %>">
<liferay-util:include page="/html/common/import_window.jsp" servletContext="<%= application %>"
portletId="<%= PortletKeys.FASCICOLO %>">
<liferay-util:param name="classPK" value="<%= String.valueOf(docPratica.getDocPraticaId()) %>" />
<liferay-util:param name="classNAME" value="<%= DocPratica.class.getName() %>" />
<liferay-util:param name="message" value="import-documento"></liferay-util:param>
</liferay-util:include>
</c:when>
<c:otherwise>
<c:if test="<%= !inBO %>">
<c:if test="<%= !disabledInput || canSignGeoDocs %>">
<liferay-util:include page="/html/allegatipratica/allegatWi_action.jsp"
servletContext="<%= application %>">
<liferay-util:param name="backUrl" value="<%= currentURL %>" />
<liferay-util:param name="comingFrom" value="<%= comingFrom %>" />
<liferay-util:param name="classPk" value="<%= String.valueOf(classPk) %>" />
<liferay-util:param name="className" value="<%= className %>" />
<liferay-util:param name="docPraticaId" value="<%= String.valueOf(docPratica.getDocPraticaId()) %>" />
<liferay-util:param name="disabledInput" value="<%= String.valueOf(disabledInput) %>" />
</liferay-util:include>
</c:if>
</c:if>
<c:if test="<%= inBO %>">
<liferay-portlet:renderURL var="previewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(docPratica.getDlFileEntryId()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" />
</liferay-portlet:renderURL>
<liferay-ui:icon id='<%="open_" + docPratica.getDocPraticaId() %>' linkCssClass="btn btn-action"
iconCssClass="fa fa-clipboard" message="Visualizza" url="<%= previewURL %>" useDialog="true" />
<liferay-ui:icon id='<%="download_"+ docPratica.getDocPraticaId() %>' linkCssClass="btn btn-action"
iconCssClass="fa fa-download" message="Download" url="<%= docPratica.getDownloadUrl(themeDisplay) %>" />
</c:if>
</c:otherwise>
</c:choose>
</div> </div>
<%
}
%>
</div> </div>
<%
}
}
%>
</liferay-ui:panel>
</div>
<%
}
%>
</div>
</div> </div>

114
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp

@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%>
<%@page import="com.liferay.portal.kernel.util.HttpUtil"%> <%@page import="com.liferay.portal.kernel.util.HttpUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
@ -15,88 +16,90 @@
<%@ include file="/html/fascicolofe/init.jsp" %> <%@ include file="/html/fascicolofe/init.jsp" %>
<% <%
String backURL = ParamUtil.getString(request, "backURL"); String backURL = ParamUtil.getString(request, "backURL");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0l);
long intPraticaId = ParamUtil.getLong(request, "intPraticaId",0l); long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0l);
String current_tab = ParamUtil.getString(request, "current_tab",StringPool.BLANK); String current_tab = ParamUtil.getString(request, "current_tab", StringPool.BLANK);
boolean openVerifyUrl = ParamUtil.getBoolean(request, "openVerifyUrl"); boolean openVerifyUrl = ParamUtil.getBoolean(request, "openVerifyUrl");
String verifyArea = ParamUtil.getString(request, "verifyArea", StringPool.BLANK); String verifyArea = ParamUtil.getString(request, "verifyArea", StringPool.BLANK);
DettPratica dettPratica = null; DettPratica dettPratica = null;
IntPratica intPratica = null; IntPratica intPratica = null;
if(dettPraticaId!=0l){ if (dettPraticaId != 0l) {
dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); intPraticaId = dettPratica.getIntPraticaId();
intPraticaId = dettPratica.getIntPraticaId(); intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
}else{ } else {
intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId);
if(dettPratica==null){ if (dettPratica == null) {
dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId);
}
dettPraticaId = dettPratica.getDettPraticaId();
} }
dettPraticaId = dettPratica.getDettPraticaId();
}
request.setAttribute("bean.dettPratica", dettPratica); request.setAttribute("bean.dettPratica", dettPratica);
String tipoIntegrazione = dettPratica.getTipoIntegrazione();
request.setAttribute("bean.tipoIntegrazione", tipoIntegrazione);
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId());
boolean geoDisabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(),dettPratica.getDettPraticaId())
|| !ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId());
String[] pageDatiDomanda = new String[] {"page_dettagli_principali", "page_soggetti", "page_desc_edificio", String tipoIntegrazione = dettPratica.getTipoIntegrazione();
"page_geologica", "page_allegati", "page_asseverazioni_riepilogo"}; request.setAttribute("bean.tipoIntegrazione", tipoIntegrazione);
if(TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione)){ Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPraticaId);
pageDatiDomanda = Arrays.copyOf(pageDatiDomanda, pageDatiDomanda.length-1); SessionUtil.setDettPraticaObject(request, dettPraticaId, "soggettoDelegato", soggettoDelegato);
} Boolean hasDelegaCompilazioneDomanda = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPraticaId);
SessionUtil.setDettPraticaObject(request, dettPraticaId, "hasDelegaCompilazioneDomanda", hasDelegaCompilazioneDomanda);
Boolean praticaIsEditable = ValidazionePraticaUtil.praticaIsEditable(dettPraticaId);
SessionUtil.setDettPraticaObject(request, dettPraticaId, "praticaIsEditable", praticaIsEditable);
Boolean pagamentoIsEnable = ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId);
SessionUtil.setDettPraticaObject(request, dettPraticaId, "pagamentoIsEnable", pagamentoIsEnable);
String[][] categorySections = {pageDatiDomanda}; boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPraticaId);
boolean geoDisabledInput = !hasDelegaCompilazioneDomanda || !praticaIsEditable;
String[] _CATEGORY_NAMES = {"cat_dati_domanda"}; String[] pageDatiDomanda = new String[] {
"page_dettagli_principali", "page_soggetti", "page_desc_edificio",
"page_geologica", "page_allegati", "page_asseverazioni_riepilogo"
};
if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione)) {
pageDatiDomanda = Arrays.copyOf(pageDatiDomanda, pageDatiDomanda.length-1);
}
String[][] categorySections = { pageDatiDomanda };
String[] _CATEGORY_NAMES = { "cat_dati_domanda" };
%> %>
<liferay-portlet:actionURL name="saveDettPratica" var="saveDettPraticaURL" > <liferay-portlet:actionURL name="saveDettPratica" var="saveDettPraticaURL" >
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>"/> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>"/>
<liferay-portlet:param name="backURL" value="<%=backURL %>"/> <liferay-portlet:param name="backURL" value="<%= backURL %>"/>
<liferay-portlet:param name="successURL" value="<%=currentURL %>"/> <liferay-portlet:param name="successURL" value="<%= currentURL %>"/>
<liferay-portlet:param name="backgroundTaskActive" value="<%=String.valueOf(true) %>"/> <liferay-portlet:param name="backgroundTaskActive" value="<%= String.valueOf(true) %>"/>
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-portlet:actionURL name="saveTipoPratica" var="saveTipoPraticaURL" > <liferay-portlet:actionURL name="saveTipoPratica" var="saveTipoPraticaURL" >
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>"/> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>"/>
<liferay-portlet:param name="backURL" value="<%=backURL %>"/> <liferay-portlet:param name="backURL" value="<%= backURL %>"/>
<liferay-portlet:param name="successURL" value="<%=currentURL %>"/> <liferay-portlet:param name="successURL" value="<%= currentURL %>"/>
<liferay-portlet:param name="backgroundTaskActive" value="<%=String.valueOf(true) %>"/> <liferay-portlet:param name="backgroundTaskActive" value="<%= String.valueOf(true) %>"/>
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:form name="fmDomande" onSubmit="preventDefault();" action="<%= Validator.isNull(tipoIntegrazione) ? saveDettPraticaURL : saveTipoPraticaURL %>"> <aui:form name="fmDomande" onSubmit="preventDefault();" action="<%= Validator.isNull(tipoIntegrazione) ? saveDettPraticaURL : saveTipoPraticaURL %>">
<aui:model-context bean="<%= dettPratica %>" model="<%= DettPratica.class %>"></aui:model-context>
<aui:model-context bean="<%=dettPratica %>" model="<%=DettPratica.class %>"></aui:model-context>
<aui:input type="hidden" name="bozza" /> <aui:input type="hidden" name="bozza" />
<aui:input type="hidden" name="disabledSubmit" value="<%= disabledInput %>" /> <aui:input type="hidden" name="disabledSubmit" value="<%= disabledInput %>" />
<aui:input type="hidden" name="geoDisabledSubmit" value="<%= geoDisabledInput %>" /> <aui:input type="hidden" name="geoDisabledSubmit" value="<%= geoDisabledInput %>" />
<aui:input type="hidden" name="current_tab" value="<%=current_tab %>"/> <aui:input type="hidden" name="current_tab" value="<%= current_tab %>"/>
<aui:input type="hidden" name="tipoIntegrazione" value="<%= tipoIntegrazione %>" /> <aui:input type="hidden" name="tipoIntegrazione" value="<%= tipoIntegrazione %>" />
<liferay-util:buffer var="htmlTop"> <liferay-util:buffer var="htmlTop">
<c:if test="<%=dettPratica.getStatus()!=WorkflowConstants.STATUS_INCOMPLETE %>"> <c:if test="<%= dettPratica.getStatus() != WorkflowConstants.STATUS_INCOMPLETE %>">
<%@ include file="/html/fascicolofe/navigator/common/html_top.jspf" %> <%@ include file="/html/fascicolofe/navigator/common/html_top.jspf" %>
</c:if> </c:if>
<c:if test="<%=dettPratica.getStatus()==WorkflowConstants.STATUS_INCOMPLETE %>"> <c:if test="<%= dettPratica.getStatus() == WorkflowConstants.STATUS_INCOMPLETE %>">
<%@ include file="/html/fascicolofe/navigator/common/html_top_pagamento.jspf" %> <%@ include file="/html/fascicolofe/navigator/common/html_top_pagamento.jspf" %>
</c:if> </c:if>
</liferay-util:buffer> </liferay-util:buffer>
<liferay-util:buffer var="htmlBottom"> <liferay-util:buffer var="htmlBottom">
<c:if test="<%=dettPratica.getStatus()==WorkflowConstants.STATUS_DRAFT %>"> <c:if test="<%= dettPratica.getStatus() == WorkflowConstants.STATUS_DRAFT %>">
<%@ include file="/html/fascicolofe/navigator/common/html_bottom.jspf" %> <%@ include file="/html/fascicolofe/navigator/common/html_bottom.jspf" %>
</c:if> </c:if>
</liferay-util:buffer> </liferay-util:buffer>
<liferay-ui:form-navigator <liferay-ui:form-navigator
categoryNames="<%= _CATEGORY_NAMES %>" categoryNames="<%= _CATEGORY_NAMES %>"
displayStyle="steps" displayStyle="steps"
@ -106,11 +109,9 @@
htmlBottom="<%=htmlBottom%>" htmlBottom="<%=htmlBottom%>"
showButtons="<%=false %>" showButtons="<%=false %>"
htmlTop="<%=htmlTop%>" /> htmlTop="<%=htmlTop%>" />
</aui:form> </aui:form>
<c:if test="<%= openVerifyUrl && intPratica.getUserId() == user.getUserId() %>">
<c:if test="<%=openVerifyUrl && intPratica.getUserId()== user.getUserId() %>">
<c:if test="<%= !TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione) %>"> <c:if test="<%= !TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione) %>">
<c:if test='<%= "verifyFascicolo".equalsIgnoreCase(verifyArea) %>'> <c:if test='<%= "verifyFascicolo".equalsIgnoreCase(verifyArea) %>'>
@ -292,3 +293,4 @@
document.location.hash='_1_WAR_portosfeportlet_tab=<%=current_tab%>'; document.location.hash='_1_WAR_portosfeportlet_tab=<%=current_tab%>';
} }
</aui:script> </aui:script>
<% SessionUtil.cleanDettPraticaObjects(request, dettPraticaId); %>

6
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/html_top_pagamento.jspf

@ -1,8 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> <%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> <%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Asseverazione"%> <%@page import="it.tref.liferay.portos.bo.model.Asseverazione"%>
@ -38,11 +36,11 @@
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:icon <liferay-ui:icon
linkCssClass='<%=ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId)?"btn btn-primary":"btn btn-primary disabled" %>' linkCssClass='<%= pagamentoIsEnable ?"btn btn-primary":"btn btn-primary disabled" %>'
iconCssClass="fa fa-cogs" iconCssClass="fa fa-cogs"
useDialog = "true" useDialog = "true"
message='<%= PagamentoLocalServiceUtil.countByClassPk(dettPratica.getDettPraticaId())>0 ? LanguageUtil.get(pageContext, "dati-pagamento") : LanguageUtil.get(pageContext, "calcola-importo") %>' message='<%= PagamentoLocalServiceUtil.countByClassPk(dettPratica.getDettPraticaId())>0 ? LanguageUtil.get(pageContext, "dati-pagamento") : LanguageUtil.get(pageContext, "calcola-importo") %>'
url="<%= ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId)?calcolaURL:StringPool.DASH %>" url="<%= pagamentoIsEnable ? calcolaURL : StringPool.DASH %>"
/> />
</c:if> </c:if>

84
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf

@ -29,38 +29,30 @@
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%> <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<div class="pull-right"> <div class="pull-right">
<% <%
Log _log = LogFactoryUtil.getLog("save_actions.jspf"); String randomId = StringUtil.randomId();
String formName = "fmDomande";
String buttonId = "fmbuttonsalvaconferma_" + randomId;
String buttonAsseverazioneId = "fmbuttonasseverazione_" + randomId;
String script =
"var el_relazioni = $('textarea[name=_" + PortletKeys.FASCICOLOFE + "_{{prefix}}Relazioni]');"
+ "if (el_relazioni.length) {"
+ " var el_coniugio = $('input[name=_" + PortletKeys.FASCICOLOFE + "_{{prefix}}Coniugio]');"
+ " var el_coniugiochk = $('input[name=_" + PortletKeys.FASCICOLOFE + "_{{prefix}}Coniugio]:checked');"
+ " console.log('length: ' + el_relazioni.length);"
+ " var err_coniugio = (el_coniugiochk.length == 0);"
+ " var err_relazioni = ((el_relazioni.val().replace(/\\s*/g, '').length < 10) && (el_coniugiochk.val() == 1));"
+ " el_coniugio.parent().css({color:(err_coniugio ? '#a94442' : '#333')});"
+ " el_relazioni.css({'border-color':(err_relazioni ?'#a94442' : '#ccc')});"
+ " if (err_coniugio || err_relazioni) {"
+ " $('#" + renderResponse.getNamespace() + "{{prefix}}SaveAndCloseDiv_" + randomId + "').parent().scrollTop(0);"
+ " return false;"
+ " }"
+ "}"
+ "saveDettPratica(false, '{{type}}');";
String randomId = StringUtil.randomId(); boolean hasDelegaAttiva = DelegheUtil.hasDelegaAttiva(user.getUserId(), dettPraticaId);
String formName = "fmDomande"; boolean hasAsseverazioneAttiva = AsseverazioniUtil.hasAsseverazioneAttiva(user.getUserId(), intPraticaId);
String buttonId = "fmbuttonsalvaconferma_" + randomId; %>
String buttonAsseverazioneId = "fmbuttonasseverazione_" + randomId;
String script = "var el_relazioni = $('textarea[name=_"
+ PortletKeys.FASCICOLOFE
+ "_{{prefix}}Relazioni]');"
+ "if (el_relazioni.length) {"
+ "var el_coniugio = $('input[name=_"
+ PortletKeys.FASCICOLOFE
+ "_{{prefix}}Coniugio]');"
+ "var el_coniugiochk = $('input[name=_"
+ PortletKeys.FASCICOLOFE
+ "_{{prefix}}Coniugio]:checked');"
+
"console.log('length: ' + el_relazioni.length);"
+
"var err_coniugio = (el_coniugiochk.length == 0);"
+ "var err_relazioni = ((el_relazioni.val().replace(/\\s*/g, '').length < 10) && (el_coniugiochk.val() == 1));"
+
"el_coniugio.parent().css({color:(err_coniugio ? '#a94442' : '#333')});"
+ "el_relazioni.css({'border-color':(err_relazioni ?'#a94442' : '#ccc')});" +
"if (err_coniugio || err_relazioni) {" + "$('#" + renderResponse.getNamespace()
+ "{{prefix}}SaveAndCloseDiv_" + randomId + "').parent().scrollTop(0);" + "return false;"
+ "}" + "}" + "saveDettPratica(false, '{{type}}');";
%>
<aui:input type="hidden" name="cmd" value="" /> <aui:input type="hidden" name="cmd" value="" />
<aui:input type="hidden" name="verifyArea" value="" /> <aui:input type="hidden" name="verifyArea" value="" />
<liferay-ui:icon-menu showWhenSingleIcon="<%=false%>" extended="false" showExpanded="true" <liferay-ui:icon-menu showWhenSingleIcon="<%=false%>" extended="false" showExpanded="true"
@ -72,11 +64,7 @@
<liferay-ui:icon iconCssClass="fa fa-save" message="salva-bozza" url="javascript:saveDettPratica(true);" <liferay-ui:icon iconCssClass="fa fa-save" message="salva-bozza" url="javascript:saveDettPratica(true);"
linkCssClass="btn" /> linkCssClass="btn" />
</c:if> </c:if>
<c:if <c:if test="<%=intPratica.getUserId() == user.getUserId() && !hasDelegaAttiva && !hasAsseverazioneAttiva%>">
test="<%=intPratica.getUserId() == user.getUserId()
&& !DelegheUtil.hasDelegaAttiva(user.getUserId(), dettPraticaId)
&& !AsseverazioniUtil.hasAsseverazioneAttiva(user.getUserId(), dettPraticaId)%>">
<liferay-ui:icon iconCssClass="fa fa-check-square" message="salva-verifica" <liferay-ui:icon iconCssClass="fa fa-check-square" message="salva-verifica"
url="javascript:saveDettPratica(false, 'domanda', 'verifyFascicolo');" linkCssClass="btn btn-primary" /> url="javascript:saveDettPratica(false, 'domanda', 'verifyFascicolo');" linkCssClass="btn btn-primary" />
</c:if> </c:if>
@ -95,16 +83,7 @@
&& dettPratica.getNormEsenteSpese(); && dettPratica.getNormEsenteSpese();
boolean isIntegrazione = dettPratica.getTipoIntegrazione().equals( boolean isIntegrazione = dettPratica.getTipoIntegrazione().equals(
TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE); TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE);
%>
<%-- <c:if test="<%= !isEsente && !isIntegrazione && DelegheUtil.canDoPayment(user.getUserId(),dettPraticaId) %>">
<liferay-ui:icon
iconCssClass="fa fa-cogs"
linkCssClass='<%=ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId)?"btn btn-primary":"btn btn-primary disabled" %>'
message='<%= PagamentoLocalServiceUtil.countByClassPk(dettPraticaId)>0 ? LanguageUtil.get(pageContext, "dati-pagamento") : LanguageUtil.get(pageContext, "calcola-importo") %>'
url="javascript:saveDettPratica(false, 'domanda', 'verifyPagamenti');"
/>
</c:if> --%>
<%
Map<String, Object> dataMap = new HashMap<String, Object>(); Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put("id", renderResponse.getNamespace() + "openVerificaFascicolo"); dataMap.put("id", renderResponse.getNamespace() + "openVerificaFascicolo");
%> %>
@ -143,8 +122,7 @@
</c:if> </c:if>
<c:if test="<%=!isEsente%>"> <c:if test="<%=!isEsente%>">
<liferay-ui:icon iconCssClass="fa fa-cogs" <liferay-ui:icon iconCssClass="fa fa-cogs"
linkCssClass='<%=ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId) ? "btn btn-primary" linkCssClass='<%= pagamentoIsEnable ? "btn btn-primary" : "btn btn-primary disabled" %>'
: "btn btn-primary disabled"%>'
message='<%=PagamentoLocalServiceUtil.countByClassPk(dettPraticaId) > 0 ? LanguageUtil message='<%=PagamentoLocalServiceUtil.countByClassPk(dettPraticaId) > 0 ? LanguageUtil
.get(pageContext, "dati-pagamento") : LanguageUtil.get(pageContext, .get(pageContext, "dati-pagamento") : LanguageUtil.get(pageContext,
"calcola-importo")%>' "calcola-importo")%>'
@ -154,18 +132,12 @@
</c:if> </c:if>
<c:if <c:if test="<%= hasDelegaAttiva && !DelegheUtil.hasDelegaPagamento(user.getUserId(), dettPraticaId) %>">
test="<%=DelegheUtil.hasDelegaAttiva(user.getUserId(), dettPraticaId)
&& !DelegheUtil.hasDelegaPagamento(user.getUserId(), dettPraticaId)%>">
<liferay-ui:icon iconCssClass="fa fa-save" message="save" url="javascript:saveDettPratica(true);" <liferay-ui:icon iconCssClass="fa fa-save" message="save" url="javascript:saveDettPratica(true);"
linkCssClass="btn" /> linkCssClass="btn" />
<% <%
long delegaId = ParamUtil.getLong(request, "delegaId"); long delegaId = ParamUtil.getLong(request, "delegaId");
if (delegaId == 0) {
_log.error("Errore pratica id " + intPratica.getIntPraticaId() + ", utente "
+ user.getScreenName() + ", delegaId = 0");
}
Delega delega = DelegaLocalServiceUtil.getDelega(delegaId); Delega delega = DelegaLocalServiceUtil.getDelega(delegaId);
boolean validated = true; boolean validated = true;
StringBuilder tooltipSection = new StringBuilder(); StringBuilder tooltipSection = new StringBuilder();
@ -355,7 +327,7 @@
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
</c:if> </c:if>
<c:if test="<%=AsseverazioniUtil.hasAsseverazioneAttiva(user.getUserId(), intPraticaId)%>"> <c:if test="<%= hasAsseverazioneAttiva %>">
<liferay-ui:icon id="<%=buttonAsseverazioneId%>" iconCssClass="fa fa-save" message="Assevera" url="#" <liferay-ui:icon id="<%=buttonAsseverazioneId%>" iconCssClass="fa fa-save" message="Assevera" url="#"
linkCssClass="btn btn-primary" /> linkCssClass="btn btn-primary" />
<div id='<%=renderResponse.getNamespace() + "asSaveAndCloseDiv_" + randomId%>' class="hide"> <div id='<%=renderResponse.getNamespace() + "asSaveAndCloseDiv_" + randomId%>' class="hide">

21
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_allegati.jsp

@ -8,18 +8,15 @@
<%@ include file="/html/fascicolofe/init.jsp" %> <%@ include file="/html/fascicolofe/init.jsp" %>
<% <%
String comingFrom = ParamUtil.getString(request,"comingFrom","page_allegati"); String comingFrom = ParamUtil.getString(request,"comingFrom", "page_allegati");
DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
if(dettPratica==null){ if (dettPratica == null) {
dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); } else {
}else{ dettPraticaId = dettPratica.getDettPraticaId();
dettPraticaId = dettPratica.getDettPraticaId(); }
} String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione");
String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione");
%> %>
<aui:script use="aui-base"> <aui:script use="aui-base">

14
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_asseverazioni_riepilogo.jsp

@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%> <%@page import="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%>
@ -13,13 +14,12 @@
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@ include file="/html/fascicolofe/init.jsp"%> <%@ include file="/html/fascicolofe/init.jsp"%>
<% <%
DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica");
long dettPraticaId = dettPratica.getDettPraticaId(); long dettPraticaId = dettPratica.getDettPraticaId();
long intPraticaId = dettPratica.getIntPraticaId();
long intPraticaId = dettPratica.getIntPraticaId(); boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, dettPraticaId, "hasDelegaCompilazioneDomanda");
boolean disabledInput = !hasDelegaCompilazioneDomanda;
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()); Soggetto soggettoDelegato = (Soggetto) SessionUtil.getDettPraticaObject(request, dettPraticaId, "soggettoDelegato");
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId());
%> %>
<liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application %>"> <liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application %>">

15
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_desc_edificio.jsp

@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%> <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
@ -12,15 +13,15 @@
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@ include file="/html/fascicolofe/init.jsp" %> <%@ include file="/html/fascicolofe/init.jsp" %>
<% <%
DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId()); Soggetto soggettoDelegato = (Soggetto) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "soggettoDelegato");
request.setAttribute("bean.dettPratica",dettPratica); request.setAttribute("bean.dettPratica",dettPratica);
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()) boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "hasDelegaCompilazioneDomanda");
|| TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()); boolean disabledInput = !hasDelegaCompilazioneDomanda || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione());
boolean disabledByIntegrazione = TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione()); boolean disabledByIntegrazione = TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione());
%> %>
<liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application %>"> <liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application %>">

695
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp

File diff soppresso perché troppo grande Load Diff

37
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_geologica.jsp

@ -1,5 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%>
<%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%> <%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
@ -12,32 +12,31 @@
<%@ include file="/html/fascicolofe/init.jsp"%> <%@ include file="/html/fascicolofe/init.jsp"%>
<% <%
DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
List<Soggetto> responsabiliCompilazione = DelegheUtil.getGeologi(intPratica.getIntPraticaId()); List<Soggetto> responsabiliCompilazione = DelegheUtil.getGeologi(intPratica.getIntPraticaId());
if (responsabiliCompilazione.size() > 0) if (responsabiliCompilazione.size() > 0) {
request.setAttribute("responsabiliCompilazione", responsabiliCompilazione); request.setAttribute("responsabiliCompilazione", responsabiliCompilazione);
}
boolean isGeologo = true; boolean isGeologo = true;
if (responsabiliCompilazione.size() > 0) { if (responsabiliCompilazione.size() > 0) {
isGeologo = false; isGeologo = false;
for (Soggetto soggetto : responsabiliCompilazione) { for (Soggetto soggetto : responsabiliCompilazione) {
if (user.getScreenName().equalsIgnoreCase(soggetto.getCodiceFiscale())) if (user.getScreenName().equalsIgnoreCase(soggetto.getCodiceFiscale()))
isGeologo = true; isGeologo = true;
}
} }
}
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(), boolean praticaIsEditable = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "praticaIsEditable");
dettPratica.getDettPraticaId()) boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(), dettPratica.getDettPraticaId())
|| !ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId()) || !praticaIsEditable
|| TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()) || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione())
|| !isGeologo; || !isGeologo;
;
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(dettPratica Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(dettPratica.getDettPraticaId());
.getDettPraticaId());
%> %>
<liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application%>"> <liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application%>">

45
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_soggetti.jsp

@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> <%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%>
@ -19,28 +20,27 @@
<%@ include file="/html/fascicolofe/init.jsp" %> <%@ include file="/html/fascicolofe/init.jsp" %>
<% <%
DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
if(dettPratica==null){ if (dettPratica == null) {
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
} }
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione");
String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione"); boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "hasDelegaCompilazioneDomanda");
boolean disabledInput = !hasDelegaCompilazioneDomanda || (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione)
&& dettPratica.isCompleta());
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()) || ( Soggetto soggettoDelegato = (Soggetto) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "soggettoDelegato");
TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione) && dettPratica.isCompleta() boolean inBO = ParamUtil.getBoolean(request, "inBO", false);
);
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId());
boolean inBO = ParamUtil.getBoolean(request,"inBO",false);
%> %>
<liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%=application %>"> <liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%= application %>">
<liferay-util:param name="disabledInput" value="<%=String.valueOf(disabledInput) %>"/> <liferay-util:param name="disabledInput" value="<%= String.valueOf(disabledInput) %>"/>
<liferay-util:param name="inBO" value="<%=String.valueOf(inBO) %>"/> <liferay-util:param name="inBO" value="<%= String.valueOf(inBO) %>"/>
<c:if test="<%= soggettoDelegato!=null%>"> <c:if test="<%= soggettoDelegato != null %>">
<liferay-util:param name="soggettoId" value="<%=String.valueOf(soggettoDelegato.getSoggettoId()) %>"/> <liferay-util:param name="soggettoId" value="<%= String.valueOf(soggettoDelegato.getSoggettoId()) %>"/>
</c:if> </c:if>
</liferay-util:include> </liferay-util:include>
@ -50,17 +50,17 @@
var modalName = event._event.details[0].windowName; var modalName = event._event.details[0].windowName;
var modalWin = Liferay.Util.Window.getById(modalName); var modalWin = Liferay.Util.Window.getById(modalName);
modalWin.after('visibleChange', function(event) { modalWin.after('visibleChange', function(event) {
if(event.prevVal && soggettiEdit){ if (event.prevVal && soggettiEdit) {
Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_"); Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_");
} }
}); });
modalWin.after('hide', function(event) { modalWin.after('hide', function(event) {
if(soggettiEdit){ if (soggettiEdit) {
Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_"); Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_");
} }
}); });
modalWin.after('destroy', function(event) { modalWin.after('destroy', function(event) {
if(soggettiEdit){ if (soggettiEdit) {
Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_"); Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_");
} }
}); });
@ -93,5 +93,4 @@
} }
}); });
</aui:script> </aui:script>
<%-- <liferay-portlet:runtime portletName="<%=PortletKeys.SOGGETTI %>" queryString='<%="dettPraticaId="+dettPratica.getDettPraticaId()+"&getCompleted="+String.valueOf(getCompleted)%>' ></liferay-portlet:runtime> --%> <liferay-portlet:runtime portletName="<%= PortletKeys.SOGGETTI %>" queryString='<%="dettPraticaId=" + dettPratica.getDettPraticaId() + "&disabledInput=" + disabledInput%>' ></liferay-portlet:runtime>
<liferay-portlet:runtime portletName="<%=PortletKeys.SOGGETTI %>" queryString='<%="dettPraticaId="+dettPratica.getDettPraticaId()+"&disabledInput="+disabledInput%>' ></liferay-portlet:runtime>

23
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp

@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%>
<%@page import="org.apache.commons.lang.StringUtils"%> <%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="it.tref.liferay.portos.bo.util.PagamentiCommonUtil"%> <%@page import="it.tref.liferay.portos.bo.util.PagamentiCommonUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> <%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%>
@ -12,25 +13,27 @@
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@ include file="/html/fascicolofe/init.jsp"%> <%@ include file="/html/fascicolofe/init.jsp"%>
<% <%
DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
request.setAttribute("bean.dettPratica", dettPratica);
long soggettoId = ParamUtil.getLong(request, "soggettoId"); DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
boolean disabledInput = ParamUtil.getBoolean(request, "disabledInput"); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
boolean inBO = ParamUtil.getBoolean(request, "inBO", false); request.setAttribute("bean.dettPratica", dettPratica);
long soggettoId = ParamUtil.getLong(request, "soggettoId");
boolean disabledInput = ParamUtil.getBoolean(request, "disabledInput");
boolean inBO = ParamUtil.getBoolean(request, "inBO", false);
boolean praticaIsEditable = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "praticaIsEditable");
boolean hasAsseverazioniAttive = AsseverazioniUtil.hasAsseverazioniAttive(dettPratica.getDettPraticaId());
%> %>
<c:if test="<%=!inBO%>"> <c:if test="<%=!inBO%>">
<c:choose> <c:choose>
<c:when test="<%=!ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId())%>"> <c:when test="<%=!praticaIsEditable%>">
<div class="alert alert-warn"> <div class="alert alert-warn">
<liferay-ui:message key="domanda-non-modificabile" /> <liferay-ui:message key="domanda-non-modificabile" />
</div> </div>
</c:when> </c:when>
<c:when <c:when
test="<%=disabledInput test="<%=disabledInput && !hasAsseverazioniAttive%>">
&& !AsseverazioniUtil.hasAsseverazioniAttive(dettPratica.getDettPraticaId())%>">
<div class="alert alert-warn"> <div class="alert alert-warn">
<% <%
String descrizioneSoggetto = ""; String descrizioneSoggetto = "";
@ -61,7 +64,7 @@
: <strong><%=descrizioneSoggetto%></strong> : <strong><%=descrizioneSoggetto%></strong>
</div> </div>
</c:when> </c:when>
<c:when test="<%=AsseverazioniUtil.hasAsseverazioniAttive(dettPratica.getDettPraticaId())%>"> <c:when test="<%= hasAsseverazioniAttive %>">
<div class="alert alert-warn"> <div class="alert alert-warn">
<liferay-ui:message key="asseverazioni-attive-domanda-non-modificabile" /> <liferay-ui:message key="asseverazioni-attive-domanda-non-modificabile" />
</div> </div>

33
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo.jsp

@ -169,7 +169,6 @@
</div> </div>
<% <%
List<String> sections = Arrays.asList(SezioniUtil.SEZIONE_DETTAGLI_PRINCIPALI, SezioniUtil.SEZIONE_ANAGRAFE_SOGGETTI, SezioniUtil.SEZIONE_DESCRIZIONE_EDIFICIO, SezioniUtil.SEZIONE_GEOLOGICA, SezioniUtil.SEZIONE_ALLEGATI); List<String> sections = Arrays.asList(SezioniUtil.SEZIONE_DETTAGLI_PRINCIPALI, SezioniUtil.SEZIONE_ANAGRAFE_SOGGETTI, SezioniUtil.SEZIONE_DESCRIZIONE_EDIFICIO, SezioniUtil.SEZIONE_GEOLOGICA, SezioniUtil.SEZIONE_ALLEGATI);
List<String> tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatori(); List<String> tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatori();
List<String> tipologiaSoggetti = Arrays.asList(TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.GEOLOGO, TipoSoggettoUtil.COLLAUDATORE); List<String> tipologiaSoggetti = Arrays.asList(TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.GEOLOGO, TipoSoggettoUtil.COLLAUDATORE);
%> %>
@ -193,28 +192,28 @@
</div> </div>
</div> </div>
</div> </div>
<% <%
for(String section:sections){ for (String section : sections) {
%> %>
<div class="row asseverazioni-title"> <div class="row asseverazioni-title">
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"> <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<%=LanguageUtil.get(pageContext, "sezione-"+section) %> <%=LanguageUtil.get(pageContext, "sezione-"+section) %>
</div> </div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-center"> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-center">
<% <%
boolean isSectionCompleted = ValidazionePraticaUtil.isSectionCompleted(section,dettPraticaId); List<String> notCompleted = ValidazionePraticaUtil.notCompletedSection(section, dettPraticaId);
StringBuilder tooltipSection = new StringBuilder(); boolean isSectionCompleted = (notCompleted.size() == 0);
if(!isSectionCompleted){ StringBuilder tooltipSection = new StringBuilder();
List<String> notCompleted = ValidazionePraticaUtil.notCompletedSection(section, dettPraticaId); if (!isSectionCompleted) {
if(!notCompleted.isEmpty()){ if (!notCompleted.isEmpty()) {
tooltipSection.append("<ul class='list-body-modal'>"); tooltipSection.append("<ul class='list-body-modal'>");
for(String incomplete : notCompleted){ for (String incomplete : notCompleted) {
tooltipSection.append("<li class='item-body-modal'>"+LanguageUtil.get(pageContext, incomplete)+"</li>"); tooltipSection.append("<li class='item-body-modal'>"+LanguageUtil.get(pageContext, incomplete)+"</li>");
}
tooltipSection.append("</ul>");
}
} }
%> tooltipSection.append("</ul>");
}
}
%>
<span class='icon-asseverazioni fa <%= isSectionCompleted ? "fa-check txt-green" : "fa-close txt-red"%>'></span> <span class='icon-asseverazioni fa <%= isSectionCompleted ? "fa-check txt-green" : "fa-close txt-red"%>'></span>
</div> </div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-center"> <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-center">

4
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java

@ -89,6 +89,6 @@ public class FirmeBean implements Serializable {
break; break;
} }
} }
firmeApplicativo.remove(firmeDetailToRemove); firmeApplicativo.remove(firmeDetailToRemove);
} }
} }

95
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FirmeUtil.java

@ -6,8 +6,6 @@ import com.liferay.portal.kernel.json.JSONSerializer;
import com.liferay.portal.kernel.util.UniqueList; import com.liferay.portal.kernel.util.UniqueList;
import it.tref.liferay.portos.bo.shared.bean.FirmeBean; import it.tref.liferay.portos.bo.shared.bean.FirmeBean;
import it.tref.liferay.portos.bo.shared.bean.FirmeDetail; import it.tref.liferay.portos.bo.shared.bean.FirmeDetail;
import java.util.Date; import java.util.Date;
@ -16,58 +14,59 @@ import java.util.Map;
public class FirmeUtil { public class FirmeUtil {
public static String addFirma(FirmeBean firmeBean, String codiceFiscale) { public static String addFirma(FirmeBean firmeBean, String codiceFiscale) {
Date now = new Date(); Date now = new Date();
List<FirmeDetail> firme = new UniqueList<FirmeDetail>(); List<FirmeDetail> firme = new UniqueList<FirmeDetail>();
firme.addAll(firmeBean.getFirmeApplicativo()); firme.addAll(firmeBean.getFirmeApplicativo());
firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now)); firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now));
firmeBean.setFirmeApplicativo(firme); firmeBean.setFirmeApplicativo(firme);
return serialize(firmeBean); return serialize(firmeBean);
} }
public static String addFirmaDigitale(FirmeBean firmeBean, String codiceFiscale) { public static String addFirmaDigitale(FirmeBean firmeBean, String codiceFiscale) {
Date now = null; Date now = null;
List<FirmeDetail> firme = new UniqueList<FirmeDetail>(); List<FirmeDetail> firme = new UniqueList<FirmeDetail>();
firme.addAll(firmeBean.getFirmeDigitali()); firme.addAll(firmeBean.getFirmeDigitali());
firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now)); firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now));
firmeBean.setFirmeDigitali(firme); firmeBean.setFirmeDigitali(firme);
return serialize(firmeBean); return serialize(firmeBean);
} }
public static String addFirma(String jsonFirmatari, String codiceFiscale) { public static String addFirma(String jsonFirmatari, String codiceFiscale) {
FirmeBean firmeBean = deserialize(jsonFirmatari); FirmeBean firmeBean = deserialize(jsonFirmatari);
return addFirma(firmeBean, codiceFiscale); return addFirma(firmeBean, codiceFiscale);
} }
public static String addFirmaDigitale(String jsonFirmatari, String codiceFiscale) { public static String addFirmaDigitale(String jsonFirmatari, String codiceFiscale) {
FirmeBean firmeBean = deserialize(jsonFirmatari); FirmeBean firmeBean = deserialize(jsonFirmatari);
return addFirmaDigitale(firmeBean, codiceFiscale); return addFirmaDigitale(firmeBean, codiceFiscale);
} }
public static String removeFirma(FirmeBean firmeBean, String codiceFiscale) { public static String removeFirma(FirmeBean firmeBean, String codiceFiscale) {
firmeBean.removeFirmeApplicativo(codiceFiscale); firmeBean.removeFirmeApplicativo(codiceFiscale);
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class"); JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class");
return jsonSerializer.serializeDeep(firmeBean); return jsonSerializer.serializeDeep(firmeBean);
} }
public static String removeFirma(String jsonFirmatari, String codiceFiscale) { public static String removeFirma(String jsonFirmatari, String codiceFiscale) {
FirmeBean firmeBean = deserialize(jsonFirmatari); FirmeBean firmeBean = deserialize(jsonFirmatari);
return removeFirma(firmeBean, codiceFiscale); return removeFirma(firmeBean, codiceFiscale);
} }
public static String serialize(FirmeBean firmeBean) { public static String serialize(FirmeBean firmeBean) {
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class"); JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class");
return jsonSerializer.serializeDeep(firmeBean); return jsonSerializer.serializeDeep(firmeBean);
} }
public static FirmeBean deserialize(String jsonFirmatari) { public static FirmeBean deserialize(String jsonFirmatari) {
JSONDeserializer<Object> jsonSerializer = JSONFactoryUtil.createJSONDeserializer(); JSONDeserializer<Object> jsonSerializer = JSONFactoryUtil.createJSONDeserializer();
Map<String, List<FirmeDetail>> deserialized = @SuppressWarnings("unchecked")
(Map<String, List<FirmeDetail>>) jsonSerializer.deserialize(jsonFirmatari); Map<String, List<FirmeDetail>> deserialized = (Map<String, List<FirmeDetail>>) jsonSerializer
FirmeBean firmeBean = new FirmeBean(); .deserialize(jsonFirmatari);
firmeBean.setFirmeApplicativo(deserialized.get("firmeApplicativo")); FirmeBean firmeBean = new FirmeBean();
firmeBean.setFirmeDigitali(deserialized.get("firmeDigitali")); firmeBean.setFirmeApplicativo(deserialized.get("firmeApplicativo"));
return firmeBean; firmeBean.setFirmeDigitali(deserialized.get("firmeDigitali"));
} return firmeBean;
}
} }

66
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SessionUtil.java

@ -0,0 +1,66 @@
package it.tref.liferay.portos.bo.shared.util;
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool;
public class SessionUtil {
private final static String PREFIX = "SessionUtil.";
private final static String DETTPRATICA_CLASSNAME = "DettPratica.";
private final static Log _log = LogFactoryUtil.getLog(SessionUtil.class);
public static void setDettPraticaObject(HttpServletRequest request, long dettPraticaId, String label,
Object object) {
setObject(request, getLabel(DETTPRATICA_CLASSNAME, dettPraticaId, label), object);
}
public static Object getDettPraticaObject(HttpServletRequest request, long dettPraticaId, String label) {
return getObject(request, getLabel(DETTPRATICA_CLASSNAME, dettPraticaId, label));
}
public static void cleanDettPraticaObjects(HttpServletRequest request, long dettPraticaId) {
cleanDettPraticaObjects(request.getSession(), dettPraticaId);
}
public static void cleanDettPraticaObjects(HttpSession session, long dettPraticaId) {
String prefix = getPrefix(DETTPRATICA_CLASSNAME, dettPraticaId);
Enumeration<String> names = session.getAttributeNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
if (name.startsWith(prefix)) {
session.removeAttribute(name);
}
}
}
public static Object getObject(HttpServletRequest request, String label) {
return getObject(request.getSession(), label);
}
public static Object getObject(HttpSession session, String label) {
Object object = session.getAttribute(label);
return object;
}
public static void setObject(HttpServletRequest request, String label, Object object) {
setObject(request.getSession(), label, object);
}
public static void setObject(HttpSession session, String label, Object object) {
session.setAttribute(label, object);
}
private static String getLabel(String className, long classPK, String label) {
return getPrefix(className, classPK) + StringPool.PERIOD + label;
}
private static String getPrefix(String className, long classPK) {
return PREFIX + className + classPK;
}
}
Caricamento…
Annulla
Salva