mirror of
https://we.phorge.it/source/phorge.git
synced 2024-09-21 01:38:48 +02:00
24104be67d
Summary: Ref T10411. This cleans up / modernizes things and lets me get an `almanac.network.edit` API in the future. This is mostly straightforward, except that Services have an extra "choose type" screen in front of them. Test Plan: - Created and edited Almanac networks, services, and devices. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10411 Differential Revision: https://secure.phabricator.com/D15326
42 lines
964 B
PHP
42 lines
964 B
PHP
<?php
|
|
|
|
final class AlmanacNetworkTransaction
|
|
extends PhabricatorApplicationTransaction {
|
|
|
|
const TYPE_NAME = 'almanac:network:name';
|
|
|
|
public function getApplicationName() {
|
|
return 'almanac';
|
|
}
|
|
|
|
public function getApplicationTransactionType() {
|
|
return AlmanacNetworkPHIDType::TYPECONST;
|
|
}
|
|
|
|
public function getApplicationTransactionCommentObject() {
|
|
return null;
|
|
}
|
|
|
|
public function getTitle() {
|
|
$author_phid = $this->getAuthorPHID();
|
|
|
|
$old = $this->getOldValue();
|
|
$new = $this->getNewValue();
|
|
|
|
switch ($this->getTransactionType()) {
|
|
case PhabricatorTransactions::TYPE_CREATE:
|
|
return pht(
|
|
'%s created this network.',
|
|
$this->renderHandleLink($author_phid));
|
|
case self::TYPE_NAME:
|
|
return pht(
|
|
'%s renamed this network from "%s" to "%s".',
|
|
$this->renderHandleLink($author_phid),
|
|
$old,
|
|
$new);
|
|
}
|
|
|
|
return parent::getTitle();
|
|
}
|
|
|
|
}
|