Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/editor/ManiphestEditEngine.php
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | protected function buildCustomEditFields($object) { | ||||
| if ($object->getStatus() != $dup_status) { | if ($object->getStatus() != $dup_status) { | ||||
| unset($status_map[$dup_status]); | unset($status_map[$dup_status]); | ||||
| } | } | ||||
| $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); | $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); | ||||
| // TODO: Restore these or toss them: | // TODO: Restore these or toss them: | ||||
| // - Default owner to viewer. | // - Default owner to viewer. | ||||
| // - 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". | |||||
| // - 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. | ||||
| if ($object->isClosed()) { | |||||
| $priority_label = null; | |||||
| $default_status = ManiphestTaskStatus::getDefaultStatus(); | |||||
| } else { | |||||
| $priority_label = pht('Change Priority'); | |||||
| $default_status = ManiphestTaskStatus::getDefaultClosedStatus(); | |||||
| } | |||||
| 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) | ||||
| ->setCommentActionLabel(pht('Change Status')) | |||||
| ->setCommentActionDefaultValue($default_status), | |||||
| id(new PhabricatorUsersEditField()) | id(new PhabricatorUsersEditField()) | ||||
| ->setKey('owner') | ->setKey('owner') | ||||
| ->setAliases(array('ownerPHID', 'assign', 'assigned')) | ->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) | ||||
| ->setSingleValue($object->getOwnerPHID()), | ->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) | ||||
| ->setCommentActionLabel($priority_label), | |||||
| id(new PhabricatorRemarkupEditField()) | id(new PhabricatorRemarkupEditField()) | ||||
| ->setKey('description') | ->setKey('description') | ||||
| ->setLabel(pht('Description')) | ->setLabel(pht('Description')) | ||||
| ->setDescription(pht('Task description.')) | ->setDescription(pht('Task description.')) | ||||
| ->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION) | ->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION) | ||||
| ->setValue($object->getDescription()), | ->setValue($object->getDescription()), | ||||
| ); | ); | ||||
| } | } | ||||
| protected function getEditorURI() { | protected function getEditorURI() { | ||||
| // TODO: Remove when cutting over. | // TODO: Remove when cutting over. | ||||
| return $this->getApplication()->getApplicationURI('editpro/'); | return $this->getApplication()->getApplicationURI('editpro/'); | ||||
| } | } | ||||
| } | } | ||||