1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Add Marked With Any Flag search option

Summary: T3692

Test Plan: Search for macros with/without flags and then all flagged

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T3692

Differential Revision: https://secure.phabricator.com/D8976
This commit is contained in:
Gareth Evans 2014-05-05 14:19:48 -07:00 committed by epriestley
parent 572089c936
commit 01892e3808

View file

@ -30,7 +30,10 @@ final class PhabricatorMacroQuery
public static function getFlagColorsOptions() {
$options = array('-1' => pht('(No Filtering)'));
$options = array(
'-1' => pht('(No Filtering)'),
'-2' => pht('(Marked With Any Flag)'),
);
foreach (PhabricatorFlagColor::getColorNameMap() as $color => $name) {
$options[$color] = $name;
@ -169,10 +172,15 @@ final class PhabricatorMacroQuery
}
if ($this->flagColor != '-1' && $this->flagColor !== null) {
if ($this->flagColor == '-2') {
$flag_colors = array_keys(PhabricatorFlagColor::getColorNameMap());
} else {
$flag_colors = array($this->flagColor);
}
$flags = id(new PhabricatorFlagQuery())
->withOwnerPHIDs(array($this->getViewer()->getPHID()))
->withTypes(array(PhabricatorMacroPHIDTypeMacro::TYPECONST))
->withColors(array($this->flagColor))
->withColors($flag_colors)
->setViewer($this->getViewer())
->execute();