Differential D21692 Diff 51705 src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php
Show All 21 Lines | public function getTitle() { | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_CREATE: | case self::TYPE_CREATE: | ||||
return pht( | return pht( | ||||
'%s created this buildable.', | '%s created this buildable.', | ||||
$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 HarbormasterBuildMessageRestartTransaction::MESSAGETYPE: | ||||
return pht( | return pht( | ||||
'%s restarted this buildable.', | '%s restarted this buildable.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case HarbormasterBuildCommand::COMMAND_RESUME: | case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE: | ||||
return pht( | return pht( | ||||
'%s resumed this buildable.', | '%s resumed this buildable.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case HarbormasterBuildCommand::COMMAND_PAUSE: | case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE: | ||||
return pht( | return pht( | ||||
'%s paused this buildable.', | '%s paused this buildable.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE: | |||||
return pht( | |||||
'%s aborted this buildable.', | |||||
$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 HarbormasterBuildMessageRestartTransaction::MESSAGETYPE: | ||||
return 'fa-backward'; | return 'fa-backward'; | ||||
case HarbormasterBuildCommand::COMMAND_RESUME: | case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE: | ||||
return 'fa-play'; | return 'fa-play'; | ||||
case HarbormasterBuildCommand::COMMAND_PAUSE: | case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE: | ||||
return 'fa-pause'; | return 'fa-pause'; | ||||
case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE: | |||||
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_PAUSE: | case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE: | ||||
return 'red'; | return 'red'; | ||||
} | } | ||||
} | } | ||||
return parent::getColor(); | return parent::getColor(); | ||||
} | } | ||||
} | } |