Path: blob/master/src/applications/diffusion/xaction/DiffusionCommitResignTransaction.php
12241 views
<?php12final class DiffusionCommitResignTransaction3extends DiffusionCommitAuditTransaction {45const TRANSACTIONTYPE = 'diffusion.commit.resign';6const ACTIONKEY = 'resign';78protected function getCommitActionLabel() {9return pht('Resign as Auditor');10}1112protected function getCommitActionDescription() {13return pht('You will resign as an auditor for this commit.');14}1516public function getIcon() {17return 'fa-flag';18}1920public function getColor() {21return 'orange';22}2324protected function getCommitActionOrder() {25return 700;26}2728public function getActionName() {29return pht('Resigned');30}3132public function generateOldValue($object) {33$actor = $this->getActor();34return !$this->isViewerAnyActiveAuditor($object, $actor);35}3637public function applyExternalEffects($object, $value) {38$status = PhabricatorAuditRequestStatus::RESIGNED;39$actor = $this->getActor();40$this->applyAuditorEffect($object, $actor, $value, $status);41}4243protected function validateAction($object, PhabricatorUser $viewer) {44if (!$this->isViewerAnyActiveAuditor($object, $viewer)) {45throw new Exception(46pht(47'You can not resign from this commit because you are not an '.48'active auditor.'));49}50}5152public function getTitle() {53return pht(54'%s resigned from this commit.',55$this->renderAuthor());56}5758public function getTitleForFeed() {59return pht(60'%s resigned from %s.',61$this->renderAuthor(),62$this->renderObject());63}6465public function getTransactionTypeForConduit($xaction) {66return 'resign';67}6869public function getFieldValuesForConduit($object, $data) {70return array();71}7273}747576