Add first valid expression ruler. Still not linked to scheduleds.

This commit is contained in:
osaajani 2019-11-27 06:25:33 +01:00
parent f59f7bd757
commit f4bbfa0152
16 changed files with 1049 additions and 18 deletions

View file

@ -131,7 +131,7 @@ namespace controllers\publics;
$name = $_POST['name'] ?? false;
$number = $_POST['number'] ?? false;
$id_user = $_SESSION['user']['id'];
$datas = empty($_POST['datas']) ? null : $_POST['datas'];
$datas = $_POST['datas'] ?? [];
if (!$name || !$number)
{
@ -162,7 +162,11 @@ namespace controllers\publics;
$key = mb_ereg_replace('[\W]', '', $key);
$clean_datas[$key] = (string) $value;
}
}
$clean_datas = $clean_datas ?: null;
if ($clean_datas)
{
$clean_datas = json_encode($clean_datas);
}
@ -206,7 +210,7 @@ namespace controllers\publics;
$name = $contact['name'] ?? false;
$number = $contact['number'] ?? false;
$id_user = $_SESSION['user']['id'];
$datas = empty($contact['datas']) ? null : $contact['datas'];
$datas = $contact['datas'] ?? null;
if (!$name || !$number)
{
@ -218,7 +222,7 @@ namespace controllers\publics;
{
continue;
}
$clean_datas = null;
if ($datas)
{
@ -233,9 +237,14 @@ namespace controllers\publics;
$key = mb_ereg_replace('[\W]', '', $key);
$clean_datas[$key] = (string) $value;
}
}
$clean_datas = $clean_datas ?: null;
if ($clean_datas)
{
$clean_datas = json_encode($clean_datas);
}
$nb_contacts_update += (int) $this->internal_contact->update_for_user($id_user, $id_contact, $number, $name, $clean_datas);
}