Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/storage/ManiphestTask.php
Show First 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | public function getPriorityKeyword() { | ||||
$keyword = ManiphestTaskPriority::getKeywordForTaskPriority($priority); | $keyword = ManiphestTaskPriority::getKeywordForTaskPriority($priority); | ||||
if ($keyword !== null) { | if ($keyword !== null) { | ||||
return $keyword; | return $keyword; | ||||
} | } | ||||
return ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD; | return ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD; | ||||
} | } | ||||
private function comparePriorityTo(ManiphestTask $other) { | |||||
$upri = $this->getPriority(); | |||||
$vpri = $other->getPriority(); | |||||
if ($upri != $vpri) { | |||||
return ($upri - $vpri); | |||||
} | |||||
$usub = $this->getSubpriority(); | |||||
$vsub = $other->getSubpriority(); | |||||
if ($usub != $vsub) { | |||||
return ($usub - $vsub); | |||||
} | |||||
$uid = $this->getID(); | |||||
$vid = $other->getID(); | |||||
if ($uid != $vid) { | |||||
return ($uid - $vid); | |||||
} | |||||
return 0; | |||||
} | |||||
public function isLowerPriorityThan(ManiphestTask $other) { | |||||
return ($this->comparePriorityTo($other) < 0); | |||||
} | |||||
public function isHigherPriorityThan(ManiphestTask $other) { | |||||
return ($this->comparePriorityTo($other) > 0); | |||||
} | |||||
public function getWorkboardProperties() { | public function getWorkboardProperties() { | ||||
return array( | return array( | ||||
'status' => $this->getStatus(), | 'status' => $this->getStatus(), | ||||
'points' => (double)$this->getPoints(), | 'points' => (double)$this->getPoints(), | ||||
'priority' => $this->getPriority(), | 'priority' => $this->getPriority(), | ||||
); | ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | $status_info = array( | ||||
'value' => $status_value, | 'value' => $status_value, | ||||
'name' => ManiphestTaskStatus::getTaskStatusName($status_value), | 'name' => ManiphestTaskStatus::getTaskStatusName($status_value), | ||||
'color' => ManiphestTaskStatus::getStatusColor($status_value), | 'color' => ManiphestTaskStatus::getStatusColor($status_value), | ||||
); | ); | ||||
$priority_value = (int)$this->getPriority(); | $priority_value = (int)$this->getPriority(); | ||||
$priority_info = array( | $priority_info = array( | ||||
'value' => $priority_value, | 'value' => $priority_value, | ||||
'subpriority' => (double)$this->getSubpriority(), | |||||
'name' => ManiphestTaskPriority::getTaskPriorityName($priority_value), | 'name' => ManiphestTaskPriority::getTaskPriorityName($priority_value), | ||||
'color' => ManiphestTaskPriority::getTaskPriorityColor($priority_value), | 'color' => ManiphestTaskPriority::getTaskPriorityColor($priority_value), | ||||
); | ); | ||||
$closed_epoch = $this->getClosedEpoch(); | $closed_epoch = $this->getClosedEpoch(); | ||||
if ($closed_epoch !== null) { | if ($closed_epoch !== null) { | ||||
$closed_epoch = (int)$closed_epoch; | $closed_epoch = (int)$closed_epoch; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |