mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
Fixed call recording download and call center show all (#6745)
This commit is contained in:
@@ -559,7 +559,7 @@
|
|||||||
|
|
||||||
//add an empty row to the tiers array
|
//add an empty row to the tiers array
|
||||||
if (count($tiers) == 0) {
|
if (count($tiers) == 0) {
|
||||||
$rows = $_SESSION['call_center']['agent_add_rows']['numeric'];
|
$rows = $_SESSION['call_center']['agent_add_rows']['numeric'] ?? null;
|
||||||
$id = 0;
|
$id = 0;
|
||||||
}
|
}
|
||||||
if (count($tiers) > 0) {
|
if (count($tiers) > 0) {
|
||||||
|
|||||||
@@ -53,14 +53,14 @@
|
|||||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||||
|
|
||||||
//get posted data
|
//get posted data
|
||||||
if (!empty($_POST['call_center_queues'])) {
|
if (!empty($_POST['call_center_queues']) && is_array($_POST['call_center_queues'])) {
|
||||||
$action = $_POST['action'];
|
$action = $_POST['action'];
|
||||||
$search = $_POST['search'];
|
$search = $_POST['search'];
|
||||||
$call_center_queues = $_POST['call_center_queues'];
|
$call_center_queues = $_POST['call_center_queues'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//process the http post data by action
|
//process the http post data by action
|
||||||
if (!empty($action) && !empty($call_center_queues)) {
|
if (!empty($action) && is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'copy':
|
case 'copy':
|
||||||
if (permission_exists('call_center_queue_add')) {
|
if (permission_exists('call_center_queue_add')) {
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
//get total call center queues count from the database
|
//get total call center queues count from the database
|
||||||
$sql = "select count(*) from v_call_center_queues ";
|
$sql = "select count(*) from v_call_center_queues ";
|
||||||
$sql .= "where true ";
|
$sql .= "where true ";
|
||||||
if (!empty($_GET['show']) && $_GET['show'] != "all" || !permission_exists('call_center_all')) {
|
if ($show != "all" || !permission_exists('call_center_all')) {
|
||||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||||
$parameters['extension_uuid'] = $extension_uuid;
|
$parameters['extension_uuid'] = $extension_uuid;
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$row = $database->select($sql, $parameters ?? null, 'row');
|
$row = $database->select($sql, $parameters, 'row');
|
||||||
if (!empty($row)) {
|
if (!empty($row)) {
|
||||||
$extension = $row["extension"];
|
$extension = $row["extension"];
|
||||||
$number_alias = $row["number_alias"];
|
$number_alias = $row["number_alias"];
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
$sql .= "order by follow_me_order asc ";
|
$sql .= "order by follow_me_order asc ";
|
||||||
$parameters['follow_me_uuid'] = $follow_me_uuid;
|
$parameters['follow_me_uuid'] = $follow_me_uuid;
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$result = $database->select($sql, $parameters ?? null, 'all');
|
$result = $database->select($sql, $parameters, 'all');
|
||||||
|
|
||||||
unset($destinations);
|
unset($destinations);
|
||||||
foreach ($result as $x => &$row) {
|
foreach ($result as $x => &$row) {
|
||||||
@@ -507,7 +507,7 @@
|
|||||||
$sql .= "order by extension, number_alias asc ";
|
$sql .= "order by extension, number_alias asc ";
|
||||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$extensions = $database->select($sql, $parameters ?? null, 'all');
|
$extensions = $database->select($sql, $parameters, 'all');
|
||||||
unset($sql, $parameters, $row);
|
unset($sql, $parameters, $row);
|
||||||
|
|
||||||
//set the default
|
//set the default
|
||||||
@@ -517,7 +517,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//prepare the autocomplete
|
//prepare the autocomplete
|
||||||
if(!empty($_SESSION['follow_me']['follow_me_autocomplete']['boolean']) == 'true') {
|
if(!empty($_SESSION['follow_me']['follow_me_autocomplete']['boolean']) && $_SESSION['follow_me']['follow_me_autocomplete']['boolean'] == 'true') {
|
||||||
echo "<link rel=\"stylesheet\" href=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.css\" />\n";
|
echo "<link rel=\"stylesheet\" href=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.css\" />\n";
|
||||||
echo "<script src=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.js\"></script>\n";
|
echo "<script src=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.js\"></script>\n";
|
||||||
echo "<script type=\"text/javascript\">\n";
|
echo "<script type=\"text/javascript\">\n";
|
||||||
@@ -754,7 +754,7 @@
|
|||||||
echo "</table>";
|
echo "</table>";
|
||||||
echo "<br /><br />";
|
echo "<br /><br />";
|
||||||
|
|
||||||
if (!empty($action) == "update") {
|
if (!empty($action) && $action == "update") {
|
||||||
echo "<input type='hidden' name='id' value='".escape($extension_uuid)."'>\n";
|
echo "<input type='hidden' name='id' value='".escape($extension_uuid)."'>\n";
|
||||||
}
|
}
|
||||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||||
|
|||||||
@@ -51,14 +51,14 @@
|
|||||||
$show = $_GET["show"] ?? '';
|
$show = $_GET["show"] ?? '';
|
||||||
|
|
||||||
//get the http post data
|
//get the http post data
|
||||||
if (!empty($_POST['call_recordings'])) {
|
if (!empty($_POST['call_recordings']) && is_array($_POST['call_recordings'])) {
|
||||||
$action = $_POST['action'];
|
$action = $_POST['action'];
|
||||||
$search = $_POST['search'];
|
$search = $_POST['search'];
|
||||||
$call_recordings = $_POST['call_recordings'];
|
$call_recordings = $_POST['call_recordings'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//process the http post data by action
|
//process the http post data by action
|
||||||
if (!empty($action) && !empty($call_recordings)) {
|
if (!empty($action) && is_array($call_recordings) && @sizeof($call_recordings) != 0) {
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'delete':
|
case 'delete':
|
||||||
if (permission_exists('call_recording_delete')) {
|
if (permission_exists('call_recording_delete')) {
|
||||||
@@ -148,10 +148,10 @@
|
|||||||
unset($sql, $parameters);
|
unset($sql, $parameters);
|
||||||
|
|
||||||
//count the results
|
//count the results
|
||||||
$result_count = !empty($call_recordings) ? sizeof($call_recordings) : 0;
|
$result_count = is_array($call_recordings) ? sizeof($call_recordings) : 0;
|
||||||
|
|
||||||
//limit the number of results
|
//limit the number of results
|
||||||
if ($_SESSION['cdr']['limit']['numeric'] > 0) {
|
if (!empty($_SESSION['cdr']['limit']['numeric']) && $_SESSION['cdr']['limit']['numeric'] > 0) {
|
||||||
$num_rows = $_SESSION['cdr']['limit']['numeric'];
|
$num_rows = $_SESSION['cdr']['limit']['numeric'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,8 +160,8 @@
|
|||||||
if ($show == "all" && permission_exists('call_recording_all')) {
|
if ($show == "all" && permission_exists('call_recording_all')) {
|
||||||
$param .= "&show=all";
|
$param .= "&show=all";
|
||||||
}
|
}
|
||||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true, $result_count); //top
|
list($paging_controls_mini, $rows_per_page) = paging($num_rows ?? null, $param, $rows_per_page, true, $result_count); //top
|
||||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page, false, $result_count); //bottom
|
list($paging_controls, $rows_per_page) = paging($num_rows ?? null, $param, $rows_per_page, false, $result_count); //bottom
|
||||||
|
|
||||||
//create token
|
//create token
|
||||||
$object = new token;
|
$object = new token;
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
echo " <input type='hidden' name='show' value='all'>";
|
echo " <input type='hidden' name='show' value='all'>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type='.urlencode($destination_type ?? '').'&show=all'.($search ? "&search=".urlencode($search) : null)]);
|
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type='.urlencode($destination_type ?? '').'&show=all'.(!empty($search) ? "&search=".urlencode($search) : null)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=\"$('#btn_reset').hide(); $('#btn_search').show();\">";
|
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=\"$('#btn_reset').hide(); $('#btn_search').show();\">";
|
||||||
@@ -244,7 +244,7 @@
|
|||||||
}
|
}
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
if (!empty($call_recordings)) {
|
if (is_array($call_recordings) && @sizeof($call_recordings) != 0) {
|
||||||
$x = 0;
|
$x = 0;
|
||||||
foreach ($call_recordings as $row) {
|
foreach ($call_recordings as $row) {
|
||||||
//playback progress bar
|
//playback progress bar
|
||||||
@@ -262,7 +262,7 @@
|
|||||||
echo " <input type='hidden' name='call_recordings[$x][uuid]' value='".escape($row['call_recording_uuid'])."' />\n";
|
echo " <input type='hidden' name='call_recordings[$x][uuid]' value='".escape($row['call_recording_uuid'])."' />\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
}
|
}
|
||||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('call_recording_all')) {
|
if ($show == "all" && permission_exists('call_recording_all')) {
|
||||||
echo " <td class='overflow hide-sm-dn shrink'>".escape($row['domain_name'])."</td>\n";
|
echo " <td class='overflow hide-sm-dn shrink'>".escape($row['domain_name'])."</td>\n";
|
||||||
}
|
}
|
||||||
echo " <td class='hide-sm-dn shrink'>".escape($row['caller_id_name'])."</td>\n";
|
echo " <td class='hide-sm-dn shrink'>".escape($row['caller_id_name'])."</td>\n";
|
||||||
|
|||||||
@@ -160,15 +160,11 @@ if (!class_exists('call_recordings')) {
|
|||||||
unset($sql, $parameters, $row);
|
unset($sql, $parameters, $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
//set the path for the directory
|
|
||||||
// $default_path = $_SESSION['switch']['call_recordings']['dir']."/".$_SESSION['domain_name'];
|
|
||||||
|
|
||||||
//build full path
|
//build full path
|
||||||
$full_recording_path = $call_recording_path.'/'.$call_recording_name;
|
$full_recording_path = $call_recording_path.'/'.$call_recording_name;
|
||||||
|
|
||||||
//download the file
|
//download the file
|
||||||
if ($full_recording_path != '/' && file_exists($full_recording_path)) {
|
if ($full_recording_path != '/' && file_exists($full_recording_path)) {
|
||||||
// ob_clean();
|
|
||||||
$fd = fopen($full_recording_path, "rb");
|
$fd = fopen($full_recording_path, "rb");
|
||||||
if ($this->binary) {
|
if ($this->binary) {
|
||||||
header("Content-Type: application/force-download");
|
header("Content-Type: application/force-download");
|
||||||
@@ -190,8 +186,8 @@ if (!class_exists('call_recordings')) {
|
|||||||
if ($this->binary) {
|
if ($this->binary) {
|
||||||
header("Content-Length: ".filesize($full_recording_path));
|
header("Content-Length: ".filesize($full_recording_path));
|
||||||
}
|
}
|
||||||
// ob_clean();
|
ob_clean();
|
||||||
// fpassthru($fd);
|
fpassthru($fd);
|
||||||
|
|
||||||
//content-range
|
//content-range
|
||||||
if (isset($_SERVER['HTTP_RANGE']) && !$this->binary) {
|
if (isset($_SERVER['HTTP_RANGE']) && !$this->binary) {
|
||||||
@@ -303,4 +299,4 @@ if (!class_exists('call_recordings')) {
|
|||||||
} //class
|
} //class
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class cache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//cache method memcache
|
//cache method memcache
|
||||||
if ($_SESSION['cache']['method']['text'] == "memcache") {
|
if (!empty($_SESSION['cache']['method']['text']) && $_SESSION['cache']['method']['text'] == "memcache") {
|
||||||
//connect to event socket
|
//connect to event socket
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||||
if ($fp === false) {
|
if ($fp === false) {
|
||||||
@@ -128,7 +128,7 @@ class cache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//cache method file
|
//cache method file
|
||||||
if ($_SESSION['cache']['method']['text'] == "file") {
|
if (!empty($_SESSION['cache']['method']['text']) && $_SESSION['cache']['method']['text'] == "file") {
|
||||||
//change the delimiter
|
//change the delimiter
|
||||||
$key = str_replace(":", ".", $key);
|
$key = str_replace(":", ".", $key);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user