From eacd0f537007318f389ec2356c3c61d4bddd05b2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 24 Jul 2011 12:39:04 -0700 Subject: [PATCH] Allow Maniphest task status to be changed on the "Edit Task" interface Summary: We omit a 'status' dropdown when creating a new task since it's silly to create a non-open task and would just clutter the interface, but there's no reason not to allow status to be edited on the "Edit" interface. Test Plan: Created a new task (no status dropdown). Edited a task, including changing the task status. Reviewed By: jungejason Reviewers: toulouse, jungejason, tuomaspelkonen, aran CC: aran, jungejason Differential Revision: 720 --- .../taskedit/ManiphestTaskEditController.php | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php b/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php index e529d4f60b..5d4aaf5357 100644 --- a/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php @@ -76,6 +76,7 @@ class ManiphestTaskEditController extends ManiphestController { $new_title = $request->getStr('title'); $new_desc = $request->getStr('description'); + $new_status = $request->getStr('status'); if ($task->getID()) { if ($new_title != $task->getTitle()) { @@ -84,6 +85,9 @@ class ManiphestTaskEditController extends ManiphestController { if ($new_desc != $task->getDescription()) { $changes[ManiphestTransactionType::TYPE_DESCRIPTION] = $new_desc; } + if ($new_status != $task->getStatus()) { + $changes[ManiphestTransactionType::TYPE_STATUS] = $new_status; + } } else { $task->setTitle($new_title); $task->setDescription($new_desc); @@ -225,7 +229,22 @@ class ManiphestTaskEditController extends ManiphestController { ->setName('title') ->setError($e_title) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT) - ->setValue($task->getTitle())) + ->setValue($task->getTitle())); + + if ($task->getID()) { + // Only show this in "edit" mode, not "create" mode, since creating a + // non-open task is kind of silly and it would just clutter up the + // "create" interface. + $form + ->appendChild( + id(new AphrontFormSelectControl()) + ->setLabel('Status') + ->setName('status') + ->setValue($task->getStatus()) + ->setOptions(ManiphestTaskStatus::getTaskStatusMap())); + } + + $form ->appendChild( id(new AphrontFormTokenizerControl()) ->setLabel('Assigned To')