Skip to content

Commit

Permalink
Merge pull request #176 from dbarzin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dbarzin authored Oct 12, 2024
2 parents ed448ab + 71e0ef6 commit b3ca942
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 20 deletions.
12 changes: 8 additions & 4 deletions app/Http/Controllers/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/de/cruds.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
'model' => [
'control' => 'Vorlage Kontrollblatt',
'report' => 'Vorlage Lenkungsbericht',
'custom' => 'Maßgeschneidertes Modell'
],
'count' => 'Anzahl an Dokumenten',
'total_size' => 'Gesamtgröße',
Expand Down Expand Up @@ -186,7 +187,7 @@
'add' => 'Neuer Benutzer',
'show' => 'Zeige Benutzer',
'fields' => [
'login' => 'Login',
'login' => 'UserId',
'name' => 'Name',
'title' => 'Titel',
'role' => 'Rolle',
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/en/cruds.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
'model' => [
'control' => 'Control sheet template',
'report' => 'Steering report template',
'custom' => 'Custom model',
],
'count' => 'Number of documents',
'total_size' => 'Total Size',
Expand Down Expand Up @@ -186,7 +187,7 @@
'add' => 'Add User',
'show' => 'Show user',
'fields' => [
'login' => 'Login',
'login' => 'UserId',
'name' => 'Name',
'title' => 'Title',
'role' => 'Role',
Expand Down
4 changes: 2 additions & 2 deletions resources/lang/fr/cruds.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -186,7 +186,7 @@
'edit' => 'Modifier un utilisateur',
'add' => 'Ajouter un utilisateur',
'fields' => [
'login' => 'Login',
'login' => 'UserId',
'name' => 'Nom',
'title' => 'Titre',
'role' => 'Role',
Expand Down
17 changes: 16 additions & 1 deletion resources/views/about.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="cell-4 text-center">
<img src="/images/deming.png" width=400>
</div>
<div class="cell">
<div class="cell-7">
@if(Auth::User()->language==="fr")
<h1>À propos de Deming</h1>

Expand All @@ -24,6 +24,21 @@
<h2>Open Source</h2>

<p>Distribué sous licence <a href="https://www.gnu.org/licenses/licenses.html">GPL</a>, 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 <a href="https://dbarzin.github.io/deming/index.fr/">documentation utilisateur</a> et le <a href="https://github.com/dbarzin">GitHub</a> du projet.</p>
@elseif(Auth::User()->language==="de")
<h1>Über Deming</h1>

<p><strong>Deming</strong> 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.</p>

<h2>Wichtige Funktionen</h2>
<ul>
<li>Überwachung der Informationssicherheitsleistung.</li>
<li>Planung und Verwaltung von Sicherheitskontrollen.</li>
<li>Erstellung detaillierter Berichte für fundierte Entscheidungen.</li>
</ul>

<h2>Open Source</h2>

<p>Unter der <a href="https://www.gnu.org/licenses/licenses.html">GPL-Lizenz</a> 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 <a href="https://dbarzin.github.io/deming/index.fr/">Benutzerdokumentation</a> und auf dem <a href="https://github.com/dbarzin">GitHub-Projekt</a>.</p>
@else
<h1>About Deming</h1>

Expand Down
12 changes: 9 additions & 3 deletions resources/views/documents/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ function bytesToHuman($bytes) {
<div class="row">
<div class="cell-4">
<a href="/doc/template?id=1" target="_new">{{ trans('cruds.document.model.control') }}</a>
@if (file_exists(storage_path('app/models/control_.docx')))
/ <a href="/doc/template?id=3" target="_new">{{ trans('cruds.document.model.custom') }}</a>
@endif
<input type="file" data-role="file" name="template1">
</div>
</div>
<div class="row">
<div class="cell-4">
<a href="/doc/template?id=2" target="_new">{{ trans('cruds.document.model.report') }}</a>
<a href="/doc/template?id=3" target="_new">{{ trans('cruds.document.model.report') }}</a>
@if (file_exists(storage_path('app/models/pilotage_.docx')))
/ <a href="/doc/template?id=4" target="_new">{{ trans('cruds.document.model.custom') }}</a>
@endif
<input type="file" data-role="file" name="template2">
</div>
</div>
Expand Down Expand Up @@ -64,7 +70,7 @@ function bytesToHuman($bytes) {
</div>
<div class="row">
<div class="cell-3">
{{ trans('cruds.document.total_size') }} : {{ bytesToHuman($sum) }}
{{ trans('cruds.document.total_size') }} : {{ bytesToHuman($sum) }}
</div>
</div>
<div class="row">
Expand All @@ -76,4 +82,4 @@ function bytesToHuman($bytes) {
</div>
</div>
</div>
@endsection
@endsection
2 changes: 1 addition & 1 deletion resources/views/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
</ul>
<div class="w-100 text-center text-small data-box p-2 border-top bd-grayMouse" style="position: absolute; bottom: 0">
<div>Github <a href="https://github.com/dbarzin/deming" class="no-decor">dbarzin/deming</a></div>
<div>Version 2024-10-R2</div>
<div>Version 2024-10-R3</div>
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions resources/views/users/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
</div>
<div class="cell-3">
<select name='language' value='language'>
<option {{ old('language')=='de' ? 'selected' : ''}} >de</option>
<option {{ old('language')=='en' ? 'selected' : ''}} >en</option>
<option {{ old('language')=='fr' ? 'selected' : ''}} >fr</option>
<option {{ old('language',Auth::user()->language)=='de' ? 'selected' : ''}} >de</option>
<option {{ old('language',Auth::user()->language)=='en' ? 'selected' : ''}} >en</option>
<option {{ old('language',Auth::user()->language)=='fr' ? 'selected' : ''}} >fr</option>
</select>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions resources/views/users/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
</div>
<div class="cell-3">
<select name='language' value='language'>
<option {{ (count($errors)>0 ? old('language') : $user->language) =='de' ? 'selected' : ''}} >de</option>
<option {{ (count($errors)>0 ? old('language') : $user->language) =='en' ? 'selected' : ''}} >en</option>
<option {{ (count($errors)>0 ? old('language') : $user->language) =='fr' ? 'selected' : ''}} >fr</option>
<option {{ (old('language',$user->language) =='de') ? 'selected' : ''}} >de</option>
<option {{ (old('language',$user->language) =='en') ? 'selected' : ''}} >en</option>
<option {{ (old('language',$user->language) =='fr') ? 'selected' : ''}} >fr</option>
</select>
</div>
</div>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b3ca942

Please sign in to comment.