|
|
|
@ -33,89 +33,72 @@
|
|
|
|
|
<%@page import="com.liferay.portal.service.permission.PortletPermissionUtil"%> |
|
|
|
|
<%@ include file="/html/gestioneattivita/init.jsp" %> |
|
|
|
|
<% |
|
|
|
|
|
|
|
|
|
SearchContainer searchContainer = (SearchContainer) request |
|
|
|
|
.getAttribute("liferay-ui:search:searchContainer"); |
|
|
|
|
String redirect = ParamUtil.getString(request, "backUrl"); |
|
|
|
|
ControlloPratica controlloPratica = null; |
|
|
|
|
|
|
|
|
|
redirect = searchContainer.getIteratorURL().toString(); |
|
|
|
|
|
|
|
|
|
ResultRow row = (ResultRow) request |
|
|
|
|
.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); |
|
|
|
|
|
|
|
|
|
controlloPratica = (ControlloPratica) row.getObject(); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
|
Group controlPanelGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.CONTROL_PANEL); |
|
|
|
|
long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(),true); |
|
|
|
|
|
|
|
|
|
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( |
|
|
|
|
controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(),controlloPratica.getPrimaryKey()); |
|
|
|
|
|
|
|
|
|
List<WorkflowTask> listaTask = null; |
|
|
|
|
if (workflowInstanceLink == null) { |
|
|
|
|
listaTask = new ArrayList<WorkflowTask>(); |
|
|
|
|
} else { |
|
|
|
|
listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, |
|
|
|
|
workflowInstanceLink.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String randomId = StringUtil.randomId(); |
|
|
|
|
|
|
|
|
|
long lastDettPraticaId = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()).getDettPraticaId(); |
|
|
|
|
|
|
|
|
|
String buttonIdCambioIstruttore = "buttonIdCambioIstruttore_"+randomId; |
|
|
|
|
String buttonIdSelezionaGeologo = "buttonIdSelezionaGeologo_"+randomId; |
|
|
|
|
String buttonIdAggiungiDettPraticheAlControllo = "buttonIdAggiungiDettPraticheAlControllo_"+randomId; |
|
|
|
|
|
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); |
|
|
|
|
long territorioGroupId = territorio.getGroupId(); |
|
|
|
|
SearchContainer searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer"); |
|
|
|
|
String redirect = ParamUtil.getString(request, "backUrl"); |
|
|
|
|
ControlloPratica controlloPratica = null; |
|
|
|
|
redirect = searchContainer.getIteratorURL().toString(); |
|
|
|
|
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); |
|
|
|
|
controlloPratica = (ControlloPratica) row.getObject(); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
|
Group controlPanelGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.CONTROL_PANEL); |
|
|
|
|
long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(),true); |
|
|
|
|
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( |
|
|
|
|
controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(),controlloPratica.getPrimaryKey()); |
|
|
|
|
List<WorkflowTask> listaTask = null; |
|
|
|
|
if (workflowInstanceLink == null) { |
|
|
|
|
listaTask = new ArrayList<WorkflowTask>(); |
|
|
|
|
} else { |
|
|
|
|
listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, |
|
|
|
|
workflowInstanceLink.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
} |
|
|
|
|
String randomId = StringUtil.randomId(); |
|
|
|
|
long lastDettPraticaId = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()).getDettPraticaId(); |
|
|
|
|
String buttonIdCambioIstruttore = "buttonIdCambioIstruttore_" + randomId; |
|
|
|
|
String buttonIdSelezionaGeologo = "buttonIdSelezionaGeologo_" + randomId; |
|
|
|
|
String buttonIdAggiungiDettPraticheAlControllo = "buttonIdAggiungiDettPraticheAlControllo_" + randomId; |
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); |
|
|
|
|
long territorioGroupId = territorio.getGroupId(); |
|
|
|
|
%> |
|
|
|
|
|
|
|
|
|
<liferay-ui:icon-menu icon="" showWhenSingleIcon="false" showExpanded="true" cssClass="menu_button_activity"> |
|
|
|
|
<div title='<%=LanguageUtil.get(pageContext,"workflow-action-open-pratica") %>' class="tooltip-info"> |
|
|
|
|
<liferay-ui:icon iconCssClass="fa fa-folder-open" |
|
|
|
|
linkCssClass="btn btn-action" |
|
|
|
|
target="_blank" |
|
|
|
|
message="" |
|
|
|
|
url="<%= FascicoloURLUtil.getFascicoloViewURL(controlloPratica.getCompanyId(), controlloPratica.getIntPraticaId()) %>" /> |
|
|
|
|
<liferay-ui:icon iconCssClass="fa fa-folder-open" linkCssClass="btn btn-action" target="_blank" message="" |
|
|
|
|
url="<%= FascicoloURLUtil.getFascicoloBOViewURL(controlloPratica.getCompanyId(), |
|
|
|
|
controlloPratica.getIntPraticaId()) %>" /> |
|
|
|
|
</div> |
|
|
|
|
<c:if test="<%= listaTask.isEmpty() && workflowInstanceLink != null %>"> |
|
|
|
|
<% |
|
|
|
|
listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, |
|
|
|
|
workflowInstanceLink.getWorkflowInstanceId(), true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), |
|
|
|
|
null, workflowInstanceLink.getWorkflowInstanceId(), true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, |
|
|
|
|
null); |
|
|
|
|
%> |
|
|
|
|
</c:if> |
|
|
|
|
<c:if test="<%= !listaTask.isEmpty() %>"> |
|
|
|
|
<% |
|
|
|
|
PortletURL workflowTaskURL = PortletURLFactoryUtil.create(request, PortletKeys.MY_WORKFLOW_TASKS,controlPanelPlid, PortletRequest.RENDER_PHASE); |
|
|
|
|
workflowTaskURL.setParameter("struts_action", |
|
|
|
|
"/my_workflow_tasks/edit_workflow_task"); |
|
|
|
|
workflowTaskURL.setParameter("workflowTaskId",String.valueOf(listaTask.get(0).getWorkflowTaskId())); |
|
|
|
|
workflowTaskURL.setPortletMode(PortletMode.VIEW); |
|
|
|
|
workflowTaskURL.setWindowState(LiferayWindowState.POP_UP); |
|
|
|
|
PortletURL workflowTaskURL = PortletURLFactoryUtil.create(request, PortletKeys.MY_WORKFLOW_TASKS, |
|
|
|
|
controlPanelPlid, PortletRequest.RENDER_PHASE); |
|
|
|
|
workflowTaskURL.setParameter("struts_action", "/my_workflow_tasks/edit_workflow_task"); |
|
|
|
|
workflowTaskURL.setParameter("workflowTaskId", String.valueOf(listaTask.get(0).getWorkflowTaskId())); |
|
|
|
|
workflowTaskURL.setParameter("tab", tabs1); |
|
|
|
|
workflowTaskURL.setPortletMode(PortletMode.VIEW); |
|
|
|
|
workflowTaskURL.setWindowState(LiferayWindowState.POP_UP); |
|
|
|
|
%> |
|
|
|
|
|
|
|
|
|
<div title='<%=LanguageUtil.get(pageContext,"workflow-action-manage") %>' class="tooltip-info"> |
|
|
|
|
<liferay-ui:icon useDialog="true" |
|
|
|
|
iconCssClass="fa fa-list-ol" |
|
|
|
|
linkCssClass="btn btn-action" |
|
|
|
|
message="" |
|
|
|
|
url='<%=workflowTaskURL.toString()+"&controlPanelCategory=my" %>' /> |
|
|
|
|
<div title='<%= LanguageUtil.get(pageContext,"workflow-action-manage") %>' class="tooltip-info"> |
|
|
|
|
<liferay-ui:icon useDialog="true" iconCssClass="fa fa-list-ol" linkCssClass="btn btn-action" message="" |
|
|
|
|
url='<%= workflowTaskURL.toString() + "&controlPanelCategory=my" %>' /> |
|
|
|
|
</div> |
|
|
|
|
</c:if> |
|
|
|
|
<c:if test="<%=WorkflowConstants.STATUS_PENDING == controlloPratica.getStatus()%>"> |
|
|
|
|
<c:if test="<%= (listaTask.size() > 0) |
|
|
|
|
&& IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.ASSEGNA_AL_RUOLO) |
|
|
|
|
&& Validator.isNotNull(listaTask.get(0).getAssigneeUserId()) |
|
|
|
|
&& (listaTask.get(0).getAssigneeUserId() != -1) |
|
|
|
|
&& (listaTask.get(0).getName().equals(\"Assegnazione\") |
|
|
|
|
|| listaTask.get(0).getName().equals(\"Approvazione\")) %>"> |
|
|
|
|
&& IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.ASSEGNA_AL_RUOLO) |
|
|
|
|
&& Validator.isNotNull(listaTask.get(0).getAssigneeUserId()) |
|
|
|
|
&& (listaTask.get(0).getAssigneeUserId() != -1) |
|
|
|
|
&& (listaTask.get(0).getName().equals(\"Assegnazione\") |
|
|
|
|
|| listaTask.get(0).getName().equals(\"Approvazione\")) %>"> |
|
|
|
|
<liferay-portlet:actionURL name="riassegnaAlRuolo" var="riassegnaAlRuoloUrl"> |
|
|
|
|
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> |
|
|
|
|
<liferay-util:param name="workflowTaskId" value="<%=String.valueOf(listaTask.get(0).getWorkflowTaskId())%>" /> |
|
|
|
|
<liferay-util:param name="controlloPraticaId" value="<%=String.valueOf(controlloPratica.getControlloPraticaId())%>" /> |
|
|
|
|
<liferay-util:param name="redirect" value="<%=currentURL%>" /> |
|
|
|
|
<liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" /> |
|
|
|
|
<liferay-util:param name="workflowTaskId" value="<%= String.valueOf(listaTask.get(0).getWorkflowTaskId()) %>" /> |
|
|
|
|
<liferay-util:param name="controlloPraticaId" value="<%= String.valueOf(controlloPratica.getControlloPraticaId()) %>" /> |
|
|
|
|
<liferay-util:param name="redirect" value="<%= currentURL %>" /> |
|
|
|
|
</liferay-portlet:actionURL> |
|
|
|
|
<div title='<%=LanguageUtil.get(pageContext,"workflow-action-riassegna-al-ruolo") %>' class="tooltip-info"> |
|
|
|
|
<liferay-ui:icon iconCssClass="fa fa-users" |
|
|
|
@ -124,7 +107,6 @@
|
|
|
|
|
url="<%=riassegnaAlRuoloUrl %>" /> |
|
|
|
|
</div> |
|
|
|
|
</c:if> |
|
|
|
|
|
|
|
|
|
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.CAMBIO_ISTRUTTORE) %>"> |
|
|
|
|
<c:if test="<%=Validator.isNotNull(intPratica.getStatusByUserId())%>"> |
|
|
|
|
<liferay-util:include page="/html/gestioneattivita/actions/action_cambio_istruttore.jsp" servletContext="<%= application %>" > |
|
|
|
@ -141,7 +123,6 @@
|
|
|
|
|
</div> |
|
|
|
|
</c:if> |
|
|
|
|
</c:if> |
|
|
|
|
|
|
|
|
|
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId()%>"> |
|
|
|
|
<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)%>"> |
|
|
|
@ -151,7 +132,6 @@
|
|
|
|
|
<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:include> |
|
|
|
|
|
|
|
|
|
<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="#" /> |
|
|
|
|
</div> |
|
|
|
@ -166,21 +146,17 @@
|
|
|
|
|
<liferay-util:param name="parereGeologoId" value="<%=String.valueOf(parereGeologo.getParereGeologoId())%>" /> |
|
|
|
|
<liferay-util:param name="redirect" value="<%=currentURL%>" /> |
|
|
|
|
</liferay-portlet:actionURL> |
|
|
|
|
|
|
|
|
|
<div title='<%=LanguageUtil.get(pageContext,"fascicolo-cancella-parere-geologo") %>' class="tooltip-info"> |
|
|
|
|
<liferay-ui:icon id="<%=buttonIdSelezionaGeologo%>" linkCssClass="btn btn-action" iconCssClass="fa fa-times-circle" message="" url="<%=annullaRichiestaParereUrl %>" /> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</c:if> |
|
|
|
|
</c:if> |
|
|
|
|
|
|
|
|
|
<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:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> |
|
|
|
|
<liferay-util:param name="controlloPraticaId" value="<%=String.valueOf(controlloPratica.getControlloPraticaId()) %>"></liferay-util:param> |
|
|
|
|
<liferay-util:param name="buttonIdAggiungiDettPraticheAlControllo" value="<%=buttonIdAggiungiDettPraticheAlControllo %>"></liferay-util:param> |
|
|
|
|
</liferay-util:include> |
|
|
|
|
|
|
|
|
|
<div title='<%=LanguageUtil.get(pageContext,"workflow-action-aggiungi-pratiche") %>' class="tooltip-info"> |
|
|
|
|
<liferay-ui:icon id="<%=buttonIdAggiungiDettPraticheAlControllo %>" |
|
|
|
|
iconCssClass="fa fa-calendar-plus-o" |
|
|
|
@ -191,21 +167,19 @@
|
|
|
|
|
</c:if> |
|
|
|
|
</c:if> |
|
|
|
|
</liferay-ui:icon-menu> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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 |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
new Y.TooltipDelegate( |
|
|
|
|
{ |
|
|
|
|
trigger: '.tooltip-info', |
|
|
|
|
position: 'top', |
|
|
|
|
cssClass: 'tooltip-help', |
|
|
|
|
html: true, |
|
|
|
|
opacity: 1 |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
</script> |