diff --git a/.devTools/routes.txt b/.devTools/routes.txt new file mode 100644 index 0000000000000000000000000000000000000000..1644dd9b2666ee38def62ebccdc2bfc23ba22b32 --- /dev/null +++ b/.devTools/routes.txt @@ -0,0 +1,57 @@ + + GET|HEAD / ................................................................................................................................................................................................................................................................................................... home + POST _ignition/execute-solution ................................................................................................................................................................................................. ignition.executeSolution › Spatie\LaravelIgnition › ExecuteSolutionController + GET|HEAD _ignition/health-check ............................................................................................................................................................................................................. ignition.healthCheck › Spatie\LaravelIgnition › HealthCheckController + POST _ignition/update-config .......................................................................................................................................................................................................... ignition.updateConfig › Spatie\LaravelIgnition › UpdateConfigController + GET|HEAD api/dangers .................................................................................................................................................................................................................................................. api.dangers.all › Api\DangersController@all + GET|HEAD api/evaluations ...................................................................................................................................................................................................................................... api.evaluations.all › Api\EvaluationsController@all + POST api/evaluations .................................................................................................................................................................................................................................... api.evaluations.post › Api\EvaluationsController@save + PUT api/evaluations/{id} ................................................................................................................................................................................................................................ api.evaluations.put › Api\EvaluationsController@save + GET|HEAD api/evaluations/{id} ................................................................................................................................................................................................................................. api.evaluations.get › Api\EvaluationsController@get + DELETE api/evaluations/{id} ........................................................................................................................................................................................................................... api.evaluations.delete › Api\EvaluationsController@delete + GET|HEAD api/evaluations/{id}/graphs/attack ......................................................................................................................................................................................................... api.evaluations.graph.attack › Api\GraphDataController@attack + GET|HEAD api/evaluations/{id}/graphs/best_measures ..................................................................................................................................................................................... api.evaluations.graph.best_measures › Api\GraphDataController@bestMeasures + GET|HEAD api/evaluations/{id}/graphs/exposition ............................................................................................................................................................................................. api.evaluations.graph.exposition › Api\GraphDataController@exposition + GET|HEAD api/evaluations/{id}/graphs/futurerisks .......................................................................................................................................................................................... api.evaluations.graph.futurerisks › Api\GraphDataController@futurerisks + GET|HEAD api/evaluations/{id}/graphs/maturity ................................................................................................................................................................................................... api.evaluations.graph.maturity › Api\GraphDataController@maturity + GET|HEAD api/evaluations/{id}/graphs/measures ................................................................................................................................................................................................... api.evaluations.graph.measures › Api\GraphDataController@measures + GET|HEAD api/evaluations/{id}/graphs/risks ............................................................................................................................................................................................................ api.evaluations.graph.risks › Api\GraphDataController@risks + POST api/forgetpwd .............................................................................................................................................................................................................................................. api.forgetpwd › Api\UsersController@forgetpwd + GET|HEAD api/graphs/actionterritory ............................................................................................................................................................................................... api.evaluations.graph.actionterritory › Api\GraphDataController@actionterritory + GET|HEAD api/graphs/organizations/{territory_id?} ..................................................................................................................................................................................... api.evaluations.graph.organizations › Api\GraphDataController@organizations + POST api/impersonate ....................................................................................................................................................................................................................................... api.impersonate › Auth\LoginController@impersonate + POST api/leave ............................................................................................................................................................................................................................... api.leaveImpersonation › Auth\LoginController@leaveImpersonation + GET|HEAD api/measures ............................................................................................................................................................................................................................................... api.measures.all › Api\MeasuresController@all + GET|HEAD api/measures/download ...................................................................................................................................................................................................................... api.measures.downloadAll › Api\MeasuresController@downloadAll + GET|HEAD api/measures/download/{id} ....................................................................................................................................................................................................................... api.measures.download › Api\MeasuresController@download + PUT api/measures/{id} ......................................................................................................................................................................................................................................... api.measures.put › Api\MeasuresController@save + GET|HEAD api/organizations ................................................................................................................................................................................................................................ api.organizations.all › Api\OrganizationsController@all + POST api/organizations .............................................................................................................................................................................................................................. api.organizations.post › Api\OrganizationsController@save + PUT api/organizations/{id} .......................................................................................................................................................................................................................... api.organizations.put › Api\OrganizationsController@save + DELETE api/organizations/{id} ..................................................................................................................................................................................................................... api.organizations.delete › Api\OrganizationsController@delete + GET|HEAD api/questions .............................................................................................................................................................................................................................................. api.maturity.all › Api\MaturityController@all + GET|HEAD api/scenarios ............................................................................................................................................................................................................................................ api.scenarios.all › Api\ScenariosController@all + GET|HEAD api/territories ...................................................................................................................................................................................................................................... api.territories.all › Api\TerritoriesController@all + POST api/territories .................................................................................................................................................................................................................................... api.territories.post › Api\TerritoriesController@save + PUT api/territories/{id} ................................................................................................................................................................................................................................ api.territories.put › Api\TerritoriesController@save + DELETE api/territories/{id} ........................................................................................................................................................................................................................... api.territories.delete › Api\TerritoriesController@delete + GET|HEAD api/users ........................................................................................................................................................................................................................................................ api.users.all › Api\UsersController@all + POST api/users ...................................................................................................................................................................................................................................................... api.users.post › Api\UsersController@save + GET|HEAD api/users/me ....................................................................................................................................................................................................................................................... api.users.me › Api\UsersController@me + PUT api/users/{id} .................................................................................................................................................................................................................................................. api.users.put › Api\UsersController@save + DELETE api/users/{id} ............................................................................................................................................................................................................................................. api.users.delete › Api\UsersController@delete + GET|HEAD export/evaluations.{ext} ............................................................................................................................................................................................................................... export.evaluations › ExportController@evaluations + GET|HEAD export/structures.{ext} ............................................................................................................................................................................................................................ export.organizations › ExportController@organizations + POST login ................................................................................................................................................................................................................................................................. login › Auth\LoginController@login + GET|HEAD login .................................................................................................................................................................................................................................................................................................... + GET|HEAD logout ............................................................................................................................................................................................................................................................. logout › Auth\LogoutController@logout + POST newpassword .......................................................................................................................................................................................................................................... password_reset.send › UsersController@storePassword + GET|HEAD newpassword/{id}/{reset_token} ........................................................................................................................................................................................................................... password_reset › UsersController@createPassword + GET|HEAD pdf/dossierCyberSecurite/{organization_id}/{evaluation_id?} ........................................................................................................................................................................... pdf.dossier_cyber_securite › PdfController@DossierCyberSecuritePdf + GET|HEAD pdf/planAction/{organization_id} ........................................................................................................................................................................................................................... pdf.plan_action › PdfController@ActionPlanPdf + GET|HEAD pdf/politiqueSecurite/{organization_id} ...................................................................................................................................................................................................... pdf.politique_securite › PdfController@PolitiqueSecuritePdf + GET|HEAD sanctum/csrf-cookie .......................................................................................................................................................................................................................................... Laravel\Sanctum › CsrfCookieController@show + GET|HEAD {any} .................................................................................................................................................................................................................................................................................................... + + Showing [53] routes + diff --git a/.devTools/scripts/dump-routes.sh b/.devTools/scripts/dump-routes.sh new file mode 100644 index 0000000000000000000000000000000000000000..a8f48678363b5eac6f8439c8c72e5ecd6d826eba --- /dev/null +++ b/.devTools/scripts/dump-routes.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cd ../.. +./artisan route:list --no-ansi > ./.devTools/routes.txt diff --git a/.devTools/scripts/ide-helper.sh b/.devTools/scripts/ide-helper.sh new file mode 100644 index 0000000000000000000000000000000000000000..3d1a10a7fe488942719ef68bc3b815d681ee3a9d --- /dev/null +++ b/.devTools/scripts/ide-helper.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cd ../.. +./vendor/bin/sail artisan ide-helper:generate +./vendor/bin/sail artisan ide-helper:meta +./vendor/bin/sail artisan ide-helper:models -W +./vendor/bin/php-cs-fixer fix ./app/Models diff --git a/.env.docker b/.env.docker new file mode 100644 index 0000000000000000000000000000000000000000..5a15b154e0e08b3111cc55915053303885681029 --- /dev/null +++ b/.env.docker @@ -0,0 +1,64 @@ +APP_NAME="Madis Cyber" +APP_ENV=local +APP_KEY=base64:wJlBLhzTz0XSp8HoFwb/4z4QsG7Ad8H++FjURNhSxtU= +APP_DEBUG=true +APP_URL=http://madis-cyber.test + +LOG_CHANNEL=stack +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=mysql +DB_HOST=mysql +DB_PORT=3306 +DB_DATABASE=laravel +DB_USERNAME=sail +DB_PASSWORD=password + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +FILESYSTEM_DISK=local +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +MEMCACHED_HOST=127.0.0.1 + +REDIS_HOST=redis +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_MAILER=smtp +MAIL_HOST=mailhog +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000,::1,madis.test,cyber.local,madis-cyber.test + +ADMIN_EMAIL=admin@datakode.fr +ADMIN_FIRSTNAME=Admin +ADMIN_LASTNAME=Datakode +ADMIN_PASSWORD=secret + +APP_FAVICON_PATH="logo_madis_2020_favicon_white.png" +REFERENTIEL_VERSION="1.3" +SEUIL_ALERTE=1 +LOGO_SIDEBAR="logo-soluris.png" +FOOTER_LINK=https://www.soluris.fr/ diff --git a/.env.test b/.env.test index 6115beb11437b56852e59bc8134dc3705df5a24f..7ede78b89c5dc60598658785bb667b5d07300839 100644 --- a/.env.test +++ b/.env.test @@ -54,5 +54,6 @@ MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000,::1 APP_FAVICON_PATH="logo_madis_2020_favicon_white.png" REFERENTIEL_VERSION="1.3" +SEUIL_ALERTE=1 LOGO_SIDEBAR="logo-soluris.png" FOOTER_LINK=https://www.soluris.fr/ diff --git a/.gitignore b/.gitignore index c0a35d4be0442d4f1705a0fd2a981bca1f60b0da..4a934b40cfa098c76af0ebc658b2622685d7354a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ public/images /Vagrantfile /after.sh /aliases +/.phpstorm.meta.php +/_ide_helper.php diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e21e789351ff3913676b37d6d4a4747593b2b46e..61df3214c35f43fdd61d133aad6a00b666d2a9b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,7 +58,7 @@ unit_tests: <<: *vendor-install-definition <<: *cache-pull-definition script: - - php -dxdebug.mode=coverage vendor/bin/phpunit --coverage-text --colors=never --coverage-html storage/artefacts/coverage/ + - php -dxdebug.mode=coverage vendor/bin/phpunit --colors=never coverage: /^\s+Lines:\s+(\d+)\.\d+%/ artifacts: paths: diff --git a/app/Enums/MaturityQuestionNames.php b/app/Enums/MaturityQuestionNames.php new file mode 100644 index 0000000000000000000000000000000000000000..92dade889266c18d8b64c5deedf384884c473bef --- /dev/null +++ b/app/Enums/MaturityQuestionNames.php @@ -0,0 +1,12 @@ +<?php + +namespace App\Enums; + +enum MaturityQuestionNames: string +{ + case KNOWLEDGE = 'Connaissance'; + case ORGANIZATION = 'Organisation'; + case MOTIVATION = 'Motivation'; + case EXECUTION = 'Exécution'; + case FUNDAMENTALS = 'Fondamentaux'; +} diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php new file mode 100644 index 0000000000000000000000000000000000000000..c914e8f2e82854036f91f359aa0e1ad8dbc34a4a --- /dev/null +++ b/app/Http/Controllers/ExportController.php @@ -0,0 +1,68 @@ +<?php + +namespace App\Http\Controllers; + +use App\Http\Resources\EvaluationExportResource; +use App\Http\Resources\OrganizationExportResource; +use App\Models\Evaluation; +use App\Models\Organization; +use Illuminate\Http\Request; +use Illuminate\Support\Collection; +use Spatie\SimpleExcel\SimpleExcelWriter; + +class ExportController extends Controller +{ + public function organizations(Request $request): Collection|null + { + $ext = $request->route('ext'); + $filename = "structures.$ext"; + $data = Organization::with(['address', 'referent', 'referentCyber', 'referentElu', 'territory', 'evaluations', 'evaluations.dangerLevels'])->get(); + $rows = OrganizationExportResource::collection($data)->toArray($request); + $header = $this->_getRowsHeader($rows[0], 'exports.organization'); + + if ('json' === $ext) { + // die('<pre>'.print_r($rows).'</pre>'); + return collect(compact('header', 'rows')); + } + + $rows = [$header, ...$rows]; + + SimpleExcelWriter::streamDownload($filename) + ->noHeaderRow() + ->addRows($rows) + ->toBrowser(); + + return null; + } + + public function evaluations(Request $request): Collection|null + { + $ext = $request->route('ext'); + $filename = "evaluations.$ext"; + $data = Evaluation::with(['dangerLevels'])->get(); + $rows = EvaluationExportResource::collection($data)->toArray($request); + $header = $this->_getRowsHeader($rows[0], 'exports.evaluation'); + + if ('json' === $ext) { + return collect(compact('header', 'rows')); + } + + $rows = [$header, ...$rows]; + + SimpleExcelWriter::streamDownload($filename) + ->noHeaderRow() + ->addRows($rows) + ->toBrowser(); + + return null; + } + + private function _getRowsHeader(array $cols, string $prefix): array + { + $keys = collect($cols)->keys(); + + return $keys->map(function ($item) use ($prefix) { + return trans($prefix . '.' . $item); + })->toArray(); + } +} diff --git a/app/Http/Resources/EvaluationExportResource.php b/app/Http/Resources/EvaluationExportResource.php new file mode 100644 index 0000000000000000000000000000000000000000..c5ef48afc621817104204695db1248125bfb7f19 --- /dev/null +++ b/app/Http/Resources/EvaluationExportResource.php @@ -0,0 +1,97 @@ +<?php + +namespace App\Http\Resources; + +use App\Enums\MaturityQuestionNames; +use App\Models\DangerLevelEvaluation; +use App\Models\Evaluation; +use App\Models\MaturityAnswer; +use App\Models\Measure; +use App\Models\MeasureLevel; +use Carbon\Carbon; +use Illuminate\Database\Eloquent\Collection as EloquentCollection; +use Illuminate\Http\Request; +use Illuminate\Http\Resources\Json\JsonResource; +use Illuminate\Support\Collection; + +class EvaluationExportResource extends JsonResource +{ + /** + * Transform the resource into an array. + * + * @param Request $request + */ + public function toArray($request): array + { + /** @var Evaluation $evaluation */ + $evaluation = $this->resource; + + $res = [ + 'organizationId' => $evaluation->organization_id, // -Collectivité id + 'updatedDate' => $evaluation->updated_at->isoFormat('DD/MM/YYYY'), // - Date de modification + 'updatedBy' => $evaluation->updated_by, // - Modifié par + 'reference' => $evaluation->reference, // - Référentiel + 'status' => Evaluation::STATUS[$evaluation->status], // - Statut de l’évaluation + + // *** +// 'statusDangers' => '!TODO', // - Statut Dangers @todo ??? quelle est la valeur attendue + // *** + ]; + + $dangerLevelEvaluations = $evaluation->dangerLevels ?? collect(); + + foreach ([1, 2, 3, 4, 5, 6] as $dangerId) { + /** @var ?DangerLevelEvaluation $dangerLevelEvaluation */ + $dangerLevelEvaluation = $dangerLevelEvaluations->where('danger_id', '=', $dangerId)->first(); + $res["dangerLevel_$dangerId"] = (string) $dangerLevelEvaluation?->level?->name; // - perception du danger X + } + + $mesures = Measure::orderBy('fundamental', 'ASC')->get(); + $mesureLevels = $evaluation->measureLevels ?? collect(); + foreach ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as $questionId) { + /** @var ?Measure $mesure */ + $mesure = $mesures->get($questionId - 1); + /** @var ?MeasureLevel $mesureLevel */ + $mesureLevel = $mesureLevels->where('measure_id', '=', $mesure->id)->first(); + + $actualLevel = $mesureLevel?->actual_level; + $res["q$questionId"] = $mesure->name; + if ($actualLevel) { + $res["q$questionId"] .= PHP_EOL . $mesure->getAttribute('level' . $actualLevel . '_actual_label'); + } + } + + $maturityLevelAnswers = $evaluation->maturityLevels()->with(['question', 'answer'])->get(); + + return [...$res, + 'actionPlan' => $this->_getActionPlanString($mesureLevels), // - Plan d’action + 'motivation' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::MOTIVATION)?->name, // - Motivation + 'execution' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::EXECUTION)?->name, // - Execution + 'fundamental' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::FUNDAMENTALS)?->name, // - Fondamentaux + 'organization' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::ORGANIZATION)?->name, // - Organisation + 'maturityCyber' => $evaluation->maturity_cyber, // - Indice de maturité + ]; + } + + private function _getAnswerForQuestionName(?EloquentCollection $maturityLevelAnswers, MaturityQuestionNames $name): ?MaturityAnswer + { + return $maturityLevelAnswers?->firstWhere('question.title', '=', $name->value)?->answer; + } + + private function _getActionPlanString(Collection $mesureLevels): string + { + $actionPlan = []; + foreach ($mesureLevels as $mesureLevel) { + if ($mesureLevel->expected_level > $mesureLevel->actual_level) { + $actionPlan[] = implode(';', [ + $mesureLevel->measure->short_name, + '[' . $mesureLevel->actual_level . ' >> ' . $mesureLevel->expected_level . ']', + (new Carbon($mesureLevel->end_date))->isoFormat('DD/MM/YYYY'), + $mesureLevel->manager, + ]); + } + } + + return implode(PHP_EOL, $actionPlan); + } +} diff --git a/app/Http/Resources/OrganizationExportResource.php b/app/Http/Resources/OrganizationExportResource.php new file mode 100644 index 0000000000000000000000000000000000000000..47bb499c47ffe9c1c5de9ac2d06ee93eef15c21b --- /dev/null +++ b/app/Http/Resources/OrganizationExportResource.php @@ -0,0 +1,96 @@ +<?php + +namespace App\Http\Resources; + +use App\Enums\MaturityQuestionNames; +use App\Models\DangerLevelEvaluation; +use App\Models\Evaluation; +use App\Models\MaturityAnswer; +use App\Models\MeasureLevel; +use App\Models\Organization; +use Illuminate\Database\Eloquent\Collection as EloquentCollection; +use Illuminate\Http\Request; +use Illuminate\Http\Resources\Json\JsonResource; + +class OrganizationExportResource extends JsonResource +{ + /** + * Transform the resource into an array. + * + * @param Request $request + */ + public function toArray($request): array + { + /** @var Organization $organization */ + $organization = $this->resource; + + $evaluation = $organization->doneEvaluations()->limit(2)->get(); + /** @var ?Evaluation $lastEvaluation */ + $lastEvaluation = $evaluation->first(); + /** @var ?Evaluation $previousEvaluation */ + $previousEvaluation = $evaluation->get(1); + + $res = [ + 'name' => $organization->name, // - nom de la collectivité + 'shortName' => $organization->short_name, // - nom court + 'territory' => (string) $organization->territory?->name, // - libellé territoire + 'type' => $organization->type, // - type de structure + 'insee' => $organization->address->codeInsee, // - insee + 'siren' => $organization->siren, // - siren + 'active' => $organization->active, // - actif + 'website' => $organization->website, // - site internet + 'info' => $organization->info, // - infos complémentaires + 'fullAddress' => (string) $organization->address, // - adresses (tous les champs) + 'referent' => (string) $organization->referent, // - référents et responsable (tous les champs) + 'referentCyber' => (string) $organization->referentCyber, + 'referentElu' => (string) $organization->referentElu, + 'lastEvaluation.cyberMaturity' => (float) $lastEvaluation?->maturity_cyber, // - score indice maturité cyber + 'previousEvaluation.cyberMaturity' => (float) $previousEvaluation?->maturity_cyber, // - score indice maturité cyber n-1 + ]; + + $measureLevels = $lastEvaluation?->measureLevels ?? collect(); + + foreach ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as $measureKey) { + /** @var ?MeasureLevel $measureLevel */ + $measureLevel = $measureLevels->get($measureKey - 1); + $res["measure$measureKey.actualLevel"] = (string) $measureLevel?->actual_level; // - niveau de mise en œuvre mesure X + } + + foreach ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as $measureKey) { + /** @var ?MeasureLevel $measureLevel */ + $measureLevel = $measureLevels->get($measureKey - 1); + $res["measure$measureKey.expectedLevel"] = (string) $measureLevel?->expected_level; // - niveau de planification mesure X + } + + $maturityLevelAnswers = $lastEvaluation?->maturityLevels()->with(['question', 'answer'])->get(); + + $res = [...$res, + 'executionLevel' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::EXECUTION)?->name, // niveau d'exécution + 'createdDate' => $organization->created_at->isoFormat('DD/MM/YYYY'), // date création de la collectivité + 'lastEvaluation.reference' => (string) $lastEvaluation?->reference, // - version du référentiel + 'lastEvaluation.updatedBy' => (string) $lastEvaluation?->updated_by, // - évaluation modifiée par + 'lastEvaluation.author' => (string) $lastEvaluation?->author, // - évaluation crée par + ]; + + $dangerLevelEvaluations = $lastEvaluation?->dangerLevels ?? collect(); + + foreach ([1, 2, 3, 4, 5, 6] as $dangerId) { + /** @var ?DangerLevelEvaluation $dangerLevelEvaluation */ + $dangerLevelEvaluation = $dangerLevelEvaluations->where('danger_id', '=', $dangerId)->first(); + $res["dangerLevel$dangerId"] = (string) $dangerLevelEvaluation?->level->name; // - perception du danger X + } + + return [...$res, + 'maturityLevel.knowledge' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::KNOWLEDGE)?->name, // - niveau de connaissance + 'maturityLevel.organization' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::ORGANIZATION)?->name, // - niveau d'organisation + 'maturityLevel.motivation' => (string) $this->_getAnswerForQuestionName($maturityLevelAnswers, MaturityQuestionNames::MOTIVATION)?->name, // - niveau de motivation + + 'alert' => (bool) $lastEvaluation?->isThresholdNotExceeded(), // - seuil non dépassé (true/false) + ]; + } + + private function _getAnswerForQuestionName(?EloquentCollection $maturityLevelAnswers, MaturityQuestionNames $name): ?MaturityAnswer + { + return $maturityLevelAnswers?->firstWhere('question.title', '=', $name->value)?->answer; + } +} diff --git a/app/Models/Address.php b/app/Models/Address.php index 70053cf5dfb2c63498afcabc8e1edaaf1f6d2618..90f65db4ed23c73331926bf5f062922559cfa826 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -2,12 +2,47 @@ namespace App\Models; +use Database\Factories\AddressFactory; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; +/** + * App\Models\Address. + * + * @property int $id + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string $address + * @property string|null $moreInfos + * @property string $cp + * @property string $city + * @property string $codeInsee + * + * @method static AddressFactory factory(...$parameters) + * @method static Builder|Address newModelQuery() + * @method static Builder|Address newQuery() + * @method static Builder|Address query() + * @method static Builder|Address whereAddress($value) + * @method static Builder|Address whereCity($value) + * @method static Builder|Address whereCodeInsee($value) + * @method static Builder|Address whereCp($value) + * @method static Builder|Address whereCreatedAt($value) + * @method static Builder|Address whereId($value) + * @method static Builder|Address whereMoreInfos($value) + * @method static Builder|Address whereUpdatedAt($value) + * @mixin Eloquent + */ class Address extends Model { use HasFactory; protected $table = 'address'; + + public function __toString(): string + { + return implode(' ', [$this->address, $this->cp, $this->city]); + } } diff --git a/app/Models/Contact.php b/app/Models/Contact.php index 45f0069bbc3e664b0e88b41f5212385bf1ebe43a..dbad12a89c28795c2d8e9e360e4a1fd74426ccb4 100644 --- a/app/Models/Contact.php +++ b/app/Models/Contact.php @@ -2,21 +2,47 @@ namespace App\Models; +use Database\Factories\ContactFactory; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; /** * Class Contact. * - * @property int $id - * @property string $civility - * @property string $firstname - * @property string $lastname - * @property string $function - * @property string $email - * @property string $phone + * @property int $id + * @property string $civility + * @property string $firstname + * @property string $lastname + * @property string $function + * @property string $email + * @property string $phone + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * + * @method static ContactFactory factory(...$parameters) + * @method static Builder|Contact newModelQuery() + * @method static Builder|Contact newQuery() + * @method static Builder|Contact query() + * @method static Builder|Contact whereCivility($value) + * @method static Builder|Contact whereCreatedAt($value) + * @method static Builder|Contact whereEmail($value) + * @method static Builder|Contact whereFirstname($value) + * @method static Builder|Contact whereFunction($value) + * @method static Builder|Contact whereId($value) + * @method static Builder|Contact whereLastname($value) + * @method static Builder|Contact wherePhone($value) + * @method static Builder|Contact whereUpdatedAt($value) + * @mixin Eloquent */ class Contact extends Model { use HasFactory; + + public function __toString(): string + { + return implode(' ', [$this->civility, $this->firstname, $this->lastname]); + } } diff --git a/app/Models/Danger.php b/app/Models/Danger.php index 6b79611d1251b80c5f5bc3fa5ac2661759c615de..c7ee340718b8b66cd2b8e7a9f4784c5f38217c5c 100644 --- a/app/Models/Danger.php +++ b/app/Models/Danger.php @@ -2,10 +2,14 @@ namespace App\Models; +use Database\Factories\DangerFactory; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Support\Carbon; use Illuminate\Support\Collection; /** @@ -15,6 +19,20 @@ * @property string $name * @property string $description * @property Scenario[]|Collection $scenarios + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property int|null $scenarios_count + * + * @method static DangerFactory factory(...$parameters) + * @method static Builder|Danger newModelQuery() + * @method static Builder|Danger newQuery() + * @method static Builder|Danger query() + * @method static Builder|Danger whereCreatedAt($value) + * @method static Builder|Danger whereDescription($value) + * @method static Builder|Danger whereId($value) + * @method static Builder|Danger whereName($value) + * @method static Builder|Danger whereUpdatedAt($value) + * @mixin Eloquent */ class Danger extends Model { diff --git a/app/Models/DangerLevel.php b/app/Models/DangerLevel.php index 797b6b88b43dfbd97e3ee8c641c3e6a970597199..24a4110efceb9e45d31bfe27b8d1dc0d4890dc83 100644 --- a/app/Models/DangerLevel.php +++ b/app/Models/DangerLevel.php @@ -2,20 +2,40 @@ namespace App\Models; +use Database\Factories\DangerLevelFactory; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Carbon; /** * Class DangerLevel. * - * @property int $id - * @property string $name - * @property string $color - * @property Danger $danger - * @property int $danger_id - * @property string $description - * @property int $value + * @property int $id + * @property string $name + * @property string $color + * @property Danger $danger + * @property int $danger_id + * @property string $description + * @property int $value + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property int|void $points + * + * @method static DangerLevelFactory factory(...$parameters) + * @method static Builder|DangerLevel newModelQuery() + * @method static Builder|DangerLevel newQuery() + * @method static Builder|DangerLevel query() + * @method static Builder|DangerLevel whereColor($value) + * @method static Builder|DangerLevel whereCreatedAt($value) + * @method static Builder|DangerLevel whereDescription($value) + * @method static Builder|DangerLevel whereId($value) + * @method static Builder|DangerLevel whereName($value) + * @method static Builder|DangerLevel whereUpdatedAt($value) + * @method static Builder|DangerLevel whereValue($value) + * @mixin Eloquent */ class DangerLevel extends Model { diff --git a/app/Models/DangerLevelEvaluation.php b/app/Models/DangerLevelEvaluation.php index 0c98815ea3985ad128a89b92080b41e80e2a4da9..741a61eee7f7b95ba70ba72f0fe2438eed130549 100644 --- a/app/Models/DangerLevelEvaluation.php +++ b/app/Models/DangerLevelEvaluation.php @@ -2,10 +2,13 @@ namespace App\Models; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Support\Carbon; /** * Class DangerLevelEvaluation. @@ -17,6 +20,19 @@ * @property int $evaluation_id * @property DangerLevel $level * @property int $danger_level_id + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * + * @method static Builder|DangerLevelEvaluation newModelQuery() + * @method static Builder|DangerLevelEvaluation newQuery() + * @method static Builder|DangerLevelEvaluation query() + * @method static Builder|DangerLevelEvaluation whereCreatedAt($value) + * @method static Builder|DangerLevelEvaluation whereDangerId($value) + * @method static Builder|DangerLevelEvaluation whereDangerLevelId($value) + * @method static Builder|DangerLevelEvaluation whereEvaluationId($value) + * @method static Builder|DangerLevelEvaluation whereId($value) + * @method static Builder|DangerLevelEvaluation whereUpdatedAt($value) + * @mixin Eloquent */ class DangerLevelEvaluation extends Model { diff --git a/app/Models/Evaluation.php b/app/Models/Evaluation.php index 09efec2a63ddbfd11219b7c9ea9597d55f3e8bd4..f7a1b1e4b9b2e134c96f4cff982c2f305bdfaf16 100644 --- a/app/Models/Evaluation.php +++ b/app/Models/Evaluation.php @@ -4,7 +4,10 @@ use App\Calculator\MaturityAnswerLevelCalculator; use Carbon\Carbon; +use Database\Factories\EvaluationFactory; use DateTime; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -25,7 +28,6 @@ * @property MeasureLevel[]|Collection<MeasureLevel> $measureLevels * @property MeasureLevel[]|Collection<MeasureLevel> $measure_levels * @property EvaluationMaturityAnswer[]|Collection<EvaluationMaturityAnswer> $maturityLevels - * @property EvaluationMaturityAnswer[]|Collection<EvaluationMaturityAnswer> $maturity_levels * @property int $status * @property Organization $organization * @property int $organization_id @@ -36,6 +38,24 @@ * @property float $maturityCyber * @property float $maturity_cyber * @property string $reference + * @property int|null $danger_levels_count + * @property int|null $maturity_levels_count + * @property int|null $measure_levels_count + * + * @method static EvaluationFactory factory(...$parameters) + * @method static Builder|Evaluation newModelQuery() + * @method static Builder|Evaluation newQuery() + * @method static Builder|Evaluation query() + * @method static Builder|Evaluation whereAuthor($value) + * @method static Builder|Evaluation whereCreatedAt($value) + * @method static Builder|Evaluation whereCurrentStep($value) + * @method static Builder|Evaluation whereId($value) + * @method static Builder|Evaluation whereOrganizationId($value) + * @method static Builder|Evaluation whereReference($value) + * @method static Builder|Evaluation whereStatus($value) + * @method static Builder|Evaluation whereUpdatedAt($value) + * @method static Builder|Evaluation whereUpdatedBy($value) + * @mixin Eloquent */ class Evaluation extends Model { @@ -176,9 +196,28 @@ public function saveAutomaticAnswers() } $evalAnswer->maturity_question_id = $question->id; - $evalAnswer->maturity_answer_id = $answer->id; + $evalAnswer->maturity_answer_id = $answer?->id; $evalAnswer->evaluation_id = $this->id; $evalAnswer->save(); } } + + public static function getThreshold(): float + { + return env('SEUIL_ALERTE'); // TODO use config instead of direct ENV + } + + /** + * true if OK. + */ + public function isThresholdNotExceeded(): bool + { + foreach ($this->measureLevels as $measureLevel) { + if ($measureLevel->actual_level < self::getThreshold()) { + return true; + } + } + + return false; + } } diff --git a/app/Models/EvaluationMaturityAnswer.php b/app/Models/EvaluationMaturityAnswer.php index 3681ad62db0f6503352a9bd4501e2323bdfa0e17..f4eb8765c8ea1977da433686ac039414873e1f27 100644 --- a/app/Models/EvaluationMaturityAnswer.php +++ b/app/Models/EvaluationMaturityAnswer.php @@ -2,17 +2,21 @@ namespace App\Models; +use Database\Factories\EvaluationMaturityAnswerFactory; use DateTime; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Support\Carbon; /** * Class EvaluationMaturityAnswer. * - * @property int $id - * @property Evaluation$evaluation + * @property int $id + * @property Evaluation $evaluation * @property int $evaluation_id * @property MaturityQuestion $question * @property int $maturity_question_id @@ -20,6 +24,20 @@ * @property int $maturity_answer_id * @property DateTime $createdAt * @property DateTime $updatedAt + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * + * @method static EvaluationMaturityAnswerFactory factory(...$parameters) + * @method static Builder|EvaluationMaturityAnswer newModelQuery() + * @method static Builder|EvaluationMaturityAnswer newQuery() + * @method static Builder|EvaluationMaturityAnswer query() + * @method static Builder|EvaluationMaturityAnswer whereCreatedAt($value) + * @method static Builder|EvaluationMaturityAnswer whereEvaluationId($value) + * @method static Builder|EvaluationMaturityAnswer whereId($value) + * @method static Builder|EvaluationMaturityAnswer whereMaturityAnswerId($value) + * @method static Builder|EvaluationMaturityAnswer whereMaturityQuestionId($value) + * @method static Builder|EvaluationMaturityAnswer whereUpdatedAt($value) + * @mixin Eloquent */ class EvaluationMaturityAnswer extends Model { diff --git a/app/Models/MaturityAnswer.php b/app/Models/MaturityAnswer.php index d181355c04985976db2ca59fa4b05231ffdf9f0f..d571341171a61bb24d5109e7406478398b508607 100644 --- a/app/Models/MaturityAnswer.php +++ b/app/Models/MaturityAnswer.php @@ -2,12 +2,16 @@ namespace App\Models; +use Database\Factories\MaturityAnswerFactory; use DateTime; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Support\Carbon; use Illuminate\Support\Collection; /** @@ -22,6 +26,22 @@ * @property MaturityAnswer[]|iterable|Collection $evaluationMaturityAnswers * @property DateTime $createdAt * @property DateTime $updatedAt + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property int|null $evaluation_maturity_answers_count + * + * @method static MaturityAnswerFactory factory(...$parameters) + * @method static Builder|MaturityAnswer newModelQuery() + * @method static Builder|MaturityAnswer newQuery() + * @method static Builder|MaturityAnswer query() + * @method static Builder|MaturityAnswer whereCreatedAt($value) + * @method static Builder|MaturityAnswer whereId($value) + * @method static Builder|MaturityAnswer whereLevel($value) + * @method static Builder|MaturityAnswer whereMaturityQuestionId($value) + * @method static Builder|MaturityAnswer whereName($value) + * @method static Builder|MaturityAnswer whereSlug($value) + * @method static Builder|MaturityAnswer whereUpdatedAt($value) + * @mixin Eloquent */ class MaturityAnswer extends Model { diff --git a/app/Models/MaturityQuestion.php b/app/Models/MaturityQuestion.php index a3d0e7406b45260a8bcd8cce14f0e8f5444479ba..bf36f7993872a02c140b24c0ee3a6fd968ae50a6 100644 --- a/app/Models/MaturityQuestion.php +++ b/app/Models/MaturityQuestion.php @@ -2,11 +2,15 @@ namespace App\Models; +use Database\Factories\MaturityQuestionFactory; use DateTime; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Support\Carbon; /** * Class MaturityQuestion. @@ -20,6 +24,23 @@ * @property bool $auto * @property DateTime $createdAt * @property DateTime $updatedAt + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property int|null $answers_count + * + * @method static MaturityQuestionFactory factory(...$parameters) + * @method static Builder|MaturityQuestion newModelQuery() + * @method static Builder|MaturityQuestion newQuery() + * @method static Builder|MaturityQuestion query() + * @method static Builder|MaturityQuestion whereAuto($value) + * @method static Builder|MaturityQuestion whereCreatedAt($value) + * @method static Builder|MaturityQuestion whereId($value) + * @method static Builder|MaturityQuestion whereName($value) + * @method static Builder|MaturityQuestion whereSlug($value) + * @method static Builder|MaturityQuestion whereSubtitle($value) + * @method static Builder|MaturityQuestion whereTitle($value) + * @method static Builder|MaturityQuestion whereUpdatedAt($value) + * @mixin Eloquent */ class MaturityQuestion extends Model { diff --git a/app/Models/Measure.php b/app/Models/Measure.php index 5d61f7f7abd578ba3e87cfa256e150527c713dbf..06e9b20bfe1b7125674470770b9d475aa76ebb88 100644 --- a/app/Models/Measure.php +++ b/app/Models/Measure.php @@ -2,6 +2,10 @@ namespace App\Models; +use Database\Factories\MeasureFactory; +use DateTime; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -9,6 +13,8 @@ use Illuminate\Support\Collection; /** + * App\Models\Measure. + * * @property int $id * @property string $name * @property string $short_name @@ -39,14 +45,60 @@ * @property int $level3_duration * @property int $level3_assistance * @property string $level3_file - * @property \DateTime $created_at - * @property \DateTime $updated_at + * @property DateTime $created_at + * @property DateTime $updated_at * @property bool $fundamental * @property int $level0_value * @property int $level1_value * @property int $level2_value * @property int $level3_value * @property Scenario[]|Collection $scenarios + * @property string $level0_actual_label + * @property int|null $scenarios_count + * + * @method static MeasureFactory factory(...$parameters) + * @method static Builder|Measure newModelQuery() + * @method static Builder|Measure newQuery() + * @method static Builder|Measure query() + * @method static Builder|Measure whereCreatedAt($value) + * @method static Builder|Measure whereFundamental($value) + * @method static Builder|Measure whereId($value) + * @method static Builder|Measure whereLevel0ActualLabel($value) + * @method static Builder|Measure whereLevel0Value($value) + * @method static Builder|Measure whereLevel1ActualLabel($value) + * @method static Builder|Measure whereLevel1Assistance($value) + * @method static Builder|Measure whereLevel1Cost($value) + * @method static Builder|Measure whereLevel1Description($value) + * @method static Builder|Measure whereLevel1Difficulty($value) + * @method static Builder|Measure whereLevel1Duration($value) + * @method static Builder|Measure whereLevel1File($value) + * @method static Builder|Measure whereLevel1Info($value) + * @method static Builder|Measure whereLevel1PreconizedLabel($value) + * @method static Builder|Measure whereLevel1Value($value) + * @method static Builder|Measure whereLevel2ActualLabel($value) + * @method static Builder|Measure whereLevel2Assistance($value) + * @method static Builder|Measure whereLevel2Cost($value) + * @method static Builder|Measure whereLevel2Description($value) + * @method static Builder|Measure whereLevel2Difficulty($value) + * @method static Builder|Measure whereLevel2Duration($value) + * @method static Builder|Measure whereLevel2File($value) + * @method static Builder|Measure whereLevel2Info($value) + * @method static Builder|Measure whereLevel2PreconizedLabel($value) + * @method static Builder|Measure whereLevel2Value($value) + * @method static Builder|Measure whereLevel3ActualLabel($value) + * @method static Builder|Measure whereLevel3Assistance($value) + * @method static Builder|Measure whereLevel3Cost($value) + * @method static Builder|Measure whereLevel3Description($value) + * @method static Builder|Measure whereLevel3Difficulty($value) + * @method static Builder|Measure whereLevel3Duration($value) + * @method static Builder|Measure whereLevel3File($value) + * @method static Builder|Measure whereLevel3Info($value) + * @method static Builder|Measure whereLevel3PreconizedLabel($value) + * @method static Builder|Measure whereLevel3Value($value) + * @method static Builder|Measure whereName($value) + * @method static Builder|Measure whereShortName($value) + * @method static Builder|Measure whereUpdatedAt($value) + * @mixin Eloquent */ class Measure extends Model { diff --git a/app/Models/MeasureLevel.php b/app/Models/MeasureLevel.php index 2150194050c11ee26c09689071f728f9e6cac4cb..f755bd4927d58b20394e2facbe259ca3a72cbd8d 100644 --- a/app/Models/MeasureLevel.php +++ b/app/Models/MeasureLevel.php @@ -2,10 +2,14 @@ namespace App\Models; +use Database\Factories\MeasureLevelFactory; use DateTime; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Support\Carbon; /** * Class MeasureLevel. @@ -19,6 +23,23 @@ * @property int|null $expected_level * @property DateTime|null $end_date * @property string|null $manager + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * + * @method static MeasureLevelFactory factory(...$parameters) + * @method static Builder|MeasureLevel newModelQuery() + * @method static Builder|MeasureLevel newQuery() + * @method static Builder|MeasureLevel query() + * @method static Builder|MeasureLevel whereActualLevel($value) + * @method static Builder|MeasureLevel whereCreatedAt($value) + * @method static Builder|MeasureLevel whereEndDate($value) + * @method static Builder|MeasureLevel whereEvaluationId($value) + * @method static Builder|MeasureLevel whereExpectedLevel($value) + * @method static Builder|MeasureLevel whereId($value) + * @method static Builder|MeasureLevel whereManager($value) + * @method static Builder|MeasureLevel whereMeasureId($value) + * @method static Builder|MeasureLevel whereUpdatedAt($value) + * @mixin Eloquent */ class MeasureLevel extends Model { diff --git a/app/Models/Organization.php b/app/Models/Organization.php index 3aa9ababfeb424d87d2f010faabc3405453200bf..3298aae2dcd40f88175816a4ed82aba16933d5b4 100644 --- a/app/Models/Organization.php +++ b/app/Models/Organization.php @@ -2,40 +2,81 @@ namespace App\Models; +use Database\Factories\OrganizationFactory; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Support\Carbon; use Illuminate\Support\Collection; /** - * @property int $id - * @property string $name - * @property string $short_name - * @property string $type - * @property string $siren - * @property bool $active - * @property string $website - * @property string $info - * @property Address $address - * @property Contact $referent - * @property int $referent_id - * @property Contact $referent_cyber - * @property Contact $referentCyber - * @property int $referent_cyber_id - * @property Contact $referent_elu - * @property Contact $referentElu - * @property int $referent_elu_id - * @property Evaluation[]|Collection<Evaluation> $evaluations - * @property Evaluation[]|Collection<Evaluation> $doneEvaluations - * @property int $territory_id + * App\Models\Organization. + * + * @property int $id + * @property string $name + * @property string $short_name + * @property string $type + * @property string $siren + * @property bool $active + * @property string $website + * @property string $info + * @property Address $address + * @property ?Contact $referent + * @property int $referent_id + * @property ?Contact $referentCyber + * @property int $referent_cyber_id + * @property ?Contact $referentElu + * @property int $referent_elu_id + * @property Evaluation[]|Collection<Evaluation> $evaluations + * @property Evaluation[]|Collection<Evaluation> $doneEvaluations + * @property int $territory_id + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $bilan1 + * @property string|null $bilan2 + * @property int|null $address_id + * @property int|null $done_evaluations_count + * @property int|null $evaluations_count + * @property \App\Models\Territory|null $territory + * @property \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $users + * @property int|null $users_count + * + * @method static OrganizationFactory factory(...$parameters) + * @method static Builder|Organization newModelQuery() + * @method static Builder|Organization newQuery() + * @method static Builder|Organization query() + * @method static Builder|Organization whereActive($value) + * @method static Builder|Organization whereAddressId($value) + * @method static Builder|Organization whereBilan1($value) + * @method static Builder|Organization whereBilan2($value) + * @method static Builder|Organization whereCreatedAt($value) + * @method static Builder|Organization whereId($value) + * @method static Builder|Organization whereInfo($value) + * @method static Builder|Organization whereName($value) + * @method static Builder|Organization whereReferentCyberId($value) + * @method static Builder|Organization whereReferentEluId($value) + * @method static Builder|Organization whereReferentId($value) + * @method static Builder|Organization whereShortName($value) + * @method static Builder|Organization whereSiren($value) + * @method static Builder|Organization whereTerritoryId($value) + * @method static Builder|Organization whereType($value) + * @method static Builder|Organization whereUpdatedAt($value) + * @method static Builder|Organization whereWebsite($value) + * @mixin Eloquent */ class Organization extends Model { use HasFactory; use HasTimestamps; + public $casts = [ + 'active' => 'boolean', + ]; + public function users(): HasMany { return $this->hasMany(User::class); diff --git a/app/Models/Scenario.php b/app/Models/Scenario.php index 0393f848b425d46c983c9becd0fefac93aa9dbf5..ca3a4fd5ebd44d743d92b5f1356aef78c65dec9e 100644 --- a/app/Models/Scenario.php +++ b/app/Models/Scenario.php @@ -2,10 +2,13 @@ namespace App\Models; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasTimestamps; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Support\Carbon; use Illuminate\Support\Collection; /** @@ -15,6 +18,19 @@ * @property string $name * @property Danger[]|Collection $dangers * @property Measure[]|Collection $measures + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property int|null $dangers_count + * @property int|null $measures_count + * + * @method static Builder|Scenario newModelQuery() + * @method static Builder|Scenario newQuery() + * @method static Builder|Scenario query() + * @method static Builder|Scenario whereCreatedAt($value) + * @method static Builder|Scenario whereId($value) + * @method static Builder|Scenario whereName($value) + * @method static Builder|Scenario whereUpdatedAt($value) + * @mixin Eloquent */ class Scenario extends Model { diff --git a/app/Models/Territory.php b/app/Models/Territory.php index 1f289cb49ba5ff621a2e9702a5db8dfd6e52845c..8d2c3f0fa77714731896eb00c50b4d88d89a85ef 100644 --- a/app/Models/Territory.php +++ b/app/Models/Territory.php @@ -2,15 +2,32 @@ namespace App\Models; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Support\Carbon; use Illuminate\Support\Collection; /** + * App\Models\Territory. + * * @property int $id * @property string $name * @property Organization[]|Collection<Organization> $organizations + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property int|null $organizations_count + * + * @method static Builder|Territory newModelQuery() + * @method static Builder|Territory newQuery() + * @method static Builder|Territory query() + * @method static Builder|Territory whereCreatedAt($value) + * @method static Builder|Territory whereId($value) + * @method static Builder|Territory whereName($value) + * @method static Builder|Territory whereUpdatedAt($value) + * @mixin Eloquent */ class Territory extends Model { diff --git a/app/Models/User.php b/app/Models/User.php index 8392a022845f7cb5f0dd5befa8ae0641279cf46f..8951e031d56fcfae08477274e39f3ba2ff96f1b4 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,26 +2,65 @@ namespace App\Models; +use Database\Factories\UserFactory; +use Eloquent; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Foundation\Auth\User as Authenticatable; +use Illuminate\Notifications\DatabaseNotification; +use Illuminate\Notifications\DatabaseNotificationCollection; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Carbon; use Lab404\Impersonate\Models\Impersonate; use Laravel\Sanctum\HasApiTokens; +use Laravel\Sanctum\PersonalAccessToken; /** - * @property int $id - * @property int $role - * @property string $firstname - * @property string $lastname - * @property string $email - * @property string $password - * @property string $remember_token - * @property string $last_login - * @property string $email_verified_at - * @property Organization|null $organization - * @property int $organization_id - * @property bool $active + * App\Models\User. + * + * @property int $id + * @property int $role + * @property string $firstname + * @property string $lastname + * @property string $email + * @property string $password + * @property string $remember_token + * @property string $last_login + * @property string $email_verified_at + * @property Organization|null $organization + * @property int $organization_id + * @property bool $active + * @property string $civility + * @property string|null $reset_token + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property DatabaseNotificationCollection|DatabaseNotification[] $notifications + * @property int|null $notifications_count + * @property Collection|PersonalAccessToken[] $tokens + * @property int|null $tokens_count + * + * @method static UserFactory factory(...$parameters) + * @method static Builder|User newModelQuery() + * @method static Builder|User newQuery() + * @method static Builder|User query() + * @method static Builder|User whereActive($value) + * @method static Builder|User whereCivility($value) + * @method static Builder|User whereCreatedAt($value) + * @method static Builder|User whereEmail($value) + * @method static Builder|User whereEmailVerifiedAt($value) + * @method static Builder|User whereFirstname($value) + * @method static Builder|User whereId($value) + * @method static Builder|User whereLastLogin($value) + * @method static Builder|User whereLastname($value) + * @method static Builder|User whereOrganizationId($value) + * @method static Builder|User wherePassword($value) + * @method static Builder|User whereRememberToken($value) + * @method static Builder|User whereResetToken($value) + * @method static Builder|User whereRole($value) + * @method static Builder|User whereUpdatedAt($value) + * @mixin Eloquent */ class User extends Authenticatable { diff --git a/composer.json b/composer.json index 755701bf676d70bcac3ba904a01fc9e395ac37a8..28dd9183b9a8cd7fb83b23093f677a3545d0345d 100644 --- a/composer.json +++ b/composer.json @@ -10,24 +10,27 @@ "barryvdh/laravel-snappy": "^1.0", "doctrine/dbal": "^3.3", "guzzlehttp/guzzle": "^7.4", - "h4cc/wkhtmltopdf-amd64": "^0.12.4", "h4cc/wkhtmltoimage-amd64": "^0.12.4", + "h4cc/wkhtmltopdf-amd64": "^0.12.4", "lab404/laravel-impersonate": "^1.7", "laravel/framework": "^9.11", "laravel/helpers": "^1.5", "laravel/sanctum": "^2.15", - "laravel/tinker": "^2.7" + "laravel/tinker": "^2.7", + "spatie/simple-excel": "^2.3" }, "require-dev": { + "barryvdh/laravel-ide-helper": "^2.12", "fakerphp/faker": "^1.9.1", "friendsofphp/php-cs-fixer": "^3.8", "laravel/homestead": "^13.2", - "laravel/sail": "^1.0.1", + "laravel/sail": "^1.16", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^6.1", "nunomaduro/larastan": "^2.0", "phpstan/phpstan": "^1.7", "phpunit/phpunit": "^9.5.10", + "roave/security-advisories": "dev-latest", "spatie/laravel-ignition": "^1.0" }, "autoload": { diff --git a/composer.lock b/composer.lock index fd70d00ebf3c791f384c7803644d917be845ba1c..3718bc8f9aaf2715321398fd6fde82e0c6867ac5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "976ab2c2ebd291956a823c5cd567cf45", + "content-hash": "334136c5ac766ef0758f8fe6ec83b50a", "packages": [ { "name": "barryvdh/laravel-snappy", @@ -2799,6 +2799,95 @@ ], "time": "2022-07-01T15:06:55+00:00" }, + { + "name": "openspout/openspout", + "version": "v3.7.4", + "source": { + "type": "git", + "url": "https://github.com/openspout/openspout.git", + "reference": "dfbbd53b5edcd486b45a37f6a04fac33073c70f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/openspout/openspout/zipball/dfbbd53b5edcd486b45a37f6a04fac33073c70f3", + "reference": "dfbbd53b5edcd486b45a37f6a04fac33073c70f3", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-filter": "*", + "ext-libxml": "*", + "ext-xmlreader": "*", + "ext-zip": "*", + "php": "~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0" + }, + "require-dev": { + "ext-zlib": "*", + "friendsofphp/php-cs-fixer": "^3.4", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "ext-iconv": "To handle non UTF-8 CSV files (if \"php-intl\" is not already installed or is too limited)", + "ext-intl": "To handle non UTF-8 CSV files (if \"iconv\" is not already installed)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "OpenSpout\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Adrien Loison", + "email": "adrien@box.com" + } + ], + "description": "PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way", + "homepage": "https://github.com/openspout/openspout", + "keywords": [ + "OOXML", + "csv", + "excel", + "memory", + "odf", + "ods", + "office", + "open", + "php", + "read", + "scale", + "spreadsheet", + "stream", + "write", + "xlsx" + ], + "support": { + "issues": "https://github.com/openspout/openspout/issues", + "source": "https://github.com/openspout/openspout/tree/v3.7.4" + }, + "funding": [ + { + "url": "https://paypal.me/filippotessarotto", + "type": "custom" + }, + { + "url": "https://github.com/Slamdunk", + "type": "github" + } + ], + "time": "2022-03-31T06:15:15+00:00" + }, { "name": "phpoption/phpoption", "version": "1.8.1", @@ -3576,6 +3665,65 @@ ], "time": "2022-03-27T21:42:02+00:00" }, + { + "name": "spatie/simple-excel", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/simple-excel.git", + "reference": "741527835370b34134d685324f8502cae6735fed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/simple-excel/zipball/741527835370b34134d685324f8502cae6735fed", + "reference": "741527835370b34134d685324f8502cae6735fed", + "shasum": "" + }, + "require": { + "illuminate/support": "^8.71|^9.0", + "openspout/openspout": "^3.0", + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.4", + "spatie/phpunit-snapshot-assertions": "^4.0", + "spatie/temporary-directory": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\SimpleExcel\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Read and write simple Excel and CSV files", + "homepage": "https://github.com/spatie/simple-excel", + "keywords": [ + "simple-excel", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/simple-excel/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-10-11T11:37:13+00:00" + }, { "name": "symfony/console", "version": "v6.1.2", @@ -5944,6 +6092,152 @@ } ], "packages-dev": [ + { + "name": "barryvdh/laravel-ide-helper", + "version": "v2.12.3", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-ide-helper.git", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "reference": "3ba1e2573b38f72107b8aacc4ee177fcab30a550", + "shasum": "" + }, + "require": { + "barryvdh/reflection-docblock": "^2.0.6", + "composer/pcre": "^1 || ^2 || ^3", + "doctrine/dbal": "^2.6 || ^3", + "ext-json": "*", + "illuminate/console": "^8 || ^9", + "illuminate/filesystem": "^8 || ^9", + "illuminate/support": "^8 || ^9", + "nikic/php-parser": "^4.7", + "php": "^7.3 || ^8.0", + "phpdocumentor/type-resolver": "^1.1.0" + }, + "require-dev": { + "ext-pdo_sqlite": "*", + "friendsofphp/php-cs-fixer": "^2", + "illuminate/config": "^8 || ^9", + "illuminate/view": "^8 || ^9", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6 || ^7", + "phpunit/phpunit": "^8.5 || ^9", + "spatie/phpunit-snapshot-assertions": "^3 || ^4", + "vimeo/psalm": "^3.12" + }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.12-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.", + "keywords": [ + "autocomplete", + "codeintel", + "helper", + "ide", + "laravel", + "netbeans", + "phpdoc", + "phpstorm", + "sublime" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.12.3" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2022-03-06T14:33:42+00:00" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "bf44b757feb8ba1734659029357646466ded673e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/bf44b757feb8ba1734659029357646466ded673e", + "reference": "bf44b757feb8ba1734659029357646466ded673e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.14|^9" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "support": { + "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.1.0" + }, + "time": "2022-10-31T15:35:43+00:00" + }, { "name": "composer/class-map-generator", "version": "1.0.0", @@ -6765,16 +7059,16 @@ }, { "name": "laravel/sail", - "version": "v1.15.1", + "version": "v1.16.2", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "2fe64c0b45a3af56cac0af638c8020a8adc860d7" + "reference": "7d1ed5f856ec8b9708712e3fc0708fcabe114659" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/2fe64c0b45a3af56cac0af638c8020a8adc860d7", - "reference": "2fe64c0b45a3af56cac0af638c8020a8adc860d7", + "url": "https://api.github.com/repos/laravel/sail/zipball/7d1ed5f856ec8b9708712e3fc0708fcabe114659", + "reference": "7d1ed5f856ec8b9708712e3fc0708fcabe114659", "shasum": "" }, "require": { @@ -6821,7 +7115,7 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2022-07-21T14:33:56+00:00" + "time": "2022-09-28T13:13:22+00:00" }, { "name": "mockery/mockery", @@ -8083,6 +8377,541 @@ ], "time": "2022-06-19T12:14:25+00:00" }, + { + "name": "roave/security-advisories", + "version": "dev-latest", + "source": { + "type": "git", + "url": "https://github.com/Roave/SecurityAdvisories.git", + "reference": "964c5d9ca40d0ec72db203b3dd6382a30abef616" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/964c5d9ca40d0ec72db203b3dd6382a30abef616", + "reference": "964c5d9ca40d0ec72db203b3dd6382a30abef616", + "shasum": "" + }, + "conflict": { + "3f/pygmentize": "<1.2", + "admidio/admidio": "<4.1.9", + "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3", + "aheinze/cockpit": "<=2.2.1", + "akaunting/akaunting": "<2.1.13", + "alextselegidis/easyappointments": "<=1.4.3", + "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", + "amazing/media2click": ">=1,<1.3.3", + "amphp/artax": "<1.0.6|>=2,<2.0.6", + "amphp/http": "<1.0.1", + "amphp/http-client": ">=4,<4.4", + "anchorcms/anchor-cms": "<=0.12.7", + "andreapollastri/cipi": "<=3.1.15", + "apereo/phpcas": "<1.6", + "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", + "appwrite/server-ce": "<0.11.1|>=0.12,<0.12.2", + "area17/twill": "<1.2.5|>=2,<2.5.3", + "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", + "awesome-support/awesome-support": "<=6.0.7", + "aws/aws-sdk-php": ">=3,<3.2.1", + "badaso/core": "<2.6.1", + "bagisto/bagisto": "<0.1.5", + "barrelstrength/sprout-base-email": "<1.2.7", + "barrelstrength/sprout-forms": "<3.9", + "barryvdh/laravel-translation-manager": "<0.6.2", + "baserproject/basercms": "<4.5.4", + "billz/raspap-webgui": "<=2.6.6", + "bk2k/bootstrap-package": ">=7.1,<7.1.2|>=8,<8.0.8|>=9,<9.0.4|>=9.1,<9.1.3|>=10,<10.0.10|>=11,<11.0.3", + "bmarshall511/wordpress_zero_spam": "<5.2.13", + "bolt/bolt": "<3.7.2", + "bolt/core": "<=4.2", + "bottelet/flarepoint": "<2.2.1", + "brightlocal/phpwhois": "<=4.2.5", + "brotkrueml/codehighlight": "<2.7", + "brotkrueml/schema": "<1.13.1|>=2,<2.5.1", + "brotkrueml/typo3-matomo-integration": "<1.3.2", + "buddypress/buddypress": "<7.2.1", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "bytefury/crater": "<6.0.2", + "cachethq/cachet": "<2.5.1", + "cakephp/cakephp": "<3.10.3|>=4,<4.0.6", + "cardgate/magento2": "<2.0.33", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cartalyst/sentry": "<=2.1.6", + "catfan/medoo": "<1.7.5", + "centreon/centreon": "<22.10-beta.1", + "cesnet/simplesamlphp-module-proxystatistics": "<3.1", + "codeception/codeception": "<3.1.3|>=4,<4.1.22", + "codeigniter/framework": "<=3.0.6", + "codeigniter4/framework": "<4.2.7", + "codeigniter4/shield": "= 1.0.0-beta", + "codiad/codiad": "<=2.8.4", + "composer/composer": "<1.10.26|>=2-alpha.1,<2.2.12|>=2.3,<2.3.5", + "concrete5/concrete5": "<9", + "concrete5/core": "<8.5.8|>=9,<9.1", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/contao": ">=4,<4.4.56|>=4.5,<4.9.18|>=4.10,<4.11.7|>=4.13,<4.13.3", + "contao/core": ">=2,<3.5.39", + "contao/core-bundle": "<4.9.18|>=4.10,<4.11.7|>=4.13,<4.13.3|= 4.10.0", + "contao/listing-bundle": ">=4,<4.4.8", + "contao/managed-edition": "<=1.5", + "craftcms/cms": "<3.7.55.2|>= 4.0.0-RC1, < 4.2.1", + "croogo/croogo": "<3.0.7", + "cuyz/valinor": "<0.12", + "czproject/git-php": "<4.0.3", + "darylldoyle/safe-svg": "<1.9.10", + "datadog/dd-trace": ">=0.30,<0.30.2", + "david-garcia/phpwhois": "<=4.3.1", + "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", + "directmailteam/direct-mail": "<5.2.4", + "doctrine/annotations": ">=1,<1.2.7", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", + "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", + "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2|>=3,<3.1.4", + "doctrine/doctrine-bundle": "<1.5.2", + "doctrine/doctrine-module": "<=0.7.1", + "doctrine/mongodb-odm": ">=1,<1.0.2", + "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", + "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", + "dolibarr/dolibarr": "<16|= 12.0.5|>= 3.3.beta1, < 13.0.2", + "dompdf/dompdf": "<2.0.1", + "drupal/core": ">=7,<7.91|>=8,<9.3.19|>=9.4,<9.4.3", + "drupal/drupal": ">=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4", + "dweeves/magmi": "<=0.7.24", + "ecodev/newsletter": "<=4", + "ectouch/ectouch": "<=2.7.2", + "elefant/cms": "<1.3.13", + "elgg/elgg": "<3.3.24|>=4,<4.0.5", + "endroid/qr-code-bundle": "<3.4.2", + "enshrined/svg-sanitize": "<0.15", + "erusev/parsedown": "<1.7.2", + "ether/logs": "<3.0.4", + "exceedone/exment": "<4.4.3|>=5,<5.0.3", + "exceedone/laravel-admin": "= 3.0.0|<2.2.3", + "ezsystems/demobundle": ">=5.4,<5.4.6.1", + "ezsystems/ez-support-tools": ">=2.2,<2.2.3", + "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", + "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", + "ezsystems/ezplatform": "<=1.13.6|>=2,<=2.5.24", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.27", + "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", + "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.19", + "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8", + "ezsystems/ezplatform-richtext": ">=2.3,<=2.3.7", + "ezsystems/ezplatform-user": ">=1,<1.0.1", + "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.29", + "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.3.5.1", + "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1", + "ezyang/htmlpurifier": "<4.1.1", + "facade/ignition": "<1.16.15|>=2,<2.4.2|>=2.5,<2.5.2", + "facturascripts/facturascripts": "<=2022.8", + "feehi/cms": "<=2.1.1", + "feehi/feehicms": "<=2.0.1.1", + "fenom/fenom": "<=2.12.1", + "filegator/filegator": "<7.8", + "firebase/php-jwt": "<2", + "flarum/core": ">=1,<=1.0.1", + "flarum/sticky": ">=0.1-beta.14,<=0.1-beta.15", + "flarum/tags": "<=0.1-beta.13", + "fluidtypo3/vhs": "<5.1.1", + "fof/byobu": ">=0.3-beta.2,<1.1.7", + "fof/upload": "<1.2.3", + "fooman/tcpdf": "<6.2.22", + "forkcms/forkcms": "<5.11.1", + "fossar/tcpdf-parser": "<6.2.22", + "francoisjacquet/rosariosis": "<10.1", + "friendsofsymfony/oauth2-php": "<1.3", + "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", + "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", + "froala/wysiwyg-editor": "<3.2.7", + "froxlor/froxlor": "<0.10.39", + "fuel/core": "<1.8.1", + "gaoming13/wechat-php-sdk": "<=1.10.2", + "genix/cms": "<=1.1.11", + "getgrav/grav": "<1.7.34", + "getkirby/cms": "= 3.8.0|<3.5.8.2|>=3.6,<3.6.6.2|>=3.7,<3.7.5.1", + "getkirby/panel": "<2.5.14", + "getkirby/starterkit": "<=3.7.0.2", + "gilacms/gila": "<=1.11.4", + "globalpayments/php-sdk": "<2", + "google/protobuf": "<3.15", + "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", + "gree/jose": "<=2.2", + "gregwar/rst": "<1.0.3", + "grumpydictator/firefly-iii": "<5.6.5", + "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", + "guzzlehttp/psr7": "<1.8.4|>=2,<2.1.1", + "helloxz/imgurl": "= 2.31|<=2.31", + "hillelcoren/invoice-ninja": "<5.3.35", + "hjue/justwriting": "<=1", + "hov/jobfair": "<1.0.13|>=2,<2.0.2", + "hyn/multi-tenant": ">=5.6,<5.7.2", + "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4", + "ibexa/post-install": "<=1.0.4", + "icecoder/icecoder": "<=8.1", + "idno/known": "<=1.3.1", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", + "illuminate/database": "<6.20.26|>=7,<7.30.5|>=8,<8.40", + "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "illuminate/view": "<6.20.42|>=7,<7.30.6|>=8,<8.75", + "impresscms/impresscms": "<=1.4.3", + "in2code/femanager": "<5.5.2|>=6,<6.3.3|>=7,<7.0.1", + "in2code/lux": "<17.6.1|>=18,<24.0.2", + "intelliants/subrion": "<=4.2.1", + "islandora/islandora": ">=2,<2.4.1", + "ivankristianto/phpwhois": "<=4.3", + "jackalope/jackalope-doctrine-dbal": "<1.7.4", + "james-heinrich/getid3": "<1.9.21", + "joomla/archive": "<1.1.12|>=2,<2.0.1", + "joomla/filesystem": "<1.6.2|>=2,<2.0.1", + "joomla/filter": "<1.4.4|>=2,<2.0.1", + "joomla/input": ">=2,<2.0.2", + "joomla/session": "<1.3.1", + "joyqi/hyper-down": "<=2.4.27", + "jsdecena/laracom": "<2.0.9", + "jsmitty12/phpwhois": "<5.1", + "kazist/phpwhois": "<=4.2.6", + "kevinpapst/kimai2": "<1.16.7", + "kitodo/presentation": "<3.1.2", + "klaviyo/magento2-extension": ">=1,<3", + "krayin/laravel-crm": "<1.2.2", + "kreait/firebase-php": ">=3.2,<3.8.1", + "la-haute-societe/tcpdf": "<6.2.22", + "laminas/laminas-diactoros": "<2.11.1", + "laminas/laminas-form": "<2.17.1|>=3,<3.0.2|>=3.1,<3.1.1", + "laminas/laminas-http": "<2.14.2", + "laravel/fortify": "<1.11.1", + "laravel/framework": "<6.20.42|>=7,<7.30.6|>=8,<8.75", + "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "latte/latte": "<2.10.8", + "lavalite/cms": "<=5.8", + "lcobucci/jwt": ">=3.4,<3.4.6|>=4,<4.0.4|>=4.1,<4.1.5", + "league/commonmark": "<0.18.3", + "league/flysystem": "<1.1.4|>=2,<2.1.1", + "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3", + "librenms/librenms": "<=22.8", + "limesurvey/limesurvey": "<3.27.19", + "livehelperchat/livehelperchat": "<=3.91", + "livewire/livewire": ">2.2.4,<2.2.6", + "lms/routes": "<2.1.1", + "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", + "luyadev/yii-helpers": "<1.2.1", + "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", + "magento/magento1ce": "<1.9.4.3", + "magento/magento1ee": ">=1,<1.14.4.3", + "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", + "marcwillmann/turn": "<0.3.3", + "matyhtf/framework": "<3.0.6", + "mautic/core": "<4.3|= 2.13.1", + "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", + "melisplatform/melis-asset-manager": "<5.0.1", + "melisplatform/melis-cms": "<5.0.1", + "melisplatform/melis-front": "<5.0.1", + "mezzio/mezzio-swoole": "<3.7|>=4,<4.3", + "microweber/microweber": "<=1.3.1", + "miniorange/miniorange-saml": "<1.4.3", + "mittwald/typo3_forum": "<1.2.1", + "modx/revolution": "<= 2.8.3-pl|<2.8", + "mojo42/jirafeau": "<4.4", + "monolog/monolog": ">=1.8,<1.12", + "moodle/moodle": "<4.0.1", + "mustache/mustache": ">=2,<2.14.1", + "namshi/jose": "<2.2", + "neoan3-apps/template": "<1.1.1", + "neorazorx/facturascripts": "<2022.4", + "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", + "neos/form": ">=1.2,<4.3.3|>=5,<5.0.9|>=5.1,<5.1.3", + "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.9.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<5.3.10|>=7,<7.0.9|>=7.1,<7.1.7|>=7.2,<7.2.6|>=7.3,<7.3.4|>=8,<8.0.2", + "neos/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", + "netgen/tagsbundle": ">=3.4,<3.4.11|>=4,<4.0.15", + "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", + "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", + "nilsteampassnet/teampass": "<=2.1.27.36", + "notrinos/notrinos-erp": "<=0.7", + "noumo/easyii": "<=0.9", + "nukeviet/nukeviet": "<4.5.2", + "nystudio107/craft-seomatic": "<3.4.12", + "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", + "october/backend": "<1.1.2", + "october/cms": "= 1.1.1|= 1.0.471|= 1.0.469|>=1.0.319,<1.0.469", + "october/october": ">=1.0.319,<1.0.466|>=2.1,<2.1.12", + "october/rain": "<1.0.472|>=1.1,<1.1.2", + "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.0.66", + "onelogin/php-saml": "<2.10.4", + "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", + "open-web-analytics/open-web-analytics": "<1.7.4", + "opencart/opencart": "<=3.0.3.7", + "openid/php-openid": "<2.3", + "openmage/magento-lts": "<19.4.15|>=20,<20.0.13", + "orchid/platform": ">=9,<9.4.4", + "oro/commerce": ">=4.1,<5.0.6", + "oro/crm": ">=1.7,<1.7.4|>=3.1,<4.1.17|>=4.2,<4.2.7", + "oro/platform": ">=1.7,<1.7.4|>=3.1,<3.1.29|>=4.1,<4.1.17|>=4.2,<4.2.8", + "packbackbooks/lti-1-3-php-library": "<5", + "padraic/humbug_get_contents": "<1.1.2", + "pagarme/pagarme-php": ">=0,<3", + "pagekit/pagekit": "<=1.0.18", + "paragonie/random_compat": "<2", + "passbolt/passbolt_api": "<2.11", + "paypal/merchant-sdk-php": "<3.12", + "pear/archive_tar": "<1.4.14", + "pear/crypt_gpg": "<1.6.7", + "pegasus/google-for-jobs": "<1.5.1|>=2,<2.1.1", + "personnummer/personnummer": "<3.0.2", + "phanan/koel": "<5.1.4", + "phpfastcache/phpfastcache": "<6.1.5|>=7,<7.1.2|>=8,<8.0.7", + "phpmailer/phpmailer": "<6.5", + "phpmussel/phpmussel": ">=1,<1.6", + "phpmyadmin/phpmyadmin": "<5.1.3", + "phpmyfaq/phpmyfaq": "<=3.1.7", + "phpoffice/phpexcel": "<1.8", + "phpoffice/phpspreadsheet": "<1.16", + "phpseclib/phpseclib": "<2.0.31|>=3,<3.0.7", + "phpservermon/phpservermon": "<=3.5.2", + "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5,<5.6.3", + "phpwhois/phpwhois": "<=4.2.5", + "phpxmlrpc/extras": "<0.6.1", + "pimcore/data-hub": "<1.2.4", + "pimcore/pimcore": "<10.5.9", + "pocketmine/bedrock-protocol": "<8.0.2", + "pocketmine/pocketmine-mp": "<4.7.2|>= 4.0.0-BETA5, < 4.4.2", + "pressbooks/pressbooks": "<5.18", + "prestashop/autoupgrade": ">=4,<4.10.1", + "prestashop/blockwishlist": ">=2,<2.1.1", + "prestashop/contactform": ">=1.0.1,<4.3", + "prestashop/gamification": "<2.3.2", + "prestashop/prestashop": ">=1.6.0.10,<1.7.8.7", + "prestashop/productcomments": "<5.0.2", + "prestashop/ps_emailsubscription": "<2.6.1", + "prestashop/ps_facetedsearch": "<3.4.1", + "prestashop/ps_linklist": "<3.1", + "privatebin/privatebin": "<1.4", + "processwire/processwire": "<=3.0.200", + "propel/propel": ">=2-alpha.1,<=2-alpha.7", + "propel/propel1": ">=1,<=1.7.1", + "pterodactyl/panel": "<1.7", + "ptrofimov/beanstalk_console": "<1.7.14", + "pusher/pusher-php-server": "<2.2.1", + "pwweb/laravel-core": "<=0.3.6-beta", + "rainlab/debugbar-plugin": "<3.1", + "rankmath/seo-by-rank-math": "<=1.0.95", + "react/http": ">=0.7,<1.7", + "remdex/livehelperchat": "<3.99", + "rmccue/requests": ">=1.6,<1.8", + "robrichards/xmlseclibs": "<3.0.4", + "rudloff/alltube": "<3.0.3", + "s-cart/core": "<6.9", + "s-cart/s-cart": "<6.9", + "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", + "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", + "sensiolabs/connect": "<4.2.3", + "serluck/phpwhois": "<=4.2.6", + "shopware/core": "<=6.4.9", + "shopware/platform": "<=6.4.9", + "shopware/production": "<=6.3.5.2", + "shopware/shopware": "<=5.7.14", + "shopware/storefront": "<=6.4.8.1", + "shopxo/shopxo": "<2.2.6", + "showdoc/showdoc": "<2.10.4", + "silverstripe/admin": ">=1,<1.8.1", + "silverstripe/assets": ">=1,<1.10.1", + "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", + "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", + "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", + "silverstripe/framework": "<4.10.9", + "silverstripe/graphql": "<3.5.2|>=4-alpha.1,<4-alpha.2|= 4.0.0-alpha1", + "silverstripe/hybridsessions": ">=1,<2.4.1|>=2.5,<2.5.1", + "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", + "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", + "silverstripe/silverstripe-omnipay": "<2.5.2|>=3,<3.0.2|>=3.1,<3.1.4|>=3.2,<3.2.1", + "silverstripe/subsites": ">=2,<2.1.1", + "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", + "silverstripe/userforms": "<3", + "simple-updates/phpwhois": "<=1", + "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", + "simplesamlphp/simplesamlphp": "<1.18.6", + "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "simplito/elliptic-php": "<1.0.6", + "slim/slim": "<2.6", + "smarty/smarty": "<3.1.47|>=4,<4.2.1", + "snipe/snipe-it": "<6.0.11|>= 6.0.0-RC-1, <= 6.0.0-RC-5", + "socalnick/scn-social-auth": "<1.15.2", + "socialiteproviders/steam": "<1.1", + "spipu/html2pdf": "<5.2.4", + "spoonity/tcpdf": "<6.2.22", + "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", + "ssddanbrown/bookstack": "<22.2.3", + "statamic/cms": "<3.2.39|>=3.3,<3.3.2", + "stormpath/sdk": ">=0,<9.9.99", + "studio-42/elfinder": "<2.1.59", + "subrion/cms": "<=4.2.1", + "sulu/sulu": "= 2.4.0-RC1|<1.6.44|>=2,<2.2.18|>=2.3,<2.3.8", + "swiftmailer/swiftmailer": ">=4,<5.4.5", + "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", + "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", + "sylius/grid-bundle": "<1.10.1", + "sylius/paypal-plugin": ">=1,<1.2.4|>=1.3,<1.3.1", + "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", + "sylius/sylius": "<1.9.10|>=1.10,<1.10.11|>=1.11,<1.11.2", + "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", + "symbiote/silverstripe-queuedjobs": ">=3,<3.0.2|>=3.1,<3.1.4|>=4,<4.0.7|>=4.1,<4.1.2|>=4.2,<4.2.4|>=4.3,<4.3.3|>=4.4,<4.4.3|>=4.5,<4.5.1|>=4.6,<4.6.4", + "symbiote/silverstripe-versionedfiles": "<=2.0.3", + "symfont/process": ">=0,<4", + "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=5.3.14,<=5.3.14|>=5.4.3,<=5.4.3|>=6.0.3,<=6.0.3|= 6.0.3|= 5.4.3|= 5.3.14", + "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5|>=5.2,<5.3.12", + "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/maker-bundle": ">=1.27,<1.29.2|>=1.30,<1.31.1", + "symfony/mime": ">=4.3,<4.3.8", + "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/polyfill": ">=1,<1.10", + "symfony/polyfill-php55": ">=1,<1.10", + "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/routing": ">=2,<2.0.19", + "symfony/security": ">=2,<2.7.51|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.8", + "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11|>=5.3,<5.3.12", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.9", + "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.3.2", + "symfony/serializer": ">=2,<2.0.11|>=4.1,<4.4.35|>=5,<5.3.12", + "symfony/symfony": ">=2,<3.4.49|>=4,<4.4.35|>=5,<5.3.12|>=5.3.14,<=5.3.14|>=5.4.3,<=5.4.3|>=6.0.3,<=6.0.3", + "symfony/translation": ">=2,<2.0.17", + "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", + "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", + "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "t3/dce": ">=2.2,<2.6.2", + "t3g/svg-sanitizer": "<1.0.3", + "tastyigniter/tastyigniter": "<3.3", + "tecnickcom/tcpdf": "<6.2.22", + "terminal42/contao-tablelookupwizard": "<3.3.5", + "thelia/backoffice-default-template": ">=2.1,<2.1.2", + "thelia/thelia": ">=2.1-beta.1,<2.1.3", + "theonedemon/phpwhois": "<=4.2.5", + "thinkcmf/thinkcmf": "<=5.1.7", + "thorsten/phpmyfaq": "<3.1.8", + "tinymce/tinymce": "<5.10", + "titon/framework": ">=0,<9.9.99", + "tobiasbg/tablepress": "<= 2.0-RC1", + "topthink/framework": "<=6.0.13", + "topthink/think": "<=6.0.9", + "topthink/thinkphp": "<=3.2.3", + "tribalsystems/zenario": "<9.2.55826", + "truckersmp/phpwhois": "<=4.3.1", + "twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.38|>=9,<9.5.29|>=10,<10.4.32|>=11,<11.5.16", + "typo3/cms-backend": ">=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/cms-core": ">=6.2,<=6.2.56|>=7,<7.6.58|>=8,<8.7.48|>=9,<9.5.37|>=10,<10.4.32|>=11,<11.5.16", + "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", + "typo3/html-sanitizer": ">=1,<1.0.7|>=2,<2.0.16", + "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", + "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", + "typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", + "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10", + "ua-parser/uap-php": "<3.8", + "unisharp/laravel-filemanager": "<=2.5.1", + "userfrosting/userfrosting": ">=0.3.1,<4.6.3", + "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", + "vanilla/safecurl": "<0.9.2", + "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", + "vrana/adminer": "<4.8.1", + "wallabag/tcpdf": "<6.2.22", + "wanglelecc/laracms": "<=1.0.3", + "web-auth/webauthn-framework": ">=3.3,<3.3.4", + "webcoast/deferred-image-processing": "<1.0.2", + "wikimedia/parsoid": "<0.12.2", + "willdurand/js-translation-bundle": "<2.1.1", + "wintercms/winter": "<1.0.475|>=1.1,<1.1.10|>=1.2,<1.2.1", + "woocommerce/woocommerce": "<6.6", + "wp-cli/wp-cli": "<2.5", + "wp-graphql/wp-graphql": "<0.3.5", + "wpanel/wpanel4-cms": "<=4.3.1", + "wwbn/avideo": "<=11.6", + "yeswiki/yeswiki": "<4.1", + "yetiforce/yetiforce-crm": "<=6.4", + "yidashi/yii2cmf": "<=2", + "yii2mod/yii2-cms": "<1.9.2", + "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii2": "<2.0.38", + "yiisoft/yii2-bootstrap": "<2.0.4", + "yiisoft/yii2-dev": "<2.0.43", + "yiisoft/yii2-elasticsearch": "<2.0.5", + "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-jui": "<2.0.4", + "yiisoft/yii2-redis": "<2.0.8", + "yoast-seo-for-typo3/yoast_seo": "<7.2.3", + "yourls/yourls": "<=1.8.2", + "zendesk/zendesk_api_client_php": "<2.2.11", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", + "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", + "zendframework/zend-diactoros": "<1.8.4", + "zendframework/zend-feed": "<2.10.3", + "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-http": "<2.8.1", + "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", + "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", + "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", + "zendframework/zend-validator": ">=2.3,<2.3.6", + "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zendframework": "<=3", + "zendframework/zendframework1": "<1.12.20", + "zendframework/zendopenid": ">=2,<2.0.2", + "zendframework/zendxml": ">=1,<1.0.1", + "zetacomponents/mail": "<1.8.2", + "zf-commons/zfc-user": "<1.2.2", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", + "zfr/zfr-oauth2-server-module": "<0.1.2", + "zoujingli/thinkadmin": "<6.0.22" + }, + "default-branch": true, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "role": "maintainer" + }, + { + "name": "Ilya Tribusean", + "email": "slash3b@gmail.com", + "role": "maintainer" + } + ], + "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", + "support": { + "issues": "https://github.com/Roave/SecurityAdvisories/issues", + "source": "https://github.com/Roave/SecurityAdvisories/tree/latest" + }, + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", + "type": "tidelift" + } + ], + "time": "2022-11-04T21:04:09+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -9662,7 +10491,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "roave/security-advisories": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..c557baea2b44e3393ab3b217d131d5a95de72641 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,85 @@ +# For more information: https://laravel.com/docs/sail +version: '3' +services: + laravel.test: + build: + context: ./vendor/laravel/sail/runtimes/8.1 + dockerfile: Dockerfile + args: + WWWGROUP: '${WWWGROUP}' + image: sail-8.1/app + extra_hosts: + - 'host.docker.internal:host-gateway' + ports: + - '${APP_PORT:-80}:80' + - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' + environment: + WWWUSER: '${WWWUSER:-1000}' + WWGROUP: '${WWGROUP:-1000}' + LARAVEL_SAIL: 1 + XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' + XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' + volumes: + - '.:/var/www/html' + networks: + - sail + depends_on: + - mysql + # - redis + - mailhog + # - selenium + mysql: + image: 'mysql/mysql-server:8.0' + ports: + - '${FORWARD_DB_PORT:-3306}:3306' + environment: + MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' + MYSQL_ROOT_HOST: "%" + MYSQL_DATABASE: '${DB_DATABASE}' + MYSQL_USER: '${DB_USERNAME}' + MYSQL_PASSWORD: '${DB_PASSWORD}' + MYSQL_ALLOW_EMPTY_PASSWORD: 1 + volumes: + - 'sail-mysql:/var/lib/mysql' + - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' + networks: + - sail + healthcheck: + test: [ "CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}" ] + retries: 3 + timeout: 5s + # redis: + # image: 'redis:alpine' + # ports: + # - '${FORWARD_REDIS_PORT:-6379}:6379' + # volumes: + # - 'sail-redis:/data' + # networks: + # - sail + # healthcheck: + # test: ["CMD", "redis-cli", "ping"] + # retries: 3 + # timeout: 5s + mailhog: + image: 'mailhog/mailhog:latest' + ports: + - '${FORWARD_MAILHOG_PORT:-1025}:1025' + - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025' + networks: + - sail +# selenium: +# image: 'selenium/standalone-chrome' +# extra_hosts: +# - 'host.docker.internal:host-gateway' +# volumes: +# - '/dev/shm:/dev/shm' +# networks: +# - sail +networks: + sail: + driver: bridge +volumes: + sail-mysql: + driver: local +# sail-redis: +# driver: local diff --git a/lang/fr/exports.php b/lang/fr/exports.php new file mode 100644 index 0000000000000000000000000000000000000000..537873832f78dabf2fd97369018ad7752686a28c --- /dev/null +++ b/lang/fr/exports.php @@ -0,0 +1,115 @@ +<?php + +return [ + 'organization' => [ + 'name' => 'nom de la collectivité', + 'shortName' => 'nom court', + 'territory' => 'libellé territoire', + 'type' => 'type de structure', + 'insee' => 'insee', + 'siren' => 'siren', + 'active' => 'actif', + 'website' => 'site internet', + 'info' => 'infos complémentaire', + 'fullAddress' => 'adresse', + 'referent' => 'référent', + 'referentElu' => 'référent élu', + 'referentCyber' => 'référent cyber', + 'lastEvaluation' => [ + 'cyberMaturity' => 'score indice maturité cyber', + 'reference' => 'version du référentiel', + 'updatedBy' => 'évaluation modifiée par', + 'author' => 'évaluation crée par', + ], + 'previousEvaluation' => [ + 'cyberMaturity' => 'score indice maturité cyber n-1', + ], + 'measure1' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 1', + 'expectedLevel' => 'niveau de planification mesure 1', + ], + 'measure2' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 2', + 'expectedLevel' => 'niveau de planification mesure 2', + ], + 'measure3' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 3', + 'expectedLevel' => 'niveau de planification mesure 3', + ], + 'measure4' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 4', + 'expectedLevel' => 'niveau de planification mesure 4', + ], + 'measure5' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 5', + 'expectedLevel' => 'niveau de planification mesure 5', + ], + 'measure6' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 6', + 'expectedLevel' => 'niveau de planification mesure 6', + ], + 'measure7' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 7', + 'expectedLevel' => 'niveau de planification mesure 7', + ], + 'measure8' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 8', + 'expectedLevel' => 'niveau de planification mesure 8', + ], + 'measure9' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 9', + 'expectedLevel' => 'niveau de planification mesure 9', + ], + 'measure10' => [ + 'actualLevel' => 'niveau de mise en œuvre mesure 10', + 'expectedLevel' => 'niveau de planification mesure 10', + ], + 'executionLevel' => "niveau d'exécution", + 'createdDate' => 'date création de la collectivité', + + 'dangerLevel1' => 'perception du danger 1', + 'dangerLevel2' => 'perception du danger 2', + 'dangerLevel3' => 'perception du danger 3', + 'dangerLevel4' => 'perception du danger 4', + 'dangerLevel5' => 'perception du danger 5', + 'dangerLevel6' => 'perception du danger 6', + + 'maturityLevel' => [ + 'knowledge' => 'niveau de connaissance', + 'organization' => 'niveau de organisation', + 'motivation' => 'niveau de motivation', + ], + + 'alert' => 'alerte seuil dépassé', + ], + 'evaluation' => [ + 'organizationId' => 'Collectivité id', + 'updatedDate' => 'Date de modification', + 'updatedBy' => 'Modifié par', + 'reference' => 'Référentiel', + 'status' => 'Statut de l’évaluation', + 'statusDangers' => 'Statut Dangers', + 'dangerLevel_1' => 'Perception Danger 1', + 'dangerLevel_2' => 'Perception Danger 2', + 'dangerLevel_3' => 'Perception Danger 3', + 'dangerLevel_4' => 'Perception Danger 4', + 'dangerLevel_5' => 'Perception Danger 5', + 'dangerLevel_6' => 'Perception Danger 6', + 'q1' => 'Q1', + 'q2' => 'Q2', + 'q3' => 'Q3', + 'q4' => 'Q4', + 'q5' => 'Q5', + 'q6' => 'Q6', + 'q7' => 'Q7', + 'q8' => 'Q8', + 'q9' => 'Q9', + 'q10' => 'Q10', + 'actionPlan' => 'Plan d’action', + 'motivation' => 'Motivation', + 'execution' => 'Exection', + 'fundamental' => 'Fondamentaux', + 'organization' => 'Organisation', + 'maturityCyber' => 'Indice de maturité', + ], +]; diff --git a/resources/js/components/Dashboard/AdminView/Components/Exports.vue b/resources/js/components/Dashboard/AdminView/Components/Exports.vue index 51a3e8bc06a2350b869a524449d0475c29620960..422a08b4873337ba9ff4f30562d5975128e1165a 100644 --- a/resources/js/components/Dashboard/AdminView/Components/Exports.vue +++ b/resources/js/components/Dashboard/AdminView/Components/Exports.vue @@ -3,7 +3,7 @@ <div class="col-md-6"> <div class="card"> <div class="card-body">Exporter les évaluations</div> - <a href="#"> + <a href="/export/evaluations.xlsx"> <div class="card-footer bg-primary p-1 text-center"> Exporter <i class="fas fa-arrow-circle-right"></i> </div> @@ -14,12 +14,12 @@ <div class="card"> <div class="card-body ">Exporter les structures</div> - <a href="#"> + <a href="/export/structures.xlsx"> <div class="card-footer bg-primary p-1 text-center"> Exporter <i class="fas fa-arrow-circle-right"></i> </div> </a> - + </div> </div> </div> @@ -27,14 +27,11 @@ <script> export default { - name: 'ActionTerritory', - props : [], - data () { - return { - } + name: 'Export', + props: [], + data() { + return {} }, - computed: { - - } + computed: {} } -</script> \ No newline at end of file +</script> diff --git a/resources/js/components/Dashboard/AdminView/index.vue b/resources/js/components/Dashboard/AdminView/index.vue index 95c64640d8c669efb78a43ed5fc8a3d706a03dbc..0067945207c719120e0471ef2c1d491403b181bf 100644 --- a/resources/js/components/Dashboard/AdminView/index.vue +++ b/resources/js/components/Dashboard/AdminView/index.vue @@ -21,9 +21,9 @@ <div class="col-md-12"> <OrganizationsAlert /> </div> - <!-- <div class="col-md-12"> - <Exports /> - </div> --> + <div class="col-md-12"> + <Exports/> + </div> <div class="col-md-12"> <MaturityCyberByTerritory /> </div> @@ -45,7 +45,7 @@ export default { ActionTerritory: () => import('./Components/ActionTerritory.vue'), MeasuresInAction: () => import('./Components/MeasuresInAction.vue'), OrganizationsAlert: () => import('./Components/OrganizationsAlert.vue'), - // Exports: () => import('./Components/Exports.vue'), + Exports: () => import('./Components/Exports.vue'), MaturityCyberByTerritory: () => import('./Components/MaturityCyberByTerritory.vue'), MeasurePlanned: () => import('./Components/MeasurePlanned.vue'), }, diff --git a/routes/web.php b/routes/web.php index e2c830861cea63c2a64a7251bb55310d111ce789..4bee61f4a6afc01e317e88ad46b4d1e8a59030fb 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use App\Http\Controllers\Auth\LoginController; use App\Http\Controllers\Auth\LogoutController; +use App\Http\Controllers\ExportController; use App\Http\Controllers\PdfController; use App\Http\Controllers\UsersController; use Illuminate\Support\Facades\Auth; @@ -32,6 +33,15 @@ Route::post('/newpassword', [UsersController::class, 'storePassword'])->name('password_reset.send'); Route::get('/newpassword/{id}/{reset_token}', [UsersController::class, 'createPassword'])->name('password_reset'); +Route::middleware('auth:sanctum')->group(function () { + Route::prefix('/export')->group(function () { + Route::get('/structures.{ext}', [ExportController::class, 'organizations']) + ->whereIn('ext', ['csv', 'xlsx', 'json'])->name('export.organizations'); + Route::get('/evaluations.{ext}', [ExportController::class, 'evaluations']) + ->whereIn('ext', ['csv', 'xlsx', 'json'])->name('export.evaluations'); + }); +}); + Route::middleware('auth:sanctum')->prefix('/pdf')->group(function () { Route::get('/planAction/{organization_id}', [PdfController::class, 'ActionPlanPdf'])->name('pdf.plan_action'); Route::get('/politiqueSecurite/{organization_id}', [PdfController::class, 'PolitiqueSecuritePdf'])->name('pdf.politique_securite'); diff --git a/tests/Feature/ExportControllerTest.php b/tests/Feature/ExportControllerTest.php new file mode 100644 index 0000000000000000000000000000000000000000..54370381550c2b66e1e49b43f30f45070da6d876 --- /dev/null +++ b/tests/Feature/ExportControllerTest.php @@ -0,0 +1,51 @@ +<?php + +namespace Tests\Feature; + +use App\Models\Evaluation; +use App\Models\Organization; +use App\Models\User; +use Illuminate\Contracts\Auth\Authenticatable; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Testing\TestResponse; +use Tests\TestCase; + +class ExportControllerTest extends TestCase +{ + use RefreshDatabase; + + /** + * Test organizations export. + */ + public function testExportOrganizations(): void + { + /** @var Authenticatable $user */ + $user = User::with('organization')->first(); + $response = $this->actingAs($user)->get(route('export.organizations', ['ext' => 'json'])); + $this->_testJsonExportResponse($response, Organization::count()); + } + + /** + * Test evaluations export. + */ + public function testExportEvaluations(): void + { + /** @var Authenticatable $user */ + $user = User::with('organization')->first(); + $response = $this->actingAs($user)->get(route('export.evaluations', ['ext' => 'json'])); + $this->_testJsonExportResponse($response, Evaluation::count()); + } + + private function _testJsonExportResponse(TestResponse $response, int $expectedLineCount): void + { + if ($response->exception) { + dump($response->exception); + } + $response->assertOk(); + + $content = $response->json(); + self::assertGreaterThan(0, count($content['header'])); + self::assertSameSize($content['header'], $content['rows'][0]); + self::assertCount($expectedLineCount, $content['rows']); + } +}