Path: blob/master/src/applications/calendar/xaction/PhabricatorCalendarEventUntilDateTransaction.php
12256 views
<?php12final class PhabricatorCalendarEventUntilDateTransaction3extends PhabricatorCalendarEventDateTransaction {45const TRANSACTIONTYPE = 'calendar.recurrenceenddate';67public function generateOldValue($object) {8$editor = $this->getEditor();910$until = $object->newUntilDateTime();11if (!$until) {12return null;13}1415return $until16->newAbsoluteDateTime()17->setIsAllDay($editor->getOldIsAllDay())18->toDictionary();19}2021public function applyInternalEffects($object, $value) {22$actor = $this->getActor();23$editor = $this->getEditor();2425if ($value) {26$datetime = PhutilCalendarAbsoluteDateTime::newFromDictionary($value);27$datetime->setIsAllDay($editor->getNewIsAllDay());28$object->setUntilDateTime($datetime);29} else {30$object->setUntilDateTime(null);31}32}3334public function getTitle() {35if ($this->getNewValue()) {36return pht(37'%s changed this event to repeat until %s.',38$this->renderAuthor(),39$this->renderNewDate());40} else {41return pht(42'%s changed this event to repeat forever.',43$this->renderAuthor());44}45}4647public function getTitleForFeed() {48if ($this->getNewValue()) {49return pht(50'%s changed %s to repeat until %s.',51$this->renderAuthor(),52$this->renderObject(),53$this->renderNewDate());54} else {55return pht(56'%s changed %s to repeat forever.',57$this->renderAuthor(),58$this->renderObject());59}60}6162protected function getInvalidDateMessage() {63return pht('Repeat until date is invalid.');64}6566}676869