Christopher Johnson (WMDE) has submitted this change and it was merged.

Change subject: synchs upstream changes to ProjectMoveController and 
TaskEditController with Sprint
......................................................................


synchs upstream changes to ProjectMoveController and TaskEditController with 
Sprint

Sprint current with https://secure.phabricator.com/D12162 25-03-2015

Change-Id: I0c405951419476503a02c17bb11fd443e9b04100
---
M src/controller/SprintController.php
M src/controller/board/SprintBoardMoveController.php
M src/controller/board/SprintBoardTaskEditController.php
M src/customfield/SprintBeginDateField.php
M src/customfield/SprintEndDateField.php
M src/customfield/SprintProjectCustomField.php
M src/customfield/SprintTaskStoryPointsField.php
M src/events/BurndownActionMenuEventListener.php
M src/util/BurndownDataDate.php
9 files changed, 41 insertions(+), 43 deletions(-)

Approvals:
  jenkins-bot: Verified



diff --git a/src/controller/SprintController.php 
b/src/controller/SprintController.php
index 39c19c5..461c19e 100644
--- a/src/controller/SprintController.php
+++ b/src/controller/SprintController.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * @author Michael Peters
+ * @author Christopher Johnson
  * @license GPL version 3
  */
 
diff --git a/src/controller/board/SprintBoardMoveController.php 
b/src/controller/board/SprintBoardMoveController.php
index 3b46891..b28784c 100644
--- a/src/controller/board/SprintBoardMoveController.php
+++ b/src/controller/board/SprintBoardMoveController.php
@@ -101,55 +101,46 @@
 
     if ($task_phids && ($order == PhabricatorProjectColumn::ORDER_PRIORITY)) {
       $tasks = id(new ManiphestTaskQuery())
-        ->setViewer($viewer)
-        ->withPHIDs($task_phids)
-        ->requireCapabilities(
-          array(
-            PhabricatorPolicyCapability::CAN_VIEW,
-            PhabricatorPolicyCapability::CAN_EDIT,
-          ))
-        ->execute();
+          ->setViewer($viewer)
+          ->withPHIDs($task_phids)
+          ->requireCapabilities(
+              array(
+                  PhabricatorPolicyCapability::CAN_VIEW,
+                  PhabricatorPolicyCapability::CAN_EDIT,
+              ))
+          ->execute();
       if (count($tasks) != count($task_phids)) {
         return new Aphront404Response();
       }
       $tasks = mpull($tasks, null, 'getPHID');
 
-      $a_task = idx($tasks, $after_phid);
-      $b_task = idx($tasks, $before_phid);
+      $try = array(
+          array($after_phid, true),
+          array($before_phid, false),
+      );
 
-      if ($a_task &&
-         (($a_task->getPriority() < $object->getPriority()) ||
-          ($a_task->getPriority() == $object->getPriority() &&
-           $a_task->getSubpriority() >= $object->getSubpriority()))) {
-
-        $after_pri = $a_task->getPriority();
-        $after_sub = $a_task->getSubpriority();
-
-        $xactions[] = id(new ManiphestTransaction())
-          ->setTransactionType(ManiphestTransaction::TYPE_SUBPRIORITY)
-          ->setNewValue(array(
-            'newPriority' => $after_pri,
-            'newSubpriorityBase' => $after_sub,
-            'direction' => '>',
-          ));
-
-       } else if ($b_task &&
-                 (($b_task->getPriority() > $object->getPriority()) ||
-                  ($b_task->getPriority() == $object->getPriority() &&
-                   $b_task->getSubpriority() <= $object->getSubpriority()))) {
-
-        $before_pri = $b_task->getPriority();
-        $before_sub = $b_task->getSubpriority();
-
-        $xactions[] = id(new ManiphestTransaction())
-          ->setTransactionType(ManiphestTransaction::TYPE_SUBPRIORITY)
-          ->setNewValue(array(
-            'newPriority' => $before_pri,
-            'newSubpriorityBase' => $before_sub,
-            'direction' => '<',
-          ));
+      $pri = null;
+      $sub = null;
+      foreach ($try as $spec) {
+        list($task_phid, $is_after) = $spec;
+        $task = idx($tasks, $task_phid);
+        if ($task) {
+          list($pri, $sub) = 
ManiphestTransactionEditor::getAdjacentSubpriority(
+              $task,
+              $is_after);
+          break;
+        }
       }
-   }
+
+      if ($pri !== null) {
+        $xactions[] = id(new ManiphestTransaction())
+            ->setTransactionType(ManiphestTransaction::TYPE_PRIORITY)
+            ->setNewValue($pri);
+        $xactions[] = id(new ManiphestTransaction())
+            ->setTransactionType(ManiphestTransaction::TYPE_SUBPRIORITY)
+            ->setNewValue($sub);
+      }
+    }
 
     $editor = id(new ManiphestTransactionEditor())
       ->setActor($viewer)
diff --git a/src/controller/board/SprintBoardTaskEditController.php 
b/src/controller/board/SprintBoardTaskEditController.php
index 32dfe1b..4fa8a9c 100644
--- a/src/controller/board/SprintBoardTaskEditController.php
+++ b/src/controller/board/SprintBoardTaskEditController.php
@@ -526,7 +526,7 @@
 
     $error_view = null;
     if ($errors) {
-      $error_view = new PHUIErrorView();
+      $error_view = new PHUIInfoView();
       $error_view->setErrors($errors);
     }
 
diff --git a/src/customfield/SprintBeginDateField.php 
b/src/customfield/SprintBeginDateField.php
index b4c0bcf..0822e88 100644
--- a/src/customfield/SprintBeginDateField.php
+++ b/src/customfield/SprintBeginDateField.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * @author Michael Peters
+ * @author Christopher Johnson
  * @license GPL version 3
  */
 
diff --git a/src/customfield/SprintEndDateField.php 
b/src/customfield/SprintEndDateField.php
index b870489..a247d28 100644
--- a/src/customfield/SprintEndDateField.php
+++ b/src/customfield/SprintEndDateField.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * @author Michael Peters
+ * @author Christopher Johnson
  * @license GPL version 3
  */
 
diff --git a/src/customfield/SprintProjectCustomField.php 
b/src/customfield/SprintProjectCustomField.php
index 12e2831..7f921ce 100644
--- a/src/customfield/SprintProjectCustomField.php
+++ b/src/customfield/SprintProjectCustomField.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * @author Michael Peters
+ * @author Christopher Johnson
  * @license GPL version 3
  */
 
diff --git a/src/customfield/SprintTaskStoryPointsField.php 
b/src/customfield/SprintTaskStoryPointsField.php
index c0f81bf..9425eb5 100644
--- a/src/customfield/SprintTaskStoryPointsField.php
+++ b/src/customfield/SprintTaskStoryPointsField.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * @author Michael Peters
+ * @author Christopher Johnson
  * @license GPL version 3
  */
 
diff --git a/src/events/BurndownActionMenuEventListener.php 
b/src/events/BurndownActionMenuEventListener.php
index b9e7f79..e0b44ec 100644
--- a/src/events/BurndownActionMenuEventListener.php
+++ b/src/events/BurndownActionMenuEventListener.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * @author Michael Peters
+ * @author Christopher Johnson
  * @license GPL version 3
  */
 
diff --git a/src/util/BurndownDataDate.php b/src/util/BurndownDataDate.php
index 63c6883..6c736d6 100644
--- a/src/util/BurndownDataDate.php
+++ b/src/util/BurndownDataDate.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * @author Michael Peters
+ * @author Christopher Johnson
  * @license GPL version 3
  */
 

-- 
To view, visit https://gerrit.wikimedia.org/r/199864
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c405951419476503a02c17bb11fd443e9b04100
Gerrit-PatchSet: 2
Gerrit-Project: phabricator/extensions/Sprint
Gerrit-Branch: master
Gerrit-Owner: Christopher Johnson (WMDE) <christopher.john...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to