mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-24 15:52:41 +01:00
b441e8b81e
Summary: Ref T9252. If you have a blueprint and you do not like that blueprint very much, you can disable it. Test Plan: Disabled / enabled some blueprints. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9252 Differential Revision: https://secure.phabricator.com/D14156
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
final class DrydockBlueprintTransaction
|
|
extends PhabricatorApplicationTransaction {
|
|
|
|
const TYPE_NAME = 'drydock:blueprint:name';
|
|
const TYPE_DISABLED = 'drydock:blueprint:disabled';
|
|
|
|
public function getApplicationName() {
|
|
return 'drydock';
|
|
}
|
|
|
|
public function getApplicationTransactionType() {
|
|
return DrydockBlueprintPHIDType::TYPECONST;
|
|
}
|
|
|
|
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);
|
|
}
|
|
case self::TYPE_DISABLED:
|
|
if ($new) {
|
|
return pht(
|
|
'%s disabled this blueprint.',
|
|
$author_handle);
|
|
} else {
|
|
return pht(
|
|
'%s enabled this blueprint.',
|
|
$author_handle);
|
|
}
|
|
}
|
|
|
|
return parent::getTitle();
|
|
}
|
|
|
|
}
|