Pholio - allow Pholio Mocks to be attached to Maniphest Tasks (and vice versa)

Summary: Fixes T2654.

Test Plan: attached lots of mocks and tasks to one another from both maniphest and pholio. verified transactions rendered okay in both applications

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2654

Differential Revision: https://secure.phabricator.com/D6501
This commit is contained in:
Bob Trahan
2013-07-19 15:59:29 -07:00
parent e777f7ad91
commit 3854599428
10 changed files with 799 additions and 42 deletions

View File

@@ -31,7 +31,11 @@ final class PhabricatorSearchSelectController
break;
case 'created';
$query->setParameter('author', array($user->getPHID()));
$query->setParameter('open', 1);
// TODO - if / when we allow pholio mocks to be archived, etc
// update this
if ($this->type != PhabricatorPHIDConstants::PHID_TYPE_MOCK) {
$query->setParameter('open', 1);
}
break;
case 'open':
$query->setParameter('open', 1);
@@ -69,6 +73,9 @@ final class PhabricatorSearchSelectController
case PhabricatorPHIDConstants::PHID_TYPE_DREV:
$pattern = '/\bD(\d+)\b/i';
break;
case PhabricatorPHIDConstants::PHID_TYPE_MOCK:
$pattern = '/\bM(\d+)\b/i';
break;
}
if (!$pattern) {
@@ -97,6 +104,11 @@ final class PhabricatorSearchSelectController
'id IN (%Ld)',
$object_ids);
break;
case PhabricatorPHIDConstants::PHID_TYPE_MOCK:
$objects = id(new PholioMock())->loadAllWhere(
'id IN (%Ld)',
$object_ids);
break;
}
return array_fill_keys(mpull($objects, 'getPHID'), true);