|
@@ -44,7 +44,7 @@
|
|
$text = $language->get();
|
|
$text = $language->get();
|
|
|
|
|
|
//action add or update
|
|
//action add or update
|
|
- if (is_uuid($_REQUEST["id"])) {
|
|
|
|
|
|
+ if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
|
$action = "update";
|
|
$action = "update";
|
|
$dashboard_uuid = $_REQUEST["id"];
|
|
$dashboard_uuid = $_REQUEST["id"];
|
|
$id = $_REQUEST["id"];
|
|
$id = $_REQUEST["id"];
|
|
@@ -54,19 +54,19 @@
|
|
}
|
|
}
|
|
|
|
|
|
//get http post variables and set them to php variables
|
|
//get http post variables and set them to php variables
|
|
- if (count($_REQUEST) > 0) {
|
|
|
|
- $dashboard_name = $_POST["dashboard_name"];
|
|
|
|
- $dashboard_path = $_POST["dashboard_path"];
|
|
|
|
- $dashboard_groups = $_POST["dashboard_groups"];
|
|
|
|
- $dashboard_column_span = $_POST["dashboard_column_span"];
|
|
|
|
- $dashboard_details_state = $_POST["dashboard_details_state"];
|
|
|
|
- $dashboard_order = $_POST["dashboard_order"];
|
|
|
|
|
|
+ if (!empty($_POST)) {
|
|
|
|
+ $dashboard_name = $_POST["dashboard_name"] ?? '';
|
|
|
|
+ $dashboard_path = $_POST["dashboard_path"] ?? '';
|
|
|
|
+ $dashboard_groups = $_POST["dashboard_groups"] ?? '';
|
|
|
|
+ $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"];
|
|
|
|
|
|
+ $dashboard_description = $_POST["dashboard_description"] ?? '';
|
|
}
|
|
}
|
|
|
|
|
|
//delete the group from the sub table
|
|
//delete the group from the sub table
|
|
- if ($_REQUEST["a"] == "delete" && permission_exists("dashboard_group_delete") && is_uuid($_GET["dashboard_group_uuid"]) && is_uuid($_GET["dashboard_uuid"])) {
|
|
|
|
|
|
+ if (isset($_REQUEST["a"]) && $_REQUEST["a"] == "delete" && permission_exists("dashboard_group_delete") && is_uuid($_GET["dashboard_group_uuid"]) && is_uuid($_GET["dashboard_uuid"])) {
|
|
//get the uuid
|
|
//get the uuid
|
|
$dashboard_group_uuid = $_GET["dashboard_group_uuid"];
|
|
$dashboard_group_uuid = $_GET["dashboard_group_uuid"];
|
|
$dashboard_uuid = $_GET["dashboard_uuid"];
|
|
$dashboard_uuid = $_GET["dashboard_uuid"];
|
|
@@ -196,7 +196,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
//pre-populate the form
|
|
//pre-populate the form
|
|
- if (is_array($_GET) && $_POST["persistformvar"] != "true") {
|
|
|
|
|
|
+ if (empty($_POST["persistformvar"])) {
|
|
$sql = "select ";
|
|
$sql = "select ";
|
|
$sql .= " dashboard_uuid, ";
|
|
$sql .= " dashboard_uuid, ";
|
|
$sql .= " dashboard_name, ";
|
|
$sql .= " dashboard_name, ";
|
|
@@ -214,7 +214,6 @@
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
|
if (is_array($row) && @sizeof($row) != 0) {
|
|
$dashboard_name = $row["dashboard_name"];
|
|
$dashboard_name = $row["dashboard_name"];
|
|
$dashboard_path = $row["dashboard_path"];
|
|
$dashboard_path = $row["dashboard_path"];
|
|
- $dashboard_groups = $row["dashboard_groups"];
|
|
|
|
$dashboard_column_span = $row["dashboard_column_span"];
|
|
$dashboard_column_span = $row["dashboard_column_span"];
|
|
$dashboard_details_state = $row["dashboard_details_state"];
|
|
$dashboard_details_state = $row["dashboard_details_state"];
|
|
$dashboard_order = $row["dashboard_order"];
|
|
$dashboard_order = $row["dashboard_order"];
|
|
@@ -238,7 +237,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
//add the $dashboard_group_uuid
|
|
//add the $dashboard_group_uuid
|
|
- if (!is_uuid($dashboard_group_uuid)) {
|
|
|
|
|
|
+ if (empty($dashboard_group_uuid) || !empty($dashboard_group_uuid) && !is_uuid($dashboard_group_uuid)) {
|
|
$dashboard_group_uuid = uuid();
|
|
$dashboard_group_uuid = uuid();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -312,10 +311,10 @@
|
|
echo " <div style='clear: both;'></div>\n";
|
|
echo " <div style='clear: both;'></div>\n";
|
|
echo "</div>\n";
|
|
echo "</div>\n";
|
|
|
|
|
|
- echo $text['title_description-dashboard']."\n";
|
|
|
|
|
|
+ //echo $text['title_description-dashboard']."\n";
|
|
echo "<br /><br />\n";
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
- if ($action == 'update') {
|
|
|
|
|
|
+ if (!empty($action) && $action == 'update') {
|
|
if (permission_exists('dashboard_add')) {
|
|
if (permission_exists('dashboard_add')) {
|
|
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
|
|
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]);
|
|
}
|
|
}
|
|
@@ -359,7 +358,7 @@
|
|
if (!empty($field['group_name'])) {
|
|
if (!empty($field['group_name'])) {
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo " <td class='vtable' style='white-space: nowrap; padding-right: 30px;' nowrap='nowrap'>\n";
|
|
echo " <td class='vtable' style='white-space: nowrap; padding-right: 30px;' nowrap='nowrap'>\n";
|
|
- echo $field['group_name'].(($field['group_domain_uuid'] != '') ? "@".$_SESSION['domains'][$field['group_domain_uuid']]['domain_name'] : null);
|
|
|
|
|
|
+ echo $field['group_name'].((!empty($field['group_domain_uuid'])) ? "@".$_SESSION['domains'][$field['group_domain_uuid']]['domain_name'] : null);
|
|
echo " </td>\n";
|
|
echo " </td>\n";
|
|
if (permission_exists('dashboard_group_delete') || if_group("superadmin")) {
|
|
if (permission_exists('dashboard_group_delete') || if_group("superadmin")) {
|
|
echo " <td class='list_control_icons' style='width: 25px;'>\n";
|
|
echo " <td class='list_control_icons' style='width: 25px;'>\n";
|