From d2ead465f38e659de77e8ba57cacd8a75b697f4c Mon Sep 17 00:00:00 2001
From: epriestley <git@epriestley.com>
Date: Wed, 21 May 2014 12:44:58 -0700
Subject: [PATCH] Remove "Close Task" button

Summary: Fixes T5134

Test Plan: Went to a task, closed it. Felt satisfied.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley, Korvin

Maniphest Tasks: T4657, T5134

Differential Revision: https://secure.phabricator.com/D9221
---
 .../ManiphestTaskDetailController.php          | 18 +++---------------
 .../ManiphestTransactionSaveController.php     | 14 ++------------
 2 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
index e7493795a5..c75f4d0673 100644
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -205,20 +205,6 @@ final class ManiphestTaskDetailController extends ManiphestController {
       $draft_text = null;
     }
 
-    $submit_control = id(new PHUIFormMultiSubmitControl());
-    if (!$task->isClosed()) {
-      $close_image = id(new PHUIIconView())
-          ->setIconFont('fa-check-square-o');
-      $submit_control->addButtonView(
-        id(new PHUIButtonView())
-          ->setColor(PHUIButtonView::GREY)
-          ->setIcon($close_image)
-          ->setText(pht('Close Task'))
-          ->setName('scuttle')
-          ->addSigil('alternate-submit-button'));
-    }
-    $submit_control->addSubmitButton(pht('Submit'));
-
     $comment_form = new AphrontFormView();
     $comment_form
       ->setUser($user)
@@ -284,7 +270,9 @@ final class ManiphestTaskDetailController extends ManiphestController {
           ->setValue($draft_text)
           ->setID('transaction-comments')
           ->setUser($user))
-      ->appendChild($submit_control);
+      ->appendChild(
+        id(new AphrontFormSubmitControl())
+          ->setValue(pht('Submit')));
 
     $control_map = array(
       ManiphestTransaction::TYPE_STATUS   => 'resolution',
diff --git a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
index 3a623612d4..34e2f57f37 100644
--- a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
+++ b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
@@ -78,17 +78,6 @@ final class ManiphestTransactionSaveController extends ManiphestController {
       $transactions[] = $transaction;
     }
 
-    $resolution = $request->getStr('resolution');
-    $did_scuttle = false;
-    if ($action !== ManiphestTransaction::TYPE_STATUS) {
-      if ($request->getStr('scuttle')) {
-        $transactions[] = id(new ManiphestTransaction())
-          ->setTransactionType(ManiphestTransaction::TYPE_STATUS)
-          ->setNewValue(ManiphestTaskStatus::getDefaultClosedStatus());
-        $did_scuttle = true;
-        $resolution = ManiphestTaskStatus::getDefaultClosedStatus();
-      }
-    }
 
     // When you interact with a task, we add you to the CC list so you get
     // further updates, and possibly assign the task to you if you took an
@@ -106,7 +95,8 @@ final class ManiphestTransactionSaveController extends ManiphestController {
       }
     }
 
-    if ($did_scuttle || ($action == ManiphestTransaction::TYPE_STATUS)) {
+    if ($action == ManiphestTransaction::TYPE_STATUS) {
+      $resolution = $request->getStr('resolution');
       if (!$task->getOwnerPHID() &&
           ManiphestTaskStatus::isClosedStatus($resolution)) {
         // Closing an unassigned task. Assign the user as the owner of