mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 11:30:55 +01:00
86a00ee4ab
Summary: Ref T10747. This barely works, but can technically import some event data. Test Plan: Used import flow to import a ".ics" document. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10747 Differential Revision: https://secure.phabricator.com/D16699
39 lines
945 B
PHP
39 lines
945 B
PHP
<?php
|
|
|
|
final class PhabricatorCalendarImportNameTransaction
|
|
extends PhabricatorCalendarImportTransactionType {
|
|
|
|
const TRANSACTIONTYPE = 'calendar.import.name';
|
|
|
|
public function generateOldValue($object) {
|
|
return $object->getName();
|
|
}
|
|
|
|
public function applyInternalEffects($object, $value) {
|
|
$object->setName($value);
|
|
}
|
|
|
|
public function getTitle() {
|
|
$old = $this->getOldValue();
|
|
$new = $this->getNewValue();
|
|
|
|
if (!strlen($old)) {
|
|
return pht(
|
|
'%s named this import %s.',
|
|
$this->renderAuthor(),
|
|
$this->renderNewValue());
|
|
} else if (!strlen($new)) {
|
|
return pht(
|
|
'%s removed the name of this import (was: %s).',
|
|
$this->renderAuthor(),
|
|
$this->renderOldValue());
|
|
} else {
|
|
return pht(
|
|
'%s renamed this import from %s to %s.',
|
|
$this->renderAuthor(),
|
|
$this->renderOldValue(),
|
|
$this->renderNewValue());
|
|
}
|
|
}
|
|
|
|
}
|