Differential D14893 Diff 36001 src/applications/project/editor/PhabricatorProjectTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/editor/PhabricatorProjectTransactionEditor.php
| Show First 20 Lines • Show All 503 Lines • ▼ Show 20 Lines | switch ($xaction->getTransactionType()) { | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| return parent::requireCapabilities($object, $xaction); | return parent::requireCapabilities($object, $xaction); | ||||
| } | } | ||||
| protected function willPublish(PhabricatorLiskDAO $object, array $xactions) { | protected function willPublish(PhabricatorLiskDAO $object, array $xactions) { | ||||
| $member_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | // NOTE: We're using the omnipotent user here because the original actor | ||||
| $object->getPHID(), | // may no longer have permission to view the object. | ||||
| PhabricatorProjectProjectHasMemberEdgeType::EDGECONST); | return id(new PhabricatorProjectQuery()) | ||||
| $object->attachMemberPHIDs($member_phids); | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
| ->withPHIDs(array($object->getPHID())) | |||||
| return $object; | ->needMembers(true) | ||||
| ->executeOne(); | |||||
| } | } | ||||
| protected function shouldSendMail( | protected function shouldSendMail( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| array $xactions) { | array $xactions) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | foreach ($xactions as $xaction) { | ||||
| $member_xaction = $xaction; | $member_xaction = $xaction; | ||||
| } | } | ||||
| if ($member_xaction) { | if ($member_xaction) { | ||||
| $object_phid = $object->getPHID(); | $object_phid = $object->getPHID(); | ||||
| if ($object_phid) { | if ($object_phid) { | ||||
| $members = PhabricatorEdgeQuery::loadDestinationPHIDs( | $project = id(new PhabricatorProjectQuery()) | ||||
| $object_phid, | ->setViewer($this->getActor()) | ||||
| PhabricatorProjectProjectHasMemberEdgeType::EDGECONST); | ->withPHIDs(array($object_phid)) | ||||
| ->needMembers(true) | |||||
| ->executeOne(); | |||||
| $members = $project->getMemberPHIDs(); | |||||
| } else { | } else { | ||||
| $members = array(); | $members = array(); | ||||
| } | } | ||||
| $clone_xaction = clone $member_xaction; | $clone_xaction = clone $member_xaction; | ||||
| $hint = $this->getPHIDTransactionNewValue($clone_xaction, $members); | $hint = $this->getPHIDTransactionNewValue($clone_xaction, $members); | ||||
| $rule = new PhabricatorProjectMembersPolicyRule(); | $rule = new PhabricatorProjectMembersPolicyRule(); | ||||
| Show All 12 Lines | |||||