2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Alternate callto url system by config

This commit is contained in:
Shnoulle
2021-10-27 17:19:08 +02:00
parent 7c79d89764
commit 76c89ec7c3
2 changed files with 16 additions and 1 deletions

View File

@@ -255,6 +255,18 @@ if (!defined('ALLOW_RESPONDENT_SELECTOR')) define ('ALLOW_RESPONDENT_SELECTOR',t
* Display a faster alternate interface where VoIP is disabled
*/
if (!defined('ALTERNATE_INTERFACE')) define ('ALTERNATE_INTERFACE',false);
/**
* Alow to choose the start part of the link for alternate interface, before phone
*/
if (!defined('ALTERNATE_INTERFACE_CALLSTARTURL')) define ('ALTERNATE_INTERFACE_CALLSTARTURL','callto:://');
/**
* Alow to choose the end part of the link for alternate interface, after phone
*/
if (!defined('ALTERNATE_INTERFACE_CALLENDURL')) define ('ALTERNATE_INTERFACE_CALLENDURL','');
/**
* Allwo to set some specific attributes (for example target='_blank') to call url
*/
if (!defined('ALTERNATE_INTERFACE_ATTRIBUTEURL')) define ('ALTERNATE_INTERFACE_ATTRIBUTEURL','');
/**
* Number of log records to display

View File

@@ -215,13 +215,16 @@ if ($ca)
//By default, the selected radio button should have a "call" started for it
//When then next one clicked, it should bring up call screen if no outcome otherwise start new call
//print "<div>";print "</div>";
$callstarturl = ALTERNATE_INTERFACE_CALLSTARTURL;
$callendurl = ALTERNATE_INTERFACE_CALLENDURL;
$extraattributes = ALTERNATE_INTERFACE_ATTRIBUTEURL;
foreach($rs as $r)
{
print "<form method='post' action='?'>
<p>
<input onclick='this.form.submit();' type='radio' name='contactphone' value='{$r['contact_phone_id']}' id='contactphone{$r['contact_phone_id']}' {$r['checked']}/>&ensp;
<label for='contactphone{$r['contact_phone_id']}'>{$r['phone']}";
if ($r['checked']) print "&emsp;<a href='callto:{$r['phone']}' class='btn btn-primary btn-xs'><i class='fa fa-phone fa-fw'></i>&ensp;" . T_('Dial') . "</a>";
if ($r['checked']) print "<br>&emsp;<a href='{$callstarturl}{$r['phone']}{$callendurl}' {$extraattributes} class='btn btn-primary btn-xs'><i class='fa fa-phone fa-fw'></i>&ensp;" . T_('Dial') . " {$r['phone']}</a>";
if (!empty($r['description'])) print " - " . $r['description'];
print "</label>
</p>