diff --git a/liferay-plugins-sdk-6.2/dist/portos-bo-shared-6.2.0.1.jar b/liferay-plugins-sdk-6.2/dist/portos-bo-shared-6.2.0.1.jar index 48dae296..838f0278 100644 Binary files a/liferay-plugins-sdk-6.2/dist/portos-bo-shared-6.2.0.1.jar and b/liferay-plugins-sdk-6.2/dist/portos-bo-shared-6.2.0.1.jar differ diff --git a/liferay-plugins-sdk-6.2/dist/portos-kaleo-shared-6.2.0.1.jar b/liferay-plugins-sdk-6.2/dist/portos-kaleo-shared-6.2.0.1.jar index 120eec49..34da0aba 100644 Binary files a/liferay-plugins-sdk-6.2/dist/portos-kaleo-shared-6.2.0.1.jar and b/liferay-plugins-sdk-6.2/dist/portos-kaleo-shared-6.2.0.1.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-shared.jar b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-shared.jar index 48dae296..838f0278 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-shared.jar and b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-shared.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-kaleo-shared.jar b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-kaleo-shared.jar index 120eec49..34da0aba 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-kaleo-shared.jar and b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-kaleo-shared.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java index 87d5e867..1f6c22af 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java @@ -90,7 +90,20 @@ public class AdvancedOperationPortlet extends MVCPortlet { } actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId)); } + + public void reindexPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{ + Privati.checkIfUserIsCompanyAdmin(actionRequest); + + ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); + + long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0L); + if (intPraticaId != 0L) { + _log.info("AdvancedOperationPortlet --- Reindexing fascicolo of IntPraticaId " + intPraticaId); + IntPraticaLocalServiceUtil.reIndexFasciolo(intPraticaId, themeDisplay.getCompanyId()); + } + actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId)); + } public void fixStatusPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{ @@ -112,32 +125,35 @@ public class AdvancedOperationPortlet extends MVCPortlet { Privati.checkIfUserIsCompanyAdmin(actionRequest); long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", -1L); + _log.info("intPraticaId: "+intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId); int destinationUO = AdvancedOperationUtil.getDestinationUO(intPratica); - + _log.info("intPratica uo: "+intPratica.getUnitaOperativa()); if (AdvancedOperationUtil.evalUO(intPratica)) { _setUO(intPratica, destinationUO); } - + _log.info("intPratica uo: "+intPratica.getUnitaOperativa()); actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId)); } - private void _setUO(IntPratica intPratica, int uo) throws SystemException, SearchException{ + private void _setUO(IntPratica intPratica, int uo) throws SystemException, PortalException{ + _log.info("uo: "+uo); intPratica.setUnitaOperativa(uo); IntPraticaLocalServiceUtil.updateIntPratica(intPratica); - Indexer intPraticaIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class); - intPraticaIndexer.reindex(intPratica); + IntPraticaLocalServiceUtil.reIndexFasciolo(intPratica.getIntPraticaId(), intPratica.getCompanyId()); - Indexer controlloPraticaIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class); - List controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()); - if(!controlloPraticas.isEmpty()){ - for(ControlloPratica controlloPratica : controlloPraticas){ - if(controlloPratica.getStatus() == WorkflowConstants.STATUS_PENDING){ - controlloPraticaIndexer.reindex(intPratica); - } - } - } +// Indexer intPraticaIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class); +// intPraticaIndexer.reindex(intPratica); +// Indexer controlloPraticaIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class); +// List controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()); +// if(!controlloPraticas.isEmpty()){ +// for(ControlloPratica controlloPratica : controlloPraticas){ +// if(controlloPratica.getStatus() == WorkflowConstants.STATUS_PENDING){ +// controlloPraticaIndexer.reindex(intPratica); +// } +// } +// } } public void ripristinaPraticaVidimata(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java index 98578bdd..bc452881 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java @@ -283,18 +283,14 @@ public class AdvancedOperationUtil { } public static SortedSet getIstruttoreUOs(IntPratica intPratica){ - WorkflowTask lastTask = getLastTask(intPratica); - if(Validator.isNotNull(lastTask)){ - long assigneeUserId = lastTask.getAssigneeUserId(); - try { - if(-1 != assigneeUserId){ - User assignee = UserLocalServiceUtil.getUser(assigneeUserId); - return UserUtil.getUnitaOperative(assignee); - } - } catch (SystemException | PortalException e){ - _log.error("AOP ==> Error while analyzing IntPratica: " + intPratica.getIntPraticaId()); - _log.error(e,e); + try { + User tecnicoIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); + if(-1 != tecnicoIstruttore.getUserId()){ + return UserUtil.getUnitaOperative(tecnicoIstruttore); } + } catch (SystemException e) { + _log.error("AOP ==> Error while analyzing IntPratica: " + intPratica.getIntPraticaId()); + _log.error(e,e); } return null; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp index befd3b49..0e1152f0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp @@ -232,30 +232,6 @@ <% } %> - <% if(AdvancedOperationUtil.evalUO(intPratica)){ %> - - - - - - <% - String functionfixUO = "javascript:"+renderResponse.getNamespace()+"openConfirmationDialog('"+renderResponse.getNamespace()+"fixUO','Sei sicuro di voler cambiare l unita operativa di questa pratica?')"; - %> - - - - - - <% } %> - <% if(AdvancedOperationUtil.isPraticaAnnullata(intPratica)){ %>