Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | foreach ($effects as $effect) { | ||||
foreach ($effect->getTarget() as $phid) { | foreach ($effect->getTarget() as $phid) { | ||||
$this->ccPHIDs[] = $phid; | $this->ccPHIDs[] = $phid; | ||||
} | } | ||||
$result[] = new HeraldApplyTranscript( | $result[] = new HeraldApplyTranscript( | ||||
$effect, | $effect, | ||||
true, | true, | ||||
pht('Added addresses to cc list.')); | pht('Added addresses to cc list.')); | ||||
break; | break; | ||||
case self::ACTION_EMAIL: | |||||
$result[] = $this->applyEmailEffect($effect); | |||||
break; | |||||
case self::ACTION_FLAG: | |||||
$result[] = parent::applyFlagEffect( | |||||
$effect, | |||||
$this->getTask()->getPHID()); | |||||
break; | |||||
case self::ACTION_ASSIGN_TASK: | case self::ACTION_ASSIGN_TASK: | ||||
$target_array = $effect->getTarget(); | $target_array = $effect->getTarget(); | ||||
$assign_phid = reset($target_array); | $assign_phid = reset($target_array); | ||||
$this->setAssignPHID($assign_phid); | $this->setAssignPHID($assign_phid); | ||||
$result[] = new HeraldApplyTranscript( | $result[] = new HeraldApplyTranscript( | ||||
$effect, | $effect, | ||||
true, | true, | ||||
pht('Assigned task.')); | pht('Assigned task.')); | ||||
break; | break; | ||||
case self::ACTION_ADD_PROJECTS: | case self::ACTION_ADD_PROJECTS: | ||||
foreach ($effect->getTarget() as $phid) { | foreach ($effect->getTarget() as $phid) { | ||||
$this->projectPHIDs[] = $phid; | $this->projectPHIDs[] = $phid; | ||||
} | } | ||||
$result[] = new HeraldApplyTranscript( | $result[] = new HeraldApplyTranscript( | ||||
$effect, | $effect, | ||||
true, | true, | ||||
pht('Added projects.')); | pht('Added projects.')); | ||||
break; | break; | ||||
default: | default: | ||||
$custom_result = parent::handleCustomHeraldEffect($effect); | $result[] = $this->applyStandardEffect($effect); | ||||
if ($custom_result === null) { | |||||
throw new Exception(pht( | |||||
"No rules to handle action '%s'.", | |||||
$action)); | |||||
} | |||||
$result[] = $custom_result; | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return $result; | return $result; | ||||
} | } | ||||
protected function getCustomFieldTemplateObject() { | protected function getCustomFieldTemplateObject() { | ||||
return new ManiphestTask(); | return new ManiphestTask(); | ||||
} | } | ||||
} | } |