Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/engine/PhabricatorBoardResponseEngine.php
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | public function buildResponse() { | ||||
} else { | } else { | ||||
$all_objects = id(new ManiphestTaskQuery()) | $all_objects = id(new ManiphestTaskQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withPHIDs($all_phids) | ->withPHIDs($all_phids) | ||||
->execute(); | ->execute(); | ||||
$all_objects = mpull($all_objects, null, 'getPHID'); | $all_objects = mpull($all_objects, null, 'getPHID'); | ||||
} | } | ||||
// NOTE: The board layout engine is sensitive to PHID input order, and uses | |||||
// the input order as a component of the "natural" column ordering if no | |||||
// explicit ordering is specified. Rearrange the PHIDs in ID order. | |||||
$all_objects = msort($all_objects, 'getID'); | |||||
$ordered_phids = mpull($all_objects, 'getPHID'); | |||||
$layout_engine = id(new PhabricatorBoardLayoutEngine()) | $layout_engine = id(new PhabricatorBoardLayoutEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setBoardPHIDs(array($board_phid)) | ->setBoardPHIDs(array($board_phid)) | ||||
->setObjectPHIDs($all_phids) | ->setObjectPHIDs($ordered_phids) | ||||
->executeLayout(); | ->executeLayout(); | ||||
$natural = array(); | $natural = array(); | ||||
$update_columns = array(); | $update_columns = array(); | ||||
foreach ($update_phids as $update_phid) { | foreach ($update_phids as $update_phid) { | ||||
$update_columns += $layout_engine->getObjectColumns( | $update_columns += $layout_engine->getObjectColumns( | ||||
$board_phid, | $board_phid, | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |