diff --git a/composer.lock b/composer.lock index 5e1d8321555ada133efac3da45932d46d9570d0a..266eff67f55f5fa464df81ecdbfddbb94b341049 100755 --- a/composer.lock +++ b/composer.lock @@ -1952,22 +1952,22 @@ }, { "name": "ramsey/uuid", - "version": "3.9.4", + "version": "3.9.6", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "be2451bef8147b7352a28fb4cddb08adc497ada3" + "reference": "ffa80ab953edd85d5b6c004f96181a538aad35a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/be2451bef8147b7352a28fb4cddb08adc497ada3", - "reference": "be2451bef8147b7352a28fb4cddb08adc497ada3", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/ffa80ab953edd85d5b6c004f96181a538aad35a3", + "reference": "ffa80ab953edd85d5b6c004f96181a538aad35a3", "shasum": "" }, "require": { "ext-json": "*", "paragonie/random_compat": "^1 | ^2 | ^9.99.99", - "php": "^5.4 | ^7 | ^8", + "php": "^5.4 | ^7.0 | ^8.0", "symfony/polyfill-ctype": "^1.8" }, "replace": { @@ -1976,14 +1976,16 @@ "require-dev": { "codeception/aspect-mock": "^1 | ^2", "doctrine/annotations": "^1.2", - "goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1", - "jakub-onderka/php-parallel-lint": "^1", + "goaop/framework": "1.0.0-alpha.2 | ^1 | >=2.1.0 <=2.3.2", "mockery/mockery": "^0.9.11 | ^1", "moontoast/math": "^1.1", + "nikic/php-parser": "<=4.5.0", "paragonie/random-lib": "^2", - "php-mock/php-mock-phpunit": "^0.3 | ^1.1", - "phpunit/phpunit": "^4.8 | ^5.4 | ^6.5", - "squizlabs/php_codesniffer": "^3.5" + "php-mock/php-mock-phpunit": "^0.3 | ^1.1 | ^2.6", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpunit/phpunit": ">=4.8.36 <9.0.0 | >=9.3.0", + "squizlabs/php_codesniffer": "^3.5", + "yoast/phpunit-polyfills": "^1.0" }, "suggest": { "ext-ctype": "Provides support for PHP Ctype functions", @@ -2045,7 +2047,7 @@ "type": "tidelift" } ], - "time": "2021-08-06T20:32:15+00:00" + "time": "2021-09-25T23:07:42+00:00" }, { "name": "setasign/fpdi", @@ -2896,7 +2898,7 @@ "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/siham.git", - "reference": "5eecac4aa6ecc069cc31dcecbd10731aad9d194a" + "reference": "9ae9dbd52629b1a01ccb647307b1aa7cf07086e4" }, "require": { "zendframework/zend-mail": "^2.10", @@ -2921,7 +2923,7 @@ } ], "description": "PHP library for SIHAM webservices", - "time": "2021-09-24T08:30:23+00:00" + "time": "2021-09-27T08:51:32+00:00" }, { "name": "unicaen/tbl", @@ -6965,16 +6967,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.20", + "version": "8.5.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9deefba183198398a09b927a6ac6bc1feb0b7b70" + "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9deefba183198398a09b927a6ac6bc1feb0b7b70", - "reference": "9deefba183198398a09b927a6ac6bc1feb0b7b70", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", + "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", "shasum": "" }, "require": { @@ -7054,7 +7056,7 @@ "type": "github" } ], - "time": "2021-08-31T06:44:38+00:00" + "time": "2021-09-25T07:37:20+00:00" }, { "name": "sabre/event", diff --git a/module/ExportRh/src/Controller/ExportRhController.php b/module/ExportRh/src/Controller/ExportRhController.php index 8284ec2bc00b69ba2eb41f1c688b0c7b1a0718fd..1352cfaccff8fecefa635e6b7b83c4cc8028cda7 100644 --- a/module/ExportRh/src/Controller/ExportRhController.php +++ b/module/ExportRh/src/Controller/ExportRhController.php @@ -35,6 +35,7 @@ class ExportRhController extends AbstractController public function __construct(ExportRhService $exportRhService) { + $this->exportRhService = $exportRhService; } @@ -122,8 +123,10 @@ class ExportRhController extends AbstractController */ try { + $excludeStatut = $this->exportRhService->getExcludeStatutOse(); + - if ($intervenant->getStatut()->getCode() != 'BIATSS' && $typeIntervenant != 'P') { + if (!array_key_exists($intervenant->getStatut()->getCode(), $this->exportRhService->getExcludeStatutOse()) && $typeIntervenant != 'P') { $intervenantRh = $this->exportRhService->getIntervenantRh($intervenant); } @@ -167,7 +170,8 @@ class ExportRhController extends AbstractController 'priseEnCharge', 'nameConnecteur', 'affectationEnCours', - 'contratEnCours')); + 'contratEnCours', + 'excludeStatut')); return $vm; } diff --git a/module/ExportRh/src/Service/ExportRhService.php b/module/ExportRh/src/Service/ExportRhService.php index 494205313d4a8368827afbafa9c3cb2f5ba5cf96..9f494cedc5b048c95f40e050d4e47bd4aec9ca5d 100644 --- a/module/ExportRh/src/Service/ExportRhService.php +++ b/module/ExportRh/src/Service/ExportRhService.php @@ -9,6 +9,7 @@ use Application\Service\Traits\AnneeServiceAwareTrait; use Application\Service\Traits\IntervenantServiceAwareTrait; use Application\Service\Traits\ParametresServiceAwareTrait; use ExportRh\Entity\IntervenantRHExportParams; +use phpDocumentor\Reflection\Types\Array_; use Zend\Form\Fieldset; /** @@ -30,11 +31,14 @@ class ExportRhService extends AbstractService protected $connecteur; + protected $config; - public function __construct($connecteur) + + public function __construct($connecteur, $config) { $this->connecteur = $connecteur; + $this->config = $config; } @@ -194,4 +198,16 @@ class ExportRhService extends AbstractService return $this->getServiceAnnee()->get($annee); } + + + public function getExcludeStatutOse(): array + { + $config = $this->config; + if (array_key_exists('exclude-statut-ose', $config)) { + return $config['exclude-statut-ose']; + } + + return []; + } + } \ No newline at end of file diff --git a/module/ExportRh/src/Service/ExportRhServiceFactory.php b/module/ExportRh/src/Service/ExportRhServiceFactory.php index 1eaeac0848b08ec06778d92f7a4063029d1f144e..1481183de9f1490b10c95f84a2082e0d99a379ba 100644 --- a/module/ExportRh/src/Service/ExportRhServiceFactory.php +++ b/module/ExportRh/src/Service/ExportRhServiceFactory.php @@ -31,7 +31,7 @@ class ExportRhServiceFactory break; } - $service = new ExportRhService($connecteur); + $service = new ExportRhService($connecteur, $config['unicaen-siham']); return $service; } diff --git a/module/ExportRh/view/export-rh/export-rh/exporter.phtml b/module/ExportRh/view/export-rh/export-rh/exporter.phtml index 3aa87825b9df4d5e87b76970fd36a11acb5813fd..603ec21f68071fb1731eb0946a74c0e0b39898e9 100755 --- a/module/ExportRh/view/export-rh/export-rh/exporter.phtml +++ b/module/ExportRh/view/export-rh/export-rh/exporter.phtml @@ -23,9 +23,9 @@ if ($priseEnCharge) { <?php echo $this->messenger()->addCurrentMessagesFromFlashMessenger(); ?> - <?php if ($typeIntervenant == 'P' || $intervenant->getStatut()->getCode() == 'BIATSS'): ?> + <?php if ($typeIntervenant == 'P' || array_key_exists($intervenant->getStatut()->getCode(), $excludeStatut)): ?> <div class="messenger alert alert-warning"> - L'export des données intervenants vers <?= $nameConnecteur; ?> est disponible uniquement pour les vacataires (hors BIATSS) + L'export des données intervenants vers <?= $nameConnecteur; ?> est disponible uniquement pour les vacataires (hors <?= implode(', ', $excludeStatut) ?> ) </div> <?php elseif ($haveContratOse === false): ?> <div class="messenger alert alert-warning">