From fc4b8a26522f17b8ce2d8b9839bd2660d787ff48 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:32:39 -0700 Subject: [PATCH] Dashboard - Allow drag and drop in parent widgets (#7431) * Dashboard - Allow drag and drop in parent widgets * Update parent.php * Update index.php * Update config.php * Update missed_calls.php * Update recent_calls.php * Update voicemails.php * Update active_calls.php * Update config.php * Update config.php * Update config.php * Update voicemails.php * Update parent.php * Update voicemails.php * Update parent.php * Update parent.php * Update index.php --------- Co-authored-by: FusionPBX --- .../resources/dashboard/active_calls.php | 8 +- .../resources/dashboard/config.php | 1 + app/devices/resources/dashboard/config.php | 1 + .../resources/dashboard/voicemails.php | 4 +- .../resources/dashboard/missed_calls.php | 4 +- .../resources/dashboard/recent_calls.php | 2 - core/contacts/resources/dashboard/config.php | 1 + core/dashboard/index.php | 124 ++++++-- core/dashboard/resources/dashboard/parent.php | 269 +++++++++++------- 9 files changed, 264 insertions(+), 150 deletions(-) diff --git a/app/active_calls/resources/dashboard/active_calls.php b/app/active_calls/resources/dashboard/active_calls.php index 578dc9c039..72d259b4cb 100644 --- a/app/active_calls/resources/dashboard/active_calls.php +++ b/app/active_calls/resources/dashboard/active_calls.php @@ -70,11 +70,9 @@ $row_style["1"] = "row_style1"; //icon and count echo "
\n"; echo "".$text['title']."\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "0\n"; - echo "
\n"; + echo "
\n"; + echo "\n"; + echo "0\n"; echo "
\n"; echo "
\n"; diff --git a/app/call_centers/resources/dashboard/config.php b/app/call_centers/resources/dashboard/config.php index 20e25dd1b3..085f674c04 100644 --- a/app/call_centers/resources/dashboard/config.php +++ b/app/call_centers/resources/dashboard/config.php @@ -4,6 +4,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '9083305a-ebb4-4b67-bb9b-8c09cf03026 $array['dashboard'][$x]['dashboard_name'] = 'Call Center Agents'; $array['dashboard'][$x]['dashboard_path'] = 'call_centers/call_center_agents'; $array['dashboard'][$x]['dashboard_icon'] = ''; +$array['dashboard'][$x]['dashboard_icon_color'] = ''; $array['dashboard'][$x]['dashboard_url'] = ''; $array['dashboard'][$x]['dashboard_target'] = ''; $array['dashboard'][$x]['dashboard_width'] = ''; diff --git a/app/devices/resources/dashboard/config.php b/app/devices/resources/dashboard/config.php index 3b1917a277..a173fcc407 100644 --- a/app/devices/resources/dashboard/config.php +++ b/app/devices/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'f1c722d5-b714-4fa2-9664-5f6d24d4466 $array['dashboard'][$x]['dashboard_name'] = 'Device Keys'; $array['dashboard'][$x]['dashboard_path'] = 'devices/device_keys'; $array['dashboard'][$x]['dashboard_icon'] = ''; +$array['dashboard'][$x]['dashboard_icon_color'] = ''; $array['dashboard'][$x]['dashboard_url'] = ''; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index 6f062a54ca..e24f957850 100644 --- a/app/voicemails/resources/dashboard/voicemails.php +++ b/app/voicemails/resources/dashboard/voicemails.php @@ -105,12 +105,10 @@ //dashboard icon if (!isset($dashboard_chart_type) || $dashboard_chart_type == "icon") { - echo "\n"; - echo "
\n"; + echo "
\n"; echo " \n"; echo " ".$messages['new']."\n"; echo "
\n"; - echo ""; } echo "
\n"; diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php index 3aeeaa890d..20051cb68e 100644 --- a/app/xml_cdr/resources/dashboard/missed_calls.php +++ b/app/xml_cdr/resources/dashboard/missed_calls.php @@ -146,12 +146,10 @@ //dashboard icon if (!isset($dashboard_chart_type) || $dashboard_chart_type == "icon") { - echo "\n"; - echo "
\n"; + echo "
\n"; echo " \n"; echo " ".$num_rows."\n"; echo "
\n"; - echo ""; } echo "
\n"; diff --git a/app/xml_cdr/resources/dashboard/recent_calls.php b/app/xml_cdr/resources/dashboard/recent_calls.php index 253c336e8c..b5ca5a635b 100644 --- a/app/xml_cdr/resources/dashboard/recent_calls.php +++ b/app/xml_cdr/resources/dashboard/recent_calls.php @@ -144,12 +144,10 @@ //dashboard icon if (!isset($dashboard_chart_type) || $dashboard_chart_type == "icon") { - echo "
\n"; echo "
\n"; echo " \n"; echo " ".$num_rows."\n"; echo "
\n"; - echo "
"; } echo "
\n"; diff --git a/core/contacts/resources/dashboard/config.php b/core/contacts/resources/dashboard/config.php index ade1eb5a76..114bf4fbc4 100644 --- a/core/contacts/resources/dashboard/config.php +++ b/core/contacts/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '3b0cbb2f-733d-4646-8332-7d108808f2f $array['dashboard'][$x]['dashboard_name'] = 'Contacts'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-regular fa-address-card'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#0292ff'; $array['dashboard'][$x]['dashboard_url'] = '/core/contacts/contacts.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; diff --git a/core/dashboard/index.php b/core/dashboard/index.php index 931912fd8d..0492c0b0c2 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -1,3 +1,4 @@ + 1) { + echo "#".$dashboard_name." div.parent_widgets.hud_content {\n"; + echo " justify-content: space-evenly;\n"; + echo "}\n"; + } } ?> @@ -576,12 +596,13 @@ function toggle_grid_row_end_all() { $widget_name = $dashboard_path_array[1]; $path_array = glob(dirname(__DIR__, 2).'/*/'.$application_name.'/resources/dashboard/'.$widget_name.'.php'); - echo "
\n"; - if (file_exists($path_array[0])) { - include $path_array[0]; + if (empty($row['dashboard_parent_uuid'])) { + echo "
\n"; + if (file_exists($path_array[0])) { + include $path_array[0]; + } + echo "
\n"; } - echo "
\n"; - $x++; } echo "\n"; @@ -632,8 +653,9 @@ function toggle_grid_row_end_all() {