diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3427,6 +3427,7 @@ 'PhabricatorProjectColumnPosition' => 'applications/project/storage/PhabricatorProjectColumnPosition.php', 'PhabricatorProjectColumnPositionQuery' => 'applications/project/query/PhabricatorProjectColumnPositionQuery.php', 'PhabricatorProjectColumnQuery' => 'applications/project/query/PhabricatorProjectColumnQuery.php', + 'PhabricatorProjectColumnSearchEngine' => 'applications/project/query/PhabricatorProjectColumnSearchEngine.php', 'PhabricatorProjectColumnTransaction' => 'applications/project/storage/PhabricatorProjectColumnTransaction.php', 'PhabricatorProjectColumnTransactionEditor' => 'applications/project/editor/PhabricatorProjectColumnTransactionEditor.php', 'PhabricatorProjectColumnTransactionQuery' => 'applications/project/query/PhabricatorProjectColumnTransactionQuery.php', @@ -4454,6 +4455,7 @@ 'ProjectAddProjectsEmailCommand' => 'applications/project/command/ProjectAddProjectsEmailCommand.php', 'ProjectBoardTaskCard' => 'applications/project/view/ProjectBoardTaskCard.php', 'ProjectCanLockProjectsCapability' => 'applications/project/capability/ProjectCanLockProjectsCapability.php', + 'ProjectColumnSearchConduitAPIMethod' => 'applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php', 'ProjectConduitAPIMethod' => 'applications/project/conduit/ProjectConduitAPIMethod.php', 'ProjectCreateConduitAPIMethod' => 'applications/project/conduit/ProjectCreateConduitAPIMethod.php', 'ProjectCreateProjectsCapability' => 'applications/project/capability/ProjectCreateProjectsCapability.php', @@ -8565,6 +8567,7 @@ 'PhabricatorPolicyInterface', 'PhabricatorDestructibleInterface', 'PhabricatorExtendedPolicyInterface', + 'PhabricatorConduitResultInterface', ), 'PhabricatorProjectColumnDetailController' => 'PhabricatorProjectBoardController', 'PhabricatorProjectColumnEditController' => 'PhabricatorProjectBoardController', @@ -8576,6 +8579,7 @@ ), 'PhabricatorProjectColumnPositionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorProjectColumnQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'PhabricatorProjectColumnSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorProjectColumnTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorProjectColumnTransactionEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorProjectColumnTransactionQuery' => 'PhabricatorApplicationTransactionQuery', @@ -9849,6 +9853,7 @@ 'ProjectAddProjectsEmailCommand' => 'MetaMTAEmailTransactionCommand', 'ProjectBoardTaskCard' => 'Phobject', 'ProjectCanLockProjectsCapability' => 'PhabricatorPolicyCapability', + 'ProjectColumnSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 'ProjectConduitAPIMethod' => 'ConduitAPIMethod', 'ProjectCreateConduitAPIMethod' => 'ProjectConduitAPIMethod', 'ProjectCreateProjectsCapability' => 'PhabricatorPolicyCapability', diff --git a/src/applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php b/src/applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php new file mode 100644 --- /dev/null +++ b/src/applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php @@ -0,0 +1,18 @@ +setLabel(pht('Projects')) + ->setKey('projectPHIDs') + ->setAliases(array('project', 'projects', 'projectPHID')), + ); + } + + + protected function buildQueryFromParameters(array $map) { + $query = $this->newQuery(); + + if ($map['projectPHIDs']) { + $query->withProjectPHIDs($map['projectPHIDs']); + } + + return $query; + } + + protected function getURI($path) { + // NOTE: There's no way to query columns in the web UI, at least for + // the moment. + return null; + } + + protected function getBuiltinQueryNames() { + $names = array(); + + $names['all'] = pht('All'); + + return $names; + } + + public function buildSavedQueryFromBuiltin($query_key) { + $query = $this->newSavedQuery(); + $query->setQueryKey($query_key); + + switch ($query_key) { + case 'all': + return $query; + } + + return parent::buildSavedQueryFromBuiltin($query_key); + } + + protected function renderResultList( + array $projects, + PhabricatorSavedQuery $query, + array $handles) { + assert_instances_of($projects, 'PhabricatorProjectColumn'); + $viewer = $this->requireViewer(); + + return null; + } + +} diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php --- a/src/applications/project/storage/PhabricatorProjectColumn.php +++ b/src/applications/project/storage/PhabricatorProjectColumn.php @@ -6,7 +6,8 @@ PhabricatorApplicationTransactionInterface, PhabricatorPolicyInterface, PhabricatorDestructibleInterface, - PhabricatorExtendedPolicyInterface { + PhabricatorExtendedPolicyInterface, + PhabricatorConduitResultInterface { const STATUS_ACTIVE = 0; const STATUS_HIDDEN = 1; @@ -183,6 +184,40 @@ return sprintf('%s%012d', $group, $sequence); } +/* -( PhabricatorConduitResultInterface )---------------------------------- */ + + public function getFieldSpecificationsForConduit() { + return array( + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('name') + ->setType('string') + ->setDescription(pht('The display name of the column.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('project') + ->setType('map') + ->setDescription(pht('The project the column belongs to.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('proxyPHID') + ->setType('phid?') + ->setDescription( + pht( + 'For columns that proxy another object (like a subproject or '. + 'milestone), the PHID of the object they proxy.')), + ); + } + + public function getFieldValuesForConduit() { + return array( + 'name' => $this->getDisplayName(), + 'proxyPHID' => $this->getProxyPHID(), + 'project' => $this->getProject()->getRefForConduit(), + ); + } + + public function getConduitSearchAttachments() { + return array(); + } + public function getRefForConduit() { return array( 'id' => (int)$this->getID(),