Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/query/AlmanacDeviceSearchEngine.php
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | final class AlmanacDeviceSearchEngine | ||||
} | } | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/almanac/device/'.$path; | return '/almanac/device/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
$names = array( | $names = array( | ||||
'active' => pht('Active Devices'), | |||||
'all' => pht('All Devices'), | 'all' => pht('All Devices'), | ||||
); | ); | ||||
return $names; | return $names; | ||||
} | } | ||||
public function buildSavedQueryFromBuiltin($query_key) { | public function buildSavedQueryFromBuiltin($query_key) { | ||||
$query = $this->newSavedQuery(); | $query = $this->newSavedQuery(); | ||||
$query->setQueryKey($query_key); | $query->setQueryKey($query_key); | ||||
switch ($query_key) { | switch ($query_key) { | ||||
case 'active': | |||||
$active_statuses = AlmanacDeviceStatus::getActiveStatusList(); | |||||
return $query->setParameter('statuses', $active_statuses); | |||||
case 'all': | case 'all': | ||||
return $query; | return $query; | ||||
} | } | ||||
return parent::buildSavedQueryFromBuiltin($query_key); | return parent::buildSavedQueryFromBuiltin($query_key); | ||||
} | } | ||||
protected function renderResultList( | protected function renderResultList( | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |