Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14756336
D18035.id43382.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D18035.id43382.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1494,6 +1494,7 @@
'ManiphestPointsConfigOptionType' => 'applications/maniphest/config/ManiphestPointsConfigOptionType.php',
'ManiphestPriorityConfigOptionType' => 'applications/maniphest/config/ManiphestPriorityConfigOptionType.php',
'ManiphestPriorityEmailCommand' => 'applications/maniphest/command/ManiphestPriorityEmailCommand.php',
+ 'ManiphestPrioritySearchConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestPrioritySearchConduitAPIMethod.php',
'ManiphestProjectNameFulltextEngineExtension' => 'applications/maniphest/engineextension/ManiphestProjectNameFulltextEngineExtension.php',
'ManiphestQueryConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php',
'ManiphestQueryStatusesConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php',
@@ -6593,6 +6594,7 @@
'ManiphestPointsConfigOptionType' => 'PhabricatorConfigJSONOptionType',
'ManiphestPriorityConfigOptionType' => 'PhabricatorConfigJSONOptionType',
'ManiphestPriorityEmailCommand' => 'ManiphestEmailCommand',
+ 'ManiphestPrioritySearchConduitAPIMethod' => 'ManiphestConduitAPIMethod',
'ManiphestProjectNameFulltextEngineExtension' => 'PhabricatorFulltextEngineExtension',
'ManiphestQueryConduitAPIMethod' => 'ManiphestConduitAPIMethod',
'ManiphestQueryStatusesConduitAPIMethod' => 'ManiphestConduitAPIMethod',
diff --git a/src/applications/maniphest/conduit/ManiphestPrioritySearchConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestPrioritySearchConduitAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/maniphest/conduit/ManiphestPrioritySearchConduitAPIMethod.php
@@ -0,0 +1,44 @@
+<?php
+
+final class ManiphestPrioritySearchConduitAPIMethod
+ extends ManiphestConduitAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'maniphest.priority.search';
+ }
+
+ public function getMethodSummary() {
+ return pht('Read information about task priorities.');
+ }
+
+ public function getMethodDescription() {
+ return pht(
+ 'Returns information about the possible priorities for Maniphest '.
+ 'tasks.');
+ }
+
+ protected function defineParamTypes() {
+ return array();
+ }
+
+ protected function defineReturnType() {
+ return 'map<string, wild>';
+ }
+
+ public function getRequiredScope() {
+ return self::SCOPE_ALWAYS;
+ }
+
+ protected function execute(ConduitAPIRequest $request) {
+ $config = ManiphestTaskPriority::getConfig();
+
+ $results = array();
+ foreach ($config as $code => $priority) {
+ $priority['value'] = $code;
+ $results[] = $priority;
+ }
+
+ return array('data' => $results);
+ }
+
+}
diff --git a/src/applications/maniphest/constants/ManiphestTaskPriority.php b/src/applications/maniphest/constants/ManiphestTaskPriority.php
--- a/src/applications/maniphest/constants/ManiphestTaskPriority.php
+++ b/src/applications/maniphest/constants/ManiphestTaskPriority.php
@@ -110,7 +110,7 @@
return idx($config, 'disabled', false);
}
- private static function getConfig() {
+ public static function getConfig() {
$config = PhabricatorEnv::getEnvConfig('maniphest.priorities');
krsort($config);
return $config;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 7:31 PM (16 h, 1 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7033101
Default Alt Text
D18035.id43382.diff (3 KB)
Attached To
Mode
D18035: Add maniphest.priority.search method
Attached
Detach File
Event Timeline
Log In to Comment