Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/view/ManiphestTaskResultListView.php
<?php | <?php | ||||
final class ManiphestTaskResultListView extends ManiphestView { | final class ManiphestTaskResultListView extends ManiphestView { | ||||
private $tasks; | private $tasks; | ||||
private $handles; | |||||
private $customFieldLists = array(); | |||||
private $savedQuery; | private $savedQuery; | ||||
private $canBatchEdit; | private $canBatchEdit; | ||||
private $showBatchControls; | private $showBatchControls; | ||||
public function setSavedQuery(PhabricatorSavedQuery $query) { | public function setSavedQuery(PhabricatorSavedQuery $query) { | ||||
$this->savedQuery = $query; | $this->savedQuery = $query; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setTasks(array $tasks) { | public function setTasks(array $tasks) { | ||||
$this->tasks = $tasks; | $this->tasks = $tasks; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setHandles(array $handles) { | |||||
$this->handles = $handles; | |||||
return $this; | |||||
} | |||||
public function setCustomFieldLists(array $lists) { | |||||
$this->customFieldLists = $lists; | |||||
return $this; | |||||
} | |||||
public function setCanBatchEdit($can_batch_edit) { | public function setCanBatchEdit($can_batch_edit) { | ||||
$this->canBatchEdit = $can_batch_edit; | $this->canBatchEdit = $can_batch_edit; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setShowBatchControls($show_batch_controls) { | public function setShowBatchControls($show_batch_controls) { | ||||
$this->showBatchControls = $show_batch_controls; | $this->showBatchControls = $show_batch_controls; | ||||
return $this; | return $this; | ||||
Show All 9 Lines | if (!$tasks) { | ||||
return id(new PHUIObjectItemListView()) | return id(new PHUIObjectItemListView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setNoDataString(pht('No tasks found.')); | ->setNoDataString(pht('No tasks found.')); | ||||
} | } | ||||
$group_parameter = nonempty($query->getParameter('group'), 'priority'); | $group_parameter = nonempty($query->getParameter('group'), 'priority'); | ||||
$order_parameter = nonempty($query->getParameter('order'), 'priority'); | $order_parameter = nonempty($query->getParameter('order'), 'priority'); | ||||
$handles = ManiphestTaskListView::loadTaskHandles($viewer, $tasks); | |||||
$groups = $this->groupTasks( | $groups = $this->groupTasks( | ||||
$tasks, | $tasks, | ||||
$group_parameter, | $group_parameter, | ||||
$handles); | $this->handles); | ||||
$result = array(); | $result = array(); | ||||
$lists = array(); | $lists = array(); | ||||
foreach ($groups as $group => $list) { | foreach ($groups as $group => $list) { | ||||
$task_list = new ManiphestTaskListView(); | $task_list = new ManiphestTaskListView(); | ||||
$task_list->setShowBatchControls($this->showBatchControls); | $task_list->setShowBatchControls($this->showBatchControls); | ||||
$task_list->setUser($viewer); | $task_list->setUser($viewer); | ||||
$task_list->setTasks($list); | $task_list->setTasks($list); | ||||
$task_list->setHandles($handles); | $task_list->setHandles($this->handles); | ||||
$task_list->setCustomFieldLists($this->customFieldLists); | |||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->addSigil('task-group') | ->addSigil('task-group') | ||||
->setMetadata(array('priority' => head($list)->getPriority())) | ->setMetadata(array('priority' => head($list)->getPriority())) | ||||
->setHeader(pht('%s (%s)', $group, phutil_count($list))); | ->setHeader(pht('%s (%s)', $group, phutil_count($list))); | ||||
$lists[] = id(new PHUIObjectBoxView()) | $lists[] = id(new PHUIObjectBoxView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
▲ Show 20 Lines • Show All 163 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