Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/editor/ManiphestEditEngine.php
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | final class ManiphestEditEngine | ||||
| protected function buildCustomEditFields($object) { | protected function buildCustomEditFields($object) { | ||||
| // See T4819. | // See T4819. | ||||
| $status_map = ManiphestTaskStatus::getTaskStatusMap(); | $status_map = ManiphestTaskStatus::getTaskStatusMap(); | ||||
| $dup_status = ManiphestTaskStatus::getDuplicateStatus(); | $dup_status = ManiphestTaskStatus::getDuplicateStatus(); | ||||
| if ($object->getStatus() != $dup_status) { | if ($object->getStatus() != $dup_status) { | ||||
| unset($status_map[$dup_status]); | unset($status_map[$dup_status]); | ||||
| } | } | ||||
| $owner_phid = $object->getOwnerPHID(); | |||||
| if ($owner_phid) { | |||||
| $owner_value = array($owner_phid); | |||||
| } else { | |||||
| $owner_value = array(); | |||||
| } | |||||
| $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); | $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); | ||||
| // TODO: Restore these or toss them: | // TODO: Restore these or toss them: | ||||
| // - Require a single owner. | |||||
| // - Default owner to viewer. | // - Default owner to viewer. | ||||
| // - Don't show "change status" for closed tasks. | // - Don't show "change status" for closed tasks. | ||||
| // - Don't show "change owner" for closed tasks. | // - Don't show "change owner" for closed tasks. | ||||
| // - Don't let users change a task status to "Duplicate". | // - Don't let users change a task status to "Duplicate". | ||||
| // - When closing an unassigned task, assign the closing user. | // - When closing an unassigned task, assign the closing user. | ||||
| // - Make sure implicit CCs on actions are working reasonably. | // - Make sure implicit CCs on actions are working reasonably. | ||||
| return array( | return array( | ||||
| id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
| ->setKey('title') | ->setKey('title') | ||||
| ->setLabel(pht('Title')) | ->setLabel(pht('Title')) | ||||
| ->setDescription(pht('Name of the task.')) | ->setDescription(pht('Name of the task.')) | ||||
| ->setTransactionType(ManiphestTransaction::TYPE_TITLE) | ->setTransactionType(ManiphestTransaction::TYPE_TITLE) | ||||
| ->setIsRequired(true) | ->setIsRequired(true) | ||||
| ->setValue($object->getTitle()), | ->setValue($object->getTitle()), | ||||
| id(new PhabricatorSelectEditField()) | id(new PhabricatorSelectEditField()) | ||||
| ->setKey('status') | ->setKey('status') | ||||
| ->setLabel(pht('Status')) | ->setLabel(pht('Status')) | ||||
| ->setDescription(pht('Status of the task.')) | ->setDescription(pht('Status of the task.')) | ||||
| ->setTransactionType(ManiphestTransaction::TYPE_STATUS) | ->setTransactionType(ManiphestTransaction::TYPE_STATUS) | ||||
| ->setValue($object->getStatus()) | ->setValue($object->getStatus()) | ||||
| ->setOptions($status_map), | ->setOptions($status_map), | ||||
| id(new PhabricatorUsersEditField()) | id(new PhabricatorUsersEditField()) | ||||
| ->setKey('assigned') | ->setKey('owner') | ||||
| ->setAliases(array('assign', 'assignee')) | ->setAliases(array('ownerPHID', 'assign', 'assigned')) | ||||
| ->setLabel(pht('Assigned To')) | ->setLabel(pht('Assigned To')) | ||||
| ->setDescription(pht('User who is responsible for the task.')) | ->setDescription(pht('User who is responsible for the task.')) | ||||
| ->setTransactionType(ManiphestTransaction::TYPE_OWNER) | ->setTransactionType(ManiphestTransaction::TYPE_OWNER) | ||||
| ->setValue($owner_value), | ->setSingleValue($object->getOwnerPHID()), | ||||
| id(new PhabricatorSelectEditField()) | id(new PhabricatorSelectEditField()) | ||||
| ->setKey('priority') | ->setKey('priority') | ||||
| ->setLabel(pht('Priority')) | ->setLabel(pht('Priority')) | ||||
| ->setDescription(pht('Priority of the task.')) | ->setDescription(pht('Priority of the task.')) | ||||
| ->setTransactionType(ManiphestTransaction::TYPE_PRIORITY) | ->setTransactionType(ManiphestTransaction::TYPE_PRIORITY) | ||||
| ->setValue($object->getPriority()) | ->setValue($object->getPriority()) | ||||
| ->setOptions($priority_map), | ->setOptions($priority_map), | ||||
| id(new PhabricatorRemarkupEditField()) | id(new PhabricatorRemarkupEditField()) | ||||
| Show All 14 Lines | |||||