Differential D15915 Diff 38331 src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
| <?php | <?php | ||||
| final class PhabricatorOwnersPackageTransaction | final class PhabricatorOwnersPackageTransaction | ||||
| extends PhabricatorApplicationTransaction { | extends PhabricatorApplicationTransaction { | ||||
| const TYPE_NAME = 'owners.name'; | const TYPE_NAME = 'owners.name'; | ||||
| const TYPE_PRIMARY = 'owners.primary'; | const TYPE_PRIMARY = 'owners.primary'; | ||||
| const TYPE_OWNERS = 'owners.owners'; | const TYPE_OWNERS = 'owners.owners'; | ||||
| const TYPE_AUDITING = 'owners.auditing'; | const TYPE_AUDITING = 'owners.auditing'; | ||||
| const TYPE_DESCRIPTION = 'owners.description'; | const TYPE_DESCRIPTION = 'owners.description'; | ||||
| const TYPE_PATHS = 'owners.paths'; | const TYPE_PATHS = 'owners.paths'; | ||||
| const TYPE_STATUS = 'owners.status'; | const TYPE_STATUS = 'owners.status'; | ||||
| const TYPE_AUTOREVIEW = 'owners.autoreview'; | |||||
| public function getApplicationName() { | public function getApplicationName() { | ||||
| return 'owners'; | return 'owners'; | ||||
| } | } | ||||
| public function getApplicationTransactionType() { | public function getApplicationTransactionType() { | ||||
| return PhabricatorOwnersPackagePHIDType::TYPECONST; | return PhabricatorOwnersPackagePHIDType::TYPECONST; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
| return pht( | return pht( | ||||
| '%s activated this package.', | '%s activated this package.', | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| } else if ($new == PhabricatorOwnersPackage::STATUS_ARCHIVED) { | } else if ($new == PhabricatorOwnersPackage::STATUS_ARCHIVED) { | ||||
| return pht( | return pht( | ||||
| '%s archived this package.', | '%s archived this package.', | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| } | } | ||||
| case self::TYPE_AUTOREVIEW: | |||||
| $map = PhabricatorOwnersPackage::getAutoreviewOptionsMap(); | |||||
| $map = ipull($map, 'name'); | |||||
| $old = idx($map, $old, $old); | |||||
| $new = idx($map, $new, $new); | |||||
| return pht( | |||||
| '%s adjusted autoreview from "%s" to "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $old, | |||||
| $new); | |||||
| } | } | ||||
| return parent::getTitle(); | return parent::getTitle(); | ||||
| } | } | ||||
| public function hasChangeDetails() { | public function hasChangeDetails() { | ||||
| switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
| case self::TYPE_DESCRIPTION: | case self::TYPE_DESCRIPTION: | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||