@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DiffusionAuditorsAddAuditorsHeraldAction
4 extends DiffusionAuditorsHeraldAction {
5
6 const ACTIONCONST = 'diffusion.auditors.add';
7
8 public function getHeraldActionName() {
9 return pht('Add auditors');
10 }
11
12 // hide "Add auditors" Herald action if Audit is disabled
13 public function supportsRuleType($rule_type) {
14 if (id(new PhabricatorAuditApplication())->isInstalled()) {
15 return ($rule_type != HeraldRuleTypeConfig::RULE_TYPE_PERSONAL);
16 } else {
17 return false;
18 }
19 }
20
21 public function applyEffect($object, HeraldEffect $effect) {
22 $rule = $effect->getRule();
23 return $this->applyAuditors($effect->getTarget(), $rule);
24 }
25
26 public function getHeraldActionStandardType() {
27 return self::STANDARD_PHID_LIST;
28 }
29
30 protected function getDatasource() {
31 return new DiffusionAuditorDatasource();
32 }
33
34 public function renderActionDescription($value) {
35 return pht('Add auditors: %s.', $this->renderHandleList($value));
36 }
37
38 public function getPHIDsAffectedByAction(HeraldActionRecord $record) {
39 return $record->getTarget();
40 }
41
42}