Dashboard - Add chart type setting (#6951)

* Dashboard - Add chart type setting
This commit is contained in:
Alex
2024-04-18 16:57:45 -06:00
committed by GitHub
parent 07ff90f97c
commit 808e2cbe66
16 changed files with 765 additions and 611 deletions
+5
View File
@@ -72,6 +72,11 @@
$apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard path.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_chart_type';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the chart type.';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_heading_text_color';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['search_by'] = '';
+79 -1
View File
@@ -260,6 +260,84 @@ $text['description-dashboard_groups']['zh-cn'] = "添加有权访问此小部件
$text['description-dashboard_groups']['ja-jp'] = "このウィジェットに対する権限を持つグループを追加します。";
$text['description-dashboard_groups']['ko-kr'] = "이 위젯에 대한 권한이 있는 그룹을 추가하십시오.";
$text['label-dashboard_chart_type']['en-us'] = "Chart Type";
$text['label-dashboard_chart_type']['en-gb'] = "Chart Type";
$text['label-dashboard_chart_type']['ar-eg'] = "نوع التخطيط";
$text['label-dashboard_chart_type']['de-at'] = "Diagramm Typ";
$text['label-dashboard_chart_type']['de-ch'] = "Diagramm Typ";
$text['label-dashboard_chart_type']['de-de'] = "Diagramm Typ";
$text['label-dashboard_chart_type']['el-gr'] = "Τύπος γραφήματος";
$text['label-dashboard_chart_type']['es-cl'] = "Tipo de gráfico";
$text['label-dashboard_chart_type']['es-mx'] = "Tipo de gráfico";
$text['label-dashboard_chart_type']['fr-ca'] = "Type de graphiqueType de graphique";
$text['label-dashboard_chart_type']['fr-fr'] = "Type de graphique";
$text['label-dashboard_chart_type']['he-il'] = "סוג תרשים";
$text['label-dashboard_chart_type']['it-it'] = "Tipo di grafico";
$text['label-dashboard_chart_type']['nl-nl'] = "Grafiektype";
$text['label-dashboard_chart_type']['pl-pl'] = "Typ wykresu";
$text['label-dashboard_chart_type']['pt-br'] = "Tipo de Gráfico";
$text['label-dashboard_chart_type']['pt-pt'] = "Tipo de Gráfico";
$text['label-dashboard_chart_type']['ro-ro'] = "Tip diagramă";
$text['label-dashboard_chart_type']['ru-ru'] = "Тип диаграммы";
$text['label-dashboard_chart_type']['sv-se'] = "Diagramtyp";
$text['label-dashboard_chart_type']['uk-ua'] = "Тип діаграми";
$text['label-dashboard_chart_type']['tr-tr'] = "Grafik tipi";
$text['label-dashboard_chart_type']['zh-cn'] = "图表类型";
$text['label-dashboard_chart_type']['ja-jp'] = "グラフの種類";
$text['label-dashboard_chart_type']['ko-kr'] = "차트 종류";
$text['description-dashboard_chart_type']['en-us'] = "Enter the dashboard widget chart type.";
$text['description-dashboard_chart_type']['en-gb'] = "Enter the dashboard widget chart type.";
$text['description-dashboard_chart_type']['ar-eg'] = "أدخل نوع مخطط عنصر واجهة المستخدم للوحة المعلومات.";
$text['description-dashboard_chart_type']['de-at'] = "Geben Sie den Diagrammtyp des Dashboard-Widgets ein.";
$text['description-dashboard_chart_type']['de-ch'] = "Geben Sie den Diagrammtyp des Dashboard-Widgets ein.";
$text['description-dashboard_chart_type']['de-de'] = "Geben Sie den Diagrammtyp des Dashboard-Widgets ein.";
$text['description-dashboard_chart_type']['el-gr'] = "Εισαγάγετε τον τύπο γραφήματος του γραφικού στοιχείου πίνακα εργαλείων.";
$text['description-dashboard_chart_type']['es-cl'] = "Ingrese el tipo de gráfico del widget del panel.";
$text['description-dashboard_chart_type']['es-mx'] = "Ingrese el tipo de gráfico del widget del panel.";
$text['description-dashboard_chart_type']['fr-ca'] = "Entrez le type de graphique du widget de tableau de bord.";
$text['description-dashboard_chart_type']['fr-fr'] = "Entrez le type de graphique du widget de tableau de bord.";
$text['description-dashboard_chart_type']['he-il'] = "הזן את סוג תרשים הווידג'ט של לוח המחוונים.";
$text['description-dashboard_chart_type']['it-it'] = "Inserisci il tipo di grafico del widget del dashboard.";
$text['description-dashboard_chart_type']['nl-nl'] = "Voer het diagramtype van de dashboardwidget in.";
$text['description-dashboard_chart_type']['pl-pl'] = "Wprowadź typ wykresu widżetu panelu kontrolnego.";
$text['description-dashboard_chart_type']['pt-br'] = "Insira o tipo de gráfico do widget do painel.";
$text['description-dashboard_chart_type']['pt-pt'] = "Insira o tipo de gráfico do widget do painel.";
$text['description-dashboard_chart_type']['ro-ro'] = "Introduceți tipul de diagramă widget din tabloul de bord.";
$text['description-dashboard_chart_type']['ru-ru'] = "Введите тип диаграммы виджета информационной панели.";
$text['description-dashboard_chart_type']['sv-se'] = "Ange diagramtypen för instrumentpanelens widget.";
$text['description-dashboard_chart_type']['uk-ua'] = "Введіть тип діаграми віджета інформаційної панелі.";
$text['description-dashboard_chart_type']['tr-tr'] = "Kontrol paneli widget'ı grafik türünü girin.";
$text['description-dashboard_chart_type']['zh-cn'] = "输入仪表板小部件图表类型。";
$text['description-dashboard_chart_type']['ja-jp'] = "ダッシュボード ウィジェットのグラフ タイプを入力します。";
$text['description-dashboard_chart_type']['ko-kr'] = "대시보드 위젯 차트 유형을 입력합니다.";
$text['label-doughnut']['en-us'] = "Doughnut";
$text['label-doughnut']['en-gb'] = "Doughnut";
$text['label-doughnut']['ar-eg'] = "كعكة محلاة";
$text['label-doughnut']['de-at'] = "Krapfen";
$text['label-doughnut']['de-ch'] = "Krapfen";
$text['label-doughnut']['de-de'] = "Krapfen";
$text['label-doughnut']['el-gr'] = "Ντόνατ";
$text['label-doughnut']['es-cl'] = "Rosquilla";
$text['label-doughnut']['es-mx'] = "Rosquilla";
$text['label-doughnut']['fr-ca'] = "Donut";
$text['label-doughnut']['fr-fr'] = "Donut";
$text['label-doughnut']['he-il'] = "סופגניה";
$text['label-doughnut']['it-it'] = "Ciambella";
$text['label-doughnut']['nl-nl'] = "Donut";
$text['label-doughnut']['pl-pl'] = "Pączek";
$text['label-doughnut']['pt-br'] = "Rosquinha";
$text['label-doughnut']['pt-pt'] = "Rosquinha";
$text['label-doughnut']['ro-ro'] = "Gogoașă";
$text['label-doughnut']['ru-ru'] = "Пончик";
$text['label-doughnut']['sv-se'] = "Munk";
$text['label-doughnut']['uk-ua'] = "Пончик";
$text['label-doughnut']['tr-tr'] = "Tatlı çörek";
$text['label-doughnut']['zh-cn'] = "油炸圈饼";
$text['label-doughnut']['ja-jp'] = "ドーナツ";
$text['label-doughnut']['ko-kr'] = "도넛";
$text['label-dashboard_heading_text_color']['en-us'] = "Heading Text Color";
$text['label-dashboard_heading_text_color']['en-gb'] = "Heading Text Color";
$text['label-dashboard_heading_text_color']['ar-eg'] = "لون نص العنوان";
@@ -728,4 +806,4 @@ $text['login-message_dismiss']['zh-cn'] = "Dismiss Message";
$text['login-message_dismiss']['ja-jp'] = "Dismiss Message";
$text['login-message_dismiss']['ko-kr'] = "Dismiss Message";
?>
?>
+29 -1
View File
@@ -65,6 +65,7 @@
$dashboard_name = $_POST["dashboard_name"] ?? '';
$dashboard_path = $_POST["dashboard_path"] ?? '';
$dashboard_groups = $_POST["dashboard_groups"] ?? '';
$dashboard_chart_type = $_POST["dashboard_chart_type"] ?? '';
$dashboard_heading_text_color = $_POST["dashboard_heading_text_color"] ?? '';
$dashboard_number_text_color = $_POST["dashboard_number_text_color"] ?? '';
$dashboard_column_span = $_POST["dashboard_column_span"] ?? '';
@@ -165,6 +166,7 @@
$array['dashboard'][0]['dashboard_uuid'] = $dashboard_uuid;
$array['dashboard'][0]['dashboard_name'] = $dashboard_name;
$array['dashboard'][0]['dashboard_path'] = $dashboard_path;
$array['dashboard'][0]['dashboard_chart_type'] = $dashboard_chart_type;
$array['dashboard'][0]['dashboard_heading_text_color'] = $dashboard_heading_text_color;
$array['dashboard'][0]['dashboard_number_text_color'] = $dashboard_number_text_color;
$array['dashboard'][0]['dashboard_column_span'] = $dashboard_column_span;
@@ -212,6 +214,7 @@
$sql .= " dashboard_uuid, ";
$sql .= " dashboard_name, ";
$sql .= " dashboard_path, ";
$sql .= " dashboard_chart_type, ";
$sql .= " dashboard_heading_text_color, ";
$sql .= " dashboard_number_text_color, ";
$sql .= " dashboard_column_span, ";
@@ -227,6 +230,7 @@
if (is_array($row) && @sizeof($row) != 0) {
$dashboard_name = $row["dashboard_name"];
$dashboard_path = $row["dashboard_path"];
$dashboard_chart_type = $row["dashboard_chart_type"];
$dashboard_heading_text_color = $row["dashboard_heading_text_color"];
$dashboard_number_text_color = $row["dashboard_number_text_color"];
$dashboard_column_span = $row["dashboard_column_span"];
@@ -404,6 +408,30 @@
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_chart_type']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select name='dashboard_chart_type' class='formfld'>\n";
if ($dashboard_chart_type == "doughnut") {
echo " <option value='doughnut' selected='selected'>".$text['label-doughnut']."</option>\n";
}
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";
}
else {
echo " <option value='none'>".$text['label-none']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-dashboard_chart_type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo $text['label-dashboard_heading_text_color']."\n";
@@ -543,4 +571,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>
+2 -1
View File
@@ -72,6 +72,7 @@
$sql .= "dashboard_uuid, \n";
$sql .= "dashboard_name, \n";
$sql .= "dashboard_path, \n";
$sql .= "dashboard_chart_type, \n";
$sql .= "dashboard_heading_text_color, \n";
$sql .= "dashboard_number_text_color, \n";
$sql .= "dashboard_column_span, \n";
@@ -149,7 +150,6 @@
echo " Chart.defaults.responsive = true;\n";
echo " Chart.defaults.maintainAspectRatio = false;\n";
echo " Chart.defaults.plugins.legend.display = false;\n";
echo " Chart.defaults.plugins.title.display = true;\n";
echo " Chart.overrides.doughnut.cutout = '75%';\n";
echo "</script>\n";
@@ -303,6 +303,7 @@
foreach($dashboard as $row) {
$dashboard_name = strtolower($row['dashboard_name']);
$dashboard_name = str_replace(" ", "_", $dashboard_name);
$dashboard_chart_type = $row['dashboard_chart_type'] ?? 'doughnut';
$dashboard_heading_text_color = $row['dashboard_heading_text_color'] ?? $settings->get('theme', 'dashboard_heading_text_color');
$dashboard_number_text_color = $row['dashboard_heading_text_color'] ?? $settings->get('theme', 'dashboard_number_text_color');
echo "<div class='widget' id='".$dashboard_name."' draggable='false'>\n";