Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
Show First 20 Lines • Show All 368 Lines • ▼ Show 20 Lines | if ($this->isPanelContext()) { | ||||
$can_bulk_edit = false; | $can_bulk_edit = false; | ||||
} else { | } else { | ||||
$can_bulk_edit = PhabricatorPolicyFilter::hasCapability( | $can_bulk_edit = PhabricatorPolicyFilter::hasCapability( | ||||
$viewer, | $viewer, | ||||
$this->getApplication(), | $this->getApplication(), | ||||
ManiphestBulkEditCapability::CAPABILITY); | ManiphestBulkEditCapability::CAPABILITY); | ||||
} | } | ||||
$custom_field_lists = $this->loadCustomFields( | |||||
$tasks, | |||||
PhabricatorCustomField::ROLE_LIST); | |||||
$list = id(new ManiphestTaskResultListView()) | $list = id(new ManiphestTaskResultListView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setTasks($tasks) | ->setTasks($tasks) | ||||
->setHandles($handles) | |||||
->setSavedQuery($saved) | ->setSavedQuery($saved) | ||||
->setCanBatchEdit($can_bulk_edit) | ->setCanBatchEdit($can_bulk_edit) | ||||
->setCustomFieldLists($custom_field_lists) | |||||
->setShowBatchControls($this->showBatchControls); | ->setShowBatchControls($this->showBatchControls); | ||||
$result = new PhabricatorApplicationSearchResultView(); | $result = new PhabricatorApplicationSearchResultView(); | ||||
$result->setContent($list); | $result->setContent($list); | ||||
return $result; | return $result; | ||||
} | } | ||||
protected function getRequiredHandlePHIDsForResultList( | |||||
array $objects, | |||||
PhabricatorSavedQuery $query) { | |||||
$phids = array(); | |||||
foreach ($objects as $task) { | |||||
$assigned_phid = $task->getOwnerPHID(); | |||||
if ($assigned_phid) { | |||||
$phids[] = $assigned_phid; | |||||
} | |||||
foreach ($task->getProjectPHIDs() as $project_phid) { | |||||
$phids[] = $project_phid; | |||||
} | |||||
} | |||||
return $phids; | |||||
} | |||||
avivey:
Moving this here is a small improvement, but in reality the "$handles" array used
in this flow… | |||||
protected function willUseSavedQuery(PhabricatorSavedQuery $saved) { | protected function willUseSavedQuery(PhabricatorSavedQuery $saved) { | ||||
// The 'withUnassigned' parameter may be present in old saved queries from | // The 'withUnassigned' parameter may be present in old saved queries from | ||||
// before parameterized typeaheads, and is retained for compatibility. We | // before parameterized typeaheads, and is retained for compatibility. We | ||||
// could remove it by migrating old saved queries. | // could remove it by migrating old saved queries. | ||||
$assigned_phids = $saved->getParameter('assignedPHIDs', array()); | $assigned_phids = $saved->getParameter('assignedPHIDs', array()); | ||||
if ($saved->getParameter('withUnassigned')) { | if ($saved->getParameter('withUnassigned')) { | ||||
$assigned_phids[] = PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN; | $assigned_phids[] = PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN; | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
Moving this here is a small improvement, but in reality the "$handles" array used
in this flow is inferior to just using $viewer->renderHandle(), and
should be replace with that.
Before this change, we'd actually load all the labels twice using the old, uncached mechanism.