activity-stream entries for spawn and native-recurrence self-disable v1.5
This commit is contained in:
@@ -83,10 +83,18 @@ class RecoRecoModel extends Base
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Native wins: if the card became native-recurring, RecoReco yields (decision 13).
|
||||
// Native wins: if the card became native-recurring, RecoReco yields (decision 13). Leave a
|
||||
// visible trail in the task's activity stream (creator_id 0 = system action).
|
||||
if ($task['recurrence_status'] != TaskModel::RECURRING_STATUS_NONE) {
|
||||
$this->taskMetadataModel->save($task_id, array('recoreco_enabled' => 0));
|
||||
$this->logger->info('RecoReco: disabled on task '.$task_id.' (now native-recurring)');
|
||||
$this->projectActivityModel->createEvent(
|
||||
(int) $task['project_id'],
|
||||
$task_id,
|
||||
0,
|
||||
'recoreco.task.disable',
|
||||
array('task' => array('id' => $task_id, 'title' => $task['title']))
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -252,6 +260,19 @@ class RecoRecoModel extends Base
|
||||
$payload = array('source_task_id' => (int) $template['id'], 'new_task_id' => (int) $newId);
|
||||
$this->hook->reference('recoreco:task:spawned', $payload);
|
||||
|
||||
// Record the spawn in the clone's activity stream (creator_id 0 = system action).
|
||||
$this->projectActivityModel->createEvent(
|
||||
(int) $template['project_id'],
|
||||
$newId,
|
||||
0,
|
||||
'recoreco.task.spawn',
|
||||
array(
|
||||
'task' => array('id' => $newId, 'title' => $template['title']),
|
||||
'template_id' => (int) $template['id'],
|
||||
'template_title' => $template['title'],
|
||||
)
|
||||
);
|
||||
|
||||
return $newId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user