Differential D20288 Diff 48496 src/applications/project/controller/PhabricatorProjectMoveController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectMoveController.php
| Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| if (!$object) { | if (!$object) { | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| } | } | ||||
| $columns = id(new PhabricatorProjectColumnQuery()) | $columns = id(new PhabricatorProjectColumnQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withProjectPHIDs(array($project->getPHID())) | ->withProjectPHIDs(array($project->getPHID())) | ||||
| ->needTriggers(true) | |||||
| ->execute(); | ->execute(); | ||||
| $columns = mpull($columns, null, 'getPHID'); | $columns = mpull($columns, null, 'getPHID'); | ||||
| $column = idx($columns, $column_phid); | $column = idx($columns, $column_phid); | ||||
| if (!$column) { | if (!$column) { | ||||
| // User is trying to drop this object into a nonexistent column, just kick | // User is trying to drop this object into a nonexistent column, just kick | ||||
| // them out. | // them out. | ||||
| return new Aphront404Response(); | return new Aphront404Response(); | ||||
| Show All 24 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $header_xactions = $ordering->getColumnTransactions( | $header_xactions = $ordering->getColumnTransactions( | ||||
| $object, | $object, | ||||
| $edit_header); | $edit_header); | ||||
| foreach ($header_xactions as $header_xaction) { | foreach ($header_xactions as $header_xaction) { | ||||
| $xactions[] = $header_xaction; | $xactions[] = $header_xaction; | ||||
| } | } | ||||
| if ($column->canHaveTrigger()) { | |||||
| $trigger = $column->getTrigger(); | |||||
| if ($trigger) { | |||||
| $trigger_xactions = $trigger->newDropTransactions( | |||||
| $viewer, | |||||
| $column, | |||||
| $object); | |||||
| foreach ($trigger_xactions as $trigger_xaction) { | |||||
| $xactions[] = $trigger_xaction; | |||||
| } | |||||
| } | |||||
| } | |||||
| $editor = id(new ManiphestTransactionEditor()) | $editor = id(new ManiphestTransactionEditor()) | ||||
| ->setActor($viewer) | ->setActor($viewer) | ||||
| ->setContinueOnMissingFields(true) | ->setContinueOnMissingFields(true) | ||||
| ->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
| ->setContentSourceFromRequest($request) | ->setContentSourceFromRequest($request) | ||||
| ->setCancelURI($cancel_uri); | ->setCancelURI($cancel_uri); | ||||
| $editor->applyTransactions($object, $xactions); | $editor->applyTransactions($object, $xactions); | ||||
| return $this->newCardResponse($board_phid, $object_phid, $ordering); | return $this->newCardResponse($board_phid, $object_phid, $ordering); | ||||
| } | } | ||||
| } | } | ||||