Changeset View
Changeset View
Standalone View
Standalone View
src/ref/revision/ArcanistRevisionRef.php
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | switch ($status_name) { | ||||
| case 'Closed': | case 'Closed': | ||||
| $is_closed = true; | $is_closed = true; | ||||
| break; | break; | ||||
| default: | default: | ||||
| $is_closed = false; | $is_closed = false; | ||||
| break; | break; | ||||
| } | } | ||||
| $value_map = array( | |||||
| '0' => 'needs-review', | |||||
| '1' => 'needs-revision', | |||||
| '2' => 'accepted', | |||||
| '3' => 'published', | |||||
| '4' => 'abandoned', | |||||
| '5' => 'changes-planned', | |||||
| ); | |||||
| $color_map = array( | |||||
| 'needs-review' => 'magenta', | |||||
| 'needs-revision' => 'red', | |||||
| 'accepted' => 'green', | |||||
| 'published' => 'cyan', | |||||
| 'abandoned' => null, | |||||
| 'changes-planned' => 'red', | |||||
| ); | |||||
| $status_value = idx($value_map, idx($dict, 'status')); | |||||
| $ansi_color = idx($color_map, $status_value); | |||||
| $dict['fields'] = array( | $dict['fields'] = array( | ||||
| 'uri' => idx($dict, 'uri'), | 'uri' => idx($dict, 'uri'), | ||||
| 'title' => idx($dict, 'title'), | 'title' => idx($dict, 'title'), | ||||
| 'authorPHID' => idx($dict, 'authorPHID'), | 'authorPHID' => idx($dict, 'authorPHID'), | ||||
| 'status' => array( | 'status' => array( | ||||
| 'name' => $status_name, | 'name' => $status_name, | ||||
| 'closed' => $is_closed, | 'closed' => $is_closed, | ||||
| 'value' => $status_value, | |||||
| 'color.ansi' => $ansi_color, | |||||
| ), | ), | ||||
| ); | ); | ||||
| return self::newFromConduit($dict); | return self::newFromConduit($dict); | ||||
| } | } | ||||
| public function getMonogram() { | public function getMonogram() { | ||||
| return 'D'.$this->getID(); | return 'D'.$this->getID(); | ||||
| ▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines | |||||