Differential D16272 Diff 39144 src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
<?php | <?php | ||||
final class PhabricatorCalendarEventTransaction | final class PhabricatorCalendarEventTransaction | ||||
extends PhabricatorApplicationTransaction { | extends PhabricatorApplicationTransaction { | ||||
const TYPE_NAME = 'calendar.name'; | const TYPE_NAME = 'calendar.name'; | ||||
const TYPE_START_DATE = 'calendar.startdate'; | const TYPE_START_DATE = 'calendar.startdate'; | ||||
const TYPE_END_DATE = 'calendar.enddate'; | const TYPE_END_DATE = 'calendar.enddate'; | ||||
const TYPE_DESCRIPTION = 'calendar.description'; | const TYPE_DESCRIPTION = 'calendar.description'; | ||||
const TYPE_CANCEL = 'calendar.cancel'; | const TYPE_CANCEL = 'calendar.cancel'; | ||||
const TYPE_ALL_DAY = 'calendar.allday'; | const TYPE_ALL_DAY = 'calendar.allday'; | ||||
const TYPE_ICON = 'calendar.icon'; | const TYPE_ICON = 'calendar.icon'; | ||||
const TYPE_INVITE = 'calendar.invite'; | const TYPE_INVITE = 'calendar.invite'; | ||||
const TYPE_ACCEPT = 'calendar.accept'; | |||||
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 131 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
return pht( | return pht( | ||||
'%s cancelled this event.', | '%s cancelled this event.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s reinstated this event.', | '%s reinstated this event.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
} | } | ||||
case self::TYPE_ACCEPT: | |||||
return pht( | |||||
'%s is attending this event.', | |||||
$this->renderHandleLink($author_phid)); | |||||
case self::TYPE_DECLINE: | |||||
return pht( | |||||
'%s declined this event.', | |||||
$this->renderHandleLink($author_phid)); | |||||
case self::TYPE_INVITE: | case self::TYPE_INVITE: | ||||
$text = null; | $text = null; | ||||
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]; | ||||
▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s reinstated %s.', | '%s reinstated %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
} | } | ||||
case self::TYPE_ACCEPT: | |||||
return pht( | |||||
'%s is attending %s.', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderHandleLink($object_phid)); | |||||
case self::TYPE_DECLINE: | |||||
return pht( | |||||
'%s declined %s.', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderHandleLink($object_phid)); | |||||
case self::TYPE_INVITE: | case self::TYPE_INVITE: | ||||
$text = null; | $text = null; | ||||
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]; | ||||
▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines |