Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/storage/ConpherenceTransaction.php
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | final class ConpherenceTransaction | ||||
| public function getTitle() { | public function getTitle() { | ||||
| $author_phid = $this->getAuthorPHID(); | $author_phid = $this->getAuthorPHID(); | ||||
| $old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
| $new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
| switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_VIEW_POLICY: | |||||
| case PhabricatorTransactions::TYPE_EDIT_POLICY: | |||||
| case PhabricatorTransactions::TYPE_JOIN_POLICY: | |||||
| return $this->getRoomTitle(); | |||||
| break; | |||||
| case self::TYPE_PARTICIPANTS: | case self::TYPE_PARTICIPANTS: | ||||
| $add = array_diff($new, $old); | $add = array_diff($new, $old); | ||||
| $rem = array_diff($old, $new); | $rem = array_diff($old, $new); | ||||
| if ($add && $rem) { | if ($add && $rem) { | ||||
| $title = pht( | $title = pht( | ||||
| '%s edited participant(s), added %d: %s; removed %d: %s.', | '%s edited participant(s), added %d: %s; removed %d: %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| Show All 16 Lines | switch ($this->getTransactionType()) { | ||||
| } | } | ||||
| return $title; | return $title; | ||||
| break; | break; | ||||
| } | } | ||||
| return parent::getTitle(); | return parent::getTitle(); | ||||
| } | } | ||||
| private function getRoomTitle() { | |||||
| $author_phid = $this->getAuthorPHID(); | |||||
| $old = $this->getOldValue(); | |||||
| $new = $this->getNewValue(); | |||||
| switch ($this->getTransactionType()) { | |||||
| case PhabricatorTransactions::TYPE_VIEW_POLICY: | |||||
| return pht( | |||||
| '%s changed the visibility of this room from "%s" to "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $this->renderPolicyName($old, 'old'), | |||||
| $this->renderPolicyName($new, 'new')); | |||||
| break; | |||||
| case PhabricatorTransactions::TYPE_EDIT_POLICY: | |||||
| return pht( | |||||
| '%s changed the edit policy of this room from "%s" to "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $this->renderPolicyName($old, 'old'), | |||||
| $this->renderPolicyName($new, 'new')); | |||||
| break; | |||||
| case PhabricatorTransactions::TYPE_JOIN_POLICY: | |||||
| return pht( | |||||
| '%s changed the join policy of this room from "%s" to "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $this->renderPolicyName($old, 'old'), | |||||
| $this->renderPolicyName($new, 'new')); | |||||
| break; | |||||
| } | |||||
| } | |||||
| public function getRequiredHandlePHIDs() { | public function getRequiredHandlePHIDs() { | ||||
| $phids = parent::getRequiredHandlePHIDs(); | $phids = parent::getRequiredHandlePHIDs(); | ||||
| $old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
| $new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
| $phids[] = $this->getAuthorPHID(); | $phids[] = $this->getAuthorPHID(); | ||||
| switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
| Show All 11 Lines | |||||