mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-21 00:46:27 +02:00
Update received
This commit is contained in:
parent
29cd7edd5d
commit
1dfebd1df7
7 changed files with 18 additions and 18 deletions
|
@ -332,10 +332,10 @@ class Console extends \descartes\InternalController
|
|||
}
|
||||
|
||||
//On map les données et on créer le Sms reçu
|
||||
$send_by = $number;
|
||||
$origin = $number;
|
||||
$content = $text;
|
||||
$is_command = \count($found_commands);
|
||||
if ($id_received = $this->internal_received->create($date, $send_by, $content, $is_command))
|
||||
if ($id_received = $this->internal_received->create($date, $origin, $content, $is_command))
|
||||
{
|
||||
echo "Erreur lors de l'enregistrement du Sms\n";
|
||||
error_log('Unable to process the Sms in file "'.$dir);
|
||||
|
@ -385,11 +385,11 @@ class Console extends \descartes\InternalController
|
|||
|
||||
foreach ($users as $user)
|
||||
{
|
||||
echo "Transfer d'un Sms du ".$received['send_by']." à l'email ".$user['email'];
|
||||
echo "Transfer d'un Sms du ".$received['origin']." à l'email ".$user['email'];
|
||||
|
||||
$to = $user['email'];
|
||||
$subject = '[RaspiSms] - Transfert d\'un Sms du '.$received['send_by'];
|
||||
$message = 'Le numéro '.$received['send_by']." vous a envoyé un Sms : \n".$received['content'];
|
||||
$subject = '[RaspiSms] - Transfert d\'un Sms du '.$received['origin'];
|
||||
$message = 'Le numéro '.$received['origin']." vous a envoyé un Sms : \n".$received['content'];
|
||||
|
||||
$success = mail($to, $subject, $message);
|
||||
echo ' ... '.($success ? 'ok' : 'ko')."\n";
|
||||
|
|
|
@ -120,17 +120,17 @@ class Received extends \descartes\InternalController
|
|||
* @param mixed $at
|
||||
* @param mixed $origin
|
||||
* @param mixed $content
|
||||
* @param mixed $is_command
|
||||
* @param mixed $command
|
||||
*
|
||||
* @return mixed bool|int : false si echec, sinon l'id de la nouvelle receivede insérée
|
||||
*/
|
||||
public function create($at, $origin, $content, $is_command)
|
||||
public function create($at, $origin, $content, $command)
|
||||
{
|
||||
$received = [
|
||||
'at' => $at,
|
||||
'origin' => $origin,
|
||||
'content' => $content,
|
||||
'is_command' => $is_command,
|
||||
'command' => $command,
|
||||
];
|
||||
|
||||
return $this->model_received->create($received);
|
||||
|
@ -143,17 +143,17 @@ class Received extends \descartes\InternalController
|
|||
* @param mixed $at
|
||||
* @param mixed $origin
|
||||
* @param mixed $content
|
||||
* @param mixed $is_command
|
||||
* @param mixed $command
|
||||
*
|
||||
* @return int : le nombre de ligne modifiées
|
||||
*/
|
||||
public function update($id, $at, $origin, $content, $is_command)
|
||||
public function update($id, $at, $origin, $content, $command)
|
||||
{
|
||||
$received = [
|
||||
'at' => $at,
|
||||
'origin' => $origin,
|
||||
'content' => $content,
|
||||
'is_command' => $is_command,
|
||||
'command' => $command,
|
||||
];
|
||||
|
||||
return $this->model_received->update($id, $received);
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace controllers\publics;
|
|||
$now = $now->format('Y-m-d H:i:s');
|
||||
|
||||
$sendeds = $this->internal_sended->get_by_target($number);
|
||||
$receiveds = $this->internal_received->get_by_send_by($number);
|
||||
$receiveds = $this->internal_received->get_by_origin($number);
|
||||
$scheduleds = $this->internal_scheduled->get_before_date_for_number($now, $number);
|
||||
|
||||
$messages = [];
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace controllers\publics;
|
|||
continue;
|
||||
}
|
||||
|
||||
$receiveds[$key]['send_by'] = $contact['name'].' ('.$received['origin'].')';
|
||||
$receiveds[$key]['origin'] = $contact['name'].' ('.$received['origin'].')';
|
||||
}
|
||||
|
||||
$this->render('received/list', ['receiveds' => $receiveds, 'page' => $page, 'limit' => $limit, 'nb_results' => \count($receiveds)]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue