Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/engine/PhabricatorBoardResponseEngine.php
<?php | <?php | ||||
final class PhabricatorBoardResponseEngine extends Phobject { | final class PhabricatorBoardResponseEngine extends Phobject { | ||||
private $viewer; | private $viewer; | ||||
private $boardPHID; | private $boardPHID; | ||||
private $objectPHID; | private $objectPHID; | ||||
private $visiblePHIDs; | private $visiblePHIDs; | ||||
private $ordering; | private $ordering; | ||||
private $sounds; | |||||
public function setViewer(PhabricatorUser $viewer) { | public function setViewer(PhabricatorUser $viewer) { | ||||
$this->viewer = $viewer; | $this->viewer = $viewer; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getViewer() { | public function getViewer() { | ||||
return $this->viewer; | return $this->viewer; | ||||
Show All 30 Lines | public function setOrdering(PhabricatorProjectColumnOrder $ordering) { | ||||
$this->ordering = $ordering; | $this->ordering = $ordering; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getOrdering() { | public function getOrdering() { | ||||
return $this->ordering; | return $this->ordering; | ||||
} | } | ||||
public function setSounds(array $sounds) { | |||||
$this->sounds = $sounds; | |||||
return $this; | |||||
} | |||||
public function getSounds() { | |||||
return $this->sounds; | |||||
} | |||||
public function buildResponse() { | public function buildResponse() { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$object_phid = $this->getObjectPHID(); | $object_phid = $this->getObjectPHID(); | ||||
$board_phid = $this->getBoardPHID(); | $board_phid = $this->getBoardPHID(); | ||||
$ordering = $this->getOrdering(); | $ordering = $this->getOrdering(); | ||||
// Load all the other tasks that are visible in the affected columns and | // Load all the other tasks that are visible in the affected columns and | ||||
// perform layout for them. | // perform layout for them. | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | foreach ($all_visible as $card_phid => $object) { | ||||
$cards[$card_phid] = $card; | $cards[$card_phid] = $card; | ||||
} | } | ||||
$payload = array( | $payload = array( | ||||
'objectPHID' => $object_phid, | 'objectPHID' => $object_phid, | ||||
'columnMaps' => $natural, | 'columnMaps' => $natural, | ||||
'cards' => $cards, | 'cards' => $cards, | ||||
'headers' => $headers, | 'headers' => $headers, | ||||
'sounds' => $this->getSounds(), | |||||
); | ); | ||||
return id(new AphrontAjaxResponse()) | return id(new AphrontAjaxResponse()) | ||||
->setContent($payload); | ->setContent($payload); | ||||
} | } | ||||
public static function newTaskProperties($task) { | public static function newTaskProperties($task) { | ||||
return array( | return array( | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |