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. 203
      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. 64
      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. 13
      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. 120
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/startup/CompanyExpandoStartupAction.java
  24. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/startup/KaleoListenereStartupAction.java
  25. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/Constants.java
  26. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java
  27. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/TempisticaConstants.java
  28. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  29. 50
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/edit_allegato_manuale.jsp
  30. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/init.jsp
  31. 161
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/view.jsp
  32. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/init.jsp
  33. 48
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/edit.jsp
  34. 18
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/import.jsp
  35. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/search.jsp
  36. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/select_comune.jsp
  37. 73
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/view.jsp
  38. 30
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/comuni/view_buttons.jsp
  39. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/tabs/parametri/view.jsp
  40. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/amministrazione/view.jsp
  41. 98
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/confirm_import_window.jsp
  42. 106
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/confirm_window.jsp
  43. 264
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/submit_window.jsp
  44. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/cronologia/init.jsp
  45. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/cronologia/view.jsp
  46. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp
  47. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/header.jsp
  48. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
  49. 328
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/action_button.jsp
  50. 98
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_aggiungi_al_controllo.jsp
  51. 89
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp
  52. 100
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_seleziona_geologo.jsp
  53. 116
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/altri_task.jsp
  54. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp
  55. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_completati.jsp
  56. 17
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_miei_ruoli.jsp
  57. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view.jsp
  58. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf
  59. 7
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/action_button.jsp
  60. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/init.jsp
  61. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/view_columns.jspf
  62. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/paesaggistica_administration/init.jsp
  63. 72
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/paesaggistica_administration/view.jsp
  64. 7
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
  65. 18
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/SoggettiPraticaPortlet.java
  66. 52
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/search/AdvancedSearch.java
  67. 8
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/PortletKeys.java
  68. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/portlet.properties
  69. 10
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/init.jsp
  70. 71
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp
  71. 502
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp
  72. 31
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/configuration.jsp
  73. 1
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/init.jsp
  74. 4
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf
  75. 75
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns.jsp
  76. 525
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns_generic.jspf
  77. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
  78. 2541
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/edit_soggetto.jsp
  79. 99
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/edit_soggetto_modal.jsp
  80. 10
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/init.jsp
  81. 1135
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view.jsp
  82. 779
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view_valida_fino.jsp
  83. 14
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java
  84. 4
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java
  85. 38
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java
  86. 474
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java
  87. 108
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java
  88. 843
      liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/portos/report/engine/ReportAssegnazioniIstruttorie.java
  89. 381
      liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/portos/report/engine/portlet/ReportsPortlet.java
  90. 90
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/jasper/core/ReportEngine.java
  91. 13
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java
  92. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java
  93. 53
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/ArtLeggeUtil.java
  94. 6
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/Constants.java
  95. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FascicoloURLUtil.java
  96. 18
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java
  97. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/ParamUtil.java
  98. 8
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java
  99. 1
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/TipoIntegrazioneUtil.java
  100. 5
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath
  101. Some files were not shown because too many files have changed in this diff Show More

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-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext
app.server.tomcat.deploy.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps
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.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-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

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

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

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)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* ADT: report tempistiche istruttorie
*/
public java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni(
java.util.Date dtMin, java.util.Date dtMax, long groupId,
java.lang.String type)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* ADT: report pratiche vidimate
*/
public java.util.List<java.lang.Object[]> reportPraticheVidimate(
java.util.Date dtMin, java.util.Date dtMax, long groupId,
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);
}
/**
* ADT: report tempistiche istruttorie
*/
public static java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni(
java.util.Date dtMin, java.util.Date dtMax, long groupId,
java.lang.String type)
@ -711,9 +708,6 @@ public class IntPraticaLocalServiceUtil {
dtMax, groupId, type);
}
/**
* ADT: report pratiche vidimate
*/
public static java.util.List<java.lang.Object[]> reportPraticheVidimate(
java.util.Date dtMin, java.util.Date dtMax, long groupId,
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);
}
/**
* ADT: report tempistiche istruttorie
*/
@Override
public java.util.List<java.lang.Object[]> reportTempisticheIstruttorieAvvisiAutorizzazioni(
java.util.Date dtMin, java.util.Date dtMax, long groupId,
@ -780,9 +777,6 @@ public class IntPraticaLocalServiceWrapper implements IntPraticaLocalService,
dtMax, groupId, type);
}
/**
* ADT: report pratiche vidimate
*/
@Override
public java.util.List<java.lang.Object[]> reportPraticheVidimate(
java.util.Date dtMin, java.util.Date dtMax, long groupId,

64
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;
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 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.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.Validator;
@ -122,7 +126,8 @@ public class PraticaUtil {
add("pagNuovaCostruzione");
add("pagVarianti");
add("pagAltro");
}};
}
};
public static List<String> getDettPraticaHiddenFields() {
@ -132,21 +137,42 @@ public class PraticaUtil {
public static String getStatoPraticaLabel(String statoPratica, long intPraticaId) throws PortalException,
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;
switch (statoPratica) {
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;
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;
default:
statoPraticaLabel = StatoPraticaConstants.getStatusLabel(statoPratica);
@ -158,9 +184,25 @@ public class PraticaUtil {
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,
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;
switch (statoPratica) {
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,
SystemException {
if (dettPratica.getTipoIntegrazione() == null || dettPratica.getTipoIntegrazione().equals("")) {
if (Validator.isNull(dettPratica.getTipoIntegrazione())) {
return true;
} else {
return !TipoIntegrazioneUtil.isOutOfWorkflow(dettPratica.getTipoIntegrazione());
@ -257,7 +257,7 @@ public class WorkflowUtil {
WorkflowTask workflowTask = getLastTask(companyId, groupId, null, controlloPratica);
Map<String, Serializable> workflowContext = getWorkflowContext(controlloPratica);
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, assegnatoreUserId,
workflowTask.getWorkflowTaskId(), istruttoreId, "", null, workflowContext);
workflowTask.getWorkflowTaskId(), istruttoreId, StringPool.BLANK, null, workflowContext);
}
public static Map<String, Serializable> getWorkflowContext(ControlloPratica controlloPratica)
@ -291,12 +291,10 @@ public class WorkflowUtil {
switch (value) {
case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.CONFORME:
value = StatoPraticaConstants.VIARCH_APERTO;
break;
return "stato-pratica-" + StatoPraticaConstants.VIARCH_APERTO;
case StatoPraticaConstants.NON_AUTORIZZATA:
case StatoPraticaConstants.NON_CONFORME:
value = StatoPraticaConstants.VIARCH_CHIUSO;
break;
return "stato-pratica-" + StatoPraticaConstants.VIARCH_CHIUSO;
}
} else if (intPratica.getTipoPratica().equals(Constants.TIPO_PRATICA_AUTORIZZAZIONE)) {
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.approvazione = Approvazione
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.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) {
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) {
}
if ((0 != destinazione) && (destinazione != pratica.getUnitaOperativa())) {
esitoLog(esito,
"Pratica " + pratica.getNumeroProgetto() + "/" + pratica.getIntPraticaId()
+ ", " + pratica.getUnitaOperativa() + " -> " + destinazione + " ("
+ userId + ")");
esitoLog(
esito,
"Pratica " + pratica.getNumeroProgetto() + StringPool.SLASH
+ pratica.getIntPraticaId() + StringPool.COMMA_AND_SPACE
+ pratica.getUnitaOperativa() + " -> " + destinazione + " ("
+ userId + StringPool.CLOSE_PARENTHESIS);
pratica.setUnitaOperativa(destinazione);
IntPraticaLocalServiceUtil.updateIntPratica(pratica);
}
@ -435,7 +437,8 @@ public class ManutenzioneDatabase {
}
break;
default:
_log.info("Tipo sconosciuto " + tipo + " (" + fileEntry.getTitle() + ")");
_log.info("Tipo sconosciuto " + tipo + " (" + fileEntry.getTitle()
+ StringPool.CLOSE_PARENTHESIS);
break;
}
} else {
@ -1157,7 +1160,7 @@ public class ManutenzioneDatabase {
WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK);
}
} else {
if (className.contains(".")) {
if (className.contains(StringPool.PERIOD)) {
switch (className) {
case "com.liferay.portlet.blogs":
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 "
+ controllo.getControlloPraticaId());
}
AvvisoLocalServiceUtil.addAvviso(intPraticaId, "", avviso.getDtAvviso(),
AvvisoUtil.TIPO_AVVISO_DIRETTO, avviso.getTipoDocumento(), templateId,
controllo.getDettPraticaId(), DettPratica.class.getName(),
controllo.getControlloPraticaId(), serviceContext);
AvvisoLocalServiceUtil.addAvviso(intPraticaId, StringPool.BLANK,
avviso.getDtAvviso(), AvvisoUtil.TIPO_AVVISO_DIRETTO,
avviso.getTipoDocumento(), templateId, controllo.getDettPraticaId(),
DettPratica.class.getName(), controllo.getControlloPraticaId(),
serviceContext);
} catch (Exception e) {
esito.add("Errore durante l'invio: " + e.getMessage());
}

13
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()) {
_log.debug("Indicizzo la pratica "
+ (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.addKeyword("entryClassName", IntPratica.class.getName());
// Prendo l ultimo DettPratica legato a IntPratica
// Prendo l'ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaFromDB.getIntPraticaId());
if (Validator.isNull(lastDettPratica)) {
@ -252,9 +253,9 @@ public class IntPraticaIndexer extends BaseIndexer {
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
intPratica.getIntPraticaId(), 0, 1);
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "true");
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.TRUE);
} else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "false");
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.FALSE);
}
// Gestione pratica sospesa
document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa());
@ -262,7 +263,7 @@ public class IntPraticaIndexer extends BaseIndexer {
document.addKeyword(Field.USER_ID, intPraticaFromDB.getUserId());
// ALTRI PROGETTI
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>();
for (Soggetto soggetto : committenti) {
if (Validator.isNotNull(soggetto.getCognome())) {
@ -467,4 +468,4 @@ public class IntPraticaIndexer extends BaseIndexer {
return WorkflowUtil.isWorkflowDisattivabile(intPraticaId);
}
}
}

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.reindex(IntPratica.class.getName(), model.getIntPraticaId());
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
_log.debug("DocPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
}
} catch (SearchException 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.reindex(IntPratica.class.getName(), model.getIntPraticaId());
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
_log.debug("SoggettoModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
}
} catch (SearchException 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(
locale,
PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(),
intPratica.getIntPraticaId()))).append(StringPool.SEMICOLON);
intPratica.getTipoProcedura()))).append(StringPool.SEMICOLON);
if (Validator.isNotNull(provincia)) {
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]);
}
if (Validator.isNotNull(dataRichiestaFine)) {
String[] dataRichiestaFineSplitted = dataRichiestaFine.split("/");
String[] dataRichiestaFineSplitted = dataRichiestaFine.split(StringPool.FORWARD_SLASH);
actionResponse.setRenderParameter("dataRichiestaFineDay", dataRichiestaFineSplitted[0]);
int month = Integer.valueOf(dataRichiestaFineSplitted[1]) - 1;
actionResponse.setRenderParameter("dataRichiestaFineMonth", String.valueOf(month));
@ -257,7 +257,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale();
User user = themeDisplay.getUser();
String cmd = ParamUtil.getString(resourceRequest, "cmd");
String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);
String id = resourceRequest.getResourceID();
String csv = StringPool.BLANK;
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest);
@ -393,7 +393,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
User userTask = UserLocalServiceUtil.fetchUser(task.getAssigneeUserId());
taskName = LanguageUtil.get(getPortletConfig(), locale, task.getName());
if (userTask != null) {
taskName += " (" + userTask.getFullName() + ")";
taskName += " (" + userTask.getFullName() + StringPool.CLOSE_PARENTHESIS;
}
} else {
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;
import it.tref.liferay.portos.bo.shared.util.ParamUtil;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
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;
DynamicQuery query = DynamicQueryFactoryUtil.forClass(Tempistica.class);
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");
query.addOrder(defaultOrderDettPrtatica);
List<Tempistica> lista = TempisticaLocalServiceUtil.dynamicQuery(query);
@ -280,7 +280,7 @@ public class TempistichePortlet extends MVCPortlet {
if (avvisi.size() > 0 && avvisi.get(0).getDtAvviso() != null) {
sb.append(CSVUtil.encode(dateFormat.format(avvisi.get(0).getDtInvio())));
} else {
sb.append("-");
sb.append(StringPool.DASH);
}
sb.append(StringPool.SEMICOLON)
.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.AzioniPraticheUtil;
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.WorkflowConstants;
import it.tref.liferay.portos.bo.util.WorkflowUtil;
@ -606,11 +607,8 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
FormLog formLog = listaKaleoLog.get(0);
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters());
if (json.has("esito")) {
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) {
tipoEsito = StatoPraticaConstants.getEsitoDeposito(json.getString("esito"));
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) {
tipoEsito = StatoPraticaConstants.getEsitoAutorizzazione(json.getString("esito"));
}
tipoEsito = PraticaUtil.getStatoPratica(json.getString("esito"),
controlloPratica.getIntPraticaId());
}
}
}

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.log.Log;
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.service.persistence.impl.BasePersistenceImpl;
import com.liferay.util.dao.orm.CustomSQLUtil;
@ -90,7 +91,7 @@ public class IntPraticaFinderImpl extends BasePersistenceImpl<IntPratica> implem
qPos.add(dtMin);
qPos.add(dtMax);
qPos.add(groupId);
qPos.add(Validator.isNotNull(type) ? type : "%");
qPos.add(Validator.isNotNull(type) ? type : StringPool.PERCENT);
qPos.add(isControlloObbligatorio);
List<Long> list = query.list();
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.addEntity("intp", IntPraticaImpl.class);
QueryPos qPos = QueryPos.getInstance(query);
qPos.add(Validator.isNotNull(type) ? type : "%");
qPos.add(Validator.isNotNull(type) ? type : StringPool.PERCENT);
qPos.add(isControlloObbligatorio);
qPos.add(groupId);
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.Session;
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.Validator;
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-29 - Scadenziario / Creazione Filtri Ricerca
@SuppressWarnings("unchecked")
@Override
public List<Object[]> scadenzePratiche(long companyId, long groupId, int start, int end, Integer statoPratica,
String tipoPratica, String istruttore) {
@ -395,9 +397,9 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
: "1 OR 1=1"));
// ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca
sql = StringUtil.replace(sql, "[$DT_TIPOPRATICA$]",
Validator.isNull(tipoPratica) ? "%" : tipoPratica.toUpperCase());
Validator.isNull(tipoPratica) ? StringPool.PERCENT : tipoPratica.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_ISTRUTTORE$]",
Validator.isNull(istruttore) ? "%" : istruttore.toUpperCase());
Validator.isNull(istruttore) ? StringPool.PERCENT : istruttore.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_STATO$]",
Validator.isNull(statoPratica) ? "1 OR 1=1" : String.valueOf(statoPratica));
SQLQuery query = session.createSQLQuery(sql);
@ -421,6 +423,7 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
}
// ADT - BUG-14 - Scadenziario
@SuppressWarnings("unchecked")
@Override
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"));
// ADT - BUG-29 - Scadenziario / Creazione Filtri Ricerca
sql = StringUtil.replace(sql, "[$DT_TIPOPRATICA$]",
Validator.isNull(tipoPratica) ? "%" : tipoPratica.toUpperCase());
Validator.isNull(tipoPratica) ? StringPool.PERCENT : tipoPratica.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_ISTRUTTORE$]",
Validator.isNull(istruttore) ? "%" : istruttore.toUpperCase());
Validator.isNull(istruttore) ? StringPool.PERCENT : istruttore.toUpperCase());
sql = StringUtil.replace(sql, "[$DT_STATO$]",
Validator.isNull(statoPratica) ? "1 OR 1=1" : String.valueOf(statoPratica));
SQLQuery query = session.createSQLQuery(sql);
@ -531,6 +534,7 @@ public class TempisticaFinderImpl extends BasePersistenceImpl<Tempistica> implem
return count;
}
@SuppressWarnings("unchecked")
@Override
public List<Object[]> scadenzePraticheForBackwardCompatibility(long companyId, long groupId, int start, int end) {

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

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

@ -28,4 +28,4 @@ public class KaleoListenereStartupAction extends ModelListenerStartupAction {
KaleoLogModelListener.class.getName())
};
}
}
}

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

@ -16,4 +16,4 @@ public class Constants extends it.tref.liferay.portos.bo.shared.util.Constants {
"Codice NUTS3 2010", "Codice NUTS1 2006", "Codice NUTS2 2006 (3)", "Codice NUTS3 2006" };
public static final String[] AMMINISTRAZIONE_CSV_HEADERS_PROVINCE = { "codice_provincia", "provincia",
"regione", "sigla" };
}
}

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

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

@ -8,4 +8,4 @@ public class TempisticaConstants {
public static final int STATO_ATTIVA = 1;
public static final int STATO_IN_SCADENZA = 0;
public static final int STATO_SCADUTA = -1;
}
}

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

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

@ -1,41 +1,37 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%>
<%@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 dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
String formName = "fmAllegatoManuale";
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
long territorioGroupId = territorio.getGroupId();
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
String formName = "fmAllegatoManuale";
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
long territorioGroupId = territorio.getGroupId();
%>
<c:if test="<%= user.getUserId() == intPratica.getUserId() || IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<c:if test="<%= user.getUserId() == intPratica.getUserId() || IntPraticaPermission.contains(
permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<liferay-portlet:actionURL name="uploadAllegatoManuale" var="uploadAllegatoManualeURL">
<liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPraticaId) %>"/>
<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="intPraticaId" value="<%=String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="mvcPath" value="/html/allegati_manuali/edit_allegato_manuale.jsp" />
</liferay-portlet:actionURL>
<aui:form name="<%= formName %>" enctype="multipart/form-data" method="post" action="<%= uploadAllegatoManualeURL %>">
<div class="container-fluid">
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="col-sm-12">
<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="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<aui:input type="textarea" name="descrizione" label="Descrizione"></aui:input>
<div class="col-xs-12">
<aui:input type="textarea" name="descrizione" label="Descrizione" />
<aui:input type="file" name="docFile" label="File">
<aui:validator name="required" errorMessage="File Richiesto" />
</aui:input>
<aui:button-row>
<aui:button type="submit" value="upload-file" cssClass="btn btn-primary"/>
<aui:button type="submit" value="upload-file" cssClass="btn btn-primary" />
</aui:button-row>
</div>
</div>
@ -46,21 +42,17 @@
</div>
</div>
</aui:form>
<aui:script use="aui-base">
window.parent.Liferay.fire('allegati_manuali-open');
window.parent.Liferay.fire('allegati_manuali-open');
</aui:script>
</c:if>
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker,
territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<div class="container-fluid">
<div class="row">
<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>
</c:if>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/allegati_manuali/init.jsp

@ -1,2 +1,2 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/init.jsp" %>
<%@include file="/html/init.jsp"%>

161
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 import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@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.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%>
<%@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"%>
<%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
long territorioGroupId = territorio.getGroupId();
@ -20,26 +18,29 @@ long territorioGroupId = territorio.getGroupId();
<div class="container-fluid">
<div class="row">
<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="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="backURL" value="<%= currentURL %>"/>
<liferay-portlet:param name="backURL" value="<%= currentURL %>" />
</liferay-portlet:renderURL>
<div class="text-right">
<liferay-portlet:resourceURL var="downloadAllURL" id="downloadAll">
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
</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">
<span class="tooltip-info" title="Aggiungi 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>
<c:if test="<%= AllegatoManualeLocalServiceUtil.countByIntPratica(intPraticaId) > 0 %>">
<span class="tooltip-info" title="Download">
<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>
</c:if>
</liferay-ui:icon-menu>
@ -47,13 +48,15 @@ long territorioGroupId = territorio.getGroupId();
</div>
</div>
<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
results="<%= AllegatoManualeLocalServiceUtil.findByIntPratica(intPraticaId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null) %>"
total="<%=AllegatoManualeLocalServiceUtil.countByIntPratica(intPraticaId)%>">
total="<%= AllegatoManualeLocalServiceUtil.countByIntPratica(intPraticaId) %>">
</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;
if (Validator.isNotNull(allegatoManuale.getFileEntryId())) {
@ -64,63 +67,74 @@ long territorioGroupId = territorio.getGroupId();
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data"
value="<%= dateFormatDateTime.format(allegatoManuale.getCreateDate()) %>" />
<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:icon-menu icon="" showExpanded="false" showWhenSingleIcon="false">
<%
if (Validator.isNotNull(allegatoManuale.getFileEntryId())) {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(allegatoManuale.getFileEntryId());
%>
<liferay-portlet:renderURL var="previewURL" 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="redirect" value='<%= currentURL+"#_1_WAR_portosboportlet_tab=_1_WAR_portosboportlet_page_allegati_manuali" %>'/>
</liferay-portlet:renderURL>
<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"/>
</li>
<%
String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(), themeDisplay, "&download=true");
%>
<li title="Scarica" id="tooltip-info">
<liferay-ui:icon message="Download" id='<%=renderResponse.getNamespace()+"download_"+allegatoManuale.getAllegatoManualeId() %>' iconCssClass="fa fa-download" url="<%=downloadUrl%>"/>
</li>
<%
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId());
%>
<c:if test="<%= Validator.isNotNull(avviso) && Validator.isNotNull(avviso.getFileEntryIdInvio()) %>">
<li title="Elimina" id="tooltip-info">
<liferay-portlet:actionURL var="deleteUrl" name="deleteAllegatoManuale">
<liferay-portlet:param name="allegatoManualeId" value="<%=String.valueOf(allegatoManuale.getAllegatoManualeId())%>" />
</liferay-portlet:actionURL>
<liferay-ui:icon message="delete" id='<%= "delete_" + allegatoManuale.getAllegatoManualeId() %>'
iconCssClass="fa fa-trash" url="javascript:void(0)"/>
<liferay-portlet:renderURL var="previewURL"
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="redirect" value='<%= currentURL
+ "#_1_WAR_portosboportlet_tab=_1_WAR_portosboportlet_page_allegati_manuali" %>'
/>
</liferay-portlet:renderURL>
<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" />
</li>
<%
String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(),
themeDisplay, "&download=true");
%>
<li title="Scarica" id="tooltip-info">
<liferay-ui:icon message="Download" id='<%= renderResponse.getNamespace()
+ "download_" + allegatoManuale.getAllegatoManualeId() %>'
iconCssClass="fa fa-download" url="<%= downloadUrl %>" />
</li>
<%
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId());
%>
<c:if test="<%= Validator.isNotNull(avviso) && Validator.isNotNull(
avviso.getFileEntryIdInvio()) %>">
<li title="Elimina" id="tooltip-info">
<liferay-portlet:actionURL var="deleteUrl" name="deleteAllegatoManuale">
<liferay-portlet:param name="allegatoManualeId" value="<%= String.valueOf(
allegatoManuale.getAllegatoManualeId()) %>" />
</liferay-portlet:actionURL>
<liferay-ui:icon message="delete" id='<%= "delete_"
+ allegatoManuale.getAllegatoManualeId() %>'
iconCssClass="fa fa-trash" url="javascript:void(0)" />
<aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"delete_"+allegatoManuale.getAllegatoManualeId() %>').on(
'click',
function(event) {
event.preventDefault();
A.io.request(
'<%=deleteUrl%>',
{
on: {
failure: function() {
alert('impossibile rimuovere il documento!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('allegati_manuali-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
}
}
A.one('<%= "#" + renderResponse.getNamespace() + "delete_"
+ allegatoManuale.getAllegatoManualeId() %>').on(
'click',
function(event) {
event.preventDefault();
A.io.request('<%= deleteUrl %>', {
on: {
failure: function() {
alert('impossibile rimuovere il documento!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('allegati_manuali-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
}
);
}
);
}
});
}
);
</aui:script>
</li>
</c:if>
<%
}
}
%>
</liferay-ui:icon-menu>
</liferay-ui:search-container-column-text>
@ -133,29 +147,24 @@ long territorioGroupId = territorio.getGroupId();
Liferay.fire('allegati_manuali-ready');
</aui:script>
<script>
YUI().use(
'aui-tooltip',
function(Y) {
new Y.TooltipDelegate({
trigger: '.tooltip-info',
position: 'top',
cssClass: 'tooltip-help',
html: true,
opacity: 1
});
}
);
YUI().use('aui-tooltip', function(Y) {
new Y.TooltipDelegate({
trigger: '.tooltip-info',
position: 'top',
cssClass: 'tooltip-help',
html: true,
opacity: 1,
});
});
</script>
</c:if>
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker, territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<c:if test="<%= user.getUserId() != intPratica.getUserId() && !IntPraticaPermission.contains(permissionChecker,
territorioGroupId, ActionKeys.AVVISI_MANUALI) %>">
<div class="container-fluid">
<div class="row">
<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>
</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);
WindowState windowState = renderRequest.getWindowState();
PortletMode portletMode = renderRequest.getPortletMode();
String currentURL = PortalUtil.getCurrentURL(liferayPortletRequest);
%>

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

@ -1,13 +1,11 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %>
<%
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;
if(comune == null) {
if(comuneId > 0) {
if (comune == null) {
if (comuneId > 0) {
comune = ComuneLocalServiceUtil.getComune(comuneId);
title = comune.getDenominazione();
} else {
@ -17,14 +15,12 @@ if(comune == null) {
} else {
title = comune.getDenominazione();
}
String codiceProvinciaValue = StringPool.BLANK;
if(Validator.isNotNull(comune.getCodiceProvincia())) {
if (Validator.isNotNull(comune.getCodiceProvincia())) {
Provincia item = ProvinciaLocalServiceUtil.findByC_C(company.getCompanyId(), comune.getCodiceProvincia());
codiceProvinciaValue = HtmlUtil.escape(item.getProvincia());
}
%>
<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="<%= CodiceIstatException.class %>" message="please-enter-a-valid-codice-istat" />
@ -33,40 +29,27 @@ if(Validator.isNotNull(comune.getCodiceProvincia())) {
<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="<%= NoSuchComuneException.class %>" message="please-select-a-comune" />
<liferay-portlet:renderURL var="redirect">
<liferay-portlet:param name="tabs1" value="comuni" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" />
</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" />
<aui:form action="<%=saveComuneURL %>" method="post" name="fm">
<aui:model-context bean="<%=comune %>" model="<%=Comune.class %>" />
<aui:form action="<%= saveComuneURL %>" method="post" name="fm">
<aui:model-context bean="<%= comune %>" model="<%= Comune.class %>" />
<aui:input name="comuneId" type="hidden" />
<aui:input name="codiceComune" type="hidden" />
<aui:field-wrapper label="codice-comune">
<%=comune.getCodiceComune() %>
<%= comune.getCodiceComune() %>
</aui:field-wrapper>
<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:icon
cssClass="modify-link"
iconCssClass="icon-search"
id="selectProvinciaLink"
label="true"
linkCssClass="btn"
message="select"
method="get"
url="javascript:;"
/>
<liferay-ui:icon cssClass="modify-link" iconCssClass="icon-search" id="selectProvinciaLink" label="true"
linkCssClass="btn" message="select" method="get" url="javascript:;" />
</aui:field-wrapper>
<aui:input name="codiceIstat" />
<aui:input name="codiceBelfiore" disabled="<%=comuneId!=0 %>" />
<aui:input name="codiceBelfiore" disabled="<%= comuneId != 0 %>" />
<aui:input name="denominazione" />
<aui:input name="provincia" />
<aui:input name="mailSuap" />
@ -75,9 +58,8 @@ if(Validator.isNotNull(comune.getCodiceProvincia())) {
<aui:button type="submit" value="save" />
</aui:button-row>
</aui:form>
<liferay-portlet:renderURL var="selectProvinciaURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="eventName" value='<%=renderResponse.getNamespace()+"selectProvincia" %>' />
<liferay-portlet:renderURL var="selectProvinciaURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="eventName" value='<%= renderResponse.getNamespace()+"selectProvincia" %>' />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/province/select_provincia.jsp" />
</liferay-portlet:renderURL>
<aui:script use="aui-base">
@ -90,7 +72,7 @@ A.one('#<portlet:namespace />selectProvinciaLink').on('click', function(event) {
},
id: '<portlet:namespace />selectProvincia',
title: '<liferay-ui:message arguments="provincia" key="select-x" />',
uri: '<%=selectProvinciaURL %>'
uri: '<%= selectProvinciaURL %>'
},
function(event) {
A.one('#<portlet:namespace />codiceProvincia').val(event.codiceprovincia);

18
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 --%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %>
<liferay-ui:error exception="<%= CSVFileNotFoundException.class %>" message="csv-file-not-found" />
<liferay-portlet:renderURL var="backURL">
<liferay-portlet:param name="tabs1" value="comuni" />
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/view.jsp" />
</liferay-portlet:renderURL>
<liferay-ui:header title="import-comunes" backURL="<%=backURL %>" />
<div class="portlet-msg-info">
<liferay-ui:message
arguments="<%=new String[] { StringUtil.merge(Constants.AMMINISTRAZIONE_CSV_HEADERS_COMUNI, StringPool.COMMA_AND_SPACE) } %>"
key="csv-file-headers-format-must-be-x"
translateArguments="false" />
arguments="<%= new String[] { StringUtil.merge(Constants.AMMINISTRAZIONE_CSV_HEADERS_COMUNI,
StringPool.COMMA_AND_SPACE) } %>"
key="csv-file-headers-format-must-be-x" translateArguments="false" />
</div>
<liferay-portlet:actionURL name="importComunes" var="importComunesURL" />
<aui:form action="<%=importComunesURL %>" enctype="multipart/form-data" method="post">
<aui:input name="redirect" type="hidden" value="<%=backURL %>" />
<aui:form action="<%= importComunesURL %>" enctype="multipart/form-data" method="post">
<aui:input name="redirect" type="hidden" value="<%= backURL %>" />
<aui:input name="file" type="file">
<aui:validator name="required" />
<aui:validator name="acceptFiles">'csv'</aui:validator>
</aui:input>
<aui:select name="delimiter">
<aui:option label="comma" value="," />
<aui:option label="semi-colon" value=";" />
<aui:option label="colon" value=":" />
</aui:select>
<aui:button-row>
<aui:button type="submit" value="import" />
</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"%>
<%@ include file="/html/amministrazione/init.jsp" %>
<%
SearchContainer<Comune> searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer");
DisplayTerms displayTerms = (DisplayTerms) searchContainer.getDisplayTerms();
%>
<liferay-ui:search-toggle
autoFocus="<%=windowState.equals(WindowState.MAXIMIZED) %>"
buttonLabel="search" displayTerms="<%=displayTerms %>"
id="toggle_id_comune_search" />
<liferay-ui:search-toggle 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 --%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/amministrazione/init.jsp" %>
<%
String eventName = ParamUtil.getString(request, "eventName", liferayPortletResponse.getNamespace() + "selectComune");
%>
<aui:form name="selectEntryFm">
<liferay-ui:header title="comuni" />
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found">
<liferay-ui:search-container-results
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-column-text name="codiceProvincia" />
<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" />
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container>
</aui:form>
<aui:script use="aui-base">
var Util = Liferay.Util;
A.one('#<portlet:namespace />selectEntryFm').delegate(
'click',
function(event) {
var result = Util.getAttributes(event.currentTarget, 'data-');
Util.getOpener().Liferay.fire('<%= HtmlUtil.escapeJS(eventName) %>', result);
Util.getWindow().hide();
},
'.selector-button'
'.selector-button',
);
</aui:script>

73
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"%>
<%@ include file="/html/amministrazione/init.jsp" %>
<%
String orderByCol = ParamUtil.getString(renderRequest, SearchContainer.DEFAULT_ORDER_BY_COL_PARAM, "denominazione");
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);
%>
<liferay-portlet:actionURL name="creaFileStaris" var="creaFileStarisURL" />
<liferay-portlet:renderURL varImpl="searchURL">
<liferay-portlet:param name="tabs1" value="comuni" />
<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:renderURL>
<aui:nav-item href="<%=addURL %>" iconCssClass="icon-plus" label="add-comune" />
<liferay-portlet:renderURL var="importURL">
<liferay-portlet:param name="mvcPath" value="/html/amministrazione/tabs/comuni/import.jsp" />
</liferay-portlet:renderURL>
<aui:nav-item href="<%= importURL %>" iconCssClass="icon-upload" label="import-comunes" />
</aui:nav>
<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>
<% String taglibOnClick = renderResponse.getNamespace() + "deleteComunes()"; %>
<aui:button disabled="true" name="deleteAll" onClick="<%=taglibOnClick %>" value="delete" />
<%
String taglibOnClick = renderResponse.getNamespace() + "deleteComunes()";
%>
<aui:button disabled="true" name="deleteAll" onClick="<%= taglibOnClick %>" value="delete" />
<aui:input name="deleteComuneIds" type="hidden" />
<liferay-ui:search-container-results>
<%
if(Validator.isNull(displayTerms.getKeywords())) {
results = ComuneLocalServiceUtil.findByCompanyId(company.getCompanyId(), searchContainer.getStart(), searchContainer.getEnd(), orderByComparator);
if (Validator.isNull(displayTerms.getKeywords())) {
results = ComuneLocalServiceUtil.findByCompanyId(company.getCompanyId(), searchContainer.getStart(),
searchContainer.getEnd(), orderByComparator);
total = ComuneLocalServiceUtil.countByCompanyId(company.getCompanyId());
} 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());
}
pageContext.setAttribute("results", results);
pageContext.setAttribute("total", total);
%>
</liferay-ui:search-container-results>
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Comune" keyProperty="comuneId" modelVar="comune">
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Comune" keyProperty="comuneId"
modelVar="comune">
<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:renderURL>
<liferay-ui:search-container-column-text href="<%=editURL %>" name="codice-provincia" orderable="true" 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-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="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 %>" 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 %>" name="codice-provincia" orderable="true"
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-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="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 %>"
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-row>
<liferay-ui:search-iterator paginate="true" />
</liferay-ui:search-container>
</aui:form>
<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(
window,
'<portlet:namespace />deleteComunes',
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.<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" />");
}
},

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

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

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

@ -195,8 +195,8 @@ long templateFolderId = ConfigurazioneServiceUtil.findByC_ChiaveLong(companyId,
}
%>
<aui:option value="<%= fd.getFolderId() %>" selected="<%= fd.getFolderId() == currentFolderId %>">
<%= parentFolderName.equals(StringPool.BLANK) ? fd.getName()
: parentFolderName + StringPool.MINUS + fd.getName()%>
<%= parentFolderName.equals(StringPool.BLANK) ? fd.getName()
: parentFolderName + StringPool.MINUS + fd.getName() %>
</aui:option>
<%
}

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"%>
<%@ include file="/html/amministrazione/init.jsp" %>
<%
String currentTab = ParamUtil.getString(request, "tabs1", "territori");
%>
<liferay-portlet:renderURL var="changeTabURL" />
<liferay-ui:tabs
names="territori,province,comuni,parametri"
url="<%= changeTabURL %>"
/>
<liferay-util:include
page='<%= "/html/amministrazione/tabs/"+currentTab+"/view.jsp" %>'
servletContext="<%= application %>"
/>
<liferay-ui:tabs names="territori,province,comuni,parametri" url="<%= changeTabURL %>" />
<liferay-util:include page='<%= "/html/amministrazione/tabs/" + currentTab + "/view.jsp" %>'
servletContext="<%= application %>" />

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

@ -1,61 +1,45 @@
<%@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 buttonId = ParamUtil.getString(request, "buttonId","sumbit-button");
String width = ParamUtil.getString(request, "width","700");
String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv");
String function = ParamUtil.getString(request, "function");
String randomId = StringUtil.randomId();
String titolo = ParamUtil.getString(request, "titolo", "Dettaglio");
String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button");
String width = ParamUtil.getString(request, "width", "700");
String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv");
String function = ParamUtil.getString(request, "function");
String randomId = StringUtil.randomId();
%>
<div id='<%=renderResponse.getNamespace()+"confirmModal_"+randomId %>' class="confirmModal text-center"></div>
<aui:script >
AUI().ready(
'aui-modal',
function(A) {
var modal = new A.Modal(
{
bodyContent: A.one('#<portlet:namespace /><%=contentDiv%>'),
width:<%=width%>,
<%
if(!height.equalsIgnoreCase(StringPool.BLANK)){
%>
height:<%=height%>,
<%
}
%>
centered: true,
destroyOnHide: false,
headerContent: '<h3 class="modal_title"><%=titolo%></h3>',
modal: true,
render: '#<portlet:namespace />confirmModal_<%=randomId%>',
visible: false,
toolbars: {
header: []
},
resizable: {
handles: ''
}
}).render();
<div id='<%= renderResponse.getNamespace() + "confirmModal_" + randomId %>' class="confirmModal text-center"></div>
<aui:script >
AUI().ready('aui-modal', function(A) {
var modal = new A.Modal({
bodyContent: A.one('#<portlet:namespace /><%= contentDiv %>'),
width:<%= width %>,
<%
if (!height.equals(StringPool.BLANK)) {
%>
height:<%=height%>,
<%
}
%>
centered: true,
destroyOnHide: false,
headerContent: '<h3 class="modal_title"><%= titolo %></h3>',
modal: true,
render: '#<portlet:namespace />confirmModal_<%= randomId %>',
visible: false,
toolbars: {
header: []
},
resizable: {
handles: ''
}
}).render();
A.one('#<portlet:namespace /><%= buttonId %>').on(
'click',
function() {
<%= function %>
A.one('#<portlet:namespace /><%=contentDiv%>').show();
modal.show();
}
);
}
);
</aui:script>
A.one('#<portlet:namespace /><%= buttonId %>').on('click', function() {
<%= function %>
A.one('#<portlet:namespace /><%= contentDiv %>').show();
modal.show();
});
});
</aui:script>

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

@ -1,66 +1,50 @@
<%@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 buttonId = ParamUtil.getString(request, "buttonId","sumbit-button");
String width = ParamUtil.getString(request, "width","700");
String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv","");
String randomId = StringUtil.randomId();
String titolo = ParamUtil.getString(request, "titolo", "Dettaglio");
String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button");
String width = ParamUtil.getString(request, "width", "700");
String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv", StringPool.BLANK);
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().ready('aui-modal', function(A) {
var modal = new A.Modal({
bodyContent: A.one('#<portlet:namespace /><%= contentDiv %>'),
width:<%= width %>,
<%
if (!height.equals(StringPool.BLANK)) {
%>
height: <%= height %>,
<%
}
%>
centered: true,
destroyOnHide: false,
headerContent: '<h3 class="modal_title"><%= titolo %></h3>',
modal: true,
render: '#<portlet:namespace />confirmModal_<%= randomId %>',
visible: false,
close: true,
resizable: {
handles: ''
}
}).render();
<aui:script >
AUI().ready(
'aui-modal',
function(A) {
var modal = new A.Modal(
{
bodyContent: A.one('#<portlet:namespace /><%=contentDiv%>'),
width:<%=width%>,
<%
if(!height.equalsIgnoreCase(StringPool.BLANK)){
%>
height:<%=height%>,
<%
}
%>
centered: true,
destroyOnHide: false,
headerContent: '<h3 class="modal_title"><%=titolo%></h3>',
modal: true,
render: '#<portlet:namespace />confirmModal_<%=randomId%>',
visible: false,
close: true,
resizable: {
handles: ''
}
}).render();
modal.addToolbar(
[
{
label: 'Chiudi',
on: {
click: function() {
modal.hide();
}
}
}
]
);
modal.addToolbar([{
label: 'Chiudi',
on: {
click: function() {
modal.hide();
}
}
}]);
A.one('#<portlet:namespace /><%= buttonId %>').on(
'click',
function() {
A.one('#<portlet:namespace /><%=contentDiv%>').show();
modal.show();
}
);
}
);
</aui:script>
A.one('#<portlet:namespace /><%= buttonId %>').on('click', function() {
A.one('#<portlet:namespace /><%= contentDiv %>').show();
modal.show();
});
});
</aui:script>

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

@ -1,149 +1,133 @@
<%@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 titolo = ParamUtil.getString(request, "titolo","Invio");
String buttonId = ParamUtil.getString(request, "buttonId","sumbit-button");
String buttonConferma = ParamUtil.getString(request, "buttonConferma","Crea");
String buttonAnnulla = ParamUtil.getString(request, "buttonAnnulla","Annulla");
String width = ParamUtil.getString(request, "width","700");
String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv","saveAndCloseDiv");
boolean buttonBar = ParamUtil.getBoolean(request, "buttonBar",true);
String randomId = StringUtil.randomId();
String onClick = ParamUtil.getString(request, "onClick");
boolean externalForm = ParamUtil.getBoolean(request, "externalForm",false);
boolean okVisible = ParamUtil.getBoolean(request, "okVisible", true);
String formName = ParamUtil.getString(request, "formName", "fm");
String titolo = ParamUtil.getString(request, "titolo", "Invio");
String buttonId = ParamUtil.getString(request, "buttonId", "sumbit-button");
String buttonConferma = ParamUtil.getString(request, "buttonConferma", "Crea");
String buttonAnnulla = ParamUtil.getString(request, "buttonAnnulla", "Annulla");
String width = ParamUtil.getString(request, "width", "700");
String height = ParamUtil.getString(request, "height");
String contentDiv = ParamUtil.getString(request, "contentDiv", "saveAndCloseDiv");
boolean buttonBar = ParamUtil.getBoolean(request, "buttonBar", true);
String randomId = StringUtil.randomId();
String onClick = ParamUtil.getString(request, "onClick");
boolean externalForm = ParamUtil.getBoolean(request, "externalForm", false);
boolean okVisible = ParamUtil.getBoolean(request, "okVisible", true);
%>
<aui:input name='<%="confirmClose_"+randomId%>' type="hidden" value="false" />
<div id='<%=renderResponse.getNamespace()+"saveAndCloseModal_"+randomId %>' class="confirmModal">
</div>
<aui:input name='<%= "confirmClose_" + randomId %>' type="hidden" value="false" />
<div id='<%=renderResponse.getNamespace() + "saveAndCloseModal_" + randomId %>' class="confirmModal"></div>
<div class='customAlert'>
<p class='message'></p>
<p class='message'></p>
<input type='button' class='confirmButton' value='CHIUDI'>
</div>
<liferay-portlet:resourceURL var="resourceURL" id="controllaExtraInfo" copyCurrentRenderParameters="false" />
<aui:script >
AUI().ready('aui-modal', 'aui-io-request', 'aui-form-validator', function(A) {
var modal = new A.Modal({
bodyContent: A.one('#<portlet:namespace /><%=contentDiv%>'),
width: <%= width %>,
<%
if (!height.equals(StringPool.BLANK)) {
%>
height: <%= height %>,
<%
}
%>
centered: true,
destroyOnHide: false,
headerContent: '<h3 class="text-center"><%= titolo %></h3>',
modal: true,
render: '#<portlet:namespace />saveAndCloseModal_<%= randomId %>',
visible: false,
close: false,
}).render();
<%
if (buttonBar) {
%>
modal.addToolbar(
[
{
label: '<%= buttonAnnulla %>',
on: {
click: function() {
modal.hide();
}
}
},
<%
if (okVisible) {
%>
{
label: '<%= buttonConferma %>',
on: {
click: function() {
<%
if (Validator.isNotNull(onClick)) {
out.print(onClick);
} else {
%>
submitForm(document.<portlet:namespace /><%= formName %>);
var formValidator = Liferay.Form.get('<portlet:namespace /><%= formName %>')
.formValidator;
<%
if (externalForm) {
%>
if (!formValidator.hasErrors()) {
A.one('#<portlet:namespace />confirmClose_<%= randomId %>')
.set('value', 'true');
} else {
alert("Attenzione!\nCampi richiesti non compilati correttamente");
}
modal.hide();
<%
} else {
%>
if (!formValidator.hasErrors()) {
modal.hide();
A.one('#<portlet:namespace />confirmClose_<%= randomId %>')
.set('value', 'true');
}
<%
}
%>
<%
}
%>
}
}
}
<%
}
%>
]
);
<%
}
%>
A.one('#<portlet:namespace /><%= buttonId %>').on('click', function() {
A.one('#<portlet:namespace /><%=contentDiv%>').show();
modal.show();
});
<liferay-portlet:resourceURL var="resourceURL" id="controllaExtraInfo" copyCurrentRenderParameters="false" >
</liferay-portlet:resourceURL>
<aui:script >
AUI().ready(
'aui-modal','aui-io-request','aui-form-validator',
function(A) {
var modal = new A.Modal(
{
bodyContent: A.one('#<portlet:namespace /><%=contentDiv%>'),
width:<%=width%>,
<%
if(!height.equalsIgnoreCase(StringPool.BLANK)){
%>
height:<%=height%>,
<%
}
%>
centered: true,
destroyOnHide: false,
headerContent: '<h3 class="text-center"><%=titolo%></h3>',
modal: true,
render: '#<portlet:namespace />saveAndCloseModal_<%=randomId%>',
visible: false,
close: false
}
).render();
<%
if(buttonBar){
%>
modal.addToolbar(
[
{
label: '<%= buttonAnnulla %>',
on: {
click: function() {
modal.hide();
}
}
}
<% if(okVisible){ %>
,
{
label: '<%=buttonConferma%>',
on: {
click: function() {
<% if(Validator.isNotNull(onClick)){
out.print(onClick);
} else {
%>
submitForm(document.<portlet:namespace /><%= formName %>);
var formValidator = Liferay.Form.get('<portlet:namespace /><%= formName %>').formValidator;
<%
if(externalForm){
%>
if (!formValidator.hasErrors()) {
A.one('#<portlet:namespace />confirmClose_<%=randomId%>').set('value','true');
}else{
alert("Attenzione!\nCampi richiesti non compilati correttamente");
}
modal.hide();
<%
} else {
%>
if (!formValidator.hasErrors()) {
modal.hide();
A.one('#<portlet:namespace />confirmClose_<%=randomId%>').set('value','true');
}
<%
}
}
%>
}
}
}
<% } %>
]
);
<%
}
%>
window.alert = function(msg) {
$('.message').text(msg);
$('.customAlert').css('animation', 'fadeIn 0.3s linear');
$('.customAlert').css('display', 'inline');
setTimeout(function() {
$('.customAlert').css('animation', 'none');
}, 100);
};
A.one('#<portlet:namespace /><%= buttonId %>').on(
'click',
function() {
<%-- console.log('<portlet:namespace /><%=contentDiv%>') --%>
A.one('#<portlet:namespace /><%=contentDiv%>').show();
modal.show();
}
);
window.alert = function(msg){
$('.message').text(msg);
$('.customAlert').css('animation', 'fadeIn 0.3s linear');
$('.customAlert').css('display', 'inline');
setTimeout(function(){
$('.customAlert').css('animation', 'none');
}, 100);
};
$(function(){
$('.confirmButton').click(function(){
$('.customAlert').css('animation', 'fadeOut 0.3s linear');
setTimeout(function(){
$('.customAlert').css('animation', 'none');
$('.customAlert').css('display', 'none');
}, 100);
});
});
});
</aui:script>
$(function(){
$('.confirmButton').click(function(){
$('.customAlert').css('animation', 'fadeOut 0.3s linear');
setTimeout(function(){
$('.customAlert').css('animation', 'none');
$('.customAlert').css('display', 'none');
}, 100);
});
});
});
</aui:script>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/cronologia/init.jsp

@ -1,2 +1,2 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/init.jsp" %>
<%@include file="/html/init.jsp"%>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/cronologia/view.jsp

@ -440,7 +440,7 @@ List<HistoryWorkflowAction> historyWorkflowActions = HistoryWorkflowActionLocalS
</div>
</div>
</c:if>
<aui:script use="aui-base, aui-modal">
<aui:script use="aui-base,aui-modal">
Liferay.provide(window, 'reSort', function(id) {
var fragment = location.hash,
returnURL = "<%= currentURL %>" + fragment;

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

@ -199,7 +199,7 @@ String provinciaJS = ParamUtil.getString(request, "provinciaJS");
</div>
</liferay-ui:panel>
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
<aui:script use="aui-base, aui-io-request">
<aui:script use="aui-base,aui-io-request">
var getComuni = function(provinciaId, comuneId, comuneValue) {
var comuneSelect = A.one("#"+comuneId);
if (provinciaId == "" || provinciaId == "000") {

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-4 col-md-4">
<strong><%=LanguageUtil.get(pageContext,
PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getIntPraticaId()))%></strong>
PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getTipoProcedura()))%></strong>
</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 import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="com.liferay.portal.kernel.log.LogFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.log.Log"%>
<%@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="ordinaTipo" value="<%=ordinaTipo %>"/>
<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>
@ -282,7 +283,7 @@ String keywords = StringPool.BLANK;
</liferay-ui:search-container-column-text>
<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">
<%

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

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

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

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

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

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

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

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

116
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 import="com.liferay.portal.kernel.search.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%>
<%@ include file="/html/gestioneattivita/init.jsp" %>
<%
boolean doSearch = true;
PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
//GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", 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 committente = ParamUtil.getString(request, "committente", 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 ufficio = ParamUtil.getString(request, "ufficio", 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 tipoAttivita = ParamUtil.getString(request, "tipoAttivita", StringPool.BLANK);
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura", StringPool.BLANK);
iteratorURL.setParameter("numeroProgetto", numeroProgetto);
iteratorURL.setParameter("protocollo", protocollo);
iteratorURL.setParameter("tipoPratica", tipoPratica);
iteratorURL.setParameter("statoPratica", statoPratica);
iteratorURL.setParameter("committente", committente);
iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessi);
//ADT ADT BUG BO ID = 8
iteratorURL.setParameter("istruttore", istruttore);
iteratorURL.setParameter("dataRichiestaInizio", dataRichiestaInizio);
iteratorURL.setParameter("dataRichiestaFine", dataRichiestaFine);
@ -41,90 +36,63 @@ iteratorURL.setParameter("tipoAttivita", tipoAttivita);
iteratorURL.setParameter("tipoProcedura", tipoProcedura);
iteratorURL.setParameter("ordinaPer", ordinaPer);
iteratorURL.setParameter("ordinaTipo", ordinaTipo);
iteratorURL.setParameter("tabs1", tabs1);
String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String keywords = StringPool.BLANK;
request.setAttribute("tabs1", "Tab_AtriTask");
%>
<!-- Funzione per esportare la ricerca -->
<liferay-portlet:resourceURL id="exportRicercaAltreAttivita" var="exportRicercaAltreAttivitaURL">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/>
<liferay-portlet:param name="dataRichiestaFine" value="<%=dataRichiestaFine %>"/>
<liferay-portlet:param name="numeroProgetto" value="<%=numeroProgetto %>"/>
<liferay-portlet:param name="protocollo" value="<%=protocollo %>"/>
<liferay-portlet:param name="tipoPratica" value="<%=tipoPratica %>"/>
<liferay-portlet:param name="statoPratica" value="<%=statoPratica %>"/>
<liferay-portlet:param name="committente" value="<%=committente %>"/>
<liferay-portlet:param name="soggettiInterconnessi" value="<%=soggettiInterconnessi %>"/>
<!-- ADT BUG BO ID = 8 -->
<liferay-portlet:param name="istruttore" value="<%=istruttore %>"/>
<liferay-portlet:param name="ufficio" value="<%=ufficio %>"/>
<liferay-portlet:param name="comune" value="<%=comuneSearch %>"/>
<liferay-portlet:param name="tipoAttivita" value="<%=tipoAttivita %>"/>
<liferay-portlet:param name="tipoProcedura" value="<%=tipoProcedura %>"/>
<liferay-portlet:param name="ordinaPer" value="<%=ordinaPer %>"/>
<liferay-portlet:param name="ordinaTipo" value="<%=ordinaTipo %>"/>
<liferay-portlet:param name="searchForExport" value="true"/>
<liferay-portlet:param name="cmd" value="exportRicercaAltreAttivita"/>
<liferay-portlet:param name="dataRichiestaInizio" value="<%= dataRichiestaInizio %>" />
<liferay-portlet:param name="dataRichiestaFine" value="<%= dataRichiestaFine %>" />
<liferay-portlet:param name="numeroProgetto" value="<%= numeroProgetto %>" />
<liferay-portlet:param name="protocollo" value="<%= protocollo %>" />
<liferay-portlet:param name="tipoPratica" value="<%= tipoPratica %>" />
<liferay-portlet:param name="statoPratica" value="<%= statoPratica %>" />
<liferay-portlet:param name="committente" value="<%= committente %>" />
<liferay-portlet:param name="soggettiInterconnessi" value="<%= soggettiInterconnessi %>" />
<liferay-portlet:param name="istruttore" value="<%= istruttore %>" />
<liferay-portlet:param name="ufficio" value="<%= ufficio %>" />
<liferay-portlet:param name="comune" value="<%= comuneSearch %>" />
<liferay-portlet:param name="tipoAttivita" value="<%= tipoAttivita %>" />
<liferay-portlet:param name="tipoProcedura" value="<%= tipoProcedura %>" />
<liferay-portlet:param name="ordinaPer" value="<%= ordinaPer %>" />
<liferay-portlet:param name="ordinaTipo" value="<%= ordinaTipo %>" />
<liferay-portlet:param name="searchForExport" value="true" />
<liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicercaAltreAttivita" />
</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="span2">
<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>
</div>
</div>
<liferay-ui:search-container
emptyResultsMessage="no-entries-were-found"
iteratorURL="<%= iteratorURL %>"
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"
>
<%
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
Hits hits = ControlloPraticaAdvancedSearch.searchAltriTask(request, user, searchContainer.getStart(), searchContainer.getEnd());
for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
ControlloPratica controlloPratica =
ControlloPraticaLocalServiceUtil.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" iteratorURL="<%= iteratorURL %>"
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
<%
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
Hits hits = ControlloPraticaAdvancedSearch.searchAltriTask(request, user, searchContainer.getStart(),
searchContainer.getEnd());
for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(
GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
listaControlloPratica.add(controlloPratica);
}
}
}
searchContainer.setTotal(hits.getLength());
}
}
}
searchContainer.setTotal(hits.getLength());
%>
<liferay-ui:search-container-results
results="<%=listaControlloPratica%>"
/>
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.ControlloPratica"
modelVar="controlloPratica"
>
<%@ include file="/html/gestioneattivita/view_columns.jspf" %>
<liferay-ui:search-container-results results="<%=listaControlloPratica%>" />
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.ControlloPratica"
modelVar="controlloPratica">
<%@include file="/html/gestioneattivita/view_columns.jspf"%>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= true %>" />
<liferay-ui:search-iterator paginate="true" />
</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.Hits"%>
<%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%>
<%@ 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="ordinaTipo" value="<%=ordinaTipo %>"/>
<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>
<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 import="com.liferay.portal.kernel.search.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%>
<%@ 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="ordinaTipo" value="<%=ordinaTipo %>"/>
<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>
<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.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%>
<%@ include file="/html/gestioneattivita/init.jsp" %>
<%
boolean doSearch = true;
PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
//GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", 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 committente = ParamUtil.getString(request, "committente", 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 ufficio = ParamUtil.getString(request, "ufficio", 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 tipoAttivita = ParamUtil.getString(request, "tipoAttivita", StringPool.BLANK);
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura", StringPool.BLANK);
iteratorURL.setParameter("numeroProgetto", numeroProgetto);
iteratorURL.setParameter("protocollo", protocollo);
iteratorURL.setParameter("tipoPratica", tipoPratica);
iteratorURL.setParameter("statoPratica", statoPratica);
iteratorURL.setParameter("committente", committente);
iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessi);
//ADT ADT BUG BO ID = 8
iteratorURL.setParameter("istruttore", istruttore);
iteratorURL.setParameter("dataRichiestaInizio", dataRichiestaInizio);
iteratorURL.setParameter("dataRichiestaFine", dataRichiestaFine);
@ -43,19 +38,12 @@ iteratorURL.setParameter("tipoAttivita", tipoAttivita);
iteratorURL.setParameter("tipoProcedura", tipoProcedura);
iteratorURL.setParameter("ordinaPer", ordinaPer);
iteratorURL.setParameter("ordinaTipo", ordinaTipo);
iteratorURL.setParameter("tabs1", tabs1);
String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String keywords = StringPool.BLANK;
request.setAttribute("tabs1", "Tab_TaskMieiRuoli");
%>
<!-- Funzione per esportare la ricerca -->
<liferay-portlet:resourceURL id="exportRicercaMieiRuoli" var="exportRicercaMieiRuoliURL">
<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="committente" value="<%=committente %>"/>
<liferay-portlet:param name="soggettiInterconnessi" value="<%=soggettiInterconnessi %>"/>
<!-- ADT BUG BO ID = 8 -->
<liferay-portlet:param name="istruttore" value="<%=istruttore %>"/>
<liferay-portlet:param name="ufficio" value="<%=ufficio %>"/>
<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="ordinaTipo" value="<%=ordinaTipo %>"/>
<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>
<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 import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@ include file="/html/gestioneattivita/init.jsp" %>
<liferay-portlet:actionURL varImpl="search2URL" name="search2URL" />
@ -21,13 +22,13 @@ search2URL.setParameter("tabs1", tabs1);
<liferay-portlet:resourceURL id="exportCSVDirigente" var="exportCSVDirigente">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/>
<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 id="exportCSVPO" var="exportCSVPO">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/>
<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>
<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;
if (workflowInstanceLink != null) {
long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId();
workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), workflowInstanceId);
workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(),
workflowInstanceId);
listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null,
workflowInstance.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
}

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

@ -12,13 +12,11 @@
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="java.util.ArrayList"%>
<%@page import="javax.portlet.PortletRequest"%>
<%@ include file="/html/gestioneattivita/init.jsp"%>
<%@include file="/html/gestioneattivita/init.jsp"%>
<%
SearchContainer searchContainer = (SearchContainer) request.getAttribute("liferay-ui:search:searchContainer");
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
IntPratica intPratica = (IntPratica) row.getObject();
List<ControlloPratica> controlliPratica = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
ControlloPratica controlloPratica = null;
if (controlliPratica.size() > 0 ) {
@ -26,7 +24,6 @@ if (controlliPratica.size() > 0 ) {
}
Group controlPanelGroup = GroupLocalServiceUtil.getGroup(company.getCompanyId(), GroupConstants.CONTROL_PANEL);
long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(),true);
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(),
controlloPratica.getPrimaryKey());
@ -67,7 +64,7 @@ YUI().use(
position: 'top',
cssClass: 'tooltip-help',
html: true,
opacity: 1
opacity: 1,
});
}
);

3
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"%>
<%@ include file="/html/init.jsp" %>
<%@include file="/html/init.jsp"%>
<%@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 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 name="Committenti">

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/paesaggistica_administration/init.jsp

@ -1,2 +1,2 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/init.jsp" %>
<%@include file="/html/init.jsp"%>

72
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 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"%>
<%
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");
%>
<%@include file="/html/paesaggistica_administration/init.jsp"%>
<hr style="margin: 0" />
<liferay-portlet:actionURL name="reIndexFasciolo" var="reIndexFascioloURL" />
<liferay-portlet:actionURL name="reIndexFasciolo" var="reIndexFascicoloURL" />
<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" />
<div class="row-fluid" style="margin-top: 10px">
<div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Form per reindicizzare un
fascicolo</div>
<aui:form action="<%=reIndexFascioloURL%>" method="post" name="fmReIndexFasciolo">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px">Form per reindicizzare un fascicolo</div>
<aui:form action="<%= reIndexFascicoloURL %>" method="post" name="fmReIndexFasciolo">
<div>
<aui:input name="intPraticaId" label="IntPraticaId">
<aui:validator name="number" />
@ -38,16 +19,15 @@ String dataProssimoSorteggio =
<aui:button type="submit" value="Reindicizza Fascicolo" />
</div>
</aui:form>
<aui:form action="<%=reIndexFascicoliURL%>" method="post" name="fmReindexFascicoli">
<aui:form action="<%= reIndexFascicoliURL %>" method="post" name="fmReindexFascicoli">
<div>
<aui:button cssClass="btn-danger" type="submit" value="Reindicizza tutti i fascicoli" />
</div>
</aui:form>
</div>
<div class="span6">
<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>
<aui:button cssClass="btn-danger" type="submit" value="Mostra configurazione" />
</div>
@ -55,10 +35,10 @@ String dataProssimoSorteggio =
</div>
</div>
<hr style="margin: 0" />
<div class="row-fluid" style="margin-top: 10px;">
<div class="row-fluid" style="margin-top: 10px">
<div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Manutenzione database</div>
<aui:form action="<%=manutenzioneDatabaseURL%>" method="post" name="fmMD">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px">Manutenzione database</div>
<aui:form action="<%= manutenzioneDatabaseURL %>" method="post" name="fmMD">
<div>
<aui:input name="mode" label="Modalità" />
<aui:button cssClass="btn-danger" type="submit" value="Avvia manutenzione" />
@ -68,33 +48,13 @@ String dataProssimoSorteggio =
<div class="span6">
</div>
</div>
<% String[] esito = renderRequest.getParameterValues("esito"); %>
<c:if test="<%=(null != esito) && (esito.length > 0)%>">
<c:if test="<%= (null != esito) && (esito.length > 0) %>">
<h2>Risultato</h2>
<%
for (String riga : esito) {
%>
<%=riga%><br>
<%
}
for (String riga : esito) {
out.print(riga);
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.SessionErrors;
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.DateFormatFactoryUtil;
import com.liferay.portal.kernel.util.FileUtil;
@ -666,7 +667,7 @@ public class FascicoloFePortlet extends MVCPortlet {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest);
long dettPraticaId = ParamUtil.getLong(actionRequest, "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");
if (bozza) {
saveDatiDettPratica(dettPraticaId, actionRequest, actionResponse);
@ -692,7 +693,7 @@ public class FascicoloFePortlet extends MVCPortlet {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest);
long dettPraticaId = ParamUtil.getLong(actionRequest, "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");
if (bozza) {
saveDatiTipoPratica(dettPraticaId, actionRequest, actionResponse);
@ -904,7 +905,7 @@ public class FascicoloFePortlet extends MVCPortlet {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest);
DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId);
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");
boolean disabledSubmit = ParamUtil.getBoolean(actionRequest, "disabledSubmit", 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.service.ComuneLocalServiceUtil;
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.ProvinciaLocalServiceUtil;
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 {
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
// 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
// NON è OBBLIGATORIA; inoltre la firma OBBLIGATORIA che deve essere presente sul file
// allegato è SOLO quella del TITOLARE DIGITALE DELLA PRATICA.
// NON è OBBLIGATORIA; inoltre la firma OBBLIGATORIA che deve essere presente sul file allegato è SOLO
// quella del TITOLARE DIGITALE DELLA PRATICA.
if (TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto())) {
String[] titolare = new String[] { dettPratica.getCodiceFiscaleDelegatoCommittente() };
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

10
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"%>
<%@ include file="/html/init.jsp" %>
<%@include file="/html/init.jsp"%>
<%
boolean isElencoProgetti = GetterUtil.getBoolean(portletPreferences.getValue("isElencoProgetti", "true"));
boolean isArchivio = GetterUtil.getBoolean(portletPreferences.getValue("isArchivio", "true"));
boolean onlyMieiProgetti = GetterUtil.getBoolean(portletPreferences.getValue("onlyMieiProgetti", "true"));
String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", ""));
String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", ""));
String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", StringPool.BLANK));
String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", StringPool.BLANK));
%>

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 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="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.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="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.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.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.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"%>
<%@include file="/html/soggettipratica/init.jsp"%>
<%
@ -302,7 +297,8 @@ if ("page_geologica".equals(comingFrom)) {
<%
String adding = StringPool.BLANK;
if (FineLavori.class.getName().equalsIgnoreCase(className)) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk());
FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(
docPratica.getClassPk());
if (fineLavori != null) {
adding = fineLavori.getFullDescription();
}
@ -312,7 +308,8 @@ if ("page_geologica".equals(comingFrom)) {
adding = collaudo.getFullDescription();
}
} else {
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk());
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(
docPratica.getClassPk());
if (dettPratica != null) {
adding = dettPratica.getFullDescription();
}
@ -344,9 +341,12 @@ if ("page_geologica".equals(comingFrom)) {
} else {
if (dett.getTipoIntegrazione().equals(
TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) {
sbProvenienza.append("Ric Integrazione # " + dett.getIntegrazione());
} else if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)) {
sbProvenienza.append("Variante # " + dett.getVarianteNumero());
sbProvenienza.append("Ric Integrazione # ")
.append(dett.getIntegrazione());
} else if (dett.getTipoIntegrazione().equals(
TipoIntegrazioneUtil.VARIANTE)) {
sbProvenienza.append("Variante # ")
.append(dett.getVarianteNumero());
}
}
}
@ -356,7 +356,8 @@ if ("page_geologica".equals(comingFrom)) {
</span>
</div>
</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" %>'>
<span class='<%= "fa " + cssIcon + " asseverazioni-icon tooltip-info " + cssColor %>'
title="<%= title %>">
@ -392,18 +393,24 @@ if ("page_geologica".equals(comingFrom)) {
<liferay-util:param name="className" value="<%= className %>" />
<liferay-util:param name="docPraticaId" value="<%= String.valueOf(docPratica
.getDocPraticaId()) %>" />
<liferay-util:param name="disabledInput" value="<%= String.valueOf(disabledInput) %>" />
<liferay-util:param name="disabledInput"
value="<%= String.valueOf(disabledInput) %>" />
</liferay-util:include>
</c:if>
</c:if>
<c:if test="<%= inBO %>">
<liferay-portlet:renderURL var="previewURL"
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: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='<%="download_"+docPratica.getDocPraticaId() %>' linkCssClass="btn btn-action" iconCssClass="fa fa-download" message="Download" url="<%=docPratica.getDownloadUrl(themeDisplay)%>"/>
<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='<%= "download_" + docPratica.getDocPraticaId() %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-download"
message="Download" url="<%= docPratica.getDownloadUrl(themeDisplay) %>" />
</c:if>
</div>
</div>

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

@ -1,293 +1,259 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalService"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@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.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.FineLavoriServiceUtil"%>
<%@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.DettPraticaLocalServiceUtil"%>
<%@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.DettPraticaServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.FirmeUtil"%>
<%@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.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeBean"%>
<%@page import="it.tref.liferay.portos.bo.shared.bean.FirmeDetail"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%>
<%@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.shared.util.FirmeUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@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",
GetterUtil.getString(
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");
String className = ParamUtil.getString(request, "className");
long intPraticaId= 0l;
if(FineLavori.class.getName().equalsIgnoreCase(className)){
FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk);
intPraticaId = fineLavori.getIntPraticaId();
} else if(Collaudo.class.getName().equalsIgnoreCase(className)){
Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk);
intPraticaId = collaudo.getIntPraticaId();
}else{
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk);
intPraticaId = dettPratica.getIntPraticaId();
}
String tipoAllegati = ParamUtil.getString(request,"tipoAllegati","allegati");
boolean fullVersion = ParamUtil.getBoolean(request,"full", false);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
String comingFrom = ParamUtil.getString(request, "comingFrom", GetterUtil.getString(
PortalUtil.getOriginalServletRequest(request).getParameter("page_allegati"), "page_allegati"));
long classPk = ParamUtil.getLong(request, "classPk");
String className = ParamUtil.getString(request, "className");
long intPraticaId = 0L;
if (FineLavori.class.getName().equalsIgnoreCase(className)) {
FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk);
intPraticaId = fineLavori.getIntPraticaId();
} else if (Collaudo.class.getName().equalsIgnoreCase(className)) {
Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk);
intPraticaId = collaudo.getIntPraticaId();
} else {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk);
intPraticaId = dettPratica.getIntPraticaId();
}
String tipoAllegati = ParamUtil.getString(request, "tipoAllegati", "allegati");
boolean fullVersion = ParamUtil.getBoolean(request, "full", false);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
String type = StringPool.BLANK;
List<String> tipologiaAllegati ;
if ("allegati_geologici".equals(tipoAllegati)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo();
type = "ag";
} else if ("allegati_fine_lavori".equals(tipoAllegati)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori();
type = "afl";
} else if ("allegati_collaudo".equals(tipoAllegati)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo();
type = "acl";
} else {
tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda();
//BUG BO ID=9 (ANNULLA ISTANZA)
tipologiaAllegati.add(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO);
type = "ad";
}
%>
<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="classPk" value="<%= String.valueOf(classPk) %>" />
<liferay-portlet:param name="comingFrom" value="<%= comingFrom %>" />
<liferay-portlet:param name="type" value="<%= type %>" />
</liferay-portlet:resourceURL>
<div class="container_btn_all_allegati padding_bottom">
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true" cssClass="inline_toolbar">
<span class="tooltip-info" title="Download Allegati">
<aui:button id='<%= renderResponse.getNamespace() + "download_all" %>' icon="fa fa-download"
cssClass="btn btn-primary btn-action" href="<%= downloadAllURLs %>" />
</span>
</liferay-ui:icon-menu>
</div>
<%
String type = StringPool.BLANK;
List<String> tipologiaAllegati ;
if("allegati_geologici".equals(tipoAllegati)){
tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo();
type="ag";
}else if("allegati_fine_lavori".equals(tipoAllegati)){
tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori();
type="afl";
}else if("allegati_collaudo".equals(tipoAllegati)){
tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo();
type="acl";
}
else{
tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda();
//BUG BO ID=9 (ANNULLA ISTANZA)
tipologiaAllegati.add(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO);
type="ad";
for (String codiceDoc:tipologiaAllegati) {
List<DocPratica> docPraticas;
if (fullVersion) {
docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, codiceDoc,
QueryUtil.ALL_POS, QueryUtil.ALL_POS);
} else {
docPraticas = DocPraticaServiceUtil.getValidUntilClassPkByIntPratica(intPraticaId, classPk, codiceDoc,
QueryUtil.ALL_POS, QueryUtil.ALL_POS);
}
%>
<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="classPk" value="<%= String.valueOf(classPk) %>" />
<liferay-portlet:param name="comingFrom" value="<%= comingFrom %>" />
<liferay-portlet:param name="type" value="<%= type %>" />
</liferay-portlet:resourceURL>
<div class="container_btn_all_allegati padding_bottom">
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" >
<span class="tooltip-info" title="Download Allegati">
<aui:button id='<%=renderResponse.getNamespace()+"download_all"%>'
icon="fa fa-download" cssClass="btn btn-primary btn-action"
href="<%= downloadAllURLs %>"
/>
</span>
</liferay-ui:icon-menu>
</div>
<%
for(String codiceDoc:tipologiaAllegati){
List<DocPratica> docPraticas;
if(fullVersion){
/* docPraticas = DocPraticaServiceUtil.findByIntPratica_Tipologia(dettPratica.getIntPraticaId(),codiceDoc,QueryUtil.ALL_POS,QueryUtil.ALL_POS, null); */
docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPraticaId,classPk, codiceDoc,QueryUtil.ALL_POS,QueryUtil.ALL_POS);
} else {
docPraticas = DocPraticaServiceUtil.getValidUntilClassPkByIntPratica(intPraticaId, classPk, codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
}
%>
<div class="panel-group allegato-group">
<div class="panel panel-default">
<div class="panel-heading">
<a class="collapse_a" data-toggle="collapse" href="#collapse-<%=codiceDoc%>_<%= type %>">
<h4 class="panel-title allegato-group__title">
<liferay-ui:message key='<%="label-documenti-tipologia-"+codiceDoc %>'/>
</h4>
<span class='num_allegati <%= docPraticas.size()>0 ? "green" : "red" %>'><%=docPraticas.size()%></span>
</a>
</div>
<div id="collapse-<%=codiceDoc%>_<%= type %>" class="panel-collapse collapse lfr-search-container">
<%
if(!docPraticas.isEmpty()){
%>
<table class="table table-striped allegati-tipologia-table" id="<portlet:namespace/>allegati-table-<%= codiceDoc %>">
<thead class="table-columns allegato-group__head">
<tr>
<th class="text-center">STATO</th>
<th>ALLEGATO</th>
<th class="text-center">FIRME</th>
<%-- <% if(!comingFrom.equals("page_va_allegati") && !comingFrom.equals("page_in_allegati") ) { %> --%>
<div class="panel panel-default">
<div class="panel-heading">
<a class="collapse_a" data-toggle="collapse" href="#collapse-<%= codiceDoc %>_<%= type %>">
<h4 class="panel-title allegato-group__title">
<liferay-ui:message key='<%= "label-documenti-tipologia-" + codiceDoc %>' />
</h4>
<span class='num_allegati <%= docPraticas.size()>0 ? "green" : "red" %>'>
<%= docPraticas.size() %>
</span>
</a>
</div>
<div id="collapse-<%= codiceDoc %>_<%= type %>" class="panel-collapse collapse lfr-search-container">
<%
if (!docPraticas.isEmpty()) {
%>
<table class="table table-striped allegati-tipologia-table"
id="<portlet:namespace/>allegati-table-<%= codiceDoc %>">
<thead class="table-columns allegato-group__head">
<tr>
<th class="text-center">STATO</th>
<th>ALLEGATO</th>
<th class="text-center">FIRME</th>
<th>AGGIUNTO DA</th>
<th>INVALIDATO DA</th>
<%-- <% } %> --%>
<th class="text-center">AZIONI</th>
</tr>
</thead>
<tbody class="allegato-group__body">
<%
for(DocPratica docPratica:docPraticas){
long docPraticaId = docPratica.getDocPraticaId();
%>
<tr>
<td class="text-center">
<span class='fa fa-circle <%= Validator.isNull(docPratica.getDtDataRimozione()) ? "txt-green" : "txt-red" %>'></span>
</td>
<td>
<%= docPratica.getFileName() %>
</td>
<td class="text-center">
<%
FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari());
StringBuilder title = new StringBuilder();
if(firme.numeroFirme()>0){
if(!firme.getFirmeDigitali().isEmpty()){
title.append("Firma sul file:<ul>");
for(FirmeDetail firma: firme.getFirmeDigitali()){
title.append("<li>"+firma.getCfFirmatario());
if(Validator.isNotNull(firma.getDtFirma())){
title.append(" del "+dateFormatDate.format(firma.getDtFirma()));
}
title.append("</li>");
}
title.append("</ul>");
}
if(!firme.getFirmeApplicativo().isEmpty()){
title.append("Firme da applicativo:<ul>");
for(FirmeDetail firma: firme.getFirmeApplicativo()){
title.append("<li>"+firma.getCfFirmatario());
if(Validator.isNotNull(firma.getDtFirma())){
title.append(" del "+dateFormatDate.format(firma.getDtFirma()));
}
title.append("</li>");
}
title.append("</ul>");
}
}
if(firme.numeroFirme()>0){
%>
<span class="fa fa-check icon-asseverazioni tooltip-info" title="<%=title.toString() %>" style="color:green">
<sub style="font-weight: bold"><%=firme.numeroFirme() %></sub>
</span>
<%
}else{
%>
<span class="fa fa-close icon-asseverazioni tooltip-info" title="Non ci sono firme sul file" style="color:red"></span>
<%
}
<th class="text-center">AZIONI</th>
</tr>
</thead>
<tbody class="allegato-group__body">
<%
for (DocPratica docPratica:docPraticas) {
long docPraticaId = docPratica.getDocPraticaId();
%>
</td>
<%-- <% if(!comingFrom.equals("page_va_allegati") && !comingFrom.equals("page_in_allegati") ) { %> --%>
<td>
<%
String description = StringPool.BLANK;
if(DettPratica.class.getName().equalsIgnoreCase(docPratica.getClassName())){
DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk());
if(adding!=null){
description = adding.getFullDescription() ;
}
}else if(FineLavori.class.getName().equalsIgnoreCase(docPratica.getClassName())){
FineLavori adding = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk());
if(adding!=null){
description = adding.getFullDescription() ;
}
}else if(Collaudo.class.getName().equalsIgnoreCase(docPratica.getClassName())){
Collaudo adding = CollaudoLocalServiceUtil.fetchCollaudo(docPratica.getClassPk());
if(adding!=null){
description = adding.getFullDescription() ;
}
}
out.print(description);
%>
</td>
<td>
<%
DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getDettPraticaIdRimozione());
if(removing != null){
%>
<%= removing.getFullDescription() %>
<%
}
%>
</td>
<%-- <%
}
%> --%>
<td class="text-center action-col">
<c:choose>
<c:when test="<%= Validator.isNotNull(docPratica.getDlFileEntryId()) %>">
<liferay-portlet:renderURL var="previewURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<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-ui:icon id='<%="open_"+docPraticaId %>' linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" 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:otherwise>
<liferay-util:include page="/html/common/import_window.jsp" servletContext="<%= application %>" 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:include>
</c:otherwise>
</c:choose>
</td>
</tr>
<%
}
%>
</tbody>
</table>
<%
<tr>
<td class="text-center">
<span class='fa fa-circle <%= Validator.isNull(docPratica.
getDtDataRimozione()) ? "txt-green" : "txt-red" %>'></span>
</td>
<td>
<%= docPratica.getFileName() %>
</td>
<td class="text-center">
<%
FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari());
StringBuilder title = new StringBuilder();
if (firme.numeroFirme() > 0) {
if (!firme.getFirmeDigitali().isEmpty()) {
title.append("Firma sul file:<ul>");
for (FirmeDetail firma : firme.getFirmeDigitali()) {
title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) {
title.append(" del ")
.append(dateFormatDate.format(firma.getDtFirma()));
}
title.append("</li>");
}
title.append("</ul>");
}
if (!firme.getFirmeApplicativo().isEmpty()) {
title.append("Firme da applicativo:<ul>");
for(FirmeDetail firma : firme.getFirmeApplicativo()) {
title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) {
title.append(" del ")
.append(dateFormatDate.format(firma.getDtFirma()));
}
title.append("</li>");
}
title.append("</ul>");
}
}
if (firme.numeroFirme() > 0) {
%>
<span class="fa fa-check icon-asseverazioni tooltip-info"
title="<%= title.toString() %>" style="color:green">
<sub style="font-weight: bold"><%= firme.numeroFirme() %></sub>
</span>
<%
} else {
%>
<span class="fa fa-close icon-asseverazioni tooltip-info"
title="Non ci sono firme sul file" style="color:red"></span>
<%
}
%>
</td>
<td>
<%
String description = StringPool.BLANK;
if (DettPratica.class.getName().equalsIgnoreCase(docPratica.getClassName())) {
DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(
docPratica.getClassPk());
if (adding != null) {
description = adding.getFullDescription();
}
} else if (FineLavori.class.getName().equalsIgnoreCase(docPratica.getClassName())) {
FineLavori adding = FineLavoriLocalServiceUtil.fetchFineLavori(
docPratica.getClassPk());
if (adding != null) {
description = adding.getFullDescription();
}
} else if (Collaudo.class.getName().equalsIgnoreCase(docPratica.getClassName())) {
Collaudo adding = CollaudoLocalServiceUtil.fetchCollaudo(docPratica.getClassPk());
if (adding != null) {
description = adding.getFullDescription();
}
}
out.print(description);
%>
</td>
<td>
<%
DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(
docPratica.getDettPraticaIdRimozione());
if (removing != null) {
out.print(removing.getFullDescription());
}
%>
</td>
<td class="text-center action-col">
<c:choose>
<c:when test="<%= Validator.isNotNull(docPratica.getDlFileEntryId()) %>">
<liferay-portlet:renderURL var="previewURL"
windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<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-ui:icon id='<%= "open_" + docPraticaId %>'
linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard"
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:otherwise>
<liferay-util:include page="/html/common/import_window.jsp"
servletContext="<%= application %>"
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:include>
</c:otherwise>
</c:choose>
</td>
</tr>
<%
}
%>
</tbody>
</table>
<%
}
%>
%>
</div>
</div>
</div>
<%
}
}
%>
<script type="text/javascript">
YUI().use(
'aui-tooltip',
function(Y) {
new Y.TooltipDelegate(
{
trigger: '.allegati-tipologia-table .tooltip-info',
position: 'top',
cssClass: 'tooltip-help',
html: true,
opacity: 1
}
);
}
);
YUI().use('aui-tooltip', function(Y) {
new Y.TooltipDelegate({
trigger: '.allegati-tipologia-table .tooltip-info',
position: 'top',
cssClass: 'tooltip-help',
html: true,
opacity: 1,
});
});
</script>

31
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"%>
<%@ include file="/html/fascicolofe/init.jsp"%>
<%@include file="/html/fascicolofe/init.jsp"%>
<liferay-portlet:actionURL portletConfiguration="true" var="configurationURL" />
<aui:form action="<%=configurationURL%>" method="post" name="fm">
<aui:input name="<%=Constants.CMD%>" type="hidden" value="<%=Constants.UPDATE%>" />
<aui:select name="preferences--tipoVisualizzazione--" type="select" value="<%=tipoVisualizzazione%>" >
<aui:option value="isProgetti" label="Progetti" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isProgetti") %>' ></aui:option>
<aui:option value="isAltriProgetti" label="Altri Progetti" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isAltriProgetti") %>'></aui:option>
<aui:option value="isDeleghe" label="Deleghe" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isDeleghe") %>'></aui:option>
<aui:option value="isArchivioProgetti" label="Archivio Progetti" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isArchivioProgetti") %>'></aui:option>
<aui:option value="isArchivioDeleghe" label="Archivio Deleghe" selected='<%=tipoVisualizzazione.equalsIgnoreCase("isArchivioDeleghe") %>'></aui:option>
<aui:form action="<%= configurationURL %>" method="post" name="fm">
<aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= Constants.UPDATE %>" />
<aui:select name="preferences--tipoVisualizzazione--" type="select" value="<%= tipoVisualizzazione %>">
<aui:option value="isProgetti" label="Progetti"
selected='<%= tipoVisualizzazione.equalsIgnoreCase("isProgetti") %>' />
<aui:option value="isAltriProgetti" label="Altri Progetti"
selected='<%= tipoVisualizzazione.equalsIgnoreCase("isAltriProgetti") %>' />
<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:input name="preferences--helpTitle--" type="text" value="<%=helpTitle%>" />
<aui:input name="preferences--helpMessage--" type="text" value="<%=helpMessage%>" />
<aui:input name="preferences--helpTitle--" type="text" value="<%= helpTitle %>" />
<aui:input name="preferences--helpMessage--" type="text" value="<%= helpMessage %>" />
<aui:button-row>
<aui:button type="submit" />
</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.util.KeyValuePair"%>
<%@page import="java.util.ArrayList"%>
<%@page import="it.tref.liferay.portos.fe.search.AdvancedSearch"%>
<%@page import="java.io.Serializable"%>
<%@page import="javax.portlet.PortletURL"%>
<%@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 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="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="javax.portlet.PortletResponse"%>
@ -48,7 +50,7 @@
"}" +
"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="" />
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" >

75
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 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 orderByCol = ParamUtil.getString(request, "orderByCol");
PortletURL iteratorURL = (PortletURL)request.getAttribute("iteratorURL");
String rowUrl = StringPool.BLANK;
String orderByType = ParamUtil.getString(request, "orderByType");
String orderByCol = ParamUtil.getString(request, "orderByCol");
PortletURL iteratorURL = (PortletURL) request.getAttribute("iteratorURL");
String rowUrl = StringPool.BLANK;
%>
<liferay-ui:search-container
emptyResultsMessage="no-entries-were-found"
iteratorURL="<%= iteratorURL %>"
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"
>
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" iteratorURL="<%= iteratorURL %>"
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
<%
List<IntPratica> listaIntPratica = (List<IntPratica>)request.getAttribute("results");
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"
>
<%
long delegaId = 0l;
%>
<%@ include file="/html/fascicolofe/view_fascicolo_columns_generic.jspf" %>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= true %>" />
List<IntPratica> listaIntPratica = (List<IntPratica>) request.getAttribute("results");
searchContainer.setTotal((Integer) request.getAttribute("count"));
%>
<liferay-ui:search-container-results results="<%=listaIntPratica%>" />
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.IntPratica" modelVar="intPratica">
<%
long delegaId = 0L;
%>
<%@ include file="/html/fascicolofe/view_fascicolo_columns_generic.jspf" %>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="true" />
</liferay-ui:search-container>

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

@ -1,309 +1,316 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica" %>
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%>
<%@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.dao.orm.QueryUtil"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@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.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.shared.util.Constants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@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.ComuneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil"%>
<%@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.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%>
<%@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.service.TerritorioLocalServiceUtil"%>
<%@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.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="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%>
<%@page import="java.util.Arrays"%>
<%@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 %>">
<liferay-portlet:renderURL var="viewURL" >
<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="backURL" value="<%= iteratorURL.toString() %>" />
</liferay-portlet:renderURL>
<c:if test="<%= intPratica.getStatus() != WorkflowConstants.STATUS_ANY || isAltriProgetti %>">
<liferay-portlet:renderURL var="viewURL" >
<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="backURL" value="<%= iteratorURL.toString() %>" />
</liferay-portlet:renderURL>
<%
rowUrl = viewURL;
rowUrl = viewURL;
%>
</c:if>
<c:if test="<%=intPratica.getStatus()==WorkflowConstants.STATUS_ANY && !isAltriProgetti%>">
</c:if>
<c:if test="<%= intPratica.getStatus() == WorkflowConstants.STATUS_ANY && !isAltriProgetti %>">
<portlet:renderURL var="editURL">
<portlet:param name="mvcPath" value="/html/fascicolofe/edit_fascicolo.jsp" />
<portlet:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId())%>" />
<portlet:param name="backURL" value="<%=iteratorURL.toString()%>" />
<portlet:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId())%>" />
<portlet:param name="backURL" value="<%= iteratorURL.toString()%>" />
</portlet:renderURL>
<%
rowUrl = editURL;
rowUrl = editURL;
%>
</c:if>
<c:if test="<%=intPratica.getStatus()==WorkflowConstants.STATUS_ANY && isDeleghe%>">
</c:if>
<c:if test="<%= intPratica.getStatus() == WorkflowConstants.STATUS_ANY && isDeleghe %>">
<portlet:renderURL var="delegaEditURL">
<portlet:param name="mvcPath" value="/html/fascicolofe/edit_fascicolo.jsp" />
<portlet:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId())%>" />
<portlet:param name="delegaId" value="<%=String.valueOf(delegaId)%>" />
<portlet:param name="backURL" value="<%=iteratorURL.toString()%>" />
<portlet:param name="intPraticaId" value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<portlet:param name="delegaId" value="<%= String.valueOf(delegaId) %>" />
<portlet:param name="backURL" value="<%= iteratorURL.toString() %>" />
</portlet:renderURL>
<%
rowUrl = delegaEditURL;
rowUrl = delegaEditURL;
%>
</c:if>
<%
DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastEditableByIntPratica(intPratica.getIntPraticaId());
if(lastDettPratica==null){
lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId());
</c:if>
<%
DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastEditableByIntPratica(intPratica.getIntPraticaId());
if (lastDettPratica == null) {
lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId());
}
%>
<liferay-ui:search-container-column-text name="#" cssClass="text-center middle-aligned">
<div class="flex-center">
<c:if test="<%= intPratica.isSospesa() %>">
<span class="btn status-icon tooltip-info btn-action" title="Sospesa">
<span class="fa fa-circle txt-orange"></span>
</span>
</c:if>
<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">
SP
</span>
</c:if>
<c:if test="<%= StatoPraticaConstants.INTEGRAZIONE.equalsIgnoreCase(intPratica.getStatoPratica()) %>">
<span class="tooltip-info display-inline-block" title="Richiesta Integrazione" style="padding:0">
<i class="fa fa-exclamation-circle txt-orange" style="font-size:33px"></i>
</span>
</c:if>
</div>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="n-progetto" href="<%= rowUrl %>" cssClass="text-nowrap middle-aligned">
<%= intPratica.getTitle(locale, false) %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="committente" href="<%=rowUrl %>" cssClass="middle-aligned">
<%
StringBuilder builder = new StringBuilder();
List<Soggetto> committenti = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(
lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
for (Soggetto committente : committenti) {
if (builder.length() > 0) {
builder.append(StringPool.COMMA).append("<br>");
}
builder.append(committente.getDescrizioneCompleta());
}
out.print(builder.toString());
%>
<liferay-ui:search-container-column-text name="#" cssClass="text-center middle-aligned">
<div class="flex-center">
<c:if test="<%= intPratica.isSospesa() %>">
<span class="btn status-icon tooltip-info btn-action" title="Sospesa">
<span class="fa fa-circle txt-orange"></span>
</span>
</c:if>
<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;">
SP
</span>
</c:if>
<c:if test="<%= StatoPraticaConstants.INTEGRAZIONE.equalsIgnoreCase(intPratica.getStatoPratica()) %>">
<span class="tooltip-info display-inline-block" title="Richiesta Integrazione" style="padding:0">
<i class="fa fa-exclamation-circle txt-orange" style="font-size:33px"></i>
</span>
</c:if>
</div>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="n-progetto" href="<%=rowUrl %>" cssClass="text-nowrap middle-aligned">
<%= intPratica.getTitle(locale,false) %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="committente" href="<%=rowUrl %>" cssClass="middle-aligned">
<%
StringBuilder builder = new StringBuilder();
List<Soggetto> committenti = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
for(Soggetto committente : committenti){
builder.append(committente.getDescrizioneCompleta())
.append(StringPool.COMMA_AND_SPACE).append("<br>");
}
if(builder.length()>0)
builder.setLength(builder.length()-6);
out.print(builder.toString());
%>
</liferay-ui:search-container-column-text>
<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>
<span class="text-center display-block" style="margin-top:5px">
<c:if test="<%= !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(lastDettPratica.getTipoIntegrazione())%>">
<%
int delegheCount = DelegaLocalServiceUtil.countByDettPratica(lastDettPratica.getDettPraticaId());
%>
<c:if test="<%= delegheCount > 0 %>">
<c:if test="<%= DelegheUtil.hasDelegheCompilazioneAttive(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Deleghe in corso">
<i class="fa fa-hand-o-right relative">
<i class="fa fa-hover fa-cog fa-top-right txt-orange"></i>
</i>
</span>
</c:if>
<c:if test="<%= !DelegheUtil.hasDelegheCompilazioneAttive(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Nessuna delega attiva">
<i class="fa fa-hand-o-right relative">
<i class="fa fa-hover fa-check fa-top-right txt-green"></i>
</i>
</span>
</c:if>
</c:if>
<c:if test="<%= AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>">
<c:if test="<%= AsseverazioniUtil.allAsseverazioniCompleted(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Asseverazioni completate">
<i class="fa fa-pencil-square relative">
<i class="fa fa-hover fa-check fa-top-right txt-green"></i>
</i>
</span>
</c:if>
<c:if test="<%= !AsseverazioniUtil.allAsseverazioniCompleted(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Asseverazioni in corso">
<i class="fa fa-pencil-square relative">
<i class="fa fa-hover fa-cog fa-top-right txt-orange"></i>
</i>
</span>
</c:if>
</c:if>
<c:if test="<%= !AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>">
<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-hover fa-close fa-top-right txt-red"></i>
</i>
</span>
</c:if>
<c:if test="<%= ( !lastDettPratica.getNormEsenteSpese() || !lastDettPratica.getNormEsenteBollo() ) && !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(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">
<i class="fa fa-eur relative">
<i class="fa fa-hover fa-close fa-top-right txt-red"></i>
</i>
</span>
</c:if>
<c:if test="<%= Validator.isNotNull(lastDettPratica.getPagamentoIdOneri()) || Validator.isNotNull(lastDettPratica.getPagamentoIdBolli())%>">
<span class="btn status-icon tooltip-info btn-action" title="Pagamento in corso">
<i class="fa fa-eur relative">
<i class="fa fa-hover fa-cog fa-top-right txt-orange"></i>
</i>
</span>
</c:if>
</c:if>
<%
int variantiCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.VARIANTE));
int integrazioniCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE));
%>
<c:if test="<%= variantiCount > 0 %>">
<span class="btn status-icon tooltip-info btn-action" title="Varianti Presentate">
<span class="relative txt-bold status-icon-text">
V
<span class="sup top-right txt-bold"><%= variantiCount %></span>
</span>
</liferay-ui:search-container-column-text>
<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.getTipoProcedura())) %></strong>
<span class="text-center display-block" style="margin-top: 5px">
<c:if test="<%= !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(
lastDettPratica.getTipoIntegrazione()) %>">
<%
int delegheCount = DelegaLocalServiceUtil.countByDettPratica(lastDettPratica.getDettPraticaId());
%>
<c:if test="<%= delegheCount > 0 %>">
<c:if test="<%= DelegheUtil.hasDelegheCompilazioneAttive(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Deleghe in corso">
<i class="fa fa-hand-o-right relative">
<i class="fa fa-hover fa-cog fa-top-right txt-orange"></i>
</i>
</span>
</c:if>
<c:if test="<%= integrazioniCount > 0 %>">
<span class="btn status-icon tooltip-info btn-action txt-bold" title="Integrazioni Presentate">
<span class="relative txt-bold status-icon-text">
I
<span class="sup top-right txt-bold"><%= integrazioniCount %></span>
</span>
<c:if test="<%= !DelegheUtil.hasDelegheCompilazioneAttive(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Nessuna delega attiva">
<i class="fa fa-hand-o-right relative">
<i class="fa fa-hover fa-check fa-top-right txt-green"></i>
</i>
</span>
</c:if>
</c:if>
<%
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, OrderByComparatorFactoryUtil.create("portos_bo_Avviso", "createDate", false));
StringBuilder sb = new StringBuilder();
if(!avvisi.isEmpty()){
sb.append("<ul class='avvisi-tooltip'>");
for(Avviso avviso : avvisi){
String tipoDocumento = avviso.translateTipoDocumento();
String testoEvento =LanguageUtil.get(pageContext, tipoDocumento);
sb.append("<li class='avviso-tooltip'>"+testoEvento+"</li>");
}
sb.append("</ul>");
%>
<liferay-portlet:renderURL var="fascicoloAvvisiURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp" />
<liferay-portlet:param name="backURL" value="<%= currentURL %>" />
<liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPratica.getIntPraticaId())%>" />
<liferay-portlet:param name="toolbarItem" value="view-storico" />
</liferay-portlet:renderURL>
<a class="btn status-icon tooltip-info btn-action" title="<%= HtmlUtil.escapeAttribute(sb.toString()) %>"
href="<%= fascicoloAvvisiURL.toString() %>">
<i class="fa fa-envelope relative">
<span class="fa-hover fa-top-right txt-bold"><%= avvisi.size() %></span>
</i>
</a>
<%
}
%>
</span>
<span class="text-center display-block" style="margin-top:5px">
<c:if test="<%= intPratica.isFineLavoriParziale() || intPratica.isFineLavoriTotale() %>">
<c:if test="<%= !intPratica.isFineLavoriTotale()%>">
<span class="btn status-icon tooltip-info btn-action" title="Fine Lavori Parziale presente">
<i class="fa fa-gavel relative">
<span class="fa-hover fa-top-right txt-orange txt-bold">P</span>
<c:if test="<%= AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>">
<c:if test="<%= AsseverazioniUtil.allAsseverazioniCompleted(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Asseverazioni completate">
<i class="fa fa-pencil-square relative">
<i class="fa fa-hover fa-check fa-top-right txt-green"></i>
</i>
</span>
</c:if>
<c:if test="<%= intPratica.isFineLavoriTotale()%>">
<span class="btn status-icon tooltip-info btn-action" title="Fine Lavori Totale presente">
<i class="fa fa-gavel relative">
<span class="fa-hover fa-top-right txt-green txt-bold">T</span>
<c:if test="<%= !AsseverazioniUtil.allAsseverazioniCompleted(lastDettPratica.getDettPraticaId()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Asseverazioni in corso">
<i class="fa fa-pencil-square relative">
<i class="fa fa-hover fa-cog fa-top-right txt-orange"></i>
</i>
</span>
</c:if>
</c:if>
<c:if test="<%= intPratica.isCollaudoParziale() || intPratica.isCollaudoTotale() %>">
<c:if test="<%= !intPratica.isCollaudoTotale() %>">
<span class="btn status-icon tooltip-info btn-action" title="Collaudo Parziale presente">
<i class="fa fa-briefcase relative">
<span class="fa-hover fa-top-right txt-orange txt-bold">P</span>
<c:if test="<%= !AsseverazioniUtil.hasAsseverazioniAttive(lastDettPratica.getDettPraticaId()) %>">
<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-hover fa-close fa-top-right txt-red"></i>
</i>
</span>
</c:if>
<c:if test="<%= (!lastDettPratica.getNormEsenteSpese() || !lastDettPratica.getNormEsenteBollo())
&& !lastDettPratica.isApproved() && !TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(
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">
<i class="fa fa-eur relative">
<i class="fa fa-hover fa-close fa-top-right txt-red"></i>
</i>
</span>
</c:if>
<c:if test="<%= intPratica.isCollaudoTotale() %>">
<span class="btn status-icon tooltip-info btn-action" title="Collaudo Totale presente">
<i class="fa fa-briefcase relative">
<span class="fa-hover fa-top-right txt-green txt-bold">T</span>
<c:if test="<%= Validator.isNotNull(lastDettPratica.getPagamentoIdOneri()) || Validator.isNotNull(
lastDettPratica.getPagamentoIdBolli()) %>">
<span class="btn status-icon tooltip-info btn-action" title="Pagamento in corso">
<i class="fa fa-eur relative">
<i class="fa fa-hover fa-cog fa-top-right txt-orange"></i>
</i>
</span>
</c:if>
</c:if>
<%
int notAnswered = ComunicazioneLocalServiceUtil.countNotAnsweredByIntPratica(intPratica.getIntPraticaId());
int variantiCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(
intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.VARIANTE));
int integrazioniCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(
intPratica.getIntPraticaId(), Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE));
%>
<c:if test="<%= notAnswered > 0 %>">
<liferay-portlet:renderURL var="comunicazioniURL">
<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="toolbarItem" value="view-storico" />
</liferay-portlet:renderURL>
<a class="btn status-icon tooltip-info btn-action" title="Comunicazione in attesa di risposta"
href="<%= comunicazioniURL.toString() %>">
<i class="fa fa-reply-all relative">
<span class="fa-hover fa-top-right txt-red txt-bold"><%= notAnswered %></span>
</i>
</a>
<c:if test="<%= variantiCount > 0 %>">
<span class="btn status-icon tooltip-info btn-action" title="Varianti Presentate">
<span class="relative txt-bold status-icon-text">
V
<span class="sup top-right txt-bold"><%= variantiCount %></span>
</span>
</span>
</c:if>
</span>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Tipo Pratica" href="<%=rowUrl %>" cssClass="text-nowrap middle-aligned">
<%= LanguageUtil.get(pageContext, "tipo-pratica-"+intPratica.getTipoPratica()) %><br/>
<%= Validator.isNotNull(lastDettPratica.getTipoIntegrazione()) ? LanguageUtil.get(pageContext, "label-integrazione-"+lastDettPratica.getTipoIntegrazione()) : ""%>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="tipologia-soggetto" href="<%=rowUrl %>" cssClass="text-nowrap middle-aligned">
<c:if test="<%= integrazioniCount > 0 %>">
<span class="btn status-icon tooltip-info btn-action txt-bold" title="Integrazioni Presentate">
<span class="relative txt-bold status-icon-text">
I
<span class="sup top-right txt-bold"><%= integrazioniCount %></span>
</span>
</span>
</c:if>
</c:if>
<%
List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(), user.getScreenName());
for(Soggetto soggetto: soggetti){
out.print("<div>"+ LanguageUtil.get(pageContext, "gc-soggetto-"+soggetto.getTipologiaSoggetto())+"</div>");
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId(), QueryUtil.ALL_POS,
QueryUtil.ALL_POS, OrderByComparatorFactoryUtil.create("portos_bo_Avviso", "createDate", false));
StringBuilder sb = new StringBuilder();
if (!avvisi.isEmpty()) {
sb.append("<ul class='avvisi-tooltip'>");
for (Avviso avviso : avvisi) {
String tipoDocumento = avviso.translateTipoDocumento();
String testoEvento = LanguageUtil.get(pageContext, tipoDocumento);
sb.append("<li class='avviso-tooltip'>").append(testoEvento).append("</li>");
}
sb.append("</ul>");
%>
<liferay-portlet:renderURL var="fascicoloAvvisiURL">
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo.jsp" />
<liferay-portlet:param name="backURL" value="<%= currentURL %>" />
<liferay-portlet:param name="intPraticaId"
value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-portlet:param name="toolbarItem" value="view-storico" />
</liferay-portlet:renderURL>
<a class="btn status-icon tooltip-info btn-action" title="<%= HtmlUtil.escapeAttribute(sb.toString()) %>"
href="<%= fascicoloAvvisiURL.toString() %>">
<i class="fa fa-envelope relative">
<span class="fa-hover fa-top-right txt-bold"><%= avvisi.size() %></span>
</i>
</a>
<%
}
%>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="desc-intervento" href="<%=rowUrl %>" cssClass="middle-aligned">
</span>
<span class="text-center display-block" style="margin-top: 5px">
<c:if test="<%= intPratica.isFineLavoriParziale() || intPratica.isFineLavoriTotale() %>">
<c:if test="<%= !intPratica.isFineLavoriTotale() %>">
<span class="btn status-icon tooltip-info btn-action" title="Fine Lavori Parziale presente">
<i class="fa fa-gavel relative">
<span class="fa-hover fa-top-right txt-orange txt-bold">P</span>
</i>
</span>
</c:if>
<c:if test="<%= intPratica.isFineLavoriTotale()%>">
<span class="btn status-icon tooltip-info btn-action" title="Fine Lavori Totale presente">
<i class="fa fa-gavel relative">
<span class="fa-hover fa-top-right txt-green txt-bold">T</span>
</i>
</span>
</c:if>
</c:if>
<c:if test="<%= intPratica.isCollaudoParziale() || intPratica.isCollaudoTotale() %>">
<c:if test="<%= !intPratica.isCollaudoTotale() %>">
<span class="btn status-icon tooltip-info btn-action" title="Collaudo Parziale presente">
<i class="fa fa-briefcase relative">
<span class="fa-hover fa-top-right txt-orange txt-bold">P</span>
</i>
</span>
</c:if>
<c:if test="<%= intPratica.isCollaudoTotale() %>">
<span class="btn status-icon tooltip-info btn-action" title="Collaudo Totale presente">
<i class="fa fa-briefcase relative">
<span class="fa-hover fa-top-right txt-green txt-bold">T</span>
</i>
</span>
</c:if>
</c:if>
<%
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), comune.getCodiceProvincia());
int notAnswered = ComunicazioneLocalServiceUtil.countNotAnsweredByIntPratica(intPratica.getIntPraticaId());
%>
Territorio: <strong><%= comune.getDenominazione() %> <%= !lastDettPratica.getLocalita().isEmpty() ? "(Loc. "+lastDettPratica.getLocalita()+" ) " : "" %>- <%= provincia.getProvincia() %></strong><br>
Localizzazione: <strong><%= lastDettPratica.getVia() %></strong><br>
<strong><%= LanguageUtil.get(pageContext, "tipo_procedura_" + intPratica.getTipoProcedura()) %></strong><br><br>
<%= lastDettPratica.getDescLongIntervento() %>
</liferay-ui:search-container-column-text>
<c:if test="<%=isDeleghe || isProgetti || isAltriProgetti%>">
<liferay-ui:search-container-column-jsp path="/html/fascicolofe/fascicolo_action.jsp" align="right" cssClass="middle-aligned"/>
</c:if>
<c:if test="<%= notAnswered > 0 %>">
<liferay-portlet:renderURL var="comunicazioniURL">
<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="toolbarItem" value="view-storico" />
</liferay-portlet:renderURL>
<a class="btn status-icon tooltip-info btn-action" title="Comunicazione in attesa di risposta"
href="<%= comunicazioniURL.toString() %>">
<i class="fa fa-reply-all relative">
<span class="fa-hover fa-top-right txt-red txt-bold"><%= notAnswered %></span>
</i>
</a>
</c:if>
</span>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Tipo Pratica" href="<%= rowUrl %>" cssClass="text-nowrap middle-aligned">
<%= LanguageUtil.get(pageContext, "tipo-pratica-" + intPratica.getTipoPratica()) %><br/>
<%= 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 name="tipologia-soggetto" href="<%= rowUrl %>"
cssClass="text-nowrap middle-aligned">
<%
List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(),
user.getScreenName());
for (Soggetto soggetto : soggetti) {
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 name="desc-intervento" href="<%= rowUrl %>" cssClass="middle-aligned">
<%
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), comune.getCodiceProvincia());
%>
Territorio: <strong><%= comune.getDenominazione() %>
<%= lastDettPratica.getLocalita().isEmpty() ? StringPool.BLANK : "(Loc. " + lastDettPratica.getLocalita()
+ 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() %>
</liferay-ui:search-container-column-text>
<c:if test="<%= isDeleghe || isProgetti || isAltriProgetti %>">
<liferay-ui:search-container-column-jsp path="/html/fascicolofe/fascicolo_action.jsp" align="right"
cssClass="middle-aligned" />
</c:if>

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

@ -112,7 +112,7 @@
Stato:
</div>
<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>

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

File diff soppresso perché troppo grande Load Diff

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

@ -1,70 +1,65 @@
<%@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"%>
<%@ include file="/html/soggettipratica/init.jsp" %>
<%@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"%>
<%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
long soggettoId = ParamUtil.getLong(renderRequest, "soggettoId");
Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(soggettoId);
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
long soggettoId = ParamUtil.getLong(renderRequest, "soggettoId");
Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(soggettoId);
%>
<liferay-portlet:renderURL var="editSoggettoURL">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPraticaId) %>"/>
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>"/>
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggettoId) %>"/>
<liferay-portlet:param name="isEditable" value="false"/>
</liferay-portlet:renderURL>
<liferay-portlet:renderURL var="redirectErrorURL">
<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="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>"/>
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggettoId) %>"/>
</liferay-portlet:renderURL>
<liferay-portlet:actionURL name="updateAllegatoSoggetto" var="updateAllegatoSoggettoURL">
<liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPraticaId) %>"/>
<liferay-portlet:param name="dettPraticaId" value="<%=String.valueOf(dettPraticaId) %>"/>
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggettoId) %>"/>
<liferay-portlet:param name="successUrl" value="<%= editSoggettoURL %>"/>
<liferay-portlet:param name="errorUrl" value="<%= redirectErrorURL %>"/>
</liferay-portlet:actionURL>
<liferay-ui:error key="error.geniocivilefe.variazione-soggetto.add.file.non.firmato" 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-portlet:renderURL var="editSoggettoURL">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp" />
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggettoId) %>" />
<liferay-portlet:param name="isEditable" value="false" />
</liferay-portlet:renderURL>
<liferay-portlet:renderURL var="redirectErrorURL">
<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="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggettoId) %>" />
</liferay-portlet:renderURL>
<liferay-portlet:actionURL name="updateAllegatoSoggetto" var="updateAllegatoSoggettoURL">
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" />
<liferay-portlet:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
<liferay-portlet:param name="soggettoId" value="<%= String.valueOf(soggettoId) %>" />
<liferay-portlet:param name="successUrl" value="<%= editSoggettoURL %>" />
<liferay-portlet:param name="errorUrl" value="<%= redirectErrorURL %>" />
</liferay-portlet:actionURL>
<liferay-ui:error key="error.geniocivilefe.variazione-soggetto.add.file.non.firmato"
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" message="errore-in-variazione-soggetto" />
<liferay-ui:header cssClass="header_back" title="add-file-variazione-soggetto" backURL="<%= editSoggettoURL %>"></liferay-ui:header>
<liferay-ui:header cssClass="header_back" title="add-file-variazione-soggetto" backURL="<%= editSoggettoURL %>" />
<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="row">
<div class="col-sm-12 col-md-12">
<div class="col-sm-12">
<div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="allegato-file-modifica" >
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-message">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false"
title="allegato-file-modifica" >
<div class="col-xs-12 container-message">
<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>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-file-chooser">
<aui:input type="file" name="docFile" label=""
required="<%= !TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto()) %>"
showRequiredLabel="<%= !TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto()) %>"/>
<div class="col-xs-12 container-file-chooser">
<aui:input type="file" name="docFile" label=""
required="<%= !TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto()) %>"
showRequiredLabel="<%= !TipoSoggettoUtil.COMMITTENTE.equals(
soggetto.getTipologiaSoggetto()) %>" />
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-checkbox-edit-allegato">
<!-- ADT BUG ID=27 -->
<aui:input type="checkbox" name="applicaFirma" label="label.firma-doc" value="false" />
<div class="col-xs-12 container-checkbox-edit-allegato">
<aui:input type="checkbox" name="applicaFirma" label="label.firma-doc" value="false" />
</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 type="submit" value="upload"></aui:button>
<aui:button type="submit" value="upload" />
</aui:button-row>
</div>
</liferay-ui:panel>

10
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"%>
<%@ include file="/html/init.jsp" %>
<%@include file="/html/init.jsp"%>
<%
boolean isElencoProgetti = GetterUtil.getBoolean(portletPreferences.getValue("isElencoProgetti", "true"));
boolean isArchivio = GetterUtil.getBoolean(portletPreferences.getValue("isArchivio", "true"));
boolean onlyMieiProgetti = GetterUtil.getBoolean(portletPreferences.getValue("onlyMieiProgetti", "true"));
String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", ""));
String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", ""));
String helpTitle = GetterUtil.getString(portletPreferences.getValue("helpTitle", StringPool.BLANK));
String helpMessage = GetterUtil.getString(portletPreferences.getValue("helpMessage", StringPool.BLANK));
%>

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

File diff soppresso perché troppo grande Load Diff

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

@ -1,527 +1,512 @@
<%@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");
if(dettPraticaId==0){
dettPraticaId = GetterUtil.getLong( PortalUtil.getOriginalServletRequest(request).getParameter("dettPraticaId"));
}
DettPratica dettPratica = DettPraticaServiceUtil.fetchDettPratica(dettPraticaId);
if(Validator.isNull(dettPratica)){
dettPratica = (DettPratica)request.getAttribute("bean.dettPratica");
}
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);
IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId());
boolean inBO = ParamUtil.getBoolean(request,"inBO",false);
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId");
if (dettPraticaId == 0) {
dettPraticaId = GetterUtil.getLong(PortalUtil.getOriginalServletRequest(request).getParameter("dettPraticaId"));
}
DettPratica dettPratica = DettPraticaServiceUtil.fetchDettPratica(dettPraticaId);
if (Validator.isNull(dettPratica)) {
dettPratica = (DettPratica) request.getAttribute("bean.dettPratica");
}
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPratica.getDettPraticaId());
request.setAttribute("bean.dettPratica", dettPratica);
IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId());
boolean inBO = ParamUtil.getBoolean(request, "inBO", false);
%>
<aui:model-context bean="<%=dettPratica %>" model="<%=DettPratica.class %>"></aui:model-context>
<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="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/>
<liferay-portlet:param name="isEditable" value="true"/>
<aui:model-context bean="<%= dettPratica %>" model="<%= DettPratica.class %>" />
<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="dettPraticaId" value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="isEditable" value="true" />
</liferay-portlet:renderURL>
<div class="container-fluid container-soggetti">
<c:if test="<%=!disabledInput && !inBO %>">
<c:if test="<%= !disabledInput && !inBO %>">
<div class="row container-soggetti">
<div class="col-sm-12 col-md-12">
<div class="text-right" style="padding-bottom:15px">
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" 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"/>
<div class="col-sm-12">
<div class="text-right" style="padding-bottom: 15px">
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
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>
</div>
</div>
</div>
</c:if>
<c:if test="<%= !inBO %>">
<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-results
results="<%=SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>"
total="<%=SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>"
/>
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto"
>
results="<%= SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(
dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>"
total="<%= SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(
dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>" />
<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" >
<liferay-ui:search-container-column-text name="Stato">
<%
String color = "";
if( Validator.isNotNull(soggetto.getDettPraticaIdRimozione()) ){
color = "txt-red";
} else {
color = "txt-green";
}
String color = StringPool.BLANK;
if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) {
color = "txt-red";
} else {
color = "txt-green";
}
%>
<span class='fa fa-circle <%= color %>'></span>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="denominazione" >
<%=soggetto.getDescrizioneCompleta() %>
<liferay-ui:search-container-column-text name="denominazione">
<%= soggetto.getDescrizioneCompleta() %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text property="codiceFiscale" name="Codice Fiscale"/>
<liferay-ui:search-container-column-text property="codiceFiscale" name="Codice Fiscale" />
<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 name="principale" cssClass="text-center">
<span class='<%= isSoggettoPrincipale ? "fa fa-star txt-orange" : "fa fa-star-o" %>'></span>
</liferay-ui:search-container-column-text>
<c:if test="<%=!disabledInput %>">
<liferay-ui:search-container-column-text name="Azioni" >
<liferay-ui:icon-menu showWhenSingleIcon="<%= false %>" extended="false" showExpanded="true" cssClass="inline_toolbar" >
<c:if test="<%= !disabledInput %>">
<liferay-ui:search-container-column-text name="Azioni">
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
cssClass="inline_toolbar">
<c:if test="<%= soggetto.getDettPraticaId() == dettPratica.getDettPraticaId() %>">
<liferay-portlet:renderURL var="editURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>">
<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:renderURL var="editURL"
windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<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:renderURL>
<liferay-ui:icon
iconCssClass="fa fa-edit"
message="edit"
url="<%=editURL%>"
linkCssClass="btn btn-action btn-primary"
useDialog="true"
/>
<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="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/>
<liferay-ui:icon iconCssClass="fa fa-edit" message="edit" url="<%= editURL %>"
linkCssClass="btn btn-action btn-primary" useDialog="true" />
<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="soggettoId" value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL>
<liferay-ui:icon
id='<%="delete_"+soggetto.getSoggettoId() %>'
iconCssClass="fa fa-trash"
message="delete"
url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger"
/>
<liferay-ui:icon id='<%= "delete_" + soggetto.getSoggettoId() %>'
iconCssClass="fa fa-trash" message="delete" url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger" />
<aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"delete_"+soggetto.getSoggettoId() %>').on(
'click',
function(event) {
event.preventDefault();
Loading.start();
if(confirm('rimuovere il soggetto?')){
A.io.request(
'<%=deleteSoggettoURL%>',
{
on: {
failure: function() {
alert('impossibile rimuovere il soggetto!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('soggetti-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
},
complete: function(){
Loading.end();
}
}
}
);
A.one('<%= StringPool.POUND + renderResponse.getNamespace() + "delete_"
+ soggetto.getSoggettoId() %>').on('click', function(event) {
event.preventDefault();
Loading.start();
if (confirm('rimuovere il soggetto?')) {
A.io.request('<%= deleteSoggettoURL %>', {
on: {
failure: function() {
alert('impossibile rimuovere il soggetto!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('soggetti-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
},
complete: function(){
Loading.end();
}
}
}
);
});
}
});
</aui:script>
</c:if>
<c:if test="<%= soggetto.getDettPraticaId() != dettPratica.getDettPraticaId() %>">
<c:if test="<%= Validator.isNotNull(soggetto.getDettPraticaIdRimozione()) %>">
<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="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/>
<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="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL>
<liferay-ui:icon
id='<%="valid_"+soggetto.getSoggettoId() %>'
iconCssClass="fa fa-valida"
message="Valida"
url="javascript:void(0)"
linkCssClass="btn btn-success"
/>
<liferay-ui:icon id='<%= "valid_" + soggetto.getSoggettoId() %>'
iconCssClass="fa fa-valida" message="Valida" url="javascript:void(0)"
linkCssClass="btn btn-success" />
<aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"valid_"+soggetto.getSoggettoId() %>').on(
'click',
function(event) {
event.preventDefault();
Loading.start();
A.io.request(
'<%=validaSoggettoURL%>',
{
on: {
failure: function() {
alert('Impossibile invalidare il soggetto!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('soggetti-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
},
complete: function(){
Loading.end();
}
}
}
);
A.one('<%= StringPool.POUND + renderResponse.getNamespace() + "valid_"
+ soggetto.getSoggettoId() %>').on('click', function(event) {
event.preventDefault();
Loading.start();
A.io.request('<%= validaSoggettoURL %>', {
on: {
failure: function() {
alert('Impossibile invalidare il soggetto!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('soggetti-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
},
complete: function(){
Loading.end();
}
}
);
});
});
</aui:script>
</c:if>
<c:if test="<%= Validator.isNull(soggetto.getDettPraticaIdRimozione()) %>">
<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="dettPraticaId" value="<%=String.valueOf(dettPratica.getDettPraticaId()) %>"/>
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/>
<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="dettPraticaId"
value="<%= String.valueOf(dettPratica.getDettPraticaId()) %>" />
<liferay-portlet:param name="soggettoId"
value="<%= String.valueOf(soggetto.getSoggettoId()) %>" />
</liferay-portlet:actionURL>
<liferay-ui:icon
id='<%="invalid_"+soggetto.getSoggettoId() %>'
iconCssClass="fa fa-ban"
message="Invalida"
url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger"
/>
<liferay-ui:icon id='<%= "invalid_" + soggetto.getSoggettoId() %>'
iconCssClass="fa fa-ban" message="Invalida" url="javascript:void(0)"
linkCssClass="btn btn-action btn-danger" />
<aui:script use="aui-base,aui-io-request">
A.one('<%="#"+renderResponse.getNamespace()+"invalid_"+soggetto.getSoggettoId() %>').on(
'click',
function(event) {
event.preventDefault();
Loading.start();
if(confirm('Sei sicuro di voler invalidare il soggetto?')){
A.io.request(
'<%=invalidaSoggettoURL%>',
{
on: {
failure: function() {
alert('Impossibile invalidare il soggetto!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('soggetti-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
},
complete: function(){
Loading.end();
}
}
}
);
A.one('<%= StringPool.POUND + renderResponse.getNamespace() + "invalid_"
+ soggetto.getSoggettoId() %>').on('click', function(event) {
event.preventDefault();
Loading.start();
if (confirm('Sei sicuro di voler invalidare il soggetto?')) {
A.io.request('<%= invalidaSoggettoURL %>', {
on: {
failure: function() {
alert('Impossibile invalidare il soggetto!');
},
success: function(event, id, obj) {
window.parent.Liferay.fire('soggetti-open');
Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>");
},
complete: function(){
Loading.end();
}
}
}
);
});
}
});
</aui:script>
</c:if>
</c:if>
</liferay-ui:icon-menu>
</liferay-ui:icon-menu>
</liferay-ui:search-container-column-text>
</c:if>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= false %>" />
<liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container>
</div>
</div>
</c:if>
<c:if test="<%= inBO %>">
<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-results
results="<%=SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>"
total="<%=SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId())%>"
/>
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto"
>
<%
boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(), dettPratica.getDettPraticaId());
%>
<liferay-portlet:renderURL var="detailsURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>">
<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="false"/>
results="<%= SoggettoServiceUtil.getValidUntilDettPraticaByIntPratica(
dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>"
total="<%= SoggettoServiceUtil.countValidUntilDettPraticaByIntPratica(
dettPratica.getIntPraticaId(), dettPratica.getDettPraticaId()) %>" />
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto">
<%
boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(),
dettPratica.getDettPraticaId());
%>
<liferay-portlet:renderURL var="detailsURL"
windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<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="false" />
</liferay-portlet:renderURL>
<liferay-ui:search-container-column-text name="Stato" cssClass="text-center">
<%
String color = "";
if( Validator.isNotNull(soggetto.getDettPraticaIdRimozione()) ){
color = "txt-red";
} else {
color = "txt-green";
}
String color;
if (Validator.isNotNull(soggetto.getDettPraticaIdRimozione())) {
color = "txt-red";
} else {
color = "txt-green";
}
%>
<span class='fa fa-circle <%= color %>'></span>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Data Nomina" cssClass="text-center">
<%= dateFormatDateTime.format(soggetto.getCreateDate()) %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="principale" cssClass="text-center">
<%
String clickFunction = StringPool.BLANK;
String unclickableClass = StringPool.BLANK;
if(disabledInput || inBO){
clickFunction = "javascript:void(0)";
unclickableClass = "unclickable";
} else {
if( !isSoggettoPrincipale && Validator.isNull(soggetto.getDettPraticaIdRimozione()) && !soggetto.getTmp() ){
clickFunction = "makeSoggettoPrincipale(\""+soggetto.getSoggettoId()+"\")";
} else if(isSoggettoPrincipale){
clickFunction = "unmakeSoggettoPrincipale(\""+soggetto.getSoggettoId()+"\")";
} else {
clickFunction = "javascript:void(0)";
unclickableClass = "unclickable";
}
}
String clickFunction = StringPool.BLANK;
String unclickableClass = StringPool.BLANK;
if (disabledInput || inBO) {
clickFunction = "javascript:void(0)";
unclickableClass = "unclickable";
} else if (!isSoggettoPrincipale && Validator.isNull(soggetto.getDettPraticaIdRimozione())
&& !soggetto.getTmp()) {
clickFunction = "makeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")";
} else if (isSoggettoPrincipale) {
clickFunction = "unmakeSoggettoPrincipale(\"" + soggetto.getSoggettoId() + "\")";
} else {
clickFunction = "javascript:void(0)";
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 name="denominazione" >
<%=soggetto.getDescrizioneCompleta() %>
<liferay-ui:search-container-column-text name="denominazione">
<%= soggetto.getDescrizioneCompleta() %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text property="codiceFiscale" name="Codice Fiscale"/>
<liferay-ui:search-container-column-text property="codiceFiscale" name="Codice Fiscale" />
<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 name="" cssClass="text-center">
<liferay-ui:icon linkCssClass="btn btn-action" iconCssClass="fa fa-clipboard" message="Visualizza" url="<%=detailsURL.toString()%>" useDialog="true"/>
<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:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= false %>" />
<liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container>
</div>
</div>
</c:if>
</div>
<div class="container-fluid 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">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-committente">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<%
List<Soggetto> committenti = SoggettoServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
%>
<c:if test="<%= committenti.isEmpty() %>">
<div>
<%= LanguageUtil.get(pageContext, "text-delega-committente-disabled") %>
</div>
</c:if>
<c:if test="<%= !committenti.isEmpty() %>">
<label for="<portlet:namespace/>committenti-list">Lista Committenti</label>
<ul id='<portlet:namespace/>committenti-list' style="padding-left: 20px;list-style: initial;">
<%
for(Soggetto committente : committenti){
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-committente">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<%
List<Soggetto> committenti = SoggettoServiceUtil
.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.COMMITTENTE);
%>
<c:if test="<%= committenti.isEmpty() %>">
<div>
<%= LanguageUtil.get(pageContext, "text-delega-committente-disabled") %>
</div>
</c:if>
<c:if test="<%= !committenti.isEmpty() %>">
<label for="<portlet:namespace/>committenti-list">Lista Committenti</label>
<ul id='<portlet:namespace/>committenti-list'
style="padding-left: 20px;list-style: initial">
<%
for (Soggetto committente : committenti) {
%>
<li><%= committente.getDescrizioneCompleta() %></li>
<%
}
}
%>
</ul>
<c:if test="<%= !SoggettiUtil.isTitolareInCommittenti(
intPratica.getIntPraticaId()) %>">
<%
User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId());
%>
</ul>
<c:if test="<%= !SoggettiUtil.isTitolareInCommittenti(intPratica.getIntPraticaId()) %>">
<%
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 %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCommittenteEnabled"%>' checked="<%= Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCommittente()) %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, "text-delega-committente"), user.getFirstName()+" "+user.getMiddleName(), user.getLastName()) %>' inlineField="true" useNamespace="false"></aui:input>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
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 test="<%= inBO %>">
<%
List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoCommittente());
Soggetto titolare = null;
if(!titolari.isEmpty()){
titolare = titolari.get(0);
}
List<Soggetto> titolari = SoggettoLocalServiceUtil
.getValidByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoCommittente());
Soggetto titolare = null;
if (!titolari.isEmpty()) {
titolare = titolari.get(0);
}
%>
<c:if test="<%= Validator.isNotNull(titolare) %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" name='<%= "_"+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"></aui:input>
<c:if test="<%= Validator.isNotNull(titolare) %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
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>
</div>
</div>
</div>
</liferay-ui:panel>
</div>
</c:if>
</div>
</div>
</div>
</liferay-ui:panel>
</div>
</div>
</div>
</div>
<div class="container-fluid 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">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-direttoreLavori">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<%
boolean enabledDelegatoFineLavori = false;
List<Soggetto> direttoriLavori = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI);
%>
<c:if test="<%= direttoriLavori.isEmpty() %>">
<div>
<%= LanguageUtil.get(pageContext, "text-delega-direttoreLavori-disabled") %>
</div>
</c:if>
<c:if test="<%= !direttoriLavori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoFineLavori"%>' showEmptyOption="true" useNamespace="false" disabled="<%= disabledInput || inBO%>">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-direttoreLavori">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<%
boolean enabledDelegatoFineLavori = false;
List<Soggetto> direttoriLavori = SoggettoServiceUtil
.getValidByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.DIRETTORE_LAVORI);
%>
<c:if test="<%= direttoriLavori.isEmpty() %>">
<div>
<%= LanguageUtil.get(pageContext, "text-delega-direttoreLavori-disabled") %>
</div>
</c:if>
<c:if test="<%= !direttoriLavori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoFineLavori" %>'
showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>">
<%
for(Soggetto direttoreLavori : direttoriLavori){
if(dettPratica.getCodiceFiscaleDelegatoFineLavori().equalsIgnoreCase(direttoreLavori.getCodiceFiscale())){
enabledDelegatoFineLavori = true;
}
for (Soggetto direttoreLavori : direttoriLavori) {
if (dettPratica.getCodiceFiscaleDelegatoFineLavori()
.equalsIgnoreCase(direttoreLavori.getCodiceFiscale())) {
enabledDelegatoFineLavori = true;
}
%>
<aui:option
label='<%= direttoreLavori.getCodiceFiscale().toUpperCase()+ " - "+ direttoreLavori.getNome()+" "+direttoreLavori.getCognome() %>'
value="<%= direttoreLavori.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori().equalsIgnoreCase(direttoreLavori.getCodiceFiscale()) %>"/>
<aui:option label='<%= direttoreLavori.getCodiceFiscale().toUpperCase()
+ " - " + direttoreLavori.getNome() + StringPool.SPACE
+ direttoreLavori.getCognome() %>'
value="<%= direttoreLavori.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori()
.equalsIgnoreCase(direttoreLavori.getCodiceFiscale()) %>" />
<%
}
}
%>
</aui:select>
<%
List<Soggetto> direttori = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoFineLavori());
Soggetto direttore = null;
if(!direttori.isEmpty()){
direttore = direttori.get(0);
}
List<Soggetto> direttori = SoggettoLocalServiceUtil
.findByIntPratica_CodiceFiscale(dettPratica.getIntPraticaId(),
dettPratica.getCodiceFiscaleDelegatoFineLavori());
Soggetto direttore = null;
if(!direttori.isEmpty()){
direttore = direttori.get(0);
}
%>
<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>
</c:if>
</div>
</div>
</div>
</liferay-ui:panel>
</div>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
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>
</div>
</div>
</div>
</liferay-ui:panel>
</div>
</div>
</div>
</div>
<div class="container-fluid 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">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-collaudatore">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<%
boolean enabledDelegatoCollaudo = false;
List<Soggetto> collaudatori = SoggettoServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(), TipoSoggettoUtil.COLLAUDATORE);
%>
<c:if test="<%= collaudatori.isEmpty() %>">
<div>
<%
String text_delega_collaudatore = "";
if( dettPratica.getCollaudoStatico() ){
text_delega_collaudatore = "text-delega-collaudatore-notRequired";
} else {
text_delega_collaudatore = "text-delega-collaudatore-disabled";
}
%>
<%= LanguageUtil.get(pageContext, text_delega_collaudatore) %>
</div>
</c:if>
<c:if test="<%= !collaudatori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= "_"+PortletKeys.FASCICOLOFE+"_codiceFiscaleDelegatoCollaudo"%>' showEmptyOption="true" useNamespace="false" disabled="<%= disabledInput || inBO%>">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="delega-collaudatore">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<%
boolean enabledDelegatoCollaudo = false;
List<Soggetto> collaudatori = SoggettoServiceUtil
.getValidTmpByIntPratica_TipologiaSoggetto(dettPratica.getIntPraticaId(),
TipoSoggettoUtil.COLLAUDATORE);
%>
<c:if test="<%= collaudatori.isEmpty() %>">
<div>
<%
for(Soggetto collaudatore : collaudatori){
if(dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(collaudatore.getCodiceFiscale())){
enabledDelegatoCollaudo = true;
}
String text_delega_collaudatore = StringPool.BLANK;
if (dettPratica.getCollaudoStatico()) {
text_delega_collaudatore = "text-delega-collaudatore-notRequired";
} else {
text_delega_collaudatore = "text-delega-collaudatore-disabled";
}
%>
<aui:option
label='<%= collaudatore.getCodiceFiscale().toUpperCase()+ " - "+ collaudatore.getNome()+" "+collaudatore.getCognome() %>'
value="<%= collaudatore.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(collaudatore.getCodiceFiscale()) %>"/>
<%
<%= LanguageUtil.get(pageContext, text_delega_collaudatore) %>
</div>
</c:if>
<c:if test="<%= !collaudatori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCollaudo" %>'
showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>">
<%
for (Soggetto collaudatore : collaudatori) {
if (dettPratica.getCodiceFiscaleDelegatoCollaudo().equalsIgnoreCase(
collaudatore.getCodiceFiscale())) {
enabledDelegatoCollaudo = true;
}
%>
<aui:option label='<%= collaudatore.getCodiceFiscale().toUpperCase()
+ " - " + collaudatore.getNome() + StringPool.SPACE
+ collaudatore.getCognome() %>'
value="<%= collaudatore.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo()
.equalsIgnoreCase(collaudatore.getCodiceFiscale()) %>" />
<%
}
%>
</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;
if(!collaudatoriDelegati.isEmpty()){
collaudatoreDelegato = collaudatoriDelegati.get(0);
if (!collaudatoriDelegati.isEmpty()) {
collaudatoreDelegato = collaudatoriDelegati.get(0);
}
%>
<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>
</c:if>
</div>
</div>
</div>
</liferay-ui:panel>
</div>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
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>
</div>
</div>
</div>
</liferay-ui:panel>
</div>
</div>
</div>
</div>
<aui:script use="aui-base">
Liferay.fire(
'soggetti-ready',
{
isCommittenteAndDitta: <%=SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId())%>,
}
);
Liferay.fire('soggetti-ready', {
isCommittenteAndDitta: <%= SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId()) %>,
});
</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);
/**
* @see HttpServlet#HttpServlet()
*/
// @see HttpServlet#HttpServlet()
public FirmaServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
// @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo().substring(1);
String[] pathArray = StringUtil.split(pathInfo, "/");
String[] pathArray = StringUtil.split(pathInfo, StringPool.FORWARD_SLASH);
FirmaGetUtil firmaGetUtil = new FirmaGetUtil();
String metodo = pathArray[0];
Risposta<?> risposta = new Risposta<>();
@ -100,9 +96,7 @@ public class FirmaServlet extends HttpServlet {
ServletResponseUtil.write(response, jsonResponse);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
// @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {

4
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;
public boolean isSuccess() {
return success;
}
public List<String> getCf() {
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.Map;
import javax.portlet.PortletPreferences;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
@ -21,7 +23,7 @@ public class FirmaGetUtil {
put("MESSAGGIO_EFFETTUARE_LOGIN", "Effettuare il login per continuare");
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("RIFIUTA", "true");
put("RIFIUTA", StringPool.TRUE);
put("APRI_PRATICA_DISABILITATO_PER_DOCUMENTO", "v");
put("MESSAGGIO_FIRMA_ATTESA", "Attesa");
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("SMART_CARD_LETTURA_CF", "SERIALNUMBER");
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_NO_FILE", "Impossibile recuperare il file");
put("MESSAGGIO_NO_PRATICA", "Impossibile accedere alla pratica");
@ -59,16 +61,16 @@ public class FirmaGetUtil {
put("NO_FILE", "Nessun file da firmare presente");
put("MESSAGGIO_SELEZIONARE_FILE_RIFIUTA", "Selezionare almeno un file prima di premere rifiuta");
put("MODALITA_LOGIN", "codice_fiscale");
put("VISUALIZZA_FILE", "true");
put("VISUALIZZA_FILE", StringPool.TRUE);
put("APRI_PRATICA_DISABILITATO_PER_PRATICA", " - ");
put("SMART_CARD_LETTURA_NOME", "GIVENNAME");
put("VISUALIZZA_FILE_DISABILITATO_PER_DOCUMENTO", " - ");
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");
put("RIFIUTA_ASSEGNA", "false");
put("RIFIUTA_ASSEGNA", StringPool.FALSE);
put("MESSAGGIO_FILE_RIFIUTA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile");
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("SMART_CARD_LETTURA_COGNOME", "SURNAME");
put("RIFIUTA_DISABILITATO_PER_DOCUMENTO", "v");
@ -118,6 +120,7 @@ public class FirmaGetUtil {
};
public Risposta<Map<String, String>> getConfiguration() {
Risposta<Map<String, String>> risposta = new Risposta<>();
risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(configurazione);
@ -125,6 +128,7 @@ public class FirmaGetUtil {
}
public Risposta<Map<String, String>> getType() {
Risposta<Map<String, String>> risposta = new Risposta<>();
risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(mappa);
@ -132,6 +136,7 @@ public class FirmaGetUtil {
}
public Risposta<Map<String, String>> getTypeVerbale() {
Risposta<Map<String, String>> risposta = new Risposta<>();
Map<String, String> mappa = new HashMap<>();
risposta.setRisposta(RispostaCostanti.OK);
@ -140,12 +145,12 @@ public class FirmaGetUtil {
}
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<>();
if (codiceFiscale.equals(codiceFiscaleTest)) {
String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK);
String tokenTest = portletPreferences.getValue("tokenTest", StringPool.BLANK);
risposta.setObj(tokenTest);
} else {
// 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) {
javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences();
String nomeTest = jxPortletPreferences.getValue("nomeTest", StringPool.BLANK);
String cognomeTest = jxPortletPreferences.getValue("cognomeTest", StringPool.BLANK);
PortletPreferences portletPreferences = FirmaUtil.getPortletPreferences();
String nomeTest = portletPreferences.getValue("nomeTest", StringPool.BLANK);
String cognomeTest = portletPreferences.getValue("cognomeTest", StringPool.BLANK);
Risposta<String> risposta = new Risposta<>();
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.setRisposta(RispostaCostanti.OK);
} else {
// TODO
}
return risposta;
}
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<>();
if (Validator.isBlank(versione)) {
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
@ -184,6 +189,7 @@ public class FirmaGetUtil {
}
public Risposta<Stile> getStile() {
Risposta<Stile> risposta = new Risposta<>();
risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(stile);

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

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

@ -25,65 +25,49 @@ import com.liferay.portlet.PortletPreferencesFactoryUtil;
public class FirmaUtil {
private static final Log _log = LogFactoryUtil.getLog(FirmaUtil.class);
public static javax.portlet.PortletPreferences getPortletPreferences() {
List<PortletPreferences> pr = null;
String preferencesXML;
javax.portlet.PortletPreferences jxPortletPreferences = null;
try {
pr =
PortletPreferencesLocalServiceUtil.getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0,
"firma_WAR_portosfirmaportlet");
preferencesXML = pr.get(0).getPreferences();
jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML);
} catch (SystemException e) {
_log.error(e.getMessage());
}
return jxPortletPreferences;
}
public static List<String> getCodiceFiscale(byte[] fileArray, String urlPdfExtractor) {
List<String> listaCodiciFiscali = null;
try {
File file = File.createTempFile("codicefiscale", ".p7m");
FileUtils.writeByteArrayToFile(file, fileArray);
ObjectMapper mapper = new ObjectMapper();
// long companyId = CompanyThreadLocal.getCompanyId();
ContentBody body = new FileBody(file);
MultipartEntity entity = new MultipartEntity();
entity.addPart("file", body);
HttpPost request = new HttpPost(urlPdfExtractor);
request.setEntity(entity);
HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request);
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode());
}
InputStream inputStream = response.getEntity().getContent();
ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class);
if (extractorResponse.isSuccess()) {
listaCodiciFiscali = extractorResponse.getCf();
}
} catch (IOException e) {
_log.error(e.getMessage());
}
return listaCodiciFiscali;
}
}
private static final Log _log = LogFactoryUtil.getLog(FirmaUtil.class);
public static javax.portlet.PortletPreferences getPortletPreferences() {
List<PortletPreferences> pr = null;
String preferencesXML;
javax.portlet.PortletPreferences jxPortletPreferences = null;
try {
pr = PortletPreferencesLocalServiceUtil.getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0L,
"firma_WAR_portosfirmaportlet");
preferencesXML = pr.get(0).getPreferences();
jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML);
} catch (SystemException e) {
_log.error(e.getMessage());
}
return jxPortletPreferences;
}
public static List<String> getCodiceFiscale(byte[] fileArray, String urlPdfExtractor) {
List<String> listaCodiciFiscali = null;
try {
File file = File.createTempFile("codicefiscale", ".p7m");
FileUtils.writeByteArrayToFile(file, fileArray);
ObjectMapper mapper = new ObjectMapper();
ContentBody body = new FileBody(file);
MultipartEntity entity = new MultipartEntity();
entity.addPart("file", body);
HttpPost request = new HttpPost(urlPdfExtractor);
request.setEntity(entity);
HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request);
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode());
}
InputStream inputStream = response.getEntity().getContent();
ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class);
if (extractorResponse.isSuccess()) {
listaCodiciFiscali = extractorResponse.getCf();
}
} catch (IOException e) {
_log.error(e.getMessage());
}
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;
}
}

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

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

18
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_SOSTITUITA = "07";
public final static String UTILIZZATA_ANNULLATO = "08";
private static Map<String, String> mezzoToLabel;
static {
mezzoToLabel = new HashMap<String, String>();
mezzoToLabel.put(MEZZO_ZERO, "label.pratica.pagamento.mezzo.zero");
mezzoToLabel.put(MEZZO_MANUALE, "label.pratica.pagamento.mezzo.manuale");
mezzoToLabel.put(MEZZO_IRIS, "label.pratica.pagamento.mezzo.iris");
}
@SuppressWarnings("serial")
private static Map<String, String> mezzoToLabel = new HashMap<String, String>() {
{
put(MEZZO_ZERO, "label.pratica.pagamento.mezzo.zero");
put(MEZZO_MANUALE, "label.pratica.pagamento.mezzo.manuale");
put(MEZZO_IRIS, "label.pratica.pagamento.mezzo.iris");
}
};
public PagamentoConstants() {
}
@ -36,5 +37,4 @@ public class PagamentoConstants {
public static String mezzoToLabel(String mezzo) {
return mezzoToLabel.get(mezzo);
}
}
}

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

@ -38,4 +38,4 @@ public class ParamUtil extends com.liferay.portal.kernel.util.ParamUtil {
}
return PortalUtil.getDate(month, day, year, hour, minute, null);
}
}
}

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(SOTTOPOSTA_A_PARERE, "label.admingeniocivile.statopratica.sottopostaaparere");
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 {
esitoDeposito = new HashMap<>();
esitoDeposito.putAll(esitoAutorizzazione);
esitoAutorizzazione.put(CONFORME, getLabel(AUTORIZZATA));
esitoAutorizzazione.put(NON_CONFORME, getLabel(NON_AUTORIZZATA));
esitoDeposito.put(CONFORME, getLabel(CONFORME));
esitoDeposito.put(NON_CONFORME, getLabel(NON_CONFORME));
}
public static String getStatusLabel(String statoPratica) {
return statusLabel.get(statoPratica);
}
public static String getEsitoAutorizzazione(String esito) {
if (esitoAutorizzazione.containsKey(esito)) {
return esitoAutorizzazione.get(esito);
}
@ -100,6 +102,7 @@ public class StatoPraticaConstants {
}
public static String getEsitoDeposito(String esito) {
if (esitoDeposito.containsKey(esito)) {
return esitoDeposito.get(esito);
}
@ -107,6 +110,7 @@ public class StatoPraticaConstants {
}
private static String getLabel(String 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 VARIANTE = "13";
@SuppressWarnings("serial")
private static final List<String> outOfWorkflow = new ArrayList<String>() {
{
add(VARIAZIONE_SOGGETTO);

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

@ -2,5 +2,10 @@
<classpath>
<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="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"/>
</classpath>

Some files were not shown because too many files have changed in this diff Show More

Caricamento…
Annulla
Salva