Skip to content

Commit

Permalink
Merge pull request #135 from dbarzin/dev
Browse files Browse the repository at this point in the history
fix report
  • Loading branch information
dbarzin authored Sep 2, 2024
2 parents bbe8a96 + 375a322 commit 429d8d9
Show file tree
Hide file tree
Showing 5 changed files with 2,264 additions and 1,401 deletions.
7 changes: 4 additions & 3 deletions app/Http/Controllers/DomainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ public function destroy(Domain $domain)
abort_if(Auth::User()->role !== 1, Response::HTTP_FORBIDDEN, '403 Forbidden');

// Has measures ?
abort_if(DB::table('measures')
->where('domain_id', $domain->id)
->exists(),
abort_if(
DB::table('measures')
->where('domain_id', $domain->id)
->exists(),
Response::HTTP_FORBIDDEN,
'403 Forbidden'
);
Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ public function pilotage(Request $request)
$templateProcessor->setValue('start_date', $start_date->format('d/m/Y'));
$templateProcessor->setValue('end_date', $end_date->format('d/m/Y'));

/* xxxxxx */
$this->generateMadeControlTable($templateProcessor, $framework, $start_date, $end_date);
/*
$values = $this->generateControlTable($templateProcessor, $framework);
$this->generateKPITable($templateProcessor, $framework, $values);
$this->generateActionPlanTable($templateProcessor, $framework);

*/
//----------------------------------------------------------------
// save a copy
$filepath = storage_path('templates/pilotage-'. Carbon::today()->format('Y-m-d') .'.docx');
Expand Down Expand Up @@ -238,7 +240,7 @@ private function generateMadeControlTable(
foreach ($controls as $control) {
$table->addRow();
$table->addCell(2500)->addText($control->measures->implode('clause', ', '));
$table->addCell(12500)->addText($control->name);
$table->addCell(12500)->addText(str_replace('&', 'x', $control->name));
$table->addCell(2800)->addText($control->realisation_date, null, ['align' => 'center']);
$table->addCell(12500)->addText($control->scope);
$table->addCell(2000)->addText(
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class TrustProxies extends Middleware
*/

protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"maatwebsite/excel": "^3.1",
"phpoffice/phpword": "^1.1.0"
"phpoffice/phpword": "^1.3"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
Expand All @@ -30,17 +30,17 @@
"autoload": {
"classmap": [
"database"
],
],
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
}
},
"autoload-dev": {
"classmap": [
"database"
],
],
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
Expand Down
Loading

0 comments on commit 429d8d9

Please sign in to comment.