Commit 28211363 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-983 Set start and endtime to the next half hour if not set for

appointments created on a mobile.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 5046222b
......@@ -1445,6 +1445,19 @@ class Sync extends RequestProcessor {
case SYNC_ADD:
self::$topCollector->AnnounceInformation(sprintf("Creating new message from mobile %d", $messageCount));
try {
// set start & endtime to the next half hour - see https://jira.z-hub.io/browse/ZP-983
if ($message instanceof SyncAppointment) {
if (!isset($message->starttime)) {
// round starttime up to the next half hour
$time = time();
$offset = ($time % 1800);
$message->starttime = $time + 1800 - $offset;
}
if (!isset($message->endtime)) {
// set endtime to starttime + half hour
$message->endtime = $message->starttime + 1800;
}
}
// ignore sms messages
if ($foldertype == "SMS") {
ZLog::Write(LOGLEVEL_DEBUG, "SMS sync are not supported. Ignoring message.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment