Sfoglia il codice sorgente

Inizio sanatoria

master
Salvatore La Manna 4 anni fa
parent
commit
5b8e908125
  1. 12
      liferay-plugins-sdk-6.2/build.portos.properties
  2. 7
      liferay-plugins-sdk-6.2/build.portos.properties.save
  3. 201
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java
  4. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalService.java
  5. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceUtil.java
  6. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceWrapper.java
  7. 60
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PraticaUtil.java
  8. 10
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java
  9. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties
  10. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/scheduler/SchedulerWorkflow.java
  11. 15
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java
  12. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  13. 11
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java
  14. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/DocPraticaModelListener.java
  15. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/SoggettoModelListener.java
  16. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java
  17. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java
  18. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/RicercaProtocolloPortlet.java
  19. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/TempistichePortlet.java
  20. 8
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  21. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaFinderImpl.java
  22. 12
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaFinderImpl.java
  23. 118
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/startup/CompanyExpandoStartupAction.java
  24. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java
  25. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  26. 24
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/edit_allegato_manuale.jsp
  27. 87
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/view.jsp
  28. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/init.jsp
  29. 24
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/edit.jsp
  30. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/import.jsp
  31. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/search.jsp
  32. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/select_comune.jsp
  33. 61
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/view.jsp
  34. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/view_buttons.jsp
  35. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/view.jsp
  36. 28
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/confirm_import_window.jsp
  37. 34
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/confirm_window.jsp
  38. 68
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/submit_window.jsp
  39. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/header.jsp
  40. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
  41. 230
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/action_button.jsp
  42. 48
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_aggiungi_al_controllo.jsp
  43. 31
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp
  44. 46
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_seleziona_geologo.jsp
  45. 62
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/altri_task.jsp
  46. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp
  47. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_completati.jsp
  48. 17
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_miei_ruoli.jsp
  49. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view.jsp
  50. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf
  51. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/action_button.jsp
  52. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/init.jsp
  53. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/view_columns.jspf
  54. 58
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/paesaggistica_administration/view.jsp
  55. 7
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
  56. 18
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/SoggettiPraticaPortlet.java
  57. 52
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/search/AdvancedSearch.java
  58. 8
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/PortletKeys.java
  59. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/portlet.properties
  60. 8
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/init.jsp
  61. 71
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp
  62. 178
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp
  63. 19
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/configuration.jsp
  64. 1
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/init.jsp
  65. 4
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf
  66. 51
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns.jsp
  67. 137
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns_generic.jspf
  68. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
  69. 1421
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/edit_soggetto.jsp
  70. 41
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/edit_soggetto_modal.jsp
  71. 8
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/init.jsp
  72. 545
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view.jsp
  73. 379
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view_valida_fino.jsp
  74. 14
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java
  75. 2
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java
  76. 38
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java
  77. 194
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java
  78. 18
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java
  79. 843
      liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/portos/report/engine/ReportAssegnazioniIstruttorie.java
  80. 133
      liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/portos/report/engine/portlet/ReportsPortlet.java
  81. 76
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/jasper/core/ReportEngine.java
  82. 13
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java
  83. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java
  84. 53
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/ArtLeggeUtil.java
  85. 6
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/Constants.java
  86. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FascicoloURLUtil.java
  87. 14
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java
  88. 8
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java
  89. 1
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/TipoIntegrazioneUtil.java
  90. 5
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath
  91. 37
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java
  92. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf
  93. 21
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
  94. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties

12
liferay-plugins-sdk-6.2/build.portos.properties

@ -1,9 +1,7 @@
# Managed by Liferay IDE (remove this comment to prevent future updates) app.server.tomcat.lib.global.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62/lib/ext
app.server.tomcat.deploy.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62/webapps
app.server.tomcat.lib.global.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext app.server.parent.dir = /home/portos/bin/liferay-paesaggistica
app.server.tomcat.deploy.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps app.server.tomcat.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62
app.server.parent.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6
app.server.tomcat.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62
app.server.type = tomcat app.server.type = tomcat
app.server.tomcat.portal.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT app.server.tomcat.portal.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62/webapps/ROOT
javac.encoding = UTF-8 javac.encoding = UTF-8

7
liferay-plugins-sdk-6.2/build.portos.properties.save

@ -0,0 +1,7 @@
app.server.tomcat.lib.global.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62/lib/ext
app.server.tomcat.deploy.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62/webapps
app.server.parent.dir = /home/portos/bin/liferay-paesaggistica
app.server.tomcat.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62
app.server.type = tomcat
app.server.tomcat.portal.dir = /home/portos/bin/liferay-paesaggistica/tomcat-7.0.62/webapps/ROOT
javac.encoding = UTF-8

201
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java

@ -40,6 +40,7 @@ import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PropsKeys; import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil; import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization; import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role; import com.liferay.portal.model.Role;
@ -52,8 +53,8 @@ public class ControlloPraticaAdvancedSearch {
private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaAdvancedSearch.class); private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaAdvancedSearch.class);
public static final String[] OVERRIDE_KEYWORDS = { "controlloPraticaId", "numeroProgetto", "tipoPratica", public static final String[] OVERRIDE_KEYWORDS = { "controlloPraticaId", "numeroProgetto", "tipoPratica",
"statoPratica", "dataRichiesta", "committente", "soggettiInteressati", "status", "statoPratica", "dataRichiesta", "committente", "soggettiInteressati", "status", "entryClassName",
"entryClassName", "userId", "descIntervento" }; "userId", "descIntervento" };
public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd"); public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
@ -73,13 +74,11 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setStart(start); searchContext.setStart(start);
searchContext.setEnd(end); searchContext.setEnd(end);
} }
// Gestione Ordinamento // Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
// Condizioni necessarie per questa ricerca : // Condizioni necessarie per questa ricerca : entryClassName=ControlloPratica & userId=taskAssigneeUserId
// entryClassName=ControlloPratica & userId=taskAssigneeUserId
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName", TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName()); ControlloPratica.class.getName());
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId", TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
@ -91,9 +90,7 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
// Ricavo i groupId relativi all utente che effettua la ricerca per
// filtrare
long ufficio = ParamUtil.getLong(request, "ufficio"); long ufficio = ParamUtil.getLong(request, "ufficio");
if (ufficio != 0 && ufficio != -1) { if (ufficio != 0 && ufficio != -1) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio); TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
@ -114,7 +111,6 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} }
} }
// Condizioni aggiuntive // Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext); retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
@ -127,7 +123,6 @@ public class ControlloPraticaAdvancedSearch {
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
return hits; return hits;
} }
@ -144,14 +139,11 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setStart(start); searchContext.setStart(start);
searchContext.setEnd(end); searchContext.setEnd(end);
} }
// Gestione Ordinamento // Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
// Condizioni necessarie per questa ricerca : // Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds tra i taskAssigneeIds
// entryClassName=ControlloPratica & roleIds tra i taskAssigneeIds
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName", TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName()); ControlloPratica.class.getName());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status", TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
@ -161,32 +153,26 @@ public class ControlloPraticaAdvancedSearch {
.getUserId()); .getUserId());
List<Role> organizationRoleList = null; List<Role> organizationRoleList = null;
for (Organization org : organizationUserList) { for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
org.getGroupId());
for (Role role : organizationRoleList) { for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", ("R"
("R" + role.getRoleId() + "G" + org.getGroupId())); + role.getRoleId() + "G" + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD); booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
} }
} }
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
if (organizationUserList != null && !organizationUserList.isEmpty() if (organizationUserList != null && !organizationUserList.isEmpty() && organizationRoleList != null
&& organizationRoleList != null && !organizationRoleList.isEmpty()) { && !organizationRoleList.isEmpty()) {
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST); booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST);
} else { } else {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", ("R" TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", "R0G0");
+ 0 + "G" + 0));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD); booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST); booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST);
} }
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
// Ricavo i groupId relativi all utente che effettua la ricerca per
// filtrare
long ufficio = ParamUtil.getLong(request, "ufficio"); long ufficio = ParamUtil.getLong(request, "ufficio");
if (ufficio != 0 && ufficio != -1) { if (ufficio != 0 && ufficio != -1) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio); TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
@ -207,33 +193,24 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} }
} }
List<Integer> uos = UnitaOperativeUtil.getUnitaOperative(user); List<Integer> uos = UnitaOperativeUtil.getUnitaOperative(user);
if ((uos.size() > 0) && !uos.contains(0)) { if ((uos.size() > 0) && !uos.contains(0)) {
BooleanQuery uoQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery uoQuery = BooleanQueryFactoryUtil.create(searchContext);
for (int uo : uos) { for (int uo : uos) {
TermQuery tq = TermQueryFactoryUtil.create(searchContext, TermQuery tq = TermQueryFactoryUtil.create(searchContext, PortosIndexField.UNITA_OPERATIVA, uo);
PortosIndexField.UNITA_OPERATIVA, uo);
uoQuery.add(tq, BooleanClauseOccur.SHOULD); uoQuery.add(tq, BooleanClauseOccur.SHOULD);
} }
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST); booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
} }
// Condizioni aggiuntive // Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext); retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString()); _log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
} }
hits = SearchEngineUtil.search(searchContext, booleanQuery); hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength()); _log.debug("Number of hint find : " + hits.getLength());
} }
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -254,51 +231,39 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setStart(start); searchContext.setStart(start);
searchContext.setEnd(end); searchContext.setEnd(end);
} }
// Gestione Ordinamento // Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
// Condizioni necessarie per questa ricerca : // Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds non e tra i
// entryClassName=ControlloPratica & // taskAssigneeIds userId non e tra taskAssigneeId
// roleIds non e tra i taskAssigneeIds
// userId non e tra taskAssigneeId
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName", TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName()); ControlloPratica.class.getName());
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId", TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
user.getUserId()); user.getUserId());
BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId()); .getUserId());
List<Role> organizationRoleList = null; List<Role> organizationRoleList = null;
for (Organization org : organizationUserList) { for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
org.getGroupId());
for (Role role : organizationRoleList) { for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds",
(role.getRoleId() + "-" + org.getGroupId())); (role.getRoleId() + StringPool.DASH + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD); booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
} }
} }
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status", TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING); WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
if (organizationUserList != null && !organizationUserList.isEmpty() && organizationRoleList != null
if (organizationUserList != null && !organizationUserList.isEmpty() && !organizationRoleList.isEmpty()) {
&& organizationRoleList != null && !organizationRoleList.isEmpty()) {
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST_NOT); booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST_NOT);
} }
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST_NOT); booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST_NOT);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
// Ricavo i groupId relativi all utente che effettua la ricerca per
// filtrare
long ufficio = ParamUtil.getLong(request, "ufficio"); long ufficio = ParamUtil.getLong(request, "ufficio");
if (ufficio != 0 && ufficio != -1) { if (ufficio != 0 && ufficio != -1) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio); TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
@ -321,7 +286,6 @@ public class ControlloPraticaAdvancedSearch {
} }
// Condizioni aggiuntive // Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext); retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString()); _log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
} }
@ -335,8 +299,8 @@ public class ControlloPraticaAdvancedSearch {
return hits; return hits;
} }
public static List<ControlloPratica> searchTaskPerEsportazioneDirigente(HttpServletRequest request, public static List<ControlloPratica> searchTaskPerEsportazioneDirigente(HttpServletRequest request, User user,
User user, int start, int end) { int start, int end) {
List<ControlloPratica> lista = new ArrayList<ControlloPratica>(); List<ControlloPratica> lista = new ArrayList<ControlloPratica>();
SearchContext searchContext = SearchContextFactory.getInstance(request); SearchContext searchContext = SearchContextFactory.getInstance(request);
@ -345,7 +309,6 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setStart(0); searchContext.setStart(0);
searchContext.setEnd(maxEnd); searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none"); searchContext.setAttribute("paginationType", "none");
// Gestione Ordinamento // Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
@ -357,7 +320,6 @@ public class ControlloPraticaAdvancedSearch {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio"); String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) { if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
@ -382,7 +344,6 @@ public class ControlloPraticaAdvancedSearch {
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("Number of hints found : " + hits.getLength()); _log.debug("Number of hints found : " + hits.getLength());
} }
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId"); String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) { if (Validator.isNotNull(controlloPraticaId)) {
@ -393,16 +354,15 @@ public class ControlloPraticaAdvancedSearch {
} }
} }
} }
} catch (ParseException | SearchException | SystemException | java.text.ParseException e) { } catch (ParseException | SearchException | SystemException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
return lista; return lista;
} }
public static List<ControlloPratica> searchTaskPerEsportazionePO(HttpServletRequest request, User user, public static List<ControlloPratica> searchTaskPerEsportazionePO(HttpServletRequest request, User user, int start,
int start, int end) { int end) {
List<ControlloPratica> lista = new ArrayList<ControlloPratica>(); List<ControlloPratica> lista = new ArrayList<ControlloPratica>();
SearchContext searchContext = SearchContextFactory.getInstance(request); SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString()); searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
@ -414,7 +374,6 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName", TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName()); ControlloPratica.class.getName());
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId", TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
@ -425,7 +384,6 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio"); String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) { if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
@ -467,6 +425,7 @@ public class ControlloPraticaAdvancedSearch {
} }
public static Hits searchTaskConclusi(HttpServletRequest request, User user, int start, int end) { public static Hits searchTaskConclusi(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request); SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString()); searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
if (ParamUtil.getBoolean(request, "searchForExport", false)) { if (ParamUtil.getBoolean(request, "searchForExport", false)) {
@ -479,29 +438,23 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setStart(start); searchContext.setStart(start);
searchContext.setEnd(end); searchContext.setEnd(end);
} }
// Gestione Ordinamento // Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request)); searchContext.setSorts(getOrderedQuery(request));
Hits hits = null; Hits hits = null;
try { try {
// Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds non e tra i
// Condizioni necessarie per questa ricerca : // taskAssigneeIds userId non e tra taskAssigneeId
// entryClassName=ControlloPratica &
// roleIds non e tra i taskAssigneeIds
// userId non e tra taskAssigneeId
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName", TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName()); ControlloPratica.class.getName());
BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId()); .getUserId());
List<Role> organizationRoleList = null; List<Role> organizationRoleList = null;
for (Organization org : organizationUserList) { for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
org.getGroupId());
for (Role role : organizationRoleList) { for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds",
(role.getRoleId() + "-" + org.getGroupId())); (role.getRoleId() + StringPool.DASH + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD); booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
} }
} }
@ -517,17 +470,13 @@ public class ControlloPraticaAdvancedSearch {
booleanQueryStatus.add(statusIncomplete, BooleanClauseOccur.SHOULD); booleanQueryStatus.add(statusIncomplete, BooleanClauseOccur.SHOULD);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
if (organizationUserList != null && !organizationUserList.isEmpty() if (organizationUserList != null && !organizationUserList.isEmpty() && organizationRoleList != null
&& organizationRoleList != null && !organizationRoleList.isEmpty()) { && !organizationRoleList.isEmpty()) {
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST_NOT); booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST_NOT);
} }
booleanQuery.add(booleanQueryStatus, BooleanClauseOccur.MUST); booleanQuery.add(booleanQueryStatus, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
// Ricavo i groupId relativi all utente che effettua la ricerca per List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
// filtrare
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext); BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) { if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) { for (Organization org : organizationList) {
@ -540,10 +489,8 @@ public class ControlloPraticaAdvancedSearch {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L); TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} }
// Condizioni aggiuntive // Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext); retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString()); _log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
} }
@ -554,7 +501,6 @@ public class ControlloPraticaAdvancedSearch {
} catch (ParseException | SearchException | SystemException e) { } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
return hits; return hits;
} }
@ -568,119 +514,108 @@ public class ControlloPraticaAdvancedSearch {
String statoPraticaSearch = ParamUtil.getString(request, "statoPratica"); String statoPraticaSearch = ParamUtil.getString(request, "statoPratica");
String committenteSearch = ParamUtil.getString(request, "committente"); String committenteSearch = ParamUtil.getString(request, "committente");
String soggettiInterconnessiSearch = ParamUtil.getString(request, "soggettiInterconnessi"); String soggettiInterconnessiSearch = ParamUtil.getString(request, "soggettiInterconnessi");
// ADT ADT BUG BO ID = 8
String istruttoreId = ParamUtil.getString(request, "istruttore"); String istruttoreId = ParamUtil.getString(request, "istruttore");
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio"); String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
String comune = ParamUtil.getString(request, "comune"); String comune = ParamUtil.getString(request, "comune");
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura"); String tipoProcedura = ParamUtil.getString(request, "tipoProcedura");
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita"); String tipoAttivita = ParamUtil.getString(request, "tipoAttivita");
// ADT - BUG-11 Aggiunta filtro ricerca // ADT - BUG-11 Aggiunta filtro ricerca
String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio"); String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio");
try { try {
if (tipoAttivita != null && !tipoAttivita.equals("") && !tipoAttivita.equals("-1")) { if (Validator.isNotNull(tipoAttivita) && !tipoAttivita.equals("-1")) {
TermQuery tipoAttivitaTermQuery = TermQueryFactoryUtil.create(searchContext, "workflowState", TermQuery tipoAttivitaTermQuery = TermQueryFactoryUtil.create(searchContext, "workflowState",
tipoAttivita); tipoAttivita);
booleanQuery.add(tipoAttivitaTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(tipoAttivitaTermQuery, BooleanClauseOccur.MUST);
} }
if (numeroProgettoSearch != null && !numeroProgettoSearch.equals("")) { if (Validator.isNotNull(numeroProgettoSearch)) {
TermQuery numeroProgettoTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery numeroProgettoTermQuery = TermQueryFactoryUtil.create(searchContext, "numeroProgetto",
"numeroProgetto", numeroProgettoSearch); numeroProgettoSearch);
booleanQuery.add(numeroProgettoTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(numeroProgettoTermQuery, BooleanClauseOccur.MUST);
} }
if (protocolloSearch != null && !protocolloSearch.equals("")) { if (Validator.isNotNull(protocolloSearch)) {
TermQuery protocolloSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery protocolloSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "protocollo",
"protocollo", protocolloSearch); protocolloSearch);
booleanQuery.add(protocolloSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(protocolloSearchTermQuery, BooleanClauseOccur.MUST);
} }
if (tipoPraticaSearch != null && !tipoPraticaSearch.equals("") && !tipoPraticaSearch.equals("-1")) { if (Validator.isNotNull(tipoPraticaSearch) && !tipoPraticaSearch.equals("-1")) {
TermQuery tipoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery tipoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "tipoPratica",
"tipoPratica", tipoPraticaSearch); tipoPraticaSearch);
booleanQuery.add(tipoPraticaSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(tipoPraticaSearchTermQuery, BooleanClauseOccur.MUST);
} }
// Gestione StatoPratica // Gestione StatoPratica
if (statoPraticaSearch != null && !statoPraticaSearch.equals("") if (Validator.isNotNull(statoPraticaSearch) && !statoPraticaSearch.equals("-1")) {
&& !statoPraticaSearch.equals("-1")) {
if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO_PARZIALE)) { if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO_PARZIALE)) {
TermQuery collaudoParzialeSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery collaudoParzialeSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"collaudoParziale", "true"); "collaudoParziale", StringPool.TRUE);
booleanQuery.add(collaudoParzialeSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(collaudoParzialeSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO)) { } else if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO)) {
TermQuery collaudoSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery collaudoSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"collaudoCompletato", "true"); "collaudoCompletato", StringPool.TRUE);
booleanQuery.add(collaudoSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(collaudoSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI)) { } else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI)) {
TermQuery fineLavoriSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery fineLavoriSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"fineLavoriCompletati", "true"); "fineLavoriCompletati", StringPool.TRUE);
booleanQuery.add(fineLavoriSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(fineLavoriSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI_PARZIALE)) { } else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI_PARZIALE)) {
TermQuery fineLavoriParzialiSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery fineLavoriParzialiSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"fineLavoriParziali", "true"); "fineLavoriParziali", StringPool.TRUE);
booleanQuery.add(fineLavoriParzialiSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(fineLavoriParzialiSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE)) { } else if (statoPraticaSearch.equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE)) {
TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"sottopostoAParere", "true"); "sottopostoAParere", StringPool.TRUE);
booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.VARIATA)) { } else if (statoPraticaSearch.equals(StatoPraticaConstants.VARIATA)) {
TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "variata",
"variata", "true"); StringPool.TRUE);
booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST);
} else { } else {
TermQuery statoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery statoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "statoPratica",
"statoPratica", statoPraticaSearch); statoPraticaSearch);
booleanQuery.add(statoPraticaSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(statoPraticaSearchTermQuery, BooleanClauseOccur.MUST);
} }
} }
if (committenteSearch != null && !committenteSearch.equals("")) { if (Validator.isNotNull(committenteSearch)) {
TermQuery committenteSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery committenteSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "committenti",
"committenti", committenteSearch.toUpperCase()); committenteSearch.toUpperCase());
booleanQuery.add(committenteSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(committenteSearchTermQuery, BooleanClauseOccur.MUST);
} }
if (soggettiInterconnessiSearch != null && !soggettiInterconnessiSearch.equals("")) { if (Validator.isNotNull(soggettiInterconnessiSearch)) {
TermQuery soggettiInterconnessiSearchTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery soggettiInterconnessiSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"soggettiInterconnessi", soggettiInterconnessiSearch.toUpperCase()); "soggettiInterconnessi", soggettiInterconnessiSearch.toUpperCase());
booleanQuery.add(soggettiInterconnessiSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(soggettiInterconnessiSearchTermQuery, BooleanClauseOccur.MUST);
} }
if (istruttoreId != null && !istruttoreId.equals("") && !istruttoreId.equals("-1")) { if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1")) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId",
istruttoreId); istruttoreId);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} }
if ((dataDa != null && !dataDa.equals("")) && (dataAl != null && !dataAl.equals(""))) { if (Validator.isNotNull(dataDa) && Validator.isNotNull(dataAl)) {
Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa); Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa);
Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl); Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp), "dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
DATE_FORMAT_LUCENE.format(dataAlApp), true, true); DATE_FORMAT_LUCENE.format(dataAlApp), true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST); booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
} } else if (Validator.isNull(dataDa) && Validator.isNotNull(dataAl)) {
if ((dataDa == null || dataDa.equals("")) && (dataAl != null && !dataDa.equals(""))) {
Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl); Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", "00000000", DATE_FORMAT_LUCENE.format(dataAlApp), true, "dataInizioProcedimento", "00000000", DATE_FORMAT_LUCENE.format(dataAlApp), true, true);
true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST); booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
} } else if (Validator.isNotNull(dataDa) && Validator.isNull(dataAl)) {
if ((dataDa != null && !dataDa.equals("")) && (dataAl == null || dataAl.equals(""))) {
Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa); Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp), "dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
DATE_FORMAT_LUCENE.format(new Date()), true, true); DATE_FORMAT_LUCENE.format(new Date()), true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST); booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
} }
if (comune != null && !comune.equals("") && !comune.equals("-1")) { if (Validator.isNotNull(comune) && !comune.equals("-1")) {
TermQuery comuneTermQuery = TermQueryFactoryUtil.create(searchContext, "comuneId", comune); TermQuery comuneTermQuery = TermQueryFactoryUtil.create(searchContext, "comuneId", comune);
booleanQuery.add(comuneTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(comuneTermQuery, BooleanClauseOccur.MUST);
} }
if (Validator.isNotNull(tipoProcedura)) { if (Validator.isNotNull(tipoProcedura)) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, "tipoProcedura", TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, "tipoProcedura", tipoProcedura);
tipoProcedura);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
} }
// ADT - BUG-11 Aggiunta filtro ricerca // ADT - BUG-11 Aggiunta filtro ricerca
@ -700,7 +635,7 @@ public class ControlloPraticaAdvancedSearch {
String orderType = ParamUtil.getString(request, "ordinaTipo", "desc"); String orderType = ParamUtil.getString(request, "ordinaTipo", "desc");
List<Sort> sortes = new ArrayList<Sort>(); List<Sort> sortes = new ArrayList<Sort>();
Sort sort = new Sort(); Sort sort = new Sort();
if (orderField != null && !orderField.equals("") && !orderField.equals("-1")) { if (Validator.isNotNull(orderField) && !orderField.equals("-1")) {
if (properties.size() > 0) { if (properties.size() > 0) {
sort.setFieldName(orderField + "_sortable"); sort.setFieldName(orderField + "_sortable");
} else { } else {
@ -714,7 +649,7 @@ public class ControlloPraticaAdvancedSearch {
sort.setType(Sort.LONG_TYPE); sort.setType(Sort.LONG_TYPE);
} }
} }
if (orderType != null && !orderType.equals("") && !orderType.equals("-1")) { if (Validator.isNotNull(orderType) && !orderType.equals("-1")) {
if (orderType.equals("asc")) { if (orderType.equals("asc")) {
sort.setReverse(false); sort.setReverse(false);
} else { } else {

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalService.java

@ -556,17 +556,11 @@ public interface IntPraticaLocalService extends BaseLocalService,
long territorioId) long territorioId)
throws com.liferay.portal.kernel.exception.SystemException; throws com.liferay.portal.kernel.exception.SystemException;
/**
* ADT: report tempistiche istruttorie
*/
public java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni( public java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni(
java.util.Date dtMin, java.util.Date dtMax, long groupId, java.util.Date dtMin, java.util.Date dtMax, long groupId,
java.lang.String type) java.lang.String type)
throws com.liferay.portal.kernel.exception.SystemException; throws com.liferay.portal.kernel.exception.SystemException;
/**
* ADT: report pratiche vidimate
*/
public java.util.List<java.lang.Object[]> reportPraticheVidimate( public java.util.List<java.lang.Object[]> reportPraticheVidimate(
java.util.Date dtMin, java.util.Date dtMax, long groupId, java.util.Date dtMin, java.util.Date dtMax, long groupId,
java.lang.String type) java.lang.String type)

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceUtil.java

@ -699,9 +699,6 @@ public class IntPraticaLocalServiceUtil {
return getService().findByTerritorioId(territorioId); return getService().findByTerritorioId(territorioId);
} }
/**
* ADT: report tempistiche istruttorie
*/
public static java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni( public static java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni(
java.util.Date dtMin, java.util.Date dtMax, long groupId, java.util.Date dtMin, java.util.Date dtMax, long groupId,
java.lang.String type) java.lang.String type)
@ -711,9 +708,6 @@ public class IntPraticaLocalServiceUtil {
dtMax, groupId, type); dtMax, groupId, type);
} }
/**
* ADT: report pratiche vidimate
*/
public static java.util.List<java.lang.Object[]> reportPraticheVidimate( public static java.util.List<java.lang.Object[]> reportPraticheVidimate(
java.util.Date dtMin, java.util.Date dtMax, long groupId, java.util.Date dtMin, java.util.Date dtMax, long groupId,
java.lang.String type) java.lang.String type)

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceWrapper.java

@ -768,9 +768,6 @@ public class IntPraticaLocalServiceWrapper implements IntPraticaLocalService,
return _intPraticaLocalService.findByTerritorioId(territorioId); return _intPraticaLocalService.findByTerritorioId(territorioId);
} }
/**
* ADT: report tempistiche istruttorie
*/
@Override @Override
public java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni( public java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni(
java.util.Date dtMin, java.util.Date dtMax, long groupId, java.util.Date dtMin, java.util.Date dtMax, long groupId,
@ -780,9 +777,6 @@ public class IntPraticaLocalServiceWrapper implements IntPraticaLocalService,
dtMax, groupId, type); dtMax, groupId, type);
} }
/**
* ADT: report pratiche vidimate
*/
@Override @Override
public java.util.List<java.lang.Object[]> reportPraticheVidimate( public java.util.List<java.lang.Object[]> reportPraticheVidimate(
java.util.Date dtMin, java.util.Date dtMax, long groupId, java.util.Date dtMin, java.util.Date dtMax, long groupId,

60
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PraticaUtil.java

@ -1,6 +1,8 @@
package it.tref.liferay.portos.bo.util; package it.tref.liferay.portos.bo.util;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.Constants;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import java.util.ArrayList; import java.util.ArrayList;
@ -12,6 +14,8 @@ import org.apache.commons.lang.StringUtils;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
@ -122,7 +126,8 @@ public class PraticaUtil {
add("pagNuovaCostruzione"); add("pagNuovaCostruzione");
add("pagVarianti"); add("pagVarianti");
add("pagAltro"); add("pagAltro");
}}; }
};
public static List<String> getDettPraticaHiddenFields() { public static List<String> getDettPraticaHiddenFields() {
@ -132,21 +137,42 @@ public class PraticaUtil {
public static String getStatoPraticaLabel(String statoPratica, long intPraticaId) throws PortalException, public static String getStatoPraticaLabel(String statoPratica, long intPraticaId) throws PortalException,
SystemException { SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
return getStatoPraticaLabel(statoPratica, intPratica.getTipoProcedura());
}
public static String getStatoPratica(String statoPratica, long intPraticaId) throws PortalException,
SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
return getStatoPratica(statoPratica, intPratica.getTipoProcedura());
}
public static String getStatoPratica(String statoPratica, String tipoProcedura) throws PortalException,
SystemException {
return LanguageUtil.get(LocaleUtil.getDefault(), getStatoPraticaLabel(statoPratica, tipoProcedura));
}
public static String getStatoPraticaLabel(String statoPratica, String tipoProcedura) throws PortalException,
SystemException {
if (Constants.PROCEDURA_P3.equalsIgnoreCase(tipoProcedura)) {
switch (statoPratica) {
case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.CONFORME:
return StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.VIARCH_APERTO);
case StatoPraticaConstants.NON_AUTORIZZATA:
case StatoPraticaConstants.NON_CONFORME:
return StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.VIARCH_CHIUSO);
}
}
String statoPraticaLabel = StringPool.BLANK; String statoPraticaLabel = StringPool.BLANK;
switch (statoPratica) { switch (statoPratica) {
case StatoPraticaConstants.CONFORME: case StatoPraticaConstants.CONFORME:
if (AzioniPraticheUtil.isDeposito(intPraticaId)) {
statoPraticaLabel = StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.CONFORME);
} else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) {
statoPraticaLabel = StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.AUTORIZZATA); statoPraticaLabel = StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.AUTORIZZATA);
}
break; break;
case StatoPraticaConstants.NON_CONFORME: case StatoPraticaConstants.NON_CONFORME:
if (AzioniPraticheUtil.isDeposito(intPraticaId)) {
statoPraticaLabel = StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.NON_CONFORME);
} else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) {
statoPraticaLabel = StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.NON_AUTORIZZATA); statoPraticaLabel = StatoPraticaConstants.getStatusLabel(StatoPraticaConstants.NON_AUTORIZZATA);
}
break; break;
default: default:
statoPraticaLabel = StatoPraticaConstants.getStatusLabel(statoPratica); statoPraticaLabel = StatoPraticaConstants.getStatusLabel(statoPratica);
@ -158,9 +184,25 @@ public class PraticaUtil {
return statoPraticaLabel; return statoPraticaLabel;
} }
public static String getStatoPraticaCode(String statoPratica, long intPraticaId) throws PortalException,
SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
return getStatoPraticaCode(statoPratica, intPratica);
}
public static String getStatoPraticaCode(String statoPratica, IntPratica intPratica) throws PortalException, public static String getStatoPraticaCode(String statoPratica, IntPratica intPratica) throws PortalException,
SystemException { SystemException {
if (Constants.PROCEDURA_P3.equals(intPratica.getTipoProcedura())) {
switch (intPratica.getStatoPratica()) {
case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.CONFORME:
return StatoPraticaConstants.VIARCH_APERTO;
case StatoPraticaConstants.NON_AUTORIZZATA:
case StatoPraticaConstants.NON_CONFORME:
return StatoPraticaConstants.VIARCH_CHIUSO;
}
}
String statoPraticaCode = StringPool.BLANK; String statoPraticaCode = StringPool.BLANK;
switch (statoPratica) { switch (statoPratica) {
case StatoPraticaConstants.CONFORME: case StatoPraticaConstants.CONFORME:

10
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java

@ -217,7 +217,7 @@ public class WorkflowUtil {
public static boolean isWorkflowAttivabileByTipoIntegrazione(DettPratica dettPratica) throws PortalException, public static boolean isWorkflowAttivabileByTipoIntegrazione(DettPratica dettPratica) throws PortalException,
SystemException { SystemException {
if (dettPratica.getTipoIntegrazione() == null || dettPratica.getTipoIntegrazione().equals("")) { if (Validator.isNull(dettPratica.getTipoIntegrazione())) {
return true; return true;
} else { } else {
return !TipoIntegrazioneUtil.isOutOfWorkflow(dettPratica.getTipoIntegrazione()); return !TipoIntegrazioneUtil.isOutOfWorkflow(dettPratica.getTipoIntegrazione());
@ -257,7 +257,7 @@ public class WorkflowUtil {
WorkflowTask workflowTask = getLastTask(companyId, groupId, null, controlloPratica); WorkflowTask workflowTask = getLastTask(companyId, groupId, null, controlloPratica);
Map<String, Serializable> workflowContext = getWorkflowContext(controlloPratica); Map<String, Serializable> workflowContext = getWorkflowContext(controlloPratica);
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, assegnatoreUserId, WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, assegnatoreUserId,
workflowTask.getWorkflowTaskId(), istruttoreId, "", null, workflowContext); workflowTask.getWorkflowTaskId(), istruttoreId, StringPool.BLANK, null, workflowContext);
} }
public static Map<String, Serializable> getWorkflowContext(ControlloPratica controlloPratica) public static Map<String, Serializable> getWorkflowContext(ControlloPratica controlloPratica)
@ -291,12 +291,10 @@ public class WorkflowUtil {
switch (value) { switch (value) {
case StatoPraticaConstants.AUTORIZZATA: case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.CONFORME: case StatoPraticaConstants.CONFORME:
value = StatoPraticaConstants.VIARCH_APERTO; return "stato-pratica-" + StatoPraticaConstants.VIARCH_APERTO;
break;
case StatoPraticaConstants.NON_AUTORIZZATA: case StatoPraticaConstants.NON_AUTORIZZATA:
case StatoPraticaConstants.NON_CONFORME: case StatoPraticaConstants.NON_CONFORME:
value = StatoPraticaConstants.VIARCH_CHIUSO; return "stato-pratica-" + StatoPraticaConstants.VIARCH_CHIUSO;
break;
} }
} else if (intPratica.getTipoPratica().equals(Constants.TIPO_PRATICA_AUTORIZZAZIONE)) { } else if (intPratica.getTipoPratica().equals(Constants.TIPO_PRATICA_AUTORIZZAZIONE)) {
if (value.equals(StatoPraticaConstants.CONFORME)) if (value.equals(StatoPraticaConstants.CONFORME))

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties

@ -1076,6 +1076,8 @@ label.admingeniocivile.statopratica.assegnata = Assegnata
label.admingeniocivile.statopratica.attesafirma = Attesa di Firma label.admingeniocivile.statopratica.attesafirma = Attesa di Firma
label.admingeniocivile.statopratica.approvazione = Approvazione label.admingeniocivile.statopratica.approvazione = Approvazione
label.admingeniocivile.statopratica.variante = Variante label.admingeniocivile.statopratica.variante = Variante
label.admingeniocivile.statopratica.viarch1 = VIArch aperto
label.admingeniocivile.statopratica.viarch2 = VIArch chiuso
label.firma-doc = Dichiaro di aver preso visione del documento, e di sottoscriverne il contenuto ai sensi del D.Lgs. 82/2005 label.firma-doc = Dichiaro di aver preso visione del documento, e di sottoscriverne il contenuto ai sensi del D.Lgs. 82/2005
label.cambio-soggetti-ok = Cambio Soggetti #{0} completato con successo label.cambio-soggetti-ok = Cambio Soggetti #{0} completato con successo

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/scheduler/SchedulerWorkflow.java

@ -46,8 +46,9 @@ public class SchedulerWorkflow implements MessageListener {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} } finally {
lock.unlock(); lock.unlock();
} }
} }
} }
}

15
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java

@ -253,10 +253,12 @@ public class ManutenzioneDatabase {
} catch (PortalException e) { } catch (PortalException e) {
} }
if ((0 != destinazione) && (destinazione != pratica.getUnitaOperativa())) { if ((0 != destinazione) && (destinazione != pratica.getUnitaOperativa())) {
esitoLog(esito, esitoLog(
"Pratica " + pratica.getNumeroProgetto() + "/" + pratica.getIntPraticaId() esito,
+ ", " + pratica.getUnitaOperativa() + " -> " + destinazione + " (" "Pratica " + pratica.getNumeroProgetto() + StringPool.SLASH
+ userId + ")"); + pratica.getIntPraticaId() + StringPool.COMMA_AND_SPACE
+ pratica.getUnitaOperativa() + " -> " + destinazione + " ("
+ userId + StringPool.CLOSE_PARENTHESIS);
pratica.setUnitaOperativa(destinazione); pratica.setUnitaOperativa(destinazione);
IntPraticaLocalServiceUtil.updateIntPratica(pratica); IntPraticaLocalServiceUtil.updateIntPratica(pratica);
} }
@ -435,7 +437,8 @@ public class ManutenzioneDatabase {
} }
break; break;
default: default:
_log.info("Tipo sconosciuto " + tipo + " (" + fileEntry.getTitle() + ")"); _log.info("Tipo sconosciuto " + tipo + " (" + fileEntry.getTitle()
+ StringPool.CLOSE_PARENTHESIS);
break; break;
} }
} else { } else {
@ -1157,7 +1160,7 @@ public class ManutenzioneDatabase {
WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK); WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK);
} }
} else { } else {
if (className.contains(".")) { if (className.contains(StringPool.PERIOD)) {
switch (className) { switch (className) {
case "com.liferay.portlet.blogs": case "com.liferay.portlet.blogs":
case "com.liferay.portlet.documentlibrary": case "com.liferay.portlet.documentlibrary":

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java

@ -618,10 +618,11 @@ public class SismicaUtil {
esito.add(intPratica.getNumeroProgetto() + " aggiunto ControlloPratica " esito.add(intPratica.getNumeroProgetto() + " aggiunto ControlloPratica "
+ controllo.getControlloPraticaId()); + controllo.getControlloPraticaId());
} }
AvvisoLocalServiceUtil.addAvviso(intPraticaId, "", avviso.getDtAvviso(), AvvisoLocalServiceUtil.addAvviso(intPraticaId, StringPool.BLANK,
AvvisoUtil.TIPO_AVVISO_DIRETTO, avviso.getTipoDocumento(), templateId, avviso.getDtAvviso(), AvvisoUtil.TIPO_AVVISO_DIRETTO,
controllo.getDettPraticaId(), DettPratica.class.getName(), avviso.getTipoDocumento(), templateId, controllo.getDettPraticaId(),
controllo.getControlloPraticaId(), serviceContext); DettPratica.class.getName(), controllo.getControlloPraticaId(),
serviceContext);
} catch (Exception e) { } catch (Exception e) {
esito.add("Errore durante l'invio: " + e.getMessage()); esito.add("Errore durante l'invio: " + e.getMessage());
} }

11
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java

@ -105,11 +105,12 @@ public class IntPraticaIndexer extends BaseIndexer {
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("Indicizzo la pratica " _log.debug("Indicizzo la pratica "
+ (Validator.isNull(intPratica.getNumeroProgetto()) ? StringPool.BLANK : intPratica + (Validator.isNull(intPratica.getNumeroProgetto()) ? StringPool.BLANK : intPratica
.getNumeroProgetto() + ", ") + "id " + intPratica.getIntPraticaId()); .getNumeroProgetto() + StringPool.COMMA_AND_SPACE) + "id "
+ intPratica.getIntPraticaId());
} }
document = getBaseModelDocument(PORTLET_ID, intPratica); document = getBaseModelDocument(PORTLET_ID, intPratica);
document.addKeyword("entryClassName", IntPratica.class.getName()); document.addKeyword("entryClassName", IntPratica.class.getName());
// Prendo l ultimo DettPratica legato a IntPratica // Prendo l'ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica = DettPraticaLocalServiceUtil DettPratica lastDettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaFromDB.getIntPraticaId()); .getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaFromDB.getIntPraticaId());
if (Validator.isNull(lastDettPratica)) { if (Validator.isNull(lastDettPratica)) {
@ -252,9 +253,9 @@ public class IntPraticaIndexer extends BaseIndexer {
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId( List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
intPratica.getIntPraticaId(), 0, 1); intPratica.getIntPraticaId(), 0, 1);
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) { if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "true"); document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.TRUE);
} else { } else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "false"); document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.FALSE);
} }
// Gestione pratica sospesa // Gestione pratica sospesa
document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa()); document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa());
@ -262,7 +263,7 @@ public class IntPraticaIndexer extends BaseIndexer {
document.addKeyword(Field.USER_ID, intPraticaFromDB.getUserId()); document.addKeyword(Field.USER_ID, intPraticaFromDB.getUserId());
// ALTRI PROGETTI // ALTRI PROGETTI
if (Validator.isNotNull(committenti) && committenti.size() > 0) { if (Validator.isNotNull(committenti) && committenti.size() > 0) {
// Creao una stringa contenente tutti i codFisc legati alla IntPratica separati da , // Creo una stringa contenente tutti i codFisc legati alla IntPratica separati da ,
List<String> listaSoggetti = new ArrayList<String>(); List<String> listaSoggetti = new ArrayList<String>();
for (Soggetto soggetto : committenti) { for (Soggetto soggetto : committenti) {
if (Validator.isNotNull(soggetto.getCognome())) { if (Validator.isNotNull(soggetto.getCognome())) {

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/DocPraticaModelListener.java

@ -22,7 +22,7 @@ public class DocPraticaModelListener extends BaseModelListener<DocPratica> {
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class); Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId()); indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId()); _log.debug("DocPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
} }
} catch (SearchException e) { } catch (SearchException e) {
_log.error(e, e); _log.error(e, e);

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/SoggettoModelListener.java

@ -22,7 +22,7 @@ public class SoggettoModelListener extends BaseModelListener<Soggetto> {
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class); Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId()); indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId()); _log.debug("SoggettoModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
} }
} catch (SearchException e) { } catch (SearchException e) {
_log.error(e, e); _log.error(e, e);

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

@ -529,7 +529,7 @@ public class FascicoloPortlet extends MVCPortlet {
.append(LanguageUtil.get( .append(LanguageUtil.get(
locale, locale,
PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(),
intPratica.getIntPraticaId()))).append(StringPool.SEMICOLON); intPratica.getTipoProcedura()))).append(StringPool.SEMICOLON);
if (Validator.isNotNull(provincia)) { if (Validator.isNotNull(provincia)) {
sb.append(provincia.getProvincia()); sb.append(provincia.getProvincia());
} }

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

@ -121,7 +121,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
actionResponse.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]); actionResponse.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]);
} }
if (Validator.isNotNull(dataRichiestaFine)) { if (Validator.isNotNull(dataRichiestaFine)) {
String[] dataRichiestaFineSplitted = dataRichiestaFine.split("/"); String[] dataRichiestaFineSplitted = dataRichiestaFine.split(StringPool.FORWARD_SLASH);
actionResponse.setRenderParameter("dataRichiestaFineDay", dataRichiestaFineSplitted[0]); actionResponse.setRenderParameter("dataRichiestaFineDay", dataRichiestaFineSplitted[0]);
int month = Integer.valueOf(dataRichiestaFineSplitted[1]) - 1; int month = Integer.valueOf(dataRichiestaFineSplitted[1]) - 1;
actionResponse.setRenderParameter("dataRichiestaFineMonth", String.valueOf(month)); actionResponse.setRenderParameter("dataRichiestaFineMonth", String.valueOf(month));
@ -257,7 +257,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale(); Locale locale = themeDisplay.getLocale();
User user = themeDisplay.getUser(); User user = themeDisplay.getUser();
String cmd = ParamUtil.getString(resourceRequest, "cmd"); String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);
String id = resourceRequest.getResourceID(); String id = resourceRequest.getResourceID();
String csv = StringPool.BLANK; String csv = StringPool.BLANK;
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest);
@ -393,7 +393,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
User userTask = UserLocalServiceUtil.fetchUser(task.getAssigneeUserId()); User userTask = UserLocalServiceUtil.fetchUser(task.getAssigneeUserId());
taskName = LanguageUtil.get(getPortletConfig(), locale, task.getName()); taskName = LanguageUtil.get(getPortletConfig(), locale, task.getName());
if (userTask != null) { if (userTask != null) {
taskName += " (" + userTask.getFullName() + ")"; taskName += " (" + userTask.getFullName() + StringPool.CLOSE_PARENTHESIS;
} }
} else { } else {
taskName = LanguageUtil.get(getPortletConfig(), locale, workflowInstance.getState()); taskName = LanguageUtil.get(getPortletConfig(), locale, workflowInstance.getState());

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

@ -1,10 +1,9 @@
package it.tref.liferay.portos.bo.portlet; package it.tref.liferay.portos.bo.portlet;
import it.tref.liferay.portos.bo.shared.util.ParamUtil;
import javax.portlet.ActionRequest; import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse; import javax.portlet.ActionResponse;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;

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

@ -149,7 +149,7 @@ public class TempistichePortlet extends MVCPortlet {
Long dettPraticaId = 0L; Long dettPraticaId = 0L;
DynamicQuery query = DynamicQueryFactoryUtil.forClass(Tempistica.class); DynamicQuery query = DynamicQueryFactoryUtil.forClass(Tempistica.class);
query.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); query.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
query.add(RestrictionsFactoryUtil.eq("tipo", "P")); query.add(RestrictionsFactoryUtil.eq("tipo", TempisticaConstants.TIPO_PRATICA));
Order defaultOrderDettPrtatica = OrderFactoryUtil.desc("createDate"); Order defaultOrderDettPrtatica = OrderFactoryUtil.desc("createDate");
query.addOrder(defaultOrderDettPrtatica); query.addOrder(defaultOrderDettPrtatica);
List<Tempistica> lista = TempisticaLocalServiceUtil.dynamicQuery(query); List<Tempistica> lista = TempisticaLocalServiceUtil.dynamicQuery(query);
@ -280,7 +280,7 @@ public class TempistichePortlet extends MVCPortlet {
if (avvisi.size() > 0 && avvisi.get(0).getDtAvviso() != null) { if (avvisi.size() > 0 && avvisi.get(0).getDtAvviso() != null) {
sb.append(CSVUtil.encode(dateFormat.format(avvisi.get(0).getDtInvio()))); sb.append(CSVUtil.encode(dateFormat.format(avvisi.get(0).getDtInvio())));
} else { } else {
sb.append("-"); sb.append(StringPool.DASH);
} }
sb.append(StringPool.SEMICOLON) sb.append(StringPool.SEMICOLON)
.append(CSVUtil.encode(String.valueOf(TimeUnit.MILLISECONDS.toDays(calcoloTempo)))) .append(CSVUtil.encode(String.valueOf(TimeUnit.MILLISECONDS.toDays(calcoloTempo))))

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

@ -30,6 +30,7 @@ import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import it.tref.liferay.portos.bo.util.AvvisoUtil; import it.tref.liferay.portos.bo.util.AvvisoUtil;
import it.tref.liferay.portos.bo.util.AzioniPraticheUtil; import it.tref.liferay.portos.bo.util.AzioniPraticheUtil;
import it.tref.liferay.portos.bo.util.GestioneFirmeUtil; import it.tref.liferay.portos.bo.util.GestioneFirmeUtil;
import it.tref.liferay.portos.bo.util.PraticaUtil;
import it.tref.liferay.portos.bo.util.TempisticaConstants; import it.tref.liferay.portos.bo.util.TempisticaConstants;
import it.tref.liferay.portos.bo.util.WorkflowConstants; import it.tref.liferay.portos.bo.util.WorkflowConstants;
import it.tref.liferay.portos.bo.util.WorkflowUtil; import it.tref.liferay.portos.bo.util.WorkflowUtil;
@ -606,11 +607,8 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
FormLog formLog = listaKaleoLog.get(0); FormLog formLog = listaKaleoLog.get(0);
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters());
if (json.has("esito")) { if (json.has("esito")) {
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { tipoEsito = PraticaUtil.getStatoPratica(json.getString("esito"),
tipoEsito = StatoPraticaConstants.getEsitoDeposito(json.getString("esito")); controlloPratica.getIntPraticaId());
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) {
tipoEsito = StatoPraticaConstants.getEsitoAutorizzazione(json.getString("esito"));
}
} }
} }
} }

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaFinderImpl.java

@ -16,6 +16,7 @@ import com.liferay.portal.kernel.dao.orm.Type;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl; import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
import com.liferay.util.dao.orm.CustomSQLUtil; import com.liferay.util.dao.orm.CustomSQLUtil;
@ -90,7 +91,7 @@ public class IntPraticaFinderImpl extends BasePersistenceImpl<IntPratica> implem
qPos.add(dtMin); qPos.add(dtMin);
qPos.add(dtMax); qPos.add(dtMax);
qPos.add(groupId); qPos.add(groupId);
qPos.add(Validator.isNotNull(type) ? type : "%"); qPos.add(Validator.isNotNull(type) ? type : StringPool.PERCENT);
qPos.add(isControlloObbligatorio); qPos.add(isControlloObbligatorio);
List<Long> list = query.list(); List<Long> list = query.list();
countIntPraticaIds = (int) (list == null || list.isEmpty() ? 0 : list.get(0)); countIntPraticaIds = (int) (list == null || list.isEmpty() ? 0 : list.get(0));
@ -118,7 +119,7 @@ public class IntPraticaFinderImpl extends BasePersistenceImpl<IntPratica> implem
query.setCacheable(false); query.setCacheable(false);
query.addEntity("intp", IntPraticaImpl.class); query.addEntity("intp", IntPraticaImpl.class);
QueryPos qPos = QueryPos.getInstance(query); QueryPos qPos = QueryPos.getInstance(query);
qPos.add(Validator.isNotNull(type) ? type : "%"); qPos.add(Validator.isNotNull(type) ? type : StringPool.PERCENT);
qPos.add(isControlloObbligatorio); qPos.add(isControlloObbligatorio);
qPos.add(groupId); qPos.add(groupId);
qPos.add(dtMin); qPos.add(dtMin);

12
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaFinderImpl.java

@ -16,6 +16,7 @@ import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.SQLQuery; import com.liferay.portal.kernel.dao.orm.SQLQuery;
import com.liferay.portal.kernel.dao.orm.Session; import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.dao.orm.Type; import com.liferay.portal.kernel.dao.orm.Type;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl; import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
@ -374,6 +375,7 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
// ADT - BUG-14 - Scadenziario // ADT - BUG-14 - Scadenziario
// ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca // ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca
@SuppressWarnings("unchecked")
@Override @Override
public List<Object[]> scadenzePratiche(long companyId, long groupId, int start, int end, Integer statoPratica, public List<Object[]> scadenzePratiche(long companyId, long groupId, int start, int end, Integer statoPratica,
String tipoPratica, String istruttore) { String tipoPratica, String istruttore) {
@ -395,9 +397,9 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
: "1 OR 1=1")); : "1 OR 1=1"));
// ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca // ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca
sql = StringUtil.replace(sql, "[$DT_TIPOPRATICA$]", sql = StringUtil.replace(sql, "[$DT_TIPOPRATICA$]",
Validator.isNull(tipoPratica) ? "%" : tipoPratica.toUpperCase()); Validator.isNull(tipoPratica) ? StringPool.PERCENT : tipoPratica.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_ISTRUTTORE$]", sql = StringUtil.replace(sql, "[$DT_ISTRUTTORE$]",
Validator.isNull(istruttore) ? "%" : istruttore.toUpperCase()); Validator.isNull(istruttore) ? StringPool.PERCENT : istruttore.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_STATO$]", sql = StringUtil.replace(sql, "[$DT_STATO$]",
Validator.isNull(statoPratica) ? "1 OR 1=1" : String.valueOf(statoPratica)); Validator.isNull(statoPratica) ? "1 OR 1=1" : String.valueOf(statoPratica));
SQLQuery query = session.createSQLQuery(sql); SQLQuery query = session.createSQLQuery(sql);
@ -421,6 +423,7 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
} }
// ADT - BUG-14 - Scadenziario // ADT - BUG-14 - Scadenziario
@SuppressWarnings("unchecked")
@Override @Override
public List<Object[]> scadenzeIntegrazioni(long companyId, long groupId, int start, int end, Integer statoPratica) { public List<Object[]> scadenzeIntegrazioni(long companyId, long groupId, int start, int end, Integer statoPratica) {
@ -479,9 +482,9 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
: "1 OR 1=1")); : "1 OR 1=1"));
// ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca // ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca
sql = StringUtil.replace(sql, "[$DT_TIPOPRATICA$]", sql = StringUtil.replace(sql, "[$DT_TIPOPRATICA$]",
Validator.isNull(tipoPratica) ? "%" : tipoPratica.toUpperCase()); Validator.isNull(tipoPratica) ? StringPool.PERCENT : tipoPratica.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_ISTRUTTORE$]", sql = StringUtil.replace(sql, "[$DT_ISTRUTTORE$]",
Validator.isNull(istruttore) ? "%" : istruttore.toUpperCase()); Validator.isNull(istruttore) ? StringPool.PERCENT : istruttore.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_STATO$]", sql = StringUtil.replace(sql, "[$DT_STATO$]",
Validator.isNull(statoPratica) ? "1 OR 1=1" : String.valueOf(statoPratica)); Validator.isNull(statoPratica) ? "1 OR 1=1" : String.valueOf(statoPratica));
SQLQuery query = session.createSQLQuery(sql); SQLQuery query = session.createSQLQuery(sql);
@ -531,6 +534,7 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
return count; return count;
} }
@SuppressWarnings("unchecked")
@Override @Override
public List<Object[]> scadenzePraticheForBackwardCompatibility(long companyId, long groupId, int start, int end) { public List<Object[]> scadenzePraticheForBackwardCompatibility(long companyId, long groupId, int start, int end) {

118
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/startup/CompanyExpandoStartupAction.java

@ -1,9 +1,9 @@
package it.tref.liferay.portos.bo.startup; package it.tref.liferay.portos.bo.startup;
import java.util.Date;
import it.tref.liferay.portos.bo.shared.util.Constants; import it.tref.liferay.portos.bo.shared.util.Constants;
import java.util.Date;
import com.liferay.portal.kernel.events.ActionException; import com.liferay.portal.kernel.events.ActionException;
import com.liferay.portal.kernel.events.SimpleAction; import com.liferay.portal.kernel.events.SimpleAction;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
@ -35,16 +35,11 @@ public class CompanyExpandoStartupAction extends SimpleAction {
String[] defaultActions = { ActionKeys.VIEW, ActionKeys.UPDATE }; String[] defaultActions = { ActionKeys.VIEW, ActionKeys.UPDATE };
String[] guestActions = { ActionKeys.VIEW }; String[] guestActions = { ActionKeys.VIEW };
try { try {
for (String companyIdStr : companyIds) { for (String companyIdStr : companyIds) {
long companyId = Long.valueOf(companyIdStr); long companyId = Long.valueOf(companyIdStr);
initExpandoColumnCompany(companyId, defaultActions, guestActions); initExpandoColumnCompany(companyId, defaultActions, guestActions);
} }
} catch (Exception e) { } catch (Exception e) {
_log.error("Errore nella procedura automatizzata di configurazione", e); _log.error("Errore nella procedura automatizzata di configurazione", e);
} }
@ -54,65 +49,45 @@ public class CompanyExpandoStartupAction extends SimpleAction {
throws NumberFormatException, SystemException { throws NumberFormatException, SystemException {
String className = Company.class.getName(); String className = Company.class.getName();
addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES, addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES,
ExpandoColumnConstants.STRING, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES_URL, ExpandoColumnConstants.STRING, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES_URL, defaultActions,
guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS,
ExpandoColumnConstants.STRING, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_URL, defaultActions,
guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT,
ExpandoColumnConstants.STRING, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT_URL,
defaultActions, guestActions); defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className,
Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS, ExpandoColumnConstants.STRING,
Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_URL, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className,
Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT, ExpandoColumnConstants.STRING,
Constants.COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT_URL, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT, addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT,
ExpandoColumnConstants.STRING, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT_URL, ExpandoColumnConstants.STRING, Constants.COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT_URL, defaultActions,
defaultActions, guestActions); guestActions);
addExpandoColumnIfNotExists(companyId, className, addExpandoColumnIfNotExists(companyId, className,
Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_LABEL, Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_LABEL, ExpandoColumnConstants.STRING,
ExpandoColumnConstants.STRING,
Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_VALUE, defaultActions, guestActions); Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_VALUE, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className, addExpandoColumnIfNotExists(companyId, className,
Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_LABEL, Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_LABEL, ExpandoColumnConstants.STRING,
ExpandoColumnConstants.STRING,
Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_VALUE, defaultActions, guestActions); Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_VALUE, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.ORG_CUSTOM_FIELD_PO, ExpandoColumnConstants.STRING,
addExpandoColumnIfNotExists(companyId, className, Constants.ORG_CUSTOM_FIELD_PO, StringPool.BLANK, defaultActions, guestActions);
ExpandoColumnConstants.STRING, StringPool.BLANK, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.GESTIONE_PRATICA_URL_FE, addExpandoColumnIfNotExists(companyId, className, Constants.GESTIONE_PRATICA_URL_FE,
ExpandoColumnConstants.STRING, StringPool.BLANK, defaultActions, guestActions); ExpandoColumnConstants.STRING, StringPool.BLANK, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.GESTIONE_PRATICA_URL_BO, addExpandoColumnIfNotExists(companyId, className, Constants.GESTIONE_PRATICA_URL_BO,
ExpandoColumnConstants.STRING, StringPool.BLANK, defaultActions, guestActions); ExpandoColumnConstants.STRING, StringPool.BLANK, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.CF_ORGANIZATION_MEMBERSHIP, addExpandoColumnIfNotExists(companyId, className, Constants.CF_ORGANIZATION_MEMBERSHIP,
ExpandoColumnConstants.STRING, StringPool.BLANK, defaultActions, guestActions); ExpandoColumnConstants.STRING, StringPool.BLANK, defaultActions, guestActions);
// Manifattura Web Group, mofidica per rendere la dimensione massima degli allegati configurabile da pannello di
// Manifattura Web Group, mofidica per rendere la dimensione massima // controllo. In origine era hardcoded a 20971520 byte.
// degli allegati configurabile da pannello di controllo. In origine era
// hardcoded a 20971520 byte.
addExpandoColumnIfNotExists(companyId, className, addExpandoColumnIfNotExists(companyId, className,
Constants.COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_IN_MIB, Constants.COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_IN_MIB, ExpandoColumnConstants.SHORT,
ExpandoColumnConstants.SHORT, Constants.COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_DEFAULT, defaultActions, guestActions);
Constants.COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_DEFAULT, defaultActions,
guestActions);
addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_LINK_SEED, addExpandoColumnIfNotExists(companyId, className, Constants.COMPANY_CUSTOM_FIELD_LINK_SEED,
ExpandoColumnConstants.STRING, String.valueOf(new Date().getTime()), defaultActions, ExpandoColumnConstants.STRING, String.valueOf(new Date().getTime()), defaultActions, guestActions);
guestActions);
} }
private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, int type,
int type, String defaultData, String[] defaultActions, String[] guestActions) String defaultData, String[] defaultActions, String[] guestActions) throws SystemException {
throws SystemException {
long classNameId = PortalUtil.getClassNameId(className); long classNameId = PortalUtil.getClassNameId(className);
ExpandoTable expandoTable = null; ExpandoTable expandoTable = null;
try { try {
expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, classNameId, expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, classNameId,
@ -124,56 +99,47 @@ public class CompanyExpandoStartupAction extends SimpleAction {
} catch (PortalException e1) { } catch (PortalException e1) {
} }
} }
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), name);
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil
.getColumn(expandoTable.getTableId(), name);
if (expandoColumn == null) { if (expandoColumn == null) {
try { try {
// Manifattura Web Group, modifica per rendere possibile la // Manifattura Web Group, modifica per rendere possibile la creazione di campi personalizzati di tipo
// creazione di campi personalizzati di tipo intero // intero
switch (type) { switch (type) {
case ExpandoColumnConstants.INTEGER: case ExpandoColumnConstants.INTEGER:
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type,
type, Integer.valueOf(defaultData)); Integer.valueOf(defaultData));
break; break;
case ExpandoColumnConstants.LONG: case ExpandoColumnConstants.LONG:
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type,
type, Long.valueOf(defaultData)); Long.valueOf(defaultData));
break; break;
case ExpandoColumnConstants.SHORT: case ExpandoColumnConstants.SHORT:
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type,
type, Short.valueOf(defaultData)); Short.valueOf(defaultData));
break; break;
default: default:
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type,
type, defaultData); defaultData);
} }
} catch (PortalException e) { } catch (PortalException e) {
} }
} }
try { try {
Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST); Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST);
Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER); Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER);
Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER); Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()),
String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(), guestActions); roleGuest.getRoleId(), guestActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()),
String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(), defaultActions); rolePowerUser.getRoleId(), defaultActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()),
String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(), defaultActions); roleUser.getRoleId(), defaultActions);
} catch (PortalException e) { } catch (PortalException e) {
} }
return expandoColumn; return expandoColumn;
} }
} }

23
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java

@ -22,6 +22,7 @@ public class GenioCivileBaseUtil {
public static String getDettPraticaURL(long plid, long resourcePrimKey, int status, String portalURL, public static String getDettPraticaURL(long plid, long resourcePrimKey, int status, String portalURL,
boolean maximized) { boolean maximized) {
return getDettPraticaURL(plid, resourcePrimKey, status, portalURL, maximized, null); return getDettPraticaURL(plid, resourcePrimKey, status, portalURL, maximized, null);
} }
@ -29,24 +30,15 @@ public class GenioCivileBaseUtil {
boolean maximized, String redirect) { boolean maximized, String redirect) {
StringBundler sb = new StringBundler(11); StringBundler sb = new StringBundler(11);
sb.append(portalURL); sb.append(portalURL).append(PortalUtil.getPathMain()).append("/portal/dettaglio_pratica/find_entry")
sb.append(PortalUtil.getPathMain()); .append(StringPool.QUESTION).append("p_l_id").append(StringPool.EQUAL).append(String.valueOf(plid))
sb.append("/portal/dettaglio_pratica/find_entry"); .append(StringPool.AMPERSAND);
sb.append(StringPool.QUESTION);
sb.append("p_l_id");
sb.append(StringPool.EQUAL);
sb.append(String.valueOf(plid));
sb.append(StringPool.AMPERSAND);
// control panel // control panel
if (Validator.isNotNull(redirect)) { if (Validator.isNotNull(redirect)) {
sb.append("doAsGroupId"); sb.append("doAsGroupId").append(StringPool.EQUAL)
sb.append(StringPool.EQUAL); .append(HttpUtil.getParameter(redirect, "doAsGroupId", false)).append(StringPool.AMPERSAND);
sb.append(HttpUtil.getParameter(redirect, "doAsGroupId", false));
sb.append(StringPool.AMPERSAND);
} }
sb.append("resourcePrimKey"); sb.append("resourcePrimKey").append(StringPool.EQUAL).append(String.valueOf(resourcePrimKey));
sb.append(StringPool.EQUAL);
sb.append(String.valueOf(resourcePrimKey));
String url = sb.toString(); String url = sb.toString();
if (status != WorkflowConstants.STATUS_APPROVED) { if (status != WorkflowConstants.STATUS_APPROVED) {
url = HttpUtil.addParameter(url, "status", String.valueOf(status)); url = HttpUtil.addParameter(url, "status", String.valueOf(status));
@ -62,6 +54,7 @@ public class GenioCivileBaseUtil {
public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status) public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status)
throws PortletModeException, WindowStateException { throws PortletModeException, WindowStateException {
return getDettPraticaURL(request, plid, resourcePrimKey, status, null); return getDettPraticaURL(request, plid, resourcePrimKey, status, null);
} }

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=3026 build.number=3033
build.date=1617377570209 build.date=1617889763598
build.auto.upgrade=true build.auto.upgrade=true
## ##

24
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/edit_allegato_manuale.jsp

@ -2,35 +2,31 @@
<%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%> <%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%>
<%@page import="it.tref.liferay.portos.bo.service.permission.IntPraticaPermission"%> <%@page import="it.tref.liferay.portos.bo.service.permission.IntPraticaPermission"%>
<%@include file="/html/doc_aggiuntiva/init.jsp"%> <%@include file="/html/doc_aggiuntiva/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
String formName = "fmAllegatoManuale"; String formName = "fmAllegatoManuale";
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
long territorioGroupId = territorio.getGroupId(); long territorioGroupId = territorio.getGroupId();
%> %>
<c:if test="<%= user.getUserId() == intPratica.getUserId() || IntPraticaPermission.contains(
<c:if test="<%= user.getUserId() == intPratica.getUserId() || IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>"> permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<liferay-portlet:actionURL name="uploadAllegatoManuale" var="uploadAllegatoManualeURL"> <liferay-portlet:actionURL name="uploadAllegatoManuale" var="uploadAllegatoManualeURL">
<liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPraticaId) %>" /> <liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>" /> <liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="mvcPath" value="/html/allegati_manuali/edit_allegato_manuale.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/allegati_manuali/edit_allegato_manuale.jsp" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:form name="<%= formName %>" enctype="multipart/form-data" method="post" action="<%= uploadAllegatoManualeURL %>"> <aui:form name="<%= formName %>" enctype="multipart/form-data" method="post" action="<%= uploadAllegatoManualeURL %>">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="upload-file"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="upload-file">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="col-xs-12">
<aui:input type="textarea" name="descrizione" label="Descrizione"></aui:input> <aui:input type="textarea" name="descrizione" label="Descrizione" />
<aui:input type="file" name="docFile" label="File"> <aui:input type="file" name="docFile" label="File">
<aui:validator name="required" errorMessage="File Richiesto" /> <aui:validator name="required" errorMessage="File Richiesto" />
</aui:input> </aui:input>
@ -46,21 +42,17 @@
</div> </div>
</div> </div>
</aui:form> </aui:form>
<aui:script use="aui-base"> <aui:script use="aui-base">
window.parent.Liferay.fire('allegati_manuali-open'); window.parent.Liferay.fire('allegati_manuali-open');
</aui:script> </aui:script>
</c:if> </c:if>
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker,
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>"> territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="alert alert-info"> <div class="alert alert-info">
<liferay-ui:message key="resource-not-allowed"></liferay-ui:message> <liferay-ui:message key="resource-not-allowed" />
</div> </div>
</div> </div>
</div> </div>
</c:if> </c:if>

87
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/view.jsp

@ -1,16 +1,14 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%>
<%@page import="it.tref.liferay.portos.bo.service.permission.IntPraticaPermission"%>
<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%>
<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> <%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%>
<%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%> <%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.permission.IntPraticaPermission"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%>
<%@include file="/html/allegati_manuali/init.jsp"%> <%@include file="/html/allegati_manuali/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
long territorioGroupId = territorio.getGroupId(); long territorioGroupId = territorio.getGroupId();
@ -20,7 +18,8 @@ long territorioGroupId = territorio.getGroupId();
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-12 fascicolo-allegato-manuale-tab"> <div class="col-sm-12 fascicolo-allegato-manuale-tab">
<liferay-portlet:renderURL var="addAllegatoManuale" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="addAllegatoManuale"
windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/allegati_manuali/edit_allegato_manuale.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/allegati_manuali/edit_allegato_manuale.jsp" />
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> <liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" /> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
@ -30,16 +29,18 @@ long territorioGroupId = territorio.getGroupId();
<liferay-portlet:resourceURL var="downloadAllURL" id="downloadAll"> <liferay-portlet:resourceURL var="downloadAllURL" id="downloadAll">
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> <liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" <liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
cssClass="inline_toolbar"> cssClass="inline_toolbar">
<span class="tooltip-info" title="Aggiungi Allegato Manuale"> <span class="tooltip-info" title="Aggiungi Allegato Manuale">
<aui:button useDialog="true" id='<%= renderResponse.getNamespace() + "add-allegato-manuale" %>' <aui:button useDialog="true" id='<%= renderResponse.getNamespace() + "add-allegato-manuale" %>'
icon="fa fa-plus" href="<%=addAllegatoManuale%>" cssClass="btn btn-primary btn-action" /> icon="fa fa-plus" href="<%= addAllegatoManuale %>"
cssClass="btn btn-primary btn-action" />
</span> </span>
<c:if test="<%= AllegatoManualeLocalServiceUtil.countByIntPratica(intPraticaId) > 0 %>"> <c:if test="<%= AllegatoManualeLocalServiceUtil.countByIntPratica(intPraticaId) > 0 %>">
<span class="tooltip-info" title="Download"> <span class="tooltip-info" title="Download">
<aui:button useDialog="true" id='<%= renderResponse.getNamespace() + "download_all" %>' <aui:button useDialog="true" id='<%= renderResponse.getNamespace() + "download_all" %>'
icon="fa fa-download" href="<%=downloadAllURL%>" cssClass="btn btn-primary btn-action" /> icon="fa fa-download" href="<%= downloadAllURL %>"
cssClass="btn btn-primary btn-action" />
</span> </span>
</c:if> </c:if>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
@ -47,13 +48,15 @@ long territorioGroupId = territorio.getGroupId();
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" orderByType="asc" orderByCol="createDate"> <liferay-ui:search-container emptyResultsMessage="no-entries-were-found" orderByType="asc"
orderByCol="createDate">
<liferay-ui:search-container-results <liferay-ui:search-container-results
results="<%= AllegatoManualeLocalServiceUtil.findByIntPratica(intPraticaId, QueryUtil.ALL_POS, results="<%= AllegatoManualeLocalServiceUtil.findByIntPratica(intPraticaId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null) %>" QueryUtil.ALL_POS, null) %>"
total="<%= AllegatoManualeLocalServiceUtil.countByIntPratica(intPraticaId) %>"> total="<%= AllegatoManualeLocalServiceUtil.countByIntPratica(intPraticaId) %>">
</liferay-ui:search-container-results> </liferay-ui:search-container-results>
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.AllegatoManuale" modelVar="allegatoManuale"> <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.AllegatoManuale"
modelVar="allegatoManuale">
<% <%
String title = StringPool.BLANK; String title = StringPool.BLANK;
if (Validator.isNotNull(allegatoManuale.getFileEntryId())) { if (Validator.isNotNull(allegatoManuale.getFileEntryId())) {
@ -64,45 +67,57 @@ long territorioGroupId = territorio.getGroupId();
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data" <liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data"
value="<%= dateFormatDateTime.format(allegatoManuale.getCreateDate()) %>" /> value="<%= dateFormatDateTime.format(allegatoManuale.getCreateDate()) %>" />
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="File" value="<%= title %>" /> <liferay-ui:search-container-column-text cssClass="text-nowrap" name="File" value="<%= title %>" />
<liferay-ui:search-container-column-text property="descrizione" cssClass="text-nowrap" name="Descrizione"/> <liferay-ui:search-container-column-text property="descrizione" cssClass="text-nowrap"
name="Descrizione" />
<liferay-ui:search-container-column-text name="actions" cssClass="text-nowrap"> <liferay-ui:search-container-column-text name="actions" cssClass="text-nowrap">
<liferay-ui:icon-menu icon="" showExpanded="false" showWhenSingleIcon="false"> <liferay-ui:icon-menu icon="" showExpanded="false" showWhenSingleIcon="false">
<% <%
if (Validator.isNotNull(allegatoManuale.getFileEntryId())) { if (Validator.isNotNull(allegatoManuale.getFileEntryId())) {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(allegatoManuale.getFileEntryId()); FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(allegatoManuale.getFileEntryId());
%> %>
<liferay-portlet:renderURL var="previewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="previewURL"
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(allegatoManuale.getFileEntryId()) %>" /> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="fileEntryId"
value="<%= String.valueOf(allegatoManuale.getFileEntryId()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" />
<liferay-portlet:param name="redirect" value='<%= currentURL+"#_1_WAR_portosboportlet_tab=_1_WAR_portosboportlet_page_allegati_manuali" %>'/> <liferay-portlet:param name="redirect" value='<%= currentURL
+ "#_1_WAR_portosboportlet_tab=_1_WAR_portosboportlet_page_allegati_manuali" %>'
/>
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<li title="Visualizza" id="tooltip-info"> <li title="Visualizza" id="tooltip-info">
<liferay-ui:icon id='<%=renderResponse.getNamespace()+"open_"+allegatoManuale.getAllegatoManualeId() %>' iconCssClass="fa fa-clipboard" message="Visualizza" url="<%=previewURL%>" useDialog="true"/> <liferay-ui:icon id='<%= renderResponse.getNamespace() + "open_"
+ allegatoManuale.getAllegatoManualeId() %>' iconCssClass="fa fa-clipboard"
message="Visualizza" url="<%= previewURL %>" useDialog="true" />
</li> </li>
<% <%
String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(), themeDisplay, "&download=true"); String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(),
themeDisplay, "&download=true");
%> %>
<li title="Scarica" id="tooltip-info"> <li title="Scarica" id="tooltip-info">
<liferay-ui:icon message="Download" id='<%=renderResponse.getNamespace()+"download_"+allegatoManuale.getAllegatoManualeId() %>' iconCssClass="fa fa-download" url="<%=downloadUrl%>"/> <liferay-ui:icon message="Download" id='<%= renderResponse.getNamespace()
+ "download_" + allegatoManuale.getAllegatoManualeId() %>'
iconCssClass="fa fa-download" url="<%= downloadUrl %>" />
</li> </li>
<% <%
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId()); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId());
%> %>
<c:if test="<%= Validator.isNotNull(avviso) && Validator.isNotNull(avviso.getFileEntryIdInvio()) %>"> <c:if test="<%= Validator.isNotNull(avviso) && Validator.isNotNull(
avviso.getFileEntryIdInvio()) %>">
<li title="Elimina" id="tooltip-info"> <li title="Elimina" id="tooltip-info">
<liferay-portlet:actionURL var="deleteUrl" name="deleteAllegatoManuale"> <liferay-portlet:actionURL var="deleteUrl" name="deleteAllegatoManuale">
<liferay-portlet:param name="allegatoManualeId" value="<%=String.valueOf(allegatoManuale.getAllegatoManualeId())%>" /> <liferay-portlet:param name="allegatoManualeId" value="<%= String.valueOf(
allegatoManuale.getAllegatoManualeId()) %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-ui:icon message="delete" id='<%= "delete_" + allegatoManuale.getAllegatoManualeId() %>' <liferay-ui:icon message="delete" id='<%= "delete_"
+ allegatoManuale.getAllegatoManualeId() %>'
iconCssClass="fa fa-trash" url="javascript:void(0)" /> iconCssClass="fa fa-trash" url="javascript:void(0)" />
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"delete_"+allegatoManuale.getAllegatoManualeId() %>').on( A.one('<%= "#" + renderResponse.getNamespace() + "delete_"
+ allegatoManuale.getAllegatoManualeId() %>').on(
'click', 'click',
function(event) { function(event) {
event.preventDefault(); event.preventDefault();
A.io.request( A.io.request('<%= deleteUrl %>', {
'<%=deleteUrl%>',
{
on: { on: {
failure: function() { failure: function() {
alert('impossibile rimuovere il documento!'); alert('impossibile rimuovere il documento!');
@ -112,8 +127,7 @@ long territorioGroupId = territorio.getGroupId();
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>"); Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
} }
} }
} });
);
} }
); );
</aui:script> </aui:script>
@ -133,29 +147,24 @@ long territorioGroupId = territorio.getGroupId();
Liferay.fire('allegati_manuali-ready'); Liferay.fire('allegati_manuali-ready');
</aui:script> </aui:script>
<script> <script>
YUI().use( YUI().use('aui-tooltip', function(Y) {
'aui-tooltip',
function(Y) {
new Y.TooltipDelegate({ new Y.TooltipDelegate({
trigger: '.tooltip-info', trigger: '.tooltip-info',
position: 'top', position: 'top',
cssClass: 'tooltip-help', cssClass: 'tooltip-help',
html: true, html: true,
opacity: 1 opacity: 1,
});
}); });
}
);
</script> </script>
</c:if> </c:if>
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker,
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>"> territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="alert alert-info"> <div class="alert alert-info">
<liferay-ui:message key="resource-not-allowed"></liferay-ui:message> <liferay-ui:message key="resource-not-allowed" />
</div> </div>
</div> </div>
</div> </div>
</c:if> </c:if>

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/init.jsp

@ -71,8 +71,5 @@ Format dateFormatDate = FastDateFormatFactoryUtil.getDate(locale, timeZone);
Format dateFormatDateTime = FastDateFormatFactoryUtil.getDateTime(locale, timeZone); Format dateFormatDateTime = FastDateFormatFactoryUtil.getDateTime(locale, timeZone);
WindowState windowState = renderRequest.getWindowState(); WindowState windowState = renderRequest.getWindowState();
PortletMode portletMode = renderRequest.getPortletMode(); PortletMode portletMode = renderRequest.getPortletMode();
String currentURL = PortalUtil.getCurrentURL(liferayPortletRequest); String currentURL = PortalUtil.getCurrentURL(liferayPortletRequest);
%> %>

24
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/edit.jsp

@ -1,10 +1,8 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %> <%@ include file="/html/amministrazione/init.jsp" %>
<% <%
long comuneId = ParamUtil.getLong(renderRequest, "comuneId"); long comuneId = ParamUtil.getLong(renderRequest, "comuneId");
Comune comune = (Comune)request.getAttribute(it.tref.liferay.portos.bo.util.WebKeys.PORTOS_AMM_COMUNE); Comune comune = (Comune) request.getAttribute(it.tref.liferay.portos.bo.shared.util.WebKeys.PORTOS_AMM_COMUNE);
String title = null; String title = null;
if (comune == null) { if (comune == null) {
if (comuneId > 0) { if (comuneId > 0) {
@ -17,14 +15,12 @@ if(comune == null) {
} else { } else {
title = comune.getDenominazione(); title = comune.getDenominazione();
} }
String codiceProvinciaValue = StringPool.BLANK; String codiceProvinciaValue = StringPool.BLANK;
if (Validator.isNotNull(comune.getCodiceProvincia())) { if (Validator.isNotNull(comune.getCodiceProvincia())) {
Provincia item = ProvinciaLocalServiceUtil.findByC_C(company.getCompanyId(), comune.getCodiceProvincia()); Provincia item = ProvinciaLocalServiceUtil.findByC_C(company.getCompanyId(), comune.getCodiceProvincia());
codiceProvinciaValue = HtmlUtil.escape(item.getProvincia()); codiceProvinciaValue = HtmlUtil.escape(item.getProvincia());
} }
%> %>
<liferay-ui:error exception="<%= CodiceBelfioreException.class %>" message="please-enter-a-valid-codice-belfiore" /> <liferay-ui:error exception="<%= CodiceBelfioreException.class %>" message="please-enter-a-valid-codice-belfiore" />
<liferay-ui:error exception="<%= CodiceComuneException.class %>" message="please-enter-a-valid-codice-comune" /> <liferay-ui:error exception="<%= CodiceComuneException.class %>" message="please-enter-a-valid-codice-comune" />
<liferay-ui:error exception="<%= CodiceIstatException.class %>" message="please-enter-a-valid-codice-istat" /> <liferay-ui:error exception="<%= CodiceIstatException.class %>" message="please-enter-a-valid-codice-istat" />
@ -33,37 +29,24 @@ if(Validator.isNotNull(comune.getCodiceProvincia())) {
<liferay-ui:error exception="<%= DuplicateComuneException.class %>" message="a-comune-with-the-same-code-already-exist" /> <liferay-ui:error exception="<%= DuplicateComuneException.class %>" message="a-comune-with-the-same-code-already-exist" />
<liferay-ui:error exception="<%= ProvinciaException.class %>" message="please-enter-a-valid-provincia" /> <liferay-ui:error exception="<%= ProvinciaException.class %>" message="please-enter-a-valid-provincia" />
<liferay-ui:error exception="<%= NoSuchComuneException.class %>" message="please-select-a-comune" /> <liferay-ui:error exception="<%= NoSuchComuneException.class %>" message="please-select-a-comune" />
<liferay-portlet:renderURL var="redirect"> <liferay-portlet:renderURL var="redirect">
<liferay-portlet:param name="tabs1" value="comuni" /> <liferay-portlet:param name="tabs1" value="comuni" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:header backURL="<%= redirect %>" localizeTitle="false" title="<%= title %>" /> <liferay-ui:header backURL="<%= redirect %>" localizeTitle="false" title="<%= title %>" />
<liferay-portlet:actionURL name="saveComune" var="saveComuneURL" /> <liferay-portlet:actionURL name="saveComune" var="saveComuneURL" />
<aui:form action="<%= saveComuneURL %>" method="post" name="fm"> <aui:form action="<%= saveComuneURL %>" method="post" name="fm">
<aui:model-context bean="<%= comune %>" model="<%= Comune.class %>" /> <aui:model-context bean="<%= comune %>" model="<%= Comune.class %>" />
<aui:input name="comuneId" type="hidden" /> <aui:input name="comuneId" type="hidden" />
<aui:input name="codiceComune" type="hidden" /> <aui:input name="codiceComune" type="hidden" />
<aui:field-wrapper label="codice-comune"> <aui:field-wrapper label="codice-comune">
<%= comune.getCodiceComune() %> <%= comune.getCodiceComune() %>
</aui:field-wrapper> </aui:field-wrapper>
<aui:field-wrapper label="codice-provincia"> <aui:field-wrapper label="codice-provincia">
<aui:input name="codiceProvincia" type="hidden" /> <aui:input name="codiceProvincia" type="hidden" />
<liferay-ui:input-resource id="codiceProvinciaValue" url="<%= codiceProvinciaValue %>" /> <liferay-ui:input-resource id="codiceProvinciaValue" url="<%= codiceProvinciaValue %>" />
<liferay-ui:icon <liferay-ui:icon cssClass="modify-link" iconCssClass="icon-search" id="selectProvinciaLink" label="true"
cssClass="modify-link" linkCssClass="btn" message="select" method="get" url="javascript:;" />
iconCssClass="icon-search"
id="selectProvinciaLink"
label="true"
linkCssClass="btn"
message="select"
method="get"
url="javascript:;"
/>
</aui:field-wrapper> </aui:field-wrapper>
<aui:input name="codiceIstat" /> <aui:input name="codiceIstat" />
<aui:input name="codiceBelfiore" disabled="<%= comuneId != 0 %>" /> <aui:input name="codiceBelfiore" disabled="<%= comuneId != 0 %>" />
@ -75,7 +58,6 @@ if(Validator.isNotNull(comune.getCodiceProvincia())) {
<aui:button type="submit" value="save" /> <aui:button type="submit" value="save" />
</aui:button-row> </aui:button-row>
</aui:form> </aui:form>
<liferay-portlet:renderURL var="selectProvinciaURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="selectProvinciaURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="eventName" value='<%= renderResponse.getNamespace()+"selectProvincia" %>' /> <liferay-portlet:param name="eventName" value='<%= renderResponse.getNamespace()+"selectProvincia" %>' />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/province/select_provincia.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/province/select_provincia.jsp" />

14
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/import.jsp

@ -1,38 +1,30 @@
<%-- LIFERAY_CRUD_GENERATOR_DO_NOT_GENERATE --%> <%-- LIFERAY_CRUD_GENERATOR_DO_NOT_GENERATE --%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %> <%@ include file="/html/amministrazione/init.jsp" %>
<liferay-ui:error exception="<%= CSVFileNotFoundException.class %>" message="csv-file-not-found" /> <liferay-ui:error exception="<%= CSVFileNotFoundException.class %>" message="csv-file-not-found" />
<liferay-portlet:renderURL var="backURL"> <liferay-portlet:renderURL var="backURL">
<liferay-portlet:param name="tabs1" value="comuni" /> <liferay-portlet:param name="tabs1" value="comuni" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:header title="import-comunes" backURL="<%=backURL %>" /> <liferay-ui:header title="import-comunes" backURL="<%=backURL %>" />
<div class="portlet-msg-info"> <div class="portlet-msg-info">
<liferay-ui:message <liferay-ui:message
arguments="<%=new String[] { StringUtil.merge(Constants.AMMINISTRAZIONE_CSV_HEADERS_COMUNI, StringPool.COMMA_AND_SPACE) } %>" arguments="<%= new String[] { StringUtil.merge(Constants.AMMINISTRAZIONE_CSV_HEADERS_COMUNI,
key="csv-file-headers-format-must-be-x" StringPool.COMMA_AND_SPACE) } %>"
translateArguments="false" /> key="csv-file-headers-format-must-be-x" translateArguments="false" />
</div> </div>
<liferay-portlet:actionURL name="importComunes" var="importComunesURL" /> <liferay-portlet:actionURL name="importComunes" var="importComunesURL" />
<aui:form action="<%= importComunesURL %>" enctype="multipart/form-data" method="post"> <aui:form action="<%= importComunesURL %>" enctype="multipart/form-data" method="post">
<aui:input name="redirect" type="hidden" value="<%= backURL %>" /> <aui:input name="redirect" type="hidden" value="<%= backURL %>" />
<aui:input name="file" type="file"> <aui:input name="file" type="file">
<aui:validator name="required" /> <aui:validator name="required" />
<aui:validator name="acceptFiles">'csv'</aui:validator> <aui:validator name="acceptFiles">'csv'</aui:validator>
</aui:input> </aui:input>
<aui:select name="delimiter"> <aui:select name="delimiter">
<aui:option label="comma" value="," /> <aui:option label="comma" value="," />
<aui:option label="semi-colon" value=";" /> <aui:option label="semi-colon" value=";" />
<aui:option label="colon" value=":" /> <aui:option label="colon" value=":" />
</aui:select> </aui:select>
<aui:button-row> <aui:button-row>
<aui:button type="submit" value="import" /> <aui:button type="submit" value="import" />
</aui:button-row> </aui:button-row>

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/search.jsp

@ -1,13 +1,8 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %> <%@ include file="/html/amministrazione/init.jsp" %>
<% <%
SearchContainer<Comune> searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer"); SearchContainer<Comune> searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer");
DisplayTerms displayTerms = (DisplayTerms) searchContainer.getDisplayTerms(); DisplayTerms displayTerms = (DisplayTerms) searchContainer.getDisplayTerms();
%> %>
<liferay-ui:search-toggle autoFocus="<%=windowState.equals(WindowState.MAXIMIZED) %>" buttonLabel="search"
<liferay-ui:search-toggle displayTerms="<%= displayTerms %>" id="toggle_id_comune_search" />
autoFocus="<%=windowState.equals(WindowState.MAXIMIZED) %>"
buttonLabel="search" displayTerms="<%=displayTerms %>"
id="toggle_id_comune_search" />

14
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/select_comune.jsp

@ -1,20 +1,16 @@
<%-- LIFERAY_CRUD_GENERATOR_DO_NOT_GENERATE --%> <%-- LIFERAY_CRUD_GENERATOR_DO_NOT_GENERATE --%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %> <%@ include file="/html/amministrazione/init.jsp" %>
<% <%
String eventName = ParamUtil.getString(request, "eventName", liferayPortletResponse.getNamespace() + "selectComune"); String eventName = ParamUtil.getString(request, "eventName", liferayPortletResponse.getNamespace() + "selectComune");
%> %>
<aui:form name="selectEntryFm"> <aui:form name="selectEntryFm">
<liferay-ui:header title="comuni" /> <liferay-ui:header title="comuni" />
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found"> <liferay-ui:search-container emptyResultsMessage="no-entries-were-found">
<liferay-ui:search-container-results <liferay-ui:search-container-results
total="<%= ComuneLocalServiceUtil.countByCompanyId(company.getCompanyId()) %>" total="<%= ComuneLocalServiceUtil.countByCompanyId(company.getCompanyId()) %>"
results="<%= ComuneLocalServiceUtil.findByCompanyId(company.getCompanyId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS) %>" results="<%= ComuneLocalServiceUtil.findByCompanyId(company.getCompanyId(), QueryUtil.ALL_POS,
/> QueryUtil.ALL_POS) %>" />
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Comune" modelVar="comune"> <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Comune" modelVar="comune">
<liferay-ui:search-container-column-text name="codiceProvincia" /> <liferay-ui:search-container-column-text name="codiceProvincia" />
<liferay-ui:search-container-column-text name="codiceComune" /> <liferay-ui:search-container-column-text name="codiceComune" />
@ -32,22 +28,18 @@ String eventName = ParamUtil.getString(request, "eventName", liferayPortletRespo
<aui:button cssClass="selector-button" data="<%= data %>" value="choose" /> <aui:button cssClass="selector-button" data="<%= data %>" value="choose" />
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" /> <liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container> </liferay-ui:search-container>
</aui:form> </aui:form>
<aui:script use="aui-base"> <aui:script use="aui-base">
var Util = Liferay.Util; var Util = Liferay.Util;
A.one('#<portlet:namespace />selectEntryFm').delegate( A.one('#<portlet:namespace />selectEntryFm').delegate(
'click', 'click',
function(event) { function(event) {
var result = Util.getAttributes(event.currentTarget, 'data-'); var result = Util.getAttributes(event.currentTarget, 'data-');
Util.getOpener().Liferay.fire('<%= HtmlUtil.escapeJS(eventName) %>', result); Util.getOpener().Liferay.fire('<%= HtmlUtil.escapeJS(eventName) %>', result);
Util.getWindow().hide(); Util.getWindow().hide();
}, },
'.selector-button' '.selector-button',
); );
</aui:script> </aui:script>

61
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/view.jsp

@ -1,17 +1,13 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %> <%@ include file="/html/amministrazione/init.jsp" %>
<% <%
String orderByCol = ParamUtil.getString(renderRequest, SearchContainer.DEFAULT_ORDER_BY_COL_PARAM, "denominazione"); String orderByCol = ParamUtil.getString(renderRequest, SearchContainer.DEFAULT_ORDER_BY_COL_PARAM, "denominazione");
String orderByType = ParamUtil.getString(renderRequest, SearchContainer.DEFAULT_ORDER_BY_TYPE_PARAM, "asc"); String orderByType = ParamUtil.getString(renderRequest, SearchContainer.DEFAULT_ORDER_BY_TYPE_PARAM, "asc");
OrderByComparator orderByComparator = OrderByComparatorFactoryUtil.create(ComuneImpl.TABLE_NAME, orderByCol, "asc".equals(orderByType)); OrderByComparator orderByComparator = OrderByComparatorFactoryUtil.create(ComuneImpl.TABLE_NAME, orderByCol,
"asc".equals(orderByType));
DisplayTerms displayTerms = new DisplayTerms(renderRequest); DisplayTerms displayTerms = new DisplayTerms(renderRequest);
%> %>
<liferay-portlet:actionURL name="creaFileStaris" var="creaFileStarisURL" /> <liferay-portlet:actionURL name="creaFileStaris" var="creaFileStarisURL" />
<liferay-portlet:renderURL varImpl="searchURL"> <liferay-portlet:renderURL varImpl="searchURL">
<liferay-portlet:param name="tabs1" value="comuni" /> <liferay-portlet:param name="tabs1" value="comuni" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" />
@ -25,68 +21,75 @@ DisplayTerms displayTerms = new DisplayTerms(renderRequest);
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/edit.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/edit.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<aui:nav-item href="<%=addURL %>" iconCssClass="icon-plus" label="add-comune" /> <aui:nav-item href="<%=addURL %>" iconCssClass="icon-plus" label="add-comune" />
<liferay-portlet:renderURL var="importURL"> <liferay-portlet:renderURL var="importURL">
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/import.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/import.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<aui:nav-item href="<%= importURL %>" iconCssClass="icon-upload" label="import-comunes" /> <aui:nav-item href="<%= importURL %>" iconCssClass="icon-upload" label="import-comunes" />
</aui:nav> </aui:nav>
<aui:nav-bar-search cssClass="pull-right"> <aui:nav-bar-search cssClass="pull-right">
<liferay-ui:search-form page="/html/amministrazione/tabs/comuni/search.jsp" servletContext="<%=application %>" /> <liferay-ui:search-form page="/html/amministrazione/tabs/comuni/search.jsp"
servletContext="<%= application %>" />
</aui:nav-bar-search> </aui:nav-bar-search>
</aui:nav-bar> </aui:nav-bar>
<%
<% String taglibOnClick = renderResponse.getNamespace() + "deleteComunes()"; %> String taglibOnClick = renderResponse.getNamespace() + "deleteComunes()";
%>
<aui:button disabled="true" name="deleteAll" onClick="<%= taglibOnClick %>" value="delete" /> <aui:button disabled="true" name="deleteAll" onClick="<%= taglibOnClick %>" value="delete" />
<aui:input name="deleteComuneIds" type="hidden" /> <aui:input name="deleteComuneIds" type="hidden" />
<liferay-ui:search-container-results> <liferay-ui:search-container-results>
<% <%
if (Validator.isNull(displayTerms.getKeywords())) { if (Validator.isNull(displayTerms.getKeywords())) {
results = ComuneLocalServiceUtil.findByCompanyId(company.getCompanyId(), searchContainer.getStart(), searchContainer.getEnd(), orderByComparator); results = ComuneLocalServiceUtil.findByCompanyId(company.getCompanyId(), searchContainer.getStart(),
searchContainer.getEnd(), orderByComparator);
total = ComuneLocalServiceUtil.countByCompanyId(company.getCompanyId()); total = ComuneLocalServiceUtil.countByCompanyId(company.getCompanyId());
} else { } else {
results = ComuneLocalServiceUtil.findByKeywords(company.getCompanyId(), displayTerms.getKeywords(), searchContainer.getStart(), searchContainer.getEnd(), orderByComparator); results = ComuneLocalServiceUtil.findByKeywords(company.getCompanyId(), displayTerms.getKeywords(),
searchContainer.getStart(), searchContainer.getEnd(), orderByComparator);
total = (int) ComuneLocalServiceUtil.countByKeywords(company.getCompanyId(), displayTerms.getKeywords()); total = (int) ComuneLocalServiceUtil.countByKeywords(company.getCompanyId(), displayTerms.getKeywords());
} }
pageContext.setAttribute("results", results); pageContext.setAttribute("results", results);
pageContext.setAttribute("total", total); pageContext.setAttribute("total", total);
%> %>
</liferay-ui:search-container-results> </liferay-ui:search-container-results>
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Comune" keyProperty="comuneId"
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Comune" keyProperty="comuneId" modelVar="comune"> modelVar="comune">
<liferay-portlet:renderURL var="editURL"> <liferay-portlet:renderURL var="editURL">
<liferay-portlet:param name="comuneId" value="<%= String.valueOf(comune.getPrimaryKey()) %>" /> <liferay-portlet:param name="comuneId" value="<%= String.valueOf(comune.getPrimaryKey()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/edit.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/edit.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:search-container-column-text href="<%= editURL %>" name="codice-provincia" orderable="true"
<liferay-ui:search-container-column-text href="<%=editURL %>" name="codice-provincia" orderable="true" orderableProperty="codiceProvincia" property="codiceProvincia" /> orderableProperty="codiceProvincia" property="codiceProvincia" />
<liferay-ui:search-container-column-text href="<%=editURL %>" name="codice-comune" orderable="true" orderableProperty="codiceComune" property="codiceComune" /> <liferay-ui:search-container-column-text href="<%= editURL %>" name="codice-comune" orderable="true"
<liferay-ui:search-container-column-text href="<%=editURL %>" name="codice-istat" orderable="true" orderableProperty="codiceIstat" property="codiceIstat" /> orderableProperty="codiceComune" property="codiceComune" />
<liferay-ui:search-container-column-text href="<%=editURL %>" name="codice-belfiore" orderable="true" orderableProperty="codiceBelfiore" property="codiceBelfiore" /> <liferay-ui:search-container-column-text href="<%= editURL %>" name="codice-istat" orderable="true"
orderableProperty="codiceIstat" property="codiceIstat" />
<liferay-ui:search-container-column-text href="<%= editURL %>" name="codice-belfiore" orderable="true"
orderableProperty="codiceBelfiore" property="codiceBelfiore" />
<liferay-ui:search-container-column-text href="<%= editURL %>" name="denominazione" orderable="true" /> <liferay-ui:search-container-column-text href="<%= editURL %>" name="denominazione" orderable="true" />
<liferay-ui:search-container-column-text href="<%= editURL %>" name="mail-suap" property="mailSuap" /> <liferay-ui:search-container-column-text href="<%= editURL %>" name="mail-suap" property="mailSuap" />
<liferay-ui:search-container-column-text href="<%= editURL %>" name="mail-sue" property="mailSue" /> <liferay-ui:search-container-column-text href="<%= editURL %>" name="mail-sue" property="mailSue" />
<liferay-ui:search-container-column-text href="<%=editURL %>" value='<%=comune.getProvincia()?LanguageUtil.get(pageContext, "yes"):LanguageUtil.get(pageContext, "no") %>' name="provincia" orderable="true" translate="true" /> <liferay-ui:search-container-column-text href="<%= editURL %>"
value='<%= comune.getProvincia() ? LanguageUtil.get(pageContext, "yes")
: LanguageUtil.get(pageContext, "no") %>'
name="provincia" orderable="true" translate="true" />
<liferay-ui:search-container-column-jsp path="/html/amministrazione/tabs/comuni/view_buttons.jsp" /> <liferay-ui:search-container-column-jsp path="/html/amministrazione/tabs/comuni/view_buttons.jsp" />
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="true" /> <liferay-ui:search-iterator paginate="true" />
</liferay-ui:search-container> </liferay-ui:search-container>
</aui:form> </aui:form>
<aui:script> <aui:script>
Liferay.Util.toggleSearchContainerButton('#<portlet:namespace />deleteAll', '#<portlet:namespace /><%= searchContainerReference.getId("searchContainer") %>SearchContainer', document.<portlet:namespace />fm, '<portlet:namespace />allRowIds'); Liferay.Util.toggleSearchContainerButton('#<portlet:namespace />deleteAll',
'#<portlet:namespace /><%= searchContainerReference.getId("searchContainer") %>SearchContainer',
document.<portlet:namespace />fm, '<portlet:namespace />allRowIds');
Liferay.provide( Liferay.provide(
window, window,
'<portlet:namespace />deleteComunes', '<portlet:namespace />deleteComunes',
function(cmd) { function(cmd) {
if (confirm('<%= UnicodeLanguageUtil.get(pageContext, "are-you-sure-you-want-to-permanently-delete-the-selected-comunes") %>')) { if (confirm('<%= UnicodeLanguageUtil.get(pageContext,
"are-you-sure-you-want-to-permanently-delete-the-selected-comunes") %>')) {
document.<portlet:namespace />fm.method = "post"; document.<portlet:namespace />fm.method = "post";
document.<portlet:namespace />fm.<portlet:namespace />deleteComuneIds.value = Liferay.Util.listCheckedExcept(document.<portlet:namespace />fm, '<portlet:namespace />allRowIds'); document.<portlet:namespace />fm.<portlet:namespace />deleteComuneIds.value =
Liferay.Util.listCheckedExcept(document.<portlet:namespace />fm, '<portlet:namespace />allRowIds');
submitForm(document.<portlet:namespace />fm, "<liferay-portlet:actionURL name="deleteComunes" />"); submitForm(document.<portlet:namespace />fm, "<liferay-portlet:actionURL name="deleteComunes" />");
} }
}, },

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/view_buttons.jsp

@ -1,26 +1,20 @@
<%-- LIFERAY_CRUD_GENERATOR_DO_NOT_GENERATE --%> <%-- LIFERAY_CRUD_GENERATOR_DO_NOT_GENERATE --%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %> <%@ include file="/html/amministrazione/init.jsp" %>
<% <%
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
Comune comune = (Comune) row.getObject(); Comune comune = (Comune) row.getObject();
%> %>
<liferay-portlet:renderURL var="redirectURL"> <liferay-portlet:renderURL var="redirectURL">
<liferay-portlet:param name="tabs1" value="comuni" /> <liferay-portlet:param name="tabs1" value="comuni" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:icon-menu> <liferay-ui:icon-menu>
<liferay-portlet:renderURL var="editURL"> <liferay-portlet:renderURL var="editURL">
<liferay-portlet:param name="comuneId" value="<%= String.valueOf(comune.getPrimaryKey()) %>" /> <liferay-portlet:param name="comuneId" value="<%= String.valueOf(comune.getPrimaryKey()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/edit.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/edit.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:icon image="edit" url="<%= editURL %>" /> <liferay-ui:icon image="edit" url="<%= editURL %>" />
<liferay-portlet:actionURL name="deleteComune" var="deleteComuneURL"> <liferay-portlet:actionURL name="deleteComune" var="deleteComuneURL">
<liferay-portlet:param name="comuneId" value="<%= String.valueOf(comune.getPrimaryKey()) %>" /> <liferay-portlet:param name="comuneId" value="<%= String.valueOf(comune.getPrimaryKey()) %>" />
<liferay-portlet:param name="redirect" value="<%= redirectURL %>" /> <liferay-portlet:param name="redirect" value="<%= redirectURL %>" />

14
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/view.jsp

@ -1,17 +1,9 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %> <%@ include file="/html/amministrazione/init.jsp" %>
<% <%
String currentTab = ParamUtil.getString(request, "tabs1", "territori"); String currentTab = ParamUtil.getString(request, "tabs1", "territori");
%> %>
<liferay-portlet:renderURL var="changeTabURL" /> <liferay-portlet:renderURL var="changeTabURL" />
<liferay-ui:tabs names="territori,province,comuni,parametri" url="<%= changeTabURL %>" />
<liferay-ui:tabs <liferay-util:include page='<%= "/html/amministrazione/tabs/" + currentTab + "/view.jsp" %>'
names="territori,province,comuni,parametri" servletContext="<%= application %>" />
url="<%= changeTabURL %>"
/>
<liferay-util:include
page='<%= "/html/amministrazione/tabs/"+currentTab+"/view.jsp" %>'
servletContext="<%= application %>"
/>

28
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/confirm_import_window.jsp

@ -1,32 +1,22 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<% <%
String titolo = ParamUtil.getString(request, "titolo", "Dettaglio"); String titolo = ParamUtil.getString(request, "titolo", "Dettaglio");
String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button"); String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button");
String width = ParamUtil.getString(request, "width", "700"); String width = ParamUtil.getString(request, "width", "700");
String height = ParamUtil.getString(request, "height"); String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv"); String contentDiv = ParamUtil.getString(request, "contentDiv");
String function = ParamUtil.getString(request, "function"); String function = ParamUtil.getString(request, "function");
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
%> %>
<div id='<%= renderResponse.getNamespace() + "confirmModal_" + randomId %>' class="confirmModal text-center"></div> <div id='<%= renderResponse.getNamespace() + "confirmModal_" + randomId %>' class="confirmModal text-center"></div>
<aui:script > <aui:script >
AUI().ready( AUI().ready('aui-modal', function(A) {
'aui-modal', var modal = new A.Modal({
function(A) {
var modal = new A.Modal(
{
bodyContent: A.one('#<portlet:namespace /><%= contentDiv %>'), bodyContent: A.one('#<portlet:namespace /><%= contentDiv %>'),
width:<%= width %>, width:<%= width %>,
<% <%
if(!height.equalsIgnoreCase(StringPool.BLANK)){ if (!height.equals(StringPool.BLANK)) {
%> %>
height:<%=height%>, height:<%=height%>,
<% <%
@ -46,16 +36,10 @@
} }
}).render(); }).render();
A.one('#<portlet:namespace /><%= buttonId %>').on('click', function() {
A.one('#<portlet:namespace /><%= buttonId %>').on(
'click',
function() {
<%= function %> <%= function %>
A.one('#<portlet:namespace /><%= contentDiv %>').show(); A.one('#<portlet:namespace /><%= contentDiv %>').show();
modal.show(); modal.show();
} });
); });
}
);
</aui:script> </aui:script>

34
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/confirm_window.jsp

@ -1,29 +1,21 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<% <%
String titolo = ParamUtil.getString(request, "titolo", "Dettaglio"); String titolo = ParamUtil.getString(request, "titolo", "Dettaglio");
String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button"); String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button");
String width = ParamUtil.getString(request, "width", "700"); String width = ParamUtil.getString(request, "width", "700");
String height = ParamUtil.getString(request, "height"); String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv", StringPool.BLANK);
String contentDiv = ParamUtil.getString(request, "contentDiv","");
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
%> %>
<div id='<%= renderResponse.getNamespace() + "confirmModal_" + randomId %>' class="confirmModal"></div> <div id='<%= renderResponse.getNamespace() + "confirmModal_" + randomId %>' class="confirmModal"></div>
<aui:script > <aui:script >
AUI().ready( AUI().ready('aui-modal', function(A) {
'aui-modal', var modal = new A.Modal({
function(A) {
var modal = new A.Modal(
{
bodyContent: A.one('#<portlet:namespace /><%= contentDiv %>'), bodyContent: A.one('#<portlet:namespace /><%= contentDiv %>'),
width:<%= width %>, width:<%= width %>,
<% <%
if(!height.equalsIgnoreCase(StringPool.BLANK)){ if (!height.equals(StringPool.BLANK)) {
%> %>
height: <%= height %>, height: <%= height %>,
<% <%
@ -41,26 +33,18 @@
} }
}).render(); }).render();
modal.addToolbar( modal.addToolbar([{
[
{
label: 'Chiudi', label: 'Chiudi',
on: { on: {
click: function() { click: function() {
modal.hide(); modal.hide();
} }
} }
} }]);
]
);
A.one('#<portlet:namespace /><%= buttonId %>').on( A.one('#<portlet:namespace /><%= buttonId %>').on('click', function() {
'click',
function() {
A.one('#<portlet:namespace /><%= contentDiv %>').show(); A.one('#<portlet:namespace /><%= contentDiv %>').show();
modal.show(); modal.show();
} });
); });
}
);
</aui:script> </aui:script>

68
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/submit_window.jsp

@ -1,6 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<% <%
String formName = ParamUtil.getString(request, "formName", "fm"); String formName = ParamUtil.getString(request, "formName", "fm");
String titolo = ParamUtil.getString(request, "titolo", "Invio"); String titolo = ParamUtil.getString(request, "titolo", "Invio");
@ -12,37 +11,24 @@
String contentDiv = ParamUtil.getString(request, "contentDiv", "saveAndCloseDiv"); String contentDiv = ParamUtil.getString(request, "contentDiv", "saveAndCloseDiv");
boolean buttonBar = ParamUtil.getBoolean(request, "buttonBar", true); boolean buttonBar = ParamUtil.getBoolean(request, "buttonBar", true);
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
String onClick = ParamUtil.getString(request, "onClick"); String onClick = ParamUtil.getString(request, "onClick");
boolean externalForm = ParamUtil.getBoolean(request, "externalForm", false); boolean externalForm = ParamUtil.getBoolean(request, "externalForm", false);
boolean okVisible = ParamUtil.getBoolean(request, "okVisible", true); boolean okVisible = ParamUtil.getBoolean(request, "okVisible", true);
%> %>
<aui:input name='<%= "confirmClose_" + randomId %>' type="hidden" value="false" /> <aui:input name='<%= "confirmClose_" + randomId %>' type="hidden" value="false" />
<div id='<%=renderResponse.getNamespace()+"saveAndCloseModal_"+randomId %>' class="confirmModal"> <div id='<%=renderResponse.getNamespace() + "saveAndCloseModal_" + randomId %>' class="confirmModal"></div>
</div>
<div class='customAlert'> <div class='customAlert'>
<p class='message'></p> <p class='message'></p>
<input type='button' class='confirmButton' value='CHIUDI'> <input type='button' class='confirmButton' value='CHIUDI'>
</div> </div>
<liferay-portlet:resourceURL var="resourceURL" id="controllaExtraInfo" copyCurrentRenderParameters="false" />
<liferay-portlet:resourceURL var="resourceURL" id="controllaExtraInfo" copyCurrentRenderParameters="false" >
</liferay-portlet:resourceURL>
<aui:script > <aui:script >
AUI().ready( AUI().ready('aui-modal', 'aui-io-request', 'aui-form-validator', function(A) {
'aui-modal','aui-io-request','aui-form-validator', var modal = new A.Modal({
function(A) {
var modal = new A.Modal(
{
bodyContent: A.one('#<portlet:namespace /><%=contentDiv%>'), bodyContent: A.one('#<portlet:namespace /><%=contentDiv%>'),
width: <%= width %>, width: <%= width %>,
<% <%
if(!height.equalsIgnoreCase(StringPool.BLANK)){ if (!height.equals(StringPool.BLANK)) {
%> %>
height: <%= height %>, height: <%= height %>,
<% <%
@ -54,10 +40,8 @@
modal: true, modal: true,
render: '#<portlet:namespace />saveAndCloseModal_<%= randomId %>', render: '#<portlet:namespace />saveAndCloseModal_<%= randomId %>',
visible: false, visible: false,
close: false close: false,
} }).render();
).render();
<% <%
if (buttonBar) { if (buttonBar) {
%> %>
@ -68,28 +52,30 @@
on: { on: {
click: function() { click: function() {
modal.hide(); modal.hide();
}
} }
} }
<% if(okVisible){ %> },
, <%
if (okVisible) {
%>
{ {
label: '<%= buttonConferma %>', label: '<%= buttonConferma %>',
on: { on: {
click: function() { click: function() {
<%
<% if(Validator.isNotNull(onClick)){ if (Validator.isNotNull(onClick)) {
out.print(onClick); out.print(onClick);
} else { } else {
%> %>
submitForm(document.<portlet:namespace /><%= formName %>); submitForm(document.<portlet:namespace /><%= formName %>);
var formValidator = Liferay.Form.get('<portlet:namespace /><%= formName %>').formValidator; var formValidator = Liferay.Form.get('<portlet:namespace /><%= formName %>')
.formValidator;
<% <%
if (externalForm) { if (externalForm) {
%> %>
if (!formValidator.hasErrors()) { if (!formValidator.hasErrors()) {
A.one('#<portlet:namespace />confirmClose_<%=randomId%>').set('value','true'); A.one('#<portlet:namespace />confirmClose_<%= randomId %>')
.set('value', 'true');
} else { } else {
alert("Attenzione!\nCampi richiesti non compilati correttamente"); alert("Attenzione!\nCampi richiesti non compilati correttamente");
} }
@ -99,31 +85,31 @@
%> %>
if (!formValidator.hasErrors()) { if (!formValidator.hasErrors()) {
modal.hide(); modal.hide();
A.one('#<portlet:namespace />confirmClose_<%=randomId%>').set('value','true'); A.one('#<portlet:namespace />confirmClose_<%= randomId %>')
.set('value', 'true');
} }
<% <%
} }
%>
<%
} }
%> %>
} }
} }
} }
<% } %> <%
}
%>
] ]
); );
<% <%
} }
%> %>
A.one('#<portlet:namespace /><%= buttonId %>').on( A.one('#<portlet:namespace /><%= buttonId %>').on('click', function() {
'click',
function() {
<%-- console.log('<portlet:namespace /><%=contentDiv%>') --%>
A.one('#<portlet:namespace /><%=contentDiv%>').show(); A.one('#<portlet:namespace /><%=contentDiv%>').show();
modal.show(); modal.show();
} });
);
window.alert = function(msg) { window.alert = function(msg) {
$('.message').text(msg); $('.message').text(msg);
@ -143,7 +129,5 @@
}, 100); }, 100);
}); });
}); });
}); });
</aui:script> </aui:script>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/header.jsp

@ -79,7 +79,7 @@
<div class="col-sm-2 col-md-2">Stato:</div> <div class="col-sm-2 col-md-2">Stato:</div>
<div class="col-sm-4 col-md-4"> <div class="col-sm-4 col-md-4">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getIntPraticaId()))%></strong> PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getTipoProcedura()))%></strong>
</div> </div>
</div> </div>

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp

@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="com.liferay.portal.kernel.log.LogFactoryUtil"%> <%@page import="com.liferay.portal.kernel.log.LogFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.log.Log"%> <%@page import="com.liferay.portal.kernel.log.Log"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
@ -143,7 +144,7 @@ String keywords = StringPool.BLANK;
<liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/> <liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/>
<liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/> <liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/>
<liferay-portlet:param name="searchForExport" value="true"/> <liferay-portlet:param name="searchForExport" value="true"/>
<liferay-portlet:param name="cmd" value="exportRicerca"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicerca"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
@ -282,7 +283,7 @@ String keywords = StringPool.BLANK;
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Stato Pratica" cssClass="text-nowrap text-center middle-aligned"> <liferay-ui:search-container-column-text name="Stato Pratica" cssClass="text-nowrap text-center middle-aligned">
<strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPraticaId)) %></strong> <strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getTipoProcedura())) %></strong>
<span class="text-center display-block" style="margin-top:5px"> <span class="text-center display-block" style="margin-top:5px">
<% <%

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

@ -1,58 +1,34 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.util.WorkflowConstants"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%>
<%@page import="it.tref.liferay.portos.bo.service.permission.IntPraticaPermission"%>
<%@page import="com.liferay.portal.model.Role"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowTaskAssignee"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowTask"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowTask"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowTaskAssignee"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil"%>
<%@page import="com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.WorkflowInstanceLink"%>
<%@page import="com.liferay.portal.service.persistence.WorkflowInstanceLinkUtil"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowDefinitionManagerUtil"%>
<%@page import="javax.portlet.PortletRequest"%>
<%@page import="com.liferay.portal.service.LayoutLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.GroupConstants"%> <%@page import="com.liferay.portal.model.GroupConstants"%>
<%@page import="com.liferay.portal.model.WorkflowInstanceLink"%>
<%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%> <%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="com.liferay.portal.service.LayoutLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil"%>
<%@page import="com.liferay.portlet.PortletURLFactoryUtil"%> <%@page import="com.liferay.portlet.PortletURLFactoryUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.FascicoloURLUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.FascicoloURLUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.GenioCivileBaseUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.permission.IntPraticaPermission"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%>
<%@page import="it.tref.liferay.portos.bo.util.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%> <%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="javax.portlet.PortletRequest"%>
<%@page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.kernel.util.WebKeys"%>
<%@page import="com.liferay.portal.kernel.dao.search.SearchContainer"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.service.permission.PortletPermissionUtil"%>
<%@include file="/html/gestioneattivita/init.jsp"%> <%@include file="/html/gestioneattivita/init.jsp"%>
<% <%
SearchContainer searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer");
SearchContainer searchContainer = (SearchContainer) request String redirect = searchContainer.getIteratorURL().toString();
.getAttribute("liferay-ui:search:searchContainer"); ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
String redirect = ParamUtil.getString(request, "backUrl"); ControlloPratica controlloPratica = (ControlloPratica) row.getObject();
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()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId());
Group controlPanelGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.CONTROL_PANEL); Group controlPanelGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.CONTROL_PANEL);
long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(), true); long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(), true);
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(),controlloPratica.getPrimaryKey()); controlloPratica.getCompanyId(), controlloPratica.getGroupId(), ControlloPratica.class.getName(),
controlloPratica.getPrimaryKey());
List<WorkflowTask> listaTask = null; List<WorkflowTask> listaTask = null;
if (workflowInstanceLink == null) { if (workflowInstanceLink == null) {
listaTask = new ArrayList<WorkflowTask>(); listaTask = new ArrayList<WorkflowTask>();
@ -60,28 +36,21 @@
listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null,
workflowInstanceLink.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); workflowInstanceLink.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} }
long lastDettPraticaId = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(
//long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); intPratica.getIntPraticaId()).getDettPraticaId();
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
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 buttonIdAnnullaRicGeologo = "buttonIdAnnullaRicGeologo_" + randomId;
String buttonIdAggiungiDettPraticheAlControllo = "buttonIdAggiungiDettPraticheAlControllo_" + randomId; String buttonIdAggiungiDettPraticheAlControllo = "buttonIdAggiungiDettPraticheAlControllo_" + randomId;
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
long territorioGroupId = territorio.getGroupId(); long territorioGroupId = territorio.getGroupId();
%> %>
<liferay-ui:icon-menu icon="" showWhenSingleIcon="false" showExpanded="true" cssClass="menu_button_activity"> <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"> <div title='<%= LanguageUtil.get(pageContext, "workflow-action-open-pratica") %>' class="tooltip-info">
<liferay-ui:icon iconCssClass="fa fa-folder-open" <liferay-ui:icon iconCssClass="fa fa-folder-open" linkCssClass="btn btn-action" target="_blank" message=""
linkCssClass="btn btn-action" url="<%= FascicoloURLUtil.getFascicoloBOViewURLNoHost(controlloPratica.getCompanyId(),
target="_blank" controlloPratica.getIntPraticaId()) %>" />
message=""
url="<%= FascicoloURLUtil.getFascicoloBOViewURLNoHost(controlloPratica.getCompanyId(), controlloPratica.getIntPraticaId()) %>" />
</div> </div>
<c:if test="<%= listaTask.isEmpty() && workflowInstanceLink != null %>"> <c:if test="<%= listaTask.isEmpty() && workflowInstanceLink != null %>">
<% <%
@ -91,19 +60,15 @@
</c:if> </c:if>
<c:if test="<%= !listaTask.isEmpty() %>"> <c:if test="<%= !listaTask.isEmpty() %>">
<% <%
PortletURL workflowTaskURL = PortletURLFactoryUtil.create(request, PortletKeys.MY_WORKFLOW_TASKS,controlPanelPlid, PortletRequest.RENDER_PHASE); PortletURL workflowTaskURL = PortletURLFactoryUtil.create(request, PortletKeys.MY_WORKFLOW_TASKS,
workflowTaskURL.setParameter("struts_action", controlPanelPlid, PortletRequest.RENDER_PHASE);
"/my_workflow_tasks/edit_workflow_task"); workflowTaskURL.setParameter("struts_action", "/my_workflow_tasks/edit_workflow_task");
workflowTaskURL.setParameter("workflowTaskId", String.valueOf(listaTask.get(0).getWorkflowTaskId())); workflowTaskURL.setParameter("workflowTaskId", String.valueOf(listaTask.get(0).getWorkflowTaskId()));
workflowTaskURL.setPortletMode(PortletMode.VIEW); workflowTaskURL.setPortletMode(PortletMode.VIEW);
workflowTaskURL.setWindowState(LiferayWindowState.POP_UP); workflowTaskURL.setWindowState(LiferayWindowState.POP_UP);
%> %>
<div title='<%= LanguageUtil.get(pageContext, "workflow-action-manage") %>' class="tooltip-info"> <div title='<%= LanguageUtil.get(pageContext, "workflow-action-manage") %>' class="tooltip-info">
<liferay-ui:icon useDialog="true" <liferay-ui:icon useDialog="true" iconCssClass="fa fa-list-ol" linkCssClass="btn btn-action" message=""
iconCssClass="fa fa-list-ol"
linkCssClass="btn btn-action"
message=""
url='<%= workflowTaskURL.toString() + "&controlPanelCategory=my" %>' /> url='<%= workflowTaskURL.toString() + "&controlPanelCategory=my" %>' />
</div> </div>
</c:if> </c:if>
@ -118,9 +83,7 @@
<liferay-util:param name="redirect" value="<%= currentURL %>" /> <liferay-util:param name="redirect" value="<%= currentURL %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<div title='<%= LanguageUtil.get(pageContext, "workflow-action-riassegna-al-ruolo") %>' class="tooltip-info"> <div title='<%= LanguageUtil.get(pageContext, "workflow-action-riassegna-al-ruolo") %>' class="tooltip-info">
<liferay-ui:icon iconCssClass="fa fa-users" <liferay-ui:icon iconCssClass="fa fa-users" linkCssClass="btn btn-action" message=""
linkCssClass="btn btn-action"
message=""
url="<%= riassegnaAlRuoloUrl %>" /> url="<%= riassegnaAlRuoloUrl %>" />
</div> </div>
</c:if> </c:if>
@ -129,111 +92,100 @@
boolean assegnazionePossibile = false; boolean assegnazionePossibile = false;
for (WorkflowTaskAssignee workflowTaskAssignee : listaTask.get(0).getWorkflowTaskAssignees()) { for (WorkflowTaskAssignee workflowTaskAssignee : listaTask.get(0).getWorkflowTaskAssignees()) {
if (workflowTaskAssignee.getAssigneeClassName().equalsIgnoreCase(Role.class.getName()) if (workflowTaskAssignee.getAssigneeClassName().equalsIgnoreCase(Role.class.getName())
&& UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), controlloPratica.getGroupId(), workflowTaskAssignee.getAssigneeClassPK(), true)){ && UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), controlloPratica.getGroupId(),
workflowTaskAssignee.getAssigneeClassPK(), true)) {
assegnazionePossibile = true; assegnazionePossibile = true;
} }
} }
%> %>
<%-- <c:if tst="<%= !listaTask.get(0).getName().equalsIgnoreCase(WorkflowConstants.WORKFLOW_TASKNAME_ESITO) %>">
<c:if test="<%=listaTask.get(0).getAssigneeUserId()!=user.getUserId()
&& assegnazionePossibile %>">
<liferay-portlet:actionURL name="assegnamiTask" var="assegnamiTaskUrl">
<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-portlet:actionURL>
<div title='<%=LanguageUtil.get(pageContext,"workflow-action-assegna-a-me") %>' class="tooltip-info">
<liferay-ui:icon iconCssClass="fa fa-user-plus"
linkCssClass="btn btn-action"
message=""
url="<%= assegnamiTaskUrl %>" />
</div>
</c:if>
</c:if> --%>
</c:if> </c:if>
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.CAMBIO_ISTRUTTORE) %>"> ActionKeys.CAMBIO_ISTRUTTORE) %>">
<c:if test="<%= Validator.isNotNull(intPratica.getStatusByUserId()) %>"> <c:if test="<%= Validator.isNotNull(intPratica.getStatusByUserId()) %>">
<liferay-util:include page="/html/gestioneattivita/actions/action_cambio_istruttore.jsp" servletContext="<%= application %>" > <liferay-util:include page="/html/gestioneattivita/actions/action_cambio_istruttore.jsp"
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> servletContext="<%= application %>" >
<liferay-util:param name="controlloPraticaId" value="<%=String.valueOf(controlloPratica.getControlloPraticaId()) %>"></liferay-util:param> <liferay-util:param name="intPraticaId"
<liferay-util:param name="buttonIdCambioIstruttore" value="<%=buttonIdCambioIstruttore %>"></liferay-util:param> value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-util:param name="controlloPraticaId"
value="<%= String.valueOf(controlloPratica.getControlloPraticaId()) %>" />
<liferay-util:param name="buttonIdCambioIstruttore" value="<%= buttonIdCambioIstruttore %>" />
</liferay-util:include> </liferay-util:include>
<div title='<%=LanguageUtil.get(pageContext,"workflow-action-cambia-istruttore") %>' class="tooltip-info"> <div title='<%= LanguageUtil.get(pageContext, "workflow-action-cambia-istruttore") %>'
<liferay-ui:icon id="<%=buttonIdCambioIstruttore %>" class="tooltip-info">
iconCssClass="fa fa-user-circle" <liferay-ui:icon id="<%= buttonIdCambioIstruttore %>" iconCssClass="fa fa-user-circle"
linkCssClass="btn btn-action" linkCssClass="btn btn-action" message="" url="#" />
message=""
url="#" />
</div> </div>
</c:if> </c:if>
</c:if> </c:if>
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId()%>"> 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(
<liferay-util:include page="/html/gestioneattivita/actions/action_seleziona_geologo.jsp" servletContext="<%= application %>" > WorkflowConstants.WORKFLOW_TASKNAME_ASSEGNAZIONE)
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> || listaTask.get(0).getName().equalsIgnoreCase(WorkflowConstants.WORKFLOW_TASKNAME_ESITO) %>">
<liferay-util:param name="dettPraticaId" value="<%=String.valueOf(controlloPratica.getDettPraticaId()) %>"></liferay-util:param> <liferay-util:include page="/html/gestioneattivita/actions/action_seleziona_geologo.jsp"
<liferay-util:param name="buttonIdSelezionaGeologo" value="<%=buttonIdSelezionaGeologo %>"></liferay-util:param> servletContext="<%= application %>" >
<liferay-util:param name="intPraticaId"
value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-util:param name="dettPraticaId"
value="<%= String.valueOf(controlloPratica.getDettPraticaId()) %>" />
<liferay-util:param name="buttonIdSelezionaGeologo" value="<%= buttonIdSelezionaGeologo %>" />
</liferay-util:include> </liferay-util:include>
<div title='<%= LanguageUtil.get(pageContext, "fascicolo-action-seleziona-geologo") %>'
<div title='<%=LanguageUtil.get(pageContext,"fascicolo-action-seleziona-geologo") %>' class="tooltip-info"> 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 test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId()%>"> <c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,
<c:if test="<%=WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId()) && ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPratica.getIntPraticaId()) != 0 %>"> ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId() %>">
<liferay-util:include page="/html/gestioneattivita/actions/action_annulla_ric_geologo.jsp" servletContext="<%= application %>" > <c:if test="<%= WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId())
<liferay-util:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> && ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(
<liferay-util:param name="dettPraticaId" value="<%=String.valueOf(controlloPratica.getDettPraticaId()) %>"></liferay-util:param> intPratica.getIntPraticaId()) != 0 %>">
<liferay-util:param name="buttonIdAnnullaRicGeologo" value="<%=buttonIdAnnullaRicGeologo %>"></liferay-util:param> <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 name="dettPraticaId"
value="<%= String.valueOf(controlloPratica.getDettPraticaId()) %>" />
<liferay-util:param name="buttonIdAnnullaRicGeologo"
value="<%= buttonIdAnnullaRicGeologo %>" />
</liferay-util:include> </liferay-util:include>
<div title='<%= LanguageUtil.get(pageContext, "fascicolo-cancella-parere-geologo") %>'
<div title='<%=LanguageUtil.get(pageContext,"fascicolo-cancella-parere-geologo") %>' class="tooltip-info"> class="tooltip-info">
<liferay-ui:icon id="<%=buttonIdAnnullaRicGeologo%>" linkCssClass="btn btn-action" iconCssClass="fa fa-times-circle" message="" url="#" /> <liferay-ui:icon id="<%= buttonIdAnnullaRicGeologo %>" linkCssClass="btn btn-action"
iconCssClass="fa fa-times-circle" message="" url="#" />
</div> </div>
</c:if> </c:if>
</c:if> </c:if>
</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"
<c:if test="<%=lastDettPraticaId != controlloPratica.getDettPraticaId() && intPratica.getStatusByUserId()== user.getUserId()%>"> 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 name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId()) %>"></liferay-util:param> <liferay-util:param name="controlloPraticaId"
<liferay-util:param name="controlloPraticaId" value="<%=String.valueOf(controlloPratica.getControlloPraticaId()) %>"></liferay-util:param> value="<%= String.valueOf(controlloPratica.getControlloPraticaId()) %>" />
<liferay-util:param name="buttonIdAggiungiDettPraticheAlControllo" value="<%=buttonIdAggiungiDettPraticheAlControllo %>"></liferay-util:param> <liferay-util:param name="buttonIdAggiungiDettPraticheAlControllo"
value="<%= buttonIdAggiungiDettPraticheAlControllo %>" />
</liferay-util:include> </liferay-util:include>
<div title='<%= LanguageUtil.get(pageContext, "workflow-action-aggiungi-pratiche") %>'
<div title='<%=LanguageUtil.get(pageContext,"workflow-action-aggiungi-pratiche") %>' class="tooltip-info"> class="tooltip-info">
<liferay-ui:icon id="<%= buttonIdAggiungiDettPraticheAlControllo %>" <liferay-ui:icon id="<%= buttonIdAggiungiDettPraticheAlControllo %>"
iconCssClass="fa fa-calendar-plus-o" iconCssClass="fa fa-calendar-plus-o" linkCssClass="btn btn-action" message="" url="#" />
linkCssClass="btn btn-action"
message=""
url="#" />
</div> </div>
</c:if> </c:if>
</c:if> </c:if>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
<script type="text/javascript"> <script type="text/javascript">
YUI().use( YUI().use('aui-tooltip', function(Y) {
'aui-tooltip', new Y.TooltipDelegate({
function(Y) {
new Y.TooltipDelegate(
{
trigger: '.tooltip-info', trigger: '.tooltip-info',
position: 'top', position: 'top',
cssClass: 'tooltip-help', cssClass: 'tooltip-help',
html: true, html: true,
opacity: 1 opacity: 1,
} });
); });
}
);
</script> </script>

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

@ -1,51 +1,34 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.model.UserGroupRole"%>
<%@page import="com.liferay.portal.model.UserGroup"%>
<%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%>
<%@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.User"%>
<%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="javax.portlet.PortletURL"%> <%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@include file="/html/gestioneattivita/init.jsp"%> <%@include file="/html/gestioneattivita/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long controlloPraticaId = ParamUtil.getLong(request, "controlloPraticaId"); long controlloPraticaId = ParamUtil.getLong(request, "controlloPraticaId");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId);
String buttonIdAggiungiDettPraticheAlControllo = ParamUtil.getString(request, "buttonIdAggiungiDettPraticheAlControllo"); String buttonIdAggiungiDettPraticheAlControllo = ParamUtil.getString(request, "buttonIdAggiungiDettPraticheAlControllo");
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
String orderByType = ParamUtil.getString(request, "orderByType", "asc"); String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
String formNameAggiungiDettPraticheAlControllo = "formNameAggiungiDettPraticheAlControllo_" + randomId; String formNameAggiungiDettPraticheAlControllo = "formNameAggiungiDettPraticheAlControllo_" + randomId;
String divIdAggiungiDettPraticheAlControllo = "divIdAggiungiDettPraticheAlControllo_" + randomId; String divIdAggiungiDettPraticheAlControllo = "divIdAggiungiDettPraticheAlControllo_" + randomId;
User istruttore = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()); User istruttore = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId());
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE);
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(controlloPratica.getGroupId(),role.getRoleId());
DettPratica dettPraticaAttuale = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica.getDettPraticaId()); DettPratica dettPraticaAttuale = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica.getDettPraticaId());
DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(controlloPratica.getIntPraticaId()); DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(controlloPratica.getIntPraticaId());
%> %>
<liferay-portlet:actionURL name="aggiungiDettPraticheAlControllo" var="aggiungiDettPraticheAlControlloUrl"> <liferay-portlet:actionURL name="aggiungiDettPraticheAlControllo" var="aggiungiDettPraticheAlControlloUrl">
<liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> <liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-util:param name="controlloPraticaId" value="<%= String.valueOf(controlloPraticaId) %>" /> <liferay-util:param name="controlloPraticaId" value="<%= String.valueOf(controlloPraticaId) %>" />
<liferay-util:param name="lastDettPraticaId" value="<%= String.valueOf(lastDettPratica.getDettPraticaId()) %>" /> <liferay-util:param name="lastDettPraticaId" value="<%= String.valueOf(lastDettPratica.getDettPraticaId()) %>" />
<liferay-util:param name="redirect" value="<%= currentURL %>" /> <liferay-util:param name="redirect" value="<%= currentURL %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:form name="<%= formNameAggiungiDettPraticheAlControllo %>" method="post"
action="<%= aggiungiDettPraticheAlControlloUrl %>">
<aui:form name="<%=formNameAggiungiDettPraticheAlControllo %>" method="post" action="<%= aggiungiDettPraticheAlControlloUrl %>" >
<div id='<%= renderResponse.getNamespace() + divIdAggiungiDettPraticheAlControllo %>' class="hide"> <div id='<%= renderResponse.getNamespace() + divIdAggiungiDettPraticheAlControllo %>' class="hide">
<div> <div>
<liferay-ui:message key="pratica-attuale" /> <strong> <%= dettPraticaAttuale.getTitle(locale) %> </strong> <liferay-ui:message key="pratica-attuale" /> <strong> <%= dettPraticaAttuale.getTitle(locale) %> </strong>
</div> </div>
@ -54,24 +37,27 @@
</div> </div>
<ul> <ul>
<% <%
List<DettPratica> elencoPratiche = DettPraticaLocalServiceUtil.findCompletedByIntPraticaAndSuccessivoDettPratica(intPraticaId, controlloPratica.getDettPraticaId()); List<DettPratica> elencoPratiche = DettPraticaLocalServiceUtil
.findCompletedByIntPraticaAndSuccessivoDettPratica(intPraticaId,
controlloPratica.getDettPraticaId());
for (DettPratica dettPratica: elencoPratiche) { for (DettPratica dettPratica: elencoPratiche) {
out.print("<li>"+dettPratica.getFullDescription()+"</li>"); out.print("<li>");
out.print(dettPratica.getFullDescription());
out.print("</li>");
} }
%> %>
</ul> </ul>
<div> <div>
<liferay-ui:message key="vuoi-aggiungere-al-controllo" /> <liferay-ui:message key="vuoi-aggiungere-al-controllo" />
</div> </div>
</div> </div>
<liferay-util:include page="/html/common/submit_window.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/submit_window.jsp" servletContext="<%= application %>">
<liferay-util:param name="formName" value="<%=formNameAggiungiDettPraticheAlControllo %>"></liferay-util:param> <liferay-util:param name="formName" value="<%= formNameAggiungiDettPraticheAlControllo %>" />
<liferay-util:param name="titolo" value="Cambia titolare pratica"></liferay-util:param> <liferay-util:param name="titolo" value="Cambia titolare pratica" />
<liferay-util:param name="buttonId" value="<%=buttonIdAggiungiDettPraticheAlControllo %>"></liferay-util:param> <liferay-util:param name="buttonId" value="<%= buttonIdAggiungiDettPraticheAlControllo %>" />
<liferay-util:param name="buttonConferma" value="Aggiungi"></liferay-util:param> <liferay-util:param name="buttonConferma" value="Aggiungi" />
<liferay-util:param name="contentDiv" value="<%=divIdAggiungiDettPraticheAlControllo %>"></liferay-util:param> <liferay-util:param name="contentDiv" value="<%= divIdAggiungiDettPraticheAlControllo %>" />
<liferay-util:param name="width" value="500"></liferay-util:param> <liferay-util:param name="width" value="500" />
<liferay-util:param name="buttonBar" value="true"></liferay-util:param> <liferay-util:param name="buttonBar" value="true" />
</liferay-util:include> </liferay-util:include>
</aui:form> </aui:form>

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

@ -10,47 +10,42 @@
<%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.model.Role"%>
<%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletURL"%>
<%@include file="/html/gestioneattivita/init.jsp"%> <%@include file="/html/gestioneattivita/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long controlloPraticaId = ParamUtil.getLong(request, "controlloPraticaId"); long controlloPraticaId = ParamUtil.getLong(request, "controlloPraticaId");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId);
String buttonIdCambioIstruttore = ParamUtil.getString(request, "buttonIdCambioIstruttore"); String buttonIdCambioIstruttore = ParamUtil.getString(request, "buttonIdCambioIstruttore");
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
String orderByType = ParamUtil.getString(request, "orderByType", "asc"); String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
String formNameSelezionaCambioIstruttore = "formNameSelezionaCambioIstruttore_" + randomId; String formNameSelezionaCambioIstruttore = "formNameSelezionaCambioIstruttore_" + randomId;
String divIdSelezionaCambioIstruttore = "divIdSelezionaCambioIstruttore_" + randomId; String divIdSelezionaCambioIstruttore = "divIdSelezionaCambioIstruttore_" + randomId;
User istruttore = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()); User istruttore = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId());
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE);
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(controlloPratica.getGroupId(),role.getRoleId()); List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
controlloPratica.getGroupId(), role.getRoleId());
%> %>
<liferay-portlet:actionURL name="cambioIstruttore" var="cambioIstruttoreUrl"> <liferay-portlet:actionURL name="cambioIstruttore" var="cambioIstruttoreUrl">
<liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> <liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-util:param name="controlloPraticaId" value="<%= String.valueOf(controlloPraticaId) %>" /> <liferay-util:param name="controlloPraticaId" value="<%= String.valueOf(controlloPraticaId) %>" />
<liferay-util:param name="redirect" value="<%= currentURL %>" /> <liferay-util:param name="redirect" value="<%= currentURL %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:form name="<%= formNameSelezionaCambioIstruttore %>" method="post" action="<%= cambioIstruttoreUrl %>"> <aui:form name="<%= formNameSelezionaCambioIstruttore %>" method="post" action="<%= cambioIstruttoreUrl %>">
<div id='<%= renderResponse.getNamespace() + divIdSelezionaCambioIstruttore %>' class="hide"> <div id='<%= renderResponse.getNamespace() + divIdSelezionaCambioIstruttore %>' class="hide">
<div> <div>
<liferay-ui:message key="istruttore-attuale" /> <strong> <%= istruttore.getFullName() %> </strong> <liferay-ui:message key="istruttore-attuale" /> <strong> <%= istruttore.getFullName() %> </strong>
</div> </div>
<aui:select name="istruttoreId" label="<%=StringPool.BLANK %>"> <aui:select name="istruttoreId" label="">
<aui:option label="" value="0" /> <aui:option label="" value="0" />
<% <%
for (UserGroupRole userGroupRole: userGroupRoles) { for (UserGroupRole userGroupRole: userGroupRoles) {
if (userGroupRole.getUserId() != istruttore.getUserId()) { if (userGroupRole.getUserId() != istruttore.getUserId()) {
User istruttoreTmp = UserLocalServiceUtil.getUser(userGroupRole.getUserId()); User istruttoreTmp = UserLocalServiceUtil.getUser(userGroupRole.getUserId());
String nominativo = istruttoreTmp.getFullName()+StringPool.SPACE+StringPool.DASH+StringPool.SPACE+istruttoreTmp.getScreenName();%> String nominativo = istruttoreTmp.getFullName() + StringPool.SPACE + StringPool.DASH
+ StringPool.SPACE + istruttoreTmp.getScreenName();
%>
<aui:option label="<%= nominativo %>" value="<%= istruttoreTmp.getUserId() %>" /> <aui:option label="<%= nominativo %>" value="<%= istruttoreTmp.getUserId() %>" />
<% <%
} }
@ -59,12 +54,12 @@
</aui:select> </aui:select>
</div> </div>
<liferay-util:include page="/html/common/submit_window.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/submit_window.jsp" servletContext="<%= application %>">
<liferay-util:param name="formName" value="<%=formNameSelezionaCambioIstruttore %>"></liferay-util:param> <liferay-util:param name="formName" value="<%= formNameSelezionaCambioIstruttore %>" />
<liferay-util:param name="titolo" value="Cambia titolare pratica"></liferay-util:param> <liferay-util:param name="titolo" value="Cambia titolare pratica" />
<liferay-util:param name="buttonId" value="<%=buttonIdCambioIstruttore %>"></liferay-util:param> <liferay-util:param name="buttonId" value="<%= buttonIdCambioIstruttore %>" />
<liferay-util:param name="buttonConferma" value="CONFERMA"></liferay-util:param> <liferay-util:param name="buttonConferma" value="CONFERMA" />
<liferay-util:param name="contentDiv" value="<%=divIdSelezionaCambioIstruttore %>"></liferay-util:param> <liferay-util:param name="contentDiv" value="<%= divIdSelezionaCambioIstruttore %>" />
<liferay-util:param name="width" value="500"></liferay-util:param> <liferay-util:param name="width" value="500" />
<liferay-util:param name="buttonBar" value="true"></liferay-util:param> <liferay-util:param name="buttonBar" value="true" />
</liferay-util:include> </liferay-util:include>
</aui:form> </aui:form>

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

@ -1,59 +1,46 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.ListUtil"%> <%@page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@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="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="java.util.ArrayList"%> <%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@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"%> <%@include file="/html/gestioneattivita/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
String buttonIdSelezionaGeologo = ParamUtil.getString(request, "buttonIdSelezionaGeologo"); String buttonIdSelezionaGeologo = ParamUtil.getString(request, "buttonIdSelezionaGeologo");
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
String orderByType = ParamUtil.getString(request, "orderByType", "asc"); String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
String formNameSelezionaGeologo = "formNameSelezionaGeologo_" + randomId; String formNameSelezionaGeologo = "formNameSelezionaGeologo_" + randomId;
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); List<ParereGeologo> pareriGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(intPraticaId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
for (ParereGeologo parereGeologo : pareriGeologo) { for (ParereGeologo parereGeologo : pareriGeologo) {
if (Validator.isNull(parereGeologo.getDtCompilazione())) { if (Validator.isNull(parereGeologo.getDtCompilazione())) {
geologi.remove(UserLocalServiceUtil.getUser(parereGeologo.getGeologoUserId())); geologi.remove(UserLocalServiceUtil.getUser(parereGeologo.getGeologoUserId()));
} }
} }
%> %>
<liferay-portlet:actionURL name="aggiungiRichiestaParere" var="aggiungiRichiestaParereUrl"> <liferay-portlet:actionURL name="aggiungiRichiestaParere" var="aggiungiRichiestaParereUrl">
<liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> <liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" /> <liferay-util:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-util:param name="redirect" value="<%= currentURL %>" /> <liferay-util:param name="redirect" value="<%= currentURL %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:form name="<%= formNameSelezionaGeologo %>" method="post" action="<%= aggiungiRichiestaParereUrl %>"> <aui:form name="<%= formNameSelezionaGeologo %>" method="post" action="<%= aggiungiRichiestaParereUrl %>">
<div id='<%= renderResponse.getNamespace() + divIdSelezionaGeologo %>' class="hide"> <div id='<%= renderResponse.getNamespace() + divIdSelezionaGeologo %>' class="hide">
<aui:select name="geologoId" label="<%=StringPool.BLANK %>" required="true"> <aui:select name="geologoId" label="" required="true">
<aui:option label="Seleziona funzionario" value="" /> <aui:option label="Seleziona funzionario" value="" />
<% <%
for (User geologo: geologi) { for (User geologo: geologi) {
List<Organization> listaOrganizzazioni = OrganizationLocalServiceUtil.getUserOrganizations(
List<Organization> listaOrganizzazioni = OrganizationLocalServiceUtil.getUserOrganizations(geologo.getUserId()); geologo.getUserId());
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(geologo.getFullName()); sb.append(geologo.getFullName()).append(StringPool.SPACE).append(StringPool.DASH).append(StringPool.SPACE)
sb.append(StringPool.SPACE); .append(ListUtil.toString(listaOrganizzazioni, "name", StringPool.COMMA_AND_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="<%= geologo.getUserId() %>" /> <aui:option label="<%= sb.toString() %>" value="<%= geologo.getUserId() %>" />
<% <%
@ -61,14 +48,13 @@
%> %>
</aui:select> </aui:select>
</div> </div>
<liferay-util:include page="/html/common/submit_window.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/submit_window.jsp" servletContext="<%= application %>">
<liferay-util:param name="formName" value="<%=formNameSelezionaGeologo %>"></liferay-util:param> <liferay-util:param name="formName" value="<%= formNameSelezionaGeologo %>" />
<liferay-util:param name="titolo" value="Seleziona parere endoprocedimentale"></liferay-util:param> <liferay-util:param name="titolo" value="Seleziona parere endoprocedimentale" />
<liferay-util:param name="buttonId" value="<%=buttonIdSelezionaGeologo %>"></liferay-util:param> <liferay-util:param name="buttonId" value="<%= buttonIdSelezionaGeologo %>" />
<liferay-util:param name="buttonConferma" value="CONFERMA"></liferay-util:param> <liferay-util:param name="buttonConferma" value="CONFERMA" />
<liferay-util:param name="contentDiv" value="<%=divIdSelezionaGeologo %>"></liferay-util:param> <liferay-util:param name="contentDiv" value="<%= divIdSelezionaGeologo %>" />
<liferay-util:param name="width" value="500"></liferay-util:param> <liferay-util:param name="width" value="500" />
<liferay-util:param name="buttonBar" value="true"></liferay-util:param> <liferay-util:param name="buttonBar" value="true" />
</liferay-util:include> </liferay-util:include>
</aui:form> </aui:form>

62
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/altri_task.jsp

@ -1,14 +1,12 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.search.Document"%> <%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%> <%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@ include file="/html/gestioneattivita/init.jsp" %> <%@ include file="/html/gestioneattivita/init.jsp" %>
<% <%
boolean doSearch = true; boolean doSearch = true;
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
//GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER //GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK); String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK);
String protocollo = ParamUtil.getString(request, "protocollo", StringPool.BLANK); String protocollo = ParamUtil.getString(request, "protocollo", StringPool.BLANK);
@ -16,7 +14,6 @@ String tipoPratica = ParamUtil.getString(request, "tipoPratica", StringPool.BLAN
String statoPratica = ParamUtil.getString(request, "statoPratica", StringPool.BLANK); String statoPratica = ParamUtil.getString(request, "statoPratica", StringPool.BLANK);
String committente = ParamUtil.getString(request, "committente", StringPool.BLANK); String committente = ParamUtil.getString(request, "committente", StringPool.BLANK);
String soggettiInterconnessi = ParamUtil.getString(request, "soggettiInterconnessi", StringPool.BLANK); String soggettiInterconnessi = ParamUtil.getString(request, "soggettiInterconnessi", StringPool.BLANK);
//ADT ADT BUG BO ID = 8
String istruttore = ParamUtil.getString(request, "istruttore", StringPool.BLANK); String istruttore = ParamUtil.getString(request, "istruttore", StringPool.BLANK);
String ufficio = ParamUtil.getString(request, "ufficio", StringPool.BLANK); String ufficio = ParamUtil.getString(request, "ufficio", StringPool.BLANK);
String ordinaPer = ParamUtil.getString(request, "ordinaPer", StringPool.BLANK); String ordinaPer = ParamUtil.getString(request, "ordinaPer", StringPool.BLANK);
@ -24,14 +21,12 @@ String ordinaTipo = ParamUtil.getString(request, "ordinaTipo", StringPool.BLANK)
String comuneSearch = ParamUtil.getString(request, "comune", StringPool.BLANK); String comuneSearch = ParamUtil.getString(request, "comune", StringPool.BLANK);
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita", StringPool.BLANK); String tipoAttivita = ParamUtil.getString(request, "tipoAttivita", StringPool.BLANK);
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura", StringPool.BLANK); String tipoProcedura = ParamUtil.getString(request, "tipoProcedura", StringPool.BLANK);
iteratorURL.setParameter("numeroProgetto", numeroProgetto); iteratorURL.setParameter("numeroProgetto", numeroProgetto);
iteratorURL.setParameter("protocollo", protocollo); iteratorURL.setParameter("protocollo", protocollo);
iteratorURL.setParameter("tipoPratica", tipoPratica); iteratorURL.setParameter("tipoPratica", tipoPratica);
iteratorURL.setParameter("statoPratica", statoPratica); iteratorURL.setParameter("statoPratica", statoPratica);
iteratorURL.setParameter("committente", committente); iteratorURL.setParameter("committente", committente);
iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessi); iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessi);
//ADT ADT BUG BO ID = 8
iteratorURL.setParameter("istruttore", istruttore); iteratorURL.setParameter("istruttore", istruttore);
iteratorURL.setParameter("dataRichiestaInizio", dataRichiestaInizio); iteratorURL.setParameter("dataRichiestaInizio", dataRichiestaInizio);
iteratorURL.setParameter("dataRichiestaFine", dataRichiestaFine); iteratorURL.setParameter("dataRichiestaFine", dataRichiestaFine);
@ -41,17 +36,12 @@ iteratorURL.setParameter("tipoAttivita", tipoAttivita);
iteratorURL.setParameter("tipoProcedura", tipoProcedura); iteratorURL.setParameter("tipoProcedura", tipoProcedura);
iteratorURL.setParameter("ordinaPer", ordinaPer); iteratorURL.setParameter("ordinaPer", ordinaPer);
iteratorURL.setParameter("ordinaTipo", ordinaTipo); iteratorURL.setParameter("ordinaTipo", ordinaTipo);
iteratorURL.setParameter("tabs1", tabs1); iteratorURL.setParameter("tabs1", tabs1);
String orderByType = ParamUtil.getString(request, "orderByType", "asc"); String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String keywords = StringPool.BLANK; String keywords = StringPool.BLANK;
request.setAttribute("tabs1", "Tab_AtriTask"); request.setAttribute("tabs1", "Tab_AtriTask");
%> %>
<!-- Funzione per esportare la ricerca --> <!-- Funzione per esportare la ricerca -->
<liferay-portlet:resourceURL id="exportRicercaAltreAttivita" var="exportRicercaAltreAttivitaURL"> <liferay-portlet:resourceURL id="exportRicercaAltreAttivita" var="exportRicercaAltreAttivitaURL">
<liferay-portlet:param name="dataRichiestaInizio" value="<%= dataRichiestaInizio %>" /> <liferay-portlet:param name="dataRichiestaInizio" value="<%= dataRichiestaInizio %>" />
@ -62,7 +52,6 @@ request.setAttribute("tabs1", "Tab_AtriTask");
<liferay-portlet:param name="statoPratica" value="<%= statoPratica %>" /> <liferay-portlet:param name="statoPratica" value="<%= statoPratica %>" />
<liferay-portlet:param name="committente" value="<%= committente %>" /> <liferay-portlet:param name="committente" value="<%= committente %>" />
<liferay-portlet:param name="soggettiInterconnessi" value="<%= soggettiInterconnessi %>" /> <liferay-portlet:param name="soggettiInterconnessi" value="<%= soggettiInterconnessi %>" />
<!-- ADT BUG BO ID = 8 -->
<liferay-portlet:param name="istruttore" value="<%= istruttore %>" /> <liferay-portlet:param name="istruttore" value="<%= istruttore %>" />
<liferay-portlet:param name="ufficio" value="<%= ufficio %>" /> <liferay-portlet:param name="ufficio" value="<%= ufficio %>" />
<liferay-portlet:param name="comune" value="<%= comuneSearch %>" /> <liferay-portlet:param name="comune" value="<%= comuneSearch %>" />
@ -71,60 +60,39 @@ request.setAttribute("tabs1", "Tab_AtriTask");
<liferay-portlet:param name="ordinaPer" value="<%= ordinaPer %>" /> <liferay-portlet:param name="ordinaPer" value="<%= ordinaPer %>" />
<liferay-portlet:param name="ordinaTipo" value="<%= ordinaTipo %>" /> <liferay-portlet:param name="ordinaTipo" value="<%= ordinaTipo %>" />
<liferay-portlet:param name="searchForExport" value="true" /> <liferay-portlet:param name="searchForExport" value="true" />
<liferay-portlet:param name="cmd" value="exportRicercaAltreAttivita"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicercaAltreAttivita" />
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<div class="row-fluid" style="margin-top: 10px">
<div class="row-fluid" style="margin-top:10px;">
<div class="span10"></div> <div class="span10"></div>
<div class="span2"> <div class="span2">
<aui:button-row cssClass="margin-top-0"> <aui:button-row cssClass="margin-top-0">
<liferay-ui:icon linkCssClass="btn btn-action btn-primary pull-right" iconCssClass="fa fa-floppy-o" message="Esporta Ricerca" label="<%= true %>" url="<%= exportRicercaAltreAttivitaURL %>" target="_blank" /> <liferay-ui:icon linkCssClass="btn btn-action btn-primary pull-right" iconCssClass="fa fa-floppy-o"
message="Esporta Ricerca" label="true" url="<%= exportRicercaAltreAttivitaURL %>" target="_blank" />
</aui:button-row> </aui:button-row>
</div> </div>
</div> </div>
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" iteratorURL="<%= iteratorURL %>"
<liferay-ui:search-container orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
emptyResultsMessage="no-entries-were-found"
iteratorURL="<%= iteratorURL %>"
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"
>
<% <%
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>(); List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
Hits hits = ControlloPraticaAdvancedSearch.searchAltriTask(request, user, searchContainer.getStart(), searchContainer.getEnd()); Hits hits = ControlloPraticaAdvancedSearch.searchAltriTask(request, user, searchContainer.getStart(),
searchContainer.getEnd());
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId"); String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) { if (Validator.isNotNull(controlloPraticaId)) {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(
ControlloPratica controlloPratica = GetterUtil.getLong(controlloPraticaId));
ControlloPraticaLocalServiceUtil.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) { if (Validator.isNotNull(controlloPratica)) {
listaControlloPratica.add(controlloPratica); listaControlloPratica.add(controlloPratica);
} }
} }
} }
searchContainer.setTotal(hits.getLength()); searchContainer.setTotal(hits.getLength());
%> %>
<liferay-ui:search-container-results results="<%=listaControlloPratica%>" />
<liferay-ui:search-container-results <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.ControlloPratica"
results="<%=listaControlloPratica%>" modelVar="controlloPratica">
/>
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.ControlloPratica"
modelVar="controlloPratica"
>
<%@include file="/html/gestioneattivita/view_columns.jspf"%> <%@include file="/html/gestioneattivita/view_columns.jspf"%>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="true" />
<liferay-ui:search-iterator paginate="<%= true %>" />
</liferay-ui:search-container> </liferay-ui:search-container>

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp

@ -3,6 +3,7 @@
<%@page import="com.liferay.portal.kernel.search.Indexer"%> <%@page import="com.liferay.portal.kernel.search.Indexer"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%> <%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="com.liferay.portal.kernel.search.Document"%> <%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@ include file="/html/gestioneattivita/init.jsp"%> <%@ include file="/html/gestioneattivita/init.jsp"%>
@ -72,7 +73,7 @@ request.setAttribute("tabs1", "Tab_MieiTask");
<liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/> <liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/>
<liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/> <liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/>
<liferay-portlet:param name="searchForExport" value="true"/> <liferay-portlet:param name="searchForExport" value="true"/>
<liferay-portlet:param name="cmd" value="exportRicercaMieAttivita"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicercaMieAttivita"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<div class="row-fluid" style="margin-top:10px;"> <div class="row-fluid" style="margin-top:10px;">

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_completati.jsp

@ -1,6 +1,7 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.search.Document"%> <%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%> <%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@ include file="/html/gestioneattivita/init.jsp" %> <%@ include file="/html/gestioneattivita/init.jsp" %>
@ -70,7 +71,7 @@ request.setAttribute("tabs1", "Tab_TaskCompletati");
<liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/> <liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/>
<liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/> <liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/>
<liferay-portlet:param name="searchForExport" value="true"/> <liferay-portlet:param name="searchForExport" value="true"/>
<liferay-portlet:param name="cmd" value="exportRicercaAttivitaConcluse"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicercaAttivitaConcluse"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<div class="row-fluid" style="margin-top:10px;"> <div class="row-fluid" style="margin-top:10px;">

17
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_miei_ruoli.jsp

@ -3,14 +3,12 @@
<%@page import="com.liferay.portal.kernel.search.Indexer"%> <%@page import="com.liferay.portal.kernel.search.Indexer"%>
<%@page import="com.liferay.portal.kernel.search.Document"%> <%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%> <%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@ include file="/html/gestioneattivita/init.jsp" %> <%@ include file="/html/gestioneattivita/init.jsp" %>
<% <%
boolean doSearch = true; boolean doSearch = true;
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
//GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER //GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK); String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK);
String protocollo = ParamUtil.getString(request, "protocollo", StringPool.BLANK); String protocollo = ParamUtil.getString(request, "protocollo", StringPool.BLANK);
@ -18,7 +16,6 @@ String tipoPratica = ParamUtil.getString(request, "tipoPratica", StringPool.BLAN
String statoPratica = ParamUtil.getString(request, "statoPratica", StringPool.BLANK); String statoPratica = ParamUtil.getString(request, "statoPratica", StringPool.BLANK);
String committente = ParamUtil.getString(request, "committente", StringPool.BLANK); String committente = ParamUtil.getString(request, "committente", StringPool.BLANK);
String soggettiInterconnessi = ParamUtil.getString(request, "soggettiInterconnessi", StringPool.BLANK); String soggettiInterconnessi = ParamUtil.getString(request, "soggettiInterconnessi", StringPool.BLANK);
//ADT ADT BUG BO ID = 8
String istruttore = ParamUtil.getString(request, "istruttore", StringPool.BLANK); String istruttore = ParamUtil.getString(request, "istruttore", StringPool.BLANK);
String ufficio = ParamUtil.getString(request, "ufficio", StringPool.BLANK); String ufficio = ParamUtil.getString(request, "ufficio", StringPool.BLANK);
String ordinaPer = ParamUtil.getString(request, "ordinaPer", StringPool.BLANK); String ordinaPer = ParamUtil.getString(request, "ordinaPer", StringPool.BLANK);
@ -26,14 +23,12 @@ String ordinaTipo = ParamUtil.getString(request, "ordinaTipo", StringPool.BLANK)
String comuneSearch = ParamUtil.getString(request, "comune", StringPool.BLANK); String comuneSearch = ParamUtil.getString(request, "comune", StringPool.BLANK);
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita", StringPool.BLANK); String tipoAttivita = ParamUtil.getString(request, "tipoAttivita", StringPool.BLANK);
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura", StringPool.BLANK); String tipoProcedura = ParamUtil.getString(request, "tipoProcedura", StringPool.BLANK);
iteratorURL.setParameter("numeroProgetto", numeroProgetto); iteratorURL.setParameter("numeroProgetto", numeroProgetto);
iteratorURL.setParameter("protocollo", protocollo); iteratorURL.setParameter("protocollo", protocollo);
iteratorURL.setParameter("tipoPratica", tipoPratica); iteratorURL.setParameter("tipoPratica", tipoPratica);
iteratorURL.setParameter("statoPratica", statoPratica); iteratorURL.setParameter("statoPratica", statoPratica);
iteratorURL.setParameter("committente", committente); iteratorURL.setParameter("committente", committente);
iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessi); iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessi);
//ADT ADT BUG BO ID = 8
iteratorURL.setParameter("istruttore", istruttore); iteratorURL.setParameter("istruttore", istruttore);
iteratorURL.setParameter("dataRichiestaInizio", dataRichiestaInizio); iteratorURL.setParameter("dataRichiestaInizio", dataRichiestaInizio);
iteratorURL.setParameter("dataRichiestaFine", dataRichiestaFine); iteratorURL.setParameter("dataRichiestaFine", dataRichiestaFine);
@ -43,19 +38,12 @@ iteratorURL.setParameter("tipoAttivita", tipoAttivita);
iteratorURL.setParameter("tipoProcedura", tipoProcedura); iteratorURL.setParameter("tipoProcedura", tipoProcedura);
iteratorURL.setParameter("ordinaPer", ordinaPer); iteratorURL.setParameter("ordinaPer", ordinaPer);
iteratorURL.setParameter("ordinaTipo", ordinaTipo); iteratorURL.setParameter("ordinaTipo", ordinaTipo);
iteratorURL.setParameter("tabs1", tabs1); iteratorURL.setParameter("tabs1", tabs1);
String orderByType = ParamUtil.getString(request, "orderByType", "asc"); String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String keywords = StringPool.BLANK; String keywords = StringPool.BLANK;
request.setAttribute("tabs1", "Tab_TaskMieiRuoli"); request.setAttribute("tabs1", "Tab_TaskMieiRuoli");
%> %>
<!-- Funzione per esportare la ricerca --> <!-- Funzione per esportare la ricerca -->
<liferay-portlet:resourceURL id="exportRicercaMieiRuoli" var="exportRicercaMieiRuoliURL"> <liferay-portlet:resourceURL id="exportRicercaMieiRuoli" var="exportRicercaMieiRuoliURL">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/> <liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/>
@ -66,7 +54,6 @@ request.setAttribute("tabs1", "Tab_TaskMieiRuoli");
<liferay-portlet:param name="statoPratica" value="<%=statoPratica %>"/> <liferay-portlet:param name="statoPratica" value="<%=statoPratica %>"/>
<liferay-portlet:param name="committente" value="<%=committente %>"/> <liferay-portlet:param name="committente" value="<%=committente %>"/>
<liferay-portlet:param name="soggettiInterconnessi" value="<%=soggettiInterconnessi %>"/> <liferay-portlet:param name="soggettiInterconnessi" value="<%=soggettiInterconnessi %>"/>
<!-- ADT BUG BO ID = 8 -->
<liferay-portlet:param name="istruttore" value="<%=istruttore %>"/> <liferay-portlet:param name="istruttore" value="<%=istruttore %>"/>
<liferay-portlet:param name="ufficio" value="<%=ufficio %>"/> <liferay-portlet:param name="ufficio" value="<%=ufficio %>"/>
<liferay-portlet:param name="comune" value="<%=comuneSearch %>"/> <liferay-portlet:param name="comune" value="<%=comuneSearch %>"/>
@ -75,7 +62,7 @@ request.setAttribute("tabs1", "Tab_TaskMieiRuoli");
<liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/> <liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/>
<liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/> <liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/>
<liferay-portlet:param name="searchForExport" value="true"/> <liferay-portlet:param name="searchForExport" value="true"/>
<liferay-portlet:param name="cmd" value="exportRicercaMieiRuoli"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicercaMieiRuoli"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<div class="row-fluid" style="margin-top:10px;"> <div class="row-fluid" style="margin-top:10px;">

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view.jsp

@ -1,6 +1,7 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@ include file="/html/gestioneattivita/init.jsp" %> <%@ include file="/html/gestioneattivita/init.jsp" %>
<liferay-portlet:actionURL varImpl="search2URL" name="search2URL" /> <liferay-portlet:actionURL varImpl="search2URL" name="search2URL" />
@ -21,13 +22,13 @@ search2URL.setParameter("tabs1", tabs1);
<liferay-portlet:resourceURL id="exportCSVDirigente" var="exportCSVDirigente"> <liferay-portlet:resourceURL id="exportCSVDirigente" var="exportCSVDirigente">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/> <liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/>
<liferay-portlet:param name="dataRichiestaFine" value="<%=dataRichiestaFine %>"/> <liferay-portlet:param name="dataRichiestaFine" value="<%=dataRichiestaFine %>"/>
<liferay-portlet:param name="cmd" value="dirigente"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="dirigente"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<liferay-portlet:resourceURL id="exportCSVPO" var="exportCSVPO"> <liferay-portlet:resourceURL id="exportCSVPO" var="exportCSVPO">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/> <liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/>
<liferay-portlet:param name="dataRichiestaFine" value="<%=dataRichiestaFine %>"/> <liferay-portlet:param name="dataRichiestaFine" value="<%=dataRichiestaFine %>"/>
<liferay-portlet:param name="cmd" value="po"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="po"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<c:if test="<%=RoleLocalServiceUtil.hasUserRole(user.getUserId(), ruoloDirigente.getRoleId()) %>"> <c:if test="<%=RoleLocalServiceUtil.hasUserRole(user.getUserId(), ruoloDirigente.getRoleId()) %>">

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf

@ -48,7 +48,8 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
WorkflowInstance workflowInstance = null; WorkflowInstance workflowInstance = null;
if (workflowInstanceLink != null) { if (workflowInstanceLink != null) {
long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId();
workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), workflowInstanceId); workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(),
workflowInstanceId);
listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null,
workflowInstance.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); workflowInstance.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} }

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/action_button.jsp

@ -16,9 +16,7 @@
<% <%
SearchContainer searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer"); SearchContainer searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer");
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
IntPratica intPratica = (IntPratica) row.getObject(); IntPratica intPratica = (IntPratica) row.getObject();
List<ControlloPratica> controlliPratica = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()); List<ControlloPratica> controlliPratica = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
ControlloPratica controlloPratica = null; ControlloPratica controlloPratica = null;
if (controlliPratica.size() > 0 ) { if (controlliPratica.size() > 0 ) {
@ -26,7 +24,6 @@ if (controlliPratica.size() > 0 ) {
} }
Group controlPanelGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.CONTROL_PANEL); Group controlPanelGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.CONTROL_PANEL);
long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(),true); long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(),true);
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(), controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(),
controlloPratica.getPrimaryKey()); controlloPratica.getPrimaryKey());
@ -67,7 +64,7 @@ YUI().use(
position: 'top', position: 'top',
cssClass: 'tooltip-help', cssClass: 'tooltip-help',
html: true, html: true,
opacity: 1 opacity: 1,
}); });
} }
); );

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/init.jsp

@ -1,5 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletURL"%>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/view_columns.jspf

@ -46,7 +46,7 @@ if(collaudatori != null && !collaudatori.isEmpty()){
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Stato Pratica"> <liferay-ui:search-container-column-text name="Stato Pratica">
<%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getIntPraticaId())) %> <%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getTipoProcedura())) %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Committenti"> <liferay-ui:search-container-column-text name="Committenti">

58
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/paesaggistica_administration/view.jsp

@ -1,33 +1,14 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="org.apache.commons.lang.time.DateUtils"%>
<%@page import="java.util.Calendar"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.Map"%>
<%@include file="/html/paesaggistica_administration/init.jsp"%> <%@include file="/html/paesaggistica_administration/init.jsp"%>
<%
SimpleDateFormat simpleDateTimeFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String dataUltimoSorteggioString =
ConfigurazioneLocalServiceUtil.findByC_ChiaveString(themeDisplay.getCompanyId(), ConfigurazioneConstants.DATE_ULTIMO_SORTEGGIO);
String dataProssimoSorteggio =
ConfigurazioneServiceUtil.findByC_ChiaveString(company.getCompanyId(), "conf.geniocivile.sorteggio.data.prossimo.sorteggio");
%>
<hr style="margin: 0" /> <hr style="margin: 0" />
<liferay-portlet:actionURL name="reIndexFasciolo" var="reIndexFascicoloURL" />
<liferay-portlet:actionURL name="reIndexFasciolo" var="reIndexFascioloURL" />
<liferay-portlet:actionURL name="reIndexFascicoli" var="reIndexFascicoliURL" /> <liferay-portlet:actionURL name="reIndexFascicoli" var="reIndexFascicoliURL" />
<liferay-portlet:actionURL name="mostraConfigurazione" var="mostraConfigurazioneUrl" /> <liferay-portlet:actionURL name="mostraConfigurazione" var="mostraConfigurazioneURL" />
<liferay-portlet:actionURL name="manutenzioneDatabase" var="manutenzioneDatabaseURL" /> <liferay-portlet:actionURL name="manutenzioneDatabase" var="manutenzioneDatabaseURL" />
<div class="row-fluid" style="margin-top: 10px"> <div class="row-fluid" style="margin-top: 10px">
<div class="span6"> <div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Form per reindicizzare un <div style="font-weight: bold; font-size: 18px; margin-bottom: 10px">Form per reindicizzare un fascicolo</div>
fascicolo</div> <aui:form action="<%= reIndexFascicoloURL %>" method="post" name="fmReIndexFasciolo">
<aui:form action="<%=reIndexFascioloURL%>" method="post" name="fmReIndexFasciolo">
<div> <div>
<aui:input name="intPraticaId" label="IntPraticaId"> <aui:input name="intPraticaId" label="IntPraticaId">
<aui:validator name="number" /> <aui:validator name="number" />
@ -43,11 +24,10 @@ String dataProssimoSorteggio =
<aui:button cssClass="btn-danger" type="submit" value="Reindicizza tutti i fascicoli" /> <aui:button cssClass="btn-danger" type="submit" value="Reindicizza tutti i fascicoli" />
</div> </div>
</aui:form> </aui:form>
</div> </div>
<div class="span6"> <div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Mostra configurazione server</div> <div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Mostra configurazione server</div>
<aui:form action="<%=mostraConfigurazioneUrl%>" method="post" name="fmMostraConfigurazione"> <aui:form action="<%= mostraConfigurazioneURL %>" method="post" name="fmMostraConfigurazione">
<div> <div>
<aui:button cssClass="btn-danger" type="submit" value="Mostra configurazione" /> <aui:button cssClass="btn-danger" type="submit" value="Mostra configurazione" />
</div> </div>
@ -55,9 +35,9 @@ String dataProssimoSorteggio =
</div> </div>
</div> </div>
<hr style="margin: 0" /> <hr style="margin: 0" />
<div class="row-fluid" style="margin-top: 10px;"> <div class="row-fluid" style="margin-top: 10px">
<div class="span6"> <div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Manutenzione database</div> <div style="font-weight: bold; font-size: 18px; margin-bottom: 10px">Manutenzione database</div>
<aui:form action="<%= manutenzioneDatabaseURL %>" method="post" name="fmMD"> <aui:form action="<%= manutenzioneDatabaseURL %>" method="post" name="fmMD">
<div> <div>
<aui:input name="mode" label="Modalità" /> <aui:input name="mode" label="Modalità" />
@ -68,33 +48,13 @@ String dataProssimoSorteggio =
<div class="span6"> <div class="span6">
</div> </div>
</div> </div>
<% String[] esito = renderRequest.getParameterValues("esito"); %> <% String[] esito = renderRequest.getParameterValues("esito"); %>
<c:if test="<%= (null != esito) && (esito.length > 0) %>"> <c:if test="<%= (null != esito) && (esito.length > 0) %>">
<h2>Risultato</h2> <h2>Risultato</h2>
<% <%
for (String riga : esito) { for (String riga : esito) {
%> out.print(riga);
<%=riga%><br> out.print("<br>");
<%
} }
%> %>
</c:if> </c:if>

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

@ -92,6 +92,7 @@ import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.servlet.ServletResponseUtil; import com.liferay.portal.kernel.servlet.ServletResponseUtil;
import com.liferay.portal.kernel.servlet.SessionErrors; import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.upload.UploadPortletRequest; import com.liferay.portal.kernel.upload.UploadPortletRequest;
import com.liferay.portal.kernel.util.Constants;
import com.liferay.portal.kernel.util.ContentTypes; import com.liferay.portal.kernel.util.ContentTypes;
import com.liferay.portal.kernel.util.DateFormatFactoryUtil; import com.liferay.portal.kernel.util.DateFormatFactoryUtil;
import com.liferay.portal.kernel.util.FileUtil; import com.liferay.portal.kernel.util.FileUtil;
@ -666,7 +667,7 @@ public class FascicoloFePortlet extends MVCPortlet {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest);
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId");
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
String cmd = ParamUtil.getString(actionRequest, "cmd"); String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
boolean bozza = ParamUtil.getBoolean(actionRequest, "bozza"); boolean bozza = ParamUtil.getBoolean(actionRequest, "bozza");
if (bozza) { if (bozza) {
saveDatiDettPratica(dettPraticaId, actionRequest, actionResponse); saveDatiDettPratica(dettPraticaId, actionRequest, actionResponse);
@ -692,7 +693,7 @@ public class FascicoloFePortlet extends MVCPortlet {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest);
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId");
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
String cmd = ParamUtil.getString(actionRequest, "cmd"); String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
boolean bozza = ParamUtil.getBoolean(actionRequest, "bozza"); boolean bozza = ParamUtil.getBoolean(actionRequest, "bozza");
if (bozza) { if (bozza) {
saveDatiTipoPratica(dettPraticaId, actionRequest, actionResponse); saveDatiTipoPratica(dettPraticaId, actionRequest, actionResponse);
@ -904,7 +905,7 @@ public class FascicoloFePortlet extends MVCPortlet {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest);
DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
boolean bozza = ParamUtil.getBoolean(actionRequest, "bozza", true); boolean bozza = ParamUtil.getBoolean(actionRequest, "bozza", true);
String cmd = ParamUtil.getString(actionRequest, "cmd"); String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
long integrazione = ParamUtil.getLong(actionRequest, "integrazione"); long integrazione = ParamUtil.getLong(actionRequest, "integrazione");
boolean disabledSubmit = ParamUtil.getBoolean(actionRequest, "disabledSubmit", true); boolean disabledSubmit = ParamUtil.getBoolean(actionRequest, "disabledSubmit", true);
boolean geoDisabledSubmit = ParamUtil.getBoolean(actionRequest, "geoDisabledSubmit", true); boolean geoDisabledSubmit = ParamUtil.getBoolean(actionRequest, "geoDisabledSubmit", true);

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

@ -8,7 +8,6 @@ import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.SoggettoSoap; import it.tref.liferay.portos.bo.model.SoggettoSoap;
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaServiceUtil;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
@ -111,19 +110,6 @@ public class SoggettiPraticaPortlet extends MVCPortlet {
} }
} }
public void removePrincipale(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
try {
long soggettoId = ParamUtil.getLong(actionRequest, "soggettoId");
Soggetto soggetto = SoggettoServiceUtil.getSoggetto(soggettoId);
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId");
DettPraticaServiceUtil.updatePrincipale(dettPraticaId, StringPool.BLANK, soggetto.getTipologiaSoggetto());
} catch (PortalException | SystemException e) {
_log.error(e, e);
throw e;
}
}
public void updateSoggetto(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { public void updateSoggetto(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
boolean requiredDoc = ParamUtil.getBoolean(actionRequest, "requiredDoc"); boolean requiredDoc = ParamUtil.getBoolean(actionRequest, "requiredDoc");
@ -286,8 +272,8 @@ public class SoggettiPraticaPortlet extends MVCPortlet {
// Per poter completare l'aggiunta di un soggetto è necessario allegare file firmato dal nuovo soggetto e // Per poter completare l'aggiunta di un soggetto è necessario allegare file firmato dal nuovo soggetto e
// almeno uno dei soggetti già inseriti nella pratica. // almeno uno dei soggetti già inseriti nella pratica.
// SOLO nel caso in cui il soggetto che viene inserito è di tipo COMMITTENTE, la sua firma sul file allegato // SOLO nel caso in cui il soggetto che viene inserito è di tipo COMMITTENTE, la sua firma sul file allegato
// NON è OBBLIGATORIA; inoltre la firma OBBLIGATORIA che deve essere presente sul file // NON è OBBLIGATORIA; inoltre la firma OBBLIGATORIA che deve essere presente sul file allegato è SOLO
// allegato è SOLO quella del TITOLARE DIGITALE DELLA PRATICA. // quella del TITOLARE DIGITALE DELLA PRATICA.
if (TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto())) { if (TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto())) {
String[] titolare = new String[] { dettPratica.getCodiceFiscaleDelegatoCommittente() }; String[] titolare = new String[] { dettPratica.getCodiceFiscaleDelegatoCommittente() };
isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjects(sourceFileName, content, isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjects(sourceFileName, content,

52
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/search/AdvancedSearch.java

@ -1,52 +0,0 @@
package it.tref.liferay.portos.fe.search;
import java.io.Serializable;
@SuppressWarnings("serial")
public class AdvancedSearch implements Serializable {
private String field;
private int comparator;
private String value;
public AdvancedSearch() {
}
public AdvancedSearch(String field, int comparator, String value) {
super();
this.field = field;
this.comparator = comparator;
this.value = value;
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
public int getComparator() {
return comparator;
}
public void setComparator(int comparator) {
this.comparator = comparator;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

8
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/PortletKeys.java

@ -1,8 +0,0 @@
package it.tref.liferay.portos.fe.util;
public class PortletKeys extends it.tref.liferay.portos.bo.shared.util.PortletKeys {
// public final static String FASCICOLOFE = "1_WAR_portosfeportlet";
// public final static String SOGGETTI = "3_WAR_portosfeportlet";
// public final static String ALLEGATI = "4_WAR_portosfeportlet";
}

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

@ -0,0 +1,2 @@
# Se questo file obbligatorio non contiene almeno una proprietà, il deploy fallisce
unused-property=800A

8
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/init.jsp

@ -1,10 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<% <%
boolean isElencoProgetti = GetterUtil.getBoolean(portletPreferences.getValue("isElencoProgetti", "true")); String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", StringPool.BLANK));
boolean isArchivio = GetterUtil.getBoolean(portletPreferences.getValue("isArchivio", "true")); String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", StringPool.BLANK));
boolean onlyMieiProgetti = GetterUtil.getBoolean(portletPreferences.getValue("onlyMieiProgetti", "true"));
String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", ""));
String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", ""));
%> %>

71
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp

@ -1,33 +1,28 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%> <%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoServiceUtil"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.model.Collaudo"%> <%@page import="it.tref.liferay.portos.bo.model.Collaudo"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.DocPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.FineLavori"%> <%@page import="it.tref.liferay.portos.bo.model.FineLavori"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%> <%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DocPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeBean"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%> <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.DocumentiPraticaUtil"%> <%@page import="it.tref.liferay.portos.bo.util.DocumentiPraticaUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeBean"%>
<%@page import="it.tref.liferay.portos.bo.model.DocPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.DocPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.fe.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.HttpUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.bo.service.persistence.SoggettoUtil"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@include file="/html/soggettipratica/init.jsp"%> <%@include file="/html/soggettipratica/init.jsp"%>
<% <%
@ -302,7 +297,8 @@ if ("page_geologica".equals(comingFrom)) {
<% <%
String adding = StringPool.BLANK; String adding = StringPool.BLANK;
if (FineLavori.class.getName().equalsIgnoreCase(className)) { if (FineLavori.class.getName().equalsIgnoreCase(className)) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk()); FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(
docPratica.getClassPk());
if (fineLavori != null) { if (fineLavori != null) {
adding = fineLavori.getFullDescription(); adding = fineLavori.getFullDescription();
} }
@ -312,7 +308,8 @@ if ("page_geologica".equals(comingFrom)) {
adding = collaudo.getFullDescription(); adding = collaudo.getFullDescription();
} }
} else { } else {
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk()); DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(
docPratica.getClassPk());
if (dettPratica != null) { if (dettPratica != null) {
adding = dettPratica.getFullDescription(); adding = dettPratica.getFullDescription();
} }
@ -344,9 +341,12 @@ if ("page_geologica".equals(comingFrom)) {
} else { } else {
if (dett.getTipoIntegrazione().equals( if (dett.getTipoIntegrazione().equals(
TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) { TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) {
sbProvenienza.append("Ric Integrazione # " + dett.getIntegrazione()); sbProvenienza.append("Ric Integrazione # ")
} else if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)) { .append(dett.getIntegrazione());
sbProvenienza.append("Variante # " + dett.getVarianteNumero()); } else if (dett.getTipoIntegrazione().equals(
TipoIntegrazioneUtil.VARIANTE)) {
sbProvenienza.append("Variante # ")
.append(dett.getVarianteNumero());
} }
} }
} }
@ -356,7 +356,8 @@ if ("page_geologica".equals(comingFrom)) {
</span> </span>
</div> </div>
</c:if> </c:if>
<div class='<%= "page_geologica".equals(comingFrom) || !inBO ? "col-xs-2" : "col-xs-4" %> asserazioni-body-title text-center'> <div class='<%= "page_geologica".equals(comingFrom) || !inBO ? "col-xs-2" : "col-xs-4" %>
asserazioni-body-title text-center'>
<div class='<%= inBO ? "col-xs-12" : "col-xs-6" %>'> <div class='<%= inBO ? "col-xs-12" : "col-xs-6" %>'>
<span class='<%= "fa " + cssIcon + " asseverazioni-icon tooltip-info " + cssColor %>' <span class='<%= "fa " + cssIcon + " asseverazioni-icon tooltip-info " + cssColor %>'
title="<%= title %>"> title="<%= title %>">
@ -392,18 +393,24 @@ if ("page_geologica".equals(comingFrom)) {
<liferay-util:param name="className" value="<%= className %>" /> <liferay-util:param name="className" value="<%= className %>" />
<liferay-util:param name="docPraticaId" value="<%= String.valueOf(docPratica <liferay-util:param name="docPraticaId" value="<%= String.valueOf(docPratica
.getDocPraticaId()) %>" /> .getDocPraticaId()) %>" />
<liferay-util:param name="disabledInput" value="<%= String.valueOf(disabledInput) %>" /> <liferay-util:param name="disabledInput"
value="<%= String.valueOf(disabledInput) %>" />
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
</c:if> </c:if>
<c:if test="<%= inBO %>"> <c:if test="<%= inBO %>">
<liferay-portlet:renderURL var="previewURL" <liferay-portlet:renderURL var="previewURL"
windowState="<%= LiferayWindowState.POP_UP.toString() %>"> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(docPratica.getDlFileEntryId()) %>" /> <liferay-portlet:param name="fileEntryId"
value="<%= String.valueOf(docPratica.getDlFileEntryId()) %>" />
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:icon id='<%="open_"+docPratica.getDocPraticaId() %>' linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" message="Visualizza" url="<%=previewURL%>" useDialog="true"/> <liferay-ui:icon id='<%= "open_" + docPratica.getDocPraticaId() %>'
<liferay-ui:icon id='<%="download_"+docPratica.getDocPraticaId() %>' linkCssClass="btn btn-action" iconCssClass="fa fa-download" message="Download" url="<%=docPratica.getDownloadUrl(themeDisplay)%>"/> linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard"
message="Visualizza" url="<%= previewURL %>" useDialog="true" />
<liferay-ui:icon id='<%= "download_" + docPratica.getDocPraticaId() %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-download"
message="Download" url="<%= docPratica.getDownloadUrl(themeDisplay) %>" />
</c:if> </c:if>
</div> </div>
</div> </div>

178
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp

@ -1,57 +1,30 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalService"%> <%@page import="it.tref.liferay.portos.bo.model.Collaudo"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.DocPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.FineLavori"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> <%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.CollaudoServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Collaudo"%>
<%@page import="it.tref.liferay.portos.bo.model.FineLavori"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DocPraticaServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DocPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DocPratica"%> <%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.FineLavoriServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeBean"%> <%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeBean"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%> <%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%>
<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil"%>
<%@page import="java.text.DateFormat"%>
<%@page import="javax.swing.text.html.parser.DocumentParser"%>
<%@page import="it.tref.liferay.portos.bo.util.DocumentiPraticaUtil"%> <%@page import="it.tref.liferay.portos.bo.util.DocumentiPraticaUtil"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Comparator"%>
<%@page import="java.util.Collections"%>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.io.Serializable"%>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="java.util.LinkedHashMap"%>
<%@page import="java.util.Map.Entry"%>
<%@include file="/html/allegatipratica/init.jsp"%> <%@include file="/html/allegatipratica/init.jsp"%>
<% <%
String comingFrom = ParamUtil.getString(request,"comingFrom", String comingFrom = ParamUtil.getString(request, "comingFrom", GetterUtil.getString(
GetterUtil.getString( PortalUtil.getOriginalServletRequest(request).getParameter("page_allegati"), "page_allegati"));
PortalUtil.getOriginalServletRequest(request).getParameter("page_allegati"),
"page_allegati")
);
//ADT BUG BO ID = 17 commento riga comingFrom
//comingFrom = "page_geologica";
long classPk = ParamUtil.getLong(request, "classPk"); long classPk = ParamUtil.getLong(request, "classPk");
String className = ParamUtil.getString(request, "className"); String className = ParamUtil.getString(request, "className");
long intPraticaId= 0l; long intPraticaId = 0L;
if (FineLavori.class.getName().equalsIgnoreCase(className)) { if (FineLavori.class.getName().equalsIgnoreCase(className)) {
FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk); FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk);
intPraticaId = fineLavori.getIntPraticaId(); intPraticaId = fineLavori.getIntPraticaId();
@ -62,14 +35,9 @@
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk);
intPraticaId = dettPratica.getIntPraticaId(); intPraticaId = dettPratica.getIntPraticaId();
} }
String tipoAllegati = ParamUtil.getString(request, "tipoAllegati", "allegati"); String tipoAllegati = ParamUtil.getString(request, "tipoAllegati", "allegati");
boolean fullVersion = ParamUtil.getBoolean(request, "full", false); boolean fullVersion = ParamUtil.getBoolean(request, "full", false);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
%>
<%
String type = StringPool.BLANK; String type = StringPool.BLANK;
List<String> tipologiaAllegati ; List<String> tipologiaAllegati ;
if ("allegati_geologici".equals(tipoAllegati)) { if ("allegati_geologici".equals(tipoAllegati)) {
@ -81,15 +49,12 @@
} else if ("allegati_collaudo".equals(tipoAllegati)) { } else if ("allegati_collaudo".equals(tipoAllegati)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo(); tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo();
type = "acl"; type = "acl";
} } else {
else{
tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda(); tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda();
//BUG BO ID=9 (ANNULLA ISTANZA) //BUG BO ID=9 (ANNULLA ISTANZA)
tipologiaAllegati.add(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO); tipologiaAllegati.add(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO);
type = "ad"; type = "ad";
} }
%> %>
<liferay-portlet:resourceURL portletName="4_WAR_portosfeportlet" var="downloadAllURLs" id="downloadAllDocPraticas"> <liferay-portlet:resourceURL portletName="4_WAR_portosfeportlet" var="downloadAllURLs" id="downloadAllDocPraticas">
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" /> <liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
@ -97,26 +62,23 @@
<liferay-portlet:param name="comingFrom" value="<%= comingFrom %>" /> <liferay-portlet:param name="comingFrom" value="<%= comingFrom %>" />
<liferay-portlet:param name="type" value="<%= type %>" /> <liferay-portlet:param name="type" value="<%= type %>" />
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<div class="container_btn_all_allegati padding_bottom"> <div class="container_btn_all_allegati padding_bottom">
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true" cssClass="inline_toolbar">
<span class="tooltip-info" title="Download Allegati"> <span class="tooltip-info" title="Download Allegati">
<aui:button id='<%=renderResponse.getNamespace()+"download_all"%>' <aui:button id='<%= renderResponse.getNamespace() + "download_all" %>' icon="fa fa-download"
icon="fa fa-download" cssClass="btn btn-primary btn-action" cssClass="btn btn-primary btn-action" href="<%= downloadAllURLs %>" />
href="<%= downloadAllURLs %>"
/>
</span> </span>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</div> </div>
<% <%
for (String codiceDoc:tipologiaAllegati) { for (String codiceDoc:tipologiaAllegati) {
List<DocPratica> docPraticas; List<DocPratica> docPraticas;
if (fullVersion) { if (fullVersion) {
/* docPraticas = DocPraticaServiceUtil.findByIntPratica_Tipologia(dettPratica.getIntPraticaId(),codiceDoc,QueryUtil.ALL_POS,QueryUtil.ALL_POS, null); */ docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, codiceDoc,
docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPraticaId,classPk, codiceDoc,QueryUtil.ALL_POS,QueryUtil.ALL_POS); QueryUtil.ALL_POS, QueryUtil.ALL_POS);
} else { } else {
docPraticas = DocPraticaServiceUtil.getValidUntilClassPkByIntPratica(intPraticaId, classPk, codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS); docPraticas = DocPraticaServiceUtil.getValidUntilClassPkByIntPratica(intPraticaId, classPk, codiceDoc,
QueryUtil.ALL_POS, QueryUtil.ALL_POS);
} }
%> %>
<div class="panel-group allegato-group"> <div class="panel-group allegato-group">
@ -126,24 +88,24 @@
<h4 class="panel-title allegato-group__title"> <h4 class="panel-title allegato-group__title">
<liferay-ui:message key='<%= "label-documenti-tipologia-" + codiceDoc %>' /> <liferay-ui:message key='<%= "label-documenti-tipologia-" + codiceDoc %>' />
</h4> </h4>
<span class='num_allegati <%= docPraticas.size()>0 ? "green" : "red" %>'><%=docPraticas.size()%></span> <span class='num_allegati <%= docPraticas.size()>0 ? "green" : "red" %>'>
<%= docPraticas.size() %>
</span>
</a> </a>
</div> </div>
<div id="collapse-<%= codiceDoc %>_<%= type %>" class="panel-collapse collapse lfr-search-container"> <div id="collapse-<%= codiceDoc %>_<%= type %>" class="panel-collapse collapse lfr-search-container">
<% <%
if (!docPraticas.isEmpty()) { if (!docPraticas.isEmpty()) {
%> %>
<table class="table table-striped allegati-tipologia-table"
<table class="table table-striped allegati-tipologia-table" id="<portlet:namespace/>allegati-table-<%= codiceDoc %>"> id="<portlet:namespace/>allegati-table-<%= codiceDoc %>">
<thead class="table-columns allegato-group__head"> <thead class="table-columns allegato-group__head">
<tr> <tr>
<th class="text-center">STATO</th> <th class="text-center">STATO</th>
<th>ALLEGATO</th> <th>ALLEGATO</th>
<th class="text-center">FIRME</th> <th class="text-center">FIRME</th>
<%-- <% if(!comingFrom.equals("page_va_allegati") && !comingFrom.equals("page_in_allegati") ) { %> --%>
<th>AGGIUNTO DA</th> <th>AGGIUNTO DA</th>
<th>INVALIDATO DA</th> <th>INVALIDATO DA</th>
<%-- <% } %> --%>
<th class="text-center">AZIONI</th> <th class="text-center">AZIONI</th>
</tr> </tr>
</thead> </thead>
@ -154,7 +116,8 @@
%> %>
<tr> <tr>
<td class="text-center"> <td class="text-center">
<span class='fa fa-circle <%= Validator.isNull(docPratica.getDtDataRimozione()) ? "txt-green" : "txt-red" %>'></span> <span class='fa fa-circle <%= Validator.isNull(docPratica.
getDtDataRimozione()) ? "txt-green" : "txt-red" %>'></span>
</td> </td>
<td> <td>
<%= docPratica.getFileName() %> <%= docPratica.getFileName() %>
@ -167,9 +130,10 @@
if (!firme.getFirmeDigitali().isEmpty()) { if (!firme.getFirmeDigitali().isEmpty()) {
title.append("Firma sul file:<ul>"); title.append("Firma sul file:<ul>");
for (FirmeDetail firma : firme.getFirmeDigitali()) { for (FirmeDetail firma : firme.getFirmeDigitali()) {
title.append("<li>"+firma.getCfFirmatario()); title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) { if (Validator.isNotNull(firma.getDtFirma())) {
title.append(" del "+dateFormatDate.format(firma.getDtFirma())); title.append(" del ")
.append(dateFormatDate.format(firma.getDtFirma()));
} }
title.append("</li>"); title.append("</li>");
} }
@ -178,9 +142,10 @@
if (!firme.getFirmeApplicativo().isEmpty()) { if (!firme.getFirmeApplicativo().isEmpty()) {
title.append("Firme da applicativo:<ul>"); title.append("Firme da applicativo:<ul>");
for(FirmeDetail firma : firme.getFirmeApplicativo()) { for(FirmeDetail firma : firme.getFirmeApplicativo()) {
title.append("<li>"+firma.getCfFirmatario()); title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) { if (Validator.isNotNull(firma.getDtFirma())) {
title.append(" del "+dateFormatDate.format(firma.getDtFirma())); title.append(" del ")
.append(dateFormatDate.format(firma.getDtFirma()));
} }
title.append("</li>"); title.append("</li>");
} }
@ -189,29 +154,31 @@
} }
if (firme.numeroFirme() > 0) { if (firme.numeroFirme() > 0) {
%> %>
<span class="fa fa-check icon-asseverazioni tooltip-info" title="<%=title.toString() %>" style="color:green"> <span class="fa fa-check icon-asseverazioni tooltip-info"
title="<%= title.toString() %>" style="color:green">
<sub style="font-weight: bold"><%= firme.numeroFirme() %></sub> <sub style="font-weight: bold"><%= firme.numeroFirme() %></sub>
</span> </span>
<% <%
} else { } else {
%> %>
<span class="fa fa-close icon-asseverazioni tooltip-info" title="Non ci sono firme sul file" style="color:red"></span> <span class="fa fa-close icon-asseverazioni tooltip-info"
title="Non ci sono firme sul file" style="color:red"></span>
<% <%
} }
%> %>
</td> </td>
<%-- <% if(!comingFrom.equals("page_va_allegati") && !comingFrom.equals("page_in_allegati") ) { %> --%>
<td> <td>
<% <%
String description = StringPool.BLANK; String description = StringPool.BLANK;
if (DettPratica.class.getName().equalsIgnoreCase(docPratica.getClassName())) { if (DettPratica.class.getName().equalsIgnoreCase(docPratica.getClassName())) {
DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk()); DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(
docPratica.getClassPk());
if (adding != null) { if (adding != null) {
description = adding.getFullDescription(); description = adding.getFullDescription();
} }
} else if (FineLavori.class.getName().equalsIgnoreCase(docPratica.getClassName())) { } else if (FineLavori.class.getName().equalsIgnoreCase(docPratica.getClassName())) {
FineLavori adding = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk()); FineLavori adding = FineLavoriLocalServiceUtil.fetchFineLavori(
docPratica.getClassPk());
if (adding != null) { if (adding != null) {
description = adding.getFullDescription(); description = adding.getFullDescription();
} }
@ -221,40 +188,44 @@
description = adding.getFullDescription(); description = adding.getFullDescription();
} }
} }
out.print(description); out.print(description);
%> %>
</td> </td>
<td> <td>
<% <%
DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getDettPraticaIdRimozione()); DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(
docPratica.getDettPraticaIdRimozione());
if (removing != null) { if (removing != null) {
%> out.print(removing.getFullDescription());
<%= removing.getFullDescription() %>
<%
} }
%> %>
</td> </td>
<%-- <%
}
%> --%>
<td class="text-center action-col"> <td class="text-center action-col">
<c:choose> <c:choose>
<c:when test="<%= Validator.isNotNull(docPratica.getDlFileEntryId()) %>"> <c:when test="<%= Validator.isNotNull(docPratica.getDlFileEntryId()) %>">
<liferay-portlet:renderURL var="previewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="previewURL"
<liferay-portlet:param name="fileEntryId" value="<%= String.valueOf(docPratica.getDlFileEntryId()) %>" /> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/common/preview_file_entry.jsp" /> <liferay-portlet:param name="fileEntryId"
value="<%= String.valueOf(docPratica.getDlFileEntryId()) %>" />
<liferay-portlet:param name="mvcPath"
value="/html/common/preview_file_entry.jsp" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:icon id='<%= "open_" + docPraticaId %>'
<liferay-ui:icon id='<%="open_"+docPraticaId %>' linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" message="Visualizza" url="<%=previewURL%>" useDialog="true"/> linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard"
<liferay-ui:icon id='<%="download_"+docPraticaId %>' linkCssClass="btn btn-action" iconCssClass="fa fa-download" message="Download" url="<%=docPratica.getDownloadUrl(themeDisplay)%>"/> message="Visualizza" url="<%= previewURL %>" useDialog="true" />
<liferay-ui:icon id='<%= "download_" + docPraticaId %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-download"
message="Download"
url="<%= docPratica.getDownloadUrl(themeDisplay) %>" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<liferay-util:include page="/html/common/import_window.jsp" servletContext="<%= application %>" portletId="<%= PortletKeys.FASCICOLO %>" > <liferay-util:include page="/html/common/import_window.jsp"
<liferay-util:param name="classPK" value="<%= String.valueOf(docPratica.getDocPraticaId()) %>" /> servletContext="<%= application %>"
<liferay-util:param name="classNAME" value="<%= DocPratica.class.getName() %>" /> portletId="<%= PortletKeys.FASCICOLO %>">
<liferay-util:param name="classPK"
value="<%= String.valueOf(docPratica.getDocPraticaId()) %>" />
<liferay-util:param name="classNAME"
value="<%= DocPratica.class.getName() %>" />
<liferay-util:param name="message" value="Download" /> <liferay-util:param name="message" value="Download" />
</liferay-util:include> </liferay-util:include>
</c:otherwise> </c:otherwise>
@ -276,18 +247,13 @@
} }
%> %>
<script type="text/javascript"> <script type="text/javascript">
YUI().use( YUI().use('aui-tooltip', function(Y) {
'aui-tooltip', new Y.TooltipDelegate({
function(Y) {
new Y.TooltipDelegate(
{
trigger: '.allegati-tipologia-table .tooltip-info', trigger: '.allegati-tipologia-table .tooltip-info',
position: 'top', position: 'top',
cssClass: 'tooltip-help', cssClass: 'tooltip-help',
html: true, html: true,
opacity: 1 opacity: 1,
} });
); });
}
);
</script> </script>

19
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/configuration.jsp

@ -1,21 +1,22 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/fascicolofe/init.jsp"%> <%@include file="/html/fascicolofe/init.jsp"%>
<liferay-portlet:actionURL portletConfiguration="true" var="configurationURL" /> <liferay-portlet:actionURL portletConfiguration="true" var="configurationURL" />
<aui:form action="<%= configurationURL %>" method="post" name="fm"> <aui:form action="<%= configurationURL %>" method="post" name="fm">
<aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= Constants.UPDATE %>" /> <aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= Constants.UPDATE %>" />
<aui:select name="preferences--tipoVisualizzazione--" type="select" value="<%= tipoVisualizzazione %>"> <aui:select name="preferences--tipoVisualizzazione--" type="select" value="<%= tipoVisualizzazione %>">
<aui:option value="isProgetti" label="Progetti" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isProgetti") %>' ></aui:option> <aui:option value="isProgetti" label="Progetti"
<aui:option value="isAltriProgetti" label="Altri Progetti" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isAltriProgetti") %>'></aui:option> selected='<%= tipoVisualizzazione.equalsIgnoreCase("isProgetti") %>' />
<aui:option value="isDeleghe" label="Deleghe" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isDeleghe") %>'></aui:option> <aui:option value="isAltriProgetti" label="Altri Progetti"
<aui:option value="isArchivioProgetti" label="Archivio Progetti" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isArchivioProgetti") %>'></aui:option> selected='<%= tipoVisualizzazione.equalsIgnoreCase("isAltriProgetti") %>' />
<aui:option value="isArchivioDeleghe" label="Archivio Deleghe" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isArchivioDeleghe") %>'></aui:option> <aui:option value="isDeleghe" label="Deleghe"
selected='<%= tipoVisualizzazione.equalsIgnoreCase("isDeleghe") %>' />
<aui:option value="isArchivioProgetti" label="Archivio Progetti"
selected='<%= tipoVisualizzazione.equalsIgnoreCase("isArchivioProgetti") %>' />
<aui:option value="isArchivioDeleghe" label="Archivio Deleghe"
selected='<%= tipoVisualizzazione.equalsIgnoreCase("isArchivioDeleghe") %>' />
</aui:select> </aui:select>
<aui:input name="preferences--helpTitle--" type="text" value="<%= helpTitle %>" /> <aui:input name="preferences--helpTitle--" type="text" value="<%= helpTitle %>" />
<aui:input name="preferences--helpMessage--" type="text" value="<%= helpMessage %>" /> <aui:input name="preferences--helpMessage--" type="text" value="<%= helpMessage %>" />
<aui:button-row> <aui:button-row>
<aui:button type="submit" /> <aui:button type="submit" />
</aui:button-row> </aui:button-row>

1
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/init.jsp

@ -39,7 +39,6 @@
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%> <%@page import="com.liferay.portal.kernel.util.KeyValuePair"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page import="it.tref.liferay.portos.fe.search.AdvancedSearch"%>
<%@page import="java.io.Serializable"%> <%@page import="java.io.Serializable"%>
<%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletURL"%>
<%@page import="java.util.LinkedHashMap"%> <%@page import="java.util.LinkedHashMap"%>

4
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf

@ -1,4 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.Constants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="javax.portlet.PortletResponse"%> <%@page import="javax.portlet.PortletResponse"%>
@ -48,7 +50,7 @@
"}" + "}" +
"saveDettPratica(false, '{{type}}');"; "saveDettPratica(false, '{{type}}');";
%> %>
<aui:input type="hidden" name="cmd" value="" /> <aui:input type="hidden" name="<%= Constants.CMD %>" value="" />
<aui:input type="hidden" name="verifyArea" value="" /> <aui:input type="hidden" name="verifyArea" value="" />
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" >

51
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns.jsp

@ -1,62 +1,23 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.AsseverazioneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="java.util.List"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@include file="/html/fascicolofe/init.jsp"%> <%@include file="/html/fascicolofe/init.jsp"%>
<% <%
String orderByType = ParamUtil.getString(request, "orderByType"); String orderByType = ParamUtil.getString(request, "orderByType");
String orderByCol = ParamUtil.getString(request, "orderByCol"); String orderByCol = ParamUtil.getString(request, "orderByCol");
PortletURL iteratorURL = (PortletURL) request.getAttribute("iteratorURL"); PortletURL iteratorURL = (PortletURL) request.getAttribute("iteratorURL");
String rowUrl = StringPool.BLANK; String rowUrl = StringPool.BLANK;
%> %>
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" iteratorURL="<%= iteratorURL %>"
<liferay-ui:search-container orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
emptyResultsMessage="no-entries-were-found"
iteratorURL="<%= iteratorURL %>"
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"
>
<% <%
List<IntPratica> listaIntPratica = (List<IntPratica>) request.getAttribute("results"); List<IntPratica> listaIntPratica = (List<IntPratica>) request.getAttribute("results");
searchContainer.setTotal((Integer) request.getAttribute("count")); searchContainer.setTotal((Integer) request.getAttribute("count"));
%> %>
<liferay-ui:search-container-results results="<%=listaIntPratica%>" />
<liferay-ui:search-container-results <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.IntPratica" modelVar="intPratica">
results="<%=listaIntPratica%>"
>
</liferay-ui:search-container-results>
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.IntPratica"
modelVar="intPratica"
>
<% <%
long delegaId = 0l; long delegaId = 0L;
%> %>
<%@ include file="/html/fascicolofe/view_fascicolo_columns_generic.jspf" %> <%@ include file="/html/fascicolofe/view_fascicolo_columns_generic.jspf" %>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= true %>" /> <liferay-ui:search-iterator paginate="true" />
</liferay-ui:search-container> </liferay-ui:search-container>

137
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns_generic.jspf

@ -1,39 +1,34 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica" %> <%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%> <%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@page import="java.util.Arrays"%>
<%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%> <%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.AvvisoUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Avviso"%>
<%@page import="com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil"%> <%@page import="com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.model.Avviso"%>
<%@page import="it.tref.liferay.portos.bo.model.Comune"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.Provincia"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="it.tref.liferay.portos.bo.model.Territorio"%>
<%@page import="it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.Constants"%> <%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.AsseverazioneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> <%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%> <%@page import="java.util.Arrays"%>
<%@page import="java.util.List"%> <%@page import="java.util.List"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<c:if test="<%= intPratica.getStatus() != WorkflowConstants.STATUS_ANY || isAltriProgetti %>"> <c:if test="<%= intPratica.getStatus() != WorkflowConstants.STATUS_ANY || isAltriProgetti %>">
<liferay-portlet:renderURL var="viewURL" > <liferay-portlet:renderURL var="viewURL" >
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp"/> <liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp"/>
@ -50,7 +45,6 @@
<portlet:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId())%>" /> <portlet:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId())%>" />
<portlet:param name="backURL" value="<%= iteratorURL.toString()%>" /> <portlet:param name="backURL" value="<%= iteratorURL.toString()%>" />
</portlet:renderURL> </portlet:renderURL>
<% <%
rowUrl = editURL; rowUrl = editURL;
%> %>
@ -62,7 +56,6 @@
<portlet:param name="delegaId" value="<%= String.valueOf(delegaId) %>" /> <portlet:param name="delegaId" value="<%= String.valueOf(delegaId) %>" />
<portlet:param name="backURL" value="<%= iteratorURL.toString() %>" /> <portlet:param name="backURL" value="<%= iteratorURL.toString() %>" />
</portlet:renderURL> </portlet:renderURL>
<% <%
rowUrl = delegaEditURL; rowUrl = delegaEditURL;
%> %>
@ -80,9 +73,10 @@
<span class="fa fa-circle txt-orange"></span> <span class="fa fa-circle txt-orange"></span>
</span> </span>
</c:if> </c:if>
<c:if test="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE.equalsIgnoreCase(intPratica.getStatoPratica()) %>"> <c:if test="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE.equalsIgnoreCase(intPratica.getStatoPratica()) %>">
<span class="display-inline-block bordered-2x border-circle bg-green txt-bold tooltip-info" title="<%= LanguageUtil.get(pageContext, "stato-pratica-SP") %>" style="padding: 5px;margin-right:5px;"> <span class="display-inline-block bordered-2x border-circle bg-green txt-bold tooltip-info"
title="<%= LanguageUtil.get(pageContext, "stato-pratica-SP") %>"
style="padding: 5px;margin-right: 5px">
SP SP
</span> </span>
</c:if> </c:if>
@ -99,23 +93,23 @@
<liferay-ui:search-container-column-text name="committente" href="<%=rowUrl %>" cssClass="middle-aligned"> <liferay-ui:search-container-column-text name="committente" href="<%=rowUrl %>" cssClass="middle-aligned">
<% <%
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
List<Soggetto> committenti = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); List<Soggetto> committenti = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(
lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
for (Soggetto committente : committenti) { for (Soggetto committente : committenti) {
builder.append(committente.getDescrizioneCompleta()) if (builder.length() > 0) {
.append(StringPool.COMMA_AND_SPACE).append("<br>"); builder.append(StringPool.COMMA).append("<br>");
}
builder.append(committente.getDescrizioneCompleta());
} }
if(builder.length()>0)
builder.setLength(builder.length()-6);
out.print(builder.toString()); out.print(builder.toString());
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Stato Pratica" cssClass="text-nowrap text-center middle-aligned"> <liferay-ui:search-container-column-text name="Stato Pratica" cssClass="text-nowrap text-center middle-aligned">
<strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getIntPraticaId())) %></strong> <strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(),
intPratica.getTipoProcedura())) %></strong>
<span class="text-center display-block" style="margin-top: 5px"> <span class="text-center display-block" style="margin-top: 5px">
<c:if test="<%= !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(lastDettPratica.getTipoIntegrazione())%>"> <c:if test="<%= !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(
lastDettPratica.getTipoIntegrazione()) %>">
<% <%
int delegheCount = DelegaLocalServiceUtil.countByDettPratica(lastDettPratica.getDettPraticaId()); int delegheCount = DelegaLocalServiceUtil.countByDettPratica(lastDettPratica.getDettPraticaId());
%> %>
@ -135,7 +129,6 @@
</span> </span>
</c:if> </c:if>
</c:if> </c:if>
<c:if test="<%= AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>"> <c:if test="<%= AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>">
<c:if test="<%= AsseverazioniUtil.allAsseverazioniCompleted(lastDettPratica.getDettPraticaId()) %>"> <c:if test="<%= AsseverazioniUtil.allAsseverazioniCompleted(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Asseverazioni completate"> <span class="btn status-icon tooltip-info btn-action" title="Asseverazioni completate">
@ -152,7 +145,6 @@
</span> </span>
</c:if> </c:if>
</c:if> </c:if>
<c:if test="<%= !AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>"> <c:if test="<%= !AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Asseverazioni non ancora richieste"> <span class="btn status-icon tooltip-info btn-action" title="Asseverazioni non ancora richieste">
<i class="fa fa-pencil-square relative"> <i class="fa fa-pencil-square relative">
@ -160,16 +152,19 @@
</i> </i>
</span> </span>
</c:if> </c:if>
<c:if test="<%= (!lastDettPratica.getNormEsenteSpese() || !lastDettPratica.getNormEsenteBollo())
<c:if test="<%= ( !lastDettPratica.getNormEsenteSpese() || !lastDettPratica.getNormEsenteBollo() ) && !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(lastDettPratica.getTipoIntegrazione())%>"> && !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(
<c:if test="<%= Validator.isNull(lastDettPratica.getPagamentoIdOneri()) && Validator.isNull(lastDettPratica.getPagamentoIdBolli()) %>"> lastDettPratica.getTipoIntegrazione()) %>">
<c:if test="<%= Validator.isNull(lastDettPratica.getPagamentoIdOneri()) && Validator.isNull(
lastDettPratica.getPagamentoIdBolli()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Pagamento non inizializzato"> <span class="btn status-icon tooltip-info btn-action" title="Pagamento non inizializzato">
<i class="fa fa-eur relative"> <i class="fa fa-eur relative">
<i class="fa fa-hover fa-close fa-top-right txt-red"></i> <i class="fa fa-hover fa-close fa-top-right txt-red"></i>
</i> </i>
</span> </span>
</c:if> </c:if>
<c:if test="<%= Validator.isNotNull(lastDettPratica.getPagamentoIdOneri()) || Validator.isNotNull(lastDettPratica.getPagamentoIdBolli())%>"> <c:if test="<%= Validator.isNotNull(lastDettPratica.getPagamentoIdOneri()) || Validator.isNotNull(
lastDettPratica.getPagamentoIdBolli()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Pagamento in corso"> <span class="btn status-icon tooltip-info btn-action" title="Pagamento in corso">
<i class="fa fa-eur relative"> <i class="fa fa-eur relative">
<i class="fa fa-hover fa-cog fa-top-right txt-orange"></i> <i class="fa fa-hover fa-cog fa-top-right txt-orange"></i>
@ -177,10 +172,11 @@
</span> </span>
</c:if> </c:if>
</c:if> </c:if>
<% <%
int variantiCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.VARIANTE)); int variantiCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(
int integrazioniCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)); intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.VARIANTE));
int integrazioniCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(
intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE));
%> %>
<c:if test="<%= variantiCount > 0 %>"> <c:if test="<%= variantiCount > 0 %>">
<span class="btn status-icon tooltip-info btn-action" title="Varianti Presentate"> <span class="btn status-icon tooltip-info btn-action" title="Varianti Presentate">
@ -198,24 +194,25 @@
</span> </span>
</span> </span>
</c:if> </c:if>
</c:if> </c:if>
<% <%
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, OrderByComparatorFactoryUtil.create("portos_bo_Avviso", "createDate", false)); List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId(), QueryUtil.ALL_POS,
QueryUtil.ALL_POS, OrderByComparatorFactoryUtil.create("portos_bo_Avviso", "createDate", false));
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (!avvisi.isEmpty()) { if (!avvisi.isEmpty()) {
sb.append("<ul class='avvisi-tooltip'>"); sb.append("<ul class='avvisi-tooltip'>");
for (Avviso avviso : avvisi) { for (Avviso avviso : avvisi) {
String tipoDocumento = avviso.translateTipoDocumento(); String tipoDocumento = avviso.translateTipoDocumento();
String testoEvento = LanguageUtil.get(pageContext, tipoDocumento); String testoEvento = LanguageUtil.get(pageContext, tipoDocumento);
sb.append("<li class='avviso-tooltip'>"+testoEvento+"</li>"); sb.append("<li class='avviso-tooltip'>").append(testoEvento).append("</li>");
} }
sb.append("</ul>"); sb.append("</ul>");
%> %>
<liferay-portlet:renderURL var="fascicoloAvvisiURL"> <liferay-portlet:renderURL var="fascicoloAvvisiURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp" />
<liferay-portlet:param name="backURL" value="<%= currentURL %>" /> <liferay-portlet:param name="backURL" value="<%= currentURL %>" />
<liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId())%>" /> <liferay-portlet:param name="intPraticaId"
value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-portlet:param name="toolbarItem" value="view-storico" /> <liferay-portlet:param name="toolbarItem" value="view-storico" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<a class="btn status-icon tooltip-info btn-action" title="<%= HtmlUtil.escapeAttribute(sb.toString()) %>" <a class="btn status-icon tooltip-info btn-action" title="<%= HtmlUtil.escapeAttribute(sb.toString()) %>"
@ -267,7 +264,8 @@
<c:if test="<%= notAnswered > 0 %>"> <c:if test="<%= notAnswered > 0 %>">
<liferay-portlet:renderURL var="comunicazioniURL"> <liferay-portlet:renderURL var="comunicazioniURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp" />
<liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId())%>" /> <liferay-portlet:param name="intPraticaId"
value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-portlet:param name="toolbarItem" value="view-storico" /> <liferay-portlet:param name="toolbarItem" value="view-storico" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<a class="btn status-icon tooltip-info btn-action" title="Comunicazione in attesa di risposta" <a class="btn status-icon tooltip-info btn-action" title="Comunicazione in attesa di risposta"
@ -278,32 +276,41 @@
</a> </a>
</c:if> </c:if>
</span> </span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Tipo Pratica" href="<%= rowUrl %>" cssClass="text-nowrap middle-aligned"> <liferay-ui:search-container-column-text name="Tipo Pratica" href="<%= rowUrl %>" cssClass="text-nowrap middle-aligned">
<%= LanguageUtil.get(pageContext, "tipo-pratica-" + intPratica.getTipoPratica()) %><br/> <%= LanguageUtil.get(pageContext, "tipo-pratica-" + intPratica.getTipoPratica()) %><br/>
<%= Validator.isNotNull(lastDettPratica.getTipoIntegrazione()) ? LanguageUtil.get(pageContext, "label-integrazione-"+lastDettPratica.getTipoIntegrazione()) : ""%> <%= Validator.isNull(lastDettPratica.getTipoIntegrazione()) ? StringPool.BLANK
: LanguageUtil.get(pageContext, "label-integrazione-"+lastDettPratica.getTipoIntegrazione()) %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="tipologia-soggetto" href="<%=rowUrl %>" cssClass="text-nowrap middle-aligned"> <liferay-ui:search-container-column-text name="tipologia-soggetto" href="<%= rowUrl %>"
cssClass="text-nowrap middle-aligned">
<% <%
List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(), user.getScreenName()); List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(),
user.getScreenName());
for (Soggetto soggetto : soggetti) { for (Soggetto soggetto : soggetti) {
out.print("<div>"+ LanguageUtil.get(pageContext, "gc-soggetto-"+soggetto.getTipologiaSoggetto())+"</div>"); out.print("<div>");
out.print(LanguageUtil.get(pageContext, "gc-soggetto-" + soggetto.getTipologiaSoggetto()));
out.print("</div>");
} }
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="desc-intervento" href="<%= rowUrl %>" cssClass="middle-aligned"> <liferay-ui:search-container-column-text name="desc-intervento" href="<%= rowUrl %>" cssClass="middle-aligned">
<% <%
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), comune.getCodiceProvincia()); Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), comune.getCodiceProvincia());
%> %>
Territorio: <strong><%= comune.getDenominazione() %> <%= !lastDettPratica.getLocalita().isEmpty() ? "(Loc. "+lastDettPratica.getLocalita()+" ) " : "" %>- <%= provincia.getProvincia() %></strong><br> Territorio: <strong><%= comune.getDenominazione() %>
Localizzazione: <strong><%= lastDettPratica.getVia() %></strong><br> <%= lastDettPratica.getLocalita().isEmpty() ? StringPool.BLANK : "(Loc. " + lastDettPratica.getLocalita()
<strong><%= LanguageUtil.get(pageContext, "tipo_procedura_" + intPratica.getTipoProcedura()) %></strong><br><br> + StringPool.CLOSE_PARENTHESIS %>
- <%= provincia.getProvincia() %></strong><br/>
Localizzazione: <strong><%= lastDettPratica.getVia() %></strong><br/>
<strong><%= LanguageUtil.get(pageContext, "tipo_procedura_" + intPratica.getTipoProcedura()) %></strong>
<br/>
<br/>
<%= lastDettPratica.getDescLongIntervento() %> <%= lastDettPratica.getDescLongIntervento() %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<c:if test="<%= isDeleghe || isProgetti || isAltriProgetti %>"> <c:if test="<%= isDeleghe || isProgetti || isAltriProgetti %>">
<liferay-ui:search-container-column-jsp path="/html/fascicolofe/fascicolo_action.jsp" align="right" cssClass="middle-aligned"/> <liferay-ui:search-container-column-jsp path="/html/fascicolofe/fascicolo_action.jsp" align="right"
cssClass="middle-aligned" />
</c:if> </c:if>

2
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp

@ -112,7 +112,7 @@
Stato: Stato:
</div> </div>
<div class="col-sm-4 col-md-4"> <div class="col-sm-4 col-md-4">
<strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPraticaId)) %></strong> <strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getTipoProcedura())) %></strong>
</div> </div>
</div> </div>
</div> </div>

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

File diff soppresso perché troppo grande Load Diff

41
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/edit_soggetto_modal.jsp

@ -1,17 +1,13 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%> <%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@include file="/html/soggettipratica/init.jsp"%> <%@include file="/html/soggettipratica/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
long soggettoId = ParamUtil.getLong(renderRequest, "soggettoId"); long soggettoId = ParamUtil.getLong(renderRequest, "soggettoId");
Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(soggettoId); Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(soggettoId);
%> %>
<liferay-portlet:renderURL var="editSoggettoURL"> <liferay-portlet:renderURL var="editSoggettoURL">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" />
@ -20,14 +16,12 @@
<liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggettoId) %>" /> <liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggettoId) %>" />
<liferay-portlet:param name="isEditable" value="false" /> <liferay-portlet:param name="isEditable" value="false" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-portlet:renderURL var="redirectErrorURL"> <liferay-portlet:renderURL var="redirectErrorURL">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto_modal.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto_modal.jsp" />
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> <liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" /> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggettoId) %>" /> <liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggettoId) %>" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-portlet:actionURL name="updateAllegatoSoggetto" var="updateAllegatoSoggettoURL"> <liferay-portlet:actionURL name="updateAllegatoSoggetto" var="updateAllegatoSoggettoURL">
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> <liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" /> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
@ -35,36 +29,37 @@
<liferay-portlet:param name="successUrl" value="<%= editSoggettoURL %>" /> <liferay-portlet:param name="successUrl" value="<%= editSoggettoURL %>" />
<liferay-portlet:param name="errorUrl" value="<%= redirectErrorURL %>" /> <liferay-portlet:param name="errorUrl" value="<%= redirectErrorURL %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-ui:error key="error.geniocivilefe.variazione-soggetto.add.file.non.firmato"
<liferay-ui:error key="error.geniocivilefe.variazione-soggetto.add.file.non.firmato" message="file-non-firmato-da-soggetti-e-persona-interessata" /> message="file-non-firmato-da-soggetti-e-persona-interessata" />
<liferay-ui:error key="error.geniocivilefe.variazione-soggetto.add.file.non.firmato.committente" message="file-non-firmato-da-titolare-digitale" /> <liferay-ui:error key="error.geniocivilefe.variazione-soggetto.add.file.non.firmato.committente"
message="file-non-firmato-da-titolare-digitale" />
<liferay-ui:error key="error.geniocivilefe.variazione-soggetto" message="errore-in-variazione-soggetto" /> <liferay-ui:error key="error.geniocivilefe.variazione-soggetto" message="errore-in-variazione-soggetto" />
<liferay-ui:header cssClass="header_back" title="add-file-variazione-soggetto" backURL="<%= editSoggettoURL %>" />
<liferay-ui:header cssClass="header_back" title="add-file-variazione-soggetto" backURL="<%= editSoggettoURL %>"></liferay-ui:header>
<aui:form name="fm" action='<%= updateAllegatoSoggettoURL %>' method="post" enctype="multipart/form-data"> <aui:form name="fm" action='<%= updateAllegatoSoggettoURL %>' method="post" enctype="multipart/form-data">
<aui:model-context bean="<%= soggetto %>" model="<%= Soggetto.class %>" /> <aui:model-context bean="<%= soggetto %>" model="<%= Soggetto.class %>" />
<div class="container-fluid popup-soggetti-modal"> <div class="container-fluid popup-soggetti-modal">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="allegato-file-modifica" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false"
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-message"> title="allegato-file-modifica" >
<div class="col-xs-12 container-message">
<liferay-util:include page="/html/common/help_message.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/help_message.jsp" servletContext="<%= application %>">
<liferay-util:param name="message" value="help_message_allegato_variazione_soggetti"></liferay-util:param> <liferay-util:param name="message" value="help_message_allegato_variazione_soggetti" />
</liferay-util:include> </liferay-util:include>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-file-chooser"> <div class="col-xs-12 container-file-chooser">
<aui:input type="file" name="docFile" label="" <aui:input type="file" name="docFile" label=""
required="<%= !TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto()) %>" required="<%= !TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto()) %>"
showRequiredLabel="<%= !TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto()) %>"/> showRequiredLabel="<%= !TipoSoggettoUtil.COMMITTENTE.equals(
soggetto.getTipologiaSoggetto()) %>" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-checkbox-edit-allegato"> <div class="col-xs-12 container-checkbox-edit-allegato">
<!-- ADT BUG ID=27 -->
<aui:input type="checkbox" name="applicaFirma" label="label.firma-doc" value="false" /> <aui:input type="checkbox" name="applicaFirma" label="label.firma-doc" value="false" />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-button"> <div class="col-xs-12 container-button">
<aui:button-row> <aui:button-row>
<aui:button type="submit" value="upload"></aui:button> <aui:button type="submit" value="upload" />
</aui:button-row> </aui:button-row>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>

8
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/init.jsp

@ -1,10 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<% <%
boolean isElencoProgetti = GetterUtil.getBoolean(portletPreferences.getValue("isElencoProgetti", "true")); String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", StringPool.BLANK));
boolean isArchivio = GetterUtil.getBoolean(portletPreferences.getValue("isArchivio", "true")); String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", StringPool.BLANK));
boolean onlyMieiProgetti = GetterUtil.getBoolean(portletPreferences.getValue("onlyMieiProgetti", "true"));
String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", ""));
String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", ""));
%> %>

545
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view.jsp

@ -1,39 +1,35 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="com.liferay.portal.kernel.util.HttpUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil"%> <%@page import="com.liferay.portal.model.User"%>
<%@page import="it.tref.liferay.portos.bo.model.DocPratica"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.DocPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.User"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeBean"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%> <%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%>
<%@page import="java.text.DateFormat"%> <%@page import="java.text.DateFormat"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.HttpUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%> <%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@include file="/html/soggettipratica/init.jsp"%> <%@include file="/html/soggettipratica/init.jsp"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeBean"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%>
<% <%
DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
if (Validator.isNull(dettPratica)) { if (Validator.isNull(dettPratica)) {
@ -43,54 +39,39 @@
} }
dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
} }
/*boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId());
if( Validator.isNotNull(request.getParameter("disabledInput")) ){
disabledInput = GetterUtil.getBoolean(request.getParameter("disabledInput"));
}*/
// Anagrafica Soggetti sempre modificabile anche con pratica sospesa // Anagrafica Soggetti sempre modificabile anche con pratica sospesa
boolean disabledInput = false;
request.setAttribute("bean.dettPratica", dettPratica); request.setAttribute("bean.dettPratica", dettPratica);
IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
//ADT BUG FE ID = 9 boolean disabledInput = !ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId());
if(!ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId())){
disabledInput = true;
}
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId()); Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId());
boolean inBO = ParamUtil.getBoolean(request, "inBO", false); boolean inBO = ParamUtil.getBoolean(request, "inBO", false);
%> %>
<aui:model-context bean="<%= dettPratica %>" model="<%= DettPratica.class %>" />
<aui:model-context bean="<%=dettPratica %>" model="<%=DettPratica.class %>"></aui:model-context>
<% <%
Map<String, Object> dataMap = new HashMap<String, Object>(); Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto"); dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
%> %>
<liferay-portlet:renderURL portletName="<%=PortletKeys.SOGGETTI %>" var="addSoggetto" windowState="<%=LiferayWindowState.POP_UP.toString() %>" > <liferay-portlet:renderURL portletName="<%= PortletKeys.SOGGETTI %>" var="addSoggetto"
windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" /> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="isEditable" value="true" /> <liferay-portlet:param name="isEditable" value="true" />
<liferay-portlet:param name="dialogId" value='<%= String.valueOf(dataMap.get("id")) %>' /> <liferay-portlet:param name="dialogId" value='<%= String.valueOf(dataMap.get("id")) %>' />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<div class="container-fluid container-soggetti"> <div class="container-fluid container-soggetti">
<c:if test="<%= !disabledInput && !inBO %>"> <c:if test="<%= !disabledInput && !inBO %>">
<div class="row container-soggetti"> <div class="row container-soggetti">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12">
<div class="text-right" style="padding-bottom: 15px"> <div class="text-right" style="padding-bottom: 15px">
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
cssClass="inline_toolbar">
<% <%
dataMap.put("title", LanguageUtil.get(pageContext, "add-soggetto")); dataMap.put("title", LanguageUtil.get(pageContext, "add-soggetto"));
%> %>
<liferay-ui:icon linkCssClass="btn btn-primary btn-action" iconCssClass="fa fa-plus" <liferay-ui:icon linkCssClass="btn btn-primary btn-action" iconCssClass="fa fa-plus"
message="add-soggetto" url="<%=addSoggetto%>" message="add-soggetto" url="<%= addSoggetto %>" useDialog="true" data="<%= dataMap %>" />
useDialog="true" data="<%= dataMap %>"/>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</div> </div>
</div> </div>
</div> </div>
</c:if> </c:if>
@ -99,23 +80,20 @@
List<Long> soggettiSostituiti = SoggettoLocalServiceUtil.getSoggettiSostituitiIds(intPratica.getIntPraticaId()); List<Long> soggettiSostituiti = SoggettoLocalServiceUtil.getSoggettiSostituitiIds(intPratica.getIntPraticaId());
%> %>
<div class="row container-soggetti__fe"> <div class="row container-soggetti__fe">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12">
<liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti"> <liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti">
<liferay-ui:search-container-results <liferay-ui:search-container-results
results="<%= SoggettoServiceUtil.findByIntPratica(dettPratica.getIntPraticaId()) %>" results="<%= SoggettoServiceUtil.findByIntPratica(dettPratica.getIntPraticaId()) %>"
total="<%=SoggettoServiceUtil.countByIntPratica(dettPratica.getIntPraticaId())%>" total="<%= SoggettoServiceUtil.countByIntPratica(dettPratica.getIntPraticaId()) %>" />
/> <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto">
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto"
>
<% <%
boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(), dettPratica.getDettPraticaId()); boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(),
dettPratica.getDettPraticaId());
%> %>
<liferay-ui:search-container-column-text name="Stato" cssClass="text-center"> <liferay-ui:search-container-column-text name="Stato" cssClass="text-center">
<% <%
String color = ""; String color = StringPool.BLANK;
if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) { if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) {
color = "txt-red"; color = "txt-red";
} else { } else {
@ -138,7 +116,8 @@
clickFunction = "javascript:void(0)"; clickFunction = "javascript:void(0)";
unclickableClass = "unclickable"; unclickableClass = "unclickable";
} else { } else {
if( !isSoggettoPrincipale && Validator.isNull(soggetto.getDettPraticaIdRimozione()) && !soggetto.getTmp() ){ if (!isSoggettoPrincipale && Validator.isNull(soggetto.getDettPraticaIdRimozione())
&& !soggetto.getTmp()) {
clickFunction = "makeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")"; clickFunction = "makeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")";
} else { } else {
clickFunction = "javascript:void(0)"; clickFunction = "javascript:void(0)";
@ -146,7 +125,9 @@
} }
} }
%> %>
<span class='<%= (isSoggettoPrincipale ? "main-soggetto is_main fa fa-star txt-orange " : "main-soggetto not_main fa fa-star-o ")+unclickableClass %>' onclick='<%= clickFunction %>'></span> <span class='<%= isSoggettoPrincipale ? "main-soggetto is_main fa fa-star txt-orange "
: "main-soggetto not_main fa fa-star-o " + unclickableClass %>'
onclick='<%= clickFunction %>'></span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Ruolo"> <liferay-ui:search-container-column-text name="Ruolo">
<%= soggetto.getFullTipologiaSoggetto() %> <%= soggetto.getFullTipologiaSoggetto() %>
@ -156,7 +137,8 @@
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Albo" cssClass="text-uppercase"> <liferay-ui:search-container-column-text name="Albo" cssClass="text-uppercase">
<% <%
if(Validator.isNull(soggetto.getAlbo()) || "albo-altro".equalsIgnoreCase(soggetto.getAlbo())){ if (Validator.isNull(soggetto.getAlbo())
|| "albo-altro".equalsIgnoreCase(soggetto.getAlbo())) {
out.print(soggetto.getAlboDescr()); out.print(soggetto.getAlboDescr());
} else { } else {
out.print(LanguageUtil.get(pageContext, "label-albo-" + soggetto.getAlbo())); out.print(LanguageUtil.get(pageContext, "label-albo-" + soggetto.getAlbo()));
@ -168,77 +150,69 @@
<% <%
Soggetto sostituente = SoggettoLocalServiceUtil.getSoggetto(soggetto.getSostituitoDa()); Soggetto sostituente = SoggettoLocalServiceUtil.getSoggetto(soggetto.getSostituitoDa());
%> %>
<span class="tooltip-info" title="<%= "da "+sostituente.getCodiceFiscale().toUpperCase()+" il "+dateFormatDate.format(sostituente.getCreateDate()) %>"> <span class="tooltip-info" title="<%= "da " + sostituente.getCodiceFiscale().toUpperCase()
+ " il " + dateFormatDate.format(sostituente.getCreateDate()) %>">
<i class="fa fa-check-square relative txt-green"></i> <i class="fa fa-check-square relative txt-green"></i>
</span> </span>
</c:if> </c:if>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<c:if test="<%= disabledInput %>"> <c:if test="<%= disabledInput %>">
<liferay-ui:search-container-column-text name="Azioni" cssClass="text-center"> <liferay-ui:search-container-column-text name="Azioni" cssClass="text-center">
<liferay-portlet:renderURL portletName="<%=PortletKeys.SOGGETTI %>" var="viewURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL portletName="<%= PortletKeys.SOGGETTI %>" var="viewURL"
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp"/> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> <liferay-portlet:param name="mvcPath"
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/> value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
<liferay-portlet:param name="dettPraticaId"
value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="isEditable" value="false" /> <liferay-portlet:param name="isEditable" value="false" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<% <%
dataMap.put("title", LanguageUtil.get(pageContext, "view-soggetto")); dataMap.put("title", LanguageUtil.get(pageContext, "view-soggetto"));
%> %>
<liferay-ui:icon <liferay-ui:icon iconCssClass="fa fa-eye" message="view" url="<%= viewURL %>"
iconCssClass="fa fa-eye" linkCssClass="btn btn-action btn-primary" useDialog="true"
message="view" data="<%= dataMap %>" />
url="<%=viewURL%>"
linkCssClass="btn btn-action btn-primary"
useDialog="true"
data="<%= dataMap %>"
/>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</c:if> </c:if>
<c:if test="<%= !disabledInput %>"> <c:if test="<%= !disabledInput %>">
<liferay-ui:search-container-column-text name="Azioni" cssClass="text-center"> <liferay-ui:search-container-column-text name="Azioni" cssClass="text-center">
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > cssClass="inline_toolbar">
<c:if test="<%= soggetto.getDettPraticaId() == dettPratica.getDettPraticaId() %>"> <c:if test="<%= soggetto.getDettPraticaId() == dettPratica.getDettPraticaId() %>">
<liferay-portlet:renderURL portletName="<%=PortletKeys.SOGGETTI %>" var="editURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL portletName="<%= PortletKeys.SOGGETTI %>" var="editURL"
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp"/> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> <liferay-portlet:param name="mvcPath"
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/> value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
<liferay-portlet:param name="dettPraticaId"
value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="isEditable" value="true" /> <liferay-portlet:param name="isEditable" value="true" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<% <%
dataMap.put("title", LanguageUtil.get(pageContext, "edit-soggetto")); dataMap.put("title", LanguageUtil.get(pageContext, "edit-soggetto"));
%> %>
<liferay-ui:icon <liferay-ui:icon iconCssClass="fa fa-edit" message="edit" url="<%= editURL %>"
iconCssClass="fa fa-edit" linkCssClass="btn btn-action btn-primary" useDialog="true"
message="edit" data="<%= dataMap %>" />
url="<%=editURL%>"
linkCssClass="btn btn-action btn-primary"
useDialog="true"
data="<%= dataMap %>"
/>
<liferay-portlet:actionURL var="deleteSoggettoURL" name="deleteSoggetto"> <liferay-portlet:actionURL var="deleteSoggettoURL" name="deleteSoggetto">
<liferay-portlet:param name="redirect" value='<%=HttpUtil.addParameter(currentURL, renderResponse.getNamespace()+"historyKey", renderResponse.getNamespace()+"page_soggetti") %>'/> <liferay-portlet:param name="redirect" value='<%= HttpUtil.addParameter(
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> currentURL, renderResponse.getNamespace() + "historyKey",
renderResponse.getNamespace() + "page_soggetti") %>' />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-ui:icon id='<%= "delete_" + soggetto.getSoggettoId() %>'
<liferay-ui:icon iconCssClass="fa fa-trash" message="delete" url="javascript:void(0)"
id='<%="delete_"+soggetto.getSoggettoId() %>' linkCssClass="btn btn-action btn-danger" />
iconCssClass="fa fa-trash"
message="delete"
url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger"
/>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"delete_"+soggetto.getSoggettoId() %>').on( A.one('<%= "#" + renderResponse.getNamespace() + "delete_"
'click', + soggetto.getSoggettoId() %>').on('click', function(event) {
function(event) {
event.preventDefault(); event.preventDefault();
if (confirm('rimuovere il soggetto?')) { if (confirm('rimuovere il soggetto?')) {
A.io.request( A.io.request('<%= deleteSoggettoURL %>', {
'<%=deleteSoggettoURL%>',
{
on: { on: {
start : function() { start : function() {
Loading.start(); Loading.start();
@ -254,16 +228,16 @@
Loading.end(); Loading.end();
} }
} }
});
} }
); });
}
}
);
</aui:script> </aui:script>
</c:if> </c:if>
<c:if test="<%= AzioniPraticheUtil.canRemoveSoggetto(dettPratica.getIntPraticaId(), soggetto.getTipologiaSoggetto()) <c:if test="<%= AzioniPraticheUtil.canRemoveSoggetto(dettPratica.getIntPraticaId(),
soggetto.getTipologiaSoggetto())
&& soggetto.getDettPraticaId() != dettPratica.getDettPraticaId() %>"> && soggetto.getDettPraticaId() != dettPratica.getDettPraticaId() %>">
<c:if test="<%= Validator.isNotNull(soggetto.getDettPraticaIdRimozione()) && Validator.isNull(soggetto.getSostituitoDa()) %>"> <c:if test="<%= Validator.isNotNull(soggetto.getDettPraticaIdRimozione())
&& Validator.isNull(soggetto.getSostituitoDa()) %>">
<liferay-portlet:actionURL var="validaSoggettoURL" name="validaSoggetto"> <liferay-portlet:actionURL var="validaSoggettoURL" name="validaSoggetto">
<liferay-portlet:param name="redirect" value='<%= HttpUtil.addParameter(currentURL, renderResponse.getNamespace() + "historyKey", renderResponse.getNamespace() + "page_soggetti") %>' /> <liferay-portlet:param name="redirect" value='<%= HttpUtil.addParameter(currentURL, renderResponse.getNamespace() + "historyKey", renderResponse.getNamespace() + "page_soggetti") %>' />
<liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggetto.getSoggettoId()) %>" /> <liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
@ -274,17 +248,13 @@
iconCssClass="fa fa-check-square" iconCssClass="fa fa-check-square"
message="Valida" message="Valida"
url="javascript:void(0)" url="javascript:void(0)"
linkCssClass="btn btn-success btn-action" linkCssClass="btn btn-success btn-action" />
/>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"valid_"+soggetto.getSoggettoId() %>').on( A.one('<%= "#" + renderResponse.getNamespace() + "valid_"
'click', + soggetto.getSoggettoId() %>').on('click', function(event) {
function(event) {
event.preventDefault(); event.preventDefault();
Loading.start(); Loading.start();
A.io.request( A.io.request('<%= validaSoggettoURL %>', {
'<%=validaSoggettoURL%>',
{
on: { on: {
failure: function() { failure: function() {
alert('Impossibile invalidare il soggetto!'); alert('Impossibile invalidare il soggetto!');
@ -296,24 +266,25 @@
complete: function(){ complete: function(){
Loading.end(); Loading.end();
} }
}
} }
); });
} });
);
</aui:script> </aui:script>
</c:if> </c:if>
<c:if test="<%= Validator.isNull(soggetto.getDettPraticaIdRimozione()) %>"> <c:if test="<%= Validator.isNull(soggetto.getDettPraticaIdRimozione()) %>">
<liferay-portlet:renderURL portletName="<%=PortletKeys.SOGGETTI %>" var="sostituisciURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL portletName="<%= PortletKeys.SOGGETTI %>"
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp"/> var="sostituisciURL"
<liferay-portlet:param name="soggettoSostituitoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/> <liferay-portlet:param name="mvcPath"
value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="soggettoSostituitoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
<liferay-portlet:param name="dettPraticaId"
value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="isEditable" value="true" /> <liferay-portlet:param name="isEditable" value="true" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<% <%
dataMap.put("title", LanguageUtil.get(pageContext, "edit-soggetto")); dataMap.put("title", LanguageUtil.get(pageContext, "edit-soggetto"));
String title = StringPool.BLANK; String title = StringPool.BLANK;
String clazz = StringPool.BLANK; String clazz = StringPool.BLANK;
if (soggettiSostituiti.contains(soggetto.getSoggettoId())) { if (soggettiSostituiti.contains(soggetto.getSoggettoId())) {
@ -322,38 +293,36 @@
} }
%> %>
<span title='<%= title %>' class="<%= clazz %>"> <span title='<%= title %>' class="<%= clazz %>">
<liferay-ui:icon <liferay-ui:icon iconCssClass="fa fa-exchange" message="Sostituisci"
iconCssClass="fa fa-exchange" url="<%= sostituisciURL %>" linkCssClass='<%=
message="Sostituisci" soggettiSostituiti.contains(soggetto.getSoggettoId())
url="<%=sostituisciURL%>" ? "btn btn-action btn-primary disabled"
linkCssClass='<%= soggettiSostituiti.contains(soggetto.getSoggettoId()) ? "btn btn-action btn-primary disabled" : "btn btn-action btn-primary" %>' : "btn btn-action btn-primary" %>'
useDialog="true" useDialog="true" data="<%= dataMap %>" />
data="<%= dataMap %>"
/>
</span> </span>
<c:if test="<%= !soggettiSostituiti.contains(soggetto.getSoggettoId()) %>"> <c:if test="<%= !soggettiSostituiti.contains(soggetto.getSoggettoId()) %>">
<liferay-portlet:actionURL var="invalidaSoggettoURL" name="invalidaSoggetto" > <liferay-portlet:actionURL var="invalidaSoggettoURL"
<liferay-portlet:param name="redirect" value='<%=HttpUtil.addParameter(currentURL, renderResponse.getNamespace()+"historyKey", renderResponse.getNamespace()+"page_soggetti") %>'/> name="invalidaSoggetto">
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/> <liferay-portlet:param name="redirect"
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> value='<%= HttpUtil.addParameter(currentURL,
renderResponse.getNamespace() + "historyKey",
renderResponse.getNamespace() + "page_soggetti") %>' />
<liferay-portlet:param name="dettPraticaId" value="<%= String
.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-ui:icon <liferay-ui:icon id='<%= "invalid_" + soggetto.getSoggettoId() %>'
id='<%="invalid_"+soggetto.getSoggettoId() %>' iconCssClass="fa fa-ban" message="Invalida"
iconCssClass="fa fa-ban"
message="Invalida"
url="javascript:void(0)" url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger" linkCssClass="btn btn-action btn-danger" />
/>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"invalid_"+soggetto.getSoggettoId() %>').on( A.one('<%= "#" + renderResponse.getNamespace() + "invalid_"
'click', + soggetto.getSoggettoId() %>').on('click', function(event) {
function(event) {
event.preventDefault(); event.preventDefault();
Loading.start(); Loading.start();
if (confirm('Sei sicuro di voler invalidare il soggetto?')) { if (confirm('Sei sicuro di voler invalidare il soggetto?')) {
A.io.request( A.io.request('<%= invalidaSoggettoURL %>', {
'<%=invalidaSoggettoURL%>',
{
on: { on: {
failure: function() { failure: function() {
alert('Impossibile invalidare il soggetto!'); alert('Impossibile invalidare il soggetto!');
@ -366,58 +335,49 @@
Loading.end(); Loading.end();
} }
} }
});
} }
); });
}
}
);
</aui:script> </aui:script>
</c:if> </c:if>
</c:if> </c:if>
</c:if> </c:if>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</c:if> </c:if>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" />
<liferay-ui:search-iterator paginate="<%= false %>" />
</liferay-ui:search-container> </liferay-ui:search-container>
</div> </div>
</div> </div>
</c:if> </c:if>
<c:if test="<%= inBO %>"> <c:if test="<%= inBO %>">
<div class="row container-soggetti__bo "> <div class="row container-soggetti__bo ">
<div class="col-sm-12 col-md-12 container-soggetti__bo-dettagli"> <div class="col-sm-12 container-soggetti__bo-dettagli">
<liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti"> <liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti">
<liferay-ui:search-container-results <liferay-ui:search-container-results
results="<%= SoggettoServiceUtil.findByIntPratica(dettPratica.getIntPraticaId()) %>" results="<%= SoggettoServiceUtil.findByIntPratica(dettPratica.getIntPraticaId()) %>"
total="<%=SoggettoServiceUtil.countByIntPratica(dettPratica.getIntPraticaId())%>" total="<%= SoggettoServiceUtil.countByIntPratica(dettPratica.getIntPraticaId()) %>" />
/> <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto">
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto"
>
<% <%
boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(), dettPratica.getDettPraticaId()); boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(),
dettPratica.getDettPraticaId());
%> %>
<liferay-portlet:renderURL portletName="<%= PortletKeys.SOGGETTI %>" var="detailsURL"
<liferay-portlet:renderURL portletName="<%=PortletKeys.SOGGETTI %>" var="detailsURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> <liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
<liferay-portlet:param name="inBO" value="true" /> <liferay-portlet:param name="inBO" value="true" />
<liferay-portlet:param name="isEditable" value="false" /> <liferay-portlet:param name="isEditable" value="false" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:search-container-column-text name="Stato" cssClass="text-center"> <liferay-ui:search-container-column-text name="Stato" cssClass="text-center">
<span class='fa fa-circle <%= soggetto.getRimosso() ? "txt-red" : "txt-green" %>'></span> <span class='fa fa-circle <%= soggetto.getRimosso() ? "txt-red" : "txt-green" %>'></span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="principale" cssClass="text-center"> <liferay-ui:search-container-column-text name="principale" cssClass="text-center">
<span class='<%= isSoggettoPrincipale ? "fa fa-star txt-orange" : "fa fa-star-o" %>'></span> <span class='<%= isSoggettoPrincipale ? "fa fa-star txt-orange" : "fa fa-star-o" %>'></span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="ruolo"> <liferay-ui:search-container-column-text name="ruolo">
<%= soggetto.getFullTipologiaSoggetto() %> <%= soggetto.getFullTipologiaSoggetto() %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
@ -435,7 +395,8 @@
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Aggiunto da"> <liferay-ui:search-container-column-text name="Aggiunto da">
<% <%
DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(soggetto.getDettPraticaId()); DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(
soggetto.getDettPraticaId());
if (adding != null) { if (adding != null) {
%> %>
<%= adding.getFullDescription() %> <%= adding.getFullDescription() %>
@ -445,7 +406,8 @@
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Invalidato da"> <liferay-ui:search-container-column-text name="Invalidato da">
<% <%
DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(soggetto.getDettPraticaIdRimozione()); DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(
soggetto.getDettPraticaIdRimozione());
if (removing != null) { if (removing != null) {
%> %>
<%= removing.getFullDescription() %> <%= removing.getFullDescription() %>
@ -454,72 +416,73 @@
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="" cssClass="text-center text-nowrap"> <liferay-ui:search-container-column-text name="" cssClass="text-center text-nowrap">
<liferay-ui:icon linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" message="Visualizza" url="<%=detailsURL.toString()%>" useDialog="true"/> <liferay-ui:icon linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard"
message="Visualizza" url="<%= detailsURL.toString() %>" useDialog="true" />
<% <%
//ADT BUG FE ID = 6
if (soggetto.getFileVariazioneId() != 0) { if (soggetto.getFileVariazioneId() != 0) {
DocPratica pratica = DocPraticaLocalServiceUtil.getDocPratica(soggetto.getFileVariazioneId()); DocPratica pratica = DocPraticaLocalServiceUtil.getDocPratica(
soggetto.getFileVariazioneId());
if (pratica != null) { if (pratica != null) {
//ADT BUG BO ID = 37 - AGGIUNTA FIRMATARI FILE BACK OFFICE //ADT BUG BO ID = 37 - AGGIUNTA FIRMATARI FILE BACK OFFICE
FirmeBean firme = FirmeUtil.deserialize(pratica.getJsonFirmatari()); FirmeBean firme = FirmeUtil.deserialize(pratica.getJsonFirmatari());
StringBuilder title = new StringBuilder(); StringBuilder title = new StringBuilder();
if (!firme.getFirmeDigitali().isEmpty()) { if (!firme.getFirmeDigitali().isEmpty()) {
title.append("Firma sul file:<ul>"); title.append("Firma sul file:<ul>");
for (FirmeDetail firma: firme.getFirmeDigitali()) { for (FirmeDetail firma: firme.getFirmeDigitali()) {
List<Soggetto> soggetti = SoggettoLocalServiceUtil
List<Soggetto> soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(), firma.getCfFirmatario()); .findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(),
firma.getCfFirmatario());
if (soggetti.size() > 0) { if (soggetti.size() > 0) {
title.append("<li>"+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"</li>"); title.append("<li>").append(soggetti.get(0).getNome())
.append(StringPool.SPACE).append(soggetti.get(0).getCognome())
.append("</li>");
} }
title.append("<li>"+firma.getCfFirmatario()); title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) { if (Validator.isNotNull(firma.getDtFirma())) {
title.append(" del "+dateFormatDate.format(firma.getDtFirma())); title.append(" del ")
.append(dateFormatDate.format(firma.getDtFirma()));
} }
title.append("</li>"); title.append("</li>");
} }
title.append("</ul>"); title.append("</ul>");
} }
if (!firme.getFirmeApplicativo().isEmpty()) { if (!firme.getFirmeApplicativo().isEmpty()) {
title.append("Firme da applicativo:<ul>"); title.append("Firme da applicativo:<ul>");
for (FirmeDetail firma: firme.getFirmeApplicativo()) { for (FirmeDetail firma: firme.getFirmeApplicativo()) {
List<Soggetto> soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(), firma.getCfFirmatario()); List<Soggetto> soggetti = SoggettoLocalServiceUtil
.findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(),
firma.getCfFirmatario());
if (soggetti.size() > 0) { if (soggetti.size() > 0) {
title.append("<li>"+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"</li>"); title.append("<li>").append(soggetti.get(0).getNome())
.append(StringPool.SPACE).append(soggetti.get(0).getCognome())
.append("</li>");
} }
title.append("<li>"+firma.getCfFirmatario()); title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) { if (Validator.isNotNull(firma.getDtFirma())) {
title.append(" del "+dateFormatDate.format(firma.getDtFirma())); title.append(" del ").append(dateFormatDate.format(firma.getDtFirma()));
} }
title.append("</li>"); title.append("</li>");
} }
title.append("</ul>"); title.append("</ul>");
} }
%> %>
<liferay-ui:icon id='<%="download_"+pratica.getDocPraticaId() %>' linkCssClass="btn btn-action" iconCssClass="fa fa-download" message="Download" url="<%=pratica.getDownloadUrl(themeDisplay)%>"/> <liferay-ui:icon id='<%= "download_" + pratica.getDocPraticaId() %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-download" message="Download"
url="<%= pratica.getDownloadUrl(themeDisplay) %>" />
<span class='fa fa-check asseverazioni-icon tooltip-info txt-green %>' title="<%=title%>"> <span class='fa fa-check asseverazioni-icon tooltip-info txt-green %>'
title="<%= title %>">
<c:if test="<%= firme.numeroFirme() > 0 %>"> <c:if test="<%= firme.numeroFirme() > 0 %>">
<sub class="txt-bold"><%= firme.numeroFirme() %></sub> <sub class="txt-bold"><%= firme.numeroFirme() %></sub>
</c:if> </c:if>
</span> </span>
<% <%
} }
} }
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= false %>" /> <liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container> </liferay-ui:search-container>
</div> </div>
</div> </div>
@ -527,15 +490,16 @@
</div> </div>
<div class="container-fluid container-delega-committente"> <div class="container-fluid container-delega-committente">
<div class="row container-delega-committente"> <div class="row container-delega-committente">
<div class="col-sm-12 col-md-12 soggetti-tab"> <div class="col-sm-12 soggetti-tab">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-committente"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-committente">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<% <%
List<Soggetto> committenti = SoggettoServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); List<Soggetto> committenti = SoggettoServiceUtil
.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.COMMITTENTE);
%> %>
<c:if test="<%= committenti.isEmpty() %>"> <c:if test="<%= committenti.isEmpty() %>">
<div> <div>
@ -544,7 +508,8 @@
</c:if> </c:if>
<c:if test="<%= !committenti.isEmpty() %>"> <c:if test="<%= !committenti.isEmpty() %>">
<label for="<portlet:namespace/>committenti-list">Lista Committenti</label> <label for="<portlet:namespace/>committenti-list">Lista Committenti</label>
<ul id='<portlet:namespace/>committenti-list' style="padding-left: 20px;list-style: initial;"> <ul id='<portlet:namespace/>committenti-list'
style="padding-left: 20px; list-style: initial">
<% <%
for (Soggetto committente : committenti) { for (Soggetto committente : committenti) {
%> %>
@ -557,23 +522,41 @@
<% <%
User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId()); User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId());
%> %>
<aui:input type="hidden" useNamespace="false" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCommittente" %>' value='<%= titolareUser.getScreenName() %>'/> <aui:input type="hidden" useNamespace="false" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCommittente" %>'
value='<%= titolareUser.getScreenName() %>' />
<c:if test="<%= !inBO %>"> <c:if test="<%= !inBO %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCommittenteEnabled"%>' checked="<%= Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCommittente()) %>" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-committente"), user.getFirstName()+" "+user.getMiddleName(), user.getLastName()) %>' inlineField="true" useNamespace="false"></aui:input> name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCommittenteEnabled" %>'
checked="<%= Validator.isNotNull(dettPratica
.getCodiceFiscaleDelegatoCommittente()) %>"
label='<%= MessageFormat.format(LanguageUtil.get(
pageContext, "text-delega-committente"),
user.getFirstName() + StringPool.SPACE + user.getMiddleName(),
user.getLastName()) %>'
inlineField="true" useNamespace="false" />
</c:if> </c:if>
<c:if test="<%= inBO %>"> <c:if test="<%= inBO %>">
<% <%
List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoCommittente()); List<Soggetto> titolari = SoggettoLocalServiceUtil
.getValidByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoCommittente());
Soggetto titolare = null; Soggetto titolare = null;
if (!titolari.isEmpty()) { if (!titolari.isEmpty()) {
titolare = titolari.get(0); titolare = titolari.get(0);
} }
%> %>
<c:if test="<%= Validator.isNotNull(titolare) %>"> <c:if test="<%= Validator.isNotNull(titolare) %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCommittenteEnabled"%>' checked="<%= Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCommittente()) %>" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-committente"), titolare.getNome(), titolare.getCognome()) %>' inlineField="true" useNamespace="false"></aui:input> name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCommittenteEnabled" %>'
checked="<%= Validator.isNotNull(dettPratica
.getCodiceFiscaleDelegatoCommittente()) %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext,
"text-delega-committente"), titolare.getNome(),
titolare.getCognome()) %>'
inlineField="true" useNamespace="false" />
</c:if> </c:if>
</c:if> </c:if>
</c:if> </c:if>
@ -586,10 +569,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="container-fluid container-delega-direttoreLavori"> <div class="container-fluid container-delega-direttoreLavori">
<div class="row container-delega-direttoreLavori"> <div class="row container-delega-direttoreLavori">
<div class="col-sm-12 col-md-12 soggetti-tab"> <div class="col-sm-12 soggetti-tab">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-direttoreLavori"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-direttoreLavori">
<div class="container-fluid"> <div class="container-fluid">
@ -597,7 +579,9 @@
<div class="col-md-12"> <div class="col-md-12">
<% <%
boolean enabledDelegatoFineLavori = false; boolean enabledDelegatoFineLavori = false;
List<Soggetto> direttoriLavori = SoggettoServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI); List<Soggetto> direttoriLavori = SoggettoServiceUtil
.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.DIRETTORE_LAVORI);
%> %>
<c:if test="<%= direttoriLavori.isEmpty() %>"> <c:if test="<%= direttoriLavori.isEmpty() %>">
<div> <div>
@ -605,30 +589,46 @@
</div> </div>
</c:if> </c:if>
<c:if test="<%= !direttoriLavori.isEmpty() %>"> <c:if test="<%= !direttoriLavori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoFineLavori"%>' showEmptyOption="true" useNamespace="false" disabled="<%= disabledInput || inBO%>"> <aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoFineLavori" %>'
showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>">
<% <%
for (Soggetto direttoreLavori : direttoriLavori) { for (Soggetto direttoreLavori : direttoriLavori) {
if(dettPratica.getCodiceFiscaleDelegatoFineLavori().equalsIgnoreCase(direttoreLavori.getCodiceFiscale())){ if (dettPratica.getCodiceFiscaleDelegatoFineLavori().equalsIgnoreCase(
direttoreLavori.getCodiceFiscale())) {
enabledDelegatoFineLavori = true; enabledDelegatoFineLavori = true;
} }
%> %>
<aui:option <aui:option label='<%= direttoreLavori.getCodiceFiscale().toUpperCase()
label='<%= direttoreLavori.getCodiceFiscale().toUpperCase()+ " - "+ direttoreLavori.getNome()+" "+direttoreLavori.getCognome() %>' + " - " + direttoreLavori.getNome() + StringPool.SPACE
+ direttoreLavori.getCognome() %>'
value="<%= direttoreLavori.getCodiceFiscale() %>" value="<%= direttoreLavori.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori().equalsIgnoreCase(direttoreLavori.getCodiceFiscale()) %>"/> selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori()
.equalsIgnoreCase(direttoreLavori.getCodiceFiscale()) %>" />
<% <%
} }
%> %>
</aui:select> </aui:select>
<% <%
List<Soggetto> direttori = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoFineLavori()); List<Soggetto> direttori = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(
Soggetto direttore = null; dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoFineLavori());
String dNome = StringPool.BLANK;
String dCognome = StringPool.BLANK;
if (!direttori.isEmpty()) { if (!direttori.isEmpty()) {
direttore = direttori.get(0); Soggetto direttore = direttori.get(0);
} dNome = direttore.getNome();
%> dCognome = direttore.getCognome();
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoFineLavoriEnabled"%>' checked="<%= enabledDelegatoFineLavori %>" }
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-direttoreLavori"), Validator.isNotNull(direttore) ? direttore.getNome() : StringPool.BLANK, Validator.isNotNull(direttore) ? direttore.getCognome() : StringPool.BLANK) %>' inlineField="true" useNamespace="false"></aui:input> %>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoFineLavoriEnabled" %>'
checked="<%= enabledDelegatoFineLavori %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext,
"text-delega-direttoreLavori"), dNome, dCognome) %>'
inlineField="true" useNamespace="false" />
</c:if> </c:if>
</div> </div>
</div> </div>
@ -638,59 +638,74 @@
</div> </div>
</div> </div>
</div> </div>
<div class="container-fluid container-delega-collaudatore"> <div class="container-fluid container-delega-collaudatore">
<div class="row container-delega-collaudatore"> <div class="row container-delega-collaudatore">
<div class="col-sm-12 col-md-12 soggetti-tab"> <div class="col-sm-12 soggetti-tab">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-collaudatore"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-collaudatore">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<% <%
boolean enabledDelegatoCollaudo = false; boolean enabledDelegatoCollaudo = false;
List<Soggetto> collaudatori = SoggettoServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.COLLAUDATORE); List<Soggetto> collaudatori = SoggettoServiceUtil
.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.COLLAUDATORE);
%> %>
<c:if test="<%= collaudatori.isEmpty() %>"> <c:if test="<%= collaudatori.isEmpty() %>">
<div> <div>
<% <%
String text_delega_collaudatore = ""; String text_delega_collaudatore = StringPool.BLANK;
if (dettPratica.getCollaudoStatico()) { if (dettPratica.getCollaudoStatico()) {
text_delega_collaudatore = "text-delega-collaudatore-notRequired"; text_delega_collaudatore = "text-delega-collaudatore-notRequired";
} else { } else {
text_delega_collaudatore = "text-delega-collaudatore-disabled"; text_delega_collaudatore = "text-delega-collaudatore-disabled";
} }
%> %>
<%= LanguageUtil.get(pageContext, text_delega_collaudatore) %> <%= LanguageUtil.get(pageContext, text_delega_collaudatore) %>
</div> </div>
</c:if> </c:if>
<c:if test="<%= !collaudatori.isEmpty() %>"> <c:if test="<%= !collaudatori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCollaudo"%>' showEmptyOption="true" useNamespace="false" disabled="<%= disabledInput || inBO%>"> <aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCollaudo" %>'
showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>">
<% <%
for (Soggetto collaudatore : collaudatori) { for (Soggetto collaudatore : collaudatori) {
if(dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(collaudatore.getCodiceFiscale())){ if (dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(
collaudatore.getCodiceFiscale())) {
enabledDelegatoCollaudo = true; enabledDelegatoCollaudo = true;
} }
%> %>
<aui:option <aui:option label='<%= collaudatore.getCodiceFiscale().toUpperCase() + " - "
label='<%= collaudatore.getCodiceFiscale().toUpperCase()+ " - "+ collaudatore.getNome()+" "+collaudatore.getCognome() %>' + collaudatore.getNome() + StringPool.SPACE
+ collaudatore.getCognome() %>'
value="<%= collaudatore.getCodiceFiscale() %>" value="<%= collaudatore.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(collaudatore.getCodiceFiscale()) %>"/> selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo()
.equalsIgnoreCase(collaudatore.getCodiceFiscale()) %>" />
<% <%
} }
%> %>
</aui:select> </aui:select>
<% <%
List<Soggetto> collaudatoriDelegati = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoCollaudo()); List<Soggetto> collaudatoriDelegati = SoggettoLocalServiceUtil
Soggetto collaudatoreDelegato = null; .findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoCollaudo());
String cdNome = StringPool.BLANK;
String cdCognome = StringPool.BLANK;
if (!collaudatoriDelegati.isEmpty()) { if (!collaudatoriDelegati.isEmpty()) {
collaudatoreDelegato = collaudatoriDelegati.get(0); Soggetto collaudatoreDelegato = collaudatoriDelegati.get(0);
} cdNome = collaudatoreDelegato.getNome();
%> cdCognome = collaudatoreDelegato.getCognome();
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCollaudoEnabled"%>' checked="<%= enabledDelegatoCollaudo %>" }
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-collaudatore"), Validator.isNotNull(collaudatoreDelegato) ? collaudatoreDelegato.getNome() : StringPool.BLANK, Validator.isNotNull(collaudatoreDelegato) ? collaudatoreDelegato.getCognome() : StringPool.BLANK) %>' inlineField="true" useNamespace="false"></aui:input> %>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCollaudoEnabled" %>'
checked="<%= enabledDelegatoCollaudo %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext,
"text-delega-collaudatore"), cdNome, cdCognome) %>'
inlineField="true" useNamespace="false" />
</c:if> </c:if>
</div> </div>
</div> </div>
@ -700,32 +715,20 @@
</div> </div>
</div> </div>
</div> </div>
<aui:script use="aui-base"> <aui:script use="aui-base">
Liferay.fire( Liferay.fire('soggetti-ready', {
'soggetti-ready',
{
isCommittenteAndDitta: <%= SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId()) %>, isCommittenteAndDitta: <%= SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId()) %>,
} });
);
</aui:script> </aui:script>
<liferay-portlet:actionURL var="makePrincipaleURL" name="makePrincipale"> <liferay-portlet:actionURL var="makePrincipaleURL" name="makePrincipale">
<liferay-portlet:param name="redirect" value='<%=HttpUtil.addParameter(currentURL, renderResponse.getNamespace()+"historyKey", renderResponse.getNamespace()+"page_soggetti") %>'/> <liferay-portlet:param name="redirect" value='<%= HttpUtil.addParameter(currentURL, renderResponse.getNamespace()
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/> + "historyKey", renderResponse.getNamespace() + "page_soggetti") %>' />
</liferay-portlet:actionURL>
<liferay-portlet:actionURL var="removePrincipaleURL" name="removePrincipale" >
<liferay-portlet:param name="redirect" value='<%=HttpUtil.addParameter(currentURL, renderResponse.getNamespace()+"historyKey", renderResponse.getNamespace()+"page_soggetti") %>'/>
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" /> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
Liferay.provide( Liferay.provide(window, 'makeSoggettoPrincipale', function(soggettoId) {
window,
'makeSoggettoPrincipale',
function(soggettoId) {
Loading.start(); Loading.start();
A.io.request( A.io.request('<%= makePrincipaleURL %>', {
'<%= makePrincipaleURL %>',
{
data: { data: {
<portlet:namespace />soggettoId: soggettoId, <portlet:namespace />soggettoId: soggettoId,
}, },
@ -742,8 +745,6 @@
Loading.end(); Loading.end();
} }
} }
} });
); });
}
);
</aui:script> </aui:script>

379
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view_valida_fino.jsp

@ -1,30 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%>
<%@page import="java.text.DateFormat"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.HttpUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%>
<%@include file="/html/soggettipratica/init.jsp"%> <%@include file="/html/soggettipratica/init.jsp"%>
<% <%
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
if (dettPraticaId == 0) { if (dettPraticaId == 0) {
@ -34,60 +9,51 @@
if (Validator.isNull(dettPratica)) { if (Validator.isNull(dettPratica)) {
dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
} }
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPratica.getDettPraticaId()); boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPratica.getDettPraticaId());
//Se è variante o integrazione i soggetti li prendo dalla pratica originale
/* boolean getCompleted = ParamUtil.getBoolean(request, "getCompleted", false); */
request.setAttribute("bean.dettPratica", dettPratica); request.setAttribute("bean.dettPratica", dettPratica);
IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId()); Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId());
boolean inBO = ParamUtil.getBoolean(request, "inBO", false); boolean inBO = ParamUtil.getBoolean(request, "inBO", false);
%> %>
<aui:model-context bean="<%= dettPratica %>" model="<%= DettPratica.class %>" />
<aui:model-context bean="<%=dettPratica %>" model="<%=DettPratica.class %>"></aui:model-context>
<liferay-portlet:renderURL var="addSoggetto" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="addSoggetto" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" /> <liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="isEditable" value="true" /> <liferay-portlet:param name="isEditable" value="true" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<div class="container-fluid container-soggetti"> <div class="container-fluid container-soggetti">
<c:if test="<%= !disabledInput && !inBO %>"> <c:if test="<%= !disabledInput && !inBO %>">
<div class="row container-soggetti"> <div class="row container-soggetti">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12">
<div class="text-right" style="padding-bottom: 15px"> <div class="text-right" style="padding-bottom: 15px">
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
<aui:button useDialog="true" value="add-soggetto" id='<%=renderResponse.getNamespace()+"add-soggetto"%>' icon="fa fa-plus" href="<%=addSoggetto %>" cssClass="btn btn-primary btn-action"/> cssClass="inline_toolbar">
<aui:button useDialog="true" value="add-soggetto"
id='<%= renderResponse.getNamespace() + "add-soggetto" %>' icon="fa fa-plus"
href="<%= addSoggetto %>" cssClass="btn btn-primary btn-action" />
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
</div> </div>
</div> </div>
</div> </div>
</c:if> </c:if>
<c:if test="<%= !inBO %>"> <c:if test="<%= !inBO %>">
<div class="row container-soggetti__fe"> <div class="row container-soggetti__fe">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12">
<liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti"> <liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti">
<liferay-ui:search-container-results <liferay-ui:search-container-results
results="<%=SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>" results="<%= SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(
total="<%=SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>" dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>"
/> total="<%= SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(
dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>" />
<liferay-ui:search-container-row <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Soggetto"
className="it.tref.liferay.portos.bo.model.Soggetto" modelVar="soggetto">
modelVar="soggetto"
>
<% <%
boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(), dettPratica.getDettPraticaId()); boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(),
dettPratica.getDettPraticaId());
%> %>
<liferay-ui:search-container-column-text name="Stato"> <liferay-ui:search-container-column-text name="Stato">
<% <%
String color = ""; String color = StringPool.BLANK;
if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) { if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) {
color = "txt-red"; color = "txt-red";
} else { } else {
@ -108,46 +74,35 @@
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<c:if test="<%= !disabledInput %>"> <c:if test="<%= !disabledInput %>">
<liferay-ui:search-container-column-text name="Azioni"> <liferay-ui:search-container-column-text name="Azioni">
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" > cssClass="inline_toolbar">
<c:if test="<%= soggetto.getDettPraticaId() == dettPratica.getDettPraticaId() %>"> <c:if test="<%= soggetto.getDettPraticaId() == dettPratica.getDettPraticaId() %>">
<liferay-portlet:renderURL var="editURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL var="editURL"
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp"/> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> <liferay-portlet:param name="mvcPath"
value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
<liferay-portlet:param name="isEditable" value="true" /> <liferay-portlet:param name="isEditable" value="true" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:icon <liferay-ui:icon iconCssClass="fa fa-edit" message="edit" url="<%= editURL %>"
iconCssClass="fa fa-edit" linkCssClass="btn btn-action btn-primary" useDialog="true" />
message="edit"
url="<%=editURL%>"
linkCssClass="btn btn-action btn-primary"
useDialog="true"
/>
<liferay-portlet:actionURL var="deleteSoggettoURL" name="deleteSoggetto"> <liferay-portlet:actionURL var="deleteSoggettoURL" name="deleteSoggetto">
<liferay-portlet:param name="redirect" value='<%=HttpUtil.addParameter(currentURL, renderResponse.getNamespace()+"historyKey", renderResponse.getNamespace()+"page_soggetti") %>'/> <liferay-portlet:param name="redirect" value='<%= HttpUtil.addParameter(
currentURL, renderResponse.getNamespace() + "historyKey",
renderResponse.getNamespace() + "page_soggetti") %>' />
<liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggetto.getSoggettoId()) %>" /> <liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-ui:icon id='<%= "delete_" + soggetto.getSoggettoId() %>'
<liferay-ui:icon iconCssClass="fa fa-trash" message="delete" url="javascript:void(0)"
id='<%="delete_"+soggetto.getSoggettoId() %>' linkCssClass="btn btn-action btn-danger" />
iconCssClass="fa fa-trash"
message="delete"
url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger"
/>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"delete_"+soggetto.getSoggettoId() %>').on( A.one('<%= StringPool.POUND + renderResponse.getNamespace() + "delete_"
'click', + soggetto.getSoggettoId() %>').on('click', function(event) {
function(event) {
event.preventDefault(); event.preventDefault();
Loading.start(); Loading.start();
if (confirm('rimuovere il soggetto?')) { if (confirm('rimuovere il soggetto?')) {
A.io.request( A.io.request('<%= deleteSoggettoURL %>', {
'<%=deleteSoggettoURL%>',
{
on: { on: {
failure: function() { failure: function() {
alert('impossibile rimuovere il soggetto!'); alert('impossibile rimuovere il soggetto!');
@ -160,35 +115,29 @@
Loading.end(); Loading.end();
} }
} }
});
} }
); });
}
}
);
</aui:script> </aui:script>
</c:if> </c:if>
<c:if test="<%= soggetto.getDettPraticaId() != dettPratica.getDettPraticaId() %>"> <c:if test="<%= soggetto.getDettPraticaId() != dettPratica.getDettPraticaId() %>">
<c:if test="<%= Validator.isNotNull(soggetto.getDettPraticaIdRimozione()) %>"> <c:if test="<%= Validator.isNotNull(soggetto.getDettPraticaIdRimozione()) %>">
<liferay-portlet:actionURL var="validaSoggettoURL" name="validaSoggetto"> <liferay-portlet:actionURL var="validaSoggettoURL" name="validaSoggetto">
<liferay-portlet:param name="redirect" value='<%=HttpUtil.addParameter(currentURL, renderResponse.getNamespace()+"historyKey", renderResponse.getNamespace()+"page_soggetti") %>'/> <liferay-portlet:param name="redirect" value='<%= HttpUtil.addParameter(
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> currentURL, renderResponse.getNamespace() + "historyKey",
renderResponse.getNamespace() + "page_soggetti") %>' />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-ui:icon <liferay-ui:icon id='<%= "valid_" + soggetto.getSoggettoId() %>'
id='<%="valid_"+soggetto.getSoggettoId() %>' iconCssClass="fa fa-valida" message="Valida" url="javascript:void(0)"
iconCssClass="fa fa-valida" linkCssClass="btn btn-success" />
message="Valida"
url="javascript:void(0)"
linkCssClass="btn btn-success"
/>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"valid_"+soggetto.getSoggettoId() %>').on( A.one('<%= StringPool.POUND + renderResponse.getNamespace() + "valid_"
'click', + soggetto.getSoggettoId() %>').on('click', function(event) {
function(event) {
event.preventDefault(); event.preventDefault();
Loading.start(); Loading.start();
A.io.request( A.io.request('<%= validaSoggettoURL %>', {
'<%=validaSoggettoURL%>',
{
on: { on: {
failure: function() { failure: function() {
alert('Impossibile invalidare il soggetto!'); alert('Impossibile invalidare il soggetto!');
@ -201,35 +150,30 @@
Loading.end(); Loading.end();
} }
} }
} });
); });
}
);
</aui:script> </aui:script>
</c:if> </c:if>
<c:if test="<%= Validator.isNull(soggetto.getDettPraticaIdRimozione()) %>"> <c:if test="<%= Validator.isNull(soggetto.getDettPraticaIdRimozione()) %>">
<liferay-portlet:actionURL var="invalidaSoggettoURL" name="invalidaSoggetto"> <liferay-portlet:actionURL var="invalidaSoggettoURL" name="invalidaSoggetto">
<liferay-portlet:param name="redirect" value='<%=HttpUtil.addParameter(currentURL, renderResponse.getNamespace()+"historyKey", renderResponse.getNamespace()+"page_soggetti") %>'/> <liferay-portlet:param name="redirect" value='<%= HttpUtil.addParameter(
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/> currentURL, renderResponse.getNamespace() + "historyKey",
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> renderResponse.getNamespace() + "page_soggetti") %>' />
<liferay-portlet:param name="dettPraticaId"
value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<liferay-ui:icon <liferay-ui:icon id='<%= "invalid_" + soggetto.getSoggettoId() %>'
id='<%="invalid_"+soggetto.getSoggettoId() %>' iconCssClass="fa fa-ban" message="Invalida" url="javascript:void(0)"
iconCssClass="fa fa-ban" linkCssClass="btn btn-action btn-danger" />
message="Invalida"
url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger"
/>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"invalid_"+soggetto.getSoggettoId() %>').on( A.one('<%= StringPool.POUND + renderResponse.getNamespace() + "invalid_"
'click', + soggetto.getSoggettoId() %>').on('click', function(event) {
function(event) {
event.preventDefault(); event.preventDefault();
Loading.start(); Loading.start();
if (confirm('Sei sicuro di voler invalidare il soggetto?')) { if (confirm('Sei sicuro di voler invalidare il soggetto?')) {
A.io.request( A.io.request('<%= invalidaSoggettoURL %>', {
'<%=invalidaSoggettoURL%>',
{
on: { on: {
failure: function() { failure: function() {
alert('Impossibile invalidare il soggetto!'); alert('Impossibile invalidare il soggetto!');
@ -242,11 +186,9 @@
Loading.end(); Loading.end();
} }
} }
});
} }
); });
}
}
);
</aui:script> </aui:script>
</c:if> </c:if>
</c:if> </c:if>
@ -254,39 +196,36 @@
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</c:if> </c:if>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" />
<liferay-ui:search-iterator paginate="<%= false %>" />
</liferay-ui:search-container> </liferay-ui:search-container>
</div> </div>
</div> </div>
</c:if> </c:if>
<c:if test="<%= inBO %>"> <c:if test="<%= inBO %>">
<div class="row container-soggetti__bo "> <div class="row container-soggetti__bo ">
<div class="col-sm-12 col-md-12 container-soggetti__bo-dettagli"> <div class="col-sm-12 container-soggetti__bo-dettagli">
<liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti"> <liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti">
<liferay-ui:search-container-results <liferay-ui:search-container-results
results="<%=SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>" results="<%= SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(
total="<%=SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>" dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>"
/> total="<%= SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(
dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>" />
<liferay-ui:search-container-row <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Soggetto"
className="it.tref.liferay.portos.bo.model.Soggetto" modelVar="soggetto">
modelVar="soggetto"
>
<% <%
boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(), dettPratica.getDettPraticaId()); boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(),
dettPratica.getDettPraticaId());
%> %>
<liferay-portlet:renderURL var="detailsURL"
<liferay-portlet:renderURL var="detailsURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" /> <liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> <liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
<liferay-portlet:param name="isEditable" value="false" /> <liferay-portlet:param name="isEditable" value="false" />
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:search-container-column-text name="Stato" cssClass="text-center"> <liferay-ui:search-container-column-text name="Stato" cssClass="text-center">
<% <%
String color = ""; String color;
if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) { if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) {
color = "txt-red"; color = "txt-red";
} else { } else {
@ -295,7 +234,6 @@
%> %>
<span class='fa fa-circle <%= color %>'></span> <span class='fa fa-circle <%= color %>'></span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Data Nomina" cssClass="text-center"> <liferay-ui:search-container-column-text name="Data Nomina" cssClass="text-center">
<%= dateFormatDateTime.format(soggetto.getCreateDate()) %> <%= dateFormatDateTime.format(soggetto.getCreateDate()) %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
@ -306,8 +244,8 @@
if (disabledInput || inBO) { if (disabledInput || inBO) {
clickFunction = "javascript:void(0)"; clickFunction = "javascript:void(0)";
unclickableClass = "unclickable"; unclickableClass = "unclickable";
} else { } else if (!isSoggettoPrincipale && Validator.isNull(soggetto.getDettPraticaIdRimozione())
if( !isSoggettoPrincipale && Validator.isNull(soggetto.getDettPraticaIdRimozione()) && !soggetto.getTmp() ){ && !soggetto.getTmp()) {
clickFunction = "makeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")"; clickFunction = "makeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")";
} else if (isSoggettoPrincipale) { } else if (isSoggettoPrincipale) {
clickFunction = "unmakeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")"; clickFunction = "unmakeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")";
@ -315,11 +253,11 @@
clickFunction = "javascript:void(0)"; clickFunction = "javascript:void(0)";
unclickableClass = "unclickable"; unclickableClass = "unclickable";
} }
}
%> %>
<span class='<%= (isSoggettoPrincipale ? "main-soggetto is_main fa fa-star txt-orange " : "main-soggetto not_main fa fa-star-o ")+unclickableClass %>' onclick='<%= clickFunction %>'></span> <span class='<%= (isSoggettoPrincipale ? "main-soggetto is_main fa fa-star txt-orange "
: "main-soggetto not_main fa fa-star-o ") + unclickableClass %>'
onclick='<%= clickFunction %>'></span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="denominazione"> <liferay-ui:search-container-column-text name="denominazione">
<%= soggetto.getDescrizioneCompleta() %> <%= soggetto.getDescrizioneCompleta() %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
@ -327,30 +265,29 @@
<liferay-ui:search-container-column-text name="Ruolo"> <liferay-ui:search-container-column-text name="Ruolo">
<%= LanguageUtil.get(pageContext, "gc-soggetto-" + soggetto.getTipologiaSoggetto()) %> <%= LanguageUtil.get(pageContext, "gc-soggetto-" + soggetto.getTipologiaSoggetto()) %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="" cssClass="text-center"> <liferay-ui:search-container-column-text name="" cssClass="text-center">
<liferay-ui:icon linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" message="Visualizza" url="<%=detailsURL.toString()%>" useDialog="true"/> <liferay-ui:icon linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard"
message="Visualizza" url="<%= detailsURL.toString() %>" useDialog="true" />
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= false %>" /> <liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container> </liferay-ui:search-container>
</div> </div>
</div> </div>
</c:if> </c:if>
</div> </div>
<div class="container-fluid container-delega-committente"> <div class="container-fluid container-delega-committente">
<div class="row container-delega-committente"> <div class="row container-delega-committente">
<div class="col-sm-12 col-md-12 soggetti-tab"> <div class="col-sm-12 soggetti-tab">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-committente"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-committente">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<% <%
List<Soggetto> committenti = SoggettoServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); List<Soggetto> committenti = SoggettoServiceUtil
.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.COMMITTENTE);
%> %>
<c:if test="<%= committenti.isEmpty() %>"> <c:if test="<%= committenti.isEmpty() %>">
<div> <div>
@ -359,7 +296,8 @@
</c:if> </c:if>
<c:if test="<%= !committenti.isEmpty() %>"> <c:if test="<%= !committenti.isEmpty() %>">
<label for="<portlet:namespace/>committenti-list">Lista Committenti</label> <label for="<portlet:namespace/>committenti-list">Lista Committenti</label>
<ul id='<portlet:namespace/>committenti-list' style="padding-left: 20px;list-style: initial;"> <ul id='<portlet:namespace/>committenti-list'
style="padding-left: 20px;list-style: initial">
<% <%
for (Soggetto committente : committenti) { for (Soggetto committente : committenti) {
%> %>
@ -368,27 +306,46 @@
} }
%> %>
</ul> </ul>
<c:if test="<%= !SoggettiUtil.isTitolareInCommittenti(intPratica.getIntPraticaId()) %>"> <c:if test="<%= !SoggettiUtil.isTitolareInCommittenti(
intPratica.getIntPraticaId()) %>">
<% <%
User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId()); User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId());
%> %>
<aui:input type="hidden" useNamespace="false" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCommittente" %>' value='<%= titolareUser.getScreenName() %>'/> <aui:input type="hidden" useNamespace="false" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCommittente" %>'
value='<%= titolareUser.getScreenName() %>' />
<c:if test="<%= !inBO %>"> <c:if test="<%= !inBO %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCommittenteEnabled"%>' checked="<%= Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCommittente()) %>" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-committente"), user.getFirstName()+" "+user.getMiddleName(), user.getLastName()) %>' inlineField="true" useNamespace="false"></aui:input> name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCommittenteEnabled" %>'
checked="<%= Validator.isNotNull(
dettPratica.getCodiceFiscaleDelegatoCommittente()) %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext,
"text-delega-committente"), user.getFirstName()
+ StringPool.SPACE + user.getMiddleName(),
user.getLastName()) %>' inlineField="true"
useNamespace="false" />
</c:if> </c:if>
<c:if test="<%= inBO %>"> <c:if test="<%= inBO %>">
<% <%
List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoCommittente()); List<Soggetto> titolari = SoggettoLocalServiceUtil
.getValidByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoCommittente());
Soggetto titolare = null; Soggetto titolare = null;
if (!titolari.isEmpty()) { if (!titolari.isEmpty()) {
titolare = titolari.get(0); titolare = titolari.get(0);
} }
%> %>
<c:if test="<%= Validator.isNotNull(titolare) %>"> <c:if test="<%= Validator.isNotNull(titolare) %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCommittenteEnabled"%>' checked="<%= Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCommittente()) %>" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-committente"), titolare.getNome(), titolare.getCognome()) %>' inlineField="true" useNamespace="false"></aui:input> name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCommittenteEnabled" %>'
checked="<%= Validator.isNotNull(dettPratica
.getCodiceFiscaleDelegatoCommittente()) %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext,
"text-delega-committente"), titolare.getNome(),
titolare.getCognome()) %>' inlineField="true"
useNamespace="false" />
</c:if> </c:if>
</c:if> </c:if>
</c:if> </c:if>
@ -401,10 +358,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="container-fluid container-delega-direttoreLavori"> <div class="container-fluid container-delega-direttoreLavori">
<div class="row container-delega-direttoreLavori"> <div class="row container-delega-direttoreLavori">
<div class="col-sm-12 col-md-12 soggetti-tab"> <div class="col-sm-12 soggetti-tab">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-direttoreLavori"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-direttoreLavori">
<div class="container-fluid"> <div class="container-fluid">
@ -412,7 +368,9 @@
<div class="col-md-12"> <div class="col-md-12">
<% <%
boolean enabledDelegatoFineLavori = false; boolean enabledDelegatoFineLavori = false;
List<Soggetto> direttoriLavori = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI); List<Soggetto> direttoriLavori = SoggettoServiceUtil
.getValidByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.DIRETTORE_LAVORI);
%> %>
<c:if test="<%= direttoriLavori.isEmpty() %>"> <c:if test="<%= direttoriLavori.isEmpty() %>">
<div> <div>
@ -420,30 +378,46 @@
</div> </div>
</c:if> </c:if>
<c:if test="<%= !direttoriLavori.isEmpty() %>"> <c:if test="<%= !direttoriLavori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoFineLavori"%>' showEmptyOption="true" useNamespace="false" disabled="<%= disabledInput || inBO%>"> <aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoFineLavori" %>'
showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>">
<% <%
for (Soggetto direttoreLavori : direttoriLavori) { for (Soggetto direttoreLavori : direttoriLavori) {
if(dettPratica.getCodiceFiscaleDelegatoFineLavori().equalsIgnoreCase(direttoreLavori.getCodiceFiscale())){ if (dettPratica.getCodiceFiscaleDelegatoFineLavori()
.equalsIgnoreCase(direttoreLavori.getCodiceFiscale())) {
enabledDelegatoFineLavori = true; enabledDelegatoFineLavori = true;
} }
%> %>
<aui:option <aui:option label='<%= direttoreLavori.getCodiceFiscale().toUpperCase()
label='<%= direttoreLavori.getCodiceFiscale().toUpperCase()+ " - "+ direttoreLavori.getNome()+" "+direttoreLavori.getCognome() %>' + " - " + direttoreLavori.getNome() + StringPool.SPACE
+ direttoreLavori.getCognome() %>'
value="<%= direttoreLavori.getCodiceFiscale() %>" value="<%= direttoreLavori.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori().equalsIgnoreCase(direttoreLavori.getCodiceFiscale()) %>"/> selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori()
.equalsIgnoreCase(direttoreLavori.getCodiceFiscale()) %>" />
<% <%
} }
%> %>
</aui:select> </aui:select>
<% <%
List<Soggetto> direttori = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoFineLavori()); List<Soggetto> direttori = SoggettoLocalServiceUtil
.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoFineLavori());
Soggetto direttore = null; Soggetto direttore = null;
if(!direttori.isEmpty()){ if(!direttori.isEmpty()){
direttore = direttori.get(0); direttore = direttori.get(0);
} }
%> %>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoFineLavoriEnabled"%>' checked="<%= enabledDelegatoFineLavori %>" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-direttoreLavori"), Validator.isNotNull(direttore) ? direttore.getNome() : StringPool.BLANK, Validator.isNotNull(direttore) ? direttore.getCognome() : StringPool.BLANK) %>' inlineField="true" useNamespace="false"></aui:input> name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoFineLavoriEnabled" %>'
checked="<%= enabledDelegatoFineLavori %>"
label='<%= MessageFormat.format(
LanguageUtil.get(pageContext, "text-delega-direttoreLavori"),
Validator.isNull(direttore) ? StringPool.BLANK : direttore.getNome(),
Validator.isNull(direttore) ? StringPool.BLANK
: direttore.getCognome() %>'
inlineField="true" useNamespace="false" />
</c:if> </c:if>
</div> </div>
</div> </div>
@ -453,60 +427,75 @@
</div> </div>
</div> </div>
</div> </div>
<div class="container-fluid container-delega-collaudatore"> <div class="container-fluid container-delega-collaudatore">
<div class="row container-delega-collaudatore"> <div class="row container-delega-collaudatore">
<div class="col-sm-12 col-md-12 soggetti-tab"> <div class="col-sm-12 soggetti-tab">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-collaudatore"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-collaudatore">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<% <%
boolean enabledDelegatoCollaudo = false; boolean enabledDelegatoCollaudo = false;
List<Soggetto> collaudatori = SoggettoServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.COLLAUDATORE); List<Soggetto> collaudatori = SoggettoServiceUtil
.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.COLLAUDATORE);
%> %>
<c:if test="<%= collaudatori.isEmpty() %>"> <c:if test="<%= collaudatori.isEmpty() %>">
<div> <div>
<% <%
String text_delega_collaudatore = ""; String text_delega_collaudatore = StringPool.BLANK;
if (dettPratica.getCollaudoStatico()) { if (dettPratica.getCollaudoStatico()) {
text_delega_collaudatore = "text-delega-collaudatore-notRequired"; text_delega_collaudatore = "text-delega-collaudatore-notRequired";
} else { } else {
text_delega_collaudatore = "text-delega-collaudatore-disabled"; text_delega_collaudatore = "text-delega-collaudatore-disabled";
} }
%> %>
<%= LanguageUtil.get(pageContext, text_delega_collaudatore) %> <%= LanguageUtil.get(pageContext, text_delega_collaudatore) %>
</div> </div>
</c:if> </c:if>
<c:if test="<%= !collaudatori.isEmpty() %>"> <c:if test="<%= !collaudatori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCollaudo"%>' showEmptyOption="true" useNamespace="false" disabled="<%= disabledInput || inBO%>"> <aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCollaudo" %>'
showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>">
<% <%
for (Soggetto collaudatore : collaudatori) { for (Soggetto collaudatore : collaudatori) {
if(dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(collaudatore.getCodiceFiscale())){ if (dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(
collaudatore.getCodiceFiscale())) {
enabledDelegatoCollaudo = true; enabledDelegatoCollaudo = true;
} }
%> %>
<aui:option <aui:option label='<%= collaudatore.getCodiceFiscale().toUpperCase()
label='<%= collaudatore.getCodiceFiscale().toUpperCase()+ " - "+ collaudatore.getNome()+" "+collaudatore.getCognome() %>' + " - " + collaudatore.getNome() + StringPool.SPACE
+ collaudatore.getCognome() %>'
value="<%= collaudatore.getCodiceFiscale() %>" value="<%= collaudatore.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(collaudatore.getCodiceFiscale()) %>"/> selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo()
.equalsIgnoreCase(collaudatore.getCodiceFiscale()) %>" />
<% <%
} }
%> %>
</aui:select> </aui:select>
<% <%
List<Soggetto> collaudatoriDelegati = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoCollaudo()); List<Soggetto> collaudatoriDelegati = SoggettoLocalServiceUtil
.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoCollaudo());
Soggetto collaudatoreDelegato = null; Soggetto collaudatoreDelegato = null;
if (!collaudatoriDelegati.isEmpty()) { if (!collaudatoriDelegati.isEmpty()) {
collaudatoreDelegato = collaudatoriDelegati.get(0); collaudatoreDelegato = collaudatoriDelegati.get(0);
} }
%> %>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCollaudoEnabled"%>' checked="<%= enabledDelegatoCollaudo %>" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-collaudatore"), Validator.isNotNull(collaudatoreDelegato) ? collaudatoreDelegato.getNome() : StringPool.BLANK, Validator.isNotNull(collaudatoreDelegato) ? collaudatoreDelegato.getCognome() : StringPool.BLANK) %>' inlineField="true" useNamespace="false"></aui:input> name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCollaudoEnabled" %>'
checked="<%= enabledDelegatoCollaudo %>"
label='<%= MessageFormat.format(
LanguageUtil.get(pageContext, "text-delega-collaudatore"),
Validator.isNull(collaudatoreDelegato) ? StringPool.BLANK
: collaudatoreDelegato.getNome(),
Validator.isNull(collaudatoreDelegato) ? StringPool.BLANK
: collaudatoreDelegato.getCognome()) %>'
inlineField="true" useNamespace="false" />
</c:if> </c:if>
</div> </div>
</div> </div>
@ -516,12 +505,8 @@
</div> </div>
</div> </div>
</div> </div>
<aui:script use="aui-base"> <aui:script use="aui-base">
Liferay.fire( Liferay.fire('soggetti-ready', {
'soggetti-ready',
{
isCommittenteAndDitta: <%= SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId()) %>, isCommittenteAndDitta: <%= SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId()) %>,
} });
);
</aui:script> </aui:script>

14
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java

@ -46,22 +46,18 @@ public class FirmaServlet extends HttpServlet {
private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class); private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class);
/** // @see HttpServlet#HttpServlet()
* @see HttpServlet#HttpServlet()
*/
public FirmaServlet() { public FirmaServlet() {
super(); super();
} }
/** // @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
@Override @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo().substring(1); String pathInfo = request.getPathInfo().substring(1);
String[] pathArray = StringUtil.split(pathInfo, "/"); String[] pathArray = StringUtil.split(pathInfo, StringPool.FORWARD_SLASH);
FirmaGetUtil firmaGetUtil = new FirmaGetUtil(); FirmaGetUtil firmaGetUtil = new FirmaGetUtil();
String metodo = pathArray[0]; String metodo = pathArray[0];
Risposta<?> risposta = new Risposta<>(); Risposta<?> risposta = new Risposta<>();
@ -100,9 +96,7 @@ public class FirmaServlet extends HttpServlet {
ServletResponseUtil.write(response, jsonResponse); ServletResponseUtil.write(response, jsonResponse);
} }
/** // @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
@Override @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException { IOException {

2
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java

@ -8,10 +8,12 @@ public class ExtractorResponse {
private List<String> cf; private List<String> cf;
public boolean isSuccess() { public boolean isSuccess() {
return success; return success;
} }
public List<String> getCf() { public List<String> getCf() {
return cf; return cf;
} }
} }

38
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java

@ -9,6 +9,8 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.portlet.PortletPreferences;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
@ -21,7 +23,7 @@ public class FirmaGetUtil {
put("MESSAGGIO_EFFETTUARE_LOGIN", "Effettuare il login per continuare"); put("MESSAGGIO_EFFETTUARE_LOGIN", "Effettuare il login per continuare");
put("ERRORE_TOKEN_SCADUTO", "Effettuare il login, sessione scaduta"); put("ERRORE_TOKEN_SCADUTO", "Effettuare il login, sessione scaduta");
put("MESSAGGIO_RIFIUTO_ERRORE", "Si è verificato un errore durante il tentativo di rifiuto del file"); put("MESSAGGIO_RIFIUTO_ERRORE", "Si è verificato un errore durante il tentativo di rifiuto del file");
put("RIFIUTA", "true"); put("RIFIUTA", StringPool.TRUE);
put("APRI_PRATICA_DISABILITATO_PER_DOCUMENTO", "v"); put("APRI_PRATICA_DISABILITATO_PER_DOCUMENTO", "v");
put("MESSAGGIO_FIRMA_ATTESA", "Attesa"); put("MESSAGGIO_FIRMA_ATTESA", "Attesa");
put("MESSAGGIO_NO_UTENTE", "Controllare di aver inserito la corretta smart card nel lettore"); put("MESSAGGIO_NO_UTENTE", "Controllare di aver inserito la corretta smart card nel lettore");
@ -32,7 +34,7 @@ public class FirmaGetUtil {
put("MESSAGGIO_FILE_FIRMA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile"); put("MESSAGGIO_FILE_FIRMA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile");
put("SMART_CARD_LETTURA_CF", "SERIALNUMBER"); put("SMART_CARD_LETTURA_CF", "SERIALNUMBER");
put("RIFIUTA_ASSEGNA_PER_PRATICA", " - "); put("RIFIUTA_ASSEGNA_PER_PRATICA", " - ");
put("RIFIUTA_CAMBIA_FASE", "false"); put("RIFIUTA_CAMBIA_FASE", StringPool.FALSE);
put("MESSAGGIO_SCELTA_CERTIFICATO_VALIDO", "Scelta del certificato non valido"); put("MESSAGGIO_SCELTA_CERTIFICATO_VALIDO", "Scelta del certificato non valido");
put("MESSAGGIO_NO_FILE", "Impossibile recuperare il file"); put("MESSAGGIO_NO_FILE", "Impossibile recuperare il file");
put("MESSAGGIO_NO_PRATICA", "Impossibile accedere alla pratica"); put("MESSAGGIO_NO_PRATICA", "Impossibile accedere alla pratica");
@ -59,16 +61,16 @@ public class FirmaGetUtil {
put("NO_FILE", "Nessun file da firmare presente"); put("NO_FILE", "Nessun file da firmare presente");
put("MESSAGGIO_SELEZIONARE_FILE_RIFIUTA", "Selezionare almeno un file prima di premere rifiuta"); put("MESSAGGIO_SELEZIONARE_FILE_RIFIUTA", "Selezionare almeno un file prima di premere rifiuta");
put("MODALITA_LOGIN", "codice_fiscale"); put("MODALITA_LOGIN", "codice_fiscale");
put("VISUALIZZA_FILE", "true"); put("VISUALIZZA_FILE", StringPool.TRUE);
put("APRI_PRATICA_DISABILITATO_PER_PRATICA", " - "); put("APRI_PRATICA_DISABILITATO_PER_PRATICA", " - ");
put("SMART_CARD_LETTURA_NOME", "GIVENNAME"); put("SMART_CARD_LETTURA_NOME", "GIVENNAME");
put("VISUALIZZA_FILE_DISABILITATO_PER_DOCUMENTO", " - "); put("VISUALIZZA_FILE_DISABILITATO_PER_DOCUMENTO", " - ");
put("MESSAGGIO_FIRMA_TOKEN_ERRORE_FIRMA", put("MESSAGGIO_FIRMA_TOKEN_ERRORE_FIRMA",
"Errore durante il tentativo di firma del file necessario al login, controllare di aver inserito correttamente la smart card"); "Errore durante il tentativo di firma del file necessario al login, controllare di aver inserito correttamente la smart card");
put("RIFIUTA_ASSEGNA", "false"); put("RIFIUTA_ASSEGNA", StringPool.FALSE);
put("MESSAGGIO_FILE_RIFIUTA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile"); put("MESSAGGIO_FILE_RIFIUTA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile");
put("RIFIUTA_CAMBIA_FASE_PER_DOCUMENTO", "a, ap, v"); put("RIFIUTA_CAMBIA_FASE_PER_DOCUMENTO", "a, ap, v");
put("APRI_PRATICA", "true"); put("APRI_PRATICA", StringPool.TRUE);
put("MESSAGGIO_FIRMA_RECUPERO_FILE", "Recupero file in corso"); put("MESSAGGIO_FIRMA_RECUPERO_FILE", "Recupero file in corso");
put("SMART_CARD_LETTURA_COGNOME", "SURNAME"); put("SMART_CARD_LETTURA_COGNOME", "SURNAME");
put("RIFIUTA_DISABILITATO_PER_DOCUMENTO", "v"); put("RIFIUTA_DISABILITATO_PER_DOCUMENTO", "v");
@ -118,6 +120,7 @@ public class FirmaGetUtil {
}; };
public Risposta<Map<String, String>> getConfiguration() { public Risposta<Map<String, String>> getConfiguration() {
Risposta<Map<String, String>> risposta = new Risposta<>(); Risposta<Map<String, String>> risposta = new Risposta<>();
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(configurazione); risposta.setObj(configurazione);
@ -125,6 +128,7 @@ public class FirmaGetUtil {
} }
public Risposta<Map<String, String>> getType() { public Risposta<Map<String, String>> getType() {
Risposta<Map<String, String>> risposta = new Risposta<>(); Risposta<Map<String, String>> risposta = new Risposta<>();
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(mappa); risposta.setObj(mappa);
@ -132,6 +136,7 @@ public class FirmaGetUtil {
} }
public Risposta<Map<String, String>> getTypeVerbale() { public Risposta<Map<String, String>> getTypeVerbale() {
Risposta<Map<String, String>> risposta = new Risposta<>(); Risposta<Map<String, String>> risposta = new Risposta<>();
Map<String, String> mappa = new HashMap<>(); Map<String, String> mappa = new HashMap<>();
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
@ -140,12 +145,12 @@ public class FirmaGetUtil {
} }
public Risposta<String> loginCodiceFiscale(String codiceFiscale) { public Risposta<String> loginCodiceFiscale(String codiceFiscale) {
javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences();
String codiceFiscaleTest = jxPortletPreferences.getValue("codiceFiscaleTest", StringPool.BLANK);
PortletPreferences portletPreferences = FirmaUtil.getPortletPreferences();
String codiceFiscaleTest = portletPreferences.getValue("codiceFiscaleTest", StringPool.BLANK);
Risposta<String> risposta = new Risposta<>(); Risposta<String> risposta = new Risposta<>();
if (codiceFiscale.equals(codiceFiscaleTest)) { if (codiceFiscale.equals(codiceFiscaleTest)) {
String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK); String tokenTest = portletPreferences.getValue("tokenTest", StringPool.BLANK);
risposta.setObj(tokenTest); risposta.setObj(tokenTest);
} else { } else {
// TODO da migliorare per sicurezza e poi modificare a giro // TODO da migliorare per sicurezza e poi modificare a giro
@ -156,23 +161,23 @@ public class FirmaGetUtil {
} }
public Risposta<String> loginNomeCognome(String nome, String cognome) { public Risposta<String> loginNomeCognome(String nome, String cognome) {
javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences();
String nomeTest = jxPortletPreferences.getValue("nomeTest", StringPool.BLANK); PortletPreferences portletPreferences = FirmaUtil.getPortletPreferences();
String cognomeTest = jxPortletPreferences.getValue("cognomeTest", StringPool.BLANK); String nomeTest = portletPreferences.getValue("nomeTest", StringPool.BLANK);
String cognomeTest = portletPreferences.getValue("cognomeTest", StringPool.BLANK);
Risposta<String> risposta = new Risposta<>(); Risposta<String> risposta = new Risposta<>();
if (nome.equals(nomeTest) && cognome.equals(cognomeTest)) { if (nome.equals(nomeTest) && cognome.equals(cognomeTest)) {
String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK); String tokenTest = portletPreferences.getValue("tokenTest", StringPool.BLANK);
risposta.setObj(tokenTest); risposta.setObj(tokenTest);
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
} else {
// TODO
} }
return risposta; return risposta;
} }
public Risposta<String> version() { public Risposta<String> version() {
javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences();
String versione = jxPortletPreferences.getValue("versione", StringPool.BLANK); PortletPreferences portletPreferences = FirmaUtil.getPortletPreferences();
String versione = portletPreferences.getValue("versione", StringPool.BLANK);
Risposta<String> risposta = new Risposta<>(); Risposta<String> risposta = new Risposta<>();
if (Validator.isBlank(versione)) { if (Validator.isBlank(versione)) {
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
@ -184,6 +189,7 @@ public class FirmaGetUtil {
} }
public Risposta<Stile> getStile() { public Risposta<Stile> getStile() {
Risposta<Stile> risposta = new Risposta<>(); Risposta<Stile> risposta = new Risposta<>();
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(stile); risposta.setObj(stile);

194
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java

@ -1,5 +1,23 @@
package it.tref.liferay.portos.firma.util; package it.tref.liferay.portos.firma.util;
import it.tref.firma.shared.RestFile;
import it.tref.firma.shared.Risposta;
import it.tref.firma.shared.RispostaCostanti;
import it.tref.liferay.portos.bo.model.Avviso;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.apache.commons.io.IOUtils;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.language.LanguageUtil;
@ -20,46 +38,22 @@ import com.liferay.portal.util.PortalUtil;
import com.liferay.portlet.documentlibrary.model.DLFileEntry; import com.liferay.portlet.documentlibrary.model.DLFileEntry;
import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil; import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
import it.tref.firma.shared.RestFile;
import it.tref.firma.shared.Risposta;
import it.tref.firma.shared.RispostaCostanti;
import it.tref.liferay.portos.bo.model.Avviso;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.apache.commons.io.IOUtils;
public class FirmaPostUtil { public class FirmaPostUtil {
private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class); private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class);
public Risposta<List<RestFile>> getFileList(String token) { public Risposta<List<RestFile>> getFileList(String token) {
/** // Verificare che il token sia il codice fiscale altrimenti c'è un metodo che estrae il cod fisc dal token
* Verificare che il token sia il codice fiscale altrimenti c e un metodo che estre il cod fisc // userCodiceFiscalePrimaFirma = al cod fisc di Avviso...tipoAvviso = S && fileEntryIdInvio = 0 &&
* dal token userCodiceFiscalePrimaFirma = al cod fisc di Avviso...tipoAvviso = S && // fileEntryIdBase != 0 && !rifiutato (aggiungere campo al service e anche campo dtRifiuto) con il
* fileEntryIdInvio = 0 && fileEntryIdBase != 0 && !rifiutato ( aggiungere campo al service e // fileEntryIdBase prendo il file e uso per riempire lista di ritorno
* anche campo dtRifiuto) con il fileEntryIdBase prendo il file e uso per riempire lista di // NEL RITORNO "tipoDocumento" è documentType con intPraticaId faccio fetch su tabella intPratica e prendo campo
* ritorno // tipoPratica
*
* NEL RITORNO "tipoDocumento" è documenttype con intPraticaId faccio fetch su tabella
* intPratica e prendo campo tipopratica
*
*/
long[] companyIds = PortalUtil.getCompanyIds(); long[] companyIds = PortalUtil.getCompanyIds();
Risposta<List<RestFile>> risposta = new Risposta<List<RestFile>>(); Risposta<List<RestFile>> risposta = new Risposta<List<RestFile>>();
for (long companyId : companyIds) { for (long companyId : companyIds) {
Company company = null; Company company = null;
try { try {
company = CompanyLocalServiceUtil.getCompany(companyId); company = CompanyLocalServiceUtil.getCompany(companyId);
@ -69,52 +63,40 @@ public class FirmaPostUtil {
String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", false); String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", false);
if (Validator.isNotNull(urlPdfExtractor)) { if (Validator.isNotNull(urlPdfExtractor)) {
byte[] fileArray = Base64.decode(token); byte[] fileArray = Base64.decode(token);
List<String> listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor); List<String> listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor);
String cf = listaCodiciFiscali.get(0); String cf = listaCodiciFiscali.get(0);
List<RestFile> listaFile = new ArrayList<RestFile>(); List<RestFile> listaFile = new ArrayList<RestFile>();
// Ricordarsi di verificare che nel token ci sia il cod fisc in chiaro altrimenti va estratto
// Ricordarsi di verificare che nel token ci sia il cod fisc in chiaro altrimenti va
// estratto
try { try {
// List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.findByIntPratica(1001, -1, -1, null);
List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf); List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf);
if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) { if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) {
for (Avviso avviso : listaAvvisi) { for (Avviso avviso : listaAvvisi) {
if (Validator.isNotNull(avviso.getFileEntryIdBase())) { if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase()); DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso.getIntPraticaId()); .getFileEntryIdBase());
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso
.getIntPraticaId());
if (Validator.isNotNull(fileEntry)) { if (Validator.isNotNull(fileEntry)) {
RestFile restFile = new RestFile(); RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId())); restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDataInvio(new Date()); restFile.setDataInvio(new Date());
String tipoDocumento = avviso.translateTipoDocumento(); String tipoDocumento = avviso.translateTipoDocumento();
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento) + StringPool.SPACE restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento)
+ StringPool.DASH + StringPool.SPACE + intPratica.getTitle(Locale.ITALIAN, true)); + StringPool.SPACE + StringPool.DASH + StringPool.SPACE
restFile.setFile(""); + intPratica.getTitle(Locale.ITALIAN, true));
restFile.setFile(StringPool.BLANK);
Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId()); Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId());
Organization organization = OrganizationLocalServiceUtil.getOrganization(group.getOrganizationId()); Organization organization = OrganizationLocalServiceUtil.getOrganization(group
.getOrganizationId());
restFile.setTipoPratica(organization.getName()); restFile.setTipoPratica(organization.getName());
listaFile.add(restFile); listaFile.add(restFile);
} }
} }
} }
} }
risposta.setObj(listaFile); risposta.setObj(listaFile);
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
} catch (Exception e) { } catch (Exception e) {
_log.error(e.getMessage(), e); _log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
@ -126,182 +108,108 @@ public class FirmaPostUtil {
public Risposta<RestFile> getFile(String token, String tipo, String id) { public Risposta<RestFile> getFile(String token, String tipo, String id) {
/* // verrà passato l'avvisoId facciamo query per riprendere file entry e ritorniamo quel file con il contenuto
* verra passato l avviso id facciamo query per riprendere file entry e ritorniamo quel file con
* il contenuto
*/
Risposta<RestFile> risposta = new Risposta<RestFile>(); Risposta<RestFile> risposta = new Risposta<RestFile>();
try { try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id)); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id));
if (Validator.isNotNull(avviso)) { if (Validator.isNotNull(avviso)) {
if (Validator.isNotNull(avviso.getFileEntryIdBase())) { if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase()); DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase());
if (Validator.isNotNull(fileEntry)) { if (Validator.isNotNull(fileEntry)) {
RestFile restFile = new RestFile(); RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId())); restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDataInvio(new Date()); restFile.setDataInvio(new Date());
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD + fileEntry.getExtension()); restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD + fileEntry.getExtension());
restFile.setTipoPratica(StringPool.BLANK); restFile.setTipoPratica(StringPool.BLANK);
// Recupero il tipo di pratica
/*
* if (Validator.isNotNull(avviso.getIntPraticaId())) { IntPratica intPratica =
* IntPraticaLocalServiceUtil.fetchIntPratica(avviso.getIntPraticaId()); if
* (Validator.isNotNull(intPratica)) {
* restFile.setTipoPratica(intPratica.getTipoPratica()); } }
*/
// Inserisco il contenuto del file in Base64 // Inserisco il contenuto del file in Base64
InputStream fileInputStream = DLFileEntryLocalServiceUtil.getFileAsStream(
InputStream fileInputStream = fileEntry.getFileEntryId(), fileEntry.getVersion());
DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion());
ByteArrayOutputStream bao = new ByteArrayOutputStream(); ByteArrayOutputStream bao = new ByteArrayOutputStream();
IOUtils.copy(fileInputStream, bao); IOUtils.copy(fileInputStream, bao);
restFile.setFile(Base64.encode(bao.toByteArray())); restFile.setFile(Base64.encode(bao.toByteArray()));
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(restFile); risposta.setObj(restFile);
} }
} }
} }
} catch (IOException | PortalException | SystemException e) {
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (PortalException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (IOException e) {
_log.error(e.getMessage(), e); _log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} }
return risposta; return risposta;
} }
public Risposta<String> openPratica(String token, String idFile) { public Risposta<String> openPratica(String token, String idFile) {
/** // mi arriva l'avvisoId e mi recupero l'intPraticaId bisogna ritornare ad una pagina privata di bo con la view
* mi arriva l'avviso id e mi recupero l intpraticaid bisogna ritornare ad una pagina privata di // sistemata per gestire direttamente la pratica portos-bo-portlet fascicolo portlet ..... intPraticaId
* bo con la view sistemata per gestire direttamente la pratica portos-bo-portlet fascicolo
* portlet ..... intpraticaid
*/
Risposta<String> risposta = new Risposta<String>(); Risposta<String> risposta = new Risposta<String>();
try { try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) { if (Validator.isNotNull(avviso)) {
// Prendo la url della pagina da ritornare settata nel expando custom field della company di riferimento
// Prendo la url della pagina da ritornare settata nel expando custom field della company // e ci aggiungo nella url l'attributo relativo all'id della intPratica
// di riferimento e ci aggiungo nella url l attributo relativo all id della intPratica
Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId()); Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId());
if (Validator.isNotNull(company)) { if (Validator.isNotNull(company)) {
String urlToBack = GetterUtil.getString(company.getExpandoBridge().getAttribute(
String urlToBack = "url-bo-gestione-pratica-firma", false));
GetterUtil.getString(company.getExpandoBridge().getAttribute("url-bo-gestione-pratica-firma", false));
urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId=" + avviso.getIntPraticaId(); urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId=" + avviso.getIntPraticaId();
risposta.setObj(urlToBack); risposta.setObj(urlToBack);
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
} }
} }
} catch (SystemException e) { } catch (SystemException e) {
_log.error(e.getMessage(), e); _log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} }
return risposta; return risposta;
} }
public Risposta<Boolean> rifiuta(String token, String idFile, String messaggio, String cambiaFase, String assegna) { public Risposta<Boolean> rifiuta(String token, String idFile, String messaggio, String cambiaFase, String assegna) {
/** // mi arriva l'avvisoId, lo recupero, setto rifiutato e dtRifiuto e aggiorno
* mi arriva l'avviso id lo recupero e setto rifiutato e dtRifiuto e aggiorno
*
*
*/
Risposta<Boolean> risposta = new Risposta<Boolean>(); Risposta<Boolean> risposta = new Risposta<Boolean>();
try { try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) { if (Validator.isNotNull(avviso)) {
avviso.setRifiutato(true); avviso.setRifiutato(true);
avviso.setDtRifiuto(new Date()); avviso.setDtRifiuto(new Date());
avviso.setCommentoRifiuto(Validator.isNotNull(messaggio) ? messaggio : StringPool.BLANK); avviso.setCommentoRifiuto(Validator.isNull(messaggio) ? StringPool.BLANK : messaggio);
AvvisoLocalServiceUtil.updateAvviso(avviso); AvvisoLocalServiceUtil.updateAvviso(avviso);
risposta.setObj(true); risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
} }
} catch (SystemException e) { } catch (SystemException e) {
_log.error(e.getMessage(), e); _log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} }
return risposta; return risposta;
} }
public Risposta<Boolean> setFile(String token, String fileToSave, String tipo, String idFile, public Risposta<Boolean> setFile(String token, String fileToSave, String tipo, String idFile,
ServiceContext serviceContext) { ServiceContext serviceContext) {
/** // Mi arriverà l'avvisoId e il contenuto e creerò un fileEntry e aggiornerò l'avviso con il fileEntryIdInvio
* Mi arriverà l avviso id e il contenuto e creero un file entry e aggiornero l avviso con il // per la creazione del fileEntry devo vedere SchedulerGeneraDocumento per creare il filename e la folder
* fileEntryIdInvio
*
* per la creazione del fileentry devo vedere SchedulerGeneraDocumento per creare il filename e
* la folder
*
*/
Risposta<Boolean> risposta = new Risposta<Boolean>(); Risposta<Boolean> risposta = new Risposta<Boolean>();
try { try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) { if (Validator.isNotNull(avviso)) {
// CREO IL FILE // CREO IL FILE
serviceContext.setCompanyId(avviso.getCompanyId()); serviceContext.setCompanyId(avviso.getCompanyId());
serviceContext.setScopeGroupId(avviso.getGroupId()); serviceContext.setScopeGroupId(avviso.getGroupId());
serviceContext.setUserId(avviso.getUserId()); serviceContext.setUserId(avviso.getUserId());
avviso = AvvisoLocalServiceUtil.addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(), fileToSave,
avviso = serviceContext);
AvvisoLocalServiceUtil
.addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(), fileToSave, serviceContext);
risposta.setObj(true); risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
} }
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (PortalException e) {
_log.error(e.getMessage(), e);
risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (Exception e) { } catch (Exception e) {
_log.error(e.getMessage(), e); _log.error(e.getMessage(), e);
risposta.setObj(false); risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} }
return risposta; return risposta;
} }
} }

18
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java

@ -33,15 +33,13 @@ public class FirmaUtil {
String preferencesXML; String preferencesXML;
javax.portlet.PortletPreferences jxPortletPreferences = null; javax.portlet.PortletPreferences jxPortletPreferences = null;
try { try {
pr = pr = PortletPreferencesLocalServiceUtil.getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0L,
PortletPreferencesLocalServiceUtil.getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0,
"firma_WAR_portosfirmaportlet"); "firma_WAR_portosfirmaportlet");
preferencesXML = pr.get(0).getPreferences(); preferencesXML = pr.get(0).getPreferences();
jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML); jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML);
} catch (SystemException e) { } catch (SystemException e) {
_log.error(e.getMessage()); _log.error(e.getMessage());
} }
return jxPortletPreferences; return jxPortletPreferences;
} }
@ -49,41 +47,27 @@ public class FirmaUtil {
List<String> listaCodiciFiscali = null; List<String> listaCodiciFiscali = null;
try { try {
File file = File.createTempFile("codicefiscale", ".p7m"); File file = File.createTempFile("codicefiscale", ".p7m");
FileUtils.writeByteArrayToFile(file, fileArray); FileUtils.writeByteArrayToFile(file, fileArray);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
// long companyId = CompanyThreadLocal.getCompanyId();
ContentBody body = new FileBody(file); ContentBody body = new FileBody(file);
MultipartEntity entity = new MultipartEntity(); MultipartEntity entity = new MultipartEntity();
entity.addPart("file", body); entity.addPart("file", body);
HttpPost request = new HttpPost(urlPdfExtractor); HttpPost request = new HttpPost(urlPdfExtractor);
request.setEntity(entity); request.setEntity(entity);
HttpClient client = new DefaultHttpClient(); HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request); HttpResponse response = client.execute(request);
if (response.getStatusLine().getStatusCode() != 200) { if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode());
} }
InputStream inputStream = response.getEntity().getContent(); InputStream inputStream = response.getEntity().getContent();
ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class); ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class);
if (extractorResponse.isSuccess()) { if (extractorResponse.isSuccess()) {
listaCodiciFiscali = extractorResponse.getCf(); listaCodiciFiscali = extractorResponse.getCf();
} }
} catch (IOException e) { } catch (IOException e) {
_log.error(e.getMessage()); _log.error(e.getMessage());
} }
return listaCodiciFiscali; return listaCodiciFiscali;
} }
} }

843
liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/portos/report/engine/ReportAssegnazioniIstruttorie.java

@ -1,843 +0,0 @@
package it.tref.portos.report.engine;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.service.ClpSerializer;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.report.service.KaleoTaskAssignmentInstanceLocalServiceUtil;
import it.tref.portos.report.engine.PortosSearchTermsReport.FieldType;
import it.tref.portos.report.engine.annotation.PortosReport;
import it.tref.portos.report.engine.template.TemplatesADV;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import net.sf.dynamicreports.jasper.builder.JasperReportBuilder;
import net.sf.dynamicreports.jasper.builder.export.JasperHtmlExporterBuilder;
import net.sf.dynamicreports.report.builder.DynamicReports;
import net.sf.dynamicreports.report.builder.column.TextColumnBuilder;
import net.sf.dynamicreports.report.builder.grid.ColumnTitleGroupBuilder;
import net.sf.dynamicreports.report.datasource.DRDataSource;
import net.sf.dynamicreports.report.exception.DRException;
import net.sf.jasperreports.engine.JRDataSource;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
import com.liferay.portal.kernel.dao.orm.Property;
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.User;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay;
@PortosReport
public class ReportAssegnazioniIstruttorie implements PortosReportInterface {
private static Log _log = LogFactoryUtil.getLog(ReportAssegnazioniIstruttorie.class);
@Override
public String generateHTML(HttpServletRequest request) {
String html = "";
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
JasperHtmlExporterBuilder htmlExporter = DynamicReports.export.htmlExporter(bos).setIgnoreHyperLink(true);
JasperReportBuilder builder = generateReport(request);
builder.pageFooter(DynamicReports.cmp.pageNumber().setStyle(TemplatesADV.boldCenteredStyle));
builder.toHtml(htmlExporter);
byte[] byteArray = bos.toByteArray();
html = new String(byteArray);
} catch (DRException e) {
_log.error(e, e);
}
return html;
}
@Override
public JasperReportBuilder generateReport(HttpServletRequest request) {
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = themeDisplay.getCompanyId();
TextColumnBuilder<String> funzionarioColumn =
DynamicReports.col.column("Funzionario", "funzionario", DynamicReports.type.stringType());
TextColumnBuilder<String> dalColumn = DynamicReports.col.column("Dal", "dal", DynamicReports.type.stringType());
TextColumnBuilder<String> alColumn = DynamicReports.col.column("Al", "al", DynamicReports.type.stringType());
ColumnTitleGroupBuilder titleGroupPeriodo = DynamicReports.grid.titleGroup("Periodo", dalColumn, alColumn);
// FIRENZE
TextColumnBuilder<Integer> autorizzazionioColumnFirenze =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneFirenze", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnFirenze =
DynamicReports.col.column("N Controlli Depositi", "numControlDepFirenze", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnFirenze =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepFirenze", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnFirenze =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepFirenze", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriFirenze =
DynamicReports.grid.titleGroup("Firenze", autorizzazionioColumnFirenze, controlDepColumnFirenze,
sanatorieColumnFirenze, opereMinoreImportanzaColumnFirenze);
// Arezzo
TextColumnBuilder<Integer> autorizzazionioColumnArezzo =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneArezzo", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnArezzo =
DynamicReports.col.column("N Controlli Depositi", "numControlDepArezzo", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnArezzo =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepArezzo", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnArezzo =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepArezzo", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriArezzo =
DynamicReports.grid.titleGroup("Arezzo", autorizzazionioColumnArezzo, controlDepColumnArezzo,
sanatorieColumnArezzo, opereMinoreImportanzaColumnArezzo);
// Grosseto
TextColumnBuilder<Integer> autorizzazionioColumnGrosseto =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneGrosseto", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnGrosseto =
DynamicReports.col.column("N Controlli Depositi", "numControlDepGrosseto", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnGrosseto =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepGrosseto", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnGrosseto =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepGrosseto", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriGrosseto =
DynamicReports.grid.titleGroup("Grosseto", autorizzazionioColumnGrosseto, controlDepColumnGrosseto,
sanatorieColumnGrosseto, opereMinoreImportanzaColumnGrosseto);
// Livorno
TextColumnBuilder<Integer> autorizzazionioColumnLivorno =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneLivorno", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnLivorno =
DynamicReports.col.column("N Controlli Depositi", "numControlDepLivorno", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnLivorno =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepLivorno", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnLivorno =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepLivorno", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriLivorno =
DynamicReports.grid.titleGroup("Livorno", autorizzazionioColumnLivorno, controlDepColumnLivorno,
sanatorieColumnLivorno, opereMinoreImportanzaColumnLivorno);
// Lucca
TextColumnBuilder<Integer> autorizzazionioColumnLucca =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneLucca", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnLucca =
DynamicReports.col.column("N Controlli Depositi", "numControlDepLucca", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnLucca =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepLucca", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnLucca =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepLucca", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriLucca =
DynamicReports.grid.titleGroup("Lucca", autorizzazionioColumnLucca, controlDepColumnLucca, sanatorieColumnLucca, opereMinoreImportanzaColumnLucca);
// Massa Carrara
TextColumnBuilder<Integer> autorizzazionioColumnMassaCarrara =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneMassaCarrara",
DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnMassaCarrara =
DynamicReports.col.column("N Controlli Depositi", "numControlDepMassaCarrara",
DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnMassaCarrara =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepMassaCarrara", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnMassaCarrara =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepMassaCarrara", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriMassaCarrara =
DynamicReports.grid.titleGroup("Massa Carrara", autorizzazionioColumnMassaCarrara,
controlDepColumnMassaCarrara, sanatorieColumnMassaCarrara, opereMinoreImportanzaColumnMassaCarrara);
// Pisa
TextColumnBuilder<Integer> autorizzazionioColumnPisa =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazionePisa", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnPisa =
DynamicReports.col.column("N Controlli Depositi", "numControlDepPisa", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnPisa =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepPisa", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnPisa =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepPisa", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriPisa =
DynamicReports.grid.titleGroup("Pisa", autorizzazionioColumnPisa, controlDepColumnPisa, sanatorieColumnPisa, opereMinoreImportanzaColumnPisa);
// Pistoia
TextColumnBuilder<Integer> autorizzazionioColumnPistoia =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazionePistoia", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnPistoia =
DynamicReports.col.column("N Controlli Depositi", "numControlDepPistoia", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnPistoia =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepPistoia", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnPistoia =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepPistoia", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriPistoia =
DynamicReports.grid.titleGroup("Pistoia", autorizzazionioColumnPistoia, controlDepColumnPistoia,
sanatorieColumnPistoia, opereMinoreImportanzaColumnPistoia);
// Prato
TextColumnBuilder<Integer> autorizzazionioColumnPrato =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazionePrato", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnPrato =
DynamicReports.col.column("N Controlli Depositi", "numControlDepPrato", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnPrato =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepPrato", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnPrato =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepPrato", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriPrato =
DynamicReports.grid.titleGroup("Prato", autorizzazionioColumnPrato, controlDepColumnPrato, sanatorieColumnPrato, opereMinoreImportanzaColumnPrato);
// Siena
TextColumnBuilder<Integer> autorizzazionioColumnSiena =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneSiena", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnSiena =
DynamicReports.col.column("N Controlli Depositi", "numControlDepSiena", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnSiena =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepSiena", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnSiena =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepSiena", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriSiena =
DynamicReports.grid.titleGroup("Siena", autorizzazionioColumnSiena, controlDepColumnSiena, sanatorieColumnSiena, opereMinoreImportanzaColumnSiena);
// Totali
TextColumnBuilder<Integer> autorizzazionioColumnTotali =
DynamicReports.col.column("N Autorizzazione", "numAutorizzazioneTotali", DynamicReports.type.integerType());
TextColumnBuilder<Integer> controlDepColumnTotali =
DynamicReports.col.column("N Controlli Depositi", "numControlDepTotali", DynamicReports.type.integerType());
TextColumnBuilder<Integer> sanatorieColumnTotali =
DynamicReports.col.column("N Sanatorie", "numSanatorieDepTotali", DynamicReports.type.integerType());
TextColumnBuilder<Integer> opereMinoreImportanzaColumnTotali =
DynamicReports.col.column("N Opere Minore Importanza", "numOpereMinoreImportanzaDepTotali", DynamicReports.type.integerType());
ColumnTitleGroupBuilder titleGroupNumeriTotali =
DynamicReports.grid.titleGroup("Totali", autorizzazionioColumnTotali, controlDepColumnTotali,
sanatorieColumnTotali, opereMinoreImportanzaColumnTotali);
JasperReportBuilder builder =
DynamicReports.report().setTemplate(TemplatesADV.reportTemplate).columnGrid(funzionarioColumn,
titleGroupPeriodo, titleGroupNumeriArezzo, titleGroupNumeriFirenze, titleGroupNumeriGrosseto,
titleGroupNumeriLivorno, titleGroupNumeriLucca, titleGroupNumeriMassaCarrara, titleGroupNumeriPisa,
titleGroupNumeriPistoia, titleGroupNumeriPrato, titleGroupNumeriSiena, titleGroupNumeriTotali).columns(
funzionarioColumn, dalColumn, alColumn
, autorizzazionioColumnArezzo, controlDepColumnArezzo, sanatorieColumnArezzo, opereMinoreImportanzaColumnArezzo
, autorizzazionioColumnFirenze, controlDepColumnFirenze, sanatorieColumnFirenze, opereMinoreImportanzaColumnFirenze
, autorizzazionioColumnGrosseto, controlDepColumnGrosseto, sanatorieColumnGrosseto, opereMinoreImportanzaColumnGrosseto
, autorizzazionioColumnLivorno, controlDepColumnLivorno, sanatorieColumnLivorno, opereMinoreImportanzaColumnLivorno
, autorizzazionioColumnLucca, controlDepColumnLucca, sanatorieColumnLucca, opereMinoreImportanzaColumnLucca
, autorizzazionioColumnMassaCarrara, controlDepColumnMassaCarrara, sanatorieColumnMassaCarrara, opereMinoreImportanzaColumnMassaCarrara
, autorizzazionioColumnPisa, controlDepColumnPisa, sanatorieColumnPisa, opereMinoreImportanzaColumnPisa
, autorizzazionioColumnPistoia, controlDepColumnPistoia, sanatorieColumnPistoia, opereMinoreImportanzaColumnPistoia
, autorizzazionioColumnPrato, controlDepColumnPrato, sanatorieColumnPrato, opereMinoreImportanzaColumnPrato
, autorizzazionioColumnSiena, controlDepColumnSiena, sanatorieColumnSiena, opereMinoreImportanzaColumnSiena
, autorizzazionioColumnTotali, controlDepColumnTotali, sanatorieColumnTotali, opereMinoreImportanzaColumnTotali)
.setDataSource(createDataSource(request, companyId)).addProperty("net.sf.jasperreports.export.xls.detect.cell.type", "true");
return builder;
}
private JRDataSource createDataSource(HttpServletRequest request, long companyId) {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
DRDataSource dataSource =
new DRDataSource("funzionario", "dal", "al"
, "numAutorizzazioneArezzo", "numControlDepArezzo", "numSanatorieDepArezzo", "numOpereMinoreImportanzaDepArezzo"
, "numAutorizzazioneFirenze", "numControlDepFirenze", "numSanatorieDepFirenze", "numOpereMinoreImportanzaDepFirenze"
, "numAutorizzazioneGrosseto", "numControlDepGrosseto", "numSanatorieDepGrosseto", "numOpereMinoreImportanzaDepGrosseto"
, "numAutorizzazioneLivorno", "numControlDepLivorno", "numSanatorieDepLivorno", "numOpereMinoreImportanzaDepLivorno"
, "numAutorizzazioneLucca", "numControlDepLucca", "numSanatorieDepLucca", "numOpereMinoreImportanzaDepLucca"
, "numAutorizzazioneMassaCarrara", "numControlDepMassaCarrara", "numSanatorieDepMassaCarrara", "numOpereMinoreImportanzaDepMassaCarrara"
, "numAutorizzazionePisa", "numControlDepPisa", "numSanatorieDepPisa", "numOpereMinoreImportanzaDepPisa"
, "numAutorizzazionePistoia", "numControlDepPistoia", "numSanatorieDepPistoia", "numOpereMinoreImportanzaDepPistoia"
, "numAutorizzazionePrato", "numControlDepPrato", "numSanatorieDepPrato", "numOpereMinoreImportanzaDepPrato"
, "numAutorizzazioneSiena", "numControlDepSiena", "numSanatorieDepSiena", "numOpereMinoreImportanzaDepSiena"
, "numAutorizzazioneTotali", "numControlDepTotali", "numSanatorieDepTotali", "numOpereMinoreImportanzaDepTotali");
try {
String dateMinString = ParamUtil.getString(request, "dateMin", null);
String dateMaxString = ParamUtil.getString(request, "dateMax", null);
if (dateMinString != null && dateMaxString != null) {
Date dateMin = sdf.parse(dateMinString);
Date dateMax = sdf.parse(dateMaxString);
Calendar calendarMin = Calendar.getInstance();
calendarMin.setTime(dateMin);
calendarMin.set(Calendar.HOUR_OF_DAY, 1);
dateMin = calendarMin.getTime();
Calendar calendarMax = Calendar.getInstance();
calendarMax.setTime(dateMax);
calendarMax.set(Calendar.HOUR_OF_DAY, 23);
dateMax = calendarMax.getTime();
ClassLoader classLoader =
(ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
List<BigInteger> listaUsers = KaleoTaskAssignmentInstanceLocalServiceUtil.distinctKaleoAssignee();
if (listaUsers != null && !listaUsers.isEmpty()) {
List<User> users = new ArrayList<User>();
for (BigInteger userId : listaUsers) {
User user = UserLocalServiceUtil.fetchUser(userId.longValue());
users.add(user);
}
Collections.sort(users, new UserComparator());
int autorizzazioniColonnaFirenze = 0;
int depositoColonnaFirenze = 0;
int sanatorieColonnaFirenze = 0;
int opereMinoreImportanzaColonnaFirenze = 0;
int autorizzazioniColonnaArezzo = 0;
int depositoColonnaArezzo = 0;
int sanatorieColonnaArezzo = 0;
int opereMinoreImportanzaColonnaArezzo = 0;
int autorizzazioniColonnaGrosseto = 0;
int depositoColonnaGrosseto = 0;
int sanatorieColonnaGrosseto = 0;
int opereMinoreImportanzaColonnaGrosseto = 0;
int autorizzazioniColonnaLivorno = 0;
int depositoColonnaLivorno = 0;
int sanatorieColonnaLivorno = 0;
int opereMinoreImportanzaColonnaLivorno = 0;
int autorizzazioniColonnaMassaCarrara = 0;
int depositoColonnaMassaCarrara = 0;
int sanatorieColonnaMassaCarrara = 0;
int opereMinoreImportanzaColonnaMassaCarrara = 0;
int autorizzazioniColonnaPisa = 0;
int depositoColonnaPisa = 0;
int sanatorieColonnaPisa = 0;
int opereMinoreImportanzaColonnaPisa = 0;
int autorizzazioniColonnaPrato = 0;
int depositoColonnaPrato = 0;
int sanatorieColonnaPrato = 0;
int opereMinoreImportanzaColonnaPrato = 0;
int autorizzazioniColonnaLucca = 0;
int depositoColonnaLucca = 0;
int sanatorieColonnaLucca = 0;
int opereMinoreImportanzaColonnaLucca = 0;
int autorizzazioniColonnaPistoia = 0;
int depositoColonnaPistoia = 0;
int sanatorieColonnaPistoia = 0;
int opereMinoreImportanzaColonnaPistoia = 0;
int autorizzazioniColonnaSiena = 0;
int depositoColonnaSiena = 0;
int sanatorieColonnaSiena = 0;
int opereMinoreImportanzaColonnaSiena = 0;
int autorizzazioniColonnaTotali = 0;
int depositoColonnaTotali = 0;
int sanatorieColonnaTotali = 0;
int opereMinoreImportanzaColonnaTotali = 0;
for (User user : users) {
// User user = UserLocalServiceUtil.fetchUser(userId.longValue());
DynamicQuery dq = DynamicQueryFactoryUtil.forClass(IntPratica.class,classLoader);
dq.add(RestrictionsFactoryUtil.eq("statusByUserId", user.getUserId()));
Property createDateProperty = PropertyFactoryUtil.forName("statusDate");
dq.add(createDateProperty.between(dateMin, dateMax));
List<IntPratica> listInt = IntPraticaLocalServiceUtil.dynamicQuery(dq, -1,-1);
listInt = orderListInt(listInt);
int autorizzazioniFirenze = 0;
int depositoFirenze = 0;
int sanatorieFirenze = 0;
int opereMinoreImportanzaFirenze = 0;
int autorizzazioniArezzo = 0;
int depositoArezzo = 0;
int sanatorieArezzo = 0;
int opereMinoreImportanzaArezzo = 0;
int autorizzazioniGrosseto = 0;
int depositoGrosseto = 0;
int sanatorieGrosseto = 0;
int opereMinoreImportanzaGrosseto = 0;
int autorizzazioniLivorno = 0;
int depositoLivorno = 0;
int sanatorieLivorno = 0;
int opereMinoreImportanzaLivorno = 0;
int autorizzazioniMassaCarrara = 0;
int depositoMassaCarrara = 0;
int sanatorieMassaCarrara = 0;
int opereMinoreImportanzaMassaCarrara = 0;
int autorizzazioniPisa = 0;
int depositoPisa = 0;
int sanatoriePisa = 0;
int opereMinoreImportanzaPisa = 0;
int autorizzazioniPrato = 0;
int depositoPrato = 0;
int sanatoriePrato = 0;
int opereMinoreImportanzaPrato = 0;
int autorizzazioniLucca = 0;
int depositoLucca = 0;
int sanatorieLucca = 0;
int opereMinoreImportanzaLucca = 0;
int autorizzazioniPistoia = 0;
int depositoPistoia = 0;
int sanatoriePistoia = 0;
int opereMinoreImportanzaPistoia = 0;
int autorizzazioniSiena = 0;
int depositoSiena = 0;
int sanatorieSiena = 0;
int opereMinoreImportanzaSiena = 0;
int autorizzazioniTotali = 0;
int depositoTotali = 0;
int sanatorieTotali = 0;
int opereMinoreImportanzaTotali = 0;
for (IntPratica intPratica : listInt) {
if (Validator.isNotNull(intPratica)) {
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId());
Organization orgFirenze = OrganizationLocalServiceUtil.getOrganization(companyId, "Firenze");
long groupIdFirenze = orgFirenze.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdFirenze) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniFirenze++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoFirenze++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatorieFirenze++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaFirenze++;
}
}
Organization orgArezzo = OrganizationLocalServiceUtil.getOrganization(companyId, "Arezzo");
long groupIdArezzo = orgArezzo.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdArezzo) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniArezzo++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoArezzo++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatorieArezzo++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaArezzo++;
}
}
Organization orgGrosetto = OrganizationLocalServiceUtil.getOrganization(companyId, "Grosseto");
long groupIdGrosseto = orgGrosetto.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdGrosseto) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniGrosseto++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoGrosseto++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatorieGrosseto++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaGrosseto++;
}
}
Organization orgLivorno = OrganizationLocalServiceUtil.getOrganization(companyId, "Livorno");
long groupIdLivorno = orgLivorno.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdLivorno) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniLivorno++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoLivorno++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatorieLivorno++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaLivorno++;
}
}
Organization orgLucca = OrganizationLocalServiceUtil.getOrganization(companyId, "Lucca");
long groupIdLucca = orgLucca.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdLucca) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniLucca++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoLucca++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatorieLucca++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaLucca++;
}
}
Organization orgMassaCarrara =
OrganizationLocalServiceUtil.getOrganization(companyId, "Massa Carrara");
long groupIdMassaCarrara = orgMassaCarrara.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdMassaCarrara) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniMassaCarrara++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoMassaCarrara++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatorieMassaCarrara++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaMassaCarrara++;
}
}
Organization orgPisa = OrganizationLocalServiceUtil.getOrganization(companyId, "Pisa");
long groupIdPisa = orgPisa.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdPisa) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniPisa++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoPisa++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatoriePisa++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaPisa++;
}
}
Organization orgPistoia = OrganizationLocalServiceUtil.getOrganization(companyId, "Pistoia");
long groupIdPistoia = orgPistoia.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdPistoia) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniPistoia++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoPistoia++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatoriePistoia++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaPistoia++;
}
}
Organization orgPrato = OrganizationLocalServiceUtil.getOrganization(companyId, "Prato");
long groupIdPrato = orgPrato.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdPrato) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniPrato++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoPrato++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatoriePrato++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaPrato++;
}
}
Organization orgSiena = OrganizationLocalServiceUtil.getOrganization(companyId, "Siena");
long groupIdSiena = orgSiena.getGroup().getGroupId();
if (territorio.getGroupId() == groupIdSiena) {
if (intPratica.getTipoPratica().equals("02")) {
autorizzazioniSiena++;
}
if (intPratica.getTipoPratica().equals("01")) {
depositoSiena++;
}
if (intPratica.getTipoPratica().equals("03")) {
sanatorieSiena++;
}
//Bug 33461
if (intPratica.getTipoPratica().equals("05")) {
opereMinoreImportanzaSiena++;
}
}
}
}
autorizzazioniTotali =
autorizzazioniArezzo + autorizzazioniFirenze + autorizzazioniGrosseto + autorizzazioniLivorno
+ autorizzazioniLucca + autorizzazioniMassaCarrara + autorizzazioniPisa + autorizzazioniPistoia
+ autorizzazioniPrato + autorizzazioniSiena;
depositoTotali =
depositoArezzo + depositoFirenze + depositoGrosseto + depositoLivorno + depositoLucca
+ depositoMassaCarrara + depositoPisa + depositoPistoia + depositoPrato + depositoSiena;
sanatorieTotali =
sanatorieArezzo + sanatorieFirenze + sanatorieGrosseto + sanatorieLivorno + sanatorieLucca
+ sanatorieMassaCarrara + sanatoriePisa + sanatoriePistoia + sanatoriePrato + sanatorieSiena;
opereMinoreImportanzaTotali =
opereMinoreImportanzaArezzo + opereMinoreImportanzaFirenze + opereMinoreImportanzaGrosseto + opereMinoreImportanzaLivorno + opereMinoreImportanzaLucca
+ opereMinoreImportanzaMassaCarrara + opereMinoreImportanzaPisa + opereMinoreImportanzaPistoia + opereMinoreImportanzaPrato + opereMinoreImportanzaSiena;
dataSource.add(user.getLastName() + " " + user.getFirstName(), dateMinString, dateMaxString
, autorizzazioniArezzo, depositoArezzo, sanatorieArezzo, opereMinoreImportanzaArezzo
, autorizzazioniFirenze, depositoFirenze, sanatorieFirenze, opereMinoreImportanzaFirenze
, autorizzazioniGrosseto, depositoGrosseto, sanatorieGrosseto, opereMinoreImportanzaGrosseto
, autorizzazioniLivorno, depositoLivorno, sanatorieLivorno, opereMinoreImportanzaLivorno
, autorizzazioniLucca, depositoLucca, sanatorieLucca, opereMinoreImportanzaLucca
, autorizzazioniMassaCarrara, depositoMassaCarrara, sanatorieMassaCarrara, opereMinoreImportanzaMassaCarrara
, autorizzazioniPisa, depositoPisa, sanatoriePisa, opereMinoreImportanzaPisa
, autorizzazioniPistoia, depositoPistoia, sanatoriePistoia, opereMinoreImportanzaPistoia
, autorizzazioniPrato, depositoPrato, sanatoriePrato, opereMinoreImportanzaPrato
, autorizzazioniSiena, depositoSiena, sanatorieSiena, opereMinoreImportanzaSiena
, autorizzazioniTotali, depositoTotali, sanatorieTotali, opereMinoreImportanzaTotali);
autorizzazioniColonnaFirenze += autorizzazioniFirenze;
depositoColonnaFirenze += depositoFirenze;
sanatorieColonnaFirenze += sanatorieFirenze;
opereMinoreImportanzaColonnaFirenze += opereMinoreImportanzaFirenze;
autorizzazioniColonnaArezzo += autorizzazioniArezzo;
depositoColonnaArezzo += depositoArezzo;
sanatorieColonnaArezzo += sanatorieArezzo;
opereMinoreImportanzaColonnaArezzo += opereMinoreImportanzaArezzo;
autorizzazioniColonnaGrosseto += autorizzazioniGrosseto;
depositoColonnaGrosseto += depositoGrosseto;
sanatorieColonnaGrosseto += sanatorieGrosseto;
opereMinoreImportanzaColonnaGrosseto += opereMinoreImportanzaGrosseto;
autorizzazioniColonnaLivorno += autorizzazioniLivorno;
depositoColonnaLivorno += depositoLivorno;
sanatorieColonnaLivorno += sanatorieLivorno;
opereMinoreImportanzaColonnaLivorno += opereMinoreImportanzaLivorno;
autorizzazioniColonnaMassaCarrara += autorizzazioniMassaCarrara;
depositoColonnaMassaCarrara += depositoMassaCarrara;
sanatorieColonnaMassaCarrara += sanatorieMassaCarrara;
opereMinoreImportanzaColonnaMassaCarrara += opereMinoreImportanzaMassaCarrara;
autorizzazioniColonnaPisa += autorizzazioniPisa;
depositoColonnaPisa += depositoPisa;
sanatorieColonnaPisa += sanatoriePisa;
opereMinoreImportanzaColonnaPisa += opereMinoreImportanzaPisa;
autorizzazioniColonnaPrato += autorizzazioniPrato;
depositoColonnaPrato += depositoPrato;
sanatorieColonnaPrato += sanatoriePrato;
opereMinoreImportanzaColonnaPrato += opereMinoreImportanzaPrato;
autorizzazioniColonnaLucca += autorizzazioniLucca;
depositoColonnaLucca += depositoLucca;
sanatorieColonnaLucca += sanatorieLucca;
opereMinoreImportanzaColonnaLucca += opereMinoreImportanzaLucca;
autorizzazioniColonnaPistoia += autorizzazioniPistoia;
depositoColonnaPistoia += depositoPistoia;
sanatorieColonnaPistoia += sanatoriePistoia;
opereMinoreImportanzaColonnaPistoia += opereMinoreImportanzaPistoia;
autorizzazioniColonnaSiena += autorizzazioniSiena;
depositoColonnaSiena += depositoSiena;
sanatorieColonnaSiena += sanatorieSiena;
opereMinoreImportanzaColonnaSiena += opereMinoreImportanzaSiena;
autorizzazioniColonnaTotali += autorizzazioniTotali;
depositoColonnaTotali += depositoTotali;
sanatorieColonnaTotali += sanatorieTotali;
opereMinoreImportanzaColonnaTotali += opereMinoreImportanzaTotali;
}
dataSource.add("TOTALI", "", ""
, autorizzazioniColonnaArezzo, depositoColonnaArezzo, sanatorieColonnaArezzo, opereMinoreImportanzaColonnaArezzo
, autorizzazioniColonnaFirenze, depositoColonnaFirenze, sanatorieColonnaFirenze, opereMinoreImportanzaColonnaFirenze
, autorizzazioniColonnaGrosseto, depositoColonnaGrosseto, sanatorieColonnaGrosseto, opereMinoreImportanzaColonnaGrosseto
, autorizzazioniColonnaLivorno, depositoColonnaLivorno, sanatorieColonnaLivorno, opereMinoreImportanzaColonnaLivorno
, autorizzazioniColonnaLucca, depositoColonnaLucca, sanatorieColonnaLucca, opereMinoreImportanzaColonnaLucca
, autorizzazioniColonnaMassaCarrara, depositoColonnaMassaCarrara, sanatorieColonnaMassaCarrara, opereMinoreImportanzaColonnaMassaCarrara
, autorizzazioniColonnaPisa, depositoColonnaPisa, sanatorieColonnaPisa, opereMinoreImportanzaColonnaPisa
, autorizzazioniColonnaPistoia, depositoColonnaPistoia, sanatorieColonnaPistoia, opereMinoreImportanzaColonnaPistoia
, autorizzazioniColonnaPrato, depositoColonnaPrato, sanatorieColonnaPrato, opereMinoreImportanzaColonnaPrato
, autorizzazioniColonnaSiena, depositoColonnaSiena, sanatorieColonnaSiena, opereMinoreImportanzaColonnaSiena
, autorizzazioniColonnaTotali, depositoColonnaTotali, sanatorieColonnaTotali, opereMinoreImportanzaColonnaTotali);
}
}
} catch (ParseException e) {
_log.error(e, e);
} catch (SystemException e) {
_log.error(e, e);
} catch (PortalException e) {
_log.error(e, e);
}
return dataSource;
}
private List<ControlloPratica> orderList(List<ControlloPratica> lista) {
Collections.sort(lista, new Comparator<ControlloPratica>() {
public int compare(ControlloPratica a, ControlloPratica b) {
return ((Long) b.getGroupId()).compareTo(((Long) a.getGroupId()));
}
});
return lista;
}
private List<IntPratica> orderListInt(List<IntPratica> lista) {
Collections.sort(lista, new Comparator<IntPratica>() {
public int compare(IntPratica a, IntPratica b) {
return ((Long) b.getGroupId()).compareTo(((Long) a.getGroupId()));
}
});
return lista;
}
@Override
public String getTitle() {
return "Report Assegnazioni ed Istruttorie";
}
@Override
public List<PortosSearchTermsReport> getSearchFields() {
List<PortosSearchTermsReport> listaFields = new ArrayList<PortosSearchTermsReport>();
listaFields.add(new PortosSearchTermsReport(1, FieldType.DATE, "dateMin"));
listaFields.add(new PortosSearchTermsReport(2, FieldType.DATE, "dateMax"));
return listaFields;
}
@Override
public boolean isCVSEnabled() {
return true;
}
@Override
public boolean isPDFEnabled() {
return false;
}
@Override
public boolean isExcelEnabled() {
return true;
}
@Override
public boolean isWordEnabled() {
return false;
}
}
class UserComparator implements Comparator<User>{
@Override
public int compare(User o1, User o2) {
int compareLastName = 0;
if(Validator.isNotNull(o1.getLastName()) && Validator.isNotNull(o2.getLastName()))
compareLastName = o1.getLastName().compareToIgnoreCase(o2.getLastName());
if(compareLastName == 0 && Validator.isNotNull(o1.getFirstName()) && Validator.isNotNull(o2.getFirstName()))
compareLastName = o1.getFirstName().compareToIgnoreCase(o2.getFirstName());
return compareLastName;
}
}

133
liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/portos/report/engine/portlet/ReportsPortlet.java

@ -37,6 +37,7 @@ import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.servlet.HttpHeaders; import com.liferay.portal.kernel.servlet.HttpHeaders;
import com.liferay.portal.kernel.util.Constants;
import com.liferay.portal.kernel.util.ContentTypes; import com.liferay.portal.kernel.util.ContentTypes;
import com.liferay.portal.kernel.util.LocaleUtil; import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
@ -56,19 +57,12 @@ public class ReportsPortlet extends MVCPortlet {
public void render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { public void render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException {
List<String> portosReportClassList = new ArrayList<String>(); List<String> portosReportClassList = new ArrayList<String>();
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(true); ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(true);
scanner.addIncludeFilter(new AnnotationTypeFilter(PortosReport.class)); scanner.addIncludeFilter(new AnnotationTypeFilter(PortosReport.class));
for (BeanDefinition bd : scanner.findCandidateComponents(PortosReportConstant.SCAN_CLASSPATH)) { for (BeanDefinition bd : scanner.findCandidateComponents(PortosReportConstant.SCAN_CLASSPATH)) {
portosReportClassList.add(bd.getBeanClassName()); portosReportClassList.add(bd.getBeanClassName());
} }
renderRequest.setAttribute(PortosReportConstant.REPORT_CLASSES_LIST, portosReportClassList); renderRequest.setAttribute(PortosReportConstant.REPORT_CLASSES_LIST, portosReportClassList);
super.render(renderRequest, renderResponse); super.render(renderRequest, renderResponse);
} }
@ -76,10 +70,9 @@ public class ReportsPortlet extends MVCPortlet {
String className = ParamUtil.getString(actionRequest, "className"); String className = ParamUtil.getString(actionRequest, "className");
String tabs1 = ParamUtil.getString(actionRequest, "tabs1"); String tabs1 = ParamUtil.getString(actionRequest, "tabs1");
@SuppressWarnings("unchecked")
List<PortosSearchTermsReport> listSearchTerms = List<PortosSearchTermsReport> listSearchTerms = (List<PortosSearchTermsReport>) PortosReportUtil.invokeMethod(
(List<PortosSearchTermsReport>) PortosReportUtil.invokeMethod(className, "getSearchFields"); className, "getSearchFields");
if (Validator.isNotNull(listSearchTerms)) { if (Validator.isNotNull(listSearchTerms)) {
for (PortosSearchTermsReport term : listSearchTerms) { for (PortosSearchTermsReport term : listSearchTerms) {
String field = ParamUtil.getString(actionRequest, term.getFieldName()); String field = ParamUtil.getString(actionRequest, term.getFieldName());
@ -88,23 +81,19 @@ public class ReportsPortlet extends MVCPortlet {
} }
} }
} }
actionResponse.setRenderParameter("className", className); actionResponse.setRenderParameter("className", className);
actionResponse.setRenderParameter("tabs1", tabs1); actionResponse.setRenderParameter("tabs1", tabs1);
} }
@Override @Override
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException,
PortletException { PortletException {
String cmd = ParamUtil.getString(resourceRequest, "cmd", StringPool.BLANK); String cmd = ParamUtil.getString(resourceRequest, Constants.CMD, StringPool.BLANK);
String className = ParamUtil.getString(resourceRequest, "className", StringPool.BLANK); String className = ParamUtil.getString(resourceRequest, "className", StringPool.BLANK);
@SuppressWarnings("unchecked")
List<PortosSearchTermsReport> listSearchTerms = (List<PortosSearchTermsReport>) PortosReportUtil.invokeMethod(
List<PortosSearchTermsReport> listSearchTerms = className, "getSearchFields");
(List<PortosSearchTermsReport>) PortosReportUtil.invokeMethod(className, "getSearchFields");
if (Validator.isNotNull(listSearchTerms)) { if (Validator.isNotNull(listSearchTerms)) {
for (PortosSearchTermsReport term : listSearchTerms) { for (PortosSearchTermsReport term : listSearchTerms) {
String field = ParamUtil.getString(resourceRequest, term.getFieldName()); String field = ParamUtil.getString(resourceRequest, term.getFieldName());
@ -113,158 +102,114 @@ public class ReportsPortlet extends MVCPortlet {
} }
} }
} }
String reportTitle = ((String) PortosReportUtil.invokeMethod(className, PortosReportConstant.METHOD_GET_TITLE))
String reportTitle = .trim();
((String) PortosReportUtil.invokeMethod(className, PortosReportConstant.METHOD_GET_TITLE)).trim();
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest);
Class<?>[] paramTypes = { HttpServletRequest.class }; Class<?>[] paramTypes = { HttpServletRequest.class };
JasperReportBuilder builder = (JasperReportBuilder) PortosReportUtil.invokeMethod(className,
JasperReportBuilder builder = PortosReportConstant.METHOD_GENERATE_REPORT, paramTypes, request);
(JasperReportBuilder) PortosReportUtil.invokeMethod(className, PortosReportConstant.METHOD_GENERATE_REPORT,
paramTypes, request);
if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_CVS)) { if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_CVS)) {
String fileName = reportTitle + StringPool.UNDERLINE + new Date().getTime() + ".csv";
String fileName = reportTitle + "_" + new Date().getTime() + ".csv";
String contentType = ContentTypes.TEXT_CSV; String contentType = ContentTypes.TEXT_CSV;
try { try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
JasperCsvExporterBuilder csvExporter = DynamicReports.export.csvExporter(bos).setFieldDelimiter(","); JasperCsvExporterBuilder csvExporter = DynamicReports.export.csvExporter(bos).setFieldDelimiter(
StringPool.COMMA);
builder.ignorePageWidth(); builder.ignorePageWidth();
builder.ignorePagination(); builder.ignorePagination();
builder.toCsv(csvExporter); builder.toCsv(csvExporter);
resourceResponse.setContentType(contentType); resourceResponse.setContentType(contentType);
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + "\"" + fileName + "\""); resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName
+ StringPool.QUOTE);
resourceResponse.setContentLength(bos.size()); resourceResponse.setContentLength(bos.size());
OutputStream out = resourceResponse.getPortletOutputStream(); OutputStream out = resourceResponse.getPortletOutputStream();
bos.writeTo(out); bos.writeTo(out);
out.flush(); out.flush();
out.close(); out.close();
} catch (DRException e) { } catch (DRException e) {
_log.error(e, e); _log.error(e, e);
} }
} else if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_PDF)) { } else if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_PDF)) {
String fileName = reportTitle + StringPool.UNDERLINE + new Date().getTime() + ".pdf";
String fileName = reportTitle + "_" + new Date().getTime() + ".pdf";
String contentType = ContentTypes.APPLICATION_PDF; String contentType = ContentTypes.APPLICATION_PDF;
try { try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
builder.pageFooter(DynamicReports.cmp.line().setStyle(TemplatesADV.boldStyle), builder.pageFooter(DynamicReports.cmp.line().setStyle(TemplatesADV.boldStyle), DynamicReports.cmp
DynamicReports.cmp.pageNumber().setStyle(TemplatesADV.bold11CenteredStyle)); .pageNumber().setStyle(TemplatesADV.bold11CenteredStyle));
builder.pageHeader( builder.pageHeader(
TemplatesADV.createTitleComponent(LanguageUtil.get(LocaleUtil.getSiteDefault(), reportTitle)), TemplatesADV.createTitleComponent(LanguageUtil.get(LocaleUtil.getSiteDefault(), reportTitle)),
DynamicReports.cmp.line()); DynamicReports.cmp.line());
builder.toPdf(bos); builder.toPdf(bos);
resourceResponse.setContentType(contentType); resourceResponse.setContentType(contentType);
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + "\"" + fileName + "\""); resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName
+ StringPool.QUOTE);
resourceResponse.setContentLength(bos.size()); resourceResponse.setContentLength(bos.size());
OutputStream out = resourceResponse.getPortletOutputStream(); OutputStream out = resourceResponse.getPortletOutputStream();
bos.writeTo(out); bos.writeTo(out);
out.flush(); out.flush();
out.close(); out.close();
} catch (DRException e) { } catch (DRException e) {
_log.error(e, e); _log.error(e, e);
} }
} else if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_EXCEL)) { } else if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_EXCEL)) {
String fileName = reportTitle + StringPool.UNDERLINE + new Date().getTime() + ".xls";
String fileName = reportTitle + "_" + new Date().getTime() + ".xls";
String contentType = ContentTypes.APPLICATION_VND_MS_EXCEL; String contentType = ContentTypes.APPLICATION_VND_MS_EXCEL;
try { try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
JasperXlsExporterBuilder xlsExporter = DynamicReports.export.xlsExporter(bos)
JasperXlsExporterBuilder xlsExporter = .setIgnorePageMargins(true).setWhitePageBackground(false)
DynamicReports.export.xlsExporter(bos).setIgnorePageMargins(true).setWhitePageBackground(false).setRemoveEmptySpaceBetweenColumns( .setRemoveEmptySpaceBetweenColumns(true);
true); // ADT: BUG BO ID=34 - REPORT PRATICHE VIDIMATE
//ADT: BUG BO ID=34 – REPORT PRATICHE VIDIMATE
String label = LanguageUtil.get(LocaleUtil.getSiteDefault(), reportTitle); String label = LanguageUtil.get(LocaleUtil.getSiteDefault(), reportTitle);
ComponentBuilder<?, ?> titleComponentNew=TemplatesADV.createTitleComponentNew(label, className, request); ComponentBuilder<?, ?> titleComponentNew = TemplatesADV.createTitleComponentNew(label, className,
request);
if (titleComponentNew != null) { if (titleComponentNew != null) {
builder.pageHeader( builder.pageHeader(titleComponentNew, DynamicReports.cmp.line());
titleComponentNew,
DynamicReports.cmp.line());
} else { } else {
builder.pageHeader( builder.pageHeader(TemplatesADV.createTitleComponent(LanguageUtil.get(LocaleUtil.getSiteDefault(),
TemplatesADV.createTitleComponent(LanguageUtil.get(LocaleUtil.getSiteDefault(), reportTitle)), reportTitle)), DynamicReports.cmp.line());
DynamicReports.cmp.line());
} }
builder.ignorePageWidth(); builder.ignorePageWidth();
builder.ignorePagination(); builder.ignorePagination();
builder.toXls(xlsExporter); builder.toXls(xlsExporter);
resourceResponse.setContentType(contentType); resourceResponse.setContentType(contentType);
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + "\"" + fileName + "\""); resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName
+ StringPool.QUOTE);
resourceResponse.setContentLength(bos.size()); resourceResponse.setContentLength(bos.size());
OutputStream out = resourceResponse.getPortletOutputStream(); OutputStream out = resourceResponse.getPortletOutputStream();
bos.writeTo(out); bos.writeTo(out);
out.flush(); out.flush();
out.close(); out.close();
} catch (DRException e) { } catch (DRException e) {
_log.error(e, e); _log.error(e, e);
} }
} else if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_WORD)) { } else if (cmd.equalsIgnoreCase(PortosReportConstant.CMD_WORD)) {
String fileName = reportTitle + StringPool.UNDERLINE + new Date().getTime() + ".docx";
String fileName = reportTitle + "_" + new Date().getTime() + ".docx";
String contentType = ContentTypes.APPLICATION_MSWORD; String contentType = ContentTypes.APPLICATION_MSWORD;
try { try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
builder.pageFooter(DynamicReports.cmp.line().setStyle(TemplatesADV.boldStyle), builder.pageFooter(DynamicReports.cmp.line().setStyle(TemplatesADV.boldStyle), DynamicReports.cmp
DynamicReports.cmp.pageNumber().setStyle(TemplatesADV.bold11CenteredStyle)); .pageNumber().setStyle(TemplatesADV.bold11CenteredStyle));
builder.pageHeader( builder.pageHeader(
TemplatesADV.createTitleComponent(LanguageUtil.get(LocaleUtil.getSiteDefault(), reportTitle)), TemplatesADV.createTitleComponent(LanguageUtil.get(LocaleUtil.getSiteDefault(), reportTitle)),
DynamicReports.cmp.line()); DynamicReports.cmp.line());
builder.toDocx(bos); builder.toDocx(bos);
resourceResponse.setContentType(contentType); resourceResponse.setContentType(contentType);
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + "\"" + fileName + "\""); resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName
+ StringPool.QUOTE);
resourceResponse.setContentLength(bos.size()); resourceResponse.setContentLength(bos.size());
OutputStream out = resourceResponse.getPortletOutputStream(); OutputStream out = resourceResponse.getPortletOutputStream();
bos.writeTo(out); bos.writeTo(out);
out.flush(); out.flush();
out.close(); out.close();
} catch (DRException e) { } catch (DRException e) {
_log.error(e, e); _log.error(e, e);
} }
} }
super.serveResource(resourceRequest, resourceResponse); super.serveResource(resourceRequest, resourceResponse);
} }
} }

76
liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/jasper/core/ReportEngine.java

@ -30,6 +30,7 @@ import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter;
import net.sf.jasperreports.engine.xml.JRXmlLoader; import net.sf.jasperreports.engine.xml.JRXmlLoader;
import com.liferay.portal.kernel.util.HttpUtil; import com.liferay.portal.kernel.util.HttpUtil;
import com.liferay.portal.kernel.util.StringPool;
public class ReportEngine { public class ReportEngine {
@ -52,8 +53,8 @@ public class ReportEngine {
private String profile = SRGB_IEC61966_2_1_BLACK_SCALED; private String profile = SRGB_IEC61966_2_1_BLACK_SCALED;
public static final String[] ESTENSIONI = { "txt", "html", "xls", "rtf", "doc", "htm", "cvs", "docx", public static final String[] ESTENSIONI = { "txt", "html", "xls", "rtf", "doc", "htm", "cvs", "docx", "pdf", "pdf",
"pdf", "pdf", "pdf" }; "pdf" };
private String reportPath = "report/"; private String reportPath = "report/";
private String templatePath = "template"; private String templatePath = "template";
@ -66,8 +67,8 @@ public class ReportEngine {
private Integer exportType; private Integer exportType;
private Connection con = null; private Connection con = null;
private String classPath = ""; private String classPath = StringPool.BLANK;
private String compileTempPath = ""; private String compileTempPath = StringPool.BLANK;
private JRExporter exporter = null; private JRExporter exporter = null;
private JRDataSource datasource = null; private JRDataSource datasource = null;
@ -159,8 +160,7 @@ public class ReportEngine {
} }
/** /**
* Funzione per inserire e verificare i dati CSV, al fine di costruire un * Funzione per inserire e verificare i dati CSV, al fine di costruire un singolo file di report
* singolo file di report
* *
* @param nomeTemplate * @param nomeTemplate
* nome del/i file/s template del/i report/s * nome del/i file/s template del/i report/s
@ -173,9 +173,8 @@ public class ReportEngine {
* @param parametri * @param parametri
* HashMap dei parametri da passare al report * HashMap dei parametri da passare al report
* @throws Exception * @throws Exception
* 1.inesistenza template 2.numero colonne nei dati maggiore del * 1.inesistenza template 2.numero colonne nei dati maggiore del numero indicato da numColonne 3. I
* numero indicato da numColonne 3. I vettori dei dati non sono * vettori dei dati non sono della stessa lunghezza
* della stessa lunghezza
*/ */
public void insertDataConnection(Connection con, HashMap<String, Object> parametri, Integer exportType) public void insertDataConnection(Connection con, HashMap<String, Object> parametri, Integer exportType)
throws Exception { throws Exception {
@ -194,24 +193,21 @@ public class ReportEngine {
} }
/** /**
* Funzione per inserire e verificare i dati CSV, al fine di costruire più * Funzione per inserire e verificare i dati CSV, al fine di costruire più file report, diversi tra loro
* file report, diversi tra loro
* *
* @param nomeTemplate * @param nomeTemplate
* nome del/i file/s template del/i report/s * nome del/i file/s template del/i report/s
* @param nomiReport * @param nomiReport
* nome del/i report/s * nome del/i report/s
* @param csvDati * @param csvDati
* i dati in formato CSV (ogni riga deve terminare con \r\n, * i dati in formato CSV (ogni riga deve terminare con \r\n, anche l'ultima)
* anche l'ultima)
* @param numColonne * @param numColonne
* numero delle colonne dei dati CSV * numero delle colonne dei dati CSV
* @param parametri * @param parametri
* HashMap dei parametri da passare al report * HashMap dei parametri da passare al report
* @throws Exception * @throws Exception
* 1.inesistenza template 2.numero colonne nei dati maggiore del * 1.inesistenza template 2.numero colonne nei dati maggiore del numero indicato da numColonne 3. I
* numero indicato da numColonne 3. I vettori dei dati non sono * vettori dei dati non sono della stessa lunghezza
* della stessa lunghezza
*/ */
public void insertDataSource(String nomeTemplate, String nomiReport, ReportInterface csvDati, public void insertDataSource(String nomeTemplate, String nomiReport, ReportInterface csvDati,
HashMap<String, Object> parametri, Integer exportType) throws Exception { HashMap<String, Object> parametri, Integer exportType) throws Exception {
@ -221,8 +217,8 @@ public class ReportEngine {
this.con = null; this.con = null;
} }
public void insertDataSource(ReportInterface csvDati, HashMap<String, Object> parametri, public void insertDataSource(ReportInterface csvDati, HashMap<String, Object> parametri, Integer exportType)
Integer exportType) throws Exception { throws Exception {
insertData(parametri, exportType); insertData(parametri, exportType);
this.CSVDati = csvDati; this.CSVDati = csvDati;
@ -230,24 +226,21 @@ public class ReportEngine {
} }
/** /**
* Funzione per inserire e verificare i dati CSV, al fine di costruire più * Funzione per inserire e verificare i dati CSV, al fine di costruire più file report, diversi tra loro
* file report, diversi tra loro
* *
* @param nomeTemplate * @param nomeTemplate
* nome del/i file/s template del/i report/s * nome del/i file/s template del/i report/s
* @param nomiReport * @param nomiReport
* nome del/i report/s * nome del/i report/s
* @param csvDati * @param csvDati
* i dati in formato CSV (ogni riga deve terminare con \r\n, * i dati in formato CSV (ogni riga deve terminare con \r\n, anche l'ultima)
* anche l'ultima)
* @param numColonne * @param numColonne
* numero delle colonne dei dati CSV * numero delle colonne dei dati CSV
* @param parametri * @param parametri
* HashMap dei parametri da passare al report * HashMap dei parametri da passare al report
* @throws Exception * @throws Exception
* 1.inesistenza template 2.numero colonne nei dati maggiore del * 1.inesistenza template 2.numero colonne nei dati maggiore del numero indicato da numColonne 3. I
* numero indicato da numColonne 3. I vettori dei dati non sono * vettori dei dati non sono della stessa lunghezza
* della stessa lunghezza
*/ */
public void insertSimpleData(String nomeTemplate, String nomiReport, HashMap<String, Object> parametri, public void insertSimpleData(String nomeTemplate, String nomiReport, HashMap<String, Object> parametri,
Integer exportType) throws Exception { Integer exportType) throws Exception {
@ -265,8 +258,7 @@ public class ReportEngine {
} }
/** /**
* Funzione per inserire e verificare i dati (solo parametri), al fine di * Funzione per inserire e verificare i dati (solo parametri), al fine di costruire più file report diversi tra loro
* costruire più file report diversi tra loro
* *
* @param nomeTemplate * @param nomeTemplate
* nome del/i file/s template del/i report/s * nome del/i file/s template del/i report/s
@ -276,14 +268,13 @@ public class ReportEngine {
* HashMap dei parametri da passare al report * HashMap dei parametri da passare al report
* @param numColonne * @param numColonne
* @throws Exception * @throws Exception
* 1.inesistenza template 2.numero colonne nei dati maggiore del * 1.inesistenza template 2.numero colonne nei dati maggiore del numero indicato da numColonne 3. I
* numero indicato da numColonne 3. I vettori dei dati non sono * vettori dei dati non sono della stessa lunghezza
* della stessa lunghezza
*/ */
private void insertData(String nomeTemplate, String nomiReport, HashMap<String, Object> parametri, private void insertData(String nomeTemplate, String nomiReport, HashMap<String, Object> parametri,
Integer exportType) throws Exception { Integer exportType) throws Exception {
if (!(new File(this.templatePath + nomeTemplate + "." + this.templateExt).exists())) if (!(new File(this.templatePath + nomeTemplate + StringPool.PERIOD + this.templateExt).exists()))
throw new Exception("Il template " + nomeTemplate + " non esiste !"); throw new Exception("Il template " + nomeTemplate + " non esiste !");
this.exportType = exportType; this.exportType = exportType;
this.nomeTemplate = nomeTemplate; this.nomeTemplate = nomeTemplate;
@ -300,8 +291,7 @@ public class ReportEngine {
} }
/** /**
* Funzione per creare un report direttamente su un OutputStream con il * Funzione per creare un report direttamente su un OutputStream con il formato desiderato
* formato desiderato
* *
* @param out * @param out
* OutputStream in cui scrivere * OutputStream in cui scrivere
@ -331,16 +321,14 @@ public class ReportEngine {
if (exporter == null || !(exporter instanceof JRPdfExporter)) if (exporter == null || !(exporter instanceof JRPdfExporter))
exporter = new JRPdfExporter(); exporter = new JRPdfExporter();
parameters.put("IS_IGNORE_PAGINATION", Boolean.FALSE); parameters.put("IS_IGNORE_PAGINATION", Boolean.FALSE);
exporter.setParameter(JRPdfExporterParameter.PDFA_CONFORMANCE, exporter.setParameter(JRPdfExporterParameter.PDFA_CONFORMANCE, JRPdfExporterParameter.PDFA_CONFORMANCE_1A);
JRPdfExporterParameter.PDFA_CONFORMANCE_1A);
exporter.setParameter(JRPdfExporterParameter.PDFA_ICC_PROFILE_PATH, exporter.setParameter(JRPdfExporterParameter.PDFA_ICC_PROFILE_PATH,
HttpUtil.decodeURL(this.getClass().getResource(getProfile()).getPath())); HttpUtil.decodeURL(this.getClass().getResource(getProfile()).getPath()));
} else if (exportType == EXPORT_TO_PDFA_1B) { } else if (exportType == EXPORT_TO_PDFA_1B) {
if (exporter == null || !(exporter instanceof JRPdfExporter)) if (exporter == null || !(exporter instanceof JRPdfExporter))
exporter = new JRPdfExporter(); exporter = new JRPdfExporter();
parameters.put("IS_IGNORE_PAGINATION", Boolean.FALSE); parameters.put("IS_IGNORE_PAGINATION", Boolean.FALSE);
exporter.setParameter(JRPdfExporterParameter.PDFA_CONFORMANCE, exporter.setParameter(JRPdfExporterParameter.PDFA_CONFORMANCE, JRPdfExporterParameter.PDFA_CONFORMANCE_1B);
JRPdfExporterParameter.PDFA_CONFORMANCE_1B);
exporter.setParameter(JRPdfExporterParameter.PDFA_ICC_PROFILE_PATH, exporter.setParameter(JRPdfExporterParameter.PDFA_ICC_PROFILE_PATH,
HttpUtil.decodeURL(this.getClass().getResource(getProfile()).getPath())); HttpUtil.decodeURL(this.getClass().getResource(getProfile()).getPath()));
} else if (exportType == EXPORT_TO_DOC || exportType == EXPORT_TO_RTF) { } else if (exportType == EXPORT_TO_DOC || exportType == EXPORT_TO_RTF) {
@ -396,8 +384,7 @@ public class ReportEngine {
* Funzione per il riempimento e la compilazione del template Jasper * Funzione per il riempimento e la compilazione del template Jasper
* *
* @param ds * @param ds
* DataSource sorgente dati può essere nullo in tal caso si tiene * DataSource sorgente dati può essere nullo in tal caso si tiene conto solo di parameters
* conto solo di parameters
* @param nomeTeplate * @param nomeTeplate
* Template Jasper da usare * Template Jasper da usare
* @param parameters * @param parameters
@ -405,21 +392,20 @@ public class ReportEngine {
* @return JasperPrint * @return JasperPrint
* @throws JRException * @throws JRException
*/ */
private JasperPrint CompileAndFillReport(String nomeTeplate, HashMap<String, Object> parameters) private JasperPrint CompileAndFillReport(String nomeTeplate, HashMap<String, Object> parameters) throws JRException {
throws JRException {
JasperDesign jd = null; JasperDesign jd = null;
JasperReport jr = null; JasperReport jr = null;
JasperPrint jp = null; JasperPrint jp = null;
if (classPath != null && !classPath.equals("")) if (classPath != null && !classPath.equals(StringPool.BLANK))
System.setProperty("jasper.reports.compile.class.path", classPath); System.setProperty("jasper.reports.compile.class.path", classPath);
if (compileTempPath != null && !compileTempPath.equals("")) if (compileTempPath != null && !compileTempPath.equals(StringPool.BLANK))
System.setProperty("jasper.reports.compile.temp", compileTempPath); System.setProperty("jasper.reports.compile.temp", compileTempPath);
try { try {
if (fileTemplate != null) { if (fileTemplate != null) {
jd = JRXmlLoader.load(fileTemplate); jd = JRXmlLoader.load(fileTemplate);
} else { } else {
jd = JRXmlLoader.load(templatePath + nomeTeplate + "." + templateExt); jd = JRXmlLoader.load(templatePath + nomeTeplate + StringPool.PERIOD + templateExt);
} }
jr = JasperCompileManager.compileReport(jd); jr = JasperCompileManager.compileReport(jd);
@ -454,7 +440,7 @@ public class ReportEngine {
private String sistemaSlash(String path) { private String sistemaSlash(String path) {
if (path.charAt(path.length() - 1) != '/' && path.charAt(path.length() - 1) != '\\') { if (path.charAt(path.length() - 1) != '/' && path.charAt(path.length() - 1) != '\\') {
path += "/"; path += StringPool.FORWARD_SLASH;
} }
return path; return path;
} }

13
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java

@ -29,17 +29,10 @@ public class ModelListenerInvocationHandler implements InvocationHandler {
@Override @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
/** // @see com.liferay.portal.kernel.bean.ClassLoaderBeanHandler
* @see com.liferay.portal.kernel.bean.ClassLoaderBeanHandler
*/
if (method.getDeclaringClass() == Object.class) { if (method.getDeclaringClass() == Object.class) {
String methodName = method.getName(); if (method.getName().equals("equals")) {
if (methodName.equals("equals")) { return proxy == args[0];
if (proxy == args[0]) {
return true;
} else {
return false;
}
} }
} }
if (ArrayUtil.contains(MODEL_METHOD_NAMES, method.getName())) { if (ArrayUtil.contains(MODEL_METHOD_NAMES, method.getName())) {

2
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java

@ -15,7 +15,6 @@ public class ModelListenerPool {
ModelListener<BaseModel<?>> modelListener) { ModelListener<BaseModel<?>> modelListener) {
_servletContextNameMap.put(modelClassName, servletContextName); _servletContextNameMap.put(modelClassName, servletContextName);
if (!_modelListenersMap.containsKey(modelClassName)) { if (!_modelListenersMap.containsKey(modelClassName)) {
_modelListenersMap.put(modelClassName, new ArrayList<ModelListener<BaseModel<?>>>()); _modelListenersMap.put(modelClassName, new ArrayList<ModelListener<BaseModel<?>>>());
} }
@ -46,5 +45,4 @@ public class ModelListenerPool {
private final static Map<String, List<ModelListener<BaseModel<?>>>> _modelListenersMap = new ConcurrentHashMap<String, List<ModelListener<BaseModel<?>>>>(); private final static Map<String, List<ModelListener<BaseModel<?>>>> _modelListenersMap = new ConcurrentHashMap<String, List<ModelListener<BaseModel<?>>>>();
private final static Map<String, String> _servletContextNameMap = new ConcurrentHashMap<String, String>(); private final static Map<String, String> _servletContextNameMap = new ConcurrentHashMap<String, String>();
} }

53
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/ArtLeggeUtil.java

@ -1,53 +0,0 @@
package it.tref.liferay.portos.bo.shared.util;
import java.util.LinkedHashMap;
import java.util.Map;
public class ArtLeggeUtil {
public static final String DPR01 = "DPR01";
public static final String DPR02 = "DPR02";
public static final String DPR03 = "DPR03";
public static final String DPR04 = "DPR04";
public static final String DM01 = "DM01";
public static final String DM02 = "DM02";
public static final String DM03 = "DM03";
public static final String DM04 = "DM04";
public static final String DM05 = "DM05";
public static final String ANR = "ANR";
public static final String DPGR01 = "DPGR01";
public static final String DPGR02 = "DPGR02";
public static final String ORD01 = "ORD01";
public static final String LTC01 = "LTC01";
public static final String CI01 = "CI01";
public static final String ART3COM3 = "ART3COM3";
public static final String ART3COM4 = "ART3COM4";
@SuppressWarnings("serial")
private static final Map<String, String> allArtLegge = new LinkedHashMap<String, String>() {
{
put(DPR01, "D.P.R. 380/01 artt. 93 e 94, L.R. 1/05 art. 105 ter");
put(DPR02, "D.P.R. 380/01 artt. 65, 93 e 94, L.R. 1/05 art. 105 ter");
put(DPR03, "D.P.R. 380/01 art. 61(art.2 L64/74)");
put(DPR04, "D.P.R. 380/01 artt. 65, 93 e 94, L.R. 1/05 art. 105 bis");
put(DM01, "D.M. 14/01/2008");
put(DM02, "D.M. 14/09/2005");
put(DM03, "D.M. 16/01/1996");
put(DM04, "D.M. 24/01/1986");
put(DM05, "D.M. 14/09/1985");
put(ANR, "Altra normativa di riferimento");
put(DPGR01, "D.P.G.R. 36/R/1996");
put(DPGR02, "D.P.G.R. 36/R/1996 ART.6 E 7");
put(ORD01, "Ordinanza P.C.M n 3274/03 e succ.integrazione");
put(LTC01, "Lettura tecnica consolidata");
put(CI01, "Codici Internazionali");
put(ART3COM3, "Art.3,3");
put(ART3COM4, "Art.3,4");
}
};
public static String getLabel(String key) {
return allArtLegge.get(key);
}
}

6
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/Constants.java

@ -33,11 +33,6 @@ public class Constants implements com.liferay.portal.kernel.util.Constants {
@SuppressWarnings("serial") @SuppressWarnings("serial")
public static final Map<String, String> PRATICA_ZONE = new HashMap<String, String>() { public static final Map<String, String> PRATICA_ZONE = new HashMap<String, String>() {
{ {
put(ZONA_3, TIPO_PRATICA_DEPOSITO);
put(ZONA_4, TIPO_PRATICA_DEPOSITO);
put(ZONA_2, TIPO_PRATICA_AUTORIZZAZIONE);
put(ZONA_1, TIPO_PRATICA_AUTORIZZAZIONE);
put(PROCEDURA_P0, TIPO_PRATICA_AUTORIZZAZIONE); put(PROCEDURA_P0, TIPO_PRATICA_AUTORIZZAZIONE);
put(PROCEDURA_P1, TIPO_PRATICA_AUTORIZZAZIONE); put(PROCEDURA_P1, TIPO_PRATICA_AUTORIZZAZIONE);
put(PROCEDURA_P2, TIPO_PRATICA_AUTORIZZAZIONE); put(PROCEDURA_P2, TIPO_PRATICA_AUTORIZZAZIONE);
@ -49,7 +44,6 @@ public class Constants implements com.liferay.portal.kernel.util.Constants {
put(PROCEDURA_P8, TIPO_PRATICA_AUTORIZZAZIONE); put(PROCEDURA_P8, TIPO_PRATICA_AUTORIZZAZIONE);
put(PROCEDURA_P9, TIPO_PRATICA_AUTORIZZAZIONE); put(PROCEDURA_P9, TIPO_PRATICA_AUTORIZZAZIONE);
put(PROCEDURA_P10, TIPO_PRATICA_AUTORIZZAZIONE); put(PROCEDURA_P10, TIPO_PRATICA_AUTORIZZAZIONE);
} }
}; };

2
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FascicoloURLUtil.java

@ -53,7 +53,7 @@ public class FascicoloURLUtil {
Company company = CompanyLocalServiceUtil.getCompany(companyId); Company company = CompanyLocalServiceUtil.getCompany(companyId);
String urlToBack = (String) company.getExpandoBridge().getAttribute(Constants.GESTIONE_PRATICA_URL_BO, false); String urlToBack = (String) company.getExpandoBridge().getAttribute(Constants.GESTIONE_PRATICA_URL_BO, false);
urlToBack = urlToBack.replaceAll("^http[s]{0,1}://[^/]+", ""); urlToBack = urlToBack.replaceAll("^http[s]{0,1}://[^/]+", StringPool.BLANK);
urlToBack = urlToBack + "&_" + PortletKeys.FASCICOLO + "_intPraticaId=" + intPraticaId; urlToBack = urlToBack + "&_" + PortletKeys.FASCICOLO + "_intPraticaId=" + intPraticaId;
return urlToBack; return urlToBack;
} }

14
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java

@ -21,14 +21,15 @@ public class PagamentoConstants {
public final static String UTILIZZATA_NON_PAGABILE = "06"; public final static String UTILIZZATA_NON_PAGABILE = "06";
public final static String UTILIZZATA_SOSTITUITA = "07"; public final static String UTILIZZATA_SOSTITUITA = "07";
public final static String UTILIZZATA_ANNULLATO = "08"; public final static String UTILIZZATA_ANNULLATO = "08";
private static Map<String, String> mezzoToLabel;
static { @SuppressWarnings("serial")
mezzoToLabel = new HashMap<String, String>(); private static Map<String, String> mezzoToLabel = new HashMap<String, String>() {
mezzoToLabel.put(MEZZO_ZERO, "label.pratica.pagamento.mezzo.zero"); {
mezzoToLabel.put(MEZZO_MANUALE, "label.pratica.pagamento.mezzo.manuale"); put(MEZZO_ZERO, "label.pratica.pagamento.mezzo.zero");
mezzoToLabel.put(MEZZO_IRIS, "label.pratica.pagamento.mezzo.iris"); put(MEZZO_MANUALE, "label.pratica.pagamento.mezzo.manuale");
put(MEZZO_IRIS, "label.pratica.pagamento.mezzo.iris");
} }
};
public PagamentoConstants() { public PagamentoConstants() {
} }
@ -36,5 +37,4 @@ public class PagamentoConstants {
public static String mezzoToLabel(String mezzo) { public static String mezzoToLabel(String mezzo) {
return mezzoToLabel.get(mezzo); return mezzoToLabel.get(mezzo);
} }
} }

8
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java

@ -60,6 +60,8 @@ public class StatoPraticaConstants {
put(RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata"); put(RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata");
put(SOTTOPOSTA_A_PARERE, "label.admingeniocivile.statopratica.sottopostaaparere"); put(SOTTOPOSTA_A_PARERE, "label.admingeniocivile.statopratica.sottopostaaparere");
put(VIDIMATA, "label.admingeniocivile.statopratica.vidimata"); put(VIDIMATA, "label.admingeniocivile.statopratica.vidimata");
put(VIARCH_APERTO, "label.admingeniocivile.statopratica.viarch1");
put(VIARCH_CHIUSO, "label.admingeniocivile.statopratica.viarch2");
} }
}; };
@ -80,19 +82,19 @@ public class StatoPraticaConstants {
static { static {
esitoDeposito = new HashMap<>(); esitoDeposito = new HashMap<>();
esitoDeposito.putAll(esitoAutorizzazione); esitoDeposito.putAll(esitoAutorizzazione);
esitoAutorizzazione.put(CONFORME, getLabel(AUTORIZZATA)); esitoAutorizzazione.put(CONFORME, getLabel(AUTORIZZATA));
esitoAutorizzazione.put(NON_CONFORME, getLabel(NON_AUTORIZZATA)); esitoAutorizzazione.put(NON_CONFORME, getLabel(NON_AUTORIZZATA));
esitoDeposito.put(CONFORME, getLabel(CONFORME)); esitoDeposito.put(CONFORME, getLabel(CONFORME));
esitoDeposito.put(NON_CONFORME, getLabel(NON_CONFORME)); esitoDeposito.put(NON_CONFORME, getLabel(NON_CONFORME));
} }
public static String getStatusLabel(String statoPratica) { public static String getStatusLabel(String statoPratica) {
return statusLabel.get(statoPratica); return statusLabel.get(statoPratica);
} }
public static String getEsitoAutorizzazione(String esito) { public static String getEsitoAutorizzazione(String esito) {
if (esitoAutorizzazione.containsKey(esito)) { if (esitoAutorizzazione.containsKey(esito)) {
return esitoAutorizzazione.get(esito); return esitoAutorizzazione.get(esito);
} }
@ -100,6 +102,7 @@ public class StatoPraticaConstants {
} }
public static String getEsitoDeposito(String esito) { public static String getEsitoDeposito(String esito) {
if (esitoDeposito.containsKey(esito)) { if (esitoDeposito.containsKey(esito)) {
return esitoDeposito.get(esito); return esitoDeposito.get(esito);
} }
@ -107,6 +110,7 @@ public class StatoPraticaConstants {
} }
private static String getLabel(String stato) { private static String getLabel(String stato) {
return LanguageUtil.get(LocaleUtil.getDefault(), "stato-pratica-" + stato); return LanguageUtil.get(LocaleUtil.getDefault(), "stato-pratica-" + stato);
} }
} }

1
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/TipoIntegrazioneUtil.java

@ -14,6 +14,7 @@ public class TipoIntegrazioneUtil {
public static final String VARIAZIONE_SOGGETTO = "12"; public static final String VARIAZIONE_SOGGETTO = "12";
public static final String VARIANTE = "13"; public static final String VARIANTE = "13";
@SuppressWarnings("serial")
private static final List<String> outOfWorkflow = new ArrayList<String>() { private static final List<String> outOfWorkflow = new ArrayList<String>() {
{ {
add(VARIAZIONE_SOGGETTO); add(VARIAZIONE_SOGGETTO);

5
liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath

@ -2,5 +2,10 @@
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"/>
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext/portal-service.jar" sourcepath="/home/portos/sources/liferay-portal-src-6.2-ce-ga6">
<attributes>
<attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="classes"/> <classpathentry kind="output" path="classes"/>
</classpath> </classpath>

37
liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java

@ -3,6 +3,8 @@ package it.tref.firma.shared;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.liferay.portal.kernel.util.StringPool;
public class RestFile implements Serializable { public class RestFile implements Serializable {
private static final long serialVersionUID = 560778228734037313L; private static final long serialVersionUID = 560778228734037313L;
@ -14,79 +16,88 @@ public class RestFile implements Serializable {
private String file; private String file;
public RestFile() { public RestFile() {
idFile = -1; idFile = -1;
nomeFile = ""; nomeFile = StringPool.BLANK;
dataInvio = new Date(); dataInvio = new Date();
documentiType = ""; documentiType = StringPool.BLANK;
tipoPratica = ""; tipoPratica = StringPool.BLANK;
file = ""; file = StringPool.BLANK;
} }
@Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (idFile != null) { if (idFile != null) {
sb.append("Id = "); sb.append("Id = ").append(idFile).append(StringPool.SPACE);
sb.append(idFile);
sb.append(" ");
} }
if (documentiType != null) { if (documentiType != null) {
sb.append("Documenti type = "); sb.append("Documenti type = ").append(documentiType).append(StringPool.SPACE);
sb.append(documentiType);
sb.append(" ");
} }
if (tipoPratica != null) { if (tipoPratica != null) {
sb.append("Tipo pratica= "); sb.append("Tipo pratica= ").append(tipoPratica).append(StringPool.SPACE);
sb.append(tipoPratica);
sb.append(" ");
} }
return sb.toString(); return sb.toString();
} }
public String getNomeFile() { public String getNomeFile() {
return nomeFile; return nomeFile;
} }
public void setNomeFile(String nomeFile) { public void setNomeFile(String nomeFile) {
this.nomeFile = nomeFile; this.nomeFile = nomeFile;
} }
public Date getDataInvio() { public Date getDataInvio() {
return dataInvio; return dataInvio;
} }
public void setDataInvio(Date dataInvio) { public void setDataInvio(Date dataInvio) {
this.dataInvio = dataInvio; this.dataInvio = dataInvio;
} }
public String getDocumentiType() { public String getDocumentiType() {
return documentiType; return documentiType;
} }
public void setDocumentiType(String documentiType) { public void setDocumentiType(String documentiType) {
this.documentiType = documentiType; this.documentiType = documentiType;
} }
public String getTipoPratica() { public String getTipoPratica() {
return tipoPratica; return tipoPratica;
} }
public void setTipoPratica(String tipoPratica) { public void setTipoPratica(String tipoPratica) {
this.tipoPratica = tipoPratica; this.tipoPratica = tipoPratica;
} }
public Integer getIdFile() { public Integer getIdFile() {
return idFile; return idFile;
} }
public void setIdFile(Integer idFile) { public void setIdFile(Integer idFile) {
this.idFile = idFile; this.idFile = idFile;
} }
public String getFile() { public String getFile() {
return file; return file;
} }
public void setFile(String file) { public void setFile(String file) {
this.file = file; this.file = file;
} }
} }

4
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf

@ -38,10 +38,6 @@ details.
<% <%
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Map<Long, String> historyWorkflowEsitiLogs = (Map<Long, String>) request.getAttribute("historyWorkflowEsitiLogs"); Map<Long, String> historyWorkflowEsitiLogs = (Map<Long, String>) request.getAttribute("historyWorkflowEsitiLogs");
System.out.println("*** historyWorkflowEsitiLogs");
for (Map.Entry<Long, String> e : historyWorkflowEsitiLogs.entrySet()) {
System.out.println("*** " + e.getKey() + " = " + e.getValue());
}
for (WorkflowLog workflowLog : workflowLogs) { for (WorkflowLog workflowLog : workflowLogs) {
Role curRole = null; Role curRole = null;
User curUser = null; User curUser = null;

21
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java

@ -6,7 +6,7 @@ import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil; import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import it.tref.liferay.portos.bo.util.AzioniPraticheUtil; import it.tref.liferay.portos.bo.util.PraticaUtil;
import it.tref.liferay.portos.kaleo.model.FormLog; import it.tref.liferay.portos.kaleo.model.FormLog;
import it.tref.liferay.portos.kaleo.service.ClpSerializer; import it.tref.liferay.portos.kaleo.service.ClpSerializer;
import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil; import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil;
@ -434,13 +434,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance
.getClassPK()); .getClassPK());
if (json.has("esito")) { if (json.has("esito")) {
String tipoEsito = StringPool.BLANK; return PraticaUtil.getStatoPratica(json.getString("esito"), controlloPratica.getIntPraticaId());
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) {
tipoEsito = StatoPraticaConstants.getEsitoDeposito(json.getString("esito"));
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) {
tipoEsito = StatoPraticaConstants.getEsitoAutorizzazione(json.getString("esito"));
}
return tipoEsito;
} else if (json.has("istruttore")) { } else if (json.has("istruttore")) {
User istruttore = UserLocalServiceUtil.fetchUser(json.getLong("istruttore")); User istruttore = UserLocalServiceUtil.fetchUser(json.getLong("istruttore"));
if (Validator.isNotNull(istruttore)) { if (Validator.isNotNull(istruttore)) {
@ -483,13 +477,10 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
if (formLog != null && Validator.isNotNull(formLog.getFormParameters())) { if (formLog != null && Validator.isNotNull(formLog.getFormParameters())) {
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters());
if (json.has("esito")) { if (json.has("esito")) {
String tipoEsito = StringPool.BLANK; esitiMapByWorkflowLogID.put(
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { workflowLog.getWorkflowLogId(),
tipoEsito = StatoPraticaConstants.getEsitoDeposito(json.getString("esito")); PraticaUtil.getStatoPratica(json.getString("esito"),
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) { controlloPratica.getIntPraticaId()));
tipoEsito = StatoPraticaConstants.getEsitoAutorizzazione(json.getString("esito"));
}
esitiMapByWorkflowLogID.put(workflowLog.getWorkflowLogId(), tipoEsito);
} }
} }
} }

4
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=Kaleo build.namespace=Kaleo
build.number=35 build.number=36
build.date=1617268494642 build.date=1617889828571
build.auto.upgrade=true build.auto.upgrade=true
## ##

Caricamento…
Annulla
Salva