Ajout du dossier receiveds au git, fix du scheduleds update et create, ajout default 0 sur le scheduleds:progress

This commit is contained in:
Pierre-Lin Bonnemaison 2015-08-09 22:50:10 +02:00
parent 1dda3958d9
commit 6861214501
3 changed files with 8 additions and 3 deletions

View File

@ -165,7 +165,7 @@
return false; return false;
} }
if (!$db->createScheduleds($date, $content)) if (!$db->insertIntoTable('scheduleds', ['at' => $date, 'content' => $content, 'progress' => false]))
{ {
if (!$api) if (!$api)
{ {
@ -259,7 +259,12 @@
//Si la date fournie est passée, on la change pour dans 2 minutes //Si la date fournie est passée, on la change pour dans 2 minutes
$objectDate = DateTime::createFromFormat('Y-m-d H:i', $date); $objectDate = DateTime::createFromFormat('Y-m-d H:i', $date);
$db->updateTableWhere('scheduleds', ['content' => $scheduled['content'], 'date' => $date], ['id' => $id_scheduled]); //On met à jour le sms if (!$db->updateTableWhere('scheduleds', ['content' => $scheduled['content'], 'at' => $date], ['id' => $id_scheduled]))
{
$_SESSION['errormessage'] = 'Impossible de mettre à jour le SMS numéro ' . $scheduled['id'] . '.';
header('Location: ' . $this->generateUrl('scheduleds', 'showAll'));
return false;
}
$db->deleteScheduleds_numbersForScheduled($id_scheduled); //On supprime tous les numéros pour ce SMS $db->deleteScheduleds_numbersForScheduled($id_scheduled); //On supprime tous les numéros pour ce SMS
$db->deleteScheduleds_contactsForScheduled($id_scheduled); //On supprime tous les contacts pour ce SMS $db->deleteScheduleds_contactsForScheduled($id_scheduled); //On supprime tous les contacts pour ce SMS

View File

@ -27,7 +27,7 @@ CREATE TABLE scheduleds
id INT NOT NULL AUTO_INCREMENT, id INT NOT NULL AUTO_INCREMENT,
at DATETIME NOT NULL, at DATETIME NOT NULL,
content VARCHAR(1000) NOT NULL, content VARCHAR(1000) NOT NULL,
progress BOOLEAN NOT NULL, progress BOOLEAN NOT NULL DEFAULT 0,
PRIMARY KEY (id) PRIMARY KEY (id)
); );

0
receiveds/.keepdir Normal file
View File