mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
f6f9d78f3a
Summary: Ref T5861. Currently, mail tags are hard-coded; move them into applications. Each Editor defines its own tags. This has zero impact on the UI or behavior. Test Plan: - Checked/unchecked some options, saved form. - Swapped back to `master` and saw exactly the same values. Reviewers: chad, btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T5861 Differential Revision: https://secure.phabricator.com/D10238
62 lines
1.5 KiB
PHP
62 lines
1.5 KiB
PHP
<?php
|
|
|
|
final class HeraldRuleEditor
|
|
extends PhabricatorApplicationTransactionEditor {
|
|
|
|
public function getEditorApplicationClass() {
|
|
return 'PhabricatorHeraldApplication';
|
|
}
|
|
|
|
public function getEditorObjectsDescription() {
|
|
return pht('Herald Rules');
|
|
}
|
|
|
|
public function getTransactionTypes() {
|
|
$types = parent::getTransactionTypes();
|
|
|
|
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
|
$types[] = HeraldRuleTransaction::TYPE_DISABLE;
|
|
|
|
return $types;
|
|
}
|
|
|
|
protected function getCustomTransactionOldValue(
|
|
PhabricatorLiskDAO $object,
|
|
PhabricatorApplicationTransaction $xaction) {
|
|
|
|
switch ($xaction->getTransactionType()) {
|
|
case HeraldRuleTransaction::TYPE_DISABLE:
|
|
return (int)$object->getIsDisabled();
|
|
}
|
|
|
|
}
|
|
|
|
protected function getCustomTransactionNewValue(
|
|
PhabricatorLiskDAO $object,
|
|
PhabricatorApplicationTransaction $xaction) {
|
|
|
|
switch ($xaction->getTransactionType()) {
|
|
case HeraldRuleTransaction::TYPE_DISABLE:
|
|
return (int)$xaction->getNewValue();
|
|
}
|
|
|
|
}
|
|
|
|
protected function applyCustomInternalTransaction(
|
|
PhabricatorLiskDAO $object,
|
|
PhabricatorApplicationTransaction $xaction) {
|
|
|
|
switch ($xaction->getTransactionType()) {
|
|
case HeraldRuleTransaction::TYPE_DISABLE:
|
|
return $object->setIsDisabled($xaction->getNewValue());
|
|
}
|
|
|
|
}
|
|
|
|
protected function applyCustomExternalTransaction(
|
|
PhabricatorLiskDAO $object,
|
|
PhabricatorApplicationTransaction $xaction) {
|
|
return;
|
|
}
|
|
|
|
}
|