From 515bad6d3b95a6c21e3e3f9adf15e5aa6a94cddc Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 27 Apr 2020 11:02:26 -0600 Subject: [PATCH] Calendar: Event from mail now defaults to start of next hour to match other places, instead of time the email was sent --- calendar/inc/class.calendar_uiforms.inc.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 287b3eaece..4606b59eda 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -3375,7 +3375,8 @@ class calendar_uiforms extends calendar_ui )); // Prepare calendar event draft - $event = array( + $event = $this->default_add_event(); + $event = array_merge($event, array( 'title' => $mailContent['subject'], 'description' => $mailContent['message'], 'participants' => $participants, @@ -3383,10 +3384,16 @@ class calendar_uiforms extends calendar_ui 'to_app' => 'calendar', 'to_id' => 0, ), - 'start' => $mailContent['date'], 'duration' => 60 * $this->cal_prefs['interval'], 'owner' => $GLOBALS['egw_info']['user']['account_id'] - ); + )); + $ts = new Api\DateTime(); + $ts->setUser(); + if($mailContent['date'] >= $ts->format('ts')) + { + // Mail from the future! Ok, use that date + $event['start'] = $mailContent['date']; + } if (is_array($mailContent['attachments'])) {