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 $savedQuery; | private $savedQuery; | ||||
| private $canEditPriority; | private $canEditPriority; | ||||
| private $canBatchEdit; | private $canBatchEdit; | ||||
| private $showBatchControls; | private $showBatchControls; | ||||
| private $customFieldLists = array(); | |||||
| 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; | ||||
| Show All 10 Lines | public function setCanBatchEdit($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; | ||||
| } | } | ||||
| public function setCustomFieldLists(array $lists) { | |||||
| $this->customFieldLists = $lists; | |||||
| return $this; | |||||
| } | |||||
| public function render() { | public function render() { | ||||
| $viewer = $this->getUser(); | $viewer = $this->getUser(); | ||||
| $tasks = $this->tasks; | $tasks = $this->tasks; | ||||
| $query = $this->savedQuery; | $query = $this->savedQuery; | ||||
| // If we didn't match anything, just pick up the default empty state. | // If we didn't match anything, just pick up the default empty state. | ||||
| if (!$tasks) { | if (!$tasks) { | ||||
| return id(new PHUIObjectItemListView()) | return id(new PHUIObjectItemListView()) | ||||
| Show All 30 Lines | foreach ($groups as $group => $list) { | ||||
| $task_list = new ManiphestTaskListView(); | $task_list = new ManiphestTaskListView(); | ||||
| $task_list->setShowBatchControls($this->showBatchControls); | $task_list->setShowBatchControls($this->showBatchControls); | ||||
| if ($can_drag) { | if ($can_drag) { | ||||
| $task_list->setShowSubpriorityControls(true); | $task_list->setShowSubpriorityControls(true); | ||||
| } | } | ||||
| $task_list->setUser($viewer); | $task_list->setUser($viewer); | ||||
| $task_list->setTasks($list); | $task_list->setTasks($list); | ||||
| $task_list->setHandles($handles); | $task_list->setHandles($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) | ||||
| ->setObjectList($task_list); | ->setObjectList($task_list); | ||||
| } | } | ||||
| if ($can_drag) { | if ($can_drag) { | ||||
| Javelin::initBehavior( | Javelin::initBehavior( | ||||
| 'maniphest-subpriority-editor', | 'maniphest-subpriority-editor', | ||||
| array( | array( | ||||
| 'uri' => '/maniphest/subpriority/', | 'uri' => '/maniphest/subpriority/', | ||||
| )); | )); | ||||
| ▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines | |||||