function(array $cfg)
{
if ( $this->db->insert('bbn_tasks', [
'title' => $cfg['title'],
'type' => $cfg['type'],
'priority' => $cfg['priority'] ?? 5,
'id_parent' => $cfg['id_parent'] ?? NULL,
'id_alias' => $cfg['id_alias'] ?? NULL,
'deadline' => $cfg['deadline'] ?? NULL,
'id_user' => $this->id_user ?: NULL,
'state' => $cfg['state'] ?? $this->idState('opened'),
'creation_date' => $this->date ?: date('Y-m-d H:i:s')
]) ){
$id = $this->db->lastId();
$this->addLog($id, 'insert');
$this->addRole($id, 'managers');
/*
$subject = "Nouveau bug posté par {$this->user}";
$text = "{$this->user} a posté un nouveau bug
".
"$title
".
"".nl2br($text)."
".
"Rendez-vous dans votre interface APST pour lui répondre
";
$this->email($id, $subject, $text);
*/
return $id;
}
}
return false;
}