Changeset View
Changeset View
Standalone View
Standalone View
plugins/libcalendaring/lib/libcalendaring_itip.php
Show First 20 Lines • Show All 461 Lines • ▼ Show 20 Lines | public function get_itip_status($event, $existing = null) | ||||
// We accept versions with older SEQUENCE but no significant changes (Bifrost#T78144) | // We accept versions with older SEQUENCE but no significant changes (Bifrost#T78144) | ||||
if (!$latest) { | if (!$latest) { | ||||
$num = $got = 0; | $num = $got = 0; | ||||
foreach (array('start', 'end', 'due', 'allday', 'recurrence', 'location') as $key) { | foreach (array('start', 'end', 'due', 'allday', 'recurrence', 'location') as $key) { | ||||
if (isset($existing[$key])) { | if (isset($existing[$key])) { | ||||
if ($key == 'allday') { | if ($key == 'allday') { | ||||
$event[$key] = $event[$key] == 'true'; | $event[$key] = $event[$key] == 'true'; | ||||
} | } | ||||
$value = $existing[$key] instanceof DateTime ? $existing[$key]->format('c') : $existing[$key]; | $value = ($existing[$key] instanceof DateTime || $existing[$key] instanceof DateTimeImmutable) ? $existing[$key]->format('c') : $existing[$key]; | ||||
$num++; | $num++; | ||||
$got += intval($value == $event[$key]); | $got += intval($value == $event[$key]); | ||||
} | } | ||||
} | } | ||||
$latest = $num === $got; | $latest = $num === $got; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | public function mail_itip_inline_ui($event, $method, $mime_id, $task, $message_date = null, $preview_url = null) | ||||
)); | )); | ||||
$buttons[] = html::div(array('id' => 'update-'.$dom_id, 'style' => 'display:none'), $update_button); | $buttons[] = html::div(array('id' => 'update-'.$dom_id, 'style' => 'display:none'), $update_button); | ||||
$buttons[] = html::div(array('id' => 'accept-'.$dom_id, 'style' => 'display:none'), $accept_buttons); | $buttons[] = html::div(array('id' => 'accept-'.$dom_id, 'style' => 'display:none'), $accept_buttons); | ||||
// For replies we need more metadata | // For replies we need more metadata | ||||
foreach (array('start', 'end', 'due', 'allday', 'recurrence', 'location') as $key) { | foreach (array('start', 'end', 'due', 'allday', 'recurrence', 'location') as $key) { | ||||
if (isset($event[$key])) { | if (isset($event[$key])) { | ||||
$metadata[$key] = $event[$key] instanceof DateTime ? $event[$key]->format('c') : $event[$key]; | $metadata[$key] = ($event[$key] instanceof DateTime || $event[$key] instanceof DateTimeImmutable) ? $event[$key]->format('c') : $event[$key]; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// when receiving iTip REQUEST messages: | // when receiving iTip REQUEST messages: | ||||
else if ($method == 'REQUEST') { | else if ($method == 'REQUEST') { | ||||
$emails = $this->lib->get_user_emails(); | $emails = $this->lib->get_user_emails(); | ||||
$title = $event['sequence'] > 0 ? $this->gettext('itipupdate') : $this->gettext('itipinvitation'); | $title = $event['sequence'] > 0 ? $this->gettext('itipupdate') : $this->gettext('itipinvitation'); | ||||
$metadata['rsvp'] = true; | $metadata['rsvp'] = true; | ||||
▲ Show 20 Lines • Show All 317 Lines • Show Last 20 Lines |