mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 11:52:40 +01:00
60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
final class ManiphestTaskSearchEngine
|
||
|
extends PhabricatorApplicationSearchEngine {
|
||
|
|
||
|
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
||
|
$saved = new PhabricatorSavedQuery();
|
||
|
|
||
|
return $saved;
|
||
|
}
|
||
|
|
||
|
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
|
||
|
$query = id(new ManiphestTaskQuery());
|
||
|
|
||
|
|
||
|
return $query;
|
||
|
}
|
||
|
|
||
|
public function buildSearchForm(
|
||
|
AphrontFormView $form,
|
||
|
PhabricatorSavedQuery $saved_query) {
|
||
|
|
||
|
}
|
||
|
|
||
|
protected function getURI($path) {
|
||
|
return '/maniphest/'.$path;
|
||
|
}
|
||
|
|
||
|
public function getBuiltinQueryNames() {
|
||
|
$names = array();
|
||
|
|
||
|
if ($this->requireViewer()->isLoggedIn()) {
|
||
|
$names['assigned'] = pht('Assigned');
|
||
|
$names['authored'] = pht('Authored');
|
||
|
}
|
||
|
|
||
|
$names['all'] = pht('All Tasks');
|
||
|
|
||
|
return $names;
|
||
|
}
|
||
|
|
||
|
public function buildSavedQueryFromBuiltin($query_key) {
|
||
|
|
||
|
$query = $this->newSavedQuery();
|
||
|
$query->setQueryKey($query_key);
|
||
|
|
||
|
switch ($query_key) {
|
||
|
case 'all':
|
||
|
return $query;
|
||
|
case 'assigned':
|
||
|
return $query;
|
||
|
case 'authored':
|
||
|
return $query;
|
||
|
}
|
||
|
|
||
|
return parent::buildSavedQueryFromBuiltin($query_key);
|
||
|
}
|
||
|
|
||
|
}
|