Line 64... |
Line 64... |
64 |
$project_id = $resultat[0]['idprojet'];
|
64 |
$project_id = $resultat[0]['idprojet'];
|
65 |
if (array_diff_key($this->champs_defaut_valeur, $parametres)) {
|
65 |
if (array_diff_key($this->champs_defaut_valeur, $parametres)) {
|
66 |
$parametres = array_merge($parametres, array_diff_key($this->champs_defaut_valeur, $parametres));
|
66 |
$parametres = array_merge($parametres, array_diff_key($this->champs_defaut_valeur, $parametres));
|
67 |
}
|
67 |
}
|
68 |
$requete_insertion = 'INSERT INTO project_settings '.
|
68 |
$requete_insertion = 'INSERT INTO project_settings '.
|
69 |
'(project_id, '.implode(array_keys($parametres), ', ').') VALUES ("'.$project_id.'", "'.implode($parametres, '", "').'")';
|
69 |
'(project_id, '.implode(array_keys($parametres), ', ').') VALUES ("'.$project_id.'", '.implode(Cel::db()->proteger($parametres), ', ').'")';
|
70 |
$requete_insertion = str_replace('"CURRENT_TIMESTAMP"', 'CURRENT_TIMESTAMP', $requete_insertion);
|
70 |
$requete_insertion = str_replace("'CURRENT_TIMESTAMP'", 'CURRENT_TIMESTAMP', $requete_insertion);
|
71 |
$resultat_ajout = Cel::db()->executer($requete_insertion);
|
71 |
$resultat_ajout = Cel::db()->executer($requete_insertion);
|
72 |
$retour = true;
|
72 |
$retour = true;
|
73 |
if ($resultat_ajout === false) {
|
73 |
if ($resultat_ajout === false) {
|
74 |
$retour = false;
|
74 |
$retour = false;
|
75 |
$msg = "Erreur de creation d'un widget : $resultat_ajout";
|
75 |
$msg = "Erreur de creation d'un widget : $resultat_ajout";
|