Differential D21751 Diff 51860 src/applications/transactions/storage/PhabricatorApplicationTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
Show First 20 Lines • Show All 344 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
$move['boardPHID'], | $move['boardPHID'], | ||||
); | ); | ||||
$phids[] = $move['fromColumnPHIDs']; | $phids[] = $move['fromColumnPHIDs']; | ||||
} | } | ||||
break; | break; | ||||
case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
case PhabricatorTransactions::TYPE_VIEW_POLICY: | case PhabricatorTransactions::TYPE_VIEW_POLICY: | ||||
case PhabricatorTransactions::TYPE_JOIN_POLICY: | case PhabricatorTransactions::TYPE_JOIN_POLICY: | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
if (!PhabricatorPolicyQuery::isSpecialPolicy($old)) { | if (!PhabricatorPolicyQuery::isSpecialPolicy($old)) { | ||||
$phids[] = array($old); | $phids[] = array($old); | ||||
} | } | ||||
if (!PhabricatorPolicyQuery::isSpecialPolicy($new)) { | if (!PhabricatorPolicyQuery::isSpecialPolicy($new)) { | ||||
$phids[] = array($new); | $phids[] = array($new); | ||||
} | } | ||||
break; | break; | ||||
case PhabricatorTransactions::TYPE_SPACE: | case PhabricatorTransactions::TYPE_SPACE: | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
} else if ($rem) { | } else if ($rem) { | ||||
return 'fa-user-times'; | return 'fa-user-times'; | ||||
} else { | } else { | ||||
return 'fa-user'; | return 'fa-user'; | ||||
} | } | ||||
case PhabricatorTransactions::TYPE_VIEW_POLICY: | case PhabricatorTransactions::TYPE_VIEW_POLICY: | ||||
case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
case PhabricatorTransactions::TYPE_JOIN_POLICY: | case PhabricatorTransactions::TYPE_JOIN_POLICY: | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
return 'fa-lock'; | return 'fa-lock'; | ||||
case PhabricatorTransactions::TYPE_EDGE: | case PhabricatorTransactions::TYPE_EDGE: | ||||
switch ($this->getMetadataValue('edge:type')) { | switch ($this->getMetadataValue('edge:type')) { | ||||
case DiffusionCommitRevertedByCommitEdgeType::EDGECONST: | case DiffusionCommitRevertedByCommitEdgeType::EDGECONST: | ||||
return 'fa-undo'; | return 'fa-undo'; | ||||
case DiffusionCommitRevertsCommitEdgeType::EDGECONST: | case DiffusionCommitRevertsCommitEdgeType::EDGECONST: | ||||
return 'fa-ambulance'; | return 'fa-ambulance'; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | public function shouldHide() { | ||||
// transactions like "alice set the task title to: ...", which are | // transactions like "alice set the task title to: ...", which are | ||||
// essentially never interesting. | // essentially never interesting. | ||||
if ($this->getIsCreateTransaction()) { | if ($this->getIsCreateTransaction()) { | ||||
switch ($xaction_type) { | switch ($xaction_type) { | ||||
case PhabricatorTransactions::TYPE_CREATE: | case PhabricatorTransactions::TYPE_CREATE: | ||||
case PhabricatorTransactions::TYPE_VIEW_POLICY: | case PhabricatorTransactions::TYPE_VIEW_POLICY: | ||||
case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
case PhabricatorTransactions::TYPE_JOIN_POLICY: | case PhabricatorTransactions::TYPE_JOIN_POLICY: | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
case PhabricatorTransactions::TYPE_SPACE: | case PhabricatorTransactions::TYPE_SPACE: | ||||
break; | break; | ||||
case PhabricatorTransactions::TYPE_SUBTYPE: | case PhabricatorTransactions::TYPE_SUBTYPE: | ||||
return true; | return true; | ||||
default: | default: | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
if (is_array($old) && !$old) { | if (is_array($old) && !$old) { | ||||
Show All 28 Lines | if ($this->getIsCreateTransaction()) { | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case PhabricatorTransactions::TYPE_VIEW_POLICY: | case PhabricatorTransactions::TYPE_VIEW_POLICY: | ||||
case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
case PhabricatorTransactions::TYPE_JOIN_POLICY: | case PhabricatorTransactions::TYPE_JOIN_POLICY: | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
case PhabricatorTransactions::TYPE_SPACE: | case PhabricatorTransactions::TYPE_SPACE: | ||||
if ($this->getIsCreateTransaction()) { | if ($this->getIsCreateTransaction()) { | ||||
break; | break; | ||||
} | } | ||||
// TODO: Remove this eventually, this is handling old changes during | // TODO: Remove this eventually, this is handling old changes during | ||||
// object creation prior to the introduction of "create" and "default" | // object creation prior to the introduction of "create" and "default" | ||||
// transaction display flags. | // transaction display flags. | ||||
▲ Show 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
return pht( | return pht( | ||||
'This %s already has that edit policy.', | 'This %s already has that edit policy.', | ||||
$this->getApplicationObjectTypeName()); | $this->getApplicationObjectTypeName()); | ||||
case PhabricatorTransactions::TYPE_JOIN_POLICY: | case PhabricatorTransactions::TYPE_JOIN_POLICY: | ||||
return pht( | return pht( | ||||
'This %s already has that join policy.', | 'This %s already has that join policy.', | ||||
$this->getApplicationObjectTypeName()); | $this->getApplicationObjectTypeName()); | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
return pht( | |||||
'This %s already has that interact policy.', | |||||
$this->getApplicationObjectTypeName()); | |||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS: | case PhabricatorTransactions::TYPE_SUBSCRIBERS: | ||||
return pht( | return pht( | ||||
'All users are already subscribed to this %s.', | 'All users are already subscribed to this %s.', | ||||
$this->getApplicationObjectTypeName()); | $this->getApplicationObjectTypeName()); | ||||
case PhabricatorTransactions::TYPE_SPACE: | case PhabricatorTransactions::TYPE_SPACE: | ||||
return pht('This object is already in that space.'); | return pht('This object is already in that space.'); | ||||
case PhabricatorTransactions::TYPE_EDGE: | case PhabricatorTransactions::TYPE_EDGE: | ||||
return pht('Edges already exist; transaction has no effect.'); | return pht('Edges already exist; transaction has no effect.'); | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
$this->renderPolicyName($new, 'new')); | $this->renderPolicyName($new, 'new')); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s changed the join policy from "%s" to "%s".', | '%s changed the join policy from "%s" to "%s".', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderPolicyName($old, 'old'), | $this->renderPolicyName($old, 'old'), | ||||
$this->renderPolicyName($new, 'new')); | $this->renderPolicyName($new, 'new')); | ||||
} | } | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
if ($this->getIsCreateTransaction()) { | |||||
return pht( | |||||
'%s created this object with interact policy "%s".', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderPolicyName($new, 'new')); | |||||
} else { | |||||
return pht( | |||||
'%s changed the interact policy from "%s" to "%s".', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderPolicyName($old, 'old'), | |||||
$this->renderPolicyName($new, 'new')); | |||||
} | |||||
case PhabricatorTransactions::TYPE_SPACE: | case PhabricatorTransactions::TYPE_SPACE: | ||||
if ($this->getIsCreateTransaction()) { | if ($this->getIsCreateTransaction()) { | ||||
return pht( | return pht( | ||||
'%s created this object in space %s.', | '%s created this object in space %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($new)); | $this->renderHandleLink($new)); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
▲ Show 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
'%s changed the edit policy for %s.', | '%s changed the edit policy for %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
case PhabricatorTransactions::TYPE_JOIN_POLICY: | case PhabricatorTransactions::TYPE_JOIN_POLICY: | ||||
return pht( | return pht( | ||||
'%s changed the join policy for %s.', | '%s changed the join policy for %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
return pht( | |||||
'%s changed the interact policy for %s.', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderHandleLink($object_phid)); | |||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS: | case PhabricatorTransactions::TYPE_SUBSCRIBERS: | ||||
return pht( | return pht( | ||||
'%s updated subscribers of %s.', | '%s updated subscribers of %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
case PhabricatorTransactions::TYPE_SPACE: | case PhabricatorTransactions::TYPE_SPACE: | ||||
if ($this->getIsCreateTransaction()) { | if ($this->getIsCreateTransaction()) { | ||||
return pht( | return pht( | ||||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | |||||
public function getActionName() { | public function getActionName() { | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case PhabricatorTransactions::TYPE_COMMENT: | case PhabricatorTransactions::TYPE_COMMENT: | ||||
return pht('Commented On'); | return pht('Commented On'); | ||||
case PhabricatorTransactions::TYPE_VIEW_POLICY: | case PhabricatorTransactions::TYPE_VIEW_POLICY: | ||||
case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
case PhabricatorTransactions::TYPE_JOIN_POLICY: | case PhabricatorTransactions::TYPE_JOIN_POLICY: | ||||
case PhabricatorTransactions::TYPE_INTERACT_POLICY: | |||||
return pht('Changed Policy'); | return pht('Changed Policy'); | ||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS: | case PhabricatorTransactions::TYPE_SUBSCRIBERS: | ||||
return pht('Changed Subscribers'); | return pht('Changed Subscribers'); | ||||
default: | default: | ||||
return pht('Updated'); | return pht('Updated'); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |