2016-07-13 00:44:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorCalendarEventUntilDateTransaction
|
|
|
|
extends PhabricatorCalendarEventDateTransaction {
|
|
|
|
|
|
|
|
const TRANSACTIONTYPE = 'calendar.recurrenceenddate';
|
|
|
|
|
|
|
|
public function generateOldValue($object) {
|
|
|
|
return $object->getRecurrenceEndDate();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function applyInternalEffects($object, $value) {
|
2016-10-03 19:14:14 +02:00
|
|
|
$actor = $this->getActor();
|
|
|
|
|
|
|
|
// TODO: DEPRECATED.
|
2016-07-13 00:44:11 +02:00
|
|
|
$object->setRecurrenceEndDate($value);
|
2016-10-03 19:14:14 +02:00
|
|
|
|
|
|
|
$datetime = PhutilCalendarAbsoluteDateTime::newFromEpoch(
|
|
|
|
$value,
|
|
|
|
$actor->getTimezoneIdentifier());
|
|
|
|
$datetime->setIsAllDay($object->getIsAllDay());
|
|
|
|
$object->setUntilDateTime($datetime);
|
2016-07-13 00:44:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitle() {
|
|
|
|
return pht(
|
|
|
|
'%s changed this event to repeat until %s.',
|
|
|
|
$this->renderAuthor(),
|
|
|
|
$this->renderNewDate());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitleForFeed() {
|
|
|
|
return pht(
|
|
|
|
'%s changed %s to repeat until %s.',
|
|
|
|
$this->renderAuthor(),
|
|
|
|
$this->renderObject(),
|
|
|
|
$this->renderNewDate());
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getInvalidDateMessage() {
|
|
|
|
return pht('Repeat until date is invalid.');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|