@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Internalize Maniphest task status colors

Summary: Ref T1812. These are a bit fluff and don't make too much sense to make configurable, at least for now.

Test Plan: Grepped for external callers.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1812

Differential Revision: https://secure.phabricator.com/D8581

+8 -32
+8 -32
src/applications/maniphest/constants/ManiphestTaskStatus.php
··· 9 9 const STATUS_CLOSED_DUPLICATE = 4; 10 10 const STATUS_CLOSED_SPITE = 5; 11 11 12 - const COLOR_STATUS_OPEN = 'status'; 13 - const COLOR_STATUS_CLOSED = 'status-dark'; 14 - 15 12 public static function getTaskStatusMap() { 16 13 $open = pht('Open'); 17 14 $resolved = pht('Resolved'); ··· 60 57 return idx($map, $status, '???'); 61 58 } 62 59 63 - public static function getTaskStatusColor($status) { 64 - $default = self::COLOR_STATUS_OPEN; 65 - 66 - $map = array( 67 - self::STATUS_OPEN => self::COLOR_STATUS_OPEN, 68 - self::STATUS_CLOSED_RESOLVED => self::COLOR_STATUS_CLOSED, 69 - self::STATUS_CLOSED_WONTFIX => self::COLOR_STATUS_CLOSED, 70 - self::STATUS_CLOSED_INVALID => self::COLOR_STATUS_CLOSED, 71 - self::STATUS_CLOSED_DUPLICATE => self::COLOR_STATUS_CLOSED, 72 - self::STATUS_CLOSED_SPITE => self::COLOR_STATUS_CLOSED, 73 - ); 74 - return idx($map, $status, $default); 75 - } 76 - 77 - public static function getIcon($status) { 78 - $default = 'oh-open'; 79 - $map = array( 80 - self::STATUS_OPEN => 'oh-open', 81 - self::STATUS_CLOSED_RESOLVED => 'oh-closed-dark', 82 - self::STATUS_CLOSED_WONTFIX => 'oh-closed-dark', 83 - self::STATUS_CLOSED_INVALID => 'oh-closed-dark', 84 - self::STATUS_CLOSED_DUPLICATE => 'oh-closed-dark', 85 - self::STATUS_CLOSED_SPITE => 'oh-closed-dark', 86 - ); 87 - return idx($map, $status, $default); 88 - } 89 - 90 60 public static function renderFullDescription($status) { 91 - $color = self::getTaskStatusColor($status); 61 + if (self::isOpenStatus($status)) { 62 + $color = 'status'; 63 + $icon = 'oh-open'; 64 + } else { 65 + $color = 'status-dark'; 66 + $icon = 'oh-closed-dark'; 67 + } 92 68 93 69 $img = id(new PHUIIconView()) 94 70 ->setSpriteSheet(PHUIIconView::SPRITE_STATUS) 95 - ->setSpriteIcon(self::getIcon($status)); 71 + ->setSpriteIcon($icon); 96 72 97 73 $tag = phutil_tag( 98 74 'span',