Dashboard - Edit: Updates for PHP 8.1
This commit is contained in:
parent
10c39f9bcb
commit
9465e36b37
|
|
@ -61,7 +61,7 @@
|
||||||
$dashboard_column_span = $_POST["dashboard_column_span"] ?? '';
|
$dashboard_column_span = $_POST["dashboard_column_span"] ?? '';
|
||||||
$dashboard_details_state = $_POST["dashboard_details_state"] ?? '';
|
$dashboard_details_state = $_POST["dashboard_details_state"] ?? '';
|
||||||
$dashboard_order = $_POST["dashboard_order"] ?? '';
|
$dashboard_order = $_POST["dashboard_order"] ?? '';
|
||||||
$dashboard_enabled = $_POST["dashboard_enabled"] ?: 'false';
|
$dashboard_enabled = $_POST["dashboard_enabled"] ?? 'false';
|
||||||
$dashboard_description = $_POST["dashboard_description"] ?? '';
|
$dashboard_description = $_POST["dashboard_description"] ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -370,13 +370,13 @@
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
}
|
}
|
||||||
if (is_array($groups)) {
|
if (!empty($groups) && is_array($groups)) {
|
||||||
echo "<br />\n";
|
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 "<select name='dashboard_groups[0][group_uuid]' class='formfld' style='width: auto; margin-right: 3px;'>\n";
|
||||||
echo " <option value=''></option>\n";
|
echo " <option value=''></option>\n";
|
||||||
foreach($groups as $row) {
|
foreach ($groups as $row) {
|
||||||
if ($field['group_level'] <= $_SESSION['user']['group_level']) {
|
if ((!empty($field['group_level']) && $field['group_level'] <= $_SESSION['user']['group_level']) || empty($field['group_level'])) {
|
||||||
if (!in_array($row["group_uuid"], $assigned_groups)) {
|
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";
|
echo " <option value='".$row['group_uuid']."'>".$row['group_name'].(!empty($row['domain_uuid']) ? "@".$_SESSION['domains'][$row['domain_uuid']]['domain_name'] : null)."</option>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ if (!class_exists('dashboard')) {
|
||||||
$x = 0;
|
$x = 0;
|
||||||
foreach ($records as $record) {
|
foreach ($records as $record) {
|
||||||
//add to the array
|
//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'];
|
$array[$this->table][$x]['dashboard_uuid'] = $record['dashboard_uuid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,7 +200,7 @@ if (!class_exists('dashboard')) {
|
||||||
|
|
||||||
//get checked records
|
//get checked records
|
||||||
foreach($records as $record) {
|
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']."'";
|
$uuids[] = "'".$record['dashboard_uuid']."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -210,7 +210,7 @@ if (!class_exists('dashboard')) {
|
||||||
$sql = "select * from v_".$this->table." ";
|
$sql = "select * from v_".$this->table." ";
|
||||||
$sql .= "where dashboard_uuid in (".implode(', ', $uuids).") ";
|
$sql .= "where dashboard_uuid in (".implode(', ', $uuids).") ";
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$rows = $database->select($sql, $parameters, 'all');
|
$rows = $database->select($sql, $parameters ?? null, 'all');
|
||||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||||
$x = 0;
|
$x = 0;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
|
@ -218,7 +218,7 @@ if (!class_exists('dashboard')) {
|
||||||
$array[$this->table][$x] = $row;
|
$array[$this->table][$x] = $row;
|
||||||
|
|
||||||
//add copy to the description
|
//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'].')';
|
$array[$this->table][$x][$this->description_field] = trim($row[$this->description_field]).' ('.$text['label-copy'].')';
|
||||||
|
|
||||||
//increment the id
|
//increment the id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue