Add ability to create multiple dashboards (#7483)

* Add ability to create multiple dashboards

* Create dashboard_widget_list.php

* Create dashboard_widget_edit.php

* Update dashboard_edit.php

* Update dashboard_config_json.php

* Update dashboard.php

* Update app_languages.php

* Update app_defaults.php

* Update app_config.php

* Update dashboard.php

* Create config.php

* Update content.php

* Update icon.php

* Update parent.php

* Update template.php

* Update config.php

* Update config.php

* Update domains.php

* Update config.php

* Update active_calls.php

* Update config.php

* Update config.php

* Update config.php

* Update config.php

* Update call_forward.php

* Update config.php

* Update config.php

* Update config.php

* Update config.php

* Update config.php

* Update domain_limits.php

* Update caller_id.php

* Update config.php

* Update config.php

* Update config.php

* Update config.php

* Update config.php

* Update registrations.php

* Update ring_group_forward.php

* Update config.php

* Update config.php

* Update switch_status.php

* Update config.php

* Update system_counts.php

* Update system_cpu_status.php

* Update system_disk_usage.php

* Update system_services.php

* Update system_status.php

* Update config.php

* Update config.php

* Update voicemails.php

* Update config.php

* Update missed_calls.php

* Update recent_calls.php

* Update dashboard_widget_edit.php

* Update app_languages.php

* Update dashboard_widget_edit.php

* Update index.php

* Update parent.php
This commit is contained in:
Alex
2025-09-08 16:33:29 -07:00
committed by GitHub
parent a7f4712ceb
commit e8681737dc
54 changed files with 6181 additions and 4812 deletions

View File

@@ -1,45 +1,48 @@
<?php
//registrations icon
$array['dashboard'][$x]['dashboard_uuid'] = 'ce343ebe-3b54-4aad-b7e0-66de02171e78';
$array['dashboard'][$x]['dashboard_name'] = 'Registrations';
$array['dashboard'][$x]['dashboard_path'] = 'registrations/registrations.php';
$array['dashboard'][$x]['dashboard_icon'] = 'fa-list-check';
$array['dashboard'][$x]['dashboard_icon_color'] = '#bfbfbf';
$array['dashboard'][$x]['dashboard_url'] = '/app/registrations/registrations.php';
$array['dashboard'][$x]['dashboard_target'] = 'self';
$array['dashboard'][$x]['dashboard_width'] = '';
$array['dashboard'][$x]['dashboard_height'] = '';
$array['dashboard'][$x]['dashboard_content'] = '';
$array['dashboard'][$x]['dashboard_content_text_align'] = '';
$array['dashboard'][$x]['dashboard_content_details'] = '';
$array['dashboard'][$x]['dashboard_chart_type'] = 'icon';
$array['dashboard'][$x]['dashboard_chart_type_options'] = ['icon'];
$array['dashboard'][$x]['dashboard_label_enabled'] = 'true';
$array['dashboard'][$x]['dashboard_label_text_color'] = '#444444';
$array['dashboard'][$x]['dashboard_label_text_color_hover'] = '';
$array['dashboard'][$x]['dashboard_label_background_color'] = '';
$array['dashboard'][$x]['dashboard_label_background_color_hover'] = '';
$array['dashboard'][$x]['dashboard_number_text_color'] = '#ffffff';
$array['dashboard'][$x]['dashboard_number_text_color_hover'] = '';
$array['dashboard'][$x]['dashboard_number_background_color'] = '#5d5ce3';
$array['dashboard'][$x]['dashboard_background_color'] = '#ffffff';
$array['dashboard'][$x]['dashboard_background_color_hover'] = '';
$array['dashboard'][$x]['dashboard_detail_background_color'] = '';
$array['dashboard'][$x]['dashboard_column_span'] = '1';
$array['dashboard'][$x]['dashboard_row_span'] = '1';
$array['dashboard'][$x]['dashboard_details_state'] = 'disabled';
$array['dashboard'][$x]['dashboard_order'] = '80';
$array['dashboard'][$x]['dashboard_enabled'] = 'true';
$array['dashboard'][$x]['dashboard_description'] = '';
$array['dashboard_widgets'][$x]['dashboard_uuid'] = '3e2cbaa4-2bec-41b2-a626-999a59b8b19c';
$array['dashboard_widgets'][$x]['dashboard_widget_uuid'] = 'ce343ebe-3b54-4aad-b7e0-66de02171e78';
$array['dashboard_widgets'][$x]['widget_name'] = 'Registrations';
$array['dashboard_widgets'][$x]['widget_path'] = 'registrations/registrations';
$array['dashboard_widgets'][$x]['widget_icon'] = 'fa-list-check';
$array['dashboard_widgets'][$x]['widget_icon_color'] = '#bfbfbf';
$array['dashboard_widgets'][$x]['widget_url'] = '/app/registrations/registrations.php';
$array['dashboard_widgets'][$x]['widget_target'] = 'self';
$array['dashboard_widgets'][$x]['widget_width'] = '';
$array['dashboard_widgets'][$x]['widget_height'] = '';
$array['dashboard_widgets'][$x]['widget_content'] = '';
$array['dashboard_widgets'][$x]['widget_content_text_align'] = '';
$array['dashboard_widgets'][$x]['widget_content_details'] = '';
$array['dashboard_widgets'][$x]['widget_chart_type'] = 'icon';
$array['dashboard_widgets'][$x]['widget_chart_type_options'] = ['icon'];
$array['dashboard_widgets'][$x]['widget_label_enabled'] = 'true';
$array['dashboard_widgets'][$x]['widget_label_text_color'] = '#444444';
$array['dashboard_widgets'][$x]['widget_label_text_color_hover'] = '';
$array['dashboard_widgets'][$x]['widget_label_background_color'] = '';
$array['dashboard_widgets'][$x]['widget_label_background_color_hover'] = '';
$array['dashboard_widgets'][$x]['widget_number_text_color'] = '#ffffff';
$array['dashboard_widgets'][$x]['widget_number_text_color_hover'] = '';
$array['dashboard_widgets'][$x]['widget_number_background_color'] = '#5d5ce3';
$array['dashboard_widgets'][$x]['widget_background_color'] = '#ffffff';
$array['dashboard_widgets'][$x]['widget_background_color_hover'] = '';
$array['dashboard_widgets'][$x]['widget_detail_background_color'] = '';
$array['dashboard_widgets'][$x]['widget_column_span'] = '1';
$array['dashboard_widgets'][$x]['widget_row_span'] = '1';
$array['dashboard_widgets'][$x]['widget_details_state'] = 'disabled';
$array['dashboard_widgets'][$x]['widget_order'] = '80';
$array['dashboard_widgets'][$x]['widget_enabled'] = 'true';
$array['dashboard_widgets'][$x]['widget_description'] = '';
$y = 0;
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_group_uuid'] = '79c46151-6008-488d-bcac-0b17ef51d1bc';
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_uuid'] = 'ce343ebe-3b54-4aad-b7e0-66de02171e78';
$array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = 'superadmin';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['dashboard_uuid'] = '3e2cbaa4-2bec-41b2-a626-999a59b8b19c';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['dashboard_widget_group_uuid'] = '79c46151-6008-488d-bcac-0b17ef51d1bc';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['dashboard_widget_uuid'] = 'ce343ebe-3b54-4aad-b7e0-66de02171e78';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['group_name'] = 'superadmin';
$y++;
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_group_uuid'] = 'ae55ad7e-d0e0-4ca5-a509-18062872104f';
$array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_uuid'] = 'ce343ebe-3b54-4aad-b7e0-66de02171e78';
$array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = 'admin';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['dashboard_uuid'] = '3e2cbaa4-2bec-41b2-a626-999a59b8b19c';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['dashboard_widget_group_uuid'] = 'ae55ad7e-d0e0-4ca5-a509-18062872104f';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['dashboard_widget_uuid'] = 'ce343ebe-3b54-4aad-b7e0-66de02171e78';
$array['dashboard_widgets'][$x]['dashboard_widget_groups'][$y]['group_name'] = 'admin';
$y++;
?>

View File

@@ -5,20 +5,20 @@
require_once "resources/check_auth.php";
//convert to a key
$dashboard_key = str_replace(' ', '_', strtolower($dashboard_name));
$widget_key = str_replace(' ', '_', strtolower($widget_name));
//add multi-lingual support
$language = new text;
$text = $language->get($_SESSION['domain']['language']['code'], dirname($dashboard_url));
$text = $language->get($_SESSION['domain']['language']['code'], dirname($widget_url));
//get the dashboard label
$dashboard_label = $text['title-'.$dashboard_key] ?? $dashboard_name;
$widget_label = $text['title-'.$widget_key] ?? $widget_name;
//prepare variables
$dashboard_target = ($dashboard_target == 'new') ? '_blank' : '_self';
$widget_target = ($widget_target == 'new') ? '_blank' : '_self';
$window_parameters = '';
if (!empty($dashboard_width) && !empty($dashboard_height)) {
$window_parameters .= "width=".$dashboard_width.",height=".$dashboard_height;
if (!empty($widget_width) && !empty($widget_height)) {
$window_parameters .= "width=".$widget_width.",height=".$widget_height;
}
//channel count
@@ -51,15 +51,15 @@
//dashboard icon
echo "<div class='hud_box'>\n";
echo " <div class='hud_content' ".(empty($dashboard_details_state) || $dashboard_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast');\"" : null).">\n";
echo " <span class='hud_title' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."')\">".escape($dashboard_label)."</span>";
echo " <div class='hud_content' ".(empty($widget_details_state) || $widget_details_state != "disabled" ? "onclick=\"$('#hud_icon_details').slideToggle('fast');\"" : null).">\n";
echo " <span class='hud_title' onclick=\"window.open('".$widget_url."', '".$widget_target."', '".$window_parameters."')\">".escape($widget_label)."</span>";
echo " <div style='position: relative; display: inline-block;'>\n";
echo " <span class='hud_stat' onclick=\"window.open('".$dashboard_url."', '".$dashboard_target."', '".$window_parameters."')\"><i class=\"fas ".$dashboard_icon."\"></i></span>\n";
echo " <span style=\"background-color: ".(!empty($dashboard_number_background_color) ? $dashboard_number_background_color : '#5d5ce3')."; color: ".(!empty($dashboard_number_text_color) ? $dashboard_number_text_color : '#ffffff')."; font-size: 12px; font-weight: bold; text-align: center; position: absolute; top: 22px; left: 25px; padding: 2px 7px 1px 7px; border-radius: 10px; white-space: nowrap;\">".$active_registrations." / ".($active_registrations + $inactive_registrations)."</span>\n";
echo " <span class='hud_stat' onclick=\"window.open('".$widget_url."', '".$widget_target."', '".$window_parameters."')\"><i class=\"fas ".$widget_icon."\"></i></span>\n";
echo " <span style=\"background-color: ".(!empty($widget_number_background_color) ? $widget_number_background_color : '#5d5ce3')."; color: ".(!empty($widget_number_text_color) ? $widget_number_text_color : '#ffffff')."; font-size: 12px; font-weight: bold; text-align: center; position: absolute; top: 22px; left: 25px; padding: 2px 7px 1px 7px; border-radius: 10px; white-space: nowrap;\">".$active_registrations." / ".($active_registrations + $inactive_registrations)."</span>\n";
echo " </div>\n";
echo " </div>\n";
if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") {
echo " <div class='hud_details hud_box' id='hud_icon_details' style='padding: 20px; 10%; overflow: auto; ".(!empty($row['dashboard_detail_background_color']) ? "background: ".$row['dashboard_detail_background_color'].";" : null)."'>".str_replace("\r", '<br>', escape($dashboard_content_details))."</div>\n";
if (empty($widget_details_state) || $widget_details_state != "disabled") {
echo " <div class='hud_details hud_box' id='hud_icon_details' style='padding: 20px; 10%; overflow: auto; ".(!empty($row['widget_detail_background_color']) ? "background: ".$row['widget_detail_background_color'].";" : null)."'>".str_replace("\r", '<br>', escape($widget_content_details))."</div>\n";
}
echo " <span class='hud_expander' onclick=\"$('#hud_icon_details').slideToggle('fast');\"><span class='fas fa-ellipsis-h'></span></span>";
echo "</div>\n";