From 15c9f8fa8df999b152cd32f113715cbb6c835c63 Mon Sep 17 00:00:00 2001 From: didier Date: Sat, 12 Oct 2024 09:44:01 +0200 Subject: [PATCH 1/6] fix login confusion --- resources/lang/de/cruds.php | 2 +- resources/lang/en/cruds.php | 2 +- resources/lang/fr/cruds.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lang/de/cruds.php b/resources/lang/de/cruds.php index 5b4d3137..17000185 100644 --- a/resources/lang/de/cruds.php +++ b/resources/lang/de/cruds.php @@ -186,7 +186,7 @@ 'add' => 'Neuer Benutzer', 'show' => 'Zeige Benutzer', 'fields' => [ - 'login' => 'Login', + 'login' => 'UserId', 'name' => 'Name', 'title' => 'Titel', 'role' => 'Rolle', diff --git a/resources/lang/en/cruds.php b/resources/lang/en/cruds.php index ec75291e..c79829f6 100644 --- a/resources/lang/en/cruds.php +++ b/resources/lang/en/cruds.php @@ -186,7 +186,7 @@ 'add' => 'Add User', 'show' => 'Show user', 'fields' => [ - 'login' => 'Login', + 'login' => 'UserId', 'name' => 'Name', 'title' => 'Title', 'role' => 'Role', diff --git a/resources/lang/fr/cruds.php b/resources/lang/fr/cruds.php index 3a40fbf2..3820e671 100644 --- a/resources/lang/fr/cruds.php +++ b/resources/lang/fr/cruds.php @@ -186,7 +186,7 @@ 'edit' => 'Modifier un utilisateur', 'add' => 'Ajouter un utilisateur', 'fields' => [ - 'login' => 'Login', + 'login' => 'UserId', 'name' => 'Nom', 'title' => 'Titre', 'role' => 'Role', From 02845cf5eecc72fb90a349761527fe36d704d353 Mon Sep 17 00:00:00 2001 From: didier Date: Sat, 12 Oct 2024 09:48:07 +0200 Subject: [PATCH 2/6] set default user language --- resources/views/users/create.blade.php | 6 +++--- resources/views/users/edit.blade.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/users/create.blade.php b/resources/views/users/create.blade.php index 03bd5e95..6cb077d1 100644 --- a/resources/views/users/create.blade.php +++ b/resources/views/users/create.blade.php @@ -49,9 +49,9 @@
diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 3ad9be5b..50809bdd 100644 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -57,7 +57,7 @@ From 5c3d03f7780093cd184c3cf9b4e51b37b3aa71d4 Mon Sep 17 00:00:00 2001 From: didier Date: Sat, 12 Oct 2024 09:53:38 +0200 Subject: [PATCH 3/6] fix old language --- resources/views/users/edit.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 50809bdd..59059e9a 100644 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -55,9 +55,9 @@
From 2cd69711c974d77c68115c533eca988a900fe1e8 Mon Sep 17 00:00:00 2001 From: didier Date: Sat, 12 Oct 2024 11:08:28 +0200 Subject: [PATCH 4/6] i18n documents templates --- app/Http/Controllers/DocumentController.php | 12 ++++++++---- resources/views/documents/index.blade.php | 12 +++++++++--- .../app/models/{control.docx => control_fr.docx} | Bin .../app/models/{pilotage.docx => pilotage_fr.docx} | Bin 4 files changed, 17 insertions(+), 7 deletions(-) rename storage/app/models/{control.docx => control_fr.docx} (100%) rename storage/app/models/{pilotage.docx => pilotage_fr.docx} (100%) diff --git a/app/Http/Controllers/DocumentController.php b/app/Http/Controllers/DocumentController.php index af9c262a..8f8d2af0 100644 --- a/app/Http/Controllers/DocumentController.php +++ b/app/Http/Controllers/DocumentController.php @@ -16,22 +16,26 @@ public function getTemplate(Request $request) $id = (int) $request->get('id'); if ($id === 1) { + // return default model + return response()->download(storage_path('app/models/control_'. Auth::user()->language .'.docx')); + } + if ($id === 2) { // check exists new model if (file_exists(storage_path('app/models/control_.docx'))) { // return new model return response()->download(storage_path('app/models/control_.docx')); } + } + if ($id === 3) { // return default model - return response()->download(storage_path('app/models/control.docx')); + return response()->download(storage_path('app/models/pilotage_'. Auth::user()->language .'.docx')); } - if ($id === 2) { + if ($id === 4) { // check exists new model if (file_exists(storage_path('app/models/pilotage_.docx'))) { // return new model return response()->download(storage_path('app/models/pilotage_.docx')); } - // return default model - return response()->download(storage_path('app/models/pilotage.docx')); } return null; } diff --git a/resources/views/documents/index.blade.php b/resources/views/documents/index.blade.php index 5d38e0d9..399b5e01 100644 --- a/resources/views/documents/index.blade.php +++ b/resources/views/documents/index.blade.php @@ -19,12 +19,18 @@ function bytesToHuman($bytes) {
{{ trans('cruds.document.model.control') }} + @if (file_exists(storage_path('app/models/control_.docx'))) + / current model + @endif
- {{ trans('cruds.document.model.report') }} + {{ trans('cruds.document.model.report') }} + @if (file_exists(storage_path('app/models/pilotage_.docx'))) + / current model + @endif
@@ -64,7 +70,7 @@ function bytesToHuman($bytes) {
- {{ trans('cruds.document.total_size') }} : {{ bytesToHuman($sum) }} + {{ trans('cruds.document.total_size') }} : {{ bytesToHuman($sum) }}
@@ -76,4 +82,4 @@ function bytesToHuman($bytes) {
-@endsection \ No newline at end of file +@endsection diff --git a/storage/app/models/control.docx b/storage/app/models/control_fr.docx similarity index 100% rename from storage/app/models/control.docx rename to storage/app/models/control_fr.docx diff --git a/storage/app/models/pilotage.docx b/storage/app/models/pilotage_fr.docx similarity index 100% rename from storage/app/models/pilotage.docx rename to storage/app/models/pilotage_fr.docx From d83ae099597e7475847ee9a1894a3180f9349229 Mon Sep 17 00:00:00 2001 From: didier Date: Sat, 12 Oct 2024 11:22:31 +0200 Subject: [PATCH 5/6] i18n models --- app/Http/Controllers/ReportController.php | 3 ++- resources/lang/de/cruds.php | 1 + resources/lang/en/cruds.php | 1 + resources/lang/fr/cruds.php | 2 +- resources/views/about.blade.php | 15 +++++++++++++++ resources/views/documents/index.blade.php | 4 ++-- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 00baee1a..ee8d64ac 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -5,6 +5,7 @@ use App\Models\Control; use Carbon\Carbon; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use PhpOffice\PhpWord\Element\Chart; use PhpOffice\PhpWord\Element\Table; @@ -74,7 +75,7 @@ public function pilotage(Request $request) // Get template file $template_filename = storage_path('app/models/pilotage_.docx'); if (! file_exists($template_filename)) { - $template_filename = storage_path('app/models/pilotage.docx'); + $template_filename = storage_path('app/models/pilotage_' . Auth::user()->language . '.docx'); } // create templateProcessor diff --git a/resources/lang/de/cruds.php b/resources/lang/de/cruds.php index 17000185..20311192 100644 --- a/resources/lang/de/cruds.php +++ b/resources/lang/de/cruds.php @@ -144,6 +144,7 @@ 'model' => [ 'control' => 'Vorlage Kontrollblatt', 'report' => 'Vorlage Lenkungsbericht', + 'custom' => 'Maßgeschneidertes Modell' ], 'count' => 'Anzahl an Dokumenten', 'total_size' => 'Gesamtgröße', diff --git a/resources/lang/en/cruds.php b/resources/lang/en/cruds.php index c79829f6..b532b7a3 100644 --- a/resources/lang/en/cruds.php +++ b/resources/lang/en/cruds.php @@ -144,6 +144,7 @@ 'model' => [ 'control' => 'Control sheet template', 'report' => 'Steering report template', + 'custom' => 'Custom model', ], 'count' => 'Number of documents', 'total_size' => 'Total Size', diff --git a/resources/lang/fr/cruds.php b/resources/lang/fr/cruds.php index 3820e671..062e42ef 100644 --- a/resources/lang/fr/cruds.php +++ b/resources/lang/fr/cruds.php @@ -144,7 +144,7 @@ 'model' => [ 'control' => 'Modèle de fiche de contrôle', 'report' => 'Modèle du rapport de pilotage', - + 'custom' => 'Modèle sur mesure', ], 'count' => 'Nombre de documents', 'total_size' => 'Taille totale', diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php index 964f7155..bd2173d7 100644 --- a/resources/views/about.blade.php +++ b/resources/views/about.blade.php @@ -24,6 +24,21 @@

Open Source

Distribué sous licence GPL, Deming s'adapte aux besoins des entreprises en quête d'amélioration continue de leur sécurité de l'information. Pour en savoir plus sur l’utilisation et les fonctionnalités, consultez la documentation utilisateur et le GitHub du projet.

+@if(Auth::User()->language==="de") +

Über Deming

+ +

Deming ist ein Open-Source-Projekt, das entwickelt wurde, um die Verwaltung der Informationssicherheit zu erleichtern. Es bietet Organisationen die notwendigen Werkzeuge, um ihre Sicherheitskontrollen effektiv zu überwachen und zu messen, während sie ihr Informationssicherheits-Managementsystem (ISMS) optimieren.

+ +

Wichtige Funktionen

+
    +
  • Überwachung der Informationssicherheitsleistung.
  • +
  • Planung und Verwaltung von Sicherheitskontrollen.
  • +
  • Erstellung detaillierter Berichte für fundierte Entscheidungen.
  • +
+ +

Open Source

+ +

Unter der GPL-Lizenz vertrieben, passt sich Deming den Bedürfnissen von Unternehmen an, die eine kontinuierliche Verbesserung ihrer Informationssicherheit anstreben. Weitere Informationen zur Nutzung und den Funktionen finden Sie in der Benutzerdokumentation und auf dem GitHub-Projekt.

@else

About Deming

diff --git a/resources/views/documents/index.blade.php b/resources/views/documents/index.blade.php index 399b5e01..018c5697 100644 --- a/resources/views/documents/index.blade.php +++ b/resources/views/documents/index.blade.php @@ -20,7 +20,7 @@ function bytesToHuman($bytes) {
{{ trans('cruds.document.model.control') }} @if (file_exists(storage_path('app/models/control_.docx'))) - / current model + / {{ trans('cruds.document.model.custom') }} @endif
@@ -29,7 +29,7 @@ function bytesToHuman($bytes) {
{{ trans('cruds.document.model.report') }} @if (file_exists(storage_path('app/models/pilotage_.docx'))) - / current model + / {{ trans('cruds.document.model.custom') }} @endif
From 71e0ef665cc0e0d357039d346353a8d0956a7965 Mon Sep 17 00:00:00 2001 From: didier Date: Sat, 12 Oct 2024 11:25:09 +0200 Subject: [PATCH 6/6] fix about --- resources/views/about.blade.php | 4 ++-- resources/views/layout.blade.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php index bd2173d7..cdd959d7 100644 --- a/resources/views/about.blade.php +++ b/resources/views/about.blade.php @@ -8,7 +8,7 @@
-
+
@if(Auth::User()->language==="fr")

À propos de Deming

@@ -24,7 +24,7 @@

Open Source

Distribué sous licence GPL, Deming s'adapte aux besoins des entreprises en quête d'amélioration continue de leur sécurité de l'information. Pour en savoir plus sur l’utilisation et les fonctionnalités, consultez la documentation utilisateur et le GitHub du projet.

-@if(Auth::User()->language==="de") +@elseif(Auth::User()->language==="de")

Über Deming

Deming ist ein Open-Source-Projekt, das entwickelt wurde, um die Verwaltung der Informationssicherheit zu erleichtern. Es bietet Organisationen die notwendigen Werkzeuge, um ihre Sicherheitskontrollen effektiv zu überwachen und zu messen, während sie ihr Informationssicherheits-Managementsystem (ISMS) optimieren.

diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php index e8696bd1..b623e9fd 100644 --- a/resources/views/layout.blade.php +++ b/resources/views/layout.blade.php @@ -160,7 +160,7 @@
-
Version 2024-10-R2
+
Version 2024-10-R3