Differential D16280 Diff 39167 src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
Show All 12 Lines | final class PhabricatorCalendarEventTransaction | ||||
const TYPE_INVITE = 'calendar.invite'; | const TYPE_INVITE = 'calendar.invite'; | ||||
const TYPE_ACCEPT = 'calendar.accept'; | const TYPE_ACCEPT = 'calendar.accept'; | ||||
const TYPE_DECLINE = 'calendar.decline'; | const TYPE_DECLINE = 'calendar.decline'; | ||||
const TYPE_RECURRING = 'calendar.recurring'; | const TYPE_RECURRING = 'calendar.recurring'; | ||||
const TYPE_FREQUENCY = 'calendar.frequency'; | const TYPE_FREQUENCY = 'calendar.frequency'; | ||||
const TYPE_RECURRENCE_END_DATE = 'calendar.recurrenceenddate'; | const TYPE_RECURRENCE_END_DATE = 'calendar.recurrenceenddate'; | ||||
const MAILTAG_RESCHEDULE = 'calendar-reschedule'; | const MAILTAG_RESCHEDULE = 'calendar-reschedule'; | ||||
const MAILTAG_CONTENT = 'calendar-content'; | const MAILTAG_CONTENT = 'calendar-content'; | ||||
const MAILTAG_OTHER = 'calendar-other'; | const MAILTAG_OTHER = 'calendar-other'; | ||||
public function getApplicationName() { | public function getApplicationName() { | ||||
return 'calendar'; | return 'calendar'; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case self::TYPE_DECLINE: | case self::TYPE_DECLINE: | ||||
return pht( | return pht( | ||||
'%s declined this event.', | '%s declined this event.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case self::TYPE_INVITE: | case self::TYPE_INVITE: | ||||
$text = null; | $text = null; | ||||
// Fill in any new invitees as "uninvited" in the old data, to make | |||||
// some of the rendering logic a little easier. | |||||
$status_uninvited = PhabricatorCalendarEventInvitee::STATUS_UNINVITED; | |||||
$old = $old + array_fill_keys(array_keys($new), $status_uninvited); | |||||
if (count($old) === 1 | if (count($old) === 1 | ||||
&& count($new) === 1 | && count($new) === 1 | ||||
&& isset($old[$author_phid])) { | && isset($old[$author_phid])) { | ||||
// user joined/declined/accepted event themself | // user joined/declined/accepted event themself | ||||
$old_status = $old[$author_phid]; | $old_status = $old[$author_phid]; | ||||
$new_status = $new[$author_phid]; | $new_status = $new[$author_phid]; | ||||
if ($old_status !== $new_status) { | if ($old_status !== $new_status) { | ||||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
case self::TYPE_DECLINE: | case self::TYPE_DECLINE: | ||||
return pht( | return pht( | ||||
'%s declined %s.', | '%s declined %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
case self::TYPE_INVITE: | case self::TYPE_INVITE: | ||||
$text = null; | $text = null; | ||||
$status_uninvited = PhabricatorCalendarEventInvitee::STATUS_UNINVITED; | |||||
$old = $old + array_fill_keys(array_keys($new), $status_uninvited); | |||||
if (count($old) === 1 | if (count($old) === 1 | ||||
&& count($new) === 1 | && count($new) === 1 | ||||
&& isset($old[$author_phid])) { | && isset($old[$author_phid])) { | ||||
// user joined/declined/accepted event themself | // user joined/declined/accepted event themself | ||||
$old_status = $old[$author_phid]; | $old_status = $old[$author_phid]; | ||||
$new_status = $new[$author_phid]; | $new_status = $new[$author_phid]; | ||||
if ($old_status !== $new_status) { | if ($old_status !== $new_status) { | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |