mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Update disucssion and numebrs to direct linking
This commit is contained in:
parent
53fe0b11f3
commit
9dd53cec7d
11 changed files with 32 additions and 13 deletions
|
@ -50,6 +50,18 @@ namespace controllers\internals;
|
|||
return $phone_number_util->format($phone_number_o, \libphonenumber\PhoneNumberFormat::INTERNATIONAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a number and make a link to a discussion with this number
|
||||
* @param string $number : Number to format and make a link for
|
||||
* @return string : Link to the number
|
||||
*/
|
||||
public static function phone_link ($number)
|
||||
{
|
||||
$number_format = \controllers\internals\Tool::phone_format($number);
|
||||
$url = \descartes\Router::url('Discussion', 'show', ['number' => $number]);
|
||||
return '<a href="' . self::s($url, false, true, false) . '">' . self::s($number_format, false, true, false) . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Cette fonction fait la correspondance entre un type d'evenement et une icone font awesome.
|
||||
*
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace controllers\publics;
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!$this->internal_scheduled->create($id_user, $at, $text, false, false, $numbers))
|
||||
if (!$this->internal_scheduled->create($id_user, $at, $text, null, false, $numbers))
|
||||
{
|
||||
$return['success'] = false;
|
||||
$return['message'] = 'Impossible de créer le Sms';
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace controllers\publics;
|
|||
continue;
|
||||
}
|
||||
|
||||
$receiveds[$key]['origin'] = $contact['name'].' ('.$received['origin'].')';
|
||||
$receiveds[$key]['origin'] = $this->s($contact['name'], false, true, false) . ' (' . \controllers\internals\Tool::phone_link($received['origin']) . ')';
|
||||
}
|
||||
|
||||
$nb_received = \count($receiveds);
|
||||
|
|
|
@ -68,7 +68,14 @@ namespace controllers\publics;
|
|||
'contact' => $contact,
|
||||
];
|
||||
|
||||
echo json_encode($this->internal_templating->render($template, $datas));
|
||||
$result = $this->internal_templating->render($template, $datas);
|
||||
$return = $result;
|
||||
if (!trim($result['result']))
|
||||
{
|
||||
$return['result'] = 'Message vide, il ne sera pas envoyé.';
|
||||
}
|
||||
|
||||
echo json_encode($return);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue