Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | public function buildSavedQueryFromRequest(AphrontRequest $request) { | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'statuses', | 'statuses', | ||||
$this->readListFromRequest($request, 'statuses')); | $this->readListFromRequest($request, 'statuses')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'priorities', | 'priorities', | ||||
$this->readListFromRequest($request, 'priorities')); | $this->readListFromRequest($request, 'priorities')); | ||||
$saved->setParameter( | |||||
'blocking', | |||||
$this->readBoolFromRequest($request, 'blocking')); | |||||
$saved->setParameter( | |||||
'blocked', | |||||
$this->readBoolFromRequest($request, 'blocked')); | |||||
$saved->setParameter('group', $request->getStr('group')); | $saved->setParameter('group', $request->getStr('group')); | ||||
$saved->setParameter('order', $request->getStr('order')); | $saved->setParameter('order', $request->getStr('order')); | ||||
$ids = $request->getStrList('ids'); | $ids = $request->getStrList('ids'); | ||||
foreach ($ids as $key => $id) { | foreach ($ids as $key => $id) { | ||||
$id = trim($id, ' Tt'); | $id = trim($id, ' Tt'); | ||||
if (!$id || !is_numeric($id)) { | if (!$id || !is_numeric($id)) { | ||||
unset($ids[$key]); | unset($ids[$key]); | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | if ($statuses) { | ||||
$query->withStatuses($statuses); | $query->withStatuses($statuses); | ||||
} | } | ||||
$priorities = $saved->getParameter('priorities'); | $priorities = $saved->getParameter('priorities'); | ||||
if ($priorities) { | if ($priorities) { | ||||
$query->withPriorities($priorities); | $query->withPriorities($priorities); | ||||
} | } | ||||
$query->withBlockingTasks($saved->getParameter('blocking')); | |||||
$query->withBlockedTasks($saved->getParameter('blocked')); | |||||
$this->applyOrderByToQuery( | $this->applyOrderByToQuery( | ||||
$query, | $query, | ||||
$this->getOrderValues(), | $this->getOrderValues(), | ||||
$saved->getParameter('order')); | $saved->getParameter('order')); | ||||
$group = $saved->getParameter('group'); | $group = $saved->getParameter('group'); | ||||
$group = idx($this->getGroupValues(), $group); | $group = idx($this->getGroupValues(), $group); | ||||
if ($group) { | if ($group) { | ||||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | public function buildSearchForm( | ||||
foreach (ManiphestTaskPriority::getTaskPriorityMap() as $pri => $name) { | foreach (ManiphestTaskPriority::getTaskPriorityMap() as $pri => $name) { | ||||
$priority_control->addCheckbox( | $priority_control->addCheckbox( | ||||
'priorities[]', | 'priorities[]', | ||||
$pri, | $pri, | ||||
$name, | $name, | ||||
isset($priorities[$pri])); | isset($priorities[$pri])); | ||||
} | } | ||||
$blocking_control = id(new AphrontFormSelectControl()) | |||||
->setLabel(pht('Blocking')) | |||||
->setName('blocking') | |||||
->setValue($this->getBoolFromQuery($saved, 'blocking')) | |||||
->setOptions(array( | |||||
'' => pht('Show All Tasks'), | |||||
'true' => pht('Show Tasks Blocking Other Tasks'), | |||||
'false' => pht('Show Tasks Not Blocking Other Tasks'),)); | |||||
$blocked_control = id(new AphrontFormSelectControl()) | |||||
->setLabel(pht('Blocked')) | |||||
->setName('blocked') | |||||
->setValue($this->getBoolFromQuery($saved, 'blocked')) | |||||
->setOptions(array( | |||||
'' => pht('Show All Tasks'), | |||||
'true' => pht('Show Tasks Blocked By Other Tasks'), | |||||
'false' => pht('Show Tasks Not Blocked By Other Tasks'),)); | |||||
$ids = $saved->getParameter('ids', array()); | $ids = $saved->getParameter('ids', array()); | ||||
$builtin_orders = $this->getOrderOptions(); | $builtin_orders = $this->getOrderOptions(); | ||||
$custom_orders = $this->getCustomFieldOrderOptions(); | $custom_orders = $this->getCustomFieldOrderOptions(); | ||||
$all_orders = $builtin_orders + $custom_orders; | $all_orders = $builtin_orders + $custom_orders; | ||||
$form | $form | ||||
->appendChild( | ->appendChild( | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | $form | ||||
->setLabel(pht('Subscribers')) | ->setLabel(pht('Subscribers')) | ||||
->setValue($subscriber_handles)) | ->setValue($subscriber_handles)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
->setName('fulltext') | ->setName('fulltext') | ||||
->setLabel(pht('Contains Words')) | ->setLabel(pht('Contains Words')) | ||||
->setValue($saved->getParameter('fulltext'))) | ->setValue($saved->getParameter('fulltext'))) | ||||
->appendChild($status_control) | ->appendChild($status_control) | ||||
->appendChild($priority_control); | ->appendChild($priority_control) | ||||
->appendChild($blocking_control) | |||||
->appendChild($blocked_control); | |||||
if (!$this->getIsBoardView()) { | if (!$this->getIsBoardView()) { | ||||
$form | $form | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
->setName('group') | ->setName('group') | ||||
->setLabel(pht('Group By')) | ->setLabel(pht('Group By')) | ||||
->setValue($saved->getParameter('group')) | ->setValue($saved->getParameter('group')) | ||||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |