Sfoglia il codice sorgente

Merge branch 'master' into geoportal-sismica

master
Salvatore La Manna 3 anni fa
parent
commit
fdf6c1685d
  1. 16
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/DettPratica.java
  2. 38
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/DettPraticaClp.java
  3. 30
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/DettPraticaWrapper.java
  4. 288
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java
  5. 81
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java
  6. 324
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo.jsp
  7. 38
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo_asseverazione.jsp

16
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/DettPratica.java

@ -31,14 +31,22 @@ public interface DettPratica extends DettPraticaModel, PersistedModel {
*
* Never modify this interface directly. Add methods to {@link it.tref.liferay.portos.bo.model.impl.DettPraticaImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
*/
public java.lang.String getTitle(java.util.Locale locale);
public java.lang.String getTitle();
public java.lang.String getFullDescription();
public java.lang.String getMiddleDescription();
public java.util.Set<it.tref.liferay.portos.bo.model.Soggetto> getSoggettiAsseveranti()
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
public java.util.Set<java.lang.String> getTipiSoggettiAsseveranti()
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
public java.lang.String getTitle();
public java.lang.String getTitle(java.util.Locale locale);
public java.lang.String serializeToVersioning()
throws java.lang.NoSuchFieldException, java.lang.SecurityException;

38
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/DettPraticaClp.java

@ -8260,6 +8260,25 @@ public class DettPraticaClp extends BaseModelImpl<DettPratica>
}
}
@Override
public java.util.Set<java.lang.String> getTipiSoggettiAsseveranti() {
try {
String methodName = "getTipiSoggettiAsseveranti";
Class<?>[] parameterTypes = new Class<?>[] { };
Object[] parameterValues = new Object[] { };
java.util.Set<java.lang.String> returnObj = (java.util.Set<java.lang.String>)invokeOnRemoteModel(methodName,
parameterTypes, parameterValues);
return returnObj;
}
catch (Exception e) {
throw new UnsupportedOperationException(e);
}
}
@Override
public java.lang.String serializeToVersioningPage() {
try {
@ -8317,6 +8336,25 @@ public class DettPraticaClp extends BaseModelImpl<DettPratica>
}
}
@Override
public java.util.Set<it.tref.liferay.portos.bo.model.Soggetto> getSoggettiAsseveranti() {
try {
String methodName = "getSoggettiAsseveranti";
Class<?>[] parameterTypes = new Class<?>[] { };
Object[] parameterValues = new Object[] { };
java.util.Set<it.tref.liferay.portos.bo.model.Soggetto> returnObj = (java.util.Set<it.tref.liferay.portos.bo.model.Soggetto>)invokeOnRemoteModel(methodName,
parameterTypes, parameterValues);
return returnObj;
}
catch (Exception e) {
throw new UnsupportedOperationException(e);
}
}
@Override
public java.lang.String getFullDescription() {
try {

30
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/DettPraticaWrapper.java

@ -8074,23 +8074,37 @@ public class DettPraticaWrapper implements DettPratica,
}
@Override
public java.lang.String getTitle(java.util.Locale locale) {
return _dettPratica.getTitle(locale);
public java.lang.String getFullDescription() {
return _dettPratica.getFullDescription();
}
@Override
public java.lang.String getTitle() {
return _dettPratica.getTitle();
public java.lang.String getMiddleDescription() {
return _dettPratica.getMiddleDescription();
}
@Override
public java.lang.String getFullDescription() {
return _dettPratica.getFullDescription();
public java.util.Set<it.tref.liferay.portos.bo.model.Soggetto> getSoggettiAsseveranti()
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
return _dettPratica.getSoggettiAsseveranti();
}
@Override
public java.lang.String getMiddleDescription() {
return _dettPratica.getMiddleDescription();
public java.util.Set<java.lang.String> getTipiSoggettiAsseveranti()
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
return _dettPratica.getTipiSoggettiAsseveranti();
}
@Override
public java.lang.String getTitle() {
return _dettPratica.getTitle();
}
@Override
public java.lang.String getTitle(java.util.Locale locale) {
return _dettPratica.getTitle(locale);
}
@Override

288
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java

@ -9,18 +9,30 @@
package it.tref.liferay.portos.bo.model.impl;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.Constants;
import it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.util.AsseverazioniUtil;
import it.tref.liferay.portos.bo.util.AzioniPraticheUtil;
import it.tref.liferay.portos.bo.util.PraticaUtil;
import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil;
import java.sql.Types;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.ArrayUtils;
import org.codehaus.jettison.json.JSONObject;
import com.liferay.portal.kernel.exception.PortalException;
@ -34,6 +46,8 @@ import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.TimeZoneUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
import com.liferay.portal.service.UserLocalServiceUtil;
/**
* The extended model implementation for the DettPratica service. Represents a row in the
@ -58,43 +72,6 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
public DettPraticaImpl() {}
@Override
public String getTitle(Locale locale) {
StringBuilder sb = new StringBuilder();
IntPratica intPratica = null;
try {
intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId());
if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) {
sb.append("Deposito ");
} else if (AzioniPraticheUtil.isAutorizzazione(intPratica.getIntPraticaId())) {
sb.append("Autorizzazione ");
}
sb.append("n. ");
if (Validator.isNotNull(getProtocollo())) {
// TODO da decidere che data, per adesso si mette quella di creazione il numero protocollo sbagliato
// dovrebbe essere il primo
sb.append(intPratica.getNumeroProgetto()).append(" del ").append(sdf.format(intPratica.getDtPratica()));
} else {
if (Validator.isNotNull(intPratica.getNumeroProgetto())) {
sb.append(intPratica.getNumeroProgetto()).append(StringPool.SPACE).append(StringPool.DASH)
.append(StringPool.SPACE);
}
sb.append(getDettPraticaId()).append(" (Temporaneo) ");
}
sb.append(" - id ").append(intPratica.getIntPraticaId());
} catch (PortalException | SystemException e) {
_log.error("Error on IntPratidaId=" + intPratica.getIntPraticaId(), e);
}
return sb.toString();
}
@Override
public String getTitle() {
return getTitle(LocaleUtil.getSiteDefault());
}
@Override
public String getFullDescription() {
@ -140,62 +117,6 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
return sb.toString();
}
@Override
public String serializeToVersioning() throws NoSuchFieldException, SecurityException {
StringBuilder sb = new StringBuilder();
sb.append("{\"version\":\"").append(Constants.DETTPRATICA_VERSION_IMPL).append("\",\"fields\":[");
Map<String, Object> modelAttributes = getModelValues();
String privateUuid = "uuid_";
Object[][] columns = DettPraticaModelImpl.TABLE_COLUMNS;
for (Object[] column_x : columns) {
String property = (String) column_x[0];
if (privateUuid.equals(property)) {
property = "uuid";
}
int type = (int) column_x[1];
String className = StringPool.BLANK;
switch (type) {
case Types.BIGINT:
className = Long.class.getCanonicalName();
break;
case Types.BOOLEAN:
case Types.TIMESTAMP:
case Types.VARCHAR:
className = String.class.getCanonicalName();
break;
case Types.INTEGER:
className = Integer.class.getCanonicalName();
break;
}
Object value = modelAttributes.get(property);
sb.append("{\"name\":\"").append(property).append("\",\"class\":\"").append(className)
.append("\",\"value\":")
.append(JSONObject.quote(String.valueOf(value)).replaceAll("[\r\n]", StringPool.SPACE))
.append(StringPool.CLOSE_CURLY_BRACE).append(StringPool.COMMA);
}
sb.setLength(sb.length() - 1);
sb.append(StringPool.CLOSE_BRACKET).append(StringPool.CLOSE_CURLY_BRACE);
return sb.toString();
}
@Override
public String serializeToVersioningPage() throws NoSuchFieldException, SecurityException {
StringBuilder sb = new StringBuilder();
sb.append("{\"fields\":[");
Object[][] columns = DettPraticaModelImpl.TABLE_COLUMNS;
for (Object[] column_x : columns) {
String property = (String) column_x[0];
if (!PraticaUtil.getDettPraticaHiddenFields().contains(property)) {
sb.append(StringPool.QUOTE).append(property).append(StringPool.QUOTE).append(StringPool.COMMA);
}
}
sb.setLength(sb.length() - 1);
sb.append(StringPool.CLOSE_BRACKET).append(StringPool.CLOSE_CURLY_BRACE);
return sb.toString();
}
private Map<String, Object> getModelValues() {
Map<String, Object> attributes = new HashMap<String, Object>();
@ -771,4 +692,185 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
attributes.put("dpdc", getDpdc() ? StringPool.TRUE : StringPool.FALSE);
return attributes;
}
@Override
public Set<Soggetto> getSoggettiAsseveranti() throws PortalException, SystemException {
Set<Soggetto> soggettiAsseveranti = new HashSet<>();
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(getIntPraticaId());
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(getTipoIntegrazione())) {
Set<Soggetto> nuoviSoggetti = new HashSet<>(
SoggettoLocalServiceUtil.getValidTmpByDettPratica(getDettPraticaId()));
List<String> cfNuoviSoggetti = SoggettoLocalServiceUtil.getCfValidTmpByDettPratica(getDettPraticaId());
List<String> nuoviDelegati = new ArrayList<String>(
DelegaLocalServiceUtil.findCfByDettPratica_Tipologia_InEsito(getDettPraticaId(), new String[] {
TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.GEOLOGO,
TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA },
new String[] { AsseverazioniUtil.STATO_ESEGUITA }));
nuoviDelegati.removeAll(cfNuoviSoggetti);
for (String cfDelegato : nuoviDelegati) {
nuoviSoggetti.addAll(SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale(getIntPraticaId(),
cfDelegato, 0L));
}
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(getTipoIntegrazione())) {
User titolaredigitaleUser = UserLocalServiceUtil.getUser(intPratica.getUserId());
// il titolare digitale potrebbe avere più ruoli
List<Soggetto> titolareDigitali = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale(
getIntPraticaId(), titolaredigitaleUser.getScreenName(), 0);
for (Soggetto titolareDigitale : titolareDigitali) {
soggettiAsseveranti.add(titolareDigitale);
}
} else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(getTipoIntegrazione())) {
String[] tipoSoggetti = new String[] { TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI,
TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA };
if (ValidazionePraticaUtil.isA98Required(this)) {
tipoSoggetti = (String[]) ArrayUtils.removeElement(tipoSoggetti, TipoSoggettoUtil.COMMITTENTE);
}
nuoviSoggetti
.addAll(SoggettoLocalServiceUtil.getSoggettiPrincipaliValidTmpByDettPratica_TipologiaSoggetto(
getDettPraticaId(), tipoSoggetti));
}
for (Soggetto soggetto : nuoviSoggetti) {
if (TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) {
if (!ValidazionePraticaUtil.isA98Required(this)) {
soggettiAsseveranti.add(soggetto);
}
} else if (TipoSoggettoUtil.COLLAUDATORE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) {
if (getCodiceFiscalePrincipaleCollaudatore().equalsIgnoreCase(soggetto.getCodiceFiscale())) {
soggettiAsseveranti.add(soggetto);
}
} else {
soggettiAsseveranti.add(soggetto);
}
}
} else {
List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica(getIntPraticaId());
boolean collaudatoreInserito = false;
for (Soggetto soggetto : soggetti) {
if (TipoSoggettoUtil.COLLAUDATORE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())
&& getCodiceFiscalePrincipaleCollaudatore().equalsIgnoreCase(soggetto.getCodiceFiscale())) {
soggettiAsseveranti.add(soggetto);
collaudatoreInserito = true;
break;
}
}
for (Soggetto soggetto : soggetti) {
String tipologia = soggetto.getTipologiaSoggetto();
if ((TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(tipologia) && !ValidazionePraticaUtil
.isA98Required(this))
|| TipoSoggettoUtil.DITTA.equalsIgnoreCase(tipologia)
|| TipoSoggettoUtil.DIRETTORE_LAVORI.equalsIgnoreCase(tipologia)
|| TipoSoggettoUtil.PROGETTISTA.equalsIgnoreCase(tipologia)
|| (TipoSoggettoUtil.COLLAUDATORE.equalsIgnoreCase(tipologia) && !collaudatoreInserito)) {
soggettiAsseveranti.add(soggetto);
}
}
}
return soggettiAsseveranti;
}
@Override
public Set<String> getTipiSoggettiAsseveranti() throws PortalException, SystemException {
Set<String> tipi = new HashSet<>();
for (Soggetto soggetto : getSoggettiAsseveranti()) {
tipi.add(soggetto.getTipologiaSoggetto());
}
return tipi;
}
@Override
public String getTitle() {
return getTitle(LocaleUtil.getSiteDefault());
}
@Override
public String getTitle(Locale locale) {
StringBuilder sb = new StringBuilder();
IntPratica intPratica = null;
try {
intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId());
if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) {
sb.append("Deposito ");
} else if (AzioniPraticheUtil.isAutorizzazione(intPratica.getIntPraticaId())) {
sb.append("Autorizzazione ");
}
sb.append("n. ");
if (Validator.isNotNull(getProtocollo())) {
// TODO da decidere che data, per adesso si mette quella di creazione il numero protocollo sbagliato
// dovrebbe essere il primo
sb.append(intPratica.getNumeroProgetto()).append(" del ").append(sdf.format(intPratica.getDtPratica()));
} else {
if (Validator.isNotNull(intPratica.getNumeroProgetto())) {
sb.append(intPratica.getNumeroProgetto()).append(StringPool.SPACE).append(StringPool.DASH)
.append(StringPool.SPACE);
}
sb.append(getDettPraticaId()).append(" (Temporaneo) ");
}
sb.append(" - id ").append(intPratica.getIntPraticaId());
} catch (PortalException | SystemException e) {
_log.error("Error on IntPratidaId=" + intPratica.getIntPraticaId(), e);
}
return sb.toString();
}
@Override
public String serializeToVersioning() throws NoSuchFieldException, SecurityException {
StringBuilder sb = new StringBuilder();
sb.append("{\"version\":\"").append(Constants.DETTPRATICA_VERSION_IMPL).append("\",\"fields\":[");
Map<String, Object> modelAttributes = getModelValues();
String privateUuid = "uuid_";
Object[][] columns = DettPraticaModelImpl.TABLE_COLUMNS;
for (Object[] column_x : columns) {
String property = (String) column_x[0];
if (privateUuid.equals(property)) {
property = "uuid";
}
int type = (int) column_x[1];
String className = StringPool.BLANK;
switch (type) {
case Types.BIGINT:
className = Long.class.getCanonicalName();
break;
case Types.BOOLEAN:
case Types.TIMESTAMP:
case Types.VARCHAR:
className = String.class.getCanonicalName();
break;
case Types.INTEGER:
className = Integer.class.getCanonicalName();
break;
}
Object value = modelAttributes.get(property);
sb.append("{\"name\":\"").append(property).append("\",\"class\":\"").append(className)
.append("\",\"value\":")
.append(JSONObject.quote(String.valueOf(value)).replaceAll("[\r\n]", StringPool.SPACE))
.append(StringPool.CLOSE_CURLY_BRACE).append(StringPool.COMMA);
}
sb.setLength(sb.length() - 1);
sb.append(StringPool.CLOSE_BRACKET).append(StringPool.CLOSE_CURLY_BRACE);
return sb.toString();
}
@Override
public String serializeToVersioningPage() throws NoSuchFieldException, SecurityException {
StringBuilder sb = new StringBuilder();
sb.append("{\"fields\":[");
Object[][] columns = DettPraticaModelImpl.TABLE_COLUMNS;
for (Object[] column_x : columns) {
String property = (String) column_x[0];
if (!PraticaUtil.getDettPraticaHiddenFields().contains(property)) {
sb.append(StringPool.QUOTE).append(property).append(StringPool.QUOTE).append(StringPool.COMMA);
}
}
sb.setLength(sb.length() - 1);
sb.append(StringPool.CLOSE_BRACKET).append(StringPool.CLOSE_CURLY_BRACE);
return sb.toString();
}
}

81
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java

@ -15,14 +15,12 @@ import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.service.base.AsseverazioneLocalServiceBaseImpl;
import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants;
import it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.util.AsseverazioniUtil;
import it.tref.liferay.portos.bo.util.AvvisoUtil;
import it.tref.liferay.portos.bo.util.Constants;
import it.tref.liferay.portos.bo.util.DelegheUtil;
import it.tref.liferay.portos.bo.util.PraticaUtil;
import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil;
import it.tref.liferay.portos.report.shared.constants.ReportConstants;
import it.tref.liferay.portos.report.shared.dto.ReportDto;
import it.tref.liferay.portos.report.shared.dto.ReportResultDto;
@ -31,17 +29,13 @@ import it.tref.liferay.portos.report.shared.util.ReportUtil;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import com.liferay.portal.NoSuchUserException;
@ -57,7 +51,6 @@ import com.liferay.portal.kernel.util.MimeTypesUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
import com.liferay.portal.security.permission.ActionKeys;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.documentlibrary.NoSuchFolderException;
@ -287,78 +280,10 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
PortalException {
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId);
long intPraticaId = dettPratica.getIntPraticaId();
long userId = serviceContext.getUserId();
IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId);
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
Set<Soggetto> nuoviSoggetti = new HashSet<>(soggettoLocalService.getValidTmpByDettPratica(dettPraticaId));
List<String> cfNuoviSoggetti = soggettoLocalService.getCfValidTmpByDettPratica(dettPraticaId);
List<String> nuoviDelegati = new ArrayList<String>(
delegaLocalService.findCfByDettPratica_Tipologia_InEsito(dettPraticaId, new String[] {
TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.GEOLOGO,
TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA },
new String[] { AsseverazioniUtil.STATO_ESEGUITA }));
nuoviDelegati.removeAll(cfNuoviSoggetti);
for (String cfDelegato : nuoviDelegati) {
nuoviSoggetti.addAll(soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale(intPraticaId,
cfDelegato, 0L));
}
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
User titolaredigitaleUser = userLocalService.getUser(intPratica.getUserId());
// il titolare digitale potrebbe avere più ruoli
List<Soggetto> titolareDigitali = soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale(
intPraticaId, titolaredigitaleUser.getScreenName(), 0);
for (Soggetto titolareDigitale : titolareDigitali) {
addAsseverazione(userId, intPraticaId, dettPraticaId, titolareDigitale, serviceContext);
}
} else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
String[] tipoSoggetti = new String[] { TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI,
TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA };
if (ValidazionePraticaUtil.isA98Required(dettPratica)) {
tipoSoggetti = (String[]) ArrayUtils.removeElement(tipoSoggetti, TipoSoggettoUtil.COMMITTENTE);
}
nuoviSoggetti.addAll(soggettoLocalService.getSoggettiPrincipaliValidTmpByDettPratica_TipologiaSoggetto(
dettPraticaId, tipoSoggetti));
}
for (Soggetto soggetto : nuoviSoggetti) {
if (TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) {
if (!ValidazionePraticaUtil.isA98Required(dettPratica)) {
addAsseverazione(userId, intPraticaId, dettPraticaId, soggetto, serviceContext);
}
} else if (TipoSoggettoUtil.COLLAUDATORE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) {
if (dettPratica.getCodiceFiscalePrincipaleCollaudatore().equalsIgnoreCase(
soggetto.getCodiceFiscale())) {
addAsseverazione(userId, intPraticaId, dettPraticaId, soggetto, serviceContext);
}
} else {
addAsseverazione(userId, intPraticaId, dettPraticaId, soggetto, serviceContext);
}
}
} else {
List<Soggetto> soggetti = soggettoLocalService.getValidTmpByIntPratica(dettPratica.getIntPraticaId());
boolean collaudatoreInserito = false;
for (Soggetto soggetto : soggetti) {
if (TipoSoggettoUtil.COLLAUDATORE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())
&& dettPratica.getCodiceFiscalePrincipaleCollaudatore().equalsIgnoreCase(
soggetto.getCodiceFiscale())) {
addAsseverazione(userId, intPraticaId, dettPraticaId, soggetto, serviceContext);
collaudatoreInserito = true;
break;
}
}
for (Soggetto soggetto : soggetti) {
String tipologia = soggetto.getTipologiaSoggetto();
if ((TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(tipologia) && !ValidazionePraticaUtil
.isA98Required(dettPratica))
|| TipoSoggettoUtil.DITTA.equalsIgnoreCase(tipologia)
|| TipoSoggettoUtil.DIRETTORE_LAVORI.equalsIgnoreCase(tipologia)
|| TipoSoggettoUtil.PROGETTISTA.equalsIgnoreCase(tipologia)
|| (TipoSoggettoUtil.COLLAUDATORE.equalsIgnoreCase(tipologia) && !collaudatoreInserito)) {
addAsseverazione(userId, intPraticaId, dettPraticaId, soggetto, serviceContext);
}
}
long intPraticaId = dettPratica.getIntPraticaId();
for (Soggetto soggetto : dettPratica.getSoggettiAsseveranti()) {
addAsseverazione(userId, intPraticaId, dettPraticaId, soggetto, serviceContext);
}
}

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

@ -1,3 +1,5 @@
<%@page import="java.util.HashSet"%>
<%@page import="java.util.Set"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.UniqueList"%>
<%@page import="it.tref.liferay.portos.bo.model.Asseverazione"%>
@ -22,7 +24,6 @@ long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0L);
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0L);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
if (dettPratica == null) {
dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId);
if (dettPratica == null) {
@ -31,165 +32,149 @@ if (dettPratica == null) {
}
%>
<liferay-portlet:renderURL var="verifyURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo.jsp"/>
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo.jsp" />
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
</liferay-portlet:renderURL>
<liferay-portlet:renderURL var="calcolaURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo_calcolo.jsp"/>
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo_calcolo.jsp" />
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
</liferay-portlet:renderURL>
<liferay-portlet:renderURL var="completedURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/completed_fascicolo.jsp"/>
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/completed_fascicolo.jsp" />
<liferay-portlet:param name="classPk" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="className" value="<%= DettPratica.class.getName() %>" />
<liferay-portlet:param name="comingFrom" value="domanda" />
</liferay-portlet:renderURL>
<portlet:renderURL var="delegaURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>" >
<portlet:renderURL var="delegaURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo_delega.jsp" />
<portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<portlet:param name="backURL" value="<%= currentURL %>" />
</portlet:renderURL>
<portlet:renderURL var="asseverazioneURL">
<portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo_asseverazione.jsp" />
<portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<portlet:param name="backURL" value="<%= currentURL %>" />
</portlet:renderURL>
<liferay-portlet:renderURL var="viewProgettiURL" >
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view.jsp"/>
<liferay-portlet:renderURL var="viewProgettiURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view.jsp" />
</liferay-portlet:renderURL>
<liferay-portlet:actionURL name="completeIntegrazione" var="completeIntegrazioneURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo.jsp"/>
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo.jsp" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="redirect" value="<%= completedURL %>" />
</liferay-portlet:actionURL>
<liferay-portlet:actionURL name="completeDomandaEsente" var="completeDomandaEsenteURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo.jsp"/>
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo.jsp" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="redirect" value="<%= completedURL %>" />
</liferay-portlet:actionURL>
<liferay-util:include page="/html/common/help_message.jsp" servletContext="<%= application %>">
<liferay-util:param name="message" value="help_message_verifica"></liferay-util:param>
</liferay-util:include>
<div class="container-fluid clearfix">
<h2 class="title-fascicolo pull-left">Verifica Fascicolo</h2>
<div class="container-btn-fascicolo pull-right" >
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" >
<liferay-ui:icon
iconCssClass="fa fa-refresh"
message="refresh"
url="<%= verifyURL %>"
linkCssClass="btn"
/>
<div class="container-btn-fascicolo pull-right">
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true"
cssClass="inline_toolbar">
<liferay-ui:icon iconCssClass="fa fa-refresh" message="refresh" url="<%= verifyURL %>"
linkCssClass="btn" />
<liferay-ui:icon
linkCssClass='<%= ValidazionePraticaUtil.delegheCompilazioneIsEnable(dettPraticaId) ? "btn" : "btn disabled" %>'
iconCssClass="fa fa-users"
message="gestione-deleghe-compilazione"
url="<%= ValidazionePraticaUtil.delegheCompilazioneIsEnable(dettPraticaId)?delegaURL:StringPool.DASH %>"
/>
linkCssClass='<%= ValidazionePraticaUtil.delegheCompilazioneIsEnable(dettPraticaId) ? "btn"
: "btn disabled" %>'
iconCssClass="fa fa-users" message="gestione-deleghe-compilazione"
url="<%= ValidazionePraticaUtil.delegheCompilazioneIsEnable(dettPraticaId) ? delegaURL
: StringPool.DASH %>" />
<%
boolean asseverazioniIsEnabled = ValidazionePraticaUtil.asseverazioniIsEnable(dettPraticaId);
StringBuilder tooltipAsseverazioni = new StringBuilder();
if (!asseverazioniIsEnabled) {
tooltipAsseverazioni.append("<ul>");
if (!ValidazionePraticaUtil.praticaIsCompleta(dettPraticaId)) {
tooltipAsseverazioni.append("<li>Domanda incompleta</li>");
}
if (SoggettoLocalServiceUtil.countValidTmpByIntPratica(dettPratica.getIntPraticaId()) == 0) {
tooltipAsseverazioni.append("<li>Nessun soggetto</li>");
}
if (DelegheUtil.hasDelegheCompilazioneAttive(dettPraticaId)) {
tooltipAsseverazioni.append("<li>Deleghe Attive</li>");
}
tooltipAsseverazioni.append("</ul>");
boolean asseverazioniIsEnabled = ValidazionePraticaUtil.asseverazioniIsEnable(dettPraticaId);
StringBuilder tooltipAsseverazioni = new StringBuilder();
if (!asseverazioniIsEnabled) {
tooltipAsseverazioni.append("<ul>");
if (!ValidazionePraticaUtil.praticaIsCompleta(dettPraticaId)) {
tooltipAsseverazioni.append("<li>Domanda incompleta</li>");
}
if (SoggettoLocalServiceUtil.countValidTmpByIntPratica(dettPratica.getIntPraticaId()) == 0) {
tooltipAsseverazioni.append("<li>Nessun soggetto</li>");
}
if (DelegheUtil.hasDelegheCompilazioneAttive(dettPraticaId)) {
tooltipAsseverazioni.append("<li>Deleghe Attive</li>");
}
tooltipAsseverazioni.append("</ul>");
}
%>
<span class="<%= !asseverazioniIsEnabled ? "tooltip-info" : StringPool.BLANK %>" title="<%= tooltipAsseverazioni.toString() %>">
<liferay-ui:icon
linkCssClass='<%= asseverazioniIsEnabled ? "btn" : "btn disabled" %>'
iconCssClass="fa fa-pencil"
message="gestione-asseverazioni"
url="<%= asseverazioniIsEnabled?asseverazioneURL : StringPool.DASH %>"
/>
<liferay-ui:icon linkCssClass='<%= asseverazioniIsEnabled ? "btn" : "btn disabled" %>'
iconCssClass="fa fa-pencil" message="gestione-asseverazioni"
url="<%= asseverazioniIsEnabled ? asseverazioneURL : StringPool.DASH %>" />
</span>
<c:if test="<%= !dettPratica.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE) %>">
<%
boolean isEsente = dettPratica.getNormEsenteBollo() && dettPratica.getNormEsenteSpese();
boolean isEsente = dettPratica.getNormEsenteBollo() && dettPratica.getNormEsenteSpese();
%>
<c:if test="<%= isEsente %>">
<liferay-ui:icon
linkCssClass='<%= ValidazionePraticaUtil.canCompleteDettPraticaEsente(dettPraticaId) ?"btn btn-primary":"btn btn-primary disabled" %>'
iconCssClass="fa fa-check"
message="Concludi Domanda"
url="<%= completeDomandaEsenteURL %>"
/>
linkCssClass='<%= ValidazionePraticaUtil.canCompleteDettPraticaEsente(dettPraticaId)
? "btn btn-primary" : "btn btn-primary disabled" %>'
iconCssClass="fa fa-check" message="Concludi Domanda"
url="<%= completeDomandaEsenteURL %>" />
</c:if>
<c:if test="<%= !isEsente %>">
<liferay-ui:icon
linkCssClass='<%= ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId) ? "btn btn-primary" : "btn btn-primary disabled" %>'
iconCssClass="fa fa-cogs"
message='<%= PagamentoLocalServiceUtil.countByClassPk(dettPraticaId)>0 ? LanguageUtil.get(pageContext, "dati-pagamento") : LanguageUtil.get(pageContext, "calcola-importo") %>'
url="<%= ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId)?calcolaURL:StringPool.DASH %>"
/>
linkCssClass='<%= ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId)
? "btn btn-primary" : "btn btn-primary disabled" %>'
iconCssClass="fa fa-cogs"
message='<%= PagamentoLocalServiceUtil.countByClassPk(dettPraticaId) > 0
? LanguageUtil.get(pageContext, "dati-pagamento")
: LanguageUtil.get(pageContext, "calcola-importo") %>'
url="<%= ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId) ? calcolaURL
: StringPool.DASH %>" />
</c:if>
</c:if>
<c:if test="<%= dettPratica.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE) %>">
<liferay-ui:icon
linkCssClass='<%= ValidazionePraticaUtil.canCompleteIntegrazione(dettPraticaId) ?"btn btn-primary":"btn btn-primary disabled" %>'
iconCssClass="fa fa-check"
message="Concludi Integrazione"
url="<%= completeIntegrazioneURL %>"
/>
linkCssClass='<%= ValidazionePraticaUtil.canCompleteIntegrazione(dettPraticaId)
? "btn btn-primary" : "btn btn-primary disabled" %>'
iconCssClass="fa fa-check" message="Concludi Integrazione"
url="<%= completeIntegrazioneURL %>" />
</c:if>
</liferay-ui:icon-menu>
</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> tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatori();
List<String> tipologiaSoggetti = Arrays.asList(TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.GEOLOGO, TipoSoggettoUtil.COLLAUDATORE);
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> tipologiaSoggetti = Arrays.asList(TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.GEOLOGO, TipoSoggettoUtil.COLLAUDATORE);
%>
<div class="container-fluid clearfix compilazione-domanda" id="<portlet:namespace/>_section-completed">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 asseverazioni tab-error">
<div class="container-fluid clearfix compilazione-domanda" id="<portlet:namespace />_section-completed">
<div class="col-xs-12 asseverazioni tab-error">
<div class="row asseverazioni-header">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center asseverazioni-header__title">
<div class="col-xs-12 text-center asseverazioni-header__title">
<strong>Compilazione Domanda</strong>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
</div>
<div class="col-xs-12">
<div class="row" style="padding-top: 10px;">
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<div class="col-xs-8">
Sezione
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 asserazioni-header-title text-center">
<div class="col-xs-2 asserazioni-header-title text-center">
Completata
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-center"></div>
<div class="col-xs-2 text-center"></div>
</div>
</div>
</div>
<%
<%
for (String section : sections) {
%>
%>
<div class="row asseverazioni-title">
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
<div class="col-xs-8">
<%= LanguageUtil.get(pageContext, "sezione-" + section) %>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-center">
<%
<div class="col-xs-2 text-center">
<%
List<String> notCompleted = ValidazionePraticaUtil.notCompletedSection(section, dettPraticaId);
boolean isSectionCompleted = (notCompleted.size() == 0);
StringBuilder tooltipSection = new StringBuilder();
@ -204,19 +189,19 @@ if (dettPratica == null) {
tooltipSection.append("</ul>");
}
}
%>
%>
<span class='icon-asseverazioni fa <%= isSectionCompleted ? "fa-check txt-green" : "fa-close txt-red" %>'></span>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-center">
<div class="col-xs-2 text-center">
<c:if test="<%= tooltipSection.length() > 0 %>">
<button id="<portlet:namespace /><%= section %>_button" class="btn btn-primary">Dettagli</button>
<div id="<portlet:namespace /><%= section %>_div" class="hide"><%= tooltipSection.toString() %></div>
<%
<%
String title = "Riepilogo Errori Sezione " + LanguageUtil.get(pageContext, "sezione-" + section);
String buttonId = section + "_button";
String contentId = section + "_div";
%>
<liferay-util:include page="/html/common/confirm_window.jsp" servletContext="<%= application %>" >
<liferay-util:include page="/html/common/confirm_window.jsp" servletContext="<%= application %>">
<liferay-util:param name="titolo" value="<%= title %>"></liferay-util:param>
<liferay-util:param name="buttonId" value="<%= buttonId %>"></liferay-util:param>
<liferay-util:param name="contentDiv" value="<%= contentId %>"></liferay-util:param>
@ -232,36 +217,36 @@ if (dettPratica == null) {
</div>
</div>
<div class="container-fluid clearfix asseverazioni-firme" id="<portlet:namespace/>_asseverazioni-table">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 asseverazioni">
<div class="container-fluid clearfix asseverazioni-firme" id="<portlet:namespace />_asseverazioni-table">
<div class="col-xs-12 asseverazioni">
<div class="row asseverazioni-header">
<div class="asseverazioni-header-top">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center asseverazioni-header__title">
<div class="col-xs-12 text-center asseverazioni-header__title">
<strong>Asseverazioni/Firme Allegati</strong>
</div>
</div>
<div class="asseverazioni-header-bottom">
<div class="asseverazioni-header-bottom__row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<div class="col-xs-6">
Descrizione
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 asserazioni-header-title text-center">
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="col-xs-6 asserazioni-header-title text-center">
<div class="col-xs-2">
<%= LanguageUtil.get(pageContext, "gc-soggetto-" + TipoSoggettoUtil.COMMITTENTE) %>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="col-xs-2">
<%= LanguageUtil.get(pageContext, "gc-soggetto-" + TipoSoggettoUtil.DITTA) %>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="col-xs-2">
<%= LanguageUtil.get(pageContext, "gc-soggetto-" + TipoSoggettoUtil.PROGETTISTA) %>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="col-xs-2">
<%= LanguageUtil.get(pageContext, "gc-soggetto-" + TipoSoggettoUtil.DIRETTORE_LAVORI) %>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="col-xs-2">
<%= LanguageUtil.get(pageContext, "gc-soggetto-" + TipoSoggettoUtil.GEOLOGO) %>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="col-xs-2">
<%= LanguageUtil.get(pageContext, "gc-soggetto-" + TipoSoggettoUtil.COLLAUDATORE) %>
</div>
</div>
@ -269,24 +254,26 @@ if (dettPratica == null) {
</div>
</div>
<div class="row asseverazioni-title">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<div class="col-xs-6">
Asseverazioni Domanda
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 asserazioni-body-title text-center">
<%
String[] esiti_complete = {AsseverazioniUtil.STATO_ESEGUITA};
String[] esiti_incomplete = {AsseverazioniUtil.STATO_ASSEGNATA};
<div class="col-xs-6 asserazioni-body-title text-center">
<%
String[] esiti_complete = { AsseverazioniUtil.STATO_ESEGUITA };
String[] esiti_incomplete = { AsseverazioniUtil.STATO_ASSEGNATA };
Set<String> tipologieRichieste = dettPratica.getTipiSoggettiAsseveranti();
for (String tipoSoggetto : tipologiaSoggetti) {
String clazz = StringPool.BLANK;
String title = StringPool.BLANK;
List<Asseverazione> asseverazioniCompletate = AsseverazioneLocalServiceUtil.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipoSoggetto, esiti_complete , QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
List<Asseverazione> asseverazioniMancanti = AsseverazioneLocalServiceUtil.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipoSoggetto, esiti_incomplete , QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
boolean isRequired = AsseverazioniUtil.isAsseverazioneDomandaRequiredByTipoSoggetto(dettPraticaId, tipoSoggetto);
boolean isRecommended = AsseverazioniUtil.isAsseverazioneDomandaRecommendedByTipoSoggetto(dettPraticaId, tipoSoggetto);
List<Asseverazione> asseverazioniCompletate = AsseverazioneLocalServiceUtil
.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipoSoggetto, esiti_complete,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
List<Asseverazione> asseverazioniMancanti = AsseverazioneLocalServiceUtil
.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipoSoggetto, esiti_incomplete,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
boolean isRequired = tipologieRichieste.contains(tipoSoggetto);
StringBuilder content = new StringBuilder();
if (isRequired || isRecommended) {
if (isRequired) {
clazz += " icon-asseverazioni fa ";
if (isRequired) {
if (asseverazioniMancanti.isEmpty() && asseverazioniCompletate.size() > 0) {
@ -301,80 +288,73 @@ if (dettPratica == null) {
clazz += "fa-close txt-red";
}
}
} else if (isRecommended) {
title = "Asseverazioni consigliate";
clazz += "fa-circle txt-blue";
}
content.append("<span class=\"")
.append(clazz)
.append(" tooltip-info\" title=\"")
.append(title)
content.append("<span class=\"").append(clazz).append(" tooltip-info\" title=\"").append(title)
.append("\"><sub class=\"txt-bold\">");
if (asseverazioniCompletate.size() > 0) {
content.append(asseverazioniCompletate.size());
}
content.append("</sub></span>");
} else if (!TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
} else if (!TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica
.getTipoIntegrazione())
&& !TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
&& TipoSoggettoUtil.GEOLOGO.equalsIgnoreCase(tipoSoggetto)
&& DelegaLocalServiceUtil.countByDettPratica_Tipologia_InEsito(intPraticaId, new String[]{DelegheUtil.TIPO_GEOLOGO}, new String[]{DelegheUtil.STATO_ESEGUITA}) > 0) {
&& DelegaLocalServiceUtil.countByDettPratica_Tipologia_InEsito(intPraticaId,
new String[] { DelegheUtil.TIPO_GEOLOGO },
new String[] { DelegheUtil.STATO_ESEGUITA }) > 0) {
clazz = "icon-asseverazioni fa fa-check txt-green";
content.append("<span class=\"").append(clazz).append("\"></span>");
} else {
content.append("<span>-</span>");
}
%>
%>
<div class="col-xs-2">
<%= content.toString() %>
</div>
<%
<%
}
%>
%>
</div>
</div>
<%
<%
for (String codiceDoc:tipologiaAllegati) {
String nomeAllegato = codiceDoc + " - " + LanguageUtil.get(pageContext, "label-documenti-tipologia-"+codiceDoc);
%>
<div class="row asseverazioni-title">
<div class="col-xs-12">
<liferay-ui:message key='<%= nomeAllegato %>'/>
%>
<div class="row asseverazioni-title">
<div class="col-xs-12">
<liferay-ui:message key='<%= nomeAllegato %>' />
</div>
</div>
</div>
<%
List<DocPratica> docPraticas = DocPraticaLocalServiceUtil
.getValidTmpByIntPratica_Tipologia(intPraticaId, codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<DocPratica> docPraticas = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia(intPraticaId,
codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
if (docPraticas.isEmpty()) {
%>
<div class="row asseverazioni-section">
<div class="col-xs-6">
Nessun allegato presente per la tipologia
<div class="row asseverazioni-section">
<div class="col-xs-6">
Nessun allegato presente per la tipologia
</div>
</div>
</div>
<%
<%
} else {
for (DocPratica docPratica : docPraticas) {
%>
%>
<div class="row asseverazioni-section">
<div class="col-xs-6">
<i class="fa fa-file-o file-icon" aria-hidden="true"></i><%= docPratica.getDescLong() %>
<i class="fa fa-file-o file-icon" aria-hidden="true"></i><%= docPratica.getDescLong() %>
</div>
<div class="col-xs-6 asserazioni-body-title text-center">
<%
FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari());
List<String> signatures = firme.allSignatures();
boolean isEnoughOne = AsseverazioniUtil.isEnoughOne(codiceDoc);
for (String tipoSoggetto : tipologiaSoggetti) {
String clazz= "";
StringBuilder tooltipTitle = new StringBuilder();
List<String> signaturesPerSubject = new UniqueList<String>();
for (String sign : signatures) {
List<Soggetto> soggetti = SoggettoLocalServiceUtil
.getValidTmpByIntPratica_CodiceFiscale(intPraticaId, sign, docPratica.getClassPk());
<%
FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari());
List<String> signatures = firme.allSignatures();
boolean isEnoughOne = AsseverazioniUtil.isEnoughOne(codiceDoc);
for (String tipoSoggetto : tipologiaSoggetti) {
String clazz = StringPool.BLANK;
StringBuilder tooltipTitle = new StringBuilder();
List<String> signaturesPerSubject = new UniqueList<String>();
for (String sign : signatures) {
List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale(
intPraticaId, sign, docPratica.getClassPk());
for (Soggetto soggetto: soggetti) {
if (soggetto.getTipologiaSoggetto().equals(tipoSoggetto)){
signaturesPerSubject.add(sign);
@ -439,7 +419,7 @@ if (dettPratica == null) {
} else if (tipoSoggetto.equals(TipoSoggettoUtil.GEOLOGO)) {
boolean progettista = AsseverazioniUtil.signaturesContains(intPraticaId, TipoSoggettoUtil.PROGETTISTA, signatures);
if (progettista || !signaturesPerSubject.isEmpty()) {
isValid = true;
isValid = true;
}
} else if (tipoSoggetto.equals(TipoSoggettoUtil.PROGETTISTA)) {
boolean geologo = AsseverazioniUtil.signaturesContains(intPraticaId, TipoSoggettoUtil.GEOLOGO, signatures);
@ -509,9 +489,7 @@ if (dettPratica == null) {
} else {
boolean isRequired = AsseverazioniUtil.isAsseverazioneRequiredByCodiceDoc(codiceDoc, tipoSoggetto);
boolean isRecommended = AsseverazioniUtil.isAsseverazioneRecommendedByCodiceDoc(codiceDoc, tipoSoggetto);
boolean direttoreLavoriNotRequired = dettPratica.getLavoriPubblici();
if (tipoSoggetto.equalsIgnoreCase(TipoSoggettoUtil.DIRETTORE_LAVORI)
&& signaturesPerSubject.size() == 0) {
isRequired = false;
@ -530,7 +508,7 @@ if (dettPratica == null) {
}
}
%>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="col-xs-2">
<span class='<%= clazz %> <%= !clazz.isEmpty() && tooltipTitle.length() > 0 ? "tooltip-info" : StringPool.BLANK %>' title='<%= tooltipTitle.toString() %>'>
<sub class="txt-bold"><%= !clazz.isEmpty() && signaturesPerSubject.size() > 0 ? signaturesPerSubject.size() : StringPool.BLANK %></sub>
</span>
@ -540,7 +518,6 @@ if (dettPratica == null) {
%>
</div>
</div>
<%
}
}
@ -548,20 +525,17 @@ if (dettPratica == null) {
%>
</div>
</div>
<script type="text/javascript">
YUI().use(
'aui-tooltip',
function(Y) {
new Y.TooltipDelegate({
trigger: '.tooltip-info',
position: 'top',
cssClass: 'tooltip-help',
html: true,
opacity: 1
});
}
);
<script>
YUI().use('aui-tooltip', function (Y) {
new Y.TooltipDelegate({
trigger: '.tooltip-info',
position: 'top',
cssClass: 'tooltip-help',
html: true,
opacity: 1,
});
});
</script>
<aui:script use="aui-base">
window.parent.Liferay.fire('verifyPopup-ready');
</aui:script>
window.parent.Liferay.fire('verifyPopup-ready');
</aui:script>

38
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo_asseverazione.jsp

@ -8,19 +8,15 @@
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%>
<%@ include file="/html/fascicolofe/init.jsp" %>
<%
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l);
DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
long intPraticaId = dettPratica.getIntPraticaId();
String formName = "fmasseverazioni";
String buttonId = "btnasseverazioni";
String backURL = ParamUtil.getString(request, "backURL");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0L);
DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
long intPraticaId = dettPratica.getIntPraticaId();
String formName = "fmasseverazioni";
String buttonId = "btnasseverazioni";
String backURL = ParamUtil.getString(request, "backURL");
%>
<liferay-portlet:renderURL var="verifyURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/verify_fascicolo.jsp"/>
@ -32,27 +28,27 @@
<h2 class="title-fascicolo pull-left">Gestione Asseverazioni</h2>
<div class="pull-right" >
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
cssClass="inline_toolbar" >
cssClass="inline_toolbar" >
<liferay-ui:icon iconCssClass="fa fa-arrow-left" message="back" url="<%= verifyURL %>"
linkCssClass="btn" />
<c:if test="<%= AsseverazioniUtil.hasAnnullaAsseverazioni(user.getUserId(),dettPraticaId) %>">
<c:if test="<%= AsseverazioniUtil.hasAnnullaAsseverazioni(user.getUserId(), dettPraticaId) %>">
<liferay-portlet:actionURL name="annullaAsseverazioni" var="annullaAsseverazioniURL">
<liferay-portlet:param name="mvcPath"
value="/html/fascicolofe/verify_fascicolo_asseverazione.jsp" />
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="redirect" value="<%=currentURL %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="redirect" value="<%= currentURL %>" />
</liferay-portlet:actionURL>
<liferay-ui:icon iconCssClass="fa fa-close" message="annulla-asseverazioni"
url="<%= annullaAsseverazioniURL %>" linkCssClass="btn btn-danger" />
</c:if>
<c:if test="<%= AsseverazioniUtil.hasRichiediAsseverazioni(user.getUserId(),dettPraticaId) %>">
<c:if test="<%= AsseverazioniUtil.hasRichiediAsseverazioni(user.getUserId(), dettPraticaId) %>">
<liferay-portlet:actionURL name="richiediAsseverazioni" var="richiediAsseverazioniURL">
<liferay-portlet:param name="mvcPath"
value="/html/fascicolofe/verify_fascicolo_asseverazione.jsp"/>
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>"/>
<liferay-portlet:param name="redirect" value="<%=currentURL %>"/>
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>"/>
<liferay-portlet:param name="redirect" value="<%= currentURL %>"/>
</liferay-portlet:actionURL>
<liferay-ui:icon id="<%=buttonId %>" iconCssClass="fa fa-users" message="richiedi-asseverazioni"
<liferay-ui:icon id="<%= buttonId %>" iconCssClass="fa fa-users" message="richiedi-asseverazioni"
url="<%= richiediAsseverazioniURL %>" linkCssClass="btn btn-primary" />
</c:if>
</liferay-ui:icon-menu>
@ -60,7 +56,7 @@
</div>
<liferay-portlet:renderURL var="addAsseverazione">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/edit_asseverazione.jsp"/>
<liferay-portlet:param name="backURL" value="<%=currentURL %>"/>
<liferay-portlet:param name="backURL" value="<%= currentURL %>"/>
</liferay-portlet:renderURL>
<%
String orderByCol = ParamUtil.getString(renderRequest, SearchContainer.DEFAULT_ORDER_BY_COL_PARAM, "asseverazioneId");
@ -134,15 +130,13 @@ DisplayTerms displayTerms = new DisplayTerms(renderRequest);
<liferay-ui:search-container-column-date name="attiva-dal" property="createDate" />
<liferay-ui:search-container-column-date name="chiusa-il" property="dtEsito" />
<liferay-ui:search-container-column-text name="status" >
<liferay-ui:message key='<%="label-asseverazione-status-"+asseverazione.getEsito() %>'></liferay-ui:message>
<liferay-ui:message key='<%= "label-asseverazione-status-" + asseverazione.getEsito() %>' />
</liferay-ui:search-container-column-text>
<%
request.setAttribute("comingFrom", "verify");
%>
<liferay-ui:search-container-column-jsp path="/html/fascicolofe/asseverazione_actions.jsp" name="actions" cssClass="text-center"/>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container>
</div>
Caricamento…
Annulla
Salva