2011-02-08 10:53:59 -08:00
|
|
|
<?php
|
|
|
|
|
2011-07-04 13:04:22 -07:00
|
|
|
/**
|
|
|
|
* @group maniphest
|
|
|
|
*/
|
2012-03-13 16:21:04 -07:00
|
|
|
final class ManiphestTaskListView extends ManiphestView {
|
2011-02-08 10:53:59 -08:00
|
|
|
|
|
|
|
private $tasks;
|
|
|
|
private $handles;
|
2012-02-24 13:00:48 -08:00
|
|
|
private $showBatchControls;
|
2012-04-02 12:12:04 -07:00
|
|
|
private $showSubpriorityControls;
|
2011-02-08 10:53:59 -08:00
|
|
|
|
|
|
|
public function setTasks(array $tasks) {
|
2012-04-03 12:10:45 -07:00
|
|
|
assert_instances_of($tasks, 'ManiphestTask');
|
2011-02-08 10:53:59 -08:00
|
|
|
$this->tasks = $tasks;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setHandles(array $handles) {
|
2012-04-03 12:10:45 -07:00
|
|
|
assert_instances_of($handles, 'PhabricatorObjectHandle');
|
2011-02-08 10:53:59 -08:00
|
|
|
$this->handles = $handles;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-02-24 13:00:48 -08:00
|
|
|
public function setShowBatchControls($show_batch_controls) {
|
|
|
|
$this->showBatchControls = $show_batch_controls;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-04-02 12:12:04 -07:00
|
|
|
public function setShowSubpriorityControls($show_subpriority_controls) {
|
|
|
|
$this->showSubpriorityControls = $show_subpriority_controls;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2011-02-08 10:53:59 -08:00
|
|
|
public function render() {
|
|
|
|
|
|
|
|
$views = array();
|
|
|
|
foreach ($this->tasks as $task) {
|
2011-02-26 20:57:21 -08:00
|
|
|
$view = new ManiphestTaskSummaryView();
|
2011-02-08 10:53:59 -08:00
|
|
|
$view->setTask($task);
|
2012-02-24 13:00:48 -08:00
|
|
|
$view->setShowBatchControls($this->showBatchControls);
|
2012-04-02 12:12:04 -07:00
|
|
|
$view->setShowSubpriorityControls($this->showSubpriorityControls);
|
Use phabricator_ time functions in more places
Summary:
Replace some more date() calls with locale-aware calls.
Also, at least on my system, the DateTimeZone / DateTime stuff didn't actually
work and always rendered in UTC. Fixed that.
Test Plan:
Viewed daemon console, differential revisions, files, and maniphest timestamps
in multiple timezones.
Reviewed By: toulouse
Reviewers: toulouse, fratrik, jungejason, aran, tuomaspelkonen
CC: aran, toulouse
Differential Revision: 530
2011-06-26 09:22:52 -07:00
|
|
|
$view->setUser($this->user);
|
2011-02-08 10:53:59 -08:00
|
|
|
$view->setHandles($this->handles);
|
|
|
|
$views[] = $view->render();
|
|
|
|
}
|
|
|
|
|
2013-03-09 13:52:41 -08:00
|
|
|
return $views;
|
2011-02-08 10:53:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|