diff --git a/src/customfield/SprintBeginDateField.php b/src/customfield/SprintBeginDateField.php index dcfe98786a588ddb8501db33ead539fdddb5e36b..439d9f7d575f3af8169e0c63349f225b2da4d87c 100644 --- a/src/customfield/SprintBeginDateField.php +++ b/src/customfield/SprintBeginDateField.php @@ -20,6 +20,10 @@ final class SprintBeginDateField extends SprintProjectCustomField { return 'isdc:sprint:startdate'; } + public function getModernFieldKey() { + return 'startdate'; + } + public function getFieldName() { return 'Sprint Start Date'; } diff --git a/src/storage/BoardDataProvider.php b/src/storage/BoardDataProvider.php index 3a3729e7f84617019edb8dd2b45319069f58ebb2..5efe05e7ec961be8eae1f360986233f1db06ab88 100644 --- a/src/storage/BoardDataProvider.php +++ b/src/storage/BoardDataProvider.php @@ -168,7 +168,7 @@ final class BoardDataProvider { $scope_phid = $this->project->getPHID(); $task_phids = mpull($this->tasks, 'getPHID'); $query = new ManiphestTransactionQuery(); - $query->withTransactionTypes(array(ManiphestTransaction::TYPE_PROJECT_COLUMN)); + $query->withTransactionTypes(array(PhabricatorTransactions::TYPE_COLUMNS)); $query->withObjectPHIDs($task_phids); $query->setViewer($this->viewer); $col_xactions = $query->execute(); @@ -176,9 +176,10 @@ final class BoardDataProvider { $xaction_date = $xaction->getDateCreated(); if ($xaction_date >= $this->start && $xaction_date <= $this->end) { $newval = $xaction->getNewValue(); - if ($newval['projectPHID'] == $scope_phid) { - $xactions[] = $xaction; - } + $newArr = call_user_func_array('array_merge', $newval); + if ($newArr['boardPHID'] == $scope_phid) { + $xactions[] = $xaction; + } } } return $xactions; diff --git a/src/storage/SprintColumnTransaction.php b/src/storage/SprintColumnTransaction.php index cfbfa0943f96a617093248d7981b691767dc4f3e..a5de31f7d60fe82b6316ee7de9c57c56241c4f4f 100644 --- a/src/storage/SprintColumnTransaction.php +++ b/src/storage/SprintColumnTransaction.php @@ -63,7 +63,7 @@ final class SprintColumnTransaction { break; case 'reopen': $this->reopenedTasksToday($date, $dates); - $this->reopenedPointsToday($date, $points, $dates); + // $this->reopenedPointsToday($date, $points, $dates); break; } } @@ -91,24 +91,25 @@ final class SprintColumnTransaction { } private function setXActionEventType($old_col_name, $new_col_name) { - $old_is_closed = ($old_col_name === null) || - SprintConstants::TYPE_CLOSED_STATUS_COLUMN == $old_col_name; + $old_is_closed = ($old_col_name = SprintConstants::TYPE_CLOSED_STATUS_COLUMN and $new_col_name != SprintConstants::TYPE_CLOSED_STATUS_COLUMN); if ($old_is_closed) { return 'reopen'; - } else { + } else if ($new_col_name) { switch ($new_col_name) { - case SprintConstants::TYPE_CLOSED_STATUS_COLUMN: - return 'close'; - case SprintConstants::TYPE_REVIEW_STATUS_COLUMN: - return 'review'; - case SprintConstants::TYPE_DOING_STATUS_COLUMN: - return 'doing'; - case SprintConstants::TYPE_BACKLOG_STATUS_COLUMN: - return 'backlog'; - default: - break; + case SprintConstants::TYPE_CLOSED_STATUS_COLUMN: + return 'close'; + case SprintConstants::TYPE_REVIEW_STATUS_COLUMN: + return 'review'; + case SprintConstants::TYPE_DOING_STATUS_COLUMN: + return 'doing'; + case SprintConstants::TYPE_BACKLOG_STATUS_COLUMN: + return 'backlog'; + default: + break; } + } else { + return null; } } @@ -118,22 +119,28 @@ final class SprintColumnTransaction { $new_col_name = null; $events = array(); foreach ($xactions as $xaction) { - $old_col_phid = idx($xaction->getOldValue(), 'columnPHIDs'); - foreach ($old_col_phid as $phid) { - $old_col = $this->query->getColumnforPHID($phid); - foreach ($old_col as $obj) { - $old_col_name = $obj->getDisplayName(); + $oldval = $xaction->getOldValue(); + if (!empty($oldval)) { + $newArr = call_user_func_array('array_merge', $oldval); + $old_col_phid = idx($newArr, 'columnPHID'); + foreach ($old_col_phid as $phid) { + $old_col = $this->query->getColumnforPHID($phid); + foreach ($old_col as $obj) { + $old_col_name = $obj->getDisplayName(); + } } } - $new_col_phid = idx($xaction->getNewValue(), 'columnPHIDs'); - foreach ($new_col_phid as $phid) { - $new_col = $this->query->getColumnforPHID($phid); - foreach ($new_col as $obj) { - $new_col_name = $obj->getDisplayName(); - } + $newval = $xaction->getNewValue(); + if (!empty($newval)) { + $newArr = call_user_func_array('array_merge', $newval); + $new_col_phid = idx($newArr, 'columnPHID'); + $xaction_scope_phid = idx($newArr, 'boardPHID'); + $new_col = $this->query->getColumnforPHID($new_col_phid); + foreach ($new_col as $obj) { + $new_col_name = $obj->getDisplayName(); + } } $scope_phid = $this->project->getPHID(); - $xaction_scope_phid = idx($xaction->getNewValue(), 'projectPHID'); if ($scope_phid == $xaction_scope_phid) { $event_type = $this->setXActionEventType($old_col_name, $new_col_name); if ($event_type !== null) { diff --git a/src/view/burndown/SprintDataView.php b/src/view/burndown/SprintDataView.php index 4b4b06d0d2b41dd26f7970ec62aab48532e3a94d..67b1d37e62f65e0cf9f2f36cb5955396c6569cd9 100644 --- a/src/view/burndown/SprintDataView.php +++ b/src/view/burndown/SprintDataView.php @@ -19,7 +19,7 @@ final class SprintDataView extends SprintView { return $this; } - public function setViewer($viewer) { + public function setViewer(PhabricatorUser $viewer) { $this->viewer = $viewer; return $this; }