Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/view/ManiphestTaskListView.php
| <?php | <?php | ||||
| final class ManiphestTaskListView extends ManiphestView { | final class ManiphestTaskListView extends ManiphestView { | ||||
| private $tasks; | private $tasks; | ||||
| private $handles; | private $handles; | ||||
| private $showBatchControls; | private $showBatchControls; | ||||
| private $showSubpriorityControls; | private $showSubpriorityControls; | ||||
| private $noDataString; | private $noDataString; | ||||
| private $customFieldLists = array(); | |||||
| public function setTasks(array $tasks) { | public function setTasks(array $tasks) { | ||||
| assert_instances_of($tasks, 'ManiphestTask'); | assert_instances_of($tasks, 'ManiphestTask'); | ||||
| $this->tasks = $tasks; | $this->tasks = $tasks; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setHandles(array $handles) { | public function setHandles(array $handles) { | ||||
| Show All 12 Lines | public function setShowSubpriorityControls($show_subpriority_controls) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setNoDataString($text) { | public function setNoDataString($text) { | ||||
| $this->noDataString = $text; | $this->noDataString = $text; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setCustomFieldLists(array $lists) { | |||||
| $this->customFieldLists = $lists; | |||||
| return $this; | |||||
| } | |||||
| public function render() { | public function render() { | ||||
| $handles = $this->handles; | $handles = $this->handles; | ||||
| require_celerity_resource('maniphest-task-summary-css'); | require_celerity_resource('maniphest-task-summary-css'); | ||||
| $list = new PHUIObjectItemListView(); | $list = new PHUIObjectItemListView(); | ||||
| if ($this->noDataString) { | if ($this->noDataString) { | ||||
| Show All 13 Lines | public function render() { | ||||
| foreach ($this->tasks as $task) { | foreach ($this->tasks as $task) { | ||||
| $item = id(new PHUIObjectItemView()) | $item = id(new PHUIObjectItemView()) | ||||
| ->setUser($this->getUser()) | ->setUser($this->getUser()) | ||||
| ->setObject($task) | ->setObject($task) | ||||
| ->setObjectName('T'.$task->getID()) | ->setObjectName('T'.$task->getID()) | ||||
| ->setHeader($task->getTitle()) | ->setHeader($task->getTitle()) | ||||
| ->setHref('/T'.$task->getID()); | ->setHref('/T'.$task->getID()); | ||||
| $field_list = idx($this->customFieldLists, $task->getPHID()); | |||||
| if ($field_list) { | |||||
| $field_list | |||||
| ->appendFieldsToListItem($task, $this->getViewer(), $item); | |||||
| } | |||||
| if ($task->getOwnerPHID()) { | if ($task->getOwnerPHID()) { | ||||
| $owner = $handles[$task->getOwnerPHID()]; | $owner = $handles[$task->getOwnerPHID()]; | ||||
| $item->addByline(pht('Assigned: %s', $owner->renderLink())); | $item->addByline(pht('Assigned: %s', $owner->renderLink())); | ||||
| } | } | ||||
| $status = $task->getStatus(); | $status = $task->getStatus(); | ||||
| $pri = idx($priority_map, $task->getPriority()); | $pri = idx($priority_map, $task->getPriority()); | ||||
| $status_name = idx($status_map, $task->getStatus()); | $status_name = idx($status_map, $task->getStatus()); | ||||
| ▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines | |||||