Skip to content

Commit

Permalink
Added flashmessage
Browse files Browse the repository at this point in the history
  • Loading branch information
mxgross committed Sep 24, 2022
1 parent 2bbb715 commit b1e134b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Controller/EasyBackupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

}
Expand Down Expand Up @@ -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'];
Expand Down
4 changes: 4 additions & 0 deletions Resources/translations/flashmessages.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<source>backup.action.zip.error.extension</source>
<target>Die PHP Erweiterung 'zip' wurde nicht gefunden. Diese muss zwingend installiert sein.</target>
</trans-unit>
<trans-unit id="filesystem.mkdir.error.backupDir">
<source>filesystem.mkdir.backupDir</source>
<target>Das angegebene Backup Verzeichnis konnte nicht erstellt oder nicht geöffnet werden.</target>
</trans-unit>
</body>
</file>
</xliff>
4 changes: 4 additions & 0 deletions Resources/translations/flashmessages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<source>backup.action.zip.error.extension</source>
<target>Error while creating zip file. The PHP extension 'zip' could not be found. Make sure it is installed.</target>
</trans-unit>
<trans-unit id="filesystem.mkdir.error.backupDir">
<source>filesystem.mkdir.backupDir</source>
<target>Specified backup directory could not be created or accessed.</target>
</trans-unit>
</body>
</file>
</xliff>
4 changes: 4 additions & 0 deletions Resources/translations/flashmessages.hr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<source>backup.action.zip.error.extension</source>
<target>Greška pri izradi zip datoteke. PHP proširenje 'zip' nije pronađeno. Proširenje mora biti instalirano.</target>
</trans-unit>
<trans-unit id="filesystem.mkdir.error.backupDir">
<source>filesystem.mkdir.backupDir</source>
<target>Navedeni rezervni direktorij nije mogao biti kreiran ili mu se nije moglo pristupiti.</target>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit b1e134b

Please sign in to comment.