From 49f693edb5ccf953659186afb36a5c78e70ca4d7 Mon Sep 17 00:00:00 2001 From: E-A B Date: Fri, 3 Feb 2023 17:27:39 +0100 Subject: [PATCH] align --- .../AuditEventPersistenceImpl.java | 1 + .../docroot/html/common/details_column.jsp | 1 + .../docroot/html/common/relations_column.jsp | 1 + .../docroot/html/detail/detail.jsp | 1 + .../docroot/html/detail/view.jsp | 1 + .../docroot/html/detail/view_list.jsp | 1 + .../docroot/html/storicizzazione/edit.jsp | 1 + .../docroot/html/storicizzazione/view.jsp | 1 + .../docroot/WEB-INF/liferay-hook.xml | 2 +- .../DuplicateFunzionarioException.java | 1 + .../DuplicatePrenotazioneException.java | 1 + .../DuplicateProfessionistaException.java | 1 + .../NoSuchDisponibilitaException.java | 1 + .../NoSuchFunzionarioException.java | 1 + .../NoSuchPrenotazioneException.java | 1 + .../NoSuchProfessionistaException.java | 1 + .../SlotNotAvailableException.java | 1 + .../model/impl/DisponibilitaImpl.java | 1 + .../model/impl/FunzionarioImpl.java | 8 +- .../model/impl/PrenotazioneImpl.java | 17 +- .../model/impl/ProfessionistaImpl.java | 1 + .../impl/DisponibilitaLocalServiceImpl.java | 29 +-- .../impl/DisponibilitaServiceImpl.java | 52 ++--- .../impl/FunzionarioLocalServiceImpl.java | 22 +- .../service/impl/FunzionarioServiceImpl.java | 112 ++++------ .../impl/PrenotazioneLocalServiceImpl.java | 211 ++++++++++-------- .../service/impl/PrenotazioneServiceImpl.java | 1 + .../html/calendar_appointments/init.jsp | 1 + .../tabs/amministrazione.jsp | 1 + .../calendar_appointments/tabs/calendar.jsp | 1 + .../tabs/gestione_disponibilita_action.jsp | 1 + .../html/calendar_appointments/view.jsp | 1 + .../docroot/html/init.jsp | 1 + .../docroot/view.jsp | 1 + .../docroot/html/init.jsp | 1 - 35 files changed, 242 insertions(+), 238 deletions(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/audit/service/persistence/AuditEventPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/audit/service/persistence/AuditEventPersistenceImpl.java index 14a029f4..8436cb5b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/audit/service/persistence/AuditEventPersistenceImpl.java +++ b/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.impl.AuditEventImpl; import it.tref.liferay.portos.audit.model.impl.AuditEventModelImpl; +import it.tref.liferay.portos.audit.service.persistence.AuditEventPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp index 851b5a30..3b091aab 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp +++ b/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.json.JSONArray"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp index f5287023..72b2cb90 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp +++ b/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.json.JSONArray"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp index ffc929c3..94e694cc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp +++ b/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="com.liferay.portal.security.permission.ActionKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp index 3d6b7058..3c18f252 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp +++ b/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="com.liferay.portal.security.permission.ActionKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp index f77b3e2e..ff21f2e4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp +++ b/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="com.liferay.portal.security.permission.ActionKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp index cb89ae81..646951b9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp +++ b/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" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp index 8447c350..ff47f72b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp +++ b/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" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-hook.xml b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-hook.xml index 5dc0d86c..8234053b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-hook.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-hook.xml @@ -1,4 +1,4 @@ - + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateFunzionarioException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateFunzionarioException.java index 0eb7de10..6a9e1899 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateFunzionarioException.java +++ b/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. */ +@SuppressWarnings("serial") public class DuplicateFunzionarioException extends PortalException { public DuplicateFunzionarioException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicatePrenotazioneException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicatePrenotazioneException.java index f36f0237..8ddd98e0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicatePrenotazioneException.java +++ b/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. */ +@SuppressWarnings("serial") public class DuplicatePrenotazioneException extends PortalException { public DuplicatePrenotazioneException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateProfessionistaException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateProfessionistaException.java index 15346fde..a6ed4a53 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateProfessionistaException.java +++ b/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. */ +@SuppressWarnings("serial") public class DuplicateProfessionistaException extends PortalException { public DuplicateProfessionistaException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchDisponibilitaException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchDisponibilitaException.java index 767cb4f0..1a9c7f25 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchDisponibilitaException.java +++ b/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. */ +@SuppressWarnings("serial") public class NoSuchDisponibilitaException extends NoSuchModelException { public NoSuchDisponibilitaException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchFunzionarioException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchFunzionarioException.java index 7cb3399a..ca5c71de 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchFunzionarioException.java +++ b/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. */ +@SuppressWarnings("serial") public class NoSuchFunzionarioException extends NoSuchModelException { public NoSuchFunzionarioException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchPrenotazioneException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchPrenotazioneException.java index 77e4c805..9a831064 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchPrenotazioneException.java +++ b/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. */ +@SuppressWarnings("serial") public class NoSuchPrenotazioneException extends NoSuchModelException { public NoSuchPrenotazioneException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchProfessionistaException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchProfessionistaException.java index 7314eb85..24e17d50 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchProfessionistaException.java +++ b/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. */ +@SuppressWarnings("serial") public class NoSuchProfessionistaException extends NoSuchModelException { public NoSuchProfessionistaException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/SlotNotAvailableException.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/SlotNotAvailableException.java index d1db8c58..58a65b67 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/SlotNotAvailableException.java +++ b/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. */ +@SuppressWarnings("serial") public class SlotNotAvailableException extends PortalException { public SlotNotAvailableException() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/DisponibilitaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/DisponibilitaImpl.java index eeed0fd5..f6278f0c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/DisponibilitaImpl.java +++ b/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. */ +@SuppressWarnings("serial") public class DisponibilitaImpl extends DisponibilitaBaseImpl { /* * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a disponibilita model instance diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/FunzionarioImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/FunzionarioImpl.java index 8bdec5dd..eddb1e39 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/FunzionarioImpl.java +++ b/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. */ +@SuppressWarnings("serial") public class FunzionarioImpl extends FunzionarioBaseImpl { /* * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a funzionario model instance @@ -29,7 +30,8 @@ public class FunzionarioImpl extends FunzionarioBaseImpl { */ public FunzionarioImpl() {} - public String getFullDescription() { - return getNome() + StringPool.SPACE + getCognome(); - } + @Override + public String getFullDescription() { + return getNome() + StringPool.SPACE + getCognome(); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/PrenotazioneImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/PrenotazioneImpl.java index 73c6cce8..a1cec9bd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/PrenotazioneImpl.java +++ b/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. */ +@SuppressWarnings("serial") public class PrenotazioneImpl extends PrenotazioneBaseImpl { /* * 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 boolean isExpired(Date now) { + @Override + public boolean isExpired(Date now) { - if (now.after(getStartDate())) { - return true; - } - - if (DateUtils.isSameDay(now, getStartDate())) { - return true; - - } - - return false; - } + return now.after(getStartDate()) || DateUtils.isSameDay(now, getStartDate()); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/ProfessionistaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/ProfessionistaImpl.java index dce6ea28..ae04c853 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/ProfessionistaImpl.java +++ b/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. */ +@SuppressWarnings("serial") public class ProfessionistaImpl extends ProfessionistaBaseImpl { /* * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a professionista model instance diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java index 81a9d1f7..57dd49bb 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java +++ b/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(); cal1.setTime(date1); cal2.setTime(date2); - boolean sameDay = - cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) - && cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); + + boolean sameDay = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && + cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); + return sameDay; } @@ -315,10 +316,10 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); return results; - } } + public List findByFunzionario_StartDate(long funzionarioId, Date date, long presidio) throws SystemException { Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date end = DateUtils.addHours(start, 22); DynamicQuery dynamicQuery = dynamicQuery(); @@ -369,11 +370,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgIds = new ArrayList(); try { Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); - boolean isDirigenteGenerale = - RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); - if (isDirigenteGenerale) { - List orgs = - OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); + boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); + + if(isDirigenteGenerale){ + + List orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1); for (Organization organization : orgs) { if (organization.getParentOrganization() != null) { orgIds.add(organization.getOrganizationId()); @@ -424,11 +425,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgIds = new ArrayList(); try { Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); - boolean isDirigenteGenerale = - RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); - if (isDirigenteGenerale) { - List orgs = - OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); + boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); + + if(isDirigenteGenerale){ + + List orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1); for (Organization organization : orgs) { if (organization.getParentOrganization() != null) { orgIds.add(organization.getOrganizationId()); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaServiceImpl.java index 5ffdc835..153110f6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaServiceImpl.java +++ b/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.Funzionario; 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 java.text.ParseException; @@ -38,7 +37,6 @@ import com.liferay.portal.service.OrganizationLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; -import com.liferay.portal.service.UserLocalServiceUtil; /** * The implementation of the disponibilita remote service. @@ -63,6 +61,7 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl { private static Log _log = LogFactoryUtil.getLog(DisponibilitaServiceImpl.class); + @Override public Disponibilita addDisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio, ServiceContext serviceContext) throws SystemException, PortalException { @@ -70,6 +69,7 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl { serviceContext); } + @Override public List addDisponibilitaGenerale(long presidio, long userId, Date dataInizioDisponibilita, Date dataFineDisponibilita, String giornoSettimana, String oraInizioDisponibilita, String oraFineDisponibilita, ServiceContext serviceContext) throws SystemException, PortalException { @@ -87,7 +87,9 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl { 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(); JSONArray array = JSONFactoryUtil.createJSONArray(); @@ -99,18 +101,9 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl { String oraInizio = oreInizio[i]; jsonFiglio.put("ora", oraInizio); Date dateVerify = formatDateTime(oraInizio, dateVerifyTemp); - - - List lista = - PrenotazioneLocalServiceUtil.findByDateHourFunzionario( - dateVerify, Long.parseLong(idFunzionario), org.getGroupId()); - - if(lista.isEmpty()){ - jsonFiglio.put("disponibile", true); - } else { - jsonFiglio.put("disponibile", false); - } - + List lista = prenotazioneLocalService.findByDateHourFunzionario(dateVerify, + Long.parseLong(idFunzionario), org.getGroupId()); + jsonFiglio.put("disponibile", lista.isEmpty()); array.put(jsonFiglio); } json.put("slot", array); @@ -124,32 +117,23 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl { Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); List userDefinitivo = new ArrayList(); try { - - if(organization != null){ - List users = UserLocalServiceUtil.getOrganizationUsers(Long.valueOf(presidio)); - + if (organization != null) { + List users = userLocalService.getOrganizationUsers(Long.valueOf(presidio)); for (User user : users) { Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); - - Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario"); - - if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){ - - boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole( - user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId()); - - - if(isIstruttore){ + Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), + "portos_calendario"); + if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) { + boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), + organization.getGroupId(), portosIstruttore.getRoleId()); + if (isIstruttore) { userDefinitivo.add(user); } } } } - - } catch (NumberFormatException | SystemException e) { - _log.error(e,e); - } catch (PortalException e) { - _log.error(e,e); + } catch (NumberFormatException | PortalException | SystemException e) { + _log.error(e, e); } Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioLocalServiceImpl.java index 835ca8de..21ca8470 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioLocalServiceImpl.java +++ b/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; -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.service.base.FunzionarioLocalServiceBaseImpl; import java.util.Date; 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. *

@@ -40,8 +40,9 @@ public class FunzionarioLocalServiceImpl extends FunzionarioLocalServiceBaseImpl * service. */ - public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia, - ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia, + ServiceContext serviceContext) throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); Date now = new Date(); @@ -74,8 +75,9 @@ public class FunzionarioLocalServiceImpl extends FunzionarioLocalServiceBaseImpl return this.deleteFunzionario(funzionario); } - public List findByPresidio(String presidio) throws SystemException { - return funzionarioPersistence.findByPresidio(presidio); - } + @Override + public List findByPresidio(String presidio) throws SystemException { + return funzionarioPersistence.findByPresidio(presidio); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioServiceImpl.java index 46611410..447943fe 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioServiceImpl.java +++ b/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; +import it.tref.liferay.portos.bo.shared.util.Constants; import it.tref.portos.calendar.appointments.model.Funzionario; 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.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; +import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.Organization; 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.ServiceContext; 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. @@ -55,81 +55,59 @@ public class FunzionarioServiceImpl extends FunzionarioServiceBaseImpl { private static Log _log = LogFactoryUtil.getLog(FunzionarioServiceImpl.class); - public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia, - ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia, + ServiceContext serviceContext) throws PortalException, SystemException { return funzionarioLocalService.addFunzionario(userId, nome, cognome, presidio, tipologia, serviceContext); } - public String getFunzionariByPresidio(String presidio) { - - JSONArray json = JSONFactoryUtil.createJSONArray(); - - try { - - Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); - - if(organization != null){ - - List users = UserLocalServiceUtil.getOrganizationUsers(Long.valueOf(presidio)); - - //Bug 32935 - Collections.sort(users, new UserComparator()); - - for (User user : users) { - - Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); - - Role portosGeologo = RoleLocalServiceUtil.getRole(organization.getCompanyId(), Constants.ROLE_NAME_GEOLOGO); - - Role portosCalendario = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario"); - - Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); - - if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){ - - boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole( - user.getUserId(), organization.getGroupId(), portosCalendario.getRoleId()); - - boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole( - user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId()); - - boolean isGeologo = UserLocalServiceUtil.hasRoleUser(portosGeologo.getRoleId(), user.getUserId()); - - - if(isCalendario){ - JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject(); - jsonFunzionario.put("id", user.getUserId()); - jsonFunzionario.put("nome", user.getFirstName()); - jsonFunzionario.put("cognome", user.getLastName()); - - if(isIstruttore){ - jsonFunzionario.put("tipologia", "Istruttore"); - } else if(isGeologo){ - jsonFunzionario.put("tipologia", "Geologo"); - } else { - jsonFunzionario.put("tipologia", ""); + @Override + public String getFunzionariByPresidio(String presidio) { + + JSONArray json = JSONFactoryUtil.createJSONArray(); + try { + Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); + if (organization != null) { + List users = userLocalService.getOrganizationUsers(Long.valueOf(presidio)); + Collections.sort(users, new UserComparator()); + for (User user : users) { + Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); + Role portosGeologo = RoleLocalServiceUtil.getRole(organization.getCompanyId(), + Constants.ROLE_NAME_GEOLOGO); + Role portosCalendario = RoleLocalServiceUtil.getRole(organization.getCompanyId(), + "portos_calendario"); + Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), + Constants.ROLE_NAME_ISTRUTTORE); + if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) { + boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), + organization.getGroupId(), portosCalendario.getRoleId()); + boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), + organization.getGroupId(), portosIstruttore.getRoleId()); + boolean isGeologo = userLocalService.hasRoleUser(portosGeologo.getRoleId(), + user.getUserId()); + if (isCalendario) { + JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject(); + jsonFunzionario.put("id", user.getUserId()); + jsonFunzionario.put("nome", user.getFirstName()); + jsonFunzionario.put("cognome", user.getLastName()); + if (isIstruttore) { + jsonFunzionario.put("tipologia", "Istruttore"); + } else if (isGeologo) { + jsonFunzionario.put("tipologia", "Geologo"); + } else { + jsonFunzionario.put("tipologia", StringPool.BLANK); + } + json.put(jsonFunzionario); } - - - - - json.put(jsonFunzionario); } } } + } catch (NumberFormatException | PortalException | SystemException e) { + _log.error(e, e); } - - } catch (NumberFormatException | SystemException e) { - _log.error(e,e); - } catch (PortalException e) { - _log.error(e,e); + return json.toString(); } - - return json.toString(); - } - - } class UserComparator implements Comparator { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java index b0bb7950..b57a3f9e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java +++ b/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.ServiceContext; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; +import com.liferay.portal.service.UserLocalServiceUtil; /** * The implementation of the prenotazione local service. @@ -55,45 +56,56 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm * service. */ - @Override - public Prenotazione addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate, - Date endDate, String descrizione, String telefono, String email, long presidio, - ServiceContext serviceContext) throws SystemException, PortalException { - - Prenotazione prenotazione = - prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName())); - User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - prenotazione.setCompanyId(serviceContext.getCompanyId()); - prenotazione.setUserId(user.getUserId()); - prenotazione.setUserName(user.getFullName()); - prenotazione.setCreateDate(serviceContext.getCreateDate(now)); - prenotazione.setModifiedDate(serviceContext.getModifiedDate(now)); - prenotazione.setGroupId(presidio); - prenotazione.setFunzionarioId(funzionarioId); - prenotazione.setProfessionistaId(professionistaId); - prenotazione.setStartDate(startDate); - prenotazione.setEndDate(endDate); - prenotazione.setDescLong(descrizione); - prenotazione.setTelefono(telefono); - prenotazione.setEmail(email); - prenotazione = updatePrenotazione(prenotazione); - return prenotazione; - } +//Product Backlog Item 32934 + public Prenotazione addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate, + Date endDate, String descrizione, String telefono, String email, long presidio, ServiceContext serviceContext) throws SystemException, PortalException { - @Override - public Prenotazione updatePrenotazione(long prenotazioneId, Date startDate, Date endDate, String descrizione, - ServiceContext serviceContext) throws SystemException, PortalException { + Prenotazione prenotazione = + prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName())); - Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId); - Date now = new Date(); - prenotazione.setModifiedDate(serviceContext.getModifiedDate(now)); - prenotazione.setStartDate(startDate); - prenotazione.setEndDate(endDate); - prenotazione.setDescLong(descrizione); - prenotazione = updatePrenotazione(prenotazione); - return prenotazione; - } + User user = userPersistence.findByPrimaryKey(userId); + + Date now = new Date(); + + prenotazione.setCompanyId(serviceContext.getCompanyId()); + prenotazione.setUserId(user.getUserId()); + prenotazione.setUserName(user.getFullName()); + prenotazione.setCreateDate(serviceContext.getCreateDate(now)); + prenotazione.setModifiedDate(serviceContext.getModifiedDate(now)); + prenotazione.setGroupId(presidio); + + prenotazione.setFunzionarioId(funzionarioId); + prenotazione.setProfessionistaId(professionistaId); + prenotazione.setStartDate(startDate); + prenotazione.setEndDate(endDate); + prenotazione.setDescLong(descrizione); + + //Product Backlog Item 32934 + prenotazione.setTelefono(telefono); + prenotazione.setEmail(email); + + prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione); + + return prenotazione; + } + + public Prenotazione updatePrenotazione(long prenotazioneId, Date startDate, Date endDate, String descrizione, + ServiceContext serviceContext) throws SystemException, PortalException { + + Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId); + + Date now = new Date(); + + prenotazione.setModifiedDate(serviceContext.getModifiedDate(now)); + + prenotazione.setStartDate(startDate); + prenotazione.setEndDate(endDate); + prenotazione.setDescLong(descrizione); + + prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione); + + return prenotazione; + } @Override public Prenotazione deletePrenotazione(Prenotazione prenotazione) throws SystemException { @@ -108,33 +120,31 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm return this.deletePrenotazione(prenotazione); } - @SuppressWarnings("unchecked") - @Override - public List findByStartDate(Date date) throws SystemException { + public List findByStartDate(Date date) throws SystemException { + Date start = DateUtils.truncate(date, java.util.Calendar.DAY_OF_MONTH); + Date end = DateUtils.addDays(start, 1); - Date start = DateUtils.truncate(date, java.util.Calendar.DAY_OF_MONTH); - Date end = DateUtils.addDays(start, 1); - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId")); - return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); - } + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId")); + return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); - @SuppressWarnings("unchecked") - @Override - public List findByDateHourFunzionario(Date date, long funzionarioId, long groupId) - throws SystemException { + } + + public List findByDateHourFunzionario(Date date, long funzionarioId, long groupId) throws SystemException { + + DynamicQuery dynamicQuery = dynamicQuery(); + + dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", date)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId)); + + return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", date)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId)); - return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); } - @Override - public int getAvailableSlotByStartDate_EndDate(long funzionarioId, Date startDate, Date endDate) - throws SystemException { + public int getAvailableSlotByStartDate_EndDate(long funzionarioId, Date startDate, Date endDate) + throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); @@ -151,45 +161,54 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm return (int) prenotazionePersistence.countWithDynamicQuery(dynamicQuery); } - @SuppressWarnings("unchecked") - @Override - public List findByFunzionario_StartDate(long funzionarioId, Date date, long groupId) - throws SystemException { + } - Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); - Date end = DateUtils.addHours(start, 22); - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId)); - dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); - dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end)); - return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); - } + public List findByFunzionario_StartDate(long funzionarioId, Date date, long groupId) throws SystemException { + Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); + Date end = DateUtils.addHours(start, 22); + + DynamicQuery dynamicQuery = dynamicQuery(); + + dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId)); + dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); + dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end)); + + return prenotazionePersistence.findWithDynamicQuery(dynamicQuery); + } + + public int countPrenotazioniPresidioPeriodo(long presidioId, String fromString, String toString) throws SystemException, PortalException, ParseException{ + + int count = 0; + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + + Date from = sdf.parse(fromString); + Date to = sdf.parse(toString); + + Calendar fromCal = Calendar.getInstance(); + fromCal.setTime(from); + fromCal.set(Calendar.HOUR_OF_DAY, 2); + + Calendar toCal = Calendar.getInstance(); + toCal.setTime(to); + toCal.set(Calendar.HOUR_OF_DAY, 22); + + + Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId); + Role portosCalendario = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_calendario"); + + if (org != null) { + + List users = UserLocalServiceUtil.getOrganizationUsers(presidioId); + for (User user : users) { + boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole( + user.getUserId(), org.getGroupId(), portosCalendario.getRoleId()); + + if(isCalendario){ + + DynamicQuery dynamicQuery = dynamicQuery(); - @Override - public int countPrenotazioniPresidioPeriodo(long presidioId, String fromString, String toString) - throws SystemException, PortalException, ParseException { - - int count = 0; - SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - Date from = sdf.parse(fromString); - Date to = sdf.parse(toString); - Calendar fromCal = Calendar.getInstance(); - fromCal.setTime(from); - fromCal.set(Calendar.HOUR_OF_DAY, 2); - Calendar toCal = Calendar.getInstance(); - toCal.setTime(to); - toCal.set(Calendar.HOUR_OF_DAY, 22); - Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId); - Role portosCalendario = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_calendario"); - if (org != null) { - List users = userLocalService.getOrganizationUsers(presidioId); - for (User user : users) { - boolean isCalendario = - UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(), - portosCalendario.getRoleId()); - if (isCalendario) { - DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId())); dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", fromCal.getTime(), toCal.getTime())); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId())); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneServiceImpl.java index b9831cea..2137487c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneServiceImpl.java +++ b/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) { _log.error(e, e); } + Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); JSONArray json = JSONFactoryUtil.createJSONArray(); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp index d654039d..8e7e7acd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp +++ b/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="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp index 6a89a46b..35e4ace3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp +++ b/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="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.model.Organization"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp index f373ee8e..2f0ab821 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp +++ b/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.model.Organization"%> <%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp index c732457f..5815f9f3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp +++ b/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"%> <%@ include file="/html/calendar_appointments/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp index 161d8081..b8d77306 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp +++ b/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"%> <%@ include file="/html/calendar_appointments/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp index f3db762d..11c883c0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp +++ b/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="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp index 8a21a366..07d5fcb0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp +++ b/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. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp index 0afcda91..065d3d8b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp +++ b/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/portlet_2_0" prefix="portlet" %>