2015-07-24 21:51:30 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class ManiphestTaskAssignOtherHeraldAction
|
|
|
|
extends ManiphestTaskAssignHeraldAction {
|
|
|
|
|
|
|
|
const ACTIONCONST = 'maniphest.assign.other';
|
|
|
|
|
|
|
|
public function getHeraldActionName() {
|
|
|
|
return pht('Assign task to');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function supportsRuleType($rule_type) {
|
|
|
|
return ($rule_type != HeraldRuleTypeConfig::RULE_TYPE_PERSONAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function applyEffect($object, HeraldEffect $effect) {
|
|
|
|
return $this->applyAssign($effect->getTarget());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeraldActionStandardType() {
|
|
|
|
return self::STANDARD_PHID_LIST;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getDatasource() {
|
|
|
|
// TODO: Eventually, it would be nice to get "limit = 1" exported from here
|
|
|
|
// up to the UI.
|
2015-12-05 21:36:27 +01:00
|
|
|
return new ManiphestAssigneeDatasource();
|
2015-07-24 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function renderActionDescription($value) {
|
2015-12-05 21:36:27 +01:00
|
|
|
if (head($value) === PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN) {
|
|
|
|
return pht('Unassign task.');
|
|
|
|
} else {
|
|
|
|
return pht('Assign task to: %s.', $this->renderHandleList($value));
|
|
|
|
}
|
2015-07-24 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|