Differential D8812 Diff 20916 src/applications/maniphest/controller/ManiphestTaskDetailController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/controller/ManiphestTaskDetailController.php
| Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | $draft = id(new PhabricatorDraft())->loadOneWhere( | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| $task->getPHID()); | $task->getPHID()); | ||||
| if ($draft) { | if ($draft) { | ||||
| $draft_text = $draft->getDraft(); | $draft_text = $draft->getDraft(); | ||||
| } else { | } else { | ||||
| $draft_text = null; | $draft_text = null; | ||||
| } | } | ||||
| $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | |||||
| $submit_text = $is_serious | |||||
| ? pht('Submit') | |||||
| : pht('Avast!'); | |||||
| $close_text = $is_serious | |||||
| ? pht('Close Task') | |||||
| : pht('Scuttle Task'); | |||||
| $submit_control = id(new PHUIFormMultiSubmitControl()); | $submit_control = id(new PHUIFormMultiSubmitControl()); | ||||
| if (!$task->isClosed()) { | if (!$task->isClosed()) { | ||||
| $close_image = id(new PHUIIconView()) | $close_image = id(new PHUIIconView()) | ||||
| ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) | ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) | ||||
| ->setSpriteIcon('check'); | ->setSpriteIcon('check'); | ||||
| $submit_control->addButtonView( | $submit_control->addButtonView( | ||||
| id(new PHUIButtonView()) | id(new PHUIButtonView()) | ||||
| ->setColor(PHUIButtonView::GREY) | ->setColor(PHUIButtonView::GREY) | ||||
| ->setIcon($close_image) | ->setIcon($close_image) | ||||
| ->setText($close_text) | ->setText(pht('Close Task')) | ||||
| ->setName('scuttle') | ->setName('scuttle') | ||||
| ->addSigil('alternate-submit-button')); | ->addSigil('alternate-submit-button')); | ||||
| } | } | ||||
| $submit_control->addSubmitButton($submit_text); | $submit_control->addSubmitButton(pht('Submit')); | ||||
| $comment_form = new AphrontFormView(); | $comment_form = new AphrontFormView(); | ||||
| $comment_form | $comment_form | ||||
| ->setUser($user) | ->setUser($user) | ||||
| ->setWorkflow(true) | ->setWorkflow(true) | ||||
| ->setAction('/maniphest/transaction/save/') | ->setAction('/maniphest/transaction/save/') | ||||
| ->setEncType('multipart/form-data') | ->setEncType('multipart/form-data') | ||||
| ->addHiddenInput('taskID', $task->getID()) | ->addHiddenInput('taskID', $task->getID()) | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | if ($user->isLoggedIn()) { | ||||
| 'preview' => 'transaction-preview', | 'preview' => 'transaction-preview', | ||||
| 'comments' => 'transaction-comments', | 'comments' => 'transaction-comments', | ||||
| 'action' => 'transaction-action', | 'action' => 'transaction-action', | ||||
| 'map' => $control_map, | 'map' => $control_map, | ||||
| 'tokenizers' => $tokenizer_map, | 'tokenizers' => $tokenizer_map, | ||||
| )); | )); | ||||
| } | } | ||||
| $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | |||||
| $comment_header = $is_serious | $comment_header = $is_serious | ||||
| ? pht('Add Comment') | ? pht('Add Comment') | ||||
| : pht('Weigh In'); | : pht('Weigh In'); | ||||
| $preview_panel = phutil_tag_div( | $preview_panel = phutil_tag_div( | ||||
| 'aphront-panel-preview', | 'aphront-panel-preview', | ||||
| phutil_tag( | phutil_tag( | ||||
| 'div', | 'div', | ||||
| ▲ Show 20 Lines • Show All 369 Lines • Show Last 20 Lines | |||||