mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
CDR: List view updates.
This commit is contained in:
@@ -60,6 +60,26 @@ $text['title']['ru-ru'] = "Детализация Вызовов";
|
||||
$text['title']['sv-se'] = "Detaljerad Samtalsinformation";
|
||||
$text['title']['uk-ua'] = "Параметри облікового запису";
|
||||
|
||||
$text['title-call_detail_records']['en-us'] = "Call Detail Records";
|
||||
$text['title-call_detail_records']['ar-eg'] = "";
|
||||
$text['title-call_detail_records']['de-at'] = "Meine Gespräche"; //copied from de-de
|
||||
$text['title-call_detail_records']['de-ch'] = "Meine Gespräche"; //copied from de-de
|
||||
$text['title-call_detail_records']['de-de'] = "Meine Gespräche";
|
||||
$text['title-call_detail_records']['es-cl'] = "Registro de Detalle de Llamadas";
|
||||
$text['title-call_detail_records']['es-mx'] = "Registro de Detalle de Llamadas"; //copied from es-cl
|
||||
$text['title-call_detail_records']['fr-ca'] = "Historique détaillé des appels"; //copied from fr-fr
|
||||
$text['title-call_detail_records']['fr-fr'] = "Historique détaillé des appels";
|
||||
$text['title-call_detail_records']['he-il'] = "";
|
||||
$text['title-call_detail_records']['it-it'] = "Cartellini di Chiamata";
|
||||
$text['title-call_detail_records']['nl-nl'] = "";
|
||||
$text['title-call_detail_records']['pl-pl'] = "Wykaz rozmów";
|
||||
$text['title-call_detail_records']['pt-br'] = "Configurações da Conta";
|
||||
$text['title-call_detail_records']['pt-pt'] = "Registo de Chamadas";
|
||||
$text['title-call_detail_records']['ro-ro'] = "";
|
||||
$text['title-call_detail_records']['ru-ru'] = "Детализация Вызовов";
|
||||
$text['title-call_detail_records']['sv-se'] = "Detaljerad Samtalsinformation";
|
||||
$text['title-call_detail_records']['uk-ua'] = "Параметри облікового запису";
|
||||
|
||||
$text['title-archive']['en-us'] = "Call Detail Records Archive";
|
||||
$text['title-archive']['ar-eg'] = "";
|
||||
$text['title-archive']['de-at'] = "Meine Gespräche Archiv"; //copied from de-de
|
||||
@@ -2340,6 +2360,26 @@ $text['label-seconds']['ru-ru'] = "Sec";
|
||||
$text['label-seconds']['sv-se'] = "Sec";
|
||||
$text['label-seconds']['uk-ua'] = "Sec";
|
||||
|
||||
$text['label-format']['en-us'] = "Format";
|
||||
$text['label-format']['ar-eg'] = "Format";
|
||||
$text['label-format']['de-at'] = "Format";
|
||||
$text['label-format']['de-ch'] = "Format";
|
||||
$text['label-format']['de-de'] = "Format";
|
||||
$text['label-format']['es-cl'] = "Format";
|
||||
$text['label-format']['es-mx'] = "Format";
|
||||
$text['label-format']['fr-ca'] = "Format";
|
||||
$text['label-format']['fr-fr'] = "Format";
|
||||
$text['label-format']['he-il'] = "Format";
|
||||
$text['label-format']['it-it'] = "Format";
|
||||
$text['label-format']['nl-nl'] = "Format";
|
||||
$text['label-format']['pl-pl'] = "Format";
|
||||
$text['label-format']['pt-br'] = "Format";
|
||||
$text['label-format']['pt-pt'] = "Format";
|
||||
$text['label-format']['ro-ro'] = "Format";
|
||||
$text['label-format']['ru-ru'] = "Format";
|
||||
$text['label-format']['sv-se'] = "Format";
|
||||
$text['label-format']['uk-ua'] = "Format";
|
||||
|
||||
$text['description_search']['en-us'] = "<u>Note</u>: Destination and Caller ID (CID) Name fields support the use of an <i>asterisk</i> ('*') as a wildcard character.";
|
||||
$text['description_search']['ar-eg'] = "";
|
||||
$text['description_search']['de-at'] = "Info: Ziel und Anruferkennung (CID) Namesfelder unterstützen die Verwendung von Stern ('*') als Wildcard Zeichen."; //copied from de-de
|
||||
|
||||
@@ -50,6 +50,16 @@ if (!class_exists('xml_cdr')) {
|
||||
public $include_internal;
|
||||
public $extensions;
|
||||
|
||||
/**
|
||||
* delete method
|
||||
*/
|
||||
private $app_name;
|
||||
private $app_uuid;
|
||||
private $permission_prefix;
|
||||
private $list_page;
|
||||
private $table;
|
||||
private $uuid_prefix;
|
||||
|
||||
/**
|
||||
* Called when the object is created
|
||||
*/
|
||||
@@ -61,6 +71,14 @@ if (!class_exists('xml_cdr')) {
|
||||
$database->connect();
|
||||
$this->db = $database->db;
|
||||
}
|
||||
|
||||
//assign private variables (for delete method)
|
||||
$this->app_name = 'xml_cdr';
|
||||
$this->app_uuid = '4a085c51-7635-ff03-f67b-86e834422848';
|
||||
$this->permission_prefix = 'xml_cdr_';
|
||||
$this->list_page = 'xml_cdr.php';
|
||||
$this->table = 'xml_cdr';
|
||||
$this->uuid_prefix = 'xml_cdr_';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1104,6 +1122,82 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
} //end download method
|
||||
|
||||
/**
|
||||
* delete records
|
||||
*/
|
||||
public function delete($records) {
|
||||
if (permission_exists($this->permission_prefix.'delete')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//delete multiple records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
$records_deleted = 0;
|
||||
|
||||
//loop through records
|
||||
foreach($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
|
||||
//get the call recordings
|
||||
$sql = "select * from v_call_recordings ";
|
||||
$sql .= "where call_recording_uuid = :xml_cdr_uuid ";
|
||||
$parameters['xml_cdr_uuid'] = $record['uuid'];
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//delete the call recording (file)
|
||||
$call_recording_path = realpath($row['call_recording_path']);
|
||||
$call_recording_name = $row['call_recording_name'];
|
||||
if (file_exists($call_recording_path.'/'.$call_recording_name)) {
|
||||
@unlink($call_recording_path.'/'.$call_recording_name);
|
||||
}
|
||||
|
||||
//build the delete array
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
|
||||
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['call_recordings'][$x]['call_recording_uuid'] = $record['uuid'];
|
||||
|
||||
//increment counter
|
||||
$records_deleted++;
|
||||
}
|
||||
}
|
||||
|
||||
//delete the checked rows
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p->add('call_recording_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->delete($array);
|
||||
unset($array);
|
||||
|
||||
//revoke temporary permissions
|
||||
$p->delete('call_recording_delete', 'temp');
|
||||
|
||||
//set message
|
||||
message::add($text['message-delete'].": ".$records_deleted);
|
||||
}
|
||||
unset($records);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} //end the class
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permisions
|
||||
if (permission_exists('xml_cdr_view')) {
|
||||
@@ -43,9 +44,30 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get posted data
|
||||
if (is_array($_POST['xml_cdrs'])) {
|
||||
$action = $_POST['action'];
|
||||
$xml_cdrs = $_POST['xml_cdrs'];
|
||||
}
|
||||
|
||||
//delete the cdr
|
||||
if (permission_exists('xml_cdr_delete')) {
|
||||
if ($action == 'delete' && is_array($xml_cdrs) && @sizeof($xml_cdrs) != 0) {
|
||||
//delete
|
||||
$obj = new xml_cdr;
|
||||
$obj->delete($xml_cdrs);
|
||||
//redirect
|
||||
header('Location: xml_cdr.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//additional includes
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//xml cdr include
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
@@ -72,16 +94,15 @@
|
||||
echo " function toggle_select(select_id) {";
|
||||
echo " $('#'+select_id).fadeToggle(fade_speed, function() {";
|
||||
echo " document.getElementById(select_id).selectedIndex = 0;";
|
||||
echo " document.getElementById(select_id).focus();";
|
||||
echo " });";
|
||||
echo " }";
|
||||
echo "</script>";
|
||||
|
||||
//page title and description
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' nowrap='nowrap' style='vertical-align: top;'><b>".$text['title']."</b><br><br><br></td>\n";
|
||||
echo "<td align='right' width='100%' style='vertical-align: top;'>\n";
|
||||
echo " <form id='frm_export' method='post' action='xml_cdr_export.php'>\n";
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <b style='float: left;'>".$text['title-call_detail_records']."</b>\n";
|
||||
echo " <form id='frm_export' class='inline' method='post' action='xml_cdr_export.php'>\n";
|
||||
echo " <input type='hidden' name='cdr_id' value='".escape($cdr_id)."'>\n";
|
||||
echo " <input type='hidden' name='direction' value='".escape($direction)."'>\n";
|
||||
echo " <input type='hidden' name='caller_id_name' value='".escape($caller_id_name)."'>\n";
|
||||
@@ -124,42 +145,36 @@
|
||||
echo " <input type='hidden' name='order_by' value='".escape($order_by)."'>\n";
|
||||
echo " <input type='hidden' name='order' value='".escape($order)."'>\n";
|
||||
}
|
||||
if (permission_exists('xml_cdr_all') && $_REQUEST['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>\n";
|
||||
if (permission_exists('bridge_delete')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
echo " <table cellpadding='0' cellspacing='0' border='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td style='vertical-align: top;'>\n";
|
||||
if (permission_exists('xml_cdr_all')) {
|
||||
if ($_REQUEST['show'] != 'alll') {
|
||||
echo " <input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='xml_cdr.php?show=all';\">\n";
|
||||
if ($_REQUEST['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>\n";
|
||||
}
|
||||
else {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
|
||||
}
|
||||
}
|
||||
if ($_GET['call_result'] != 'missed') {
|
||||
echo " <input type='button' class='btn' value='".$text['button-missed']."' onclick=\"document.location.href='xml_cdr.php?call_result=missed';\">\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-missed'],'icon'=>'phone-slash','link'=>'?call_result=missed']);
|
||||
}
|
||||
echo " <input type='button' class='btn' value='".$text['button-statistics']."' onclick=\"document.location.href='xml_cdr_statistics.php';\">\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-statistics'],'icon'=>'chart-area','link'=>'xml_cdr_statistics.php']);
|
||||
if (permission_exists('xml_cdr_archive')) {
|
||||
if ($_REQUEST['show'] == 'all') {
|
||||
$query_string = "show=all";
|
||||
}
|
||||
echo " <input type='button' class='btn' value='".$text['button-archive']."' onclick=\"window.location='xml_cdr_archive.php?".escape($query_string)."';\">\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-archive'],'icon'=>'archive','link'=>'xml_cdr_archive.php'.($_REQUEST['show'] == 'all' ? '?show=all' : null)]);
|
||||
}
|
||||
echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>'file-export','onclick'=>"toggle_select('export_format'); this.blur();"]);
|
||||
echo "<select class='formfld' style='display: none; width: auto;' name='export_format' id='export_format' onchange=\"display_message('".$text['message-preparing_download']."'); toggle_select('export_format'); document.getElementById('frm_export').submit();\">";
|
||||
echo "<option value='' disabled='disabled' selected='selected'>".$text['label-format']."</option>";
|
||||
echo "<option value='csv'>CSV</option>";
|
||||
echo "<option value='pdf'>PDF</option>";
|
||||
echo "</select>";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-refresh'],'icon'=>'sync-alt','link'=>'xml_cdr.php']);
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
||||
}
|
||||
echo " <input type='button' class='btn' value='".$text['button-export']."' onclick=\"toggle_select('export_format');\">\n";
|
||||
echo " <select class='formfld' style='display: none; width: auto; margin-left: 3px;' name='export_format' id='export_format' onchange=\"display_message('".$text['message-preparing_download']."'); toggle_select('export_format'); document.getElementById('frm_export').submit();\">\n";
|
||||
echo " <option value=''>...</option>\n";
|
||||
echo " <option value='csv'>CSV</option>\n";
|
||||
echo " <option value='pdf'>PDF</option>\n";
|
||||
echo " </select>\n";
|
||||
echo " <input type='button' class='btn' value='".$text['button-refresh']."' onclick=\"document.location.href='xml_cdr.php';\" />\n";
|
||||
echo " </td>";
|
||||
echo " <td style='vertical-align: top; padding-left: 15px;'>".$paging_controls_mini."</td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo " </form>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo $text['description']." \n";
|
||||
echo $text['description2']." \n";
|
||||
@@ -167,7 +182,6 @@
|
||||
echo $text['description-4']." \n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
|
||||
//basic search of call detail records
|
||||
if (permission_exists('xml_cdr_search')) {
|
||||
echo "<form method='get' action=''>\n";
|
||||
@@ -243,7 +257,7 @@
|
||||
echo " <div class='label'>\n";
|
||||
echo " ".$text['label-caller_id']."\n";
|
||||
echo " </div>\n";
|
||||
echo " <div class='field nowrap'>\n";
|
||||
echo " <div class='field no-wrap'>\n";
|
||||
echo " <input type='text' class='formfld' name='caller_id_name' style='min-width: 115px; width: 115px;' placeholder=\"".$text['label-name']."\" value='".escape($caller_id_name)."'>\n";
|
||||
echo " <input type='text' class='formfld' name='caller_id_number' style='min-width: 115px; width: 115px;' placeholder=\"".$text['label-number']."\" value='".escape($caller_id_number)."'>\n";
|
||||
echo " </div>\n";
|
||||
@@ -254,7 +268,7 @@
|
||||
echo " <div class='label'>\n";
|
||||
echo " ".$text['label-start_range']."\n";
|
||||
echo " </div>\n";
|
||||
echo " <div class='field nowrap'>\n";
|
||||
echo " <div class='field no-wrap'>\n";
|
||||
echo " <input type='text' class='formfld datetimepicker' data-toggle='datetimepicker' data-target='#start_stamp_begin' onblur=\"$(this).datetimepicker('hide');\" style='min-width: 115px; width: 115px;' name='start_stamp_begin' id='start_stamp_begin' placeholder='".$text['label-from']."' value='".escape($start_stamp_begin)."'>\n";
|
||||
echo " <input type='text' class='formfld datetimepicker' data-toggle='datetimepicker' data-target='#start_stamp_end' onblur=\"$(this).datetimepicker('hide');\" style='min-width: 115px; width: 115px;' name='start_stamp_end' id='start_stamp_end' placeholder='".$text['label-to']."' value='".escape($start_stamp_end)."'>\n";
|
||||
echo " </div>\n";
|
||||
@@ -265,7 +279,7 @@
|
||||
echo " <div class='label'>\n";
|
||||
echo " ".$text['label-duration']." (".$text['label-seconds'].")\n";
|
||||
echo " </div>\n";
|
||||
echo " <div class='field nowrap'>\n";
|
||||
echo " <div class='field no-wrap'>\n";
|
||||
echo " <input type='text' class='formfld' style='min-width: 75px; width: 75px;' name='duration_min' value='".escape($duration_min)."' placeholder=\"".$text['label-minimum']."\">\n";
|
||||
echo " <input type='text' class='formfld' style='min-width: 75px; width: 75px;' name='duration_max' value='".escape($duration_max)."' placeholder=\"".$text['label-maximum']."\">\n";
|
||||
echo " </div>\n";
|
||||
@@ -296,7 +310,7 @@
|
||||
echo " <div class='label'>\n";
|
||||
echo " ".$text['label-tta']." (".$text['label-seconds'].")\n";
|
||||
echo " </div>\n";
|
||||
echo " <div class='field nowrap'>\n";
|
||||
echo " <div class='field no-wrap'>\n";
|
||||
echo " <input type='text' class='formfld' style='min-width: 75px; width: 75px;' name='tta_min' id='tta_min' value='".escape($tta)."' placeholder=\"".$text['label-minimum']."\">\n";
|
||||
echo " <input type='text' class='formfld' style='min-width: 75px; width: 75px;' name='tta_max' id='tta_max' value='".escape($tta)."' placeholder=\"".$text['label-maximum']."\">\n";
|
||||
echo " </div>\n";
|
||||
@@ -371,7 +385,7 @@
|
||||
echo " <div class='label'>\n";
|
||||
echo " ".$text['label-order']."\n";
|
||||
echo " </div>\n";
|
||||
echo " <div class='field nowrap'>\n";
|
||||
echo " <div class='field no-wrap'>\n";
|
||||
echo " <select name='order_by' class='formfld'>\n";
|
||||
if (permission_exists('xml_cdr_extension')) {
|
||||
echo " <option value='extension' ".($order_by == 'extension' ? "selected='selected'" : null).">".$text['label-extension']."</option>\n";
|
||||
@@ -436,18 +450,16 @@
|
||||
|
||||
echo "</div>\n";
|
||||
|
||||
button::$collapse = false;
|
||||
echo "<div style='float: right; padding-top: 8px; margin-left: 20px; white-space: nowrap;'>";
|
||||
if (permission_exists('xml_cdr_all') && $_REQUEST['show'] == 'all') {
|
||||
echo "<input type='hidden' name='show' value='all'>\n";
|
||||
}
|
||||
if (permission_exists('xml_cdr_search_advanced')) {
|
||||
if ($_REQUEST['show'] == 'all') {
|
||||
$query_string = "show=all";
|
||||
}
|
||||
echo " <a href='xml_cdr_search.php?".escape($query_string)."'><button type='button' class='btn btn-default' style='margin-right: 20px;'>".$text['button-advanced_search']."</button></a>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-advanced_search'],'icon'=>'bolt','link'=>"xml_cdr_search.php".($_REQUEST['show'] == 'all' ? '?show=all' : null),'style'=>'margin-right: 15px;']);
|
||||
}
|
||||
echo " <input type='button' class='btn' value='".$text['button-reset']."' onclick=\"document.location.href='xml_cdr.php';\">\n";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>\n";
|
||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button', 'link'=>'xml_cdr.php']);
|
||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','name'=>'submit']);
|
||||
echo "</div>\n";
|
||||
echo "<div style='font-size: 85%; padding-top: 8px;'>".$text['description_search']."</div>\n";
|
||||
|
||||
@@ -461,11 +473,15 @@
|
||||
|
||||
//show the results
|
||||
$col_count = 0;
|
||||
echo "<form name='frm' method='post' action='xml_cdr_delete.php'>\n";
|
||||
echo "<table class='tr_hover' width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<form id='form_list' method='post'>\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('xml_cdr_delete') && $result_count > 0) {
|
||||
echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' value='' onclick='list_all_toggle();'>\n";
|
||||
echo " </th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
|
||||
@@ -483,7 +499,7 @@
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_caller_id_name')) {
|
||||
echo "<th>".$text['label-caller_id_name']."</th>\n";
|
||||
echo "<th class='hide-md-dn'>".$text['label-caller_id_name']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_caller_id_number')) {
|
||||
@@ -491,7 +507,7 @@
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_caller_destination')) {
|
||||
echo "<th>".$text['label-caller_destination']."</th>\n";
|
||||
echo "<th class='hide-md-dn'>".$text['label-caller_destination']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_destination')) {
|
||||
@@ -499,7 +515,7 @@
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_recording') && (permission_exists('recording_play') || permission_exists('recording_download'))) {
|
||||
echo "<th>".$text['label-recording']."</th>\n";
|
||||
echo "<th class='center'>".$text['label-recording']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_custom_fields')) {
|
||||
@@ -510,34 +526,34 @@
|
||||
$field_label = ucwords(str_replace("_", " ", $field_name));
|
||||
$field_label = str_replace("Sip", "SIP", $field_label);
|
||||
if ($field_name != "destination_number") {
|
||||
echo "<th style='text-align: right;'>".$field_label."</th>\n";
|
||||
echo "<th class='right'>".$field_label."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (permission_exists('xml_cdr_start')) {
|
||||
echo "<th style='text-align: center;'>".$text['label-start']."</th>\n";
|
||||
echo "<th class='center'>".$text['label-start']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_tta')) {
|
||||
echo "<th style='text-align: right;' title=\"".$text['description-tta']."\">".$text['label-tta']."</th>\n";
|
||||
echo "<th class='right hide-md-dn' title=\"".$text['description-tta']."\">".$text['label-tta']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_duration')) {
|
||||
echo "<th style='text-align: center;'>".$text['label-duration']."</th>\n";
|
||||
echo "<th class='center hide-sm-dn'>".$text['label-duration']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_pdd')) {
|
||||
echo "<th style='text-align: right;' title=\"".$text['description-pdd']."\">".$text['label-pdd']."</th>\n";
|
||||
echo "<th class='right hide-md-dn' title=\"".$text['description-pdd']."\">".$text['label-pdd']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_mos')) {
|
||||
echo "<th style='text-align: center;' title=\"".$text['description-mos']."\">".$text['label-mos']."</th>\n";
|
||||
echo "<th class='center hide-md-dn' title=\"".$text['description-mos']."\">".$text['label-mos']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_hangup_cause')) {
|
||||
echo "<th>".$text['label-hangup_cause']."</th>\n";
|
||||
echo "<th class='hide-sm-dn'>".$text['label-hangup_cause']."</th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
else {
|
||||
@@ -545,16 +561,13 @@
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('xml_cdr_details')) {
|
||||
echo "<td class='list_control_icon'>";
|
||||
if (permission_exists('xml_cdr_delete') && $result_count > 0) {
|
||||
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "<td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
//show results
|
||||
if (is_array($result)) {
|
||||
|
||||
//determine if theme images exist
|
||||
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/";
|
||||
$theme_cdr_images_exist = (
|
||||
@@ -572,12 +585,13 @@
|
||||
) ? true : false;
|
||||
|
||||
//loop through the results
|
||||
$x = 0;
|
||||
foreach ($result as $index => $row) {
|
||||
//get the date and time
|
||||
$tmp_year = date("Y", strtotime($row['start_stamp']));
|
||||
$tmp_month = date("M", strtotime($row['start_stamp']));
|
||||
$tmp_day = date("d", strtotime($row['start_stamp']));
|
||||
$tmp_start_epoch = ($_SESSION['domain']['time_format']['text'] == '12h') ? date("j M Y g:i:sa", $row['start_epoch']) : date("j M Y H:i:s", $row['start_epoch']);
|
||||
$tmp_start_epoch = ($_SESSION['domain']['time_format']['text'] == '12h') ? escape(date("j M Y", $row['start_epoch']))." <span class='hide-md-dn'>".escape(date("g:i:sa", $row['start_epoch']))."</span>" : escape(date("j M Y", $row['start_epoch']))." <span class='hide-md-dn'>".escape(date("H:i:s", $row['start_epoch']))."</span>";
|
||||
|
||||
//get the hangup cause
|
||||
$hangup_cause = $row['hangup_cause'];
|
||||
@@ -606,27 +620,23 @@
|
||||
|
||||
//recording playback
|
||||
if (permission_exists('recording_play') && $record_path != '') {
|
||||
$content .= "<tr id='recording_progress_bar_".$row['xml_cdr_uuid']."' style='display: none;'><td class='".$row_style[$c]." playback_progress_bar_background' style='padding: 0; border: none;' colspan='".$col_count."'><span class='playback_progress_bar' id='recording_progress_".$row['xml_cdr_uuid']."'></span></td></tr>\n";
|
||||
$content .= "<tr class='list-row' id='recording_progress_bar_".$row['xml_cdr_uuid']."' style='display: none;'><td class='playback_progress_bar_background' style='padding: 0; border: none;' colspan='".$col_count."'><span class='playback_progress_bar' id='recording_progress_".$row['xml_cdr_uuid']."'></span></td></tr>\n";
|
||||
$content .= "<tr class='list-row' style='display: none;'><td></td></tr>\n"; // dummy table row to maintain alternating background color
|
||||
}
|
||||
|
||||
if (permission_exists('xml_cdr_details')) {
|
||||
$tr_link = "href='xml_cdr_details.php?id=".urlencode($row['xml_cdr_uuid']).(($_REQUEST['show']) ? "&show=all" : null)."'";
|
||||
$list_row_url = "xml_cdr_details.php?id=".urlencode($row['xml_cdr_uuid']).($_REQUEST['show'] ? "&show=all" : null);
|
||||
}
|
||||
else {
|
||||
$tr_link = null;
|
||||
}
|
||||
$content .= "<tr ".$tr_link.">\n";
|
||||
$content .= "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('xml_cdr_delete')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
|
||||
$content .= " <input type='checkbox' name='id[".$index."]' id='checkbox_".escape($row['xml_cdr_uuid'])."' value='".escape($row['xml_cdr_uuid'])."' onclick=\"if (this.checked) { document.getElementById('recording_".escape($row['xml_cdr_uuid'])."').value='".base64_encode(escape($record_path).'/'.escape($record_name))."' } else { document.getElementById('recording_".escape($row['xml_cdr_uuid'])."').value=''; document.getElementById('chk_all').checked = false; }\">";
|
||||
$content .= " <input type='hidden' name='rec[".$index."]' id='recording_".escape($row['xml_cdr_uuid'])."'>";
|
||||
$content .= " </td>";
|
||||
$xml_ids[] = 'checkbox_'.$row['xml_cdr_uuid'];
|
||||
$content .= " <td class='checkbox'>\n";
|
||||
$content .= " <input type='checkbox' name='xml_cdrs[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
$content .= " <input type='hidden' name='xml_cdrs[$x][uuid]' value='".escape($row['xml_cdr_uuid'])."' />\n";
|
||||
$content .= " </td>\n";
|
||||
}
|
||||
|
||||
//determine call result and appropriate icon
|
||||
if (permission_exists('xml_cdr_direction')) {
|
||||
$content .= "<td valign='top' class='".$row_style[$c]."'>\n";
|
||||
$content .= "<td>\n";
|
||||
if ($theme_cdr_images_exist) {
|
||||
if ($row['direction'] == 'inbound' || $row['direction'] == 'local') {
|
||||
if ($row['answer_stamp'] != '' && $row['bridge_uuid'] != '') { $call_result = 'answered'; }
|
||||
@@ -653,23 +663,23 @@
|
||||
}
|
||||
//extension
|
||||
if (permission_exists('xml_cdr_extension')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."'>";
|
||||
$content .= " <td>";
|
||||
$content .= $row['extension'].' ';
|
||||
$content .= " </td>\n";
|
||||
}
|
||||
//domain name
|
||||
if (permission_exists('xml_cdr_all') && $_REQUEST['show'] == "all") {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."'>";
|
||||
$content .= " <td>";
|
||||
$content .= $row['domain_name'].' ';
|
||||
$content .= " </td>\n";
|
||||
}
|
||||
//caller id name
|
||||
if (permission_exists('xml_cdr_caller_id_name')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."'>".escape(substr($row['caller_id_name'], 0, 20))." </td>\n";
|
||||
$content .= " <td class='overflow hide-md-dn'>".escape($row['caller_id_name'])." </td>\n";
|
||||
}
|
||||
//source
|
||||
if (permission_exists('xml_cdr_caller_id_number')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]." tr_link_void' nowrap='nowrap'>";
|
||||
$content .= " <td class='no-link no-wrap'>";
|
||||
$content .= " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode(escape($row['caller_id_name']))."&src_cid_number=".urlencode(escape($row['caller_id_number']))."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode(escape($row['caller_id_number']))."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
|
||||
if (is_numeric($row['caller_id_number'])) {
|
||||
$content .= " ".format_phone(substr($row['caller_id_number'], 0, 20)).' ';
|
||||
@@ -682,7 +692,7 @@
|
||||
}
|
||||
//caller destination
|
||||
if (permission_exists('xml_cdr_caller_destination')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]." tr_link_void' nowrap='nowrap'>";
|
||||
$content .= " <td class='no-link no-wrap hide-md-dn'>";
|
||||
$content .= " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode(escape($row['caller_id_name']))."&src_cid_number=".urlencode(escape($row['caller_id_number']))."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode(escape($row['caller_destination']))."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
|
||||
if (is_numeric($row['caller_destination'])) {
|
||||
$content .= " ".format_phone(escape(substr($row['caller_destination'], 0, 20))).' ';
|
||||
@@ -711,7 +721,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
$content .= " <td valign='top' class='".$row_style[$c]." tr_link_void' nowrap='nowrap'>";
|
||||
$content .= " <td class='no-link no-wrap'>";
|
||||
$content .= " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode(escape($row['destination_number']))."&src_cid_number=".urlencode(escape($row['destination_number']))."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode(escape($row['destination_number']))."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
|
||||
if (is_numeric($row['destination_number'])) {
|
||||
if ($prefix) {
|
||||
@@ -744,22 +754,18 @@
|
||||
//recording
|
||||
if (permission_exists('xml_cdr_recording') && (permission_exists('recording_play') || permission_exists('recording_download'))) {
|
||||
if ($record_path != '' && file_exists($record_path.'/'.$record_name)) {
|
||||
$content .= " <td valign='top' align='center' class='".$row_style[$c]." row_style_slim tr_link_void' nowrap='nowrap'>";
|
||||
$content .= " <td class='button center no-link no-wrap'>";
|
||||
if (permission_exists('recording_play')) {
|
||||
$content .= "<audio id='recording_audio_".escape($row['xml_cdr_uuid'])."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".escape($row['xml_cdr_uuid'])."')\" onended=\"recording_reset('".escape($row['xml_cdr_uuid'])."');\" src=\"download.php?id=".escape($row['xml_cdr_uuid'])."&t=record\" type='".escape($record_type)."'></audio>";
|
||||
$content .= "<span id='recording_button_".escape($row['xml_cdr_uuid'])."' onclick=\"recording_play('".escape($row['xml_cdr_uuid'])."')\" title='".$text['label-play']." / ".$text['label-pause']."'>".$v_link_label_play."</span>";
|
||||
}
|
||||
else {
|
||||
//needs a translation
|
||||
$content .= "Don't have recording_play permission ";
|
||||
$content .= button::create(['type'=>'button','label'=>$text['button-label'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.escape($row['xml_cdr_uuid']),'onclick'=>"recording_play('".escape($row['xml_cdr_uuid'])."')",'title'=>$text['label-play'].' / '.$text['label-pause']]);
|
||||
}
|
||||
if (permission_exists('recording_download')) {
|
||||
$content .= "<a href=\"download.php?id=".escape($row['xml_cdr_uuid'])."&t=bin\" title='".$text['label-download']."'>".$v_link_label_download."</a>";
|
||||
$content .= button::create(['type'=>'button','title'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'link'=>"download.php?id=".urlencode($row['xml_cdr_uuid'])."&t=bin"]);
|
||||
}
|
||||
$content .= " </td>\n";
|
||||
$content .= "</td>\n";
|
||||
}
|
||||
else {
|
||||
$content .= " <td valign='top' align='center' class='".$row_style[$c]."'> </td>\n";
|
||||
$content .= " <td> </td>\n";
|
||||
}
|
||||
}
|
||||
//custom cdr fields
|
||||
@@ -769,26 +775,26 @@
|
||||
$array = explode(",", $field);
|
||||
$field_name = $array[count($array) - 1];
|
||||
if ($field_name != "destination_number") {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."' style='text-align: center;' nowrap='nowrap'>".escape($row[$field_name])."</td>\n";
|
||||
$content .= " <td class='center no-wrap'>".escape($row[$field_name])."</td>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//start
|
||||
if (permission_exists('xml_cdr_start')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."' style='text-align: center;' nowrap='nowrap'>".escape($tmp_start_epoch)."</td>\n";
|
||||
$content .= " <td class='center no-wrap'>".$tmp_start_epoch."</td>\n";
|
||||
}
|
||||
//tta (time to answer)
|
||||
if (permission_exists('xml_cdr_tta')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".(($row['tta'] > 0) ? $row['tta']."s" : " ")."</td>\n";
|
||||
$content .= " <td class='right hide-md-dn'>".(($row['tta'] > 0) ? $row['tta']."s" : " ")."</td>\n";
|
||||
}
|
||||
//duration
|
||||
if (permission_exists('xml_cdr_duration')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".gmdate("G:i:s", $seconds)."</td>\n";
|
||||
$content .= " <td class='center hide-sm-dn'>".gmdate("G:i:s", $seconds)."</td>\n";
|
||||
}
|
||||
//pdd (post dial delay)
|
||||
if (permission_exists("xml_cdr_pdd")) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."' style='text-align: right;'>".number_format(escape($row['pdd_ms'])/1000,2)."s</td>\n";
|
||||
$content .= " <td class='right hide-md-dn'>".number_format(escape($row['pdd_ms'])/1000,2)."s</td>\n";
|
||||
}
|
||||
//mos (mean opinion score)
|
||||
if (permission_exists("xml_cdr_mos")) {
|
||||
@@ -796,24 +802,19 @@
|
||||
$title = " title='".$text['label-mos_score-'.round($row['rtp_audio_in_mos'])]."'";
|
||||
$value = $row['rtp_audio_in_mos'];
|
||||
}
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."'$title style='text-align: center;'>$value</td>\n";
|
||||
$content .= " <td class='center hide-md-dn' ".$title.">".$value."</td>\n";
|
||||
}
|
||||
//hangup cause/call result
|
||||
if (permission_exists('xml_cdr_hangup_cause')) {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'><a ".$tr_link.">".escape($hangup_cause)."</a></td>\n";
|
||||
$content .= " <td class='no-wrap hide-sm-dn'><a href='".$list_row_url."'>".escape($hangup_cause)."</a></td>\n";
|
||||
}
|
||||
else {
|
||||
$content .= " <td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>".ucwords(escape($call_result))."</td>\n";
|
||||
$content .= " <td class='no-wrap hide-sm-dn'>".ucwords(escape($call_result))."</td>\n";
|
||||
}
|
||||
//control icons
|
||||
//action icon
|
||||
if (permission_exists('xml_cdr_details')) {
|
||||
$content .= " <td class='list_control_icons tr_link_void' nowrap='nowrap'>";
|
||||
if ($tr_link != null) {
|
||||
$content .= " <a ".$tr_link." title='".$text['button-view']."'>".$v_link_label_view."</a>";
|
||||
}
|
||||
if (permission_exists('xml_cdr_delete')) {
|
||||
$content .= "<a href='xml_cdr_delete.php?id[]=".escape($row['xml_cdr_uuid'])."&rec[]=".(($record_path != '') ? base64_encode($record_path.'/'.$record_name) : null)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
|
||||
}
|
||||
$content .= " <td class='action-button'>";
|
||||
$content .= button::create(['type'=>'button','title'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'link'=>$list_row_url]);
|
||||
$content .= " </td>\n";
|
||||
}
|
||||
$content .= "</tr>\n";
|
||||
@@ -827,30 +828,18 @@
|
||||
}
|
||||
unset($content);
|
||||
|
||||
//toggle the color
|
||||
$c = $c ? 0 : 1;
|
||||
} //foreach
|
||||
} //if
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
unset($sql, $result, $row_count);
|
||||
|
||||
//paging controls
|
||||
echo "<tr>\n";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
echo "<br><br>";
|
||||
echo $paging_controls;
|
||||
echo "<br><br>";
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<div align='center'>".$paging_controls."</div>\n";
|
||||
|
||||
// check or uncheck all checkboxes
|
||||
if (is_array($xml_ids) && sizeof($xml_ids) > 0) {
|
||||
echo "<script>\n";
|
||||
echo " function check(what) {\n";
|
||||
foreach ($xml_ids as $xml_id) {
|
||||
echo "document.getElementById('".$xml_id."').checked = (what == 'all') ? true : false;\n";
|
||||
}
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
}
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</form>\n";
|
||||
|
||||
//store last search/sort query parameters in session
|
||||
$_SESSION['xml_cdr']['last_query'] = $_SERVER["QUERY_STRING"];
|
||||
@@ -858,4 +847,4 @@
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -511,7 +511,6 @@
|
||||
//end where
|
||||
if (strlen($order_by) > 0) {
|
||||
$sql .= order_by($order_by, $order);
|
||||
//$sql .= " order by $order_by $order ";
|
||||
}
|
||||
if ($_REQUEST['export_format'] != "csv" && $_REQUEST['export_format'] != "pdf") {
|
||||
if ($rows_per_page == 0) {
|
||||
@@ -542,12 +541,7 @@
|
||||
unset($database, $sql, $parameters);
|
||||
|
||||
//return the paging
|
||||
list($paging_controls_mini, $rows_per_page, $offset) = paging($num_rows, $param, $rows_per_page, true, $result_count); //top
|
||||
list($paging_controls, $rows_per_page, $offset) = paging($num_rows, $param, $rows_per_page, false, $result_count); //bottom
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $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
|
||||
|
||||
//set the row style
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user