Update disucssion and numebrs to direct linking
This commit is contained in:
parent
53fe0b11f3
commit
9dd53cec7d
|
@ -28,7 +28,7 @@ function verifReceived()
|
||||||
jQuery('.popup-alert').fadeOut('slow');
|
jQuery('.popup-alert').fadeOut('slow');
|
||||||
jQuery.getJSON(HTTP_PWD + "/received/popup", function( data ) {
|
jQuery.getJSON(HTTP_PWD + "/received/popup", function( data ) {
|
||||||
$.each(data, function(key, val) {
|
$.each(data, function(key, val) {
|
||||||
showMessage('SMS reçu du ' + val.origin.replace(/</g, "<").replace(/>/g, ">") + ' : ' + val.text.replace(/</g, "<").replace(/>/g, ">"), 1);
|
showMessage('SMS reçu du ' + val.origin + ' : ' + val.text, 1);
|
||||||
playReceptionSound();
|
playReceptionSound();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -50,6 +50,18 @@ namespace controllers\internals;
|
||||||
return $phone_number_util->format($phone_number_o, \libphonenumber\PhoneNumberFormat::INTERNATIONAL);
|
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.
|
* Cette fonction fait la correspondance entre un type d'evenement et une icone font awesome.
|
||||||
*
|
*
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace controllers\publics;
|
||||||
return false;
|
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['success'] = false;
|
||||||
$return['message'] = 'Impossible de créer le Sms';
|
$return['message'] = 'Impossible de créer le Sms';
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace controllers\publics;
|
||||||
continue;
|
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);
|
$nb_received = \count($receiveds);
|
||||||
|
|
|
@ -68,7 +68,14 @@ namespace controllers\publics;
|
||||||
'contact' => $contact,
|
'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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php $this->s($contact['id']); ?></td>
|
<td><?php $this->s($contact['id']); ?></td>
|
||||||
<td><?php $this->s($contact['name']); ?></td>
|
<td><?php $this->s($contact['name']); ?></td>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($contact['number'])); ?></td>
|
<td><?php echo(\controllers\internals\Tool::phone_link($contact['number'])); ?></td>
|
||||||
<td><input type="checkbox" name="ids[]" value="<?php $this->s($contact['id']); ?>"></td>
|
<td><input type="checkbox" name="ids[]" value="<?php $this->s($contact['id']); ?>"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
|
@ -153,7 +153,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($sendeds as $sended) { ?>
|
<?php foreach ($sendeds as $sended) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($sended['destination'])); ?></td>
|
<td><?php echo \controllers\internals\Tool::phone_link($sended['destination']); ?></td>
|
||||||
<td><?php $this->s($sended['at']); ?></td>
|
<td><?php $this->s($sended['at']); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($receiveds as $received) { ?>
|
<?php foreach ($receiveds as $received) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($received['origin'])); ?></td>
|
<td><?php echo \controllers\internals\Tool::phone_link($received['origin']); ?></td>
|
||||||
<td><?php $this->s($received['at']); ?></td>
|
<td><?php $this->s($received['at']); ?></td>
|
||||||
<td><?php echo ($received['command']) ? 'Oui' : 'Non'; ?></td>
|
<td><?php echo ($received['command']) ? 'Oui' : 'Non'; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
<?php foreach ($discussions as $discussion) { ?>
|
<?php foreach ($discussions as $discussion) { ?>
|
||||||
<tr class="goto" url="<?php $this->s(\descartes\Router::url('Discussion', 'show', ['number' => $discussion['number']])); ?>">
|
<tr class="goto" url="<?php $this->s(\descartes\Router::url('Discussion', 'show', ['number' => $discussion['number']])); ?>">
|
||||||
<td><?php $this->s($discussion['at']); ?></td>
|
<td><?php $this->s($discussion['at']); ?></td>
|
||||||
<td><?php $this->s(isset($discussion['contact']) ? $discussion['contact'] . ' (' . \controllers\internals\Tool::phone_format($discussion['number']) . ')' : \controllers\internals\Tool::phone_format($discussion['number'])); ?></td>
|
<td><?php $this->s(isset($discussion['contact']) ? $discussion['contact'] . ' (' . \controllers\internals\Tool::phone_format($discussion['number']) . ')' : \controllers\internals\Tool::phone_link($discussion['number'])); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -55,8 +55,8 @@
|
||||||
<?php foreach ($receiveds as $received) { ?>
|
<?php foreach ($receiveds as $received) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php $this->s($received['id']); ?></td>
|
<td><?php $this->s($received['id']); ?></td>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($received['origin'])); ?></td>
|
<td><?php echo(\controllers\internals\Tool::phone_link($received['origin'])); ?></td>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($received['destination'])); ?></td>
|
<td><?php echo(\controllers\internals\Tool::phone_link($received['destination'])); ?></td>
|
||||||
<td><?php $this->s($received['text']); ?></td>
|
<td><?php $this->s($received['text']); ?></td>
|
||||||
<td><?php $this->s($received['at']); ?></td>
|
<td><?php $this->s($received['at']); ?></td>
|
||||||
<td><?php echo $received['command'] ? 'Oui' : 'Non'; ?></td>
|
<td><?php echo $received['command'] ? 'Oui' : 'Non'; ?></td>
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
<?php foreach ($sendeds as $sended) { ?>
|
<?php foreach ($sendeds as $sended) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php $this->s($sended['id']); ?></td>
|
<td><?php $this->s($sended['id']); ?></td>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($sended['origin'])); ?></td>
|
<td><?php echo(\controllers\internals\Tool::phone_link($sended['origin'])); ?></td>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($sended['destination'])); ?></td>
|
<td><?php echo(\controllers\internals\Tool::phone_link($sended['destination'])); ?></td>
|
||||||
<td><?php $this->s($sended['text']); ?></td>
|
<td><?php $this->s($sended['text']); ?></td>
|
||||||
<td><?php $this->s($sended['at']); ?></td>
|
<td><?php $this->s($sended['at']); ?></td>
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
<?php foreach ($smsstops as $smsstop) { ?>
|
<?php foreach ($smsstops as $smsstop) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php $this->s($smsstop['id']); ?></td>
|
<td><?php $this->s($smsstop['id']); ?></td>
|
||||||
<td><?php $this->s(\controllers\internals\Tool::phone_format($smsstop['number'])); ?></td>
|
<td><?php echo(\controllers\internals\Tool::phone_link($smsstop['number'])); ?></td>
|
||||||
<?php if ($_SESSION['user']['admin']) { ?>
|
<?php if ($_SESSION['user']['admin']) { ?>
|
||||||
<td><input name="ids[]" type="checkbox" value="<?php $this->s($smsstop['id']); ?>"></td>
|
<td><input name="ids[]" type="checkbox" value="<?php $this->s($smsstop['id']); ?>"></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
Loading…
Reference in New Issue