Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/storage/PhabricatorProjectColumn.php
Show All 21 Lines | final class PhabricatorProjectColumn | ||||
protected $properties = array(); | protected $properties = array(); | ||||
private $project = self::ATTACHABLE; | private $project = self::ATTACHABLE; | ||||
private $proxy = self::ATTACHABLE; | private $proxy = self::ATTACHABLE; | ||||
public static function initializeNewColumn(PhabricatorUser $user) { | public static function initializeNewColumn(PhabricatorUser $user) { | ||||
return id(new PhabricatorProjectColumn()) | return id(new PhabricatorProjectColumn()) | ||||
->setName('') | ->setName('') | ||||
->setStatus(self::STATUS_ACTIVE); | ->setStatus(self::STATUS_ACTIVE) | ||||
->attachProxy(null); | |||||
} | } | ||||
protected function getConfiguration() { | protected function getConfiguration() { | ||||
return array( | return array( | ||||
self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
self::CONFIG_SERIALIZATION => array( | self::CONFIG_SERIALIZATION => array( | ||||
'properties' => self::SERIALIZATION_JSON, | 'properties' => self::SERIALIZATION_JSON, | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | public function getPointLimit() { | ||||
return $this->getProperty('pointLimit'); | return $this->getProperty('pointLimit'); | ||||
} | } | ||||
public function setPointLimit($limit) { | public function setPointLimit($limit) { | ||||
$this->setProperty('pointLimit', $limit); | $this->setProperty('pointLimit', $limit); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getOrderingKey() { | |||||
$proxy = $this->getProxy(); | |||||
// Normal columns and subproject columns go first, in a user-controlled | |||||
// order. | |||||
// All the milestone columns go last, in their sequential order. | |||||
if (!$proxy || !$proxy->isMilestone()) { | |||||
$group = 'A'; | |||||
$sequence = $this->getSequence(); | |||||
} else { | |||||
$group = 'B'; | |||||
$sequence = $proxy->getMilestoneNumber(); | |||||
} | |||||
return sprintf('%s%012d', $group, $sequence); | |||||
} | |||||
/* -( PhabricatorApplicationTransactionInterface )------------------------- */ | /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | ||||
public function getApplicationTransactionEditor() { | public function getApplicationTransactionEditor() { | ||||
return new PhabricatorProjectColumnTransactionEditor(); | return new PhabricatorProjectColumnTransactionEditor(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |