Sfoglia il codice sorgente

Aggiunto errore soggetto

feature/fix_soggetti
abianchi7701 1 anno fa
parent
commit
d6c6174d54
  1. 11
      liferay-plugins-sdk-6.2/hooks/hms-taglib-hook/.project
  2. 11
      liferay-plugins-sdk-6.2/layouttpl/bootstrapt_1_column-layouttpl/.project
  3. 11
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/.project
  4. 11
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/.project
  5. 11
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/.project
  6. 1
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties
  7. 106
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/SoggettiPraticaPortlet.java
  8. 4
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/edit_soggetto.jsp
  9. 11
      liferay-plugins-sdk-6.2/themes/provatema-theme/.project
  10. 11
      liferay-plugins-sdk-6.2/webs/elasticray-web/.project

11
liferay-plugins-sdk-6.2/hooks/hms-taglib-hook/.project

@ -33,4 +33,15 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1701177105995</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

11
liferay-plugins-sdk-6.2/layouttpl/bootstrapt_1_column-layouttpl/.project

@ -33,4 +33,15 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1701177105974</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

11
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/.project

@ -33,4 +33,15 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1701177105998</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

11
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/.project

@ -33,4 +33,15 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1701177106002</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

11
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/.project

@ -33,4 +33,15 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1701177106006</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

1
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties

@ -77,6 +77,7 @@ salva-verifica = Salva e Verifica
## Soggetti ## ## Soggetti ##
add-soggetto = Aggiungi Soggetto add-soggetto = Aggiungi Soggetto
edit-soggetto = Modifica Soggetto edit-soggetto = Modifica Soggetto
errore-soggetto = Il Soggetto Inserito non può ottenere il ruolo
## Parere Geologo ## ## Parere Geologo ##
error-update-parere-geologo = "Errore durante l'inserimento del parere geologo" error-update-parere-geologo = "Errore durante l'inserimento del parere geologo"

106
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/SoggettiPraticaPortlet.java

@ -1,5 +1,34 @@
package it.tref.liferay.portos.fe.portlet; package it.tref.liferay.portos.fe.portlet;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.json.JSONSerializer;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.servlet.HttpHeaders;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.upload.UploadPortletRequest;
import com.liferay.portal.kernel.util.ContentTypes;
import com.liferay.portal.kernel.util.DateFormatFactoryUtil;
import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.HttpUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.DocPratica;
@ -38,35 +67,6 @@ import javax.portlet.PortletException;
import javax.portlet.ResourceRequest; import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse; import javax.portlet.ResourceResponse;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.json.JSONSerializer;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.servlet.HttpHeaders;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.upload.UploadPortletRequest;
import com.liferay.portal.kernel.util.ContentTypes;
import com.liferay.portal.kernel.util.DateFormatFactoryUtil;
import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.HttpUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
public class SoggettiPraticaPortlet extends MVCPortlet { public class SoggettiPraticaPortlet extends MVCPortlet {
private static Log _log = LogFactoryUtil.getLog(SoggettiPraticaPortlet.class); private static Log _log = LogFactoryUtil.getLog(SoggettiPraticaPortlet.class);
@ -202,6 +202,7 @@ public class SoggettiPraticaPortlet extends MVCPortlet {
long soggettoSostituitoId = ParamUtil.getLong(actionRequest, "soggettoSostituitoId"); long soggettoSostituitoId = ParamUtil.getLong(actionRequest, "soggettoSostituitoId");
ServiceContext serviceContext = ServiceContextFactory.getInstance(Soggetto.class.getName(), actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(Soggetto.class.getName(), actionRequest);
long userId = PortalUtil.getUserId(actionRequest); long userId = PortalUtil.getUserId(actionRequest);
try { try {
actionResponse.setRenderParameter("mvcPath", "html/soggettipratica/edit_soggetto.jsp"); actionResponse.setRenderParameter("mvcPath", "html/soggettipratica/edit_soggetto.jsp");
boolean tmp = false; boolean tmp = false;
@ -209,6 +210,7 @@ public class SoggettiPraticaPortlet extends MVCPortlet {
tmp = true; tmp = true;
} }
Soggetto soggetto = null; Soggetto soggetto = null;
if(controlloTipologia(userId, codiceFiscale, tipologiaSoggetto)){
if (soggettoId == 0) { if (soggettoId == 0) {
soggetto = SoggettoServiceUtil.addSoggetto(userId, dettPraticaId, intPraticaId, nome, cognome, soggetto = SoggettoServiceUtil.addSoggetto(userId, dettPraticaId, intPraticaId, nome, cognome,
codiceFiscale, codiceFiscaleDelegato, dataNascita, provinciaNascita, comuneNascita, codiceFiscale, codiceFiscaleDelegato, dataNascita, provinciaNascita, comuneNascita,
@ -230,8 +232,12 @@ public class SoggettiPraticaPortlet extends MVCPortlet {
aggiuntivo, rimosso, ambitoAttivita, ambitoProfessione, intPraticaIdRimozione, aggiuntivo, rimosso, ambitoAttivita, ambitoProfessione, intPraticaIdRimozione,
dettPraticaIdRimozione, null, soggettoSostituitoId, 0L, tmp, serviceContext); dettPraticaIdRimozione, null, soggettoSostituitoId, 0L, tmp, serviceContext);
} }
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
actionResponse.setRenderParameter("soggettoId", String.valueOf(soggetto.getSoggettoId())); actionResponse.setRenderParameter("soggettoId", String.valueOf(soggetto.getSoggettoId()));
}else{
SessionErrors.add(actionRequest, "error");
}
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
actionResponse.setRenderParameter("closePopup", String.valueOf(true)); actionResponse.setRenderParameter("closePopup", String.valueOf(true));
} catch (PortalException e) { } catch (PortalException e) {
_log.error(e, e); _log.error(e, e);
@ -452,4 +458,44 @@ public class SoggettiPraticaPortlet extends MVCPortlet {
throw new IOException(e); throw new IOException(e);
} }
} }
private boolean controlloTipologia(long userId, String codiceFiscale, String tipo){
try {
OrderByComparator orderByComparator = OrderByComparatorFactoryUtil.create("portos_bo_soggetto",
"createDate", false);
List<Soggetto> soggetti = SoggettoLocalServiceUtil.findByUserId_CodiceFiscale(userId, codiceFiscale,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, orderByComparator);
for (Soggetto soggetto : soggetti) {
switch (tipo) {
case TipoSoggettoUtil.COLLAUDATORE:
if(soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.DIRETTORE_LAVORI || soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.PROGETTISTA || soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.DITTA){
return false;
}
break;
case TipoSoggettoUtil.DIRETTORE_LAVORI:
if(soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.COLLAUDATORE || soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.DITTA){
return false;
}
break;
case TipoSoggettoUtil.DITTA:
if(soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.DIRETTORE_LAVORI || soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.PROGETTISTA || soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.DITTA){
return false;
}
break;
case TipoSoggettoUtil.PROGETTISTA:
if(soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.COLLAUDATORE || soggetto.getTipologiaSoggetto()==TipoSoggettoUtil.DITTA){
return false;
}
break;
}
}
} catch (SystemException e) {
}
return true;
}
} }

4
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/edit_soggetto.jsp

@ -86,6 +86,10 @@ boolean inBO = ParamUtil.getBoolean(request, "inBO");
</p> </p>
</c:if> </c:if>
<liferay-ui:error key="error" message="errore-soggetto" />
<aui:form name="fm" onSubmit="preventDefault();" <aui:form name="fm" onSubmit="preventDefault();"
action='<%= disabledInput ? StringPool.BLANK : updateSoggettoURL%>' method="post" enctype="multipart/form-data"> action='<%= disabledInput ? StringPool.BLANK : updateSoggettoURL%>' method="post" enctype="multipart/form-data">
<aui:model-context bean="<%= soggetto %>" model="<%= Soggetto.class %>" /> <aui:model-context bean="<%= soggetto %>" model="<%= Soggetto.class %>" />

11
liferay-plugins-sdk-6.2/themes/provatema-theme/.project

@ -38,4 +38,15 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1701177106009</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

11
liferay-plugins-sdk-6.2/webs/elasticray-web/.project

@ -33,4 +33,15 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1701177105990</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

Caricamento…
Annulla
Salva