Differential D25078 Diff 1219 src/applications/project/trigger/PhabricatorProjectTriggerRemoveProjectsRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/trigger/PhabricatorProjectTriggerRemoveProjectsRule.php
<?php | <?php | ||||
final class PhabricatorProjectTriggerRemoveProjectsRule | final class PhabricatorProjectTriggerRemoveProjectsRule | ||||
extends PhabricatorProjectTriggerRule { | extends PhabricatorProjectTriggerRule { | ||||
const TRIGGERTYPE = 'task.projects.remove'; | const TRIGGERTYPE = 'task.projects.remove'; | ||||
public function getSelectControlname() { | public function getSelectControlname() { | ||||
return pht('Remove project tags'); | return pht('Remove Project Tags'); | ||||
} | } | ||||
protected function getValueForEditorField() { | protected function getValueForEditorField() { | ||||
return $this->getDatasource()->getWireTokens($this->getValue()); | return $this->getDatasource()->getWireTokens($this->getValue()); | ||||
} | } | ||||
protected function assertValidRuleRecordFormat($value) { | protected function assertValidRuleRecordFormat($value) { | ||||
if (!is_array($value)) { | if (!is_array($value)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Remove project rule value should be a list, but is not '. | 'Remove Project Rule value should be a list, but is not '. | ||||
'(value is "%s").', | '(value is "%s").', | ||||
phutil_describe_type($value))); | phutil_describe_type($value))); | ||||
} | } | ||||
} | } | ||||
protected function assertValidRuleRecordValue($value) { | protected function assertValidRuleRecordValue($value) { | ||||
if (!$value) { | if (!$value) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'You must select at least one project tag to remove.')); | 'You must select at least one Project Tag to remove.')); | ||||
} | } | ||||
} | } | ||||
protected function newDropTransactions($object, $value) { | protected function newDropTransactions($object, $value) { | ||||
$project_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; | $project_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; | ||||
$xaction = $object->getApplicationTransactionTemplate() | $xaction = $object->getApplicationTransactionTemplate() | ||||
->setTransactionType(PhabricatorTransactions::TYPE_EDGE) | ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | final class PhabricatorProjectTriggerRemoveProjectsRule | ||||
} | } | ||||
public function getRuleViewLabel() { | public function getRuleViewLabel() { | ||||
return pht('Remove Project Tags'); | return pht('Remove Project Tags'); | ||||
} | } | ||||
public function getRuleViewDescription($value) { | public function getRuleViewDescription($value) { | ||||
return pht( | return pht( | ||||
'Remove project tags: %s.', | 'Remove Project Tags: %s.', | ||||
phutil_tag( | phutil_tag( | ||||
'strong', | 'strong', | ||||
array(), | array(), | ||||
$this->getViewer() | $this->getViewer() | ||||
->renderHandleList($value) | ->renderHandleList($value) | ||||
->setAsInline(true) | ->setAsInline(true) | ||||
->render())); | ->render())); | ||||
} | } | ||||
Show All 9 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0