Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php b/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php
index 3974851c0d..63121813bb 100644
--- a/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php
+++ b/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php
@@ -1,76 +1,70 @@
<?php
final class HarbormasterBuildableTransactionEditor
extends PhabricatorApplicationTransactionEditor {
public function getEditorApplicationClass() {
return 'PhabricatorHarbormasterApplication';
}
public function getEditorObjectsDescription() {
return pht('Harbormaster Buildables');
}
public function getTransactionTypes() {
$types = parent::getTransactionTypes();
- $types[] = HarbormasterBuildableTransaction::TYPE_CREATE;
$types[] = HarbormasterBuildableTransaction::TYPE_COMMAND;
return $types;
}
protected function getCustomTransactionOldValue(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case HarbormasterBuildableTransaction::TYPE_CREATE:
case HarbormasterBuildableTransaction::TYPE_COMMAND:
return null;
}
return parent::getCustomTransactionOldValue($object, $xaction);
}
protected function getCustomTransactionNewValue(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case HarbormasterBuildableTransaction::TYPE_CREATE:
- return true;
case HarbormasterBuildableTransaction::TYPE_COMMAND:
return $xaction->getNewValue();
}
return parent::getCustomTransactionNewValue($object, $xaction);
}
protected function applyCustomInternalTransaction(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case HarbormasterBuildableTransaction::TYPE_CREATE:
case HarbormasterBuildableTransaction::TYPE_COMMAND:
return;
}
return parent::applyCustomInternalTransaction($object, $xaction);
}
protected function applyCustomExternalTransaction(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case HarbormasterBuildableTransaction::TYPE_CREATE:
case HarbormasterBuildableTransaction::TYPE_COMMAND:
return;
}
return parent::applyCustomExternalTransaction($object, $xaction);
}
}
diff --git a/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php b/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php
index 0d7ab76e19..a4a2f1ab14 100644
--- a/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php
+++ b/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php
@@ -1,93 +1,84 @@
<?php
final class HarbormasterBuildableTransaction
extends PhabricatorApplicationTransaction {
- const TYPE_CREATE = 'harbormaster:buildable:create';
const TYPE_COMMAND = 'harbormaster:buildable:command';
public function getApplicationName() {
return 'harbormaster';
}
public function getApplicationTransactionType() {
return HarbormasterBuildablePHIDType::TYPECONST;
}
public function getTitle() {
$author_phid = $this->getAuthorPHID();
$old = $this->getOldValue();
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case self::TYPE_CREATE:
- return pht(
- '%s created this buildable.',
- $this->renderHandleLink($author_phid));
case self::TYPE_COMMAND:
switch ($new) {
case HarbormasterBuildMessageRestartTransaction::MESSAGETYPE:
return pht(
'%s restarted this buildable.',
$this->renderHandleLink($author_phid));
case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE:
return pht(
'%s resumed this buildable.',
$this->renderHandleLink($author_phid));
case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE:
return pht(
'%s paused this buildable.',
$this->renderHandleLink($author_phid));
case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE:
return pht(
'%s aborted this buildable.',
$this->renderHandleLink($author_phid));
}
}
return parent::getTitle();
}
public function getIcon() {
$author_phid = $this->getAuthorPHID();
$old = $this->getOldValue();
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case self::TYPE_CREATE:
- return 'fa-plus';
case self::TYPE_COMMAND:
switch ($new) {
case HarbormasterBuildMessageRestartTransaction::MESSAGETYPE:
return 'fa-backward';
case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE:
return 'fa-play';
case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE:
return 'fa-pause';
case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE:
return 'fa-exclamation-triangle';
}
}
return parent::getIcon();
}
public function getColor() {
$author_phid = $this->getAuthorPHID();
$old = $this->getOldValue();
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case self::TYPE_CREATE:
- return 'green';
case self::TYPE_COMMAND:
switch ($new) {
case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE:
return 'red';
}
}
return parent::getColor();
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Nov 24, 8:46 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1071
Default Alt Text
(5 KB)

Event Timeline