Changeset View
Changeset View
Standalone View
Standalone View
src/ref/revision/ArcanistRevisionRef.php
| Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | $color_map = array( | ||||
| 'published' => 'cyan', | 'published' => 'cyan', | ||||
| 'abandoned' => null, | 'abandoned' => null, | ||||
| 'changes-planned' => 'red', | 'changes-planned' => 'red', | ||||
| ); | ); | ||||
| $status_value = idx($value_map, idx($dict, 'status')); | $status_value = idx($value_map, idx($dict, 'status')); | ||||
| $ansi_color = idx($color_map, $status_value); | $ansi_color = idx($color_map, $status_value); | ||||
| $date_created = null; | |||||
| if (isset($dict['dateCreated'])) { | |||||
| $date_created = (int)$dict['dateCreated']; | |||||
| } | |||||
| $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, | 'value' => $status_value, | ||||
| 'color.ansi' => $ansi_color, | 'color.ansi' => $ansi_color, | ||||
| ), | ), | ||||
| 'dateCreated' => $date_created, | |||||
| ); | ); | ||||
| return self::newFromConduit($dict); | return self::newFromConduit($dict); | ||||
| } | } | ||||
| public function getMonogram() { | public function getMonogram() { | ||||
| return 'D'.$this->getID(); | return 'D'.$this->getID(); | ||||
| } | } | ||||
| public function getStatusShortDisplayName() { | public function getStatusShortDisplayName() { | ||||
| if ($this->isStatusNeedsReview()) { | if ($this->isStatusNeedsReview()) { | ||||
| return pht('Review'); | return pht('Review'); | ||||
| } | } | ||||
| return idxv($this->parameters, array('fields', 'status', 'name')); | return idxv($this->parameters, array('fields', 'status', 'name')); | ||||
| } | } | ||||
| public function getStatusDisplayName() { | public function getStatusDisplayName() { | ||||
| return idxv($this->parameters, array('fields', 'status', 'name')); | return idxv($this->parameters, array('fields', 'status', 'name')); | ||||
| } | } | ||||
| public function getStatusANSIColor() { | public function getStatusANSIColor() { | ||||
| return idxv($this->parameters, array('fields', 'status', 'color.ansi')); | return idxv($this->parameters, array('fields', 'status', 'color.ansi')); | ||||
| } | } | ||||
| public function getDateCreated() { | |||||
| return idxv($this->parameters, array('fields', 'dateCreated')); | |||||
| } | |||||
| public function isStatusChangesPlanned() { | public function isStatusChangesPlanned() { | ||||
| $status = $this->getStatus(); | $status = $this->getStatus(); | ||||
| return ($status === 'changes-planned'); | return ($status === 'changes-planned'); | ||||
| } | } | ||||
| public function isStatusAbandoned() { | public function isStatusAbandoned() { | ||||
| $status = $this->getStatus(); | $status = $this->getStatus(); | ||||
| return ($status === 'abandoned'); | return ($status === 'abandoned'); | ||||
| ▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines | |||||