2016-07-01 17:50:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class ManiphestTaskGraph
|
|
|
|
extends PhabricatorObjectGraph {
|
|
|
|
|
|
|
|
protected function getEdgeTypes() {
|
|
|
|
return array(
|
|
|
|
ManiphestTaskDependedOnByTaskEdgeType::EDGECONST,
|
|
|
|
ManiphestTaskDependsOnTaskEdgeType::EDGECONST,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getParentEdgeType() {
|
|
|
|
return ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function newQuery() {
|
|
|
|
return new ManiphestTaskQuery();
|
|
|
|
}
|
|
|
|
|
2016-07-01 21:53:41 +02:00
|
|
|
protected function isClosed($object) {
|
|
|
|
return $object->isClosed();
|
|
|
|
}
|
|
|
|
|
2016-07-01 17:50:16 +02:00
|
|
|
protected function newTableRow($phid, $object, $trace) {
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
|
|
|
|
if ($object) {
|
|
|
|
$status = $object->getStatus();
|
|
|
|
$priority = $object->getPriority();
|
|
|
|
$status_icon = ManiphestTaskStatus::getStatusIcon($status);
|
|
|
|
$status_name = ManiphestTaskStatus::getTaskStatusName($status);
|
|
|
|
$priority_color = ManiphestTaskPriority::getTaskPriorityColor($priority);
|
|
|
|
|
|
|
|
|
|
|
|
$status = array(
|
|
|
|
id(new PHUIIconView())->setIcon($status_icon, $priority_color),
|
|
|
|
' ',
|
|
|
|
$status_name,
|
|
|
|
);
|
|
|
|
|
|
|
|
$owner_phid = $object->getOwnerPHID();
|
|
|
|
if ($owner_phid) {
|
|
|
|
$assigned = $viewer->renderHandle($owner_phid);
|
|
|
|
} else {
|
|
|
|
$assigned = phutil_tag('em', array(), pht('None'));
|
|
|
|
}
|
|
|
|
|
|
|
|
$link = phutil_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => $object->getURI(),
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
$object->getMonogram(),
|
|
|
|
' ',
|
|
|
|
$object->getTitle(),
|
|
|
|
));
|
|
|
|
} else {
|
|
|
|
$status = null;
|
|
|
|
$assigned = null;
|
|
|
|
$link = $viewer->renderHandle($phid);
|
|
|
|
}
|
|
|
|
|
|
|
|
return array(
|
|
|
|
$trace,
|
|
|
|
$status,
|
|
|
|
$assigned,
|
|
|
|
$link,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function newTable(AphrontTableView $table) {
|
|
|
|
return $table
|
|
|
|
->setHeaders(
|
|
|
|
array(
|
|
|
|
null,
|
|
|
|
pht('Status'),
|
|
|
|
pht('Assigned'),
|
|
|
|
pht('Task'),
|
|
|
|
))
|
|
|
|
->setColumnClasses(
|
|
|
|
array(
|
|
|
|
'threads',
|
2016-07-01 21:53:41 +02:00
|
|
|
'graph-status',
|
2016-07-01 17:50:16 +02:00
|
|
|
null,
|
2016-07-01 21:53:41 +02:00
|
|
|
'wide object-link',
|
2016-07-01 17:50:16 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|