Dashboard - Missed & Recent Calls: Fix minor inconsistencies.

This commit is contained in:
fusionate 2023-02-23 14:50:16 +00:00
parent e72094543a
commit f6b065085b
No known key found for this signature in database
2 changed files with 17 additions and 14 deletions

View File

@ -6,9 +6,9 @@
//includes files //includes files
require_once "resources/require.php"; require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permisions //check permisions
require_once "resources/check_auth.php";
if (permission_exists('xml_cdr_view')) { if (permission_exists('xml_cdr_view')) {
//access granted //access granted
} }
@ -21,8 +21,7 @@
$language = new text; $language = new text;
$text = $language->get($_SESSION['domain']['language']['code'], 'core/user_settings'); $text = $language->get($_SESSION['domain']['language']['code'], 'core/user_settings');
//missed calls //create assigned extensions array
echo "<div class='hud_box'>\n";
if (is_array($_SESSION['user']['extension'])) { if (is_array($_SESSION['user']['extension'])) {
foreach ($_SESSION['user']['extension'] as $assigned_extension) { foreach ($_SESSION['user']['extension'] as $assigned_extension) {
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user']; $assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
@ -33,6 +32,7 @@
//if also viewing system status, show more recent calls (more room avaialble) //if also viewing system status, show more recent calls (more room avaialble)
$missed_limit = (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5; $missed_limit = (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5;
//get the missed calls from call detail records
$sql = "select \n"; $sql = "select \n";
$sql .= " direction, \n"; $sql .= " direction, \n";
$sql .= " start_stamp, \n"; $sql .= " start_stamp, \n";
@ -68,17 +68,17 @@
$sql .= "order by \n"; $sql .= "order by \n";
$sql .= "start_epoch desc \n"; $sql .= "start_epoch desc \n";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
//echo $sql;
//view_array($parameters);
if (!isset($database)) { $database = new database; } if (!isset($database)) { $database = new database; }
$result = $database->select($sql, $parameters, 'all'); $result = $database->select($sql, $parameters, 'all');
$num_rows = is_array($result) ? sizeof($result) : 0; $num_rows = is_array($result) ? sizeof($result) : 0;
//define row styles
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
//missed calls
echo "<div class='hud_box'>\n";
//add doughnut chart //add doughnut chart
?> ?>
@ -99,7 +99,7 @@
'<?php echo $_SESSION['dashboard']['missed_calls_chart_sub_background_color']['text']; ?>' '<?php echo $_SESSION['dashboard']['missed_calls_chart_sub_background_color']['text']; ?>'
], ],
borderColor: '<?php echo $_SESSION['dashboard']['missed_calls_chart_border_color']['text']; ?>', borderColor: '<?php echo $_SESSION['dashboard']['missed_calls_chart_border_color']['text']; ?>',
borderWidth: '<?php echo $_SESSION['dashboard']['missed_calls_chart_border_Width']['text']; ?>', borderWidth: '<?php echo $_SESSION['dashboard']['missed_calls_chart_border_width']['text']; ?>',
cutout: chart_cutout cutout: chart_cutout
}] }]
}, },

View File

@ -6,9 +6,9 @@
//includes files //includes files
require_once "resources/require.php"; require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permisions //check permisions
require_once "resources/check_auth.php";
if (permission_exists('xml_cdr_view')) { if (permission_exists('xml_cdr_view')) {
//access granted //access granted
} }
@ -27,6 +27,7 @@
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user']; $assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
} }
} }
unset($assigned_extension);
//if also viewing system status, show more recent calls (more room avaialble) //if also viewing system status, show more recent calls (more room avaialble)
$recent_limit = (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5; $recent_limit = (is_array($selected_blocks) && in_array('counts', $selected_blocks)) ? 10 : 5;
@ -96,8 +97,10 @@
data: { data: {
datasets: [{ datasets: [{
data: ['<?php echo $num_rows; ?>', 0.00001], data: ['<?php echo $num_rows; ?>', 0.00001],
backgroundColor: ['<?php echo $_SESSION['dashboard']['recent_calls_chart_main_background_color']['text']; ?>', backgroundColor: [
'<?php echo $_SESSION['dashboard']['missed_calls_chart_sub_background_color']['text']; ?>'], '<?php echo $_SESSION['dashboard']['recent_calls_chart_main_background_color']['text']; ?>',
'<?php echo $_SESSION['dashboard']['recent_calls_chart_sub_background_color']['text']; ?>'
],
borderColor: '<?php echo $_SESSION['dashboard']['recent_calls_chart_border_color']['text']; ?>', borderColor: '<?php echo $_SESSION['dashboard']['recent_calls_chart_border_color']['text']; ?>',
borderWidth: '<?php echo $_SESSION['dashboard']['recent_calls_chart_border_width']['text']; ?>', borderWidth: '<?php echo $_SESSION['dashboard']['recent_calls_chart_border_width']['text']; ?>',
cutout: chart_cutout cutout: chart_cutout