Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/editor/ManiphestEditEngine.php
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | protected function buildCustomEditFields($object) { | ||||
| $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]); | ||||
| } | } | ||||
| $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); | $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); | ||||
| // TODO: Restore these or toss them: | // TODO: Restore these or toss them: | ||||
| // - Default owner to viewer. | |||||
| // - Don't show "change owner" for closed tasks. | |||||
| // - 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()) { | if ($object->isClosed()) { | ||||
| $priority_label = null; | $priority_label = null; | ||||
| $owner_label = null; | |||||
| $default_status = ManiphestTaskStatus::getDefaultStatus(); | $default_status = ManiphestTaskStatus::getDefaultStatus(); | ||||
| } else { | } else { | ||||
| $priority_label = pht('Change Priority'); | $priority_label = pht('Change Priority'); | ||||
| $owner_label = pht('Assign / Claim'); | |||||
chad: Can we split assign/claim now into two different actions? | |||||
| $default_status = ManiphestTaskStatus::getDefaultClosedStatus(); | $default_status = ManiphestTaskStatus::getDefaultClosedStatus(); | ||||
| } | } | ||||
| if ($object->getOwnerPHID()) { | |||||
| $owner_value = array($object->getOwnerPHID()); | |||||
| } else { | |||||
| $owner_value = array($this->getViewer()->getPHID()); | |||||
| } | |||||
| 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')) | ->setCommentActionLabel(pht('Change Status')) | ||||
| ->setCommentActionDefaultValue($default_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()) | ||||
| ->setCommentActionLabel($owner_label) | |||||
| ->setCommentActionDefaultValue($owner_value), | |||||
| 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), | ->setCommentActionLabel($priority_label), | ||||
| Show All 15 Lines | |||||
Can we split assign/claim now into two different actions?