Sfoglia il codice sorgente

endoproc multiplo

master
Mattia Gosetto 4 anni fa
parent
commit
ce935dd843
  1. 10
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java
  2. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  3. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/asset/controllopratica/full_content.jsp
  4. 50
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/action_button.jsp
  5. 73
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_annulla_ric_geologo.jsp
  6. 7
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_seleziona_geologo.jsp

10
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java

@ -295,25 +295,25 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
SessionErrors.add(actionRequest, "error-aggiunta-richiesta-parere"); SessionErrors.add(actionRequest, "error-aggiunta-richiesta-parere");
} }
} }
public void aggiungiRichiestaParere(ActionRequest actionRequest, ActionResponse actionResponse) { public void aggiungiRichiestaParere(ActionRequest actionRequest, ActionResponse actionResponse) {
long geologoId = ParamUtil.getLong(actionRequest, "geologoId"); long geologoId = ParamUtil.getLong(actionRequest, "geologoId");
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId"); long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId");
try { try {
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
serviceContext.setCreateDate(new Date()); serviceContext.setCreateDate(new Date());
serviceContext.setModifiedDate(new Date()); serviceContext.setModifiedDate(new Date());
if (ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPraticaId) == 0) { //if (ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPraticaId) == 0) {
ParereGeologo parereGeologo = ParereGeologoServiceUtil.addParereGeologo(geologoId, ParereGeologo parereGeologo = ParereGeologoServiceUtil.addParereGeologo(geologoId,
intPraticaId, dettPraticaId, serviceContext); intPraticaId, dettPraticaId, serviceContext);
// ADT: aggiunta notifica geologo // ADT: aggiunta notifica geologo
MailUtil.invioNotificaGeologo(parereGeologo, serviceContext); MailUtil.invioNotificaGeologo(parereGeologo, serviceContext);
} else { /*} else {
throw new PortalException("parere endoprocedimentale già presente"); throw new PortalException("parere endoprocedimentale già presente");
} }*/
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {
_log.error(e, e); _log.error(e, e);
SessionErrors.add(actionRequest, "error-aggiunta-richiesta-parere"); SessionErrors.add(actionRequest, "error-aggiunta-richiesta-parere");

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=2856 build.number=2858
build.date=1611650497371 build.date=1611666327615
build.auto.upgrade=true build.auto.upgrade=true
## ##

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/asset/controllopratica/full_content.jsp

@ -51,7 +51,7 @@ List<ParereGeologo> pareriGeologo = ParereGeologoLocalServiceUtil.findByIntPrati
<strong>Tecnico istruttore: </strong> <%= tecnicoIstruttore!=null?tecnicoIstruttore.getFullName(): "Nessun istruttore" %> <strong>Tecnico istruttore: </strong> <%= tecnicoIstruttore!=null?tecnicoIstruttore.getFullName(): "Nessun istruttore" %>
</p> </p>
</div> </div>
</div>
<div> <div>
<div class="container_header_text_attivita"> <div class="container_header_text_attivita">
<liferay-ui:icon url="<%=carichiDiLavoroGeologo %>" useDialog="true" message="visualizza-carichi-di-lavoro" linkCssClass="btn btn-rounded" iconCssClass="icon-bar-chart"/> <liferay-ui:icon url="<%=carichiDiLavoroGeologo %>" useDialog="true" message="visualizza-carichi-di-lavoro" linkCssClass="btn btn-rounded" iconCssClass="icon-bar-chart"/>

50
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/action_button.jsp

@ -67,7 +67,8 @@
long lastDettPraticaId = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()).getDettPraticaId(); long lastDettPraticaId = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()).getDettPraticaId();
String buttonIdCambioIstruttore = "buttonIdCambioIstruttore_"+randomId; String buttonIdCambioIstruttore = "buttonIdCambioIstruttore_"+randomId;
String buttonIdSelezionaGeologo = "buttonIdSelezionaGeologo_"+randomId; String buttonIdSelezionaGeologo = "buttonIdSelezionaGeologo_"+randomId;
String buttonIdAnnullaRicGeologo = "buttonIdAnnullaRicGeologo_"+randomId;
String buttonIdAggiungiDettPraticheAlControllo = "buttonIdAggiungiDettPraticheAlControllo_"+randomId; String buttonIdAggiungiDettPraticheAlControllo = "buttonIdAggiungiDettPraticheAlControllo_"+randomId;
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
@ -173,35 +174,34 @@
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId()%>"> <c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId()%>">
<c:if test="<%=!listaTask.isEmpty() %>"> <c:if test="<%=!listaTask.isEmpty() %>">
<c:if test="<%= listaTask.get(0).getName().equalsIgnoreCase(WorkflowConstants.WORKFLOW_TASKNAME_ASSEGNAZIONE) || listaTask.get(0).getName().equalsIgnoreCase(WorkflowConstants.WORKFLOW_TASKNAME_ESITO)%>"> <c:if test="<%= listaTask.get(0).getName().equalsIgnoreCase(WorkflowConstants.WORKFLOW_TASKNAME_ASSEGNAZIONE) || listaTask.get(0).getName().equalsIgnoreCase(WorkflowConstants.WORKFLOW_TASKNAME_ESITO)%>">
<c:if test="<%=WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId()) && ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPratica.getIntPraticaId()) == 0 %>"> <liferay-util:include page="/html/gestioneattivita/actions/action_seleziona_geologo.jsp" servletContext="<%= application %>" >
<liferay-util:include page="/html/gestioneattivita/actions/action_seleziona_geologo.jsp" servletContext="<%= application %>" > <liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param>
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> <liferay-util:param name="dettPraticaId" value="<%=String.valueOf(controlloPratica.getDettPraticaId()) %>"></liferay-util:param>
<liferay-util:param name="dettPraticaId" value="<%=String.valueOf(controlloPratica.getDettPraticaId()) %>"></liferay-util:param> <liferay-util:param name="buttonIdSelezionaGeologo" value="<%=buttonIdSelezionaGeologo %>"></liferay-util:param>
<liferay-util:param name="buttonIdSelezionaGeologo" value="<%=buttonIdSelezionaGeologo %>"></liferay-util:param> </liferay-util:include>
</liferay-util:include>
<div title='<%=LanguageUtil.get(pageContext,"fascicolo-action-seleziona-geologo") %>' class="tooltip-info">
<div title='<%=LanguageUtil.get(pageContext,"fascicolo-action-seleziona-geologo") %>' class="tooltip-info"> <liferay-ui:icon id="<%=buttonIdSelezionaGeologo%>" linkCssClass="btn btn-action" iconCssClass="fa fa-globe" message="" url="#" />
<liferay-ui:icon id="<%=buttonIdSelezionaGeologo%>" linkCssClass="btn btn-action" iconCssClass="fa fa-globe" message="" url="#" /> </div>
</div>
</c:if>
</c:if> </c:if>
</c:if> </c:if>
<c:if test="<%=WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId()) && ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPratica.getIntPraticaId()) != 0 %>"> <c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId()%>">
<% <c:if test="<%=WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId()) && ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPratica.getIntPraticaId()) != 0 %>">
ParereGeologo parereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaIdParereVuoto(intPratica.getIntPraticaId(), 0, 1).get(0); <liferay-util:include page="/html/gestioneattivita/actions/action_annulla_ric_geologo.jsp" servletContext="<%= application %>" >
%> <liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param>
<liferay-portlet:actionURL name="annullaRichiestaParere" var="annullaRichiestaParereUrl"> <liferay-util:param name="dettPraticaId" value="<%=String.valueOf(controlloPratica.getDettPraticaId()) %>"></liferay-util:param>
<liferay-util:param name="parereGeologoId" value="<%=String.valueOf(parereGeologo.getParereGeologoId())%>" /> <liferay-util:param name="buttonIdAnnullaRicGeologo" value="<%=buttonIdAnnullaRicGeologo %>"></liferay-util:param>
<liferay-util:param name="redirect" value="<%=currentURL%>" /> </liferay-util:include>
</liferay-portlet:actionURL>
<div title='<%=LanguageUtil.get(pageContext,"fascicolo-cancella-parere-geologo") %>' class="tooltip-info">
<div title='<%=LanguageUtil.get(pageContext,"fascicolo-cancella-parere-geologo") %>' class="tooltip-info"> <liferay-ui:icon id="<%=buttonIdAnnullaRicGeologo%>" linkCssClass="btn btn-action" iconCssClass="fa fa-times-circle" message="" url="#" />
<liferay-ui:icon id="<%=buttonIdSelezionaGeologo%>" linkCssClass="btn btn-action" iconCssClass="fa fa-times-circle" message="" url="<%=annullaRichiestaParereUrl %>" /> </div>
</div> </c:if>
</c:if> </c:if>
</c:if> </c:if>
<c:if test="<%=lastDettPraticaId != controlloPratica.getDettPraticaId() && intPratica.getStatusByUserId()== user.getUserId()%>"> <c:if test="<%=lastDettPraticaId != controlloPratica.getDettPraticaId() && intPratica.getStatusByUserId()== user.getUserId()%>">
<liferay-util:include page="/html/gestioneattivita/actions/action_aggiungi_al_controllo.jsp" servletContext="<%= application %>" > <liferay-util:include page="/html/gestioneattivita/actions/action_aggiungi_al_controllo.jsp" servletContext="<%= application %>" >
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> <liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param>

73
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_annulla_ric_geologo.jsp

@ -0,0 +1,73 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Organization"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.model.Role"%>
<%@page import="javax.portlet.PortletURL"%>
<%@include file="/html/gestioneattivita/init.jsp"%>
<%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
String buttonIdAnnullaRicGeologo = ParamUtil.getString(request, "buttonIdAnnullaRicGeologo");
PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String randomId = StringUtil.randomId();
String formNameAnnullaRicGeologo = "formNameAnnullaRicGeologo_"+randomId;
String divIdAnnullaRicGeologo = "divIdAnnullaRicGeologo_"+randomId;
List<ParereGeologo> pareriGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(intPraticaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<User> geologi = new ArrayList<User>();
%>
<liferay-portlet:actionURL name="annullaRichiestaParere" var="annullaRichiestaParereGeologoUrl">
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPraticaId)%>" />
<liferay-util:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId)%>" />
<liferay-util:param name="redirect" value="<%=currentURL%>" />
</liferay-portlet:actionURL>
<aui:form name="<%=formNameAnnullaRicGeologo %>" method="post" action="<%= annullaRichiestaParereGeologoUrl %>" >
<div id='<%= renderResponse.getNamespace() + divIdAnnullaRicGeologo %>' class="hide" >
<aui:select name="parereGeologoId" label="<%=StringPool.BLANK %>" required="true">
<aui:option label="Seleziona funzionario" value="" />
<%
for (ParereGeologo parereGeologo : pareriGeologo) {
if(Validator.isNull(parereGeologo.getDtCompilazione())){
User geologo = UserLocalServiceUtil.getUser(parereGeologo.getGeologoUserId());
List<Organization> listaOrganizzazioni = OrganizationLocalServiceUtil.getUserOrganizations(geologo.getUserId());
StringBuilder sb = new StringBuilder();
sb.append(geologo.getFullName());
sb.append(StringPool.SPACE);
sb.append(StringPool.DASH);
sb.append(StringPool.SPACE);
sb.append(ListUtil.toString(listaOrganizzazioni, "name", StringPool.COMMA_AND_SPACE));
%>
<aui:option label="<%=sb.toString()%>" value="<%=parereGeologo.getParereGeologoId()%>" />
<%
}
}
%>
</aui:select>
</div>
<liferay-util:include page="/html/common/submit_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="formName" value="<%=formNameAnnullaRicGeologo %>"></liferay-util:param>
<liferay-util:param name="titolo" value="Seleziona parere endoprocedimentale da annullare"></liferay-util:param>
<liferay-util:param name="buttonId" value="<%=buttonIdAnnullaRicGeologo %>"></liferay-util:param>
<liferay-util:param name="buttonConferma" value="CONFERMA"></liferay-util:param>
<liferay-util:param name="contentDiv" value="<%=divIdAnnullaRicGeologo %>"></liferay-util:param>
<liferay-util:param name="width" value="500"></liferay-util:param>
<liferay-util:param name="buttonBar" value="true"></liferay-util:param>
</liferay-util:include>
</aui:form>

7
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_seleziona_geologo.jsp

@ -25,6 +25,13 @@
String divIdSelezionaGeologo = "divIdSelezionaGeologo_"+randomId; String divIdSelezionaGeologo = "divIdSelezionaGeologo_"+randomId;
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(),Constants.ROLE_NAME_GEOLOGO); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(),Constants.ROLE_NAME_GEOLOGO);
List<User> geologi = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); List<User> geologi = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
List<ParereGeologo> pareriGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(intPraticaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for(ParereGeologo parereGeologo : pareriGeologo){
if(Validator.isNull(parereGeologo.getDtCompilazione())){
geologi.remove(UserLocalServiceUtil.getUser(parereGeologo.getGeologoUserId()));
}
}
%> %>
<liferay-portlet:actionURL name="aggiungiRichiestaParere" var="aggiungiRichiestaParereUrl"> <liferay-portlet:actionURL name="aggiungiRichiestaParere" var="aggiungiRichiestaParereUrl">

Caricamento…
Annulla
Salva