From 5c096bbec87ef434f934323592c3ad36876024ec Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Fri, 12 Sep 2025 10:57:15 -0700 Subject: [PATCH] Dashboard: Fix php warnings (#7493) * Dashboard: Fix php warnings * Update dashboard_edit.php * Update dashboard.php * Update parent.php * Update footer.php * Update active_calls.php * Update active_calls.php --- app/active_calls/active_calls.php | 4 ++-- app/active_calls/resources/dashboard/active_calls.php | 2 +- core/dashboard/dashboard.php | 4 ++-- core/dashboard/dashboard_edit.php | 3 +++ core/dashboard/index.php | 4 ++-- core/dashboard/resources/dashboard/parent.php | 2 +- resources/footer.php | 4 ++-- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/active_calls/active_calls.php b/app/active_calls/active_calls.php index e458582729..63c85746ec 100644 --- a/app/active_calls/active_calls.php +++ b/app/active_calls/active_calls.php @@ -241,9 +241,9 @@ echo " \n"; -$version = md5(file_get_contents(__DIR__, '/resources/javascript/arrow.js')); +$version = md5(file_get_contents(__DIR__ . '/resources/javascript/arrows.js')); echo "\n"; ?> \n"; ?> diff --git a/core/dashboard/dashboard.php b/core/dashboard/dashboard.php index d9b7d3cd63..74da2194f9 100644 --- a/core/dashboard/dashboard.php +++ b/core/dashboard/dashboard.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2021-2024 + Portions created by the Initial Developer are Copyright (C) 2021-2025 the Initial Developer. All Rights Reserved. */ @@ -205,7 +205,7 @@ $list_row_url = ''; if (permission_exists('dashboard_edit')) { $list_row_url = "dashboard_edit.php?id=".urlencode($row['dashboard_uuid']); - if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) { + if (!empty($row['domain_uuid']) && $row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) { $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true'; } } diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 6de7263bb0..de2774ed74 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -55,9 +55,12 @@ $dashboard_content = ''; $dashboard_content_text_align = ''; $dashboard_content_details = ''; + $dashboard_chart_type = ''; $dashboard_label_enabled = 'true'; $dashboard_label_text_color = ''; + $dashboard_label_text_color_hover = ''; $dashboard_label_background_color = ''; + $dashboard_label_background_color_hover = ''; $dashboard_number_text_color = ''; $dashboard_number_background_color = ''; $dashboard_groups = []; diff --git a/core/dashboard/index.php b/core/dashboard/index.php index ce32e51e14..5c09edc1fb 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -172,7 +172,7 @@ require_once "resources/header.php"; //include websockets - $version = md5(file_get_contents(__DIR__, '/resources/javascript/ws_client.js')); + $version = md5(file_get_contents(__DIR__ . '/resources/javascript/ws_client.js')); echo "\n"; //include sortablejs @@ -204,7 +204,7 @@ echo "
".$text['title-dashboard']."
\n"; echo "
\n"; echo "
\n"; - if ($_SESSION['theme']['menu_style']['text'] != 'side') { + if ($settings->get('theme', 'menu_style') != 'side') { echo " ".$text['label-welcome']." ".$_SESSION["username"]."   "; } if (permission_exists('dashboard_edit')) { diff --git a/core/dashboard/resources/dashboard/parent.php b/core/dashboard/resources/dashboard/parent.php index 4fcf295d12..b5788e300f 100644 --- a/core/dashboard/resources/dashboard/parent.php +++ b/core/dashboard/resources/dashboard/parent.php @@ -12,7 +12,7 @@ $text = $language->get($_SESSION['domain']['language']['code'], dirname($dashboard_url)); //get the dashboard label - $dashboard_label = $text['title-'.$dashboard_key]; + $dashboard_label = $text['title-'.$dashboard_key] ?? ''; if (empty($dashboard_label)) { $dashboard_label = $dashboard_name; } diff --git a/resources/footer.php b/resources/footer.php index 87fca34bc0..6faaabe359 100644 --- a/resources/footer.php +++ b/resources/footer.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2024 + Portions created by the Initial Developer are Copyright (C) 2008-2025 the Initial Developer. All Rights Reserved. Contributor(s): @@ -214,7 +214,7 @@ unset($menu); } //build menu by style - switch ($_SESSION['theme']['menu_style']['text']) { + switch ($settings->get('theme', 'menu_style')) { case 'side': $view->assign('menu_side_state', (isset($_SESSION['theme']['menu_side_state']['text']) && $_SESSION['theme']['menu_side_state']['text'] != '' ? $_SESSION['theme']['menu_side_state']['text'] : 'expanded')); if ($_SESSION['theme']['menu_side_state']['text'] != 'hidden') {