Sfoglia il codice sorgente

filtri bo e fe

master
Mattia Gosetto 3 anni fa
parent
commit
e6ac396db5
  1. 16
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java
  2. 15
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java
  3. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java
  4. 20
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java
  5. 16
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java
  6. 63
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java
  7. 211
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java
  8. 62
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java
  9. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  10. 22
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp
  11. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp
  12. 171
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp
  13. 44
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp

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

@ -522,6 +522,8 @@ public class ControlloPraticaAdvancedSearch {
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 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 {
@ -596,6 +598,18 @@ public class ControlloPraticaAdvancedSearch {
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")) { if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) {
TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa", TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa",
unitaOperativa); unitaOperativa);
@ -633,8 +647,6 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST); booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST);
} }
_log.info("Query backend" + booleanQuery.toString());
} catch (ParseException | java.text.ParseException e) { } catch (ParseException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);
} }

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

@ -271,6 +271,8 @@ public class IntPraticaAdvancedSearch {
String istruttoreId = ParamUtil.getString(request, "istruttore"); String istruttoreId = ParamUtil.getString(request, "istruttore");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa"); String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
Long geologi = ParamUtil.getLong(request, "geologi");
Long parereGeologo = ParamUtil.getLong(request, "parereGeologo");
try { try {
TermQuery termQuery; TermQuery termQuery;
@ -332,7 +334,18 @@ public class IntPraticaAdvancedSearch {
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST); booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
} }
_log.info("Query frontend" + booleanQuery.toString()); 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);
} }

1
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";

20
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;
@ -114,7 +116,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());
@ -124,6 +126,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,

16
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;
@ -252,12 +253,21 @@ public class IntPraticaIndexer extends BaseIndexer {
document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPraticaFromDB.getUnitaOperativa()); 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

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

@ -260,7 +260,8 @@ public class FascicoloPortlet extends MVCPortlet {
String tipoIntervento = actionRequest.getParameter("tipoIntervento"); String tipoIntervento = actionRequest.getParameter("tipoIntervento");
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String geologo = ParamUtil.getString(actionRequest, "geologo"); String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
String istruttore = ParamUtil.getString(actionRequest, "istruttore"); String istruttore = ParamUtil.getString(actionRequest, "istruttore");
if (Validator.isNotNull(dataRichiestaInizio)) { if (Validator.isNotNull(dataRichiestaInizio)) {
@ -316,7 +317,8 @@ public class FascicoloPortlet extends MVCPortlet {
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("geologo", geologo); actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
actionResponse.setRenderParameter("istruttore", istruttore); actionResponse.setRenderParameter("istruttore", istruttore);
} }
@ -481,45 +483,40 @@ public class FascicoloPortlet extends MVCPortlet {
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(id)) { }else if ("geologo".equals(id)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); List<User> geologi = new ArrayList<User>();
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
for(Organization org : organizationList) { Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
for (User userGroupRole : geologiUsers) { if (geologi.isEmpty()) {
List<Integer> unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole); geologi.add(userGroupRole);
if(unitaOperativeGeologo.contains(uoId)){ } else {
if (geologi.isEmpty()) { boolean isPresent = false;
geologi.add(userGroupRole); for(User geo : geologi) {
} else { if (geo.getUserId() == userGroupRole.getUserId()) {
boolean isPresent = false; isPresent = true;
for(User geo : geologi) { break;
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
} }
} }
if(!isPresent){
geologi.add(userGroupRole);
}
} }
} }
}
for (User geo : geologi) { for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId()); jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName()); jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject); jsonArray.put(jsonObject);
}
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("exportRicerca".equals(id)) { } else if ("exportRicerca".equals(id)) {

211
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;
@ -91,7 +102,8 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String provincia = ParamUtil.getString(actionRequest, "provincia"); String provincia = ParamUtil.getString(actionRequest, "provincia");
String geologo = ParamUtil.getString(actionRequest, "geologo"); String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
String istruttore = ParamUtil.getString(actionRequest, "istruttore"); String istruttore = ParamUtil.getString(actionRequest, "istruttore");
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
@ -117,7 +129,8 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("provincia", provincia); actionResponse.setRenderParameter("provincia", provincia);
actionResponse.setRenderParameter("geologo", geologo); actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
actionResponse.setRenderParameter("istruttore", istruttore); actionResponse.setRenderParameter("istruttore", istruttore);
} }
@ -251,38 +264,180 @@ 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();
if ("comuniForUfficio".equals(resourceId)) { try{
String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); if ("comuniForUfficio".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); String ufficio = ParamUtil.getString(resourceRequest, "ufficioId");
List<Comune> comuni; JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) { List<Comune> comuni;
try { if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) {
if (!ufficio.equals("-1")) { try {
long ufficioId = Long.parseLong(ufficio); if (!ufficio.equals("-1")) {
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(), long ufficioId = Long.parseLong(ufficio);
ufficioId); comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(),
for (Comune comune : comuni) { ufficioId);
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); for (Comune comune : comuni) {
jsonObject.put("comuneId", comune.getComuneId()); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("descLong", comune.getDenominazione()); jsonObject.put("comuneId", comune.getComuneId());
jsonArray.put(jsonObject); jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
} else {
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId());
for (Comune comune : comuni) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); } catch (Exception e) {
} else { e.printStackTrace();
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId()); }
for (Comune comune : comuni) { }
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); }else if ("province".equals(resourceId)) {
jsonObject.put("comuneId", comune.getComuneId()); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
jsonObject.put("descLong", comune.getDenominazione()); List<String> province = TerritorioLocalServiceUtil.getActiveProvince();
jsonArray.put(jsonObject); 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);
}
} }
writeJSON(resourceRequest, resourceResponse, jsonArray);
} }
} catch (Exception e) {
e.printStackTrace();
} }
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);
} }
} }

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

@ -108,7 +108,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String provincia = ParamUtil.getString(actionRequest, "provincia"); String provincia = ParamUtil.getString(actionRequest, "provincia");
String geologo = ParamUtil.getString(actionRequest, "geologo"); 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);
@ -148,7 +150,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("provincia", provincia); actionResponse.setRenderParameter("provincia", provincia);
actionResponse.setRenderParameter("geologo", geologo); actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
} }
public void cambioIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) { public void cambioIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) {
@ -424,45 +427,40 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(id)) { }else if ("geologo".equals(id)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); List<User> geologi = new ArrayList<User>();
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) { for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) { for (User userGroupRole : geologiUsers) {
List<Integer> unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole); if (geologi.isEmpty()) {
if(unitaOperativeGeologo.contains(uoId)){ geologi.add(userGroupRole);
if (geologi.isEmpty()) { } else {
geologi.add(userGroupRole); boolean isPresent = false;
} else { for(User geo : geologi) {
boolean isPresent = false; if (geo.getUserId() == userGroupRole.getUserId()) {
for(User geo : geologi) { isPresent = true;
if (geo.getUserId() == userGroupRole.getUserId()) { break;
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
} }
} }
if(!isPresent){
geologi.add(userGroupRole);
}
} }
} }
}
for (User geo : geologi) { for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId()); jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName()); jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject); jsonArray.put(jsonObject);
}
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} }

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=3277 build.number=3294
build.date=1629883670001 build.date=1629903256819
build.auto.upgrade=true build.auto.upgrade=true
## ##

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

@ -16,7 +16,7 @@ String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune"); String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); 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"
@ -71,18 +71,21 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" /> <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:select name="geologo" label="Parere endoprocedimentale" cssClass="geologoSelect" /> <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: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" />
@ -211,11 +214,8 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
}); });
}; };
var getGeologo = function(callback, uoId) { var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', { A.io.request('<%= getGeologoUrl %>', {
data: {
<portlet:namespace />uoId: uoId
},
dataType: 'json', dataType: 'json',
on: { on: {
success: function() { success: function() {
@ -260,7 +260,7 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>' selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
}, },
{ {
select: '<portlet:namespace />geologo', select: '<portlet:namespace />geologi',
selectData: getGeologo, selectData: getGeologo,
selectDesc: 'descLong', selectDesc: 'descLong',
selectId: 'geologoId', selectId: 'geologoId',

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

@ -21,7 +21,7 @@ String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune"); String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); 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"
@ -123,18 +123,22 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" /> <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:select name="geologo" label="Parere endoprocedimentale" cssClass="geologoSelect" /> <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: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" />
@ -270,11 +274,8 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
}); });
}; };
var getGeologo = function(callback, uoId) { var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', { A.io.request('<%= getGeologoUrl %>', {
data: {
<portlet:namespace />uoId: uoId
},
dataType: 'json', dataType: 'json',
on: { on: {
success: function() { success: function() {
@ -319,7 +320,7 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>' selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
}, },
{ {
select: '<portlet:namespace />geologo', select: '<portlet:namespace />geologi',
selectData: getGeologo, selectData: getGeologo,
selectDesc: 'descLong', selectDesc: 'descLong',
selectId: 'geologoId', selectId: 'geologoId',

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

@ -33,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">
@ -86,18 +91,21 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" /> <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:select name="geologo" label="Parere endoprocedimentale" cssClass="geologoSelect" /> <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: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" />
@ -160,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', {
on: { dataType: 'json',
success: function() { on: {
$(".add-new-project__comune select").empty(); success: function() {
$(".add-new-project__comune select").append($('<option>').val('-1').text('Tutti')); callback(this.get('responseData'));
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) var getProvince = function(callback) {
.text(response[index].descLong)); A.io.request(
if (cs != 'null') { '<%= getProvinceURL %>',
if (response[index].comuneId == cs) { {
checkIfExists = true; dataType: 'json',
} on: {
success: function() {
callback(this.get('responseData'));
} }
} }
if (checkIfExists) { }
$(".add-new-project__comune select").val(cs); );
};
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'));
} }
} }
} });
}); };
}).trigger("change");
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 : "") %>'
}
]
);
</aui:script> </aui:script>

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

@ -32,43 +32,47 @@
<aui:select name="statoPratica" label="Stato Pratica"> <aui:select name="statoPratica" label="Stato Pratica">
<aui:option value="-1">Stato Pratica</aui:option> <aui:option value="-1">Stato Pratica</aui:option>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>"> <aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">
<liferay-ui:message key="annullata" /> <liferay-ui:message key="Annullata" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO %>"> <aui:option value="<%= StatoPraticaConstants.COLLAUDO %>">
<liferay-ui:message key="collaudo" /> <liferay-ui:message key="Collaudo" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>">
<liferay-ui:message key="Collaudo parziale" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>"> <aui:option value="<%= StatoPraticaConstants.CONFORME %>">
<liferay-ui:message key="conforme" /> <liferay-ui:message key="Conforme" />
</aui:option> </aui:option>
<aui:option value="sospesa"><liferay-ui:message key="sospesa" /></aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>"> <aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>">
<liferay-ui:message key="fine lavori" /> <liferay-ui:message key="Fine lavori" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>">
<liferay-ui:message key="collaudo parziale" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>"> <aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>">
<liferay-ui:message key="fine lavori parziali" /> <liferay-ui:message key="Fine lavori parziali" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>"> <aui:option value="IC">
<liferay-ui:message key="variata" /> <liferay-ui:message key="In compilazione" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.VIDIMATA %>"> <aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
<liferay-ui:message key="vidimata" /> <liferay-ui:message key="Integrazione in corso" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>"> <aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">
<liferay-ui:message key="nonConforme" /> <liferay-ui:message key="Non conforme" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
<liferay-ui:message key="integrazione in corso" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>"> <aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>">
<liferay-ui:message key="rifiutata" /> <liferay-ui:message key="Rifiutata" />
</aui:option>
<aui:option value="sospesa">
<liferay-ui:message key="Sospesa" />
</aui:option> </aui:option>
<aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>"> <aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>">
<liferay-ui:message key="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:option>
<aui:option value="IC"><liferay-ui:message key="in compilazione" /></aui:option>
</aui:select> </aui:select>
</div> </div>
</div> </div>

Caricamento…
Annulla
Salva