diff --git a/composer copy.json b/composer copy.json new file mode 100644 index 0000000..0a98ead --- /dev/null +++ b/composer copy.json @@ -0,0 +1,23 @@ +{ + "name": "finstral/glpi-urbackup-plugin", + "description": "UrBackup integration plugin for GLPI 11", + "type": "glpi-plugin", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=8.3" + }, + "autoload": { + "psr-4": { + "GlpiPlugin\\Urbackup\\": "src/" + } + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true + }, + "extra": { + "glpi-plugin": { + "key": "urbackup" + } + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index 0a98ead..721e883 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "finstral/glpi-urbackup-plugin", + "name": "glpi/urbackup-plugin", "description": "UrBackup integration plugin for GLPI 11", "type": "glpi-plugin", "license": "GPL-2.0-or-later", diff --git a/front/asset.form.php b/front/asset.form.php index 3cfabf9..3046d20 100644 --- a/front/asset.form.php +++ b/front/asset.form.php @@ -27,11 +27,11 @@ $itemtype = (string) ($_POST['itemtype'] ?? $_GET['itemtype'] ?? ''); $items_id = (int) ($_POST['items_id'] ?? $_GET['items_id'] ?? 0); if ($itemtype === '' || $items_id <= 0) { - Html::displayValidationError(__('Invalid parameters')); + Html::displayValidationError(__('Invalid parameters', 'urbackup')); } if (!in_array($itemtype, Config::getEnabledItemtypes(), true)) { - Html::displayValidationError(__('Item type not enabled for UrBackup')); + Html::displayValidationError(__('Item type not enabled for UrBackup', 'urbackup')); } $item = getItemForItemtype($itemtype); @@ -48,13 +48,13 @@ if (isset($_POST['connect'])) { $server_id = (int) ($_POST['plugin_urbackup_servers_id'] ?? 0); if ($server_id <= 0) { - Html::displayValidationError(__('No server selected')); + Html::displayValidationError(__('No server selected', 'urbackup')); } $link = ServerAsset::getLinkForAsset($itemtype, $items_id); if ($link !== null) { - Html::displayValidationError(__('Asset is already linked to a server')); + Html::displayValidationError(__('Asset is already linked to a server', 'urbackup')); } $result = ServerAsset::createForAsset($itemtype, $items_id, $server_id); @@ -63,7 +63,7 @@ if (isset($_POST['connect'])) { $item->getFromDB($items_id); Html::redirect($item->getLinkURL()); } else { - Html::displayValidationError(__('Failed to link asset to server')); + Html::displayValidationError(__('Failed to link asset to server', 'urbackup')); } } @@ -78,7 +78,7 @@ if (isset($_POST['disconnect'])) { $item->getFromDB($items_id); Html::redirect($item->getLinkURL()); } else { - Html::displayValidationError(__('Failed to disconnect asset from server')); + Html::displayValidationError(__('Failed to disconnect asset from server', 'urbackup')); } } diff --git a/front/server.php b/front/server.php index 93b360a..d4fc148 100644 --- a/front/server.php +++ b/front/server.php @@ -18,7 +18,7 @@ if (!Profile::canCurrentUser(READ)) { } Html::header( - 'UrBackup Servers', + __('UrBackup Servers', 'urbackup'), '', 'admin', 'GlpiPlugin\Urbackup\Server' diff --git a/front/server_test.ajax.php b/front/server_test.ajax.php index 937bf2c..79a7b97 100644 --- a/front/server_test.ajax.php +++ b/front/server_test.ajax.php @@ -14,21 +14,21 @@ Html::header_nocache(); Session::checkLoginUser(); if (!Session::haveRight('plugin_urbackup', READ)) { - echo json_encode(['success' => false, 'message' => 'No permission']); + echo json_encode(['success' => false, 'message' => __('No permission', 'urbackup')]); exit; } $server_id = (int) ($_POST['id'] ?? $_GET['id'] ?? 0); if ($server_id <= 0) { - echo json_encode(['success' => false, 'message' => 'Invalid server ID']); + echo json_encode(['success' => false, 'message' => __('Invalid server ID', 'urbackup')]); exit; } $server = new GlpiPlugin\Urbackup\Server(); if (!$server->getFromDB($server_id)) { - echo json_encode(['success' => false, 'message' => 'Server not found']); + echo json_encode(['success' => false, 'message' => __('Server not found', 'urbackup')]); exit; } diff --git a/install/install.php b/install/install.php index 604e60d..44c1c81 100644 --- a/install/install.php +++ b/install/install.php @@ -12,7 +12,7 @@ use GlpiPlugin\Urbackup\Config; use GlpiPlugin\Urbackup\Profile; if (!defined('GLPI_ROOT')) { - die('Sorry. You cannot access this file directly.'); + die(__('Sorry. You cannot access this file directly.', 'urbackup')); } /** diff --git a/install/uninstall.php b/install/uninstall.php index 29ca564..93aecef 100644 --- a/install/uninstall.php +++ b/install/uninstall.php @@ -11,7 +11,7 @@ declare(strict_types=1); use GlpiPlugin\Urbackup\Profile; if (!defined('GLPI_ROOT')) { - die('Sorry. You cannot access this file directly.'); + die(__('Sorry. You cannot access this file directly.', 'urbackup')); } /** diff --git a/locales/de_DE.mo b/locales/de_DE.mo index 9c730d7..16ae426 100644 Binary files a/locales/de_DE.mo and b/locales/de_DE.mo differ diff --git a/locales/de_DE.po b/locales/de_DE.po index 112ac1a..6ed9bc9 100644 --- a/locales/de_DE.po +++ b/locales/de_DE.po @@ -155,4 +155,55 @@ msgid "Last backup" msgstr "Letztes Backup" msgid "Show" -msgstr "Anzeigen" \ No newline at end of file +msgstr "Anzeigen" + +msgid "HTTP" +msgstr "HTTP" + +msgid "HTTPS" +msgstr "HTTPS" + +msgid "API Error" +msgstr "API-Fehler" + +msgid "Unknown" +msgstr "Unbekannt" + +msgid "Asset Definition" +msgstr "Asset-Definition" + +msgid "Legacy" +msgstr "Legacy" + +msgid "UrBackup Servers" +msgstr "UrBackup-Server" + +msgid "Invalid parameters" +msgstr "Ungültige Parameter" + +msgid "Item type not enabled for UrBackup" +msgstr "Elementtyp für UrBackup nicht aktiviert" + +msgid "No server selected" +msgstr "Kein Server ausgewählt" + +msgid "Asset is already linked to a server" +msgstr "Asset ist bereits mit einem Server verknüpft" + +msgid "Failed to link asset to server" +msgstr "Verknüpfung von Asset mit Server fehlgeschlagen" + +msgid "Failed to disconnect asset from server" +msgstr "Trennung von Asset vom Server fehlgeschlagen" + +msgid "No permission" +msgstr "Keine Berechtigung" + +msgid "Invalid server ID" +msgstr "Ungültige Server-ID" + +msgid "Server not found" +msgstr "Server nicht gefunden" + +msgid "Sorry. You cannot access this file directly." +msgstr "Entschuldigung. Sie können nicht direkt auf diese Datei zugreifen." diff --git a/locales/en_GB.mo b/locales/en_GB.mo index 31a9502..7297697 100644 Binary files a/locales/en_GB.mo and b/locales/en_GB.mo differ diff --git a/locales/en_GB.po b/locales/en_GB.po index ba3596d..cda4138 100644 --- a/locales/en_GB.po +++ b/locales/en_GB.po @@ -155,4 +155,55 @@ msgid "Last backup" msgstr "Last backup" msgid "Show" -msgstr "Show" \ No newline at end of file +msgstr "Show" + +msgid "HTTP" +msgstr "HTTP" + +msgid "HTTPS" +msgstr "HTTPS" + +msgid "API Error" +msgstr "API Error" + +msgid "Unknown" +msgstr "Unknown" + +msgid "Asset Definition" +msgstr "Asset Definition" + +msgid "Legacy" +msgstr "Legacy" + +msgid "UrBackup Servers" +msgstr "UrBackup Servers" + +msgid "Invalid parameters" +msgstr "Invalid parameters" + +msgid "Item type not enabled for UrBackup" +msgstr "Item type not enabled for UrBackup" + +msgid "No server selected" +msgstr "No server selected" + +msgid "Asset is already linked to a server" +msgstr "Asset is already linked to a server" + +msgid "Failed to link asset to server" +msgstr "Failed to link asset to server" + +msgid "Failed to disconnect asset from server" +msgstr "Failed to disconnect asset from server" + +msgid "No permission" +msgstr "No permission" + +msgid "Invalid server ID" +msgstr "Invalid server ID" + +msgid "Server not found" +msgstr "Server not found" + +msgid "Sorry. You cannot access this file directly." +msgstr "Sorry. You cannot access this file directly." diff --git a/locales/it_IT.mo b/locales/it_IT.mo index 505476e..06068ab 100644 Binary files a/locales/it_IT.mo and b/locales/it_IT.mo differ diff --git a/locales/it_IT.po b/locales/it_IT.po index 70dff38..af8df01 100644 --- a/locales/it_IT.po +++ b/locales/it_IT.po @@ -155,4 +155,55 @@ msgid "Last backup" msgstr "Ultimo backup" msgid "Show" -msgstr "Mostra" \ No newline at end of file +msgstr "Mostra" + +msgid "HTTP" +msgstr "HTTP" + +msgid "HTTPS" +msgstr "HTTPS" + +msgid "API Error" +msgstr "Errore API" + +msgid "Unknown" +msgstr "Sconosciuto" + +msgid "Asset Definition" +msgstr "Definizione asset" + +msgid "Legacy" +msgstr "Legacy" + +msgid "UrBackup Servers" +msgstr "Server UrBackup" + +msgid "Invalid parameters" +msgstr "Parametri non validi" + +msgid "Item type not enabled for UrBackup" +msgstr "Tipo oggetto non abilitato per UrBackup" + +msgid "No server selected" +msgstr "Nessun server selezionato" + +msgid "Asset is already linked to a server" +msgstr "L'asset è già collegato a un server" + +msgid "Failed to link asset to server" +msgstr "Collegamento asset al server fallito" + +msgid "Failed to disconnect asset from server" +msgstr "Disconnessione asset dal server fallita" + +msgid "No permission" +msgstr "Nessun permesso" + +msgid "Invalid server ID" +msgstr "ID server non valido" + +msgid "Server not found" +msgstr "Server non trovato" + +msgid "Sorry. You cannot access this file directly." +msgstr "Spiacenti. Non puoi accedere direttamente a questo file." diff --git a/src/Config.php b/src/Config.php index 679b0da..bd9ecfd 100644 --- a/src/Config.php +++ b/src/Config.php @@ -268,7 +268,7 @@ class Config extends CommonDBTM 'checked' => $is_default, ]); echo ""; - echo "