diff --git a/app/call_forward/resources/dashboard/call_forward.php b/app/call_forward/resources/dashboard/call_forward.php index 1ee2d2e3cc..a21fd3a9d1 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 e4cb3ae5b5..55d95dab85 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 6c7c0d0087..967900b419 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 5c6f85b557..1556fe92d9 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"; //doughnut chart diff --git a/app/switch/resources/dashboard/switch_status.php b/app/switch/resources/dashboard/switch_status.php index 796e23760a..3fb031e61d 100644 --- a/app/switch/resources/dashboard/switch_status.php +++ b/app/switch/resources/dashboard/switch_status.php @@ -77,7 +77,7 @@ } //show the content - echo "
\n"; + echo "
\n"; echo " ".$text['label-switch_status']."\n"; if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { diff --git a/app/system/resources/dashboard/system_counts.php b/app/system/resources/dashboard/system_counts.php index 91794e97d0..ad24615eb1 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 (!isset($dashboard_chart_type) || $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 c34c8c4f73..89db140df1 100644 --- a/app/system/resources/dashboard/system_cpu_status.php +++ b/app/system/resources/dashboard/system_cpu_status.php @@ -51,7 +51,7 @@ } //show the content - echo "
\n"; + echo "
\n"; echo " ".$text['label-cpu_usage']."\n"; //add half doughnut chart diff --git a/app/system/resources/dashboard/system_status.php b/app/system/resources/dashboard/system_status.php index 90e671670e..870787cb4f 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 (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index ab1f09b8f9..4f605b5cef 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 (isset($dashboard_chart_type) && $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 d853a9a0df..104c98f530 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 a772540d4d..407a73792d 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/app_config.php b/core/dashboard/app_config.php index f5723b337b..25075fecaf 100644 --- a/core/dashboard/app_config.php +++ b/core/dashboard/app_config.php @@ -117,6 +117,11 @@ $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard column span.'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_row_span'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; + $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard row span.'; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_details_state'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['search_by'] = 'expanded'; diff --git a/core/dashboard/app_languages.php b/core/dashboard/app_languages.php index 6b4bfc8b44..88674a28dd 100644 --- a/core/dashboard/app_languages.php +++ b/core/dashboard/app_languages.php @@ -650,6 +650,58 @@ $text['description-dashboard_column_span']['zh-cn'] = "输入仪表板小部件 $text['description-dashboard_column_span']['ja-jp'] = "ダッシュボード ウィジェットの列スパンを入力します。"; $text['description-dashboard_column_span']['ko-kr'] = "대시보드 위젯 열 범위를 입력합니다."; +$text['label-dashboard_row_span']['en-us'] = "Row Span"; +$text['label-dashboard_row_span']['en-gb'] = "Row Span"; +$text['label-dashboard_row_span']['ar-eg'] = ""; +$text['label-dashboard_row_span']['de-at'] = ""; +$text['label-dashboard_row_span']['de-ch'] = ""; +$text['label-dashboard_row_span']['de-de'] = ""; +$text['label-dashboard_row_span']['el-gr'] = ""; +$text['label-dashboard_row_span']['es-cl'] = ""; +$text['label-dashboard_row_span']['es-mx'] = ""; +$text['label-dashboard_row_span']['fr-ca'] = ""; +$text['label-dashboard_row_span']['fr-fr'] = ""; +$text['label-dashboard_row_span']['he-il'] = ""; +$text['label-dashboard_row_span']['it-it'] = ""; +$text['label-dashboard_row_span']['nl-nl'] = ""; +$text['label-dashboard_row_span']['pl-pl'] = ""; +$text['label-dashboard_row_span']['pt-br'] = ""; +$text['label-dashboard_row_span']['pt-pt'] = ""; +$text['label-dashboard_row_span']['ro-ro'] = ""; +$text['label-dashboard_row_span']['ru-ru'] = ""; +$text['label-dashboard_row_span']['sv-se'] = ""; +$text['label-dashboard_row_span']['uk-ua'] = ""; +$text['label-dashboard_row_span']['tr-tr'] = ""; +$text['label-dashboard_row_span']['zh-cn'] = ""; +$text['label-dashboard_row_span']['ja-jp'] = ""; +$text['label-dashboard_row_span']['ko-kr'] = ""; + +$text['description-dashboard_row_span']['en-us'] = "Enter the dashboard widget row span."; +$text['description-dashboard_row_span']['en-gb'] = "Enter the dashboard widget row span."; +$text['description-dashboard_row_span']['ar-eg'] = ""; +$text['description-dashboard_row_span']['de-at'] = ""; +$text['description-dashboard_row_span']['de-ch'] = ""; +$text['description-dashboard_row_span']['de-de'] = ""; +$text['description-dashboard_row_span']['el-gr'] = ""; +$text['description-dashboard_row_span']['es-cl'] = ""; +$text['description-dashboard_row_span']['es-mx'] = ""; +$text['description-dashboard_row_span']['fr-ca'] = ""; +$text['description-dashboard_row_span']['fr-fr'] = ""; +$text['description-dashboard_row_span']['he-il'] = ""; +$text['description-dashboard_row_span']['it-it'] = ""; +$text['description-dashboard_row_span']['nl-nl'] = ""; +$text['description-dashboard_row_span']['pl-pl'] = ""; +$text['description-dashboard_row_span']['pt-br'] = ""; +$text['description-dashboard_row_span']['pt-pt'] = ""; +$text['description-dashboard_row_span']['ro-ro'] = ""; +$text['description-dashboard_row_span']['ru-ru'] = ""; +$text['description-dashboard_row_span']['sv-se'] = ""; +$text['description-dashboard_row_span']['uk-ua'] = ""; +$text['description-dashboard_row_span']['tr-tr'] = ""; +$text['description-dashboard_row_span']['zh-cn'] = ""; +$text['description-dashboard_row_span']['ja-jp'] = ""; +$text['description-dashboard_row_span']['ko-kr'] = ""; + $text['label-dashboard_details_state']['en-us'] = "Details State"; $text['label-dashboard_details_state']['en-gb'] = "Details State"; $text['label-dashboard_details_state']['ar-eg'] = "تفاصيل الدولة"; diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 903cb4babe..a93c9b1e55 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -49,6 +49,7 @@ $dashboard_number_text_color = ''; $dashboard_groups = []; $dashboard_column_span = ''; + $dashboard_row_span = ''; $dashboard_details_state = ''; $dashboard_order = ''; $dashboard_enabled = $row["dashboard_enabled"] ?? 'true'; @@ -79,6 +80,7 @@ $dashboard_background_color = $_POST["dashboard_background_color"] ?? ''; $dashboard_detail_background_color = $_POST["dashboard_detail_background_color"] ?? ''; $dashboard_column_span = $_POST["dashboard_column_span"] ?? ''; + $dashboard_row_span = $_POST["dashboard_row_span"] ?? ''; $dashboard_details_state = $_POST["dashboard_details_state"] ?? ''; $dashboard_order = $_POST["dashboard_order"] ?? ''; $dashboard_enabled = $_POST["dashboard_enabled"] ?? 'false'; @@ -209,6 +211,7 @@ $array['dashboard'][0]['dashboard_background_color'] = $dashboard_background_color; $array['dashboard'][0]['dashboard_detail_background_color'] = $dashboard_detail_background_color; $array['dashboard'][0]['dashboard_column_span'] = $dashboard_column_span; + $array['dashboard'][0]['dashboard_row_span'] = $dashboard_row_span; $array['dashboard'][0]['dashboard_details_state'] = $dashboard_details_state; $array['dashboard'][0]['dashboard_order'] = $dashboard_order; $array['dashboard'][0]['dashboard_enabled'] = $dashboard_enabled; @@ -262,6 +265,7 @@ $sql .= " dashboard_background_color, "; $sql .= " dashboard_detail_background_color, "; $sql .= " dashboard_column_span, "; + $sql .= " dashboard_row_span, "; $sql .= " dashboard_details_state, "; $sql .= " dashboard_order, "; $sql .= " dashboard_enabled, "; @@ -283,6 +287,7 @@ $dashboard_background_color = $row["dashboard_background_color"]; $dashboard_detail_background_color = $row["dashboard_detail_background_color"]; $dashboard_column_span = $row["dashboard_column_span"]; + $dashboard_row_span = $row["dashboard_row_span"]; $dashboard_details_state = $row["dashboard_details_state"]; $dashboard_order = $row["dashboard_order"]; $dashboard_enabled = $row["dashboard_enabled"] ?? 'false'; @@ -317,6 +322,11 @@ $dashboard_detail_background_color = json_decode($dashboard_detail_background_color, true); } +//add a default value to $dashboard_chart_type + 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 a default value to $dashboard_details_state if (!isset($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"; @@ -325,9 +335,12 @@ $dashboard_details_state = "expanded"; } -//add a default value to $dashboard_chart_type - 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 a default value to $dashboard_row_span + if (!isset($dashboard_row_span) && 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_row_span = 1; + } + if (empty($dashboard_row_span)) { + $dashboard_row_span = 2; } //add an empty row @@ -539,7 +552,8 @@ $dashboard_path == "app/domain_limits/resources/dashboard/domain_limits.php" || $dashboard_path == "app/call_forward/resources/dashboard/call_forward.php" || $dashboard_path == "app/ring_groups/resources/dashboard/ring_group_forward.php" || - $dashboard_path == "app/extensions/resources/dashboard/caller_id.php") { + $dashboard_path == "app/extensions/resources/dashboard/caller_id.php" || + $dashboard_path == "app/maintenance/resources/dashboard/maintenance.php") { echo "\n"; echo "\n"; echo $text['label-dashboard_chart_type']."\n"; @@ -651,7 +665,7 @@ echo "\n"; echo " \n"; + $i=1; + while ($i<=3) { + $selected = ($i == $dashboard_row_span) ? "selected" : null; + echo " \n"; + $i++; + } + echo " \n"; + echo "
\n"; + echo $text['description-dashboard_row_span']."\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " ".$text['label-dashboard_details_state']."\n"; diff --git a/core/dashboard/index.php b/core/dashboard/index.php index 1987d1ea19..af2ab61d37 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -81,6 +81,7 @@ $sql .= "dashboard_background_color, \n"; $sql .= "dashboard_detail_background_color, \n"; $sql .= "dashboard_column_span, \n"; + $sql .= "dashboard_row_span, \n"; $sql .= "dashboard_details_state, \n"; $sql .= "dashboard_order, \n"; $sql .= "cast(dashboard_enabled as text), \n"; @@ -221,7 +222,7 @@ grid-gap: 1rem; } -div.hud_container { +div.hud_content { display: flex; flex-wrap: wrap; justify-content: center; @@ -233,15 +234,17 @@ div.hud_chart { padding-top: 7px; } -span.hud_stat { padding-bottom: 27px; } - /* Dashboard settings */ @@ -343,9 +375,17 @@ span.hud_stat { padding-bottom: 27px; } @@ -361,10 +401,19 @@ function toggle_grid_row_end(dashboard_name) { $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 = (!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;")); + $dashboard_details_state = $row['dashboard_details_state'] ?? "expanded"; + $dashboard_row_span = $row['dashboard_row_span'] ?? 2; + if (!isset($row['dashboard_details_state']) && in_array($dashboard_name, ["New Messages", "Missed Calls", "Recent Calls"])) { + $dashboard_details_state = "hidden"; + } + if ($dashboard_details_state == "expanded") { + $dashboard_row_span += 3; + } + if (!isset($row['dashboard_row_span']) && !isset($row['dashboard_details_state']) && in_array($dashboard_name, ["New Messages", "Missed Calls", "Recent Calls"])) { + $dashboard_row_span = 1; + } - echo "
\n"; + echo "
\n"; include($row['dashboard_path']); echo "
\n"; $x++; diff --git a/core/dashboard/resources/dashboard/icon.php b/core/dashboard/resources/dashboard/icon.php index 561e231a4b..7e172cfaf2 100644 --- a/core/dashboard/resources/dashboard/icon.php +++ b/core/dashboard/resources/dashboard/icon.php @@ -11,12 +11,12 @@ //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"; - if (empty($dashboard_detail_state) || $dashboard_detail_state != "disabled") { + if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") { echo "
"; echo "\n"; echo "\n";