From 6645d7b91799fc4c11ea8d20e573fa9c62716f4a Mon Sep 17 00:00:00 2001 From: Yinci Date: Wed, 13 Dec 2023 15:55:44 +0100 Subject: [PATCH] Add last updated at --- app/Services/DumpService.php | 10 +- resources/lang/nl/woningdossier.php | 1 + .../admin/cooperation/reports/index.blade.php | 91 +++++++++---------- 3 files changed, 54 insertions(+), 48 deletions(-) diff --git a/app/Services/DumpService.php b/app/Services/DumpService.php index 752f1fd0ff..866d076de4 100644 --- a/app/Services/DumpService.php +++ b/app/Services/DumpService.php @@ -131,6 +131,7 @@ public function createHeaderStructure(string $short): self if ($this->anonymize) { $headers = [ __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.created-at'), + __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.updated-at'), __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.status'), __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.zip-code'), @@ -139,6 +140,7 @@ public function createHeaderStructure(string $short): self } else { $headers = [ __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.created-at'), + __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.updated-at'), __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.coach-appointment-date'), __('woningdossier.cooperation.admin.cooperation.reports.csv-columns.status'), @@ -189,6 +191,10 @@ public function generateDump(bool $withConditionalLogic = true): array $inputSource = $this->inputSource; $createdAt = optional($user->created_at)->format('Y-m-d'); + $updatedAt = $this->user->userActionPlanAdvices() + ->forInputSource($inputSource) + ->orderByDesc('updated_at') + ->value('updated_at'); $mostRecentStatus = $building->getMostRecentBuildingStatus(); if (! $mostRecentStatus instanceof BuildingStatus) { @@ -205,7 +211,7 @@ public function generateDump(bool $withConditionalLogic = true): array if ($this->anonymize) { $data = [ - $createdAt, $buildingStatus, $postalCode, $city, + $createdAt, $updatedAt, $buildingStatus, $postalCode, $city, ]; } else { $allowAccess = $user->allowedAccess() ? 'Ja' : 'Nee'; @@ -228,7 +234,7 @@ public function generateDump(bool $withConditionalLogic = true): array $appointmentDate = optional($mostRecentStatus->appointment_date)->format('Y-m-d'); $data = [ - $createdAt, $appointmentDate, $buildingStatus, $allowAccess, $connectedCoachNames, + $createdAt, $updatedAt, $appointmentDate, $buildingStatus, $allowAccess, $connectedCoachNames, $firstName, $lastName, $email, $phoneNumber, $street, trim($number . ' ' . $extension), $postalCode, $city, ]; diff --git a/resources/lang/nl/woningdossier.php b/resources/lang/nl/woningdossier.php index ece3416e0b..14db417227 100644 --- a/resources/lang/nl/woningdossier.php +++ b/resources/lang/nl/woningdossier.php @@ -429,6 +429,7 @@ 'csv-columns' => [ 'input-source' => 'Rol', 'created-at' => 'Datum account', + 'updated-at' => 'Laatste wijziging', 'coach-appointment-date' => 'Datum afspraak coachgesprek', 'status' => 'Status', 'allow-access' => 'Toestemming aanwezig', diff --git a/resources/views/cooperation/admin/cooperation/reports/index.blade.php b/resources/views/cooperation/admin/cooperation/reports/index.blade.php index 7c4de1c95e..0c55318a0d 100644 --- a/resources/views/cooperation/admin/cooperation/reports/index.blade.php +++ b/resources/views/cooperation/admin/cooperation/reports/index.blade.php @@ -31,56 +31,55 @@ - - - - + + + + - @foreach($reportFileTypeCategory->fileTypes as $fileType) - @if(in_array($fileType->short, ['custom-questionnaire-report-anonymized', 'custom-questionnaire-report'])) - @include('cooperation.admin.cooperation.reports.parts.file-type-questionnaire-table-row') - @else - - + @foreach($reportFileTypeCategory->fileTypes as $fileType) + @if(in_array($fileType->short, ['custom-questionnaire-report-anonymized', 'custom-questionnaire-report'])) + @include('cooperation.admin.cooperation.reports.parts.file-type-questionnaire-table-row') + @else + + - - - @endif - @endforeach + + + + + @endif + @endforeach
{{\App\Helpers\Translation::translate('woningdossier.cooperation.admin.cooperation.reports.index.table.columns.name')}}{{\App\Helpers\Translation::translate('woningdossier.cooperation.admin.cooperation.reports.index.table.columns.download')}}
{{\App\Helpers\Translation::translate('woningdossier.cooperation.admin.cooperation.reports.index.table.columns.name')}}{{\App\Helpers\Translation::translate('woningdossier.cooperation.admin.cooperation.reports.index.table.columns.download')}}
- {{$fileType->name}} - -
+ {{$fileType->name}} + + -
- @csrf -
+ + @csrf + - -