2011-02-08 19:53:59 +01:00
|
|
|
<?php
|
|
|
|
|
2011-07-04 22:04:22 +02:00
|
|
|
/**
|
|
|
|
* @group maniphest
|
|
|
|
*/
|
2012-03-14 00:21:04 +01:00
|
|
|
final class ManiphestTaskListView extends ManiphestView {
|
2011-02-08 19:53:59 +01:00
|
|
|
|
|
|
|
private $tasks;
|
|
|
|
private $handles;
|
2012-02-24 22:00:48 +01:00
|
|
|
private $showBatchControls;
|
2012-04-02 21:12:04 +02:00
|
|
|
private $showSubpriorityControls;
|
2011-02-08 19:53:59 +01:00
|
|
|
|
|
|
|
public function setTasks(array $tasks) {
|
2012-04-03 21:10:45 +02:00
|
|
|
assert_instances_of($tasks, 'ManiphestTask');
|
2011-02-08 19:53:59 +01:00
|
|
|
$this->tasks = $tasks;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setHandles(array $handles) {
|
2012-04-03 21:10:45 +02:00
|
|
|
assert_instances_of($handles, 'PhabricatorObjectHandle');
|
2011-02-08 19:53:59 +01:00
|
|
|
$this->handles = $handles;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-02-24 22:00:48 +01:00
|
|
|
public function setShowBatchControls($show_batch_controls) {
|
|
|
|
$this->showBatchControls = $show_batch_controls;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-04-02 21:12:04 +02:00
|
|
|
public function setShowSubpriorityControls($show_subpriority_controls) {
|
|
|
|
$this->showSubpriorityControls = $show_subpriority_controls;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2011-02-08 19:53:59 +01:00
|
|
|
public function render() {
|
|
|
|
|
|
|
|
$views = array();
|
|
|
|
foreach ($this->tasks as $task) {
|
2011-02-27 05:57:21 +01:00
|
|
|
$view = new ManiphestTaskSummaryView();
|
2011-02-08 19:53:59 +01:00
|
|
|
$view->setTask($task);
|
2012-02-24 22:00:48 +01:00
|
|
|
$view->setShowBatchControls($this->showBatchControls);
|
2012-04-02 21:12:04 +02: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 18:22:52 +02:00
|
|
|
$view->setUser($this->user);
|
2011-02-08 19:53:59 +01:00
|
|
|
$view->setHandles($this->handles);
|
|
|
|
$views[] = $view->render();
|
|
|
|
}
|
|
|
|
|
2012-03-05 22:51:35 +01:00
|
|
|
return implode("\n", $views);
|
2011-02-08 19:53:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|