diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf2e67c833b44e059c4efdb831c2006ff248cf2..33639af89a8878b464414d0989519d417b0c3a9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ Journal des modifications ========================= +5.2.9 +----- +- Masquage des membres du CSI et de leurs saisies +- Formation : Amélioration de l'affichage de la liste des inscrits (état de la session, état de la saisie de l'enquête) +- Formation : La génération du pdf d'attestion est maintenant bloquée si l'enquête est non saisie +- Formation : Ajout d'un interval pour la date butoir dans la Session et affichage sur l'index du doctorant +- Formation : Passage sous la forme de template des PDFs de convocation et d'attestation +- Soutenance : Passage des courriers électroniques liés à l'engagement d'impartialité dans UnicaenRenderer +- [FIX] Soutenance : La génération de rapport de soutenance n'est plus limitée au fait q'un membre soit en visio + 5.2.8 ----- - Second dépôt (correction de thèse) : améliorations et nouvelle notification (MDD, BU, DT). diff --git a/composer.json b/composer.json index 7f8ed324ea8448f3141c229eb71475b2a0e6dda3..24cd297d93e3020aa69453cf4b9050ce030b00be 100755 --- a/composer.json +++ b/composer.json @@ -37,13 +37,12 @@ "unicaen/auth": "^5.1", "unicaen/auth-token": "^5.0", "unicaen/bjy-authorize": "^4.0", - "unicaen/db-anonym": "dev-master", "unicaen/db-import": "^5.2", - "unicaen/livelog": "dev-master", "unicaen/faq": "^5.0", "unicaen/ldap": "^4.0", + "unicaen/parametre": "^5.0", "unicaen/renderer": "^5.0", - "unicaen/pdf": "^4.0", + "unicaen/pdf": "5.0.1", "webmozart/assert": "^1.3", "laminas/laminas-feed": "^2.12", "laminas/laminas-soap": "^2.8", diff --git a/composer.lock b/composer.lock index 459069a4a6980470ac15b47848667cb90c97ff4f..64af755691e673ed79a91895d694775fefb1f23a 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": "11134d86edcc725657176b6b3452c53c", + "content-hash": "53760c0958ccceec4ee83b75fbbe980c", "packages": [ { "name": "aws/aws-crt-php", @@ -58,16 +58,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.253.2", + "version": "3.258.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "0f0e24bfae22edcdd62bcaedaff9610f8a328952" + "reference": "ed1bede7fe80a5e1528d6cff530341ad2018a128" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0f0e24bfae22edcdd62bcaedaff9610f8a328952", - "reference": "0f0e24bfae22edcdd62bcaedaff9610f8a328952", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/ed1bede7fe80a5e1528d6cff530341ad2018a128", + "reference": "ed1bede7fe80a5e1528d6cff530341ad2018a128", "shasum": "" }, "require": { @@ -146,9 +146,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.253.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.258.2" }, - "time": "2022-12-14T19:25:13+00:00" + "time": "2023-02-02T19:41:58+00:00" }, { "name": "beberlei/assert", @@ -211,16 +211,16 @@ }, { "name": "brick/varexporter", - "version": "0.3.7", + "version": "0.3.8", "source": { "type": "git", "url": "https://github.com/brick/varexporter.git", - "reference": "3e263cd718d242594c52963760fee2059fd5833c" + "reference": "b5853edea6204ff8fa10633c3a4cccc4058410ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/varexporter/zipball/3e263cd718d242594c52963760fee2059fd5833c", - "reference": "3e263cd718d242594c52963760fee2059fd5833c", + "url": "https://api.github.com/repos/brick/varexporter/zipball/b5853edea6204ff8fa10633c3a4cccc4058410ed", + "reference": "b5853edea6204ff8fa10633c3a4cccc4058410ed", "shasum": "" }, "require": { @@ -248,7 +248,7 @@ ], "support": { "issues": "https://github.com/brick/varexporter/issues", - "source": "https://github.com/brick/varexporter/tree/0.3.7" + "source": "https://github.com/brick/varexporter/tree/0.3.8" }, "funding": [ { @@ -256,7 +256,7 @@ "type": "github" } ], - "time": "2022-06-29T23:37:57+00:00" + "time": "2023-01-21T23:05:38+00:00" }, { "name": "cboden/ratchet", @@ -396,16 +396,16 @@ }, { "name": "doctrine/annotations", - "version": "1.14.1", + "version": "1.14.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51" + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/9e034d7a70032d422169f27d8759e8d84abb4f51", - "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", "shasum": "" }, "require": { @@ -466,9 +466,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.1" + "source": "https://github.com/doctrine/annotations/tree/1.14.3" }, - "time": "2022-12-12T12:46:12+00:00" + "time": "2023-02-01T09:20:38+00:00" }, { "name": "doctrine/cache", @@ -1392,30 +1392,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -1442,7 +1442,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -1458,7 +1458,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", @@ -1855,74 +1855,6 @@ }, "time": "2017-07-23T21:35:13+00:00" }, - { - "name": "fakerphp/faker", - "version": "v1.21.0", - "source": { - "type": "git", - "url": "https://github.com/FakerPHP/Faker.git", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/92efad6a967f0b79c499705c69b662f738cc9e4d", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0", - "psr/container": "^1.0 || ^2.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "conflict": { - "fzaninotto/faker": "*" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "doctrine/persistence": "^1.3 || ^2.0", - "ext-intl": "*", - "phpunit/phpunit": "^9.5.26", - "symfony/phpunit-bridge": "^5.4.16" - }, - "suggest": { - "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", - "ext-curl": "Required by Faker\\Provider\\Image to download images.", - "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", - "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", - "ext-mbstring": "Required for multibyte Unicode string functionality." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.21.0" - }, - "time": "2022-12-13T13:54:32+00:00" - }, { "name": "guzzlehttp/guzzle", "version": "6.5.8", @@ -3749,28 +3681,28 @@ }, { "name": "laminas/laminas-dependency-plugin", - "version": "2.2.0", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-dependency-plugin.git", - "reference": "73cfb63ddca9d6bfedad5e0a038f6d55063975a3" + "reference": "9f75aa145ea21bed5fef8dbbabf930430fbcddbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-dependency-plugin/zipball/73cfb63ddca9d6bfedad5e0a038f6d55063975a3", - "reference": "73cfb63ddca9d6bfedad5e0a038f6d55063975a3", + "url": "https://api.github.com/repos/laminas/laminas-dependency-plugin/zipball/9f75aa145ea21bed5fef8dbbabf930430fbcddbd", + "reference": "9f75aa145ea21bed5fef8dbbabf930430fbcddbd", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1 || ^2.0", - "php": "^7.3 || ~8.0.0 || ~8.1.0" + "composer-plugin-api": ">=1.1.0 <2.3.0", + "php": "^7.4 || ~8.0.0 || ~8.1.0" }, "require-dev": { - "composer/composer": "^1.9 || ^2.0", - "laminas/laminas-coding-standard": "^2.2.1", - "mikey179/vfsstream": "^1.6.10@alpha", + "composer/composer": ">=1.9.0 <2.3.0", + "laminas/laminas-coding-standard": "~2.4.0", + "mikey179/vfsstream": "^1.6.11", "phpunit/phpunit": "^9.5.5", - "psalm/plugin-phpunit": "^0.15.1", + "psalm/plugin-phpunit": "^0.17.0", "roave/security-advisories": "dev-master", "vimeo/psalm": "^4.5" }, @@ -3790,7 +3722,7 @@ "description": "Replace zendframework and zfcampus packages with their Laminas Project equivalents.", "support": { "issues": "https://github.com/laminas/laminas-dependency-plugin/issues", - "source": "https://github.com/laminas/laminas-dependency-plugin/tree/2.2.0" + "source": "https://github.com/laminas/laminas-dependency-plugin/tree/2.4.0" }, "funding": [ { @@ -3798,7 +3730,7 @@ "type": "community_bridge" } ], - "time": "2021-09-08T17:51:35+00:00" + "time": "2022-09-12T19:05:50+00:00" }, { "name": "laminas/laminas-development-mode", @@ -7075,16 +7007,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.2", + "version": "v4.15.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -7125,9 +7057,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2022-11-12T15:38:23+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "ocramius/proxy-manager", @@ -7620,16 +7552,16 @@ }, { "name": "ramsey/uuid", - "version": "3.9.6", + "version": "3.9.7", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "ffa80ab953edd85d5b6c004f96181a538aad35a3" + "reference": "dc75aa439eb4c1b77f5379fd958b3dc0e6014178" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/ffa80ab953edd85d5b6c004f96181a538aad35a3", - "reference": "ffa80ab953edd85d5b6c004f96181a538aad35a3", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/dc75aa439eb4c1b77f5379fd958b3dc0e6014178", + "reference": "dc75aa439eb4c1b77f5379fd958b3dc0e6014178", "shasum": "" }, "require": { @@ -7666,11 +7598,6 @@ "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "autoload": { "files": [ "src/functions.php" @@ -7721,7 +7648,7 @@ "type": "tidelift" } ], - "time": "2021-09-25T23:07:42+00:00" + "time": "2022-12-19T21:55:10+00:00" }, { "name": "ratchet/rfc6455", @@ -8409,16 +8336,16 @@ }, { "name": "symfony/console", - "version": "v5.4.16", + "version": "v5.4.19", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef" + "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", + "url": "https://api.github.com/repos/symfony/console/zipball/dccb8d251a9017d5994c988b034d3e18aaabf740", + "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740", "shasum": "" }, "require": { @@ -8488,7 +8415,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.16" + "source": "https://github.com/symfony/console/tree/v5.4.19" }, "funding": [ { @@ -8504,7 +8431,7 @@ "type": "tidelift" } ], - "time": "2022-11-25T14:09:27+00:00" + "time": "2023-01-01T08:32:19+00:00" }, { "name": "symfony/deprecation-contracts", @@ -8575,16 +8502,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.4.16", + "version": "v5.4.20", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "5032c5849aef24741e1970cb03511b0dd131d838" + "reference": "d0435363362a47c14e9cf50663cb8ffbf491875a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5032c5849aef24741e1970cb03511b0dd131d838", - "reference": "5032c5849aef24741e1970cb03511b0dd131d838", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0435363362a47c14e9cf50663cb8ffbf491875a", + "reference": "d0435363362a47c14e9cf50663cb8ffbf491875a", "shasum": "" }, "require": { @@ -8631,7 +8558,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.16" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.20" }, "funding": [ { @@ -8647,7 +8574,7 @@ "type": "tidelift" } ], - "time": "2022-11-07T08:06:40+00:00" + "time": "2023-01-29T11:11:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -9306,16 +9233,16 @@ }, { "name": "symfony/routing", - "version": "v5.4.15", + "version": "v5.4.19", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "5c9b129efe9abce9470e384bf65d8a7e262eee69" + "reference": "df1b28f37c8e78912213c58ef6ab2f2037bbfdc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/5c9b129efe9abce9470e384bf65d8a7e262eee69", - "reference": "5c9b129efe9abce9470e384bf65d8a7e262eee69", + "url": "https://api.github.com/repos/symfony/routing/zipball/df1b28f37c8e78912213c58ef6ab2f2037bbfdc5", + "reference": "df1b28f37c8e78912213c58ef6ab2f2037bbfdc5", "shasum": "" }, "require": { @@ -9330,7 +9257,7 @@ "symfony/yaml": "<4.4" }, "require-dev": { - "doctrine/annotations": "^1.12", + "doctrine/annotations": "^1.12|^2", "psr/log": "^1|^2|^3", "symfony/config": "^5.3|^6.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", @@ -9376,7 +9303,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.15" + "source": "https://github.com/symfony/routing/tree/v5.4.19" }, "funding": [ { @@ -9392,7 +9319,7 @@ "type": "tidelift" } ], - "time": "2022-10-13T14:10:41+00:00" + "time": "2023-01-01T08:32:19+00:00" }, { "name": "symfony/service-contracts", @@ -9479,16 +9406,16 @@ }, { "name": "symfony/string", - "version": "v5.4.15", + "version": "v5.4.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed" + "reference": "0a01071610fd861cc160dfb7e2682ceec66064cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", + "url": "https://api.github.com/repos/symfony/string/zipball/0a01071610fd861cc160dfb7e2682ceec66064cb", + "reference": "0a01071610fd861cc160dfb7e2682ceec66064cb", "shasum": "" }, "require": { @@ -9545,7 +9472,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.15" + "source": "https://github.com/symfony/string/tree/v5.4.19" }, "funding": [ { @@ -9561,20 +9488,20 @@ "type": "tidelift" } ], - "time": "2022-10-05T15:16:54+00:00" + "time": "2023-01-01T08:32:19+00:00" }, { "name": "twig/twig", - "version": "v3.4.3", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58" + "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3ffcf4b7d890770466da3b2666f82ac054e7ec72", + "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72", "shasum": "" }, "require": { @@ -9589,7 +9516,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.5-dev" } }, "autoload": { @@ -9625,7 +9552,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.3" + "source": "https://github.com/twigphp/Twig/tree/v3.5.0" }, "funding": [ { @@ -9637,7 +9564,7 @@ "type": "tidelift" } ], - "time": "2022-09-28T08:42:51+00:00" + "time": "2022-12-27T12:28:18+00:00" }, { "name": "unicaen/alerte", @@ -9690,11 +9617,11 @@ }, { "name": "unicaen/app", - "version": "5.1.6", + "version": "5.1.7", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/app.git", - "reference": "db8308362d461b6e137871056416100153343f7e" + "reference": "2fe32e5dbe47b6e6315e9631239a5a8b561cfeb8" }, "require": { "beberlei/assert": "^2.9", @@ -9750,7 +9677,7 @@ ] }, "description": "Module de base des applications unicaen", - "time": "2022-11-29T11:30:07+00:00" + "time": "2023-01-26T08:37:08+00:00" }, { "name": "unicaen/auth", @@ -9874,43 +9801,13 @@ ], "time": "2021-12-10T09:24:28+00:00" }, - { - "name": "unicaen/db-anonym", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://git.unicaen.fr/lib/unicaen/db-anonym.git", - "reference": "e77ca1026c2e53e72873ef918d60a15a60d10057" - }, - "require": { - "fakerphp/faker": "^1.20", - "php": "^7.0 || ^8.0", - "unicaen/app": "^4.0 || ^5.0", - "webmozart/assert": "^1.11" - }, - "require-dev": { - "laminas/laminas-test": "^4.0", - "phpunit/phpunit": "^8.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "UnicaenDbAnonym": "src/" - }, - "classmap": [ - "./Module.php" - ] - }, - "description": "Module pour anonymiser les données d'une bdd", - "time": "2022-12-15T12:20:21+00:00" - }, { "name": "unicaen/db-import", - "version": "5.2.2", + "version": "5.2.3", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/db-import.git", - "reference": "0ad7c2e7a9de4499d03c1d519a3b8f55bc37e665" + "reference": "47c652f5a82db1f78c77a01c9c5255652c4ac3a3" }, "require": { "beberlei/assert": "^2.7", @@ -9921,7 +9818,7 @@ "monolog/monolog": "^2.3", "ramsey/uuid": "^3.6", "unicaen/app": "^4.0 || ^5.0", - "unicaen/livelog": "dev-master" + "unicaen/livelog": "^2.0" }, "require-dev": { "phpunit/phpunit": "~5.4", @@ -9942,7 +9839,7 @@ } }, "description": "Module d'import entre bases de données", - "time": "2022-09-07T13:21:58+00:00" + "time": "2023-01-27T09:06:15+00:00" }, { "name": "unicaen/faq", @@ -10013,11 +9910,11 @@ }, { "name": "unicaen/livelog", - "version": "dev-master", + "version": "2.0.1", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/livelog.git", - "reference": "8dc3c80b8512ac1bee1948fb9c0bdb355cb8256a" + "reference": "0ceb699fd914275f3851d18607d76a791ed9088d" }, "require": { "cboden/ratchet": "^0.4.4", @@ -10042,15 +9939,37 @@ ] }, "description": "Module permettant d'afficher des logs en live à l'aide d'une websocket (et d'une socket)", - "time": "2022-12-15T12:24:44+00:00" + "time": "2023-01-27T09:51:22+00:00" + }, + { + "name": "unicaen/parametre", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://git.unicaen.fr/lib/unicaen/parametre.git", + "reference": "04311ff04b56bda07cb67eeed3d0757f0e50027a" + }, + "require": { + "unicaen/app": "^5", + "unicaen/privilege": "^5" + }, + "type": "library", + "autoload": { + "psr-0": [], + "classmap": [ + "./Module.php" + ] + }, + "description": "Module de gestion de paramètres", + "time": "2022-07-21T08:58:12+00:00" }, { "name": "unicaen/pdf", - "version": "4.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/pdf.git", - "reference": "18497c10f122c9483cb5186bd51815391caf3014" + "reference": "f36fa5c5f44205593d076a1a49a98bf4752ad32b" }, "require": { "laminas/laminas-dependency-plugin": "^2.1", @@ -10073,15 +9992,15 @@ ] }, "description": "Génération PDF", - "time": "2022-03-29T05:53:50+00:00" + "time": "2022-12-15T11:04:14+00:00" }, { "name": "unicaen/privilege", - "version": "5.0.3", + "version": "5.0.5", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/privilege.git", - "reference": "d1957d0eeb82c1f919556ecb88b659a32f9cd300" + "reference": "7e593ed6b1af6e8ed38bf91e1fbb813a7ae875e9" }, "require": { "laminas/laminas-dependency-plugin": "^2.1", @@ -10100,30 +10019,29 @@ ] }, "description": "Module reprenant la gestion des privileges - Version laminas", - "time": "2022-11-03T15:32:34+00:00" + "time": "2023-01-23T14:28:44+00:00" }, { "name": "unicaen/renderer", - "version": "5.0.3", + "version": "5.0.5", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/renderer.git", - "reference": "2fac10cd89dbd5d36a64411f7e44df9ca9a831c8" + "reference": "15e07cff3dbb4f3a083bb5af245fc1cc5acc92af" }, "require": { "laminas/laminas-dependency-plugin": "^2.1", - "unicaen/app": "^5.0", + "php": "^7.0", "unicaen/privilege": "^5.0" }, "type": "library", "autoload": { - "psr-0": [], "classmap": [ "./Module.php" ] }, "description": "Module de rendu de texte avec templates et macros", - "time": "2022-09-16T14:21:27+00:00" + "time": "2023-01-20T19:42:17+00:00" }, { "name": "unicaen/zfc-user", @@ -11860,16 +11778,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.14", + "version": "v5.4.19", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "6894d06145fefebd9a4c7272baa026a1c394a430" + "reference": "2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6894d06145fefebd9a4c7272baa026a1c394a430", - "reference": "6894d06145fefebd9a4c7272baa026a1c394a430", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b", + "reference": "2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b", "shasum": "" }, "require": { @@ -11929,7 +11847,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.14" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.19" }, "funding": [ { @@ -11945,7 +11863,7 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:01:20+00:00" + "time": "2023-01-16T10:52:33+00:00" }, { "name": "symfony/yaml", @@ -12020,11 +11938,11 @@ }, { "name": "unicaen/code", - "version": "7.1", + "version": "7.2", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/code.git", - "reference": "b81326b34e8a993d771fa2aa682322e1908f6f9a" + "reference": "86df91b5c75ae57ebdbd8f2dcf8c3c2c1df76adc" }, "require": { "easybook/geshi": ">=1.0", @@ -12041,7 +11959,7 @@ ] }, "description": "Boite à outils pour la programmation avec la bibliothèque Unicaen", - "time": "2022-10-05T15:04:59+00:00" + "time": "2022-12-02T10:15:21+00:00" }, { "name": "unicaen/test", @@ -12074,10 +11992,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "unicaen/db-anonym": 20, - "unicaen/livelog": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -12098,5 +12013,5 @@ "ext-zip": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.1.0" } diff --git a/config/application.config.php b/config/application.config.php index 915534b6c01ad060e15e867dbd97bbc2a039857c..671b90ff8020b66263921d6c0d31483ab509cfc4 100755 --- a/config/application.config.php +++ b/config/application.config.php @@ -32,12 +32,13 @@ return [ 'UnicaenAuthToken', 'UnicaenAvis', 'UnicaenLdap', - 'UnicaenDbAnonym', +// 'UnicaenDbAnonym', 'UnicaenDbImport', 'UnicaenFaq', - 'UnicaenLivelog', +// 'UnicaenLivelog', 'UnicaenPdf', 'UnicaenRenderer', + 'UnicaenParametre', 'Structure', 'These', 'Fichier', diff --git a/doc/release-notes/v5.2.8.md b/doc/release-notes/v5.2.8.md index 6e0c554f8776d4442d7f376da5d26967f6a537d6..4c907e20808f5f7e948853d857f7f169652ca891 100644 --- a/doc/release-notes/v5.2.8.md +++ b/doc/release-notes/v5.2.8.md @@ -20,6 +20,7 @@ git fetch --tags && git checkout --force 5.2.8 && bash ./install.sh INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#Serment', '<p>Retourne le lien vers le téléchargement du serment du docteur</p>', 'Url', 'getSermentDocteur'); INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#ProcesVerbal', '<p>Retourne le lien vers le téléchargement du procés verbal</p>', 'Url', 'getProcesVerbal'); INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#RapportSoutenance', '<p>Retourne le lien vers le téléchargement du rapport de soutenance</p>', 'Url', 'getRapportSoutenance'); +INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#RapportTechnique', '<p>Retourne le lien vers le téléchargement du rapport technique</p>', 'Url', 'getRapportTechnique'); INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css) VALUES ( 'TRANSMETTRE_DOCUMENTS_DIRECTION', '<p>Courrier électronique envoyé à la direction de thèse pour transmission de documents avant soutenance</p>', diff --git a/doc/release-notes/v5.2.9.md b/doc/release-notes/v5.2.9.md new file mode 100644 index 0000000000000000000000000000000000000000..c7fbdf42f8502b1a35e36848168e37489d1b73ef --- /dev/null +++ b/doc/release-notes/v5.2.9.md @@ -0,0 +1,75 @@ +# Version 5.2.9 + +## 1. Sur le serveur d'application + +- Placez-vous dans le répertoire de l'application puis lancez la commande suivante + pour installer la nouvelle version : + +```bash +git fetch --tags && git checkout --force 5.2.9 && bash ./install.sh +``` + +- Selon le moteur PHP que vous avez installé, rechargez le service, exemple : + - php7.4-fpm : `service php7.4-fpm reload` + - apache2-mod-php7.4 : `service apache2 reload` + +## 2. Dans la base de données + +```sql +-- MAJ RENDERER -------------------- +alter table unicaen_renderer_template add namespace varchar(256); + +-- MACROS -------------------------- +INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('These#Titre', null, 'these', 'getTitre'); +INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#RapporteurDashboard', '<p>Fourni l''url vers le darshboard du rapporteur passé en variable</p>', 'Url', 'getUrlRapporteurDashboard'); +INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Session#Periode', null, 'session', 'getPeriode'); +INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Inscription#DureeSuivie', null, 'inscription', 'getDureeSuivie'); +INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Session#Responsable', null, 'session', 'getDenominationResponsable'); +INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Signature#EtablissementFormation', null, 'Url', 'getFormationSignature'); + +-- TEMPLATES FORMATION --------------------------------------------- +INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace) VALUES ( + 'FORMATION_ATTESTATION', null, 'pdf', + 'Attestation de suivie de la formation VAR[Formation#Libelle]', + '<h1 style="text-align: center;">Attestation de suivi de formation</h1><p></p><p>Bonjour ,</p><p>Je, sousigné·e, certifie que <strong>VAR[Doctorant#Denomination]</strong> a participé à la formation <strong>VAR[Formation#Libelle]</strong> qui s''est déroulée sur la période du VAR[Session#Periode] (Durée : VAR[Session#Duree] heures).</p><p>VAR[Doctorant#Denomination] a suivi VAR[Inscription#DureeSuivie] heure·s de formation.</p><p style="text-align: right;">Le·la responsable du module<br />VAR[Session#Responsable]<br /><br /></p><p style="text-align: right;">VAR[Signature#EtablissementFormation]</p>', + null, + 'Formation\Provider\Template' +); +INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace) VALUES ( + 'FORMATION_CONVOCATION', null, 'pdf', + 'Convocation à la formation VAR[Formation#Libelle] du VAR[Session#Periode]', + '<h1 style="text-align: center;">Convocation à la session de formation VAR[Formation#Libelle]</h1><p><br /><br />Bonjour VAR[Doctorant#Denomination],</p><p>Nous avons le plaisir de vous informer que la formation, VAR[Formation#Libelle], à laquelle vous êtes inscrit·e se déroulera selon le calendrier ci-dessous :<br />VAR[Session#SeancesTable]<br /><br />En cas d''impossibilité d''assister à tout ou partie de ce stage, merci de bien vouloir informer le ou la responsable du module de formation (VAR[Session#Responsable]) dans les meilleurs délais afin de permettre de contacter un·e doctorant·e actuellement sur liste d''attente.</p><p>Nous vous souhaitons un stage fructueux.</p><p style="text-align: right;">L''application SyGAL,<br />VAR[Signature#EtablissementFormation]</p><p><br /><span style="text-decoration: underline;">P.S.:</span> Cette convocation vaut ordre de mission<br /><br /><br /></p>', + 'table { width:100%; } th { text-align:left; }', + 'Formation\Provider\Template' +); + +-- TEMPLATES SOUTENANCE -------------------------------------------- +INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace) VALUES ( + 'DEMANDE_ENGAGEMENT_IMPARTIALITE', '<p>Courrier électronique notifiant un·e futur·e rapporteur·e pour la signature de l''engagement d''impartialité.<br />Envoyé lors de l''appariement membre/acteur</p>', 'mail', + 'Demande de signature de l''engagement d''impartialité de la thèse de VAR[Doctorant#Denomination]', + '<p>-- Version française ---------------------------------------------------------------</p><p>Bonjour,</p><p>Afin de pouvoir devenir rapporteur de la thèse de <strong>VAR[Doctorant#Denomination]</strong> intitulée <strong>VAR[These#Titre]</strong>, il est nécessaire de signer électroniquement l''engagement d''impartialité dans l''application <em>ESUP-SyGAL</em> :<strong> VAR[Url#RapporteurDashboard]</strong>.<br /><br />Vous accéderez ainsi à une page "index de la soutenance" listant les membres du jury.<br />Cliquez ensuite sur "accès à l’engagement d’impartialité".<br />Puis après avoir pris connaissance des conditions relatives à cet engagement, vous pourrez signer ou non cet engagement d’impartialité.<br />Si vous signez, vous pourrez alors télécharger le PDF du manuscrit de thèse.</p><p>Cordialement<br /><br />-- English version ------------------------------------------------------------------<br /><br />Dear Mrs/Mr,</p><p>Before being officially registered as an external referee for the PhD thesis presented by <strong>VAR[Doctorant#Denomination]</strong> entitled <strong>VAR[These#Titre]</strong>, you have to sign the "impartiality commitment" available in your dashborad : <strong>VAR[Url#RapporteurDashboard]</strong>.<br /><br />You will then be connected to a web page entitled "index of the PhD defense" listing the PhD jury members.<br />Click then on "access to the impartiality commitment".<br />Then, after reading the requirements regarding the impartiality commitment of an external referee, you sign it or not.<br />If you sign it, you will be able to download the PDF version of the PhD manuscript.</p><p>Best regards,</p><p>-- Justification ----------------------------------------------------------------------<br /><br />Vous avez reçu ce mail car :</p><ul><li>vous avez été désigné rapporteur pour la thèse de VAR[Doctorant#Denomination]</li><li>la signature a été annulée<br /><br /></li></ul>', + null, + 'Soutenance\Provider\Template' +); +INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace) VALUES ( + 'SIGNATURE_ENGAGEMENT_IMPARTIALITE', '<p>Courrier électronique envoyé vers les maisons du doctorat lors de la signature de l''engagement d''impartialité par un rapporteur</p>', 'mail', + 'Signature de l''engagement d''impartialité de la thèse de VAR[Doctorant#Denomination] par VAR[Membre#Denomination]', + '<p>Bonjour,</p><p><strong>VAR[Membre#Denomination]</strong> vient de signer l''engagement d''impartialité de la thèse de <strong>VAR[Doctorant#Denomination]</strong> intitulée <strong>VAR[These#Titre]</strong>.</p><p>-- Justification ----------------------------------------------------------------------<br /><br />Vous avez reçu ce mail car :</p><ul><li>le rapporteeur VAR[Membre#Denomination] vient de signer l''engagement d''impartialité; </li><li>vous êtes un gestionnaire de la maison du doctorat de l''établissement d''inscription du doctorant . <br /><br /></li></ul>', + null, + 'Soutenance\Provider\Template' +); +INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace) VALUES ( + 'REFUS_ENGAGEMENT_IMPARTIALITE', '<p>Courrier électronique envoyé lors du refus de l''engagement d''impartialité</p>', 'mail', + 'Refus de l''engagement d''impartialité de la thèse de VAR[Doctorant#Denomination] par VAR[Membre#Denomination]', + '<p>Bonjour,</p><p><strong>VAR[Membre#Denomination]</strong> vient de refuser l''engagement d''impartialité de la thèse de <strong>VAR[Doctorant#Denomination]</strong> intitulée <strong>VAR[These#Titre]</strong>.</p><p>-- Justification ----------------------------------------------------------------------</p><p>Vous avez reçu ce mail car :</p><ul><li>le rapporteur VAR[Membre#Denomination] vient de refuser de signer l''engagement d''impartialité;</li><li>vous êtes :<ul><li>soit un des acteurs directs de la thèse de VAR[Doctorant#Denomination],</li><li>soit un gestionnaire de la maison du doctorat de l''établissement d''inscription du doctorant.<br /> <br /><br /></li></ul></li></ul>', + null, + 'Soutenance\Provider\Template' +); +INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace) VALUES ( + 'ANNULATION_ENGAGEMENT_IMPARTIALITE', '<p>Courrier électronique envoyé lors de l''annulation d''un engagement d''impartialité</p>', 'mail', + 'Annulation de la signature de l''engagement d''impartialité de VAR[Membre#Denomination] pour la thèse de VAR[Doctorant#Denomination]', + '<p>Bonjour,</p><p><br />Votre signature de l''engagement d''impartialité de la thèse de <strong>VAR[Doctorant#Denomination]</strong> intitulée <strong>VAR[These#Titre]</strong> vient d''être annulée.</p> <p>-- Justification ----------------------------------------------------------------------</p> <p>Vous avez reçu ce mail car :</p><ul><li>vous avez signé l''engagement d''impartialité pour la thèse de VAR[Doctorant#Denomination]; </li><li>la signature a été annulée. </li></ul>', + null, + 'Soutenance\Provider\Template' +); +``` \ No newline at end of file diff --git a/doc/release-notes/v5.2.X.md b/doc/release-notes/v5.2.X.md new file mode 100644 index 0000000000000000000000000000000000000000..5bb4b3d426257d644d1ea6e1fe8d82afeb218238 --- /dev/null +++ b/doc/release-notes/v5.2.X.md @@ -0,0 +1,129 @@ +# Version 5.2.9 + +## 1. Sur le serveur d'application + +- Placez-vous dans le répertoire de l'application puis lancez la commande suivante + pour installer la nouvelle version : + +```bash +git fetch --tags && git checkout --force 5.2.9 && bash ./install.sh +``` + +- Selon le moteur PHP que vous avez installé, rechargez le service, exemple : + - php7.4-fpm : `service php7.4-fpm reload` + - apache2-mod-php7.4 : `service apache2 reload` + +## 2. Dans la base de données + +```sql +create table unicaen_parametre_categorie +( + id serial not null, + code varchar(1024) not null, + libelle varchar(1024) not null, + description text, + ordre integer default 9999 +); + +create unique index unicaen_parametre_categorie_code_uindex + on unicaen_parametre_categorie (code); + +create unique index unicaen_parametre_categorie_id_uindex + on unicaen_parametre_categorie (id); + +alter table unicaen_parametre_categorie + add constraint unicaen_parametre_categorie_pk + primary key (id); + +-- table parametre +create table unicaen_parametre_parametre +( + id serial not null + constraint unicaen_parametre_parametre_pk + primary key, + categorie_id integer not null + constraint unicaen_parametre_parametre_unicaen_parametre_categorie_id_fk + references unicaen_parametre_categorie, + code varchar(1024) not null, + libelle varchar(1024) not null, + description text, + valeurs_possibles text, + valeur text, + ordre integer default 9999 +); + +create unique index unicaen_parametre_parametre_id_uindex + on unicaen_parametre_parametre (id); + +create unique index unicaen_parametre_parametre_code_categorie_id_uindex + on unicaen_parametre_parametre (code, categorie_id); + + + +alter table privilege alter column id set default nextval('privilege_id_seq'); +alter sequence privilege_id_seq owned by privilege.id; +alter sequence privilege_id_seq restart with 1000; + +INSERT INTO categorie_privilege (code, libelle, ordre) +VALUES ('parametrecategorie', 'UnicaenParametre - Gestion des catégories de paramètres', 100); +INSERT INTO privilege(CATEGORIE_ID, CODE, LIBELLE, ORDRE) +WITH d(code, lib, ordre) AS ( + SELECT 'parametrecategorie_index', 'Affichage de l''index des paramètres', 10 UNION + SELECT 'parametrecategorie_afficher', 'Affichage des détails d''une catégorie', 20 UNION + SELECT 'parametrecategorie_ajouter', 'Ajouter une catégorie de paramètre', 30 UNION + SELECT 'parametrecategorie_modifier', 'Modifier une catégorie de paramètre', 40 UNION + SELECT 'parametrecategorie_supprimer', 'Supprimer une catégorie de paramètre', 60 +) +SELECT cp.id, d.code, d.lib, d.ordre +FROM d JOIN categorie_privilege cp ON cp.CODE = 'parametrecategorie' +; + +INSERT INTO categorie_privilege (code, libelle, ordre) +VALUES ('parametre', 'UnicaenParametre - Gestion des paramètres', 101); +INSERT INTO privilege(CATEGORIE_ID, CODE, LIBELLE, ORDRE) +WITH d(code, lib, ordre) AS ( + SELECT 'parametre_afficher', 'Afficher un paramètre', 10 UNION + SELECT 'parametre_ajouter', 'Ajouter un paramètre', 20 UNION + SELECT 'parametre_modifier', 'Modifier un paramètre', 30 UNION + SELECT 'parametre_supprimer', 'Supprimer un paramètre', 50 UNION + SELECT 'parametre_valeur', 'Modifier la valeur d''un parametre', 100 +) +SELECT cp.id, d.code, d.lib, d.ordre +FROM d +JOIN privilege cp ON cp.CODE = 'parametre' +; + +drop table soutenance_configuration; + +INSERT INTO unicaen_parametre_categorie (code, libelle, description, ordre) +VALUES ('SOUTENANCE', 'Gestion des paramètres du module Soutenance', null, 1000); +INSERT INTO unicaen_parametre_parametre(CATEGORIE_ID, CODE, LIBELLE, description, valeurs_possibles, valeur, ORDRE) +WITH d(code, lib, description, possible, valeur, ordre) AS ( + SELECT 'NB_MAX_MEMBRE_JURY', 'Nombre maximal de membres dans le jury', null, 'Number', '8', 20 UNION + SELECT 'NB_MIN_RAPPORTEUR', 'Nombre minimal de rapporteurs', null, 'Number', '2', 300 UNION + SELECT 'RATIO_PARITE', 'Ratio de parité dans le jury', '<p>N''est que indicatif car ne peut être <em>enforced</em> dans certaines disciplines.</p>', 'String', '0.5', 400 UNION + SELECT 'RATIO_MIN_RANG_A', 'Ratio minimal de membres de rang A', null, 'String', '0.5', 500 UNION + SELECT 'RATIO_MIN_EXTERIEUR', 'Ratio minimal de membres extérieurs', null, 'String', '0.5', 600 UNION + SELECT 'NB_MIN_MEMBRE_JURY', 'Nombre minimal de membres dans le jury', null, 'Number', '4', 10 UNION + SELECT 'DELAI_RETOUR', 'Delai avant le retour des rapports', null, 'Number', '14', 1100 UNION + SELECT 'DELAI_INTERVENTION', 'Délai permettant aux directeurs d''intervenir [-j jour:+j jour]', null, 'Number', '21', 1200 UNION + SELECT 'DOC_DELOCALISATION', 'Formulaire de délocalisation de la soutenance', null, 'String', 'https://sygal.normandie-univ.fr/fichier/telecharger/permanent/DEMANDE_DELOCALISATION_SOUTENANCE', 2100 UNION + SELECT 'DOC_DELEGATION_SIGNATURE', 'Formulaire de délégation de signature', null, 'String', 'https://sygal.normandie-univ.fr/fichier/telecharger/permanent/DEMANDE_DELEGATION_SIGNATURE', 2200 UNION + SELECT 'DOC_REDACTION_ANGLAIS', 'Formulaire de demande de rédaction en anglais', null, 'String', null, 2400 UNION + SELECT 'DOC_LABEL_EUROPEEN', 'Formulaire de demande de label europeen', null, 'String', 'https://sygal.normandie-univ.fr/fichier/telecharger/permanent/DEMANDE_LABEL_EUROPEEN', 2300 UNION + SELECT 'DOC_CONFIDENTIALITE', 'Formulaire de demande de confidentialité', null, 'String', 'https://sygal-test.normandie-univ.fr/fichier/telecharger/permanent/DEMANDE_DE_CONFIDENTIALITE', 2500 +) +SELECT cp.id, d.code, d.lib, d.description, d.possible, d.valeur, d.ordre +FROM d +JOIN unicaen_parametre_categorie cp ON cp.CODE = 'SOUTENANCE'; + +INSERT INTO unicaen_parametre_categorie (code, libelle, description, ordre) +VALUES ('FORMATION', 'Gestion des paramètres du module Formation', null, 900); +INSERT INTO unicaen_parametre_parametre(CATEGORIE_ID, CODE, LIBELLE, description, valeurs_possibles, valeur, ORDRE) +WITH d(code, lib, description, possible, valeur, ordre) AS ( + SELECT 'DELAI_ENQUETE', ' Délai pour la saisie de l''enquête (en jours) ', null, 'Number', '15', 10 +) +SELECT cp.id, d.code, d.lib, d.description, d.possible, d.valeur, d.ordre +FROM d +JOIN unicaen_parametre_categorie cp ON cp.CODE = 'FORMATION' +``` \ No newline at end of file diff --git a/module/Application/config/others/parametre.config.php b/module/Application/config/others/parametre.config.php deleted file mode 100755 index 2cc24f838137d9c3e52d7fab6d3b8b22d0dd7a0b..0000000000000000000000000000000000000000 --- a/module/Application/config/others/parametre.config.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -use Application\Service\Parametre\ParametreService; - -return [ - 'service_manager' => [ - 'invokables' => array( - 'ParametreService' => ParametreService::class, - ), - 'factories' => [ - - ], - ], -]; diff --git a/module/Application/config/others/unicaen-parametre.config.php b/module/Application/config/others/unicaen-parametre.config.php new file mode 100644 index 0000000000000000000000000000000000000000..df799f847bdef218edcf83e4dea95f6df27fbf7c --- /dev/null +++ b/module/Application/config/others/unicaen-parametre.config.php @@ -0,0 +1,96 @@ +<?php + +namespace UnicaenParametre; + +use UnicaenAuth\Guard\PrivilegeController; +use UnicaenParametre\Controller\CategorieController; +use UnicaenParametre\Controller\ParametreController; +use UnicaenParametre\Provider\Privilege\ParametrecategoriePrivileges; +use UnicaenParametre\Provider\Privilege\ParametrePrivileges; + +return [ + + 'bjyauthorize' => [ + 'guards' => [ + PrivilegeController::class => [ + [ + 'controller' => CategorieController::class, + 'action' => [ + 'index', + ], + 'pivileges' => ParametrecategoriePrivileges::PARAMETRECATEGORIE_INDEX, + ], + [ + 'controller' => CategorieController::class, + 'action' => [ + 'ajouter', + ], + 'pivileges' => ParametrecategoriePrivileges::PARAMETRECATEGORIE_AJOUTER, + ], + [ + 'controller' => CategorieController::class, + 'action' => [ + 'modifier', + ], + 'pivileges' => ParametrecategoriePrivileges::PARAMETRECATEGORIE_MODIFIER, + ], + [ + 'controller' => CategorieController::class, + 'action' => [ + 'supprimer', + ], + 'pivileges' => ParametrecategoriePrivileges::PARAMETRECATEGORIE_SUPPRIMER, + ], + [ + 'controller' => ParametreController::class, + 'action' => [ + 'ajouter', + ], + 'pivileges' => ParametrePrivileges::PARAMETRE_AJOUTER, + ], + [ + 'controller' => ParametreController::class, + 'action' => [ + 'modifier', + ], + 'pivileges' => ParametrePrivileges::PARAMETRE_MODIFIER, + ], + [ + 'controller' => ParametreController::class, + 'action' => [ + 'modifier-valeur', + ], + 'pivileges' => ParametrePrivileges::PARAMETRE_VALEUR, + ], + [ + 'controller' => ParametreController::class, + 'action' => [ + 'supprimer', + ], + 'pivileges' => ParametrePrivileges::PARAMETRE_SUPPRIMER, + ], + ], + ], + ], + + + 'navigation' => [ + 'default' => [ + 'home' => [ + 'pages' => [ + 'admin' => [ + 'pages' => [ + 'parametres' => [ + 'label' => 'Gestion des paramètres', + 'route' => 'parametre/index', + 'resource' => PrivilegeController::getResourceId(CategorieController::class, 'index'), + 'order' => 10001, + 'icon' => 'fas fa-tools', + ], + ], + ], + ], + ], + ], + ], +]; \ No newline at end of file diff --git a/module/Application/config/others/unicaen-renderer.config.php b/module/Application/config/others/unicaen-renderer.config.php index 195a3ba271cb51e0595fa141657a9c007c22f733..5a0b7336940191978b43d046d18415b0eda955fd 100755 --- a/module/Application/config/others/unicaen-renderer.config.php +++ b/module/Application/config/others/unicaen-renderer.config.php @@ -147,7 +147,7 @@ return [ 'label' => 'Gestion de contenus', 'route' => 'contenu', 'resource' => PrivilegeController::getResourceId(IndexController::class, 'index'), - 'order' => 10001, + 'order' => 10002, 'icon' => 'far fa-file-code', ], ], diff --git a/module/Application/view/application/rapport/rapport-csi/consulter.phtml b/module/Application/view/application/rapport/rapport-csi/consulter.phtml index cfada7645c682d0e440dbd7ff5e13a9473d9a75a..23d0df776705cf62ae60191636c2188717d9c5d7 100644 --- a/module/Application/view/application/rapport/rapport-csi/consulter.phtml +++ b/module/Application/view/application/rapport/rapport-csi/consulter.phtml @@ -54,6 +54,7 @@ $canModifier = ($privilege_TELEVERSER_SIEN OR $privilege_TELEVERSER_TOUT); Cette page est consacrée au téléversement des rapports CSI. </p> +<?php if (false) : //todo à retirer lors de la création du vrai module CSI ?> <div class="row"> <div class="col-md-11"> @@ -143,6 +144,8 @@ $canModifier = ($privilege_TELEVERSER_SIEN OR $privilege_TELEVERSER_TOUT); <?php endif; ?> </div> </div> +<?php endif; ?> + <div class="row"> <div class="col-md-11"> diff --git a/module/Formation/config/module.config.php b/module/Formation/config/module.config.php index 5977bb55b77d2ee54e327d28717649e7b5988c90..d94cce0c3b562920ea60ff89d2dbe3054820dff0 100644 --- a/module/Formation/config/module.config.php +++ b/module/Formation/config/module.config.php @@ -9,6 +9,8 @@ use Formation\Provider\IdentityProvider; use Formation\Provider\IdentityProviderFactory; use Formation\Service\Notification\FormationNotificationFactory; use Formation\Service\Notification\FormationNotificationFactoryFactory; +use Formation\Service\Url\UrlService; +use Formation\Service\Url\UrlServiceFactory; use Formation\View\Helper\EtatViewHelper; use Formation\View\Helper\FormateursViewHelper; use Formation\View\Helper\ModaliteViewHelper; @@ -63,6 +65,7 @@ return array( 'factories' => [ FormationNotificationFactory::class => FormationNotificationFactoryFactory::class, IdentityProvider::class => IdentityProviderFactory::class, + UrlService::class => UrlServiceFactory::class, ], ], diff --git a/module/Formation/config/others/inscription.config.php b/module/Formation/config/others/inscription.config.php index 5599082088d69549c1f20966ab24a32521f9d1db..548fe878a80596f2e6a69d3a78a3f4d34fa04b33 100644 --- a/module/Formation/config/others/inscription.config.php +++ b/module/Formation/config/others/inscription.config.php @@ -7,6 +7,10 @@ use Formation\Controller\InscriptionControllerFactory; use Formation\Controller\Recherche\InscriptionRechercheController; use Formation\Controller\Recherche\InscriptionRechercheControllerFactory; use Formation\Provider\Privilege\InscriptionPrivileges; +use Formation\Service\Exporter\Attestation\AttestationExporter; +use Formation\Service\Exporter\Attestation\AttestationExporterFactory; +use Formation\Service\Exporter\Convocation\ConvocationExporter; +use Formation\Service\Exporter\Convocation\ConvocationExporterFactory; use Formation\Service\Inscription\Search\InscriptionSearchServiceFactory; use Formation\Service\Inscription\InscriptionService; use Formation\Service\Inscription\InscriptionServiceFactory; @@ -256,6 +260,8 @@ return [ 'factories' => [ InscriptionService::class => InscriptionServiceFactory::class, InscriptionSearchService::class => InscriptionSearchServiceFactory::class, + AttestationExporter::class => AttestationExporterFactory::class, + ConvocationExporter::class => ConvocationExporterFactory::class, ], ], 'controllers' => [ diff --git a/module/Formation/src/Formation/Controller/EnqueteQuestionController.php b/module/Formation/src/Formation/Controller/EnqueteQuestionController.php index 1e557aceb78bcba9515a6c8467e07c995cc6091d..4f6f17b13d08dbe02dc409fc85d7dbb76abc3558 100644 --- a/module/Formation/src/Formation/Controller/EnqueteQuestionController.php +++ b/module/Formation/src/Formation/Controller/EnqueteQuestionController.php @@ -3,6 +3,7 @@ namespace Formation\Controller; use Application\Controller\AbstractController; +use DateInterval; use DateTime; use Doctrine\Common\Collections\ArrayCollection; use Formation\Entity\Db\EnqueteCategorie; @@ -11,6 +12,7 @@ use Formation\Entity\Db\EnqueteReponse; use Formation\Form\EnqueteCategorie\EnqueteCategorieFormAwareTrait; use Formation\Form\EnqueteQuestion\EnqueteQuestionFormAwareTrait; use Formation\Form\EnqueteReponse\EnqueteReponseFormAwareTrait; +use Formation\Provider\Parametre\FormationParametres; use Formation\Service\EnqueteCategorie\EnqueteCategorieServiceAwareTrait; use Formation\Service\EnqueteQuestion\EnqueteQuestionServiceAwareTrait; use Formation\Service\EnqueteReponse\EnqueteReponseServiceAwareTrait; @@ -19,6 +21,7 @@ use Formation\Service\Session\SessionServiceAwareTrait; use Laminas\Http\Response; use UnicaenApp\Service\EntityManagerAwareTrait; use Laminas\View\Model\ViewModel; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; class EnqueteQuestionController extends AbstractController { use EntityManagerAwareTrait; @@ -26,6 +29,7 @@ class EnqueteQuestionController extends AbstractController { use EnqueteQuestionServiceAwareTrait; use EnqueteReponseServiceAwareTrait; use InscriptionServiceAwareTrait; + use ParametreServiceAwareTrait; use SessionServiceAwareTrait; use EnqueteCategorieFormAwareTrait; use EnqueteQuestionFormAwareTrait; @@ -338,11 +342,16 @@ class EnqueteQuestionController extends AbstractController { $categories = $this->getEntityManager()->getRepository(EnqueteCategorie::class)->findAll(); + $delai = $this->getParametreService()->getParametreByCode(FormationParametres::CATEGORIE, FormationParametres::DELAI_ENQUETE)->getValeur(); + $date = DateTime::createFromFormat('d/m/Y', $inscription->getSession()->getDateFin()->format('d/m/Y')); + $date->add(new DateInterval('P'.$delai.'D')); + return new ViewModel([ 'inscription' => $inscription, 'questions' => $questions, 'categories' => $categories, 'form' => $form, + 'date' => $date, ]); } diff --git a/module/Formation/src/Formation/Controller/EnqueteQuestionControllerFactory.php b/module/Formation/src/Formation/Controller/EnqueteQuestionControllerFactory.php index 3a4b63d7250c534a37323a4ef182d32fba0f77c1..2f2bb7ca7492b563501bec453ef61ab9daa3ab03 100644 --- a/module/Formation/src/Formation/Controller/EnqueteQuestionControllerFactory.php +++ b/module/Formation/src/Formation/Controller/EnqueteQuestionControllerFactory.php @@ -12,12 +12,15 @@ use Formation\Service\EnqueteReponse\EnqueteReponseService; use Formation\Service\Inscription\InscriptionService; use Formation\Service\Session\SessionService; use Interop\Container\ContainerInterface; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; +use UnicaenParametre\Service\Parametre\ParametreService; class EnqueteQuestionControllerFactory { /** - * @throws \Psr\Container\NotFoundExceptionInterface - * @throws \Psr\Container\ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws ContainerExceptionInterface */ public function __invoke(ContainerInterface $container) : EnqueteQuestionController { @@ -26,6 +29,7 @@ class EnqueteQuestionControllerFactory { * @var EnqueteCategorieService $enqueteCategorieService * @var EnqueteReponseService $enqueteReponseService * @var InscriptionService $inscriptionService + * @var ParametreService $parametreService * @var SessionService $sessionService */ $entityManager = $container->get('doctrine.entitymanager.orm_default'); @@ -33,6 +37,7 @@ class EnqueteQuestionControllerFactory { $enqueteQuestionService = $container->get(EnqueteQuestionService::class); $enqueteReponseService = $container->get(EnqueteReponseService::class); $inscriptionService = $container->get(InscriptionService::class); + $parametreService = $container->get(ParametreService::class); $sessionService = $container->get(SessionService::class); /** @@ -50,6 +55,7 @@ class EnqueteQuestionControllerFactory { $controller->setEnqueteQuestionService($enqueteQuestionService); $controller->setEnqueteReponseService($enqueteReponseService); $controller->setInscriptionService($inscriptionService); + $controller->setParametreService($parametreService); $controller->setSessionService($sessionService); $controller->setEnqueteCategorieForm($enqueteCategorieForm); $controller->setEnqueteQuestionForm($enqueteQuestionForm); diff --git a/module/Formation/src/Formation/Controller/IndexController.php b/module/Formation/src/Formation/Controller/IndexController.php index c8368ff908ed7c9a4e31fb6206801bfa37f948c5..cacf7f211c6468fff37774ab06433fd6377b6709 100644 --- a/module/Formation/src/Formation/Controller/IndexController.php +++ b/module/Formation/src/Formation/Controller/IndexController.php @@ -7,14 +7,17 @@ use Doctorant\Entity\Db\Doctorant; use Doctorant\Service\DoctorantServiceAwareTrait; use Formation\Entity\Db\Inscription; use Formation\Entity\Db\Session; +use Formation\Provider\Parametre\FormationParametres; use Individu\Entity\Db\Individu; use Laminas\View\Model\ViewModel; use UnicaenApp\Service\EntityManagerAwareTrait; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; class IndexController extends AbstractController { use EntityManagerAwareTrait; use DoctorantServiceAwareTrait; + use ParametreServiceAwareTrait; public function indexAction() : ViewModel { @@ -50,6 +53,7 @@ class IndexController extends AbstractController 'ouvertes' => $ouvertes, 'preparations' => $preparations, 'inscriptions' => $inscriptions, + 'delai' => $this->getParametreService()->getParametreByCode(FormationParametres::CATEGORIE, FormationParametres::DELAI_ENQUETE)->getValeur(), ]); } diff --git a/module/Formation/src/Formation/Controller/IndexControllerFactory.php b/module/Formation/src/Formation/Controller/IndexControllerFactory.php index 49c9a0341a9e8cbdbc7acafafd85d6aed28746f6..95e11b5dbf81564f7fd4edbe6cc2b20aac756a74 100644 --- a/module/Formation/src/Formation/Controller/IndexControllerFactory.php +++ b/module/Formation/src/Formation/Controller/IndexControllerFactory.php @@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManager; use Interop\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; +use UnicaenParametre\Service\Parametre\ParametreService; class IndexControllerFactory { @@ -21,13 +22,16 @@ class IndexControllerFactory { /** * @var EntityManager $entityManager * @var DoctorantService $doctorantService + * @var ParametreService $parametreService */ $entityManager = $container->get('doctrine.entitymanager.orm_default'); $doctorantService = $container->get(DoctorantService::class); + $parametreService = $container->get(ParametreService::class); $controller = new IndexController(); $controller->setEntityManager($entityManager); $controller->setDoctorantService($doctorantService); + $controller->setParametreService($parametreService); return $controller; } diff --git a/module/Formation/src/Formation/Controller/InscriptionController.php b/module/Formation/src/Formation/Controller/InscriptionController.php index a293a6b7dcbe8eb228899932e18819df37baa885..0c2a582d0bb77c57a3a1f041ea716833cb3727c9 100644 --- a/module/Formation/src/Formation/Controller/InscriptionController.php +++ b/module/Formation/src/Formation/Controller/InscriptionController.php @@ -9,8 +9,8 @@ use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; use Fichier\Service\Storage\Adapter\Exception\StorageAdapterException; use Formation\Entity\Db\Inscription; use Formation\Provider\NatureFichier\NatureFichier; -use Formation\Service\Exporter\Attestation\AttestationExporter; -use Formation\Service\Exporter\Convocation\ConvocationExporter; +use Formation\Service\Exporter\Attestation\AttestationExporterAwareTrait; +use Formation\Service\Exporter\Convocation\ConvocationExporterAwareTrait; use Formation\Service\Inscription\InscriptionServiceAwareTrait; use Formation\Service\Notification\FormationNotificationFactoryAwareTrait; use Notification\Service\NotifierServiceAwareTrait; @@ -40,6 +40,8 @@ class InscriptionController extends AbstractController use PresenceServiceAwareTrait; use SessionServiceAwareTrait; use StructureDocumentServiceAwareTrait; + use AttestationExporterAwareTrait; + use ConvocationExporterAwareTrait; private ?PhpRenderer $renderer = null; public function setRenderer(?PhpRenderer $renderer) { $this->renderer = $renderer; } @@ -242,28 +244,10 @@ class InscriptionController extends AbstractController $inscription = $this->getInscriptionService()->getRepository()->getRequestedInscription($this); $session = $inscription->getSession(); - $logos = []; - try { - $logos['site'] = $this->fichierStorageService->getFileForLogoStructure($session->getSite()->getStructure()); - } catch (StorageAdapterException $e) { - $logos['site'] = null; - } - if ($comue = $this->etablissementService->fetchEtablissementComue()) { - try { - $logos['comue'] = $this->fichierStorageService->getFileForLogoStructure($comue->getStructure()); - } catch (StorageAdapterException $e) { - $logos['comue'] = null; - } - } - - $signature = $this->findSignatureEtablissement($inscription->getDoctorant()->getEtablissement()); - //exporter - $export = new ConvocationExporter($this->renderer, 'A4'); + $export = $this->convocationExporter; $export->setVars([ - 'signature' => $signature, 'inscription' => $inscription, - 'logos' => $logos, ]); $export->export('SYGAL_convocation_' . $session->getId() . "_" . $inscription->getId() . ".pdf"); } @@ -271,8 +255,18 @@ class InscriptionController extends AbstractController public function genererAttestationAction() { $inscription = $this->getInscriptionService()->getRepository()->getRequestedInscription($this); - $session = $inscription->getSession(); + if ($inscription->getValidationEnquete() === null) { + $vm = new ViewModel( + [ + 'title' => "Génération de l'attestation impossible", + 'message' => "Vous n'avez pas encore validé l'enquête de retour de la session de formation", + ]); + $vm->setTemplate('formation/default/message-info'); + return $vm; + } + + $session = $inscription->getSession(); $presences = $this->getPresenceService()->calculerDureePresence($inscription); $logos = []; @@ -292,7 +286,7 @@ class InscriptionController extends AbstractController $signature = $this->findSignatureEtablissement($inscription->getDoctorant()->getEtablissement()); //exporter - $export = new AttestationExporter($this->renderer, 'A4'); + $export = $this->attestationExporter; $export->setVars([ 'signature' => $signature, 'inscription' => $inscription, diff --git a/module/Formation/src/Formation/Controller/InscriptionControllerFactory.php b/module/Formation/src/Formation/Controller/InscriptionControllerFactory.php index 17b3710d2d6820ffe2089ac63f5f0b8613779a38..251dd1d8886c2dbfbab17b2e87351d34932b6172 100644 --- a/module/Formation/src/Formation/Controller/InscriptionControllerFactory.php +++ b/module/Formation/src/Formation/Controller/InscriptionControllerFactory.php @@ -3,6 +3,8 @@ namespace Formation\Controller; use Fichier\Service\Fichier\FichierStorageService; +use Formation\Service\Exporter\Attestation\AttestationExporter; +use Formation\Service\Exporter\Convocation\ConvocationExporter; use Formation\Service\Notification\FormationNotificationFactory; use Formation\Service\Session\SessionService; use Psr\Container\ContainerExceptionInterface; @@ -39,6 +41,7 @@ class InscriptionControllerFactory { * @var PresenceService $presenceService * @var SessionService $sessionService * @var StructureDocumentService $structureDocumentService + * @var AttestationExporter $attestationExporter */ $entityManager = $container->get('doctrine.entitymanager.orm_default'); $doctorantService = $container->get(DoctorantService::class); @@ -50,6 +53,8 @@ class InscriptionControllerFactory { $presenceService = $container->get(PresenceService::class); $sessionService = $container->get(SessionService::class); $structureDocumentService = $container->get(StructureDocumentService::class); + $attestationExporter = $container->get(AttestationExporter::class); + $convocationExporter = $container->get(ConvocationExporter::class); /* @var $renderer PhpRenderer */ $renderer = $container->get('ViewRenderer'); @@ -68,6 +73,8 @@ class InscriptionControllerFactory { $controller->setStructureDocumentService($structureDocumentService); /** forms *****************************************************************************************************/ /** autres*****************************************************************************************************/ + $controller->setAttestationExporter($attestationExporter); + $controller->setConvocationExporter($convocationExporter); $controller->setRenderer($renderer); /** @var \Formation\Service\Notification\FormationNotificationFactory $formationNotificationFactory */ diff --git a/module/Formation/src/Formation/Controller/Recherche/AbstractRechercheController.php b/module/Formation/src/Formation/Controller/Recherche/AbstractRechercheController.php index 7c257115014df313857d2b7a62e598632e955762..160d48170cdd760b340a1b5903c80131f436100c 100755 --- a/module/Formation/src/Formation/Controller/Recherche/AbstractRechercheController.php +++ b/module/Formation/src/Formation/Controller/Recherche/AbstractRechercheController.php @@ -6,14 +6,17 @@ use Application\Controller\AbstractController; use Application\Search\Controller\SearchControllerInterface; use Application\Search\Controller\SearchControllerTrait; use Application\Search\SearchServiceAwareTrait; +use Formation\Provider\Parametre\FormationParametres; use Laminas\Http\Response; use Laminas\Paginator\Paginator as LaminasPaginator; use Laminas\View\Model\ViewModel; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; class AbstractRechercheController extends AbstractController implements SearchControllerInterface { use SearchServiceAwareTrait; use SearchControllerTrait; + use ParametreServiceAwareTrait; protected string $routeName; protected string $indexActionTemplate; @@ -37,6 +40,7 @@ class AbstractRechercheController extends AbstractController implements SearchCo 'paginator' => $paginator, 'routeName' => $this->routeName, 'returnUrl' => $this->getRequest()->getRequestUri(), + 'delai' => $this->getParametreService()?$this->getParametreService()->getParametreByCode(FormationParametres::CATEGORIE, FormationParametres::DELAI_ENQUETE)->getValeur():null, ]); $model->setTemplate($this->indexActionTemplate); diff --git a/module/Formation/src/Formation/Controller/Recherche/EnqueteReponseRechercheControllerFactory.php b/module/Formation/src/Formation/Controller/Recherche/EnqueteReponseRechercheControllerFactory.php index 1e022e0217b7aa27e15ca859fb09f066f989960b..9a0d0906dcd150831060deebb0234ec56779a168 100644 --- a/module/Formation/src/Formation/Controller/Recherche/EnqueteReponseRechercheControllerFactory.php +++ b/module/Formation/src/Formation/Controller/Recherche/EnqueteReponseRechercheControllerFactory.php @@ -8,6 +8,7 @@ use Formation\Entity\Db\Formateur; use Formation\Entity\Db\Session; use Formation\Service\EnqueteReponse\Search\EnqueteReponseSearchService; use Psr\Container\ContainerInterface; +use UnicaenParametre\Service\Parametre\ParametreService; class EnqueteReponseRechercheControllerFactory { @@ -19,8 +20,13 @@ class EnqueteReponseRechercheControllerFactory { $controller = new EnqueteReponseRechercheController(); - /** @var \Doctrine\ORM\EntityManager $em */ + /** + * @var \Doctrine\ORM\EntityManager $em + * @var ParametreService $parametreService + */ $em = $container->get('doctrine.entitymanager.orm_default'); + $parametreService = $container->get(ParametreService::class); + $controller->setParametreService($parametreService); /** @var \Formation\Entity\Db\Repository\EnqueteQuestionRepository $repository */ $repository = $em->getRepository(EnqueteQuestion::class); diff --git a/module/Formation/src/Formation/Controller/Recherche/FormationRechercheControllerFactory.php b/module/Formation/src/Formation/Controller/Recherche/FormationRechercheControllerFactory.php index 29509c0d5312b439548a4e5b9a0db2885acf0e15..d342456c8f2ed62dfba2d896ee936a63ea31c0ff 100644 --- a/module/Formation/src/Formation/Controller/Recherche/FormationRechercheControllerFactory.php +++ b/module/Formation/src/Formation/Controller/Recherche/FormationRechercheControllerFactory.php @@ -4,6 +4,7 @@ namespace Formation\Controller\Recherche; use Formation\Service\Formation\Search\FormationSearchService; use Psr\Container\ContainerInterface; +use UnicaenParametre\Service\Parametre\ParametreService; class FormationRechercheControllerFactory { @@ -13,11 +14,16 @@ class FormationRechercheControllerFactory */ public function __invoke(ContainerInterface $container): FormationRechercheController { - /** @var \Formation\Service\Formation\Search\FormationSearchService $searchService */ + /** + * @var \Formation\Service\Formation\Search\FormationSearchService $searchService + * @var ParametreService $parametreService + */ $searchService = $container->get(FormationSearchService::class); + $parametreService = $container->get(ParametreService::class); $controller = new FormationRechercheController(); $controller->setSearchService($searchService); + $controller->setParametreService($parametreService); return $controller; } diff --git a/module/Formation/src/Formation/Controller/Recherche/InscriptionRechercheControllerFactory.php b/module/Formation/src/Formation/Controller/Recherche/InscriptionRechercheControllerFactory.php index 79780bef04768dd4267b191c1639c415a932c92a..ed07d8407db82580ea74c32c73cf3636e75b5cfe 100644 --- a/module/Formation/src/Formation/Controller/Recherche/InscriptionRechercheControllerFactory.php +++ b/module/Formation/src/Formation/Controller/Recherche/InscriptionRechercheControllerFactory.php @@ -4,6 +4,7 @@ namespace Formation\Controller\Recherche; use Formation\Service\Inscription\Search\InscriptionSearchService; use Psr\Container\ContainerInterface; +use UnicaenParametre\Service\Parametre\ParametreService; class InscriptionRechercheControllerFactory { @@ -13,11 +14,16 @@ class InscriptionRechercheControllerFactory */ public function __invoke(ContainerInterface $container): InscriptionRechercheController { - /** @var \Formation\Service\Inscription\Search\InscriptionSearchService $searchService */ + /** + * @var \Formation\Service\Inscription\Search\InscriptionSearchService $searchService + * @var ParametreService $parametreService + */ $searchService = $container->get(InscriptionSearchService::class); + $parametreService = $container->get(ParametreService::class); $controller = new InscriptionRechercheController(); $controller->setSearchService($searchService); + $controller->setParametreService($parametreService); return $controller; } diff --git a/module/Formation/src/Formation/Controller/Recherche/ModuleRechercheControllerFactory.php b/module/Formation/src/Formation/Controller/Recherche/ModuleRechercheControllerFactory.php index 18491d9175db95b7a99de9e1efb521c68a083fec..cb5d4713c5b0d4641d6eb67df88432e5a047b719 100644 --- a/module/Formation/src/Formation/Controller/Recherche/ModuleRechercheControllerFactory.php +++ b/module/Formation/src/Formation/Controller/Recherche/ModuleRechercheControllerFactory.php @@ -4,6 +4,7 @@ namespace Formation\Controller\Recherche; use Formation\Service\Module\Search\ModuleSearchService; use Psr\Container\ContainerInterface; +use UnicaenParametre\Service\Parametre\ParametreService; class ModuleRechercheControllerFactory { @@ -13,11 +14,17 @@ class ModuleRechercheControllerFactory */ public function __invoke(ContainerInterface $container): ModuleRechercheController { - /** @var \Formation\Service\Module\Search\ModuleSearchService $searchService */ + /** + * @var \Formation\Service\Module\Search\ModuleSearchService $searchService + * @var ParametreService $parametreService + */ $searchService = $container->get(ModuleSearchService::class); + $parametreService = $container->get(ParametreService::class); + $controller = new ModuleRechercheController(); $controller->setSearchService($searchService); + $controller->setParametreService($parametreService); return $controller; } diff --git a/module/Formation/src/Formation/Controller/Recherche/SessionRechercheControllerFactory.php b/module/Formation/src/Formation/Controller/Recherche/SessionRechercheControllerFactory.php index 129218894a00e55bcd853f46f8e7e6ea76ac7abc..02627de3e300697d8e8ac2568ca2766f2dcb90c0 100644 --- a/module/Formation/src/Formation/Controller/Recherche/SessionRechercheControllerFactory.php +++ b/module/Formation/src/Formation/Controller/Recherche/SessionRechercheControllerFactory.php @@ -3,21 +3,29 @@ namespace Formation\Controller\Recherche; use Formation\Service\Session\Search\SessionSearchService; +use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; +use Psr\Container\NotFoundExceptionInterface; +use UnicaenParametre\Service\Parametre\ParametreService; class SessionRechercheControllerFactory { /** - * @throws \Psr\Container\NotFoundExceptionInterface - * @throws \Psr\Container\ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws ContainerExceptionInterface */ public function __invoke(ContainerInterface $container): SessionRechercheController { - /** @var \Formation\Service\Session\Search\SessionSearchService $searchService */ + /** + * @var \Formation\Service\Session\Search\SessionSearchService $searchService + * @var ParametreService $parametreService + */ $searchService = $container->get(SessionSearchService::class); + $parametreService = $container->get(ParametreService::class); $controller = new SessionRechercheController(); $controller->setSearchService($searchService); + $controller->setParametreService($parametreService); return $controller; } diff --git a/module/Formation/src/Formation/Entity/Db/Inscription.php b/module/Formation/src/Formation/Entity/Db/Inscription.php index 932245449aedc7eed943baca85e7f7b08cf6454a..4564e3aac31f3cbb8ff346f72c299a1f6b4757d6 100644 --- a/module/Formation/src/Formation/Entity/Db/Inscription.php +++ b/module/Formation/src/Formation/Entity/Db/Inscription.php @@ -163,5 +163,15 @@ class Inscription implements HistoriqueAwareInterface { return -1; } + /** Pour macro ****************************************************************************************************/ + + /** + * @noinspection PhpUnusedMethod (il s'agit d'une méthode utilisée par les macros) + */ + public function getDureeSuivie() : string + { + $duree = $this->computeDureePresence(); + return "".$duree; + } } \ No newline at end of file diff --git a/module/Formation/src/Formation/Entity/Db/Session.php b/module/Formation/src/Formation/Entity/Db/Session.php index d46c3797296e428ae9b6a2d642782d2f273b63c5..d616e522da52e9df2662962971a8ab0c6ac0fd68 100644 --- a/module/Formation/src/Formation/Entity/Db/Session.php +++ b/module/Formation/src/Formation/Entity/Db/Session.php @@ -303,7 +303,17 @@ class Session implements HistoriqueAwareInterface, /** * @noinspection PhpUnusedMethod (il s'agit d'une méthode utilisée par les macros) - * @return string + */ + public function getPeriode() : string { + $jour_debut = $this->getDateDebut()->format('d/m/Y'); + $jour_fin = $this->getDateFin()->format('d/m/Y'); + + if ($jour_debut === $jour_fin) return $jour_debut; + return $jour_debut." au ".$jour_fin; + } + + /** + * @noinspection PhpUnusedMethod (il s'agit d'une méthode utilisée par les macros) */ public function getSeancesAsTable() : string { @@ -337,4 +347,10 @@ class Session implements HistoriqueAwareInterface, $etatCode = $this->getEtat()->getCode(); return ($etatCode === Session::ETAT_INSCRIPTION_CLOSE OR $etatCode === Session::ETAT_IMMINENTE); } + + public function getDenominationResponsable() : string + { + $responsable = $this->getResponsable(); + return $responsable?$responsable->getNomComplet():"Aucun responsable de désigner pour cette session"; + } } \ No newline at end of file diff --git a/module/Formation/src/Formation/Provider/Parametre/FormationParametres.php b/module/Formation/src/Formation/Provider/Parametre/FormationParametres.php new file mode 100644 index 0000000000000000000000000000000000000000..d74fb36413ab2f488453c0d785238f9d05e4df85 --- /dev/null +++ b/module/Formation/src/Formation/Provider/Parametre/FormationParametres.php @@ -0,0 +1,10 @@ +<?php + +namespace Formation\Provider\Parametre; + +class FormationParametres +{ + const CATEGORIE = 'FORMATION'; + + const DELAI_ENQUETE = 'DELAI_ENQUETE'; +} \ No newline at end of file diff --git a/module/Formation/src/Formation/Provider/Template/PdfTemplates.php b/module/Formation/src/Formation/Provider/Template/PdfTemplates.php index 77d917678416b1002407046a6da728850d906976..a3b82f61530c94c90e68c224aed4f49bf543de80 100644 --- a/module/Formation/src/Formation/Provider/Template/PdfTemplates.php +++ b/module/Formation/src/Formation/Provider/Template/PdfTemplates.php @@ -4,6 +4,7 @@ namespace Formation\Provider\Template; class PdfTemplates { - const CONVOCATION_TEMPLATE = "FORMATION_CONVATION"; + const FORMATION_CONVOCATION = "FORMATION_CONVOCATION"; + const FORMATION_ATTESTATION = "FORMATION_ATTESTATION"; } \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporter.php b/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporter.php index b49a4999bb51f19c6aa891c5a463326676ce7ed9..903ae4ed1ffc7feeff364fa6b92c430335975c0c 100644 --- a/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporter.php +++ b/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporter.php @@ -2,12 +2,27 @@ namespace Formation\Service\Exporter\Attestation; -use UnicaenApp\Exporter\Pdf as PdfExporter; +use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; +use Formation\Entity\Db\Inscription; +use Formation\Provider\Template\PdfTemplates; +use Formation\Service\Url\UrlServiceAwareTrait; +use Structure\Entity\Db\Etablissement; +use Structure\Entity\Db\Structure; +use Structure\Service\Etablissement\EtablissementServiceAwareTrait; +use Structure\Service\Structure\StructureServiceAwareTrait; +use UnicaenPdf\Exporter\PdfExporter as PdfExporter; use Laminas\View\Renderer\PhpRenderer; use Laminas\View\Resolver\TemplatePathStack; +use UnicaenRenderer\Service\Rendu\RenduServiceAwareTrait; class AttestationExporter extends PdfExporter { + use EtablissementServiceAwareTrait; + use FichierStorageServiceAwareTrait; + use RenduServiceAwareTrait; + use StructureServiceAwareTrait; + use UrlServiceAwareTrait; + private $vars; public function setVars(array $vars) @@ -27,10 +42,38 @@ class AttestationExporter extends PdfExporter public function export($filename = null, $destination = self::DESTINATION_BROWSER, $memoryLimit = null) { -// $this->addBodyHtml('<style>' . file_get_contents(APPLICATION_DIR . '/public/css/page-unicaen.css') . '</style>'); - $this->setHeaderScript('empty.phtml'); - $this->setFooterScript('empty.phtml'); - $this->addBodyScript('attestation.phtml', false, $this->vars); + + /** @var Inscription $inscription */ + $inscription = $this->vars['inscription']; + $session = $inscription->getSession(); + $doctorant = $inscription->getDoctorant(); + + $urlService = $this->urlService; + $urlService->setVariables(['etablissement' => $doctorant->getEtablissement()]); + + $vars = [ + 'doctorant' => $doctorant, + 'session' => $session, + 'formation' => $session->getFormation(), + 'inscription' => $inscription, + 'Url' => $urlService, + ]; + + /** @var Etablissement $comue */ + $comue = $this->etablissementService->fetchEtablissementComue(); + /** @var Structure $ced */ + $ced = $this->getStructureService()->getRepository()->findOneBy(['sigle' => 'CED']); + $etab = $session->getSite(); + $logos = [ + "COMUE" => $comue?$this->fichierStorageService->getFileForLogoStructure($comue->getStructure()):null, + "CED" => $ced?$this->fichierStorageService->getFileForLogoStructure($ced):null, + "ETAB" => $etab?$this->fichierStorageService->getFileForLogoStructure($etab->getStructure()):null, + ]; + $rendu = $this->getRenduService()->generateRenduByTemplateCode(PdfTemplates::FORMATION_ATTESTATION, $vars); + $this->getMpdf()->SetMargins(0,0,60); + $this->setHeaderScript('header.phtml', null, $logos); + $this->setFooterScript('footer.phtml'); + $this->addBodyHtml($rendu->getCorps()); return PdfExporter::export($filename, $destination, $memoryLimit); } } \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporterAwareTrait.php b/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporterAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..b072270ed8682f65b87100b7f41a9e5991fb86ef --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporterAwareTrait.php @@ -0,0 +1,19 @@ +<?php + +namespace Formation\Service\Exporter\Attestation; + +trait AttestationExporterAwareTrait { + + private AttestationExporter $attestationExporter; + + public function getAttestationExporter(): AttestationExporter + { + return $this->attestationExporter; + } + + public function setAttestationExporter(AttestationExporter $attestationExporter): void + { + $this->attestationExporter = $attestationExporter; + } + +} \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporterFactory.php b/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporterFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..0ecb3973512559eb8cda2644b293f2a35525426c --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Attestation/AttestationExporterFactory.php @@ -0,0 +1,44 @@ +<?php + +namespace Formation\Service\Exporter\Attestation; + +use Fichier\Service\Fichier\FichierStorageService; +use Formation\Service\Url\UrlService; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; +use Psr\Container\NotFoundExceptionInterface; +use Structure\Service\Etablissement\EtablissementService; +use Structure\Service\Structure\StructureService; +use UnicaenRenderer\Service\Rendu\RenduService; + +class AttestationExporterFactory { + + /** + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function __invoke(ContainerInterface $container) : AttestationExporter + { + /** + * @var EtablissementService $etablissementService + * @var FichierStorageService $fichierStorageService + * @var RenduService $renduService + * @var StructureService $structureService + * @var UrlService $urlService + */ + $etablissementService = $container->get(EtablissementService::class); + $fichierStorageService = $container->get(FichierStorageService::class); + $renduService = $container->get(RenduService::class); + $structureService = $container->get(StructureService::class); + $urlService = $container->get(UrlService::class); + $renderer = $container->get('ViewRenderer'); + + $exporter = new AttestationExporter($renderer, 'A4'); + $exporter->setEtablissementService($etablissementService); + $exporter->setFichierStorageService($fichierStorageService); + $exporter->setRenduService($renduService); + $exporter->setStructureService($structureService); + $exporter->setUrlService($urlService); + return $exporter; + } +} \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Exporter/Attestation/attestation.phtml b/module/Formation/src/Formation/Service/Exporter/Attestation/attestation.phtml deleted file mode 100644 index e686054af21e6956e994b140e12ee29cc665ca2a..0000000000000000000000000000000000000000 --- a/module/Formation/src/Formation/Service/Exporter/Attestation/attestation.phtml +++ /dev/null @@ -1,134 +0,0 @@ -<?php /** @noinspection PhpUnusedAliasInspection */ - -/** - * @see \Formation\Service\Exporter\Convocation\AttestationExporter; - * @var Inscription $inscription - * @var string[] $logos - * @var float $presences - * @var string $signature - */ - -use Individu\Entity\Db\Individu; -use Formation\Entity\Db\Inscription; -use Formation\Entity\Db\Seance; - -$session = $inscription->getSession(); -$doctorant = $inscription->getDoctorant(); - -$libelle = $session->getFormation()->getLibelle(); -$denomination = $doctorant->getIndividu()->getNomComplet(false, false,false,true); -$responsable = null; -if ($individu = $session->getResponsable()) { - $nom = $individu->getNomComplet(false, false,false,true); - $responsable = $nom; -} - -$duree = $session->getDuree(); -$debut = $session->getDateDebut()->format("d/m/Y"); -$fin = $session->getDateFin()->format("d/m/Y"); -$periode = "Période non précisé"; -if ($debut !== null AND $fin !== null) { - if ($debut === $fin) $periode = $debut; - else $periode = $debut. " au " .$fin; -} - -?> - -<?php if (isset($logos['comue'])) : ?> - <div style="width:25%; float:left; position:absolute; top: 20px; left: 20px"> - <?php if ($logos['comue'] !== null): ?> - <img src="<?php echo $logos['comue']; ?>" alt="Logo de la COMUE" /> - <?php else : ?> - <span style='background-color:red;'> - Logo du site manquant - </span> - <?php endif; ?> - </div> - <div style="width:25%; float:right; position:absolute; top: 20px; right: 20px"> - <?php if ($logos['site'] !== null): ?> - <img src="<?php echo $logos['site']; ?>" alt="Logo du site de formation" /> - <?php else : ?> - <span style='background-color:red;'> - Logo du site manquant - </span> - <?php endif; ?> - </div> -<?php else : ?> -<div style="width:25%; float:left; position:absolute; top: 20px; left: 20px"> - <?php if ($logos['site'] !== null): ?> - <img src="<?php echo $logos['site']; ?>" alt="Logo du site de formation" /> - <?php else : ?> - <span style='background-color:red;'> - Logo du site manquant - </span> - <?php endif; ?> -</div> -<?php endif; ?> - -<p> </p> -<p> </p> -<p> </p> -<h1>Attestation de formation - <br/> - <?php echo $libelle; ?> -</h1> - -<p> -Bonjour , -</p> -<p> - Je, - <?php - if ($individu === null) $individu = new Individu(); - switch($individu->getCivilite()) { - case "M." : - echo "soussigné,"; - break; - case "Mme" : - echo "soussignée,"; - break; - default : - echo "soussigné·e,"; - break; - } - ?> - certifie que <strong><?php echo $denomination; ?></strong> a participé à la formation <span class="formation"><?php echo $libelle; ?></span> - qui s'est déroulee sur la période du <?php echo $periode; ?> (Durée : <?php echo $duree; ?> heures). -</p> -<p> - <?php echo $denomination; ?> a suivi <?php echo $presences; ?> heure<?php if ($presences>1) echo "s";?> de formation.</p> - -<p style="text-align: right;"> - <?php - switch($individu->getCivilite()) { - case "M." : - echo "Le"; - break; - case "Mme" : - echo "La"; - break; - default : - echo "Le·a"; - break; - } - ?> - responsable du module <br/> - <?php echo $responsable; ?>, - <br/> - - <img id="logo" style="background-color: white; max-width: 30%;" - src="data:image/png;base64,<?php echo base64_encode($signature); ?>" alt="signature"/> -</p> - - - -<p> -</p> - -<style> - span.formation { - font-weight: bold; - } -</style> - - diff --git a/module/Formation/src/Formation/Service/Exporter/Attestation/empty.phtml b/module/Formation/src/Formation/Service/Exporter/Attestation/empty.phtml deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/module/Formation/src/Formation/Service/Exporter/Attestation/footer.phtml b/module/Formation/src/Formation/Service/Exporter/Attestation/footer.phtml new file mode 100644 index 0000000000000000000000000000000000000000..ea2dee47b2f06339fc3e1efa3f327660166353d3 --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Attestation/footer.phtml @@ -0,0 +1,9 @@ +<?php + + +?> + +<small> +Document généré par ESUP-SyGAL le <?php echo (new DateTime())->format('d/m/Y à H:i'); ?> +</small> + diff --git a/module/Formation/src/Formation/Service/Exporter/Attestation/header.phtml b/module/Formation/src/Formation/Service/Exporter/Attestation/header.phtml new file mode 100644 index 0000000000000000000000000000000000000000..62d6987a339abff025c6063beea7dca3eec0da11 --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Attestation/header.phtml @@ -0,0 +1,4 @@ +<img src="<?php echo $COMUE; ?>" style='max-width:4cm;max-height:4cm;' alt="Logo de la comue"/> +<img src="<?php echo $CED; ?>" style='max-width:4cm;max-height:4cm;' alt="Logo du college"/> +<img src="<?php echo $ETAB; ?>" style='max-width:4cm;max-height:4cm;' alt="Logo de l'etablissement"/> + diff --git a/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporter.php b/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporter.php index 868e023b1dc9c83815d32cb4919dedb154d5ef60..baaa8667f4f2f7fa9cef58d0ecbeff90fe4d9d16 100644 --- a/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporter.php +++ b/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporter.php @@ -2,12 +2,27 @@ namespace Formation\Service\Exporter\Convocation; -use UnicaenApp\Exporter\Pdf as PdfExporter; +use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; +use Formation\Entity\Db\Inscription; +use Formation\Provider\Template\PdfTemplates; +use Formation\Service\Url\UrlServiceAwareTrait; +use Structure\Entity\Db\Etablissement; +use Structure\Entity\Db\Structure; +use Structure\Service\Etablissement\EtablissementServiceAwareTrait; +use Structure\Service\Structure\StructureServiceAwareTrait; +use UnicaenPdf\Exporter\PdfExporter as PdfExporter; use Laminas\View\Renderer\PhpRenderer; use Laminas\View\Resolver\TemplatePathStack; +use UnicaenRenderer\Service\Rendu\RenduServiceAwareTrait; class ConvocationExporter extends PdfExporter { + use EtablissementServiceAwareTrait; + use FichierStorageServiceAwareTrait; + use RenduServiceAwareTrait; + use StructureServiceAwareTrait; + use UrlServiceAwareTrait; + private $vars; public function setVars(array $vars) @@ -27,10 +42,38 @@ class ConvocationExporter extends PdfExporter public function export($filename = null, $destination = self::DESTINATION_BROWSER, $memoryLimit = null) { -// $this->addBodyHtml('<style>' . file_get_contents(APPLICATION_DIR . '/public/css/page-unicaen.css') . '</style>'); - $this->setHeaderScript('empty.phtml'); - $this->setFooterScript('empty.phtml'); - $this->addBodyScript('convocation.phtml', false, $this->vars); + + /** @var Inscription $inscription */ + $inscription = $this->vars['inscription']; + $session = $inscription->getSession(); + $doctorant = $inscription->getDoctorant(); + + $urlService = $this->urlService; + $urlService->setVariables(['etablissement' => $doctorant->getEtablissement()]); + + $vars = [ + 'doctorant' => $doctorant, + 'session' => $session, + 'formation' => $session->getFormation(), + 'inscription' => $inscription, + 'Url' => $urlService, + ]; + + /** @var Etablissement $comue */ + $comue = $this->etablissementService->fetchEtablissementComue(); + /** @var Structure $ced */ + $ced = $this->getStructureService()->getRepository()->findOneBy(['sigle' => 'CED']); + $etab = $session->getSite(); + $logos = [ + "COMUE" => $comue?$this->fichierStorageService->getFileForLogoStructure($comue->getStructure()):null, + "CED" => $ced?$this->fichierStorageService->getFileForLogoStructure($ced):null, + "ETAB" => $etab?$this->fichierStorageService->getFileForLogoStructure($etab->getStructure()):null, + ]; + $rendu = $this->getRenduService()->generateRenduByTemplateCode(PdfTemplates::FORMATION_CONVOCATION, $vars); + $this->getMpdf()->SetMargins(0,0,60); + $this->setHeaderScript('header.phtml', null, $logos); + $this->setFooterScript('footer.phtml'); + $this->addBodyHtml($rendu->getCorps()); return PdfExporter::export($filename, $destination, $memoryLimit); } } \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporterAwareTrait.php b/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporterAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..518079850c9f511ec7162ac0b801c4f5dd6ae115 --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporterAwareTrait.php @@ -0,0 +1,19 @@ +<?php + +namespace Formation\Service\Exporter\Convocation; + +trait ConvocationExporterAwareTrait { + + private ConvocationExporter $convocationExporter; + + public function getConvocationExporter(): ConvocationExporter + { + return $this->convocationExporter; + } + + public function setConvocationExporter(ConvocationExporter $convocationExporter): void + { + $this->convocationExporter = $convocationExporter; + } + +} \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporterFactory.php b/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporterFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..1bf74275f56043b08f499c8474803dbafb6702c1 --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Convocation/ConvocationExporterFactory.php @@ -0,0 +1,44 @@ +<?php + +namespace Formation\Service\Exporter\Convocation; + +use Fichier\Service\Fichier\FichierStorageService; +use Formation\Service\Url\UrlService; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; +use Psr\Container\NotFoundExceptionInterface; +use Structure\Service\Etablissement\EtablissementService; +use Structure\Service\Structure\StructureService; +use UnicaenRenderer\Service\Rendu\RenduService; + +class ConvocationExporterFactory { + + /** + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function __invoke(ContainerInterface $container) : ConvocationExporter + { + /** + * @var EtablissementService $etablissementService + * @var FichierStorageService $fichierStorageService + * @var RenduService $renduService + * @var StructureService $structureService + * @var UrlService $urlService + */ + $etablissementService = $container->get(EtablissementService::class); + $fichierStorageService = $container->get(FichierStorageService::class); + $renduService = $container->get(RenduService::class); + $structureService = $container->get(StructureService::class); + $urlService = $container->get(UrlService::class); + $renderer = $container->get('ViewRenderer'); + + $exporter = new ConvocationExporter($renderer, 'A4'); + $exporter->setEtablissementService($etablissementService); + $exporter->setFichierStorageService($fichierStorageService); + $exporter->setRenduService($renduService); + $exporter->setStructureService($structureService); + $exporter->setUrlService($urlService); + return $exporter; + } +} \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Exporter/Convocation/convocation.phtml b/module/Formation/src/Formation/Service/Exporter/Convocation/convocation.phtml deleted file mode 100644 index 80f972d28c723a4b7741f584b56d04b904c9656e..0000000000000000000000000000000000000000 --- a/module/Formation/src/Formation/Service/Exporter/Convocation/convocation.phtml +++ /dev/null @@ -1,154 +0,0 @@ -<?php - -/** - * @see \Formation\Service\Exporter\Convocation\ConvocationExporter; - * @var Inscription $inscription - * @var string[] $logos - * @var string $signature - */ - -use Formation\Entity\Db\Inscription; -use Formation\Entity\Db\Seance; - -$session = $inscription->getSession(); -$doctorant = $inscription->getDoctorant(); - -$libelle = $session->getFormation()->getLibelle(); -$denomination = $doctorant->getIndividu()->getNomComplet(false, false,false,true); -$responsable = null; -if ($individu = $session->getResponsable()) { - $nom = $individu->getNomComplet(false, false,false,true); - $email = $individu->getEmailPro(); - $responsable = $nom; - if ($email) $responsable .= " <i>" .$email."</i>"; -} - -/** @var Seance[] $seances */ -$seances = $session->getSeances()->toArray(); -$seances = array_filter($seances, function ($a) { return $a->estNonhistorise();}); -usort($seances, function ($a, $b) { return $a->getDebut() > $b->getDebut(); }); - -?> - -<?php if (isset($logos['comue'])) : ?> - <div style="width:25%; float:left; position:absolute; top: 20px; left: 20px"> - <?php if ($logos['comue'] !== null): ?> - <img src="<?php echo $logos['comue']; ?>" alt="Logo de la COMUE" /> - <?php else : ?> - <span style='background-color:red;'> - Logo du site manquant - </span> - <?php endif; ?> - </div> - <div style="width:25%; float:right; position:absolute; top: 20px; right: 20px"> - <?php if ($logos['site'] !== null): ?> - <img src="<?php echo $logos['site']; ?>" alt="Logo du site de formation" /> - <?php else : ?> - <span style='background-color:red;'> - Logo du site manquant - </span> - <?php endif; ?> - </div> -<?php else : ?> -<div style="width:25%; float:left; position:absolute; top: 20px; left: 20px"> - <?php if ($logos['site'] !== null): ?> - <img src="<?php echo $logos['site']; ?>" alt="Logo du site de formation" /> - <?php else : ?> - <span style='background-color:red;'> - Logo du site manquant - </span> - <?php endif; ?> -</div> -<?php endif; ?> - -<p> </p> -<p> </p> -<p> </p> -<h1>Convocation à la session de formation - <br/> - <?php echo $libelle; ?> -</h1> - - -<p> -Bonjour <?php echo $denomination; ?>, -</p> - -<p> - Nous avons le plaisir de vous informer que la formation, <q><?php echo $libelle; ?></q>, à laquelle vous êtes inscrit·e se déroulera selon le calendrier ci-dessous : -</p> - -<table class="seances"> - <thead> - <tr> - <th> Lieu</th> - <th> Date</th> - <th> Début</th> - <th> Fin</th> - </tr> - </thead> - <tbody> - <?php foreach ($seances as $seance) : ?> - <tr> - <td> <?php echo $seance->getLieu(); ?> </td> - <td> <?php echo $seance->getDebut()->format('d/m/Y'); ?> </td> - <td> <?php echo $seance->getDebut()->format('H:i'); ?> </td> - <td> <?php echo $seance->getFin()->format('H:i'); ?> </td> - </tr> - <?php endforeach; ?> - </tbody> -</table> - -<p> - En cas d'impossibilité d'assister à tout ou partie de ce stage, merci de bien vouloir informer le·a responsable - du module de formation (<?php echo $responsable; ?>) dans les meilleurs délais afin de permettre de contacter un·e doctorant·e actuellement sur liste d'attente. -</p> -<p> - Nous vous souhaitons un stage fructueux. -</p> -<p></p> -<p style="text-align: right;">L'application SyGAL</p> -<br/> -<img id="logo" style="background-color: white; max-width: 50%;" alt="Signature" - src="data:image/png;base64,<?php echo base64_encode($signature); ?>"/> - -<p> -</p> - -<p style="text-align: left;">PS: Cette convocation vaut ordre de mission</p> - - - - -<style> - table.seances { - width:15.5cm; - display: block; - margin-left: auto; - margin-right: auto; - border-collapse: collapse; - } - - table.seances th { - background-color: #F5A756; - font-family: Arial, Helvetica, sans-serif; - font-weight: bold; - font-size:12pt; - text-align: center; - border: 0.3mm solid #F5A756; - border-collapse: collapse; - } - - table.seances td { - font-size: 10pt; - min-width: 4cm; - - font-family: Arial, Helvetica, sans-serif; - - border: 0.3mm solid #F5A756; - border-collapse: collapse; - padding: 1mm; - } -</style> - - diff --git a/module/Formation/src/Formation/Service/Exporter/Convocation/empty.phtml b/module/Formation/src/Formation/Service/Exporter/Convocation/empty.phtml deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/module/Formation/src/Formation/Service/Exporter/Convocation/footer.phtml b/module/Formation/src/Formation/Service/Exporter/Convocation/footer.phtml new file mode 100644 index 0000000000000000000000000000000000000000..ea2dee47b2f06339fc3e1efa3f327660166353d3 --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Convocation/footer.phtml @@ -0,0 +1,9 @@ +<?php + + +?> + +<small> +Document généré par ESUP-SyGAL le <?php echo (new DateTime())->format('d/m/Y à H:i'); ?> +</small> + diff --git a/module/Formation/src/Formation/Service/Exporter/Convocation/header.phtml b/module/Formation/src/Formation/Service/Exporter/Convocation/header.phtml new file mode 100644 index 0000000000000000000000000000000000000000..62d6987a339abff025c6063beea7dca3eec0da11 --- /dev/null +++ b/module/Formation/src/Formation/Service/Exporter/Convocation/header.phtml @@ -0,0 +1,4 @@ +<img src="<?php echo $COMUE; ?>" style='max-width:4cm;max-height:4cm;' alt="Logo de la comue"/> +<img src="<?php echo $CED; ?>" style='max-width:4cm;max-height:4cm;' alt="Logo du college"/> +<img src="<?php echo $ETAB; ?>" style='max-width:4cm;max-height:4cm;' alt="Logo de l'etablissement"/> + diff --git a/module/Formation/src/Formation/Service/Url/UrlService.php b/module/Formation/src/Formation/Service/Url/UrlService.php new file mode 100644 index 0000000000000000000000000000000000000000..1e640faea504b560b956d6584ca6685b3f36e0fe --- /dev/null +++ b/module/Formation/src/Formation/Service/Url/UrlService.php @@ -0,0 +1,46 @@ +<?php + +namespace Formation\Service\Url; + +use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; +use Fichier\Service\Storage\Adapter\Exception\StorageAdapterException; +use Formation\Provider\NatureFichier\NatureFichier; +use Laminas\View\Renderer\PhpRenderer; +use Structure\Entity\Db\Etablissement; +use Structure\Service\StructureDocument\StructureDocumentServiceAwareTrait; +use UnicaenApp\Exception\RuntimeException; + +class UrlService { + use FichierStorageServiceAwareTrait; + use StructureDocumentServiceAwareTrait; + + /** @var PhpRenderer */ + protected $renderer; + protected array $variables = []; + + public function setVariables(array $variables) : void + { + $this->variables = $variables; + } + + public function getFormationSignature() : string + { + /** @var Etablissement $etablissement */ + $etablissement = $this->variables['etablissement']; + if ($etablissement === null) return "Aucun établissement"; + + $fichier = $this->structureDocumentService->findDocumentFichierForStructureNatureAndEtablissement( + $etablissement->getStructure(), + NatureFichier::CODE_SIGNATURE_FORMATION, + $etablissement); + if ($fichier === null) return "Aucune signature"; + + try { + $this->fichierStorageService->setGenererFichierSubstitutionSiIntrouvable(false); + $content = $this->fichierStorageService->getFileContentForFichier($fichier); + } catch (StorageAdapterException $e) { + throw new RuntimeException("Un problème est survenu lors de la récupération de la signature !", 0, $e); + } + return '<img src="data:image/png;base64,'. base64_encode($content). '" style="max-width:5cm;"/>'; + } +} \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Url/UrlServiceAwareTrait.php b/module/Formation/src/Formation/Service/Url/UrlServiceAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..64e1b7c77bc2b78f5920cdb87f40a8a42ecaa90d --- /dev/null +++ b/module/Formation/src/Formation/Service/Url/UrlServiceAwareTrait.php @@ -0,0 +1,24 @@ +<?php + +namespace Formation\Service\Url; + +trait UrlServiceAwareTrait { + + private UrlService $urlService; + + /** + * @return UrlService + */ + public function getUrlService(): UrlService + { + return $this->urlService; + } + + /** + * @param UrlService $urlService + */ + public function setUrlService(UrlService $urlService): void + { + $this->urlService = $urlService; + } +} \ No newline at end of file diff --git a/module/Formation/src/Formation/Service/Url/UrlServiceFactory.php b/module/Formation/src/Formation/Service/Url/UrlServiceFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..a17ad34bef9c8dbe6744e713875053d1ddfc7190 --- /dev/null +++ b/module/Formation/src/Formation/Service/Url/UrlServiceFactory.php @@ -0,0 +1,31 @@ +<?php + +namespace Formation\Service\Url; + +use Fichier\Service\Fichier\FichierStorageService; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; +use Psr\Container\NotFoundExceptionInterface; +use Structure\Service\StructureDocument\StructureDocumentService; + +class UrlServiceFactory { + + /** + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function __invoke(ContainerInterface $container) : UrlService + { + /** + * @var FichierStorageService $fichierStorageService + * @var StructureDocumentService $structureDocumentService + */ + $fichierStorageService = $container->get(FichierStorageService::class); + $structureDocumentService = $container->get(StructureDocumentService::class); + + $service = new UrlService(); + $service->setFichierStorageService($fichierStorageService); + $service->setStructureDocumentService($structureDocumentService); + return $service; + } +} \ No newline at end of file diff --git a/module/Formation/view/formation/default/message-info.phtml b/module/Formation/view/formation/default/message-info.phtml new file mode 100644 index 0000000000000000000000000000000000000000..de6555e8edbb735fef0498d3fe506485a8fea5cc --- /dev/null +++ b/module/Formation/view/formation/default/message-info.phtml @@ -0,0 +1,17 @@ +<?php + +/** + * @var string $title + * @var string $message + */ + +$this->headTitle($title); +?> + +<h1 class="page-header"> + <?php echo $title; ?> +</h1> + +<div class="lead"> + <?php echo $message; ?> +</div> diff --git a/module/Formation/view/formation/enquete-question/repondre-questions.phtml b/module/Formation/view/formation/enquete-question/repondre-questions.phtml index a65a9cb560b68904bc8ccef698cd4b794bc41ea2..b72ddfc056e3b6a19b858bd4806630ad7bb5bdce 100644 --- a/module/Formation/view/formation/enquete-question/repondre-questions.phtml +++ b/module/Formation/view/formation/enquete-question/repondre-questions.phtml @@ -11,6 +11,7 @@ use Formation\Form\EnqueteReponse\EnqueteReponseForm; * @var EnqueteCategorie[] $categories * @var EnqueteQuestion[] $questions * @var EnqueteReponseForm $form + * @var DateTime $date */ $categories = array_filter($categories, function (EnqueteCategorie $a) { return $a->estNonHistorise();}); @@ -24,6 +25,16 @@ usort($categories, function (EnqueteCategorie $a, EnqueteCategorie $b) { return <?php echo $inscription->getDoctorant()->getIndividu()->getNomComplet(); ?> </h1> +<div class="alert alert-warning"> + + <span class="lead"> + <strong> + <span class="icon icon-attention"></span> + Attention, vous devez repondre et valider l'enquête pour le <?php echo $date->format('d/m/Y'); ?>. + </strong> + </span> +</div> + <?php echo $this->form()->openTag($form); ?> <?php foreach ($categories as $categorie) : ?> diff --git a/module/Formation/view/formation/index/index-doctorant.phtml b/module/Formation/view/formation/index/index-doctorant.phtml index 6865dfd25b42bdb34076a7df19286da77e890a42..a6c51220308ccc5a391422b885a0656deeb0f55b 100644 --- a/module/Formation/view/formation/index/index-doctorant.phtml +++ b/module/Formation/view/formation/index/index-doctorant.phtml @@ -7,6 +7,7 @@ * @var Session[] $preparations * @var Inscription[] $inscriptions * @var EnqueteReponse[] $reponses; + * @var int $delai; */ @@ -42,8 +43,9 @@ $canSupprimerInscription = $this->isAllowed(InscriptionPrivileges::getResourceId $canConvocationInscription = $this->isAllowed(InscriptionPrivileges::getResourceId(InscriptionPrivileges::INSCRIPTION_CONVOCATION)); $canRepondreEnquete = $this->isAllowed(EnquetePrivileges::getResourceId(EnquetePrivileges::ENQUETE_REPONSE_REPONDRE)); $canAttestationInscription = $this->isAllowed(InscriptionPrivileges::getResourceId(InscriptionPrivileges::INSCRIPTION_ATTESTATION)); - $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModulePrivileges::MODULE_CATALOGUE)); + +$now = new DateTime(); ?> <h1 class="page-header"> @@ -429,25 +431,41 @@ $canCatalogueAfficher = $this->isAllowed(ModulePrivileges::getResourceId(ModuleP <br/> <?php if ($inscription->computeDureePresence() > 0) : ?> <?php if ($canRepondreEnquete AND $inscription->getValidationEnquete() === null) : ?> - <?php /** @see \Formation\Controller\EnqueteQuestionController::repondreQuestionsAction() */?> - <a href="<?php echo $this->url('formation/enquete/repondre-questions', ['inscription' => $inscription->getId()], [], true); ?>"> - <span class="icon icon-edit" - title="Compléter l'enquête" data-bs-toggle="tooltip" data-bs-html="true" - ></span>Compléter l'enquête</a> - <?php /** @see \Formation\Controller\EnqueteQuestionController::validerQuestionsAction() */?> - <a href="<?php echo $this->url('formation/enquete/valider-questions', ['inscription' => $inscription->getId()], [], true); ?>" - class="ajax-modal" data-event="modification" - > - <span class="icon icon-checked" - title="Valider l'enquête" data-bs-toggle="tooltip" data-bs-html="true" - ></span>Valider l'enquête</a> + <?php + $dateFin = $inscription->getSession()->getDateFin(); + $dateButoir = $dateFin->add(new DateInterval('P'.$delai.'D')); + ?> + <?php if ($now <= $dateButoir) : ?> + <span class="text-warning"> Date butoir : <?php echo $dateButoir->format('d/m/Y'); ?></span><br/> + <?php /** @see \Formation\Controller\EnqueteQuestionController::repondreQuestionsAction() */?> + <a href="<?php echo $this->url('formation/enquete/repondre-questions', ['inscription' => $inscription->getId()], [], true); ?>" + title="Compléter l'enquête (date butoir: <?php echo $dateButoir->format('d/m/Y'); ?>)" data-bs-toggle="tooltip" data-bs-html="true" + > + <span class="icon icon-edit"></span> + Compléter l'enquête + </a> + <br/> + <?php else : ?> + <span class="text-danger" + title="Impossible de valider l'enquête après la date butoir (date butoir: <?php echo $dateButoir->format('d/m/Y'); ?>)" data-bs-toggle="tooltip" data-bs-html="true" + > + <span class="icon icon-unchecked"></span> + Date butoir dépassée + </span> + <?php endif; ?> <?php endif; ?> <?php if ($inscription->getValidationEnquete() !== null AND $canAttestationInscription) : ?> - <?php /** @see \Formation\Controller\InscriptionController::genererAttestationAction() */?> - <a href="<?php echo $this->url('formation/inscription/generer-attestation', ['inscription' => $inscription->getId()], [], true); ?>" target="_blank"> - <span class="icon icon-pdf" - title="Télécharger l'attestation" data-bs-toggle="tooltip" data-bs-html="true" - ></span>Télécharger l'attestation</a> + <?php if ($session->getEtat()->getCode() === Etat::CODE_CLOTURER) : ?> + <?php /** @see \Formation\Controller\InscriptionController::genererAttestationAction() */?> + <a href="<?php echo $this->url('formation/inscription/generer-attestation', ['inscription' => $inscription->getId()], [], true); ?>" target="_blank"> + <span class="icon icon-pdf" title="Télécharger l'attestation" data-bs-toggle="tooltip" data-bs-html="true"></span> + Télécharger l'attestation + </a> + <?php else : ?> + <span class="text-warning"> + L'attestation sera disponible à la clôture de la session + </span> + <?php endif; ?> <?php endif; ?> <?php else :?> Pas de présence diff --git a/module/Formation/view/formation/inscription/recherche/index.phtml b/module/Formation/view/formation/inscription/recherche/index.phtml index 03e09e7f002b4a94ba2feec816a03b718423e6e7..26798879ad8934affe43f02a4c400365d683112e 100644 --- a/module/Formation/view/formation/inscription/recherche/index.phtml +++ b/module/Formation/view/formation/inscription/recherche/index.phtml @@ -2,7 +2,11 @@ namespace Application; +use DateInterval; +use DateTime; +use Formation\Entity\Db\Etat; use Formation\Entity\Db\Inscription; +use Formation\Entity\Db\Session; use Formation\Provider\Privilege\InscriptionPrivileges; use Formation\Provider\Privilege\SessionPrivileges; use Laminas\Paginator\Paginator as LaminasPaginator; @@ -12,6 +16,7 @@ use Laminas\Paginator\Paginator as LaminasPaginator; * @var LaminasPaginator $paginator * @var string $routeName * @var string $returnUrl + * @var int $delai * * @see \Formation\Controller\Recherche\SessionRechercheController::indexAction() */ @@ -19,9 +24,10 @@ use Laminas\Paginator\Paginator as LaminasPaginator; $this->headTitle($this->translate($title)); $canVoirSession = $this->isAllowed(SessionPrivileges::getResourceId(SessionPrivileges::SESSION_AFFICHER)); - $canHistoriserInscription = $this->isAllowed(InscriptionPrivileges::getResourceId(InscriptionPrivileges::INSCRIPTION_HISTORISER)); $canSupprimerInscription = $this->isAllowed(InscriptionPrivileges::getResourceId(InscriptionPrivileges::INSCRIPTION_SUPPRIMER)); + +$now = new DateTime(); ?> <h1 class="page-header"><?php echo $title ?></h1> @@ -58,15 +64,21 @@ $canSupprimerInscription = $this->isAllowed(InscriptionPrivileges::getReso <tbody> <?php /** @var Inscription $inscription*/ ?> <?php foreach ($paginator as $inscription) : ?> + <?php + $session = $inscription->getSession(); + $individu = $inscription->getDoctorant()->getIndividu(); + $dateButoir = $session->getDateFin()->add(new DateInterval('P'.$delai.'D')); + ?> <tr> <td> <?php echo $inscription->getId(); ?> </td> <td> <span class="<?php if ($inscription->estHistorise()) echo "historise text-danger"; ?>" title="<?php echo $inscription->getDescription(); ?>" data-bs-toggle="tooltip" data-bs-html="true" > - <?php echo $inscription->getSession()->getId(); ?> - <?php echo $inscription->getSession()->getFormation()->getLibelle(); ?> + <?php // echo $session->getId(); ?> + <?php echo $session->getFormation()->getLibelle(); ?> </span> + <?php echo $this->etat($session); ?> </td> <td> <span class="<?php if ($inscription->estHistorise()) echo "historise text-danger"; ?>" @@ -74,6 +86,17 @@ $canSupprimerInscription = $this->isAllowed(InscriptionPrivileges::getReso > <?php echo $inscription->getDoctorant()->getIndividu()->getNomComplet(); ?> </span> + <?php if ($session->getEtat()->getCode() === Etat::CODE_CLOTURER) : ?> + <?php if ($inscription->getValidationEnquete()) : ?> + <span class="icon icon-checked text-success" title="Enquête validée le <?php echo $inscription->getValidationEnquete()->format('d/m/Y'); ?>"></span> + <?php else : ?> + <?php if ($now < $dateButoir) : ?> + <span class="icon icon-wait text-info" title="Enquête non validée (date butoir: <?php echo $dateButoir->format('d/m/Y'); ?>)"></span> + <?php else : ?> + <span class="icon icon-unchecked text-danger" title="Enquête non saisie (date butoir: <?php echo $dateButoir->format('d/m/Y'); ?>)"></span> + <?php endif; ?> + <?php endif; ?> + <?php endif; ?> </td> <td> <?php if ($inscription->isListePrincipale()) : ?> diff --git a/module/Soutenance/config/others/configuration.config.php b/module/Soutenance/config/others/configuration.config.php deleted file mode 100644 index 9c5b6c90cbf868233741ab547ade5a754802629d..0000000000000000000000000000000000000000 --- a/module/Soutenance/config/others/configuration.config.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Soutenance; - -use Soutenance\Controller\ConfigurationController; -use Soutenance\Controller\ConfigurationControllerFactory; -use Soutenance\Form\Configuration\ConfigurationForm; -use Soutenance\Form\Configuration\ConfigurationFormFactory; -use Soutenance\Provider\Privilege\QualitePrivileges; -use Soutenance\Service\Parametre\ParametreService; -use Soutenance\Service\Parametre\ParametreServiceFactory; -use UnicaenAuth\Guard\PrivilegeController; -use Laminas\Router\Http\Literal; - -return array( - 'bjyauthorize' => [ - 'guards' => [ - PrivilegeController::class => [ - [ - 'controller' => ConfigurationController::class, - 'action' => [ - 'index', - ], - 'privileges' => QualitePrivileges::SOUTENANCE_QUALITE_MODIFIER, - ], - - ], - ], - ], - - 'router' => [ - 'routes' => [ - 'configuration' => [ - 'type' => Literal::class, - 'may_terminate' => true, - 'options' => [ - 'route' => '/configuration', - 'defaults' => [ - 'controller' => ConfigurationController::class, - 'action' => 'index', - ], - ], - ], - ], - ], - - 'navigation' => [ - 'default' => [ - 'home' => [ - 'pages' => [ - 'admin' => [ - 'pages' => [ - 'qualite' => [ - 'label' => 'Qualités des membres', - 'route' => 'qualite', - 'order' => 1000, - 'resource' => QualitePrivileges::getResourceId(QualitePrivileges::SOUTENANCE_QUALITE_VISUALISER), - ], - ], - ], - ], - ], - ], - ], - - - 'service_manager' => [ - 'factories' => [ - ParametreService::class => ParametreServiceFactory::class, - ], - ], - 'controllers' => [ - 'factories' => [ - ConfigurationController::class => ConfigurationControllerFactory::class, - ], - ], - - 'form_elements' => [ - 'factories' => [ - ConfigurationForm::class => ConfigurationFormFactory::class, - ], - ], - -); diff --git a/module/Soutenance/config/others/presoutenance.config.php b/module/Soutenance/config/others/presoutenance.config.php index ee372ed29beaf0f158d727bf15c96377249b62f0..aa9cbadb6307fec882e209cddbbd3231c4c2112e 100644 --- a/module/Soutenance/config/others/presoutenance.config.php +++ b/module/Soutenance/config/others/presoutenance.config.php @@ -70,7 +70,6 @@ return [ 'convocations', 'modifier-adresse', 'envoyer-convocation', - 'rapport-technique', 'transmettre-documents-direction-these', ], 'privileges' => PresoutenancePrivileges::PRESOUTENANCE_DATE_RETOUR_MODIFICATION, @@ -82,6 +81,7 @@ return [ 'convocation-membre', 'proces-verbal-soutenance', 'rapport-soutenance', + 'rapport-technique', ], 'roles' => [], ], diff --git a/module/Soutenance/config/others/qualite.config.php b/module/Soutenance/config/others/qualite.config.php index c612e567677f1d61beb1aca2b284a160e579249f..6d932430358510fdafa4c27a9fb32c83b68437d7 100644 --- a/module/Soutenance/config/others/qualite.config.php +++ b/module/Soutenance/config/others/qualite.config.php @@ -115,25 +115,6 @@ return array( ], ], - 'navigation' => [ - 'default' => [ - 'home' => [ - 'pages' => [ - 'admin' => [ - 'pages' => [ - 'configuration' => [ - 'label' => 'Paramétrage du module de soutenance', - 'route' => 'configuration', - 'order' => 2000, - 'resource' => QualitePrivileges::getResourceId(QualitePrivileges::SOUTENANCE_QUALITE_VISUALISER), - ], - ], - ], - ], - ], - ], - ], - 'service_manager' => [ 'factories' => [ QualiteService::class => QualiteServiceFactory::class, diff --git a/module/Soutenance/src/Soutenance/Assertion/InterventionAssertion.php b/module/Soutenance/src/Soutenance/Assertion/InterventionAssertion.php index 67fd4290e8c8a178e21d738d4f6073f98ed12c93..f7f0f0af15cfc885c2628bfe7df0d2f833de4b37 100644 --- a/module/Soutenance/src/Soutenance/Assertion/InterventionAssertion.php +++ b/module/Soutenance/src/Soutenance/Assertion/InterventionAssertion.php @@ -3,18 +3,19 @@ namespace Soutenance\Assertion; use Application\Entity\Db\Role; +use Soutenance\Provider\Parametre\SoutenanceParametres; use These\Entity\Db\These; use These\Service\These\TheseServiceAwareTrait; use Application\Service\UserContextServiceAwareTrait; use DateInterval; use DateTime; use Soutenance\Provider\Privilege\InterventionPrivileges; -use Soutenance\Service\Parametre\ParametreServiceAwareTrait; use Soutenance\Service\Proposition\PropositionServiceAwareTrait; use Laminas\Permissions\Acl\Acl; use Laminas\Permissions\Acl\Assertion\AssertionInterface; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Laminas\Permissions\Acl\Role\RoleInterface; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; class InterventionAssertion implements AssertionInterface { @@ -45,7 +46,7 @@ class InterventionAssertion implements AssertionInterface $proposition = $this->getPropositionService()->findOneForThese($these); $date_soutenance = ($these->getDateSoutenance())?$these->getDateSoutenance():$proposition->getDate(); - $interval = $this->getParametreService()->getParametreByCode('PERIODE_INTERVENTION_DIRECTEUR')->getValeur(); + $interval = $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DELAI_INTERVENTION)->getValeur(); $mini = (new DateTime())->sub(new DateInterval('P'.$interval.'D')); $maxi = (new DateTime())->add(new DateInterval('P'.$interval.'D')); diff --git a/module/Soutenance/src/Soutenance/Assertion/InterventionAssertionFactory.php b/module/Soutenance/src/Soutenance/Assertion/InterventionAssertionFactory.php index 5ee0622f876c751a8f8384620391710e054cebc7..cd5251050a2163728daf09106e18ffcdbd9b906b 100644 --- a/module/Soutenance/src/Soutenance/Assertion/InterventionAssertionFactory.php +++ b/module/Soutenance/src/Soutenance/Assertion/InterventionAssertionFactory.php @@ -2,11 +2,13 @@ namespace Soutenance\Assertion; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use These\Service\These\TheseService; use Application\Service\UserContextService; use Interop\Container\ContainerInterface; -use Soutenance\Service\Parametre\ParametreService; use Soutenance\Service\Proposition\PropositionService; +use UnicaenParametre\Service\Parametre\ParametreService; class InterventionAssertionFactory { @@ -14,8 +16,10 @@ class InterventionAssertionFactory /** * @param ContainerInterface $container * @return InterventionAssertion + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ - public function __invoke(ContainerInterface $container) + public function __invoke(ContainerInterface $container) : InterventionAssertion { /** * @var TheseService $theseService diff --git a/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertion.php b/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertion.php index 3d46e29efd7bcd9bdfb9e62cadca1dbbc416d897..4d822acf94c064a852350bc3008039c842080b0d 100644 --- a/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertion.php +++ b/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertion.php @@ -9,12 +9,12 @@ use Application\Service\UserContextServiceAwareTrait; use DateTime; use Soutenance\Entity\Etat; use Soutenance\Provider\Privilege\JustificatifPrivileges; -use Soutenance\Service\Parametre\ParametreServiceAwareTrait; use Soutenance\Service\Proposition\PropositionServiceAwareTrait; use Laminas\Permissions\Acl\Acl; use Laminas\Permissions\Acl\Assertion\AssertionInterface; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Laminas\Permissions\Acl\Role\RoleInterface; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; class JustificatifAssertion implements AssertionInterface { use UserContextServiceAwareTrait; diff --git a/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertionFactory.php b/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertionFactory.php index 78e58e3b4252a6d5da7594e85a867801b568706f..3a728d639516f1001a19a2cb76593e8592711b12 100644 --- a/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertionFactory.php +++ b/module/Soutenance/src/Soutenance/Assertion/JustificatifAssertionFactory.php @@ -2,11 +2,13 @@ namespace Soutenance\Assertion; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use These\Service\These\TheseService; use Application\Service\UserContextService; use Interop\Container\ContainerInterface; -use Soutenance\Service\Parametre\ParametreService; use Soutenance\Service\Proposition\PropositionService; +use UnicaenParametre\Service\Parametre\ParametreService; class JustificatifAssertionFactory { @@ -14,8 +16,10 @@ class JustificatifAssertionFactory /** * @param ContainerInterface $container * @return JustificatifAssertion + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ - public function __invoke(ContainerInterface $container) + public function __invoke(ContainerInterface $container) : JustificatifAssertion { /** * @var TheseService $theseService diff --git a/module/Soutenance/src/Soutenance/Controller/ConfigurationController.php b/module/Soutenance/src/Soutenance/Controller/ConfigurationController.php deleted file mode 100644 index e898bb2fb4406447f95815b7eb6e6c9be49fe42e..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Controller/ConfigurationController.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Soutenance\Controller; - -use Soutenance\Entity\Parametre; -use Soutenance\Form\Configuration\ConfigurationForm; -use Soutenance\Form\Configuration\ConfigurationFormAwareTrait; -use Soutenance\Service\Parametre\ParametreServiceAwareTrait; -use Laminas\Http\Request; -use Laminas\Mvc\Controller\AbstractActionController; -use Laminas\View\Model\ViewModel; - -class ConfigurationController extends AbstractActionController -{ - use ParametreServiceAwareTrait; - use ConfigurationFormAwareTrait; - - public function indexAction() - { - /** @var ConfigurationForm $form */ - $form = $this->getConfigurationForm(); - - //todo faire une fonction dans le service ... formulaire avec une collection - $params = [ - Parametre::CODE_AVIS_DEADLINE, - Parametre::CODE_JURY_SIZE_MIN, - Parametre::CODE_JURY_SIZE_MAX, - Parametre::CODE_JURY_RAPPORTEUR_SIZE_MIN, - Parametre::CODE_JURY_RANGA_RATIO_MIN, - Parametre::CODE_JURY_EXTERIEUR_RATIO_MIN, - Parametre::CODE_JURY_PARITE_RATIO_MIN, - - Parametre::CODE_FORMULAIRE_DELOCALISATION, - Parametre::CODE_FORMULAIRE_DELEGUATION, - Parametre::CODE_FORMULAIRE_THESE_ANGLAIS, - Parametre::CODE_FORMULAIRE_LABEL_EUROPEEN, - Parametre::CODE_FORMULAIRE_CONFIDENTIALITE, - - Parametre::CODE_DIRECTEUR_INTERVENTION, - ]; - - foreach ($params as $param) { - $value = $this->getParametreService()->getParametreByCode($param); - - if ($value !== null) $form->get($param)->setValue($this->getParametreService()->getParametreByCode($param)->getValeur()); - } - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - foreach ($data as $key => $valeur) { - if (array_search($key, $params) !== false) { - $parametre = $this->getParametreService()->getParametreByCode($key)->setValeur($valeur); - $this->getParametreService()->update($parametre); - } - } - $this->redirect()->toRoute('configuration'); - } - - return new ViewModel([ - 'form' => $form, - ]); - } -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Controller/ConfigurationControllerFactory.php b/module/Soutenance/src/Soutenance/Controller/ConfigurationControllerFactory.php deleted file mode 100644 index 6090359f285d8ac1437d0931a1fa6c9bac00e018..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Controller/ConfigurationControllerFactory.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Soutenance\Controller; - -use Interop\Container\ContainerInterface; -use Soutenance\Form\Configuration\ConfigurationForm; -use Soutenance\Service\Parametre\ParametreService; - -class ConfigurationControllerFactory { - - /** - * @param ContainerInterface $container - * @return ConfigurationController - */ - public function __invoke(ContainerInterface $container) - { - /** @var ParametreService $parametreService */ - $parametreService = $container->get(ParametreService::class); - - /** @var ConfigurationForm $configurationForm */ - $configurationForm = $container->get('FormElementManager')->get(ConfigurationForm::class); - - /** @var ConfigurationController $controller */ - $controller = new ConfigurationController(); - $controller->setParametreService($parametreService); - $controller->setConfigurationForm($configurationForm); - - return $controller; - } -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Controller/EngagementImpartialiteController.php b/module/Soutenance/src/Soutenance/Controller/EngagementImpartialiteController.php index 75855ef4fa5166bcd2c79e5c580e83d25b485064..f63b83eff955e80133bf29a4a994c318e5b45ddc 100644 --- a/module/Soutenance/src/Soutenance/Controller/EngagementImpartialiteController.php +++ b/module/Soutenance/src/Soutenance/Controller/EngagementImpartialiteController.php @@ -77,7 +77,7 @@ class EngagementImpartialiteController extends AbstractController $url_rapporteur = $this->url()->fromRoute("soutenance/index-rapporteur", ['these' => $these->getId()], ['force_canonical' => true], true); $url = $this->url()->fromRoute('zfcuser/login', ['type' => 'token'], ['query' => ['token' => $token->getToken(), 'redirect' => $url_rapporteur, 'role' => $membre->getActeur()->getRole()->getRoleId()], 'force_canonical' => true], true); try { - $notif = $this->soutenanceNotificationFactory->createNotificationDemandeSignatureEngagementImpartialite($these, $proposition, $membre, $url); + $notif = $this->soutenanceNotificationFactory->createNotificationDemandeSignatureEngagementImpartialite($these, $membre); $this->notifierService->trigger($notif); } catch (RuntimeException $e) { // aucun destintaire, todo : cas à gérer ! @@ -101,7 +101,7 @@ class EngagementImpartialiteController extends AbstractController $url_rapporteur = $this->url()->fromRoute("soutenance/index-rapporteur", ['these' => $these->getId()], ['force_canonical' => true], true); $url = $this->url()->fromRoute('zfcuser/login', ['type' => 'token'], ['query' => ['token' => $token->getToken(), 'redirect' => $url_rapporteur, 'role' => $membre->getActeur()->getRole()->getRoleId()], 'force_canonical' => true], true); try { - $notif = $this->soutenanceNotificationFactory->createNotificationDemandeSignatureEngagementImpartialite($these, $proposition, $membre, $url); + $notif = $this->soutenanceNotificationFactory->createNotificationDemandeSignatureEngagementImpartialite($these, $membre); $this->notifierService->trigger($notif); } catch (RuntimeException $e) { // aucun destintaire, todo : cas à gérer ! @@ -121,7 +121,7 @@ class EngagementImpartialiteController extends AbstractController if ($signature === null) { $this->getEngagementImpartialiteService()->create($membre, $these); try { - $notif = $this->soutenanceNotificationFactory->createNotificationSignatureEngagementImpartialite($these, $proposition, $membre); + $notif = $this->soutenanceNotificationFactory->createNotificationSignatureEngagementImpartialite($these, $membre); $this->notifierService->trigger($notif); } catch (RuntimeException $e) { // aucun destintaire, todo : cas à gérer ! @@ -140,7 +140,7 @@ class EngagementImpartialiteController extends AbstractController $this->getEngagementImpartialiteService()->createRefus($membre, $these); $this->getPropositionService()->annulerValidationsForProposition($proposition); try { - $notif = $this->soutenanceNotificationFactory->createNotificationRefusEngagementImpartialite($these, $proposition, $membre); + $notif = $this->soutenanceNotificationFactory->createNotificationRefusEngagementImpartialite($these, $membre); $this->notifierService->trigger($notif); } catch (RuntimeException $e) { // aucun destintaire, todo : cas à gérer ! @@ -159,7 +159,7 @@ class EngagementImpartialiteController extends AbstractController /** @var Validation[] $validations */ $this->getEngagementImpartialiteService()->delete($membre); try { - $notif = $this->soutenanceNotificationFactory->createNotificationAnnulationEngagementImpartialite($these, $proposition, $membre); + $notif = $this->soutenanceNotificationFactory->createNotificationAnnulationEngagementImpartialite($these, $membre); $this->notifierService->trigger($notif); } catch (RuntimeException $e) { // aucun destintaire, todo : cas à gérer ! diff --git a/module/Soutenance/src/Soutenance/Controller/InterventionController.php b/module/Soutenance/src/Soutenance/Controller/InterventionController.php index 675cff7d182f0e8c359225d5bd5a1470a67d23f8..e2caa679127e0156ed49a92d3131312a686e2e8f 100644 --- a/module/Soutenance/src/Soutenance/Controller/InterventionController.php +++ b/module/Soutenance/src/Soutenance/Controller/InterventionController.php @@ -3,25 +3,26 @@ namespace Soutenance\Controller; use Application\Controller\AbstractController; +use Depot\Service\FichierThese\FichierTheseServiceAwareTrait; use Fichier\Entity\Db\NatureFichier; use Fichier\Entity\Db\VersionFichier; -use Depot\Service\FichierThese\FichierTheseServiceAwareTrait; -use These\Service\These\TheseServiceAwareTrait; +use Laminas\Http\Response; +use Laminas\View\Model\ViewModel; use Soutenance\Entity\Intervention; use Soutenance\Entity\Justificatif; use Soutenance\Entity\Membre; -use Soutenance\Entity\Parametre; +use Soutenance\Provider\Parametre\SoutenanceParametres; use Soutenance\Service\Intervention\InterventionServiceAwareTrait; use Soutenance\Service\Justificatif\JustificatifServiceAwareTrait; use Soutenance\Service\Membre\MembreServiceAwareTrait; -use Soutenance\Service\Parametre\ParametreServiceAwareTrait; use Soutenance\Service\Proposition\PropositionServiceAwareTrait; +use These\Service\These\TheseServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Service\EntityManagerAwareTrait; -use Laminas\Http\Response; -use Laminas\View\Model\ViewModel; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; -class InterventionController extends AbstractController { +class InterventionController extends AbstractController +{ use EntityManagerAwareTrait; use FichierTheseServiceAwareTrait; use InterventionServiceAwareTrait; @@ -31,12 +32,12 @@ class InterventionController extends AbstractController { use PropositionServiceAwareTrait; use TheseServiceAwareTrait; - public function indexAction() + public function indexAction() : ViewModel { return new ViewModel([]); } - public function afficherAction() : ViewModel + public function afficherAction(): ViewModel { $these = $this->getTheseService()->getRequestedThese($this); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -44,23 +45,23 @@ class InterventionController extends AbstractController { $distanciels = $this->getInterventionService()->getInterventionByTheseAndType($these, Intervention::TYPE_DISTANCIEL); $visios = $this->getInterventionService()->getInterventionByTheseAndType($these, Intervention::TYPE_VISIO_TARDIVE); $membres = []; - foreach($proposition->getMembres() as $membre) { + foreach ($proposition->getMembres() as $membre) { $membres[$membre->getId()] = $membre; } return new ViewModel([ 'these' => $these, - 'distanciel' => (!empty($distanciels))?current($distanciels):null, - 'visios' => (!empty($visios))?$visios:null, + 'distanciel' => (!empty($distanciels)) ? current($distanciels) : null, + 'visios' => (!empty($visios)) ? $visios : null, 'proposition' => $proposition, 'membres' => $membres, 'justificatifs' => $justificatifs, 'urlFichierThese' => $this->urlFichierThese(), - 'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getParametreByCode(Parametre::CODE_FORMULAIRE_DELEGUATION)->getValeur(), + 'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELEGATION_SIGNATURE)->getValeur(), ]); } - public function togglePresidentDistancielAction() + public function togglePresidentDistancielAction() : Response { $these = $this->getTheseService()->getRequestedThese($this); $interventions = $this->getInterventionService()->getInterventionByTheseAndType($these, Intervention::TYPE_DISTANCIEL); @@ -78,13 +79,13 @@ class InterventionController extends AbstractController { $this->getInterventionService()->historiser($intervention); break; default: //erreur - throw new RuntimeException("Plusieurs Intervention de type '".Intervention::TYPE_DISTANCIEL." pour la thèse '".$these->getId()."'."); + throw new RuntimeException("Plusieurs Intervention de type '" . Intervention::TYPE_DISTANCIEL . " pour la thèse '" . $these->getId() . "'."); } return $this->redirect()->toRoute('soutenance/intervention/afficher', ['these' => $these->getId()], [], true); } - public function ajouterVisioconferenceTardiveAction() : ViewModel + public function ajouterVisioconferenceTardiveAction(): ViewModel { $these = $this->getTheseService()->getRequestedThese($this); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -95,7 +96,7 @@ class InterventionController extends AbstractController { $files = $request->getFiles(); $membre = $this->getMembreService()->find($data['membre']); - if ($membre !== null and ($files !== null AND !empty($files))) { + if ($membre !== null and ($files !== null and !empty($files))) { // 1 - Justificatif $files = ['files' => $files->toArray()]; @@ -123,7 +124,9 @@ class InterventionController extends AbstractController { } $membres = $proposition->getMembres()->toArray(); - $membres = array_filter($membres, function(Membre $membre) { return $membre->isVisio() === false; }); + $membres = array_filter($membres, function (Membre $membre) { + return $membre->isVisio() === false; + }); return new ViewModel([ 'title' => "Ajout d'une déclaration de visioconférence tardive pour un membre du jury", @@ -132,7 +135,7 @@ class InterventionController extends AbstractController { ]); } - public function supprimerVisioconferenceTardiveAction() : Response + public function supprimerVisioconferenceTardiveAction(): Response { $intervention = $this->getInterventionService()->getRequestedIntervention($this); $these = $intervention->getThese(); diff --git a/module/Soutenance/src/Soutenance/Controller/InterventionControllerFactory.php b/module/Soutenance/src/Soutenance/Controller/InterventionControllerFactory.php index 19454e201fb8f3ad56e418dd040ff8a3955a040c..31ea1f2b9d43228dff3273ebbae9c6f44a63b51a 100644 --- a/module/Soutenance/src/Soutenance/Controller/InterventionControllerFactory.php +++ b/module/Soutenance/src/Soutenance/Controller/InterventionControllerFactory.php @@ -3,22 +3,26 @@ namespace Soutenance\Controller; use Depot\Service\FichierThese\FichierTheseService; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use These\Service\These\TheseService; use Doctrine\ORM\EntityManager; use Interop\Container\ContainerInterface; use Soutenance\Service\Intervention\InterventionService; use Soutenance\Service\Justificatif\JustificatifService; use Soutenance\Service\Membre\MembreService; -use Soutenance\Service\Parametre\ParametreService; use Soutenance\Service\Proposition\PropositionService; +use UnicaenParametre\Service\Parametre\ParametreService; class InterventionControllerFactory { /** * @param ContainerInterface $container * @return InterventionController + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ - public function __invoke(ContainerInterface $container) + public function __invoke(ContainerInterface $container) : InterventionController { /** * @var EntityManager $entityManager diff --git a/module/Soutenance/src/Soutenance/Controller/JustificatifController.php b/module/Soutenance/src/Soutenance/Controller/JustificatifController.php index c8877a88305f030618988386f8565074c904edd3..fcdaf714aac266c86c722557e086cbb35d1ff961 100644 --- a/module/Soutenance/src/Soutenance/Controller/JustificatifController.php +++ b/module/Soutenance/src/Soutenance/Controller/JustificatifController.php @@ -5,15 +5,15 @@ namespace Soutenance\Controller; use Application\Controller\AbstractController; use Fichier\Entity\Db\VersionFichier; use Depot\Service\FichierThese\FichierTheseServiceAwareTrait; +use Laminas\Http\Response; use Soutenance\Entity\Justificatif; -use Soutenance\Entity\Parametre; use Soutenance\Form\Justificatif\JustificatifFormAwareTrait; +use Soutenance\Provider\Parametre\SoutenanceParametres; use Soutenance\Service\Justificatif\JustificatifServiceAwareTrait; use Soutenance\Service\Membre\MembreServiceAwareTrait; -use Soutenance\Service\Parametre\ParametreServiceAwareTrait; use Soutenance\Service\Proposition\PropositionServiceAwareTrait; -use Laminas\Http\Request; use Laminas\View\Model\ViewModel; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; class JustificatifController extends AbstractController { use FichierTheseServiceAwareTrait; @@ -24,7 +24,7 @@ class JustificatifController extends AbstractController { use JustificatifFormAwareTrait; - public function ajouterAction() + public function ajouterAction() : ViewModel { $proposition = $this->getPropositionService()->getRequestedProposition($this); $nature = $this->params()->fromRoute('nature'); @@ -57,7 +57,7 @@ class JustificatifController extends AbstractController { ]); } - public function retirerAction() + public function retirerAction() : Response { $justificatif = $this->getJustificatifService()->getRequestedJustificatif($this); $retour = $this->params()->fromQuery('retour'); @@ -67,7 +67,7 @@ class JustificatifController extends AbstractController { return $this->redirect()->toUrl($retour); } - public function ajouterJustificatifAction() + public function ajouterJustificatifAction() : ViewModel { $these = $this->requestedThese(); @@ -80,7 +80,6 @@ class JustificatifController extends AbstractController { $form->bind($justificatif); $form->init(); - /** @var Request $request */ $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); @@ -105,11 +104,11 @@ class JustificatifController extends AbstractController { 'form' => $form, 'justificatifs' => $justificatifs, - 'FORMULAIRE_DELOCALISATION' => $this->getParametreService()->getParametreByCode(Parametre::CODE_FORMULAIRE_DELOCALISATION)->getValeur(), - 'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getParametreByCode(Parametre::CODE_FORMULAIRE_DELEGUATION)->getValeur(), - 'FORMULAIRE_DEMANDE_LABEL' => $this->getParametreService()->getParametreByCode(Parametre::CODE_FORMULAIRE_LABEL_EUROPEEN)->getValeur(), - 'FORMULAIRE_DEMANDE_ANGLAIS' => $this->getParametreService()->getParametreByCode(Parametre::CODE_FORMULAIRE_THESE_ANGLAIS)->getValeur(), - 'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $this->getParametreService()->getParametreByCode(Parametre::CODE_FORMULAIRE_CONFIDENTIALITE)->getValeur(), + 'FORMULAIRE_DELOCALISATION' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELOCALISATION)->getValeur(), + 'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELEGATION_SIGNATURE)->getValeur(), + 'FORMULAIRE_DEMANDE_LABEL' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_LABEL_EUROPEEN)->getValeur(), + 'FORMULAIRE_DEMANDE_ANGLAIS' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_REDACTION_ANGLAIS)->getValeur(), + 'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_CONFIDENTIALITE)->getValeur(), ]); // $vm->setTemplate('soutenance/default/default-form'); return $vm; diff --git a/module/Soutenance/src/Soutenance/Controller/JustificatifControllerFactory.php b/module/Soutenance/src/Soutenance/Controller/JustificatifControllerFactory.php index b82924c311bc6f4d0538e94def2a9e2111b4348a..2c7d08715e18f129f0032162edbda688640c4033 100644 --- a/module/Soutenance/src/Soutenance/Controller/JustificatifControllerFactory.php +++ b/module/Soutenance/src/Soutenance/Controller/JustificatifControllerFactory.php @@ -4,19 +4,23 @@ namespace Soutenance\Controller; use Depot\Service\FichierThese\FichierTheseService; use Interop\Container\ContainerInterface; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Soutenance\Form\Justificatif\JustificatifForm; use Soutenance\Service\Justificatif\JustificatifService; use Soutenance\Service\Membre\MembreService; -use Soutenance\Service\Parametre\ParametreService; use Soutenance\Service\Proposition\PropositionService; +use UnicaenParametre\Service\Parametre\ParametreService; class JustificatifControllerFactory { /** * @param ContainerInterface $container * @return JustificatifController + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ - public function __invoke(ContainerInterface $container) + public function __invoke(ContainerInterface $container) : JustificatifController { /** * @var FichierTheseService $fichierTheseService diff --git a/module/Soutenance/src/Soutenance/Controller/PropositionController.php b/module/Soutenance/src/Soutenance/Controller/PropositionController.php index 18c4362bd83159acb546ddeb8f2708b2fd0c4460..1bb1dd7ea8df2531f31eae9347a308123c378214 100644 --- a/module/Soutenance/src/Soutenance/Controller/PropositionController.php +++ b/module/Soutenance/src/Soutenance/Controller/PropositionController.php @@ -3,32 +3,23 @@ namespace Soutenance\Controller; use Application\Controller\AbstractController; -use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; -use Information\Service\InformationServiceAwareTrait; -use Soutenance\Provider\Template\PdfTemplates; -use Soutenance\Service\Avis\AvisServiceAwareTrait; -use Soutenance\Service\Exporter\SermentExporter\SermentPdfExporter; -use Soutenance\Service\Notification\SoutenanceNotificationFactoryAwareTrait; -use Structure\Service\Etablissement\EtablissementServiceAwareTrait; -use Structure\Service\Structure\StructureServiceAwareTrait; -use These\Entity\Db\Acteur; -use Individu\Entity\Db\Individu; -use Individu\Entity\Db\IndividuRole; use Application\Entity\Db\Role; use Application\Entity\Db\Utilisateur; -use These\Service\Acteur\ActeurServiceAwareTrait; -use Structure\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Application\Service\UserContextServiceAwareTrait; +use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; +use Individu\Entity\Db\Individu; +use Individu\Entity\Db\IndividuRole; +use Information\Service\InformationServiceAwareTrait; use Laminas\Form\Form; use Laminas\Http\Request; use Laminas\View\Model\ViewModel; use Laminas\View\Renderer\PhpRenderer; +use Notification\Service\NotifierServiceAwareTrait; use Soutenance\Assertion\PropositionAssertionAwareTrait; use Soutenance\Entity\Etat; use Soutenance\Entity\Evenement; use Soutenance\Entity\Membre; -use Soutenance\Entity\Parametre; use Soutenance\Entity\Proposition; use Soutenance\Form\Anglais\AnglaisFormAwareTrait; use Soutenance\Form\ChangementTitre\ChangementTitreFormAwareTrait; @@ -37,18 +28,26 @@ use Soutenance\Form\DateLieu\DateLieuFormAwareTrait; use Soutenance\Form\LabelEuropeen\LabelEuropeenFormAwareTrait; use Soutenance\Form\Membre\MembreFromAwareTrait; use Soutenance\Form\Refus\RefusFormAwareTrait; +use Soutenance\Provider\Parametre\SoutenanceParametres; use Soutenance\Provider\Privilege\PropositionPrivileges; +use Soutenance\Provider\Template\PdfTemplates; use Soutenance\Provider\Validation\TypeValidation; +use Soutenance\Service\Avis\AvisServiceAwareTrait; use Soutenance\Service\Evenement\EvenementServiceAwareTrait; +use Soutenance\Service\Exporter\SermentExporter\SermentPdfExporter; use Soutenance\Service\Justificatif\JustificatifServiceAwareTrait; use Soutenance\Service\Membre\MembreServiceAwareTrait; -use Notification\Service\NotifierServiceAwareTrait; -use Soutenance\Service\Parametre\ParametreServiceAwareTrait; +use Soutenance\Service\Notification\SoutenanceNotificationFactoryAwareTrait; use Soutenance\Service\Proposition\PropositionServiceAwareTrait; use Soutenance\Service\SignaturePresident\SiganturePresidentPdfExporter; use Soutenance\Service\Validation\ValidatationServiceAwareTrait; +use Structure\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait; +use Structure\Service\Etablissement\EtablissementServiceAwareTrait; +use These\Entity\Db\Acteur; +use These\Service\Acteur\ActeurServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use UnicaenAuth\Entity\Db\RoleInterface; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; use UnicaenRenderer\Service\Rendu\RenduServiceAwareTrait; /** @method boolean isAllowed($resource, $privilege = null) */ @@ -132,8 +131,6 @@ class PropositionController extends AbstractController $justificatifs = $this->getJustificatifService()->generateListeJustificatif($proposition); $justificatifsOk = $this->getJustificatifService()->isJustificatifsOk($proposition, $justificatifs); - /** Adresse des formulaires --------------------------------------------------------------------------------- */ - $parametres = $this->getParametreService()->getParametresAsArray(); /** Collècte des informations sur les individus liés -------------------------------------------------------- */ /** @var IndividuRole[] $ecoleResponsables */ @@ -166,27 +163,36 @@ class PropositionController extends AbstractController $informationsOk = true; $directeurs = $this->getActeurService()->getRepository()->findEncadrementThese($these); foreach ($directeurs as $directeur) { - if ($directeur->getIndividu()->getEmailPro() === null AND $directeur->getIndividu()->getComplement() === null) { + if ($directeur->getIndividu()->getEmailPro() === null and $directeur->getIndividu()->getComplement() === null) { $informationsOk = false; break; } } if (empty($uniteResponsables)) $informationsOk = false; foreach ($uniteResponsables as $uniteResponsable) { - if ($uniteResponsable->getIndividu()->getEmailPro() === null) { $informationsOk = false; break;} + if ($uniteResponsable->getIndividu()->getEmailPro() === null) { + $informationsOk = false; + break; + } } if (empty($ecoleResponsables)) $informationsOk = false; foreach ($ecoleResponsables as $ecoleResponsable) { - if ($ecoleResponsable->getIndividu()->getEmailPro() === null) { $informationsOk = false; break;} + if ($ecoleResponsable->getIndividu()->getEmailPro() === null) { + $informationsOk = false; + break; + } } if (empty($etablissementResponsables)) $informationsOk = false; foreach ($etablissementResponsables as $etablissementResponsable) { - if ($etablissementResponsable->getIndividu()->getEmailPro() === null) { $informationsOk = false; break;} + if ($etablissementResponsable->getIndividu()->getEmailPro() === null) { + $informationsOk = false; + break; + } } /** @var Individu $individu */ foreach (array_merge($ecoleResponsables, $uniteResponsables, $etablissementResponsables) as $ecoleResponsable) { $individu = $ecoleResponsable->getIndividu(); - if ($individu->getEmailPro() === null AND $individu->getComplement() === null) { + if ($individu->getEmailPro() === null and $individu->getComplement() === null) { $informationsOk = false; break; } @@ -214,15 +220,15 @@ class PropositionController extends AbstractController 'informationsOk' => $informationsOk, 'avis' => $this->getAvisService()->getAvisByThese($these), - 'FORMULAIRE_DELOCALISATION' => $parametres[Parametre::CODE_FORMULAIRE_DELOCALISATION], - 'FORMULAIRE_DELEGUATION' => $parametres[Parametre::CODE_FORMULAIRE_DELEGUATION], - 'FORMULAIRE_DEMANDE_LABEL' => $parametres[Parametre::CODE_FORMULAIRE_LABEL_EUROPEEN], - 'FORMULAIRE_DEMANDE_ANGLAIS' => $parametres[Parametre::CODE_FORMULAIRE_THESE_ANGLAIS], - 'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $parametres[Parametre::CODE_FORMULAIRE_CONFIDENTIALITE], + 'FORMULAIRE_DELOCALISATION' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELOCALISATION)->getValeur(), + 'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELEGATION_SIGNATURE)->getValeur(), + 'FORMULAIRE_DEMANDE_LABEL' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_LABEL_EUROPEEN)->getValeur(), + 'FORMULAIRE_DEMANDE_ANGLAIS' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_REDACTION_ANGLAIS)->getValeur(), + 'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_CONFIDENTIALITE)->getValeur(), ]); } - public function modifierDateLieuAction() : ViewModel + public function modifierDateLieuAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -250,7 +256,7 @@ class PropositionController extends AbstractController return $vm; } - public function modifierMembreAction() : ViewModel + public function modifierMembreAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -310,7 +316,7 @@ class PropositionController extends AbstractController return $this->redirect()->toRoute('soutenance/proposition', ['these' => $these->getId()], [], true); } - public function labelEuropeenAction() : ViewModel + public function labelEuropeenAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -337,7 +343,7 @@ class PropositionController extends AbstractController return $vm; } - public function anglaisAction() : ViewModel + public function anglaisAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -364,7 +370,7 @@ class PropositionController extends AbstractController return $vm; } - public function confidentialiteAction() : ViewModel + public function confidentialiteAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -392,7 +398,7 @@ class PropositionController extends AbstractController return $vm; } - public function changementTitreAction() : ViewModel + public function changementTitreAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -524,7 +530,7 @@ class PropositionController extends AbstractController } - public function refuserStructureAction() : ViewModel + public function refuserStructureAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -569,7 +575,6 @@ class PropositionController extends AbstractController if ($autorisation !== null) return $autorisation; - $codirecteurs = $this->getActeurService()->getRepository()->findActeursByTheseAndRole($these, Role::CODE_CODIRECTEUR_THESE); @@ -583,7 +588,7 @@ class PropositionController extends AbstractController 'libelle' => $this->getPropositionService()->generateLibelleSignaturePresidenceForThese($these), 'nbCodirecteur' => count($codirecteurs), ]); - $exporter->export('Document_pour_signature_-_'.$these->getId().'_-_'.str_replace(' ','_',$these->getDoctorant()->getIndividu()->getNomComplet()).'.pdf'); + $exporter->export('Document_pour_signature_-_' . $these->getId() . '_-_' . str_replace(' ', '_', $these->getDoctorant()->getIndividu()->getNomComplet()) . '.pdf'); exit; } @@ -608,7 +613,7 @@ class PropositionController extends AbstractController * @param Proposition $proposition * @return Proposition */ - private function update(Request $request, Form $form, Proposition $proposition) : Proposition + private function update(Request $request, Form $form, Proposition $proposition): Proposition { $data = $request->getPost(); $form->setData($data); @@ -638,7 +643,7 @@ class PropositionController extends AbstractController return $this->redirect()->toRoute('soutenance', [], [], true); } - public function afficherSoutenancesParEcoleDoctoraleAction() : ViewModel + public function afficherSoutenancesParEcoleDoctoraleAction(): ViewModel { $ecole = $this->getEcoleDoctoraleService()->getRequestedEcoleDoctorale($this); $soutenances = $this->getPropositionService()->findSoutenancesAutoriseesByEcoleDoctorale($ecole); @@ -652,7 +657,7 @@ class PropositionController extends AbstractController /** Declaration sur l'honneur *************************************************************************************/ - public function declarationNonPlagiatAction() : ViewModel + public function declarationNonPlagiatAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); @@ -709,36 +714,39 @@ class PropositionController extends AbstractController if ($autorisation !== null) return $autorisation; $validations = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_VALIDATION_DECLARATION_HONNEUR, $these); - foreach ($validations as $validation) { $this->getValidationService()->historise($validation); } + foreach ($validations as $validation) { + $this->getValidationService()->historise($validation); + } $refus = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_REFUS_DECLARATION_HONNEUR, $these); - foreach ($refus as $refu) { $this->getValidationService()->historise($refu); } + foreach ($refus as $refu) { + $this->getValidationService()->historise($refu); + } return $this->redirect()->toRoute('soutenance/proposition', ['these' => $these->getId()], [], true); } /** Vue ***********************************************************************************************************/ - public function generateViewDateLieuAction() : ViewModel + public function generateViewDateLieuAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); - $parametres = $this->getParametreService()->getParametresAsArray(); $vm = new ViewModel(); $vm->setTerminal(true); $vm->setVariables([ 'these' => $these, 'proposition' => $proposition, - 'FORMULAIRE_DELOCALISATION' => $parametres[Parametre::CODE_FORMULAIRE_DELOCALISATION], + 'FORMULAIRE_DELOCALISATION' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELOCALISATION)->getValeur(), 'canModifier' => $this->isAllowed(PropositionPrivileges::getResourceId(PropositionPrivileges::PROPOSITION_MODIFIER)), ]); return $vm; } - public function generateViewJuryAction() : ViewModel + + public function generateViewJuryAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); - $parametres = $this->getParametreService()->getParametresAsArray(); /** Indicateurs --------------------------------------------------------------------------------------------- */ $indicateurs = $this->getPropositionService()->computeIndicateurForProposition($proposition); @@ -751,17 +759,17 @@ class PropositionController extends AbstractController $vm->setVariables([ 'these' => $these, 'proposition' => $proposition, - 'FORMULAIRE_DELEGUATION' => $parametres[Parametre::CODE_FORMULAIRE_DELEGUATION], + 'FORMULAIRE_DELEGUATION' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_DELEGATION_SIGNATURE)->getValeur(), 'canModifier' => $this->isAllowed(PropositionPrivileges::getResourceId(PropositionPrivileges::PROPOSITION_MODIFIER)), 'indicateurs' => $indicateurs, ]); return $vm; } - public function generateViewInformationsAction() : ViewModel + + public function generateViewInformationsAction(): ViewModel { $these = $this->requestedThese(); $proposition = $this->getPropositionService()->findOneForThese($these); - $parametres = $this->getParametreService()->getParametresAsArray(); $vm = new ViewModel(); @@ -769,9 +777,9 @@ class PropositionController extends AbstractController $vm->setVariables([ 'these' => $these, 'proposition' => $proposition, - 'FORMULAIRE_DEMANDE_LABEL' => $parametres[Parametre::CODE_FORMULAIRE_LABEL_EUROPEEN], - 'FORMULAIRE_DEMANDE_ANGLAIS' => $parametres[Parametre::CODE_FORMULAIRE_THESE_ANGLAIS], - 'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $parametres[Parametre::CODE_FORMULAIRE_CONFIDENTIALITE], + 'FORMULAIRE_DEMANDE_LABEL' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_LABEL_EUROPEEN)->getValeur(), + 'FORMULAIRE_DEMANDE_ANGLAIS' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_REDACTION_ANGLAIS)->getValeur(), + 'FORMULAIRE_DEMANDE_CONFIDENTIALITE' => $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::DOC_CONFIDENTIALITE)->getValeur(), 'canModifier' => $this->isAllowed(PropositionPrivileges::getResourceId(PropositionPrivileges::PROPOSITION_MODIFIER)), ]); return $vm; @@ -785,7 +793,7 @@ class PropositionController extends AbstractController * @param string|null $message * @return ViewModel|null */ - private function verifierAutorisation(Proposition $proposition, array $privilieges, ?string $message = null) : ?ViewModel + private function verifierAutorisation(Proposition $proposition, array $privilieges, ?string $message = null): ?ViewModel { $authorized = false; foreach ($privilieges as $priviliege) { @@ -795,7 +803,7 @@ class PropositionController extends AbstractController if ($authorized === false) { $vm = new ViewModel(); $vm->setTemplate('soutenance/error/403'); - $vm->setVariables(['message' => $message ]); + $vm->setVariables(['message' => $message]); return $vm; } return null; @@ -815,11 +823,11 @@ class PropositionController extends AbstractController $rendu = $this->getRenduService()->generateRenduByTemplateCode(PdfTemplates::SERMENT_DU_DOCTEUR, $vars); $comue = $this->etablissementService->fetchEtablissementComue(); - $cheminLogoComue = ($comue)?$this->fichierStorageService->getFileForLogoStructure($comue->getStructure()):null; - $cheminLogoEtablissement = ($these->getEtablissement())?$this->fichierStorageService->getFileForLogoStructure($these->getEtablissement()->getStructure()):null; + $cheminLogoComue = ($comue) ? $this->fichierStorageService->getFileForLogoStructure($comue->getStructure()) : null; + $cheminLogoEtablissement = ($these->getEtablissement()) ? $this->fichierStorageService->getFileForLogoStructure($these->getEtablissement()->getStructure()) : null; $exporter = new SermentPdfExporter($this->renderer, 'A4'); - $exporter->getMpdf()->SetMargins(0,0,50); + $exporter->getMpdf()->SetMargins(0, 0, 50); $exporter->setVars([ 'texte' => $rendu->getCorps(), 'comue' => $comue, diff --git a/module/Soutenance/src/Soutenance/Entity/Mapping/Soutenance.Entity.Parametre.dcm.xml b/module/Soutenance/src/Soutenance/Entity/Mapping/Soutenance.Entity.Parametre.dcm.xml deleted file mode 100644 index 020a84e0bcdb13a6f8950fd0a1914cd2f9cf5c32..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Entity/Mapping/Soutenance.Entity.Parametre.dcm.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <entity name="Soutenance\Entity\Parametre" table="SOUTENANCE_CONFIGURATION"> - <id name="id" type="integer" column="ID"> - <generator strategy="SEQUENCE"/> - </id> - - <field name="code" type="string" length="64" column="CODE" nullable="false"/> - <field name="libelle" type="string" length="256" column="LIBELLE" nullable="false"/> - <field name="valeur" type="string" length="128" column="VALEUR" nullable="false"/> - - </entity> -</doctrine-mapping> diff --git a/module/Soutenance/src/Soutenance/Entity/Parametre.php b/module/Soutenance/src/Soutenance/Entity/Parametre.php deleted file mode 100644 index 3d1beed026eb80f8367b06a73442dcc5f4eaa566..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Entity/Parametre.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -namespace Soutenance\Entity; - -class Parametre { - - const CODE_AVIS_DEADLINE = 'AVIS_DEADLINE'; - const CODE_JURY_SIZE_MIN = 'JURY_SIZE_MIN'; - const CODE_JURY_SIZE_MAX = 'JURY_SIZE_MAX'; - const CODE_JURY_RAPPORTEUR_SIZE_MIN = 'JURY_RAPPORTEUR_SIZE_MIN'; - const CODE_JURY_RANGA_RATIO_MIN = 'JURY_RANGA_RATIO_MIN'; - const CODE_JURY_EXTERIEUR_RATIO_MIN = 'JURY_EXTERIEUR_RATIO_MIN'; - const CODE_JURY_PARITE_RATIO_MIN = 'JURY_PARITE_RATIO_MIN'; -// const CODE_PROPOSITION_ORDRE_VALIDATION_ACTEUR = 'PROPOSITION_ORDRE_VALIDATION_ACTEUR'; -// const CODE_PROPOSITION_ORDRE_VALIDATION_UR = 'PROPOSITION_ORDRE_VALIDATION_UR'; -// const CODE_PROPOSITION_ORDRE_VALIDATION_ED = 'PROPOSITION_ORDRE_VALIDATION_ED'; -// const CODE_PROPOSITION_ORDRE_VALIDATION_BDD = 'PROPOSITION_ORDRE_VALIDATION_BDD'; -// const CODE_PROPOSITION_ORDRE_VALIDATION_PRESIDENT = 'PROPOSITION_ORDRE_VALIDATION_PRESIDENT'; - const CODE_FORMULAIRE_DELOCALISATION = 'FORMULAIRE_DELOCALISATION'; - const CODE_FORMULAIRE_DELEGUATION = 'FORMULAIRE_DELEGUATION'; - const CODE_FORMULAIRE_LABEL_EUROPEEN = 'FORMULAIRE_LABEL_EUROPEEN'; - const CODE_FORMULAIRE_THESE_ANGLAIS = 'FORMULAIRE_THESE_ANGLAIS'; - const CODE_FORMULAIRE_CONFIDENTIALITE = 'FORMULAIRE_CONFIDENTIALITE'; - - const CODE_DIRECTEUR_INTERVENTION = 'PERIODE_INTERVENTION_DIRECTEUR'; - - /** @var integer */ - private $id; - /** @var string */ - private $code; - /** @var string */ - private $libelle; - /** @var string */ - private $valeur; - - /** - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * @return string - */ - public function getCode() - { - return $this->code; - } - - /** - * @param string $code - * @return Parametre - */ - public function setCode($code) - { - $this->code = $code; - return $this; - } - - /** - * @return string - */ - public function getLibelle() - { - return $this->libelle; - } - - /** - * @param string $libelle - * @return Parametre - */ - public function setLibelle($libelle) - { - $this->libelle = $libelle; - return $this; - } - - /** - * @return string - */ - public function getValeur() - { - return $this->valeur; - } - - /** - * @param string $valeur - * @return Parametre - */ - public function setValeur($valeur) - { - $this->valeur = $valeur; - return $this; - } -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationForm.php b/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationForm.php deleted file mode 100644 index ae36d55db5e6087adef13c26433cff7643b0c202..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationForm.php +++ /dev/null @@ -1,184 +0,0 @@ -<?php - -namespace Soutenance\Form\Configuration; - -use Soutenance\Entity\Parametre; -use Laminas\Form\Element\Submit; -use Laminas\Form\Element\Text; -use Laminas\Form\Form; - -class ConfigurationForm extends Form { - - public function init() - { - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_AVIS_DEADLINE, - 'options' => [ - 'label' => "Delai avant le retour des rapports : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_AVIS_DEADLINE, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_JURY_SIZE_MIN, - 'options' => [ - 'label' => "Nombre minimal de membre dans le jury : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_JURY_SIZE_MIN, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_JURY_SIZE_MAX, - 'options' => [ - 'label' => "Nombre maximal de membre dans le jury : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_JURY_SIZE_MAX, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_JURY_RAPPORTEUR_SIZE_MIN, - 'options' => [ - 'label' => "Nombre minimal de rapporteur : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_JURY_RAPPORTEUR_SIZE_MIN, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_JURY_RANGA_RATIO_MIN, - 'options' => [ - 'label' => "Ratio minimal de membre de rang A : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_JURY_RANGA_RATIO_MIN, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_JURY_EXTERIEUR_RATIO_MIN, - 'options' => [ - 'label' => "Ratio minimal de membre exterieur : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_JURY_EXTERIEUR_RATIO_MIN, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_JURY_PARITE_RATIO_MIN, - 'options' => [ - 'label' => "Ratio minimal de parité : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_JURY_PARITE_RATIO_MIN, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_FORMULAIRE_DELOCALISATION, - 'options' => [ - 'label' => "Formulaire de délocalisation de la soutenance : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_FORMULAIRE_DELOCALISATION, - ], - ] - ); - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_FORMULAIRE_DELEGUATION, - 'options' => [ - 'label' => "Formulaire de délégation de signature : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_FORMULAIRE_DELEGUATION, - ], - ] - ); - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_FORMULAIRE_LABEL_EUROPEEN, - 'options' => [ - 'label' => "Formulaire de demande de label européen : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_FORMULAIRE_LABEL_EUROPEEN, - ], - ] - ); - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_FORMULAIRE_THESE_ANGLAIS, - 'options' => [ - 'label' => "Formulaire de demande de rédaction en anglais : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_FORMULAIRE_THESE_ANGLAIS, - ], - ] - ); - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_FORMULAIRE_CONFIDENTIALITE, - 'options' => [ - 'label' => "Formulaire de demande de confidentialité : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_FORMULAIRE_CONFIDENTIALITE, - ], - ] - ); - - $this->add( - [ - 'type' => Text::class, - 'name' => Parametre::CODE_DIRECTEUR_INTERVENTION, - 'options' => [ - 'label' => "Durée permettant aux directeurs d'intervenir [-j jour:+j jour] : ", - ], - 'attributes' => [ - 'id' => Parametre::CODE_DIRECTEUR_INTERVENTION, - ], - ] - ); - - $this->add((new Submit('submit')) - ->setValue("Enregister") - ->setAttribute('class', 'btn btn-primary') - ); - } -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationFormAwareTrait.php b/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationFormAwareTrait.php deleted file mode 100644 index 23f66ce9c7499adbd79809801dddd610444378c5..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationFormAwareTrait.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Soutenance\Form\Configuration; - -trait ConfigurationFormAwareTrait { - - /** @var ConfigurationForm $configurationForm */ - private $configurationForm; - - /** - * @return ConfigurationForm - */ - public function getConfigurationForm() - { - return $this->configurationForm; - } - - /** - * @param ConfigurationForm $configurationForm - * @return ConfigurationForm - */ - public function setConfigurationForm($configurationForm) - { - $this->configurationForm = $configurationForm; - return $this->configurationForm; - } - - -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationFormFactory.php b/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationFormFactory.php deleted file mode 100644 index d5b952e9f8078d2f5c90a41e8a4331c3b1b6d790..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationFormFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Soutenance\Form\Configuration; - -use Interop\Container\ContainerInterface; - -class ConfigurationFormFactory -{ - - /** - * @param ContainerInterface $container - * @return ConfigurationForm - */ - public function __invoke(ContainerInterface $container) - { - /** @var ConfigurationForm $form */ - $form = new ConfigurationForm(); - return $form; - } -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationHydrator.php b/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationHydrator.php deleted file mode 100644 index ce68ba22065d3cd0bed868f3e658716395948989..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Form/Configuration/ConfigurationHydrator.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Soutenance\Form\Configuration; - -use Laminas\Hydrator\HydratorInterface; - -class ConfigurationHydrator implements HydratorInterface { - - public function extract($object): array - { - // TODO: Implement extract() method. - } - - public function hydrate(array $data, $object) - { - // TODO: Implement hydrate() method. - } - - -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Provider/Parametre/SoutenanceParametres.php b/module/Soutenance/src/Soutenance/Provider/Parametre/SoutenanceParametres.php new file mode 100644 index 0000000000000000000000000000000000000000..9a5d9909bb05c9352ccd129f7eabc4d02d86065f --- /dev/null +++ b/module/Soutenance/src/Soutenance/Provider/Parametre/SoutenanceParametres.php @@ -0,0 +1,24 @@ +<?php + +namespace Soutenance\Provider\Parametre; + +class SoutenanceParametres { + + CONST CATEGORIE = 'SOUTENANCE'; + + CONST NB_MIN_MEMBRE_JURY = 'NB_MIN_MEMBRE_JURY'; + CONST NB_MAX_MEMBRE_JURY = 'NB_MAX_MEMBRE_JURY'; + CONST NB_MIN_RAPPORTEUR = 'NB_MIN_RAPPORTEUR'; + CONST RATIO_PARITE = 'RATIO_PARITE'; + CONST RATIO_MIN_RANG_A = 'RATIO_MIN_RANG_A'; + CONST RATIO_MIN_EXTERIEUR = 'RATIO_MIN_EXTERIEUR'; + + CONST DELAI_RETOUR = 'DELAI_RETOUR'; + CONST DELAI_INTERVENTION = 'DELAI_INTERVENTION'; + + CONST DOC_DELOCALISATION = 'DOC_DELOCALISATION'; + CONST DOC_DELEGATION_SIGNATURE = 'DOC_DELEGATION_SIGNATURE'; + CONST DOC_LABEL_EUROPEEN = 'DOC_LABEL_EUROPEEN'; + CONST DOC_REDACTION_ANGLAIS = 'DOC_REDACTION_ANGLAIS'; + CONST DOC_CONFIDENTIALITE = 'DOC_CONFIDENTIALITE'; +} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Provider/Template/MailTemplates.php b/module/Soutenance/src/Soutenance/Provider/Template/MailTemplates.php index 9f0516f3500b3fcf45e500f0cc3c550530de3d56..6a0a7baf2f1162013e08626b5edfb89bf1c559b2 100644 --- a/module/Soutenance/src/Soutenance/Provider/Template/MailTemplates.php +++ b/module/Soutenance/src/Soutenance/Provider/Template/MailTemplates.php @@ -4,5 +4,11 @@ namespace Soutenance\Provider\Template; class MailTemplates { - const TRANSMETTRE_DOCUMENTS_DIRECTION = "TRANSMETTRE_DOCUMENTS_DIRECTION"; + const TRANSMETTRE_DOCUMENTS_DIRECTION = "TRANSMETTRE_DOCUMENTS_DIRECTION"; + + /** ENGAGEMENT D'IMPARTIALITE *************************************************************************************/ + const DEMANDE_ENGAGEMENT_IMPARTIALITE = 'DEMANDE_ENGAGEMENT_IMPARTIALITE'; + const SIGNATURE_ENGAGEMENT_IMPARTIALITE = 'SIGNATURE_ENGAGEMENT_IMPARTIALITE'; + const REFUS_ENGAGEMENT_IMPARTIALITE = 'REFUS_ENGAGEMENT_IMPARTIALITE'; + const ANNULATION_ENGAGEMENT_IMPARTIALITE = 'ANNULATION_ENGAGEMENT_IMPARTIALITE'; } \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Service/Notification/SoutenanceNotificationFactory.php b/module/Soutenance/src/Soutenance/Service/Notification/SoutenanceNotificationFactory.php index 148c20d666c5a37e9bc75e2947880ca4ff41fbbd..99263b9d922385035a47edcd101892f8fe101fc7 100644 --- a/module/Soutenance/src/Soutenance/Service/Notification/SoutenanceNotificationFactory.php +++ b/module/Soutenance/src/Soutenance/Service/Notification/SoutenanceNotificationFactory.php @@ -61,7 +61,7 @@ class SoutenanceNotificationFactory extends NotificationFactory /** * @param Validation $validation - * @return \Notification\Notification + * @return Notification * @see Application/view/soutenance/notification/devalidation.phtml */ public function createNotificationDevalidationProposition(Validation $validation): Notification @@ -89,7 +89,7 @@ class SoutenanceNotificationFactory extends NotificationFactory /** * @param These $these * @param Validation $validation - * @return \Notification\Notification + * @return Notification * @see Application/view/soutenance/notification/validation-acteur.phtml */ public function createNotificationValidationProposition(These $these, Validation $validation): Notification @@ -119,7 +119,7 @@ class SoutenanceNotificationFactory extends NotificationFactory /** * @param These $these - * @return \Notification\Notification + * @return Notification * @see Application/view/soutenance/notification/validation-structure.phtml */ public function createNotificationUniteRechercheProposition(These $these): Notification @@ -164,7 +164,7 @@ class SoutenanceNotificationFactory extends NotificationFactory /** * @param These $these - * @return \Notification\Notification + * @return Notification * @see Application/view/soutenance/notification/validation-structure.phtml */ public function createNotificationEcoleDoctoraleProposition(These $these): Notification @@ -209,7 +209,7 @@ class SoutenanceNotificationFactory extends NotificationFactory /** * @param These $these - * @return \Notification\Notification + * @return Notification * @see Application/view/soutenance/notification/validation-structure.phtml */ public function createNotificationBureauDesDoctoratsProposition(These $these): Notification @@ -251,7 +251,7 @@ class SoutenanceNotificationFactory extends NotificationFactory /** * @param \These\Entity\Db\These $these - * @return \Notification\Notification + * @return Notification */ public function createNotificationPropositionValidee(These $these): Notification { @@ -283,7 +283,7 @@ class SoutenanceNotificationFactory extends NotificationFactory /** * @param $these - * @return \Notification\Notification + * @return Notification */ public function createNotificationPresoutenance($these): Notification { @@ -310,7 +310,7 @@ class SoutenanceNotificationFactory extends NotificationFactory * @param Individu $currentUser * @param RoleInterface $currentRole * @param string $motif - * @return \Notification\Notification + * @return Notification */ public function createNotificationRefusPropositionSoutenance($these, $currentUser, $currentRole, $motif): Notification { @@ -343,125 +343,88 @@ class SoutenanceNotificationFactory extends NotificationFactory /** ENGAGEMENT IMPARTIALITE ***************************************************************************************/ - /** - * @param These $these - * @param Proposition $proposition - * @param Membre $membre - * @param string $url - * @return \Notification\Notification - */ - public function createNotificationDemandeSignatureEngagementImpartialite(These $these, Proposition $proposition, Membre $membre, string $url): Notification + public function createNotificationDemandeSignatureEngagementImpartialite(These $these, Membre $membre): Notification { - $email = $membre->getEmail(); - - if ($email !== null) { - $notif = new Notification(); - $notif - ->setSubject("Demande de signature de l'engagement d'impartialité de la thèse de " . $these->getDoctorant()->getIndividu()) - ->setTo($email) - ->setTemplatePath('soutenance/notification/engagement-impartialite-demande') - ->setTemplateVariables([ - 'these' => $these, - 'proposition' => $proposition, - 'membre' => $membre, - 'url' => $url, - ]); + $vars = ['these' => $these, 'doctorant' => $these->getDoctorant(), 'rapporteur' => $membre]; + $url = $this->getUrlService()->setVariables($vars); + $vars['Url'] = $url; - return $notif; - } else { - throw new RuntimeException("Aucun mail de disponible (" . __METHOD__ . "::TheseId#" . $these->getId() . ")"); + $rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::DEMANDE_ENGAGEMENT_IMPARTIALITE, $vars); + $mail = $membre->getEmail(); + if ($mail === null) { + throw new RuntimeException("Aucun mail trouvé pour le rapporteur"); } + $notif = new Notification(); + $notif + ->setSubject($rendu->getSujet()) + ->setTo($mail) + ->setBody($rendu->getCorps()); + return $notif; } - /** - * @param These $these - * @param Proposition $proposition - * @param Membre $membre - */ - public function createNotificationSignatureEngagementImpartialite($these, $proposition, $membre): Notification + public function createNotificationSignatureEngagementImpartialite(These $these, Membre $membre): Notification { - $email = $this->emailTheseService->fetchEmailMaisonDuDoctorat($these); - - if ($email !== null) { - $notif = new Notification(); - $notif - ->setSubject("Signature de l'engagement d'impartialité de la thèse de " . $these->getDoctorant()->getIndividu()) - ->setTo($email) - ->setTemplatePath('soutenance/notification/engagement-impartialite-signature') - ->setTemplateVariables([ - 'these' => $these, - 'proposition' => $proposition, - 'membre' => $membre, - ]); + $vars = ['these' => $these, 'doctorant' => $these->getDoctorant(), 'membre' => $membre]; + $url = $this->getUrlService()->setVariables($vars); + $vars['Url'] = $url; - return $notif; - } else { - throw new RuntimeException("Aucun mail de disponible (" . __METHOD__ . "::TheseId#" . $these->getId() . ")"); + $rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::SIGNATURE_ENGAGEMENT_IMPARTIALITE, $vars); + $email = $this->emailTheseService->fetchEmailMaisonDuDoctorat($these); + if (empty($email)) { + throw new RuntimeException("Aucun mail trouvé pour la maison du doctorat de ". $these->getEtablissement()->getStructure()->getLibelle()); } + $notif = new Notification(); + $notif + ->setSubject($rendu->getSujet()) + ->setTo($email) + ->setBody($rendu->getCorps()); + return $notif; } - /** - * @param These $these - * @param Proposition $proposition - * @param Membre $membre - */ - public function createNotificationRefusEngagementImpartialite($these, $proposition, $membre): Notification + public function createNotificationRefusEngagementImpartialite(These $these, Membre $membre): Notification { + $vars = ['these' => $these, 'doctorant' => $these->getDoctorant(), 'membre' => $membre]; + $url = $this->getUrlService()->setVariables($vars); + $vars['Url'] = $url; + + $rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::REFUS_ENGAGEMENT_IMPARTIALITE, $vars); + $emailsAD = $this->emailTheseService->fetchEmailActeursDirects($these); $emailsBDD = $this->emailTheseService->fetchEmailMaisonDuDoctorat($these); $emails = array_merge($emailsAD, $emailsBDD); - - $emails = array_filter($emails, function ($s) { - return $s !== null; - }); - - if (!empty($emails)) { - $notif = new Notification(); - $notif - ->setSubject("Refus de l'engagement d'impartialité de la thèse de " . $these->getDoctorant()->getIndividu()) - ->setTo($emails) - ->setTemplatePath('soutenance/notification/engagement-impartialite-refus') - ->setTemplateVariables([ - 'these' => $these, - 'proposition' => $proposition, - 'membre' => $membre, - ]); - - return $notif; - } else { - throw new RuntimeException("Aucun mail de disponible (" . __METHOD__ . "::TheseId#" . $these->getId() . ")"); + if (empty($emails)) { + throw new RuntimeException("Aucun mail trouvé"); } + $notif = new Notification(); + $notif + ->setSubject($rendu->getSujet()) + ->setTo($emails) + ->setBody($rendu->getCorps()); + return $notif; } - /** - * @param These $these - * @param Proposition $proposition - * @param Membre $membre - */ - public function createNotificationAnnulationEngagementImpartialite($these, $proposition, $membre): Notification + public function createNotificationAnnulationEngagementImpartialite(These $these, Membre $membre): Notification { - $email = $membre->getEmail(); + $vars = ['these' => $these, 'doctorant' => $these->getDoctorant(), 'membre' => $membre]; + $url = $this->getUrlService()->setVariables($vars); + $vars['Url'] = $url; - if ($email) { - $notif = new Notification(); - $notif - ->setSubject("Annulation de la signature de l'engagement d'impartialité de la thèse de " . $these->getDoctorant()->getIndividu()) - ->setTo($email) - ->setTemplatePath('soutenance/notification/engagement-impartialite-annulation') - ->setTemplateVariables([ - 'these' => $these, - 'proposition' => $proposition, - 'membre' => $membre, - ]); + $rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::ANNULATION_ENGAGEMENT_IMPARTIALITE, $vars); - return $notif; - } else { - throw new RuntimeException("Aucun mail de disponible (" . __METHOD__ . "::TheseId#" . $these->getId() . ")"); + $mail = $membre->getEmail(); + if ($mail === null) { + throw new RuntimeException("Aucun mail trouvé pour le rapporteur"); } + $notif = new Notification(); + $notif + ->setSubject($rendu->getSujet()) + ->setTo($mail) + ->setBody($rendu->getCorps()); + return $notif; } @@ -570,7 +533,7 @@ class SoutenanceNotificationFactory extends NotificationFactory * @param Proposition $proposition * @param Membre $rapporteur * @param string $url - * @return \Notification\Notification + * @return Notification */ public function createNotificationDemandeAvisSoutenance(These $these, Proposition $proposition, Membre $rapporteur, string $url): Notification { @@ -665,7 +628,7 @@ class SoutenanceNotificationFactory extends NotificationFactory * @param Proposition $proposition * @param Utilisateur $user * @param string $url - * @return \Notification\Notification + * @return Notification */ public function createNotificationConnexionRapporteur(Proposition $proposition, Utilisateur $user, string $url): Notification { @@ -737,7 +700,7 @@ class SoutenanceNotificationFactory extends NotificationFactory * @param string $email * @param string $url * @param array $avisArray - * @return \Notification\Notification + * @return Notification */ public function createNotificationEnvoiConvocationDoctorant(Doctorant $doctorant, Proposition $proposition, DateTime $date, string $email, string $url, array $avisArray): Notification { @@ -771,7 +734,7 @@ class SoutenanceNotificationFactory extends NotificationFactory * @param string $email * @param string $url * @param array $avisArray - * @return \Notification\Notification + * @return Notification */ public function createNotificationEnvoiConvocationMembre(Membre $membre, Proposition $proposition, DateTime $date, string $email, string $url, array $avisArray): Notification { diff --git a/module/Soutenance/src/Soutenance/Service/Parametre/ParametreService.php b/module/Soutenance/src/Soutenance/Service/Parametre/ParametreService.php deleted file mode 100644 index 522ec63b0f1e1292389bd2acf7163bbbf6fa13af..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Service/Parametre/ParametreService.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -namespace Soutenance\Service\Parametre; - -use Doctrine\ORM\NonUniqueResultException; -use Doctrine\ORM\OptimisticLockException; -use Soutenance\Entity\Parametre; -use UnicaenApp\Exception\RuntimeException; -use UnicaenApp\Service\EntityManagerAwareTrait; - -class ParametreService { - use EntityManagerAwareTrait; - - /** - * @return Parametre[] - */ - public function getParametres() - { - $qb = $this->getEntityManager()->getRepository(Parametre::class)->createQueryBuilder('parametre') - ->orderBy('parametre.id', 'ASC') - ; - - $result = $qb->getQuery()->getResult(); - return $result; - } - - public function getParametresAsArray() - { - $result = $this->getParametres(); - $array = []; - foreach ($result as $item) { - $array[$item->getCode()] = $item->getValeur(); - } - return $array; - } - - /** - * @param integer $id - * @return Parametre - */ - public function getParametre($id) - { - $qb = $this->getEntityManager()->getRepository(Parametre::class)->createQueryBuilder('parametre') - ->andWhere('parametre.id = :id') - ->setParameter('id', $id) - ; - - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs Parametre partagent le même identifiant [".$id."]", $e); - } - return $result; - } - - /** - * @param string $code - * @return Parametre - */ - public function getParametreByCode($code) - { - $qb = $this->getEntityManager()->getRepository(Parametre::class)->createQueryBuilder('parametre') - ->andWhere('parametre.code = :code') - ->setParameter('code', $code) - ; - - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs Parametre partagent le même code [".$code."]", $e); - } - return $result; - } - - /** - * @param Parametre $parametre - * @return Parametre - */ - public function update(Parametre $parametre) - { - try { - $this->getEntityManager()->flush($parametre); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour en BD d'un parametre", $e); - } - return $parametre; - } -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Service/Parametre/ParametreServiceAwareTrait.php b/module/Soutenance/src/Soutenance/Service/Parametre/ParametreServiceAwareTrait.php deleted file mode 100644 index aed1bdd4c4f77099408e523337e90cc040e5426e..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Service/Parametre/ParametreServiceAwareTrait.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Soutenance\Service\Parametre; - -trait ParametreServiceAwareTrait { - /** @var ParametreService */ - private $parametreService; - - /** - * @return ParametreService - */ - public function getParametreService() - { - return $this->parametreService; - } - - /** - * @param ParametreService $parametreService - * @return ParametreService - */ - public function setParametreService($parametreService) - { - $this->parametreService = $parametreService; - return $this->parametreService; - } - - -} \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Service/Parametre/ParametreServiceFactory.php b/module/Soutenance/src/Soutenance/Service/Parametre/ParametreServiceFactory.php deleted file mode 100644 index b43090c472be15b0ae4a3f70b6a0fe881dfdecb5..0000000000000000000000000000000000000000 --- a/module/Soutenance/src/Soutenance/Service/Parametre/ParametreServiceFactory.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Soutenance\Service\Parametre; - -use Doctrine\ORM\EntityManager; -use Interop\Container\ContainerInterface; - -class ParametreServiceFactory -{ - public function __invoke(ContainerInterface $container) - { - /** - * @var EntityManager $entityManager - */ - $entityManager = $container->get('doctrine.entitymanager.orm_default'); - - /** @var ParametreService $service */ - $service = new ParametreService(); - $service->setEntityManager($entityManager); - - return $service; - } -} diff --git a/module/Soutenance/src/Soutenance/Service/Proposition/PropositionService.php b/module/Soutenance/src/Soutenance/Service/Proposition/PropositionService.php index 377f696b26134b8c193a9e4c873f1d5f728e391f..a92fe452427a16f028006e6a191510d9bb9891b2 100644 --- a/module/Soutenance/src/Soutenance/Service/Proposition/PropositionService.php +++ b/module/Soutenance/src/Soutenance/Service/Proposition/PropositionService.php @@ -2,7 +2,6 @@ namespace Soutenance\Service\Proposition; -//TODO faire le repo aussi use Application\Entity\Db\Repository\DefaultEntityRepository; use Application\Entity\Db\Role; use Application\Entity\Db\TypeValidation; @@ -15,21 +14,20 @@ use Application\Service\Variable\VariableServiceAwareTrait; use DateInterval; use DateTime; use Doctrine\ORM\NonUniqueResultException; -use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\ORMException; use Exception; use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; use Fichier\Service\Storage\Adapter\Exception\StorageAdapterException; use Individu\Entity\Db\Individu; use Laminas\Mvc\Controller\AbstractActionController; +use Notification\Service\NotifierServiceAwareTrait; use Soutenance\Entity\Etat; use Soutenance\Entity\Membre; use Soutenance\Entity\Proposition; +use Soutenance\Provider\Parametre\SoutenanceParametres; use Soutenance\Provider\Validation\TypeValidation as TypeValidationSoutenance; use Soutenance\Service\Membre\MembreServiceAwareTrait; use Soutenance\Service\Notification\SoutenanceNotificationFactoryAwareTrait; -use Notification\Service\NotifierServiceAwareTrait; -use Soutenance\Service\Parametre\ParametreServiceAwareTrait; use Soutenance\Service\Validation\ValidatationServiceAwareTrait; use Structure\Entity\Db\EcoleDoctorale; use Structure\Service\Etablissement\EtablissementServiceAwareTrait; @@ -38,6 +36,7 @@ use These\Service\Acteur\ActeurServiceAwareTrait; use UnicaenApp\Exception\LogicException; use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Service\EntityManagerAwareTrait; +use UnicaenParametre\Service\Parametre\ParametreServiceAwareTrait; class PropositionService extends BaseService { @@ -45,8 +44,8 @@ class PropositionService extends BaseService use ActeurServiceAwareTrait; use ValidatationServiceAwareTrait; use NotifierServiceAwareTrait; - use SoutenanceNotificationFactoryAwareTrait; use ParametreServiceAwareTrait; + use SoutenanceNotificationFactoryAwareTrait; use VariableServiceAwareTrait; use FichierStorageServiceAwareTrait; use EtablissementServiceAwareTrait; @@ -63,10 +62,6 @@ class PropositionService extends BaseService /** GESTION DES ENTITES *******************************************************************************************/ - /** - * @param These $these - * @return Proposition - */ public function create(These $these) : Proposition { $proposition = new Proposition($these); @@ -87,16 +82,12 @@ class PropositionService extends BaseService try { $this->getEntityManager()->persist($proposition); $this->getEntityManager()->flush($proposition); - } catch (OptimisticLockException $e) { + } catch (ORMException $e) { throw new RuntimeException("Un erreur s'est produite lors de l'enregistrment en BD de la proposition de thèse !"); } return $proposition; } - /** - * @param Proposition $proposition - * @return Proposition - */ public function update(Proposition $proposition) : Proposition { try { @@ -111,29 +102,15 @@ class PropositionService extends BaseService try { $this->getEntityManager()->flush($proposition); - } catch (OptimisticLockException $e) { + } catch (ORMException $e) { throw new RuntimeException("Une erreur s'est produite lors de la mise à jour de la proposition de soutenance !"); } return $proposition; } - /** - * @param Proposition $proposition - * @return Proposition - */ - public function historise($proposition) + public function historise(Proposition $proposition) : Proposition { - try { - $date = new DateTime(); - $user = $this->userContextService->getIdentityDb(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération des données liées à l'historisation", 0 , $e); - } - - $proposition->setHistoModificateur($user); - $proposition->setHistoModification($date); - $proposition->setHistoDestructeur($user); - $proposition->setHistoDestruction($date); + $proposition->historiser(); try { $this->getEntityManager()->flush($proposition); @@ -143,23 +120,9 @@ class PropositionService extends BaseService return $proposition; } - /** - * @param Proposition $proposition - * @return Proposition - */ - public function restore($proposition) + public function restore(Proposition $proposition) : Proposition { - try { - $date = new DateTime(); - $user = $this->userContextService->getIdentityDb(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération des données liées à l'historisation", 0 , $e); - } - - $proposition->setHistoModificateur($user); - $proposition->setHistoModification($date); - $proposition->setHistoDestructeur(null); - $proposition->setHistoDestruction(null); + $proposition->dehistoriser(); try { $this->getEntityManager()->flush($proposition); @@ -169,17 +132,15 @@ class PropositionService extends BaseService return $proposition; } - /** - * @param Proposition $proposition - */ - public function delete($proposition) + public function delete(Proposition $proposition) : Proposition { try { $this->getEntityManager()->remove($proposition); $this->getEntityManager()->flush($proposition); - } catch (OptimisticLockException $e) { + } catch (ORMException $e) { throw new RuntimeException("Une erreur s'est produite lors de la mise à jour de la proposition de soutenance !"); } + return $proposition; } /** REQUETES ******************************************************************************************************/ @@ -205,11 +166,7 @@ class PropositionService extends BaseService ; } - /** - * @param int $id - * @return Proposition - */ - public function find($id): Proposition + public function find(?int $id): ?Proposition { $qb = $this->createQueryBuilder() ->andWhere("proposition.id = :id") @@ -224,22 +181,13 @@ class PropositionService extends BaseService return $result; } - /** - * @param AbstractActionController $controller - * @param string $param - * @return Proposition - */ - public function getRequestedProposition(AbstractActionController $controller, string $param = 'proposition') : Proposition + public function getRequestedProposition(AbstractActionController $controller, string $param = 'proposition') : ?Proposition { $id = $controller->params()->fromRoute($param); return $this->find($id); } - /** - * @param These $these - * @return Proposition|null - */ public function findOneForThese(These $these): ?Proposition { $qb = $this->createQueryBuilder() @@ -336,13 +284,12 @@ class PropositionService extends BaseService $nbExterieur = 0; $nbRapporteur = 0; - $parameters = $this->getParametreService()->getParametresAsArray(); - $parite_min = $parameters['JURY_PARITE_RATIO_MIN']; - $membre_min = $parameters['JURY_SIZE_MIN']; - $membre_max = $parameters['JURY_SIZE_MAX']; - $rapporteur_min = $parameters['JURY_RAPPORTEUR_SIZE_MIN']; - $rangA_min = $parameters['JURY_RANGA_RATIO_MIN']; - $exterieur_min = $parameters['JURY_EXTERIEUR_RATIO_MIN']; + $membre_min = $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::NB_MIN_MEMBRE_JURY)->getValeur(); + $membre_max = $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::NB_MAX_MEMBRE_JURY)->getValeur(); + $rapporteur_min = $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::NB_MIN_RAPPORTEUR)->getValeur(); + $rangA_min = ((float) $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::RATIO_MIN_RANG_A)->getValeur()); + $exterieur_min = ((float) $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::RATIO_MIN_EXTERIEUR)->getValeur()); + $parite_min = ((float) $this->getParametreService()->getParametreByCode(SoutenanceParametres::CATEGORIE, SoutenanceParametres::RATIO_PARITE)->getValeur()); /** @var Membre $membre */ foreach ($proposition->getMembres() as $membre) { diff --git a/module/Soutenance/src/Soutenance/Service/Proposition/PropositionServiceFactory.php b/module/Soutenance/src/Soutenance/Service/Proposition/PropositionServiceFactory.php index 802741e351038be381ca73b9f4f8470044696f81..273adca62e020e7828973132db679150e8fe2872 100644 --- a/module/Soutenance/src/Soutenance/Service/Proposition/PropositionServiceFactory.php +++ b/module/Soutenance/src/Soutenance/Service/Proposition/PropositionServiceFactory.php @@ -2,6 +2,8 @@ namespace Soutenance\Service\Proposition; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Soutenance\Service\Notification\SoutenanceNotificationFactory; use These\Service\Acteur\ActeurService; use Structure\Service\Etablissement\EtablissementService; @@ -12,14 +14,14 @@ use Doctrine\ORM\EntityManager; use Psr\Container\ContainerInterface; use Soutenance\Service\Membre\MembreService; use Notification\Service\NotifierService; -use Soutenance\Service\Parametre\ParametreService; use Soutenance\Service\Validation\ValidationService; +use UnicaenParametre\Service\Parametre\ParametreService; class PropositionServiceFactory { /** - * @throws \Psr\Container\ContainerExceptionInterface - * @throws \Psr\Container\NotFoundExceptionInterface + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function __invoke(ContainerInterface $container): PropositionService { @@ -58,7 +60,6 @@ class PropositionServiceFactory $service->setMembreService($membreService); $service->setUserContextService($userContextService); - /** @var \Soutenance\Service\Notification\SoutenanceNotificationFactory $soutenanceNotificationFactory */ $soutenanceNotificationFactory = $container->get(SoutenanceNotificationFactory::class); $service->setSoutenanceNotificationFactory($soutenanceNotificationFactory); diff --git a/module/Soutenance/src/Soutenance/Service/Url/UrlService.php b/module/Soutenance/src/Soutenance/Service/Url/UrlService.php index fd1131b1ac690b26a99467d150640fbd3014b22b..a44596e66f21c29654c3a1449d5c9432a595a346 100644 --- a/module/Soutenance/src/Soutenance/Service/Url/UrlService.php +++ b/module/Soutenance/src/Soutenance/Service/Url/UrlService.php @@ -5,11 +5,13 @@ namespace Soutenance\Service\Url; use DateTime; use Laminas\View\Renderer\PhpRenderer; use Soutenance\Controller\PropositionController; +use Soutenance\Service\Membre\MembreServiceAwareTrait; /** * TODO faire remonter un service père qui embarque la mécanique de base */ class UrlService { + use MembreServiceAwareTrait; /** @var PhpRenderer */ protected $renderer; @@ -82,4 +84,34 @@ class UrlService { return $url; } + /** + * @noinspection PhpUnusedAliasInspection + * @return string + */ + public function getRapportTechnique() : string + { + $these = $this->variables['these']; + /** @see \Soutenance\Controller\PresoutenanceController::rapportTechniqueAction() */ + $url = $this->renderer->url('soutenance/presoutenance/rapport-technique', ['these' => $these->getId()], ['force_canonical' => 'true'], true); + return $url; + } + + /** + * @noinspection PhpUnusedAliasInspection + * @return string + */ + public function getUrlRapporteurDashboard() : string + { + $these = $this->variables['these']; + $rapporteur = $this->variables['rapporteur']; + if ($rapporteur->getActeur()) { + $token = $this->getMembreService()->retrieveOrCreateToken($rapporteur); + $url_rapporteur = $this->renderer->url("soutenance/index-rapporteur", ['these' => $these->getId()], ['force_canonical' => true], true); + $url = $this->renderer->url('zfcuser/login', ['type' => 'token'], ['query' => ['token' => $token->getToken(), 'redirect' => $url_rapporteur, 'role' => $rapporteur->getActeur()->getRole()->getRoleId()], 'force_canonical' => true], true); + } else { + $url = $this->renderer->url('home'); + } + return "<a href='".$url."' target='_blank'> Tableau de bord / Dashboard </a>"; + } + } \ No newline at end of file diff --git a/module/Soutenance/src/Soutenance/Service/Url/UrlServiceFactory.php b/module/Soutenance/src/Soutenance/Service/Url/UrlServiceFactory.php index f7e38d058d3b328a656409e22fdaf45475e17c08..95bcea56508a31c4d916eca38ee997a8d833a6e9 100644 --- a/module/Soutenance/src/Soutenance/Service/Url/UrlServiceFactory.php +++ b/module/Soutenance/src/Soutenance/Service/Url/UrlServiceFactory.php @@ -6,6 +6,7 @@ use Interop\Container\ContainerInterface; use Laminas\View\Renderer\PhpRenderer; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; +use Soutenance\Service\Membre\MembreService; class UrlServiceFactory { @@ -17,11 +18,16 @@ class UrlServiceFactory { */ public function __invoke(ContainerInterface $container) : UrlService { - /* @var PhpRenderer $renderer */ + /** + * @var PhpRenderer $renderer + * @var MembreService $membreService + */ $renderer = $container->get('ViewRenderer'); + $membreService = $container->get(MembreService::class); $service = new UrlService(); $service->setRenderer($renderer); + $service->setMembreService($membreService); return $service; } } \ No newline at end of file diff --git a/module/Soutenance/view/soutenance/configuration/index.phtml b/module/Soutenance/view/soutenance/configuration/index.phtml deleted file mode 100644 index 31748b6229e6efb7b9f1e8aa708b619750b70e99..0000000000000000000000000000000000000000 --- a/module/Soutenance/view/soutenance/configuration/index.phtml +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/** - * @see \Soutenance\Controller\ConfigurationController::indexAction() - * - * @var ConfigurationForm $form - */ - -use Soutenance\Entity\Parametre; -use Soutenance\Form\Configuration\ConfigurationForm; - -?> - -<h1 class="page-header"> - Configuration du module de soutenance -</h1> - -<?php echo $this->form()->openTag($form) ?> -<div class="row"> -<div class="col-md-6"> - <h2>Composition du jury</h2> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_JURY_SIZE_MIN)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_JURY_SIZE_MAX)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_JURY_RAPPORTEUR_SIZE_MIN)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_JURY_EXTERIEUR_RATIO_MIN)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_JURY_RANGA_RATIO_MIN)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_JURY_PARITE_RATIO_MIN)); ?> -</div> -<div class="col-md-6"> - <h2>Formulaires associés à la soutenance</h2> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_FORMULAIRE_DELOCALISATION)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_FORMULAIRE_DELEGUATION)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_FORMULAIRE_LABEL_EUROPEEN)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_FORMULAIRE_THESE_ANGLAIS)); ?> - <?php echo $this->formControlGroup($form->get(Parametre::CODE_FORMULAIRE_CONFIDENTIALITE)); ?> -</div> -</div> -<h2> Autres paramètres </h2> -<?php echo $this->formControlGroup($form->get(Parametre::CODE_AVIS_DEADLINE)); ?> -<?php echo $this->formControlGroup($form->get(Parametre::CODE_DIRECTEUR_INTERVENTION)); ?> -<?php echo $this->formControlGroup($form->get('submit')); ?> -<?php echo $this->form()->closeTag(); ?> - -<?php -//echo $this->form($form); -?> diff --git a/module/Soutenance/view/soutenance/notification/engagement-impartialite-annulation.phtml b/module/Soutenance/view/soutenance/notification/engagement-impartialite-annulation.phtml deleted file mode 100644 index 36f85e701a10414b24eae5bbbcbdc8ce37e1df44..0000000000000000000000000000000000000000 --- a/module/Soutenance/view/soutenance/notification/engagement-impartialite-annulation.phtml +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -use These\Entity\Db\These; -use Soutenance\Entity\Membre; -use Soutenance\Entity\Proposition; - -/** - * @see \Soutenance\Service\Notification\SoutenanceNotificationFactory::createNotificationAnnulationEngagementImpartialite() - * @var These $these - * @var Proposition $proposition - * @var Membre $membre - */ - -$justification = true; - -?> - -<p> - Bonjour, -</p> -<p> - Votre signature de l'engagement d'impartialité de la thèse de - <strong><?php echo $these->getDoctorant()->getNomComplet(); ?></strong> intitulée - <strong><?php echo $these->getTitre(); ?></strong> vient d'être annulée. -</p> - -<?php if ($justification) : ?> -<p> - Vous avez reçu ce mail car : - <ol> - <li> vous avez signé l'engagement d'impartialité pour la thèse de <?php echo $these->getDoctorant()->getIndividu()->getNomComplet(); ?>; </li> - <li> la signature a été annulée. </li> - </ol> -</p> -<?php endif; ?> \ No newline at end of file diff --git a/module/Soutenance/view/soutenance/notification/engagement-impartialite-demande.phtml b/module/Soutenance/view/soutenance/notification/engagement-impartialite-demande.phtml deleted file mode 100644 index 8b0d12789a22e3ac3c97580b32befb71156282a2..0000000000000000000000000000000000000000 --- a/module/Soutenance/view/soutenance/notification/engagement-impartialite-demande.phtml +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -use These\Entity\Db\These; -use Soutenance\Entity\Membre; -use Soutenance\Entity\Proposition; - -/** - * @see \Soutenance\Service\Notification\SoutenanceNotificationFactory::createNotificationDemandeSignatureEngagementImpartialite() - * @var These $these - * @var Proposition $proposition - * @var Membre $membre - * @var string $url - */ - -//$urlRetour = $this->url('soutenance/engagement-impartialite', ['these' => $these->getId(), 'membre' => $membre->getId()], ['force_canonical'=>true], true); - -$justification = true; -?> - -<p><em>-- Version française----------------------------------------------------</em></p> -<p> - Bonjour, -</p> -<p> - Afin de pouvoir devenir rapporteur de la thèse de <strong><?php echo $these->getDoctorant()->getIndividu(); ?></strong> intitulée - <strong><?php echo $these->getTitre(); ?></strong>, il est nécessaire de signer électroniquement l'engagement d'impartialité dans - l'application <?php echo $this->appInfos()->nom ?> : <strong><a href="<?php echo $url; ?>">Accéder à votre table de bord SyGAL</a></strong>. -</p> -<p> - Vous accéderez ainsi à une page "index de la soutenance" listant les membres du jury. - Cliquez ensuite sur "accès à l’engagement d’impartialité". - Puis après avoir pris connaissance des conditions relatives à cet engagement, vous pourrez signer ou non cet engagement d’impartialité. - Si vous signez, vous pourrez alors télécharger le PDF du manuscrit de thèse. -</p> -<p> - Cordialement, -</p> - -<p><em>-- English version -----------------------------------------------------</em></p> -<p> - Dear Mrs/Mr, -</p> -<p> - Before being officially registered as an external referee for the PhD thesis presented by <strong><?php echo $these->getDoctorant()->getIndividu(); ?></strong> entitled - <strong><?php echo $these->getTitre(); ?></strong>, you have to sign the "impartiality commitment" available in your dashborad : <strong><a href="<?php echo $url; ?>">Access your SyGAL dashboard</a></strong>. -</p> -<p> - You will then be connected to a web page entitled "index of the PhD defense" listing the PhD jury members. - Click then on "access to the impartiality commitment". - Then, after reading the requirements regarding the impartiality commitment of an external referee, you sign it or not. - If you sign it, you will be able to download the PDF version of the PhD manuscript. -</p> -<p> - Best regards, -</p> - -<?php if ($justification) : ?> - <p> - Vous avez reçu ce mail car : - <ol> - <li> vous avez été désigné rapporteur pour la thèse de <?php echo $these->getDoctorant()->getIndividu()->getNomComplet(); ?>; </li> - <li> la signature a été annulée. </li> - </ol> - </p> -<?php endif; ?> diff --git a/module/Soutenance/view/soutenance/notification/engagement-impartialite-refus.phtml b/module/Soutenance/view/soutenance/notification/engagement-impartialite-refus.phtml deleted file mode 100644 index 16bedb0c14c8f24577cd44117aa6934f1425ed24..0000000000000000000000000000000000000000 --- a/module/Soutenance/view/soutenance/notification/engagement-impartialite-refus.phtml +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -use These\Entity\Db\These; -use Soutenance\Entity\Membre; -use Soutenance\Entity\Proposition; - -/** - * @see \Soutenance\Service\Notification\SoutenanceNotificationFactory::createNotificationRefusEngagementImpartialite() - * @var These $these - * @var Proposition $proposition - * @var Membre $membre - */ - -$justification = true; -?> - -<p> - Bonjour, -</p> -<p> - <strong><?php echo $membre->getIndividu(); ?></strong> vient de refuser de signer l'engagement d'impartialité de la thèse de - <strong><?php echo $these->getDoctorant()->getNomComplet(); ?></strong> intitulée - <strong><?php echo $these->getTitre(); ?></strong>. -</p> - -<?php if ($justification) : ?> - <p> - Vous avez reçu ce mail car : - <ol> - <li> le rapporteur <?php echo $membre->getIndividu()->getNomComplet() ?> vient de refuser de signer l'engagement d'impartialité; </li> - <li> vous êtes soit : - <ul> - <li> un des acteurs directs de la thèse de <?php echo $these->getDoctorant()->getIndividu()->getNomComplet(); ?> ; </li> - <li> un gestionnaire de la maison du doctorat de l'établissement d'inscription du doctorant . </li> - </ul> - </li> - </ol> - </p> -<?php endif; ?> - diff --git a/module/Soutenance/view/soutenance/notification/engagement-impartialite-signature.phtml b/module/Soutenance/view/soutenance/notification/engagement-impartialite-signature.phtml deleted file mode 100644 index 1e39542417f9532d231aaa4034e89dd1e0707bff..0000000000000000000000000000000000000000 --- a/module/Soutenance/view/soutenance/notification/engagement-impartialite-signature.phtml +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -use These\Entity\Db\These; -use Soutenance\Entity\Membre; -use Soutenance\Entity\Proposition; - -/** - * @see \Soutenance\Service\Notification\SoutenanceNotificationFactory::createNotificationSignatureEngagementImpartialite() - * @var These $these - * @var Proposition $proposition - * @var Membre $membre - */ - -$justification = true; -?> - -<p> - Bonjour, -</p> -<p> - <strong><?php echo $membre->getIndividu(); ?></strong> vient de signer l'engagement d'impartialité de la thèse de - <strong><?php echo $these->getDoctorant()->getNomComplet(); ?></strong> intitulée - <strong><?php echo $these->getTitre(); ?></strong>. -</p> - -<?php if ($justification) : ?> - <p> - Vous avez reçu ce mail car : - <ol> - <li> le rapporteur <?php echo $membre->getIndividu()->getNomComplet() ?> vient de signer l'engagement d'impartialité; </li> - <li> vous êtes un gestionnaire de la maison du doctorat de l'établissement d'inscription du doctorant . </li> - </ol> - </p> -<?php endif; ?> - diff --git a/module/Soutenance/view/soutenance/presoutenance/presoutenance.phtml b/module/Soutenance/view/soutenance/presoutenance/presoutenance.phtml index bea84b5b55bbbc0a898b78519cc118beedabb4fa..41105ccaecf37a5c417358533894fb95f576ed6e 100644 --- a/module/Soutenance/view/soutenance/presoutenance/presoutenance.phtml +++ b/module/Soutenance/view/soutenance/presoutenance/presoutenance.phtml @@ -303,7 +303,7 @@ $canSimulerRemonter = $this->isAllowed(PresoutenancePrivileges::getResourceId(Pr </a> <?php endif; ?> - <?php if ($proposition->getEtat()->getCode() === Etat::VALIDEE AND $canGenererDocument AND $proposition->hasVisio()) : ?> + <?php if ($proposition->getEtat()->getCode() === Etat::VALIDEE AND $canGenererDocument) : ?> <a <?php /** @see \Soutenance\Controller\PresoutenanceController::rapportSoutenanceAction() */ ?> href="<?php echo $this->url('soutenance/presoutenance/rapport-soutenance', ['these' => $these->getId()], [], true); ?>" class="btn btn-primary action"