mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-30 05:16:28 +02:00
remplace les tests empty par isset pour éviter les erreurs si valeur = 0
This commit is contained in:
parent
15cd965580
commit
10262a7976
1 changed files with 3 additions and 3 deletions
|
@ -110,7 +110,7 @@
|
||||||
|
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
if (empty($_POST['name']) || empty($_POST['phone']) || (RASPISMS_SETTINGS_EXTENDED_CONTACTS_INFOS && empty($_POST['civility'])))
|
if (!isset($_POST['name']) || !isset($_POST['phone']) || (RASPISMS_SETTINGS_EXTENDED_CONTACTS_INFOS && !isset($_POST['civility'])))
|
||||||
{
|
{
|
||||||
$_SESSION['errormessage'] = 'Des champs sont manquants.';
|
$_SESSION['errormessage'] = 'Des champs sont manquants.';
|
||||||
header('Location: ' . $this->generateUrl('contacts', 'add'));
|
header('Location: ' . $this->generateUrl('contacts', 'add'));
|
||||||
|
@ -140,6 +140,8 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$id_contact = $db->lastId();
|
||||||
|
|
||||||
$db->insertIntoTable('events', ['type' => 'CONTACT_ADD', 'text' => 'Ajout contact : ' . $nomComplet . ' (' . internalTools::phoneAddSpace($phone) . ')']);
|
$db->insertIntoTable('events', ['type' => 'CONTACT_ADD', 'text' => 'Ajout contact : ' . $nomComplet . ' (' . internalTools::phoneAddSpace($phone) . ')']);
|
||||||
|
|
||||||
if (!RASPISMS_SETTINGS_EXTENDED_CONTACTS_INFOS)
|
if (!RASPISMS_SETTINGS_EXTENDED_CONTACTS_INFOS)
|
||||||
|
@ -149,8 +151,6 @@
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id_contact = $db->lastId();
|
|
||||||
|
|
||||||
if (!$db->insertIntoTable('contacts_infos', ['id_contact' => $id_contact, 'civility' => $civility, 'first_name' => $prenom, 'last_name' => $nom, 'birthday' => $birthday, 'love_situation' => $loveSituation]))
|
if (!$db->insertIntoTable('contacts_infos', ['id_contact' => $id_contact, 'civility' => $civility, 'first_name' => $prenom, 'last_name' => $nom, 'birthday' => $birthday, 'love_situation' => $loveSituation]))
|
||||||
{
|
{
|
||||||
$_SESSION['errormessage'] = "Le contact a bien été créé, mais certaines informations n'ont pas pu être enregistrées.";
|
$_SESSION['errormessage'] = "Le contact a bien été créé, mais certaines informations n'ont pas pu être enregistrées.";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue