Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/maniphest/herald/ManiphestTaskAssignOtherHeraldAction.php
12256 views
1
<?php
2
3
final class ManiphestTaskAssignOtherHeraldAction
4
extends ManiphestTaskAssignHeraldAction {
5
6
const ACTIONCONST = 'maniphest.assign.other';
7
8
public function getHeraldActionName() {
9
return pht('Assign task to');
10
}
11
12
public function supportsRuleType($rule_type) {
13
return ($rule_type != HeraldRuleTypeConfig::RULE_TYPE_PERSONAL);
14
}
15
16
public function applyEffect($object, HeraldEffect $effect) {
17
return $this->applyAssign($effect->getTarget());
18
}
19
20
public function getHeraldActionStandardType() {
21
return self::STANDARD_PHID_LIST;
22
}
23
24
protected function getDatasource() {
25
return id(new ManiphestAssigneeDatasource())
26
->setLimit(1);
27
}
28
29
public function renderActionDescription($value) {
30
if (head($value) === PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN) {
31
return pht('Unassign task.');
32
} else {
33
return pht('Assign task to: %s.', $this->renderHandleList($value));
34
}
35
}
36
37
}
38
39