Active Calls: List view updates, bulk call hangup. Button Class: Add onmouseover/out support.
This commit is contained in:
parent
b27410c600
commit
f57fa290d3
|
|
@ -31,8 +31,12 @@
|
|||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
if (!permission_exists('bridge_view')) {
|
||||
echo "access denied"; exit;
|
||||
if (permission_exists('bridge_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
|
|
|
|||
|
|
@ -561,6 +561,26 @@ $text['confirm-hangup']['ru-ru'] = "Вы действительно хотите
|
|||
$text['confirm-hangup']['sv-se'] = "Vill du verkligen avsluta detta samtal";
|
||||
$text['confirm-hangup']['uk-ua'] = "Ви дійсно бажаєте розірвати дзвінок?";
|
||||
|
||||
$text['confirm-hangups']['en-us'] = "Do you really want to hangup these calls?";
|
||||
$text['confirm-hangups']['ar-eg'] = "";
|
||||
$text['confirm-hangups']['de-at'] = "Wollen Sie dieses Gespräch wirklich beenden?"; //copied from de-de
|
||||
$text['confirm-hangups']['de-ch'] = "Wollen Sie dieses Gespräch wirklich beenden?"; //copied from de-de
|
||||
$text['confirm-hangups']['de-de'] = "Wollen Sie dieses Gespräch wirklich beenden?";
|
||||
$text['confirm-hangups']['es-cl'] = "¿Realmente desea terminar esta llamada?";
|
||||
$text['confirm-hangups']['es-mx'] = "¿Realmente desea terminar esta llamada?"; //copied from es-cl
|
||||
$text['confirm-hangups']['fr-ca'] = "Voulez-vous vraiment raccrocher cette communication?"; //copied from fr-fr
|
||||
$text['confirm-hangups']['fr-fr'] = "Voulez-vous vraiment raccrocher cette communication?";
|
||||
$text['confirm-hangups']['he-il'] = "";
|
||||
$text['confirm-hangups']['it-it'] = "Vuoi veramente chiudere questa chiamata?";
|
||||
$text['confirm-hangups']['nl-nl'] = "";
|
||||
$text['confirm-hangups']['pl-pl'] = "Czy na pewno chcesz się rozłączyć tę rozmowę?";
|
||||
$text['confirm-hangups']['pt-br'] = "Deseja realmente finalizar essa chamada?";
|
||||
$text['confirm-hangups']['pt-pt'] = "Deseja realmente terminar esta chamada?";
|
||||
$text['confirm-hangups']['ro-ro'] = "";
|
||||
$text['confirm-hangups']['ru-ru'] = "Вы действительно хотите завершить вызов?";
|
||||
$text['confirm-hangups']['sv-se'] = "Vill du verkligen avsluta detta samtal";
|
||||
$text['confirm-hangups']['uk-ua'] = "Ви дійсно бажаєте розірвати дзвінок?";
|
||||
|
||||
$text['check-onbreak-status']['en-us'] = "On Break";
|
||||
$text['check-onbreak-status']['ar-eg'] = "";
|
||||
$text['check-onbreak-status']['de-at'] = "Auf Pause"; //copied from de-de
|
||||
|
|
@ -681,4 +701,24 @@ $text['button-show_all']['ru-ru'] = "Показать все";
|
|||
$text['button-show_all']['sv-se'] = "Visa Allt";
|
||||
$text['button-show_all']['uk-ua'] = "Показати всі";
|
||||
|
||||
?>
|
||||
$text['message-calls_ended']['en-us'] = "Calls Ended";
|
||||
$text['message-calls_ended']['ar-eg'] = "";
|
||||
$text['message-calls_ended']['de-at'] = "";
|
||||
$text['message-calls_ended']['de-ch'] = "";
|
||||
$text['message-calls_ended']['de-de'] = "";
|
||||
$text['message-calls_ended']['es-cl'] = "";
|
||||
$text['message-calls_ended']['es-mx'] = "";
|
||||
$text['message-calls_ended']['fr-ca'] = "";
|
||||
$text['message-calls_ended']['fr-fr'] = "";
|
||||
$text['message-calls_ended']['he-il'] = "";
|
||||
$text['message-calls_ended']['it-it'] = "";
|
||||
$text['message-calls_ended']['nl-nl'] = "";
|
||||
$text['message-calls_ended']['pl-pl'] = "";
|
||||
$text['message-calls_ended']['pt-br'] = "";
|
||||
$text['message-calls_ended']['pt-pt'] = "";
|
||||
$text['message-calls_ended']['ro-ro'] = "";
|
||||
$text['message-calls_ended']['ru-ru'] = "";
|
||||
$text['message-calls_ended']['sv-se'] = "";
|
||||
$text['message-calls_ended']['uk-ua'] = "";
|
||||
|
||||
?>
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
|
@ -86,33 +87,14 @@
|
|||
//refresh controls
|
||||
function refresh_stop() {
|
||||
clearTimeout(timer_id);
|
||||
document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">";
|
||||
document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; margin-right: 20px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">";
|
||||
}
|
||||
|
||||
function refresh_start() {
|
||||
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
|
||||
if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 2px; margin-right: 20px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
|
||||
ajax_get();
|
||||
}
|
||||
|
||||
//call controls
|
||||
function hangup(uuid) {
|
||||
if (confirm("<?php echo $text['confirm-hangup']?>")) {
|
||||
send_cmd('calls_exec.php?command=hangup&uuid='+uuid);
|
||||
}
|
||||
}
|
||||
|
||||
function send_cmd(url) {
|
||||
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
|
||||
xmlhttp=new XMLHttpRequest();
|
||||
}
|
||||
else {// code for IE6, IE5
|
||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
xmlhttp.open("GET",url,false);
|
||||
xmlhttp.send(null);
|
||||
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
|
@ -91,15 +91,12 @@
|
|||
}
|
||||
unset($results);
|
||||
}
|
||||
$num_rows = @sizeof($rows);
|
||||
|
||||
|
||||
//set the alternating color for each row
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
//if the connnection is available then run it and return the results
|
||||
if (!$fp) {
|
||||
|
||||
$msg = "<div align='center'>".$text['confirm-socket']."<br /></div>";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='40%'>\n";
|
||||
|
|
@ -111,112 +108,140 @@
|
|||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
}
|
||||
else {
|
||||
//define js function call var
|
||||
$onhover_pause_refresh = " onmouseover='refresh_stop();' onmouseout='refresh_start();'";
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create('/app/calls_active/calls_active_inc.php');
|
||||
|
||||
//show content
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0' align='right'>";
|
||||
echo " <tr>";
|
||||
echo " <td valign='middle' nowrap='nowrap' style='padding-right: 15px' id='refresh_state'>";
|
||||
echo " <img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\">";
|
||||
echo " </td>";
|
||||
echo " <td valign='top' nowrap='nowrap'>";
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
echo " <span id='refresh_state'><img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 2px; margin-right: 20px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\"></span>";
|
||||
if (permission_exists('call_active_hangup') && $rows) {
|
||||
echo button::create(['type'=>'button','label'=>$text['label-hangup'],'icon'=>'phone-slash','onclick'=>"if (confirm('".$text['confirm-hangups']."')) { list_action_set('hangup'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('call_active_all')) {
|
||||
if ($show == "all") {
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"document.location='calls_active.php';\" value='".$text['button-back']."' ".$onhover_pause_refresh.">\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'link'=>'calls_active.php','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']);
|
||||
}
|
||||
else {
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-show_all']."' onclick=\"document.location='calls_active.php?show=all';\" value='".$text['button-show_all']."' ".$onhover_pause_refresh.">\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'calls_active.php?show=all','onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']);
|
||||
}
|
||||
}
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo "<b>".$text['title']." (" . count($rows) . ")"."</b>";
|
||||
echo "<br><br>\n";
|
||||
echo $text['description']."\n";
|
||||
echo "<br><br>\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
//show the results
|
||||
echo "<div id='cmd_reponse'></div>\n";
|
||||
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<th>".$text['label-profile']."</th>\n";
|
||||
echo "<th>".$text['label-created']."</th>\n";
|
||||
echo "<form id='form_list' method='post' action='calls_exec.php'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='if (this.checked) { refresh_stop(); } else { refresh_start(); } list_all_toggle();' ".($rows ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
echo " <th>".$text['label-profile']."</th>\n";
|
||||
echo " <th>".$text['label-created']."</th>\n";
|
||||
if ($show == 'all') {
|
||||
echo "<th>".$text['label-domain']."</th>\n";
|
||||
echo " <th>".$text['label-domain']."</th>\n";
|
||||
}
|
||||
echo " <th>".$text['label-number']."</th>\n";
|
||||
echo " <th>".$text['label-cid-name']."</th>\n";
|
||||
echo " <th>".$text['label-cid-number']."</th>\n";
|
||||
echo " <th>".$text['label-destination']."</th>\n";
|
||||
echo " <th>".$text['label-app']."</th>\n";
|
||||
echo " <th>".$text['label-codec']."</th>\n";
|
||||
echo " <th>".$text['label-secure']."</th>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "<th>".$text['label-number']."</th>\n";
|
||||
echo "<th>".$text['label-cid-name']."</th>\n";
|
||||
echo "<th>".$text['label-cid-number']."</th>\n";
|
||||
echo "<th>".$text['label-destination']."</th>\n";
|
||||
echo "<th>".$text['label-app']."</th>\n";
|
||||
echo "<th>".$text['label-codec']."</th>\n";
|
||||
echo "<th>".$text['label-secure']."</th>\n";
|
||||
echo "<td class='list_control_icon'></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
foreach ($rows as &$row) {
|
||||
//set the php variables
|
||||
foreach ($row as $key => $value) {
|
||||
$$key = $value;
|
||||
}
|
||||
//if (if_group("superadmin") && isset($_REQUEST['debug'])) {
|
||||
// echo "<tr><td colspan='20'><pre>".print_r(escape($row), true)."</pre></td></tr>";
|
||||
//}
|
||||
if (is_array($rows)) {
|
||||
$x = 0;
|
||||
foreach ($rows as &$row) {
|
||||
|
||||
//get the sip profile
|
||||
$name_array = explode("/", $name);
|
||||
$sip_profile = $name_array[1];
|
||||
$sip_uri = $name_array[2];
|
||||
|
||||
//get the number
|
||||
$temp_array = explode("@", $sip_uri);
|
||||
$tmp_number = $temp_array[0];
|
||||
$tmp_number = str_replace("sip:", "", $tmp_number);
|
||||
|
||||
//remove the '+' because it breaks the call recording
|
||||
$cid_num = str_replace("+", "", $cid_num);
|
||||
|
||||
//replace gateway uuid with name
|
||||
if (sizeof($_SESSION['gateways']) > 0) {
|
||||
foreach ($_SESSION['gateways'] as $gateway_uuid => $gateway_name) {
|
||||
$application_data = str_replace($gateway_uuid, $gateway_name, $application_data);
|
||||
//set the php variables
|
||||
foreach ($row as $key => $value) {
|
||||
$$key = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// reduce too long app data
|
||||
if(strlen($application_data) > 512) {
|
||||
$application_data = substr($application_data, 0, 512) . ' <b>...</b>';
|
||||
}
|
||||
//get the sip profile
|
||||
$name_array = explode("/", $name);
|
||||
$sip_profile = $name_array[1];
|
||||
$sip_uri = $name_array[2];
|
||||
|
||||
//send the html
|
||||
echo "<tr>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($sip_profile)." </td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($created)." </td>\n";
|
||||
if ($show == 'all') {
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($domain_name)." </td>\n";
|
||||
}
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($tmp_number)." </td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($cid_name)." </td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($cid_num)." </td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($dest)." </td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".((strlen($application) > 0) ? escape($application).":".escape($application_data) : null)." </td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." </td>\n";
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".escape($secure)." </td>\n";
|
||||
echo "<td class='list_control_icons' style='width: 25px; text-align: left;'><a href='javascript:void(0);' alt='".$text['label-hangup']."' onclick=\"hangup('".escape($uuid)."');\">".$v_link_label_delete."</a></td>\n";
|
||||
echo "</tr>\n";
|
||||
//get the number
|
||||
$temp_array = explode("@", $sip_uri);
|
||||
$tmp_number = $temp_array[0];
|
||||
$tmp_number = str_replace("sip:", "", $tmp_number);
|
||||
|
||||
//alternate the row style
|
||||
$c = ($c) ? 0 : 1;
|
||||
//remove the '+' because it breaks the call recording
|
||||
$cid_num = str_replace("+", "", $cid_num);
|
||||
|
||||
//replace gateway uuid with name
|
||||
if (sizeof($_SESSION['gateways']) > 0) {
|
||||
foreach ($_SESSION['gateways'] as $gateway_uuid => $gateway_name) {
|
||||
$application_data = str_replace($gateway_uuid, $gateway_name, $application_data);
|
||||
}
|
||||
}
|
||||
|
||||
// reduce too long app data
|
||||
if(strlen($application_data) > 512) {
|
||||
$application_data = substr($application_data, 0, 512) . ' <b>...</b>';
|
||||
}
|
||||
|
||||
//send the html
|
||||
echo "<tr class='list-row'>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='calls[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (this.checked) { refresh_stop(); } else { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='calls[$x][uuid]' value='".escape($uuid)."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " <td>".escape($sip_profile)." </td>\n";
|
||||
echo " <td>".escape($created)." </td>\n";
|
||||
if ($show == 'all') {
|
||||
echo " <td>".escape($domain_name)." </td>\n";
|
||||
}
|
||||
echo " <td>".escape($tmp_number)." </td>\n";
|
||||
echo " <td>".escape($cid_name)." </td>\n";
|
||||
echo " <td>".escape($cid_num)." </td>\n";
|
||||
echo " <td>".escape($dest)." </td>\n";
|
||||
echo " <td>".(strlen($application) > 0 ? escape($application).":".escape($application_data) : null)." </td>\n";
|
||||
echo " <td>".escape($read_codec).":".escape($read_rate)." / ".escape($write_codec).":".escape($write_rate)." </td>\n";
|
||||
echo " <td>".escape($secure)." </td>\n";
|
||||
if (permission_exists('call_active_hangup')) {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['label-hangup'],'icon'=>'phone-slash','onclick'=>"if (confirm('".$text['confirm-hangup']."')) { list_self_check('checkbox_".$x."'); list_action_set('hangup'); list_form_submit('form_list'); } else { this.blur(); return false; }",'onmouseover'=>'refresh_stop()','onmouseout'=>'refresh_start()']);
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
//increment counter
|
||||
$x++;
|
||||
}
|
||||
unset($rows);
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</form>\n";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -1,30 +1,27 @@
|
|||
<?php
|
||||
/* $Id$ */
|
||||
/*
|
||||
v_exec.php
|
||||
Copyright (C) 2008 - 2019 Mark J Crane
|
||||
All rights reserved.
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
The Original Code is FusionPBX
|
||||
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
|
|
@ -33,7 +30,7 @@
|
|||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('call_active_view') || permission_exists('extension_active_view')) {
|
||||
if (permission_exists('call_active_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
|
|
@ -41,28 +38,63 @@
|
|||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//authorized referrer
|
||||
if(stristr($_SERVER["HTTP_REFERER"], '/calls_active_extensions.php') === false) {
|
||||
if(stristr($_SERVER["HTTP_REFERER"], '/calls_active.php') === false) {
|
||||
echo " access denied";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//authorized commands
|
||||
if ($_GET["command"] == 'hangup') {
|
||||
if (is_uuid($_GET["uuid"])) {
|
||||
//setup the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
|
||||
//run the command
|
||||
$switch_result = event_socket_request($fp, 'api uuid_kill '.$_GET["uuid"]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//not found. this command is not authorized
|
||||
if (stristr($_SERVER["HTTP_REFERER"], '/calls_active.php') === false) {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
//authorized commands
|
||||
if ($_REQUEST['action'] == 'hangup' && permission_exists('call_active_hangup')) {
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate('/app/calls_active/calls_active_inc.php')) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: calls_active.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//verify submitted call uuids
|
||||
if (is_array($_POST['calls']) && @sizeof($_POST['calls']) != 0) {
|
||||
foreach ($_POST['calls'] as $call) {
|
||||
if ($call['checked'] == 'true' && is_uuid($call['uuid'])) {
|
||||
$calls[] = $call['uuid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_uuid($_REQUEST['uuid'])) {
|
||||
$calls[] = $_REQUEST['uuid'];
|
||||
}
|
||||
|
||||
//iterate through calls
|
||||
if (is_array($calls) && @sizeof($calls) != 0) {
|
||||
|
||||
//setup the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
|
||||
//execute hangup command
|
||||
foreach ($calls as $call_uuid) {
|
||||
$switch_result = event_socket_request($fp, 'api uuid_kill '.$call_uuid);
|
||||
}
|
||||
|
||||
//set message
|
||||
message::add($text['message-calls_ended'].': '.@sizeof($calls),'positive');
|
||||
|
||||
}
|
||||
|
||||
//redirect
|
||||
header('Location: calls_active.php');
|
||||
exit;
|
||||
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -43,6 +43,8 @@ if (!class_exists('button')) {
|
|||
$button .= "title=\"".($array['title'] ? $array['title'] : $array['label'])."\" ";
|
||||
}
|
||||
$button .= $array['onclick'] ? "onclick=\"".$array['onclick']."\" " : null;
|
||||
$button .= $array['onmouseover'] ? "onmouseenter=\"".$array['onmouseover']."\" " : null;
|
||||
$button .= $array['onmouseout'] ? "onmouseleave=\"".$array['onmouseout']."\" " : null;
|
||||
$button .= "class='btn btn-".($array['class'] ? $array['class'] : 'default')." ".($array['disabled'] ? 'disabled' : null)."' ";
|
||||
$button .= "style='margin-left: 2px; margin-right: 2px; ".($array['style'] ? $array['style'] : null)."' ";
|
||||
$button .= $array['disabled'] ? "disabled='disabled' " : null;
|
||||
|
|
@ -96,7 +98,7 @@ if (!class_exists('button')) {
|
|||
|
||||
//usage
|
||||
|
||||
echo button::create(['type'=>'button','label'=>$text['button-label'],'icon'=>'icon','name'=>'btn','id'=>'btn','value'=>'value','link'=>'url','target'=>'_blank','onclick'=>'javascript','class'=>'name','style'=>'css','title'=>$text['button-label'],'collapse'=>'class','disabled'=>false]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-label'],'icon'=>'icon','name'=>'btn','id'=>'btn','value'=>'value','link'=>'url','target'=>'_blank','onclick'=>'javascript','onmouseover'=>'javascript','onmouseout'=>'javascript','class'=>'name','style'=>'css','title'=>$text['button-label'],'collapse'=>'class','disabled'=>false]);
|
||||
|
||||
echo button::create([
|
||||
'type'=>'button',
|
||||
|
|
@ -108,6 +110,8 @@ if (!class_exists('button')) {
|
|||
'link'=>'url',
|
||||
'target'=>'_blank',
|
||||
'onclick'=>'javascript',
|
||||
'onmouseover'=>'javascript',
|
||||
'onmouseout'=>'javascript',
|
||||
'class'=>'name',
|
||||
'style'=>'css',
|
||||
'title'=>$text['button-label'],
|
||||
|
|
@ -124,6 +128,8 @@ if (!class_exists('button')) {
|
|||
value submitted value (if type is also set to 'submit')
|
||||
target '_blank' | '_self' (default) | etc
|
||||
onclick javascript
|
||||
onmouseover javascript (actually uses onmouseenter so doesn't bubble to child elements)
|
||||
onmouseout javascript (actually uses onmouseleave so doesn't bubble to child elements)
|
||||
class css class[es]
|
||||
style css style[s]
|
||||
title tooltip text (if not set, defaults to value of label)
|
||||
|
|
|
|||
Loading…
Reference in New Issue