1) skip all past events and recurrences in conflict check and fix off-by-one error in recurrence limit

2) restructure config a bit:
- rename Birthday section to Addressbook
- rename Scheduling conflict section to Recurrences and conflict check
- add: Please note: conflict check is never done in the past and always limited by above recurrence horizont.
This commit is contained in:
Ralf Becker 2016-07-06 16:44:06 +02:00
parent cae960965e
commit 5374b39680
7 changed files with 55 additions and 28 deletions

View File

@ -287,7 +287,10 @@ class calendar_boupdate extends calendar_bo
* Check given event for conflicts and return them * Check given event for conflicts and return them
* *
* For recurring events we check a configurable fixed number of recurrences * For recurring events we check a configurable fixed number of recurrences
* or we try for a fixed maximum time. * and for a fixed maximum time (default 3s).
*
* Conflict check skips past events/recurrences and is always limited by recurrence horizont,
* as it would only report non-recurring events after.
* *
* @param array $event * @param array $event
* @param Api\DateTime& $checked_excluding =null time until which (excluding) recurrences have been checked * @param Api\DateTime& $checked_excluding =null time until which (excluding) recurrences have been checked
@ -341,11 +344,14 @@ class calendar_boupdate extends calendar_bo
{ {
$startts = $date->format('ts'); $startts = $date->format('ts');
// skip past events or recurrences
if ($startts+$duration < $this->now_su) continue;
// abort check if configured limits are exceeded // abort check if configured limits are exceeded
if ($event['recur_type'] && if ($event['recur_type'] &&
($checked++ > $max_checked && $max_checked > 0 || // maximum number of checked recurrences exceeded (++$checked > $max_checked && $max_checked > 0 || // maximum number of checked recurrences exceeded
microtime(true) > $start+$max_check_time || // max check time exceeded microtime(true) > $start+$max_check_time || // max check time exceeded
$startts > $this->config['horizont'])) // we are behind horizont for which recurring events are rendered $startts > $this->config['horizont'])) // we are behind horizon for which recurrences are rendered
{ {
if ($this->debug > 2 || $this->debug == 'conflicts') if ($this->debug > 2 || $this->debug == 'conflicts')
{ {

View File

@ -397,6 +397,7 @@ people holiday calendar de Feiertag
permission denied calendar de Zugriff verweigert permission denied calendar de Zugriff verweigert
planner by category calendar de Planer nach Kategorien planner by category calendar de Planer nach Kategorien
planner by user calendar de Planer nach Benutzern planner by user calendar de Planer nach Benutzern
please note: conflict check is never done in the past and always limited by above recurrence horizont. calendar de Bitte beachten: Konfliktprüfung findet nie in der Vergangenheit statt und ist immer durch den obigen Wiederholungs-Bereich beschränkt.
please note: you can configure the field assignments after you uploaded the file. calendar de Bitte beachten: Die Feldzuordnung kann NACH dem Hochladen der Datei konfiguriert werden. please note: you can configure the field assignments after you uploaded the file. calendar de Bitte beachten: Die Feldzuordnung kann NACH dem Hochladen der Datei konfiguriert werden.
preselected group for entering the planner calendar de Vorausgewählte Gruppe beim Planer-Aufruf preselected group for entering the planner calendar de Vorausgewählte Gruppe beim Planer-Aufruf
prevent deleting of entries admin de Das Löschen von Einträgen verhindern prevent deleting of entries admin de Das Löschen von Einträgen verhindern
@ -413,6 +414,8 @@ receive summary of appointments calendar de Zusammenfassung der Termine erhalten
recover calendar de Wiederherstellen recover calendar de Wiederherstellen
recovered calendar de wieder hergestellt recovered calendar de wieder hergestellt
recurrence calendar de Wiederholung recurrence calendar de Wiederholung
recurrence enddate calendar de Enddatum der Wiederholung
recurrences and conflict check calendar de Wiederholungen und Konfliktprüfung
recurring event calendar de Wiederholender Termin recurring event calendar de Wiederholender Termin
reject calendar de Absagen reject calendar de Absagen
rejected calendar de Abgesagt rejected calendar de Abgesagt

View File

@ -397,6 +397,7 @@ people holiday calendar en People holiday
permission denied calendar en Permission denied. permission denied calendar en Permission denied.
planner by category calendar en Planner by category planner by category calendar en Planner by category
planner by user calendar en Planner by user planner by user calendar en Planner by user
please note: conflict check is never done in the past and always limited by above recurrence horizont. calendar en Please note: conflict check is never done in the past and always limited by above recurrence horizont.
please note: you can configure the field assignments after you uploaded the file. calendar en Note: You can configure the field assignments AFTER you uploaded the file. please note: you can configure the field assignments after you uploaded the file. calendar en Note: You can configure the field assignments AFTER you uploaded the file.
preselected group for entering the planner calendar en Pre-selected group for entering the planner preselected group for entering the planner calendar en Pre-selected group for entering the planner
prevent deleting of entries admin en Prevent deleting of entries prevent deleting of entries admin en Prevent deleting of entries
@ -414,6 +415,7 @@ recover calendar en Recover
recovered calendar en Recovered. recovered calendar en Recovered.
recurrence calendar en Recurrence recurrence calendar en Recurrence
recurrence enddate calendar en Recurrence end date recurrence enddate calendar en Recurrence end date
recurrences and conflict check calendar en Recurrences and conflict check
recurring event calendar en Recurring event recurring event calendar en Recurring event
reject calendar en Reject reject calendar en Reject
rejected calendar en Rejected rejected calendar en Rejected

View File

@ -128,6 +128,12 @@
background-color: white; background-color: white;
} }
/* Conflict display */
div.calendar_conflicts {
max-height: 540px;
overflow-y: auto;
}
/* Loader - hide sizing behind overlay*/ /* Loader - hide sizing behind overlay*/
#egw-loadin-prompt_calendar::before { #egw-loadin-prompt_calendar::before {
opacity: 1; opacity: 1;

View File

@ -84,7 +84,7 @@
</select> </select>
</row> </row>
<row> <row>
<description value="Birthdays" span="all" class="subHeader"/> <description value="Addressbook" span="all" class="subHeader"/>
</row> </row>
<row> <row>
<description value="Show birthdays from addressbook" label="%s:"/> <description value="Show birthdays from addressbook" label="%s:"/>
@ -94,10 +94,6 @@
<option value="yes">No</option> <option value="yes">No</option>
</select> </select>
</row> </row>
<row>
<description value="Calendar recurrence horizont in days (default 1000)" label="%s:"/>
<textbox id="newsettings[calendar_horizont]" size="5"/>
</row>
<row> <row>
<description value="Create links for participants from addressbook" label="%s:"/> <description value="Create links for participants from addressbook" label="%s:"/>
<select id="newsettings[link_contacts]"> <select id="newsettings[link_contacts]">
@ -106,7 +102,14 @@
</select> </select>
</row> </row>
<row> <row>
<description value="Scheduling conflict" span="all" class="subHeader"/> <description value="Recurrences and conflict check" span="all" class="subHeader"/>
</row>
<row>
<description value="Calendar recurrence horizont in days (default 1000)"/>
<textbox id="newsettings[calendar_horizont]" size="5"/>
</row>
<row>
<description value="Please note: conflict check is never done in the past and always limited by above recurrence horizont." span="all"/>
</row> </row>
<row> <row>
<description value="Limit search for conflicts in recurrences to given time in seconds (default 3)"/> <description value="Limit search for conflicts in recurrences to given time in seconds (default 3)"/>

View File

@ -4,6 +4,7 @@
<overlay> <overlay>
<template id="calendar.conflicts" template="" lang="" group="0" version="1.0.1.001"> <template id="calendar.conflicts" template="" lang="" group="0" version="1.0.1.001">
<description value="Scheduling conflict" class="calendar_size120b"/> <description value="Scheduling conflict" class="calendar_size120b"/>
<box class="calendar_conflicts">
<grid> <grid>
<columns> <columns>
<column/> <column/>
@ -23,6 +24,7 @@
</row> </row>
</rows> </rows>
</grid> </grid>
</box>
<hbox> <hbox>
<button label="Ignore conflict" id="button[ignore]" statustext="Saves the event ignoring the conflict"/> <button label="Ignore conflict" id="button[ignore]" statustext="Saves the event ignoring the conflict"/>
<button id="button[reedit]" label="Re-Edit event" statustext="Allows to edit the event again"/> <button id="button[reedit]" label="Re-Edit event" statustext="Allows to edit the event again"/>

View File

@ -138,6 +138,11 @@
padding: 2px; padding: 2px;
background-color: white; background-color: white;
} }
/* Conflict display */
div.calendar_conflicts {
max-height: 540px;
overflow-y: auto;
}
/* Loader - hide sizing behind overlay*/ /* Loader - hide sizing behind overlay*/
#egw-loadin-prompt_calendar::before { #egw-loadin-prompt_calendar::before {
opacity: 1; opacity: 1;