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

New Feature: Allow calltourl to be configured

This commit is contained in:
Adam Zammit
2021-11-05 13:56:50 +11:00
2 changed files with 19 additions and 1 deletions

View File

@@ -256,6 +256,21 @@ if (!defined('ALLOW_RESPONDENT_SELECTOR')) define ('ALLOW_RESPONDENT_SELECTOR',t
*/
if (!defined('ALTERNATE_INTERFACE')) define ('ALTERNATE_INTERFACE',false);
/**
* Allow to choose the start part of the link for alternate interface, before phone
*/
if (!defined('ALTERNATE_INTERFACE_CALLSTARTURL')) define ('ALTERNATE_INTERFACE_CALLSTARTURL','callto:');
/**
* Allow to choose the end part of the link for alternate interface, after phone
*/
if (!defined('ALTERNATE_INTERFACE_CALLENDURL')) define ('ALTERNATE_INTERFACE_CALLENDURL','');
/**
* Allow 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>