From aa6c993848797d792a886b4a570f20ca897ade7e Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 9 Feb 2016 04:28:22 -0800 Subject: [PATCH] Fix two minor points UI issues Summary: Ref T4427. - When points are configured, show them on the task detail page (just a simple property, at least for now). - Typecast points better to avoid "joe changed points from 12 to 12." beacuse we compare the stored value (as a string) to the new value (as a double). Test Plan: - Saw points on detail view. - Created task with points, then edited it without touching points. No more spurious "changed from 12 to 12" transaction. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4427 Differential Revision: https://secure.phabricator.com/D15223 --- .../controller/ManiphestTaskDetailController.php | 9 +++++++++ .../maniphest/editor/ManiphestTransactionEditor.php | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php index 6ca5ab2946..a15b8f4594 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -229,6 +229,15 @@ final class ManiphestTaskDetailController extends ManiphestController { $view->addProperty(pht('Author'), $author); + if (ManiphestTaskPoints::getIsEnabled()) { + $points = $task->getPoints(); + if ($points !== null) { + $view->addProperty( + ManiphestTaskPoints::getPointsLabel(), + $task->getPoints()); + } + } + $source = $task->getOriginalEmailSource(); if ($source) { $subject = '[T'.$task->getID().'] '.$task->getTitle(); diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php index 073bf87bea..922317b206 100644 --- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php +++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php @@ -71,7 +71,11 @@ final class ManiphestTransactionEditor case ManiphestTransaction::TYPE_COVER_IMAGE: return $object->getCoverImageFilePHID(); case ManiphestTransaction::TYPE_POINTS: - return $object->getPoints(); + $points = $object->getPoints(); + if ($points !== null) { + $points = (double)$points; + } + return $points; case ManiphestTransaction::TYPE_MERGED_INTO: case ManiphestTransaction::TYPE_MERGED_FROM: return null;