Dashboard - Edit: Updates for PHP 8.1

This commit is contained in:
fusionate
2023-05-17 00:00:40 +00:00
parent 10c39f9bcb
commit 9465e36b37
2 changed files with 10 additions and 10 deletions

View File

@@ -61,7 +61,7 @@
$dashboard_column_span = $_POST["dashboard_column_span"] ?? '';
$dashboard_details_state = $_POST["dashboard_details_state"] ?? '';
$dashboard_order = $_POST["dashboard_order"] ?? '';
$dashboard_enabled = $_POST["dashboard_enabled"] ?: 'false';
$dashboard_enabled = $_POST["dashboard_enabled"] ?? 'false';
$dashboard_description = $_POST["dashboard_description"] ?? '';
}
@@ -370,13 +370,13 @@
}
echo "</table>\n";
}
if (is_array($groups)) {
echo "<br />\n";
if (!empty($groups) && is_array($groups)) {
if (!empty($dashboard_groups)) { echo "<br />\n"; }
echo "<select name='dashboard_groups[0][group_uuid]' class='formfld' style='width: auto; margin-right: 3px;'>\n";
echo " <option value=''></option>\n";
foreach($groups as $row) {
if ($field['group_level'] <= $_SESSION['user']['group_level']) {
if (!in_array($row["group_uuid"], $assigned_groups)) {
foreach ($groups as $row) {
if ((!empty($field['group_level']) && $field['group_level'] <= $_SESSION['user']['group_level']) || empty($field['group_level'])) {
if (empty($assigned_groups) || !in_array($row["group_uuid"], $assigned_groups)) {
echo " <option value='".$row['group_uuid']."'>".$row['group_name'].(!empty($row['domain_uuid']) ? "@".$_SESSION['domains'][$row['domain_uuid']]['domain_name'] : null)."</option>\n";
}
}

View File

@@ -85,7 +85,7 @@ if (!class_exists('dashboard')) {
$x = 0;
foreach ($records as $record) {
//add to the array
if ($record['checked'] == 'true' && is_uuid($record['dashboard_uuid'])) {
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['dashboard_uuid'])) {
$array[$this->table][$x]['dashboard_uuid'] = $record['dashboard_uuid'];
}
@@ -200,7 +200,7 @@ if (!class_exists('dashboard')) {
//get checked records
foreach($records as $record) {
if ($record['checked'] == 'true' && is_uuid($record['dashboard_uuid'])) {
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['dashboard_uuid'])) {
$uuids[] = "'".$record['dashboard_uuid']."'";
}
}
@@ -210,7 +210,7 @@ if (!class_exists('dashboard')) {
$sql = "select * from v_".$this->table." ";
$sql .= "where dashboard_uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters, 'all');
$rows = $database->select($sql, $parameters ?? null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
$x = 0;
foreach ($rows as $row) {
@@ -218,7 +218,7 @@ if (!class_exists('dashboard')) {
$array[$this->table][$x] = $row;
//add copy to the description
$array[$this->table][$x][dashboard.'_uuid'] = uuid();
$array[$this->table][$x]['dashboard_uuid'] = uuid();
$array[$this->table][$x][$this->description_field] = trim($row[$this->description_field]).' ('.$text['label-copy'].')';
//increment the id