Sfoglia il codice sorgente

align

feature/allineamento-sorgenti
E-A B 2 anni fa
parent
commit
49f693edb5
  1. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/audit/service/persistence/AuditEventPersistenceImpl.java
  2. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp
  3. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp
  4. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp
  5. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp
  6. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp
  7. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp
  8. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp
  9. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-hook.xml
  10. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateFunzionarioException.java
  11. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicatePrenotazioneException.java
  12. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateProfessionistaException.java
  13. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchDisponibilitaException.java
  14. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchFunzionarioException.java
  15. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchPrenotazioneException.java
  16. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchProfessionistaException.java
  17. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/SlotNotAvailableException.java
  18. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/DisponibilitaImpl.java
  19. 2
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/FunzionarioImpl.java
  20. 13
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/PrenotazioneImpl.java
  21. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/ProfessionistaImpl.java
  22. 25
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java
  23. 46
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaServiceImpl.java
  24. 14
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioLocalServiceImpl.java
  25. 62
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioServiceImpl.java
  26. 69
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java
  27. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneServiceImpl.java
  28. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp
  29. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp
  30. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp
  31. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp
  32. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp
  33. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp
  34. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp
  35. 1
      liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp

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

@ -43,6 +43,7 @@ import it.tref.liferay.portos.audit.NoSuchAuditEventException;
import it.tref.liferay.portos.audit.model.AuditEvent; import it.tref.liferay.portos.audit.model.AuditEvent;
import it.tref.liferay.portos.audit.model.impl.AuditEventImpl; import it.tref.liferay.portos.audit.model.impl.AuditEventImpl;
import it.tref.liferay.portos.audit.model.impl.AuditEventModelImpl; import it.tref.liferay.portos.audit.model.impl.AuditEventModelImpl;
import it.tref.liferay.portos.audit.service.persistence.AuditEventPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.TextFormatter"%> <%@page import="com.liferay.portal.kernel.util.TextFormatter"%>
<%@page import="com.liferay.portal.kernel.json.JSONArray"%> <%@page import="com.liferay.portal.kernel.json.JSONArray"%>
<%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.TextFormatter"%> <%@page import="com.liferay.portal.kernel.util.TextFormatter"%>
<%@page import="com.liferay.portal.kernel.json.JSONArray"%> <%@page import="com.liferay.portal.kernel.json.JSONArray"%>
<%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp

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

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp

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

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-hook.xml

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook> <hook>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateFunzionarioException.java

@ -13,6 +13,7 @@ import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class DuplicateFunzionarioException extends PortalException { public class DuplicateFunzionarioException extends PortalException {
public DuplicateFunzionarioException() { public DuplicateFunzionarioException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicatePrenotazioneException.java

@ -13,6 +13,7 @@ import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class DuplicatePrenotazioneException extends PortalException { public class DuplicatePrenotazioneException extends PortalException {
public DuplicatePrenotazioneException() { public DuplicatePrenotazioneException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateProfessionistaException.java

@ -13,6 +13,7 @@ import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class DuplicateProfessionistaException extends PortalException { public class DuplicateProfessionistaException extends PortalException {
public DuplicateProfessionistaException() { public DuplicateProfessionistaException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchDisponibilitaException.java

@ -13,6 +13,7 @@ import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class NoSuchDisponibilitaException extends NoSuchModelException { public class NoSuchDisponibilitaException extends NoSuchModelException {
public NoSuchDisponibilitaException() { public NoSuchDisponibilitaException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchFunzionarioException.java

@ -13,6 +13,7 @@ import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class NoSuchFunzionarioException extends NoSuchModelException { public class NoSuchFunzionarioException extends NoSuchModelException {
public NoSuchFunzionarioException() { public NoSuchFunzionarioException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchPrenotazioneException.java

@ -13,6 +13,7 @@ import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class NoSuchPrenotazioneException extends NoSuchModelException { public class NoSuchPrenotazioneException extends NoSuchModelException {
public NoSuchPrenotazioneException() { public NoSuchPrenotazioneException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchProfessionistaException.java

@ -13,6 +13,7 @@ import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class NoSuchProfessionistaException extends NoSuchModelException { public class NoSuchProfessionistaException extends NoSuchModelException {
public NoSuchProfessionistaException() { public NoSuchProfessionistaException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/SlotNotAvailableException.java

@ -13,6 +13,7 @@ import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class SlotNotAvailableException extends PortalException { public class SlotNotAvailableException extends PortalException {
public SlotNotAvailableException() { public SlotNotAvailableException() {

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/DisponibilitaImpl.java

@ -20,6 +20,7 @@ package it.tref.portos.calendar.appointments.model.impl;
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class DisponibilitaImpl extends DisponibilitaBaseImpl { public class DisponibilitaImpl extends DisponibilitaBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a disponibilita model instance * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a disponibilita model instance

2
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/FunzionarioImpl.java

@ -22,6 +22,7 @@ import com.liferay.portal.kernel.util.StringPool;
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class FunzionarioImpl extends FunzionarioBaseImpl { public class FunzionarioImpl extends FunzionarioBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a funzionario model instance * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a funzionario model instance
@ -29,6 +30,7 @@ public class FunzionarioImpl extends FunzionarioBaseImpl {
*/ */
public FunzionarioImpl() {} public FunzionarioImpl() {}
@Override
public String getFullDescription() { public String getFullDescription() {
return getNome() + StringPool.SPACE + getCognome(); return getNome() + StringPool.SPACE + getCognome();
} }

13
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/PrenotazioneImpl.java

@ -24,6 +24,7 @@ import org.apache.commons.lang.time.DateUtils;
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class PrenotazioneImpl extends PrenotazioneBaseImpl { public class PrenotazioneImpl extends PrenotazioneBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a prenotazione model instance * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a prenotazione model instance
@ -31,17 +32,9 @@ public class PrenotazioneImpl extends PrenotazioneBaseImpl {
*/ */
public PrenotazioneImpl() {} public PrenotazioneImpl() {}
@Override
public boolean isExpired(Date now) { public boolean isExpired(Date now) {
if (now.after(getStartDate())) { return now.after(getStartDate()) || DateUtils.isSameDay(now, getStartDate());
return true;
}
if (DateUtils.isSameDay(now, getStartDate())) {
return true;
}
return false;
} }
} }

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/ProfessionistaImpl.java

@ -20,6 +20,7 @@ package it.tref.portos.calendar.appointments.model.impl;
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting + Manifattura Web Group s.r.l.
*/ */
@SuppressWarnings("serial")
public class ProfessionistaImpl extends ProfessionistaBaseImpl { public class ProfessionistaImpl extends ProfessionistaBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a professionista model instance * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a professionista model instance

25
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java

@ -286,9 +286,10 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
Calendar cal2 = Calendar.getInstance(); Calendar cal2 = Calendar.getInstance();
cal1.setTime(date1); cal1.setTime(date1);
cal2.setTime(date2); cal2.setTime(date2);
boolean sameDay =
cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) boolean sameDay = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&
&& cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR);
return sameDay; return sameDay;
} }
@ -315,10 +316,10 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
return results; return results;
}
} }
public List<Disponibilita> findByFunzionario_StartDate(long funzionarioId, Date date, long presidio) throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
Date end = DateUtils.addHours(start, 22); Date end = DateUtils.addHours(start, 22);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -369,11 +370,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Long> orgIds = new ArrayList<Long>(); List<Long> orgIds = new ArrayList<Long>();
try { try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if(isDirigenteGenerale){ if(isDirigenteGenerale){
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
@ -424,11 +425,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Long> orgIds = new ArrayList<Long>(); List<Long> orgIds = new ArrayList<Long>();
try { try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if(isDirigenteGenerale){ if(isDirigenteGenerale){
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());

46
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaServiceImpl.java

@ -11,7 +11,6 @@ package it.tref.portos.calendar.appointments.service.impl;
import it.tref.portos.calendar.appointments.model.Disponibilita; import it.tref.portos.calendar.appointments.model.Disponibilita;
import it.tref.portos.calendar.appointments.model.Funzionario; import it.tref.portos.calendar.appointments.model.Funzionario;
import it.tref.portos.calendar.appointments.model.Prenotazione; import it.tref.portos.calendar.appointments.model.Prenotazione;
import it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil;
import it.tref.portos.calendar.appointments.service.base.DisponibilitaServiceBaseImpl; import it.tref.portos.calendar.appointments.service.base.DisponibilitaServiceBaseImpl;
import java.text.ParseException; import java.text.ParseException;
@ -38,7 +37,6 @@ 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.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
/** /**
* The implementation of the disponibilita remote service. * The implementation of the disponibilita remote service.
@ -63,6 +61,7 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl {
private static Log _log = LogFactoryUtil.getLog(DisponibilitaServiceImpl.class); private static Log _log = LogFactoryUtil.getLog(DisponibilitaServiceImpl.class);
@Override
public Disponibilita addDisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio, public Disponibilita addDisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
@ -70,6 +69,7 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl {
serviceContext); serviceContext);
} }
@Override
public List<Disponibilita> addDisponibilitaGenerale(long presidio, long userId, Date dataInizioDisponibilita, public List<Disponibilita> addDisponibilitaGenerale(long presidio, long userId, Date dataInizioDisponibilita,
Date dataFineDisponibilita, String giornoSettimana, String oraInizioDisponibilita, Date dataFineDisponibilita, String giornoSettimana, String oraInizioDisponibilita,
String oraFineDisponibilita, ServiceContext serviceContext) throws SystemException, PortalException { String oraFineDisponibilita, ServiceContext serviceContext) throws SystemException, PortalException {
@ -87,7 +87,9 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl {
return listDisponibilita; return listDisponibilita;
} }
public String verifyDisponibilitaByDateHour(String presidio, String date,String[] oreInizio, String idFunzionario) throws SystemException, ParseException { @Override
public String verifyDisponibilitaByDateHour(String presidio, String date, String[] oreInizio, String idFunzionario)
throws SystemException, ParseException {
JSONObject json = JSONFactoryUtil.createJSONObject(); JSONObject json = JSONFactoryUtil.createJSONObject();
JSONArray array = JSONFactoryUtil.createJSONArray(); JSONArray array = JSONFactoryUtil.createJSONArray();
@ -99,18 +101,9 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl {
String oraInizio = oreInizio[i]; String oraInizio = oreInizio[i];
jsonFiglio.put("ora", oraInizio); jsonFiglio.put("ora", oraInizio);
Date dateVerify = formatDateTime(oraInizio, dateVerifyTemp); Date dateVerify = formatDateTime(oraInizio, dateVerifyTemp);
List<Prenotazione> lista = prenotazioneLocalService.findByDateHourFunzionario(dateVerify,
Long.parseLong(idFunzionario), org.getGroupId());
List<Prenotazione> lista = jsonFiglio.put("disponibile", lista.isEmpty());
PrenotazioneLocalServiceUtil.findByDateHourFunzionario(
dateVerify, Long.parseLong(idFunzionario), org.getGroupId());
if(lista.isEmpty()){
jsonFiglio.put("disponibile", true);
} else {
jsonFiglio.put("disponibile", false);
}
array.put(jsonFiglio); array.put(jsonFiglio);
} }
json.put("slot", array); json.put("slot", array);
@ -124,31 +117,22 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl {
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio));
List<User> userDefinitivo = new ArrayList<User>(); List<User> userDefinitivo = new ArrayList<User>();
try { try {
if (organization != null) { if (organization != null) {
List<User> users = UserLocalServiceUtil.getOrganizationUsers(Long.valueOf(presidio)); List<User> users = userLocalService.getOrganizationUsers(Long.valueOf(presidio));
for (User user : users) { for (User user : users) {
Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario"); "portos_calendario");
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){ boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
organization.getGroupId(), portosIstruttore.getRoleId());
boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId());
if (isIstruttore) { if (isIstruttore) {
userDefinitivo.add(user); userDefinitivo.add(user);
} }
} }
} }
} }
} catch (NumberFormatException | PortalException | SystemException e) {
} catch (NumberFormatException | SystemException e) {
_log.error(e,e);
} catch (PortalException e) {
_log.error(e, e); _log.error(e, e);
} }

14
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioLocalServiceImpl.java

@ -8,17 +8,17 @@
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
import it.tref.portos.calendar.appointments.model.Funzionario; import it.tref.portos.calendar.appointments.model.Funzionario;
import it.tref.portos.calendar.appointments.service.base.FunzionarioLocalServiceBaseImpl; import it.tref.portos.calendar.appointments.service.base.FunzionarioLocalServiceBaseImpl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
/** /**
* The implementation of the funzionario local service. * The implementation of the funzionario local service.
* <p> * <p>
@ -40,6 +40,7 @@ public class FunzionarioLocalServiceImpl extends FunzionarioLocalServiceBaseImpl
* service. * service.
*/ */
@Override
public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia, public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia,
ServiceContext serviceContext) throws PortalException, SystemException { ServiceContext serviceContext) throws PortalException, SystemException {
@ -74,8 +75,9 @@ public class FunzionarioLocalServiceImpl extends FunzionarioLocalServiceBaseImpl
return this.deleteFunzionario(funzionario); return this.deleteFunzionario(funzionario);
} }
@Override
public List<Funzionario> findByPresidio(String presidio) throws SystemException { public List<Funzionario> findByPresidio(String presidio) throws SystemException {
return funzionarioPersistence.findByPresidio(presidio); return funzionarioPersistence.findByPresidio(presidio);
} }
} }

62
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioServiceImpl.java

@ -8,6 +8,7 @@
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
import it.tref.liferay.portos.bo.shared.util.Constants;
import it.tref.portos.calendar.appointments.model.Funzionario; import it.tref.portos.calendar.appointments.model.Funzionario;
import it.tref.portos.calendar.appointments.service.base.FunzionarioServiceBaseImpl; import it.tref.portos.calendar.appointments.service.base.FunzionarioServiceBaseImpl;
@ -22,6 +23,7 @@ import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization; import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role; import com.liferay.portal.model.Role;
@ -30,8 +32,6 @@ 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.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.Constants;
/** /**
* The implementation of the funzionario remote service. * The implementation of the funzionario remote service.
@ -55,81 +55,59 @@ public class FunzionarioServiceImpl extends FunzionarioServiceBaseImpl {
private static Log _log = LogFactoryUtil.getLog(FunzionarioServiceImpl.class); private static Log _log = LogFactoryUtil.getLog(FunzionarioServiceImpl.class);
@Override
public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia, public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia,
ServiceContext serviceContext) throws PortalException, SystemException { ServiceContext serviceContext) throws PortalException, SystemException {
return funzionarioLocalService.addFunzionario(userId, nome, cognome, presidio, tipologia, serviceContext); return funzionarioLocalService.addFunzionario(userId, nome, cognome, presidio, tipologia, serviceContext);
} }
@Override
public String getFunzionariByPresidio(String presidio) { public String getFunzionariByPresidio(String presidio) {
JSONArray json = JSONFactoryUtil.createJSONArray(); JSONArray json = JSONFactoryUtil.createJSONArray();
try { try {
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio));
if (organization != null) { if (organization != null) {
List<User> users = userLocalService.getOrganizationUsers(Long.valueOf(presidio));
List<User> users = UserLocalServiceUtil.getOrganizationUsers(Long.valueOf(presidio));
//Bug 32935
Collections.sort(users, new UserComparator()); Collections.sort(users, new UserComparator());
for (User user : users) { for (User user : users) {
Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
Role portosGeologo = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
Role portosGeologo = RoleLocalServiceUtil.getRole(organization.getCompanyId(), Constants.ROLE_NAME_GEOLOGO); Constants.ROLE_NAME_GEOLOGO);
Role portosCalendario = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
Role portosCalendario = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario"); "portos_calendario");
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); Constants.ROLE_NAME_ISTRUTTORE);
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){ boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
organization.getGroupId(), portosCalendario.getRoleId());
boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole( boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
user.getUserId(), organization.getGroupId(), portosCalendario.getRoleId()); organization.getGroupId(), portosIstruttore.getRoleId());
boolean isGeologo = userLocalService.hasRoleUser(portosGeologo.getRoleId(),
boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole( user.getUserId());
user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId());
boolean isGeologo = UserLocalServiceUtil.hasRoleUser(portosGeologo.getRoleId(), user.getUserId());
if (isCalendario) { if (isCalendario) {
JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject(); JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject();
jsonFunzionario.put("id", user.getUserId()); jsonFunzionario.put("id", user.getUserId());
jsonFunzionario.put("nome", user.getFirstName()); jsonFunzionario.put("nome", user.getFirstName());
jsonFunzionario.put("cognome", user.getLastName()); jsonFunzionario.put("cognome", user.getLastName());
if (isIstruttore) { if (isIstruttore) {
jsonFunzionario.put("tipologia", "Istruttore"); jsonFunzionario.put("tipologia", "Istruttore");
} else if (isGeologo) { } else if (isGeologo) {
jsonFunzionario.put("tipologia", "Geologo"); jsonFunzionario.put("tipologia", "Geologo");
} else { } else {
jsonFunzionario.put("tipologia", ""); jsonFunzionario.put("tipologia", StringPool.BLANK);
} }
json.put(jsonFunzionario); json.put(jsonFunzionario);
} }
} }
} }
} }
} catch (NumberFormatException | PortalException | SystemException e) {
} catch (NumberFormatException | SystemException e) {
_log.error(e,e);
} catch (PortalException e) {
_log.error(e, e); _log.error(e, e);
} }
return json.toString(); return json.toString();
} }
} }
class UserComparator implements Comparator<User> { class UserComparator implements Comparator<User> {

69
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java

@ -33,6 +33,7 @@ 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.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
/** /**
* The implementation of the prenotazione local service. * The implementation of the prenotazione local service.
@ -55,43 +56,54 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm
* service. * service.
*/ */
@Override //Product Backlog Item 32934
public Prenotazione addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate, public Prenotazione addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate,
Date endDate, String descrizione, String telefono, String email, long presidio, Date endDate, String descrizione, String telefono, String email, long presidio, ServiceContext serviceContext) throws SystemException, PortalException {
ServiceContext serviceContext) throws SystemException, PortalException {
Prenotazione prenotazione = Prenotazione prenotazione =
prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName())); prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName()));
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
prenotazione.setCompanyId(serviceContext.getCompanyId()); prenotazione.setCompanyId(serviceContext.getCompanyId());
prenotazione.setUserId(user.getUserId()); prenotazione.setUserId(user.getUserId());
prenotazione.setUserName(user.getFullName()); prenotazione.setUserName(user.getFullName());
prenotazione.setCreateDate(serviceContext.getCreateDate(now)); prenotazione.setCreateDate(serviceContext.getCreateDate(now));
prenotazione.setModifiedDate(serviceContext.getModifiedDate(now)); prenotazione.setModifiedDate(serviceContext.getModifiedDate(now));
prenotazione.setGroupId(presidio); prenotazione.setGroupId(presidio);
prenotazione.setFunzionarioId(funzionarioId); prenotazione.setFunzionarioId(funzionarioId);
prenotazione.setProfessionistaId(professionistaId); prenotazione.setProfessionistaId(professionistaId);
prenotazione.setStartDate(startDate); prenotazione.setStartDate(startDate);
prenotazione.setEndDate(endDate); prenotazione.setEndDate(endDate);
prenotazione.setDescLong(descrizione); prenotazione.setDescLong(descrizione);
//Product Backlog Item 32934
prenotazione.setTelefono(telefono); prenotazione.setTelefono(telefono);
prenotazione.setEmail(email); prenotazione.setEmail(email);
prenotazione = updatePrenotazione(prenotazione);
prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione);
return prenotazione; return prenotazione;
} }
@Override
public Prenotazione updatePrenotazione(long prenotazioneId, Date startDate, Date endDate, String descrizione, public Prenotazione updatePrenotazione(long prenotazioneId, Date startDate, Date endDate, String descrizione,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId); Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId);
Date now = new Date(); Date now = new Date();
prenotazione.setModifiedDate(serviceContext.getModifiedDate(now)); prenotazione.setModifiedDate(serviceContext.getModifiedDate(now));
prenotazione.setStartDate(startDate); prenotazione.setStartDate(startDate);
prenotazione.setEndDate(endDate); prenotazione.setEndDate(endDate);
prenotazione.setDescLong(descrizione); prenotazione.setDescLong(descrizione);
prenotazione = updatePrenotazione(prenotazione);
prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione);
return prenotazione; return prenotazione;
} }
@ -108,31 +120,29 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm
return this.deletePrenotazione(prenotazione); return this.deletePrenotazione(prenotazione);
} }
@SuppressWarnings("unchecked")
@Override
public List<Prenotazione> findByStartDate(Date date) throws SystemException { public List<Prenotazione> findByStartDate(Date date) throws SystemException {
Date start = DateUtils.truncate(date, java.util.Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, java.util.Calendar.DAY_OF_MONTH);
Date end = DateUtils.addDays(start, 1); Date end = DateUtils.addDays(start, 1);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end)); dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end));
dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId")); dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId"));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
} }
@SuppressWarnings("unchecked") public List<Prenotazione> findByDateHourFunzionario(Date date, long funzionarioId, long groupId) throws SystemException {
@Override
public List<Prenotazione> findByDateHourFunzionario(Date date, long funzionarioId, long groupId)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", date)); dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", date));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
} }
@Override
public int getAvailableSlotByStartDate_EndDate(long funzionarioId, Date startDate, Date endDate) public int getAvailableSlotByStartDate_EndDate(long funzionarioId, Date startDate, Date endDate)
throws SystemException { throws SystemException {
@ -151,45 +161,54 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm
return (int) prenotazionePersistence.countWithDynamicQuery(dynamicQuery); return (int) prenotazionePersistence.countWithDynamicQuery(dynamicQuery);
} }
@SuppressWarnings("unchecked") }
@Override
public List<Prenotazione> findByFunzionario_StartDate(long funzionarioId, Date date, long groupId)
throws SystemException {
public List<Prenotazione> findByFunzionario_StartDate(long funzionarioId, Date date, long groupId) throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
Date end = DateUtils.addHours(start, 22); Date end = DateUtils.addHours(start, 22);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end)); dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
} }
@Override public int countPrenotazioniPresidioPeriodo(long presidioId, String fromString, String toString) throws SystemException, PortalException, ParseException{
public int countPrenotazioniPresidioPeriodo(long presidioId, String fromString, String toString)
throws SystemException, PortalException, ParseException {
int count = 0; int count = 0;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date from = sdf.parse(fromString); Date from = sdf.parse(fromString);
Date to = sdf.parse(toString); Date to = sdf.parse(toString);
Calendar fromCal = Calendar.getInstance(); Calendar fromCal = Calendar.getInstance();
fromCal.setTime(from); fromCal.setTime(from);
fromCal.set(Calendar.HOUR_OF_DAY, 2); fromCal.set(Calendar.HOUR_OF_DAY, 2);
Calendar toCal = Calendar.getInstance(); Calendar toCal = Calendar.getInstance();
toCal.setTime(to); toCal.setTime(to);
toCal.set(Calendar.HOUR_OF_DAY, 22); toCal.set(Calendar.HOUR_OF_DAY, 22);
Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId); Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId);
Role portosCalendario = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_calendario"); Role portosCalendario = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_calendario");
if (org != null) { if (org != null) {
List<User> users = userLocalService.getOrganizationUsers(presidioId);
List<User> users = UserLocalServiceUtil.getOrganizationUsers(presidioId);
for (User user : users) { for (User user : users) {
boolean isCalendario = boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(), user.getUserId(), org.getGroupId(), portosCalendario.getRoleId());
portosCalendario.getRoleId());
if(isCalendario){ if(isCalendario){
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId()));
dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", fromCal.getTime(), toCal.getTime())); dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", fromCal.getTime(), toCal.getTime()));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId()));

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneServiceImpl.java

@ -113,6 +113,7 @@ public class PrenotazioneServiceImpl extends PrenotazioneServiceBaseImpl {
} catch (NumberFormatException | PortalException | SystemException e) { } catch (NumberFormatException | PortalException | SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date); Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
JSONArray json = JSONFactoryUtil.createJSONArray(); JSONArray json = JSONFactoryUtil.createJSONArray();

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.model.Role"%>
<%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Organization"%> <%@page import="com.liferay.portal.model.Organization"%>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Organization"%> <%@page import="com.liferay.portal.model.Organization"%>
<%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.portos.calendar.appointments.model.Disponibilita"%> <%@page import="it.tref.portos.calendar.appointments.model.Disponibilita"%>
<%@ include file="/html/calendar_appointments/init.jsp" %> <%@ include file="/html/calendar_appointments/init.jsp" %>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%> <%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%>
<%@ include file="/html/calendar_appointments/init.jsp" %> <%@ include file="/html/calendar_appointments/init.jsp" %>
<% <%

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.text.Format"%> <%@page import="java.text.Format"%>
<%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%> <%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp

@ -1,3 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% <%
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.

1
liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>

Caricamento…
Annulla
Salva