From f6e6750efc8a1126c5cfcf8dd475ac10ac9e6b42 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:40:05 -0700 Subject: [PATCH] Dashboard - Minor changes (#6993) --- .../resources/dashboard/call_forward.php | 4 +-- .../resources/dashboard/domain_limits.php | 4 +-- .../resources/dashboard/caller_id.php | 4 +-- .../dashboard/ring_group_forward.php | 4 +-- .../resources/dashboard/switch_status.php | 4 +-- .../resources/dashboard/system_counts.php | 4 +-- .../resources/dashboard/system_cpu_status.php | 4 +-- .../resources/dashboard/system_status.php | 4 +-- .../resources/dashboard/voicemails.php | 4 +-- .../resources/dashboard/missed_calls.php | 4 +-- .../resources/dashboard/recent_calls.php | 4 +-- core/dashboard/dashboard_edit.php | 19 ++++++-------- core/dashboard/index.php | 12 +++++++-- resources/app_languages.php | 26 +++++++++++++++++++ 14 files changed, 66 insertions(+), 35 deletions(-) diff --git a/app/call_forward/resources/dashboard/call_forward.php b/app/call_forward/resources/dashboard/call_forward.php index ebc51f3ec2..1ee2d2e3cc 100644 --- a/app/call_forward/resources/dashboard/call_forward.php +++ b/app/call_forward/resources/dashboard/call_forward.php @@ -106,7 +106,7 @@ echo " ".$text['header-call_forward']."\n"; //doughnut chart - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { echo "
\n"; echo "\n"; } - if ($dashboard_chart_type == "none") { + if ($dashboard_chart_type == "number") { echo " ".$stats['call_forward'].""; } echo " \n"; diff --git a/app/domain_limits/resources/dashboard/domain_limits.php b/app/domain_limits/resources/dashboard/domain_limits.php index 221f1725a3..e4cb3ae5b5 100644 --- a/app/domain_limits/resources/dashboard/domain_limits.php +++ b/app/domain_limits/resources/dashboard/domain_limits.php @@ -114,7 +114,7 @@ echo " ".$text['label-domain_limits']."\n"; //doughnut chart - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { echo "
\n"; echo "\n"; } - if ($dashboard_chart_type == "none") { + if ($dashboard_chart_type == "number") { echo " ".$hud_stat_used.""; } echo " \n"; diff --git a/app/extensions/resources/dashboard/caller_id.php b/app/extensions/resources/dashboard/caller_id.php index ff45b08124..6c7c0d0087 100644 --- a/app/extensions/resources/dashboard/caller_id.php +++ b/app/extensions/resources/dashboard/caller_id.php @@ -177,7 +177,7 @@ echo " ".$text['label-caller_id_number']."\n"; //doughnut chart - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { echo "
\n"; echo "\n"; } - if ($dashboard_chart_type == "none") { + if ($dashboard_chart_type == "number") { echo " ".$stats['undefined'].""; } echo " \n"; diff --git a/app/ring_groups/resources/dashboard/ring_group_forward.php b/app/ring_groups/resources/dashboard/ring_group_forward.php index 36b5c94a71..5c6f85b557 100644 --- a/app/ring_groups/resources/dashboard/ring_group_forward.php +++ b/app/ring_groups/resources/dashboard/ring_group_forward.php @@ -157,7 +157,7 @@ echo " ".$text['header-ring-group-forward']."\n"; //doughnut chart - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) ||$dashboard_chart_type == "doughnut") { echo "
\n"; echo "\n"; } - if ($dashboard_chart_type == "none") { + if ($dashboard_chart_type == "number") { echo " ".$stats['forwarding'].""; } echo " \n"; diff --git a/app/switch/resources/dashboard/switch_status.php b/app/switch/resources/dashboard/switch_status.php index bbf02ffd43..796e23760a 100644 --- a/app/switch/resources/dashboard/switch_status.php +++ b/app/switch/resources/dashboard/switch_status.php @@ -80,7 +80,7 @@ echo "
\n"; echo " ".$text['label-switch_status']."\n"; - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { //add doughnut chart ?>
@@ -125,7 +125,7 @@ ".$registrations.""; } echo "
\n"; diff --git a/app/system/resources/dashboard/system_counts.php b/app/system/resources/dashboard/system_counts.php index 96a7918445..91794e97d0 100644 --- a/app/system/resources/dashboard/system_counts.php +++ b/app/system/resources/dashboard/system_counts.php @@ -298,7 +298,7 @@ echo "
\n"; echo " ".$text['label-system_counts']."\n"; - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { //add doughnut chart ?>
@@ -354,7 +354,7 @@ ".$domain_total.""; } echo "
\n"; diff --git a/app/system/resources/dashboard/system_cpu_status.php b/app/system/resources/dashboard/system_cpu_status.php index f6ad1105e7..c34c8c4f73 100644 --- a/app/system/resources/dashboard/system_cpu_status.php +++ b/app/system/resources/dashboard/system_cpu_status.php @@ -55,7 +55,7 @@ echo " ".$text['label-cpu_usage']."\n"; //add half doughnut chart - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { ?>
@@ -113,7 +113,7 @@ ".round($percent_cpu)."%"; } echo "\n"; diff --git a/app/system/resources/dashboard/system_status.php b/app/system/resources/dashboard/system_status.php index 8f8785f581..90e671670e 100644 --- a/app/system/resources/dashboard/system_status.php +++ b/app/system/resources/dashboard/system_status.php @@ -40,7 +40,7 @@ echo "
\n"; echo " ".$text['label-disk_usage']."\n"; - if ($dashboard_chart_type == "doughnut") { + if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { ?>
@@ -94,7 +94,7 @@ ".round($percent_disk_usage)."%"; } echo "
\n"; diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index bf24328fc4..ab1f09b8f9 100644 --- a/app/voicemails/resources/dashboard/voicemails.php +++ b/app/voicemails/resources/dashboard/voicemails.php @@ -55,7 +55,7 @@ echo "
\n"; echo " ".$text['label-new_messages'].""; - if (isset($row['dashboard_chart_type']) && $row['dashboard_chart_type'] == "doughnut") { + if (isset($dashboard_chart_type) && $dashboard_chart_type == "doughnut") { //add doughnut chart ?>
@@ -100,7 +100,7 @@ ".$messages['new'].""; } echo "
\n"; diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php index e70e263bf4..d853a9a0df 100644 --- a/app/xml_cdr/resources/dashboard/missed_calls.php +++ b/app/xml_cdr/resources/dashboard/missed_calls.php @@ -93,7 +93,7 @@ echo "
\n"; echo " ".$text['label-missed_calls'].""; - if ($row['dashboard_chart_type'] == "doughnut") { + if ($dashboard_chart_type == "doughnut") { //add doughnut chart ?>
@@ -138,7 +138,7 @@ ".$num_rows.""; } echo "
\n"; diff --git a/app/xml_cdr/resources/dashboard/recent_calls.php b/app/xml_cdr/resources/dashboard/recent_calls.php index f7295923ec..a772540d4d 100644 --- a/app/xml_cdr/resources/dashboard/recent_calls.php +++ b/app/xml_cdr/resources/dashboard/recent_calls.php @@ -90,7 +90,7 @@ echo "
\n"; echo " ".$text['label-recent_calls']."\n"; - if ($row['dashboard_chart_type'] == "doughnut") { + if ($dashboard_chart_type == "doughnut") { //add doughnut chart ?> @@ -136,7 +136,7 @@ ".$num_rows.""; } echo "
\n"; diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 00a00cb863..dcc6ef58f6 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -318,19 +318,16 @@ } //add a default value to $dashboard_details_state + if (!isset($row['dashboard_details_state']) && in_array($dashboard_path, ['app/voicemails/resources/dashboard/voicemails.php', 'app/xml_cdr/resources/dashboard/missed_calls.php', 'app/xml_cdr/resources/dashboard/recent_calls.php'])) { + $dashboard_details_state = "hidden"; + } if (!isset($dashboard_details_state)) { $dashboard_details_state = "expanded"; } //add a default value to $dashboard_chart_type - if (!isset($dashboard_chart_type) && $dashboard_path == 'app/voicemails/resources/dashboard/voicemails.php') { - $dashboard_chart_type = "none"; - } - if (!isset($dashboard_chart_type) && $dashboard_path == 'app/xml_cdr/resources/dashboard/missed_calls.php') { - $dashboard_chart_type = "none"; - } - if (!isset($dashboard_chart_type) && $dashboard_path == 'app/xml_cdr/resources/dashboard/recent_calls.php') { - $dashboard_chart_type = "none"; + if (!isset($dashboard_chart_type) && in_array($dashboard_path, ['app/voicemails/resources/dashboard/voicemails.php', 'app/xml_cdr/resources/dashboard/missed_calls.php', 'app/xml_cdr/resources/dashboard/recent_calls.php'])) { + $dashboard_chart_type = "number"; } //add an empty row @@ -555,11 +552,11 @@ else { echo " \n"; } - if ($dashboard_chart_type == "none") { - echo " \n"; + if ($dashboard_chart_type == "number") { + echo " \n"; } else { - echo " \n"; + echo " \n"; } echo " \n"; echo "
\n"; diff --git a/core/dashboard/index.php b/core/dashboard/index.php index 873fcad943..1987d1ea19 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -299,6 +299,14 @@ span.hud_stat { padding-bottom: 27px; } echo " display: none;\n"; echo "}\n"; } + if (!isset($row['dashboard_details_state']) && $dashboard_name == "new_messages" || + !isset($row['dashboard_details_state']) && $dashboard_name == "missed_calls" || + !isset($row['dashboard_details_state']) && $dashboard_name == "recent_calls") { + echo "#".$dashboard_name." .hud_box .hud_expander, \n"; + echo "#".$dashboard_name." .hud_box .hud_details {\n"; + echo " display: none;\n"; + echo "}\n"; + } } ?> } @@ -350,11 +358,11 @@ function toggle_grid_row_end(dashboard_name) { $dashboard_name = $row['dashboard_name']; $dashboard_icon = $row['dashboard_icon'] ?? ''; $dashboard_url = $row['dashboard_url'] ?? ''; - $dashboard_chart_type = $row['dashboard_chart_type'] ?? 'doughnut'; + $dashboard_chart_type = $row['dashboard_chart_type']; $dashboard_heading_text_color = $row['dashboard_heading_text_color'] ?? $settings->get('theme', 'dashboard_heading_text_color'); $dashboard_number_text_color = $row['dashboard_number_text_color'] ?? $settings->get('theme', 'dashboard_number_text_color'); $dashboard_details_state = $row['dashboard_details_state']; - $grid_row_end = ($dashboard_details_state == "expanded" || empty($dashboard_details_state)) ? "grid-row-end: span 5;" : "grid-row-end: span 2;"; + $grid_row_end = (!isset($dashboard_details_state) && in_array($dashboard_name, ["New Messages", "Missed Calls", "Recent Calls"]) ? "grid-row-end: span 2;" : ($dashboard_details_state == "expanded" || empty($dashboard_details_state) ? "grid-row-end: span 5;" : "grid-row-end: span 2;")); echo "
\n"; include($row['dashboard_path']); diff --git a/resources/app_languages.php b/resources/app_languages.php index 762565ac70..a81837cbdf 100644 --- a/resources/app_languages.php +++ b/resources/app_languages.php @@ -4884,6 +4884,32 @@ $text['label-characters']['zh-cn'] = "来电显示名称"; $text['label-characters']['ja-jp'] = "発信者ID名"; $text['label-characters']['ko-kr'] = "발신자 ID 이름"; +$text['label-number']['en-us'] = "Number"; +$text['label-number']['en-gb'] = "Number"; +$text['label-number']['ar-eg'] = "رقم"; +$text['label-number']['de-at'] = "Nummer"; +$text['label-number']['de-ch'] = "Nummer"; +$text['label-number']['de-de'] = "Nummer"; +$text['label-number']['el-gr'] = "Αριθμός"; +$text['label-number']['es-cl'] = "Número"; +$text['label-number']['es-mx'] = "Número"; +$text['label-number']['fr-ca'] = "Nombre"; +$text['label-number']['fr-fr'] = "Nombre"; +$text['label-number']['he-il'] = "מספר"; +$text['label-number']['it-it'] = "Numero"; +$text['label-number']['nl-nl'] = "Nummer"; +$text['label-number']['pl-pl'] = "Numer"; +$text['label-number']['pt-br'] = "Número"; +$text['label-number']['pt-pt'] = "Número"; +$text['label-number']['ro-ro'] = "Număr"; +$text['label-number']['ru-ru'] = "Число"; +$text['label-number']['sv-se'] = "siffra"; +$text['label-number']['uk-ua'] = "Номер"; +$text['label-number']['tr-tr'] = "Sayı"; +$text['label-number']['zh-cn'] = "数字"; +$text['label-number']['ja-jp'] = "番号"; +$text['label-number']['ko-kr'] = "숫자"; + $text['label-numbers']['en-us'] = "Numbers"; $text['label-numbers']['en-gb'] = "Numbers"; $text['label-numbers']['ar-eg'] = "أرقام";