diff --git a/front/asset.form.php b/front/asset.form.php index fe666f5..3cfabf9 100644 --- a/front/asset.form.php +++ b/front/asset.form.php @@ -1,5 +1,7 @@ delete('glpi_plugin_urbackup_serverassets', ['id' => (int) $link['id']]); - if ($result) { $item->getFromDB($items_id); Html::redirect($item->getLinkURL()); diff --git a/front/config.form.php b/front/config.form.php index db0bb8c..5041d4e 100644 --- a/front/config.form.php +++ b/front/config.form.php @@ -1,5 +1,7 @@ runFile() - * - schema evolution using Migration addField(), addKey(), executeMigration() - * - * ------------------------------------------------------------------------- */ use GlpiPlugin\Urbackup\Config; diff --git a/install/uninstall.php b/install/uninstall.php index 454285e..29ca564 100644 --- a/install/uninstall.php +++ b/install/uninstall.php @@ -1,12 +1,11 @@ initForm($ID, $options); $this->showFormHeader($options); - $this->showFormFields($ID); + $this->showFormFields($ID > 0 ? (int) $ID : null); $this->showFormButtons($options); return true; @@ -1339,7 +1341,7 @@ JAVASCRIPT; return $cache[$id]; } - private static function getAssetIp(string $itemtype, int $items_id): string + public static function getAssetIp(string $itemtype, int $items_id): string { global $DB; diff --git a/src/ServerAsset.php b/src/ServerAsset.php index 56eb4d8..de697f7 100644 --- a/src/ServerAsset.php +++ b/src/ServerAsset.php @@ -79,7 +79,6 @@ class ServerAsset extends CommonDBTM } $table = self::getTable(); - $date = $_SESSION['glpi_currenttime'] ?? date('Y-m-d H:i:s'); $existing = self::getLinkForAsset($itemtype, $items_id, false); @@ -88,10 +87,6 @@ class ServerAsset extends CommonDBTM $table, [ 'plugin_urbackup_servers_id' => $server_id, - 'client_name' => (string) ($item->fields['name'] ?? ''), - 'client_ip' => self::extractAssetIp($item), - 'is_active' => 1, - 'date_mod' => $date, ], [ 'id' => (int) $existing['id'], @@ -243,43 +238,40 @@ class ServerAsset extends CommonDBTM echo "
| " . htmlspecialchars(__('Linked assets', 'urbackup')) . " | |||||
|---|---|---|---|---|---|
| " . htmlspecialchars(__('Linked assets', 'urbackup')) . " | |||||
| " . htmlspecialchars(__('Asset', 'urbackup')) . " | "; echo "" . htmlspecialchars(__('Type')) . " | "; echo "" . htmlspecialchars(__('IP address', 'urbackup')) . " | "; - echo "" . htmlspecialchars(__('Last file backup', 'urbackup')) . " | "; - echo "" . htmlspecialchars(__('Last image backup', 'urbackup')) . " | "; echo "|
| " . $asset_label . " | "; echo "" . htmlspecialchars($itemtype) . " | "; - echo "" . htmlspecialchars((string) $row['client_ip']) . " | "; - echo "" . htmlspecialchars((string) $row['last_file_backup']) . " | "; - echo "" . htmlspecialchars((string) $row['last_image_backup']) . " | "; + echo "" . htmlspecialchars($asset_ip ?: '-') . " | "; echo "