mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-28 12:08:14 +01:00
Conpherence - make threads loadable as handles
Summary: Fixes T3403 Test Plan: looked at /mail/ and saw sensible values as pertained to Conpherence threads. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T3403 Differential Revision: https://secure.phabricator.com/D6370
This commit is contained in:
parent
2c03cd931b
commit
63250b2413
1 changed files with 32 additions and 1 deletions
|
@ -219,6 +219,14 @@ final class PhabricatorObjectHandleData {
|
|||
->execute();
|
||||
return mpull($legds, null, 'getPHID');
|
||||
|
||||
case PhabricatorPHIDConstants::PHID_TYPE_CONP:
|
||||
$confs = id(new ConpherenceThreadQuery())
|
||||
->withPHIDs($phids)
|
||||
->setViewer($this->viewer)
|
||||
->execute();
|
||||
return mpull($confs, null, 'getPHID');
|
||||
|
||||
|
||||
}
|
||||
|
||||
return array();
|
||||
|
@ -738,7 +746,7 @@ final class PhabricatorObjectHandleData {
|
|||
$handle->setPHID($phid);
|
||||
$handle->setType($type);
|
||||
if (empty($objects[$phid])) {
|
||||
$handle->setName('Unknown Legalpad Document');
|
||||
$handle->setName(pht('Unknown Legalpad Document'));
|
||||
} else {
|
||||
$document = $objects[$phid];
|
||||
$handle->setName($document->getDocumentBody()->getTitle());
|
||||
|
@ -750,6 +758,29 @@ final class PhabricatorObjectHandleData {
|
|||
}
|
||||
break;
|
||||
|
||||
case PhabricatorPHIDConstants::PHID_TYPE_CONP:
|
||||
foreach ($phids as $phid) {
|
||||
$handle = new PhabricatorObjectHandle();
|
||||
$handle->setPHID($phid);
|
||||
$handle->setType($type);
|
||||
if (empty($objects[$phid])) {
|
||||
$handle->setName(pht('Unknown Conpherence Thread'));
|
||||
} else {
|
||||
$thread = $objects[$phid];
|
||||
$name = $thread->getTitle();
|
||||
if (!strlen($name)) {
|
||||
$name = pht('[No Title]');
|
||||
}
|
||||
$handle->setName($name);
|
||||
$handle->setFullName($name);
|
||||
$handle->setURI('/conpherence/'.$thread->getID().'/');
|
||||
$handle->setComplete(true);
|
||||
}
|
||||
$handles[$phid] = $handle;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$loader = null;
|
||||
if (isset($external_loaders[$type])) {
|
||||
|
|
Loading…
Add table
Reference in a new issue