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
This commit is contained in:
Alex
2025-09-12 10:57:15 -07:00
committed by GitHub
parent 683fd9ab9f
commit 5c096bbec8
7 changed files with 13 additions and 10 deletions

View File

@@ -241,9 +241,9 @@ echo " <input id='token' type='hidden' name='" . $token['name'] . "' value='" .
subscriber::save_token($token, ['active.calls']);
//break the caching
$version = md5(file_get_contents(__DIR__, '/resources/javascript/websocket_client.js'));
$version = md5(file_get_contents(__DIR__ . '/resources/javascript/websocket_client.js'));
echo "<script src='resources/javascript/websocket_client.js?v=$version'></script>\n";
$version = md5(file_get_contents(__DIR__, '/resources/javascript/arrow.js'));
$version = md5(file_get_contents(__DIR__ . '/resources/javascript/arrows.js'));
echo "<script src='resources/javascript/arrows.js?v=$version'></script>\n";
?>
<script>

View File

@@ -96,7 +96,7 @@ if ($dashboard_details_state != 'disabled') {
echo "</div>\n";
//include arrows when not changed
$version = md5(file_get_contents($project_root, '/app/active_calls/resources/javascript/arrow.js'));
$version = md5(file_get_contents($project_root . '/app/active_calls/resources/javascript/arrows.js'));
echo "<script src='/app/active_calls/resources/javascript/arrows.js?v=$version'></script>\n";
?>

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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';
}
}

View File

@@ -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 = [];

View File

@@ -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 "<script src='/core/dashboard/resources/javascript/ws_client.js?v=$version'></script>\n";
//include sortablejs
@@ -204,7 +204,7 @@
echo " <div class='heading'><b>".$text['title-dashboard']."</b></div>\n";
echo " <div class='actions'>\n";
echo " <form id='dashboard' method='post' _onsubmit='setFormSubmitting()'>\n";
if ($_SESSION['theme']['menu_style']['text'] != 'side') {
if ($settings->get('theme', 'menu_style') != 'side') {
echo " ".$text['label-welcome']." <a href='".PROJECT_PATH."/core/users/user_edit.php?id=user'>".$_SESSION["username"]."</a>&nbsp; &nbsp;";
}
if (permission_exists('dashboard_edit')) {

View File

@@ -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;
}

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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') {