Salvatore La Manna 3 anni fa
parent
commit
9bf257d7fc
  1. 54
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java
  2. 57
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java
  3. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java
  4. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties
  5. 24
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java
  6. 26
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java
  7. 157
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java
  8. 170
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java
  9. 163
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java
  10. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java
  11. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java
  12. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java
  13. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java
  14. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java
  15. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java
  16. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java
  17. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java
  18. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java
  19. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java
  20. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java
  21. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java
  22. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java
  23. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java
  24. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java
  25. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java
  26. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java
  27. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java
  28. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java
  29. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java
  30. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java
  31. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java
  32. 326
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp
  33. 315
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp
  34. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf
  35. 295
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp
  36. 83
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp

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

@ -17,6 +17,8 @@ import java.util.Properties;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
@ -54,7 +56,7 @@ public class ControlloPraticaAdvancedSearch {
public static final String[] OVERRIDE_KEYWORDS = { "controlloPraticaId", "numeroProgetto", "tipoPratica", public static final String[] OVERRIDE_KEYWORDS = { "controlloPraticaId", "numeroProgetto", "tipoPratica",
"statoPratica", "dataRichiesta", "committente", "soggettiInteressati", "status", "entryClassName", "statoPratica", "dataRichiesta", "committente", "soggettiInteressati", "status", "entryClassName",
"userId", "descIntervento" }; "userId", "descIntervento", "tipoProcedura" };
public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd"); public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
@ -515,11 +517,13 @@ public class ControlloPraticaAdvancedSearch {
String committenteSearch = ParamUtil.getString(request, "committente"); String committenteSearch = ParamUtil.getString(request, "committente");
String soggettiInterconnessiSearch = ParamUtil.getString(request, "soggettiInterconnessi"); String soggettiInterconnessiSearch = ParamUtil.getString(request, "soggettiInterconnessi");
String istruttoreId = ParamUtil.getString(request, "istruttore"); String istruttoreId = ParamUtil.getString(request, "istruttore");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio"); String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
String comune = ParamUtil.getString(request, "comune"); String comune = ParamUtil.getString(request, "comune");
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura");
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita"); String tipoAttivita = ParamUtil.getString(request, "tipoAttivita");
Long geologi = ParamUtil.getLong(request, "geologi");
Long parereGeologo = ParamUtil.getLong(request, "parereGeologo");
// ADT - BUG-11 Aggiunta filtro ricerca // ADT - BUG-11 Aggiunta filtro ricerca
String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio"); String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio");
try { try {
@ -575,6 +579,9 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(statoPraticaSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(statoPraticaSearchTermQuery, BooleanClauseOccur.MUST);
} }
} }
queryTipoProcedura(request, booleanQuery, searchContext);
if (Validator.isNotNull(committenteSearch)) { if (Validator.isNotNull(committenteSearch)) {
TermQuery committenteSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "committenti", TermQuery committenteSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "committenti",
committenteSearch.toUpperCase()); committenteSearch.toUpperCase());
@ -585,11 +592,30 @@ public class ControlloPraticaAdvancedSearch {
"soggettiInterconnessi", soggettiInterconnessiSearch.toUpperCase()); "soggettiInterconnessi", soggettiInterconnessiSearch.toUpperCase());
booleanQuery.add(soggettiInterconnessiSearchTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(soggettiInterconnessiSearchTermQuery, BooleanClauseOccur.MUST);
} }
if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1")) { if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1") && !istruttoreId.equals("0")) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId",
istruttoreId); istruttoreId);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} }
if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi",
geologi);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo",
parereGeologo);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) {
TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa",
unitaOperativa);
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(dataDa) && Validator.isNotNull(dataAl)) { if (Validator.isNotNull(dataDa) && Validator.isNotNull(dataAl)) {
Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa); Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa);
Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl); Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl);
@ -614,21 +640,35 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(comuneTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(comuneTermQuery, BooleanClauseOccur.MUST);
} }
if (Validator.isNotNull(tipoProcedura)) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, "tipoProcedura", tipoProcedura);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
// ADT - BUG-11 Aggiunta filtro ricerca // ADT - BUG-11 Aggiunta filtro ricerca
if (Validator.isNotNull(controlloObbligatorioSearch)) { if (Validator.isNotNull(controlloObbligatorioSearch)) {
TermQuery controlloObbligatorioTermQuery = TermQueryFactoryUtil.create(searchContext, TermQuery controlloObbligatorioTermQuery = TermQueryFactoryUtil.create(searchContext,
"controlloObbligatorio", controlloObbligatorioSearch); "controlloObbligatorio", controlloObbligatorioSearch);
booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST);
} }
} catch (ParseException | java.text.ParseException e) { } catch (ParseException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
} }
private static void queryTipoProcedura(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String tipoProcedura = ParamUtil.getString(request, PortosIndexField.TIPO_PROCEDURA);
if (Validator.isNotNull(tipoProcedura) && !tipoProcedura.equals("-1")) {
String[] procSplit = StringUtils.split(tipoProcedura, "|");
if(procSplit.length > 0){
for(String proc : procSplit){
BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext);
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PROCEDURA, proc);
bq.add(termQuery, BooleanClauseOccur.SHOULD);
booleanQuery.add(bq, BooleanClauseOccur.MUST);
}
}
}
}
private static Sort[] getOrderedQuery(HttpServletRequest request) { private static Sort[] getOrderedQuery(HttpServletRequest request) {
Properties properties = PropsUtil.getProperties("elasticsearch.", true); Properties properties = PropsUtil.getProperties("elasticsearch.", true);
String orderField = ParamUtil.getString(request, "ordinaPer", "numeroProgetto"); String orderField = ParamUtil.getString(request, "ordinaPer", "numeroProgetto");

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

@ -14,6 +14,8 @@ import java.util.Properties;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
@ -51,7 +53,8 @@ public class IntPraticaAdvancedSearch {
public static final String[] OVERRIDE_KEYWORDS = { PortosIndexField.INT_PRATICA_ID, public static final String[] OVERRIDE_KEYWORDS = { PortosIndexField.INT_PRATICA_ID,
PortosIndexField.NUMERO_PROGETTO, PortosIndexField.TIPO_PRATICA, PortosIndexField.STATO_PRATICA, PortosIndexField.NUMERO_PROGETTO, PortosIndexField.TIPO_PRATICA, PortosIndexField.STATO_PRATICA,
PortosIndexField.DATA_RICHIESTA, PortosIndexField.COMMITTENTE, PortosIndexField.SOGGETTI_INTERESSATI, PortosIndexField.DATA_RICHIESTA, PortosIndexField.COMMITTENTE, PortosIndexField.SOGGETTI_INTERESSATI,
PortosIndexField.STATUS, Field.ENTRY_CLASS_NAME, Field.USER_ID, PortosIndexField.DESC_INTERVENTO }; PortosIndexField.STATUS, Field.ENTRY_CLASS_NAME, Field.USER_ID, PortosIndexField.DESC_INTERVENTO,
PortosIndexField.TIPO_PROCEDURA };
public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd"); public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
@ -81,6 +84,7 @@ public class IntPraticaAdvancedSearch {
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive // Condizioni aggiuntive
query(request, user, booleanQuery, searchContext); query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery); hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits); logResults(user, booleanQuery, hits);
} catch (SearchException | ParseException e) { } catch (SearchException | ParseException e) {
@ -265,6 +269,11 @@ public class IntPraticaAdvancedSearch {
private static void query(HttpServletRequest request, User user, BooleanQuery booleanQuery, private static void query(HttpServletRequest request, User user, BooleanQuery booleanQuery,
SearchContext searchContext) { SearchContext searchContext) {
String istruttoreId = ParamUtil.getString(request, "istruttore");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
Long geologi = ParamUtil.getLong(request, "geologi");
Long parereGeologo = ParamUtil.getLong(request, "parereGeologo");
try { try {
TermQuery termQuery; TermQuery termQuery;
queryPraticaAperta(request, booleanQuery, searchContext); queryPraticaAperta(request, booleanQuery, searchContext);
@ -275,6 +284,7 @@ public class IntPraticaAdvancedSearch {
booleanQuery.add(termQuery, BooleanClauseOccur.MUST); booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
} }
queryTipoPratica(request, booleanQuery, searchContext); queryTipoPratica(request, booleanQuery, searchContext);
queryTipoProcedura(request, booleanQuery, searchContext);
String tipoIntervento = ParamUtil.getString(request, "tipoIntervento"); String tipoIntervento = ParamUtil.getString(request, "tipoIntervento");
if (Validator.isNotNull(tipoIntervento)) { if (Validator.isNotNull(tipoIntervento)) {
if (tipoIntervento.equals("interventoLocale")) { if (tipoIntervento.equals("interventoLocale")) {
@ -296,6 +306,7 @@ public class IntPraticaAdvancedSearch {
} }
queryStatoPratica(request, booleanQuery, searchContext); queryStatoPratica(request, booleanQuery, searchContext);
addRequiredTerms(booleanQuery, PortosIndexField.COMMITTENTI, ParamUtil.getString(request, "committente")); addRequiredTerms(booleanQuery, PortosIndexField.COMMITTENTI, ParamUtil.getString(request, "committente"));
addRequiredTerms(booleanQuery, PortosIndexField.ISTRUTTORE_FULL_NAME, addRequiredTerms(booleanQuery, PortosIndexField.ISTRUTTORE_FULL_NAME,
ParamUtil.getString(request, "tecnicoIstruttore")); ParamUtil.getString(request, "tecnicoIstruttore"));
addRequiredTerms(booleanQuery, PortosIndexField.PROPRIETARIO_DIGITALE_FULL_NAME, addRequiredTerms(booleanQuery, PortosIndexField.PROPRIETARIO_DIGITALE_FULL_NAME,
@ -310,6 +321,31 @@ public class IntPraticaAdvancedSearch {
} }
queryComune(request, booleanQuery, searchContext); queryComune(request, booleanQuery, searchContext);
queryDate(request, booleanQuery, searchContext); queryDate(request, booleanQuery, searchContext);
if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1") && !istruttoreId.equals("0")) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId",
istruttoreId);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) {
TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa",
unitaOperativa);
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi",
geologi);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo",
parereGeologo);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
} catch (ParseException | java.text.ParseException e) { } catch (ParseException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -447,6 +483,23 @@ public class IntPraticaAdvancedSearch {
} }
} }
private static void queryTipoProcedura(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String tipoProcedura = ParamUtil.getString(request, PortosIndexField.TIPO_PROCEDURA);
if (Validator.isNotNull(tipoProcedura) && !tipoProcedura.equals("-1")) {
String[] procSplit = StringUtils.split(tipoProcedura, "|");
if(procSplit.length > 0){
for(String proc : procSplit){
BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext);
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PROCEDURA, proc);
bq.add(termQuery, BooleanClauseOccur.SHOULD);
booleanQuery.add(bq, BooleanClauseOccur.MUST);
}
}
}
}
private static void queryStatoPratica(HttpServletRequest request, BooleanQuery booleanQuery, private static void queryStatoPratica(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException { SearchContext searchContext) throws ParseException {
@ -475,6 +528,8 @@ public class IntPraticaAdvancedSearch {
termQuery = TermQueryFactoryUtil.create(searchContext, "dtPratica", "0"); termQuery = TermQueryFactoryUtil.create(searchContext, "dtPratica", "0");
else if (statoPratica.equals(StatoPraticaConstants.VARIATA)) else if (statoPratica.equals(StatoPraticaConstants.VARIATA))
termQuery = TermQueryFactoryUtil.create(searchContext, "variata", StringPool.TRUE); termQuery = TermQueryFactoryUtil.create(searchContext, "variata", StringPool.TRUE);
else if(statoPratica.equals(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L);
else if (!statoPratica.equals("-1")) else if (!statoPratica.equals("-1"))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.STATO_PRATICA, statoPratica); termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.STATO_PRATICA, statoPratica);
if (Validator.isNotNull(termQuery)) if (Validator.isNotNull(termQuery))

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

@ -48,6 +48,7 @@ public class PortosIndexField implements Serializable {
public static final String PROPRIETARIO_DIGITALE_FULL_NAME = "proprietarioDigitaleFullName"; public static final String PROPRIETARIO_DIGITALE_FULL_NAME = "proprietarioDigitaleFullName";
public static final String ISTRUTTORE_USERNAME = "istruttoreUsername"; public static final String ISTRUTTORE_USERNAME = "istruttoreUsername";
public static final String PARERE_GEOLOGO = "parereGeologo"; public static final String PARERE_GEOLOGO = "parereGeologo";
public static final String GEOLOGI = "geologi";
public static final String COMUNE_ID = "comuneId"; public static final String COMUNE_ID = "comuneId";
public static final String COMUNE_DENOMINAZIONE = "comuneDenominazione"; public static final String COMUNE_DENOMINAZIONE = "comuneDenominazione";
public static final String PROVINCIA_ID = "provinciaId"; public static final String PROVINCIA_ID = "provinciaId";
@ -71,4 +72,5 @@ public class PortosIndexField implements Serializable {
public static final String TIPO_PROCEDURA = "tipoProcedura"; public static final String TIPO_PROCEDURA = "tipoProcedura";
public static final String UNITA_OPERATIVA = "unitaOperativa"; public static final String UNITA_OPERATIVA = "unitaOperativa";
public static final String IN_LAVORAZIONE_SUE = "inLavorazioneSue"; public static final String IN_LAVORAZIONE_SUE = "inLavorazioneSue";
public static final String ASSEGNATA_AD_ISTRUTTORE = "assegnataAdIstruttore";
} }

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

@ -17,6 +17,8 @@ tipo-pratica-01 = Deposito
tipo-pratica-02 = Autorizzazione tipo-pratica-02 = Autorizzazione
tipo-pratica-03 = Sanatoria tipo-pratica-03 = Sanatoria
in-corso = In corso
stato-pratica-AL = Annullata stato-pratica-AL = Annullata
stato-pratica-AU = Autorizzata stato-pratica-AU = Autorizzata
stato-pratica-AV = Attestazione vincoli stato-pratica-AV = Attestazione vincoli

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

@ -4,6 +4,7 @@ import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Provincia;
import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.model.Territorio;
@ -11,6 +12,7 @@ import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
@ -111,7 +113,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
document.addKeyword("entryClassName", ControlloPratica.class.getName()); document.addKeyword("entryClassName", ControlloPratica.class.getName());
document.addKeyword(PortosIndexField.CONTROLLO_PRATICA_ID, controlloPraticaFromDB.getControlloPraticaId()); document.addKeyword(PortosIndexField.CONTROLLO_PRATICA_ID, controlloPraticaFromDB.getControlloPraticaId());
document.addKeyword(PortosIndexField.DETT_PRATICA_ID, controlloPraticaFromDB.getDettPraticaId()); document.addKeyword(PortosIndexField.DETT_PRATICA_ID, controlloPraticaFromDB.getDettPraticaId());
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, controlloPraticaFromDB.getParereGeologo()); //document.addKeyword(PortosIndexField.PARERE_GEOLOGO, controlloPraticaFromDB.getParereGeologo());
document.addKeyword(PortosIndexField.STATUS, controlloPraticaFromDB.getStatus()); document.addKeyword(PortosIndexField.STATUS, controlloPraticaFromDB.getStatus());
document.addKeyword(PortosIndexField.STATUS_BY_USERID, controlloPraticaFromDB.getStatusByUserId()); document.addKeyword(PortosIndexField.STATUS_BY_USERID, controlloPraticaFromDB.getStatusByUserId());
document.addKeyword(PortosIndexField.STATUS_BY_USERNAME, controlloPraticaFromDB.getStatusByUserName()); document.addKeyword(PortosIndexField.STATUS_BY_USERNAME, controlloPraticaFromDB.getStatusByUserName());
@ -121,6 +123,22 @@ public class ControlloPraticaIndexer extends BaseIndexer {
} else { } else {
document.addKeyword(PortosIndexField.STATUS_DATE, 0); document.addKeyword(PortosIndexField.STATUS_DATE, 0);
} }
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
controlloPraticaFromDB.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<Long>();
for(ParereGeologo geo : listaParereGeologo){
idGeologi.add(geo.getGeologoUserId());
}
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L);
} else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L);
}
document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0]));
document.addKeyword(PortosIndexField.DATA_INIZIO_PROCEDIMENTO, document.addKeyword(PortosIndexField.DATA_INIZIO_PROCEDIMENTO,
DATE_FORMAT.format(controlloPraticaFromDB.getCreateDate())); DATE_FORMAT.format(controlloPraticaFromDB.getCreateDate()));
document.addKeywordSortable(PortosIndexField.DATA_INIZIO_PROCEDIMENTO, document.addKeywordSortable(PortosIndexField.DATA_INIZIO_PROCEDIMENTO,
@ -138,7 +156,11 @@ public class ControlloPraticaIndexer extends BaseIndexer {
document.addKeyword(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName() document.addKeyword(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName()
.toUpperCase()); .toUpperCase());
} }
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L);
}else{
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L);
} }
if (intPratica.getUserId() != 0L) { if (intPratica.getUserId() != 0L) {
User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId()); User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId());
if (Validator.isNotNull(proprietarioDigitale)) { if (Validator.isNotNull(proprietarioDigitale)) {

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

@ -29,6 +29,7 @@ import java.util.Locale;
import javax.portlet.PortletURL; import javax.portlet.PortletURL;
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
@ -133,6 +134,7 @@ public class IntPraticaIndexer extends BaseIndexer {
document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO, document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO,
Integer.valueOf(intPraticaFromDB.getNumeroProgetto())); Integer.valueOf(intPraticaFromDB.getNumeroProgetto()));
} }
document.addKeyword(PortosIndexField.TIPO_PROCEDURA, intPraticaFromDB.getTipoProcedura());
document.addKeyword(PortosIndexField.IN_LAVORAZIONE_SUE, intPraticaFromDB.getInLavorazioneSue()); document.addKeyword(PortosIndexField.IN_LAVORAZIONE_SUE, intPraticaFromDB.getInLavorazioneSue());
if (lastDettPratica != null) { if (lastDettPratica != null) {
document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione()); document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione());
@ -191,13 +193,21 @@ public class IntPraticaIndexer extends BaseIndexer {
document.addKeyword(PortosIndexField.ISTRUTTORE_USERNAME, document.addKeyword(PortosIndexField.ISTRUTTORE_USERNAME,
UserLocalServiceUtil.getUser(intPraticaFromDB.getStatusByUserId()).getScreenName() UserLocalServiceUtil.getUser(intPraticaFromDB.getStatusByUserId()).getScreenName()
.toUpperCase()); .toUpperCase());
} }
if (intPratica.getStatusByUserId() != 0L) { if (intPratica.getStatusByUserId() != 0L) {
User userIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); User userIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId());
if (userIstruttore != null) { if (userIstruttore != null) {
document.addText(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName()); document.addText(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName());
} }
if(intPratica.getStatoPratica().equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE))
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L);
else
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L);
}else{
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L);
} }
if (intPratica.getUserId() != 0L) { if (intPratica.getUserId() != 0L) {
User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId()); User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId());
if (proprietarioDigitale != null) { if (proprietarioDigitale != null) {
@ -245,14 +255,24 @@ public class IntPraticaIndexer extends BaseIndexer {
} }
document.addKeyword(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); document.addKeyword(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica());
document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica());
document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPraticaFromDB.getUnitaOperativa());
// Gestione Parere Geologo // Gestione Parere Geologo
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId( List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
intPratica.getIntPraticaId(), 0, 1); intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<Long>();
for(ParereGeologo geo : listaParereGeologo){
idGeologi.add(geo.getGeologoUserId());
}
document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0]));
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) { if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.TRUE); document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L);
} else { } else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.FALSE); document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L);
} }
// Gestione pratica sospesa // Gestione pratica sospesa
document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa()); document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa());
// Gestione Diverse tipologie di IntPratica MIEI PROGETTI && ARCHIVIO PROGETTI // Gestione Diverse tipologie di IntPratica MIEI PROGETTI && ARCHIVIO PROGETTI

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

@ -21,8 +21,10 @@ import it.tref.liferay.portos.bo.service.ParereGeologoServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import it.tref.liferay.portos.bo.util.DocumentiPraticaUtil; import it.tref.liferay.portos.bo.util.DocumentiPraticaUtil;
import it.tref.liferay.portos.bo.util.PraticaUtil; import it.tref.liferay.portos.bo.util.PraticaUtil;
import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil; import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil;
@ -77,9 +79,15 @@ import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.kernel.zip.ZipWriter; import com.liferay.portal.kernel.zip.ZipWriter;
import com.liferay.portal.kernel.zip.ZipWriterFactoryUtil; import com.liferay.portal.kernel.zip.ZipWriterFactoryUtil;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
import com.liferay.portal.model.UserGroupRole;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
@ -240,21 +248,22 @@ public class FascicoloPortlet extends MVCPortlet {
public void searchURL(ActionRequest actionRequest, ActionResponse actionResponse) { public void searchURL(ActionRequest actionRequest, ActionResponse actionResponse) {
String numeroProgetto = actionRequest.getParameter("numeroProgetto"); String numeroProgetto = actionRequest.getParameter("numeroProgetto");
String protocollo = actionRequest.getParameter("protocollo");
String tipoPratica = actionRequest.getParameter("tipoPratica");
String statoPratica = actionRequest.getParameter("statoPratica"); String statoPratica = actionRequest.getParameter("statoPratica");
String committente = actionRequest.getParameter("committente"); String committente = actionRequest.getParameter("committente");
String descInterventoSearch = actionRequest.getParameter("descIntervento");
String tecnicoIstruttore = actionRequest.getParameter("tecnicoIstruttore"); String tecnicoIstruttore = actionRequest.getParameter("tecnicoIstruttore");
String titolareDigitale = actionRequest.getParameter("titolareDigitale"); String titolareDigitale = actionRequest.getParameter("titolareDigitale");
String soggettiInterconnessi = actionRequest.getParameter("soggettiInterconnessi"); String soggettiInterconnessi = actionRequest.getParameter("soggettiInterconnessi");
String dataRichiestaInizio = actionRequest.getParameter("dataRichiestaInizio"); String dataRichiestaInizio = actionRequest.getParameter("dataRichiestaInizio");
String dataRichiestaFine = actionRequest.getParameter("dataRichiestaFine"); String dataRichiestaFine = actionRequest.getParameter("dataRichiestaFine");
String provincia = actionRequest.getParameter("provincia"); String provincia = actionRequest.getParameter("provincia");
String praticaAperta = actionRequest.getParameter("praticaAperta");
String comune = actionRequest.getParameter("comune"); String comune = actionRequest.getParameter("comune");
String tipoIntervento = actionRequest.getParameter("tipoIntervento"); String tipoIntervento = actionRequest.getParameter("tipoIntervento");
String indirizzo = actionRequest.getParameter("indirizzo"); String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
String istruttore = ParamUtil.getString(actionRequest, "istruttore");
if (Validator.isNotNull(dataRichiestaInizio)) { if (Validator.isNotNull(dataRichiestaInizio)) {
String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split(StringPool.FORWARD_SLASH); String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split(StringPool.FORWARD_SLASH);
actionResponse.setRenderParameter("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]); actionResponse.setRenderParameter("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]);
@ -276,11 +285,10 @@ public class FascicoloPortlet extends MVCPortlet {
actionResponse.setRenderParameter("tipoIntervento", tipoIntervento); actionResponse.setRenderParameter("tipoIntervento", tipoIntervento);
} }
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
actionResponse.setRenderParameter("praticaAperta", praticaAperta); //actionResponse.setRenderParameter("praticaAperta", praticaAperta);
actionResponse.setRenderParameter("descIntervento", descInterventoSearch); //actionResponse.setRenderParameter("descIntervento", descInterventoSearch);
actionResponse.setRenderParameter("protocollo", protocollo); //actionResponse.setRenderParameter("protocollo", protocollo);
actionResponse.setRenderParameter("tipoPratica", tipoPratica); //actionResponse.setRenderParameter("tipoPratica", tipoPratica);
actionResponse.setRenderParameter("tipoPratica", tipoPratica);
actionResponse.setRenderParameter("statoPratica", statoPratica); actionResponse.setRenderParameter("statoPratica", statoPratica);
actionResponse.setRenderParameter("committente", committente); actionResponse.setRenderParameter("committente", committente);
if (Validator.isNotNull(provincia)) { if (Validator.isNotNull(provincia)) {
@ -289,7 +297,7 @@ public class FascicoloPortlet extends MVCPortlet {
if (Validator.isNotNull(comune)) { if (Validator.isNotNull(comune)) {
actionResponse.setRenderParameter("comune", comune); actionResponse.setRenderParameter("comune", comune);
} }
actionResponse.setRenderParameter("indirizzo", indirizzo); //actionResponse.setRenderParameter("indirizzo", indirizzo);
if (Validator.isNull(tecnicoIstruttore)) { if (Validator.isNull(tecnicoIstruttore)) {
actionResponse.setRenderParameter("tecnicoIstruttore", StringPool.BLANK); actionResponse.setRenderParameter("tecnicoIstruttore", StringPool.BLANK);
} else { } else {
@ -306,12 +314,23 @@ public class FascicoloPortlet extends MVCPortlet {
} }
actionResponse.setRenderParameter("ordinaPer", ordinaPer); actionResponse.setRenderParameter("ordinaPer", ordinaPer);
actionResponse.setRenderParameter("ordinaTipo", ordinaTipo); actionResponse.setRenderParameter("ordinaTipo", ordinaTipo);
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
actionResponse.setRenderParameter("istruttore", istruttore);
} }
@Override @Override
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException,
PortletException { PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale();
User user = themeDisplay.getUser();
String id = resourceRequest.getResourceID(); String id = resourceRequest.getResourceID();
try { try {
if ("downloadAllDocPratica".equals(id)) { if ("downloadAllDocPratica".equals(id)) {
@ -364,12 +383,33 @@ public class FascicoloPortlet extends MVCPortlet {
resourceResponse.getPortletOutputStream().write(data); resourceResponse.getPortletOutputStream().write(data);
resourceResponse.getPortletOutputStream().flush(); resourceResponse.getPortletOutputStream().flush();
resourceResponse.getPortletOutputStream().close(); resourceResponse.getPortletOutputStream().close();
} else if ("province".equals(id)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<String> province = TerritorioLocalServiceUtil.getActiveProvince();
for (String codiceProvincia : province) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), codiceProvincia);
jsonObject.put("provinciaId", provincia.getCodiceProvincia());
jsonObject.put("descLong", provincia.getSigla() + " - " + provincia.getProvincia());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("unitaOperative".equals(id)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for(int i=1; i<11; i++) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("uoId", i);
jsonObject.put("descLong", i);
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("comuni".equals(id)) { }else if ("comuni".equals(id)) {
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) { if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) {
List<Long> comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId); List<Long> comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId);
// ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro
List<Comune> comumeList = new ArrayList<Comune>(); List<Comune> comumeList = new ArrayList<Comune>();
for (long comuneId : comuniIds) { for (long comuneId : comuniIds) {
Comune comune = ComuneLocalServiceUtil.getComune(comuneId); Comune comune = ComuneLocalServiceUtil.getComune(comuneId);
@ -389,10 +429,97 @@ public class FascicoloPortlet extends MVCPortlet {
} }
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("istruttore".equals(id)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore");
List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
org.getGroupId(), role.getRoleId());
for (UserGroupRole userGroupRole : istruttori) {
User istruttore = userGroupRole.getUser();
List<Integer> unitaOperativeIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore);
if(unitaOperativeIstruttore.contains(uoId)){
if (tecniciIstruttori.isEmpty()) {
tecniciIstruttori.add(userGroupRole);
} else {
boolean isPresent = false;
for(UserGroupRole tecnico : tecniciIstruttori) {
if (tecnico.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
tecniciIstruttori.add(userGroupRole);
}
}
}
}
}
List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>();
for (UserGroupRole tecnico : tecniciIstruttori) {
IstruttoreBean istruttore = new IstruttoreBean();
istruttore.setIdIstruttore(tecnico.getUserId());
istruttore.setDenominazione(tecnico.getUser().getFullName());
tecniciIstruttoriSorted.add(istruttore);
}
Collections.sort(tecniciIstruttoriSorted);
for (IstruttoreBean istruttore : tecniciIstruttoriSorted) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("istruttoreId", istruttore.getIdIstruttore());
jsonObject.put("descLong", istruttore.getDenominazione());
jsonArray.put(jsonObject);
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(id)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
}
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("exportRicerca".equals(id)) { } else if ("exportRicerca".equals(id)) {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale();
User user = themeDisplay.getUser();
String csv = StringPool.BLANK; String csv = StringPool.BLANK;
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest);
HttpServletResponse response = PortalUtil.getHttpServletResponse(resourceResponse); HttpServletResponse response = PortalUtil.getHttpServletResponse(resourceResponse);

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

@ -15,13 +15,17 @@ import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -52,7 +56,14 @@ import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
import com.liferay.portal.model.UserGroupRole;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
@ -79,7 +90,6 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
String ufficio = ParamUtil.getString(actionRequest, "ufficio"); String ufficio = ParamUtil.getString(actionRequest, "ufficio");
String ordinaPer = ParamUtil.getString(actionRequest, "ordinaPer"); String ordinaPer = ParamUtil.getString(actionRequest, "ordinaPer");
String ordinaTipo = ParamUtil.getString(actionRequest, "ordinaTipo"); String ordinaTipo = ParamUtil.getString(actionRequest, "ordinaTipo");
String comune = ParamUtil.getString(actionRequest, "comune");
String praticaAperta = ParamUtil.getString(actionRequest, "praticaAperta"); String praticaAperta = ParamUtil.getString(actionRequest, "praticaAperta");
String interventoTutti = ParamUtil.getString(actionRequest, "interventoTutti"); String interventoTutti = ParamUtil.getString(actionRequest, "interventoTutti");
String interventoNuovaCostruzione = ParamUtil.getString(actionRequest, "interventoNuovaCostruzione"); String interventoNuovaCostruzione = ParamUtil.getString(actionRequest, "interventoNuovaCostruzione");
@ -87,6 +97,15 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
String interventoMiglioramentoSismico = ParamUtil.getString(actionRequest, "interventoMiglioramentoSismico"); String interventoMiglioramentoSismico = ParamUtil.getString(actionRequest, "interventoMiglioramentoSismico");
String interventoRiparazioneInterventoLocale = ParamUtil.getString(actionRequest, String interventoRiparazioneInterventoLocale = ParamUtil.getString(actionRequest,
"interventoRiparazioneInterventoLocale"); "interventoRiparazioneInterventoLocale");
String comune = ParamUtil.getString(actionRequest, "comune");
String tipoAttivita = ParamUtil.getString(actionRequest, "tipoAttivita");
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String provincia = ParamUtil.getString(actionRequest, "provincia");
String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
String istruttore = ParamUtil.getString(actionRequest, "istruttore");
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
actionResponse.setRenderParameter("tipoPratica", tipoPratica); actionResponse.setRenderParameter("tipoPratica", tipoPratica);
actionResponse.setRenderParameter("statoPratica", statoPratica); actionResponse.setRenderParameter("statoPratica", statoPratica);
@ -106,6 +125,13 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
actionResponse.setRenderParameter("interventoMiglioramentoSismico", interventoMiglioramentoSismico); actionResponse.setRenderParameter("interventoMiglioramentoSismico", interventoMiglioramentoSismico);
actionResponse.setRenderParameter("interventoRiparazioneInterventoLocale", actionResponse.setRenderParameter("interventoRiparazioneInterventoLocale",
interventoRiparazioneInterventoLocale); interventoRiparazioneInterventoLocale);
actionResponse.setRenderParameter("tipoAttivita", tipoAttivita);
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("provincia", provincia);
actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
actionResponse.setRenderParameter("istruttore", istruttore);
} }
@Override @Override
@ -238,6 +264,7 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
} }
// ADT BUG-ID=16 Sezione Pratiche Assegnate // ADT BUG-ID=16 Sezione Pratiche Assegnate
User user = themeDisplay.getUser(); User user = themeDisplay.getUser();
try{
if ("comuniForUfficio".equals(resourceId)) { if ("comuniForUfficio".equals(resourceId)) {
String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); String ufficio = ParamUtil.getString(resourceRequest, "ufficioId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
@ -269,7 +296,148 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
e.printStackTrace(); e.printStackTrace();
} }
} }
}else if ("province".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<String> province = TerritorioLocalServiceUtil.getActiveProvince();
for (String codiceProvincia : province) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), codiceProvincia);
jsonObject.put("provinciaId", provincia.getCodiceProvincia());
jsonObject.put("descLong", provincia.getSigla() + " - " + provincia.getProvincia());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("unitaOperative".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for(int i=1; i<11; i++) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("uoId", i);
jsonObject.put("descLong", i);
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("comuni".equals(resourceId)) {
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) {
List<Long> comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId);
List<Comune> comumeList = new ArrayList<Comune>();
for (long comuneId : comuniIds) {
Comune comune = ComuneLocalServiceUtil.getComune(comuneId);
comumeList.add(comune);
}
Collections.sort(comumeList, new Comparator<Comune>() {
@Override
public int compare(Comune o1, Comune o2) {
return o1.getDenominazione().compareTo(o2.getDenominazione());
}
});
for (Comune comune : comumeList) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("istruttore".equals(resourceId)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore");
List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
org.getGroupId(), role.getRoleId());
for (UserGroupRole userGroupRole : istruttori) {
User istruttore = userGroupRole.getUser();
List<Integer> unitaOperativeIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore);
if(unitaOperativeIstruttore.contains(uoId)){
if (tecniciIstruttori.isEmpty()) {
tecniciIstruttori.add(userGroupRole);
} else {
boolean isPresent = false;
for(UserGroupRole tecnico : tecniciIstruttori) {
if (tecnico.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
tecniciIstruttori.add(userGroupRole);
}
}
}
}
} }
List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>();
for (UserGroupRole tecnico : tecniciIstruttori) {
IstruttoreBean istruttore = new IstruttoreBean();
istruttore.setIdIstruttore(tecnico.getUserId());
istruttore.setDenominazione(tecnico.getUser().getFullName());
tecniciIstruttoriSorted.add(istruttore);
}
Collections.sort(tecniciIstruttoriSorted);
for (IstruttoreBean istruttore : tecniciIstruttoriSorted) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("istruttoreId", istruttore.getIdIstruttore());
jsonObject.put("descLong", istruttore.getDenominazione());
jsonArray.put(jsonObject);
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
}
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}
}catch (Exception e) {
_log.error(e, e);
throw new IOException(e);
}
super.serveResource(resourceRequest, resourceResponse); super.serveResource(resourceRequest, resourceResponse);
} }
} }

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

@ -16,8 +16,11 @@ import it.tref.liferay.portos.bo.service.ParereGeologoServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.service.permission.IntPraticaPermission; import it.tref.liferay.portos.bo.service.permission.IntPraticaPermission;
import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean;
import it.tref.liferay.portos.bo.shared.bean.ParereGeologoBean;
import it.tref.liferay.portos.bo.shared.util.ActionKeys; import it.tref.liferay.portos.bo.shared.util.ActionKeys;
import it.tref.liferay.portos.bo.shared.util.Constants; import it.tref.liferay.portos.bo.shared.util.Constants;
import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import it.tref.liferay.portos.bo.util.AvvisoUtil; import it.tref.liferay.portos.bo.util.AvvisoUtil;
import it.tref.liferay.portos.bo.util.MailUtil; import it.tref.liferay.portos.bo.util.MailUtil;
import it.tref.liferay.portos.bo.util.WorkflowUtil; import it.tref.liferay.portos.bo.util.WorkflowUtil;
@ -25,6 +28,8 @@ import it.tref.liferay.portos.bo.util.WorkflowUtil;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -62,13 +67,17 @@ import com.liferay.portal.kernel.workflow.WorkflowInstance;
import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil; import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil;
import com.liferay.portal.kernel.workflow.WorkflowTask; import com.liferay.portal.kernel.workflow.WorkflowTask;
import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil; import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role; import com.liferay.portal.model.Role;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
import com.liferay.portal.model.UserGroupRole;
import com.liferay.portal.model.WorkflowInstanceLink; import com.liferay.portal.model.WorkflowInstanceLink;
import com.liferay.portal.security.permission.PermissionThreadLocal; import com.liferay.portal.security.permission.PermissionThreadLocal;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil; import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
@ -97,6 +106,11 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
String comune = ParamUtil.getString(actionRequest, "comune"); String comune = ParamUtil.getString(actionRequest, "comune");
String tipoAttivita = ParamUtil.getString(actionRequest, "tipoAttivita"); String tipoAttivita = ParamUtil.getString(actionRequest, "tipoAttivita");
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String provincia = ParamUtil.getString(actionRequest, "provincia");
String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
actionResponse.setRenderParameter("tabs1", tabs1); actionResponse.setRenderParameter("tabs1", tabs1);
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
actionResponse.setRenderParameter("protocollo", protocollo); actionResponse.setRenderParameter("protocollo", protocollo);
@ -134,6 +148,10 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
actionResponse.setRenderParameter("comune", comune); actionResponse.setRenderParameter("comune", comune);
actionResponse.setRenderParameter("tipoAttivita", tipoAttivita); actionResponse.setRenderParameter("tipoAttivita", tipoAttivita);
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("provincia", provincia);
actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
} }
public void cambioIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) { public void cambioIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) {
@ -257,6 +275,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
PortletException { PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale(); Locale locale = themeDisplay.getLocale();
User user = themeDisplay.getUser(); User user = themeDisplay.getUser();
String cmd = ParamUtil.getString(resourceRequest, Constants.CMD); String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);
@ -273,7 +292,10 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
csv = exportSearch(locale, resourceRequest, user, cmd); csv = exportSearch(locale, resourceRequest, user, cmd);
} }
// ADT BUG BO ID= 1 SEZIONE ATTIVITÀ // ADT BUG BO ID= 1 SEZIONE ATTIVITÀ
try{
if ("comuniForUfficio".equals(id)) { if ("comuniForUfficio".equals(id)) {
String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); String ufficio = ParamUtil.getString(resourceRequest, "ufficioId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Comune> comuni; List<Comune> comuni;
@ -305,7 +327,148 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
e.printStackTrace(); e.printStackTrace();
} }
} }
}else if ("province".equals(id)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<String> province = TerritorioLocalServiceUtil.getActiveProvince();
for (String codiceProvincia : province) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), codiceProvincia);
jsonObject.put("provinciaId", provincia.getCodiceProvincia());
jsonObject.put("descLong", provincia.getSigla() + " - " + provincia.getProvincia());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("unitaOperative".equals(id)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for(int i=1; i<11; i++) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("uoId", i);
jsonObject.put("descLong", i);
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("comuni".equals(id)) {
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) {
List<Long> comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId);
List<Comune> comumeList = new ArrayList<Comune>();
for (long comuneId : comuniIds) {
Comune comune = ComuneLocalServiceUtil.getComune(comuneId);
comumeList.add(comune);
}
Collections.sort(comumeList, new Comparator<Comune>() {
@Override
public int compare(Comune o1, Comune o2) {
return o1.getDenominazione().compareTo(o2.getDenominazione());
}
});
for (Comune comune : comumeList) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("istruttore".equals(id)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore");
List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
org.getGroupId(), role.getRoleId());
for (UserGroupRole userGroupRole : istruttori) {
User istruttore = userGroupRole.getUser();
List<Integer> unitaOperativeIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore);
if(unitaOperativeIstruttore.contains(uoId)){
if (tecniciIstruttori.isEmpty()) {
tecniciIstruttori.add(userGroupRole);
} else {
boolean isPresent = false;
for(UserGroupRole tecnico : tecniciIstruttori) {
if (tecnico.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
tecniciIstruttori.add(userGroupRole);
}
}
}
} }
}
List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>();
for (UserGroupRole tecnico : tecniciIstruttori) {
IstruttoreBean istruttore = new IstruttoreBean();
istruttore.setIdIstruttore(tecnico.getUserId());
istruttore.setDenominazione(tecnico.getUser().getFullName());
tecniciIstruttoriSorted.add(istruttore);
}
Collections.sort(tecniciIstruttoriSorted);
for (IstruttoreBean istruttore : tecniciIstruttoriSorted) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("istruttoreId", istruttore.getIdIstruttore());
jsonObject.put("descLong", istruttore.getDenominazione());
jsonArray.put(jsonObject);
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(id)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
}
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}
}catch (Exception e) {
_log.error(e, e);
throw new IOException(e);
}
ServletResponseUtil.sendFile(request, response, "export_pratiche.csv", csv.getBytes(StringPool.UTF8), ServletResponseUtil.sendFile(request, response, "export_pratiche.csv", csv.getBytes(StringPool.UTF8),
ContentTypes.TEXT_CSV_UTF8); ContentTypes.TEXT_CSV_UTF8);
} }

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchAllegatoManualeException;
import it.tref.liferay.portos.bo.model.AllegatoManuale; import it.tref.liferay.portos.bo.model.AllegatoManuale;
import it.tref.liferay.portos.bo.model.impl.AllegatoManualeImpl; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeImpl;
import it.tref.liferay.portos.bo.model.impl.AllegatoManualeModelImpl; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AllegatoManualePersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -46,7 +46,6 @@ import it.tref.liferay.portos.bo.NoSuchAsseverazioneException;
import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.Asseverazione;
import it.tref.liferay.portos.bo.model.impl.AsseverazioneImpl; import it.tref.liferay.portos.bo.model.impl.AsseverazioneImpl;
import it.tref.liferay.portos.bo.model.impl.AsseverazioneModelImpl; import it.tref.liferay.portos.bo.model.impl.AsseverazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AsseverazionePersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -46,7 +46,6 @@ import it.tref.liferay.portos.bo.NoSuchAvvisoException;
import it.tref.liferay.portos.bo.model.Avviso; import it.tref.liferay.portos.bo.model.Avviso;
import it.tref.liferay.portos.bo.model.impl.AvvisoImpl; import it.tref.liferay.portos.bo.model.impl.AvvisoImpl;
import it.tref.liferay.portos.bo.model.impl.AvvisoModelImpl; import it.tref.liferay.portos.bo.model.impl.AvvisoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AvvisoPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchCollaudoException;
import it.tref.liferay.portos.bo.model.Collaudo; import it.tref.liferay.portos.bo.model.Collaudo;
import it.tref.liferay.portos.bo.model.impl.CollaudoImpl; import it.tref.liferay.portos.bo.model.impl.CollaudoImpl;
import it.tref.liferay.portos.bo.model.impl.CollaudoModelImpl; import it.tref.liferay.portos.bo.model.impl.CollaudoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.CollaudoPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -46,7 +46,6 @@ import it.tref.liferay.portos.bo.NoSuchComuneException;
import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.impl.ComuneImpl; import it.tref.liferay.portos.bo.model.impl.ComuneImpl;
import it.tref.liferay.portos.bo.model.impl.ComuneModelImpl; import it.tref.liferay.portos.bo.model.impl.ComuneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ComunePersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchComunicazioneException;
import it.tref.liferay.portos.bo.model.Comunicazione; import it.tref.liferay.portos.bo.model.Comunicazione;
import it.tref.liferay.portos.bo.model.impl.ComunicazioneImpl; import it.tref.liferay.portos.bo.model.impl.ComunicazioneImpl;
import it.tref.liferay.portos.bo.model.impl.ComunicazioneModelImpl; import it.tref.liferay.portos.bo.model.impl.ComunicazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ComunicazionePersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchConfigurazioneException;
import it.tref.liferay.portos.bo.model.Configurazione; import it.tref.liferay.portos.bo.model.Configurazione;
import it.tref.liferay.portos.bo.model.impl.ConfigurazioneImpl; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneImpl;
import it.tref.liferay.portos.bo.model.impl.ConfigurazioneModelImpl; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ConfigurazionePersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchControlloPraticaException;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.impl.ControlloPraticaImpl; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.ControlloPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -46,7 +46,6 @@ import it.tref.liferay.portos.bo.NoSuchDelegaException;
import it.tref.liferay.portos.bo.model.Delega; import it.tref.liferay.portos.bo.model.Delega;
import it.tref.liferay.portos.bo.model.impl.DelegaImpl; import it.tref.liferay.portos.bo.model.impl.DelegaImpl;
import it.tref.liferay.portos.bo.model.impl.DelegaModelImpl; import it.tref.liferay.portos.bo.model.impl.DelegaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DelegaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchDettPraticaException;
import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.impl.DettPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DettPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.DettPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.DettPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DettPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchDocAggiuntivaException;
import it.tref.liferay.portos.bo.model.DocAggiuntiva; import it.tref.liferay.portos.bo.model.DocAggiuntiva;
import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaImpl; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaImpl;
import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaModelImpl; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DocAggiuntivaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -46,7 +46,6 @@ import it.tref.liferay.portos.bo.NoSuchDocPraticaException;
import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.DocPratica;
import it.tref.liferay.portos.bo.model.impl.DocPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DocPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.DocPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.DocPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DocPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchFineLavoriException;
import it.tref.liferay.portos.bo.model.FineLavori; import it.tref.liferay.portos.bo.model.FineLavori;
import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl; import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl;
import it.tref.liferay.portos.bo.model.impl.FineLavoriModelImpl; import it.tref.liferay.portos.bo.model.impl.FineLavoriModelImpl;
import it.tref.liferay.portos.bo.service.persistence.FineLavoriPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -42,7 +42,6 @@ import it.tref.liferay.portos.bo.NoSuchHistoryWorkflowActionException;
import it.tref.liferay.portos.bo.model.HistoryWorkflowAction; import it.tref.liferay.portos.bo.model.HistoryWorkflowAction;
import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionImpl; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionImpl;
import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionModelImpl; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionModelImpl;
import it.tref.liferay.portos.bo.service.persistence.HistoryWorkflowActionPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -48,7 +48,6 @@ import it.tref.liferay.portos.bo.NoSuchIntPraticaException;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.impl.IntPraticaImpl; import it.tref.liferay.portos.bo.model.impl.IntPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.IntPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.IntPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.IntPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -46,7 +46,6 @@ import it.tref.liferay.portos.bo.NoSuchPagamentoException;
import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.Pagamento;
import it.tref.liferay.portos.bo.model.impl.PagamentoImpl; import it.tref.liferay.portos.bo.model.impl.PagamentoImpl;
import it.tref.liferay.portos.bo.model.impl.PagamentoModelImpl; import it.tref.liferay.portos.bo.model.impl.PagamentoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.PagamentoPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchParereGeologoException;
import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.impl.ParereGeologoImpl; import it.tref.liferay.portos.bo.model.impl.ParereGeologoImpl;
import it.tref.liferay.portos.bo.model.impl.ParereGeologoModelImpl; import it.tref.liferay.portos.bo.model.impl.ParereGeologoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ParereGeologoPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -43,7 +43,6 @@ import it.tref.liferay.portos.bo.NoSuchProvinciaException;
import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Provincia;
import it.tref.liferay.portos.bo.model.impl.ProvinciaImpl; import it.tref.liferay.portos.bo.model.impl.ProvinciaImpl;
import it.tref.liferay.portos.bo.model.impl.ProvinciaModelImpl; import it.tref.liferay.portos.bo.model.impl.ProvinciaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ProvinciaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchSoggettoException;
import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.impl.SoggettoImpl; import it.tref.liferay.portos.bo.model.impl.SoggettoImpl;
import it.tref.liferay.portos.bo.model.impl.SoggettoModelImpl; import it.tref.liferay.portos.bo.model.impl.SoggettoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.SoggettoPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -42,7 +42,6 @@ import it.tref.liferay.portos.bo.NoSuchStoricoSoggettoPraticaException;
import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica; import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica;
import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaImpl; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.StoricoSoggettoPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -45,7 +45,6 @@ import it.tref.liferay.portos.bo.NoSuchTempisticaException;
import it.tref.liferay.portos.bo.model.Tempistica; import it.tref.liferay.portos.bo.model.Tempistica;
import it.tref.liferay.portos.bo.model.impl.TempisticaImpl; import it.tref.liferay.portos.bo.model.impl.TempisticaImpl;
import it.tref.liferay.portos.bo.model.impl.TempisticaModelImpl; import it.tref.liferay.portos.bo.model.impl.TempisticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.TempisticaPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -44,7 +44,6 @@ import it.tref.liferay.portos.bo.NoSuchTerritorioException;
import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.model.impl.TerritorioImpl; import it.tref.liferay.portos.bo.model.impl.TerritorioImpl;
import it.tref.liferay.portos.bo.model.impl.TerritorioModelImpl; import it.tref.liferay.portos.bo.model.impl.TerritorioModelImpl;
import it.tref.liferay.portos.bo.service.persistence.TerritorioPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -1,5 +1,7 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page import="java.util.Collections"%> <%@page import="java.util.Collections"%>
<%@page import="java.util.Comparator"%> <%@page import="java.util.Comparator"%>
@ -10,8 +12,11 @@
} }
</style> </style>
<% <%
String comune = ParamUtil.getString(request, "comune"); String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String provinciaJS = ParamUtil.getString(request, "provinciaJS"); String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
%> %>
<liferay-ui:panel title="filters" defaultState="closed" <liferay-ui:panel title="filters" defaultState="closed"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false" id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false"
@ -22,148 +27,65 @@ String provinciaJS = ParamUtil.getString(request, "provinciaJS");
<aui:input type="text" name="numeroProgetto" label="Numero Progetto" /> <aui:input type="text" name="numeroProgetto" label="Numero Progetto" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="protocollo" label="Protocollo" /> <aui:select name="tipoProcedura" label="Tipo Pratica">
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="tipoPratica" label="Tipo Pratica">
<aui:option value="-1">Seleziona il tipo di pratica</aui:option> <aui:option value="-1">Seleziona il tipo di pratica</aui:option>
<aui:option value="01"><liferay-ui:message key="deposito"/></aui:option> <%
<aui:option value="02"><liferay-ui:message key="autorizzazione"/></aui:option> for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) {
<aui:option value="03"><liferay-ui:message key="sanatoria"/></aui:option> String tipo = procedura.getKey();
</aui:select> String label = procedura.getValue();
</div> String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label;
<div class="col-xs-12 col-md-3"> if(nomeProcedura.length() > 90)
<aui:select name="statoPratica" label="Stato Procedimento"> nomeProcedura = nomeProcedura.substring(0, 90) + "...";
<aui:option value="-1">Stato Pratica</aui:option> %>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>"> <aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option>
<liferay-ui:message key="annullata"/> <%
</aui:option> }
<aui:option value="<%= StatoPraticaConstants.AUTORIZZATA %>"> %>
<liferay-ui:message key="autorizzata"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_AUTORIZZATA %>">
<liferay-ui:message key="non autorizzata"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO %>">
<liferay-ui:message key="collaudo"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>">
<liferay-ui:message key="collaudo parziale"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>">
<liferay-ui:message key="conforme"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">
<liferay-ui:message key="non conforme"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>">
<liferay-ui:message key="fine lavori"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>">
<liferay-ui:message key="fine lavori parziali"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
<liferay-ui:message key="integrazione in corso"/>
</aui:option>
<aui:option value="sospesa"><liferay-ui:message key="sospesa"/></aui:option>
<aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>">
<liferay-ui:message key="sottoposta a parere"/>
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>">
<liferay-ui:message key="variata"/>
</aui:option>
</aui:select> </aui:select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6">
<aui:input label="Descrizione Intervento" name="descIntervento" type="text" placeholder="" />
</div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoIntervento" label="Tipo Intervento"> <aui:select name="provincia" label="Provincia" cssClass="provinciaSelect" />
<aui:option value="-1">Tipo Intervento</aui:option>
<aui:option value="interventoLocale"><liferay-ui:message key="Intervento Locale" /></aui:option>
<aui:option value="miglioramento"><liferay-ui:message key="Miglioramento Sismico" /></aui:option>
<aui:option value="adeguamento"><liferay-ui:message key="Adeguamento Sismico" /></aui:option>
<aui:option value="nuovaCostruzione"><liferay-ui:message key="Nuova Costruzione" /></aui:option>
</aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-sm-12 col-md-3 add-new-project__comune">
<aui:column cssClass="praticaApertaContainer"> <aui:select name="comune" label="Comune" />
<span style="font-weight: bold;">Pratica Aperta : </span>
<aui:input checked="true" inlineField="true" type="radio" name="praticaAperta" value="tutte"
label="Tutte" />
<aui:input inlineField="true" type="radio" name="praticaAperta" value="aperta" label="Sì" />
<aui:input inlineField="true" type="radio" name="praticaAperta" value="chiusa" label="No" />
</aui:column>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="provincia" label="Provincia" cssClass="provinciaSelect"> <aui:input type="text" name="titolareDigitale" label="Titolare Digitale" />
<aui:option value="000"> </aui:option>
<%
List<String> province = TerritorioLocalServiceUtil.getActiveProvince();
//ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro
List<Provincia> provinceList = new ArrayList<Provincia>();
for (String codiceProvincia : province) {
Provincia provinciaToStamp = ProvinciaLocalServiceUtil.fetchByC_C(company.getCompanyId(),
codiceProvincia);
provinceList.add(provinciaToStamp);
}
Collections.sort(provinceList, new Comparator<Provincia>() {
public int compare(Provincia o1, Provincia o2){
return o1.getProvincia().compareTo(o2.getProvincia());
}
});
for (Provincia provincia : provinceList) {
%>
<aui:option value="<%= provincia.getCodiceProvincia() %>">
<%= provincia.getProvincia() %>
</aui:option>
<%
}
%>
</aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="comune" label="Comune" cssClass="comuneSelect"> <aui:input type="text" name="committente" label="Committente" />
<aui:option value="000" />
<%
if (Validator.isNotNull(provinciaJS) && !provinciaJS.equals("000")) {
List<Long> comuni = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaJS);
for (long comuneId : comuni) {
Comune comuneToStamp = ComuneLocalServiceUtil.getComune(comuneId);
%>
<aui:option value="<%= comuneToStamp.getComuneId() %>">
<%= comuneToStamp.getDenominazione() %>
</aui:option>
<%
}
}
%>
</aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="indirizzo" label="Indirizzo" /> <aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-1">
<aui:input type="text" name="tecnicoIstruttore" label="Tecnico Istruttore" /> <aui:select name="unitaOperativa" label="unita-operativa" cssClass="uoSelect" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-2">
<aui:input type="text" name="titolareDigitale" label="Titolare Digitale" /> <aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="committente" label="Committente" /> <aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" /> <aui:select name="parereGeologo" label="Parere fornito">
<aui:option value="-1">Tutte</aui:option>
<aui:option value="1">Si</aui:option>
<aui:option value="0">No</aui:option>
</aui:select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true"> <aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" /> <liferay-util:param name="field" value="dataRichiestaInizio" />
@ -177,16 +99,43 @@ String provinciaJS = ParamUtil.getString(request, "provinciaJS");
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoAttivita" label="Attività">
<aui:option value="-1">Tutte</aui:option>
<aui:option value="Assegnazione">Assegnazione</aui:option>
<aui:option value="Approvazione">Approvazione</aui:option>
<aui:option value="Annullato">Annullato</aui:option>
<aui:option value="Esito">Esito</aui:option>
<aui:option value="NonApprovato">Non Approvato</aui:option>
<aui:option value="signal_cittadino">Richiesta Integrazione</aui:option>
<aui:option value="signal_ff">Firma</aui:option>
</aui:select>
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Esito">
<aui:option value="-1">Tutti</aui:option>
<aui:option value="<%= StatoPraticaConstants.AUTORIZZATA %>">Autorizzata</aui:option>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">Annullata</aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>">Conforme</aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">Integrazione</aui:option>
<aui:option value="<%= StatoPraticaConstants.NO_PARERE %>">Nessun parere</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_AUTORIZZATA %>">Non autorizzata</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">Non conforme</aui:option>
<aui:option value="<%= StatoPraticaConstants.PREAVVISO_CONTRARIO %>">Preavviso contrario</aui:option>
</aui:select>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-3">
<aui:select name="ordinaPer" label="Ordina Per"> <aui:select name="ordinaPer" label="Ordina Per">
<aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option> <aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option>
<aui:option value="protocollo">Protocollo</aui:option> <aui:option value="protocollo">Protocollo</aui:option>
<aui:option value="dataCreazione">Data Invio</aui:option> <aui:option value="dataCreazione">Data Invio</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-3">
<aui:select name="ordinaTipo" label="Tipo Ordine"> <aui:select name="ordinaTipo" label="Tipo Ordine">
<aui:option selected="true" value="dec">Dec</aui:option> <aui:option selected="true" value="dec">Dec</aui:option>
<aui:option value="asc">Asc</aui:option> <aui:option value="asc">Asc</aui:option>
@ -198,45 +147,126 @@ String provinciaJS = ParamUtil.getString(request, "provinciaJS");
<aui:button type="submit" value="search" /> <aui:button type="submit" value="search" />
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
<liferay-portlet:resourceURL id="unitaOperative" var="getUnitaOperativeUrl" />
<liferay-portlet:resourceURL id="province" var="getProvinceURL" />
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" /> <liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
<aui:script use="aui-base,aui-io-request"> <liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" />
var getComuni = function(provinciaId, comuneId, comuneValue) { <liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" />
var comuneSelect = A.one("#"+comuneId);
if (provinciaId == "" || provinciaId == "000") { <aui:script use="aui-io-request,liferay-dynamic-select">
comuneSelect.html("<option value='000' label=''></option>") var getUnitaOperative = function(callback) {
comuneSelect.addClass("disabled").set("disabled", true); A.io.request(
} else { '<%= getUnitaOperativeUrl %>',
A.io.request('<%= getComuniURL %>', { {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getProvince = function(callback) {
A.io.request(
'<%= getProvinceURL %>',
{
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getComuni = function(callback, provinciaId) {
A.io.request(
'<%= getComuniURL %>',
{
data: { data: {
<portlet:namespace />provinciaId: provinciaId <portlet:namespace />provinciaId: provinciaId
},dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getIstruttori = function(callback, uoId) {
A.io.request('<%= getIstruttoriUrl %>', {
data: {
<portlet:namespace />uoId: uoId
}, },
dataType: 'json', dataType: 'json',
on: { on: {
success: function() { success: function() {
var response = this.get('responseData'); callback(this.get('responseData'));
comuneSelect.html("<option value='000' label=''></option>")
for (index in response) {
var code = '<option value="' + response[index].comuneId + '" label="' + response[index].descLong
+ '" class="comuneItem" ' + (comuneValue==response[index].comuneId ? "selected=\"true\""
: "")
+ '>' + response[index].descLong + '</option>';
comuneSelect.append(code);
} }
if (provinciaId != "" && provinciaId != "000") {
comuneSelect.removeClass("disabled").set("disabled", false);
} }
});
};
var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
} }
} }
}); });
}
}; };
A.ready(function() { new Liferay.DynamicSelect(
A.one(".provinciaSelect").on('change', function(event) { [
var provinciaId = event.currentTarget.get('value'), {
comuneId = event.currentTarget.attr("id").replace("provincia","comune"), select: '<portlet:namespace />provincia',
comuneValue = "000"; selectData: getProvince,
getComuni(provinciaId, comuneId, comuneValue) selectDesc: 'descLong',
}); selectId: 'provinciaId',
}); selectSort: true,
selectVal: '<%= (Validator.isNotNull(provinciaSelect) ? provinciaSelect : "") %>'
},
{
select: '<portlet:namespace />comune',
selectData: getComuni,
selectDesc: 'descLong',
selectId: 'comuneId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(comuneSelect) ? comuneSelect : "") %>'
},
{
select: '<portlet:namespace />unitaOperativa',
selectData: getUnitaOperative,
selectDesc: 'descLong',
selectId: 'uoId',
selectSort: false,
selectVal: '<%= (Validator.isNotNull(uoSelect) ? uoSelect : "") %>'
},
{
select: '<portlet:namespace />istruttore',
selectData: getIstruttori,
selectDesc: 'descLong',
selectId: 'istruttoreId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
},
{
select: '<portlet:namespace />geologi',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(geologoSelect) ? geologoSelect : "") %>'
}
]
);
</aui:script> </aui:script>

315
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp

@ -1,4 +1,5 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%> <%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%>
@ -7,6 +8,7 @@
<%@page import="com.liferay.portal.model.UserGroupRole"%> <%@page import="com.liferay.portal.model.UserGroupRole"%>
<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.model.Role"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.Collections"%> <%@page import="java.util.Collections"%>
<%@page import="java.util.Comparator"%> <%@page import="java.util.Comparator"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
@ -15,7 +17,11 @@
<%@page import="org.apache.commons.lang.StringEscapeUtils"%> <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
<%@include file="/html/fascicolo/init.jsp"%> <%@include file="/html/fascicolo/init.jsp"%>
<% <%
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
%> %>
<liferay-ui:panel title="filters" defaultState="closed" <liferay-ui:panel title="filters" defaultState="closed"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false" id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false"
@ -26,89 +32,66 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:input type="text" name="numeroProgetto" label="Numero Progetto" /> <aui:input type="text" name="numeroProgetto" label="Numero Progetto" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="protocollo" label="Protocollo" /> <aui:select name="tipoProcedura" label="Tipo Pratica">
</div> <aui:option value="-1">Seleziona il tipo di pratica</aui:option>
<div class="col-xs-12 col-md-3"> <%
<aui:select name="tipoPratica" label="Tipo Pratica"> for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) {
<aui:option value="-1" label="Seleziona il tipo di pratica" /> String tipo = procedura.getKey();
<aui:option value="01" label="deposito" /> String label = procedura.getValue();
<aui:option value="02" label="autorizzazione" /> String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label;
<aui:option value="03" label="sanatoria" /> if(nomeProcedura.length() > 90)
nomeProcedura = nomeProcedura.substring(0, 90) + "...";
%>
<aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option>
<%
}
%>
</aui:select> </aui:select>
</div> </div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Stato Pratica"> <aui:select name="provincia" label="Provincia" cssClass="provinciaSelect" />
<aui:option value="-1" label="Stato Pratica" /> </div>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>" label="annullata" /> <div class="col-sm-12 col-md-3 add-new-project__comune">
<aui:option value="<%= StatoPraticaConstants.AUTORIZZATA %>" label="autorizzata" /> <aui:select name="comune" label="Comune" />
<aui:option value="<%= StatoPraticaConstants.NON_AUTORIZZATA %>" label="non autorizzata" />
<aui:option value="<%= StatoPraticaConstants.COLLAUDO %>" label="collaudo" />
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>" label="fine lavori" />
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>" label="collaudo parziale" />
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>" label="fine lavori parziale" />
<aui:option value="VA" label="variata" />
<aui:option value="<%= StatoPraticaConstants.VIDIMATA %>" label="vidimata" />
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>" label="integrazione in corso" />
<aui:option value="sospesa" label="sospesa" />
</aui:select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="titolareDigitale" label="Titolare Digitale" />
</div>
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="committente" label="Committente" /> <aui:input type="text" name="committente" label="Committente" />
</div> </div>
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="soggettiInterconnessi" <aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" />
label="Soggetti Interconnessi" />
</div> </div>
<div class="col-xs-12 col-md-4"> </div>
<%-- ADT BUG BO ID = 8 SEZIONE ATTIVITÀ --%> <div class="row">
<c:if test="<%= organizationList != null && organizationList.size() > 1 %>"> <div class="col-xs-12 col-md-1">
<aui:select name="istruttore" label="Tecnico Istruttore"> <aui:select name="unitaOperativa" label="unita-operativa" cssClass="uoSelect" />
<aui:option value="-1">Tutti</aui:option> </div>
<% <div class="col-xs-12 col-md-2">
List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>(); <aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" />
for(Organization org : organizationList) { </div>
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore");
List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
org.getGroupId(), role.getRoleId()); <div class="col-xs-12 col-md-3">
for (UserGroupRole userGroupRole : istruttori) { <aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" />
if (tecniciIstruttori.isEmpty()) { </div>
tecniciIstruttori.add(userGroupRole);
} else { <div class="col-xs-12 col-md-3">
boolean isPresent = false; <aui:select name="parereGeologo" label="Parere fornito">
for(UserGroupRole tecnico : tecniciIstruttori) { <aui:option value="-1">Tutte</aui:option>
if (tecnico.getUserId() == userGroupRole.getUserId()) { <aui:option value="1">Si</aui:option>
isPresent = true; <aui:option value="0">No</aui:option>
break;
}
}
if(!isPresent){
tecniciIstruttori.add(userGroupRole);
}
}
}
}
List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>();
for (UserGroupRole tecnico : tecniciIstruttori) {
IstruttoreBean istruttore = new IstruttoreBean();
istruttore.setIdIstruttore(tecnico.getUserId());
istruttore.setDenominazione(tecnico.getUser().getFullName());
tecniciIstruttoriSorted.add(istruttore);
}
Collections.sort(tecniciIstruttoriSorted);
for (IstruttoreBean istruttore : tecniciIstruttoriSorted) {
%>
<aui:option value="<%= istruttore.getIdIstruttore() %>"><%= istruttore.getDenominazione() %></aui:option>
<%
}
%>
</aui:select> </aui:select>
</c:if>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true"> <aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" /> <liferay-util:param name="field" value="dataRichiestaInizio" />
@ -120,40 +103,10 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
</liferay-util:include> </liferay-util:include>
</aui:field-wrapper> </aui:field-wrapper>
</div> </div>
<div class="col-sm-12 col-md-3 add-new-project__ufficio">
<c:if test="<%= organizationList != null && organizationList.size() > 1 %>">
<aui:select name="ufficio" label="Ufficio">
<aui:option value="-1">Tutte</aui:option>
<%
for (Organization org : organizationList) {
if (org.getParentOrganizationId() != 0) {
%>
<aui:option value="<%= org.getGroupId() %>"><%= org.getName() %></aui:option>
<%
}
}
%>
</aui:select>
</c:if>
</div>
<div class="col-sm-12 col-md-3 add-new-project__comune">
<%
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
%>
<aui:select name="comune" label="Comune" />
</div>
<div class="col-sm-12 col-md-2">
<aui:select name="tipoProcedura" label="tipo-procedura">
<aui:option value="">Tutte</aui:option>
<aui:option value="A">Procedura A</aui:option>
<aui:option value="B">Procedura B</aui:option>
<aui:option value="C">Procedura C</aui:option>
</aui:select>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoAttivita" label="Tipo Attività"> <aui:select name="tipoAttivita" label="Attività">
<aui:option value="-1">Tutte</aui:option> <aui:option value="-1">Tutte</aui:option>
<aui:option value="Assegnazione">Assegnazione</aui:option> <aui:option value="Assegnazione">Assegnazione</aui:option>
<aui:option value="Approvazione">Approvazione</aui:option> <aui:option value="Approvazione">Approvazione</aui:option>
@ -164,11 +117,22 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:option value="signal_ff">Firma</aui:option> <aui:option value="signal_ff">Firma</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Esito">
<aui:option value="-1">Tutti</aui:option>
<aui:option value="<%= StatoPraticaConstants.AUTORIZZATA %>">Autorizzata</aui:option>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">Annullata</aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>">Conforme</aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">Integrazione</aui:option>
<aui:option value="<%= StatoPraticaConstants.NO_PARERE %>">Nessun parere</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_AUTORIZZATA %>">Non autorizzata</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">Non conforme</aui:option>
<aui:option value="<%= StatoPraticaConstants.PREAVVISO_CONTRARIO %>">Preavviso contrario</aui:option>
</aui:select>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<div class="row">
<div class="col-xs-12 col-md-6">
<aui:select name="ordinaPer" label="Ordina Per"> <aui:select name="ordinaPer" label="Ordina Per">
<aui:option value="taskName">Nome Task</aui:option> <aui:option value="taskName">Nome Task</aui:option>
<aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option> <aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option>
@ -177,60 +141,135 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:option value="tipoPratica">Tipo Pratica</aui:option> <aui:option value="tipoPratica">Tipo Pratica</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-3">
<aui:select name="ordinaTipo" label="Tipo Ordine"> <aui:select name="ordinaTipo" label="Tipo Ordine">
<aui:option selected="true" value="dec">Dec</aui:option> <aui:option selected="true" value="dec">Dec</aui:option>
<aui:option value="asc">Asc</aui:option> <aui:option value="asc">Asc</aui:option>
</aui:select> </aui:select>
</div> </div>
</div> </div>
</div>
</div>
<aui:button type="submit" value="search" /> <aui:button type="submit" value="search" />
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
<%-- ADT BUG BO ID = 1 SEZIONE ATTIVITÀ --%>
<liferay-portlet:resourceURL id="comuniForUfficio" var="getComuniURL" /> <liferay-portlet:resourceURL id="unitaOperative" var="getUnitaOperativeUrl" />
<aui:script use="aui-io-request"> <liferay-portlet:resourceURL id="province" var="getProvinceURL" />
$(".add-new-project__ufficio select").change(function() { <liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
var comuni = ''; <liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" />
var val = $(this).val(); <liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" />
$(".add-new-project__comune select").empty();
<aui:script use="aui-io-request,liferay-dynamic-select">
var getUnitaOperative = function(callback) {
A.io.request(
'<%= getUnitaOperativeUrl %>',
{
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getProvince = function(callback) {
A.io.request(
'<%= getProvinceURL %>',
{
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getComuni = function(callback, provinciaId) {
A.io.request( A.io.request(
'<%= getComuniURL %>', '<%= getComuniURL %>',
{ {
data: { data: {
<portlet:namespace />ufficioId: val <portlet:namespace />provinciaId: provinciaId
}, },dataType: 'json',
dataType: 'json',
on: { on: {
success: function() { success: function() {
$(".add-new-project__comune select").empty(); callback(this.get('responseData'));
$(".add-new-project__comune select").append($('<option>').val('-1').text('Tutti'));
var response = this.get('responseData');
<%
String csParam = ParamUtil.getString(renderRequest, "comune");
String cs = "null";
if (csParam != null && !csParam.equals("")) {
cs = csParam;
} }
%>
var cs = <%= cs %>;
var checkIfExists = false;
for (index in response) {
$(".add-new-project__comune select").append($('<option>').val(response[index].comuneId).text(response[index].descLong));
if (cs != 'null') {
if(response[index].comuneId == cs){
checkIfExists = true;
} }
} }
);
};
var getIstruttori = function(callback, uoId) {
A.io.request('<%= getIstruttoriUrl %>', {
data: {
<portlet:namespace />uoId: uoId
},
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
} }
if (checkIfExists) {
$(".add-new-project__comune select").val(cs);
} }
});
};
var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
} }
} }
});
};
new Liferay.DynamicSelect(
[
{
select: '<portlet:namespace />provincia',
selectData: getProvince,
selectDesc: 'descLong',
selectId: 'provinciaId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(provinciaSelect) ? provinciaSelect : "") %>'
},
{
select: '<portlet:namespace />comune',
selectData: getComuni,
selectDesc: 'descLong',
selectId: 'comuneId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(comuneSelect) ? comuneSelect : "") %>'
},
{
select: '<portlet:namespace />unitaOperativa',
selectData: getUnitaOperative,
selectDesc: 'descLong',
selectId: 'uoId',
selectSort: false,
selectVal: '<%= (Validator.isNotNull(uoSelect) ? uoSelect : "") %>'
},
{
select: '<portlet:namespace />istruttore',
selectData: getIstruttori,
selectDesc: 'descLong',
selectId: 'istruttoreId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
},
{
select: '<portlet:namespace />geologi',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(geologoSelect) ? geologoSelect : "") %>'
} }
]
); );
}).trigger("change");
</aui:script> </aui:script>

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

@ -1,3 +1,4 @@
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%> <%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> <%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
@ -80,11 +81,22 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
} }
} }
} }
if(intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE)){
taskName += " " + LanguageUtil.get(pageContext, "in-corso");
}
out.print(taskName); out.print(taskName);
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Esito"> <liferay-ui:search-container-column-text name="Esito">
<%= ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()) %> <%
String esito = StringPool.BLANK;
esito += ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId());
if(intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE)){
esito += " " + LanguageUtil.get(pageContext, "in-corso");
}
out.print(esito);
%>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<%-- ADT - BUG-12 Aggiunta colonna Data Esito --%> <%-- ADT - BUG-12 Aggiunta colonna Data Esito --%>
<c:if test='<%= "Tab_TaskCompletati".equals(currentTab) %>'> <c:if test='<%= "Tab_TaskCompletati".equals(currentTab) %>'>

295
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp

@ -1,5 +1,7 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="com.liferay.portal.model.Organization"%> <%@page import="com.liferay.portal.model.Organization"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@include file="/html/fascicolo/init.jsp"%> <%@include file="/html/fascicolo/init.jsp"%>
@ -31,6 +33,11 @@
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<% <%
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
%> %>
<liferay-ui:panel title="filters" defaultState="closed" id='<%= renderResponse.getNamespace() + scopeGroupId + <liferay-ui:panel title="filters" defaultState="closed" id='<%= renderResponse.getNamespace() + scopeGroupId +
"ricercaSaiPanel" %>' collapsible="true" extended="false" persistState="true"> "ricercaSaiPanel" %>' collapsible="true" extended="false" persistState="true">
@ -40,62 +47,66 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:input type="text" name="numeroProgetto" label="Numero Progetto" /> <aui:input type="text" name="numeroProgetto" label="Numero Progetto" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoPratica" label="Tipo Pratica"> <aui:select name="tipoProcedura" label="Tipo Pratica">
<aui:option value="-1" label="Seleziona il tipo di pratica" /> <aui:option value="-1">Seleziona il tipo di pratica</aui:option>
<aui:option value="01" label="deposito" /> <%
<aui:option value="02" label="autorizzazione" /> for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) {
<aui:option value="03" label="sanatoria" /> String tipo = procedura.getKey();
String label = procedura.getValue();
String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label;
if(nomeProcedura.length() > 90)
nomeProcedura = nomeProcedura.substring(0, 90) + "...";
%>
<aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option>
<%
}
%>
</aui:select> </aui:select>
</div> </div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Stato Pratica"> <aui:select name="provincia" label="Provincia" cssClass="provinciaSelect" />
<aui:option value="-1" label="Stato Pratica" /> </div>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>" label="annullata" /> <div class="col-sm-12 col-md-3 add-new-project__comune">
<aui:option value="<%= StatoPraticaConstants.COLLAUDO %>" label="collaudo" /> <aui:select name="comune" label="Comune" />
<aui:option value="sospesa" label="sospesa" />
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>" label= label="fine lavori" />
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>" label="collaudo parziale" />
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>" label="fine lavori parziali" />
<aui:option value="VA" label="variata" />
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>" label="integrazione in corso" />
<aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>" label="rifiutata" />
</aui:select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="committente" label="Committente" /> <aui:input type="text" name="titolareDigitale" label="Titolare Digitale" />
</div> </div>
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="direttoreLavori" label="Direttore Lavori" /> <aui:input type="text" name="committente" label="Committente" />
</div> </div>
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" /> <aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-2 add-new-project__ufficio"> <div class="col-xs-12 col-md-1">
<c:if test="<%= organizationList != null && organizationList.size() > 1 %>"> <aui:select name="unitaOperativa" label="unita-operativa" cssClass="uoSelect" />
<aui:select name="ufficio" label="Ufficio"> </div>
<div class="col-xs-12 col-md-2">
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="parereGeologo" label="Parere fornito">
<aui:option value="-1">Tutte</aui:option> <aui:option value="-1">Tutte</aui:option>
<% <aui:option value="1">Si</aui:option>
for (Organization org : organizationList) { <aui:option value="0">No</aui:option>
%>
<aui:option value="<%= org.getGroupId() %>"><%= org.getName() %></aui:option>
<%
}
%>
</aui:select> </aui:select>
</c:if>
</div> </div>
<div class="col-xs-12 col-md-2 add-new-project__comune">
<%
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
%>
<aui:select name="comune" label="Comune" />
</div> </div>
<div class="col-xs-12 col-md-4"> <div class="row">
<aui:field-wrapper label="Data assegnazione pratica da" inlineField="true"> <div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" /> <liferay-util:param name="field" value="dataRichiestaInizio" />
</liferay-util:include> </liferay-util:include>
@ -108,47 +119,46 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12 col-md-3">
<aui:column> <aui:select name="tipoAttivita" label="Attività">
<span style="font-weight: bold;">Pratica Aperta : </span> <aui:option value="-1">Tutte</aui:option>
<aui:input checked="true" inlineField="true" type="radio" name="praticaAperta" value="tutte" <aui:option value="Assegnazione">Assegnazione</aui:option>
label="Tutte" /> <aui:option value="Approvazione">Approvazione</aui:option>
<aui:input inlineField="true" type="radio" name="praticaAperta" value="aperta" label="Sì" /> <aui:option value="Annullato">Annullato</aui:option>
<aui:input inlineField="true" type="radio" name="praticaAperta" value="chiusa" label="No" /> <aui:option value="Esito">Esito</aui:option>
</aui:column> <aui:option value="NonApprovato">Non Approvato</aui:option>
</div> <aui:option value="signal_cittadino">Richiesta Integrazione</aui:option>
<aui:option value="signal_ff">Firma</aui:option>
</aui:select>
</div> </div>
<div class="row"> <div class="col-xs-12 col-md-3">
<div class="col-xs-12 col-md-12"> <aui:select name="statoPratica" label="Esito">
<aui:column> <aui:option value="-1">Tutti</aui:option>
<span style="font-weight: bold;">Tipologia Intervento : </span> <aui:option value="<%= StatoPraticaConstants.AUTORIZZATA %>">Autorizzata</aui:option>
<aui:input checked="true" inlineField="true" type="checkbox" name="interventoTutti" label="Tutti" /> <aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">Annullata</aui:option>
<aui:input inlineField="true" type="checkbox" name="interventoNuovaCostruzione" <aui:option value="<%= StatoPraticaConstants.CONFORME %>">Conforme</aui:option>
label="Nuova Costruzione" /> <aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">Integrazione</aui:option>
<aui:input inlineField="true" type="checkbox" name="interventoAdeguamentoSismico" <aui:option value="<%= StatoPraticaConstants.NO_PARERE %>">Nessun parere</aui:option>
label="Adeguamento Sismico" /> <aui:option value="<%= StatoPraticaConstants.NON_AUTORIZZATA %>">Non autorizzata</aui:option>
<aui:input inlineField="true" type="checkbox" name="interventoMiglioramentoSismico" <aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">Non conforme</aui:option>
label="Miglioramento Sismico" /> <aui:option value="<%= StatoPraticaConstants.PREAVVISO_CONTRARIO %>">Preavviso contrario</aui:option>
<aui:input inlineField="true" type="checkbox" name="interventoRiparazioneInterventoLocale" </aui:select>
label="Riparazione Intervento Locale" />
</aui:column>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-12">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-3">
<aui:select name="ordinaPer" label="Ordina Per"> <aui:select name="ordinaPer" label="Ordina Per">
<aui:option value="taskName">Nome Task</aui:option> <aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option>
<aui:option value="numeroProgetto">Numero Progetto</aui:option> <aui:option value="protocollo">Protocollo</aui:option>
<aui:option selected="true" value="createDate">Data Invio</aui:option> <aui:option value="dataCreazione">Data Invio</aui:option>
<aui:option value="tipoPratica">Tipo Pratica</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-3">
<aui:select name="ordinaTipo" label="Tipo Ordine"> <aui:select name="ordinaTipo" label="Tipo Ordine">
<aui:option selected="true" value="asc">Asc</aui:option> <aui:option selected="true" value="dec">Dec</aui:option>
<aui:option value="dec">Dec</aui:option> <aui:option value="asc">Asc</aui:option>
</aui:select> </aui:select>
</div> </div>
</div> </div>
@ -158,46 +168,125 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:button type="button" href="<%= exportCVS.toString() %>" value="export" /> <aui:button type="button" href="<%= exportCVS.toString() %>" value="export" />
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
<%-- ADT BUG-ID=16 Sezione Pratiche Assegnate --%>
<liferay-portlet:resourceURL id="comuniForUfficio" var="getComuniURL" /> <liferay-portlet:resourceURL id="unitaOperative" var="getUnitaOperativeUrl" />
<aui:script use="aui-io-request"> <liferay-portlet:resourceURL id="province" var="getProvinceURL" />
$(".add-new-project__ufficio select").change(function() { <liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
var comuni = ''; <liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" />
var val = $(this).val(); <liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" />
$(".add-new-project__comune select").empty();
A.io.request('<%= getComuniURL %>', { <aui:script use="aui-io-request,liferay-dynamic-select">
data: { var getUnitaOperative = function(callback) {
<portlet:namespace />ufficioId: val A.io.request(
}, '<%= getUnitaOperativeUrl %>',
{
dataType: 'json', dataType: 'json',
on: { on: {
success: function() { success: function() {
$(".add-new-project__comune select").empty(); callback(this.get('responseData'));
$(".add-new-project__comune select").append($('<option>').val('-1').text('Tutti'));
var response = this.get('responseData');
<%
String csParam = ParamUtil.getString(renderRequest, "comune");
String cs = "null";
if (csParam != null && !csParam.equals(StringPool.BLANK)) {
cs = csParam;
} }
%>
var cs = <%= cs %>;
var checkIfExists = false;
for (index in response) {
$(".add-new-project__comune select").append($('<option>').val(response[index].comuneId)
.text(response[index].descLong));
if (cs != 'null') {
if (response[index].comuneId == cs) {
checkIfExists = true;
} }
} }
);
};
var getProvince = function(callback) {
A.io.request(
'<%= getProvinceURL %>',
{
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getComuni = function(callback, provinciaId) {
A.io.request(
'<%= getComuniURL %>',
{
data: {
<portlet:namespace />provinciaId: provinciaId
},dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getIstruttori = function(callback, uoId) {
A.io.request('<%= getIstruttoriUrl %>', {
data: {
<portlet:namespace />uoId: uoId
},
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
} }
if (checkIfExists) {
$(".add-new-project__comune select").val(cs);
} }
});
};
var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
} }
} }
}); });
}).trigger("change"); };
new Liferay.DynamicSelect(
[
{
select: '<portlet:namespace />provincia',
selectData: getProvince,
selectDesc: 'descLong',
selectId: 'provinciaId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(provinciaSelect) ? provinciaSelect : "") %>'
},
{
select: '<portlet:namespace />comune',
selectData: getComuni,
selectDesc: 'descLong',
selectId: 'comuneId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(comuneSelect) ? comuneSelect : "") %>'
},
{
select: '<portlet:namespace />unitaOperativa',
selectData: getUnitaOperative,
selectDesc: 'descLong',
selectId: 'uoId',
selectSort: false,
selectVal: '<%= (Validator.isNotNull(uoSelect) ? uoSelect : "") %>'
},
{
select: '<portlet:namespace />istruttore',
selectData: getIstruttori,
selectDesc: 'descLong',
selectId: 'istruttoreId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
},
{
select: '<portlet:namespace />geologi',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(geologoSelect) ? geologoSelect : "") %>'
}
]
);
</aui:script> </aui:script>

83
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp

@ -1,4 +1,6 @@
<%@page import="it.tref.liferay.portos.bo.util.PortosIndexField"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@include file="/html/fascicolofe/init.jsp"%> <%@include file="/html/fascicolofe/init.jsp"%>
<liferay-ui:panel title="filters" defaultState="closed" <liferay-ui:panel title="filters" defaultState="closed"
@ -10,30 +12,71 @@
<aui:input type="text" name="numeroProgetto" label="Numero Progetto" /> <aui:input type="text" name="numeroProgetto" label="Numero Progetto" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="protocollo" label="Protocollo" /> <aui:select name="tipoProcedura" label="Tipo Pratica">
</div> <aui:option value="-1">Seleziona il tipo di pratica</aui:option>
<div class="col-xs-12 col-md-3"> <%
<aui:select name="tipoPratica" label="Tipo Pratica"> for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure()
<aui:option value="-1" label="Seleziona il tipo di pratica" /> .entrySet()) {
<aui:option value="<%= Constants.TIPO_PRATICA_DEPOSITO %>" label="deposito" /> String tipo = procedura.getKey();
<aui:option value="<%= Constants.TIPO_PRATICA_AUTORIZZAZIONE %>" label="autorizzazione" /> String label = procedura.getValue();
<aui:option value="<%= Constants.TIPO_PRATICA_SANATORIA %>" label="sanatoria" /> String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label;
if(nomeProcedura.length() > 90)
nomeProcedura = nomeProcedura.substring(0, 90) + "...";
%>
<aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option>
<%
}
%>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Stato Pratica"> <aui:select name="statoPratica" label="Stato Pratica">
<aui:option value="-1" label="Stato Pratica" /> <aui:option value="-1">Stato Pratica</aui:option>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>" label="annullata" /> <aui:option value="<%= PortosIndexField.ASSEGNATA_AD_ISTRUTTORE %>">
<aui:option value="<%= StatoPraticaConstants.COLLAUDO %>" label="collaudo" /> <liferay-ui:message key="Assegnata ad istruttore" />
<aui:option value="sospesa" label="sospesa" /> </aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>" label="fine lavori" /> <aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>" label="collaudo parziale" /> <liferay-ui:message key="Annullata" />
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>" label="fine lavori parziali" /> </aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>" label="variata" /> <aui:option value="<%= StatoPraticaConstants.COLLAUDO %>">
<aui:option value="<%= StatoPraticaConstants.VIDIMATA %>" label="vidimata" /> <liferay-ui:message key="Collaudo" />
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>" label="integrazione in corso" /> </aui:option>
<aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>" label="rifiutata" /> <aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>">
<aui:option value="IC" label="in compilazione" /> <liferay-ui:message key="Collaudo parziale" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>">
<liferay-ui:message key="Conforme" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>">
<liferay-ui:message key="Fine lavori" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>">
<liferay-ui:message key="Fine lavori parziali" />
</aui:option>
<aui:option value="IC">
<liferay-ui:message key="In compilazione" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
<liferay-ui:message key="Integrazione in corso" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">
<liferay-ui:message key="Non conforme" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>">
<liferay-ui:message key="Rifiutata" />
</aui:option>
<aui:option value="sospesa">
<liferay-ui:message key="Sospesa" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>">
<liferay-ui:message key="Sottoposta a parere" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>">
<liferay-ui:message key="Variata" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VIDIMATA %>">
<liferay-ui:message key="Vidimata" />
</aui:option>
</aui:select> </aui:select>
</div> </div>
</div> </div>

Caricamento…
Annulla
Salva