diff --git a/pandora_console/godmode/resources/resources_export_import.php b/pandora_console/godmode/resources/resources_export_import.php
index 721666df05..ac9fdd44a4 100644
--- a/pandora_console/godmode/resources/resources_export_import.php
+++ b/pandora_console/godmode/resources/resources_export_import.php
@@ -50,13 +50,14 @@ $prd = new Prd();
if (isset($_FILES['resource_import']) === true) {
$data = parse_ini_file($_FILES['resource_import']['tmp_name'], true);
if ($data !== false) {
- $msg = $prd->importPrd($data);
- $array_msg = [];
- foreach ($msg['items'] as $key => $value) {
- $array_msg[$value[0]][key($value[1])][$value[1][key($value[1])]] = $value[1][key($value[1])];
+ if (isset($data['prd_data']['name']) === true
+ && isset($data['prd_data']['type']) === true
+ ) {
+ $name = $data['prd_data']['name'];
+ $type = $data['prd_data']['type'];
}
- $msg['items'] = $array_msg;
+ $msg = $prd->importPrd($data);
} else {
$msg = [
'status' => false,
@@ -141,26 +142,13 @@ html_print_table($table);
let title = "";
let message = "";
if (msg.status === true) {
- title = "";
- message = "";
- message += "
";
- Object.entries(msg.items).forEach(([table, value]) => {
- message += table + " ";
- Object.entries(value).forEach(([field, value2]) => {
- message += "with " + field + ": (";
- if (typeof value2 === 'object' && Object.keys(value2).length > 0) {
- Object.entries(value2).forEach(([key3, value3]) => {
- message += value3 + " , ";
- });
- }
- });
- message = message.substring(0, message.length - 3);
- message += ")";
- message += "
";
- });
-
+ title = "";
+ message = "";
+ const name = "";
+ const type = "";
+ message += ` ${type} - ${name}`;
} else {
- title = "";
+ title = "";
Object.entries(msg.errors).forEach(([key, value]) => {
message += value + "
";
});
@@ -256,4 +244,4 @@ html_print_table($table);
});
}
});
-
+
\ No newline at end of file