mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
6bb24e1d0c
Summary: No UI changes, just some search and replace for UI consistency. Test Plan: Test person and object hovercards still work. UIExamples too. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15172
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class ManiphestHovercardEngineExtension
|
|
extends PhabricatorHovercardEngineExtension {
|
|
|
|
const EXTENSIONKEY = 'maniphest';
|
|
|
|
public function isExtensionEnabled() {
|
|
return PhabricatorApplication::isClassInstalled(
|
|
'PhabricatorManiphestApplication');
|
|
}
|
|
|
|
public function getExtensionName() {
|
|
return pht('Maniphest Tasks');
|
|
}
|
|
|
|
public function canRenderObjectHovercard($object) {
|
|
return ($object instanceof ManiphestTask);
|
|
}
|
|
|
|
public function renderHovercard(
|
|
PHUIHovercardView $hovercard,
|
|
PhabricatorObjectHandle $handle,
|
|
$task,
|
|
$data) {
|
|
$viewer = $this->getViewer();
|
|
|
|
$hovercard
|
|
->setTitle($task->getMonogram())
|
|
->setDetail($task->getTitle());
|
|
|
|
$owner_phid = $task->getOwnerPHID();
|
|
if ($owner_phid) {
|
|
$owner = $viewer->renderHandle($owner_phid);
|
|
} else {
|
|
$owner = phutil_tag('em', array(), pht('None'));
|
|
}
|
|
$hovercard->addField(pht('Assigned To'), $owner);
|
|
|
|
$hovercard->addField(
|
|
pht('Priority'),
|
|
ManiphestTaskPriority::getTaskPriorityName($task->getPriority()));
|
|
|
|
$hovercard->addTag(ManiphestView::renderTagForTask($task));
|
|
}
|
|
|
|
}
|