Differential D16166 Diff 38890 src/applications/search/controller/PhabricatorSearchRelationshipController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/controller/PhabricatorSearchRelationshipController.php
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$dialog_button = $relationship->getDialogButtonText(); | $dialog_button = $relationship->getDialogButtonText(); | ||||
$dialog_instructions = $relationship->getDialogInstructionsText(); | $dialog_instructions = $relationship->getDialogInstructionsText(); | ||||
// TODO: Remove this, this is just legacy support. | // TODO: Remove this, this is just legacy support. | ||||
$legacy_kinds = array( | $legacy_kinds = array( | ||||
ManiphestTaskHasCommitEdgeType::EDGECONST => 'CMIT', | ManiphestTaskHasCommitEdgeType::EDGECONST => 'CMIT', | ||||
ManiphestTaskHasMockEdgeType::EDGECONST => 'MOCK', | ManiphestTaskHasMockEdgeType::EDGECONST => 'MOCK', | ||||
ManiphestTaskHasRevisionEdgeType::EDGECONST => 'DREV', | ManiphestTaskHasRevisionEdgeType::EDGECONST => 'DREV', | ||||
ManiphestTaskDependsOnTaskEdgeType::EDGECONST => 'TASK', | |||||
ManiphestTaskDependedOnByTaskEdgeType::EDGECONST => 'TASK', | |||||
); | ); | ||||
$edge_type = $relationship->getEdgeConstant(); | $edge_type = $relationship->getEdgeConstant(); | ||||
$legacy_kind = idx($legacy_kinds, $edge_type); | $legacy_kind = idx($legacy_kinds, $edge_type); | ||||
if (!$legacy_kind) { | if (!$legacy_kind) { | ||||
throw new Exception( | throw new Exception( | ||||
pht('Only specific legacy relationships are supported!')); | pht('Only specific legacy relationships are supported!')); | ||||
} | } | ||||
Show All 24 Lines | private function newGraphCycleResponse( | ||||
$handles = $this->loadViewerHandles($cycle); | $handles = $this->loadViewerHandles($cycle); | ||||
$names = array(); | $names = array(); | ||||
foreach ($cycle as $cycle_phid) { | foreach ($cycle as $cycle_phid) { | ||||
$names[] = $handles[$cycle_phid]->getFullName(); | $names[] = $handles[$cycle_phid]->getFullName(); | ||||
} | } | ||||
$message = pht( | $message = pht( | ||||
'You can not create that relationship because it would create a '. | 'You can not create that relationship because it would create a '. | ||||
'circular dependency: %s.', | 'circular dependency:'); | ||||
implode(" \xE2\x86\x92 ", $names)); | |||||
$list = implode(" \xE2\x86\x92 ", $names); | |||||
return $this->newDialog() | return $this->newDialog() | ||||
->setTitle(pht('Circular Dependency')) | ->setTitle(pht('Circular Dependency')) | ||||
->appendParagraph($message) | ->appendParagraph($message) | ||||
->appendParagraph($list) | |||||
->addCancelButton($done_uri); | ->addCancelButton($done_uri); | ||||
} | } | ||||
private function newUnrelatableObjectResponse(Exception $ex, $done_uri) { | private function newUnrelatableObjectResponse(Exception $ex, $done_uri) { | ||||
$message = $ex->getMessage(); | $message = $ex->getMessage(); | ||||
return $this->newDialog() | return $this->newDialog() | ||||
->setTitle(pht('Invalid Relationship')) | ->setTitle(pht('Invalid Relationship')) | ||||
->appendParagraph($message) | ->appendParagraph($message) | ||||
->addCancelButton($done_uri); | ->addCancelButton($done_uri); | ||||
} | } | ||||
} | } |