From b1e134be8f7ddbdebf458d8e1ad71ab1b677444b Mon Sep 17 00:00:00 2001 From: mgross Date: Sat, 24 Sep 2022 19:46:28 +0200 Subject: [PATCH] Added flashmessage --- Controller/EasyBackupController.php | 6 ++---- Resources/translations/flashmessages.de.xlf | 4 ++++ Resources/translations/flashmessages.en.xlf | 4 ++++ Resources/translations/flashmessages.hr.xlf | 4 ++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Controller/EasyBackupController.php b/Controller/EasyBackupController.php index fb4c590..b49a646 100755 --- a/Controller/EasyBackupController.php +++ b/Controller/EasyBackupController.php @@ -86,9 +86,7 @@ private function log($logLevel, $message) $this->filesystem->appendToFile($logFile, "[$dateTime] $logLevel: $message".PHP_EOL); } catch (\Exception $e) { - // Todo: log in generall log - // Todo: translate error message - $this->flashError("Failed to touch $logFile"); + $this->flashError('filesystem.mkdir.error.backupDir'); } } @@ -634,7 +632,7 @@ private function checkStatus() // Todo: build path via config files instead of manually $dotGitPath = $this->kimaiRootPath . 'var' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'EasyBackupBundle' . DIRECTORY_SEPARATOR .'.git'; - if (!file_exists($dotGitPath)) { + if (file_exists($dotGitPath)) { $cmd = self::CMD_GIT_HEAD; $cmdResArr = $this->execute($cmd); $cmdRes = !empty($cmdResArr['err']) ? $cmdResArr['err'] : $cmdResArr['out']; diff --git a/Resources/translations/flashmessages.de.xlf b/Resources/translations/flashmessages.de.xlf index 4ac0b1a..f22913d 100755 --- a/Resources/translations/flashmessages.de.xlf +++ b/Resources/translations/flashmessages.de.xlf @@ -30,6 +30,10 @@ backup.action.zip.error.extension Die PHP Erweiterung 'zip' wurde nicht gefunden. Diese muss zwingend installiert sein. + + filesystem.mkdir.backupDir + Das angegebene Backup Verzeichnis konnte nicht erstellt oder nicht geöffnet werden. + diff --git a/Resources/translations/flashmessages.en.xlf b/Resources/translations/flashmessages.en.xlf index e9d5673..84205fd 100755 --- a/Resources/translations/flashmessages.en.xlf +++ b/Resources/translations/flashmessages.en.xlf @@ -30,6 +30,10 @@ backup.action.zip.error.extension Error while creating zip file. The PHP extension 'zip' could not be found. Make sure it is installed. + + filesystem.mkdir.backupDir + Specified backup directory could not be created or accessed. + diff --git a/Resources/translations/flashmessages.hr.xlf b/Resources/translations/flashmessages.hr.xlf index e8642ce..74aedc4 100644 --- a/Resources/translations/flashmessages.hr.xlf +++ b/Resources/translations/flashmessages.hr.xlf @@ -30,6 +30,10 @@ backup.action.zip.error.extension Greška pri izradi zip datoteke. PHP proširenje 'zip' nije pronađeno. Proširenje mora biti instalirano. + + filesystem.mkdir.backupDir + Navedeni rezervni direktorij nije mogao biti kreiran ili mu se nije moglo pristupiti. +