From 5eead0d88ab5ba46766e386b54b0e41fad91494b Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:36:54 -0700 Subject: [PATCH] Dashboard - Add disabled option to details state (#6962) * Dashboard - Add disabled option to details state --- .../resources/dashboard/call_forward.php | 2 +- .../resources/dashboard/domain_limits.php | 2 +- .../resources/dashboard/caller_id.php | 2 +- .../resources/dashboard/ring_group_forward.php | 2 +- .../resources/dashboard/switch_status.php | 2 +- .../resources/dashboard/system_counts.php | 2 +- .../resources/dashboard/system_cpu_status.php | 2 +- .../resources/dashboard/system_status.php | 2 +- .../resources/dashboard/voicemails.php | 2 +- .../resources/dashboard/missed_calls.php | 2 +- .../resources/dashboard/recent_calls.php | 2 +- core/dashboard/dashboard_edit.php | 18 ++++++++++++------ core/dashboard/index.php | 11 +++++++++-- core/dashboard/resources/dashboard/icon.php | 2 +- 14 files changed, 33 insertions(+), 20 deletions(-) diff --git a/app/call_forward/resources/dashboard/call_forward.php b/app/call_forward/resources/dashboard/call_forward.php index 4cfdcc6625..fd41ee96ad 100644 --- a/app/call_forward/resources/dashboard/call_forward.php +++ b/app/call_forward/resources/dashboard/call_forward.php @@ -102,7 +102,7 @@ //begin widget echo "
\n"; - echo "
\n"; + echo "
\n"; echo " ".$text['header-call_forward']."\n"; //doughnut chart diff --git a/app/domain_limits/resources/dashboard/domain_limits.php b/app/domain_limits/resources/dashboard/domain_limits.php index 8640b8b25b..db9eb6be7a 100644 --- a/app/domain_limits/resources/dashboard/domain_limits.php +++ b/app/domain_limits/resources/dashboard/domain_limits.php @@ -110,7 +110,7 @@ $hud_stat_title = $text['label-destinations']; } - echo "
\n"; + echo "
\n"; echo " ".$text['label-domain_limits']."\n"; //doughnut chart diff --git a/app/extensions/resources/dashboard/caller_id.php b/app/extensions/resources/dashboard/caller_id.php index 3a787e2886..eb1c7199f0 100644 --- a/app/extensions/resources/dashboard/caller_id.php +++ b/app/extensions/resources/dashboard/caller_id.php @@ -173,7 +173,7 @@ //caller id echo "
\n"; - echo "
\n"; + echo "
\n"; echo " ".$text['label-caller_id_number']."\n"; //doughnut chart diff --git a/app/ring_groups/resources/dashboard/ring_group_forward.php b/app/ring_groups/resources/dashboard/ring_group_forward.php index 550d3e9f45..c525302d76 100644 --- a/app/ring_groups/resources/dashboard/ring_group_forward.php +++ b/app/ring_groups/resources/dashboard/ring_group_forward.php @@ -153,7 +153,7 @@ //ring group forward echo "
\n"; - echo "
\n"; + echo "
\n"; echo " ".$text['header-ring-group-forward']."\n"; diff --git a/app/switch/resources/dashboard/switch_status.php b/app/switch/resources/dashboard/switch_status.php index d5f2425739..3b1cfdfb0f 100644 --- a/app/switch/resources/dashboard/switch_status.php +++ b/app/switch/resources/dashboard/switch_status.php @@ -76,7 +76,7 @@ $registrations = $registration->count(); } - echo "
\n"; + echo "
\n"; echo " ".$text['label-switch_status']."\n"; if ($dashboard_chart_type == "doughnut") { diff --git a/app/system/resources/dashboard/system_counts.php b/app/system/resources/dashboard/system_counts.php index 30d453882e..0e780c3578 100644 --- a/app/system/resources/dashboard/system_counts.php +++ b/app/system/resources/dashboard/system_counts.php @@ -295,7 +295,7 @@ echo "
\n"; if ($show_stat) { - echo "
\n"; + echo "
\n"; echo " ".$text['label-system_counts']."\n"; if ($dashboard_chart_type == "doughnut") { diff --git a/app/system/resources/dashboard/system_cpu_status.php b/app/system/resources/dashboard/system_cpu_status.php index 0477ac7d92..d0e9e79235 100644 --- a/app/system/resources/dashboard/system_cpu_status.php +++ b/app/system/resources/dashboard/system_cpu_status.php @@ -51,7 +51,7 @@ } //add half doughnut chart - echo "
\n"; + echo "
\n"; echo " ".$text['label-cpu_usage']."\n"; if ($dashboard_chart_type == "doughnut") { diff --git a/app/system/resources/dashboard/system_status.php b/app/system/resources/dashboard/system_status.php index daf7c783f0..78ab2ffce9 100644 --- a/app/system/resources/dashboard/system_status.php +++ b/app/system/resources/dashboard/system_status.php @@ -37,7 +37,7 @@ if (!empty($percent_disk_usage)) { //add half doughnut chart - echo "
\n"; + echo "
\n"; echo " ".$text['label-disk_usage']."\n"; if ($dashboard_chart_type == "doughnut") { diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index abdfd5203d..0cba3ab1df 100644 --- a/app/voicemails/resources/dashboard/voicemails.php +++ b/app/voicemails/resources/dashboard/voicemails.php @@ -52,7 +52,7 @@ } } - echo "
\n"; + echo "
\n"; echo " ".$text['label-new_messages'].""; if ($dashboard_chart_type == "doughnut") { diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php index 29c79a14d2..10a8924339 100644 --- a/app/xml_cdr/resources/dashboard/missed_calls.php +++ b/app/xml_cdr/resources/dashboard/missed_calls.php @@ -90,7 +90,7 @@ //missed calls echo "
\n"; - echo "
\n"; + echo "
\n"; echo " ".$text['label-missed_calls'].""; if ($dashboard_chart_type == "doughnut") { diff --git a/app/xml_cdr/resources/dashboard/recent_calls.php b/app/xml_cdr/resources/dashboard/recent_calls.php index bc0530725a..06b59e0ef0 100644 --- a/app/xml_cdr/resources/dashboard/recent_calls.php +++ b/app/xml_cdr/resources/dashboard/recent_calls.php @@ -87,7 +87,7 @@ //recent calls echo "
\n"; - echo "
\n"; + echo "
\n"; echo " ".$text['label-recent_calls']."\n"; if ($dashboard_chart_type == "doughnut") { diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 693c6eb6dd..4b8a0ba9cc 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -584,12 +584,6 @@ echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-dashboard_details_state']."\n"; diff --git a/core/dashboard/index.php b/core/dashboard/index.php index e19fc97582..e1c9ea38a8 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -163,7 +163,7 @@ $expanded_all = true; if (is_array($dashboard) && @sizeof($dashboard) != 0) { foreach ($dashboard as $row) { - if ($row['dashboard_details_state'] == 'contracted' || $row['dashboard_details_state'] == 'hidden') { $expanded_all = false; } + if ($row['dashboard_details_state'] == 'contracted' || $row['dashboard_details_state'] == 'hidden' || $row['dashboard_details_state'] == 'disabled') { $expanded_all = false; } } } @@ -266,6 +266,12 @@ echo " display: none;\n"; echo "}\n"; } + if ($row['dashboard_details_state'] == "disabled") { + echo "#".$dashboard_name." .hud_box .hud_expander, \n"; + echo "#".$dashboard_name." .hud_box .hud_details {\n"; + echo " display: none;\n"; + echo "}\n"; + } } ?> } @@ -315,6 +321,7 @@ $dashboard_heading_text_color = $row['dashboard_heading_text_color'] ?? $settings->get('theme', 'dashboard_heading_text_color'); $dashboard_number_background_color = $row['dashboard_number_background_color'] ?? $settings->get('theme', 'dashboard_number_background_color'); $dashboard_number_text_color = $row['dashboard_number_text_color'] ?? $settings->get('theme', 'dashboard_number_text_color'); + $dashboard_details_state = $row['dashboard_details_state']; echo "
\n"; include($row['dashboard_path']); echo "
\n"; @@ -421,4 +428,4 @@ //show the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/core/dashboard/resources/dashboard/icon.php b/core/dashboard/resources/dashboard/icon.php index 8dc81b0b59..1763ab78b1 100644 --- a/core/dashboard/resources/dashboard/icon.php +++ b/core/dashboard/resources/dashboard/icon.php @@ -11,7 +11,7 @@ //dashboard icon echo "
\n"; - echo "
\n"; + echo "
\n"; echo " ". $dashboard_name . ""; // (isset($text['label-'.$dashboard_name])) ? $text['label-'.$dashboard_name] : $dashboard_name echo " \n"; echo "
\n";