Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | $saved->setParameter( | ||||
'withNoProject', | 'withNoProject', | ||||
$request->getBool('withNoProject')); | $request->getBool('withNoProject')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'anyProjectPHIDs', | 'anyProjectPHIDs', | ||||
$this->readPHIDsFromRequest($request, 'anyProjects')); | $this->readPHIDsFromRequest($request, 'anyProjects')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'allColumnPHIDs', | |||||
$this->readPHIDsFromRequest($request, 'allColumns')); | |||||
$saved->setParameter( | |||||
'anyColumnPHIDs', | |||||
$this->readPHIDsFromRequest($request, 'anyColumns')); | |||||
$saved->setParameter( | |||||
'excludeProjectPHIDs', | 'excludeProjectPHIDs', | ||||
$this->readPHIDsFromRequest($request, 'excludeProjects')); | $this->readPHIDsFromRequest($request, 'excludeProjects')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'userProjectPHIDs', | 'userProjectPHIDs', | ||||
$this->readUsersFromRequest($request, 'userProjects')); | $this->readUsersFromRequest($request, 'userProjects')); | ||||
$saved->setParameter('createdStart', $request->getStr('createdStart')); | $saved->setParameter('createdStart', $request->getStr('createdStart')); | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | if ($exclude_project_phids) { | ||||
$query->withoutProjects($exclude_project_phids); | $query->withoutProjects($exclude_project_phids); | ||||
} | } | ||||
$user_project_phids = $saved->getParameter('userProjectPHIDs'); | $user_project_phids = $saved->getParameter('userProjectPHIDs'); | ||||
if ($user_project_phids) { | if ($user_project_phids) { | ||||
$query->withAnyUserProjects($user_project_phids); | $query->withAnyUserProjects($user_project_phids); | ||||
} | } | ||||
$all_column_phids = $saved->getParameter('allColumnPHIDs'); | |||||
if ($all_column_phids) { | |||||
$query->withAllColumns($all_column_phids); | |||||
} | |||||
$any_column_phids = $saved->getParameter('anyColumnPHIDs'); | |||||
if ($any_column_phids) { | |||||
$query->withAnyColumns($any_column_phids); | |||||
} | |||||
$start = $this->parseDateTime($saved->getParameter('createdStart')); | $start = $this->parseDateTime($saved->getParameter('createdStart')); | ||||
$end = $this->parseDateTime($saved->getParameter('createdEnd')); | $end = $this->parseDateTime($saved->getParameter('createdEnd')); | ||||
if ($start) { | if ($start) { | ||||
$query->withDateCreatedAfter($start); | $query->withDateCreatedAfter($start); | ||||
} | } | ||||
if ($end) { | if ($end) { | ||||
Show All 26 Lines | $all_project_phids = $saved->getParameter( | ||||
'allProjectPHIDs', | 'allProjectPHIDs', | ||||
array()); | array()); | ||||
$any_project_phids = $saved->getParameter( | $any_project_phids = $saved->getParameter( | ||||
'anyProjectPHIDs', | 'anyProjectPHIDs', | ||||
array()); | array()); | ||||
$exclude_project_phids = $saved->getParameter( | $exclude_project_phids = $saved->getParameter( | ||||
'excludeProjectPHIDs', | 'excludeProjectPHIDs', | ||||
array()); | array()); | ||||
$all_column_phids = $saved->getParameter('allColumnPHIDs', array()); | |||||
$any_column_phids = $saved->getParameter('anyColumnPHIDs', array()); | |||||
epriestley: I think things aren't sticking because these are `Phids` but should be `PHIDs`. | |||||
$user_project_phids = $saved->getParameter( | $user_project_phids = $saved->getParameter( | ||||
'userProjectPHIDs', | 'userProjectPHIDs', | ||||
array()); | array()); | ||||
$subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); | $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); | ||||
$all_phids = array_merge( | $all_phids = array_merge( | ||||
$assigned_phids, | $assigned_phids, | ||||
$author_phids, | $author_phids, | ||||
$all_project_phids, | $all_project_phids, | ||||
$any_project_phids, | $any_project_phids, | ||||
$exclude_project_phids, | $exclude_project_phids, | ||||
$all_column_phids, | |||||
$any_column_phids, | |||||
$user_project_phids, | $user_project_phids, | ||||
$subscriber_phids); | $subscriber_phids); | ||||
if ($all_phids) { | if ($all_phids) { | ||||
$handles = id(new PhabricatorHandleQuery()) | $handles = id(new PhabricatorHandleQuery()) | ||||
->setViewer($this->requireViewer()) | ->setViewer($this->requireViewer()) | ||||
->withPHIDs($all_phids) | ->withPHIDs($all_phids) | ||||
->execute(); | ->execute(); | ||||
} else { | } else { | ||||
$handles = array(); | $handles = array(); | ||||
} | } | ||||
$assigned_handles = array_select_keys($handles, $assigned_phids); | $assigned_handles = array_select_keys($handles, $assigned_phids); | ||||
$author_handles = array_select_keys($handles, $author_phids); | $author_handles = array_select_keys($handles, $author_phids); | ||||
$all_project_handles = array_select_keys($handles, $all_project_phids); | $all_project_handles = array_select_keys($handles, $all_project_phids); | ||||
$any_project_handles = array_select_keys($handles, $any_project_phids); | $any_project_handles = array_select_keys($handles, $any_project_phids); | ||||
$exclude_project_handles = array_select_keys( | $exclude_project_handles = array_select_keys( | ||||
$handles, | $handles, | ||||
$exclude_project_phids); | $exclude_project_phids); | ||||
$all_column_handles = array_select_keys($handles, $all_column_phids); | |||||
$any_column_handles = array_select_keys($handles, $any_column_phids); | |||||
$user_project_handles = array_select_keys($handles, $user_project_phids); | $user_project_handles = array_select_keys($handles, $user_project_phids); | ||||
$subscriber_handles = array_select_keys($handles, $subscriber_phids); | $subscriber_handles = array_select_keys($handles, $subscriber_phids); | ||||
$with_unassigned = $saved->getParameter('withUnassigned'); | $with_unassigned = $saved->getParameter('withUnassigned'); | ||||
$with_no_projects = $saved->getParameter('withNoProject'); | $with_no_projects = $saved->getParameter('withNoProject'); | ||||
$statuses = $saved->getParameter('statuses', array()); | $statuses = $saved->getParameter('statuses', array()); | ||||
$statuses = array_fuse($statuses); | $statuses = array_fuse($statuses); | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | $form | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource('/typeahead/common/accounts/') | ->setDatasource('/typeahead/common/accounts/') | ||||
->setName('userProjects') | ->setName('userProjects') | ||||
->setLabel(pht('In Users\' Projects')) | ->setLabel(pht('In Users\' Projects')) | ||||
->setValue($user_project_handles)) | ->setValue($user_project_handles)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource('/typeahead/common/workboardcolumns/') | |||||
->setName('allColumns') | |||||
->setLabel(pht('In All Columns')) | |||||
->setValue($all_column_handles)) | |||||
->appendChild( | |||||
id(new AphrontFormTokenizerControl()) | |||||
->setDatasource('/typeahead/common/workboardcolumns/') | |||||
->setName('anyColumns') | |||||
->setLabel(pht('In Any Columns')) | |||||
->setValue($any_column_handles)) | |||||
->appendChild( | |||||
id(new AphrontFormTokenizerControl()) | |||||
->setDatasource('/typeahead/common/accounts/') | ->setDatasource('/typeahead/common/accounts/') | ||||
->setName('authors') | ->setName('authors') | ||||
->setLabel(pht('Authors')) | ->setLabel(pht('Authors')) | ||||
->setValue($author_handles)) | ->setValue($author_handles)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource('/typeahead/common/mailable/') | ->setDatasource('/typeahead/common/mailable/') | ||||
->setName('subscribers') | ->setName('subscribers') | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |
I think things aren't sticking because these are Phids but should be PHIDs.