Add "Spaces", an application for managing policy namespaces
Summary: Ref T3820. This doesn't actually do anything yet, but dumps in all the plumbing.
Test Plan:
{F156989}
{F156990}
{F156991}
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: eadler, wienczny, jdloft, devurandom, thz, hwinkel, 20after4, sascha-egerer, seporaitis, joshuaspence, chad, epriestley
Maniphest Tasks: T3820
Differential Revision: https://secure.phabricator.com/D9204
2015-06-01 20:28:38 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorSpacesNamespaceTransaction
|
|
|
|
extends PhabricatorApplicationTransaction {
|
|
|
|
|
|
|
|
const TYPE_NAME = 'spaces:name';
|
|
|
|
const TYPE_DEFAULT = 'spaces:default';
|
2015-06-11 00:53:51 +02:00
|
|
|
const TYPE_DESCRIPTION = 'spaces:description';
|
2015-06-11 19:13:47 +02:00
|
|
|
const TYPE_ARCHIVE = 'spaces:archive';
|
Add "Spaces", an application for managing policy namespaces
Summary: Ref T3820. This doesn't actually do anything yet, but dumps in all the plumbing.
Test Plan:
{F156989}
{F156990}
{F156991}
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: eadler, wienczny, jdloft, devurandom, thz, hwinkel, 20after4, sascha-egerer, seporaitis, joshuaspence, chad, epriestley
Maniphest Tasks: T3820
Differential Revision: https://secure.phabricator.com/D9204
2015-06-01 20:28:38 +02:00
|
|
|
|
|
|
|
public function getApplicationName() {
|
|
|
|
return 'spaces';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getApplicationTransactionType() {
|
|
|
|
return PhabricatorSpacesNamespacePHIDType::TYPECONST;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getApplicationTransactionCommentObject() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-06-11 00:53:51 +02:00
|
|
|
public function shouldHide() {
|
|
|
|
$old = $this->getOldValue();
|
|
|
|
|
|
|
|
switch ($this->getTransactionType()) {
|
|
|
|
case self::TYPE_DESCRIPTION:
|
|
|
|
return ($old === null);
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent::shouldHide();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasChangeDetails() {
|
|
|
|
switch ($this->getTransactionType()) {
|
|
|
|
case self::TYPE_DESCRIPTION:
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent::hasChangeDetails();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRemarkupBlocks() {
|
|
|
|
$blocks = parent::getRemarkupBlocks();
|
|
|
|
|
|
|
|
switch ($this->getTransactionType()) {
|
|
|
|
case self::TYPE_DESCRIPTION:
|
|
|
|
$blocks[] = $this->getNewValue();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $blocks;
|
|
|
|
}
|
|
|
|
|
Add "Spaces", an application for managing policy namespaces
Summary: Ref T3820. This doesn't actually do anything yet, but dumps in all the plumbing.
Test Plan:
{F156989}
{F156990}
{F156991}
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: eadler, wienczny, jdloft, devurandom, thz, hwinkel, 20after4, sascha-egerer, seporaitis, joshuaspence, chad, epriestley
Maniphest Tasks: T3820
Differential Revision: https://secure.phabricator.com/D9204
2015-06-01 20:28:38 +02:00
|
|
|
public function getTitle() {
|
|
|
|
$old = $this->getOldValue();
|
|
|
|
$new = $this->getNewValue();
|
|
|
|
|
|
|
|
$author_phid = $this->getAuthorPHID();
|
|
|
|
|
|
|
|
switch ($this->getTransactionType()) {
|
|
|
|
case self::TYPE_NAME:
|
|
|
|
if ($old === null) {
|
|
|
|
return pht(
|
|
|
|
'%s created this space.',
|
|
|
|
$this->renderHandleLink($author_phid));
|
|
|
|
} else {
|
|
|
|
return pht(
|
|
|
|
'%s renamed this space from "%s" to "%s".',
|
|
|
|
$this->renderHandleLink($author_phid),
|
|
|
|
$old,
|
|
|
|
$new);
|
|
|
|
}
|
2015-06-11 00:53:51 +02:00
|
|
|
case self::TYPE_DESCRIPTION:
|
|
|
|
return pht(
|
|
|
|
'%s updated the description for this space.',
|
|
|
|
$this->renderHandleLink($author_phid));
|
Add "Spaces", an application for managing policy namespaces
Summary: Ref T3820. This doesn't actually do anything yet, but dumps in all the plumbing.
Test Plan:
{F156989}
{F156990}
{F156991}
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: eadler, wienczny, jdloft, devurandom, thz, hwinkel, 20after4, sascha-egerer, seporaitis, joshuaspence, chad, epriestley
Maniphest Tasks: T3820
Differential Revision: https://secure.phabricator.com/D9204
2015-06-01 20:28:38 +02:00
|
|
|
case self::TYPE_DEFAULT:
|
|
|
|
return pht(
|
|
|
|
'%s made this the default space.',
|
|
|
|
$this->renderHandleLink($author_phid));
|
2015-06-11 19:13:47 +02:00
|
|
|
case self::TYPE_ARCHIVE:
|
|
|
|
if ($new) {
|
|
|
|
return pht(
|
|
|
|
'%s archived this space.',
|
|
|
|
$this->renderHandleLink($author_phid));
|
|
|
|
} else {
|
|
|
|
return pht(
|
|
|
|
'%s activated this space.',
|
|
|
|
$this->renderHandleLink($author_phid));
|
|
|
|
}
|
Add "Spaces", an application for managing policy namespaces
Summary: Ref T3820. This doesn't actually do anything yet, but dumps in all the plumbing.
Test Plan:
{F156989}
{F156990}
{F156991}
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: eadler, wienczny, jdloft, devurandom, thz, hwinkel, 20after4, sascha-egerer, seporaitis, joshuaspence, chad, epriestley
Maniphest Tasks: T3820
Differential Revision: https://secure.phabricator.com/D9204
2015-06-01 20:28:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return parent::getTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|