Skip to content

Commit 60daef0

Browse files
committed
Feature #14464
In calendars, when a notification is sent to users about an operation done on an event, if this event spans over several days, its end date is specified in the notification text. In order to know if an event spans over several days, a new method is added to the Period object and this method gives this information.
1 parent 6b7df92 commit 60daef0

25 files changed

+102
-69
lines changed

core-api/src/main/java/org/silverpeas/core/calendar/CalendarComponent.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@
4848
* A calendar component is a set of properties that express a common semantic for all objects
4949
* planned in a calendar. Those objects can be an event, a to-do, and so one and they share a
5050
* common set of properties that are defined in this class.
51-
*
51+
* <p>
5252
* This class is dedicated to be used into an implementation composition by the more concrete
5353
* representations of a calendar component (like for example {@link CalendarEvent}). We recommend
5454
* strongly to force the update of the {@link CalendarComponent} instance when a property is
5555
* modified in the outer object; this is a requirement for date properties (like the recurrence
5656
* rule for a recurrent outer object).
57+
* </p>
5758
* @author mmoquillon
5859
*/
5960
@Entity
@@ -250,16 +251,18 @@ public AttendeeSet getAttendees() {
250251
* Any changes to some properties of a calendar component increment this sequence number. This
251252
* number is mainly dedicated with the synchronization or syndication mechanism of calendar
252253
* components with external calendars. Its meaning comes from the icalendar specification.
253-
*
254+
* <p>
254255
* The sequence number will be always incremented when a date property is modified (the period at
255256
* which the component occurs in the calendar, the recurrence rule for a recurrent component).
256257
* Nevertheless, it can also be incremented with the change of some other properties.
257-
*
258+
* </p>
259+
* <p>
258260
* Actually the sequence number has the same meaning than the version number
259261
* ({@link CalendarComponent#getVersion()}) minus the sequence number can to be not incremented
260262
* with the change of some properties. This means than the version number matches always the
261263
* number of updates of the calendar component whereas the sequence number matches only a
262264
* subset of update of the calendar component.
265+
* </p>
263266
* @return the revision number of this calendar component;
264267
*/
265268
public long getSequence() {

core-api/src/main/java/org/silverpeas/core/date/Period.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@
2929
import javax.persistence.Column;
3030
import javax.persistence.Embeddable;
3131
import java.io.Serializable;
32-
import java.time.Instant;
33-
import java.time.LocalDate;
34-
import java.time.LocalDateTime;
35-
import java.time.OffsetDateTime;
36-
import java.time.ZoneOffset;
37-
import java.time.ZonedDateTime;
32+
import java.time.*;
3833
import java.time.temporal.ChronoUnit;
3934
import java.time.temporal.Temporal;
4035
import java.util.Date;
@@ -383,6 +378,17 @@ public boolean isInDays() {
383378
return inDays;
384379
}
385380

381+
/**
382+
* Does this period span over several days?
383+
* @return true if the end date of this period is after at least one day its start date. False
384+
* otherwise.
385+
*/
386+
public boolean spanOverSeveralDays() {
387+
return LocalDate.ofInstant(endDateTime, ZoneOffset.UTC).minusDays(1)
388+
.isAfter(LocalDate.ofInstant(startDateTime,
389+
ZoneOffset.UTC));
390+
}
391+
386392
/**
387393
* Is this period an indefinite one? That is to say a period ranging over an indefinite range of
388394
* time meaning that whatever any event, it occurs during this period. In Silverpeas, an
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ bittet um Ihre Teilnahme an der Veranstaltungen <b>$contributionName$</b> seit dem <i>$contributionDate$</i> geändert
2+
$senderName$ bittet um Ihre Teilnahme an allen Veranstaltungen <b>$contributionName$</b>$if(contributionStartDate)$ ab dem <i>$contributionDate$</i>$endif$
33
$else$
4-
$senderName$ bittet um Ihre Teilnahme an der Veranstaltung <b>$contributionName$</b> vom <i>$contributionDate$</i>
4+
$senderName$ bittet um Ihre Teilnahme an die Veranstaltung <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ vom <i>$contributionStartDate$</i> bis zum <i>$contributionEndDate$</i>$else$ für den <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ asks for your participation in all the events <b>$contributionName$</b> since <i>$contributionDate$</i>
2+
$senderName$ asks for your participation in all the events <b>$contributionName$</b>$if(contributionStartDate)$ from <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ asks for your participation in the event <b>$contributionName$</b> at <i>$contributionDate$</i>
4+
$senderName$ asks for your participation in the event <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ from <i>$contributionStartDate$</i> to <i>$contributionEndDate$</i>$else$ for <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ vous invite à tous les événements <b>$contributionName$</b> à partir du <i>$contributionDate$</i>
2+
$senderName$ vous invite à tous les événements <b>$contributionName$</b>$if(contributionStartDate)$ à partir du <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ vous invite à l'événement <b>$contributionName$</b> du <i>$contributionDate$</i>
4+
$senderName$ vous invite à l'événement <b>$contributionName$</b>$if(contributionStartDate)$ du <i>$contributionStartDate$</i>$if(contributionEndDate)$ jusqu'au <i>$contributionEndDate$</i>$endif$$endif$
55
$endif$
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ $participation$ an der Veranstaltungen <b>$contributionName$</b> seit dem <i>$contributionDate$</i> geändert
2+
$senderName$ $participation$ an allen Veranstaltungen <b>$contributionName$</b>$if(contributionStartDate)$ ab dem <i>$contributionDate$</i>$endif$
33
$else$
4-
$senderName$ $participation$ an der Veranstaltung <b>$contributionName$</b> vom <i>$contributionDate$</i>
5-
$endif$
4+
$senderName$ $participation$ an die Veranstaltung <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ vom <i>$contributionStartDate$</i> bis zum <i>$contributionEndDate$</i>$else$ für den <i>$contributionStartDate$</i>$endif$$endif$
5+
$endif$
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ $participation$ in the events <b>$contributionName$</b> since <i>$contributionDate$</i>
2+
$senderName$ $participation$ in the events <b>$contributionName$</b>$if(contributionStartDate)$ from <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ $participation$ in the event <b>$contributionName$</b> at <i>$contributionDate$</i>
4+
$senderName$ $participation$ in the event <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ from <i>$contributionStartDate$</i> to <i>$contributionEndDate$</i>$else$ for <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ $participation$ à tous les événements <b>$contributionName$</b> à partir de <i>$contributionDate$</i>
2+
$senderName$ $participation$ à tous les événements <b>$contributionName$</b>$if(contributionStartDate)$ à partir du <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ $participation$ à l'événement <b>$contributionName$</b> du <i>$contributionDate$</i>
4+
$senderName$ $participation$ à l'événement <b>$contributionName$</b>$if(contributionStartDate)$ du <i>$contributionStartDate$</i>$if(contributionEndDate)$ jusqu'au <i>$contributionEndDate$</i>$endif$$endif$
55
$endif$
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ es verändert Ihre Präsenz-Status an der Veranstaltungen <b>$contributionName$</b> seit dem <i>$contributionDate$</i> geändert
2+
$senderName$ hat Ihren Präsenz-Status für allen Veranstaltungen <b>$contributionName$</b>$if(contributionStartDate)$ ab dem <i>$contributionDate$</i> geändert$else$ geändert$endif$
33
$else$
4-
$senderName$ es verändert Ihre Präsenz-Status an der Veranstaltung <b>$contributionName$</b> vom <i>$contributionDate$</i>
4+
$senderName$ hat Ihren Präsenz-Status an die Veranstaltung <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ vom <i>$contributionStartDate$</i> bis zum <i>$contributionEndDate$</i> geändert$else$ für den <i>$contributionStartDate$</i> geändert$endif$$else$ geändert$endif$
55
$endif$
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ has updated your presence status in all the events <b>$contributionName$</b> since <i>$contributionDate$</i>
2+
$senderName$ has updated your presence status in all the events <b>$contributionName$</b>$if(contributionStartDate)$ from <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ has updated your presence status in the event <b>$contributionName$</b> at <i>$contributionDate$</i>
4+
$senderName$ has updated your presence status in the event <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ from <i>$contributionStartDate$</i> to <i>$contributionEndDate$</i>$else$ for <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ a modifié votre status de présence pour les événements <b>$contributionName$</b> à partir de <i>$contributionDate$</i>
2+
$senderName$ a modifié votre status de présence pour les événements <b>$contributionName$</b>$if(contributionStartDate)$ à partir du <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ a modifié votre status de présence à l'événement <b>$contributionName$</b> du <i>$contributionDate$</i>
4+
$senderName$ a modifié votre status de présence pour l'événement <b>$contributionName$</b>$if(contributionStartDate)$ du <i>$contributionStartDate$</i>$if(contributionEndDate)$ jusqu'au <i>$contributionEndDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
Sie beteiligen sich nicht mehr in die Veranstaltungen <b>$contributionName$</b> seit dem <i>$contributionDate$</i> geändert
2+
$senderName$ hat Ihre Teilnahme an allen Veranstaltungen <b>$contributionName$</b>$if(contributionStartDate)$ ab dem <i>$contributionDate$</i> entfernt$else$ entfernt$endif$
33
$else$
4-
Sie beteiligen sich nicht mehr in die Veranstaltung <b>$contributionName$</b> vom <i>$contributionDate$</i>
4+
$senderName$ hat Ihre Teilnahme an die Veranstaltung <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ vom <i>$contributionStartDate$</i> bis zum <i>$contributionEndDate$</i> entfernt$else$ für den <i>$contributionStartDate$</i> entfernt$endif$$else$ entfernt$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
You don't participate anymore in the events <b>$contributionName$</b> since <i>$contributionDate$</i>
2+
$senderName$ has removed your participation in all the events <b>$contributionName$</b><i>$contributionDate$</i>$if(contributionStartDate)$ from <i>$contributionStartDate$</i>$endif$
33
$else$
4-
You don't participate anymore in the event <b>$contributionName$</b> at <i>$contributionDate$</i>
4+
$senderName$ has removed your participation in the event <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ from <i>$contributionStartDate$</i> to <i>$contributionEndDate$</i>$else$ for <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
Votre participation à tous les événements <b>$contributionName$</b> à partir du <i>$contributionDate$</i> a été retirée par $senderName$
2+
$senderName$ a retiré votre participation à tous les événements <b>$contributionName$</b>$if(contributionStartDate)$ à partir du <i>$contributionStartDate$</i>$endif$
33
$else$
4-
Votre participation à l'événement <b>$contributionName$</b> du <i>$contributionDate$</i> a été retirée par $senderName$
4+
$senderName$ a retiré votre participation à l'événement <b>$contributionName$</b>$if(contributionStartDate)$ du <i>$contributionStartDate$</i>$if(contributionEndDate)$ jusqu'au <i>$contributionEndDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ hat alle <b>$contributionName$</b> Ereignisse aus <i>$contributionDate$</i> erstellt
2+
$senderName$ hat allen Veranstaltungen <b>$contributionName$</b>$if(contributionStartDate)$ ab dem <i>$contributionDate$</i> erstellt$else erstellt$endif$
33
$else$
4-
$senderName$ hat das Ereignis <b>$contributionName$</b> aus <i>$contributionDate$</i> erstellt
4+
$senderName$ hat die Veranstaltung <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ vom <i>$contributionStartDate$</i> bis zum <i>$contributionEndDate$</i> erstellt$else$ für den <i>$contributionStartDate$</i> erstellt$endif$$else$ erstellt$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ has created all the events <b>$contributionName$</b> since <i>$contributionDate$</i>
2+
$senderName$ has created all the events <b>$contributionName$</b>$if(contributionStartDate)$ from <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ has created the event <b>$contributionName$</b> at <i>$contributionDate$</i>
4+
$senderName$ has created the event <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ from <i>$contributionStartDate$</i> to <i>$contributionEndDate$</i>$else$ for <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ a créé tous les événements <b>$contributionName$</b> à partir du <i>$contributionDate$</i>
2+
$senderName$ a créé tous les événements <b>$contributionName$</b>$if(contributionStartDate)$ à partir du <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ a créé l'événement <b>$contributionName$</b> du <i>$contributionDate$</i>
4+
$senderName$ a créé l'événement <b>$contributionName$</b>$if(contributionStartDate)$ du <i>$contributionStartDate$</i>$if(contributionEndDate)$ jusqu'au <i>$contributionEndDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ hat gelöscht der Veranstaltungen <b>$contributionName$</b> seit dem <i>$contributionDate$</i> geändert
2+
$senderName$ hat allen Veranstaltungen <b>$contributionName$</b>$if(contributionStartDate)$ ab dem <i>$contributionDate$</i> gelöscht$else$ gelöscht$endif$
33
$else$
4-
$senderName$ hat gelöscht der Veranstaltung <b>$contributionName$</b> vom <i>$contributionDate$</i>
4+
$senderName$ hat die Veranstaltung <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ vom <i>$contributionStartDate$</i> bis zum <i>$contributionEndDate$</i> gelöscht$else$ für den <i>$contributionStartDate$</i> gelöscht$endif$$else$ gelöscht$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ has deleted all the events <b>$contributionName$</b> since <i>$contributionDate$</i>
2+
$senderName$ has deleted all the events <b>$contributionName$</b>$if(contributionStartDate)$ from <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ has deleted the event <b>$contributionName$</b> at <i>$contributionDate$</i>
4+
$senderName$ has deleted the event <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ from <i>$contributionStartDate$</i> to <i>$contributionEndDate$</i>$else$ for <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ a supprimé tous les événements <b>$contributionName$</b> à partir de <i>$contributionDate$</i>
2+
$senderName$ a supprimé tous les événements <b>$contributionName$</b>$if(contributionStartDate)$ à partir du <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ a supprimé l'événement <b>$contributionName$</b> du <i>$contributionDate$</i>
4+
$senderName$ a supprimé l'événement <b>$contributionName$</b>$if(contributionStartDate)$ du <i>$contributionStartDate$</i>$if(contributionEndDate)$ jusqu'au <i>$contributionEndDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ das Veranstaltungen <b>$contributionName$</b> seit dem <i>$contributionDate$</i> geändert aktualisiert
2+
$senderName$ hat allen Veranstaltungen <b>$contributionName$</b>$if(contributionStartDate)$ ab dem <i>$contributionDate$</i> geändert$else$ geändert$endif$
33
$else$
4-
$senderName$ das Veranstaltung <b>$contributionName$</b> vom <i>$contributionDate$</i> aktualisiert
4+
$senderName$ hat die Veranstaltung <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ vom <i>$contributionStartDate$</i> bis zum <i>$contributionEndDate$</i> geändert$else$ für den <i>$contributionStartDate$</i> bearbeitet$endif$$else$ geändert$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ has updated all the events <b>$contributionName$</b> since <i>$contributionDate$</i>
2+
$senderName$ has updated all the events <b>$contributionName$</b>$if(contributionStartDate)$ from <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ has updated the event <b>$contributionName$</b> at <i>$contributionDate$</i>
4+
$senderName$ has updated the event <b>$contributionName$</b>$if(contributionStartDate)$$if(contributionEndDate)$ from <i>$contributionStartDate$</i> to <i>$contributionEndDate$</i>$else$ for <i>$contributionStartDate$</i>$endif$$endif$
55
$endif$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$if(several)$
2-
$senderName$ a modifié tous les événements <b>$contributionName$</b> à partir du <i>$contributionDate$</i>
2+
$senderName$ a modifié tous les événements <b>$contributionName$</b>$if(contributionStartDate)$ à partir du <i>$contributionStartDate$</i>$endif$
33
$else$
4-
$senderName$ a modifié l'événement <b>$contributionName$</b> du <i>$contributionDate$</i>
4+
$senderName$ a modifié l'événement <b>$contributionName$</b>$if(contributionStartDate)$ du <i>$contributionStartDate$</i>$if(contributionEndDate)$ jusqu'au <i>$contributionEndDate$</i>$endif$$endif$
55
$endif$

core-configuration/src/main/config/resources/StringTemplates/core/calendar/notification_de.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<b>$senderName$</b> is notifying you about event <b>$event.title$</b>.
1+
<b>$senderName$</b> benachrichtigt Sie über die Veranstaltung <b>$event.title$</b>.
22

33
$if(senderMessage)$
44
<div style="background-color:#FFF9D7; border:1px solid #E2C822; padding:5px; width:390px;">$senderMessage$</div>

0 commit comments

Comments
 (0)