Dashboard - Minor changes (#6993)

This commit is contained in:
Alex
2024-06-03 11:40:05 -06:00
committed by GitHub
parent d48208456b
commit f6e6750efc
14 changed files with 66 additions and 35 deletions
+8 -11
View File
@@ -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 " <option value='doughnut'>".$text['label-doughnut']."</option>\n";
}
if ($dashboard_chart_type == "none") {
echo " <option value='none' selected='selected'>".$text['label-none']."</option>\n";
if ($dashboard_chart_type == "number") {
echo " <option value='number' selected='selected'>".$text['label-number']."</option>\n";
}
else {
echo " <option value='none'>".$text['label-none']."</option>\n";
echo " <option value='number'>".$text['label-number']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
+10 -2
View File
@@ -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 "<div class='widget' style='".$grid_row_end."' id='".str_replace(" ", "_", strtolower($row['dashboard_name']))."' draggable='false'>\n";
include($row['dashboard_path']);