1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Restrict marking task duplicate to "merge duplicates" workflow

Summary: Fixes T4819, remove status "duplicate" from dropdown in edit task unless task is already in duplicate status

Test Plan: Edit task, not in duplicate status, verify dropdown does not have "duplicate" option. Edit task already in "duplicate" status, verify that dropdown shows "duplicate" status option.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T4819

Differential Revision: https://secure.phabricator.com/D8902
This commit is contained in:
lkassianik 2014-04-29 11:41:30 -07:00 committed by epriestley
parent f32971cf81
commit 1d5731b1ae

View file

@ -569,13 +569,21 @@ final class ManiphestTaskEditController extends ManiphestController {
->setValue($task->getTitle())); ->setValue($task->getTitle()));
if ($can_edit_status) { if ($can_edit_status) {
// See T4819.
$status_map = ManiphestTaskStatus::getTaskStatusMap();
$dup_status = ManiphestTaskStatus::getDuplicateStatus();
if ($task->getStatus() != $dup_status) {
unset($status_map[$dup_status]);
}
$form $form
->appendChild( ->appendChild(
id(new AphrontFormSelectControl()) id(new AphrontFormSelectControl())
->setLabel(pht('Status')) ->setLabel(pht('Status'))
->setName('status') ->setName('status')
->setValue($task->getStatus()) ->setValue($task->getStatus())
->setOptions(ManiphestTaskStatus::getTaskStatusMap())); ->setOptions($status_map));
} }
$policies = id(new PhabricatorPolicyQuery()) $policies = id(new PhabricatorPolicyQuery())