From 98d5e4fd6754807b182b34905381e15b25c10829 Mon Sep 17 00:00:00 2001
From: Alex <40072887+alexdcrane@users.noreply.github.com>
Date: Mon, 13 May 2024 13:20:33 -0700
Subject: [PATCH] Dashboard - Added chart cutout and text size default settings
(#6976)
---
.../dashboard/call_center_agents.php | 20 ++++++------
.../resources/dashboard/device_keys.php | 32 +++++++++----------
.../resources/dashboard/voicemails.php | 4 +--
.../resources/dashboard/missed_calls.php | 4 +--
.../resources/dashboard/recent_calls.php | 4 +--
core/dashboard/dashboard_edit.php | 18 +++++++++--
core/dashboard/index.php | 20 ++++--------
themes/default/app_config.php | 16 ++++++++++
8 files changed, 71 insertions(+), 47 deletions(-)
diff --git a/app/call_centers/resources/dashboard/call_center_agents.php b/app/call_centers/resources/dashboard/call_center_agents.php
index 18fa2f2782..e8178fee7f 100644
--- a/app/call_centers/resources/dashboard/call_center_agents.php
+++ b/app/call_centers/resources/dashboard/call_center_agents.php
@@ -42,8 +42,8 @@
$text = $language->get($_SESSION['domain']['language']['code'], 'app/call_centers');
//get http variables and set as php variables
- $order_by = $_GET["order_by"];
- $order = $_GET["order"];
+ $order_by = $_GET["order_by"] ?? null;
+ $order = $_GET["order"] ?? null;
//connect to the database
if (!isset($database)) {
@@ -119,7 +119,7 @@
$cmd = "callcenter_config tier del ".$row['queue_extension']."@".$_SESSION['domain_name']." ".$row['id'];
$response = event_socket::api($cmd);
}
-
+
//small sleep
usleep(200);
}
@@ -164,8 +164,8 @@
}
//get the agent details from event socket
- $switch_cmd = 'callcenter_config agent list '.$agent['call_center_agent_uuid'];
- $event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
+ $switch_cmd = 'callcenter_config agent list '.($agent['call_center_agent_uuid'] ?? null);
+ $event_socket_str = trim(event_socket_request($fp ?? null, 'api '.$switch_cmd));
$call_center_agent = csv_to_named_array($event_socket_str, '|');
//set the agent status
@@ -173,7 +173,7 @@
//update the queue status
$x = 0;
- if (is_array($call_center_queues)) {
+ if (!empty($call_center_queues) && is_array($call_center_queues)) {
foreach ($call_center_queues as $queue) {
$call_center_queues[$x]['queue_status'] = 'Logged Out';
foreach ($call_center_tiers as $tier) {
@@ -228,7 +228,7 @@
//echo " radio_checked_value = 'Logged Out';\n";
//echo " }\n";
echo " if (radio_button.checked) { console.log('checked: '+radio_button.value) }\n";
- echo " if (radio_button.value === 'Available' && agent_status === 'Available') {\n"; // radio_checked_value == 'On Break' &&
+ echo " if (radio_button.value === 'Available' && agent_status === 'Available') {\n"; // radio_checked_value == 'On Break' &&
//echo " radio_button.checked = true;\n";
//echo " radio_button.value = 'Available';\n";
//echo " radio_button[agent_status]\"]:checked').value == 'On Break';\n";
@@ -236,7 +236,7 @@
//echo " console.log('need to change status On Break to Available');\n";
//echo " console.log('---');\n";
echo " }\n";
- echo " if (radio_button.value === 'On Break' && agent_status === 'On Break') {\n"; // radio_checked_value == 'Available' &&
+ echo " if (radio_button.value === 'On Break' && agent_status === 'On Break') {\n"; // radio_checked_value == 'Available' &&
//echo " radio_button.checked = true;\n";
//echo " radio_button.value = 'On Break';\n";
//echo " radio_button[agent_status]\"]:checked').value == 'On Break';\n";
@@ -259,7 +259,7 @@
//show the content
echo "
\n";
- echo "
".$text['header-call_center_queues'].($agent['agent_name'] != '' ? " Agent: ".$agent['agent_name']."" : "")."
\n";
+ echo "
".$text['header-call_center_queues'].(!empty($agent['agent_name']) ? " Agent: ".$agent['agent_name']."" : "")."
\n";
echo "
\n";
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"document.getElementById('form_list_call_center_agent_dashboard').submit();"]);
echo "
\n";
@@ -274,7 +274,7 @@
echo "
".$text['label-status']." | \n";
echo "\n";
- if (is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
+ if (!empty($call_center_queues) && is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
$x = 0;
foreach ($call_center_queues as $row) {
$onclick = "onclick=\"cycle('agents[".$x."][agent_status]');\"";
diff --git a/app/devices/resources/dashboard/device_keys.php b/app/devices/resources/dashboard/device_keys.php
index 23a5eeaf2e..54439c8d2e 100644
--- a/app/devices/resources/dashboard/device_keys.php
+++ b/app/devices/resources/dashboard/device_keys.php
@@ -308,7 +308,7 @@
unset($sql, $parameters, $row);
//get device lines
- if (is_uuid($device_uuid)) {
+ if (!empty($device_uuid) && is_uuid($device_uuid)) {
$sql = "select * from v_device_lines ";
$sql .= "where device_uuid = :device_uuid ";
$parameters['device_uuid'] = $device_uuid;
@@ -317,7 +317,7 @@
}
//get the user
- if (is_array($device_lines)) {
+ if (!empty($device_lines) && is_array($device_lines)) {
foreach ($device_lines as $row) {
if ($_SESSION['domain_name'] == $row['server_address']) {
$user_id = $row['user_id'];
@@ -331,7 +331,7 @@
$sip_profile_name = 'internal';
//get the device keys in the right order where device keys are listed after the profile keys
- if (is_uuid($device_uuid)) {
+ if (!empty($device_uuid) && is_uuid($device_uuid)) {
$sql = "select * from v_device_keys ";
$sql .= "where (";
$sql .= "device_uuid = :device_uuid ";
@@ -356,7 +356,7 @@
}
//override profile keys with device keys
- if (is_array($keys) && @sizeof($keys) != 0) {
+ if (!empty($keys) && is_array($keys) && @sizeof($keys) != 0) {
foreach($keys as $row) {
$id = $row['device_key_id'];
$device_keys[$id] = $row;
@@ -371,7 +371,7 @@
}
//get the vendor count and last and device information
- if (is_array($device_keys) && @sizeof($device_keys) != 0) {
+ if (!empty($device_keys) && is_array($device_keys) && @sizeof($device_keys) != 0) {
$vendor_count = 0;
foreach($device_keys as $row) {
if ($previous_vendor != $row['device_key_vendor']) {
@@ -388,10 +388,10 @@
//add a new key
if (permission_exists('device_key_add')) {
- $device_keys[$x]['device_key_category'] = $device_key_category;
+ $device_keys[$x]['device_key_category'] = $device_key_category ?? '';
$device_keys[$x]['device_key_id'] = '';
- $device_keys[$x]['device_uuid'] = $device_uuid;
- $device_keys[$x]['device_key_vendor'] = $device_key_vendor;
+ $device_keys[$x]['device_uuid'] = $device_uuid ?? '';
+ $device_keys[$x]['device_key_vendor'] = $device_key_vendor ?? '';
$device_keys[$x]['device_key_type'] = '';
$device_keys[$x]['device_key_line'] = '';
$device_keys[$x]['device_key_value'] = '';
@@ -422,7 +422,7 @@
unset($device_keys[$row['device_key_id']]);
}
//hide protected keys
- if ($row['device_key_protected'] == "true") {
+ if (!empty($row['device_key_protected']) && $row['device_key_protected'] == "true") {
unset($device_keys[$row['device_key_id']]);
}
}
@@ -436,13 +436,13 @@
echo "
\n";
echo "
".$text['title-device_keys']."
\n";
echo "
\n";
- echo button::create(['type'=>'button','label'=>$text['button-apply'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"document.location.href='".PROJECT_PATH."/app/devices/cmd.php?cmd=check_sync&profile=".$sip_profile_name."&user=".$user_id."@".$server_address."&domain=".$server_address."&agent=".$device_key_vendor."';"]);
+ echo button::create(['type'=>'button','label'=>$text['button-apply'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"document.location.href='".PROJECT_PATH."/app/devices/cmd.php?cmd=check_sync&profile=".$sip_profile_name."&user=".($user_id ?? '')."@".($server_address ?? '')."&domain=".($server_address ?? '')."&agent=".($device_key_vendor ?? '')."';"]);
echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"list_form_submit('form_list_device_keys');"]);
echo "
\n";
echo "
\n";
echo "
\n";
- if (!$is_included) {
+ if (!empty($is_included) && !$is_included) {
echo $text['description-device_keys']."\n";
echo "
\n";
}
@@ -458,7 +458,7 @@
$device_vendor = $row['device_key_vendor'];
//set the column names
- if ($previous_device_key_vendor != $row['device_key_vendor'] || $row['device_key_vendor'] == '') {
+ if (!empty($previous_device_key_vendor) && $previous_device_key_vendor != $row['device_key_vendor'] || $row['device_key_vendor'] == '') {
echo "