Differential D11870 Diff 34163 src/applications/harbormaster/storage/HarbormasterBuildTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/HarbormasterBuildTransaction.php
Show All 25 Lines | switch ($this->getTransactionType()) { | ||||
'%s created this build.', | '%s created this build.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case self::TYPE_COMMAND: | case self::TYPE_COMMAND: | ||||
switch ($new) { | switch ($new) { | ||||
case HarbormasterBuildCommand::COMMAND_RESTART: | case HarbormasterBuildCommand::COMMAND_RESTART: | ||||
return pht( | return pht( | ||||
'%s restarted this build.', | '%s restarted this build.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case HarbormasterBuildCommand::COMMAND_ABORT: | |||||
return pht( | |||||
'%s aborted this build.', | |||||
$this->renderHandleLink($author_phid)); | |||||
case HarbormasterBuildCommand::COMMAND_RESUME: | case HarbormasterBuildCommand::COMMAND_RESUME: | ||||
return pht( | return pht( | ||||
'%s resumed this build.', | '%s resumed this build.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case HarbormasterBuildCommand::COMMAND_STOP: | case HarbormasterBuildCommand::COMMAND_PAUSE: | ||||
return pht( | return pht( | ||||
'%s stopped this build.', | '%s paused this build.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
} | } | ||||
} | } | ||||
return parent::getTitle(); | return parent::getTitle(); | ||||
} | } | ||||
public function getIcon() { | public function getIcon() { | ||||
$author_phid = $this->getAuthorPHID(); | $author_phid = $this->getAuthorPHID(); | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_CREATE: | case self::TYPE_CREATE: | ||||
return 'fa-plus'; | return 'fa-plus'; | ||||
case self::TYPE_COMMAND: | case self::TYPE_COMMAND: | ||||
switch ($new) { | switch ($new) { | ||||
case HarbormasterBuildCommand::COMMAND_RESTART: | case HarbormasterBuildCommand::COMMAND_RESTART: | ||||
return 'fa-backward'; | return 'fa-backward'; | ||||
case HarbormasterBuildCommand::COMMAND_RESUME: | case HarbormasterBuildCommand::COMMAND_RESUME: | ||||
return 'fa-play'; | return 'fa-play'; | ||||
case HarbormasterBuildCommand::COMMAND_STOP: | case HarbormasterBuildCommand::COMMAND_PAUSE: | ||||
return 'fa-stop'; | return 'fa-pause'; | ||||
case HarbormasterBuildCommand::COMMAND_ABORT: | |||||
return 'fa-exclamation-triangle'; | |||||
} | } | ||||
} | } | ||||
return parent::getIcon(); | return parent::getIcon(); | ||||
} | } | ||||
public function getColor() { | public function getColor() { | ||||
$author_phid = $this->getAuthorPHID(); | $author_phid = $this->getAuthorPHID(); | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_CREATE: | case self::TYPE_CREATE: | ||||
return 'green'; | return 'green'; | ||||
case self::TYPE_COMMAND: | case self::TYPE_COMMAND: | ||||
switch ($new) { | switch ($new) { | ||||
case HarbormasterBuildCommand::COMMAND_STOP: | case HarbormasterBuildCommand::COMMAND_PAUSE: | ||||
case HarbormasterBuildCommand::COMMAND_ABORT: | |||||
return 'red'; | return 'red'; | ||||
} | } | ||||
} | } | ||||
return parent::getColor(); | return parent::getColor(); | ||||
} | } | ||||
} | } |