2014-01-09 21:19:54 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DrydockBlueprintTransaction
|
|
|
|
extends PhabricatorApplicationTransaction {
|
|
|
|
|
2015-09-24 19:18:17 +02:00
|
|
|
const TYPE_NAME = 'drydock:blueprint:name';
|
|
|
|
const TYPE_DISABLED = 'drydock:blueprint:disabled';
|
2014-01-09 21:19:54 +01:00
|
|
|
|
|
|
|
public function getApplicationName() {
|
|
|
|
return 'drydock';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getApplicationTransactionType() {
|
2014-07-24 00:05:46 +02:00
|
|
|
return DrydockBlueprintPHIDType::TYPECONST;
|
2014-01-09 21:19:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitle() {
|
|
|
|
$old = $this->getOldValue();
|
|
|
|
$new = $this->getNewValue();
|
|
|
|
$author_handle = $this->renderHandleLink($this->getAuthorPHID());
|
|
|
|
|
|
|
|
switch ($this->getTransactionType()) {
|
|
|
|
case self::TYPE_NAME:
|
|
|
|
if (!strlen($old)) {
|
|
|
|
return pht(
|
|
|
|
'%s created this blueprint.',
|
|
|
|
$author_handle);
|
|
|
|
} else {
|
|
|
|
return pht(
|
|
|
|
'%s renamed this blueprint from "%s" to "%s".',
|
|
|
|
$author_handle,
|
|
|
|
$old,
|
|
|
|
$new);
|
|
|
|
}
|
2015-09-24 19:18:17 +02:00
|
|
|
case self::TYPE_DISABLED:
|
|
|
|
if ($new) {
|
|
|
|
return pht(
|
|
|
|
'%s disabled this blueprint.',
|
|
|
|
$author_handle);
|
|
|
|
} else {
|
|
|
|
return pht(
|
|
|
|
'%s enabled this blueprint.',
|
|
|
|
$author_handle);
|
|
|
|
}
|
2014-01-09 21:19:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return parent::getTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|