diff --git a/.gitignore b/.gitignore index 7594f1d988eff27380604154d70c43b6d2288072..9e4330033c34cf30d2dc002b17f8a0b4d2ce219d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ vendor/ +data/ +upload/ .idea config/autoload/*local* diff --git a/Dockerfile b/Dockerfile index 69611f30f2f06890b0f05abb870463f5d1063126..97da39b1d3e29498edad6345a13d8caf747ee204 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,11 +25,11 @@ RUN ln -sf /dev/stdout /var/log/apache2/other_vhosts_access.log RUN ln -sf /dev/stderr /var/log/apache2/error.log # Configuration Apache, PHP et FPM -ADD docker/apache-ports.conf ${APACHE_CONF_DIR}/ports.conf -ADD docker/apache-site.conf ${APACHE_CONF_DIR}/sites-available/app.conf -ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/app-ssl.conf -ADD docker/fpm/pool.d/app.conf ${PHP_CONF_DIR}/fpm/pool.d/app.conf -ADD docker/fpm/conf.d/app.ini ${PHP_CONF_DIR}/fpm/conf.d/90-app.ini +ADD docker/apache-ports.conf ${APACHE_CONF_DIR}/ports.conf +ADD docker/apache-site.conf ${APACHE_CONF_DIR}/sites-available/app.conf +ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/app-ssl.conf +ADD docker/fpm/pool.d/www.conf ${PHP_CONF_DIR}/fpm/pool.d/ +ADD docker/fpm/conf.d/99-app.ini ${PHP_CONF_DIR}/fpm/conf.d/ # Copie des scripts complémentaires à lancer au démarrage du container COPY docker/entrypoint.d/* /entrypoint.d/ diff --git a/composer.json b/composer.json index 14930f1b408c908784bf9a6d6083dc7b64c469f7..4fb3f460e06db6b33280d175859e08f016d90570 100755 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "unicaen/app": "^1.2", "unicaen/auth": "^1.2", "unicaen/ldap": "^2.2", - "unicaen/octopus": "^0.6.0" + "unicaen/octopus": "^0.6.0", + "unicaen/db-import": "^1.1" }, "require-dev": { "unicaen/code": "^1.0", diff --git a/composer.lock b/composer.lock index d96f2860e9fe8c6850a548a22bd30e573f2d4bf6..bd5e71ef473f0cd7a192033721f47c6757bc29c9 100644 --- a/composer.lock +++ b/composer.lock @@ -1,11 +1,66 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "235a5bfca20e9fda8157b07ca032fb33", + "content-hash": "7148dde3835dec1826443e09baf8db53", "packages": [ + { + "name": "beberlei/assert", + "version": "v2.9.6", + "source": { + "type": "git", + "url": "https://github.com/beberlei/assert.git", + "reference": "ec9e4cf0b63890edce844ee3922e2b95a526e936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beberlei/assert/zipball/ec9e4cf0b63890edce844ee3922e2b95a526e936", + "reference": "ec9e4cf0b63890edce844ee3922e2b95a526e936", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.1.1", + "phpunit/phpunit": "^4.8.35|^5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Assert\\": "lib/Assert" + }, + "files": [ + "lib/Assert/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Collaborator" + } + ], + "description": "Thin assertion library for input validation in business models.", + "keywords": [ + "assert", + "assertion", + "validation" + ], + "time": "2018-06-11T17:15:25+00:00" + }, { "name": "bjyoungblood/bjy-authorize", "version": "1.4.0", @@ -584,33 +639,33 @@ }, { "name": "doctrine/inflector", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -647,7 +702,7 @@ "singularize", "string" ], - "time": "2015-11-06T14:35:42+00:00" + "time": "2017-07-22T12:18:28+00:00" }, { "name": "doctrine/instantiator", @@ -835,16 +890,16 @@ }, { "name": "jasig/phpcas", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/apereo/phpCAS.git", - "reference": "61c8899c8f91204e8b9135d795461e50fe5c2db0" + "reference": "b5b29102c3a42f570c4a3e852f3cf67cae6d6082" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apereo/phpCAS/zipball/61c8899c8f91204e8b9135d795461e50fe5c2db0", - "reference": "61c8899c8f91204e8b9135d795461e50fe5c2db0", + "url": "https://api.github.com/repos/apereo/phpCAS/zipball/b5b29102c3a42f570c4a3e852f3cf67cae6d6082", + "reference": "b5b29102c3a42f570c4a3e852f3cf67cae6d6082", "shasum": "" }, "require": { @@ -882,10 +937,11 @@ "description": "Provides a simple API for authenticating users against a CAS server", "homepage": "https://wiki.jasig.org/display/CASC/phpCAS", "keywords": [ + "apereo", "cas", "jasig" ], - "time": "2017-04-10T19:12:45+00:00" + "time": "2019-04-22T19:48:16+00:00" }, { "name": "kriswallsmith/assetic", @@ -1012,18 +1068,63 @@ ], "time": "2016-12-12T10:42:18+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02T15:55:56+00:00" + }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1057,7 +1158,89 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "ramsey/uuid", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "^1.0|^2.0|9.99.99", + "php": "^5.4 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "codeception/aspect-mock": "^1.0 | ~2.0.0", + "doctrine/annotations": "~1.2.0", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", + "ircmaxell/random-lib": "^1.1", + "jakub-onderka/php-parallel-lint": "^0.9.0", + "mockery/mockery": "^0.9.9", + "moontoast/math": "^1.1", + "php-mock/php-mock-phpunit": "^0.3|^1.1", + "phpunit/phpunit": "^4.7|^5.0|^6.5", + "squizlabs/php_codesniffer": "^2.3" + }, + "suggest": { + "ext-ctype": "Provides support for PHP Ctype functions", + "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", + "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", + "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", + "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", + "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": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marijn Huizendveld", + "email": "marijn.huizendveld@gmail.com" + }, + { + "name": "Thibaud Fabre", + "email": "thibaud@aztech.io" + }, + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", + "homepage": "https://github.com/ramsey/uuid", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "time": "2018-07-19T23:38:55+00:00" }, { "name": "rwoverdijk/assetmanager", @@ -1171,7 +1354,7 @@ }, { "name": "symfony/console", - "version": "v3.3.16", + "version": "v3.3.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -1239,16 +1422,16 @@ }, { "name": "symfony/debug", - "version": "v3.4.6", + "version": "v3.4.27", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc" + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/9b1071f86e79e1999b3d3675d2e0e7684268b9bc", - "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc", + "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9", "shasum": "" }, "require": { @@ -1291,20 +1474,78 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-02-28T21:49:22+00:00" + "time": "2019-04-11T09:48:14+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "82ebae02209c21113908c229e9883c419720738a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", "shasum": "" }, "require": { @@ -1316,7 +1557,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -1350,20 +1591,20 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/process", - "version": "v2.8.36", + "version": "v2.8.50", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9" + "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/756f614c5061729ea245ac6717231f7e3bfb74f9", - "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9", + "url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8", + "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8", "shasum": "" }, "require": { @@ -1399,15 +1640,15 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-02-12T17:44:58+00:00" + "time": "2018-11-11T11:18:13+00:00" }, { "name": "unicaen/app", - "version": "1.3.10", + "version": "1.3.26", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/app.git", - "reference": "845dd41da189fdd5e39f6d2d882e05b77a16c5dc" + "reference": "79aef7a75e26ff4219d82046005a297d6f1e5e6f" }, "require": { "doctrine/doctrine-orm-module": ">=0.7", @@ -1450,19 +1691,21 @@ ] }, "description": "Module de base des applications unicaen", - "time": "2018-03-28T08:06:13+00:00" + "time": "2019-05-07T13:37:50+00:00" }, { "name": "unicaen/auth", - "version": "1.2.5", + "version": "1.3.9", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/auth.git", - "reference": "4f1a531c08b1474340e9d90e92a1ad7b18dda620" + "reference": "19b325c4877a87945bffb7b8ced994dff3ddac48" }, "require": { + "beberlei/assert": "^2.9", "bjyoungblood/bjy-authorize": ">=1.4", "jasig/phpcas": ">=1.3.3", + "ramsey/uuid": "^3.7", "unicaen/app": "^1.3", "zf-commons/zfc-user-doctrine-orm": ">=0.1" }, @@ -1480,7 +1723,42 @@ ] }, "description": "Module d'authentification pour les applications Unicaen", - "time": "2018-03-28T08:19:16+00:00" + "time": "2019-04-25T08:44:09+00:00" + }, + { + "name": "unicaen/db-import", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://git.unicaen.fr/lib/unicaen/db-import.git", + "reference": "ebe6f7c14511870109874eb77d86b3ff8654338f" + }, + "require": { + "beberlei/assert": "^2.7", + "doctrine/doctrine-orm-module": ">=0.7", + "php": ">=5.6", + "ramsey/uuid": "^3.6" + }, + "require-dev": { + "phpunit/phpunit": "~5.4", + "unicaen/test": "^1.0" + }, + "type": "module", + "autoload": { + "psr-0": { + "UnicaenDbImport\\": "src/" + }, + "classmap": [ + "./Module.php" + ] + }, + "autoload-dev": { + "psr-4": { + "UnicaenDbImportUnitTest\\": "test/UnicaenDbImportUnitTest" + } + }, + "description": "Module d'import entre bases de données", + "time": "2018-02-26T10:20:56+00:00" }, { "name": "unicaen/ldap", @@ -1548,44 +1826,98 @@ "time": "2019-04-15T15:21:00+00:00" }, { - "name": "zendframework/zend-authentication", + "name": "zendframework/zendframework", "version": "2.4.13", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-authentication.git", - "reference": "6868e48c1385e4bee14037b22dddfe11704f9d8c" + "url": "https://github.com/zendframework/zendframework.git", + "reference": "06bf809653a51e843b7a84dc380ac1d8a0a6a1ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-authentication/zipball/6868e48c1385e4bee14037b22dddfe11704f9d8c", - "reference": "6868e48c1385e4bee14037b22dddfe11704f9d8c", + "url": "https://api.github.com/repos/zendframework/zendframework/zipball/06bf809653a51e843b7a84dc380ac1d8a0a6a1ea", + "reference": "06bf809653a51e843b7a84dc380ac1d8a0a6a1ea", "shasum": "" }, "require": { "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" + "zendframework/zendxml": "^1.0.1" }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", + "replace": { + "zendframework/zend-authentication": "self.version", + "zendframework/zend-barcode": "self.version", + "zendframework/zend-cache": "self.version", + "zendframework/zend-captcha": "self.version", + "zendframework/zend-code": "self.version", + "zendframework/zend-config": "self.version", + "zendframework/zend-console": "self.version", "zendframework/zend-crypt": "self.version", "zendframework/zend-db": "self.version", + "zendframework/zend-debug": "self.version", + "zendframework/zend-di": "self.version", + "zendframework/zend-dom": "self.version", + "zendframework/zend-escaper": "self.version", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-feed": "self.version", + "zendframework/zend-file": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-form": "self.version", "zendframework/zend-http": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-inputfilter": "self.version", + "zendframework/zend-json": "self.version", "zendframework/zend-ldap": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-log": "self.version", + "zendframework/zend-mail": "self.version", + "zendframework/zend-math": "self.version", + "zendframework/zend-memory": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-modulemanager": "self.version", + "zendframework/zend-mvc": "self.version", + "zendframework/zend-navigation": "self.version", + "zendframework/zend-paginator": "self.version", + "zendframework/zend-permissions-acl": "self.version", + "zendframework/zend-permissions-rbac": "self.version", + "zendframework/zend-progressbar": "self.version", + "zendframework/zend-resources": "self.version", + "zendframework/zend-serializer": "self.version", + "zendframework/zend-server": "self.version", + "zendframework/zend-servicemanager": "self.version", "zendframework/zend-session": "self.version", + "zendframework/zend-soap": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-tag": "self.version", + "zendframework/zend-test": "self.version", + "zendframework/zend-text": "self.version", "zendframework/zend-uri": "self.version", - "zendframework/zend-validator": "self.version" + "zendframework/zend-validator": "self.version", + "zendframework/zend-version": "self.version", + "zendframework/zend-view": "self.version", + "zendframework/zend-xmlrpc": "self.version" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "fabpot/php-cs-fixer": "~1.0", + "ircmaxell/random-lib": "~1.1", + "mikey179/vfsstream": "~1.2", + "phpunit/phpcov": "~2.0", + "phpunit/phpunit": "~4.6", + "satooshi/php-coveralls": "dev-master" }, "suggest": { - "zendframework/zend-crypt": "Zend\\Crypt component", - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-http": "Zend\\Http component", - "zendframework/zend-ldap": "Zend\\Ldap component", - "zendframework/zend-session": "Zend\\Session component", - "zendframework/zend-uri": "Zend\\Uri component", - "zendframework/zend-validator": "Zend\\Validator component" + "doctrine/annotations": "Doctrine Annotations >=1.0 for annotation features", + "ext-intl": "ext/intl for i18n features (included in default builds of PHP)", + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable", + "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", + "zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes", + "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form" }, + "bin": [ + "bin/classmap_generator.php", + "bin/pluginmap_generator.php", + "bin/templatemap_generator.php" + ], "type": "library", "extra": { "branch-alias": { @@ -1595,1854 +1927,99 @@ }, "autoload": { "psr-4": { - "Zend\\Authentication\\": "src/" + "Zend\\": "library/Zend/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "provides an API for authentication and includes concrete authentication adapters for common use case scenarios", - "homepage": "https://github.com/zendframework/zend-authentication", + "description": "Zend Framework 2", + "homepage": "http://framework.zend.com/", "keywords": [ - "Authentication", + "framework", "zf2" ], - "time": "2015-05-11T16:17:05+00:00" + "time": "2017-07-13T17:23:56+00:00" }, { - "name": "zendframework/zend-cache", - "version": "2.4.13", + "name": "zendframework/zendxml", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-cache.git", - "reference": "5c4e6231082f74ab3e4fd58927c867ef4c24d71f" + "url": "https://github.com/zendframework/ZendXml.git", + "reference": "eceab37a591c9e140772a1470338258857339e00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/5c4e6231082f74ab3e4fd58927c867ef4c24d71f", - "reference": "5c4e6231082f74ab3e4fd58927c867ef4c24d71f", + "url": "https://api.github.com/repos/zendframework/ZendXml/zipball/eceab37a591c9e140772a1470338258857339e00", + "reference": "eceab37a591c9e140772a1470338258857339e00", "shasum": "" }, "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "~2.4.0", - "zendframework/zend-serializer": "~2.4.0", - "zendframework/zend-servicemanager": "~2.4.0", - "zendframework/zend-stdlib": "~2.4.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-session": "~2.4.0" - }, - "suggest": { - "ext-apc": "APC >= 3.1.6 to use the APC storage adapter", - "ext-dba": "DBA, to use the DBA storage adapter", - "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", - "ext-mongo": "Mongo, to use MongoDb storage adapter", - "ext-wincache": "WinCache, to use the WinCache storage adapter", - "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-session": "Zend\\Session component" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" + "dev-master": "1.2.x-dev", + "dev-develop": "1.3.x-dev" } }, "autoload": { "psr-4": { - "Zend\\Cache\\": "src/" + "ZendXml\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "provides a generic way to cache any data", - "homepage": "https://github.com/zendframework/zend-cache", + "description": "Utility library for XML usage, best practices, and security in PHP", "keywords": [ - "cache", - "zf2" + "ZendFramework", + "security", + "xml", + "zf" ], - "time": "2015-09-15T16:23:56+00:00" + "time": "2019-01-22T19:42:14+00:00" }, { - "name": "zendframework/zend-config", - "version": "2.4.13", + "name": "zf-commons/zfc-base", + "version": "v0.1.2", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-config.git", - "reference": "6b879e54096b8e0d2290f7414c38f9a5947cb8ac" + "url": "https://github.com/ZF-Commons/ZfcBase.git", + "reference": "fc68a49b58ba68584a9a4c44a1ca9df12b30d1bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-config/zipball/6b879e54096b8e0d2290f7414c38f9a5947cb8ac", - "reference": "6b879e54096b8e0d2290f7414c38f9a5947cb8ac", + "url": "https://api.github.com/repos/ZF-Commons/ZfcBase/zipball/fc68a49b58ba68584a9a4c44a1ca9df12b30d1bf", + "reference": "fc68a49b58ba68584a9a4c44a1ca9df12b30d1bf", "shasum": "" }, "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-filter": "self.version", - "zendframework/zend-i18n": "self.version", - "zendframework/zend-json": "self.version", - "zendframework/zend-servicemanager": "self.version" - }, - "suggest": { - "zendframework/zend-filter": "Zend\\Filter component", - "zendframework/zend-i18n": "Zend\\I18n component", - "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", - "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + "php": ">=5.3.3", + "zendframework/zend-db": "~2.1", + "zendframework/zend-eventmanager": "~2.1", + "zendframework/zend-loader": "~2.1", + "zendframework/zend-modulemanager": "~2.1", + "zendframework/zend-mvc": "~2.1", + "zendframework/zend-servicemanager": "~2.1", + "zendframework/zend-stdlib": "~2.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, "autoload": { - "psr-4": { - "Zend\\Config\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a nested object property based user interface for accessing this configuration data within application code", - "homepage": "https://github.com/zendframework/zend-config", - "keywords": [ - "config", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-console", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-console.git", - "reference": "92f9c51bdc42332e63914eec892364594a9b68c8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-console/zipball/92f9c51bdc42332e63914eec892364594a9b68c8", - "reference": "92f9c51bdc42332e63914eec892364594a9b68c8", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "suggest": { - "zendframework/zend-filter": "To support DefaultRouteMatcher usage", - "zendframework/zend-validator": "To support DefaultRouteMatcher usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Console\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-console", - "keywords": [ - "console", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-crypt", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-crypt.git", - "reference": "165ec063868884eb952f6bca258f464f7103b79f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-crypt/zipball/165ec063868884eb952f6bca258f464f7103b79f", - "reference": "165ec063868884eb952f6bca258f464f7103b79f", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-math": "~2.4.0", - "zendframework/zend-servicemanager": "~2.4.0", - "zendframework/zend-stdlib": "~2.4.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-config": "~2.4.0" - }, - "suggest": { - "ext-mcrypt": "Required for most features of Zend\\Crypt" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Crypt\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-crypt", - "keywords": [ - "crypt", - "zf2" - ], - "time": "2015-11-23T16:33:27+00:00" - }, - { - "name": "zendframework/zend-db", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-db.git", - "reference": "b78b12c68bdafffaecb87f684426ad446b95204f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-db/zipball/b78b12c68bdafffaecb87f684426ad446b95204f", - "reference": "b78b12c68bdafffaecb87f684426ad446b95204f", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-stdlib": "self.version" - }, - "suggest": { - "zendframework/zend-eventmanager": "Zend\\EventManager component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Db\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-db", - "keywords": [ - "db", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-escaper", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "13f468ff824f3c83018b90aff892a1b3201383a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/13f468ff824f3c83018b90aff892a1b3201383a9", - "reference": "13f468ff824f3c83018b90aff892a1b3201383a9", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Escaper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-escaper", - "keywords": [ - "escaper", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-eventmanager", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "c2c46a7a2809b74ceb66fd79f66d43f97e1747b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/c2c46a7a2809b74ceb66fd79f66d43f97e1747b4", - "reference": "c2c46a7a2809b74ceb66fd79f66d43f97e1747b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\EventManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-event-manager", - "keywords": [ - "eventmanager", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-filter", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-filter.git", - "reference": "a3711101850078b2aa69586c71897acaada2e9cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/a3711101850078b2aa69586c71897acaada2e9cb", - "reference": "a3711101850078b2aa69586c71897acaada2e9cb", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-crypt": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-uri": "self.version" - }, - "suggest": { - "zendframework/zend-crypt": "Zend\\Crypt component", - "zendframework/zend-i18n": "Zend\\I18n component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-uri": "Zend\\Uri component for UriNormalize filter" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Filter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a set of commonly needed data filters", - "homepage": "https://github.com/zendframework/zend-filter", - "keywords": [ - "filter", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-form", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-form.git", - "reference": "779ba5da3dc040c52e632ea340462af2306c7682" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-form/zipball/779ba5da3dc040c52e632ea340462af2306c7682", - "reference": "779ba5da3dc040c52e632ea340462af2306c7682", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-inputfilter": "~2.4.0", - "zendframework/zend-stdlib": "~2.4.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "ircmaxell/random-lib": "^1.1", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-cache": "~2.4.0", - "zendframework/zend-captcha": "~2.4.0", - "zendframework/zend-code": "~2.4.0", - "zendframework/zend-eventmanager": "~2.4.0", - "zendframework/zend-filter": "~2.4.0", - "zendframework/zend-i18n": "~2.4.0", - "zendframework/zend-servicemanager": "~2.4.0", - "zendframework/zend-session": "~2.4.0", - "zendframework/zend-text": "~2.4.0", - "zendframework/zend-validator": "~2.4.0", - "zendframework/zend-view": "~2.4.0", - "zendframework/zendservice-recaptcha": "~2.0" - }, - "suggest": { - "zendframework/zend-captcha": "Zend\\Captcha component", - "zendframework/zend-code": "Zend\\Code component", - "zendframework/zend-eventmanager": "Zend\\EventManager component", - "zendframework/zend-filter": "Zend\\Filter component", - "zendframework/zend-i18n": "Zend\\I18n component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-validator": "Zend\\Validator component", - "zendframework/zend-view": "Zend\\View component", - "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Form\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-form", - "keywords": [ - "form", - "zf2" - ], - "time": "2015-09-09T19:11:05+00:00" - }, - { - "name": "zendframework/zend-http", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-http.git", - "reference": "0456267c3825f3c4b558460e0bffeb4c496e6fb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/0456267c3825f3c4b558460e0bffeb4c496e6fb8", - "reference": "0456267c3825f3c4b558460e0bffeb4c496e6fb8", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-loader": "~2.4.0", - "zendframework/zend-stdlib": "~2.4.0", - "zendframework/zend-uri": "~2.4.0", - "zendframework/zend-validator": "~2.4.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-config": "~2.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Http\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", - "homepage": "https://github.com/zendframework/zend-http", - "keywords": [ - "http", - "zf2" - ], - "time": "2015-09-14T16:11:20+00:00" - }, - { - "name": "zendframework/zend-i18n", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "f26d6ae4be3f1ac98fbb3708aafae908c38f46c8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/f26d6ae4be3f1ac98fbb3708aafae908c38f46c8", - "reference": "f26d6ae4be3f1ac98fbb3708aafae908c38f46c8", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-cache": "self.version", - "zendframework/zend-config": "self.version", - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-filter": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-validator": "self.version", - "zendframework/zend-view": "self.version" - }, - "suggest": { - "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", - "zendframework/zend-cache": "Zend\\Cache component", - "zendframework/zend-config": "Zend\\Config component", - "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", - "zendframework/zend-filter": "You should install this package to use the provided filters", - "zendframework/zend-resources": "Translation resources", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-validator": "You should install this package to use the provided validators", - "zendframework/zend-view": "You should install this package to use the provided view helpers" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\I18n\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-i18n", - "keywords": [ - "i18n", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-inputfilter", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-inputfilter.git", - "reference": "6305e9acf7da9f5481b5266cb6e0353a96c10a06" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-inputfilter/zipball/6305e9acf7da9f5481b5266cb6e0353a96c10a06", - "reference": "6305e9acf7da9f5481b5266cb6e0353a96c10a06", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-filter": "~2.4.0", - "zendframework/zend-stdlib": "~2.4.0", - "zendframework/zend-validator": "~2.4.8" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "^4.5", - "zendframework/zend-servicemanager": "~2.4.0" - }, - "suggest": { - "zendframework/zend-servicemanager": "To support plugin manager support" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\InputFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-inputfilter", - "keywords": [ - "inputfilter", - "zf2" - ], - "time": "2015-09-09T15:44:54+00:00" - }, - { - "name": "zendframework/zend-json", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-json.git", - "reference": "1db4b878846520e619fbcdc7ce826c8563f8e839" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-json/zipball/1db4b878846520e619fbcdc7ce826c8563f8e839", - "reference": "1db4b878846520e619fbcdc7ce826c8563f8e839", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-http": "self.version", - "zendframework/zend-server": "self.version" - }, - "suggest": { - "zendframework/zend-http": "Zend\\Http component", - "zendframework/zend-server": "Zend\\Server component", - "zendframework/zendxml": "To support Zend\\Json\\Json::fromXml() usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Json\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", - "homepage": "https://github.com/zendframework/zend-json", - "keywords": [ - "json", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-ldap", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-ldap.git", - "reference": "07bfa76ceea39e2db1da9121cdf56ecaa5505584" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-ldap/zipball/07bfa76ceea39e2db1da9121cdf56ecaa5505584", - "reference": "07bfa76ceea39e2db1da9121cdf56ecaa5505584", - "shasum": "" - }, - "require": { - "ext-ldap": "*", - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-eventmanager": "self.version" - }, - "suggest": { - "zendframework/zend-eventmanager": "Zend\\EventManager component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Ldap\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides support for LDAP operations including but not limited to binding, searching and modifying entries in an LDAP directory", - "homepage": "https://github.com/zendframework/zend-ldap", - "keywords": [ - "ldap", - "zf2" - ], - "time": "2015-05-11T15:11:40+00:00" - }, - { - "name": "zendframework/zend-loader", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-loader.git", - "reference": "5e62c44a4d23c4e09d35fcc2a3b109c944dbdc22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/5e62c44a4d23c4e09d35fcc2a3b109c944dbdc22", - "reference": "5e62c44a4d23c4e09d35fcc2a3b109c944dbdc22", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Loader\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-loader", - "keywords": [ - "loader", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-log", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-log.git", - "reference": "f6538f4b61cdacafa47c7cef26c5c0204f2d1eef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-log/zipball/f6538f4b61cdacafa47c7cef26c5c0204f2d1eef", - "reference": "f6538f4b61cdacafa47c7cef26c5c0204f2d1eef", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-console": "self.version", - "zendframework/zend-db": "self.version", - "zendframework/zend-escaper": "self.version", - "zendframework/zend-mail": "self.version", - "zendframework/zend-validator": "self.version" - }, - "suggest": { - "ext-mongo": "*", - "zendframework/zend-console": "Zend\\Console component", - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-escaper": "Zend\\Escaper component, for use in the XML formatter", - "zendframework/zend-mail": "Zend\\Mail component", - "zendframework/zend-validator": "Zend\\Validator component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Log\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "component for general purpose logging", - "homepage": "https://github.com/zendframework/zend-log", - "keywords": [ - "log", - "logging", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-mail", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-mail.git", - "reference": "99f7ceb42065c0cc89ef5130ee4b1ee89ae014d6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-mail/zipball/99f7ceb42065c0cc89ef5130ee4b1ee89ae014d6", - "reference": "99f7ceb42065c0cc89ef5130ee4b1ee89ae014d6", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-crypt": "~2.4.0", - "zendframework/zend-loader": "~2.4.0", - "zendframework/zend-mime": "~2.4.0", - "zendframework/zend-stdlib": "~2.4.0", - "zendframework/zend-validator": "~2.4.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-config": "~2.4.0", - "zendframework/zend-servicemanager": "~2.4.0" - }, - "suggest": { - "zendframework/zend-servicemanager": "Zend\\ServiceManager component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Mail\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages", - "homepage": "https://github.com/zendframework/zend-mail", - "keywords": [ - "mail", - "zf2" - ], - "time": "2017-07-13T16:53:17+00:00" - }, - { - "name": "zendframework/zend-math", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-math.git", - "reference": "1e7e803366fc7618a8668ce2403c932196174faa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-math/zipball/1e7e803366fc7618a8668ce2403c932196174faa", - "reference": "1e7e803366fc7618a8668ce2403c932196174faa", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "suggest": { - "ext-bcmath": "If using the bcmath functionality", - "ext-gmp": "If using the gmp functionality", - "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable", - "zendframework/zend-servicemanager": ">= current version, if using the BigInteger::factory functionality" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Math\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-math", - "keywords": [ - "math", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-mime", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-mime.git", - "reference": "df81ca9f94f0d1cd31175b8d2df6002b61dd5973" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-mime/zipball/df81ca9f94f0d1cd31175b8d2df6002b61dd5973", - "reference": "df81ca9f94f0d1cd31175b8d2df6002b61dd5973", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-mail": "self.version" - }, - "suggest": { - "zendframework/zend-mail": "Zend\\Mail component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Mime\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-mime", - "keywords": [ - "mime", - "zf2" - ], - "time": "2015-05-07T16:53:42+00:00" - }, - { - "name": "zendframework/zend-modulemanager", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-modulemanager.git", - "reference": "49c0713c2b560dd434aa36b83df4c89f51f8dab4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-modulemanager/zipball/49c0713c2b560dd434aa36b83df4c89f51f8dab4", - "reference": "49c0713c2b560dd434aa36b83df4c89f51f8dab4", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-config": "self.version", - "zendframework/zend-console": "self.version", - "zendframework/zend-loader": "self.version", - "zendframework/zend-servicemanager": "self.version" - }, - "suggest": { - "zendframework/zend-config": "Zend\\Config component", - "zendframework/zend-console": "Zend\\Console component", - "zendframework/zend-loader": "Zend\\Loader component", - "zendframework/zend-mvc": "Zend\\Mvc component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\ModuleManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-module-manager", - "keywords": [ - "modulemanager", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-mvc", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-mvc.git", - "reference": "5ecf513a82fe9fdeee84919eee45e8098639df04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-mvc/zipball/5ecf513a82fe9fdeee84919eee45e8098639df04", - "reference": "5ecf513a82fe9fdeee84919eee45e8098639df04", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "~2.4.0", - "zendframework/zend-form": "~2.4.8", - "zendframework/zend-servicemanager": "~2.4.0", - "zendframework/zend-stdlib": "~2.4.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-authentication": "~2.4.0", - "zendframework/zend-cache": "~2.4.0", - "zendframework/zend-console": "~2.4.0", - "zendframework/zend-di": "~2.4.0", - "zendframework/zend-filter": "~2.4.0", - "zendframework/zend-http": "~2.4.8", - "zendframework/zend-i18n": "~2.4.0", - "zendframework/zend-inputfilter": "~2.4.8", - "zendframework/zend-json": "~2.4.0", - "zendframework/zend-log": "~2.4.0", - "zendframework/zend-modulemanager": "~2.4.0", - "zendframework/zend-serializer": "~2.4.0", - "zendframework/zend-session": "~2.4.0", - "zendframework/zend-text": "~2.4.0", - "zendframework/zend-uri": "~2.4.0", - "zendframework/zend-validator": "~2.4.8", - "zendframework/zend-version": "~2.4.0", - "zendframework/zend-view": "~2.4.0" - }, - "suggest": { - "zendframework/zend-authentication": "Zend\\Authentication component for Identity plugin", - "zendframework/zend-config": "Zend\\Config component", - "zendframework/zend-console": "Zend\\Console component", - "zendframework/zend-di": "Zend\\Di component", - "zendframework/zend-filter": "Zend\\Filter component", - "zendframework/zend-http": "Zend\\Http component", - "zendframework/zend-i18n": "Zend\\I18n component for translatable segments", - "zendframework/zend-inputfilter": "Zend\\Inputfilter component", - "zendframework/zend-json": "Zend\\Json component", - "zendframework/zend-log": "Zend\\Log component", - "zendframework/zend-modulemanager": "Zend\\ModuleManager component", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-session": "Zend\\Session component for FlashMessenger, PRG, and FPRG plugins", - "zendframework/zend-stdlib": "Zend\\Stdlib component", - "zendframework/zend-text": "Zend\\Text component", - "zendframework/zend-uri": "Zend\\Uri component", - "zendframework/zend-validator": "Zend\\Validator component", - "zendframework/zend-version": "Zend\\Version component", - "zendframework/zend-view": "Zend\\View component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Mvc\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-mvc", - "keywords": [ - "mvc", - "zf2" - ], - "time": "2015-09-14T16:32:50+00:00" - }, - { - "name": "zendframework/zend-navigation", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-navigation.git", - "reference": "2753d71f032ab0276e2ba5e6bb76fc20605bca36" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-navigation/zipball/2753d71f032ab0276e2ba5e6bb76fc20605bca36", - "reference": "2753d71f032ab0276e2ba5e6bb76fc20605bca36", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-config": "self.version", - "zendframework/zend-mvc": "self.version", - "zendframework/zend-permissions-acl": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-view": "self.version" - }, - "suggest": { - "zendframework/zend-config": "Zend\\Config component", - "zendframework/zend-mvc": "Zend\\Mvc component", - "zendframework/zend-permissions-acl": "Zend\\Permissions\\Acl component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-view": "Zend\\View component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Navigation\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides support for managing trees of pointers to web pages", - "homepage": "https://github.com/zendframework/zend-navigation", - "keywords": [ - "navigation", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-paginator", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-paginator.git", - "reference": "4e58de6d6c6d9cb0225e516e778ca06ff9f05ba0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-paginator/zipball/4e58de6d6c6d9cb0225e516e778ca06ff9f05ba0", - "reference": "4e58de6d6c6d9cb0225e516e778ca06ff9f05ba0", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-cache": "self.version", - "zendframework/zend-db": "self.version", - "zendframework/zend-filter": "self.version", - "zendframework/zend-json": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-view": "self.version" - }, - "suggest": { - "zendframework/zend-cache": "Zend\\Cache component to support cache features", - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-filter": "Zend\\Filter component", - "zendframework/zend-json": "Zend\\Json component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-view": "Zend\\View component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Paginator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-paginator", - "keywords": [ - "paginator", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-permissions-acl", - "version": "2.6.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-permissions-acl.git", - "reference": "843bbd9c6f6d20b84dd0ce6c815d10397e98082b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-permissions-acl/zipball/843bbd9c6f6d20b84dd0ce6c815d10397e98082b", - "reference": "843bbd9c6f6d20b84dd0ce6c815d10397e98082b", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" - }, - "suggest": { - "zendframework/zend-servicemanager": "To support Zend\\Permissions\\Acl\\Assertion\\AssertionManager plugin manager usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Permissions\\Acl\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a lightweight and flexible access control list (ACL) implementation for privileges management", - "homepage": "https://github.com/zendframework/zend-permissions-acl", - "keywords": [ - "acl", - "zf2" - ], - "time": "2016-02-03T21:46:45+00:00" - }, - { - "name": "zendframework/zend-serializer", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-serializer.git", - "reference": "31a0da5c09f54fe76bc4e145e348b0d3d277aaf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/31a0da5c09f54fe76bc4e145e348b0d3d277aaf0", - "reference": "31a0da5c09f54fe76bc4e145e348b0d3d277aaf0", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-json": "self.version", - "zendframework/zend-math": "self.version", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-servicemanager": "self.version" - }, - "suggest": { - "zendframework/zend-servicemanager": "To support plugin manager support" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Serializer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover", - "homepage": "https://github.com/zendframework/zend-serializer", - "keywords": [ - "serializer", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-servicemanager", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-servicemanager.git", - "reference": "855294e12771b4295c26446b6ed2df2f1785f234" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/855294e12771b4295c26446b6ed2df2f1785f234", - "reference": "855294e12771b4295c26446b6ed2df2f1785f234", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-di": "self.version" - }, - "suggest": { - "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", - "zendframework/zend-di": "Zend\\Di component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\ServiceManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-service-manager", - "keywords": [ - "servicemanager", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-session", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-session.git", - "reference": "5123393617a05ade012ddf3dc389f86dcbed7fdc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-session/zipball/5123393617a05ade012ddf3dc389f86dcbed7fdc", - "reference": "5123393617a05ade012ddf3dc389f86dcbed7fdc", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-cache": "self.version", - "zendframework/zend-db": "self.version", - "zendframework/zend-http": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-validator": "self.version" - }, - "suggest": { - "zendframework/zend-cache": "Zend\\Cache component", - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-eventmanager": "Zend\\EventManager component", - "zendframework/zend-http": "Zend\\Http component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-validator": "Zend\\Validator component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Session\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "manage and preserve session data, a logical complement of cookie data, across multiple page requests by the same client", - "homepage": "https://github.com/zendframework/zend-session", - "keywords": [ - "session", - "zf2" - ], - "time": "2017-06-19T18:48:06+00:00" - }, - { - "name": "zendframework/zend-stdlib", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "d8ecb629a72da9f91bd95c5af006384823560b42" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/d8ecb629a72da9f91bd95c5af006384823560b42", - "reference": "d8ecb629a72da9f91bd95c5af006384823560b42", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-filter": "self.version", - "zendframework/zend-serializer": "self.version", - "zendframework/zend-servicemanager": "self.version" - }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Stdlib\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-stdlib", - "keywords": [ - "stdlib", - "zf2" - ], - "time": "2015-07-21T13:55:46+00:00" - }, - { - "name": "zendframework/zend-uri", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-uri.git", - "reference": "33512866d20cc4bc54a0c1a6a0bdfcf5088939b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/33512866d20cc4bc54a0c1a6a0bdfcf5088939b3", - "reference": "33512866d20cc4bc54a0c1a6a0bdfcf5088939b3", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-escaper": "~2.4.0", - "zendframework/zend-validator": "~2.4.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Uri\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "a component that aids in manipulating and validating » Uniform Resource Identifiers (URIs)", - "homepage": "https://github.com/zendframework/zend-uri", - "keywords": [ - "uri", - "zf2" - ], - "time": "2015-09-14T16:17:10+00:00" - }, - { - "name": "zendframework/zend-validator", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-validator.git", - "reference": "81415511fe729e6de19a61936313cef43c80d337" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/81415511fe729e6de19a61936313cef43c80d337", - "reference": "81415511fe729e6de19a61936313cef43c80d337", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.4.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-config": "~2.4.0", - "zendframework/zend-db": "~2.4.0", - "zendframework/zend-filter": "~2.4.0", - "zendframework/zend-i18n": "~2.4.0", - "zendframework/zend-math": "~2.4.0", - "zendframework/zend-servicemanager": "~2.4.0", - "zendframework/zend-session": "~2.4.0", - "zendframework/zend-uri": "~2.4.0" - }, - "suggest": { - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator", - "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages as well as to use the various Date validators", - "zendframework/zend-math": "Zend\\Math component", - "zendframework/zend-resources": "Translations of validator messages", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains", - "zendframework/zend-session": "Zend\\Session component", - "zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Validator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a set of commonly needed validators", - "homepage": "https://github.com/zendframework/zend-validator", - "keywords": [ - "validator", - "zf2" - ], - "time": "2015-09-08T21:04:17+00:00" - }, - { - "name": "zendframework/zend-version", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-version.git", - "reference": "00d456c9fa490c8798801cc099a05f6c32ac9d2a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-version/zipball/00d456c9fa490c8798801cc099a05f6c32ac9d2a", - "reference": "00d456c9fa490c8798801cc099a05f6c32ac9d2a", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-json": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "suggest": { - "zendframework/zend-http": "Allows use of Zend\\Http\\Client to check version information", - "zendframework/zend-json": "To check latest version hosted in GitHub" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Version\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-version", - "keywords": [ - "version", - "zf2" - ], - "abandoned": "ocramius/package-versions", - "time": "2017-07-13T17:22:10+00:00" - }, - { - "name": "zendframework/zend-view", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-view.git", - "reference": "d81da0d932a0e35f8cbc6f10d80c8b4ab54973ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-view/zipball/d81da0d932a0e35f8cbc6f10d80c8b4ab54973ea", - "reference": "d81da0d932a0e35f8cbc6f10d80c8b4ab54973ea", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-loader": "self.version", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-authentication": "self.version", - "zendframework/zend-escaper": "self.version", - "zendframework/zend-feed": "self.version", - "zendframework/zend-filter": "self.version", - "zendframework/zend-http": "self.version", - "zendframework/zend-i18n": "self.version", - "zendframework/zend-json": "self.version", - "zendframework/zend-mvc": "self.version", - "zendframework/zend-navigation": "self.version", - "zendframework/zend-paginator": "self.version", - "zendframework/zend-permissions-acl": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-uri": "self.version" - }, - "suggest": { - "zendframework/zend-authentication": "Zend\\Authentication component", - "zendframework/zend-escaper": "Zend\\Escaper component", - "zendframework/zend-feed": "Zend\\Feed component", - "zendframework/zend-filter": "Zend\\Filter component", - "zendframework/zend-http": "Zend\\Http component", - "zendframework/zend-i18n": "Zend\\I18n component", - "zendframework/zend-json": "Zend\\Json component", - "zendframework/zend-mvc": "Zend\\Mvc component", - "zendframework/zend-navigation": "Zend\\Navigation component", - "zendframework/zend-paginator": "Zend\\Paginator component", - "zendframework/zend-permissions-acl": "Zend\\Permissions\\Acl component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-uri": "Zend\\Uri component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\View\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a system of helpers, output filters, and variable escaping", - "homepage": "https://github.com/zendframework/zend-view", - "keywords": [ - "view", - "zf2" - ], - "time": "2015-06-16T15:22:37+00:00" - }, - { - "name": "zf-commons/zfc-base", - "version": "v0.1.2", - "source": { - "type": "git", - "url": "https://github.com/ZF-Commons/ZfcBase.git", - "reference": "fc68a49b58ba68584a9a4c44a1ca9df12b30d1bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ZF-Commons/ZfcBase/zipball/fc68a49b58ba68584a9a4c44a1ca9df12b30d1bf", - "reference": "fc68a49b58ba68584a9a4c44a1ca9df12b30d1bf", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "zendframework/zend-db": "~2.1", - "zendframework/zend-eventmanager": "~2.1", - "zendframework/zend-loader": "~2.1", - "zendframework/zend-modulemanager": "~2.1", - "zendframework/zend-mvc": "~2.1", - "zendframework/zend-servicemanager": "~2.1", - "zendframework/zend-stdlib": "~2.1" - }, - "type": "library", - "autoload": { - "psr-0": { - "ZfcBase": "src/" - }, - "classmap": [ - "./Module.php" - ] + "psr-0": { + "ZfcBase": "src/" + }, + "classmap": [ + "./Module.php" + ] }, "notification-url": "https://packagist.org/downloads/", "authors": [ @@ -3601,20 +2178,20 @@ "packages-dev": [ { "name": "easybook/geshi", - "version": "v1.0.8.18", + "version": "v1.0.8.19", "source": { "type": "git", "url": "https://github.com/easybook/geshi.git", - "reference": "4b06bfe8c6fbedd6aad0a0700d650f591386e287" + "reference": "b4df5fa84a44d4e12eff67263a701eac7e157241" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/easybook/geshi/zipball/4b06bfe8c6fbedd6aad0a0700d650f591386e287", - "reference": "4b06bfe8c6fbedd6aad0a0700d650f591386e287", + "url": "https://api.github.com/repos/easybook/geshi/zipball/b4df5fa84a44d4e12eff67263a701eac7e157241", + "reference": "b4df5fa84a44d4e12eff67263a701eac7e157241", "shasum": "" }, "require": { - "php": ">4.3.0" + "php": ">=5.0" }, "type": "library", "autoload": { @@ -3643,7 +2220,154 @@ "highlighter", "syntax" ], - "time": "2016-10-05T07:15:42+00:00" + "time": "2018-04-20T18:19:44+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -3701,29 +2425,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.3.2", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", + "php": "^7.0", "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -3742,7 +2472,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-10T14:09:06+00:00" + "time": "2019-04-30T17:48:53+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -3793,33 +2523,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.5", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -3852,43 +2582,44 @@ "spy", "stub" ], - "time": "2018-02-19T10:16:54+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -3903,7 +2634,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -3914,7 +2645,7 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4055,29 +2786,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.12", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4100,45 +2831,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-12-04T08:55:13+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "6.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -4146,7 +2889,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -4172,30 +2915,33 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "time": "2019-02-01T05:22:47+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "version": "5.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.5.11" }, "suggest": { "ext-soap": "*" @@ -4203,7 +2949,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -4218,7 +2964,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4229,34 +2975,79 @@ "xunit" ], "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -4287,38 +3078,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4345,32 +3136,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -4395,34 +3186,34 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -4462,27 +3253,27 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -4490,7 +3281,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4513,32 +3304,124 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.5", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -4566,23 +3449,73 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", - "version": "1.0.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, + "require": { + "php": ">=5.6" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -4601,70 +3534,55 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2016-10-03T07:35:21+00:00" }, { - "name": "symfony/yaml", - "version": "v3.3.16", + "name": "theseer/tokenizer", + "version": "1.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-01-20T15:04:53+00:00" + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-04-04T09:56:43+00:00" }, { "name": "unicaen/code", - "version": "1.1.4", + "version": "1.1.7", "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/code.git", - "reference": "b31f1857684c45c78c60c8e14dc72ad73e363819" + "reference": "7c3d36ad949ece224611ef0d61bbb841cca3c06d" }, "require": { "doctrine/dbal": "^2.5", @@ -4682,24 +3600,25 @@ ] }, "description": "Boite à outils pour la programmation avec la bibliothèque Unicaen", - "time": "2018-03-20T15:11:11+00:00" + "time": "2019-02-08T08:38:51+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -4732,56 +3651,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" - }, - { - "name": "zendframework/zend-debug", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-debug.git", - "reference": "b6f9df59155391ca683c479a0d758f66ef73b3b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-debug/zipball/b6f9df59155391ca683c479a0d758f66ef73b3b3", - "reference": "b6f9df59155391ca683c479a0d758f66ef73b3b3", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-escaper": "2.*" - }, - "suggest": { - "ext/xdebug": "XDebug, for better backtrace output", - "zendframework/zend-escaper": "To support escaped output" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Debug\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-debug", - "keywords": [ - "debug", - "zf2" - ], - "time": "2015-06-03T14:05:35+00:00" + "time": "2018-12-25T11:19:39+00:00" }, { "name": "zendframework/zend-developer-tools", @@ -4850,111 +3720,6 @@ "zf2" ], "time": "2015-11-24T11:08:25+00:00" - }, - { - "name": "zendframework/zend-dom", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-dom.git", - "reference": "445aefba36bae56d1e3df50e18c89a8f6c98ad9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-dom/zipball/445aefba36bae56d1e3df50e18c89a8f6c98ad9c", - "reference": "445aefba36bae56d1e3df50e18c89a8f6c98ad9c", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Dom\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides tools for working with DOM documents and structures", - "homepage": "https://github.com/zendframework/zend-dom", - "keywords": [ - "dom", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" - }, - { - "name": "zendframework/zend-test", - "version": "2.4.13", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-test.git", - "reference": "f743e5f552fce1bc387c1e2a42a693309f7a6880" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-test/zipball/f743e5f552fce1bc387c1e2a42a693309f7a6880", - "reference": "f743e5f552fce1bc387c1e2a42a693309f7a6880", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "phpunit/phpunit": "~4.0", - "zendframework/zend-console": "self.version", - "zendframework/zend-dom": "self.version", - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-http": "self.version", - "zendframework/zend-mvc": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-stdlib": "self.version", - "zendframework/zend-uri": "self.version", - "zendframework/zend-view": "self.version" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "zendframework/zend-console": "self.version" - }, - "suggest": { - "zendframework/zend-console": "Zend\\Console component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Test\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-test", - "keywords": [ - "test", - "zf2" - ], - "time": "2015-05-07T14:55:31+00:00" } ], "aliases": [], diff --git a/config/application.config.php b/config/application.config.php index 254a828e78e4fe418a078a1460fefe186ab78679..ebde397a4f3f7e31adae27924c4ed2a632a62a53 100755 --- a/config/application.config.php +++ b/config/application.config.php @@ -3,13 +3,14 @@ $modules = [ 'ZfcBase', 'DoctrineModule', 'DoctrineORMModule', 'ZfcUser', 'ZfcUserDoctrineORM', 'BjyAuthorize', 'AssetManager', - 'UnicaenApp', 'UnicaenAuth', 'UnicaenLdap', + 'UnicaenApp', 'UnicaenAuth', 'UnicaenLdap', 'UnicaenDbImport', 'Autoform', 'Fichier', 'Mailing', 'Octopus', 'Utilisateur', 'Application', + //'ZendDeveloperTools', ]; if ( 'development' == getenv('APPLICATION_ENV') ?: 'production' ) { diff --git a/config/autoload/global.php b/config/autoload/global.php index fcdef6b06d7bcf0e9cffaa593c071b4add9259a7..47fcd6aa04a5704ac5da02219b65fb9d90aafe6e 100755 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -15,23 +15,5 @@ return [ 'cache_dir' => 'data/config/', 'check_dependencies' => ($env !== 'production'), ], - 'doctrine' => [ - 'configuration' => [ - 'orm_default' => [ - 'metadata_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'query_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'result_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'hydration_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'generate_proxies' => ($env !== 'production'), - ], - 'orm_octopus' => [ - 'metadata_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'query_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'result_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'hydration_cache' => ($env === 'production' ? 'memcached' : 'array'), - 'generate_proxies' => ($env !== 'production'), - 'driver' => 'orm_octopus', - ], - ], - ], + ]; diff --git a/config/autoload/unicaen-app.global.php b/config/autoload/unicaen-app.global.php index e30901d7d113295aaa132d6b7c3b194325907d88..a59e01ed700082355b50b25fbbc8c9a4b6588e93 100644 --- a/config/autoload/unicaen-app.global.php +++ b/config/autoload/unicaen-app.global.php @@ -14,8 +14,8 @@ return [ 'app_infos' => [ 'nom' => "PrEECoG", 'desc' => "Gestion Prévisionnelle des effectifs, des emplois et des compétences", - 'version' => "0.1.2", - 'date' => "07/05/2019", + 'version' => "0.2.0", + 'date' => "03/07/2019", 'contact' => ['mail' => "dsi.applications@unicaen.fr", /*'tel' => "01 02 03 04 05"*/], 'mentionsLegales' => "http://www.unicaen.fr/acces-direct/mentions-legales/", 'informatiqueEtLibertes' => "http://www.unicaen.fr/acces-direct/informatique-et-libertes/", diff --git a/config/autoload/unicaen-db-import.global.php b/config/autoload/unicaen-db-import.global.php new file mode 100644 index 0000000000000000000000000000000000000000..9e8a9450ef59b00926744b29d71e805908e97c55 --- /dev/null +++ b/config/autoload/unicaen-db-import.global.php @@ -0,0 +1,266 @@ +<?php + +namespace Application; + +use UnicaenAuth\Guard\PrivilegeController; + +return [ + /** + * Configuration globale du module UnicaenDbImport. + */ + 'import' => [ + /** + * Liste des imports. + */ + 'imports' => [ +// [ +// 'name' => 'Import_AGENT', + /** + * Configuration de la source de données à importer : + * - 'name' : petit nom (unique) de la source + * - 'table' : nom de la table source contenant les données à importer + * - 'select' : select SQL de mise en forme des données source à importer (NB: antinomique avec 'table') + * - 'connection' : identifiant de la connexion Doctrine à la base de données source + * - 'source_code_column' : nom de la colonne dans la table/vue source contenant l'identifiant unique + * - 'columns' : liste ordonnée des noms des colonnes à prendre en compte dans la table/vue source + */ +// 'source' => [ +// 'name' => 'Agents geres par la DRH', +// 'table' => 'V_AGENT', +// 'select' => 'SELECT * FROM V_AGENT', +// 'connection' => 'doctrine.connection.orm_octopus', +// 'source_code_column' => 'C_INDIVIDU', +// 'columns' => ['C_SRC_INDIVIDU', 'C_SOURCE', 'PRENOM', 'NOM_USAGE'], +// ], + /** + * Forçage éventuel du nom de la table intermédiaire utilisée lorsque source et destination + * ne partagent pas la même connexion. NB: cette table intermédiaire est créée/peuplée/supprimée + * dans la base de données destination à chaque import. + * En l'absence de ce forçage, le nom de la table intermédiaire sera celui de la table destination + * préfixé par "src_". + */ +// 'intermediate_table' => 'src_agent', + /** + * Configuration de la destination des données importées : + * - 'name' : petit nom (unique) de la destination + * - 'table' : nom de la table destination vers laquelle les données sont importées + * - 'connection' : identifiant de la connexion Doctrine à la base de données destination + * - 'source_code_column' : nom de la colonne dans la table destination contenant l'identifiant unique + * - 'columns' : liste ordonnée des noms des colonnes importées dans la table destination + * - 'columns_to_char' : format sprintf nécessaire pour mettre des colonnes au format requis (string) + */ +// 'destination' => [ +// 'name' => 'Agents gérés par la DRH', +// 'table' => 'agent', +// 'connection' => 'doctrine.connection.orm_default', +// 'source_code_column' => 'c_individu', +// 'columns' => ['c_src_individu', 'c_source', 'prenom', 'nom_usage'], +// 'columns_to_char' => [ +// 'debut_validite' => "TO_CHAR(%s,'YYYY-MM-DD')", // car colonne destination de type TIMESTAMP +// 'fin_validite' => "TO_CHAR(%s,'YYYY-MM-DD')", // idem +// ], +// ], +// ], + [ + 'name' => 'Import_AGENT', + 'source' => [ + 'name' => 'Agents geres par la DRH', + 'select' => 'SELECT * FROM V_PREECOG_AGENT', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'C_INDIVIDU', + 'columns' => ['C_SRC_INDIVIDU', 'C_SOURCE', 'PRENOM', 'NOM_USAGE', 'BAP_ID', 'CORPS_ID', 'GRADE_ID'], + ], + 'intermediate_table' => 'src_agent', + 'destination' => [ + 'name' => 'Agents gérés par la DRH', + 'table' => 'agent', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'c_individu', + 'columns' => ['c_src_individu', 'c_source', 'prenom', 'nom_usage', 'bap_id', 'corps_id', 'grade_id'], + ], + ], + [ + 'name' => 'Import_STATUT', + 'source' => [ + 'name' => 'Statut des agents geres par la DRH', + 'select' => 'SELECT * FROM V_PREECOG_STATUT', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['ID_ORIG', 'C_SOURCE', 'INDIVIDU_ID', 'STRUCTURE_ID', 'D_DEBUT', 'D_FIN', 'T_TITULAIRE', 'T_CDI', 'T_CDD', 'T_VACATAIRE', 'T_ENSEIGNANT', 'T_ADMINISTRATIF', 'T_CHERCHEUR', 'T_ETUDIANT', 'T_AUDITEUR_LIBRE', 'T_DOCTORANT', 'T_DETACHE_IN', 'T_DETACHE_OUT', 'T_DISPO', 'T_HEBERGE', 'T_EMERITE', 'T_RETRAITE'], + ], + 'intermediate_table' => 'src_agent_statut', + 'destination' => [ + 'name' => 'Statut des agents geres par la DRH', + 'table' => 'agent_statut', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['id_orig', 'c_source', 'individu_id', 'structure_id', 'd_debut', 'd_fin', 't_titulaire', 't_cdi', 't_cdd', 't_vacataire', 't_enseignant', 't_administratif', 't_chercheur', 't_etudiant', 't_auditeur_libre', 't_doctorant', 't_detache_in', 't_detache_out', 't_dispo', 't_heberge', 't_emerite', 't_retraite'], + 'columns_to_char' => [ + 'd_debut' => "TO_CHAR(%s,'YYYY-MM-DD')", + 'd_fin' => "TO_CHAR(%s,'YYYY-MM-DD')", + ], + ], + ], + [ + 'name' => 'Import_STRUCTURE', + 'source' => [ + 'name' => 'Agents geres par la DRH', + 'select' => 'SELECT * FROM V_PREECOG_STRUCTURE', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['CODE', 'LIBELLE_COURT', 'LIBELLE_LONG', 'TYPE', 'HISTO'], + ], + 'intermediate_table' => 'src_structure', + 'destination' => [ + 'name' => 'Structure stockees dans octopus', + 'table' => 'structure', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['code', 'libelle_court', 'libelle_long', 'type', 'histo'], + ], + ], + [ + 'name' => 'Import_SITE', + 'source' => [ + 'name' => 'Sites remontés de PrEECoG', + 'select' => 'SELECT * FROM V_PREECOG_SITE', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['NOM', 'LIBELLE'], + ], + 'intermediate_table' => 'src_site', + 'destination' => [ + 'name' => 'Sites stockes dans octopus', + 'table' => 'site', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['nom', 'libelle'], + ], + ], + [ + 'name' => 'Import_BATIMENT', + 'source' => [ + 'name' => 'Batiments remontés de PrEECoG', + 'select' => 'SELECT * FROM V_PREECOG_BATIMENT', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['NOM', 'LIBELLE', 'SITE_ID'], + ], + 'intermediate_table' => 'src_batiment', + 'destination' => [ + 'name' => 'Batiments stockes dans octopus', + 'table' => 'batiment', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['nom', 'libelle', 'site_id'], + ], + ], + [ + 'name' => 'Import_FONCTION', + 'source' => [ + 'name' => 'Fonctions remontées de PrEECoG', + 'select' => 'SELECT * FROM V_PREECOG_FONCTION', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['PARENT_ID', 'CODE', 'NIVEAU'], + ], + 'intermediate_table' => 'src_fonction', + 'destination' => [ + 'name' => 'Fonctions remontées de OCTOPUS', + 'table' => 'fonction', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['parent_id', 'code', 'niveau'], + ], + ], + [ + 'name' => 'Import_FONCTION_LIBELLE', + 'source' => [ + 'name' => 'Libellés des fonctions remontées de PrEECoG', + 'select' => 'SELECT * FROM V_PREECOG_FONCTION_LIBELLE', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['FONCTION_ID', 'LIBELLE', 'GENRE', 'DEFAUT'], + ], + 'intermediate_table' => 'src_fonction_libelle', + 'destination' => [ + 'name' => 'Libellés des fonctions remontées de OCTOPUS', + 'table' => 'fonction_libelle', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['fonction_id', 'libelle', 'genre', 'defaut'], + ], + ], + [ + 'name' => 'Import_BAP', + 'source' => [ + 'name' => 'BAP des agents remonté depuis OCTOPUS', + 'select' => 'SELECT * FROM V_PREECOG_BAP', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['C_BAP', 'LIB_COURT', 'LIB_LONG', 'HISTO'], + ], + 'intermediate_table' => 'src_correspondance', + 'destination' => [ + 'name' => 'BAP des agents remonté depuis OCTOPUS', + 'table' => 'correspondance', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['c_bap', 'lib_court', 'lib_long', 'histo'], + ], + ], + [ + 'name' => 'Import_GRADE', + 'source' => [ + 'name' => 'Grades des agents remonté depuis OCTOPUS', + 'select' => 'SELECT * FROM V_PREECOG_GRADE', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['LIB_COURT', 'LIB_LONG', 'CODE', 'HISTO'], + ], + 'intermediate_table' => 'src_grade', + 'destination' => [ + 'name' => 'Grades des agents remonté depuis OCTOPUS', + 'table' => 'grade', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['lib_court', 'lib_long', 'code', 'histo'], + ], + ], + [ + 'name' => 'Import_CORPS', + 'source' => [ + 'name' => 'Corps des agents remonté depuis OCTOPUS', + 'select' => 'SELECT * FROM V_PREECOG_CORPS', + 'connection' => 'doctrine.connection.orm_octopus', + 'source_code_column' => 'ID', + 'columns' => ['LIB_COURT', 'LIB_LONG', 'CODE', 'CATEGORIE', 'HISTO'], + ], + 'intermediate_table' => 'src_corps', + 'destination' => [ + 'name' => 'Corps des agents remonté depuis OCTOPUS', + 'table' => 'corps', + 'connection' => 'doctrine.connection.orm_default', + 'source_code_column' => 'id', + 'columns' => ['lib_court', 'lib_long', 'code', 'categorie', 'histo'], + ], + ], + ], + + ], + + 'bjyauthorize' => [ + 'guards' => [ + PrivilegeController::class => [ + [ + 'controller' => 'UnicaenDbImport\Controller\Console', + 'action' => [ + 'runImport', + ], + 'roles' => [], + ], + ], + ], + ], + +]; diff --git a/docker-compose.yml b/docker-compose.yml index b0263e138a64cee7e5dc97e82460ec380e6ed1bd..cbb340d005f29c47e07c11452f6c2f9f6aacdfee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,11 +7,10 @@ services: args: PHP_VERSION: 7.0 context: . - dockerfile: Dockerfile ports: - - "8112:80" - - "8111:443" + - "8000:80" + - "443:443" volumes: - - .:/app - - /tmp:/tmp - working_dir: /app + - .:/app + - /tmp:/tmp + working_dir: /app \ No newline at end of file diff --git a/docker/apache-site-ssl.conf b/docker/apache-site-ssl.conf index 6174fa677003aaa36c12b7db164bcb2eb0d8134b..75863a1fd8889d2d0b1f21e3f7cede1d3f5f44e4 100644 --- a/docker/apache-site-ssl.conf +++ b/docker/apache-site-ssl.conf @@ -14,7 +14,7 @@ <IfModule proxy_fcgi_module> <FilesMatch ".+\.ph(ar|p|tml)$"> - SetHandler "proxy:unix:/var/run/php-fpm.sock|fcgi://localhost/" + SetHandler "proxy:unix:/run/php/php-fpm.sock|fcgi://localhost/" </FilesMatch> </IfModule> diff --git a/docker/fpm/conf.d/app.ini b/docker/fpm/conf.d/99-app.ini similarity index 53% rename from docker/fpm/conf.d/app.ini rename to docker/fpm/conf.d/99-app.ini index c110657644b0473b335d86be2714ff5b31bd7f33..61932c916e3ec4a9cb01823dfcf775e143f44771 100644 --- a/docker/fpm/conf.d/app.ini +++ b/docker/fpm/conf.d/99-app.ini @@ -3,10 +3,10 @@ date.timezone = Europe/Paris short_open_tag = Off expose_php = Off -log_errors = On -display_startup_errors = On display_errors = On +display_startup_errors = On error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE +log_errors = On max_execution_time = 120 @@ -18,33 +18,32 @@ upload_max_filesize = 501M post_max_size = 502M +;opcache.error_log=/var/log/php_opcache_error.log +;opcache.enable = 0 +;opcache.memory_consumption = 256 +;opcache.interned_strings_buffer = 8 +;opcache.max_wasted_percentage = 5 +;opcache.max_accelerated_files = 16000 +;; http://php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq +;; defaults to zend opcache checking every 180 seconds for PHP file changes +;; set to zero to check every second if you are doing alot of frequent +;; php file edits/developer work +;; opcache.revalidate_freq=0 +;opcache.revalidate_freq = 180 +;opcache.fast_shutdown = 0 +;opcache.enable_cli = 0 +;opcache.save_comments = 1 +;opcache.enable_file_override = 1 +;opcache.validate_timestamps = 1 +;opcache.huge_code_pages = 0 + + +xdebug.enable = 1 xdebug.remote_enable = 1 xdebug.remote_connect_back = 1 xdebug.profiler_enable_trigger = 1 - xdebug.var_display_max_children = 1024 xdebug.var_display_max_data = -1 xdebug.max_nesting_level = 256 # Attention: trop diminuer 'max_nesting_level' peut causer une erreur 'Maximum function nesting level of x reached' - #xdebug.collect_params = 4 - - -;opcache.error_log=/var/log/php_opcache_error.log -opcache.enable = 0 -opcache.memory_consumption = 256 -opcache.interned_strings_buffer = 8 -opcache.max_wasted_percentage = 5 -opcache.max_accelerated_files = 16000 -; http://php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq -; defaults to zend opcache checking every 180 seconds for PHP file changes -; set to zero to check every second if you are doing alot of frequent -; php file edits/developer work -; opcache.revalidate_freq=0 -opcache.revalidate_freq = 180 -opcache.fast_shutdown = 0 -opcache.enable_cli = 0 -opcache.save_comments = 1 -opcache.enable_file_override = 1 -opcache.validate_timestamps = 1 -opcache.huge_code_pages = 0 diff --git a/docker/fpm/pool.d/app.conf b/docker/fpm/pool.d/app.conf deleted file mode 100644 index ddb5099a219c59fc1030feb2d977022dd844edf7..0000000000000000000000000000000000000000 --- a/docker/fpm/pool.d/app.conf +++ /dev/null @@ -1,24 +0,0 @@ -[app] - -user = www-data -group = www-data - -listen = /var/run/php-fpm.sock -listen.owner = www-data -listen.group = www-data - -; mandatory values -; Soit: -; pm = dynamic -; pm.max_children = 5 -; pm.start_servers = 2 -; pm.min_spare_servers = 1 -; pm.max_spare_servers = 3 -; Soit: -pm = ondemand -pm.max_children = 35 -pm.process_idle_timeout = 10s -pm.max_requests = 500 - -request_slowlog_timeout = 30 -slowlog = /var/log/php-fpm.slow.log diff --git a/docker/fpm/pool.d/www.conf b/docker/fpm/pool.d/www.conf new file mode 100644 index 0000000000000000000000000000000000000000..85e7a2afb0efce3fac9679f108919623c21fc243 --- /dev/null +++ b/docker/fpm/pool.d/www.conf @@ -0,0 +1,429 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or /usr) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = /run/php/php-fpm.sock + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +listen.owner = www-data +listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 5 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/share/php/7.2/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M + +catch_workers_output = yes + +php_flag[display_errors] = on +php_admin_value[error_log] = /var/log/fpm-php.www.log +php_admin_flag[log_errors] = on diff --git a/module/Application/config/merged/activite.config.php b/module/Application/config/merged/activite.config.php index c993434752a57162c216baeb468d2648933a4f14..12b0f38ec72b57001bd28d43feb22924573eb6d6 100644 --- a/module/Application/config/merged/activite.config.php +++ b/module/Application/config/merged/activite.config.php @@ -7,6 +7,7 @@ use Application\Controller\Activite\ActiviteControllerFactory; use Application\Form\Activite\ActiviteForm; use Application\Form\Activite\ActiviteFormFactory; use Application\Form\Activite\ActiviteHydrator; +use Application\Form\Activite\ActiviteHydratorFactory; use Application\Provider\Privilege\ActivitePrivileges; use Application\Service\Activite\ActiviteService; use Application\Service\Activite\ActiviteServiceFactory; @@ -32,15 +33,31 @@ return [ 'controller' => ActiviteController::class, 'action' => [ 'creer', + ], + 'privileges' => [ + ActivitePrivileges::AJOUTER, + ], + ], + [ + 'controller' => ActiviteController::class, + 'action' => [ 'editer', 'historiser', 'restaurer', - 'detruire', ], 'privileges' => [ ActivitePrivileges::EDITER, ], ], + [ + 'controller' => ActiviteController::class, + 'action' => [ + 'detruire', + ], + 'privileges' => [ + ActivitePrivileges::EFFACER, + ], + ], ], ], ], @@ -50,7 +67,7 @@ return [ 'activite' => [ 'type' => Literal::class, 'options' => [ - 'route' => '/activite', + 'route' => '/mission-principale', 'defaults' => [ 'controller' => ActiviteController::class, 'action' => 'index', @@ -141,8 +158,8 @@ return [ ], ], 'hydrators' => [ - 'invokable' => [ - ActiviteHydrator::class => ActiviteHydrator::class, + 'factories' => [ + ActiviteHydrator::class => ActiviteHydratorFactory::class, ] ] diff --git a/module/Application/config/merged/agent.config.php b/module/Application/config/merged/agent.config.php index 76525d7f37f038881925d2ce90a5cc751ba20fa3..65aeec67491220705fbadcf96aa96f6ee300edce 100644 --- a/module/Application/config/merged/agent.config.php +++ b/module/Application/config/merged/agent.config.php @@ -7,18 +7,15 @@ use Application\Controller\Agent\AgentControllerFactory; use Application\Controller\AgentFichier\AgentFichierController; use Application\Controller\AgentFichier\AgentFichierControllerFactory; use Application\Controller\EntretienProfessionnel\EntretienProfessionnelController; -use Application\Entity\Db\AgentStatut; use Application\Form\Agent\AgentForm; use Application\Form\Agent\AgentFormFactory; use Application\Form\Agent\AgentHydrator; use Application\Form\Agent\AgentHydratorFactory; -use Application\Form\Agent\AgentImportForm; -use Application\Form\Agent\AgentImportFormFactory; use Application\Provider\Privilege\AgentPrivileges; use Application\Service\Agent\AgentService; use Application\Service\Agent\AgentServiceFactory; -use Application\View\Helper\AgentStatutViewHelper; use Application\View\Helper\AgentViewHelper; +use Application\View\Helper\AgentStatutViewHelper; use UnicaenAuth\Guard\PrivilegeController; use Zend\Mvc\Router\Http\Literal; use Zend\Mvc\Router\Http\Segment; @@ -32,6 +29,7 @@ return [ 'action' => [ 'index', 'afficher', + ], 'privileges' => [ AgentPrivileges::AFFICHER, @@ -40,23 +38,12 @@ return [ [ 'controller' => AgentController::class, 'action' => [ - 'ajouter', - 'importer', 'rechercher-individu', ], 'privileges' => [ AgentPrivileges::AJOUTER, ], ], - [ - 'controller' => AgentController::class, - 'action' => [ - 'supprimer', - ], - 'privileges' => [ - AgentPrivileges::EFFACER, - ], - ], [ 'controller' => AgentController::class, 'action' => [ @@ -102,6 +89,16 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ + 'modifier' => [ + 'type' => Segment::class, + 'options' => [ + 'route' => '/modifier/:agent', + 'defaults' => [ + 'controller' => AgentController::class, + 'action' => 'modifier', + ], + ], + ], 'fichiers' => [ 'type' => Segment::class, 'options' => [ @@ -142,46 +139,6 @@ return [ ], ], ], - 'modifier' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/modifier/:id', - 'defaults' => [ - 'controller' => AgentController::class, - 'action' => 'modifier', - ], - ], - ], - 'supprimer' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/supprimer/:id', - 'defaults' => [ - 'controller' => AgentController::class, - 'action' => 'supprimer', - ], - ], - ], - 'ajouter' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/ajouter', - 'defaults' => [ - 'controller' => AgentController::class, - 'action' => 'ajouter', - ], - ], - ], - 'importer' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/importer', - 'defaults' => [ - 'controller' => AgentController::class, - 'action' => 'importer', - ], - ], - ], 'rechercher-individu' => [ 'type' => Literal::class, 'options' => [ @@ -213,13 +170,12 @@ return [ 'form_elements' => [ 'factories' => [ AgentForm::class => AgentFormFactory::class, - AgentImportForm::class => AgentImportFormFactory::class, ], ], 'hydrators' => [ 'factories' => [ AgentHydrator::class => AgentHydratorFactory::class, - ] + ], ], 'view_helpers' => [ 'invokables' => [ diff --git a/module/Application/config/merged/fiche-metier.config.php b/module/Application/config/merged/fiche-metier.config.php index 0e7622d9996ba1f7161f7999f8a8927d7f8bea1e..559f977069d1c3b40054720226e0ee22f8e6af0c 100644 --- a/module/Application/config/merged/fiche-metier.config.php +++ b/module/Application/config/merged/fiche-metier.config.php @@ -2,50 +2,34 @@ namespace Application; -use Application\Controller\FicheMetier\FicheMetierTypeController; -use Application\Controller\FicheMetier\FicheMetierTypeControllerFactory; -use Application\Form\FicheMetier\AjouterFicheTypeForm; -use Application\Form\FicheMetier\AjouterFicheTypeFormFactory; -use Application\Form\FicheMetier\AjouterFicheTypeHydrator; -use Application\Form\FicheMetier\AjouterFicheTypeHydratorFactory; -use Application\Form\FicheMetier\AssocierMetierTypeForm; -use Application\Form\FicheMetier\AssocierMetierTypeFormFactory; -use Application\Form\FicheMetier\AssocierMetierTypeHydrator; -use Application\Form\FicheMetier\AssocierMetierTypeHydratorFactory; -use Application\Form\FicheMetier\AssocierPosteForm; -use Application\Form\FicheMetier\AssocierPosteFormFactory; -use Application\Form\FicheMetier\AssocierPosteHydrator; -use Application\Form\FicheMetier\AssocierPosteHydratorFactory; -use Application\Form\FicheMetier\FicheMetierCreationForm; -use Application\Form\FicheMetier\FicheMetierCreationFormFactory; -use Application\Form\FicheMetier\FicheMetierCreationHydrator; -use Application\Form\FicheMetier\FicheMetierCreationHydratorFactory; -use Application\Form\FicheMetierType\ActiviteExistanteForm; -use Application\Form\FicheMetierType\ActiviteExistanteFormFactory; -use Application\Form\FicheMetierType\ApplicationsForm; -use Application\Form\FicheMetierType\ApplicationsFormFactory; -use Application\Form\FicheMetierType\ApplicationsHydrator; -use Application\Form\FicheMetierType\ApplicationsHydratorFactory; -use Application\Form\FicheMetierType\FormationBaseForm; -use Application\Form\FicheMetierType\FormationBaseFormFactory; -use Application\Form\FicheMetierType\FormationBaseHydrator; -use Application\Form\FicheMetierType\FormationComportementaleForm; -use Application\Form\FicheMetierType\FormationComportementaleFormFactory; -use Application\Form\FicheMetierType\FormationComportementaleHydrator; -use Application\Form\FicheMetierType\FormationOperationnelleForm; -use Application\Form\FicheMetierType\FormationOperationnelleFormFactory; -use Application\Form\FicheMetierType\FormationOperationnelleHydrator; -use Application\Form\FicheMetierType\LibelleForm; -use Application\Form\FicheMetierType\LibelleFormFactory; -use Application\Form\FicheMetierType\LibelleHydrator; -use Application\Form\FicheMetierType\LibelleHydratorFactory; -use Application\Form\FicheMetierType\MissionsPrincipalesForm; -use Application\Form\FicheMetierType\MissionsPrincipalesFormFactory; +use Application\Controller\FicheMetier\FicheMetierController; +use Application\Controller\FicheMetier\FicheMetierControllerFactory; +use Application\Form\FicheMetier\ActiviteExistanteForm; +use Application\Form\FicheMetier\ActiviteExistanteFormFactory; +use Application\Form\FicheMetier\ApplicationsForm; +use Application\Form\FicheMetier\ApplicationsFormFactory; +use Application\Form\FicheMetier\ApplicationsHydrator; +use Application\Form\FicheMetier\ApplicationsHydratorFactory; +use Application\Form\FicheMetier\FormationBaseForm; +use Application\Form\FicheMetier\FormationBaseFormFactory; +use Application\Form\FicheMetier\FormationBaseHydrator; +use Application\Form\FicheMetier\FormationComportementaleForm; +use Application\Form\FicheMetier\FormationComportementaleFormFactory; +use Application\Form\FicheMetier\FormationComportementaleHydrator; +use Application\Form\FicheMetier\FormationOperationnelleForm; +use Application\Form\FicheMetier\FormationOperationnelleFormFactory; +use Application\Form\FicheMetier\FormationOperationnelleHydrator; +use Application\Form\FicheMetier\LibelleForm; +use Application\Form\FicheMetier\LibelleFormFactory; +use Application\Form\FicheMetier\LibelleHydrator; +use Application\Form\FicheMetier\LibelleHydratorFactory; +use Application\Form\FicheMetier\MissionsPrincipalesForm; +use Application\Form\FicheMetier\MissionsPrincipalesFormFactory; use Application\Provider\Privilege\FicheMetierPrivileges; use Application\Service\FicheMetier\FicheMetierService; use Application\Service\FicheMetier\FicheMetierServiceFactory; -use Application\View\Helper\FicheTypeExterneViewHelper; -use Application\View\Helper\FicheTypeViewHelper; +use Application\View\Helper\FicheMetierExterneViewHelper; +use Application\View\Helper\FicheMetierViewHelper; use Application\View\Helper\SpecificitePosteViewHelper; use UnicaenAuth\Guard\PrivilegeController; use Zend\Mvc\Router\Http\Literal; @@ -56,7 +40,7 @@ return [ 'guards' => [ PrivilegeController::class => [ [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => [ 'index', ], @@ -64,13 +48,14 @@ return [ ], ], [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => [ 'afficher', 'editer', 'detruire', 'historiser', 'restaurer', + 'export', 'editer-libelle', 'editer-missions-principales', @@ -100,7 +85,7 @@ return [ 'options' => [ 'route' => '/fiche-metier-type', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'index', ], ], @@ -111,7 +96,7 @@ return [ 'options' => [ 'route' => '/ajouter', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'ajouter', ], ], @@ -122,18 +107,29 @@ return [ 'options' => [ 'route' => '/afficher/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'afficher', ], ], 'may_terminate' => true, ], + 'export' => [ + 'type' => Segment::class, + 'options' => [ + 'route' => '/export/:id', + 'defaults' => [ + 'controller' => FicheMetierController::class, + 'action' => 'export', + ], + ], + 'may_terminate' => true, + ], 'editer' => [ 'type' => Segment::class, 'options' => [ - 'route' => '/editer/:id', + 'route' => '/editer[/:id]', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'editer', ], ], @@ -144,7 +140,7 @@ return [ 'options' => [ 'route' => '/historiser/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'historiser', ], ], @@ -155,7 +151,7 @@ return [ 'options' => [ 'route' => '/restaurer/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'restaurer', ], ], @@ -166,7 +162,7 @@ return [ 'options' => [ 'route' => '/detruire/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'detruire', ], ], @@ -177,7 +173,7 @@ return [ 'options' => [ 'route' => '/editer-libelle/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'editer-libelle', ], ], @@ -188,7 +184,7 @@ return [ 'options' => [ 'route' => '/editer-missions-principales/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'editer-missions-principales', ], ], @@ -199,7 +195,7 @@ return [ 'options' => [ 'route' => '/retirer-activite/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'retirer-activite', ], ], @@ -210,7 +206,7 @@ return [ 'options' => [ 'route' => '/deplacer-activite/:id/:direction', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'deplacer-activite', ], ], @@ -221,7 +217,7 @@ return [ 'options' => [ 'route' => '/ajouter-nouvelle-activite/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'ajouter-nouvelle-activite', ], ], @@ -232,7 +228,7 @@ return [ 'options' => [ 'route' => '/ajouter-activite-existante/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'ajouter-activite-existante', ], ], @@ -243,7 +239,7 @@ return [ 'options' => [ 'route' => '/modifier-connaissances/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'modifier-connaissances', ], ], @@ -254,7 +250,7 @@ return [ 'options' => [ 'route' => '/modifier-operationnelle/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'modifier-operationnelle', ], ], @@ -265,7 +261,7 @@ return [ 'options' => [ 'route' => '/modifier-comportementale/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'modifier-comportementale', ], ], @@ -276,7 +272,7 @@ return [ 'options' => [ 'route' => '/modifier-application/:id', 'defaults' => [ - 'controller' => FicheMetierTypeController::class, + 'controller' => FicheMetierController::class, 'action' => 'modifier-application', ], ], @@ -296,7 +292,7 @@ return [ ], 'controllers' => [ 'factories' => [ - FicheMetierTypeController::class => FicheMetierTypeControllerFactory::class, + FicheMetierController::class => FicheMetierControllerFactory::class, ], ], 'form_elements' => [ @@ -331,8 +327,8 @@ return [ 'view_helpers' => [ 'invokables' => [ 'specificitePoste' => SpecificitePosteViewHelper::class, - 'ficheTypeExterne' => FicheTypeExterneViewHelper::class, - 'ficheMetierType' => FicheTypeViewHelper::class, + 'ficheMetierExterne' => FicheMetierExterneViewHelper::class, + 'ficheMetier' => FicheMetierViewHelper::class, ], ], diff --git a/module/Application/config/merged/fiche-poste.config.php b/module/Application/config/merged/fiche-poste.config.php index 527979665539c8376960f0f5ff0b018e6102f75c..a909b6f822f0dda6d585eb64b5c6d6c8379f6cbd 100644 --- a/module/Application/config/merged/fiche-poste.config.php +++ b/module/Application/config/merged/fiche-poste.config.php @@ -50,6 +50,7 @@ return [ 'retirer-fiche-metier', 'modifier-fiche-metier', 'selectionner-activite', + 'export', ], 'roles' => [ ], @@ -93,11 +94,22 @@ return [ ], ], ], + 'export' => [ + 'type' => Segment::class, + 'may_terminate' => true, + 'options' => [ + 'route' => '/export/:fiche-poste', + 'defaults' => [ + 'controller' => FichePosteController::class, + 'action' => 'export', + ], + ], + ], 'editer' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ - 'route' => '/editer/:fiche-poste', + 'route' => '/editer[/:fiche-poste]', 'defaults' => [ 'controller' => FichePosteController::class, 'action' => 'editer', diff --git a/module/Application/config/merged/fonction.config.php b/module/Application/config/merged/fonction.config.php deleted file mode 100644 index 1de31305b97d328484fcd83394a6a67981ee711c..0000000000000000000000000000000000000000 --- a/module/Application/config/merged/fonction.config.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -namespace Application; - -use Application\Controller\Fonction\FonctionController; -use Application\Controller\Fonction\FonctionControllerFactory; -use Application\Form\Fonction\FonctionForm; -use Application\Form\Fonction\FonctionFormFactory; -use Application\Form\Fonction\FonctionHydrator; -use Application\Provider\Privilege\FonctionPrivileges; -use Application\Service\Fonction\FonctionService; -use Application\Service\Fonction\FonctionServiceFactory; -use UnicaenAuth\Guard\PrivilegeController; -use Zend\Mvc\Router\Http\Literal; -use Zend\Mvc\Router\Http\Segment; - -return [ - 'bjyauthorize' => [ - 'guards' => [ - PrivilegeController::class => [ - [ - 'controller' => FonctionController::class, - 'action' => [ - 'index', - 'afficher', - 'creer', - 'modifier', - 'historiser', - 'restaurer', - 'detruire', - 'synchroniser', - ], - 'privileges' => [ - FonctionPrivileges::AFFICHER, - ], - ], - ], - ], - ], - - 'router' => [ - 'routes' => [ - 'fonction' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/fonction', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'index', - ], - ], - 'may_terminate' => true, - 'child_routes' => [ - 'creer' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/creer', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'creer', - ], - ], - ], - 'afficher' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/afficher/:fonction', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'afficher', - ], - ], - ], - 'modifier' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/modifier/:fonction', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'modifier', - ], - ], - ], - 'historiser' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/historiser/:fonction', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'historiser', - ], - ], - ], - 'restaurer' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/restaurer/:fonction', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'restaurer', - ], - ], - ], - 'detruire' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/detruire/:fonction', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'detruire', - ], - ], - ], - 'synchroniser' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/synchroniser', - 'defaults' => [ - 'controller' => FonctionController::class, - 'action' => 'synchroniser', - ], - ], - ], - ], - ], - ], - ], - - 'service_manager' => [ - 'factories' => [ - FonctionService::class => FonctionServiceFactory::class, - ], - ], - 'controllers' => [ - 'factories' => [ - FonctionController::class => FonctionControllerFactory::class, - ], - ], - 'form_elements' => [ - 'factories' => [ - FonctionForm::class => FonctionFormFactory::class, - ], - ], - 'hydrators' => [ - 'invokables' => [ - FonctionHydrator::class => FonctionHydrator::class, - ] - ] - -]; \ No newline at end of file diff --git a/module/Application/config/merged/immobilier.config.php b/module/Application/config/merged/immobilier.config.php new file mode 100644 index 0000000000000000000000000000000000000000..e95e64729d6a9b547dbd2a97700e0eef1e4eb13f --- /dev/null +++ b/module/Application/config/merged/immobilier.config.php @@ -0,0 +1,71 @@ +<?php + +namespace Application; + +use Application\Controller\Immobilier\ImmobilierController; +use Application\Controller\Immobilier\ImmobilierControllerFactory; +use Application\Controller\Structure\StructureController; +use Application\Controller\Structure\StructureControllerFactory; +use Application\Provider\Privilege\RessourceRhPrivileges; +use Application\Provider\Privilege\StructurePrivileges; +use Application\Service\Immobilier\ImmobilierService; +use Application\Service\Immobilier\ImmobilierServiceFactory; +use Application\Service\Structure\StructureService; +use Application\Service\Structure\StructureServiceFactory; +use UnicaenAuth\Guard\PrivilegeController; +use Zend\Mvc\Router\Http\Literal; +use Zend\Mvc\Router\Http\Segment; + +return [ + 'bjyauthorize' => [ + 'guards' => [ + PrivilegeController::class => [ + [ + 'controller' => ImmobilierController::class, + 'action' => [ + 'index', + ], + 'privileges' => [ + RessourceRhPrivileges::AFFICHER, + ], + ], + ], + ], + ], + + 'router' => [ + 'routes' => [ + 'immobilier' => [ + 'type' => Literal::class, + 'options' => [ + 'route' => '/immobilier', + 'defaults' => [ + 'controller' => ImmobilierController::class, + 'action' => 'index', + ], + ], + 'may_terminate' => true, + 'child_routes' => [ + ], + ], + ], + ], + + 'service_manager' => [ + 'factories' => [ + ImmobilierService::class => ImmobilierServiceFactory::class, + ], + ], + 'controllers' => [ + 'factories' => [ + ImmobilierController::class => ImmobilierControllerFactory::class, + ], + ], + 'form_elements' => [ + 'factories' => [], + ], + 'hydrators' => [ + 'factories' => [], + ] + +]; \ No newline at end of file diff --git a/module/Application/config/merged/menu.config.php b/module/Application/config/merged/menu.config.php index 77a1d7d35b6240fea2a7112028bb094408a9e5d6..473983ec78eca3d40bdff3bb2a217f71e5a793b5 100644 --- a/module/Application/config/merged/menu.config.php +++ b/module/Application/config/merged/menu.config.php @@ -6,10 +6,9 @@ use Application\Provider\Privilege\ActivitePrivileges; use Application\Provider\Privilege\AdministrationPrivileges; use Application\Provider\Privilege\ApplicationPrivileges; use Application\Provider\Privilege\FicheMetierPrivileges; -use Application\Provider\Privilege\FonctionPrivileges; +use Application\Provider\Privilege\PersoPrivileges; use Application\Provider\Privilege\PostePrivileges; use Application\Provider\Privilege\RessourceRhPrivileges; -use Application\Provider\Privilege\StructurePrivileges; return [ 'navigation' => [ @@ -23,9 +22,7 @@ return [ // 'visible' => false, 'label' => 'Accueil', 'route' => 'index-personnel', - 'roles' => [ - 'Personnel' - ], + 'resource' => PersoPrivileges::getResourceId(PersoPrivileges::MENU), 'pages' => [ 'index-personnel' => [ 'visible' => true, @@ -33,9 +30,7 @@ return [ 'label' => 'Mon accueil', 'icon' => 'fas fa-angle-right', 'route' => 'index-personnel', - 'roles' => [ - 'Personnel', - ], + 'resource' => PersoPrivileges::getResourceId(PersoPrivileges::MENU), ], 'entretien' => [ 'visible' => true, @@ -43,9 +38,7 @@ return [ 'label' => 'Mes entretiens Pro.', 'icon' => 'fas fa-angle-right', 'route' => 'agent/entretien-professionnel', - 'roles' => [ - 'Personnel', - ], + 'resource' => PersoPrivileges::getResourceId(PersoPrivileges::ENTRETIEN), ], 'fichier' => [ 'visible' => true, @@ -53,9 +46,7 @@ return [ 'label' => 'Mes fichiers', 'icon' => 'fas fa-angle-right', 'route' => 'agent/fichiers', - 'roles' => [ - 'Personnel', - ], + 'resource' => PersoPrivileges::getResourceId(PersoPrivileges::FICHIER), ], // 'rgpd' => [ // 'visible' => true, @@ -78,53 +69,68 @@ return [ 'pages' => [ [ 'order' => 1, - 'label' => 'Les corps, grades et status', - 'route' => 'ressource-rh/index-corps-grade-status', + 'label' => 'Les agents', + 'route' => 'agent', + 'privileges' => FicheMetierPrivileges::AFFICHER, + 'dropdown-header' => true, + 'icon' => 'fas fa-angle-right' + ], + [ + 'order' => 2, + 'label' => 'Les corps', + 'route' => 'ressource-rh/index-corps', 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], [ 'order' => 2, - 'label' => 'Les correspondances', - 'route' => 'ressource-rh/index-correspondance', + 'label' => 'Les grades', + 'route' => 'ressource-rh/index-grade', 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], [ 'order' => 3, - 'label' => 'Les domaines', - 'route' => 'ressource-rh/index-domaine', + 'label' => 'Les correspondances', + 'route' => 'ressource-rh/index-correspondance', 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], [ 'order' => 4, - 'label' => 'Les fonctions', - 'route' => 'fonction', + 'label' => 'Familles, domaines et métiers', + 'route' => 'ressource-rh/index-metier-famille-domaine', 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], [ - 'order' => 5, - 'label' => 'Les métiers et familles professionnelles', - 'route' => 'ressource-rh/index-metier-et-famille', + 'order' => 7, + 'label' => 'Sites et bâtiments', + 'route' => 'immobilier', 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], [ - 'order' => 6, + 'order' => 8, 'label' => 'Les structures', 'route' => 'structure', 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], - + [ + 'order' => 100, + 'label' => 'Cartographie', + 'route' => 'ressource-rh/cartographie', + 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , + 'dropdown-header' => true, + 'icon' => 'fas fa-angle-right' + ], ], ], @@ -195,27 +201,39 @@ return [ 'resource' => FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::AFFICHER), 'pages' => [ [ - 'label' => 'Les activités', + 'order' => 1, + 'label' => 'Les missions principales', 'route' => 'activite', 'privileges' => ActivitePrivileges::AFFICHER, 'dropdown-header' => true, 'icon' => 'fas fa-angle-right', ], [ - 'label' => 'Les agents', - 'route' => 'agent', - 'privileges' => FicheMetierPrivileges::AFFICHER, + 'order' => 2, + 'label' => 'Les missions spécifiques', + 'route' => 'ressource-rh/index-mission-specifique', + 'resource' => RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) , 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], [ + 'order' => 3, 'label' => 'Les applications', 'route' => 'application', 'privileges' => ApplicationPrivileges::AFFICHER, 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' ], +// [ +// 'order' => 4, +// 'label' => 'Les formations', +// 'route' => 'application', +// 'privileges' => ApplicationPrivileges::AFFICHER, +// 'dropdown-header' => true, +// 'icon' => 'fas fa-angle-right' +// ], [ + 'order' => 7, 'label' => 'Les fiches de poste', 'route' => 'fiche-poste', 'privileges' => FicheMetierPrivileges::AFFICHER, @@ -223,6 +241,7 @@ return [ 'icon' => 'fas fa-angle-right' ], [ + 'order' => 6, 'label' => 'Les fiches métiers', 'route' => 'fiche-metier-type', 'privileges' => FicheMetierPrivileges::AFFICHER, @@ -230,6 +249,7 @@ return [ 'icon' => 'fas fa-angle-right' ], [ + 'order' => 5, 'label' => 'Les postes', 'route' => 'poste', 'privileges' => PostePrivileges::AFFICHER, diff --git a/module/Application/config/merged/poste.config.php b/module/Application/config/merged/poste.config.php index 9b12669ffb445521355b1d858bb1d43575e7de6f..ccbc934efdcb8325d82cd76a6914c5ac3e2ccddc 100644 --- a/module/Application/config/merged/poste.config.php +++ b/module/Application/config/merged/poste.config.php @@ -12,7 +12,6 @@ use Application\Provider\Privilege\PostePrivileges; use Application\Service\Poste\PosteService; use Application\Service\Poste\PosteServiceFactory; use Application\View\Helper\PosteViewHelper; -use Application\View\Helper\PosteViewHelperFactory; use UnicaenAuth\Guard\PrivilegeController; use Zend\Mvc\Router\Http\Literal; use Zend\Mvc\Router\Http\Segment; @@ -86,16 +85,6 @@ return [ ], ], ], - 'rechercher-batiment' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/rechercher-batiment', - 'defaults' => [ - 'controller' => PosteController::class, - 'action' => 'rechercher-batiment', - ], - ], - ], 'supprimer' => [ 'type' => Segment::class, 'options' => [ @@ -154,8 +143,8 @@ return [ ] ], 'view_helpers' => [ - 'factories' => [ - 'poste' => PosteViewHelperFactory::class, + 'invokables' => [ + 'poste' => PosteViewHelper::class, ], ], diff --git a/module/Application/config/merged/ressource-rh.config.php b/module/Application/config/merged/ressource-rh.config.php index 2faf5d2969ccce6c4fc7cde4f7b1e7471bcfe8cb..11c58270c52b62f81374823b7a8c195fc6b3750d 100644 --- a/module/Application/config/merged/ressource-rh.config.php +++ b/module/Application/config/merged/ressource-rh.config.php @@ -4,30 +4,35 @@ namespace Application; use Application\Controller\RessourceRh\RessourceRhController; use Application\Controller\RessourceRh\RessourceRhControllerFactory; -use Application\Form\RessourceRh\AgentStatusForm; -use Application\Form\RessourceRh\AgentStatusFormFactory; -use Application\Form\RessourceRh\AgentStatusHydrator; -use Application\Form\RessourceRh\CorpsForm; -use Application\Form\RessourceRh\CorpsFormFactory; -use Application\Form\RessourceRh\CorpsHydrator; -use Application\Form\RessourceRh\CorrespondanceForm; -use Application\Form\RessourceRh\CorrespondanceFormFactory; -use Application\Form\RessourceRh\CorrespondanceHydrator; + +use Application\Form\MissionSpecifique\MissionSpecifiqueForm; +use Application\Form\MissionSpecifique\MissionSpecifiqueFormFactory; +use Application\Form\MissionSpecifique\MissionSpecifiqueHydrator; +use Application\Form\MissionSpecifique\MissionSpecifiqueHydratorFactory; use Application\Form\RessourceRh\DomaineForm; use Application\Form\RessourceRh\DomaineFormFactory; use Application\Form\RessourceRh\DomaineHydrator; -use Application\Form\RessourceRh\GradeForm; -use Application\Form\RessourceRh\GradeFormFactory; -use Application\Form\RessourceRh\GradeHydrator; -use Application\Form\RessourceRh\GradeHydratorFactory; -use Application\Form\RessourceRh\MetierFamilleForm; -use Application\Form\RessourceRh\MetierFamilleFormFactory; -use Application\Form\RessourceRh\MetierFamilleHydrator; +use Application\Form\RessourceRh\DomaineHydratorFactory; +use Application\Form\RessourceRh\FamilleProfessionnelleHydrator; +use Application\Form\RessourceRh\FonctionForm; +use Application\Form\RessourceRh\FonctionFormFactory; +use Application\Form\RessourceRh\FonctionHydrator; +use Application\Form\RessourceRh\FonctionHydratorFactory; +use Application\Form\RessourceRh\FamilleProfessionnelleForm; +use Application\Form\RessourceRh\FamilleProfessionnelleFormFactory; use Application\Form\RessourceRh\MetierForm; use Application\Form\RessourceRh\MetierFormFactory; use Application\Form\RessourceRh\MetierHydrator; use Application\Form\RessourceRh\MetierHydratorFactory; use Application\Provider\Privilege\RessourceRhPrivileges; +use Application\Service\Domaine\DomaineService; +use Application\Service\Domaine\DomaineServiceFactory; +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleService; +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleServiceFactory; +use Application\Service\Fonction\FonctionService; +use Application\Service\Fonction\FonctionServiceFactory; +use Application\Service\Metier\MetierService; +use Application\Service\Metier\MetierServiceFactory; use Application\Service\RessourceRh\RessourceRhService; use Application\Service\RessourceRh\RessourceRhServiceFactory; use UnicaenAuth\Guard\PrivilegeController; @@ -42,12 +47,14 @@ return [ 'controller' => RessourceRhController::class, 'action' => [ 'index', - 'index-corps-grade-status', - 'index-metier-et-famille', + 'index-grade', + 'index-corps', + 'index-metier-famille-domaine', 'index-correspondance', - 'index-domaine', - 'index-metier-et-famille', + 'index-mission-specifique', 'get-grades-json', + 'cartographie', + 'export-cartographie', ], 'privileges' => [ RessourceRhPrivileges::AFFICHER, @@ -56,14 +63,11 @@ return [ [ 'controller' => RessourceRhController::class, 'action' => [ - 'creer-agent-status', - 'creer-correspondance', - 'creer-corps', 'creer-metier', 'creer-famille', 'ajouter-domaine', 'ajouter-fonction', - 'ajouter-grade', + 'ajouter-mission-specifique', ], 'privileges' => [ RessourceRhPrivileges::AJOUTER, @@ -72,14 +76,14 @@ return [ [ 'controller' => RessourceRhController::class, 'action' => [ - 'modifier-agent-status', - 'modifier-correspondance', - 'modifier-corps', 'modifier-metier', 'modifier-famille', 'modifier-domaine', 'modifier-fonction', - 'modifier-grade', + + 'modifier-mission-specifique', + 'historiser-mission-specifique', + 'restaurer-mission-specifique', ], 'privileges' => [ RessourceRhPrivileges::MODIFIER, @@ -88,14 +92,11 @@ return [ [ 'controller' => RessourceRhController::class, 'action' => [ - 'effacer-corps', - 'effacer-correspondance', 'effacer-metier', - 'effacer-agent-status', 'effacer-famille', 'supprimer-domaine', 'supprimer-fonction', - 'supprimer-grade', + 'supprimer-mission-specifique', ], 'privileges' => [ RessourceRhPrivileges::EFFACER, @@ -118,164 +119,59 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ - 'index-corps-grade-status' => [ + 'index-correspondance' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ - 'route' => '/index-corps-grade-status', + 'route' => '/index-correspondance', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'index-corps-grade-status', + 'action' => 'index-correspondance', ], ], ], - 'index-metier-et-famille' => [ + 'index-corps' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ - 'route' => '/index-metier-et-famille', + 'route' => '/index-corps', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'index-metier-et-famille', + 'action' => 'index-corps', ], ], ], - 'index-correspondance' => [ + 'index-grade' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ - 'route' => '/index-correspondance', + 'route' => '/index-grade', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'index-correspondance', + 'action' => 'index-grade', ], ], ], - 'index-domaine' => [ + 'index-metier-famille-domaine' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ - 'route' => '/index-domaine', + 'route' => '/index-metier-famille-domaine', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'index-domaine', - ], - ], - ], - 'agent-status' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/agent-status', - ], - 'may_terminate' => false, - 'child_routes' => [ - 'creer' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/creer', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'creer-agent-status', - ], - ], - ], - 'modifier' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/modifier/:id', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'modifier-agent-status', - ], - ], - ], - 'effacer' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/effacer/:id', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'effacer-agent-status', - ], - ], - ], - ], - ], - 'correspondance' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/correspondance', - ], - 'may_terminate' => false, - 'child_routes' => [ - 'creer' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/creer', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'creer-correspondance', - ], - ], - ], - 'modifier' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/modifier/:id', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'modifier-correspondance', - ], - ], - ], - 'effacer' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/effacer/:id', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'effacer-correspondance', - ], - ], + 'action' => 'index-metier-famille-domaine', ], ], ], - 'corps' => [ + + 'index-mission-specifique' => [ 'type' => Literal::class, + 'may_terminate' => true, 'options' => [ - 'route' => '/corps', - ], - 'may_terminate' => false, - 'child_routes' => [ - 'creer' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/creer', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'creer-corps', - ], - ], - ], - 'modifier' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/modifier/:id', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'modifier-corps', - ], - ], - ], - 'effacer' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/effacer/:id', - 'defaults' => [ - 'controller' => RessourceRhController::class, - 'action' => 'effacer-corps', - ], - ], + 'route' => '/index-mission-specifique', + 'defaults' => [ + 'controller' => RessourceRhController::class, + 'action' => 'index-mission-specifique', ], ], ], @@ -435,50 +331,84 @@ return [ ], ], ], - 'grade' => [ + 'cartographie' => [ 'type' => Literal::class, 'options' => [ - 'route' => '/grade', + 'route' => '/cartographie', + 'defaults' => [ + 'controller' => RessourceRhController::class, + 'action' => 'cartographie', + ], ], - 'may_terminate' => false, + 'may_terminate' => true, 'child_routes' => [ - 'get-grades' => [ - 'type' => Literal::class, + 'export' => [ + 'type' => Literal::class, 'options' => [ - 'route' => '/get-grades', + 'route' => '/export', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'get-grades-json', + 'action' => 'export-cartographie', ], ], + 'may_terminate' => true, ], + ], + ], + 'mission-specifique' => [ + 'type' => Literal::class, + 'options' => [ + 'route' => '/mission-specifique', + ], + 'may_terminate' => false, + 'child_routes' => [ 'ajouter' => [ 'type' => Literal::class, 'options' => [ 'route' => '/ajouter', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'ajouter-grade', + 'action' => 'ajouter-mission-specifique', ], ], ], 'modifier' => [ 'type' => Segment::class, 'options' => [ - 'route' => '/modifier/:grade', + 'route' => '/modifier/:mission', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'modifier-grade', + 'action' => 'modifier-mission-specifique', + ], + ], + ], + 'historiser' => [ + 'type' => Segment::class, + 'options' => [ + 'route' => '/historiser/:mission', + 'defaults' => [ + 'controller' => RessourceRhController::class, + 'action' => 'historiser-mission-specifique', + ], + ], + ], + 'restaurer' => [ + 'type' => Segment::class, + 'options' => [ + 'route' => '/restaurer/:mission', + 'defaults' => [ + 'controller' => RessourceRhController::class, + 'action' => 'restaurer-mission-specifique', ], ], ], 'supprimer' => [ 'type' => Segment::class, 'options' => [ - 'route' => '/supprimer/:grade', + 'route' => '/supprimer/:mission', 'defaults' => [ 'controller' => RessourceRhController::class, - 'action' => 'supprimer-grade', + 'action' => 'supprimer-mission-specifique', ], ], ], @@ -490,10 +420,12 @@ return [ ], 'service_manager' => [ - 'invokables' => [ - ], 'factories' => [ RessourceRhService::class => RessourceRhServiceFactory::class, + DomaineService::class => DomaineServiceFactory::class, + FamilleProfessionnelleService::class => FamilleProfessionnelleServiceFactory::class, + FonctionService::class => FonctionServiceFactory::class, + MetierService::class => MetierServiceFactory::class, ], ], 'controllers' => [ @@ -503,26 +435,22 @@ return [ ], 'form_elements' => [ 'factories' => [ - AgentStatusForm::class => AgentStatusFormFactory::class, - CorpsForm::class => CorpsFormFactory::class, - CorrespondanceForm::class => CorrespondanceFormFactory::class, MetierForm::class => MetierFormFactory::class, - MetierFamilleForm::class => MetierFamilleFormFactory::class, + FamilleProfessionnelleForm::class => FamilleProfessionnelleFormFactory::class, +// FonctionForm::class => FonctionFormFactory::class, DomaineForm::class => DomaineFormFactory::class, - GradeForm::class => GradeFormFactory::class, + MissionSpecifiqueForm::class => MissionSpecifiqueFormFactory::class, ], ], 'hydrators' => [ 'invokables' => [ - AgentStatusHydrator::class => AgentStatusHydrator::class, - CorpsHydrator::class => CorpsHydrator::class, - CorrespondanceHydrator::class => CorrespondanceHydrator::class, - MetierFamilleHydrator::class => MetierFamilleHydrator::class, - DomaineHydrator::class => DomaineHydrator::class, + FamilleProfessionnelleHydrator::class => FamilleProfessionnelleHydrator::class, ], 'factories' => [ MetierHydrator::class => MetierHydratorFactory::class, - GradeHydrator::class => GradeHydratorFactory::class, + MissionSpecifiqueHydrator::class => MissionSpecifiqueHydratorFactory::class, + DomaineHydrator::class => DomaineHydratorFactory::class, + FonctionHydrator::class => FonctionHydratorFactory::class, ], ] diff --git a/module/Application/config/merged/structure.config.php b/module/Application/config/merged/structure.config.php index cfd6a1dc7d076004cbde8053cd221cd0f00ae20d..b8a7427761b81fa711f0d5833a759fe85505a91e 100644 --- a/module/Application/config/merged/structure.config.php +++ b/module/Application/config/merged/structure.config.php @@ -4,10 +4,9 @@ namespace Application; use Application\Controller\Structure\StructureController; use Application\Controller\Structure\StructureControllerFactory; -use Application\Form\Structure\StructureFormFactory; use Application\Form\Structure\StructureForm; +use Application\Form\Structure\StructureFormFactory; use Application\Form\Structure\StructureHydrator; -use Application\Form\Structure\StructureHydratorFactory; use Application\Provider\Privilege\StructurePrivileges; use Application\Service\Structure\StructureService; use Application\Service\Structure\StructureServiceFactory; @@ -23,18 +22,28 @@ return [ 'controller' => StructureController::class, 'action' => [ 'index', - 'description', - 'creer', - 'modifier', - 'historiser', - 'restaurer', - 'detruire', + ], + 'privileges' => [ + StructurePrivileges::AFFICHER, + ], + ], + [ + 'controller' => StructureController::class, + 'action' => [ 'ajouter-gestionnaire', 'retirer-gestionnaire', - 'synchroniser', ], 'privileges' => [ - StructurePrivileges::AFFICHER, + StructurePrivileges::GESTIONNAIRE, + ], + ], + [ + 'controller' => StructureController::class, + 'action' => [ + 'editer-description' + ], + 'privileges' => [ + StructurePrivileges::EDITER, ], ], ], @@ -54,66 +63,6 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ - 'creer' => [ - 'type' => Literal::class, - 'options' => [ - 'route' => '/creer', - 'defaults' => [ - 'controller' => StructureController::class, - 'action' => 'creer', - ], - ], - ], - 'description' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/description/:structure', - 'defaults' => [ - 'controller' => StructureController::class, - 'action' => 'description', - ], - ], - ], - 'modifier' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/modifier/:structure', - 'defaults' => [ - 'controller' => StructureController::class, - 'action' => 'modifier', - ], - ], - ], - 'historiser' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/historiser/:structure', - 'defaults' => [ - 'controller' => StructureController::class, - 'action' => 'historiser', - ], - ], - ], - 'restaurer' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/restaurer/:structure', - 'defaults' => [ - 'controller' => StructureController::class, - 'action' => 'restaurer', - ], - ], - ], - 'detruire' => [ - 'type' => Segment::class, - 'options' => [ - 'route' => '/detruire/:structure', - 'defaults' => [ - 'controller' => StructureController::class, - 'action' => 'detruire', - ], - ], - ], 'ajouter-gestionnaire' => [ 'type' => Segment::class, 'options' => [ @@ -138,15 +87,17 @@ return [ 'may_terminate' => true, 'child_routes' => [], ], - 'synchroniser' => [ - 'type' => Literal::class, + 'editer-description' => [ + 'type' => Segment::class, 'options' => [ - 'route' => '/synchroniser', + 'route' => '/editer-description/:structure', 'defaults' => [ 'controller' => StructureController::class, - 'action' => 'synchroniser', + 'action' => 'editer-description', ], ], + 'may_terminate' => true, + 'child_routes' => [], ], ], ], @@ -169,9 +120,9 @@ return [ ], ], 'hydrators' => [ - 'factories' => [ - StructureHydrator::class => StructureHydratorFactory::class, - ] + 'invokables' => [ + StructureHydrator::class => StructureHydrator::class, + ], ] ]; \ No newline at end of file diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index aff495c272c6ba294da2ef6933e478226d95c999..5bc9fb2bb0f4009208d2c5e79675b2f89095f1cd 100755 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -114,10 +114,10 @@ return [ 'public_files' => [ 'inline_scripts' => [ '100_' => 'js/jquery.ui.datepicker-fr.js', -// '110_' => 'https://gest.unicaen.fr/public/bootstrap-select-1.9.4/dist/js/bootstrap-select.min.js', - '111_' => 'https://gest.unicaen.fr/public/bootstrap-confirmation-2.4.0/bootstrap-confirmation.min.js', +// '111_' => 'https://gest.unicaen.fr/public/bootstrap-confirmation-2.4.0/bootstrap-confirmation.min.js', + '111_' => 'vendor/DataTables-1.10.18/datatables.min.js', '112_' => 'vendor/font-awesome-5.0.9/fontawesome-all.min.js', - '120_' => 'vendor/bootstrap-select-1.13.2/dist/js/bootstrap-select.min.js', + '114_' => 'vendor/bootstrap-select-1.13.2/dist/js/bootstrap-select.min.js', '124_' => 'vendor/vakata-jstree-3.3.4/dist/jstree.min.js', '150_' => 'js/tinymce/js/tinymce/tinymce.js', '151_' => 'js/form_fiche.js', @@ -125,8 +125,8 @@ return [ 'stylesheets' => [ '050_bootstrap-theme' => '', // '111_' => 'https://gest.unicaen.fr/public/open-sans-gh-pages/open-sans.css', -// '113_' => 'https://gest.unicaen.fr/public/bootstrap-select-1.9.4/dist/css/bootstrap-select.min.css', - '113_' => 'vendor/bootstrap-select-1.13.2/dist/css/bootstrap-select.min.css', + '111_' => 'vendor/DataTables-1.10.18/datatables.min.css', + '114_' => 'vendor/bootstrap-select-1.13.2/dist/css/bootstrap-select.min.css', '121_' => 'vendor/vakata-jstree-3.3.4/dist/themes/proton/style.min.css', ], 'images' => [ diff --git a/module/Application/src/Application/Controller/Agent/AgentController.php b/module/Application/src/Application/Controller/Agent/AgentController.php index b36ba1ec51878d30c3b32b643f98e702338d0759..8fb1ccc2381af99434f170e7c850f95534b8c2ff 100644 --- a/module/Application/src/Application/Controller/Agent/AgentController.php +++ b/module/Application/src/Application/Controller/Agent/AgentController.php @@ -2,11 +2,9 @@ namespace Application\Controller\Agent; -use Application\Entity\Db\Agent; -use Application\Form\Agent\AgentForm; use Application\Form\Agent\AgentFormAwareTrait; -use Application\Form\Agent\AgentImportFormAwareTrait; use Application\Service\Agent\AgentServiceAwareTrait; +use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Octopus\Entity\Db\Individu; use Octopus\Service\Individu\IndividuServiceAwareTrait; use Zend\Http\Request; @@ -19,9 +17,9 @@ class AgentController extends AbstractActionController /** Trait utilisés pour les services */ use AgentServiceAwareTrait; use IndividuServiceAwareTrait; - /** Trait utilisés pour les formulaires */ + use RessourceRhServiceAwareTrait; + /** Trait de formulaire */ use AgentFormAwareTrait; - use AgentImportFormAwareTrait; public function indexAction() { $agents = $this->getAgentService()->getAgents(); @@ -40,111 +38,32 @@ class AgentController extends AbstractActionController ]); } - public function ajouterAction() { - - /** @var Agent $agent */ - $agent = new Agent(); - - /** @var AgentForm $form */ - $form = $this->getAgentForm(); - $form->setAttribute('action', $this->url()->fromRoute('agent/ajouter', [], [], true)); - $form->bind($agent); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getAgentService()->create($agent); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/agent/modifier'); - $vm->setVariables([ - 'title' => 'Ajouter un agent', - 'form' => $form, - ]); - return $vm; - } - - public function modifierAction() { - - $agent = $this->getAgentService()->getRequestedAgent($this, 'id'); - - /** @var AgentForm $form */ + public function modifierAction() + { + $agent = $this->getAgentService()->getRequestedAgent($this, 'agent'); $form = $this->getAgentForm(); - $form->setAttribute('action', $this->url()->fromRoute('agent/modifier', ['id' => $agent->getId()], [], true)); + $form->setAttribute('action', $this->url()->fromRoute('agent/modifier', ['agent' => $agent->getId()], [], true)); $form->bind($agent); - /** @var Request $request */ + /** @var Request $request */ $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getAgentService()->update($agent); + $this->getAgentService()->update($agent); } } $vm = new ViewModel(); - $vm->setTemplate('application/agent/modifier'); + $vm->setTemplate('application/default/default-form'); $vm->setVariables([ - 'title' => 'Modifier un agent', + 'title' => 'Éditer l\'agent', 'form' => $form, ]); return $vm; } - public function supprimerAction() { - - $agent = $this->getAgentService()->getRequestedAgent($this, 'id'); - - $this->getAgentService()->delete($agent); - - return $this->redirect()->toRoute('agent', [], [], true); - } - - public function afficherStatutsAction() - { - $agent = $this->getAgentService()->getRequestedAgent($this, 'agent'); - $statuts = $agent->getStatuts(); - - return new ViewModel([ - 'title' => 'Statuts de l\'agent '.$agent->getDenomination(), - 'status' => $statuts, - ]); - } - - public function importerAction() - { - $form = $this->getAgentImportForm(); - $form->setAttribute('method','post'); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - var_dump($data); - $individu = $this->getIndividuService()->getIndividu($data['agent']['id']); - - var_dump($individu->getNomUsage()); - var_dump($individu->getPrenom()); - foreach ($individu->getAffectations() as $affectation) { - if ($affectation->getType()->getId() < 5) { - var_dump($affectation->getStructure()->getLibelleLong()); - var_dump($affectation->getDateDebut()->format('d/m/Y')); - if ($affectation->getDateFin()) var_dump($affectation->getDateFin()->format('d/m/Y')); - } - } - } - - return new ViewModel([ - 'form' => $form, - ]); - } - /** * @return JsonModel */ @@ -157,7 +76,7 @@ class AgentController extends AbstractActionController $result[] = array( 'id' => $individu->getCIndividuChaine(), 'label' => $individu->getPrenom()." ".(($individu->getNomUsage())?$individu->getNomUsage():$individu->getNomFamille()), - 'extra' => ($individu->getCSource())->__toString(), + 'extra' => $individu->getCSource()->__toString(), ); } usort($result, function($a, $b) { @@ -168,4 +87,6 @@ class AgentController extends AbstractActionController } exit; } + + } \ No newline at end of file diff --git a/module/Application/src/Application/Controller/Agent/AgentControllerFactory.php b/module/Application/src/Application/Controller/Agent/AgentControllerFactory.php index 21a50135bf1fb61fbcdc46c55987768aabd8ea70..21281833c01d0ef2263e8757cf1e5e0342073375 100644 --- a/module/Application/src/Application/Controller/Agent/AgentControllerFactory.php +++ b/module/Application/src/Application/Controller/Agent/AgentControllerFactory.php @@ -3,8 +3,8 @@ namespace Application\Controller\Agent; use Application\Form\Agent\AgentForm; -use Application\Form\Agent\AgentImportForm; use Application\Service\Agent\AgentService; +use Application\Service\RessourceRh\RessourceRhService; use Octopus\Service\Individu\IndividuService; use Zend\Mvc\Controller\ControllerManager; @@ -15,25 +15,25 @@ class AgentControllerFactory { /** * @var AgentService $agentService * @var IndividuService $individuService + * @var RessourceRhService $ressourceService */ $agentService = $manager->getServiceLocator()->get(AgentService::class); $individuService = $manager->getServiceLocator()->get(IndividuService::class); + $ressourceService = $manager->getServiceLocator()->get(RessourceRhService::class); /** * @var AgentForm $agentForm - * @var AgentImportForm $agentImportForm */ $agentForm = $manager->getServiceLocator()->get('FormElementManager')->get(AgentForm::class); - $agentImportForm = $manager->getServiceLocator()->get('FormElementManager')->get(AgentImportForm::class); /** @var AgentController $controller */ $controller = new AgentController(); $controller->setAgentService($agentService); $controller->setIndividuService($individuService); + $controller->setRessourceRhService($ressourceService); $controller->setAgentForm($agentForm); - $controller->setAgentImportForm($agentImportForm); return $controller; } diff --git a/module/Application/src/Application/Controller/AgentFichier/AgentFichierController.php b/module/Application/src/Application/Controller/AgentFichier/AgentFichierController.php index 4f27c565e4b2c4bf3b2067ae61d975d900ed8655..e9b8be3cb5a517e6adc4bed046ce57fca6c3f548 100644 --- a/module/Application/src/Application/Controller/AgentFichier/AgentFichierController.php +++ b/module/Application/src/Application/Controller/AgentFichier/AgentFichierController.php @@ -37,19 +37,19 @@ class AgentFichierController extends AbstractActionController { } } - /** @var Fichier $cv */ - $cv = $agent->fetchFile(Nature::CV); + /** @var Fichier[] $cv */ + $cvs = $agent->fetchFiles(Nature::CV); - /** @var Fichier $motiv */ - $motiv = $agent->fetchFile(Nature::MOTIV); + /** @var Fichier[] $motiv */ + $motivs = $agent->fetchFiles(Nature::MOTIV); /** @var Fichier[] $formations */ $formations = $agent->fetchFiles(Nature::FORMATION); return new ViewModel([ 'agent' => $agent, - 'cv' => $cv, - 'motiv' => $motiv, + 'cvs' => $cvs, + 'motivs' => $motivs, 'formations' => $formations, ]); } diff --git a/module/Application/src/Application/Controller/EntretienProfessionnel/EntretienProfessionnelController.php b/module/Application/src/Application/Controller/EntretienProfessionnel/EntretienProfessionnelController.php index 37d83d2c2461d55eb754b8629fe1fb6b4070697b..9c1a37fd85fa7b82b6941f15452f4cb6b00f6024 100644 --- a/module/Application/src/Application/Controller/EntretienProfessionnel/EntretienProfessionnelController.php +++ b/module/Application/src/Application/Controller/EntretienProfessionnel/EntretienProfessionnelController.php @@ -81,7 +81,7 @@ class EntretienProfessionnelController extends AbstractActionController { } $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); + //$vm->setTemplate('application/default/default-form'); $vm->setVariables([ 'title' => 'Création d\'un nouvel entretien professionnel', 'form' => $form, @@ -128,6 +128,4 @@ class EntretienProfessionnelController extends AbstractActionController { $this->getEntretienProfessionnelService()->delete($entretien); return $this->redirect()->toRoute('entretien-professionnel', [], [], true); } - - } \ No newline at end of file diff --git a/module/Application/src/Application/Controller/FicheMetier/FicheMetierTypeController.php b/module/Application/src/Application/Controller/FicheMetier/FicheMetierController.php similarity index 78% rename from module/Application/src/Application/Controller/FicheMetier/FicheMetierTypeController.php rename to module/Application/src/Application/Controller/FicheMetier/FicheMetierController.php index cf0cb39220ad4b83a699e6f00fbc47cca6a6d8e2..6282d425f8be88a4373968e61da6b27529b845cb 100644 --- a/module/Application/src/Application/Controller/FicheMetier/FicheMetierTypeController.php +++ b/module/Application/src/Application/Controller/FicheMetier/FicheMetierController.php @@ -3,31 +3,33 @@ namespace Application\Controller\FicheMetier; use Application\Entity\Db\Activite; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Application\Form\Activite\ActiviteFormAwareTrait; -use Application\Form\FicheMetierType\ActiviteExistanteForm; -use Application\Form\FicheMetierType\ActiviteExistanteFormAwareTrait; -use Application\Form\FicheMetierType\ApplicationsForm; -use Application\Form\FicheMetierType\ApplicationsFormAwareTrait; -use Application\Form\FicheMetierType\FormationBaseForm; -use Application\Form\FicheMetierType\FormationBaseFormAwareTrait; -use Application\Form\FicheMetierType\FormationComportementaleForm; -use Application\Form\FicheMetierType\FormationComportementaleFormAwareTrait; -use Application\Form\FicheMetierType\FormationOperationnelleForm; -use Application\Form\FicheMetierType\FormationOperationnelleFormAwareTrait; -use Application\Form\FicheMetierType\LibelleForm; -use Application\Form\FicheMetierType\LibelleFormAwareTrait; -use Application\Form\FicheMetierType\MissionsPrincipalesForm; -use Application\Form\FicheMetierType\MissionsPrincipalesFormAwareTrait; +use Application\Form\FicheMetier\ActiviteExistanteForm; +use Application\Form\FicheMetier\ActiviteExistanteFormAwareTrait; +use Application\Form\FicheMetier\ApplicationsForm; +use Application\Form\FicheMetier\ApplicationsFormAwareTrait; +use Application\Form\FicheMetier\FormationBaseForm; +use Application\Form\FicheMetier\FormationBaseFormAwareTrait; +use Application\Form\FicheMetier\FormationComportementaleForm; +use Application\Form\FicheMetier\FormationComportementaleFormAwareTrait; +use Application\Form\FicheMetier\FormationOperationnelleForm; +use Application\Form\FicheMetier\FormationOperationnelleFormAwareTrait; +use Application\Form\FicheMetier\LibelleForm; +use Application\Form\FicheMetier\LibelleFormAwareTrait; +use Application\Form\FicheMetier\MissionsPrincipalesForm; +use Application\Form\FicheMetier\MissionsPrincipalesFormAwareTrait; use Application\Service\Activite\ActiviteServiceAwareTrait; +use Application\Service\Export\FicheMetier\FicheMetierPdfExporter; use Application\Service\FicheMetier\FicheMetierServiceAwareTrait; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Zend\Form\Element\Select; use Zend\Http\Request; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; +use Zend\View\Renderer\PhpRenderer; -class FicheMetierTypeController extends AbstractActionController{ +class FicheMetierController extends AbstractActionController{ /** Traits associé aux services */ use ActiviteServiceAwareTrait; use FicheMetierServiceAwareTrait; @@ -44,16 +46,16 @@ class FicheMetierTypeController extends AbstractActionController{ public function indexAction() { - $fichesMetiersTypes = $this->getFicheMetierService()->getFichesMetiersTypes(); + $fichesMetiers = $this->getFicheMetierService()->getFichesMetiers(); return new ViewModel([ - 'fiches' => $fichesMetiersTypes, + 'fiches' => $fichesMetiers, ]); } public function afficherAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); return new ViewModel([ 'title' => 'Visualisation d\'une fiche métier', @@ -63,7 +65,8 @@ class FicheMetierTypeController extends AbstractActionController{ public function editerAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', false); + if ($fiche === null) $fiche = $this->getFicheMetierService()->getLastFicheMetier(); $activites = $this->getActiviteService()->getActivitesByFicheMetierType($fiche); return new ViewModel([ @@ -74,38 +77,37 @@ class FicheMetierTypeController extends AbstractActionController{ public function historiserAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); - $this->getFicheMetierService()->historiserFicheMetierType($fiche); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); + $this->getFicheMetierService()->historise($fiche); return $this->redirect()->toRoute('fiche-metier-type', [], [], true); } public function restaurerAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); - $this->getFicheMetierService()->restaurationFicheMetierType($fiche); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); + $this->getFicheMetierService()->restore($fiche); return $this->redirect()->toRoute('fiche-metier-type', [], [], true); } public function detruireAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); - $this->getFicheMetierService()->deleteFicheMetierType($fiche); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); + $this->getFicheMetierService()->delete($fiche); return $this->redirect()->toRoute('fiche-metier-type', [], [], true); } public function ajouterAction() { - /** @var FicheMetierType $fiche */ - $fiche = new FicheMetierType(); + /** @var FicheMetier $fiche */ + $fiche = new FicheMetier(); /** @var LibelleForm $form */ $form = $this->getLibelleForm(); $form->setAttribute('action', $this->url()->fromRoute('fiche-metier-type/ajouter', [], [] , true)); $form->bind($fiche); -// $familles = $this->getRessourceRhService()->getMetiersFamilles('libelle'); /** @var Request $request */ $request = $this->getRequest(); @@ -113,7 +115,7 @@ class FicheMetierTypeController extends AbstractActionController{ $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getFicheMetierService()->createFicheMetierType($fiche); + $this->getFicheMetierService()->create($fiche); } } @@ -121,8 +123,6 @@ class FicheMetierTypeController extends AbstractActionController{ $vm->setTemplate('application/default/default-form'); $vm->setVariables([ 'title' => 'Ajout d\'une fiche metier', -// 'familles' => $familles, -// 'metier' => $this->getRessourceRhService()->getMetier(11), 'form' => $form, ]); return $vm; @@ -131,7 +131,7 @@ class FicheMetierTypeController extends AbstractActionController{ public function editerLibelleAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); /** @var MissionsPrincipalesForm $form */ $form = $this->getLibelleForm(); @@ -144,7 +144,7 @@ class FicheMetierTypeController extends AbstractActionController{ $form->setData($data); if ($form->isValid()) { - $this->getFicheMetierService()->updateFicheMetierType($fiche); + $this->getFicheMetierService()->update($fiche); } } @@ -159,7 +159,7 @@ class FicheMetierTypeController extends AbstractActionController{ public function editerMissionsPrincipalesAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); /** @var MissionsPrincipalesForm $form */ $form = $this->getMissionsPrincipalesForm(); @@ -172,7 +172,7 @@ class FicheMetierTypeController extends AbstractActionController{ $form->setData($data); if ($form->isValid()) { - $this->getFicheMetierService()->updateFicheMetierType($fiche); + $this->getFicheMetierService()->update($fiche); } } @@ -187,7 +187,7 @@ class FicheMetierTypeController extends AbstractActionController{ public function ajouterNouvelleActiviteAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); $activite = new Activite(); /** @var MissionsPrincipalesForm $form */ @@ -218,7 +218,7 @@ class FicheMetierTypeController extends AbstractActionController{ public function ajouterActiviteExistanteAction() { - $fiche = $this->getFicheMetierService()->getRequestedFicheMetierType($this, 'id', true); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id', true); /** @var ActiviteExistanteForm $form */ $form = $this->getActiviteExistanteForm(); @@ -280,8 +280,7 @@ class FicheMetierTypeController extends AbstractActionController{ public function modifierConnaissancesAction() { - $ficheId = $this->params()->fromRoute('id'); - $fiche = $this->getFicheMetierService()->getFicheMetierType($ficheId); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id'); /** @var FormationBaseForm $form */ $form = $this->getFormationBaseForm(); @@ -294,7 +293,7 @@ class FicheMetierTypeController extends AbstractActionController{ $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getFicheMetierService()->updateFicheMetierType($fiche); + $this->getFicheMetierService()->update($fiche); } } @@ -305,10 +304,9 @@ class FicheMetierTypeController extends AbstractActionController{ ]); } - public function modifierOperationnelleAction() { - - $ficheId = $this->params()->fromRoute('id'); - $fiche = $this->getFicheMetierService()->getFicheMetierType($ficheId); + public function modifierOperationnelleAction() + { + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id'); /** @var FormationOperationnelleForm $form */ $form = $this->getFormationOperationnelleForm(); @@ -321,7 +319,7 @@ class FicheMetierTypeController extends AbstractActionController{ $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getFicheMetierService()->updateFicheMetierType($fiche); + $this->getFicheMetierService()->update($fiche); } } @@ -334,8 +332,7 @@ class FicheMetierTypeController extends AbstractActionController{ public function modifierComportementaleAction() { - $ficheId = $this->params()->fromRoute('id'); - $fiche = $this->getFicheMetierService()->getFicheMetierType($ficheId); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id'); /** @var FormationComportementaleForm $form */ $form = $this->getFormationComportementaleForm(); @@ -348,7 +345,7 @@ class FicheMetierTypeController extends AbstractActionController{ $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getFicheMetierService()->updateFicheMetierType($fiche); + $this->getFicheMetierService()->update($fiche); } } @@ -361,8 +358,7 @@ class FicheMetierTypeController extends AbstractActionController{ public function modifierApplicationAction() { - $ficheId = $this->params()->fromRoute('id'); - $fiche = $this->getFicheMetierService()->getFicheMetierType($ficheId); + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id'); /** @var ApplicationsForm $form */ $form = $this->getApplicationsForm(); @@ -375,7 +371,7 @@ class FicheMetierTypeController extends AbstractActionController{ $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getFicheMetierService()->updateFicheMetierType($fiche); + $this->getFicheMetierService()->update($fiche); } } @@ -385,4 +381,20 @@ class FicheMetierTypeController extends AbstractActionController{ 'form' => $form, ]); } + + /** Document pour la signature en présidence */ + public function exportAction() + { + $fiche = $this->getFicheMetierService()->getRequestedFicheMetier($this, 'id'); + + /* @var PhpRenderer $renderer */ + $renderer = $this->getServiceLocator()->get('view_renderer'); + + $exporter = new FicheMetierPdfExporter($renderer, 'A4'); + $exporter->setVars([ + 'fiche' => $fiche, + ]); + $exporter->export('export.pdf'); + exit; + } } \ No newline at end of file diff --git a/module/Application/src/Application/Controller/FicheMetier/FicheMetierTypeControllerFactory.php b/module/Application/src/Application/Controller/FicheMetier/FicheMetierControllerFactory.php similarity index 84% rename from module/Application/src/Application/Controller/FicheMetier/FicheMetierTypeControllerFactory.php rename to module/Application/src/Application/Controller/FicheMetier/FicheMetierControllerFactory.php index 59862d50f35d9cb9753ce73589c31fac72b45cee..be9993b7ebb0739af1bfec177bf78262fe0fcb36 100644 --- a/module/Application/src/Application/Controller/FicheMetier/FicheMetierTypeControllerFactory.php +++ b/module/Application/src/Application/Controller/FicheMetier/FicheMetierControllerFactory.php @@ -3,19 +3,19 @@ namespace Application\Controller\FicheMetier; use Application\Form\Activite\ActiviteForm; -use Application\Form\FicheMetierType\ActiviteExistanteForm; -use Application\Form\FicheMetierType\ApplicationsForm; -use Application\Form\FicheMetierType\FormationBaseForm; -use Application\Form\FicheMetierType\FormationComportementaleForm; -use Application\Form\FicheMetierType\FormationOperationnelleForm; -use Application\Form\FicheMetierType\LibelleForm; -use Application\Form\FicheMetierType\MissionsPrincipalesForm; +use Application\Form\FicheMetier\ActiviteExistanteForm; +use Application\Form\FicheMetier\ApplicationsForm; +use Application\Form\FicheMetier\FormationBaseForm; +use Application\Form\FicheMetier\FormationComportementaleForm; +use Application\Form\FicheMetier\FormationOperationnelleForm; +use Application\Form\FicheMetier\LibelleForm; +use Application\Form\FicheMetier\MissionsPrincipalesForm; use Application\Service\Activite\ActiviteService; use Application\Service\FicheMetier\FicheMetierService; use Application\Service\RessourceRh\RessourceRhService; use Zend\Mvc\Controller\ControllerManager; -class FicheMetierTypeControllerFactory { +class FicheMetierControllerFactory { public function __invoke(ControllerManager $manager) { @@ -48,8 +48,8 @@ class FicheMetierTypeControllerFactory { $missionsPrincipalesForm = $manager->getServiceLocator()->get('FormElementManager')->get(MissionsPrincipalesForm::class); - /** @var FicheMetierTypeController $controller */ - $controller = new FicheMetierTypeController(); + /** @var FicheMetierController $controller */ + $controller = new FicheMetierController(); $controller->setActiviteService($activiteService); $controller->setFicheMetierService($ficheMetierService); diff --git a/module/Application/src/Application/Controller/FichePoste/FichePosteController.php b/module/Application/src/Application/Controller/FichePoste/FichePosteController.php index 7c8aa7756d31139c29c4eedaab63668900b2ee39..db03f6f35d0f78f4bff02959efd75dcfeab15b16 100644 --- a/module/Application/src/Application/Controller/FichePoste/FichePosteController.php +++ b/module/Application/src/Application/Controller/FichePoste/FichePosteController.php @@ -2,7 +2,7 @@ namespace Application\Controller\FichePoste; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Application\Entity\Db\FichePoste; use Application\Entity\Db\FicheTypeExterne; use Application\Entity\Db\SpecificitePoste; @@ -14,10 +14,12 @@ use Application\Form\FichePosteCreation\FichePosteCreationFormAwareTrait; use Application\Form\SpecificitePoste\SpecificitePosteForm; use Application\Form\SpecificitePoste\SpecificitePosteFormAwareTrait; use Application\Service\Agent\AgentServiceAwareTrait; +use Application\Service\Export\FichePoste\FichePostePdfExporter; use Application\Service\FichePoste\FichePosteServiceAwareTrait; use Zend\Http\Request; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; +use Zend\View\Renderer\PhpRenderer; class FichePosteController extends AbstractActionController { /** Service **/ @@ -52,7 +54,7 @@ class FichePosteController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $fiche = $this->getFichePosteService()->create($fiche); + $this->getFichePosteService()->create($fiche); } } @@ -77,7 +79,8 @@ class FichePosteController extends AbstractActionController { public function editerAction() { - $fiche = $this->getFichePosteService()->getRequestedFichePoste($this, 'fiche-poste'); + $fiche = $this->getFichePosteService()->getRequestedFichePoste($this, 'fiche-poste', false); + if ($fiche === null) $fiche = $this->getFichePosteService()->getLastFichePoste(); return new ViewModel([ 'fiche' => $fiche, ]); @@ -182,21 +185,26 @@ class FichePosteController extends AbstractActionController { if ($request->isPost()) { $data = $request->getPost(); $form->setData($data); + + $res = $this->checkValidite($fiche, $data); + if ($res) return $res; + if ($form->isValid()) { $ficheTypeExterne->setFichePoste($fiche); $this->getFichePosteService()->createFicheTypeExterne($ficheTypeExterne); if ($ficheTypeExterne->getPrincipale()) { + var_dump('principale is 1'); foreach ($fiche->getFichesMetiers() as $ficheMetier) { if ($ficheMetier !== $ficheTypeExterne && $ficheMetier->getPrincipale()) { $ficheMetier->setPrincipale(false); - //$this->getFichePosteService()->updateFicheTypeExterne($ficheMetier); + $this->getFichePosteService()->updateFicheTypeExterne($ficheMetier); } } } //comportement par defaut (ajout de toutes les activités) - /** @var FicheMetierType */ + /** @var FicheMetier */ $activites = $ficheTypeExterne->getFicheType()->getActivites(); $tab = []; foreach ($activites as $activite) { @@ -205,7 +213,6 @@ class FichePosteController extends AbstractActionController { $text = implode(";",$tab); $ficheTypeExterne->setActivites($text); $this->getFichePosteService()->updateFicheTypeExterne($ficheTypeExterne); - } } @@ -218,17 +225,6 @@ class FichePosteController extends AbstractActionController { return $vm; } - public function retirerFicheMetierAction() - { - $fichePoste = $this->getFichePosteService()->getRequestedFichePoste($this, 'fiche-poste'); - $ficheTypeExterneId = $this->params()->fromRoute('fiche-type-externe'); - $ficheTypeExterne = $this->getFichePosteService()->getFicheTypeExterne($ficheTypeExterneId); - - if ($ficheTypeExterne && $fichePoste) $this->getFichePosteService()->deleteFicheTypeExterne($ficheTypeExterne); - - return $this->redirect()->toRoute('fiche-poste/editer',['fiche-poste' => $fichePoste->getId()], [], true); - } - public function modifierFicheMetierAction() { $fichePoste = $this->getFichePosteService()->getRequestedFichePoste($this, 'fiche-poste'); @@ -243,7 +239,12 @@ class FichePosteController extends AbstractActionController { $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); + $form->setData($data); + + $res = $this->checkValidite($fichePoste, $data); + if ($res) return $res; + if ($form->isValid()) { $ficheTypeExterne->setFichePoste($fichePoste); $this->getFichePosteService()->updateFicheTypeExterne($ficheTypeExterne); @@ -268,6 +269,16 @@ class FichePosteController extends AbstractActionController { return $vm; } + public function retirerFicheMetierAction() + { + $fichePoste = $this->getFichePosteService()->getRequestedFichePoste($this, 'fiche-poste'); + $ficheTypeExterneId = $this->params()->fromRoute('fiche-type-externe'); + $ficheTypeExterne = $this->getFichePosteService()->getFicheTypeExterne($ficheTypeExterneId); + + if ($ficheTypeExterne && $fichePoste) $this->getFichePosteService()->deleteFicheTypeExterne($ficheTypeExterne); + + return $this->redirect()->toRoute('fiche-poste/editer',['fiche-poste' => $fichePoste->getId()], [], true); + } public function selectionnerActiviteAction() { @@ -332,4 +343,45 @@ class FichePosteController extends AbstractActionController { ]); } + + /** + * @param FichePoste $fiche + * @param array $data + * @return ViewModel + */ + private function checkValidite($fiche, $data) + { + $cut = false; + if ($data['est_principale'] === "1" && $data['quotite'] < 50) { + $cut = true; + $this->flashMessenger()->addErrorMessage("La fichie métier principale doit avoir une quotité d'au moins 50%."); + } + if ($data['est_principale'] === "0" && $data['quotite'] >= 50) { + $cut = true; + $this->flashMessenger()->addErrorMessage("La fichie métier non principale doit avoir une quotité infiérieure à 50%."); + } + if ($fiche->getQuotiteTravaillee() + $data['quotite'] > 100) { + $cut = true; + $this->flashMessenger()->addErrorMessage("La somme des quotités travaillées ne peut dépasser 100%."); + } + if ($cut) { + return (new ViewModel(['title' => 'Informations saisies incorrectes']))->setTemplate('layout/flashMessage'); + } + } + + /** Document pour la signature en présidence */ + public function exportAction() + { + $fiche = $this->getFichePosteService()->getRequestedFichePoste($this, 'fiche-poste'); + + /* @var PhpRenderer $renderer */ + $renderer = $this->getServiceLocator()->get('view_renderer'); + + $exporter = new FichePostePdfExporter($renderer, 'A4'); + $exporter->setVars([ + 'fiche' => $fiche, + ]); + $exporter->export('export.pdf'); + exit; + } } \ No newline at end of file diff --git a/module/Application/src/Application/Controller/Fonction/FonctionController.php b/module/Application/src/Application/Controller/Fonction/FonctionController.php deleted file mode 100644 index c39eefdc0b0b4674906b08517a41386bde27aea0..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Controller/Fonction/FonctionController.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php - -namespace Application\Controller\Fonction; - -use Application\Entity\Db\Fonction; -use Application\Entity\Db\FonctionLibelle; -use Application\Entity\Db\Source; -use Application\Form\Fonction\FonctionFormAwareTrait; -use Application\Service\Fonction\FonctionServiceAwareTrait; -use Zend\Http\Request; -use Zend\Mvc\Controller\AbstractActionController; -use Zend\View\Model\ViewModel; - -class FonctionController extends AbstractActionController { - use FonctionServiceAwareTrait; - - use FonctionFormAwareTrait; - - public function indexAction() - { - $fonctions = $this->getFonctionService()->getFonctions(); - - return new ViewModel([ - 'fonctions' => $fonctions, - ]); - } - - public function creerAction() - { - $fonction = new Fonction(); - $form = $this->getFonctionForm(); - $form->setAttribute('action', $this->url()->fromRoute('fonction/creer', [], [], true)); - $form->bind($fonction); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - - $fonction->setSource(Source::Preecog); - $this->getFonctionService()->create($fonction); - { - $libelle = new FonctionLibelle(); - $libelle->setFonction($fonction); - $libelle->setLibelle(trim($data['libelle_masculin'])); - $libelle->setDefault('O'); - $libelle->setGenre('M'); - $this->getFonctionService()->createLibelle($libelle); - $fonction->addLibelle($libelle); - } - { - $libelle = new FonctionLibelle(); - $libelle->setFonction($fonction); - $libelle->setLibelle(trim($data['libelle_feminin'])); - $libelle->setDefault('O'); - $libelle->setGenre('F'); - $this->getFonctionService()->createLibelle($libelle); - $fonction->addLibelle($libelle); - } - - $this->getFonctionService()->update($fonction); - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Ajout d\'une fonction', - 'form' => $form, - ]); - return $vm; - } - - public function modifierAction() - { - $fonction = $this->getFonctionService()->getRequestedFontion($this, 'fonction'); - $form = $this->getFonctionForm(); - $form->setAttribute('action', $this->url()->fromRoute('fonction/modifier', ['fonction' => $fonction->getId()], [], true)); - $form->bind($fonction); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - { - $libelle = $fonction->getDefault('M'); - $libelle->setLibelle(trim($data['libelle_masculin'])); - $this->getFonctionService()->updateLibelle($libelle); - } - { - $libelle = $fonction->getDefault('F'); - $libelle->setLibelle(trim($data['libelle_feminin'])); - $this->getFonctionService()->updateLibelle($libelle); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Modification d\'une fonction', - 'form' => $form, - ]); - return $vm; - } - - public function afficherAction() - { - $fonction = $this->getFonctionService()->getRequestedFontion($this, 'fonction'); - return new ViewModel([ - 'title' => 'Visualisation d\'une fonction', - 'fonction' => $fonction, - ]); - } - - public function historiserAction() - { - $fonction = $this->getFonctionService()->getRequestedFontion($this, 'fonction'); - $this->getFonctionService()->historise($fonction); - return $this->redirect()->toRoute('fonction',[], [], true); - } - - public function restaurerAction() - { - $fonction = $this->getFonctionService()->getRequestedFontion($this, 'fonction'); - $this->getFonctionService()->restore($fonction); - return $this->redirect()->toRoute('fonction',[], [], true); - } - - public function detruireAction() - { - $fonction = $this->getFonctionService()->getRequestedFontion($this, 'fonction'); - $this->getFonctionService()->delete($fonction); - return $this->redirect()->toRoute('fonction',[], [], true); - } - - public function synchroniserAction() - { - $result = $this->getFonctionService()->synchroniseFromOctopus(); - return $this->redirect()->toRoute('fonction',[], [], true); - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Controller/Fonction/FonctionControllerFactory.php b/module/Application/src/Application/Controller/Fonction/FonctionControllerFactory.php deleted file mode 100644 index 6aba4d7280400a716afadfb4cf88ea553ef55765..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Controller/Fonction/FonctionControllerFactory.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Application\Controller\Fonction; - -use Application\Form\Fonction\FonctionForm; -use Application\Service\Fonction\FonctionService; -use Zend\Mvc\Controller\ControllerManager; - -class FonctionControllerFactory { - - public function __invoke(ControllerManager $manager) - { - /** @var FonctionService $fonctionService */ - $fonctionService = $manager->getServiceLocator()->get(FonctionService::class); - - /** @var FonctionForm $fonctionForm */ - $fonctionForm = $manager->getServiceLocator()->get('FormElementManager')->get(FonctionForm::class); - - /** @var FonctionController $controller */ - $controller = new FonctionController(); - $controller->setFonctionService($fonctionService); - $controller->setFonctionForm($fonctionForm); - return $controller; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Controller/Immobilier/ImmobilierController.php b/module/Application/src/Application/Controller/Immobilier/ImmobilierController.php new file mode 100644 index 0000000000000000000000000000000000000000..f850c16d6eb1688856918d8208ce71d8f56494d9 --- /dev/null +++ b/module/Application/src/Application/Controller/Immobilier/ImmobilierController.php @@ -0,0 +1,23 @@ +<?php + +namespace Application\Controller\Immobilier; + +use Application\Service\Immobilier\ImmobilierServiceAwareTrait; +use Zend\Mvc\Controller\AbstractActionController; +use Zend\View\Model\ViewModel; + +class ImmobilierController extends AbstractActionController { + use ImmobilierServiceAwareTrait; + + public function indexAction() + { + $sites = $this->getImmobilierService()->getSites(); + $batiments = $this->getImmobilierService()->getBatiments(); + + return new ViewModel([ + 'sites' => $sites, + 'batiments' => $batiments, + ]); + } + +} \ No newline at end of file diff --git a/module/Application/src/Application/Controller/Immobilier/ImmobilierControllerFactory.php b/module/Application/src/Application/Controller/Immobilier/ImmobilierControllerFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..9a57bddfb11842a2dda882cbf4cd19db1bcdfeaf --- /dev/null +++ b/module/Application/src/Application/Controller/Immobilier/ImmobilierControllerFactory.php @@ -0,0 +1,23 @@ +<?php + +namespace Application\Controller\Immobilier; + +use Application\Service\Immobilier\ImmobilierService; +use Zend\Mvc\Controller\ControllerManager; + +class ImmobilierControllerFactory { + + public function __invoke(ControllerManager $manager) + { + /** + * @var ImmobilierService $immobilierService + */ + $immobilierService = $manager->getServiceLocator()->get(ImmobilierService::class); + + /** @var ImmobilierController $controller */ + $controller = new ImmobilierController(); + $controller->setImmobilierService($immobilierService); + return $controller; + } + +} \ No newline at end of file diff --git a/module/Application/src/Application/Controller/IndexController.php b/module/Application/src/Application/Controller/IndexController.php index 1a3869c78e04da3a894d0fc479628fbcc2f0dce1..2924fda5017edc10f8003a31cd2dcd3a0f856832 100755 --- a/module/Application/src/Application/Controller/IndexController.php +++ b/module/Application/src/Application/Controller/IndexController.php @@ -26,6 +26,9 @@ class IndexController extends AbstractActionController public function indexAction() { + $identity = null; + $agent = null; + /** @var Role $connectedRole */ $connectedRole = $this->getUserService()->getConnectedRole(); @@ -40,17 +43,16 @@ class IndexController extends AbstractActionController } } - $identity = $this->getUserService()->getConnectedUser(); - if ($identity) { - } + if ($this->getUserService()->getServiceUserContext()->getLdapUser()) { + $supannId = ((int)$this->getUserService()->getServiceUserContext()->getLdapUser()->getSupannEmpId()); + $identity = $this->getUserService()->getConnectedUser(); - // !TODO bouger cela pour faire plus propre ... - $agent = $this->getAgentService()->getAgentByUser($identity); - if ($identity !== null && $agent === null) { - $people = $this->getServiceUserContext()->getLdapUser(); - if ($people->getSupannEmpId() !== null) { + // !TODO bouger cela pour faire plus propre ... + $agent = $this->getAgentService()->getAgentBySupannId($supannId); + if ($identity !== null && $agent !== null && $agent->getUtilisateur() === null) { + $agent->setUtilisateur($identity); + $this->getAgentService()->update($agent); $personnel = $this->getRoleService()->getRoleByCode(Role::PERSONNEL); - $this->getAgentService()->createFromLDAP($people, $identity); $this->getUserService()->addRole($identity, $personnel); return $this->redirect()->toRoute('home', [], [], true); } diff --git a/module/Application/src/Application/Controller/Poste/PosteController.php b/module/Application/src/Application/Controller/Poste/PosteController.php index 658b1fd843334856a78679507df7021dee0d9d03..6918e2389bb3f4de3608736ad3e4331a875f7ddc 100644 --- a/module/Application/src/Application/Controller/Poste/PosteController.php +++ b/module/Application/src/Application/Controller/Poste/PosteController.php @@ -6,17 +6,13 @@ use Application\Entity\Db\Poste; use Application\Form\Poste\PosteForm; use Application\Form\Poste\PosteFormAwareTrait; use Application\Service\Poste\PosteServiceAwareTrait; -use Octopus\Entity\Db\ImmobilierBatiment; -use Octopus\Service\Immobilier\ImmobilierServiceAwareTrait; use Zend\Http\Request; use Zend\Mvc\Controller\AbstractActionController; -use Zend\View\Model\JsonModel; use Zend\View\Model\ViewModel; class PosteController extends AbstractActionController { /** Trait utilisés pour les services */ use PosteServiceAwareTrait; - use ImmobilierServiceAwareTrait; /** Trait utilisés pour les formulaires */ use PosteFormAwareTrait; @@ -26,7 +22,6 @@ class PosteController extends AbstractActionController { return new ViewModel([ 'postes' => $postes, - 'immobilierService' => $this->getImmobiliserService(), ]); } @@ -112,28 +107,4 @@ class PosteController extends AbstractActionController { return $this->redirect()->toRoute('poste', [], [], true); } - - /** - * @return JsonModel - */ - public function rechercherBatimentAction() { - if (($term = $this->params()->fromQuery('term'))) { - $batiments = $this->getImmobiliserService()->getImmobilierBatimentsByTerm($term); - $result = []; - /** @var ImmobilierBatiment[] $batiments */ - foreach ($batiments as $batiment) { - $result[] = array( - 'id' => $batiment->getId(), - 'label' => $batiment->getLibelle(), - 'extra' => "<span class='badge' style='background-color: slategray;'>".$batiment->getSite()->getLibelle()."</span>", - ); - } - usort($result, function($a, $b) { - return strcmp($a['label'], $b['label']); - }); - - return new JsonModel($result); - } - exit; - } } \ No newline at end of file diff --git a/module/Application/src/Application/Controller/Poste/PosteControllerFactory.php b/module/Application/src/Application/Controller/Poste/PosteControllerFactory.php index 4ce74b8aa655c10dc55759777bab97653ba9c1b3..6c33b3f0b9f7f7b4269b48d925aa3ade030eb7cc 100644 --- a/module/Application/src/Application/Controller/Poste/PosteControllerFactory.php +++ b/module/Application/src/Application/Controller/Poste/PosteControllerFactory.php @@ -4,7 +4,6 @@ namespace Application\Controller\Poste; use Application\Form\Poste\PosteForm; use Application\Service\Poste\PosteService; -use Octopus\Service\Immobilier\ImmobilierService; use Zend\Mvc\Controller\ControllerManager; class PosteControllerFactory { @@ -13,10 +12,8 @@ class PosteControllerFactory { { /** * @var PosteService $posteService - * @var ImmobilierService $immobilierService */ $posteService = $manager->getServiceLocator()->get(PosteService::class); - $immobilierService = $manager->getServiceLocator()->get(ImmobilierService::class); /** * @var PosteForm $posteForm @@ -26,7 +23,6 @@ class PosteControllerFactory { /** @var PosteController $controller */ $controller = new PosteController(); $controller->setPosteService($posteService); - $controller->setImmobiliserService($immobilierService); $controller->setPosteForm($posteForm); return $controller; } diff --git a/module/Application/src/Application/Controller/RessourceRh/RessourceRhController.php b/module/Application/src/Application/Controller/RessourceRh/RessourceRhController.php index 9e784bf7f897f0c21b624d1084ecb1e1204caf11..46774b6b304010608decc29644cef450acbbf754 100644 --- a/module/Application/src/Application/Controller/RessourceRh/RessourceRhController.php +++ b/module/Application/src/Application/Controller/RessourceRh/RessourceRhController.php @@ -2,45 +2,45 @@ namespace Application\Controller\RessourceRh; -use Application\Entity\Db\AgentStatus; -use Application\Entity\Db\Corps; -use Application\Entity\Db\Correspondance; use Application\Entity\Db\Domaine; -use Application\Entity\Db\Fonction; -use Application\Entity\Db\Grade; use Application\Entity\Db\Metier; -use Application\Entity\Db\MetierFamille; -use Application\Form\RessourceRh\AgentStatusFormAwareTrait; -use Application\Form\RessourceRh\CorpsFormAwareTrait; -use Application\Form\RessourceRh\CorrespondanceFormAwareTrait; +use Application\Entity\Db\FamilleProfessionnelle; +use Application\Entity\Db\MissionSpecifique; +use Application\Form\MissionSpecifique\MissionSpecifiqueFormAwareTrait; use Application\Form\RessourceRh\DomaineForm; use Application\Form\RessourceRh\DomaineFormAwareTrait; -use Application\Form\RessourceRh\GradeForm; -use Application\Form\RessourceRh\GradeFormAwareTrait; -use Application\Form\RessourceRh\MetierFamilleForm; -use Application\Form\RessourceRh\MetierFamilleFormAwareTrait; +use Application\Form\RessourceRh\FonctionFormAwareTrait; +use Application\Form\RessourceRh\FamilleProfessionnelleForm; +use Application\Form\RessourceRh\FamilleProfessionnelleFormAwareTrait; use Application\Form\RessourceRh\MetierForm; use Application\Form\RessourceRh\MetierFormAwareTrait; -use Application\Form\RessourceRh\AgentStatusForm; -use Application\Form\RessourceRh\CorpsForm; -use Application\Form\RessourceRh\CorrespondanceForm; +use Application\Service\Domaine\DomaineServiceAwareTrait; +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleServiceAwareTrait; +use Application\Service\Fonction\FonctionServiceAwareTrait; +use Application\Service\Metier\MetierServiceAwareTrait; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; +use DateTime; +use UnicaenApp\View\Model\CsvModel; use Zend\Http\Request; use Zend\Mvc\Controller\AbstractActionController; -use Zend\View\Model\JsonModel; use Zend\View\Model\ViewModel; class RessourceRhController extends AbstractActionController { /** Trait utilisés pour les services */ use RessourceRhServiceAwareTrait; + + use DomaineServiceAwareTrait; + use FamilleProfessionnelleServiceAwareTrait; + use FonctionServiceAwareTrait; + use MetierServiceAwareTrait; + /** Trait utilisés pour les formulaires */ - use AgentStatusFormAwareTrait; - use CorpsFormAwareTrait; - use CorrespondanceFormAwareTrait; use DomaineFormAwareTrait; - use GradeFormAwareTrait; - use MetierFamilleFormAwareTrait; + use FamilleProfessionnelleFormAwareTrait; + use FonctionFormAwareTrait; use MetierFormAwareTrait; + use MissionSpecifiqueFormAwareTrait; + public function indexAction() { @@ -49,260 +49,52 @@ class RessourceRhController extends AbstractActionController { public function indexCorrespondanceAction() { - $correspondances = $this->getRessourceRhService()->getCorrespondances('libelle'); + $correspondances_on = $this->getRessourceRhService()->getCorrespondances(true); + $correspondances_off = $this->getRessourceRhService()->getCorrespondances(false); return new ViewModel([ - 'correspondances' => $correspondances, + 'correspondances_actives' => $correspondances_on, + 'correspondances_historisees' => $correspondances_off, ]); } - /** Sub part */ - public function indexCorpsGradeStatusAction() + public function indexGradeAction() { - $status = $this->getRessourceRhService()->getAgentStatusListe('libelle'); - $corps = $this->getRessourceRhService()->getCorpsListe('libelle'); - $grades = $this->getRessourceRhService()->getGrades(); + $grades_on = $this->getRessourceRhService()->getGrades(true); + $grades_off = $this->getRessourceRhService()->getGrades(false); return new ViewModel([ - 'status' => $status, - 'corps' => $corps, - 'grades' => $grades, + 'grades_actifs' => $grades_on, + 'grades_historises' => $grades_off, ]); } - public function indexMetierEtFamilleAction() + public function indexCorpsAction() { - $metiers = $this->getRessourceRhService()->getMetiers('libelle'); - $familles = $this->getRessourceRhService()->getMetiersFamilles('libelle'); + $corps_on = $this->getRessourceRhService()->getCorps(true); + $corps_off = $this->getRessourceRhService()->getCorps(false); return new ViewModel([ - 'metiers' => $metiers, - 'familles' => $familles, + 'corps_actifs' => $corps_on, + 'corps_historises' => $corps_off, ]); } - public function indexDomaineAction() + public function indexMetierFamilleDomaineAction() { - $domaines = $this->getRessourceRhService()->getDomaines('libelle'); + $familles = $this->getFamilleProfessionnelleService()->getFamillesProfessionnelles(); + $domaines = $this->getDomaineService()->getDomaines(); + $fonctions = $this->getFonctionService()->getFonctions(); + $metiers = $this->getMetierService()->getMetiers(); return new ViewModel([ + 'metiers' => $metiers, + 'familles' => $familles, + 'fonctions' => $fonctions, 'domaines' => $domaines, ]); } - /** AGENT STATUS **************************************************************************************************/ - - public function creerAgentStatusAction() - { - $status = new AgentStatus(); - - /** @var AgentStatusForm $form */ - $form = $this->getAgentStatusForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/agent-status/creer', [], [], true)); - $form->bind($status); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getRessourceRhService()->createAgentStatus($status); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Ajouter un nouveau status', - 'form' => $form, - ]); - return $vm; - } - - public function modifierAgentStatusAction() - { - $statusId = $this->params()->fromRoute('id'); - $status = $this->getRessourceRhService()->getAgentStatus($statusId); - - /** @var AgentStatusForm $form */ - $form = $this->getAgentStatusForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/agent-status/modifier', [], [], true)); - $form->bind($status); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getRessourceRhService()->updateAgentStatus($status); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Éditer un status', - 'form' => $form, - ]); - return $vm; - } - - public function effacerAgentStatusAction() - { - $statusId = $this->params()->fromRoute('id'); - $status = $this->getRessourceRhService()->getAgentStatus($statusId); - - if ($status !== null) { - $this->getRessourceRhService()->deleteAgentStatus($status); - } - - return $this->redirect()->toRoute('ressource-rh', [], [], true); - } - - /** CORRESPONDANCE ************************************************************************************************/ - - public function creerCorrespondanceAction() - { - $correspondance = new Correspondance(); - - /** @var CorrespondanceForm $form */ - $form = $this->getCorrespondanceForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/correspondance/creer', [], [], true)); - $form->bind($correspondance); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getRessourceRhService()->createCorrespondance($correspondance); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Ajouter une nouvelle catégorie', - 'form' => $form, - ]); - return $vm; - } - - public function modifierCorrespondanceAction() - { - $correspondanceId = $this->params()->fromRoute('id'); - $correspondance = $this->getRessourceRhService()->getCorrespondance($correspondanceId); - - /** @var CorrespondanceForm $form */ - $form = $this->getCorrespondanceForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/correspondance/modifier', [], [], true)); - $form->bind($correspondance); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getRessourceRhService()->updateCorrespondance($correspondance); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Éditer une catégorie', - 'form' => $form, - ]); - return $vm; - } - - public function effacerCorrespondanceAction() - { - $correspondanceId = $this->params()->fromRoute('id'); - $correspondance = $this->getRessourceRhService()->getCorrespondance($correspondanceId); - - if ($correspondance !== null) { - $this->getRessourceRhService()->deleteCorrespondance($correspondance); - } - - return $this->redirect()->toRoute('ressource-rh', [], [], true); - } - - /** CORPS *********************************************************************************************************/ - - public function creerCorpsAction() - { - $corps = new Corps(); - - /** @var CorpsForm $form */ - $form = $this->getCorpsForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/corps/creer', [], [], true)); - $form->bind($corps); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getRessourceRhService()->createCorps($corps); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Ajouter un nouveau corps', - 'form' => $form, - ]); - return $vm; - } - - public function modifierCorpsAction() - { - $corpsId = $this->params()->fromRoute('id'); - $corps = $this->getRessourceRhService()->getCorps($corpsId); - - /** @var CorpsForm $form */ - $form = $this->getCorpsForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/corps/modifier', [], [], true)); - $form->bind($corps); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getRessourceRhService()->updateCorps($corps); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => 'Éditer un corps', - 'form' => $form, - ]); - return $vm; - } - - public function effacerCorpsAction() - { - $corpsId = $this->params()->fromRoute('id'); - $corps = $this->getRessourceRhService()->getCorps($corpsId); - - if ($corps !== null) { - $this->getRessourceRhService()->deleteCorps($corps); - } - - return $this->redirect()->toRoute('ressource-rh', [], [], true); - } - /** METIER ********************************************************************************************************/ public function creerMetierAction() @@ -320,7 +112,7 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->createMetier($metier); + $this->getMetierService()->create($metier); } } @@ -335,8 +127,7 @@ class RessourceRhController extends AbstractActionController { public function modifierMetierAction() { - $metierId = $this->params()->fromRoute('id'); - $metier = $this->getRessourceRhService()->getMetier($metierId); + $metier = $this->getMetierService()->getRequestedMetier($this, 'id'); /** @var MetierForm $form */ $form = $this->getMetierForm(); @@ -349,7 +140,7 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->updateMetier($metier); + $this->getMetierService()->update($metier); } } @@ -364,24 +155,23 @@ class RessourceRhController extends AbstractActionController { public function effacerMetierAction() { - $metierId = $this->params()->fromRoute('id'); - $metier = $this->getRessourceRhService()->getMetier($metierId); + $metier = $this->getMetierService()->getRequestedMetier($this, 'id'); if ($metier !== null) { - $this->getRessourceRhService()->deleteMetier($metier); + $this->getMetierService()->delete($metier); } - return $this->redirect()->toRoute('ressource-rh', [], [], true); + return $this->redirect()->toRoute('ressource-rh/index-metier-famille-domaine', [], [], true); } - /** FAMILLE METIER ************************************************************************************************/ + /** FAMILLE PROFESSIONNELLE ***************************************************************************************/ public function creerFamilleAction() { - $famille = new MetierFamille(); + $famille = new FamilleProfessionnelle(); - /** @var MetierFamilleForm $form */ - $form = $this->getMetierFamilleForm(); + /** @var FamilleProfessionnelleForm $form */ + $form = $this->getFamilleProfessionnelleForm(); $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/famille/creer', [], [], true)); $form->bind($famille); @@ -391,7 +181,7 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->createMetierFamille($famille); + $this->getFamilleProfessionnelleService()->create($famille); } } @@ -406,11 +196,10 @@ class RessourceRhController extends AbstractActionController { public function modifierFamilleAction() { - $familleId = $this->params()->fromRoute('id'); - $famille = $this->getRessourceRhService()->getMetierFamille($familleId); + $famille = $this->getFamilleProfessionnelleService()->getRequestedFamilleProfessionnelle($this, 'id'); - /** @var MetierFamilleForm $form */ - $form = $this->getMetierFamilleForm(); + /** @var FamilleProfessionnelleForm $form */ + $form = $this->getFamilleProfessionnelleForm(); $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/famille/modifier', [], [], true)); $form->bind($famille); @@ -420,7 +209,7 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->updateMetierFamille($famille); + $this->getFamilleProfessionnelleService()->update($famille); } } @@ -435,14 +224,13 @@ class RessourceRhController extends AbstractActionController { public function effacerFamilleAction() { - $familleId = $this->params()->fromRoute('id'); - $famille = $this->getRessourceRhService()->getMetierFamille($familleId); + $famille = $this->getFamilleProfessionnelleService()->getRequestedFamilleProfessionnelle($this, 'id'); if ($famille !== null) { - $this->getRessourceRhService()->deleteMetierFamille($famille); + $this->getFamilleProfessionnelleService()->delete($famille); } - return $this->redirect()->toRoute('ressource-rh', [], [], true); + return $this->redirect()->toRoute('ressource-rh/index-metier-famille-domaine', [], [], true); } /** DOMAINE *******************************************************************************************************/ @@ -463,7 +251,7 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->createDomaine($domaine); + $this->getDomaineService()->create($domaine); } } @@ -478,9 +266,7 @@ class RessourceRhController extends AbstractActionController { public function modifierDomaineAction() { - /** @var Domaine $domaine */ - $domaineId = $this->params()->fromRoute('domaine'); - $domaine = $this->getRessourceRhService()->getDomaine($domaineId); + $domaine = $this->getDomaineService()->getRequestedDomaine($this, 'domaine'); /** @var DomaineForm $form */ $form = $this->getDomaineForm(); @@ -493,7 +279,7 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->updateDomaine($domaine); + $this->getDomaineService()->update($domaine); } } @@ -508,28 +294,25 @@ class RessourceRhController extends AbstractActionController { public function supprimerDomaineAction() { - /** @var Domaine $domaine */ - $domaineId = $this->params()->fromRoute('domaine'); - $domaine = $this->getRessourceRhService()->getDomaine($domaineId); + $domaine = $this->getDomaineService()->getRequestedDomaine($this, 'domaine'); if ($domaine !== null) { - $this->getRessourceRhService()->deleteDomaine($domaine); + $this->getDomaineService()->delete($domaine); } - return $this->redirect()->toRoute('ressource-rh', [], [], true); + return $this->redirect()->toRoute('ressource-rh/index-metier-famille-domaine', [], [], true); } - /** Grade ******************************************************************************************************/ + /** Fonction ***************************************************************************************************/ - public function ajouterGradeAction() + public function modifierFonctionAction() { - /** @var Grade $grade */ - $grade = new Grade(); + $fonction = $this->getFonctionService()->getRequestedFonction($this, 'fonction'); - /** @var GradeForm $form */ - $form = $this->getGradeForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/grade/ajouter', [], [], true)); - $form->bind($grade); + /** @var DomaineForm $form */ + $form = $this->getFonctionForm(); + $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/fonction/modifier', ['fonction' => $fonction->getId()], [], true)); + $form->bind($fonction); /** @var Request $request */ $request = $this->getRequest(); @@ -537,29 +320,36 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->createGrade($grade); + $this->getFonctionService()->update($fonction); } } $vm = new ViewModel(); $vm->setTemplate('application/default/default-form'); $vm->setVariables([ - 'title' => 'Ajouter un grade', + 'title' => 'Modifier un domaine', 'form' => $form, ]); return $vm; } - public function modifierGradeAction() + /** MISSION SPECIFIQUE ********************************************************************************************/ + + public function indexMissionSpecifiqueAction() { - /** @var Grade $grade */ - $gradeId = $this->params()->fromRoute('grade'); - $grade = $this->getRessourceRhService()->getGrade($gradeId); + $missions = $this->getRessourceRhService()->getMissionsSpecifiques(); - /** @var GradeForm $form */ - $form = $this->getGradeForm(); - $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/grade/modifier', ['grade' => $grade->getId()], [], true)); - $form->bind($grade); + return new ViewModel([ + 'missions' => $missions, + ]); + } + + public function ajouterMissionSpecifiqueAction() + { + $mission = new MissionSpecifique(); + $form = $this->getMissionSpecifiqueForm(); + $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/mission-specifique/ajouter', [], [], true)); + $form->bind($mission); /** @var Request $request */ $request = $this->getRequest(); @@ -567,48 +357,136 @@ class RessourceRhController extends AbstractActionController { $data = $request->getPost(); $form->setData($data); if ($form->isValid()) { - $this->getRessourceRhService()->updateGrade($grade); + $this->getRessourceRhService()->createMissionSpecifique($mission); } } $vm = new ViewModel(); $vm->setTemplate('application/default/default-form'); $vm->setVariables([ - 'title' => 'Modifier un grade', - 'form' => $form, + 'title' => 'Ajouter une mission spécifique', + 'form' => $form, ]); + return $vm; } - public function supprimerGradeAction() + public function modifierMissionSpecifiqueAction() { - /** @var Grade $grade */ - $gradeId = $this->params()->fromRoute('grade'); - $grade = $this->getRessourceRhService()->getGrade($gradeId); + $mission = $this->getRessourceRhService()->getRequestedMissionSpecifique($this, 'mission'); + $form = $this->getMissionSpecifiqueForm(); + $form->setAttribute('action', $this->url()->fromRoute('ressource-rh/mission-specifique/modifier', ['mission' => $mission->getId()], [], true)); + $form->bind($mission); - if ($grade !== null) { - $this->getRessourceRhService()->deleteGrade($grade); + /** @var Request $request */ + $request = $this->getRequest(); + if ($request->isPost()) { + $data = $request->getPost(); + $form->setData($data); + if ($form->isValid()) { + $this->getRessourceRhService()->updateMissionSpecifique($mission); + } } - return $this->redirect()->toRoute('ressource-rh', [], [], true); + $vm = new ViewModel(); + $vm->setTemplate('application/default/default-form'); + $vm->setVariables([ + 'title' => 'Modifier une mission spécifique', + 'form' => $form, + ]); + + return $vm; } - public function getGradesJsonAction() + public function historiserMissionSpecifiqueAction() { - $grades = $this->getRessourceRhService()->getGrades(); - - $result = []; - foreach ($grades as $grade) { - $result[$grade->getId()] = [ - 'id' => $grade->getId(), - 'corps' => $grade->getCorps()->getId(), - 'libelle' => $grade->getLibelle(), + $mission = $this->getRessourceRhService()->getRequestedMissionSpecifique($this, 'mission'); + $this->getRessourceRhService()->historiseMissionSpecifique($mission); + return $this->redirect()->toRoute('ressource-rh/index-mission-specifique', [], [], true); + } + + public function restaurerMissionSpecifiqueAction() { + $mission = $this->getRessourceRhService()->getRequestedMissionSpecifique($this, 'mission'); + $this->getRessourceRhService()->restoreMissionSpecifique($mission); + return $this->redirect()->toRoute('ressource-rh/index-mission-specifique', [], [], true); + } + + public function supprimerMissionSpecifiqueAction() { + $mission = $this->getRessourceRhService()->getRequestedMissionSpecifique($this, 'mission'); + $this->getRessourceRhService()->deleteMissionSpecifique($mission); + return $this->redirect()->toRoute('ressource-rh/index-mission-specifique', [], [], true); + } + + + public function cartographieAction() { + $metiers = $this->getMetierService()->getMetiers(); + + $results = []; + foreach($metiers as $metier) { + $fonction = $metier->getFonction(); + $domaine = $metier->getDomaine(); + $famille = ($domaine)?$domaine->getFamille():null; + $entry = [ + 'famille' => ($famille)?$famille->__toString():"---", + 'fonction' => ($fonction)?$fonction:"---", + 'domaine' => ($domaine)?$domaine->__toString():"---", + 'metier' => ($metier)?$metier->__toString():"---", + 'nbFiche' => count($metier->getFichesMetiers()), + ]; + $results[] = $entry; + } + + usort($results, function($a, $b) { + if ($a['famille'] !== $b['famille']) return $a['famille'] < $b['famille']; + if ($a['fonction'] !== $b['fonction']) return $a['fonction'] < $b['fonction']; + if ($a['domaine'] !== $b['domaine']) return $a['domaine'] < $b['domaine']; + return $a['metier'] < $b['metier']; + }); + + return new ViewModel([ + 'results' => $results, + ]); + } + + public function exportCartographieAction() { + $metiers = $this->getMetierService()->getMetiers(); + + $results = []; + foreach($metiers as $metier) { + $fonction = $metier->getFonction(); + $domaine = ($metier)?$metier->getDomaine():null; + $famille = ($domaine)?$domaine->getFamille():null; + $entry = [ + 'famille' => ($famille)?$famille->__toString():"---", + 'domaine' => ($domaine)?$domaine->__toString():"---", + 'fonction' => ($fonction)?:"---", + 'metier' => ($metier)?$metier->__toString():"---", + 'nbFiche' => count($metier->getFichesMetiers()), ]; + $results[] = $entry; } - $jm = new JsonModel( - $result - ); - return $jm; + + usort($results, function($a, $b) { + if ($a['famille'] !== $b['famille']) return $a['famille'] < $b['famille']; + if ($a['domaine'] !== $b['domaine']) return $a['domaine'] < $b['domaine']; + if ($a['fonction'] !== $b['fonction']) return $a['fonction'] < $b['fonction']; + return $a['metier'] < $b['metier']; + }); + + $headers = ['Famille', 'Domaine', 'Fonction', 'Metier', '#Fiche']; + + $today = new DateTime(); + + $result = new CsvModel(); + $result->setDelimiter(';'); + $result->setEnclosure('"'); + $result->setHeader($headers); + $result->setData($results); + $result->setFilename('cartographie_metier_'.$today->format('Ymd-His').'.csv'); + + return $result; } + + } \ No newline at end of file diff --git a/module/Application/src/Application/Controller/RessourceRh/RessourceRhControllerFactory.php b/module/Application/src/Application/Controller/RessourceRh/RessourceRhControllerFactory.php index d334e4313e4fb0a5dfbe35d48bb87a3cb06115c2..7cf4c14a809f89efd338a5bd1bad9ebc85ad8dae 100644 --- a/module/Application/src/Application/Controller/RessourceRh/RessourceRhControllerFactory.php +++ b/module/Application/src/Application/Controller/RessourceRh/RessourceRhControllerFactory.php @@ -2,13 +2,18 @@ namespace Application\Controller\RessourceRh; -use Application\Form\RessourceRh\AgentStatusForm; +use Application\Form\MissionSpecifique\MissionSpecifiqueForm; use Application\Form\RessourceRh\CorpsForm; use Application\Form\RessourceRh\CorrespondanceForm; use Application\Form\RessourceRh\DomaineForm; +use Application\Form\RessourceRh\FonctionForm; use Application\Form\RessourceRh\GradeForm; -use Application\Form\RessourceRh\MetierFamilleForm; +use Application\Form\RessourceRh\FamilleProfessionnelleForm; use Application\Form\RessourceRh\MetierForm; +use Application\Service\Domaine\DomaineService; +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleService; +use Application\Service\Fonction\FonctionService; +use Application\Service\Metier\MetierService; use Application\Service\RessourceRh\RessourceRhService; use Zend\Mvc\Controller\ControllerManager; @@ -18,38 +23,48 @@ class RessourceRhControllerFactory { { /** * @var RessourceRhService $ressourceService + * + * @var DomaineService $domaineService + * @var FamilleProfessionnelleService $familleService + * @var FonctionService $fonctionService + * @var MetierService $metierService */ $ressourceService = $manager->getServiceLocator()->get(RessourceRhService::class); + $domaineService = $manager->getServiceLocator()->get(DomaineService::class); + $familleService = $manager->getServiceLocator()->get(FamilleProfessionnelleService::class); + $fonctionService = $manager->getServiceLocator()->get(FonctionService::class); + $metierService = $manager->getServiceLocator()->get(MetierService::class); /** - * @var AgentStatusForm $agentStatusForm - * @var CorpsForm $corpsForm - * @var CorrespondanceForm $correspondanceForm * @var DomaineForm $domaineForm - * @var GradeForm $gradeForm - * @var MetierFamilleForm $metierFamilleForm + * @var FamilleProfessionnelleForm $familleForm + * @var FonctionForm $fonctionForm * @var MetierForm $metierForm + * @var MissionSpecifiqueForm $missionSpecifiqueForm */ - $agentStatusForm = $manager->getServiceLocator()->get('FormElementManager')->get(AgentStatusForm::class); - $corpsForm = $manager->getServiceLocator()->get('FormElementManager')->get(CorpsForm::class); - $correspondanceForm = $manager->getServiceLocator()->get('FormElementManager')->get(CorrespondanceForm::class); - $domaineForm = $manager->getServiceLocator()->get('FormElementManager')->get(DomaineForm::class); - $gradeForm = $manager->getServiceLocator()->get('FormElementManager')->get(GradeForm::class); - $metierFamilleForm = $manager->getServiceLocator()->get('FormElementManager')->get(MetierFamilleForm::class); - $metierForm = $manager->getServiceLocator()->get('FormElementManager')->get(MetierForm::class); + $missionSpecifiqueForm = $manager->getServiceLocator()->get('FormElementManager')->get(MissionSpecifiqueForm::class); + + $familleForm = $manager->getServiceLocator()->get('FormElementManager')->get(FamilleProfessionnelleForm::class); + $fonctionForm = $manager->getServiceLocator()->get('FormElementManager')->get(FonctionForm::class); + $domaineForm = $manager->getServiceLocator()->get('FormElementManager')->get(DomaineForm::class); + $metierForm = $manager->getServiceLocator()->get('FormElementManager')->get(MetierForm::class); + /** @var RessourceRhController $controller */ $controller = new RessourceRhController(); $controller->setRessourceRhService($ressourceService); + $controller->setDomaineService($domaineService); + $controller->setFamilleProfessionnelleService($familleService); + $controller->setFonctionService($fonctionService); + $controller->setMetierService($metierService); - $controller->setAgentStatusForm($agentStatusForm); - $controller->setCorpsForm($corpsForm); - $controller->setCorrespondanceForm($correspondanceForm); + $controller->setMissionSpecifiqueForm($missionSpecifiqueForm); + $controller->setFamilleProfessionnelleForm($familleForm); + $controller->setFonctionForm($fonctionForm); $controller->setDomaineForm($domaineForm); - $controller->setGradeForm($gradeForm); - $controller->setMetierFamilleForm($metierFamilleForm); $controller->setMetierForm($metierForm); + return $controller; } diff --git a/module/Application/src/Application/Controller/Structure/StructureController.php b/module/Application/src/Application/Controller/Structure/StructureController.php index c2f302b40a87aa428a6651b98c357999f0b2ca0e..20cf5f3f6d1aa3be36f7b18461a95ae7133b04c0 100644 --- a/module/Application/src/Application/Controller/Structure/StructureController.php +++ b/module/Application/src/Application/Controller/Structure/StructureController.php @@ -2,7 +2,6 @@ namespace Application\Controller\Structure; -use Application\Entity\Db\Structure; use Application\Form\Structure\StructureFormAwareTrait; use Application\Service\Structure\StructureServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; @@ -17,115 +16,23 @@ use Zend\View\Model\ViewModel; class StructureController extends AbstractActionController { use RoleServiceAwareTrait; use StructureServiceAwareTrait; - use StructureFormAwareTrait; use UserServiceAwareTrait; + use StructureFormAwareTrait; + public function indexAction() { - $structures = $this->getStructureService()->getStructuresOuvertes(); + $structures = $this->getStructureService()->getStructures(); + $user = $this->getUserService()->getConnectedUser(); + $role = $this->getUserService()->getConnectedRole(); return new ViewModel([ 'structures' => $structures, + 'user' => $user, + 'role' => $role, ]); } - public function creerAction() - { - $structure = new Structure(); - $form = $this->getStructureForm(); - $form->setAttribute('action', $this->url()->fromRoute('structure/creer',[],[],true)); - $form->bind($structure); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $structure->setSource("PrEECoG"); - $this->getStructureService()->create($structure); - return $this->redirect()->toRoute('structure', [], [], true); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => "Ajouter une structure", - 'form' => $form, - ]); - return $vm; - } - - public function modifierAction() - { - $structure = $this->getStructureService()->getRequestedStructure($this, 'structure'); - $form = $this->getStructureForm(); - $form->setAttribute('action', $this->url()->fromRoute('structure/modifier',['structure' => $structure->getId()],[],true)); - $form->bind($structure); - - /** @var Request $request */ - $request = $this->getRequest(); - if ($request->isPost()) { - $data = $request->getPost(); - $form->setData($data); - if ($form->isValid()) { - $this->getStructureService()->update($structure); - return $this->redirect()->toRoute('structure', [], [], true); - } - } - - $vm = new ViewModel(); - $vm->setTemplate('application/default/default-form'); - $vm->setVariables([ - 'title' => "Modifier une structure", - 'form' => $form, - ]); - return $vm; - } - - public function descriptionAction() - { - $structure = $this->getStructureService()->getRequestedStructure($this, 'structure'); - - return new ViewModel([ - 'title' => "Description de la structure <strong>". $structure->getLibelleCourt()."</strong>", - 'description' => $structure->getDescription(), - ]); - } - - public function historiserAction() - { - $structure = $this->getStructureService()->getRequestedStructure($this, 'structure'); - $this->getStructureService()->historise($structure); - return $this->redirect()->toRoute('structure',[], [], true); - } - - public function restaurerAction() - { - $structure = $this->getStructureService()->getRequestedStructure($this, 'structure'); - $this->getStructureService()->restore($structure); - return $this->redirect()->toRoute('structure',[], [], true); - } - - public function detruireAction() - { - $structure = $this->getStructureService()->getRequestedStructure($this, 'structure'); - $this->getStructureService()->delete($structure); - return $this->redirect()->toRoute('structure',[], [], true); - } - - public function synchroniserAction() - { - $result = $this->getStructureService()->synchroniseFromOctopus(); - return $this->redirect()->toRoute('structure',[], [], true); - } - - public function synchroniserCronAction() - { - //TODO !!! - $result = $this->getStructureService()->synchroniseFromOctopus(); - } public function ajouterGestionnaireAction() { @@ -138,8 +45,7 @@ class StructureController extends AbstractActionController { $data = $request->getPost(); $gestionnaire = $this->getUserService()->getUtilisateur($data['gestionnaire']); if ($gestionnaire) { - $structure->addGestionnaire($gestionnaire); - $this->getStructureService()->update($structure); + $this->getStructureService()->addGestionnaire($structure, $gestionnaire); } } else { /** @var User[] $gestionnaires */ @@ -170,8 +76,7 @@ class StructureController extends AbstractActionController { $data = $request->getPost(); $gestionnaire = $this->getUserService()->getUtilisateur($data['gestionnaire']); if ($gestionnaire) { - $structure->removeGestionnaire($gestionnaire); - $this->getStructureService()->update($structure); + $this->getStructureService()->removeGestionnaire($structure, $gestionnaire); } } else { /** @var User[] $gestionnaires */ @@ -190,4 +95,31 @@ class StructureController extends AbstractActionController { exit; } + public function editerDescriptionAction() + { + $structure = $this->getStructureService()->getRequestedStructure($this, 'structure'); + + $form = $this->getStructureForm(); + $form->setAttribute('action', $this->url()->fromRoute('structure/editer-description', ['structure' => $structure->getId()], [] , true)); + $form->bind($structure); + + /** @var Request $request */ + $request = $this->getRequest(); + if ($request->isPost()) { + $data = $request->getPost(); + $form->setData($data); + if ($form->isValid()) { + $this->getStructureService()->update($structure); + } + } + + $vm = new ViewModel(); + $vm->setTemplate('application/default/default-form'); + $vm->setVariables([ + 'title' => 'Édition de la description de la structure', + 'form' => $form, + ]); + return $vm; + } + } \ No newline at end of file diff --git a/module/Application/src/Application/Controller/Structure/StructureControllerFactory.php b/module/Application/src/Application/Controller/Structure/StructureControllerFactory.php index a717f1801b1e4578b2fad9fb535b0b604e00f0cc..22670b0d26c02b0eb3a8364d4d91e0ad9d9cc09b 100644 --- a/module/Application/src/Application/Controller/Structure/StructureControllerFactory.php +++ b/module/Application/src/Application/Controller/Structure/StructureControllerFactory.php @@ -21,16 +21,17 @@ class StructureControllerFactory { $structureService = $manager->getServiceLocator()->get(StructureService::class); $userService = $manager->getServiceLocator()->get(UserService::class); - - /** @var StructureForm $structureForm */ + /** + * @var StructureForm $structureForm + */ $structureForm = $manager->getServiceLocator()->get('FormElementManager')->get(StructureForm::class); /** @var StructureController $controller */ $controller = new StructureController(); $controller->setRoleService($roleService); $controller->setStructureService($structureService); - $controller->setStructureForm($structureForm); $controller->setUserService($userService); + $controller->setStructureForm($structureForm); return $controller; } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Activite.php b/module/Application/src/Application/Entity/Db/Activite.php index 723c6a4d72a72ac81df6b4c765d4ed52b0a78644..a9f2d9bb51ec270fd717e47e8ce6bc85c56a8d1e 100644 --- a/module/Application/src/Application/Entity/Db/Activite.php +++ b/module/Application/src/Application/Entity/Db/Activite.php @@ -2,6 +2,7 @@ namespace Application\Entity\Db; +use Doctrine\Common\Collections\ArrayCollection; use UnicaenApp\Entity\HistoriqueAwareTrait; class Activite @@ -14,7 +15,13 @@ class Activite private $libelle; /** @var string */ private $description; + /** @var ArrayCollection */ + private $applications; + public function __construct() + { + $this->applications = new ArrayCollection(); + } /** * @return int */ @@ -59,5 +66,41 @@ class Activite return $this; } + /** + * @return Application[] + */ + public function getApplications() + { + return $this->applications->toArray(); + } + + /** + * @param Application $application + * @return Activite + */ + public function addApplication($application) + { + $this->applications->add($application); + return $this; + } + + /** + * @param Application $application + * @return Activite + */ + public function removeApplication($application) + { + $this->applications->removeElement($application); + return $this; + } + + /** + * @param Application $application + * @return boolean + */ + public function hasApplication($application) + { + return $this->applications->contains($application); + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Agent.php b/module/Application/src/Application/Entity/Db/Agent.php index 3cce0499507c782884ff7b86fb9f7c77a2d60463..602d59705f62b94a4b01cbec583ac91f22d6e541 100644 --- a/module/Application/src/Application/Entity/Db/Agent.php +++ b/module/Application/src/Application/Entity/Db/Agent.php @@ -2,56 +2,51 @@ namespace Application\Entity\Db; -use DateTime; +use Application\Service\Agent\AgentServiceAwareTrait; use Doctrine\Common\Collections\ArrayCollection; use Fichier\Entity\Db\Fichier; -use UnicaenApp\Exception\RuntimeException; use Utilisateur\Entity\Db\User; class Agent { + use ImportableAwareTrait; + use AgentServiceAwareTrait; - /** @var integer */ + /** @var string */ private $id; /** @var string */ - private $nom; + private $sourceName; + /** @var integer */ + private $sourceId; /** @var string */ private $prenom; /** @var string */ - private $numeroPoste; - - // categorie, corps, et grade (devrait correspondre à des infos en bases pour une meilleures structuration ... - - /** @var DateTime */ - private $dateDebut; - /** @var DateTime */ - private $dateFin; - /** @var integer */ + private $nomUsuel; + /** @var User */ + private $utilisateur; + /** @var int */ private $quotite; - /** @var AgentStatus */ - private $status; - /** @var ArrayCollection (AgentStatut)*/ - private $statuts; + /** @var Correspondance */ private $correspondance; - /** @var Corps */ - private $corps; /** @var Grade */ private $grade; - /** @var User */ - private $utilisateur; - - - /** @var string */ - private $missionsComplementaires; + /** @var Corps */ + private $corps; - /** @var ArrayCollection */ + /** @var ArrayCollection (AgentStatut)*/ + private $statuts; + /** @var ArrayCollection (MissionSpecifique) */ + private $missions; + /** @var ArrayCollection (Fichier) */ private $fichiers; public function __construct() { - $this->statuts = new ArrayCollection(); + $this->statuts = new ArrayCollection(); + $this->missions = new ArrayCollection(); $this->fichiers = new ArrayCollection(); } + /** * @return int */ @@ -63,141 +58,116 @@ class Agent { /** * @return string */ - public function getNom() + public function getSourceName() { - return $this->nom; + return $this->sourceName; } /** - * @param string $nom + * @param string $sourceName * @return Agent */ - public function setNom($nom) + public function setSourceName($sourceName) { - $this->nom = $nom; + $this->sourceName = $sourceName; return $this; } /** - * @return string + * @return int */ - public function getPrenom() + public function getSourceId() { - return $this->prenom; + return $this->sourceId; } /** - * @param string $prenom + * @param int $sourceId * @return Agent */ - public function setPrenom($prenom) + public function setSourceId($sourceId) { - $this->prenom = $prenom; + $this->sourceId = $sourceId; return $this; } - public function getDenomination() - { - return $this->getPrenom().' '.$this->getNom(); - - } /** - * @return DateTime + * @return string */ - public function getDateDebut() + public function getPrenom() { - return $this->dateDebut; + return $this->prenom; } /** - * @param DateTime $dateDebut + * @param string $prenom * @return Agent */ - public function setDateDebut($dateDebut) + public function setPrenom($prenom) { - $this->dateDebut = $dateDebut; + $this->prenom = $prenom; return $this; } /** - * @return DateTime + * @return string */ - public function getDateFin() + public function getNomUsuel() { - return $this->dateFin; + return $this->nomUsuel; } /** - * @param DateTime $dateFin + * @param string $nomUsuel * @return Agent */ - public function setDateFin($dateFin) + public function setNomUsuel($nomUsuel) { - $this->dateFin = $dateFin; + $this->nomUsuel = $nomUsuel; return $this; } /** - * @return int + * @return string */ - public function getQuotite() + public function getDenomination() { - return $this->quotite; - } + return $this->getPrenom().' '.$this->getNomUsuel(); - /** - * @param int $quotite - * @return Agent - */ - public function setQuotite($quotite) - { - $this->quotite = $quotite; - return $this; } - /** - * @return AgentStatus + * @return User */ - public function getStatus() + public function getUtilisateur() { - return $this->status; + return $this->utilisateur; } /** - * @param AgentStatus $status + * @param User $utilisateur * @return Agent */ - public function setStatus($status) + public function setUtilisateur($utilisateur) { - $this->status = $status; + $this->utilisateur = $utilisateur; return $this; } /** - * @return AgentStatut[] - */ - public function getStatuts() - { - return $this->statuts->toArray(); - } - - /** - * @param AgentStatut $statut - * @return Agent + * @return int */ - public function addStatut($statut) + public function getQuotite() { - $this->statuts->add($statut); - return $this; + return $this->quotite; } /** - * @param AgentStatut $statut + * @param int $quotite * @return Agent */ - public function removeStatut($statut) + public function setQuotite($quotite) { - $this->statuts->removeElement($statut); + $this->quotite = $quotite; return $this; } @@ -220,20 +190,20 @@ class Agent { } /** - * @return string + * @return Grade */ - public function getNumeroPoste() + public function getGrade() { - return $this->numeroPoste; + return $this->grade; } /** - * @param string $numeroPoste + * @param Grade $grade * @return Agent */ - public function setNumeroPoste($numeroPoste) + public function setGrade($grade) { - $this->numeroPoste = $numeroPoste; + $this->grade = $grade; return $this; } @@ -256,130 +226,96 @@ class Agent { } /** - * @return string + * @return AgentStatut[] */ - public function getMissionsComplementaires() - { - return $this->missionsComplementaires; + public function getStatuts() { + return $this->statuts->toArray(); } /** - * @param string $missionsComplementaires + * @param AgentStatut * @return Agent */ - public function setMissionsComplementaires($missionsComplementaires) + public function addStatut($statut) { - $this->missionsComplementaires = $missionsComplementaires; + $this->statuts->add($statut); return $this; } /** - * @return Grade - */ - public function getGrade() - { - return $this->grade; - } - - /** - * @param Grade $grade + * @param AgentStatut * @return Agent */ - public function setGrade($grade) + public function removeStatut($statut) { - $this->grade = $grade; + $this->statuts->removeElement($statut); return $this; } /** - * @return Fichier[] + * @return MissionSpecifique[] */ - public function getFichiers() - { - return $this->fichiers->toArray(); + public function getMissions() { + return $this->missions->toArray(); } /** - * @param Fichier $fichier + * @param MissionSpecifique * @return Agent */ - public function addFichier($fichier) + public function addMission($mission) { - $this->fichiers->add($fichier); + $this->missions->add($mission); return $this; } /** - * @param Fichier $fichier + * @param MissionSpecifique * @return Agent */ - public function removeFichier($fichier) + public function removeMission($mission) { - $this->fichiers->removeElement($fichier); + $this->missions->removeElement($mission); return $this; } /** - * @return User + * @return Fichier[] */ - public function getUtilisateur() + public function getFichiers() { - return $this->utilisateur; + return $this->fichiers->toArray(); } /** - * @param User $utilisateur + * @param Fichier $fichier * @return Agent */ - public function setUtilisateur($utilisateur) + public function addFichier($fichier) { - $this->utilisateur = $utilisateur; + $this->fichiers->add($fichier); return $this; } - - /** - * @param string $natureCode - * @return Fichier + * @param Fichier $fichier + * @return Agent */ - public function fetchFile($natureCode) + public function removeFichier($fichier) { - $result = $this->fetchFiles($natureCode); - $nb = count($result); - - if ($nb === 0) return null; - if ($nb > 1) throw new RuntimeException("Plusieurs fichiers de nature [] trouvés."); - - return current($result); + $this->fichiers->removeElement($fichier); + return $this; } /** - * @param string $natureCode + * @param string $nature * @return Fichier[] */ - public function fetchFiles($natureCode) + public function fetchFiles($nature) { - $result = []; - /** @var Fichier $fichier */ - foreach ($this->fichiers as $fichier) { - if ($fichier->getNature()->getCode() === $natureCode) $result[] = $fichier; - } - return $result; - } + $fichiers = $this->getFichiers(); + $fichiers = array_filter($fichiers, function (Fichier $f) use ($nature) { return ($f->getHistoDestruction() === null && $f->getNature()->getCode() === $nature);}); - /** - * @return AgentStatut[] - */ - public function getStatutsActifs() - { - $statutsActifs = []; - foreach ($this->statuts as $statut) { - if ($statut->isActif()) { - $statutsActifs[] = $statut; - } - } - - return $statutsActifs; + return $fichiers; } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/AgentStatus.php b/module/Application/src/Application/Entity/Db/AgentStatus.php deleted file mode 100644 index ab02a2c57a6b456d941a4ca7340915e50fd078bc..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Entity/Db/AgentStatus.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Application\Entity\Db; - -class AgentStatus { - - /** @var integer */ - private $id; - /** @var string */ - private $libelle; - - /** - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * @return string - */ - public function getLibelle() - { - return $this->libelle; - } - - /** - * @param string $libelle - * @return AgentStatus - */ - public function setLibelle($libelle) - { - $this->libelle = $libelle; - return $this; - } - - public function __toString() - { - return $this->getLibelle(); - } - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/AgentStatut.php b/module/Application/src/Application/Entity/Db/AgentStatut.php index 0462b31cd73cc1ba5d3b3bbd62144f6df43cc4c0..81661d843a8ebc3aa0de4944db3c94e002551236 100644 --- a/module/Application/src/Application/Entity/Db/AgentStatut.php +++ b/module/Application/src/Application/Entity/Db/AgentStatut.php @@ -7,7 +7,7 @@ use Exception; use UnicaenApp\Exception\RuntimeException; class AgentStatut { - /** @var integer */ + /** @var string */ private $id; /** @var string */ private $sourceName; @@ -58,23 +58,13 @@ class AgentStatut { private $retraite; /** - * @return int + * @return string */ public function getId() { return $this->id; } - /** - * @param int $id - * @return AgentStatut - */ - public function setId($id) - { - $this->id = $id; - return $this; - } - /** * @return string */ @@ -206,7 +196,7 @@ class AgentStatut { */ public function isTitulaire() { - return $this->titulaire; + return $this->titulaire === 'O'; } /** @@ -224,7 +214,7 @@ class AgentStatut { */ public function isCdi() { - return $this->cdi; + return $this->cdi === 'O'; } /** @@ -242,7 +232,7 @@ class AgentStatut { */ public function isCdd() { - return $this->cdd; + return $this->cdd === 'O'; } /** @@ -260,7 +250,7 @@ class AgentStatut { */ public function isVacataire() { - return $this->vacataire; + return $this->vacataire === 'O'; } /** @@ -278,7 +268,7 @@ class AgentStatut { */ public function isEnseignant() { - return $this->enseignant; + return $this->enseignant === 'O'; } /** @@ -296,7 +286,7 @@ class AgentStatut { */ public function isAdministratif() { - return $this->administratif; + return $this->administratif === 'O'; } /** @@ -314,7 +304,7 @@ class AgentStatut { */ public function isChercheur() { - return $this->chercheur; + return $this->chercheur === 'O'; } /** @@ -332,7 +322,7 @@ class AgentStatut { */ public function isEtudiant() { - return $this->etudiant; + return $this->etudiant === 'O'; } /** @@ -350,7 +340,7 @@ class AgentStatut { */ public function isAuditeurLibre() { - return $this->auditeurLibre; + return $this->auditeurLibre === 'O'; } /** @@ -368,7 +358,7 @@ class AgentStatut { */ public function isDoctorant() { - return $this->doctorant; + return $this->doctorant === 'O'; } /** @@ -386,7 +376,7 @@ class AgentStatut { */ public function isDetacheIn() { - return $this->detacheIn; + return $this->detacheIn === 'O'; } /** @@ -404,7 +394,7 @@ class AgentStatut { */ public function isDetacheOut() { - return $this->detacheOut; + return $this->detacheOut === 'O'; } /** @@ -422,7 +412,7 @@ class AgentStatut { */ public function isDispo() { - return $this->dispo; + return $this->dispo === 'O'; } /** @@ -440,7 +430,7 @@ class AgentStatut { */ public function isHeberge() { - return $this->heberge; + return $this->heberge === 'O'; } /** @@ -458,7 +448,7 @@ class AgentStatut { */ public function isEmerite() { - return $this->emerite; + return $this->emerite === 'O'; } /** @@ -476,7 +466,7 @@ class AgentStatut { */ public function isRetraite() { - return $this->retraite; + return $this->retraite === 'O'; } /** diff --git a/module/Application/src/Application/Entity/Db/Application.php b/module/Application/src/Application/Entity/Db/Application.php index 2b932f57d520717b10b15fe3cfdb5239c35dd96c..c4e6308f72a992e8b9ffe910d8a25e86304cb475 100644 --- a/module/Application/src/Application/Entity/Db/Application.php +++ b/module/Application/src/Application/Entity/Db/Application.php @@ -2,6 +2,8 @@ namespace Application\Entity\Db; +use Doctrine\Common\Collections\ArrayCollection; + class Application { /** @var integer */ @@ -15,6 +17,14 @@ class Application { /** @var boolean */ private $actif; + /** @var ArrayCollection */ + private $activites; + + public function __construct() + { + $this->activites = new ArrayCollection(); + } + /** * @return int */ @@ -94,4 +104,41 @@ class Application { $this->actif = $actif; return $this; } + + /** + * @return Activite[] + */ + public function getActivites() + { + return $this->activites->toArray(); + } + + /** + * @param Activite $activite + * @return Application + */ + public function addApplication($activite) + { + $this->activites->add($activite); + return $this; + } + + /** + * @param Activite $activite + * @return Application + */ + public function removeApplication($activite) + { + $this->activites->removeElement($activite); + return $this; + } + + /** + * @param Activite $activite + * @return boolean + */ + public function hasApplication($activite) + { + return $this->activites->contains($activite); + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Batiment.php b/module/Application/src/Application/Entity/Db/Batiment.php new file mode 100644 index 0000000000000000000000000000000000000000..8e6052e13d341f8a2be3475144cc9f9db66592c2 --- /dev/null +++ b/module/Application/src/Application/Entity/Db/Batiment.php @@ -0,0 +1,86 @@ +<?php + +namespace Application\Entity\Db; + +class Batiment { + use ImportableAwareTrait; + + /** @var string */ + private $id; + /** @var string */ + private $nom; + /** @var string */ + private $libelle; + /** @var Site */ + private $site; + + /** + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getNom() + { + return $this->nom; + } + + /** + * @param string $nom + * @return Batiment + */ + public function setNom($nom) + { + $this->nom = $nom; + return $this; + } + + /** + * @return string + */ + public function getLibelle() + { + return $this->libelle; + } + + /** + * @param string $libelle + * @return Batiment + */ + public function setLibelle($libelle) + { + $this->libelle = $libelle; + return $this; + } + + /** + * @return Site + */ + public function getSite() + { + return $this->site; + } + + /** + * @param Site $site + * @return Batiment + */ + public function setSite($site) + { + $this->site = $site; + return $this; + } + + /** + * @return string + */ + public function __toString() + { + return '<span class="badge">'.$this->getSite()->getNom().'</span> ' . $this->libelle; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Corps.php b/module/Application/src/Application/Entity/Db/Corps.php index 30eb081b2abb03271f94e5694a015fa563e3c851..0c21b26133f528c131d949aa9337203965622cb1 100644 --- a/module/Application/src/Application/Entity/Db/Corps.php +++ b/module/Application/src/Application/Entity/Db/Corps.php @@ -9,7 +9,13 @@ class Corps { /** @var string */ private $code; /** @var string */ - private $libelle; + private $libelleCourt; + /** @var string */ + private $libelleLong; + /** @var string */ + private $categorie; + /** @var string */ + private $histo; /** * @return int @@ -50,25 +56,78 @@ class Corps { /** * @return string */ - public function getLibelle() + public function getLibelleCourt() { - return $this->libelle; + return $this->libelleCourt; } /** - * @param string $libelle + * @param string $libelleCourt * @return Corps */ - public function setLibelle($libelle) + public function setLibelleCourt($libelleCourt) { - $this->libelle = $libelle; + $this->libelleCourt = $libelleCourt; return $this; } - public function __toString() + /** + * @return string + */ + public function getLibelleLong() + { + return $this->libelleLong; + } + + /** + * @param string $libelleLong + * @return Corps + */ + public function setLibelleLong($libelleLong) { - return "(".$this->getCode().") ".$this->getLibelle(); + $this->libelleLong = $libelleLong; + return $this; } + /** + * @return string + */ + public function getCategorie() + { + return $this->categorie; + } + + /** + * @param string $categorie + * @return Corps + */ + public function setCategorie($categorie) + { + $this->categorie = $categorie; + return $this; + } + + /** + * @return string + */ + public function getHisto() + { + return $this->histo; + } + + /** + * @param string $histo + * @return Corps + */ + public function setHisto($histo) + { + $this->histo = $histo; + return $this; + } + + public function __toString() + { + return $this->getLibelleCourt(); + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Correspondance.php b/module/Application/src/Application/Entity/Db/Correspondance.php index bf178b615ded2cf0a60c79f25fadbb41c052dab1..9882e2971a4eff789db10e0f5f6cdeed37feac28 100644 --- a/module/Application/src/Application/Entity/Db/Correspondance.php +++ b/module/Application/src/Application/Entity/Db/Correspondance.php @@ -7,11 +7,13 @@ class Correspondance { /** @var integer */ private $id; /** @var string */ - private $reference; + private $categorie; /** @var string */ - private $libelle; + private $libelleCourt; /** @var string */ - private $description; + private $libelleLong; + /** @var string */ + private $histo; /** * @return int @@ -24,60 +26,81 @@ class Correspondance { /** * @return string */ - public function getReference() + public function getCategorie() { - return $this->reference; + return $this->categorie; } /** - * @param string $reference + * @param string $categorie * @return Correspondance */ - public function setReference($reference) + public function setCategorie($categorie) { - $this->reference = $reference; + $this->categorie = $categorie; return $this; } /** * @return string */ - public function getLibelle() + public function getLibelleCourt() { - return $this->libelle; + return $this->libelleCourt; } /** - * @param string $libelle + * @param string $libelleCourt * @return Correspondance */ - public function setLibelle($libelle) + public function setLibelleCourt($libelleCourt) { - $this->libelle = $libelle; + $this->libelleCourt = $libelleCourt; return $this; } /** * @return string */ - public function getDescription() + public function getLibelleLong() { - return $this->description; + return $this->libelleLong; } /** - * @param string $description + * @param string $libelleLong * @return Correspondance */ - public function setDescription($description) + public function setLibelleLong($libelleLong) { - $this->description = $description; + $this->libelleLong = $libelleLong; return $this; } + /** + * @return string + */ + public function getHisto() + { + return $this->histo; + } + + /** + * @param string $histo + * @return Correspondance + */ + public function setHisto($histo) + { + $this->histo = $histo; + return $this; + } + + /** + * @return string + */ public function __toString() { - return $this->reference . ' '. $this->getLibelle() . ' '.'"'. $this->getDescription().'"'; + return $this->getLibelleCourt(); } diff --git a/module/Application/src/Application/Entity/Db/Domaine.php b/module/Application/src/Application/Entity/Db/Domaine.php index bae5720adc77d8666302214d6a778c8d380681c8..76d1caf60b76b571209315b3b51b15664ca92c3b 100644 --- a/module/Application/src/Application/Entity/Db/Domaine.php +++ b/module/Application/src/Application/Entity/Db/Domaine.php @@ -2,6 +2,8 @@ namespace Application\Entity\Db; +use Doctrine\Common\Collections\ArrayCollection; + class Domaine { /** @var integer */ @@ -9,6 +11,16 @@ class Domaine { /** @var string */ private $libelle; + /** @var FamilleProfessionnelle */ + private $famille; + /** @var ArrayCollection */ + private $metiers; + + public function __construct() + { + $this->metiers = new ArrayCollection(); + } + /** * @return int */ @@ -35,5 +47,57 @@ class Domaine { return $this; } + /** + * @return FamilleProfessionnelle + */ + public function getFamille() + { + return $this->famille; + } + + /** + * @param FamilleProfessionnelle $famille + * @return Domaine + */ + public function setFamille($famille) + { + $this->famille = $famille; + return $this; + } + + /** + * @return Metier[] + */ + public function getMetiers() + { + return $this->metiers->toArray(); + } + + /** + * @param Metier $metier + * @return Domaine + */ + public function addMetier($metier) + { + $this->metiers->add($metier); + return $this; + } + + /** + * @param Metier $metier + * @return Domaine + */ + public function removeMetier($metier) + { + $this->metiers->removeElement($metier); + return $this; + } + /** + * @return string + */ + public function __toString() + { + return $this->getLibelle(); + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/FamilleProfessionnelle.php b/module/Application/src/Application/Entity/Db/FamilleProfessionnelle.php new file mode 100644 index 0000000000000000000000000000000000000000..3ef6ab11897554ec47a2222a94355ae0563f1828 --- /dev/null +++ b/module/Application/src/Application/Entity/Db/FamilleProfessionnelle.php @@ -0,0 +1,83 @@ +<?php + +namespace Application\Entity\Db; + +use Doctrine\Common\Collections\ArrayCollection; + +class FamilleProfessionnelle { + + /** @var integer */ + private $id; + /** @var string */ + private $libelle; + + /** @var ArrayCollection */ + private $domaines; + + /** + * MetierFamille constructor. + */ + public function __construct() + { + $this->domaines = new ArrayCollection(); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getLibelle() + { + return $this->libelle; + } + + /** + * @param string $libelle + * @return FamilleProfessionnelle + */ + public function setLibelle($libelle) + { + $this->libelle = $libelle; + return $this; + } + + public function getDomaines() + { + return $this->domaines->toArray(); + } + + /** + * @param Domaine $domaine + * @return FamilleProfessionnelle + */ + public function addDomaine($domaine) + { + $this->domaines->add($domaine); + return $this; + } + + /** + * @param Domaine $domaine + * @return FamilleProfessionnelle + */ + public function removeDomaine($domaine) + { + $this->domaines->removeElement($domaine); + return $this; + } + + /** + * @return + */ + public function __toString() + { + return $this->getLibelle(); + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/FicheMetierType.php b/module/Application/src/Application/Entity/Db/FicheMetier.php similarity index 99% rename from module/Application/src/Application/Entity/Db/FicheMetierType.php rename to module/Application/src/Application/Entity/Db/FicheMetier.php index 51b8ffbbf92a81eaa01685224050e0b9a4961fbb..ff15f109e21669734f811dcb79c6c2c3d01e0c88 100644 --- a/module/Application/src/Application/Entity/Db/FicheMetierType.php +++ b/module/Application/src/Application/Entity/Db/FicheMetier.php @@ -5,7 +5,7 @@ namespace Application\Entity\Db; use Doctrine\Common\Collections\ArrayCollection; use UnicaenApp\Entity\HistoriqueAwareTrait; -class FicheMetierType { +class FicheMetier { use HistoriqueAwareTrait; /** @var int */ diff --git a/module/Application/src/Application/Entity/Db/FicheMetierTypeActivite.php b/module/Application/src/Application/Entity/Db/FicheMetierTypeActivite.php index 9ec3883506427f58f247c8eb4ca78dffac0127a4..7e5feaed0d56e61ee1c8f0c65d69a61510af43c7 100644 --- a/module/Application/src/Application/Entity/Db/FicheMetierTypeActivite.php +++ b/module/Application/src/Application/Entity/Db/FicheMetierTypeActivite.php @@ -6,7 +6,7 @@ class FicheMetierTypeActivite { /** @var int */ private $id; - /** @var FicheMetierType */ + /** @var FicheMetier */ private $fiche; /** @var Activite */ private $activite; @@ -23,7 +23,7 @@ class FicheMetierTypeActivite { } /** - * @return FicheMetierType + * @return FicheMetier */ public function getFiche() { @@ -31,7 +31,7 @@ class FicheMetierTypeActivite { } /** - * @param FicheMetierType $fiche + * @param FicheMetier $fiche * @return FicheMetierTypeActivite */ public function setFiche($fiche) diff --git a/module/Application/src/Application/Entity/Db/FichePoste.php b/module/Application/src/Application/Entity/Db/FichePoste.php index 6a3f5148da717152a3af9fb4ee5398089029381e..3103bb1351ecb0418fd7ed8a68632b939a485b9c 100644 --- a/module/Application/src/Application/Entity/Db/FichePoste.php +++ b/module/Application/src/Application/Entity/Db/FichePoste.php @@ -155,5 +155,63 @@ class FichePoste return null; } + public function getQuotiteTravaillee() + { + $somme = 0; + /** @var FicheTypeExterne $ficheMetier */ + foreach ($this->fichesMetiers as $ficheMetier) { + $somme += $ficheMetier->getQuotite(); + } + return $somme; + } + + + /** + * //TODO finir cela + * [ + * [ + * 'famille' => 'Informatique, + * [ + * 'id' => 123, + * 'metier' => 'Ingenieur en logiciel', + * 'quotite' => '50', + * 'principal' => true, + * ], + * [ + * 'id' => 43, + * 'metier' => 'Gestionnaire de base de données', + * 'quotite' => '20', + * ], + * ], + * [ + * 'famille' => 'Assistance technique et administration de la recherche , + * [ + * 'id' => 665, + * 'metier' => 'Responsable assistance support', + * 'quotite' => '20', + * ], + * ], + * ] + * + * @return array + */ + public function getFamillesAsJson() { + $result = []; + foreach ($this->getFichesMetiers() as $fiche) { + $metier = $fiche->getFicheType()->getMetier()->getLibelle(); + $famille = $fiche->getFicheType()->getMetier()->getFonction()->getDomaine()->getFamille()->getLibelle(); + $quotite = $fiche->getQuotite(); + + if (!isset($result[$famille])) { + $result[$famille] = []; + } + $result[$famille][] = [ + 'id' => $fiche->getId(), + 'metier' => $metier, + 'quotite' => $quotite + ]; + } + return $result; + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/FicheTypeExterne.php b/module/Application/src/Application/Entity/Db/FicheTypeExterne.php index 02eae1d1117f45d663ab67d2cf6dcc2f7df159bd..00597785cd083356f7bc2d27855785f93e3f8e5a 100644 --- a/module/Application/src/Application/Entity/Db/FicheTypeExterne.php +++ b/module/Application/src/Application/Entity/Db/FicheTypeExterne.php @@ -15,7 +15,7 @@ class FicheTypeExterne { private $id; /** @var FichePoste */ private $fichePoste; - /** @var FicheMetierType */ + /** @var FicheMetier */ private $ficheType; /** @var integer */ private $quotite; @@ -51,7 +51,7 @@ class FicheTypeExterne { } /** - * @return FicheMetierType + * @return FicheMetier */ public function getFicheType() { @@ -59,7 +59,7 @@ class FicheTypeExterne { } /** - * @param FicheMetierType $ficheType + * @param FicheMetier $ficheType * @return FicheTypeExterne */ public function setFicheType($ficheType) diff --git a/module/Application/src/Application/Entity/Db/Fonction.php b/module/Application/src/Application/Entity/Db/Fonction.php index 9ea2887535288aa7456e02512795eb2c5fcf2ec4..01555dd3e73758a85794929d8b415cc45cc0c6d3 100644 --- a/module/Application/src/Application/Entity/Db/Fonction.php +++ b/module/Application/src/Application/Entity/Db/Fonction.php @@ -3,66 +3,101 @@ namespace Application\Entity\Db; use Doctrine\Common\Collections\ArrayCollection; -use UnicaenApp\Entity\HistoriqueAwareTrait; class Fonction { - use HistoriqueAwareTrait; + use ImportableAwareTrait; - /** @var integer */ - private $id; + /** @var string */ + private $id; + /** @var Fonction */ + private $parent; /** @var string */ - private $source; + private $code; /** @var string */ - private $idSource; - /** @var ArrayCollection */ - private $libelles; + private $niveau; + /** @var ArrayCollection */ + private $libelles; - public function __construct() - { - $this->libelles = new ArrayCollection(); - } + /** @var Domaine */ + private $domaine; + /** @var ArrayCollection (Metier) */ + private $metiers; + + public function __construct() + { + $this->libelles = new ArrayCollection(); + $this->metiers = new ArrayCollection(); + } /** - * @return int + * @return string */ public function getId() { return $this->id; } + /** + * @param string $id + * @return Fonction + */ + public function setId($id) + { + $this->id = $id; + return $this; + } + + /** + * @return Fonction + */ + public function getParent() + { + return $this->parent; + } + + /** + * @param Fonction $parent + * @return Fonction + */ + public function setParent($parent) + { + $this->parent = $parent; + return $this; + } + /** * @return string */ - public function getSource() + public function getCode() { - return $this->source; + return $this->code; } /** - * @param string $source + * @param string $code * @return Fonction */ - public function setSource($source) + public function setCode($code) { - $this->source = $source; + $this->code = $code; return $this; } /** * @return string */ - public function getIdSource() + public function getNiveau() { - return $this->idSource; + return $this->niveau; } /** - * @param string $idSource + * @param string $niveau * @return Fonction */ - public function setIdSource($idSource) + public function setNiveau($niveau) { - $this->idSource = $idSource; + $this->niveau = $niveau; return $this; } @@ -78,6 +113,7 @@ class Fonction { * @param FonctionLibelle $libelle * @return Fonction */ + public function addLibelle($libelle) { $this->libelles->add($libelle); @@ -88,35 +124,69 @@ class Fonction { * @param FonctionLibelle $libelle * @return Fonction */ + public function removeLibelle($libelle) { $this->libelles->removeElement($libelle); return $this; } - public function __toString() + /** + * @return Domaine + */ + public function getDomaine() { - $tab = []; - foreach ($this->getLibelles() as $libelle) $tab[] = $libelle->getLibelle(); - return implode("/", $tab); + return $this->domaine; } /** - * @param string $genre - * @return FonctionLibelle + * @param Domaine $domaine + * @return Fonction */ - public function getDefault($genre) + public function setDomaine($domaine) { - /** @var FonctionLibelle $libelle */ - foreach ($this->libelles as $libelle) { - if ($libelle->getDefault() && $libelle->getGenre() === $genre) return $libelle; - } - return null; + $this->domaine = $domaine; + return $this; } - public function setId($id) + /** + * @return Metier[] + */ + public function getMetiers() { - $this->id = $id; + return $this->metiers->toArray(); + } + + /** + * @param Metier $metier + * @return Fonction + */ + public function addMetier($metier) + { + $this->metiers->add($metier); + return $this; } + /** + * @param Metier $metier + * @return Fonction + */ + public function removeMetier($metier) + { + $this->metiers->removeElement($metier); + return $this; + } + + /** + * @return string + */ + public function __toString() + { + $array = []; + foreach ($this->getLibelles() as $libelle) { + $array[] = $libelle->getLibelle(); + } + + return implode("/", $array); + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/FonctionLibelle.php b/module/Application/src/Application/Entity/Db/FonctionLibelle.php index d56deece6e4a13237c66ae3e99a64690b4418a45..a043611445405ae3b808f0c6c54f0fb264b9bc37 100644 --- a/module/Application/src/Application/Entity/Db/FonctionLibelle.php +++ b/module/Application/src/Application/Entity/Db/FonctionLibelle.php @@ -2,12 +2,10 @@ namespace Application\Entity\Db; -use UnicaenApp\Entity\HistoriqueAwareTrait; - class FonctionLibelle { - use HistoriqueAwareTrait; + use ImportableAwareTrait; - /** @var integer */ + /** @var string */ private $id; /** @var Fonction */ private $fonction; @@ -16,31 +14,16 @@ class FonctionLibelle { /** @var string */ private $genre; /** @var string */ - private $default; - - /** @var string */ - private $source; - /** @var string */ - private $idSource; + private $defaut; /** - * @return int + * @return string */ public function getId() { return $this->id; } - /** - * @param int $id - * @return FonctionLibelle - */ - public function setId($id) - { - $this->id = $id; - return $this; - } - /** * @return Fonction */ @@ -95,60 +78,23 @@ class FonctionLibelle { return $this; } - /** - * @return boolean - */ - public function getDefault() - { - return ($this->default === 'O'); - } - - /** - * @param string $default - * @return FonctionLibelle - */ - public function setDefault($default) - { - $this->default = $default; - return $this; - } - /** * @return string */ - public function getSource() + public function getDefaut() { - return $this->source; + return $this->defaut; } /** - * @param string $source + * @param string $defaut * @return FonctionLibelle */ - public function setSource($source) + public function setDefaut($defaut) { - $this->source = $source; + $this->defaut = $defaut; return $this; } - /** - * @return string - */ - public function getIdSource() - { - return $this->idSource; - } - - /** - * @param string $idSource - * @return FonctionLibelle - */ - public function setIdSource($idSource) - { - $this->idSource = $idSource; - return $this; - } - - } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Grade.php b/module/Application/src/Application/Entity/Db/Grade.php index 49b5a174ee2cae181ccc634b71369f5b83305e9e..69219fcb57ecab6c2defe8ade8a990bd51c1761e 100644 --- a/module/Application/src/Application/Entity/Db/Grade.php +++ b/module/Application/src/Application/Entity/Db/Grade.php @@ -4,16 +4,19 @@ namespace Application\Entity\Db; class Grade { - /** @var integer */ + /** @var string */ private $id; - /** @var Corps */ - private $corps; /** @var string */ - private $libelle; - /** @var integer */ - private $rang; + private $libelleCourt; + /** @var string */ + private $libelleLong; + /** @var string */ + private $code; + /** @var string */ + private $histo; + /** - * @return int + * @return string */ public function getId() { @@ -21,64 +24,79 @@ class Grade { } /** - * @return Corps + * @return string */ - public function getCorps() + public function getLibelleCourt() { - return $this->corps; + return $this->libelleCourt; } /** - * @param Corps $corps + * @param string $libelleCourt * @return Grade */ - public function setCorps($corps) + public function setLibelleCourt($libelleCourt) { - $this->corps = $corps; + $this->libelleCourt = $libelleCourt; return $this; } /** * @return string */ - public function getLibelle() + public function getLibelleLong() { - return $this->libelle; + return $this->libelleLong; } /** - * @param string $libelle + * @param string $libelleLong * @return Grade */ - public function setLibelle($libelle) + public function setLibelleLong($libelleLong) { - $this->libelle = $libelle; + $this->libelleLong = $libelleLong; return $this; } - public function __toString() + /** + * @return string + */ + public function getCode() { - $texte = $this->getCorps()->getLibelle() . " ". $this->getLibelle(); - return $texte; + return $this->code; } /** - * @return int + * @param string $code + * @return Grade */ - public function getRang() + public function setCode($code) { - return $this->rang; + $this->code = $code; + return $this; } /** - * @param int $rang + * @return string + */ + public function getHisto() + { + return $this->histo; + } + + /** + * @param string $histo * @return Grade */ - public function setRang($rang) + public function setHisto($histo) { - $this->rang = $rang; + $this->histo = $histo; return $this; } - + public function __toString() + { + return $this->getLibelleCourt(); + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/ImportableAwareTrait.php b/module/Application/src/Application/Entity/Db/ImportableAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..3a2d4dbdae37643f9b1e88f257f4722212b1e23b --- /dev/null +++ b/module/Application/src/Application/Entity/Db/ImportableAwareTrait.php @@ -0,0 +1,72 @@ +<?php + +namespace Application\Entity\Db; + +use DateTime; + +trait ImportableAwareTrait { + + /** @var Datetime */ + private $importationCreation; + /** @var Datetime */ + private $importationModification; + /** @var Datetime */ + private $importationHistorisation; + + /** + * @return DateTime + */ + public function getImportationCreation() + { + return $this->importationCreation; + } + + /** + * @param DateTime $importationCreation + * @return ImportableAwareTrait + */ + public function setImportationCreation($importationCreation) + { + $this->importationCreation = $importationCreation; + return $this; + } + + /** + * @return DateTime + */ + public function getImportationModification() + { + return $this->importationModification; + } + + /** + * @param DateTime $importationModification + * @return ImportableAwareTrait + */ + public function setImportationModification($importationModification) + { + $this->importationModification = $importationModification; + return $this; + } + + /** + * @return DateTime + */ + public function getImportationHistorisation() + { + return $this->importationHistorisation; + } + + /** + * @param DateTime $importationHistorisation + * @return ImportableAwareTrait + */ + public function setImportationHistorisation($importationHistorisation) + { + $this->importationHistorisation = $importationHistorisation; + return $this; + } + + + +} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Activite.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Activite.dcm.xml index 361eeb7f6ca2d0932f02181340b840c800e2a714..bb2b615c251ab569efcdc039e6522d56ed0cf4e5 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Activite.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Activite.dcm.xml @@ -9,6 +9,17 @@ <field name="libelle" type="string" length="255" column="libelle" nullable="false"/> <field name="description" type="string" length="2047" column="description" nullable="false"/> + <many-to-many field="applications" target-entity="Application\Entity\Db\Application" inversed-by="application" fetch="LAZY"> + <join-table name="activite_application"> + <join-columns> + <join-column name="activite_id" referenced-column-name="id"/> + </join-columns> + <inverse-join-columns> + <join-column name="application_id" referenced-column-name="id"/> + </inverse-join-columns> + </join-table> + </many-to-many> + <field name="histoCreation" type="datetime" column="histo_creation" nullable="false"/> <field name="histoModification" type="datetime" column="histo_modification" nullable="false"/> <field name="histoDestruction" type="datetime" column="histo_destruction" nullable="true"/> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Agent.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Agent.dcm.xml index c1113ad50e77a265b595f1061652ab4d4c4d09cc..a0245b1b2a8eaf14a541da588b626bdea2ffd104 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Agent.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Agent.dcm.xml @@ -2,38 +2,38 @@ <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="Application\Entity\Db\Agent" table="agent"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="c_individu" type="string" length="40" > </id> - <field name="nom" type="string" length="256" column="nom_usuel" nullable="false"/> - <field name="prenom" type="string" length="256" column="prenom" nullable="false"/> - <field name="dateDebut" type="datetime" column="date_debut" nullable="true"/> - <field name="dateFin" type="datetime" column="date_fin" nullable="true"/> - <field name="quotite" type="integer" column="quotite" nullable="true"/> - <field name="numeroPoste" type="string" length="256" column="numero_poste" nullable="true"/> - <field name="missionsComplementaires" type="string" length="2048" column="missions_complementaires" nullable="true"/> + <field name="sourceName" column="c_source" type="string" length="40" /> + <field name="sourceId" column="c_src_individu" type="string" length="40" /> - <many-to-one target-entity="Application\Entity\Db\AgentStatus" field="status"> - <join-column name="status" referenced-column-name="id" /> - </many-to-one> + <field name="prenom" column="prenom" type="string" length="64" /> + <field name="nomUsuel" column="nom_usage" type="string" length="64" /> + + <field name="quotite" column="quotite" type="integer" /> <one-to-many target-entity="Application\Entity\Db\AgentStatut" mapped-by="agent" field="statuts"/> - <many-to-one target-entity="Application\Entity\Db\Correspondance" field="correspondance"> - <join-column name="correspondance" referenced-column-name="id" /> - </many-to-one> - <many-to-one target-entity="Application\Entity\Db\Corps" field="corps"> - <join-column name="corps" referenced-column-name="id" /> - </many-to-one> - <many-to-one target-entity="Application\Entity\Db\Grade" field="grade"> - <join-column name="grade" referenced-column-name="id" /> - </many-to-one> + <one-to-one target-entity="Utilisateur\Entity\Db\User" field="utilisateur"> + <join-column name="utilisateur_id" referenced-column-name="id" /> + </one-to-one> + + <many-to-many field="missions" target-entity="Application\Entity\Db\MissionSpecifique" inversed-by="mission" fetch="LAZY"> + <join-table name="agent_mission"> + <join-columns> + <join-column name="agent_id" referenced-column-name="c_individu"/> + </join-columns> + <inverse-join-columns> + <join-column name="mission_id" referenced-column-name="id"/> + </inverse-join-columns> + </join-table> + </many-to-many> <many-to-many field="fichiers" target-entity="Fichier\Entity\Db\Fichier" inversed-by="fichier" fetch="LAZY"> <join-table name="agent_fichier"> <join-columns> - <join-column name="agent" referenced-column-name="id"/> + <join-column name="agent" referenced-column-name="c_individu"/> </join-columns> <inverse-join-columns> <join-column name="fichier" referenced-column-name="id"/> @@ -41,9 +41,16 @@ </join-table> </many-to-many> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="utilisateur"> - <join-column name="utilisateur" referenced-column-name="id" /> + <many-to-one target-entity="Application\Entity\Db\Correspondance" field="correspondance"> + <join-column name="bap_id" referenced-column-name="id"/> </many-to-one> + <many-to-one target-entity="Application\Entity\Db\Grade" field="grade"> + <join-column name="grade_id" referenced-column-name="id"/> + </many-to-one> + + <many-to-one target-entity="Application\Entity\Db\Corps" field="corps"> + <join-column name="corps_id" referenced-column-name="id"/> + </many-to-one> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AgentStatut.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AgentStatut.dcm.xml index 312ed26aa2e518ee0fcb622c947edd339c148cf2..2ddb85b5146d881b069c06e0637b8c1442a2c0fa 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AgentStatut.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AgentStatut.dcm.xml @@ -2,39 +2,37 @@ <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="Application\Entity\Db\AgentStatut" table="agent_statut"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="id" type="string" length="40" > </id> - <field name="sourceName" type="string" length="64" column="source_name" nullable="true"/> - <field name="sourceId" type="integer" column="source_id" nullable="true"/> + <field name="sourceName" column="c_source" type="string" length="40" /> + <field name="idOrigine" column="id_orig" type="string" length="256" /> - <field name="idOrigine" type="string" length="256" column="id_origine" nullable="true"/> <many-to-one target-entity="Application\Entity\Db\Agent" field="agent"> - <join-column name="agent_id" referenced-column-name="id"/> + <join-column name="individu_id" referenced-column-name="c_individu"/> </many-to-one> <many-to-one target-entity="Application\Entity\Db\Structure" field="structure"> <join-column name="structure_id" referenced-column-name="id"/> </many-to-one> - <field name="debut" type="datetime" column="debut" nullable="false"/> - <field name="fin" type="datetime" column="fin" nullable="true"/> + <field name="debut" type="datetime" column="d_debut" nullable="false"/> + <field name="fin" type="datetime" column="d_fin" nullable="true"/> - <field name="titulaire" type="boolean" column="titulaire" nullable="true"/> - <field name="cdi" type="boolean" column="cdi" nullable="true"/> - <field name="cdd" type="boolean" column="cdd" nullable="true"/> - <field name="vacataire" type="boolean" column="vacataire" nullable="true"/> - <field name="enseignant" type="boolean" column="enseignant" nullable="true"/> - <field name="administratif" type="boolean" column="administratif" nullable="true"/> - <field name="chercheur" type="boolean" column="chercheur" nullable="true"/> - <field name="etudiant" type="boolean" column="etudiant" nullable="true"/> - <field name="auditeurLibre" type="boolean" column="auditeur_libre" nullable="true"/> - <field name="doctorant" type="boolean" column="doctorant" nullable="true"/> - <field name="detacheIn" type="boolean" column="detache_in" nullable="true"/> - <field name="detacheOut" type="boolean" column="detache_out" nullable="true"/> - <field name="dispo" type="boolean" column="dispo" nullable="true"/> - <field name="heberge" type="boolean" column="heberge" nullable="true"/> - <field name="emerite" type="boolean" column="emerite" nullable="true"/> - <field name="retraite" type="boolean" column="retraite" nullable="true"/> + <field name="titulaire" type="string" length="1" column="t_titulaire" nullable="true"/> + <field name="cdi" type="string" length="1" column="t_cdi" nullable="true"/> + <field name="cdd" type="string" length="1" column="t_cdd" nullable="true"/> + <field name="vacataire" type="string" length="1" column="t_vacataire" nullable="true"/> + <field name="enseignant" type="string" length="1" column="t_enseignant" nullable="true"/> + <field name="administratif" type="string" length="1" column="t_administratif" nullable="true"/> + <field name="chercheur" type="string" length="1" column="t_chercheur" nullable="true"/> + <field name="etudiant" type="string" length="1" column="t_etudiant" nullable="true"/> + <field name="auditeurLibre" type="string" length="1" column="t_auditeur_libre" nullable="true"/> + <field name="doctorant" type="string" length="1" column="t_doctorant" nullable="true"/> + <field name="detacheIn" type="string" length="1" column="t_detache_in" nullable="true"/> + <field name="detacheOut" type="string" length="1" column="t_detache_out" nullable="true"/> + <field name="dispo" type="string" length="1" column="t_dispo" nullable="true"/> + <field name="heberge" type="string" length="1" column="t_heberge" nullable="true"/> + <field name="emerite" type="string" length="1" column="t_emerite" nullable="true"/> + <field name="retraite" type="string" length="1" column="t_retraite" nullable="true"/> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Application.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Application.dcm.xml index 574bb8664b5635e0da89be6ce88c6d507a2deeb2..595a51a0d1e44554f41c3f38073db8412dd7f506 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Application.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Application.dcm.xml @@ -11,5 +11,16 @@ <field name="url" type="string" length="128" column="url" nullable="false" /> <field name="actif" type="boolean" column="actif" nullable="false" /> + <many-to-many field="activites" target-entity="Application\Entity\Db\Activite" inversed-by="activite" fetch="LAZY"> + <join-table name="activite_application"> + <join-columns> + <join-column name="application_id" referenced-column-name="id"/> + </join-columns> + <inverse-join-columns> + <join-column name="activite_id" referenced-column-name="id"/> + </inverse-join-columns> + </join-table> + </many-to-many> + </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Batiment.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Batiment.dcm.xml new file mode 100644 index 0000000000000000000000000000000000000000..c81ca77101258b784b072aa753bba940e850b6ca --- /dev/null +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Batiment.dcm.xml @@ -0,0 +1,20 @@ +<?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="Application\Entity\Db\Batiment" table="batiment"> + + <id name="id" column="id" type="string" length="40" > + </id> + + <field name="nom" column="nom" type="string" length="128"/> + <field name="libelle" column="libelle" type="string" length="128"/> + + <field name="importationCreation" column="created_on" type="datetime" /> + <field name="importationModification" column="updated_on" type="datetime" /> + <field name="importationHistorisation" column="deleted_on" type="datetime" /> + + <many-to-one target-entity="Application\Entity\Db\Site" field="site"> + <join-column name="site_id" referenced-column-name="id"/> + </many-to-one> + + </entity> +</doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Corps.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Corps.dcm.xml index 899f2a29547125e04dfa9db663ff4b9ec04ee34e..9db7cd52bac731db20fb6d941c7171cc3c5a0aa3 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Corps.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Corps.dcm.xml @@ -2,12 +2,13 @@ <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="Application\Entity\Db\Corps" table="corps"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="id" type="string" length="40"> </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="libelleCourt" column="lib_court" type="string" length="20" /> + <field name="libelleLong" column="lib_long" type="string" length="200" /> + <field name="code" column="code" type="string" length="10" /> + <field name="categorie" column="categorie" type="string" length="10" /> + <field name="histo" column="histo" type="string" length="10" /> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Correspondance.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Correspondance.dcm.xml index add11be78b9b67b1942d6ebce8897ce2aec962ad..b7f22e22db7adfbb5eb58464c4a903a64464d07d 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Correspondance.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Correspondance.dcm.xml @@ -2,13 +2,13 @@ <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="Application\Entity\Db\Correspondance" table="correspondance"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="id" type="string" length="40"> </id> - <field name="reference" type="string" length="64" column="reference" nullable="false" /> - <field name="libelle" type="string" length="64" column="libelle" nullable="false" /> - <field name="description" type="string" length="128" column="description" nullable="true" /> + <field name="categorie" column="c_bap" type="string" length="10" /> + <field name="libelleCourt" column="lib_court" type="string" length="20" /> + <field name="libelleLong" column="lib_long" type="string" length="200" /> + <field name="histo" column="histo" type="string" length="10" /> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Domaine.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Domaine.dcm.xml index 906f576dbdcc78b49a9d0fdfc3315300f74b450f..cbbd882d267d432fecf813cad1cc090e08a5875b 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Domaine.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Domaine.dcm.xml @@ -8,5 +8,11 @@ <field name="libelle" type="string" length="256" column="libelle" nullable="false"/> + <many-to-one target-entity="Application\Entity\Db\FamilleProfessionnelle" field="famille"> + <join-column name="famille_id" referenced-column-name="id"/> + </many-to-one> + + <one-to-many target-entity="Application\Entity\Db\Metier" field="metiers" mapped-by="domaine"/> + </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.EntretienProfessionnel.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.EntretienProfessionnel.dcm.xml index 08620cb1a9d9d328f4dd8566270a7383ac023382..a3d3cb0347181b7d02e23b7b5bdc40a8a75b33c0 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.EntretienProfessionnel.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.EntretienProfessionnel.dcm.xml @@ -7,7 +7,7 @@ </id> <many-to-one target-entity="Application\Entity\Db\Agent" field="agent"> - <join-column name="agent" referenced-column-name="id"/> + <join-column name="agent" referenced-column-name="c_individu"/> </many-to-one> <many-to-one target-entity="Utilisateur\Entity\Db\User" field="responsable"> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AgentStatus.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FamilleProfessionnelle.dcm.xml similarity index 74% rename from module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AgentStatus.dcm.xml rename to module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FamilleProfessionnelle.dcm.xml index 77060a49dfa518be6f89a60717828e7be219a28f..e204bf63c10e72ab05c6890b96c78eed066fa777 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AgentStatus.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FamilleProfessionnelle.dcm.xml @@ -1,6 +1,6 @@ <?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="Application\Entity\Db\AgentStatus" table="agent_status"> + <entity name="Application\Entity\Db\FamilleProfessionnelle" table="famille_professionnelle"> <id name="id" type="integer" column="id"> <generator strategy="IDENTITY"/> @@ -8,5 +8,7 @@ <field name="libelle" type="string" length="128" column="libelle" nullable="false" /> + <one-to-many target-entity="Application\Entity\Db\Domaine" field="domaines" mapped-by="famille"/> + </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetierType.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetier.dcm.xml similarity index 95% rename from module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetierType.dcm.xml rename to module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetier.dcm.xml index dcddfd20b51cc97cfa2ee49e69e565e4aae8d2ec..8934752efc1ff0a2d5e36f21b4c5dd1aa07ba0c2 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetierType.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetier.dcm.xml @@ -1,6 +1,6 @@ <?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="Application\Entity\Db\FicheMetierType" table="fiche_type_metier"> + <entity name="Application\Entity\Db\FicheMetier" table="fiche_metier"> <id name="id" type="integer" column="id"> <generator strategy="IDENTITY"/> @@ -10,7 +10,7 @@ <many-to-one target-entity="Application\Entity\Db\Metier" field="metier"> <join-column name="metier" referenced-column-name="id" /> </many-to-one> - <field name="missionsPrincipales" type="string" length="2047" column="missions_principales" nullable="false"/> + <field name="missionsPrincipales" type="string" length="4096" column="missions_principales" nullable="false"/> <field name="connaissances" type="string" length="1024" column="connaissances" nullable="true"/> <field name="connaissancesFormation" type="string" length="1024" column="connaissances_formation" nullable="true"/> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetierTypeActivite.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetierTypeActivite.dcm.xml index 70400dd359513756423eab90570815a7708fc2f0..3c7c623070890fc1a8296d4f2aeac341b7b8ef32 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetierTypeActivite.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetierTypeActivite.dcm.xml @@ -8,7 +8,7 @@ <field name="position" column="position" type="integer" nullable="false" /> - <many-to-one target-entity="Application\Entity\Db\FicheMetierType" field="fiche"> + <many-to-one target-entity="Application\Entity\Db\FicheMetier" field="fiche"> <join-column name="fiche" referenced-column-name="id" /> </many-to-one> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FichePoste.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FichePoste.dcm.xml index 4a5d4ca2d3c3d43f4be5ef6c0a8b4cb5da1f6039..c822697244444f0875ab06e1360f4bc2a2a27961 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FichePoste.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FichePoste.dcm.xml @@ -22,7 +22,7 @@ </many-to-one> <many-to-one field="agent" target-entity="Application\Entity\Db\Agent"> - <join-column name="agent" referenced-column-name="id" /> + <join-column name="agent" referenced-column-name="c_individu" /> </many-to-one> <one-to-one field="specificite" target-entity="Application\Entity\Db\SpecificitePoste"> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheTypeExterne.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheTypeExterne.dcm.xml index b937bec825986b1b906898948776767654201161..b578e9d71a5a6e07c9ac526d6f99922f17864380 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheTypeExterne.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheTypeExterne.dcm.xml @@ -10,7 +10,7 @@ <join-column name="fiche_poste" referenced-column-name="id"/> </many-to-one> - <many-to-one target-entity="Application\Entity\Db\FicheMetierType" field="ficheType"> + <many-to-one target-entity="Application\Entity\Db\FicheMetier" field="ficheType"> <join-column name="fiche_type" referenced-column-name="id"/> </many-to-one> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Fonction.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Fonction.dcm.xml index f87a54c70c956cdcad409afaada24edc89066623..f0a5a2959f97c2b252aaf99ce1e6207204e4627f 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Fonction.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Fonction.dcm.xml @@ -2,29 +2,28 @@ <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="Application\Entity\Db\Fonction" table="fonction"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="id" type="string" length="40" > </id> - <field name="source" type="string" length="64" column="source" nullable="true"/> - <field name="idSource" type="string" length="64" column="id_source" nullable="true"/> + <one-to-one target-entity="Application\Entity\Db\Fonction" field="parent"> + <join-column name="parent_id" referenced-column-name="id"/> + </one-to-one> + + <field name="code" column="code" type="string" length="128"/> + <field name="niveau" column="niveau" type="string" length="40"/> <one-to-many target-entity="Application\Entity\Db\FonctionLibelle" mapped-by="fonction" field="libelles"/> - <field name="histoCreation" type="datetime" column="histo_creation" nullable="false"/> - <field name="histoModification" type="datetime" column="histo_modification" nullable="false"/> - <field name="histoDestruction" type="datetime" column="histo_destruction" nullable="true"/> + <field name="importationCreation" column="created_on" type="datetime" /> + <field name="importationModification" column="updated_on" type="datetime" /> + <field name="importationHistorisation" column="deleted_on" type="datetime" /> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoCreateur"> - <join-column name="histo_createur_id" referenced-column-name="id"/> - </many-to-one> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoModificateur"> - <join-column name="histo_modificateur_id" referenced-column-name="id"/> - </many-to-one> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoDestructeur"> - <join-column name="histo_destructeur_id" referenced-column-name="id"/> + <many-to-one target-entity="Application\Entity\Db\Domaine" field="domaine"> + <join-column name="domaine_id" referenced-column-name="id"/> </many-to-one> + <one-to-many target-entity="Application\Entity\Db\Metier" field="metiers" mapped-by="fonction"/> + </entity> </doctrine-mapping> \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FonctionLibelle.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FonctionLibelle.dcm.xml index 7669685c9f10c261d6847f885e3551b47ee78cbb..e5834492c3b4b66225aecb9e645907f19567b4f2 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FonctionLibelle.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FonctionLibelle.dcm.xml @@ -2,34 +2,19 @@ <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="Application\Entity\Db\FonctionLibelle" table="fonction_libelle"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="id" type="string" length="40" > </id> - <many-to-one target-entity="Application\Entity\Db\Fonction" field="fonction"> - <join-column name="fonction" referenced-column-name="id" /> + <many-to-one target-entity="Application\Entity\Db\Fonction" field="fonction"> + <join-column name="fonction_id" referenced-column-name="id"/> </many-to-one> - <field name="libelle" type="string" length="255" column="libelle" nullable="false"/> - <field name="genre" type="string" length="1" column="genre" nullable="false"/> - <field name="default" type="string" length="1" column="defaut" nullable="false"/> + <field name="libelle" column="libelle" type="string" length="128"/> + <field name="genre" column="genre" type="string" length="1"/> + <field name="defaut" column="defaut" type="string" length="1"/> - <field name="source" type="string" length="64" column="source" nullable="true"/> - <field name="idSource" type="string" length="64" column="id_source" nullable="true"/> - - - <field name="histoCreation" type="datetime" column="histo_creation" nullable="false"/> - <field name="histoModification" type="datetime" column="histo_modification" nullable="false"/> - <field name="histoDestruction" type="datetime" column="histo_destruction" nullable="true"/> - - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoCreateur"> - <join-column name="histo_createur_id" referenced-column-name="id"/> - </many-to-one> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoModificateur"> - <join-column name="histo_modificateur_id" referenced-column-name="id"/> - </many-to-one> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoDestructeur"> - <join-column name="histo_destructeur_id" referenced-column-name="id"/> - </many-to-one> + <field name="importationCreation" column="created_on" type="datetime" /> + <field name="importationModification" column="updated_on" type="datetime" /> + <field name="importationHistorisation" column="deleted_on" type="datetime" /> </entity> </doctrine-mapping> \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Grade.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Grade.dcm.xml index 0ecbc96eae6e3484d52103c496b7c67cf01c4daa..c2d087508c475afcff9ac98de8b91602198907b0 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Grade.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Grade.dcm.xml @@ -2,15 +2,13 @@ <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="Application\Entity\Db\Grade" table="grade"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="id" type="string" length="40"> </id> - <field name="libelle" type="string" length="256" column="libelle" nullable="false" /> - <field name="rang" type="integer" column="rang" nullable="true" /> - <many-to-one target-entity="Application\Entity\Db\Corps" field="corps"> - <join-column name="corps" referenced-column-name="id" /> - </many-to-one> + <field name="libelleCourt" column="lib_court" type="string" length="20" /> + <field name="libelleLong" column="lib_long" type="string" length="200" /> + <field name="code" column="code" type="string" length="10" /> + <field name="histo" column="histo" type="string" length="10" /> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Metier.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Metier.dcm.xml index 467d22be6aea1e7e2b8b511d3dffb1c9198677c5..e9127332ea8b5ca02df7084016cd7d356b9579d7 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Metier.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Metier.dcm.xml @@ -7,8 +7,12 @@ </id> <field name="libelle" type="string" length="128" column="libelle" nullable="false" /> - <many-to-one target-entity="Application\Entity\Db\MetierFamille" field="famille"> - <join-column name="famille" referenced-column-name="id" /> + <field name="fonction" type="string" length="128" column="fonction" nullable="false" /> + + <many-to-one target-entity="Application\Entity\Db\Domaine" field="domaine"> + <join-column name="domaine_id" referenced-column-name="id" /> </many-to-one> + + <one-to-many target-entity="Application\Entity\Db\FicheMetier" mapped-by="metier" field="fichesMetiers"/> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.MetierFamille.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.MetierFamille.dcm.xml deleted file mode 100644 index 0f3a52aa1dff8eb906ba66feef63411fc302c978..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.MetierFamille.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="Application\Entity\Db\MetierFamille" table="metier_famille"> - - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> - </id> - - <field name="libelle" type="string" length="128" column="libelle" nullable="false" /> - <field name="couleur" type="string" length="64" column="couleur" nullable="true" /> - - <one-to-many target-entity="Application\Entity\Db\Metier" field="metiers" mapped-by="famille"/> - - </entity> -</doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.StructureType.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.MissionSpecifique.dcm.xml similarity index 68% rename from module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.StructureType.dcm.xml rename to module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.MissionSpecifique.dcm.xml index e883ac5ce69e9f5240358a6d464f8f2125f901fc..b9ecac55be472f680b1dffd5d6032925d36da09c 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.StructureType.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.MissionSpecifique.dcm.xml @@ -1,13 +1,24 @@ <?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="Application\Entity\Db\StructureType" table="structure_type"> + <entity name="Application\Entity\Db\MissionSpecifique" table="mission_specifique"> <id name="id" type="integer" column="id"> <generator strategy="IDENTITY"/> </id> - <field name="code" type="string" length="255" column="code" nullable="false"/> - <field name="libelle" type="string" length="255" column="libelle" nullable="false"/> + <field name="libelle" type="string" length="256" column="libelle" nullable="false"/> + + <many-to-many field="agents" target-entity="Application\Entity\Db\Agent" inversed-by="agent" fetch="LAZY"> + <join-table name="agent_mission"> + <join-columns> + <join-column name="mission_id" referenced-column-name="id"/> + </join-columns> + <inverse-join-columns> + <join-column name="agent_id" referenced-column-name="c_individu"/> + </inverse-join-columns> + </join-table> + </many-to-many> + <field name="histoCreation" type="datetime" column="histo_creation" nullable="false"/> <field name="histoModification" type="datetime" column="histo_modification" nullable="false"/> @@ -23,5 +34,6 @@ <join-column name="histo_destructeur_id" referenced-column-name="id"/> </many-to-one> + </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Poste.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Poste.dcm.xml index 8486923614c734e004f388daa583fbd9a2e44a5f..5b33ae44a01af36d677cc586983e90bd49b0e964 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Poste.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Poste.dcm.xml @@ -7,11 +7,14 @@ </id> <field name="numeroPoste" type="string" length="128" column="numero_poste" nullable="true"/> - <field name="localisation" type="string" length="128" column="localisation" nullable="true"/> + <field name="fonction" type="string" length="128" column="fonction" nullable="true"/> <field name="lien" type="string" length="256" column="lien" nullable="true"/> + <many-to-one target-entity="Application\Entity\Db\Batiment" field="localisation"> + <join-column name="localisation" referenced-column-name="id" /> + </many-to-one> <many-to-one target-entity="Application\Entity\Db\Agent" field="rattachementHierarchique"> - <join-column name="rattachement_hierarchique" referenced-column-name="id" /> + <join-column name="rattachement_hierarchique" referenced-column-name="c_individu" /> </many-to-one> <many-to-one target-entity="Application\Entity\Db\Correspondance" field="correspondance"> <join-column name="correspondance" referenced-column-name="id" /> @@ -22,9 +25,5 @@ <many-to-one target-entity="Application\Entity\Db\Domaine" field="domaine"> <join-column name="domaine" referenced-column-name="id" /> </many-to-one> - <many-to-one target-entity="Application\Entity\Db\Fonction" field="fonction"> - <join-column name="fonction" referenced-column-name="id" /> - </many-to-one> - </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Site.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Site.dcm.xml new file mode 100644 index 0000000000000000000000000000000000000000..69c609e83b76a261beebe42f3baf1db0a7de9535 --- /dev/null +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Site.dcm.xml @@ -0,0 +1,18 @@ +<?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="Application\Entity\Db\Site" table="site"> + + <id name="id" column="id" type="string" length="40" > + </id> + + <field name="nom" column="nom" type="string" length="128"/> + <field name="libelle" column="libelle" type="string" length="128"/> + + <field name="importationCreation" column="created_on" type="datetime" /> + <field name="importationModification" column="updated_on" type="datetime" /> + <field name="importationHistorisation" column="deleted_on" type="datetime" /> + + <one-to-many target-entity="Application\Entity\Db\Batiment" mapped-by="site" field="batiments"/> + + </entity> +</doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml index 59dc32cdc3ec35c22868c94c45d673cce4169462..9a7d8612b64dfba9348a2cebd734fd531444dcbc 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml @@ -2,42 +2,20 @@ <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="Application\Entity\Db\Structure" table="structure"> - <id name="id" type="integer" column="id"> - <generator strategy="IDENTITY"/> + <id name="id" column="id" type="string" length="40" > </id> - <field name="libelleCourt" type="string" length="128" column="libelle_court" nullable="false"/> - <field name="libelleLong" type="string" length="2048" column="libelle_long" nullable="true"/> - <field name="sigle" type="string" length="32" column="sigle" nullable="true"/> + <field name="code" column="code" type="string" length="40" /> - <many-to-one target-entity="Application\Entity\Db\StructureType" field="type"> - <join-column name="structure_type" referenced-column-name="id"/> - </many-to-one> + <field name="libelleCourt" column="libelle_court" type="string" length="128"/> + <field name="libelleLong" column="libelle_long" type="string" length="1024"/> + <field name="type" column="type" type="string" length="128"/> + <field name="description" column="description" type="string" length="10240"/> + <field name="histo" column="histo" type="string" length="10" /> - <field name="dateOuverture" type="datetime" column="date_ouverture" nullable="false"/> - <field name="dateFermeture" type="datetime" column="date_fermeture" nullable="false"/> - -<!-- <many-to-one target-entity="Application\Entity\Db\Source" field="source">--> -<!-- <join-column name="source" referenced-column-name="id"/>--> -<!-- </many-to-one>--> - <field name="source" type="string" length="32" column="source" nullable="true"/> - <field name="idSource" type="string" length="128" column="source_id" nullable="false"/> - - <field name="histoCreation" type="datetime" column="histo_creation" nullable="false"/> - <field name="histoModification" type="datetime" column="histo_modification" nullable="false"/> - <field name="histoDestruction" type="datetime" column="histo_destruction" nullable="true"/> - - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoCreateur"> - <join-column name="histo_createur_id" referenced-column-name="id"/> - </many-to-one> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoModificateur"> - <join-column name="histo_modificateur_id" referenced-column-name="id"/> - </many-to-one> - <many-to-one target-entity="Utilisateur\Entity\Db\User" field="histoDestructeur"> - <join-column name="histo_destructeur_id" referenced-column-name="id"/> - </many-to-one> - - <field name="description" type="string" length="4096" column="description" nullable="true"/> + <field name="importationCreation" column="created_on" type="datetime" /> + <field name="importationModification" column="updated_on" type="datetime" /> + <field name="importationHistorisation" column="deleted_on" type="datetime" /> <many-to-many field="gestionnaires" target-entity="Utilisateur\Entity\Db\User" inversed-by="gestionnaire" fetch="LAZY"> <join-table name="structure_gestionnaire"> diff --git a/module/Application/src/Application/Entity/Db/Metier.php b/module/Application/src/Application/Entity/Db/Metier.php index 7e4f3d98594386d2af2b1f9703916ba4c56a89cd..4df52b939e9fdce8eb22707c827d3eb90ee1be7d 100644 --- a/module/Application/src/Application/Entity/Db/Metier.php +++ b/module/Application/src/Application/Entity/Db/Metier.php @@ -2,14 +2,28 @@ namespace Application\Entity\Db; +use Doctrine\Common\Collections\ArrayCollection; + class Metier { /** @var integer */ private $id; /** @var string */ private $libelle; - /** @var MetierFamille */ - private $famille; + + /** @var Domaine */ + private $domaine; + /** @var string */ + private $fonction; + + + /** @var ArrayCollection (FicheMetierType) */ + private $fichesMetiers; + + public function __construct() + { + $this->fichesMetiers = new ArrayCollection(); + } /** * @return int @@ -36,20 +50,38 @@ class Metier { } /** - * @return MetierFamille + * @return string */ - public function getFamille() + public function getFonction() { - return $this->famille; + return $this->fonction; } /** - * @param MetierFamille $famille + * @param string $fonction * @return Metier */ - public function setFamille($famille) + public function setFonction($fonction) { - $this->famille = $famille; + $this->fonction = $fonction; + return $this; + } + + /** + * @return Domaine + */ + public function getDomaine() + { + return $this->domaine; + } + + /** + * @param Domaine $domaine + * @return Metier + */ + public function setDomaine($domaine) + { + $this->domaine = $domaine; return $this; } @@ -58,5 +90,12 @@ class Metier { return $this->getLibelle(); } + /** + * @return ArrayCollection + */ + public function getFichesMetiers() + { + return $this->fichesMetiers; + } } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/MissionSpecifique.php b/module/Application/src/Application/Entity/Db/MissionSpecifique.php new file mode 100644 index 0000000000000000000000000000000000000000..cbd0745153a5c810d98c8390b14ff116de19654d --- /dev/null +++ b/module/Application/src/Application/Entity/Db/MissionSpecifique.php @@ -0,0 +1,86 @@ +<?php + +namespace Application\Entity\Db; + +use Doctrine\Common\Collections\ArrayCollection; +use UnicaenApp\Entity\HistoriqueAwareTrait; + +class MissionSpecifique { + use HistoriqueAwareTrait; + + /** @var integer */ + private $id; + /** @var string */ + private $libelle; + /** @var ArrayCollection */ + private $agents; + + public function __construct() + { + $this->agents = new ArrayCollection(); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $id + * @return MissionSpecifique + */ + public function setId($id) + { + $this->id = $id; + return $this; + } + + /** + * @return string + */ + public function getLibelle() + { + return $this->libelle; + } + + /** + * @param string $libelle + * @return MissionSpecifique + */ + public function setLibelle($libelle) + { + $this->libelle = $libelle; + return $this; + } + + /** + * @return Agent[] + */ + public function getAgents() + { + return $this->agents->toArray(); + } + + /** + * @param Agent $agent + * @return MissionSpecifique + */ + public function addAgent($agent) + { + $this->agents->add($agent); + return $this; + } + + /** + * @param Agent $agent + * @return MissionSpecifique + */ + public function removeAgent($agent) + { + $this->agents->removeElement($agent); + return $this; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Poste.php b/module/Application/src/Application/Entity/Db/Poste.php index 7abb53686d4f55812d001acf6404886091d7af09..2bc538561533df79b7b7172e72eb9e41b053715c 100644 --- a/module/Application/src/Application/Entity/Db/Poste.php +++ b/module/Application/src/Application/Entity/Db/Poste.php @@ -10,7 +10,7 @@ class Poste { private $numeroPoste; /** @var Structure */ private $structure; - /** @var string */ + /** @var Batiment */ private $localisation; /** @var Correspondance */ private $correspondance; @@ -20,7 +20,7 @@ class Poste { private $domaine; /** @var string */ private $lien; - /** @var Fonction */ + /** @var string */ private $fonction; /** @@ -68,7 +68,7 @@ class Poste { } /** - * @return string + * @return Batiment */ public function getLocalisation() { @@ -76,7 +76,7 @@ class Poste { } /** - * @param string $localisation + * @param Batiment $localisation * @return Poste */ public function setLocalisation($localisation) @@ -158,7 +158,7 @@ class Poste { } /** - * @return Fonction + * @return string */ public function getFonction() { @@ -166,7 +166,7 @@ class Poste { } /** - * @param Fonction $fonction + * @param string $fonction * @return Poste */ public function setFonction($fonction) diff --git a/module/Application/src/Application/Entity/Db/MetierFamille.php b/module/Application/src/Application/Entity/Db/Site.php similarity index 50% rename from module/Application/src/Application/Entity/Db/MetierFamille.php rename to module/Application/src/Application/Entity/Db/Site.php index 0b9493927d90a84b36c0a05f7baea4dd8fc94a8d..263bf95e42dd47670046acbb073d36d59c98bfb2 100644 --- a/module/Application/src/Application/Entity/Db/MetierFamille.php +++ b/module/Application/src/Application/Entity/Db/Site.php @@ -4,28 +4,26 @@ namespace Application\Entity\Db; use Doctrine\Common\Collections\ArrayCollection; -class MetierFamille { +class Site { + use ImportableAwareTrait; - /** @var integer */ + /** @var string */ private $id; /** @var string */ - private $libelle; + private $nom; /** @var string */ - private $couleur; + private $libelle; /** @var ArrayCollection */ - private $metiers; + private $batiments; - /** - * MetierFamille constructor. - */ public function __construct() { - $this->metiers = new ArrayCollection(); + $this->batiments = new ArrayCollection(); } /** - * @return int + * @return string */ public function getId() { @@ -35,65 +33,64 @@ class MetierFamille { /** * @return string */ - public function getLibelle() + public function getNom() { - return $this->libelle; + return $this->nom; } /** - * @param string $libelle - * @return MetierFamille + * @param string $nom + * @return Site */ - public function setLibelle($libelle) + public function setNom($nom) { - $this->libelle = $libelle; + $this->nom = $nom; return $this; } /** * @return string */ - public function getCouleur() + public function getLibelle() { - return $this->couleur; + return $this->libelle; } /** - * @param string $couleur - * @return MetierFamille + * @param string $libelle + * @return Site */ - public function setCouleur($couleur) + public function setLibelle($libelle) { - $this->couleur = $couleur; + $this->libelle = $libelle; return $this; } /** - * @return ArrayCollection + * @return Batiment[] */ - public function getMetiers() + public function getBatiments() { - return $this->metiers; + return $this->batiments->toArray(); } /** - * @param Metier $metier - * @return MetierFamille + * @param Batiment $batiment + * @return Site */ - public function addMetier($metier) + public function addBatiment($batiment) { - $this->metiers->add($metier); + $this->batiments->add($batiment); return $this; } /** - * @param Metier $metier - * @return MetierFamille + * @param Batiment $batiment + * @return Site */ - public function removeMetier($metier) + public function removeBatiment($batiment) { - $this->metiers->removeElement($metier); + $this->batiments->removeElement($batiment); return $this; } - } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Structure.php b/module/Application/src/Application/Entity/Db/Structure.php index e5629b73c1cc4f27b3ff3e22f1a7b227e3721ead..14450a24cefc0af5e682a0215d1ded6e991d5e7e 100644 --- a/module/Application/src/Application/Entity/Db/Structure.php +++ b/module/Application/src/Application/Entity/Db/Structure.php @@ -4,33 +4,27 @@ namespace Application\Entity\Db; use DateTime; use Doctrine\Common\Collections\ArrayCollection; -use UnicaenApp\Entity\HistoriqueAwareTrait; use Utilisateur\Entity\Db\User; class Structure { - use HistoriqueAwareTrait; + use ImportableAwareTrait; - /** @var integer */ + /** @var string */ private $id; /** @var string */ + private $code; + /** @var string */ private $libelleCourt; /** @var string */ private $libelleLong; /** @var string */ - private $sigle; - /** @var StructureType */ private $type; - /** @var DateTime */ - private $dateOuverture; - /** @var DateTime */ - private $dateFermeture; - /** @var string */ - private $source; /** @var string */ - private $idSource; + private $histo; + + /** @var string */ private $description; - /** @var ArrayCollection */ private $gestionnaires; @@ -40,69 +34,69 @@ class Structure { } /** - * @return int + * @return string */ public function getId() { return $this->id; } - /** + /** * @return string */ - public function getLibelleCourt() + public function getCode() { - return $this->libelleCourt; + return $this->code; } /** - * @param string $libelleCourt + * @param string $code * @return Structure */ - public function setLibelleCourt($libelleCourt) + public function setCode($code) { - $this->libelleCourt = $libelleCourt; + $this->code = $code; return $this; } /** * @return string */ - public function getLibelleLong() + public function getLibelleCourt() { - return $this->libelleLong; + return $this->libelleCourt; } /** - * @param string $libelleLong + * @param string $libelleCourt * @return Structure */ - public function setLibelleLong($libelleLong) + public function setLibelleCourt($libelleCourt) { - $this->libelleLong = $libelleLong; + $this->libelleCourt = $libelleCourt; return $this; } /** * @return string */ - public function getSigle() + public function getLibelleLong() { - return $this->sigle; + return $this->libelleLong; } /** - * @param string $sigle + * @param string $libelleLong * @return Structure */ - public function setSigle($sigle) + public function setLibelleLong($libelleLong) { - $this->sigle = $sigle; + $this->libelleLong = $libelleLong; return $this; } /** - * @return StructureType + * @return string */ public function getType() { @@ -110,7 +104,7 @@ class Structure { } /** - * @param StructureType $type + * @param string $type * @return Structure */ public function setType($type) @@ -120,128 +114,76 @@ class Structure { } /** - * @return DateTime + * @return string */ - public function getDateOuverture() + public function getDescription() { - return $this->dateOuverture; + return $this->description; } /** - * @param DateTime $dateOuverture + * @param string $description * @return Structure */ - public function setDateOuverture($dateOuverture) + public function setDescription($description) { - $this->dateOuverture = $dateOuverture; + $this->description = $description; return $this; } /** - * @return DateTime + * @return User[] */ - public function getDateFermeture() + public function getGestionnaires() { - return $this->dateFermeture; + return $this->gestionnaires->toArray(); } /** - * @param DateTime $dateFermeture + * @param User $user * @return Structure */ - public function setDateFermeture($dateFermeture) + public function addGestionnaire($user) { - $this->dateFermeture = $dateFermeture; + $this->gestionnaires->add($user); return $this; } /** - * @return string - */ - public function getSource() - { - return $this->source; - } - - /** - * @param string $source + * @param User $user * @return Structure */ - public function setSource($source) + public function removeGestionnaire($user) { - $this->source = $source; + $this->gestionnaires->removeElement($user); return $this; } /** * @return string */ - public function getIdSource() + public function getHisto() { - return $this->idSource; + return $this->histo; } /** - * @param string $idSource + * @param string $histo * @return Structure */ - public function setIdSource($idSource) + public function setHisto($histo) { - $this->idSource = $idSource; + $this->histo = $histo; return $this; } /** * @return string */ - public function getDescription() - { - return $this->description; - } - - /** - * @param string $description - * @return Structure - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * @return User[] - */ - public function getGestionnaires() { - return $this->gestionnaires->toArray(); - } - - /** - * @param User $gestionnaire - */ - public function addGestionnaire($gestionnaire) { - $this->gestionnaires->add($gestionnaire); - } - - /** - * @param User $gestionnaire - */ - public function removeGestionnaire($gestionnaire) { - $this->gestionnaires->removeElement($gestionnaire); - } - - /** - * @param User $gestionnaire - * @return boolean - */ - public function hasGestionnaire($gestionnaire) { - return $this->gestionnaires->contains($gestionnaire); - } - public function __toString() { $text = ""; - $text .= "[".$this->getType()->getCode()."] "; + $text .= "[".$this->getType()."] "; $text .= $this->getLibelleCourt(); return $text; } diff --git a/module/Application/src/Application/Entity/Db/StructureType.php b/module/Application/src/Application/Entity/Db/StructureType.php deleted file mode 100644 index 47978e1b0cc68515a0d9797bbde680eae522139f..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Entity/Db/StructureType.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -namespace Application\Entity\Db; - -use UnicaenApp\Entity\HistoriqueAwareTrait; - -class StructureType { - use HistoriqueAwareTrait; - - /** @var integer */ - private $id; - /** @var string */ - private $code; - /** @var string */ - private $libelle; - - /** - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * @return string - */ - public function getCode() - { - return $this->code; - } - - /** - * @param string $code - * @return StructureType - */ - public function setCode($code) - { - $this->code = $code; - return $this; - } - - /** - * @return string - */ - public function getLibelle() - { - return $this->libelle; - } - - /** - * @param string $libelle - * @return StructureType - */ - public function setLibelle($libelle) - { - $this->libelle = $libelle; - return $this; - } - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/Activite/ActiviteForm.php b/module/Application/src/Application/Form/Activite/ActiviteForm.php index e249733d851899ffa5350497c7ff6f0805fe3b33..1084f5f7351e73258e6612bce5176878f2a8a3c7 100644 --- a/module/Application/src/Application/Form/Activite/ActiviteForm.php +++ b/module/Application/src/Application/Form/Activite/ActiviteForm.php @@ -2,11 +2,14 @@ namespace Application\Form\Activite; +use Application\Service\Application\ApplicationServiceAwareTrait; use Zend\Form\Element\Button; +use Zend\Form\Element\Select; use Zend\Form\Element\Text; use Zend\Form\Form; class ActiviteForm extends Form { + use ApplicationServiceAwareTrait; public function init() { @@ -35,6 +38,22 @@ class ActiviteForm extends Form { 'class' => 'type2 form-control', ] ]); + $this->add([ + 'name' => 'applications', + 'type' => Select::class, + 'options' => [ + 'label' => 'Applications : ', + 'label_attributes' => [ + 'class' => 'control-label', + ], + 'value_options' => $this->getApplicationOptions() + ], + 'attributes' => [ + 'class' => 'description form-control', + 'style' => 'height:300px;', + 'multiple' => 'multiple', + ] + ]); // button $this->add([ 'type' => Button::class, @@ -51,4 +70,14 @@ class ActiviteForm extends Form { ], ]); } + + private function getApplicationOptions() + { + $applications = $this->getApplicationService()->getApplications('libelle'); + $options = []; + foreach ($applications as $application) { + $options[$application->getId()] = $application->getLibelle(); + } + return $options; + } } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Activite/ActiviteFormFactory.php b/module/Application/src/Application/Form/Activite/ActiviteFormFactory.php index 0ba25ebca2d27e923e1a67f43d5492cf1c1da31c..e63febcf24d01e762f979486f1ae550d3e32fb8c 100644 --- a/module/Application/src/Application/Form/Activite/ActiviteFormFactory.php +++ b/module/Application/src/Application/Form/Activite/ActiviteFormFactory.php @@ -2,16 +2,23 @@ namespace Application\Form\Activite; +use Application\Service\Application\ApplicationService; use Zend\Form\FormElementManager; class ActiviteFormFactory { public function __invoke(FormElementManager $manager) { - /** @var ActiviteHydrator $hydrator */ + /** + * @var ApplicationService $applicationService + * @var ActiviteHydrator $hydrator + */ $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(ActiviteHydrator::class); + $applicationService = $manager->getServiceLocator()->get(ApplicationService::class); + $form = new ActiviteForm(); + $form->setApplicationService($applicationService); $form->init(); $form->setHydrator($hydrator); diff --git a/module/Application/src/Application/Form/Activite/ActiviteHydrator.php b/module/Application/src/Application/Form/Activite/ActiviteHydrator.php index 0c306b0b4f1cc8aa7d8ab9715ca4a1b89b40f637..3e5aa814ebc53427c27e6d734775f409c2155059 100644 --- a/module/Application/src/Application/Form/Activite/ActiviteHydrator.php +++ b/module/Application/src/Application/Form/Activite/ActiviteHydrator.php @@ -3,9 +3,11 @@ namespace Application\Form\Activite; use Application\Entity\Db\Activite; +use Application\Service\Application\ApplicationServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class ActiviteHydrator implements HydratorInterface { + use ApplicationServiceAwareTrait; /** * @param Activite $object @@ -13,9 +15,15 @@ class ActiviteHydrator implements HydratorInterface { */ public function extract($object) { + $formationIds = []; + foreach ($object->getApplications() as $application) { + $formationIds[] = $application->getId(); + } + $data = [ 'libelle' => $object->getLibelle(), 'description' => $object->getDescription(), + 'applications' => $formationIds, ]; return $data; } @@ -29,6 +37,14 @@ class ActiviteHydrator implements HydratorInterface { { $object->setLibelle($data['libelle']); $object->setDescription($data['description']); + + foreach ($object->getApplications() as $application) { + $object->removeApplication($application); + } + foreach ($data['applications'] as $id) { + $application = $this->getApplicationService()->getApplication($id); + if ($application) $object->addApplication($application); + } return $object; } diff --git a/module/Application/src/Application/Form/Activite/ActiviteHydratorFactory.php b/module/Application/src/Application/Form/Activite/ActiviteHydratorFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..339b9979848530863f4ab50da36b9a47f3ce1639 --- /dev/null +++ b/module/Application/src/Application/Form/Activite/ActiviteHydratorFactory.php @@ -0,0 +1,23 @@ +<?php + +namespace Application\Form\Activite; + +use Application\Service\Application\ApplicationService; +use Zend\Form\FormElementManager; +use Zend\Stdlib\Hydrator\HydratorPluginManager; + +class ActiviteHydratorFactory { + + public function __invoke(HydratorPluginManager $manager) + { + /** + * @var ApplicationService $applicationService + */ + $applicationService = $manager->getServiceLocator()->get(ApplicationService::class); + + $hydrator = new ActiviteHydrator(); + $hydrator->setApplicationService($applicationService); + + return $hydrator; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/Agent/AgentForm.php b/module/Application/src/Application/Form/Agent/AgentForm.php index 9ead24516f316a10bc72ac865ed892a015cb487b..a3cebe226696068a26925c58f0de0edb418e3a54 100644 --- a/module/Application/src/Application/Form/Agent/AgentForm.php +++ b/module/Application/src/Application/Form/Agent/AgentForm.php @@ -2,232 +2,63 @@ namespace Application\Form\Agent; -use Application\Entity\Db\AgentStatus; -use Application\Entity\Db\Corps; -use Application\Entity\Db\Correspondance; -use Application\Entity\Db\Grade; -use DoctrineModule\Form\Element\ObjectSelect; -use UnicaenApp\Form\Element\Date; -use UnicaenApp\Service\EntityManagerAwareTrait; +use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Zend\Form\Element\Button; use Zend\Form\Element\Select; -use Zend\Form\Element\Text; use Zend\Form\Form; -use Zend\InputFilter\Factory; class AgentForm extends Form { - use EntityManagerAwareTrait; + use RessourceRhServiceAwareTrait; public function init() { - // prenom - $this->add([ - 'type' => Text::class, - 'name' => 'prenom', - 'options' => [ - 'label' => "Prénom* :", - ], - 'attributes' => [ - 'id' => 'prenom', - ], - ]); - // nom - $this->add([ - 'type' => Text::class, - 'name' => 'nom', - 'options' => [ - 'label' => "Nom* :", - ], - 'attributes' => [ - 'id' => 'nom', - ], - ]); - // numeroPoste - $this->add([ - 'type' => Text::class, - 'name' => 'numeroPoste', - 'options' => [ - 'label' => "Numero de poste :", - ], - 'attributes' => [ - 'id' => 'numeroPoste', - ], - ]); - // date de début - $this->add([ - 'type' => Date::class, - 'name' => 'dateDebut', - 'options' => [ - 'label' => "Date de début* :", - 'label_attributes' => [ - 'class' => 'control-label', - ], - 'format' => 'd/m/Y' - ], - 'attributes' => [ - 'id' => 'dateDebut', - 'class' => 'form-control' - ], - ]); - - // date de fin - $this->add([ - 'type' => Date::class, - 'name' => 'dateFin', - 'options' => [ - 'label' => "Date de fin :", - 'label_attributes' => [ - 'class' => 'control-label', - ], - 'format' => 'd/m/Y' - ], - 'attributes' => [ - 'id' => 'dateFin', - 'class' => 'form-control' - ], - ]); - // quotite + //Quotité $this->add([ 'type' => Select::class, 'name' => 'quotite', 'options' => [ - 'label' => "Quotite travaillée* :", + 'label' => 'Quotité travaillée* :', + 'empty_option' => "Sélectionner une quotité ...", 'value_options' => [ - '100' => '100 % ', - '90' => ' 90 % ', - '80' => ' 80 % ', - '70' => ' 70 % ', - '60' => ' 60 % ', - '50' => ' 50 % ', + 20 => ' 20 %', + 30 => ' 30 %', + 40 => ' 40 %', + 50 => ' 50 %', + 60 => ' 60 %', + 70 => ' 70 %', + 80 => ' 80 %', + 90 => ' 90 %', + 100 => '100 %', ], ], 'attributes' => [ - 'id' => 'quotite', + 'id' => 'quotite', 'class' => 'bootstrap-selectpicker show-tick', 'data-live-search' => 'true', ], ]); - // Status - $this->add([ - 'type' => ObjectSelect::class, - 'name' => 'status', - 'options' => [ - 'label' => "Status de l'agent* :", - 'empty_option' => "Sélectionner un status ...", - 'object_manager' => $this->getEntityManager(), - 'target_class' => AgentStatus::class, - 'property' => 'libelle', - 'find_method' => [ - 'name' => 'findBy', - 'params' => [ - 'criteria' => [], - 'orderBy' => ['libelle' => 'ASC'], - ], - ], - 'disable_inarray_validator' => true, - ], - 'attributes' => [ - 'id' => 'status', - 'class' => 'bootstrap-selectpicker show-tick', - 'data-live-search' => 'true', - ], - ]); - // Status + + //MissionSpecifique $this->add([ - 'type' => ObjectSelect::class, - 'name' => 'correspondance', + 'type' => Select::class, + 'name' => 'missions', 'options' => [ - 'label' => "Correspondance* :", - 'empty_option' => "Sélectionner une correspondance ...", - 'object_manager' => $this->getEntityManager(), - 'target_class' => Correspondance::class, - 'property' => 'libelle', - 'find_method' => [ - 'name' => 'findBy', - 'params' => [ - 'criteria' => [], - 'orderBy' => ['libelle' => 'ASC'], - ], - ], - 'disable_inarray_validator' => true, + 'label' => 'Missions spécifiques :', + 'value_options' => $this->getRessourceRhService()->getMisssionsSpecifiquesAsOption(), ], 'attributes' => [ - 'id' => 'correspondance', + 'id' => 'missions', 'class' => 'bootstrap-selectpicker show-tick', - 'data-live-search' => 'true', - ], - ]); - // Corps - $this->add([ - 'type' => ObjectSelect::class, - 'name' => 'corps', - 'options' => [ - 'label' => "Corps* :", - 'empty_option' => "Sélectionner un corps ...", - 'object_manager' => $this->getEntityManager(), - 'target_class' => Corps::class, - 'property' => 'libelle', - 'find_method' => [ - 'name' => 'findBy', - 'params' => [ - 'criteria' => [], - 'orderBy' => ['libelle' => 'ASC'], - ], - ], - 'disable_inarray_validator' => true, - ], - 'attributes' => [ - 'id' => 'corps', - //'class' => 'bootstrap-selectpicker show-tick', - //'data-live-search' => 'true', - ], - ]); - // Grade - $this->add([ - 'type' => ObjectSelect::class, - 'name' => 'grade', - 'options' => [ - 'label' => "Grade* :", - 'empty_option' => "Sélectionner un grade ...", - 'object_manager' => $this->getEntityManager(), - 'target_class' => Grade::class, - 'property' => 'libelle', - 'find_method' => [ - 'name' => 'findBy', - 'params' => [ - 'criteria' => [], - 'orderBy' => ['libelle' => 'ASC'], - ], - ], - 'disable_inarray_validator' => true, - ], - 'attributes' => [ - 'id' => 'grade', - //'class' => 'bootstrap-selectpicker show-tick', - //'data-live-search' => 'true', + 'multiple' => 'multiple', ], ]); - // description - $this->add([ - 'name' => 'description', - 'type' => 'textarea', - 'options' => [ - 'label' => 'Missions complémentaires : ', - 'label_attributes' => [ - 'class' => 'control-label', - ], - ], - 'attributes' => [ - 'class' => 'type2 form-control', - ] - ]); - // button + //Bouton $this->add([ 'type' => Button::class, 'name' => 'creer', 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer l\'agent', + 'label' => '<i class="fas fa-save"></i> Enregistrer', 'label_options' => [ 'disable_html_escape' => true, ], @@ -238,40 +69,5 @@ class AgentForm extends Form { ], ]); - $this->setInputFilter((new Factory())->createInputFilter([ - 'nom' => [ - 'required' => true, - ], - 'prenom' => [ - 'required' => true, - ], - 'numeroPoste' => [ - 'required' => false, - ], - 'quotite' => [ - 'required' => true, - ], - 'dateDebut' => [ - 'required' => true, - ], - 'dateFin' => [ - 'required' => false, - ], - 'status' => [ - 'required' => true, - ], - 'correspondance' => [ - 'required' => true, - ], - 'corps' => [ - 'required' => true, - ], - 'grade' => [ - 'required' => true, - ], - 'missions' => [ - 'required' => false, - ], - ])); } } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Agent/AgentFormAwareTrait.php b/module/Application/src/Application/Form/Agent/AgentFormAwareTrait.php index 9d64487f3b98b30b2ab558fdd5ab2c95667d231d..b058114ae0d7527530ad9c28e646eecf3933e187 100644 --- a/module/Application/src/Application/Form/Agent/AgentFormAwareTrait.php +++ b/module/Application/src/Application/Form/Agent/AgentFormAwareTrait.php @@ -4,8 +4,8 @@ namespace Application\Form\Agent; trait AgentFormAwareTrait { - /** @var AgentForm $agentForm */ - private $agentForm; + /** @var AgentForm */ + private $agentForm; /** * @return AgentForm @@ -24,4 +24,6 @@ trait AgentFormAwareTrait { $this->agentForm = $agentForm; return $this->agentForm; } + + } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Agent/AgentFormFactory.php b/module/Application/src/Application/Form/Agent/AgentFormFactory.php index 08d519515a597802e85d83907c96c47642c07374..955c079549bf5c2b0b104e9c444f65cab4a485da 100644 --- a/module/Application/src/Application/Form/Agent/AgentFormFactory.php +++ b/module/Application/src/Application/Form/Agent/AgentFormFactory.php @@ -2,25 +2,24 @@ namespace Application\Form\Agent; -use Doctrine\ORM\EntityManager; +use Application\Service\RessourceRh\RessourceRhService; use Zend\Form\FormElementManager; class AgentFormFactory { public function __invoke(FormElementManager $manager) { - /** - * @var EntityManager $entityManager - * @var AgentHydrator $hydrator - */ + /** @var AgentHydrator $hydrator */ $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(AgentHydrator::class); - $entityManager = $manager->getServiceLocator()->get('doctrine.entitymanager.orm_default'); + /** @var RessourceRhService $ressourceService */ + $ressourceService = $manager->getServiceLocator()->get(RessourceRhService::class); + + /** @var AgentForm $form */ $form = new AgentForm(); - $form->setEntityManager($entityManager); + $form->setRessourceRhService($ressourceService); $form->setHydrator($hydrator); $form->init(); - return $form; } } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Agent/AgentHydrator.php b/module/Application/src/Application/Form/Agent/AgentHydrator.php index 28e23206a63d574d09e9812eae4ae2d85ab52e33..d76446eb6007a9796b93d57ba02fd86e6ba002de 100644 --- a/module/Application/src/Application/Form/Agent/AgentHydrator.php +++ b/module/Application/src/Application/Form/Agent/AgentHydrator.php @@ -4,7 +4,6 @@ namespace Application\Form\Agent; use Application\Entity\Db\Agent; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; -use DateTime; use Zend\Stdlib\Hydrator\HydratorInterface; class AgentHydrator implements HydratorInterface { @@ -16,20 +15,15 @@ class AgentHydrator implements HydratorInterface { */ public function extract($object) { + $missionId = []; + foreach ($object->getMissions() as $mission) { + $missionId[] = $mission->getId(); + } + $data = [ - 'nom' => $object->getNom(), - 'prenom' => $object->getPrenom(), - 'numeroPoste' => $object->getNumeroPoste(), - 'dateDebut' => ($object->getDateDebut())?$object->getDateDebut()->format("d/m/Y"):"", - 'dateFin' => ($object->getDateFin())?$object->getDateFin()->format("d/m/Y"):"", - 'quotite' => $object->getQuotite(), - 'status' => $object->getStatus(), - 'correspondance' => $object->getCorrespondance(), - 'corps' => $object->getCorps(), - 'grade' => $object->getGrade(), - 'description' => $object->getMissionsComplementaires(), + 'quotite' => $object->getQuotite(), + 'missions' => $missionId, ]; - return $data; } @@ -40,28 +34,14 @@ class AgentHydrator implements HydratorInterface { */ public function hydrate(array $data, $object) { - $status = $this->getRessourceRhService()->getAgentStatus($data['status']); - $correspondance = $this->getRessourceRhService()->getCorrespondance($data['correspondance']); - $corps = $this->getRessourceRhService()->getCorps($data['corps']); - $grade = $this->getRessourceRhService()->getGrade($data['grade']); - - $object->setPrenom($data['prenom']); - $object->setNom($data['nom']); - $object->setNumeroPoste($data['numeroPoste']); $object->setQuotite($data['quotite']); - if ($data['dateDebut']) { - $date = DateTime::createFromFormat('d/m/Y', $data['dateDebut']); - $object->setDateDebut($date); - } - if ($data['dateFin']) { - $date = DateTime::createFromFormat('d/m/Y', $data['dateFin']); - $object->setDateFin($date); + + foreach ($object->getMissions() as $mission) $object->removeMission($mission); + + foreach ($data['missions'] as $missionId) { + $mission = $this->getRessourceRhService()->getMissionSpecifique($missionId); + $object->addMission($mission); } - $object->setStatus($status); - $object->setCorrespondance($correspondance); - $object->setCorps($corps); - $object->setGrade($grade); - $object->setMissionsComplementaires($data['description']); return $object; } diff --git a/module/Application/src/Application/Form/Agent/AgentHydratorFactory.php b/module/Application/src/Application/Form/Agent/AgentHydratorFactory.php index 773f62d29c83336fbb785841c491fa985dcea906..4e15487cc51a600b34f1022f2136dbd4a7ad2ea7 100644 --- a/module/Application/src/Application/Form/Agent/AgentHydratorFactory.php +++ b/module/Application/src/Application/Form/Agent/AgentHydratorFactory.php @@ -3,20 +3,22 @@ namespace Application\Form\Agent; use Application\Service\RessourceRh\RessourceRhService; -use Zend\ServiceManager\ServiceLocatorInterface; +use Zend\Stdlib\Hydrator\HydratorPluginManager; -class AgentHydratorFactory { +class AgentHydratorFactory { - public function __invoke(ServiceLocatorInterface $serviceLocator) - { - /** @var ServiceLocatorInterface $parentLocator */ - $parentLocator = $serviceLocator->getServiceLocator(); - /** @var RessourceRhService $ressourceService */ - $ressourceService = $parentLocator->get(RessourceRhService::class); + public function __invoke(HydratorPluginManager $manager) { - $hydrator = new AgentHydrator(); - $hydrator->setRessourceRhService($ressourceService); + /** + * @var RessourceRhService $ressourceService + */ + $ressourceService = $manager->getServiceLocator()->get(RessourceRhService::class); + /** @var AgentHydrator $hydrator */ + $hydrator = new AgentHydrator; + $hydrator->setRessourceRhService($ressourceService); return $hydrator; } + + } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Agent/AgentImportForm.php b/module/Application/src/Application/Form/Agent/AgentImportForm.php deleted file mode 100644 index 90a0231f66942b11de8696a9c14fac5d53ec7dbb..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/Agent/AgentImportForm.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Application\Form\Agent; - -use Application\Form\AutocompleteAwareTrait; -use UnicaenApp\Form\Element\SearchAndSelect; -use Zend\Form\Element\Button; -use Zend\Form\Form; - -class AgentImportForm extends Form { - - - use AutocompleteAwareTrait; - - public function init() - { - $sas = new SearchAndSelect('agent'); - $sas->setLabel('Agent provenant d\'Octopus'); - $sas->setAttribute('placeholder','Recherchez un agent'); - $sas->setAttribute('class', 'individu-finder'); - $sas->setLabelOption('disable_html_escape', false); - - $sas->setAutocompleteSource($this->getAutocomplete()); - $this->add($sas); - - // button - $this->add([ - 'type' => Button::class, - 'name' => 'creer', - 'options' => [ - 'label' => '<i class="fas fa-user-cog"></i> Importer l\'agent', - 'label_options' => [ - 'disable_html_escape' => true, - ], - ], - 'attributes' => [ - 'type' => 'submit', - 'class' => 'btn btn-primary', - ], - ]); - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/Agent/AgentImportFormAwareTrait.php b/module/Application/src/Application/Form/Agent/AgentImportFormAwareTrait.php deleted file mode 100644 index 0e965e9c1a3ecc82552ccc2f05844ff1a8f7ad4a..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/Agent/AgentImportFormAwareTrait.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Application\Form\Agent; - -trait AgentImportFormAwareTrait { - - /** @var AgentImportForm $agentImportForm */ - private $agentImportForm; - - /** - * @return AgentImportForm - */ - public function getAgentImportForm() - { - return $this->agentImportForm; - } - - /** - * @param AgentImportForm $agentImportForm - * @return AgentImportForm - */ - public function setAgentImportForm($agentImportForm) - { - $this->agentImportForm = $agentImportForm; - return $this->agentImportForm; - } - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/Agent/AgentImportFormFactory.php b/module/Application/src/Application/Form/Agent/AgentImportFormFactory.php deleted file mode 100644 index 69137538746b4aeaee5923408e93a9391058d15f..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/Agent/AgentImportFormFactory.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Application\Form\Agent; - -use Zend\Form\FormElementManager; - -class AgentImportFormFactory { - - public function __invoke(FormElementManager $manager) - { - - /** @var AgentImportForm $form */ - $form = new AgentImportForm(); - $form->setAutocomplete($manager->getServiceLocator()->get('view_renderer')->url('agent/rechercher-individu',[],[], true)); - $form->init(); - - return $form; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierForm.php b/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierForm.php index 1e91c4297bca1309ebf54272b535dc146841f6b6..8d27bfb73cdca08fdde753e221ea0b029a04b0cf 100644 --- a/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierForm.php +++ b/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierForm.php @@ -7,6 +7,7 @@ use Zend\Form\Element\Button; use Zend\Form\Element\Checkbox; use Zend\Form\Element\Select; use Zend\Form\Form; +use Zend\InputFilter\Factory; class AjouterFicheMetierForm extends Form { use FicheMetierServiceAwareTrait; @@ -19,6 +20,7 @@ class AjouterFicheMetierForm extends Form { 'name' => 'fiche_type', 'options' => [ 'label' => "Fiche type :", + 'empty_option' => 'Sélectionner une fiche type ...', 'value_options' => $this->generateFicheTypeOptions(), ], 'attributes' => [ @@ -33,6 +35,7 @@ class AjouterFicheMetierForm extends Form { 'name' => 'quotite', 'options' => [ 'label' => "Quotité* :", + 'empty_option' => 'Préciser la quotité associée ...', 'value_options' => $this->generateQuotiteOptions(), ], 'attributes' => [ @@ -67,13 +70,17 @@ class AjouterFicheMetierForm extends Form { 'class' => 'btn btn-primary', ], ]); + + $this->setInputFilter((new Factory())->createInputFilter([ + 'fiche_type' => [ 'required' => true, ], + 'quotite' => [ 'required' => true, ], + ])); } private function generateFicheTypeOptions() { - $fiches = $this->getFicheMetierService()->getFichesMetiersTypes(); + $fiches = $this->getFicheMetierService()->getFichesMetiers(); $options = []; - $options[0] = "Sélectionner une fiche type ... "; foreach ($fiches as $fiche) { $options[$fiche->getId()] = $fiche->getMetier()->getLibelle(); } diff --git a/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierHydrator.php b/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierHydrator.php index bce90b44316c8889763c60ae5a1388fc00bfe094..f8f91de99c55fc2f8d4d192166eaf1f51851cac7 100644 --- a/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierHydrator.php +++ b/module/Application/src/Application/Form/AjouterFicheMetier/AjouterFicheMetierHydrator.php @@ -30,7 +30,7 @@ class AjouterFicheMetierHydrator implements HydratorInterface { */ public function hydrate(array $data, $object) { - $ficheType = $this->getFicheMetierService()->getFicheMetierType($data['fiche_type']); + $ficheType = $this->getFicheMetierService()->getFicheMetier($data['fiche_type']); $object->setFicheType($ficheType); $object->setQuotite($data['quotite']); $object->setPrincipale($data['est_principale']); diff --git a/module/Application/src/Application/Form/AssocierAgent/AssocierAgentForm.php b/module/Application/src/Application/Form/AssocierAgent/AssocierAgentForm.php index c33e6b5cef50a380e3c5f18385bf4fc813171ec8..32fb0f8bb102f5fffc38082676228296667bd191 100644 --- a/module/Application/src/Application/Form/AssocierAgent/AssocierAgentForm.php +++ b/module/Application/src/Application/Form/AssocierAgent/AssocierAgentForm.php @@ -22,6 +22,8 @@ class AssocierAgentForm extends Form { ], 'attributes' => [ 'id' => 'agent', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', ], ]); @@ -48,7 +50,7 @@ class AssocierAgentForm extends Form { $options = []; $options[0] = "Sélectionner un agent ... "; foreach ($agents as $agent) { - $options[$agent->getId()] = $agent->getDenomination() . ' ('.$agent->getNumeroPoste().')'; + $options[$agent->getId()] = $agent->getDenomination(); /* . ' ('.$agent->getNumeroPoste().')';*/ } return $options; diff --git a/module/Application/src/Application/Form/EntretienProfessionnel/EntretienProfessionnelForm.php b/module/Application/src/Application/Form/EntretienProfessionnel/EntretienProfessionnelForm.php index bba12a2d3623c5c00e15e69ebea769a48f4cd3ba..6256e58976fc8a34d54f53acbce20dd20c8fd33f 100644 --- a/module/Application/src/Application/Form/EntretienProfessionnel/EntretienProfessionnelForm.php +++ b/module/Application/src/Application/Form/EntretienProfessionnel/EntretienProfessionnelForm.php @@ -34,7 +34,7 @@ class EntretienProfessionnelForm extends Form { $personnelsOpt = []; $personnelsOpt[ null ] = 'Sélectionnaire un personnel ... '; foreach ($agents as $agent) { - $personnelsOpt[$agent->getId()] = $agent->getPrenom(). " ".$agent->getNom(); + $personnelsOpt[$agent->getId()] = $agent->getDenomination(); } /** Année Scolaire **/ @@ -56,6 +56,8 @@ class EntretienProfessionnelForm extends Form { ], 'attributes' => [ 'id' => 'responsable', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', ], ]); //Agent (selection parmi liste des agents [du service]) @@ -68,6 +70,8 @@ class EntretienProfessionnelForm extends Form { ], 'attributes' => [ 'id' => 'agent', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', ], ]); //Annee (initialisée à l'annee scolaire en cours) diff --git a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteForm.php b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteForm.php similarity index 96% rename from module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteForm.php rename to module/Application/src/Application/Form/FicheMetier/ActiviteExistanteForm.php index ecdb706442937e9b839f13685b6b4daab0096818..d111eb05683c286b52792e5c40359b55246955fb 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteForm.php +++ b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteForm.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Application\Service\Activite\ActiviteServiceAwareTrait; use UnicaenApp\Service\EntityManagerAwareTrait; diff --git a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteFormAwareTrait.php b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteFormAwareTrait.php similarity index 93% rename from module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteFormAwareTrait.php rename to module/Application/src/Application/Form/FicheMetier/ActiviteExistanteFormAwareTrait.php index df871be7a412b6140794998706340d0562535fe6..5478ebcfab321c7c18e4ada8b6873d2df517633c 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteFormAwareTrait.php +++ b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; trait ActiviteExistanteFormAwareTrait { diff --git a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteFormFactory.php b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteFormFactory.php similarity index 94% rename from module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteFormFactory.php rename to module/Application/src/Application/Form/FicheMetier/ActiviteExistanteFormFactory.php index 3bd8d772c8990254ef5841de70d16c4f8aa75aa3..4ede655f38ab77bad51fb11c2c44a8992b666831 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteFormFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteFormFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Application\Service\Activite\ActiviteService; use Zend\Form\FormElementManager; diff --git a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteHydrator.php b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteHydrator.php similarity index 66% rename from module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteHydrator.php rename to module/Application/src/Application/Form/FicheMetier/ActiviteExistanteHydrator.php index 3cb23016ac70431eefac73fa874595480e161330..3779d7aeb566e7e6461360cfb3e69d1eaf3a9722 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ActiviteExistanteHydrator.php +++ b/module/Application/src/Application/Form/FicheMetier/ActiviteExistanteHydrator.php @@ -1,14 +1,14 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Zend\Stdlib\Hydrator\HydratorInterface; class ActiviteExistanteHydrator implements HydratorInterface { /** - * @param FicheMetierType $object + * @param FicheMetier $object * @return array */ public function extract($object) @@ -20,8 +20,8 @@ class ActiviteExistanteHydrator implements HydratorInterface { /** * @param array $data - * @param FicheMetierType $object - * @return FicheMetierType + * @param FicheMetier $object + * @return FicheMetier */ public function hydrate(array $data, $object) { diff --git a/module/Application/src/Application/Form/FicheMetierType/ApplicationsForm.php b/module/Application/src/Application/Form/FicheMetier/ApplicationsForm.php similarity index 98% rename from module/Application/src/Application/Form/FicheMetierType/ApplicationsForm.php rename to module/Application/src/Application/Form/FicheMetier/ApplicationsForm.php index 3e2781dd9a6040c78bef15f0e48e370f3d63fb85..adb3ab8bd69ddf9af46550c8c73d443eecc6da28 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ApplicationsForm.php +++ b/module/Application/src/Application/Form/FicheMetier/ApplicationsForm.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Application\Service\Application\ApplicationServiceAwareTrait; use Zend\Form\Element\Button; diff --git a/module/Application/src/Application/Form/FicheMetierType/ApplicationsFormAwareTrait.php b/module/Application/src/Application/Form/FicheMetier/ApplicationsFormAwareTrait.php similarity index 92% rename from module/Application/src/Application/Form/FicheMetierType/ApplicationsFormAwareTrait.php rename to module/Application/src/Application/Form/FicheMetier/ApplicationsFormAwareTrait.php index fb04363d630225744646fa9eedb9f8c6afc53b61..38294b9154c18679f1a6057591726a56b1e0c358 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ApplicationsFormAwareTrait.php +++ b/module/Application/src/Application/Form/FicheMetier/ApplicationsFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; trait ApplicationsFormAwareTrait { diff --git a/module/Application/src/Application/Form/FicheMetierType/ApplicationsFormFactory.php b/module/Application/src/Application/Form/FicheMetier/ApplicationsFormFactory.php similarity index 94% rename from module/Application/src/Application/Form/FicheMetierType/ApplicationsFormFactory.php rename to module/Application/src/Application/Form/FicheMetier/ApplicationsFormFactory.php index e1bdf9616fe6a71e47d6da2dbe6b6aedf8cc4c4e..0491e154eb6f31e59d37537c536137ea5d3d9526 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ApplicationsFormFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/ApplicationsFormFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Application\Service\Application\ApplicationService; use Zend\Form\FormElementManager; diff --git a/module/Application/src/Application/Form/FicheMetierType/ApplicationsHydrator.php b/module/Application/src/Application/Form/FicheMetier/ApplicationsHydrator.php similarity index 85% rename from module/Application/src/Application/Form/FicheMetierType/ApplicationsHydrator.php rename to module/Application/src/Application/Form/FicheMetier/ApplicationsHydrator.php index 09d16742ef307d9e5343fd868dafc8ec6e867f61..8a8d31d5c5b36aca26a63e02dc7bdf41e7312178 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ApplicationsHydrator.php +++ b/module/Application/src/Application/Form/FicheMetier/ApplicationsHydrator.php @@ -1,15 +1,15 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Application\Service\Application\ApplicationServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class ApplicationsHydrator implements HydratorInterface { use ApplicationServiceAwareTrait; /** - * @param FicheMetierType $object + * @param FicheMetier $object * @return array */ public function extract($object) @@ -28,8 +28,8 @@ class ApplicationsHydrator implements HydratorInterface { /** * @param array $data - * @param FicheMetierType $object - * @return FicheMetierType + * @param FicheMetier $object + * @return FicheMetier */ public function hydrate(array $data, $object) { diff --git a/module/Application/src/Application/Form/FicheMetierType/ApplicationsHydratorFactory.php b/module/Application/src/Application/Form/FicheMetier/ApplicationsHydratorFactory.php similarity index 93% rename from module/Application/src/Application/Form/FicheMetierType/ApplicationsHydratorFactory.php rename to module/Application/src/Application/Form/FicheMetier/ApplicationsHydratorFactory.php index 719139a948fddacd709978b80e26cd2e33c9e307..8c5f5cb204cd306ad0423c372cdb9a9407edcb23 100644 --- a/module/Application/src/Application/Form/FicheMetierType/ApplicationsHydratorFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/ApplicationsHydratorFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Application\Service\Application\ApplicationService; diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationBaseForm.php b/module/Application/src/Application/Form/FicheMetier/FormationBaseForm.php similarity index 97% rename from module/Application/src/Application/Form/FicheMetierType/FormationBaseForm.php rename to module/Application/src/Application/Form/FicheMetier/FormationBaseForm.php index f5bee4ddfe44e989c25f1bdd4b173499808d689b..c7e63c590ead256c5bb03fe47d41240b67ebb1ad 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationBaseForm.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationBaseForm.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\Element\Button; use Zend\Form\Form; diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationBaseFormAwareTrait.php b/module/Application/src/Application/Form/FicheMetier/FormationBaseFormAwareTrait.php similarity index 92% rename from module/Application/src/Application/Form/FicheMetierType/FormationBaseFormAwareTrait.php rename to module/Application/src/Application/Form/FicheMetier/FormationBaseFormAwareTrait.php index 10c3c1b4b395510b0d3097ea9d049b53a249d68a..eef7c7738445f97122bd9ea8ed736858a7c8ab43 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationBaseFormAwareTrait.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationBaseFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; trait FormationBaseFormAwareTrait { diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationBaseFormFactory.php b/module/Application/src/Application/Form/FicheMetier/FormationBaseFormFactory.php similarity index 90% rename from module/Application/src/Application/Form/FicheMetierType/FormationBaseFormFactory.php rename to module/Application/src/Application/Form/FicheMetier/FormationBaseFormFactory.php index 3423e04b9e41ec98bba475c5c685db001de32d2e..f816908ad30a5c06945670f9ffe41686a9bc8dd9 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationBaseFormFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationBaseFormFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\FormElementManager; diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationBaseHydrator.php b/module/Application/src/Application/Form/FicheMetier/FormationBaseHydrator.php similarity index 78% rename from module/Application/src/Application/Form/FicheMetierType/FormationBaseHydrator.php rename to module/Application/src/Application/Form/FicheMetier/FormationBaseHydrator.php index e5e1c2faa0184ba083ec0cbc871e11e098b31c79..5130ce31acc992add4d4df5f06e33f8f617fd964 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationBaseHydrator.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationBaseHydrator.php @@ -1,15 +1,15 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class FormationBaseHydrator implements HydratorInterface { use RessourceRhServiceAwareTrait; /** - * @param FicheMetierType $object + * @param FicheMetier $object * @return array */ public function extract($object) @@ -23,8 +23,8 @@ class FormationBaseHydrator implements HydratorInterface { /** * @param array $data - * @param FicheMetierType $object - * @return FicheMetierType + * @param FicheMetier $object + * @return FicheMetier */ public function hydrate(array $data, $object) { diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleForm.php b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleForm.php similarity index 97% rename from module/Application/src/Application/Form/FicheMetierType/FormationComportementaleForm.php rename to module/Application/src/Application/Form/FicheMetier/FormationComportementaleForm.php index ca336152315e2be844bb2f5e3a657ccf3fe7e5de..36ba319fbdbc8cd5d43eaa4b29fa89a96720a61e 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleForm.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleForm.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\Element\Button; use Zend\Form\Form; diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleFormAwareTrait.php b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleFormAwareTrait.php similarity index 94% rename from module/Application/src/Application/Form/FicheMetierType/FormationComportementaleFormAwareTrait.php rename to module/Application/src/Application/Form/FicheMetier/FormationComportementaleFormAwareTrait.php index 5d921f0299ba36622c4d305f111a3972bb0cd082..ebdc82d42a6d04bae68de97172fddc6c6f1d82e2 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleFormAwareTrait.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; trait FormationComportementaleFormAwareTrait { diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleFormFactory.php b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleFormFactory.php similarity index 91% rename from module/Application/src/Application/Form/FicheMetierType/FormationComportementaleFormFactory.php rename to module/Application/src/Application/Form/FicheMetier/FormationComportementaleFormFactory.php index 3901c8cbdb1357a820b0776154d203978e93eafb..af6fabcd0b1c455d0ee2ae42115d7eb36690b085 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleFormFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleFormFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\FormElementManager; diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleHydrator.php b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleHydrator.php similarity index 80% rename from module/Application/src/Application/Form/FicheMetierType/FormationComportementaleHydrator.php rename to module/Application/src/Application/Form/FicheMetier/FormationComportementaleHydrator.php index 8bdbec0e11faae2ee11f4052d3140c63f949c7ab..93c494dd2b63b9bf40f3872f85a6c2a0438ba29a 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationComportementaleHydrator.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationComportementaleHydrator.php @@ -1,15 +1,15 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class FormationComportementaleHydrator implements HydratorInterface { use RessourceRhServiceAwareTrait; /** - * @param FicheMetierType $object + * @param FicheMetier $object * @return array */ public function extract($object) @@ -23,8 +23,8 @@ class FormationComportementaleHydrator implements HydratorInterface { /** * @param array $data - * @param FicheMetierType $object - * @return FicheMetierType + * @param FicheMetier $object + * @return FicheMetier */ public function hydrate(array $data, $object) { diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleForm.php b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleForm.php similarity index 97% rename from module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleForm.php rename to module/Application/src/Application/Form/FicheMetier/FormationOperationnelleForm.php index b15c5bdc62a1b560fbaeac3399d8a2672a9d9338..f8fdfe700a0ddff7b76f1537993b50987724751b 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleForm.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleForm.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\Element\Button; use Zend\Form\Form; diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleFormAwareTrait.php b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleFormAwareTrait.php similarity index 94% rename from module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleFormAwareTrait.php rename to module/Application/src/Application/Form/FicheMetier/FormationOperationnelleFormAwareTrait.php index 509f9818b71bb7e258ec8b8c52cda9e95b942b59..76589b74e9f2c134afa98ffc6c409968229054f0 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleFormAwareTrait.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; trait FormationOperationnelleFormAwareTrait { diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleFormFactory.php b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleFormFactory.php similarity index 91% rename from module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleFormFactory.php rename to module/Application/src/Application/Form/FicheMetier/FormationOperationnelleFormFactory.php index 581ecd0e5c438752a6a42ee5ca91660350734e93..952f828a0de4474bcaf61106de0467d86cf28a2b 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleFormFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleFormFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\FormElementManager; diff --git a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleHydrator.php b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleHydrator.php similarity index 80% rename from module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleHydrator.php rename to module/Application/src/Application/Form/FicheMetier/FormationOperationnelleHydrator.php index 7e156d5e0a91eb996eb164b6660e2bd4a78d8ffd..d8bff5bcf808480069091d1e07eab6a3e4d8e0d1 100644 --- a/module/Application/src/Application/Form/FicheMetierType/FormationOperationnelleHydrator.php +++ b/module/Application/src/Application/Form/FicheMetier/FormationOperationnelleHydrator.php @@ -1,15 +1,15 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class FormationOperationnelleHydrator implements HydratorInterface { use RessourceRhServiceAwareTrait; /** - * @param FicheMetierType $object + * @param FicheMetier $object * @return array */ public function extract($object) @@ -23,8 +23,8 @@ class FormationOperationnelleHydrator implements HydratorInterface { /** * @param array $data - * @param FicheMetierType $object - * @return FicheMetierType + * @param FicheMetier $object + * @return FicheMetier */ public function hydrate(array $data, $object) { diff --git a/module/Application/src/Application/Form/FicheMetierType/LibelleForm.php b/module/Application/src/Application/Form/FicheMetier/LibelleForm.php similarity index 85% rename from module/Application/src/Application/Form/FicheMetierType/LibelleForm.php rename to module/Application/src/Application/Form/FicheMetier/LibelleForm.php index b542e148f7911c2e5948d4300457cdfaf818f4c0..9e9aecf47a96626c4ff3195371c7b2eba11b1275 100644 --- a/module/Application/src/Application/Form/FicheMetierType/LibelleForm.php +++ b/module/Application/src/Application/Form/FicheMetier/LibelleForm.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Zend\Form\Element\Button; @@ -19,7 +19,9 @@ class LibelleForm extends Form { 'options' => [ 'label' => "Libellé du métier :", 'empty_option' => "Sélectionner un metier ...", - 'value_options' => $this->getRessourceRhService()->getMetiersTypesAsOptions(), + 'value_options' => + //$this->getOptions(), + $this->getRessourceRhService()->getMetiersTypesAsMultiOptions(), ], 'attributes' => [ 'id' => 'metier', diff --git a/module/Application/src/Application/Form/FicheMetierType/LibelleFormAwareTrait.php b/module/Application/src/Application/Form/FicheMetier/LibelleFormAwareTrait.php similarity index 91% rename from module/Application/src/Application/Form/FicheMetierType/LibelleFormAwareTrait.php rename to module/Application/src/Application/Form/FicheMetier/LibelleFormAwareTrait.php index ecdda23671485f92008439577abf7af26f90af4b..e67c851107acfa0ed5f22be9cb338d0cf882d728 100644 --- a/module/Application/src/Application/Form/FicheMetierType/LibelleFormAwareTrait.php +++ b/module/Application/src/Application/Form/FicheMetier/LibelleFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; trait LibelleFormAwareTrait { diff --git a/module/Application/src/Application/Form/FicheMetierType/LibelleFormFactory.php b/module/Application/src/Application/Form/FicheMetier/LibelleFormFactory.php similarity index 93% rename from module/Application/src/Application/Form/FicheMetierType/LibelleFormFactory.php rename to module/Application/src/Application/Form/FicheMetier/LibelleFormFactory.php index 00ccbb733bee62b94ee574997b95b906d0cfcfa1..31164eabcc7edb4f0af1c8d411e23457ef036e7f 100644 --- a/module/Application/src/Application/Form/FicheMetierType/LibelleFormFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/LibelleFormFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Application\Service\RessourceRh\RessourceRhService; use Zend\Form\FormElementManager; diff --git a/module/Application/src/Application/Form/FicheMetierType/LibelleHydrator.php b/module/Application/src/Application/Form/FicheMetier/LibelleHydrator.php similarity index 57% rename from module/Application/src/Application/Form/FicheMetierType/LibelleHydrator.php rename to module/Application/src/Application/Form/FicheMetier/LibelleHydrator.php index 1d9aa3fa7614e3c0b8320e684bb88c76a1e1681c..144840db2b5e6504dea9995f8d768ea9001b0f4e 100644 --- a/module/Application/src/Application/Form/FicheMetierType/LibelleHydrator.php +++ b/module/Application/src/Application/Form/FicheMetier/LibelleHydrator.php @@ -1,15 +1,16 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Entity\Db\FicheMetierType; -use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; +use Application\Entity\Db\FicheMetier; +use Application\Service\Metier\MetierServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class LibelleHydrator implements HydratorInterface { - use RessourceRhServiceAwareTrait; + use MetierServiceAwareTrait; + /** - * @param FicheMetierType $object + * @param FicheMetier $object * @return array */ public function extract($object) @@ -22,12 +23,12 @@ class LibelleHydrator implements HydratorInterface { /** * @param array $data - * @param FicheMetierType $object - * @return FicheMetierType + * @param FicheMetier $object + * @return FicheMetier */ public function hydrate(array $data, $object) { - $metier = $this->getRessourceRhService()->getMetier($data['metier']); + $metier = $this->getMetierService()->getMetier($data['metier']); $object->setMetier($metier); return $object; } diff --git a/module/Application/src/Application/Form/FicheMetierType/LibelleHydratorFactory.php b/module/Application/src/Application/Form/FicheMetier/LibelleHydratorFactory.php similarity index 55% rename from module/Application/src/Application/Form/FicheMetierType/LibelleHydratorFactory.php rename to module/Application/src/Application/Form/FicheMetier/LibelleHydratorFactory.php index 6a468c077bdf55ae7946b3a6c4b9af0ac666afcd..204e636e7a0619f309e66b55148aac3824140b74 100644 --- a/module/Application/src/Application/Form/FicheMetierType/LibelleHydratorFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/LibelleHydratorFactory.php @@ -1,8 +1,8 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Service\RessourceRh\RessourceRhService; +use Application\Service\Metier\MetierService; use Zend\ServiceManager\ServiceLocatorInterface; class LibelleHydratorFactory { @@ -11,11 +11,11 @@ class LibelleHydratorFactory { { /** @var ServiceLocatorInterface $parentLocator */ $parentLocator = $serviceLocator->getServiceLocator(); - /** @var RessourceRhService $ressourceService */ - $ressourceService = $parentLocator->get(RessourceRhService::class); + /** @var MetierService $metierService */ + $metierService = $parentLocator->get(MetierService::class); $hydrator = new LibelleHydrator(); - $hydrator->setRessourceRhService($ressourceService); + $hydrator->setMetierService($metierService); return $hydrator; } diff --git a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesForm.php b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesForm.php similarity index 95% rename from module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesForm.php rename to module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesForm.php index 202ea9cecf89c23fb638fc171c86695001e25560..1e466b6c03d92ea285b29633bf71a648f6dadde9 100644 --- a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesForm.php +++ b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesForm.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\Element\Button; use Zend\Form\Form; diff --git a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesFormAwareTrait.php b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesFormAwareTrait.php similarity index 93% rename from module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesFormAwareTrait.php rename to module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesFormAwareTrait.php index ce24c0e2c41419d5e5babf4d1c9a5d3a08288981..5af1f20f96ee4deedffca6144f69684bc774978c 100644 --- a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesFormAwareTrait.php +++ b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; trait MissionsPrincipalesFormAwareTrait { diff --git a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesFormFactory.php b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesFormFactory.php similarity index 91% rename from module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesFormFactory.php rename to module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesFormFactory.php index 78a4a1709ca13ef85f2b9a32189d1c07ee978769..88b77af3d8096bb6b6ebe4984faef7a6a5098d7e 100644 --- a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesFormFactory.php +++ b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesFormFactory.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; use Zend\Form\FormElementManager; diff --git a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesHydrator.php b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesHydrator.php similarity index 72% rename from module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesHydrator.php rename to module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesHydrator.php index 222975e96c1316ef31e6108ebddb4614b432bcc9..295e60dea8f1420cc18c9436f0ab44ffef8cfc27 100644 --- a/module/Application/src/Application/Form/FicheMetierType/MissionsPrincipalesHydrator.php +++ b/module/Application/src/Application/Form/FicheMetier/MissionsPrincipalesHydrator.php @@ -1,14 +1,14 @@ <?php -namespace Application\Form\FicheMetierType; +namespace Application\Form\FicheMetier; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Zend\Stdlib\Hydrator\HydratorInterface; class MissionsPrincipalesHydrator implements HydratorInterface { /** - * @param FicheMetierType $object + * @param FicheMetier $object * @return array */ public function extract($object) @@ -21,8 +21,8 @@ class MissionsPrincipalesHydrator implements HydratorInterface { /** * @param array $data - * @param FicheMetierType $object - * @return FicheMetierType + * @param FicheMetier $object + * @return FicheMetier */ public function hydrate(array $data, $object) { diff --git a/module/Application/src/Application/Form/Fonction/FonctionForm.php b/module/Application/src/Application/Form/Fonction/FonctionForm.php deleted file mode 100644 index a48b1101c712de2f5b84b39a26b22492c9ea5c33..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/Fonction/FonctionForm.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Application\Form\Fonction; - -use Zend\Form\Element\Button; -use Zend\Form\Element\Text; -use Zend\Form\Form; - -class FonctionForm extends Form { - - public function init() - { - $this->add([ - 'type' => Text::class, - 'name' => 'libelle_masculin', - 'options' => [ - 'label' => "Libellé masculin :", - ], - 'attributes' => [ - 'id' => 'libelle_masculin', - ], - ]); - $this->add([ - 'type' => Text::class, - 'name' => 'libelle_feminin', - 'options' => [ - 'label' => "Libellé féminin :", - ], - 'attributes' => [ - 'id' => 'libelle_feminin', - ], - ]); - $this->add([ - 'type' => Button::class, - 'name' => 'creer', - 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer la fonction', - 'label_options' => [ - 'disable_html_escape' => true, - ], - ], - 'attributes' => [ - 'type' => 'submit', - 'class' => 'btn btn-primary', - ], - ]); - - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/Fonction/FonctionHydrator.php b/module/Application/src/Application/Form/Fonction/FonctionHydrator.php deleted file mode 100644 index 745a63cdcd4c8629ee784e6933db45a31e5eac6f..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/Fonction/FonctionHydrator.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Application\Form\Fonction; - -use Application\Entity\Db\Fonction; -use Zend\Stdlib\Hydrator\HydratorInterface; - -class FonctionHydrator implements HydratorInterface { - - /** - * @param Fonction $object - * @return array - */ - public function extract($object) - { - $data = []; - $data['libelle_masculin'] = null; - $data['libelle_feminin'] = null; - - - foreach ($object->getLibelles() as $libelle) { - if ($libelle->getDefault()) { - if ($libelle->getGenre() === 'M') $data['libelle_masculin'] = $libelle->getLibelle(); - if ($libelle->getGenre() === 'F') $data['libelle_feminin'] = $libelle->getLibelle(); - } - } - - return $data; - } - - /** - * @param array $data - * @param Fonction $object - * @return Fonction - */ - public function hydrate(array $data, $object) - { - //delegué au fonction du controller - } - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/MetierFamilleForm.php b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueForm.php similarity index 89% rename from module/Application/src/Application/Form/RessourceRh/MetierFamilleForm.php rename to module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueForm.php index 2b9c6c4dfa272527158c2e4b4cd4471092de085b..10298e4c124b3123493e472130a7489513157cef 100644 --- a/module/Application/src/Application/Form/RessourceRh/MetierFamilleForm.php +++ b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueForm.php @@ -1,12 +1,12 @@ <?php -namespace Application\Form\RessourceRh; +namespace Application\Form\MissionSpecifique; use Zend\Form\Element\Button; use Zend\Form\Element\Text; use Zend\Form\Form; -class MetierFamilleForm extends Form { +class MissionSpecifiqueForm extends Form { public function init() { @@ -26,7 +26,7 @@ class MetierFamilleForm extends Form { 'type' => Button::class, 'name' => 'creer', 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer le métier', + 'label' => '<i class="fas fa-save"></i> Enregistrer la mission', 'label_options' => [ 'disable_html_escape' => true, ], diff --git a/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueFormAwareTrait.php b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueFormAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..44cd625857d9eb26b3670bd6b9341dbbb3b186c7 --- /dev/null +++ b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueFormAwareTrait.php @@ -0,0 +1,29 @@ +<?php + +namespace Application\Form\MissionSpecifique; + +trait MissionSpecifiqueFormAwareTrait { + + /** @var MissionSpecifiqueForm */ + private $missionSpecifiqueForm; + + /** + * @return MissionSpecifiqueForm + */ + public function getMissionSpecifiqueForm() + { + return $this->missionSpecifiqueForm; + } + + /** + * @param MissionSpecifiqueForm $missionSpecifiqueForm + * @return MissionSpecifiqueForm + */ + public function setMissionSpecifiqueForm($missionSpecifiqueForm) + { + $this->missionSpecifiqueForm = $missionSpecifiqueForm; + return $this->missionSpecifiqueForm; + } + + +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueFormFactory.php b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueFormFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..bd60a592107ba7179f04b0a28395fd98caa229a8 --- /dev/null +++ b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueFormFactory.php @@ -0,0 +1,24 @@ +<?php + +namespace Application\Form\MissionSpecifique; + +use Zend\Form\FormElementManager; + +class MissionSpecifiqueFormFactory { + + public function __invoke(FormElementManager $manager) + { + /** + * @var MissionSpecifiqueHydrator $hydrator + */ + $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(MissionSpecifiqueHydrator::class); + + /** + * @var MissionSpecifiqueForm $form + */ + $form = new MissionSpecifiqueForm(); + $form->setHydrator($hydrator); + $form->init(); + return $form; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/AgentStatusHydrator.php b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueHydrator.php similarity index 50% rename from module/Application/src/Application/Form/RessourceRh/AgentStatusHydrator.php rename to module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueHydrator.php index aac97cbf0431fccb8302b32725963272960feb78..2e5fd75255967c42cd205e8b2fffca3d4b5f8520 100644 --- a/module/Application/src/Application/Form/RessourceRh/AgentStatusHydrator.php +++ b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueHydrator.php @@ -1,33 +1,31 @@ <?php -namespace Application\Form\RessourceRh; +namespace Application\Form\MissionSpecifique; -use Application\Entity\Db\AgentStatus; +use Application\Entity\Db\MissionSpecifique; use Zend\Stdlib\Hydrator\HydratorInterface; -class AgentStatusHydrator implements HydratorInterface { +class MissionSpecifiqueHydrator implements HydratorInterface { /** - * @param AgentStatus $object + * @param MissionSpecifique $object * @return array */ public function extract($object) { - $data = [ - 'libelle' => $object->getLibelle(), - ]; + $data = []; + $data['libelle'] = $object->getLibelle(); return $data; } /** * @param array $data - * @param AgentStatus $object - * @return AgentStatus + * @param MissionSpecifique $object + * @return MissionSpecifique */ public function hydrate(array $data, $object) { $object->setLibelle($data['libelle']); return $object; } - } \ No newline at end of file diff --git a/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueHydratorFactory.php b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueHydratorFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..6210661a307e27166ec3e1bd5ddade5d66496783 --- /dev/null +++ b/module/Application/src/Application/Form/MissionSpecifique/MissionSpecifiqueHydratorFactory.php @@ -0,0 +1,15 @@ +<?php + +namespace Application\Form\MissionSpecifique; + +use Zend\Stdlib\Hydrator\HydratorPluginManager; + +class MissionSpecifiqueHydratorFactory { + + public function __invoke(HydratorPluginManager $manager) + { + /** @var MissionSpecifiqueHydrator $hydrator */ + $hydrator = new MissionSpecifiqueHydrator(); + return $hydrator; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/Poste/PosteForm.php b/module/Application/src/Application/Form/Poste/PosteForm.php index 786417a223f4f6fc5c7b3f3354600247fc398955..46f3c0848c4884886f73850cc0f8bb5a1c58e310 100644 --- a/module/Application/src/Application/Form/Poste/PosteForm.php +++ b/module/Application/src/Application/Form/Poste/PosteForm.php @@ -5,11 +5,10 @@ namespace Application\Form\Poste; use Application\Entity\Db\Domaine; use Application\Form\AutocompleteAwareTrait; use Application\Service\Agent\AgentServiceAwareTrait; -use Application\Service\Fonction\FonctionServiceAwareTrait; +use Application\Service\Immobilier\ImmobilierServiceAwareTrait; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Application\Service\Structure\StructureServiceAwareTrait; use DoctrineModule\Form\Element\ObjectSelect; -use UnicaenApp\Form\Element\SearchAndSelect; use UnicaenApp\Service\EntityManagerAwareTrait; use Zend\Form\Element\Button; use Zend\Form\Element\Select; @@ -21,9 +20,9 @@ class PosteForm extends Form { use AgentServiceAwareTrait; use RessourceRhServiceAwareTrait; use EntityManagerAwareTrait; - use FonctionServiceAwareTrait; use ServiceLocatorAwareTrait; use StructureServiceAwareTrait; + use ImmobilierServiceAwareTrait; use AutocompleteAwareTrait; @@ -46,6 +45,7 @@ class PosteForm extends Form { 'name' => 'structure', 'options' => [ 'label' => "Service/composante/direction d'affectation :", + 'empty_option' => "Sélectionner une service ...", 'value_options' => $this->getStructureService()->getStructuresAsOptions(), ], 'attributes' => [ @@ -56,14 +56,20 @@ class PosteForm extends Form { ]); // localisation - $sas = new SearchAndSelect('localisation'); - $sas->setLabel('Localisation du poste'); - $sas->setAttribute('placeholder','Recherchez un batiment'); - $sas->setAttribute('class', 'individu-finder'); - $sas->setLabelOption('disable_html_escape', false); - - $sas->setAutocompleteSource($this->getAutocomplete()); - $this->add($sas); + $this->add([ + 'type' => Select::class, + 'name' => 'localisation', + 'options' => [ + 'label' => "Localisation du poste :", + 'empty_option' => "Sélectionner un bâtiment ...", + 'value_options' => $this->getImmobilierService()->getBatimentsAsOptions(), + ], + 'attributes' => [ + 'id' => 'localisation', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', + ], + ]); // correspondance $this->add([ @@ -71,6 +77,7 @@ class PosteForm extends Form { 'name' => 'correspondance', 'options' => [ 'label' => "Catégorie :", + 'empty_option' => "Sélectionner une correspondance ...", 'value_options' => $this->generateCorrespondanceSelectOptions(), ], 'attributes' => [ @@ -86,6 +93,7 @@ class PosteForm extends Form { 'name' => 'rattachement', 'options' => [ 'label' => "Rattachement hierarchique :", + 'empty_option' => "Sélectionner un rattachement ...", 'value_options' => $this->generateRattachementSelectOptions(), ], 'attributes' => [ @@ -101,7 +109,7 @@ class PosteForm extends Form { 'name' => 'domaine', 'options' => [ 'label' => "Domaine UNICAEN :", - 'empty_option' => "Sélectionner un domaine", + 'empty_option' => "Sélectionner un domaine ...", 'object_manager' => $this->getEntityManager(), 'target_class' => Domaine::class, 'property' => 'libelle', @@ -127,7 +135,11 @@ class PosteForm extends Form { 'name' => 'fonction', 'options' => [ 'label' => "Fonction :", - 'value_options' => $this->getFonctionService()->getFonctionsAsOption(), + 'empty_option' => "Sélectionner une fonction ...", + 'value_options' => [ + 'Soutien' => 'Soutien', + 'Support' => 'Support', + ], ], 'attributes' => [ 'id' => 'fonction', @@ -169,11 +181,10 @@ class PosteForm extends Form { private function generateCorrespondanceSelectOptions() { - $correspondances = $this->getRessourceRhService()->getCorrespondances(); + $correspondances = $this->getRessourceRhService()->getCorrespondances(true); $options = []; - $options[0] = "Sélectionner une correspondance ..."; foreach($correspondances as $correspondance) { - $options[$correspondance->getId()] = $correspondance->__toString(); + $options[$correspondance->getId()] = $correspondance->getLibelleCourt() . " - " . $correspondance->getLibelleLong(); } return $options; } diff --git a/module/Application/src/Application/Form/Poste/PosteFormFactory.php b/module/Application/src/Application/Form/Poste/PosteFormFactory.php index 81fca0b673c1df7f8253ca7916658fb6eb44d3f1..0376b8be036868353a72aca67f4559b33c7132bf 100644 --- a/module/Application/src/Application/Form/Poste/PosteFormFactory.php +++ b/module/Application/src/Application/Form/Poste/PosteFormFactory.php @@ -3,7 +3,7 @@ namespace Application\Form\Poste; use Application\Service\Agent\AgentService; -use Application\Service\Fonction\FonctionService; +use Application\Service\Immobilier\ImmobilierService; use Application\Service\RessourceRh\RessourceRhService; use Application\Service\Structure\StructureService; use Doctrine\ORM\EntityManager; @@ -11,27 +11,18 @@ use Zend\Form\FormElementManager; class PosteFormFactory { - protected function getUrl(FormElementManager $manager, $name = null, $params = [], $options = [], $reuseMatchedParams = false) - { - $url = $manager->getServiceLocator()->get('viewhelpermanager')->get('url'); - - /* @var $url \Zend\View\Helper\Url */ - return $url->__invoke($name, $params, $options, $reuseMatchedParams); - } - - public function __invoke(FormElementManager $manager) { /** * @var EntityManager $entityManager * @var AgentService $agentService - * @var FonctionService $fonctionService + * @var ImmobilierService $immobilierService * @var StructureService $structureService * @var RessourceRhService $ressourceService */ $entityManager = $manager->getServiceLocator()->get('doctrine.entitymanager.orm_default'); $agentService = $manager->getServiceLocator()->get(AgentService::class); - $fonctionService = $manager->getServiceLocator()->get(FonctionService::class); + $immobilierService = $manager->getServiceLocator()->get(ImmobilierService::class); $structureService = $manager->getServiceLocator()->get(StructureService::class); $ressourceService = $manager->getServiceLocator()->get(RessourceRhService::class); @@ -40,10 +31,9 @@ class PosteFormFactory { $form = new PosteForm(); - $form->setAutocomplete($manager->getServiceLocator()->get('view_renderer')->url('poste/rechercher-batiment',[],[], true)); $form->setEntityManager($entityManager); $form->setAgentService($agentService); - $form->setFonctionService($fonctionService); + $form->setImmobilierService($immobilierService); $form->setStructureService($structureService); $form->setRessourceRhService($ressourceService); $form->init(); diff --git a/module/Application/src/Application/Form/Poste/PosteHydrator.php b/module/Application/src/Application/Form/Poste/PosteHydrator.php index 4139858ca5680ac68951b18e5a5ca8e5b869cc8a..2f1d4c4ccdd4dcc6d1798aacbd538fbcc06cda25 100644 --- a/module/Application/src/Application/Form/Poste/PosteHydrator.php +++ b/module/Application/src/Application/Form/Poste/PosteHydrator.php @@ -4,18 +4,18 @@ namespace Application\Form\Poste; use Application\Entity\Db\Poste; use Application\Service\Agent\AgentServiceAwareTrait; -use Application\Service\Fonction\FonctionServiceAwareTrait; +use Application\Service\Domaine\DomaineServiceAwareTrait; +use Application\Service\Immobilier\ImmobilierServiceAwareTrait; use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; use Application\Service\Structure\StructureServiceAwareTrait; -use Octopus\Service\Immobilier\ImmobilierServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class PosteHydrator implements HydratorInterface { use AgentServiceAwareTrait; - use FonctionServiceAwareTrait; use RessourceRhServiceAwareTrait; use ImmobilierServiceAwareTrait; use StructureServiceAwareTrait; + use DomaineServiceAwareTrait; /** * @param Poste $object @@ -23,16 +23,15 @@ class PosteHydrator implements HydratorInterface { */ public function extract($object) { - $batiment = $this->getImmobiliserService()->getImmobilierBatiment($object->getLocalisation()); $data = [ 'numero_poste' => $object->getNumeroPoste(), - 'localisation' => $batiment, + 'localisation' => ($object->getLocalisation())?$object->getLocalisation()->getId():null, 'structure' => ($object->getStructure())?$object->getStructure()->getId():null, 'correspondance' => ($object->getCorrespondance())?$object->getCorrespondance()->getId():null, 'rattachement' => ($object->getRattachementHierarchique())?$object->getRattachementHierarchique()->getId():null, 'domaine' => ($object->getDomaine())?$object->getDomaine()->getId():null, - 'fonction' => ($object->getFonction())?$object->getFonction()->getId():null, + 'fonction' => $object->getFonction(), 'lien' => $object->getLien(), ]; return $data; @@ -48,16 +47,16 @@ class PosteHydrator implements HydratorInterface { $structure = $this->getStructureService()->getStructure($data['structure']); $correspondance = $this->getRessourceRhService()->getCorrespondance($data['correspondance']); $rattachement = $this->getAgentService()->getAgent($data['rattachement']); - $domaine = $this->getRessourceRhService()->getDomaine($data['domaine']); - $fonction = $this->getFonctionService()->getFonction($data['fonction']); + $domaine = $this->getDomaineService()->getDomaine($data['domaine']); + $batiment = $this->getImmobilierService()->getBatiment($data['localisation']); $object->setNumeroPoste($data['numero_poste']); - $object->setLocalisation($data['localisation']['id']); + $object->setLocalisation($batiment); $object->setStructure($structure); $object->setCorrespondance($correspondance); $object->setRattachementHierarchique($rattachement); $object->setDomaine($domaine); - $object->setFonction($fonction); + $object->setFonction($data['fonction']); $object->setLien($data['lien']); return $object; diff --git a/module/Application/src/Application/Form/Poste/PosteHydratorFactory.php b/module/Application/src/Application/Form/Poste/PosteHydratorFactory.php index da90a4a80e06971fee4540980fa98e87af0f750e..ce596018adf617d7fc25056cd26699bb44c94575 100644 --- a/module/Application/src/Application/Form/Poste/PosteHydratorFactory.php +++ b/module/Application/src/Application/Form/Poste/PosteHydratorFactory.php @@ -2,11 +2,11 @@ namespace Application\Form\Poste; -use Application\Service\Fonction\FonctionService; -use Application\Service\Structure\StructureService; use Application\Service\Agent\AgentService; +use Application\Service\Domaine\DomaineService; +use Application\Service\Immobilier\ImmobilierService; use Application\Service\RessourceRh\RessourceRhService; -use Octopus\Service\Immobilier\ImmobilierService; +use Application\Service\Structure\StructureService; use Zend\ServiceManager\ServiceLocatorInterface; class PosteHydratorFactory { @@ -17,24 +17,24 @@ class PosteHydratorFactory { $parentLocator = $serviceLocator->getServiceLocator(); /** * @var AgentService $agentService - * @var FonctionService $fonctionService + * @var DomaineService $domaineService * @var StructureService $structureService * @var RessourceRhService $ressourceService * @var ImmobilierService $immobilierService */ $agentService = $parentLocator->get(AgentService::class); - $fonctionService = $parentLocator->get(FonctionService::class); + $domaineService = $parentLocator->get(DomaineService::class); $structureService = $parentLocator->get(StructureService::class); $ressourceService = $parentLocator->get(RessourceRhService::class); $immobilierService = $parentLocator->get(ImmobilierService::class); $hydrator = new PosteHydrator(); - $hydrator->setStructureService($structureService); $hydrator->setAgentService($agentService); - $hydrator->setFonctionService($fonctionService); + $hydrator->setDomaineService($domaineService); + $hydrator->setStructureService($structureService); $hydrator->setRessourceRhService($ressourceService); - $hydrator->setImmobiliserService($immobilierService); + $hydrator->setImmobilierService($immobilierService); return $hydrator; } diff --git a/module/Application/src/Application/Form/RessourceRh/AgentStatusFormAwareTrait.php b/module/Application/src/Application/Form/RessourceRh/AgentStatusFormAwareTrait.php deleted file mode 100644 index 1271713135b6a0e3978682af6d421a9b3f7b001e..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/AgentStatusFormAwareTrait.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -trait AgentStatusFormAwareTrait { - - /** @var AgentStatusForm $agentStatusForm */ - private $agentStatusForm; - - /** - * @return AgentStatusForm - */ - public function getAgentStatusForm() - { - return $this->agentStatusForm; - } - - /** - * @param AgentStatusForm $agentStatusForm - * @return AgentStatusForm - */ - public function setAgentStatusForm($agentStatusForm) - { - $this->agentStatusForm = $agentStatusForm; - return $this->agentStatusForm; - } - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/CorpsFormAwareTrait.php b/module/Application/src/Application/Form/RessourceRh/CorpsFormAwareTrait.php deleted file mode 100644 index 2606650e70ef578571889d7ca14e135545e4b748..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/CorpsFormAwareTrait.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -trait CorpsFormAwareTrait { - - /** @var CorpsForm $corpsForm */ - private $corpsForm; - - /** - * @return CorpsForm - */ - public function getCorpsForm() - { - return $this->corpsForm; - } - - /** - * @param CorpsForm $corpsForm - * @return CorpsForm - */ - public function setCorpsForm($corpsForm) - { - $this->corpsForm = $corpsForm; - return $this->corpsForm; - } - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/CorpsFormFactory.php b/module/Application/src/Application/Form/RessourceRh/CorpsFormFactory.php deleted file mode 100644 index 9049fed534588f1c1e556a170fc3922323a119b6..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/CorpsFormFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Zend\Form\FormElementManager; - -class CorpsFormFactory { - - public function __invoke(FormElementManager $manager) - { - /** @var CorpsHydrator $hydrator */ - $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(CorpsHydrator::class); - - $form = new CorpsForm(); - $form->init(); - $form->setHydrator($hydrator); - - return $form; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/CorpsHydrator.php b/module/Application/src/Application/Form/RessourceRh/CorpsHydrator.php deleted file mode 100644 index 134f1f8a97864f8b7ff8a11b3b387b7da885b8df..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/CorpsHydrator.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Application\Entity\Db\Corps; -use Zend\Stdlib\Hydrator\HydratorInterface; - -class CorpsHydrator implements HydratorInterface { - - /** - * @param Corps $object - * @return array - */ - public function extract($object) - { - $data = [ - 'code' => $object->getCode(), - 'libelle' => $object->getLibelle(), - ]; - return $data; - } - - /** - * @param array $data - * @param Corps $object - * @return Corps - */ - public function hydrate(array $data, $object) - { - $object->setCode($data['code']); - $object->setLibelle($data['libelle']); - return $object; - } - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/CorrespondanceForm.php b/module/Application/src/Application/Form/RessourceRh/CorrespondanceForm.php deleted file mode 100644 index d1cb700fe3e7c7ce4d577423ed7947e1cdb95be7..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/CorrespondanceForm.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Zend\Form\Element\Button; -use Zend\Form\Element\Select; -use Zend\Form\Element\Text; -use Zend\Form\Form; - -class CorrespondanceForm extends Form { - - public function init() - { - // reference - $this->add([ - 'type' => Select::class, - 'name' => 'reference', - 'options' => [ - 'label' => "Référence :", - 'value_options' => [ - '' => 'Choisir une correspondance', - 'BAP' => 'Correspondance BAP', - 'REFERENS' => 'Correspondance REFERENS', - 'REME' => 'Correspondance REME', - 'bibliothèque' => 'Correspondance bibliothèque', - ], - ], - 'attributes' => [ - 'id' => 'reference', - ], - ]); - // libelle - $this->add([ - 'type' => Text::class, - 'name' => 'libelle', - 'options' => [ - 'label' => "Libelle :", - ], - 'attributes' => [ - 'id' => 'libelle', - ], - ]); - // description - $this->add([ - 'type' => Text::class, - 'name' => 'description', - 'options' => [ - 'label' => "Description :", - ], - 'attributes' => [ - 'id' => 'description', - ], - ]); - // button - $this->add([ - 'type' => Button::class, - 'name' => 'creer', - 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer la correspondance', - 'label_options' => [ - 'disable_html_escape' => true, - ], - ], - 'attributes' => [ - 'type' => 'submit', - 'class' => 'btn btn-primary', - ], - ]); - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/CorrespondanceFormAwareTrait.php b/module/Application/src/Application/Form/RessourceRh/CorrespondanceFormAwareTrait.php deleted file mode 100644 index 7810aa7a3082ba89b26efb5eaa03ff26fecc3cea..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/CorrespondanceFormAwareTrait.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -trait CorrespondanceFormAwareTrait { - - /** @var CorrespondanceForm $correspondanceForm */ - private $correspondanceForm; - - /** - * @return CorrespondanceForm - */ - public function getCorrespondanceForm() - { - return $this->correspondanceForm; - } - - /** - * @param CorrespondanceForm $correspondanceForm - * @return CorrespondanceForm - */ - public function setCorrespondanceForm($correspondanceForm) - { - $this->correspondanceForm = $correspondanceForm; - return $this->correspondanceForm; - } - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/CorrespondanceFormFactory.php b/module/Application/src/Application/Form/RessourceRh/CorrespondanceFormFactory.php deleted file mode 100644 index f7ccdd0ce35440af544d2a06051364b144305b00..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/CorrespondanceFormFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Zend\Form\FormElementManager; - -class CorrespondanceFormFactory { - - public function __invoke(FormElementManager $manager) - { - /** @var CorrespondanceHydrator $hydrator */ - $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(CorrespondanceHydrator::class); - - $form = new CorrespondanceForm(); - $form->init(); - $form->setHydrator($hydrator); - - return $form; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/CorrespondanceHydrator.php b/module/Application/src/Application/Form/RessourceRh/CorrespondanceHydrator.php deleted file mode 100644 index 8738c9e6edb8b88135764c3733cc0a797a3c8561..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/CorrespondanceHydrator.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Application\Entity\Db\Correspondance; -use Zend\Stdlib\Hydrator\HydratorInterface; - -class CorrespondanceHydrator implements HydratorInterface { - - /** - * @param Correspondance $object - * @return array - */ - public function extract($object) - { - $data = [ - 'reference' => $object->getReference(), - 'libelle' => $object->getLibelle(), - 'description' => $object->getDescription(), - ]; - return $data; - } - - /** - * @param array $data - * @param Correspondance $object - * @return Correspondance - */ - public function hydrate(array $data, $object) - { - $object->setReference($data['reference']); - $object->setLibelle($data['libelle']); - $object->setDescription($data['description']); - return $object; - } - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/DomaineForm.php b/module/Application/src/Application/Form/RessourceRh/DomaineForm.php index 88577555e6de1eb22d2ff4b1c8e93a9a80acd79e..a76fb001089dfaf405a3ae8dad0e78154710adeb 100644 --- a/module/Application/src/Application/Form/RessourceRh/DomaineForm.php +++ b/module/Application/src/Application/Form/RessourceRh/DomaineForm.php @@ -2,11 +2,14 @@ namespace Application\Form\RessourceRh; +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleServiceAwareTrait; use Zend\Form\Element\Button; +use Zend\Form\Element\Select; use Zend\Form\Element\Text; use Zend\Form\Form; class DomaineForm extends Form { + use FamilleProfessionnelleServiceAwareTrait; public function init() { @@ -21,12 +24,28 @@ class DomaineForm extends Form { 'id' => 'libelle', ], ]); + // famille + $this->add([ + 'type' => Select::class, + 'name' => 'famille', + 'options' => [ + 'label' => "Famille professionnelle* :", + 'empty_option' => "Sélectionner une famille ...", + 'value_options' => $this->getFamilleProfessionnelleService()->getFamillesProfessionnellesAsOptions(), + ], + 'attributes' => [ + 'id' => 'famille', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', + ], + ]); + // button $this->add([ 'type' => Button::class, 'name' => 'creer', 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer le domaine', + 'label' => '<i class="fas fa-save"></i> Enregistrer', 'label_options' => [ 'disable_html_escape' => true, ], diff --git a/module/Application/src/Application/Form/RessourceRh/DomaineFormFactory.php b/module/Application/src/Application/Form/RessourceRh/DomaineFormFactory.php index 48d006026462ef087313ec86f68d423d6b9dc83e..4f9400be1f5c7cfbe28e17db81ce3c109ef9eaf8 100644 --- a/module/Application/src/Application/Form/RessourceRh/DomaineFormFactory.php +++ b/module/Application/src/Application/Form/RessourceRh/DomaineFormFactory.php @@ -2,16 +2,23 @@ namespace Application\Form\RessourceRh; +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleService; use Zend\Form\FormElementManager; class DomaineFormFactory { public function __invoke(FormElementManager $manager) { + /** + * @var FamilleProfessionnelleService $familleService + */ + $familleService = $manager->getServiceLocator()->get(FamilleProfessionnelleService::class); + /** @var DomaineHydrator $hydrator */ $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(DomaineHydrator::class); $form = new DomaineForm(); + $form->setFamilleProfessionnelleService($familleService); $form->init(); $form->setHydrator($hydrator); diff --git a/module/Application/src/Application/Form/RessourceRh/DomaineHydrator.php b/module/Application/src/Application/Form/RessourceRh/DomaineHydrator.php index 0fcc9fa16729fbbbd4b9e649d108accfca42517a..a1317bb5442ea59a625f5fce7657c8b8cd485ad0 100644 --- a/module/Application/src/Application/Form/RessourceRh/DomaineHydrator.php +++ b/module/Application/src/Application/Form/RessourceRh/DomaineHydrator.php @@ -3,9 +3,11 @@ namespace Application\Form\RessourceRh; use Application\Entity\Db\Domaine; +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class DomaineHydrator implements HydratorInterface { + use FamilleProfessionnelleServiceAwareTrait; /** * @param Domaine $object @@ -15,6 +17,7 @@ class DomaineHydrator implements HydratorInterface { { $data = [ 'libelle' => $object->getLibelle(), + 'famille' => ($object->getFamille())?$object->getFamille()->getId():null, ]; return $data; } @@ -26,7 +29,11 @@ class DomaineHydrator implements HydratorInterface { */ public function hydrate(array $data, $object) { + $famille = $this->getFamilleProfessionnelleService()->getFamilleProfessionnelle($data['famille']); + $object->setLibelle($data['libelle']); + $object->setFamille($famille); + return $object; } diff --git a/module/Application/src/Application/Form/RessourceRh/DomaineHydratorFactory.php b/module/Application/src/Application/Form/RessourceRh/DomaineHydratorFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..960e8f170eb91aed21a8c3ffba340846a2cadff1 --- /dev/null +++ b/module/Application/src/Application/Form/RessourceRh/DomaineHydratorFactory.php @@ -0,0 +1,22 @@ +<?php + +namespace Application\Form\RessourceRh; + +use Application\Service\FamilleProfessionnelle\FamilleProfessionnelleService; +use Zend\Stdlib\Hydrator\HydratorPluginManager; + +class DomaineHydratorFactory { + + public function __invoke(HydratorPluginManager $manager) + { + /** + * @var FamilleProfessionnelleService $familleService + */ + $familleService = $manager->getServiceLocator()->get(FamilleProfessionnelleService::class); + + /** @var DomaineHydrator $hydrator */ + $hydrator = new DomaineHydrator(); + $hydrator->setFamilleProfessionnelleService($familleService); + return $hydrator; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/AgentStatusForm.php b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleForm.php similarity index 94% rename from module/Application/src/Application/Form/RessourceRh/AgentStatusForm.php rename to module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleForm.php index 105a88125e6c7e00aa4e98755edeeb05080a53f5..277ae4c45d8885b6b0434557743cb8b2ad93bf4d 100644 --- a/module/Application/src/Application/Form/RessourceRh/AgentStatusForm.php +++ b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleForm.php @@ -6,7 +6,7 @@ use Zend\Form\Element\Button; use Zend\Form\Element\Text; use Zend\Form\Form; -class AgentStatusForm extends Form { +class FamilleProfessionnelleForm extends Form { public function init() { @@ -26,7 +26,7 @@ class AgentStatusForm extends Form { 'type' => Button::class, 'name' => 'creer', 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer le status', + 'label' => '<i class="fas fa-save"></i> Enregistrer', 'label_options' => [ 'disable_html_escape' => true, ], diff --git a/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleFormAwareTrait.php b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleFormAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..37addd4295e09f664e4ce695245421b514ef3adf --- /dev/null +++ b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleFormAwareTrait.php @@ -0,0 +1,29 @@ +<?php + +namespace Application\Form\RessourceRh; + +trait FamilleProfessionnelleFormAwareTrait { + + /** @var FamilleProfessionnelleForm $familleProfessionnelleForm */ + private $familleProfessionnelleForm; + + /** + * @return FamilleProfessionnelleForm + */ + public function getFamilleProfessionnelleForm() + { + return $this->familleProfessionnelleForm; + } + + /** + * @param FamilleProfessionnelleForm $familleProfessionnelleForm + * @return FamilleProfessionnelleForm + */ + public function setFamilleProfessionnelleForm($familleProfessionnelleForm) + { + $this->familleProfessionnelleForm = $familleProfessionnelleForm; + return $this->familleProfessionnelleForm; + } + + +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/AgentStatusFormFactory.php b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleFormFactory.php similarity index 59% rename from module/Application/src/Application/Form/RessourceRh/AgentStatusFormFactory.php rename to module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleFormFactory.php index cd4087f40092783af4a0394533f1ac831d46798e..8e4b875189a5d41cb6fce23c503bd20950192c78 100644 --- a/module/Application/src/Application/Form/RessourceRh/AgentStatusFormFactory.php +++ b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleFormFactory.php @@ -4,14 +4,14 @@ namespace Application\Form\RessourceRh; use Zend\Form\FormElementManager; -class AgentStatusFormFactory { +class FamilleProfessionnelleFormFactory { public function __invoke(FormElementManager $manager) { - /** @var AgentStatusHydrator $hydrator */ - $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(AgentStatusHydrator::class); + /** @var FamilleProfessionnelleHydrator $hydrator */ + $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(FamilleProfessionnelleHydrator::class); - $form = new AgentStatusForm(); + $form = new FamilleProfessionnelleForm(); $form->init(); $form->setHydrator($hydrator); diff --git a/module/Application/src/Application/Form/RessourceRh/MetierFamilleHydrator.php b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleHydrator.php similarity index 65% rename from module/Application/src/Application/Form/RessourceRh/MetierFamilleHydrator.php rename to module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleHydrator.php index 1bd6e6947c7490ba400c8332fb5a4663ba6524d5..0b3a069ff71d096c300271fc62c3346e28031a59 100644 --- a/module/Application/src/Application/Form/RessourceRh/MetierFamilleHydrator.php +++ b/module/Application/src/Application/Form/RessourceRh/FamilleProfessionnelleHydrator.php @@ -2,13 +2,13 @@ namespace Application\Form\RessourceRh; -use Application\Entity\Db\MetierFamille; +use Application\Entity\Db\FamilleProfessionnelle; use Zend\Stdlib\Hydrator\HydratorInterface; -class MetierFamilleHydrator implements HydratorInterface { +class FamilleProfessionnelleHydrator implements HydratorInterface { /** - * @param MetierFamille $object + * @param FamilleProfessionnelle $object * @return array */ public function extract($object) @@ -21,8 +21,8 @@ class MetierFamilleHydrator implements HydratorInterface { /** * @param array $data - * @param MetierFamille $object - * @return MetierFamille + * @param FamilleProfessionnelle $object + * @return FamilleProfessionnelle */ public function hydrate(array $data, $object) { diff --git a/module/Application/src/Application/Form/RessourceRh/CorpsForm.php b/module/Application/src/Application/Form/RessourceRh/FonctionForm.php similarity index 54% rename from module/Application/src/Application/Form/RessourceRh/CorpsForm.php rename to module/Application/src/Application/Form/RessourceRh/FonctionForm.php index c66ee454c5ec8ceda22fbf1bac034b0f6d9630cc..ef7d87c6268d8d0798f528d01f78c187079f4ff2 100644 --- a/module/Application/src/Application/Form/RessourceRh/CorpsForm.php +++ b/module/Application/src/Application/Form/RessourceRh/FonctionForm.php @@ -2,42 +2,38 @@ namespace Application\Form\RessourceRh; +use Application\Service\Domaine\DomaineServiceAwareTrait; use Zend\Form\Element\Button; -use Zend\Form\Element\Text; +use Zend\Form\Element\Select; use Zend\Form\Form; -class CorpsForm extends Form { +class FonctionForm extends Form { + use DomaineServiceAwareTrait; public function init() { - // libelle + // Domaine $this->add([ - 'type' => Text::class, - 'name' => 'code', + 'type' => Select::class, + 'name' => 'domaine', 'options' => [ - 'label' => "Code :", + 'label' => "Domaine* :", + 'empty_option' => "Sélectionner un domaine ...", + 'value_options' => [],//$this->getDomaineService()->getDomainesAsOptions(), ], 'attributes' => [ - 'id' => 'code', - ], - ]); - // libelle - $this->add([ - 'type' => Text::class, - 'name' => 'libelle', - 'options' => [ - 'label' => "Libelle :", - ], - 'attributes' => [ - 'id' => 'libelle', + 'id' => 'domaine', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', ], ]); + // button $this->add([ 'type' => Button::class, 'name' => 'creer', 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer le corps', + 'label' => '<i class="fas fa-save"></i> Enregistrer', 'label_options' => [ 'disable_html_escape' => true, ], diff --git a/module/Application/src/Application/Form/Fonction/FonctionFormAwareTrait.php b/module/Application/src/Application/Form/RessourceRh/FonctionFormAwareTrait.php similarity index 92% rename from module/Application/src/Application/Form/Fonction/FonctionFormAwareTrait.php rename to module/Application/src/Application/Form/RessourceRh/FonctionFormAwareTrait.php index 922fe5944286a7e022f6f164d5e2bf2a83059b1d..b6a79b08645e40172083a160be55dc6c03832ddd 100644 --- a/module/Application/src/Application/Form/Fonction/FonctionFormAwareTrait.php +++ b/module/Application/src/Application/Form/RessourceRh/FonctionFormAwareTrait.php @@ -1,6 +1,6 @@ <?php -namespace Application\Form\Fonction; +namespace Application\Form\RessourceRh; trait FonctionFormAwareTrait { @@ -24,6 +24,4 @@ trait FonctionFormAwareTrait { $this->fonctionForm = $fonctionForm; return $this->fonctionForm; } - - } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Fonction/FonctionFormFactory.php b/module/Application/src/Application/Form/RessourceRh/FonctionFormFactory.php similarity index 52% rename from module/Application/src/Application/Form/Fonction/FonctionFormFactory.php rename to module/Application/src/Application/Form/RessourceRh/FonctionFormFactory.php index 64d34b4aa094fdbd723a21f5d13ece5ea92c30c2..a46f044ccf8f6392d3f0b0c839e701797f3d309c 100644 --- a/module/Application/src/Application/Form/Fonction/FonctionFormFactory.php +++ b/module/Application/src/Application/Form/RessourceRh/FonctionFormFactory.php @@ -1,18 +1,26 @@ <?php -namespace Application\Form\Fonction; +namespace Application\Form\RessourceRh; +use Application\Service\Domaine\DomaineService; use Zend\Form\FormElementManager; class FonctionFormFactory { public function __invoke(FormElementManager $manager) { + /** + * @var DomaineService $domaineService + */ + $domaineService = $manager->getServiceLocator()->get(DomaineService::class); + /** @var FonctionHydrator $hydrator */ $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(FonctionHydrator::class); - /** @var FonctionForm */ + /** @var FonctionForm $form */ $form = new FonctionForm(); + $form->setDomaineService($domaineService); + $form->init(); $form->setHydrator($hydrator); return $form; } diff --git a/module/Application/src/Application/Form/RessourceRh/FonctionHydrator.php b/module/Application/src/Application/Form/RessourceRh/FonctionHydrator.php new file mode 100644 index 0000000000000000000000000000000000000000..b9de95236dc9bc1cc5f53d27735ec303b734d81d --- /dev/null +++ b/module/Application/src/Application/Form/RessourceRh/FonctionHydrator.php @@ -0,0 +1,38 @@ +<?php + +namespace Application\Form\RessourceRh; + +use Application\Entity\Db\Fonction; +use Application\Service\Domaine\DomaineServiceAwareTrait; +use Zend\Stdlib\Hydrator\HydratorInterface; + +class FonctionHydrator implements HydratorInterface { + use DomaineServiceAwareTrait; + + /** + * @param Fonction $object + * @return array + */ + public function extract($object) + { + $data = [ + 'domaine' => ($object->getDomaine())?$object->getDomaine()->getId():null, + ]; + return $data; + } + + /** + * @param array $data + * @param Fonction $object + * @return Fonction + */ + public function hydrate(array $data, $object) + { + $domaine = $this->getDomaineService()->getDomaine($data['domaine']); + + $object->setDomaine($domaine); + + return $object; + } + +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/FonctionHydratorFactory.php b/module/Application/src/Application/Form/RessourceRh/FonctionHydratorFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..bd8f7fffcf6adc887eef668e9400943f3fbaf538 --- /dev/null +++ b/module/Application/src/Application/Form/RessourceRh/FonctionHydratorFactory.php @@ -0,0 +1,22 @@ +<?php + +namespace Application\Form\RessourceRh; + +use Application\Service\Domaine\DomaineService; +use Zend\Stdlib\Hydrator\HydratorPluginManager; + +class FonctionHydratorFactory { + + public function __invoke(HydratorPluginManager $manager) + { + /** + * @var DomaineService $domaineService + */ + $domaineService = $manager->getServiceLocator()->get(DomaineService::class); + + /** @var FonctionHydrator $hydrator */ + $hydrator = new FonctionHydrator(); + $hydrator->setDomaineService($domaineService); + return $hydrator; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/GradeForm.php b/module/Application/src/Application/Form/RessourceRh/GradeForm.php deleted file mode 100644 index 03ee6434b3423ff0574357c3d8be95f35e20c726..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/GradeForm.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Application\Entity\Db\Corps; -use DoctrineModule\Form\Element\ObjectSelect; -use UnicaenApp\Service\EntityManagerAwareTrait; -use Zend\Form\Element\Button; -use Zend\Form\Element\Text; -use Zend\Form\Form; - -class GradeForm extends Form { - use EntityManagerAwareTrait; - - public function init() - { - // Status - $this->add([ - 'type' => ObjectSelect::class, - 'name' => 'corps', - 'options' => [ - 'label' => "Corps* :", - 'empty_option' => "Sélectionner un corps ...", - 'object_manager' => $this->getEntityManager(), - 'target_class' => Corps::class, - 'property' => 'libelle', - 'find_method' => [ - 'name' => 'findBy', - 'params' => [ - 'criteria' => [], - 'orderBy' => ['libelle' => 'ASC'], - ], - ], - 'disable_inarray_validator' => true, - ], - 'attributes' => [ - 'id' => 'corps', - ], - ]); - // libelle - $this->add([ - 'type' => Text::class, - 'name' => 'libelle', - 'options' => [ - 'label' => "Libelle :", - ], - 'attributes' => [ - 'id' => 'libelle', - ], - ]); - // rang - $this->add([ - 'type' => Text::class, - 'name' => 'rang', - 'options' => [ - 'label' => "Rang :", - ], - 'attributes' => [ - 'id' => 'rang', - ], - ]); - // button - $this->add([ - 'type' => Button::class, - 'name' => 'creer', - 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer le grade', - 'label_options' => [ - 'disable_html_escape' => true, - ], - ], - 'attributes' => [ - 'type' => 'submit', - 'class' => 'btn btn-primary', - ], - ]); - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/GradeFormAwareTrait.php b/module/Application/src/Application/Form/RessourceRh/GradeFormAwareTrait.php deleted file mode 100644 index 9698202769e9c9cc9aa344f23fd3a4bc16a4ca67..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/GradeFormAwareTrait.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -trait GradeFormAwareTrait { - - /** @var GradeForm $gradeForm */ - private $gradeForm; - - /** - * @return GradeForm - */ - public function getGradeForm() - { - return $this->gradeForm; - } - - /** - * @param GradeForm $gradeForm - * @return GradeForm - */ - public function setGradeForm($gradeForm) - { - $this->gradeForm = $gradeForm; - return $this->gradeForm; - } - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/GradeFormFactory.php b/module/Application/src/Application/Form/RessourceRh/GradeFormFactory.php deleted file mode 100644 index 5380758bfea8d5ce7168e233ca36f523143c41d4..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/GradeFormFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Zend\Form\FormElementManager; - -class GradeFormFactory { - - public function __invoke(FormElementManager $manager) - { - /** @var GradeHydrator $hydrator */ - $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(GradeHydrator::class); - - $form = new GradeForm(); - $form->init(); - $form->setHydrator($hydrator); - - return $form; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/GradeHydrator.php b/module/Application/src/Application/Form/RessourceRh/GradeHydrator.php deleted file mode 100644 index 28464deb8ea975b27c5c90a0d44151c6c18cfcaf..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/GradeHydrator.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Application\Entity\Db\Grade; -use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; -use Zend\Stdlib\Hydrator\HydratorInterface; - -class GradeHydrator implements HydratorInterface { - use RessourceRhServiceAwareTrait; - - /** - * @param Grade $object - * @return array - */ - public function extract($object) - { - $data = [ - 'libelle' => $object->getLibelle(), - 'rang' => $object->getRang(), - 'corps' => ($object && $object->getCorps())?$object->getCorps()->getId():0, - ]; - return $data; - } - - /** - * @param array $data - * @param Grade $object - * @return Grade - */ - public function hydrate(array $data, $object) - { - $corps = $this->getRessourceRhService()->getCorps($data['corps']); - - $object->setLibelle($data['libelle']); - $object->setRang($data['rang']); - $object->setCorps($corps); - return $object; - } - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/GradeHydratorFactory.php b/module/Application/src/Application/Form/RessourceRh/GradeHydratorFactory.php deleted file mode 100644 index c3876d54d5472e36810fc0af13ad6d5b4769a860..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/GradeHydratorFactory.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Application\Service\RessourceRh\RessourceRhService; -use Zend\ServiceManager\ServiceLocatorInterface; - -class GradeHydratorFactory { - - public function __invoke(ServiceLocatorInterface $serviceLocator) - { - /** @var ServiceLocatorInterface $parentLocator */ - $parentLocator = $serviceLocator->getServiceLocator(); - /** @var RessourceRhService $ressourceService */ - $ressourceService = $parentLocator->get(RessourceRhService::class); - - $hydrator = new GradeHydrator(); - $hydrator->setRessourceRhService($ressourceService); - - return $hydrator; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/MetierFamilleFormAwareTrait.php b/module/Application/src/Application/Form/RessourceRh/MetierFamilleFormAwareTrait.php deleted file mode 100644 index 430280f0f76c193b33a16e48a8680f390871244e..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/MetierFamilleFormAwareTrait.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -trait MetierFamilleFormAwareTrait { - - /** @var MetierFamilleForm $metierFamilleForm */ - private $metierFamilleForm; - - /** - * @return MetierFamilleForm - */ - public function getMetierFamilleForm() - { - return $this->metierFamilleForm; - } - - /** - * @param MetierFamilleForm $metierFamilleForm - * @return MetierFamilleForm - */ - public function setMetierFamilleForm($metierFamilleForm) - { - $this->metierFamilleForm = $metierFamilleForm; - return $this->metierFamilleForm; - } - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/MetierFamilleFormFactory.php b/module/Application/src/Application/Form/RessourceRh/MetierFamilleFormFactory.php deleted file mode 100644 index 8875cbc19cf3c93ac2a86b3a31a247368218a877..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/RessourceRh/MetierFamilleFormFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Application\Form\RessourceRh; - -use Zend\Form\FormElementManager; - -class MetierFamilleFormFactory { - - public function __invoke(FormElementManager $manager) - { - /** @var MetierFamilleHydrator $hydrator */ - $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(MetierFamilleHydrator::class); - - $form = new MetierFamilleForm(); - $form->init(); - $form->setHydrator($hydrator); - - return $form; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/RessourceRh/MetierForm.php b/module/Application/src/Application/Form/RessourceRh/MetierForm.php index 9a81638b2b9e367bb5dbddade424333daffa38bd..00b92e6c4571a24487a17696dba7e7fa9f94f2ac 100644 --- a/module/Application/src/Application/Form/RessourceRh/MetierForm.php +++ b/module/Application/src/Application/Form/RessourceRh/MetierForm.php @@ -2,39 +2,49 @@ namespace Application\Form\RessourceRh; -use Application\Entity\Db\MetierFamille; -use DoctrineModule\Form\Element\ObjectSelect; -use UnicaenApp\Service\EntityManagerAwareTrait; +use Application\Service\Domaine\DomaineServiceAwareTrait; +use Application\Service\Fonction\FonctionServiceAwareTrait; use Zend\Form\Element\Button; +use Zend\Form\Element\Select; use Zend\Form\Element\Text; use Zend\Form\Form; class MetierForm extends Form { - use EntityManagerAwareTrait; + use DomaineServiceAwareTrait; public function init() { - // Status + //domaine $this->add([ - 'type' => ObjectSelect::class, - 'name' => 'famille', + 'type' => Select::class, + 'name' => 'fonction', 'options' => [ - 'label' => "Famille de métier* :", - 'empty_option' => "Sélectionner une famille de métier ...", - 'object_manager' => $this->getEntityManager(), - 'target_class' => MetierFamille::class, - 'property' => 'libelle', - 'find_method' => [ - 'name' => 'findBy', - 'params' => [ - 'criteria' => [], - 'orderBy' => ['libelle' => 'ASC'], - ], + 'label' => "Fonction :", + 'empty_option' => "Sélectionner une fonction ...", + 'value_options' => [ + 'Soutien' => 'Soutien', + 'Support' => 'Support', ], - 'disable_inarray_validator' => true, ], 'attributes' => [ - 'id' => 'famille', + 'id' => 'fonction', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', + ], + ]); + //fonction + $this->add([ + 'type' => Select::class, + 'name' => 'domaine', + 'options' => [ + 'label' => "Domaine UniCaen* :", + 'empty_option' => "Sélectionner un domaine ...", + 'value_options' => $this->getDomaineService()->getDomainesAsOptions(), + ], + 'attributes' => [ + 'id' => 'fonction', + 'class' => 'bootstrap-selectpicker show-tick', + 'data-live-search' => 'true', ], ]); // libelle @@ -53,7 +63,7 @@ class MetierForm extends Form { 'type' => Button::class, 'name' => 'creer', 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer le métier', + 'label' => '<i class="fas fa-save"></i> Enregistrer', 'label_options' => [ 'disable_html_escape' => true, ], diff --git a/module/Application/src/Application/Form/RessourceRh/MetierFormFactory.php b/module/Application/src/Application/Form/RessourceRh/MetierFormFactory.php index 5e7fab51719fb8b037cd4ddfd2f46193b8fdc72d..f3374f8e2caebe059bf28ee7cd0449a85d44356a 100644 --- a/module/Application/src/Application/Form/RessourceRh/MetierFormFactory.php +++ b/module/Application/src/Application/Form/RessourceRh/MetierFormFactory.php @@ -2,6 +2,7 @@ namespace Application\Form\RessourceRh; +use Application\Service\Domaine\DomaineService; use Zend\Form\FormElementManager; class MetierFormFactory { @@ -11,7 +12,11 @@ class MetierFormFactory { /** @var MetierHydrator $hydrator */ $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(MetierHydrator::class); + /** @var DomaineService $domaineService */ + $domaineService = $manager->getServiceLocator()->get(DomaineService::class); + $form = new MetierForm(); + $form->setDomaineService($domaineService); $form->init(); $form->setHydrator($hydrator); diff --git a/module/Application/src/Application/Form/RessourceRh/MetierHydrator.php b/module/Application/src/Application/Form/RessourceRh/MetierHydrator.php index ef7a851bfa0252a94bbd64953ac01bd3e82302ff..29cca03f0496792a9b16b9045b2612046e929862 100644 --- a/module/Application/src/Application/Form/RessourceRh/MetierHydrator.php +++ b/module/Application/src/Application/Form/RessourceRh/MetierHydrator.php @@ -3,11 +3,11 @@ namespace Application\Form\RessourceRh; use Application\Entity\Db\Metier; -use Application\Service\RessourceRh\RessourceRhServiceAwareTrait; +use Application\Service\Domaine\DomaineServiceAwareTrait; use Zend\Stdlib\Hydrator\HydratorInterface; class MetierHydrator implements HydratorInterface { - use RessourceRhServiceAwareTrait; + use DomaineServiceAwareTrait; /** * @param Metier $object @@ -16,7 +16,8 @@ class MetierHydrator implements HydratorInterface { public function extract($object) { $data = [ - 'famille' => $object->getFamille(), + 'domaine' => ($object->getDomaine())?$object->getDomaine()->getId():null, + 'fonction' => $object->getFonction(), 'libelle' => $object->getLibelle(), ]; return $data; @@ -29,10 +30,11 @@ class MetierHydrator implements HydratorInterface { */ public function hydrate(array $data, $object) { - $famille = $this->getRessourceRhService()->getMetierFamille($data['famille']); + $domaine = $this->getDomaineService()->getDomaine($data['domaine']); $object->setLibelle($data['libelle']); - $object->setFamille($famille); + $object->setFonction($data['fonction']); + $object->setDomaine($domaine); return $object; } diff --git a/module/Application/src/Application/Form/RessourceRh/MetierHydratorFactory.php b/module/Application/src/Application/Form/RessourceRh/MetierHydratorFactory.php index 45bf78edcc1f44c2313df40339f2d4bc6c134c8c..f5b789e2f4699dda61289898171abba0f59c8b00 100644 --- a/module/Application/src/Application/Form/RessourceRh/MetierHydratorFactory.php +++ b/module/Application/src/Application/Form/RessourceRh/MetierHydratorFactory.php @@ -2,7 +2,7 @@ namespace Application\Form\RessourceRh; -use Application\Service\RessourceRh\RessourceRhService; +use Application\Service\Domaine\DomaineService; use Zend\ServiceManager\ServiceLocatorInterface; class MetierHydratorFactory { @@ -11,11 +11,11 @@ class MetierHydratorFactory { { /** @var ServiceLocatorInterface $parentLocator */ $parentLocator = $serviceLocator->getServiceLocator(); - /** @var RessourceRhService $ressourceService */ - $ressourceService = $parentLocator->get(RessourceRhService::class); + /** @var DomaineService $domaineService */ + $domaineService = $parentLocator->get(DomaineService::class); $hydrator = new MetierHydrator(); - $hydrator->setRessourceRhService($ressourceService); + $hydrator->setDomaineService($domaineService); return $hydrator; } diff --git a/module/Application/src/Application/Form/SpecificitePoste/SpecificitePosteForm.php b/module/Application/src/Application/Form/SpecificitePoste/SpecificitePosteForm.php index 114832bca96249bf6c237fa58d7cfe02117d4bed..81cdf214c8a212bec503016f472f87401140d360 100644 --- a/module/Application/src/Application/Form/SpecificitePoste/SpecificitePosteForm.php +++ b/module/Application/src/Application/Form/SpecificitePoste/SpecificitePosteForm.php @@ -70,7 +70,7 @@ class SpecificitePosteForm extends Form { 'name' => 'contraintes', 'type' => 'textarea', 'options' => [ - 'label' => 'Contraintes particulières d\'exercice : ', + 'label' => 'Sujétions ou conditions particulières : ', 'label_attributes' => [ 'class' => 'control-label', ], diff --git a/module/Application/src/Application/Form/Structure/StructureForm.php b/module/Application/src/Application/Form/Structure/StructureForm.php index 44ac5a6a56e7e03785a8c62418ee5238e8d6b0b1..b1d459ae7aea6457c4fcbeb6c8180b64ba42a959 100644 --- a/module/Application/src/Application/Form/Structure/StructureForm.php +++ b/module/Application/src/Application/Form/Structure/StructureForm.php @@ -2,86 +2,13 @@ namespace Application\Form\Structure; -use Application\Service\Structure\StructureServiceAwareTrait; -use UnicaenApp\Form\Element\Date; use Zend\Form\Element\Button; -use Zend\Form\Element\Select; -use Zend\Form\Element\Text; use Zend\Form\Form; -use Zend\InputFilter\Factory; class StructureForm extends Form { - use StructureServiceAwareTrait; public function init() { - // libelle court - $this->add([ - 'type' => Text::class, - 'name' => 'libelle_court', - 'options' => [ - 'label' => "Libelle court* :", - ], - 'attributes' => [ - 'id' => 'libelle_court', - ], - ]); - // libelle long - $this->add([ - 'type' => Text::class, - 'name' => 'libelle_long', - 'options' => [ - 'label' => "Libelle long :", - ], - 'attributes' => [ - 'id' => 'libelle_long', - ], - ]); - // sigle - $this->add([ - 'type' => Text::class, - 'name' => 'sigle', - 'options' => [ - 'label' => "Sigle :", - ], - 'attributes' => [ - 'id' => 'sigle', - ], - ]); - // sigle - $this->add([ - 'type' => Select::class, - 'name' => 'type', - 'options' => [ - 'label' => "Type de structure* :", - 'value_options' => $this->getStructureService()->getStructureTypeAsOptions(), - ], - 'attributes' => [ - 'id' => 'type', - ], - ]); - // date d'ouverture - $this->add([ - 'type' => Date::class, - 'name' => 'date_ouverture', - 'options' => [ - 'label' => "Date ouverture* :", - ], - 'attributes' => [ - 'id' => 'date_ouverture', - ], - ]); - // date de fermeture - $this->add([ - 'type' => Date::class, - 'name' => 'date_fermeture', - 'options' => [ - 'label' => "Date de fermeture :", - ], - 'attributes' => [ - 'id' => 'date_fermeture', - ], - ]); // description $this->add([ 'name' => 'description', @@ -101,7 +28,7 @@ class StructureForm extends Form { 'type' => Button::class, 'name' => 'creer', 'options' => [ - 'label' => '<i class="fas fa-save"></i> Enregistrer', + 'label' => '<i class="fas fa-save"></i> Enregistrer l\'application', 'label_options' => [ 'disable_html_escape' => true, ], @@ -111,15 +38,5 @@ class StructureForm extends Form { 'class' => 'btn btn-primary', ], ]); - - $this->setInputFilter((new Factory())->createInputFilter([ - 'libelle_court' => [ 'required' => true, ], - 'libelle_long' => [ 'required' => false, ], - 'sigle' => [ 'required' => false, ], - 'type' => [ 'required' => true, ], - 'date_ouverture' => [ 'required' => true, ], - 'date_fermeture' => [ 'required' => false, ], - 'description' => [ 'required' => false, ], - ])); } } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Structure/StructureFormAwareTrait.php b/module/Application/src/Application/Form/Structure/StructureFormAwareTrait.php index 93bba657c38814423b248f0cc692db298785b418..1c16c2c595383d1134d5c080e233d3b1dd92701a 100644 --- a/module/Application/src/Application/Form/Structure/StructureFormAwareTrait.php +++ b/module/Application/src/Application/Form/Structure/StructureFormAwareTrait.php @@ -24,6 +24,4 @@ trait StructureFormAwareTrait { $this->structureForm = $structureForm; return $this->structureForm; } - - } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Structure/StructureFormFactory.php b/module/Application/src/Application/Form/Structure/StructureFormFactory.php index cd1ea5f706c3d841d3d22dbef91f34e233259811..fb2d571a6f4886ad014a9a1285631afa388a6165 100644 --- a/module/Application/src/Application/Form/Structure/StructureFormFactory.php +++ b/module/Application/src/Application/Form/Structure/StructureFormFactory.php @@ -2,7 +2,6 @@ namespace Application\Form\Structure; -use Application\Service\Structure\StructureService; use Zend\Form\FormElementManager; class StructureFormFactory { @@ -12,13 +11,11 @@ class StructureFormFactory { /** @var StructureHydrator $hydrator */ $hydrator = $manager->getServiceLocator()->get('HydratorManager')->get(StructureHydrator::class); - /** @var StructureService $structureService */ - $structureService = $manager->getServiceLocator()->get(StructureService::class); - + /** @var StructureForm $form */ $form = new StructureForm(); - $form->setStructureService($structureService); $form->setHydrator($hydrator); $form->init(); return $form; } + } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Structure/StructureHydrator.php b/module/Application/src/Application/Form/Structure/StructureHydrator.php index 11c0b994b9510007b3d2ea6cf8d100de75cfbb93..79decdd456e1c58cad036427119c2bd08dff5e1b 100644 --- a/module/Application/src/Application/Form/Structure/StructureHydrator.php +++ b/module/Application/src/Application/Form/Structure/StructureHydrator.php @@ -3,14 +3,10 @@ namespace Application\Form\Structure; use Application\Entity\Db\Structure; -use Application\Service\Structure\StructureServiceAwareTrait; -use DateTime; use Zend\Stdlib\Hydrator\HydratorInterface; class StructureHydrator implements HydratorInterface { - use StructureServiceAwareTrait; - const date_format = 'd/m/Y'; /** * @param Structure $object * @return array @@ -18,36 +14,16 @@ class StructureHydrator implements HydratorInterface { public function extract($object) { $data = [ - 'libelle_court' => $object->getLibelleCourt(), - 'libelle_long' => $object->getLibelleLong(), - 'sigle' => $object->getSigle(), - 'type' => ($object->getType())?$object->getType()->getCode():null, - 'date_ouverture' => ($object->getDateOuverture())?$object->getDateOuverture()->format(StructureHydrator::date_format):null, - 'date_fermeture' => ($object->getDateFermeture())?$object->getDateFermeture()->format(StructureHydrator::date_format):null, - 'description' => $object->getDescription(), + 'description' => $object->getDescription(), ]; return $data; } - /** - * @param array $data - * @param Structure $object - * @return Structure - */ public function hydrate(array $data, $object) { - $type = $this->getStructureService()->getStructureTypeByCode($data['type']); - $dateOuverture = ($data['date_ouverture'] !== "")?DateTime::createFromFormat(StructureHydrator::date_format, $data['date_ouverture']):null; - $dateFermeture = ($data['date_fermeture'] !== "")?DateTime::createFromFormat(StructureHydrator::date_format, $data['date_fermeture']):null; - - $object->setLibelleCourt($data['libelle_court']); - $object->setLibelleLong($data['libelle_long']); - $object->setSigle($data['sigle']); - $object->setType($type); - $object->setDateOuverture($dateOuverture); - $object->setDateFermeture($dateFermeture); - $object->setDescription($data['description']); + if ($data['description'] && $data['description'] != '') $object->setDescription($data['description']); return $object; } + } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Structure/StructureHydratorFactory.php b/module/Application/src/Application/Form/Structure/StructureHydratorFactory.php deleted file mode 100644 index 8a52d69deaf980191bb9645882e5e32bbfe7d57d..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Form/Structure/StructureHydratorFactory.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Application\Form\Structure; - -use Application\Service\Structure\StructureService; -use Zend\Stdlib\Hydrator\HydratorPluginManager; - -class StructureHydratorFactory { - - public function __invoke(HydratorPluginManager $manager) - { - /** - * @var StructureService $structureService - */ - $structureService = $manager->getServiceLocator()->get(StructureService::class); - - /** - * @var StructureHydrator $hydrator - */ - $hydrator = new StructureHydrator(); - $hydrator->setStructureService($structureService); - return $hydrator; - } - -} \ No newline at end of file diff --git a/module/Application/src/Application/Provider/Privilege/ActivitePrivileges.php b/module/Application/src/Application/Provider/Privilege/ActivitePrivileges.php index 0aaf9b0da0ae9b05b5874261a83dc355bb020ee7..a2051725f76567e97c76012a1193e1964530eeef 100644 --- a/module/Application/src/Application/Provider/Privilege/ActivitePrivileges.php +++ b/module/Application/src/Application/Provider/Privilege/ActivitePrivileges.php @@ -4,8 +4,8 @@ namespace Application\Provider\Privilege; class ActivitePrivileges extends \UnicaenAuth\Provider\Privilege\Privileges { - const AJOUTER = 'activite-ajouter-activite'; const AFFICHER = 'activite-afficher-activite'; + const AJOUTER = 'activite-ajouter-activite'; const EDITER = 'activite-editer-activite'; const EFFACER = 'activite-effacer-activite'; } diff --git a/module/Application/src/Application/Provider/Privilege/FichePostePrivileges.php b/module/Application/src/Application/Provider/Privilege/FichePostePrivileges.php new file mode 100644 index 0000000000000000000000000000000000000000..dcd53a8515c78f77903c1ef85e4e7d20e7d685bb --- /dev/null +++ b/module/Application/src/Application/Provider/Privilege/FichePostePrivileges.php @@ -0,0 +1,11 @@ +<?php + +namespace Application\Provider\Privilege; + +class FichePostePrivileges extends \UnicaenAuth\Provider\Privilege\Privileges +{ + const AFFICHER = 'ficheposte-fp-afficher'; + const HISTORISER = 'ficheposte-fp-historiser'; + const EDITER = 'ficheposte-fp-editer-fiche'; + const AJOUTER = 'ficheposte-fp-ajouter-fiche'; +} diff --git a/module/Application/src/Application/Provider/Privilege/PersoPrivileges.php b/module/Application/src/Application/Provider/Privilege/PersoPrivileges.php new file mode 100644 index 0000000000000000000000000000000000000000..a13eeb2d3c6a81553c385a2b13ebd772017f5a04 --- /dev/null +++ b/module/Application/src/Application/Provider/Privilege/PersoPrivileges.php @@ -0,0 +1,10 @@ +<?php + +namespace Application\Provider\Privilege; + +class PersoPrivileges extends \UnicaenAuth\Provider\Privilege\Privileges +{ + const MENU = 'perso-perso-menu'; + const ENTRETIEN = 'perso-perso-entretien'; + const FICHIER = 'perso-perso-fichier'; +} diff --git a/module/Application/src/Application/Service/Activite/ActiviteService.php b/module/Application/src/Application/Service/Activite/ActiviteService.php index 4de87d7850d175d1c187f47841f4c5256cadb9a0..d0c9017bad899eda409da09de2e36027c464faf9 100644 --- a/module/Application/src/Application/Service/Activite/ActiviteService.php +++ b/module/Application/src/Application/Service/Activite/ActiviteService.php @@ -3,7 +3,7 @@ namespace Application\Service\Activite; use Application\Entity\Db\Activite; -use Application\Entity\Db\FicheMetierType; +use Application\Entity\Db\FicheMetier; use Application\Entity\Db\FicheMetierTypeActivite; use Exception; use Utilisateur\Service\User\UserServiceAwareTrait; @@ -166,6 +166,10 @@ class ActiviteService { } } + /** + * @param $id + * @return FicheMetierTypeActivite + */ public function getFicheMetierTypeActivite($id) { $qb = $this->getEntityManager()->getRepository(FicheMetierTypeActivite::class)->createQueryBuilder('activite') @@ -182,7 +186,7 @@ class ActiviteService { } /** - * @param FicheMetierType $fiche + * @param FicheMetier $fiche * @return FicheMetierTypeActivite[] */ public function getActivitesByFicheMetierType($fiche) @@ -292,6 +296,9 @@ class ActiviteService { } + /** + * @param FicheMetierTypeActivite $couple + */ public function removeFicheMetierTypeActivite($couple) { $this->getEntityManager()->remove($couple); @@ -304,27 +311,8 @@ class ActiviteService { $this->compacting($couple->getFiche()); } - public function getActiviteDisponible($fiche) { - //select a.id, a.libelle, f.id - //from activite a - //left join fiche_metier_type_activite f on a.id = f.activite and f.fiche=1 - //where f.id IS NULL; - -// $qb = $this->getEntityManager()->getRepository(Activite::class)->createQueryBuilder('activite') -// ->leftJoin('activite.id', 'fiche_activite', 'on' ) - - //select * - //from activite a - //where a.id not in ( - //select a.id from fiche_metier_type_activite f - //join activite a on f.activite = a.id where f.fiche = 1 - //) - - - } - /** - * @param FicheMetierType $ficheMetier + * @param FicheMetier $ficheMetier * @return array */ public function getActivitesAsOptions($ficheMetier = null) diff --git a/module/Application/src/Application/Service/Agent/AgentService.php b/module/Application/src/Application/Service/Agent/AgentService.php index ed82bd4d6d2c3ccc8fbc90e997ee0b53f717f784..5af72e7c12e3d50d4316b9e8ec46009d46685ae8 100644 --- a/module/Application/src/Application/Service/Agent/AgentService.php +++ b/module/Application/src/Application/Service/Agent/AgentService.php @@ -3,10 +3,8 @@ namespace Application\Service\Agent; use Application\Entity\Db\Agent; -use Application\Entity\Db\MissionComplementaire; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\OptimisticLockException; -use UnicaenApp\Entity\Ldap\People; use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Service\EntityManagerAwareTrait; use Utilisateur\Entity\Db\User; @@ -25,6 +23,8 @@ class AgentService { if ($order !== null) { $qb = $qb->orderBy('agent.' . $order); + } else { + $qb = $qb->orderBy('agent.nomUsuel, agent.prenom'); } $result = $qb->getQuery()->getResult(); @@ -80,36 +80,6 @@ class AgentService { return $result; } - /** - * @param People $people - * @param User user - * @return Agent - */ - public function createFromLDAP($people, $user) - { - $agent = new Agent(); - $agent->setUtilisateur($user); - $agent->setNom($people->getNomUsuel()); - $agent->setPrenom($people->getGivenName()); - - $this->create($agent); - } - - /** - * @param Agent $agent - * @return Agent - */ - public function create($agent) - { - $this->getEntityManager()->persist($agent); - try { - $this->getEntityManager()->flush($agent); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème a été recontré lors de la création de l'agent", $e); - } - return $agent; - } - /** * @param Agent $agent * @return Agent @@ -125,74 +95,23 @@ class AgentService { } /** - * @param Agent $agent + * @param int $supannId + * @return Agent */ - public function delete($agent) - { - $this->getEntityManager()->remove($agent); - try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème a été recontré lors de la suppression de l'agent", $e); - } - } - - /** MISSION COMP **************************************************************************************************/ - - public function getMissionComplementaire($id) + public function getAgentBySupannId($supannId) { - $qb = $this->getEntityManager()->getRepository(MissionComplementaire::class)->createQueryBuilder('mission') - ->andWhere('mission.id = :id') - ->setParameter('id', $id) - ; + $qb = $this->getEntityManager()->getRepository(Agent::class)->createQueryBuilder('agent') + ->andWhere('agent.sourceName = :harp') + ->andWhere('agent.sourceId = :supannId') + ->setParameter('harp', 'HARP') + ->setParameter('supannId', $supannId); try { $result = $qb->getQuery()->getOneOrNullResult(); } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs missions complémentaires partagent le même identifiant [".$id."]"); + throw new RuntimeException("Plusieurs agents partagent le même identifiant [".$supannId."]"); } return $result; - } - - /** - * @param MissionComplementaire $mission - * @return MissionComplementaire - */ - public function createMissionComplementaire($mission) - { - $this->getEntityManager()->persist($mission); - try { - $this->getEntityManager()->flush($mission); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème a été recontré lors de la création de la mission complémentaire", $e); - } - return $mission; - } - /** - * @param MissionComplementaire $mission - * @return MissionComplementaire - */ - public function updateMissionComplementaire($mission) - { - try { - $this->getEntityManager()->flush($mission); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème a été recontré lors de la mise à jour de la mission complémentaire", $e); - } - return $mission; - } - - /** - * @param MissionComplementaire $mission - */ - public function deleteMissionComplementaire($mission) - { - $this->getEntityManager()->remove($mission); - try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème a été recontré lors de la suppression de la mission complémentaire", $e); - } } } \ No newline at end of file diff --git a/module/Application/src/Application/Service/Domaine/DomaineService.php b/module/Application/src/Application/Service/Domaine/DomaineService.php new file mode 100644 index 0000000000000000000000000000000000000000..c6cd22720e7cf712876acd6d04e52f8fd78c8c43 --- /dev/null +++ b/module/Application/src/Application/Service/Domaine/DomaineService.php @@ -0,0 +1,121 @@ +<?php + +namespace Application\Service\Domaine; + +use Application\Entity\Db\Domaine; +use Doctrine\ORM\NonUniqueResultException; +use Doctrine\ORM\OptimisticLockException; +use UnicaenApp\Exception\RuntimeException; +use UnicaenApp\Service\EntityManagerAwareTrait; +use Zend\Mvc\Controller\AbstractActionController; + +class DomaineService { + use EntityManagerAwareTrait; + + /** + * @return Domaine[] + */ + public function getDomaines() + { + $qb = $this->getEntityManager()->getRepository(Domaine::class)->createQueryBuilder('domaine') + ->addSelect('famille')->leftJoin('domaine.famille', 'famille') + ->addSelect('metier')->leftJoin('domaine.metiers', 'metier') + ; + $qb = $qb->addOrderBy('domaine.libelle', 'ASC'); + + $result = $qb->getQuery()->getResult(); + return $result; + } + + /** + * @return array + */ + public function getDomainesAsOptions() + { + $domaines = $this->getDomaines(); + + $options = []; + foreach ($domaines as $domaine) { + $options[$domaine->getId()] = $domaine->getLibelle(); + } + + return $options; + } + + /** + * @param integer $id + * @return Domaine + */ + public function getDomaine($id) + { + $qb = $this->getEntityManager()->getRepository(Domaine::class)->createQueryBuilder('domaine') + ->addSelect('famille')->leftJoin('domaine.famille', 'famille') + ->addSelect('metier')->leftJoin('domaine.metiers', 'metier') + ->andWhere('domaine.id = :id') + ->setParameter('id', $id) + ; + + try { + $result = $qb->getQuery()->getOneOrNullResult(); + } catch (NonUniqueResultException $e) { + throw new RuntimeException("Plusieurs Domaine partagent le même identifiant [".$id."]"); + } + return $result; + } + + /** + * @param AbstractActionController $controller + * @param string $paramName + * @return Domaine + */ + public function getRequestedDomaine($controller, $paramName) + { + $id = $controller->params()->fromRoute($paramName); + $domaine = $this->getDomaine($id); + + return $domaine; + } + + /** + * @param Domaine $domaine + * @return Domaine + */ + public function create($domaine) + { + $this->getEntityManager()->persist($domaine); + try { + $this->getEntityManager()->flush($domaine); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la création d'un Domaine", $e); + } + return $domaine; + } + + /** + * @param Domaine $domaine + * @return Domaine + */ + public function update($domaine) + { + try { + $this->getEntityManager()->flush($domaine); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'un Domaine.", $e); + } + return $domaine; + } + + /** + * @param Domaine $domaine + */ + public function delete($domaine) + { + $this->getEntityManager()->remove($domaine); + try { + $this->getEntityManager()->flush(); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la suppression d'un Domaine", $e); + } + } + +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Domaine/DomaineServiceAwareTrait.php b/module/Application/src/Application/Service/Domaine/DomaineServiceAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..b41c2e32b15cd3c5ccebcd5e13d221973546138c --- /dev/null +++ b/module/Application/src/Application/Service/Domaine/DomaineServiceAwareTrait.php @@ -0,0 +1,27 @@ +<?php + +namespace Application\Service\Domaine; + +trait DomaineServiceAwareTrait { + + /** @var DomaineService $domaineService */ + private $domaineService; + + /** + * @return DomaineService + */ + public function getDomaineService() + { + return $this->domaineService; + } + + /** + * @param DomaineService $domaineService + * @return DomaineService + */ + public function setDomaineService($domaineService) + { + $this->domaineService = $domaineService; + return $this->domaineService; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Domaine/DomaineServiceFactory.php b/module/Application/src/Application/Service/Domaine/DomaineServiceFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..4a54e4944b7993e7743207a5fca68fbc58e4f289 --- /dev/null +++ b/module/Application/src/Application/Service/Domaine/DomaineServiceFactory.php @@ -0,0 +1,20 @@ +<?php + +namespace Application\Service\Domaine; + +use Doctrine\ORM\EntityManager; +use Zend\ServiceManager\ServiceLocatorInterface; + +class DomaineServiceFactory { + + public function __invoke(ServiceLocatorInterface $serviceLocator) + { + /** @var EntityManager $entityManager */ + $entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default'); + + /** @var DomaineService $service */ + $service = new DomaineService(); + $service->setEntityManager($entityManager); + return $service; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Export/FicheMetier/FicheMetierPdfExporter.php b/module/Application/src/Application/Service/Export/FicheMetier/FicheMetierPdfExporter.php new file mode 100644 index 0000000000000000000000000000000000000000..cbb40b054da3ea666fabca61d183df717ed793dd --- /dev/null +++ b/module/Application/src/Application/Service/Export/FicheMetier/FicheMetierPdfExporter.php @@ -0,0 +1,36 @@ +<?php + +namespace Application\Service\Export\FicheMetier; + +use UnicaenApp\Exporter\Pdf as PdfExporter; +use Zend\View\Renderer\PhpRenderer; +use Zend\View\Resolver\TemplatePathStack; + +class FicheMetierPdfExporter extends PdfExporter +{ + private $vars; + + public function setVars(array $vars) + { + $this->vars = $vars; + $this->vars['exporter'] = $this; + + return $this; + } + + public function __construct(PhpRenderer $renderer = null, $format = 'A4', $orientationPaysage = false, $defaultFontSize = 10) + { + parent::__construct($renderer, $format, $orientationPaysage, $defaultFontSize); + $resolver = $renderer->resolver(); + $resolver->attach(new TemplatePathStack(['script_paths' => [__DIR__]])); + } + + public function export($filename = null, $destination = self::DESTINATION_BROWSER, $memoryLimit = null) + { + //$this->addBodyHtml('<style>' . file_get_contents('/css/app.css') . '</style>'); + $this->setHeaderScript('empty.phtml'); + $this->setFooterScript('empty.phtml'); + $this->addBodyScript('fiche-metier.phtml', false, $this->vars); + return PdfExporter::export($filename, $destination, $memoryLimit); + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Export/FicheMetier/empty.phtml b/module/Application/src/Application/Service/Export/FicheMetier/empty.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/module/Application/src/Application/Service/Export/FicheMetier/fiche-metier.phtml b/module/Application/src/Application/Service/Export/FicheMetier/fiche-metier.phtml new file mode 100644 index 0000000000000000000000000000000000000000..daec238082542704ca83184385cecc8f49e68f99 --- /dev/null +++ b/module/Application/src/Application/Service/Export/FicheMetier/fiche-metier.phtml @@ -0,0 +1,93 @@ +<?php + +/** + * @var FicheMetier $fiche + */ + +use Application\Entity\Db\FicheMetier; +use Application\Entity\Db\FicheMetierTypeActivite; + +?> + +<?php + $activites = $fiche->getActivites(); + usort($activites, function (FicheMetierTypeActivite $a, FicheMetierTypeActivite $b) { return $a->getPosition() < $b->getPosition();}); +?> + +<h1> + <?php echo $fiche->getMetier()->getLibelle(); ?> +</h1> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2>Missions principales</h2> + </div> + <div class="panel-body"> + <?php echo $fiche->getMissionsPrincipales(); ?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2>Activités</h2> + </div> + <div class="panel-body"> + + <?php foreach($activites as $activite) : ?> + <?php if ($activite->getActivite()->estNonHistorise()) : ?> + <div class="activite"> + <h3> <?php echo $activite->getActivite()->getLibelle(); ?> </h3> + <?php echo $activite->getActivite()->getDescription(); ?> + </div> + <?php endif ;?> + <?php endforeach; ?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2>Parcours de formation de base pour la prise de poste</h2> + </div> + <div class="panel-body"> + <h3> Connaissances </h3> + <?php echo $fiche->getConnaissances(); ?> + <h3>Compétences opérationnelles </h3> + <?php echo $fiche->getCompetencesOperationnelles(); ?> + <h3> Compétences comportementales </h3> + <?php echo $fiche->getCompetencesComportementales(); ?> + </div> + +<?php + $applications = []; + foreach ($fiche->getActivites() as $activite) { + foreach ($activite->getActivite()->getApplications() as $application) { + $applications[] = $application->getLibelle(); + } + } + foreach ($fiche->getApplications() as $application) { + $applications[] = $application->getLibelle(); + } + sort($applications); + $applications = array_unique($applications); +?> + + <div class="row"> + <div class="col-md-6"> + <h3> Applications </h3> + <ul> + <?php foreach ($applications as $application) : ?> + <li> <?php echo $application; ?> </li> + <?php endforeach; ?> + </ul> + </div> + <div class="col-md-6"> + <h3> Plan de formation </h3> + <?php + echo $fiche->getConnaissancesFormation(); + echo $fiche->getCompetencesOperationnellesFormation(); + echo $fiche->getCompetencesComportementalesFormation(); + echo $fiche->getApplicationsFormation(); + ?> + </div> + </div> +</div> diff --git a/module/Application/src/Application/Service/Export/FichePoste/FichePostePdfExporter.php b/module/Application/src/Application/Service/Export/FichePoste/FichePostePdfExporter.php new file mode 100644 index 0000000000000000000000000000000000000000..676cbe9a6583d7a1d2c25ce226691b3d7d89523f --- /dev/null +++ b/module/Application/src/Application/Service/Export/FichePoste/FichePostePdfExporter.php @@ -0,0 +1,36 @@ +<?php + +namespace Application\Service\Export\FichePoste; + +use UnicaenApp\Exporter\Pdf as PdfExporter; +use Zend\View\Renderer\PhpRenderer; +use Zend\View\Resolver\TemplatePathStack; + +class FichePostePdfExporter extends PdfExporter +{ + private $vars; + + public function setVars(array $vars) + { + $this->vars = $vars; + $this->vars['exporter'] = $this; + + return $this; + } + + public function __construct(PhpRenderer $renderer = null, $format = 'A4', $orientationPaysage = false, $defaultFontSize = 10) + { + parent::__construct($renderer, $format, $orientationPaysage, $defaultFontSize); + $resolver = $renderer->resolver(); + $resolver->attach(new TemplatePathStack(['script_paths' => [__DIR__]])); + } + + public function export($filename = null, $destination = self::DESTINATION_BROWSER, $memoryLimit = null) + { +// $this->addBodyHtml('<style>' . file_get_contents('fiche.css') . '</style>'); + $this->setHeaderScript('empty.phtml'); + $this->setFooterScript('empty.phtml'); + $this->addBodyScript('fiche-poste.phtml', false, $this->vars); + return PdfExporter::export($filename, $destination, $memoryLimit); + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Export/FichePoste/empty.phtml b/module/Application/src/Application/Service/Export/FichePoste/empty.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/module/Application/src/Application/Service/Export/FichePoste/fiche-poste.phtml b/module/Application/src/Application/Service/Export/FichePoste/fiche-poste.phtml new file mode 100644 index 0000000000000000000000000000000000000000..c859d2419c98ac18719cb4c2c7adc823cbb0f4a2 --- /dev/null +++ b/module/Application/src/Application/Service/Export/FichePoste/fiche-poste.phtml @@ -0,0 +1,124 @@ +<?php + +/** + * @var FichePoste $fiche + */ + +use Application\Entity\Db\FichePoste; +use Application\Entity\Db\FicheTypeExterne; + +$canAssocierAgent = true; +$canAssocierMetierType = true; + +?> + +<h1> + Fiche de poste : + <?php echo $fiche->getLibelle(); ?> +</h1> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2> Agent occupant le poste </h2> + </div> + + <div class="panel-body"> + + <?php $agent = $fiche->getAgent(); ?> + + <?php if($agent === null) : ?> + <div class="alert alert-warning"> + <i class="fas fa-exclamation-triangle"></i> + Aucun agent d'associé à ce poste + </div> + <?php else : ?> + <?php echo $this->agent($agent); ?> + <?php endif; ?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2> Environnement du poste de travail </h2> + </div> + <div class="panel-body"> + <h3> Affectation du poste </h3> + <?php if ($fiche->getPoste() !== null && $fiche->getPoste()->getStructure() !== null) : ?> + <?php if ($fiche->getPoste()->getStructure()->getDescription() !== null) :?> + <?php echo $fiche->getPoste()->getStructure()->getDescription(); ?> + <?php else: ?> + <div class="alert alert-warning"> + <i class="fas fa-exclamation-triangle"></i> + Aucune description de fournie pour l'affectation <em><?php echo $fiche->getPoste()->getStructure()->getLibelleCourt(); ?></em>. + </div> + <?php endif; ?> + <?php else : ?> + <div class="alert alert-warning"> + <i class="fas fa-exclamation-triangle"></i> + Aucune affectation de renseignée. + </div> + <?php endif; ?> + + <h3> Positionnement dans l'établissement</h3> + <?php if ($fiche->getPoste() === null) : ?> + <div class="alert alert-warning"> + <i class="fas fa-exclamation-triangle"></i> + Aucun poste n'est attaché à ce poste + </div> + <?php else: ?> + <?php echo $this->poste($fiche->getPoste()); ?> + <?php endif; ?> + </div> +</div> + +<!-- FICHES TYPES -----------------------------------------------------------------------------------------------------> + +<?php +$principal = $fiche->getFicheTypeExternePrincipale(); + +$fichesMetiers = $fiche->getFichesMetiers(); +$fichesMetiers = array_filter($fichesMetiers, function (FicheTypeExterne $a) { return !$a->getPrincipale(); }); +usort($fichesMetiers, function (FicheTypeExterne $a, FicheTypeExterne $b) { return ($a->getQuotite() > $b->getQuotite()); }); +?> + + +<?php /** @var FicheTypeExterne $ficheType **/ ?> +<div class="panel panel-default"> + <div class="panel-heading"> + <div class="row"> + <h2>Fiche composée de <?php echo count($fiche->getFichesMetiers()); ?> fiche(s) type(s).</h2> + <ul> + <?php if ($principal) : ?> + <li> <strong> <?php echo $principal->getFicheType()->getMetier() ?> à <?php echo $principal->getQuotite(); ?>%</strong></li> + <?php endif; ?> + + <?php foreach ($fichesMetiers as $ficheType) : ?> + <li> <?php echo $ficheType->getFicheType()->getMetier(); ?> à <?php echo $ficheType->getQuotite(); ?>% </li> + <?php endforeach; ?> + </ul> + </div> + </div> +</div> + +<?php if ($principal) echo $this->ficheMetierExterne($principal, false); ?> +<?php foreach ($fichesMetiers as $ficheType) : ?> + <?php echo $this->ficheMetierExterne($ficheType, false); ?> +<?php endforeach; ?> + + +<!-- SPECIFICITE DU POSTE ---------------------------------------------------------------------------------------------> +<div class="panel panel-info"> + <div class="panel-heading"> + <h2> Spécificité du poste </h2> + </div> + <div class="panel-body"> + <?php if ($fiche->getSpecificite() === null) : ?> + <div class="alert alert-warning"> + <i class="fas fa-exclamation-triangle"></i> + Aucune spécificité attachée à ce poste. + </div> + <?php else: ?> + <?php echo $this->specificitePoste($fiche->getSpecificite()); ?> + <?php endif; ?> + </div> +</div> \ No newline at end of file diff --git a/module/Application/src/Application/Service/Export/FichePoste/fiche.css b/module/Application/src/Application/Service/Export/FichePoste/fiche.css new file mode 100644 index 0000000000000000000000000000000000000000..4717ad4b94f6dfedd27029b8432f7e5a458597a8 --- /dev/null +++ b/module/Application/src/Application/Service/Export/FichePoste/fiche.css @@ -0,0 +1,3 @@ +h1 { + color: red; +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleService.php b/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleService.php new file mode 100644 index 0000000000000000000000000000000000000000..00ec2906bb72c5219ca0360313b2b700e9d14ed9 --- /dev/null +++ b/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleService.php @@ -0,0 +1,116 @@ +<?php + +namespace Application\Service\FamilleProfessionnelle; + +use Application\Entity\Db\FamilleProfessionnelle; +use Doctrine\ORM\NonUniqueResultException; +use Doctrine\ORM\OptimisticLockException; +use UnicaenApp\Exception\RuntimeException; +use UnicaenApp\Service\EntityManagerAwareTrait; +use Zend\Mvc\Controller\AbstractActionController; + +class FamilleProfessionnelleService { + use EntityManagerAwareTrait; + + /** + * @param string $order + * @return FamilleProfessionnelle[] + */ + public function getFamillesProfessionnelles() + { + $qb = $this->getEntityManager()->getRepository(FamilleProfessionnelle::class)->createQueryBuilder('famille') + ->addSelect('domaine')->leftJoin('famille.domaines', 'domaine') + ->addSelect('metier')->leftJoin('domaine.metiers', 'metier') + ; + $qb = $qb->addOrderBy('famille.libelle'); + + $result = $qb->getQuery()->getResult(); + return $result; + } + + public function getFamillesProfessionnellesAsOptions() + { + $familles = $this->getFamillesProfessionnelles(); + $options = []; + foreach ($familles as $famille) { + $options[$famille->getId()] = $famille->getLibelle(); + } + return $options; + } + + /** + * @param integer $id + * @return FamilleProfessionnelle + */ + public function getFamilleProfessionnelle($id) + { + $qb = $this->getEntityManager()->getRepository(FamilleProfessionnelle::class)->createQueryBuilder('famille') + ->addSelect('domaine')->leftJoin('famille.domaines', 'domaine') + ->addSelect('metier')->leftJoin('domaine.metiers', 'metier') + ->andWhere('famille.id = :id') + ->setParameter('id', $id) + ; + + try { + $result = $qb->getQuery()->getOneOrNullResult(); + } catch (NonUniqueResultException $e) { + throw new RuntimeException("Plusieurs FamilleProfessionnelle partagent le même identifiant [".$id."]"); + } + return $result; + } + + /** + * @param AbstractActionController $controller + * @param string $paramName + * @return FamilleProfessionnelle + */ + public function getRequestedFamilleProfessionnelle($controller, $paramName) + { + $id = $controller->params()->fromRoute($paramName); + $famille = $this->getFamilleProfessionnelle($id); + + return $famille; + } + + /** + * @param FamilleProfessionnelle $famille + * @return FamilleProfessionnelle + */ + public function create($famille) + { + $this->getEntityManager()->persist($famille); + try { + $this->getEntityManager()->flush($famille); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la création d'une FamilleProfessionnelle", $e); + } + return $famille; + } + + /** + * @param FamilleProfessionnelle $famille + * @return FamilleProfessionnelle + */ + public function update($famille) + { + try { + $this->getEntityManager()->flush($famille); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'une FamilleProfessionnelle.", $e); + } + return $famille; + } + + /** + * @param FamilleProfessionnelle $famille + */ + public function delete($famille) + { + $this->getEntityManager()->remove($famille); + try { + $this->getEntityManager()->flush(); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la suppression d'une FamilleProfessionnelle", $e); + } + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleServiceAwareTrait.php b/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleServiceAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..4fc5b959f7f53071cbddeb12df947207c7c0b8c3 --- /dev/null +++ b/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleServiceAwareTrait.php @@ -0,0 +1,28 @@ +<?php + +namespace Application\Service\FamilleProfessionnelle; + +trait FamilleProfessionnelleServiceAwareTrait +{ + + /** @var FamilleProfessionnelleService $familleProfessionnelleService */ + private $familleProfessionnelleService; + + /** + * @return FamilleProfessionnelleService + */ + public function getFamilleProfessionnelleService() + { + return $this->familleProfessionnelleService; + } + + /** + * @param FamilleProfessionnelleService $familleProfessionnelleService + * @return FamilleProfessionnelleService + */ + public function setFamilleProfessionnelleService($familleProfessionnelleService) + { + $this->familleProfessionnelleService = $familleProfessionnelleService; + return $this->familleProfessionnelleService; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleServiceFactory.php b/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleServiceFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..be510fd5ecefa2a3437a79c31562026872e530af --- /dev/null +++ b/module/Application/src/Application/Service/FamilleProfessionnelle/FamilleProfessionnelleServiceFactory.php @@ -0,0 +1,20 @@ +<?php + +namespace Application\Service\FamilleProfessionnelle; + +use Doctrine\ORM\EntityManager; +use Zend\ServiceManager\ServiceLocatorInterface; + +class FamilleProfessionnelleServiceFactory { + + public function __invoke(ServiceLocatorInterface $serviceLocator) + { + /** @var EntityManager $entityManager */ + $entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default'); + + /** @var FamilleProfessionnelleService $service */ + $service = new FamilleProfessionnelleService(); + $service->setEntityManager($entityManager); + return $service; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/FicheMetier/FicheMetierService.php b/module/Application/src/Application/Service/FicheMetier/FicheMetierService.php index 1b3cc0eb6f3919ca990f14d299ee0e060e542a15..dc72b4bed6f06053b78545b1dc41758bd2a6dc3a 100644 --- a/module/Application/src/Application/Service/FicheMetier/FicheMetierService.php +++ b/module/Application/src/Application/Service/FicheMetier/FicheMetierService.php @@ -2,17 +2,14 @@ namespace Application\Service\FicheMetier; -use Application\Entity\Db\FichePoste; -use Application\Entity\Db\FicheMetierType; -use Application\Entity\Db\FicheTypeExterne; -use Application\Entity\Db\SpecificitePoste; -use Exception; -use Utilisateur\Service\User\UserServiceAwareTrait; +use Application\Entity\Db\FicheMetier; use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\OptimisticLockException; +use Exception; use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Service\EntityManagerAwareTrait; +use Utilisateur\Service\User\UserServiceAwareTrait; use Zend\Mvc\Controller\AbstractController; class FicheMetierService { @@ -21,11 +18,11 @@ class FicheMetierService { /** * @param string $order an attribute use to sort - * @return FichePoste[] + * @return FicheMetier[] */ public function getFichesMetiers($order = 'id') { - $qb = $this->getEntityManager()->getRepository(FichePoste::class)->createQueryBuilder('ficheMetier') + $qb = $this->getEntityManager()->getRepository(FicheMetier::class)->createQueryBuilder('ficheMetier') ->orderBy('ficheMetier.', $order) ; @@ -35,11 +32,11 @@ class FicheMetierService { /** * @param int $id - * @return FichePoste + * @return FicheMetier */ public function getFicheMetier($id) { - $qb = $this->getEntityManager()->getRepository(FichePoste::class)->createQueryBuilder('ficheMetier') + $qb = $this->getEntityManager()->getRepository(FicheMetier::class)->createQueryBuilder('ficheMetier') ->andWhere('ficheMetier.id = :id') ->setParameter('id', $id) ; @@ -52,179 +49,79 @@ class FicheMetierService { return $result; } - - /** - * @param FichePoste $fiche - * @return FichePoste - */ - public function historiser($fiche) { - //TODO récupérer l'utilisateur connecté - $utilisateur = null; - $fiche->historiser($utilisateur); - try { - $this->getEntityManager()->flush($fiche); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Une erreur s'est produite lors de l'historsation de la fiche métier [".$fiche->getId()."]."); - } - return $fiche; - } - - /** - * @param FichePoste $fiche - * @return FichePoste - */ - public function restaurer($fiche) { - $fiche->dehistoriser(); - try { - $this->getEntityManager()->flush($fiche); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Une erreur s'est produite lors de la restauration de la fiche métier [".$fiche->getId()."]."); - } - return $fiche; - } - - /** - * @param FichePoste $fiche - * @return FichePoste - */ - public function creer($fiche) - { - $connectedUtilisateur = $this->getUserService()->getConnectedUser(); - - $fiche->setHistoCreation(new DateTime()); - $fiche->setHistoCreateur($connectedUtilisateur); - $fiche->setHistoModification(new DateTime()); - $fiche->setHistoModificateur($connectedUtilisateur); - $this->getEntityManager()->persist($fiche); - try { - $this->getEntityManager()->flush($fiche); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Une erreur s'est produite lors de la création de la fiche."); - } - - return $fiche; - } - - /** - * @param FichePoste $fiche - * @return FichePoste - */ - public function update($fiche) - { - $connectedUtilisateur = $this->getUserService()->getConnectedUser(); - - $fiche->setHistoModification(new DateTime()); - $fiche->setHistoModificateur($connectedUtilisateur); - try { - $this->getEntityManager()->flush($fiche); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Une erreur s'est produite lors de la mise à jour de la fiche."); - } - - return $fiche; - } - - /** - * @return FicheMetierType[] - */ - public function getFichesMetiersTypes() - { - $qb = $this->getEntityManager()->getRepository(FicheMetierType::class)->createQueryBuilder('fiche') - ; - - $result = $qb->getQuery()->getResult(); - return $result; - } - - /** - * @param int $id - * @return FicheMetierType - */ - public function getFicheMetierType($id) - { - $qb = $this->getEntityManager()->getRepository(FicheMetierType::class)->createQueryBuilder('fiche') - ->andWhere('fiche.id = :id') - ->setParameter('id', $id) - ; - - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs fiche métier type partagent sur le même identifiant [".$id."]."); - } - return $result; - } - /** * @param AbstractController $controller * @param string $name * @param bool $notNull - * @return FicheMetierType + * @return FicheMetier */ - public function getRequestedFicheMetierType($controller, $name, $notNull = false) + public function getRequestedFicheMetier($controller, $name, $notNull = false) { $ficheId = $controller->params()->fromRoute($name); - $fiche = $this->getFicheMetierType($ficheId); + $fiche = $this->getFicheMetier($ficheId); if($notNull && !$fiche) throw new RuntimeException("Aucune fiche de trouvée avec l'identifiant [".$ficheId."]"); return $fiche; } /** - * @param FicheMetierType $ficheMetierType - * @return FicheMetierType + * @param FicheMetier $fiche + * @return FicheMetier */ - public function createFicheMetierType($ficheMetierType) + public function create($fiche) { try { + $connectedUtilisateur = $this->getUserService()->getConnectedUser(); $date = new DateTime(); - $user = $this->getUserService()->getConnectedUser(); } catch (Exception $e) { - throw new RuntimeException("Un problème s'est produit lors de la récupération des informations d'historisation", $e); + throw new RuntimeException("Problème de récupération des infos concernant l'utilisateur ou la date", $e); } - $ficheMetierType->setHistoCreation($date); - $ficheMetierType->setHistoCreateur($user); - $ficheMetierType->setHistoModification($date); - $ficheMetierType->setHistoModificateur($user); - $this->getEntityManager()->persist($ficheMetierType); + $fiche->setHistoCreation($date); + $fiche->setHistoCreateur($connectedUtilisateur); + $fiche->setHistoModification($date); + $fiche->setHistoModificateur($connectedUtilisateur); + + $this->getEntityManager()->persist($fiche); try { - $this->getEntityManager()->flush($ficheMetierType); + $this->getEntityManager()->flush($fiche); } catch (OptimisticLockException $e) { - throw new RuntimeException("Une erreur s'est produite lors de la mise à jour de la fiche métier.", $e); + throw new RuntimeException("Une erreur s'est produite lors de la création de la fiche."); } - return $ficheMetierType; + return $fiche; } /** - * @param FicheMetierType $ficheMetierType - * @return FicheMetierType + * @param FicheMetier $fiche + * @return FicheMetier */ - public function updateFicheMetierType($ficheMetierType) + public function update($fiche) { try { + $connectedUtilisateur = $this->getUserService()->getConnectedUser(); $date = new DateTime(); - $user = $this->getUserService()->getConnectedUser(); } catch (Exception $e) { - throw new RuntimeException("Un problème s'est produit lors de la récupération des informations d'historisation", $e); + throw new RuntimeException("Problème de récupération des infos concernant l'utilisateur ou la date", $e); } - $ficheMetierType->setHistoModification($date); - $ficheMetierType->setHistoModificateur($user); + + $fiche->setHistoModification($date); + $fiche->setHistoModificateur($connectedUtilisateur); try { - $this->getEntityManager()->flush($ficheMetierType); + $this->getEntityManager()->flush($fiche); } catch (OptimisticLockException $e) { - throw new RuntimeException("Une erreur s'est produite lors de la mise à jour de la fiche métier.", $e); + throw new RuntimeException("Une erreur s'est produite lors de la mise à jour de la fiche."); } - return $ficheMetierType; + + return $fiche; } /** - * @param FicheMetierType $ficheMetierType - * @return FicheMetierType + * @param FicheMetier $ficheMetier + * @return FicheMetier */ - public function historiserFicheMetierType($ficheMetierType) + public function historise($ficheMetier) { try { $date = new DateTime(); @@ -232,47 +129,56 @@ class FicheMetierService { } catch (Exception $e) { throw new RuntimeException("Un problème s'est produit lors de la récupération des informations d'historisation", $e); } - $ficheMetierType->setHistoDestruction($date); - $ficheMetierType->setHistoDestructeur($user); + $ficheMetier->setHistoDestruction($date); + $ficheMetier->setHistoDestructeur($user); try { - $this->getEntityManager()->flush($ficheMetierType); + $this->getEntityManager()->flush($ficheMetier); } catch (OptimisticLockException $e) { throw new RuntimeException("Une erreur s'est produite lors de l'historisation de la fiche métier.", $e); } - return $ficheMetierType; + return $ficheMetier; } /** - * @param FicheMetierType $ficheMetierType - * @return FicheMetierType + * @param FicheMetier $ficheMetier + * @return FicheMetier */ - public function restaurationFicheMetierType($ficheMetierType) + public function restore($ficheMetier) { - $ficheMetierType->setHistoDestruction(null); - $ficheMetierType->setHistoDestructeur(null); + $ficheMetier->setHistoDestruction(null); + $ficheMetier->setHistoDestructeur(null); try { - $this->getEntityManager()->flush($ficheMetierType); + $this->getEntityManager()->flush($ficheMetier); } catch (OptimisticLockException $e) { throw new RuntimeException("Une erreur s'est produite lors de la restauration de la fiche métier.", $e); } - return $ficheMetierType; + return $ficheMetier; } /** - * @param FicheMetierType $ficheMetierType - * @return FicheMetierType + * @param FicheMetier $ficheMetier + * @return FicheMetier */ - public function deleteFicheMetierType($ficheMetierType) + public function delete($ficheMetier) { - $this->getEntityManager()->remove($ficheMetierType); + $this->getEntityManager()->remove($ficheMetier); try { $this->getEntityManager()->flush(); } catch (OptimisticLockException $e) { throw new RuntimeException("Une erreur s'est produite lors de l'effacement de la fiche métier.", $e); } - return $ficheMetierType; + return $ficheMetier; + } + + /** + * @return FicheMetier + */ + public function getLastFicheMetier() + { + $fiches = $this->getFichesMetiers('id'); + return end($fiches); } } \ No newline at end of file diff --git a/module/Application/src/Application/Service/FichePoste/FichePosteService.php b/module/Application/src/Application/Service/FichePoste/FichePosteService.php index c31b855f7cc1c14c3c75db77c8f81db801595617..1ec4372865400076cbf41d7202e82bd27efbb9b3 100644 --- a/module/Application/src/Application/Service/FichePoste/FichePosteService.php +++ b/module/Application/src/Application/Service/FichePoste/FichePosteService.php @@ -157,12 +157,14 @@ class FichePosteService { /** * @param AbstractActionController $controller * @param string $paramName + * @param bool $notNull * @return FichePoste */ - public function getRequestedFichePoste($controller, $paramName) + public function getRequestedFichePoste($controller, $paramName, $notNull = false) { $id = $controller->params()->fromRoute($paramName); $fiche = $this->getFichePoste($id); + if($notNull && !$fiche) throw new RuntimeException("Aucune fiche de trouvée avec l'identifiant [".$id."]"); return $fiche; } @@ -305,4 +307,13 @@ class FichePosteService { } return $result; } + + /** + * @return FichePoste + */ + public function getLastFichePoste() + { + $fiches = $this->getFichesPostes(); + return end($fiches); + } } \ No newline at end of file diff --git a/module/Application/src/Application/Service/Fonction/FonctionService.php b/module/Application/src/Application/Service/Fonction/FonctionService.php index 65508a2e77ce554c06ef88ec6153321379478208..488d1b0a06c3419eca28051001e134b7645a4405 100644 --- a/module/Application/src/Application/Service/Fonction/FonctionService.php +++ b/module/Application/src/Application/Service/Fonction/FonctionService.php @@ -3,285 +3,62 @@ namespace Application\Service\Fonction; use Application\Entity\Db\Fonction; -use Application\Entity\Db\FonctionLibelle; -use Application\Entity\Db\Source; -use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\OptimisticLockException; -use Exception; -use Octopus\Entity\Db\FonctionType; use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Service\EntityManagerAwareTrait; -use Utilisateur\Service\User\UserServiceAwareTrait; use Zend\Mvc\Controller\AbstractActionController; class FonctionService { use EntityManagerAwareTrait; - use \Octopus\Service\Fonction\FonctionServiceAwareTrait; - use UserServiceAwareTrait; - /** @var \Octopus\Service\Fonction\FonctionService */ - public $octopusFonctionService; + /** Site **********************************************************************************************************/ /** - * @var Fonction $fonction - * @return Fonction - */ - public function create($fonction) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $fonction->setHistoCreation($date); - $fonction->setHistoCreateur($user); - $fonction->setHistoModification($date); - $fonction->setHistoModificateur($user); - - try { - $this->getEntityManager()->persist($fonction); - $this->getEntityManager()->flush($fonction); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Fonction", $e); - } - return $fonction; - } - - /** - * @var Fonction $fonction - * @return Fonction - */ - public function update($fonction) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $fonction->setHistoModification($date); - $fonction->setHistoModificateur($user); - - try { - $this->getEntityManager()->flush($fonction); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Fonction", $e); - } - return $fonction; - } - - /** - * @var Fonction $fonction - * @return Fonction - */ - public function historise($fonction) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $fonction->setHistoDestruction($date); - $fonction->setHistoDestructeur($user); - - try { - $this->getEntityManager()->flush($fonction); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Fonction", $e); - } - return $fonction; - } - - /** - * @var Fonction $fonction - * @return Fonction - */ - public function restore($fonction) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $fonction->setHistoModification($date); - $fonction->setHistoModificateur($user); - $fonction->setHistoDestruction(null); - $fonction->setHistoDestructeur(null); - - try { - $this->getEntityManager()->flush($fonction); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Fonction", $e); - } - return $fonction; - } - - /** - * @var Fonction $fonction - * @return Fonction - */ - public function delete($fonction) - { - try { - $this->getEntityManager()->remove($fonction); - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'effacement d'une Fonction", $e); - } - return $fonction; - } - - /** ********************/ - - /** - * @var FonctionLibelle $libelle - * @return FonctionLibelle - */ - public function createLibelle($libelle) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $libelle->setHistoCreation($date); - $libelle->setHistoCreateur($user); - $libelle->setHistoModification($date); - $libelle->setHistoModificateur($user); - - try { - $this->getEntityManager()->persist($libelle); - $this->getEntityManager()->flush($libelle); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une FonctionLibelle", $e); - } - return $libelle; - } - - /** - * @var FonctionLibelle $libelle - * @return FonctionLibelle - */ - public function updateLibelle($libelle) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $libelle->setHistoModification($date); - $libelle->setHistoModificateur($user); - - try { - $this->getEntityManager()->flush($libelle); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une FonctionLibelle", $e); - } - return $libelle; - } - - /** - * @var FonctionLibelle $libelle - * @return FonctionLibelle - */ - public function historiseLibelle($libelle) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $libelle->setHistoDestruction($date); - $libelle->setHistoDestructeur($user); - - try { - $this->getEntityManager()->flush($libelle); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une FonctionLibelle", $e); - } - return $libelle; - } - - /** - * @var FonctionLibelle $libelle - * @return FonctionLibelle + * @return Fonction[] */ - public function restoreLibelle($libelle) + public function getFonctions() { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $libelle->setHistoModification($date); - $libelle->setHistoModificateur($user); - $libelle->setHistoDestruction(null); - $libelle->setHistoDestructeur(null); + $qb = $this->getEntityManager()->getRepository(Fonction::class)->createQueryBuilder('fonction') + ->addSelect('libelle')->leftJoin('fonction.libelles','libelle') + ->orderBy('fonction.parent, fonction.id') + ; - try { - $this->getEntityManager()->flush($libelle); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une FonctionLibelle", $e); - } - return $libelle; + $result = $qb->getQuery()->getResult(); + return $result; } /** - * @var FonctionLibelle $libelle - * @return FonctionLibelle + * @return array */ - public function deleteLibelle($libelle) + public function getFonctionsAsOptions() { - try { - $this->getEntityManager()->remove($libelle); - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'effacement d'une FonctionLibelle", $e); + $fonctions = $this->getFonctions(); + $options = []; + foreach ($fonctions as $fonction) { + $array = []; + foreach ($fonction->getLibelles() as $libelle) $array[] = $libelle->getLibelle(); + $options[$fonction->getId()] = implode("/", $array); } - return $libelle; - } - - /** ********************/ - /** - * @return Fonction[] - */ - public function getFonctions() - { - $qb = $this->getEntityManager()->getRepository(Fonction::class)->createQueryBuilder('fonction') - ->orderBy('fonction.id'); - $result = $qb->getQuery()->getResult(); - return $result; + return $options; } /** - * @param integer $id + * @param string $id * @return Fonction */ public function getFonction($id) { $qb = $this->getEntityManager()->getRepository(Fonction::class)->createQueryBuilder('fonction') + ->addSelect('libelle')->leftJoin('fonction.libelles','libelle') ->andWhere('fonction.id = :id') - ->setParameter('id', $id); + ->setParameter('id', $id) + ; + try { $result = $qb->getQuery()->getOneOrNullResult(); } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs Fonction partagent le même identifiant [".$id."]", $e); + throw new RuntimeException('Plusieurs Fonction partagent le même id ['.$id.']', $e); } return $result; } @@ -291,124 +68,25 @@ class FonctionService { * @param string $paramName * @return Fonction */ - public function getRequestedFontion($controller, $paramName) + public function getRequestedFonction($controller, $paramName) { $id = $controller->params()->fromRoute($paramName); - $fonction = $this->getFonction($id); - return $fonction; - } - - - public function synchroniseFromOctopus() - { - $fonctionType = $this->getFonctionService()->getFonctionTypeByNom(FonctionType::FONCTION_STRUCTURELLE); - $fonctions_OCTOPUS = $this->getFonctionService()->getFonctionsByType($fonctionType); - $fonctions_PREECOG = $this->getFonctions(); - - - $nouvelles = []; - $modifiees = []; - $supprimees = []; - foreach ($fonctions_OCTOPUS as $fonction) { - $res = array_filter($fonctions_PREECOG, - function(Fonction $s) use ($fonction) { return ($s->getSource() === 'OCTOPUS' && $s->getIdSource() == $fonction->getId()); }); - if (! empty($res)) { - $modification = $this->updateFromOctopus(current($res), $fonction); - if ($modification) $modifiees[] = current($res); - } else { - //nouvelle structure - $nouvelle = $this->createFromOctopus($fonction); - $nouvelles[] = $nouvelle; - } - } - foreach ($fonctions_PREECOG as $fonction) { - if ($fonction->getSource() === Source::Octopus) { - $res = array_filter($fonctions_OCTOPUS, - function (\Octopus\Entity\Db\Fonction $s) use ($fonction) { - return ($fonction->getSource() === 'OCTOPUS' && $s->getId() == $fonction->getIdSource()); - }); - if (empty($res)) { - $this->delete($fonction); - $supprimees[] = $fonction; - } - } - } - return [ - 'nouvelles' => $nouvelles, - 'modifiees' => $modifiees, - 'supprimees' => $supprimees, - ]; + $site = $this->getFonction($id); + return $site; } /** - * @var \Octopus\Entity\Db\Fonction $fonction_OCTOPUS - * @return Fonction + * @param Fonction $fonction + * @return $fonction */ - private function createFromOctopus($fonction_OCTOPUS) + public function update($fonction) { - $fonction = new Fonction(); - $fonction->setSource('OCTOPUS'); - $fonction->setIdSource($fonction_OCTOPUS->getId()); - $fonction = $this->create($fonction); - - /** recopie des libelles */ - foreach ($fonction_OCTOPUS->getLibelles() as $libelle_OCTOPUS) { - $libelle = new FonctionLibelle(); - $libelle->setFonction($fonction); - $libelle->setLibelle($libelle_OCTOPUS->getLibelle()); - $libelle->setGenre($libelle_OCTOPUS->getGenre()); - $libelle->setDefault(($libelle_OCTOPUS->getDefault())?'O':'N'); - $libelle->setSource('OCTOPUS'); - $libelle->setIdSource($libelle_OCTOPUS->getId()); - $this->createLibelle($libelle); - - $fonction->addLibelle($libelle); - $this->update($fonction); + try { + $this->getEntityManager()->flush($fonction); + } catch (OptimisticLockException $e) { + throw new RuntimeException('Un problème est surevenue lors de l\'enregistrement en base.', $e); } - return $fonction; - } - - /** - * @var Fonction $current - * @var \Octopus\Entity\Db\Fonction $fonction - * @return Fonction - */ - private function updateFromOctopus($current, \Octopus\Entity\Db\Fonction $fonction) - { - $libelles = $current->getLibelles(); - foreach ($libelles as $libelle) { - $current->removeLibelle($libelle); - $this->deleteLibelle($libelle); - } - - foreach ($fonction->getLibelles() as $libelle_OCTOPUS) { - $libelle = new FonctionLibelle(); - $libelle->setFonction($current); - $libelle->setLibelle($libelle_OCTOPUS->getLibelle()); - $libelle->setGenre($libelle_OCTOPUS->getGenre()); - $libelle->setDefault(($libelle_OCTOPUS->getDefault()) ? 'O' : 'N'); - $libelle->setSource('OCTOPUS'); - $libelle->setIdSource($libelle_OCTOPUS->getId()); - $this->createLibelle($libelle); - $current->addLibelle($libelle); - } - $this->update($current); - return $current; } - - public function getFonctionsAsOption() - { - $options = []; - $options[null] = "Selectionner une fonction ..."; - - foreach ($this->getFonctions() as $fonction) { - $options[$fonction->getId()] = $fonction->__toString(); - } - - return $options; - } - - } diff --git a/module/Application/src/Application/Service/Fonction/FonctionServiceFactory.php b/module/Application/src/Application/Service/Fonction/FonctionServiceFactory.php index f36ce3908531c46c8c25539f235cb07edc0b4713..6bfa6448945a44a5e2f075e18c5e2c63c579390c 100644 --- a/module/Application/src/Application/Service/Fonction/FonctionServiceFactory.php +++ b/module/Application/src/Application/Service/Fonction/FonctionServiceFactory.php @@ -3,7 +3,6 @@ namespace Application\Service\Fonction; use Doctrine\ORM\EntityManager; -use Utilisateur\Service\User\UserService; use Zend\ServiceManager\ServiceLocatorInterface; class FonctionServiceFactory { @@ -12,18 +11,12 @@ class FonctionServiceFactory { { /** * @var EntityManager $entityManager - * @var UserService $userService - * @var \Octopus\Service\Fonction\FonctionService $fonctionService */ $entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default'); - $userService = $serviceLocator->get(UserService::class); - $fonctionService = $serviceLocator->get(\Octopus\Service\Fonction\FonctionService::class); /** @var FonctionService $service */ $service = new FonctionService(); $service->setEntityManager($entityManager); - $service->setUserService($userService); - $service->setFonctionService($fonctionService); return $service; } diff --git a/module/Application/src/Application/Service/Immobilier/ImmobilierService.php b/module/Application/src/Application/Service/Immobilier/ImmobilierService.php new file mode 100644 index 0000000000000000000000000000000000000000..38662584e3bad5f12c02ac5a6c2d673feabd45d5 --- /dev/null +++ b/module/Application/src/Application/Service/Immobilier/ImmobilierService.php @@ -0,0 +1,136 @@ +<?php + +namespace Application\Service\Immobilier; + +use Application\Entity\Db\Batiment; +use Application\Entity\Db\Site; +use Doctrine\ORM\NonUniqueResultException; +use UnicaenApp\Exception\RuntimeException; +use UnicaenApp\Service\EntityManagerAwareTrait; +use Zend\Mvc\Controller\AbstractActionController; + +class ImmobilierService { + use EntityManagerAwareTrait; + + /** Site **********************************************************************************************************/ + + /** + * @return Site[] + */ + public function getSites() + { + $qb = $this->getEntityManager()->getRepository(Site::class)->createQueryBuilder('site') + ->addSelect('batiment')->leftJoin('site.batiments','batiment') + ->orderBy('site.libelle') + ; + + $result = $qb->getQuery()->getResult(); + return $result; + } + + /** + * @return array + */ + public function getSitesAsOptions() + { + $sites = $this->getSites(); + $options = []; + foreach ($sites as $site) { + $options[$site->getId()] = $site->getLibelle(); + } + return $options; + } + + /** + * @param string $id + * @return Site + */ + public function getSite($id) + { + $qb = $this->getEntityManager()->getRepository(Site::class)->createQueryBuilder('site') + ->addSelect('batiment')->leftJoin('site.batiments','batiment') + ->andWhere('site.id = :id') + ->setParameter('id', $id) + ; + + try { + $result = $qb->getQuery()->getOneOrNullResult(); + } catch (NonUniqueResultException $e) { + throw new RuntimeException('Plusieurs Site partagent le même id ['.$id.']', $e); + } + return $result; + } + + /** + * @param AbstractActionController $controller + * @param string $paramName + * @return Site + */ + public function getRequestedSite($controller, $paramName) + { + $id = $controller->params()->fromRoute($paramName); + $site = $this->getSite($id); + return $site; + } + + /** Batiment ******************************************************************************************************/ + + /** + * @return Batiment[] + */ + public function getBatiments() + { + $qb = $this->getEntityManager()->getRepository(Batiment::class)->createQueryBuilder('batiment') + ->addSelect('site')->leftJoin('batiment.site','site') + ->orderBy('batiment.libelle') + ; + + $result = $qb->getQuery()->getResult(); + return $result; + } + + /** + * @return array + */ + public function getBatimentsAsOptions() + { + $batiments = $this->getBatiments(); + $options = []; + foreach ($batiments as $batiment) { + $options[$batiment->getId()] = $batiment->getLibelle() . /*'<span class="badge">'*/ ' - '.$batiment->getSite()->getLibelle()/*.'</span>'*/; + } + return $options; + } + + /** + * @param string $id + * @return Batiment + */ + public function getBatiment($id) + { + $qb = $this->getEntityManager()->getRepository(Batiment::class)->createQueryBuilder('batiment') + ->addSelect('site')->leftJoin('batiment.site','site') + ->andWhere('batiment.id = :id') + ->setParameter('id', $id) + ; + + try { + $result = $qb->getQuery()->getOneOrNullResult(); + } catch (NonUniqueResultException $e) { + throw new RuntimeException('Plusieurs Batiment partagent le même id ['.$id.']', $e); + } + return $result; + } + + /** + * @param AbstractActionController $controller + * @param string $paramName + * @return Batiment + */ + public function getRequestedBatiment($controller, $paramName) + { + $id = $controller->params()->fromRoute($paramName); + $batiment = $this->getBatiment($id); + return $batiment; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Immobilier/ImmobilierServiceAwareTrait.php b/module/Application/src/Application/Service/Immobilier/ImmobilierServiceAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..b5cdc2a6379c1723c93d1ed40eb7665ac43f84a5 --- /dev/null +++ b/module/Application/src/Application/Service/Immobilier/ImmobilierServiceAwareTrait.php @@ -0,0 +1,29 @@ +<?php + +namespace Application\Service\Immobilier; + +trait ImmobilierServiceAwareTrait { + + /** @var ImmobilierService */ + private $immobilierService; + + /** + * @return ImmobilierService + */ + public function getImmobilierService() + { + return $this->immobilierService; + } + + /** + * @param ImmobilierService $immobilierService + * @return ImmobilierService + */ + public function setImmobilierService($immobilierService) + { + $this->immobilierService = $immobilierService; + return $this->immobilierService; + } + + +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Immobilier/ImmobilierServiceFactory.php b/module/Application/src/Application/Service/Immobilier/ImmobilierServiceFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..fdcfd170f41d2bd5e667eeb118b47dc902ad03a6 --- /dev/null +++ b/module/Application/src/Application/Service/Immobilier/ImmobilierServiceFactory.php @@ -0,0 +1,22 @@ +<?php + +namespace Application\Service\Immobilier; + +use Doctrine\ORM\EntityManager; +use Zend\ServiceManager\ServiceLocatorInterface; + +class ImmobilierServiceFactory { + + public function __invoke(ServiceLocatorInterface $serviceLocator) + { + /** + * @var EntityManager $entityManager + */ + $entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default'); + + /** @var ImmobilierService $service */ + $service = new ImmobilierService(); + $service->setEntityManager($entityManager); + return $service; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Metier/MetierService.php b/module/Application/src/Application/Service/Metier/MetierService.php new file mode 100644 index 0000000000000000000000000000000000000000..4f07d86552e8a304ba4bd025b786009a98e4c248 --- /dev/null +++ b/module/Application/src/Application/Service/Metier/MetierService.php @@ -0,0 +1,121 @@ +<?php + +namespace Application\Service\Metier; + +use Application\Entity\Db\Metier; +use Doctrine\ORM\NonUniqueResultException; +use Doctrine\ORM\OptimisticLockException; +use UnicaenApp\Exception\RuntimeException; +use UnicaenApp\Service\EntityManagerAwareTrait; +use Zend\Mvc\Controller\AbstractActionController; + +class MetierService { + use EntityManagerAwareTrait; + + /** + * @return Metier[] + */ + public function getMetiers() + { + $qb = $this->getEntityManager()->getRepository(Metier::class)->createQueryBuilder('metier') + ->addSelect('domaine')->leftJoin('metier.domaine','domaine') + ->addSelect('famille')->leftJoin('domaine.famille','famille') + ; + $qb = $qb->addOrderBy('metier.libelle'); + + $result = $qb->getQuery()->getResult(); + return $result; + } + + /** + * @return array + */ + public function getMetiersAsOptions() + { + $metiers = $this->getMetiers(); + + $array = []; + foreach ($metiers as $metier) { + $array[$metier->getId()] = $metier->getLibelle(); + } + return $array; + } + + /** + * @param integer $id + * @return Metier + */ + public function getMetier($id) + { + $qb = $this->getEntityManager()->getRepository(Metier::class)->createQueryBuilder('metier') + ->addSelect('domaine')->leftJoin('metier.domaine','domaine') + ->addSelect('famille')->leftJoin('domaine.famille','famille') + ->andWhere('metier.id = :id') + ->setParameter('id', $id) + ; + + try { + $result = $qb->getQuery()->getOneOrNullResult(); + } catch (NonUniqueResultException $e) { + throw new RuntimeException("Plusieurs Metier partagent le même identifiant [".$id."]"); + } + return $result; + } + + /** + * @param AbstractActionController $controller + * @param string $paramName + * @return Metier + */ + public function getRequestedMetier($controller, $paramName) + { + $id = $controller->params()->fromRoute($paramName); + $metier = $this->getMetier($id); + + return $metier; + } + + /** + * @param Metier $metier + * @return Metier + */ + public function create($metier) + { + $this->getEntityManager()->persist($metier); + try { + $this->getEntityManager()->flush($metier); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la création d'un Metier", $e); + } + return $metier; + } + + /** + * @param Metier $metier + * @return Metier + */ + public function update($metier) + { + try { + $this->getEntityManager()->flush($metier); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'un Metier.", $e); + } + return $metier; + } + + /** + * @param Metier $metier + * @return Metier + */ + public function delete($metier) + { + $this->getEntityManager()->remove($metier); + try { + $this->getEntityManager()->flush(); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème s'est produit lors de la suppression d'un Metier", $e); + } + return $metier; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Metier/MetierServiceAwareTrait.php b/module/Application/src/Application/Service/Metier/MetierServiceAwareTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..d6fd26463b98541ad94511445d22c888d0f02049 --- /dev/null +++ b/module/Application/src/Application/Service/Metier/MetierServiceAwareTrait.php @@ -0,0 +1,29 @@ +<?php + +namespace Application\Service\Metier; + +trait MetierServiceAwareTrait { + + /** @var MetierService */ + private $metierService; + + /** + * @return MetierService + */ + public function getMetierService() + { + return $this->metierService; + } + + /** + * @param MetierService $metierService + * @return MetierService + */ + public function setMetierService($metierService) + { + $this->metierService = $metierService; + return $this->metierService; + } + + +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/Metier/MetierServiceFactory.php b/module/Application/src/Application/Service/Metier/MetierServiceFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..a7166dc72d6579348ad4575640c5794452a7a36b --- /dev/null +++ b/module/Application/src/Application/Service/Metier/MetierServiceFactory.php @@ -0,0 +1,20 @@ +<?php + +namespace Application\Service\Metier; + +use Doctrine\ORM\EntityManager; +use Zend\ServiceManager\ServiceLocatorInterface; + +class MetierServiceFactory { + + public function __invoke(ServiceLocatorInterface $serviceLocator) + { + /** @var EntityManager $entityManager */ + $entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default'); + + /** @var MetierService $service */ + $service = new MetierService(); + $service->setEntityManager($entityManager); + return $service; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/Service/RessourceRh/RessourceRhService.php b/module/Application/src/Application/Service/RessourceRh/RessourceRhService.php index 8426d1560502032525b38254d35e8c0fb498b8f8..5ce5b7c3077b4158e80741d242f90732021e5207 100644 --- a/module/Application/src/Application/Service/RessourceRh/RessourceRhService.php +++ b/module/Application/src/Application/Service/RessourceRh/RessourceRhService.php @@ -2,33 +2,44 @@ namespace Application\Service\RessourceRh; -use Application\Entity\Db\AgentStatus; use Application\Entity\Db\Corps; use Application\Entity\Db\Correspondance; -use Application\Entity\Db\Domaine; use Application\Entity\Db\Grade; use Application\Entity\Db\Metier; -use Application\Entity\Db\MetierFamille; +use Application\Entity\Db\MissionSpecifique; +use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\OptimisticLockException; +use Exception; use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Service\EntityManagerAwareTrait; +use UnicaenAuth\Entity\Db\User; +use Utilisateur\Service\User\UserServiceAwareTrait; +use Zend\Mvc\Controller\AbstractActionController; class RessourceRhService { use EntityManagerAwareTrait; + use UserServiceAwareTrait; - /** AGENT STATUS **************************************************************************************************/ + /** CORRESPONDANCE ************************************************************************************************/ /** + * @param bool $active * @param string $order - * @return AgentStatus[] + * @return Correspondance[] */ - public function getAgentStatusListe($order = null) + public function getCorrespondances($active = null, $order = null) { - $qb = $this->getEntityManager()->getRepository(AgentStatus::class)->createQueryBuilder('status'); + $qb = $this->getEntityManager()->getRepository(Correspondance::class)->createQueryBuilder('correspondance') + ->orderBy('correspondance.libelleCourt', 'ASC') + ; + if ($active !== null) { + if ($active) $qb = $qb ->andWhere("correspondance.histo = 'O'"); + else $qb = $qb ->andWhere("correspondance.histo <> 'O'"); + } if ($order !== null) { - $qb = $qb->orderBy('status.' . $order); + $qb = $qb->addOrderBy('correspondance.'.$order, 'ASC'); } $result = $qb->getQuery()->getResult(); @@ -36,80 +47,58 @@ class RessourceRhService { } /** - * @param integer $id - * @return AgentStatus + * @return array */ - public function getAgentStatus($id) + public function getCorrespondancesAsOptions() { - $qb = $this->getEntityManager()->getRepository(AgentStatus::class)->createQueryBuilder('status') - ->andWhere('status.id = :id') - ->setParameter('id', $id) - ; + $correspondances = $this->getCorrespondances(true); - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs status partagent le même identifiant [".$id."]"); + $array = []; + foreach ($correspondances as $correspondance) { + $array[$correspondance->getId()] = $correspondance->getLibelleLong() . " - " . $correspondance->getLibelleLong(); } - return $result; - } - /** - * @param AgentStatus $status - * @return AgentStatus - */ - public function createAgentStatus($status) - { - $this->getEntityManager()->persist($status); - try { - $this->getEntityManager()->flush($status); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la création d'un status", $e); - } - return $status; + return $array; } /** - * @param AgentStatus $status - * @return AgentStatus + * @param string $id + * @return Correspondance */ - public function updateAgentStatus($status) + public function getCorrespondance($id) { - try { - $this->getEntityManager()->flush($status); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'un status", $e); - } - return $status; - } + $qb = $this->getEntityManager()->getRepository(Correspondance::class)->createQueryBuilder('correspondance') + ->andWhere('correspondance.id = :id') + ->setParameter('id', $id) + ; - /** - * @param AgentStatus $status - */ - public function deleteAgentStatus($status) - { - $this->getEntityManager()->remove($status); try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la suppression d'un status", $e); + $result = $qb->getQuery()->getOneOrNullResult(); + } catch (NonUniqueResultException $e) { + throw new RuntimeException("Plusieurs correpondances partagent le même identifiant [".$id."]"); } + return $result; } - /** CORRESPONDANCE ************************************************************************************************/ + /** Grade *******************************************************************************************************/ /** + * @param bool $active * @param string $order * @return Correspondance[] */ - public function getCorrespondances($order = null) + public function getGrades($active = null, $order = null) { - $qb = $this->getEntityManager()->getRepository(Correspondance::class)->createQueryBuilder('correspondance') - ->orderBy('correspondance.reference', 'ASC') + $qb = $this->getEntityManager()->getRepository(Grade::class)->createQueryBuilder('grade') + ->orderBy('grade.libelleCourt', 'ASC') ; + if ($active !== null) { + if ($active) $qb = $qb ->andWhere("grade.histo = 'O'"); + else $qb = $qb ->andWhere("grade.histo <> 'O'"); + } if ($order !== null) { - $qb = $qb->addOrderBy('correspondance.'.$order, 'ASC'); + $qb = $qb->addOrderBy('grade.'.$order, 'ASC'); } $result = $qb->getQuery()->getResult(); @@ -117,76 +106,55 @@ class RessourceRhService { } /** - * @param integer $id - * @return Correspondance + * @return array */ - public function getCorrespondance($id) + public function getGradesAsOptions() { - $qb = $this->getEntityManager()->getRepository(Correspondance::class)->createQueryBuilder('correspondance') - ->andWhere('correspondance.id = :id') - ->setParameter('id', $id) - ; + $grades = $this->getGrades(true); - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs correpondances partagent le même identifiant [".$id."]"); + $array = []; + foreach ($grades as $grade) { + $array[$grade->getId()] = $grade->getLibelleCourt() . " - ". $grade->getLibelleLong(); } - return $result; - } - /** - * @param Correspondance $correspondance - * @return Correspondance - */ - public function createCorrespondance($correspondance) - { - $this->getEntityManager()->persist($correspondance); - try { - $this->getEntityManager()->flush($correspondance); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la création d'une correspondance", $e); - } - return $correspondance; + return $array; } /** - * @param Correspondance $correspondance - * @return Correspondance + * @param integer $id + * @return Grade */ - public function updateCorrespondance($correspondance) + public function getGrade($id) { - try { - $this->getEntityManager()->flush($correspondance); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'une correspondance", $e); - } - return $correspondance; - } + $qb = $this->getEntityManager()->getRepository(Grade::class)->createQueryBuilder('grade') + ->andWhere('grade.id = :id') + ->setParameter('id', $id) + ; - /** - * @param Correspondance $correspondance - */ - public function deleteCorrespondance($correspondance) - { - $this->getEntityManager()->remove($correspondance); try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la suppression d'une correspondance", $e); + $result = $qb->getQuery()->getOneOrNullResult(); + } catch (NonUniqueResultException $e) { + throw new RuntimeException("Plusieurs grades partagent le même identifiant [".$id."]"); } + return $result; } - /** CORPS *********************************************************************************************************/ + /** Corps *********************************************************************************************************/ /** + * @param bool $active * @param string $order - * @return Corps[] + * @return Correspondance[] */ - public function getCorpsListe($order = null) + public function getCorps($active = null, $order = null) { $qb = $this->getEntityManager()->getRepository(Corps::class)->createQueryBuilder('corps') + ->orderBy('corps.libelleCourt', 'ASC') ; + if ($active !== null) { + if ($active) $qb = $qb ->andWhere("corps.histo = 'O'"); + else $qb = $qb ->andWhere("corps.histo <> 'O'"); + } if ($order !== null) { $qb = $qb->addOrderBy('corps.'.$order, 'ASC'); @@ -196,11 +164,25 @@ class RessourceRhService { return $result; } + /** + * @return array + */ + public function getCorpsAsOptions() + { + $corps = $this->getCorps(true); + + $array = []; + foreach ($corps as $item) { + $array[$item->getId()] = $item->getLibelleCourt() . " - " . $item->getLibelleLong() ; + } + return $array; + } + /** * @param integer $id * @return Corps */ - public function getCorps($id) + public function getCorp($id) { $qb = $this->getEntityManager()->getRepository(Corps::class)->createQueryBuilder('corps') ->andWhere('corps.id = :id') @@ -215,384 +197,244 @@ class RessourceRhService { return $result; } - /** - * @param Corps $corps - * @return Corps - */ - public function createCorps($corps) - { - $this->getEntityManager()->persist($corps); - try { - $this->getEntityManager()->flush($corps); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la création d'un corps", $e); - } - return $corps; - } + /** ***********************************************/ - /** - * @param Corps $corps - * @return Corps - */ - public function updateCorps($corps) + public function getMetiersTypesAsOptions() { - try { - $this->getEntityManager()->flush($corps); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'un corps", $e); - } - return $corps; - } + $qb = $this->getEntityManager()->getRepository(Metier::class)->createQueryBuilder('metier') +// ->andWhere('fiche.histoDestruction IS NULL') + ->orderBy('metier.libelle', 'ASC'); - /** - * @param Corps $corps - */ - public function deleteCorps($corps) - { - $this->getEntityManager()->remove($corps); - try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la suppression d'un corps", $e); + $result = $qb->getQuery()->getResult(); + + $options = []; + /** @var Metier $metier */ + foreach ($result as $metier) { + $options[$metier->getId()] = $metier->getLibelle(); } + return $options; } - /** CORPS *********************************************************************************************************/ - /** - * @param string $order - * @return Metier[] - */ - public function getMetiers($order = null) + public function getMetiersTypesAsMultiOptions() { + /** @var Metier[] $metiers */ $qb = $this->getEntityManager()->getRepository(Metier::class)->createQueryBuilder('metier') - ; - - if ($order !== null) { - $qb = $qb->addOrderBy('metier.'.$order, 'ASC'); + ->orderBy('metier.libelle', 'ASC'); + $metiers = $qb->getQuery()->getResult(); + + $vide = []; + $result = []; + foreach ($metiers as $metier) { + if ($metier->getDomaine()) { + $result[$metier->getDomaine()->getLibelle()][] = $metier; + } else { + $vide[] = $metier; + } + } + ksort($result); + $multi = []; + foreach ($result as $key => $metiers) { + //['label'=>'A', 'options' => ["A" => "A", "a"=> "a"]], + $options = []; + foreach ($metiers as $metier) { + $options[$metier->getId()] = $metier->getLibelle(); + } + $multi[] = ['label' => $key, 'options' => $options]; } - - $result = $qb->getQuery()->getResult(); - return $result; - } - - /** - * @param integer $id - * @return Metier - */ - public function getMetier($id) - { - $qb = $this->getEntityManager()->getRepository(Metier::class)->createQueryBuilder('metier') - ->andWhere('metier.id = :id') - ->setParameter('id', $id) - ; - - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs métiers partagent le même identifiant [".$id."]"); + $options = []; + foreach ($vide as $metier) { + $options[$metier->getId()] = $metier->getLibelle(); } - return $result; - } + $multi[] = ['label' => 'Sans domaine rattaché', 'options' => $options]; + return $multi; - /** - * @param Metier $metier - * @return Metier - */ - public function createMetier($metier) - { - $this->getEntityManager()->persist($metier); - try { - $this->getEntityManager()->flush($metier); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la création d'un métier", $e); - } - return $metier; } + /** MISSION SPECIFIQUE ********************************************************************************************/ /** - * @param Metier $metier - * @return Metier + * @return MissionSpecifique[] */ - public function updateMetier($metier) - { - try { - $this->getEntityManager()->flush($metier); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'un metier.", $e); - } - return $metier; - } + public function getMissionsSpecifiques() { + $qb = $this->getEntityManager()->getRepository(MissionSpecifique::class)->createQueryBuilder('mission') + ->orderBy('mission.libelle', 'ASC'); - /** - * @param Metier $metier - */ - public function deleteMetier($metier) - { - $this->getEntityManager()->remove($metier); - try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la suppression d'un metier", $e); - } + $result = $qb->getQuery()->getResult(); + return $result; } - /** Famille Metier ************************************************************************************************/ - /** - * @param string $order - * @return MetierFamille[] + * @return MissionSpecifique[] */ - public function getMetiersFamilles($order = null) + public function getMisssionsSpecifiquesAsOption() { - $qb = $this->getEntityManager()->getRepository(MetierFamille::class)->createQueryBuilder('famille') - ->addSelect('metier')->leftJoin('famille.metiers', 'metier') - ; - - if ($order !== null) { - $qb = $qb->addOrderBy('famille.'.$order, 'ASC'); + $missions = $this->getMissionsSpecifiques(); + $options = []; + foreach ($missions as $mission) { + $options[$mission->getId()] = $mission->getLibelle(); } - - $result = $qb->getQuery()->getResult(); - return $result; + return $options; } /** * @param integer $id - * @return MetierFamille + * @return MissionSpecifique */ - public function getMetierFamille($id) - { - $qb = $this->getEntityManager()->getRepository(MetierFamille::class)->createQueryBuilder('famille') - ->andWhere('famille.id = :id') - ->setParameter('id', $id) - ; + public function getMissionSpecifique($id) { + $qb = $this->getEntityManager()->getRepository(MissionSpecifique::class)->createQueryBuilder('mission') + ->andWhere('mission.id = :id') + ->setParameter('id', $id); try { $result = $qb->getQuery()->getOneOrNullResult(); } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs familles de métier partagent le même identifiant [".$id."]"); + throw new RuntimeException("Plusieurs MissionSpecifique partagent le même id [".$id."]", $e); } return $result; } /** - * @param MetierFamille $famille - * @return MetierFamille + * @param AbstractActionController $controller + * @param string $paramName + * @return MissionSpecifique */ - public function createMetierFamille($famille) + public function getRequestedMissionSpecifique($controller, $paramName) { - $this->getEntityManager()->persist($famille); - try { - $this->getEntityManager()->flush($famille); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la création d'une famille de métier", $e); - } - return $famille; + $id = $controller->params()->fromRoute($paramName); + $mission = $this->getMissionSpecifique($id); + return $mission; } /** - * @param MetierFamille $famille - * @return MetierFamille + * @param MissionSpecifique $mission + * @return MissionSpecifique */ - public function updateMetierFamille($famille) + public function createMissionSpecifique($mission) { + /** @var User $user */ + $user = $this->getUserService()->getConnectedUser(); + /** @var DateTime $date */ try { - $this->getEntityManager()->flush($famille); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'une famille de metier.", $e); + $date = new DateTime(); + } catch (Exception $e) { + throw new RuntimeException("Problème lors de la récupération de la date", $e); } - return $famille; - } - /** - * @param MetierFamille $famille - */ - public function deleteMetierFamille($famille) - { - $this->getEntityManager()->remove($famille); + $mission->setHistoCreation($date); + $mission->setHistoCreateur($user); + $mission->setHistoModification($date); + $mission->setHistoModificateur($user); + + $this->getEntityManager()->persist($mission); try { - $this->getEntityManager()->flush(); + $this->getEntityManager()->flush($mission); } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la suppression d'une famille de metier", $e); + throw new RuntimeException("Problème lors de la sauvegarde en BD", $e); } - } - - /** Domaine *******************************************************************************************************/ - /** - * @param string $order - * @return Domaine[] - */ - public function getDomaines($order = null) - { - $qb = $this->getEntityManager()->getRepository(Domaine::class)->createQueryBuilder('domaine') - ; - - if ($order !== null) { - $qb = $qb->addOrderBy('domaine.'.$order, 'ASC'); - } - - $result = $qb->getQuery()->getResult(); - return $result; + return $mission; } /** - * @param integer $id - * @return Domaine + * @param MissionSpecifique $mission + * @return MissionSpecifique */ - public function getDomaine($id) + public function updateMissionSpecifique($mission) { - $qb = $this->getEntityManager()->getRepository(Domaine::class)->createQueryBuilder('domaine') - ->andWhere('domaine.id = :id') - ->setParameter('id', $id) - ; - + /** @var User $user */ + $user = $this->getUserService()->getConnectedUser(); + /** @var DateTime $date */ try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs domaines partagent le même identifiant [".$id."]"); + $date = new DateTime(); + } catch (Exception $e) { + throw new RuntimeException("Problème lors de la récupération de la date", $e); } - return $result; - } - /** - * @param Domaine $domaine - * @return Domaine - */ - public function createDomaine($domaine) - { - $this->getEntityManager()->persist($domaine); - try { - $this->getEntityManager()->flush($domaine); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la création d'un Domaine", $e); - } - return $domaine; - } + $mission->setHistoModification($date); + $mission->setHistoModificateur($user); - /** - * @param Domaine $domaine - * @return Domaine - */ - public function updateDomaine($domaine) - { try { - $this->getEntityManager()->flush($domaine); + $this->getEntityManager()->flush($mission); } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'un Domaine.", $e); + throw new RuntimeException("Problème lors de la sauvegarde en BD", $e); } - return $domaine; + + return $mission; } /** - * @param Domaine $domaine + * @param MissionSpecifique $mission + * @return MissionSpecifique */ - public function deleteDomaine($domaine) + public function historiseMissionSpecifique($mission) { - $this->getEntityManager()->remove($domaine); + /** @var User $user */ + $user = $this->getUserService()->getConnectedUser(); + /** @var DateTime $date */ try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la suppression d'un Domaine", $e); + $date = new DateTime(); + } catch (Exception $e) { + throw new RuntimeException("Problème lors de la récupération de la date", $e); } - } - /** Grade *******************************************************************************************************/ + $mission->setHistoDestruction($date); + $mission->setHistoDestructeur($user); - /** - * @param string $order - * @return Grade[] - */ - public function getGrades($order = null) - { - $qb = $this->getEntityManager()->getRepository(Grade::class)->createQueryBuilder('grade') - ; - - if ($order !== null) { - $qb = $qb->addOrderBy('grade.'.$order, 'ASC'); - } else { - $qb = $qb->addOrderBy('grade.corps, grade.rang', 'ASC'); + try { + $this->getEntityManager()->flush($mission); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Problème lors de la sauvegarde en BD", $e); } - $result = $qb->getQuery()->getResult(); - return $result; + return $mission; } /** - * @param integer $id - * @return Grade + * @param MissionSpecifique $mission + * @return MissionSpecifique */ - public function getGrade($id) + public function restoreMissionSpecifique($mission) { - $qb = $this->getEntityManager()->getRepository(Grade::class)->createQueryBuilder('grade') - ->andWhere('grade.id = :id') - ->setParameter('id', $id) - ; - - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs grades partagent le même identifiant [".$id."]"); - } - return $result; - } + $mission->setHistoDestruction(null); + $mission->setHistoDestructeur(null); - /** - * @param Grade $grade - * @return Grade - */ - public function createGrade($grade) - { - $this->getEntityManager()->persist($grade); try { - $this->getEntityManager()->flush($grade); + $this->getEntityManager()->flush($mission); } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la création d'un Grade", $e); + throw new RuntimeException("Problème lors de la sauvegarde en BD", $e); } - return $grade; + + return $mission; } /** - * @param Grade $grade - * @return Grade + * @param MissionSpecifique $mission + * @return MissionSpecifique */ - public function updateGrade($grade) + public function deleteMissionSpecifique($mission) { + + $this->getEntityManager()->remove($mission); try { - $this->getEntityManager()->flush($grade); + $this->getEntityManager()->flush($mission); } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la mise à jour d'un Grade.", $e); + throw new RuntimeException("Problème lors de la sauvegarde en BD", $e); } - return $grade; + + return $mission; } /** - * @param Grade $grade + * @return Metier[] */ - public function deleteGrade($grade) - { - $this->getEntityManager()->remove($grade); - try { - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème s'est produit lors de la suppression d'un Grade", $e); - } - } - - public function getMetiersTypesAsOptions() + public function getCartographie() { $qb = $this->getEntityManager()->getRepository(Metier::class)->createQueryBuilder('metier') -// ->andWhere('fiche.histoDestruction IS NULL') - ->orderBy('metier.libelle', 'ASC'); + ->addSelect('famille')->join('metier.famille', 'famille') + ->addSelect('domaine')->join('metier.domaine', 'domaine') + ->orderBy('famille.libelle, domaine.libelle, metier.libelle'); $result = $qb->getQuery()->getResult(); - - $options = []; - /** @var Metier $metier */ - foreach ($result as $metier) { - $options[$metier->getId()] = $metier->getLibelle(); - } - return $options; + return $result; } } \ No newline at end of file diff --git a/module/Application/src/Application/Service/RessourceRh/RessourceRhServiceFactory.php b/module/Application/src/Application/Service/RessourceRh/RessourceRhServiceFactory.php index cfe9b46d04418d70153c3e78b4005481779339f2..45fbbed0066976b79bc582b096b98832224d8b01 100644 --- a/module/Application/src/Application/Service/RessourceRh/RessourceRhServiceFactory.php +++ b/module/Application/src/Application/Service/RessourceRh/RessourceRhServiceFactory.php @@ -3,6 +3,7 @@ namespace Application\Service\RessourceRh; use Doctrine\ORM\EntityManager; +use Utilisateur\Service\User\UserService; use Zend\ServiceManager\ServiceLocatorInterface; class RessourceRhServiceFactory { @@ -15,12 +16,15 @@ class RessourceRhServiceFactory { { /** * @var EntityManager $entityManager + * @var UserService $userService */ $entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default'); + $userService = $serviceLocator->get(UserService::class); /** @var RessourceRhService $service */ $service = new RessourceRhService(); $service->setEntityManager($entityManager); + $service->setUserService($userService); return $service; } diff --git a/module/Application/src/Application/Service/Structure/StructureService.php b/module/Application/src/Application/Service/Structure/StructureService.php index 8a47e21efe2ab4421f791728aaa7fc7359b2aa8f..cde03c6af6ed71bc9d46512db7cfa926a0ec467d 100644 --- a/module/Application/src/Application/Service/Structure/StructureService.php +++ b/module/Application/src/Application/Service/Structure/StructureService.php @@ -2,152 +2,30 @@ namespace Application\Service\Structure; -use Application\Entity\Db\Source; use Application\Entity\Db\Structure; -use Application\Entity\Db\StructureType; -use Utilisateur\Service\User\UserServiceAwareTrait; -use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\OptimisticLockException; -use Exception; use UnicaenApp\Exception\RuntimeException; use UnicaenApp\Service\EntityManagerAwareTrait; +use Utilisateur\Entity\Db\User; +use Utilisateur\Service\User\UserServiceAwareTrait; use Zend\Mvc\Controller\AbstractActionController; class StructureService { use EntityManagerAwareTrait; use UserServiceAwareTrait; - use \Octopus\Service\Structure\StructureServiceAwareTrait; - - /** - * @return Structure - * @var Structure $structure - */ - public function create($structure) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $structure->setHistoCreation($date); - $structure->setHistoCreateur($user); - $structure->setHistoModification($date); - $structure->setHistoModificateur($user); - - $date = $structure->getDateOuverture(); - $format = $date->format('d/m/Y'); - - - try { - $this->getEntityManager()->persist($structure); - $this->getEntityManager()->flush($structure); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Structure", $e); - } - return $structure; - } - - /** - * @return Structure - * @var Structure $structure - */ - public function update($structure) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $structure->setHistoModification($date); - $structure->setHistoModificateur($user); - - try { - $this->getEntityManager()->flush($structure); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Structure", $e); - } - return $structure; - } - - /** - * @return Structure - * @var Structure $structure - */ - public function historise($structure) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $structure->setHistoDestruction($date); - $structure->setHistoDestructeur($user); - - try { - $this->getEntityManager()->flush($structure); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Structure", $e); - } - return $structure; - } - - /** - * @return Structure - * @var Structure $structure - */ - public function restore($structure) - { - try { - $date = new DateTime(); - } catch(Exception $e) { - throw new RuntimeException("Un problème est survenu lors de la récupération de la date", $e); - } - $user = $this->getUserService()->getConnectedUser(); - - $structure->setHistoModification($date); - $structure->setHistoModificateur($user); - $structure->setHistoDestruction(null); - $structure->setHistoDestructeur(null); - - try { - $this->getEntityManager()->flush($structure); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'enregistrement d'une Structure", $e); - } - return $structure; - } - - /** - * @return Structure - * @var Structure $structure - */ - public function delete($structure) - { - try { - $this->getEntityManager()->remove($structure); - $this->getEntityManager()->flush(); - } catch (OptimisticLockException $e) { - throw new RuntimeException("Un problème est survenu lors de l'effacement d'une Structure", $e); - } - return $structure; - } /** * @return Structure[] */ - public function getStructures() + public function getStructures($ouverte = true) { $qb = $this->getEntityManager()->getRepository(Structure::class)->createQueryBuilder('structure') - ->orderBy('structure.id'); + ->orderBy('structure.code'); + if ($ouverte) $qb = $qb->andWhere("structure.histo = 'O'"); $result = $qb->getQuery()->getResult(); + return $result; } @@ -168,54 +46,6 @@ class StructureService return $result; } - /** - * @return Structure[] - */ - public function getStructuresOuvertes() - { - $qb = $this->getEntityManager()->getRepository(Structure::class)->createQueryBuilder('structure') - ->andWhere('structure.dateFermeture IS NULL') - ->orderBy('structure.id'); - $result = $qb->getQuery()->getResult(); - return $result; - } - - /** - * @return StructureType[] - */ - public function getStructureTypeAsOptions() - { - $qb = $this->getEntityManager()->getRepository(StructureType::class)->createQueryBuilder('type') - ->orderBy('type.libelle'); - $result = $qb->getQuery()->getResult(); - - $options = []; - $options[null] = 'Sélectionnez un type de structure ... '; - /** @var StructureType $item */ - foreach ($result as $item) { - $options[$item->getCode()] = $item->getLibelle(); - } - return $options; - } - - /** - * @param string $typeCode - * @return StructureType - */ - public function getStructureTypeByCode($typeCode) - { - $qb = $this->getEntityManager()->getRepository(StructureType::class)->createQueryBuilder('type') - ->andWhere('type.code = :type') - ->setParameter('type', $typeCode); - - try { - $result = $qb->getQuery()->getOneOrNullResult(); - } catch (NonUniqueResultException $e) { - throw new RuntimeException("Plusieurs StructureType partagent le même code [".$typeCode."].", $e); - } - return $result; - } - /** * @param AbstractActionController $controller * @param string $paramName @@ -231,123 +61,66 @@ class StructureService /** * @return array */ - public function getStructuresAsOptions() + public function getStructuresAsOptions($ouverte = true) { $qb = $this->getEntityManager()->getRepository(Structure::class)->createQueryBuilder('structure') - ->andWhere('structure.dateFermeture IS NULL') - ->andWhere('structure.histoDestruction IS NULL') ->orderBy('structure.libelleLong') ; + if ($ouverte) $qb = $qb->andWhere("structure.histo = 'O'"); $result = $qb->getQuery()->getResult(); $options = []; - $options[null] = "Sélectionner une structure ..."; /** @var Structure $item */ foreach ($result as $item) { - $options[$item->getId()] = $item->getLibelleLong(); + if ($item->getId() !== null) $options[$item->getId()] = $item->getLibelleLong(); } - return $options; } - - public function synchroniseFromOctopus() + /** + * @param Structure $structure + * @param User $gestionnaire + * @return Structure + */ + public function addGestionnaire($structure, $gestionnaire) { - $structures_OCTOPUS = $this->getStructureService()->getStructures(); - $structures_PREECOG = $this->getStructures(); - - $nouvelles = []; - $modifiees = []; - $supprimees = []; - foreach ($structures_OCTOPUS as $structure) { - $res = array_filter($structures_PREECOG, - function(Structure $s) use ($structure) { return ($s->getSource() === 'OCTOPUS' && $s->getIdSource() == $structure->getId()); }); - if (! empty($res)) { - $modification = $this->updateFromOctopus(current($res), $structure); - if ($modification) $modifiees[] = current($res); - } else { - //nouvelle structure - $nouvelle = $this->createFromOctopus($structure); - $nouvelles[] = $nouvelle; - } - } - foreach ($structures_PREECOG as $structure) { - if ($structure->getSource() === Source::Octopus) { - $res = array_filter($structures_OCTOPUS, - function (\Octopus\Entity\Db\Structure $s) use ($structure) { - return ($structure->getSource() === 'OCTOPUS' && $s->getId() == $structure->getIdSource()); - }); - if (empty($res)) { - $this->delete($structure); - $supprimees[] = $structure; - } - } + $structure->addGestionnaire($gestionnaire); + try { + $this->getEntityManager()->flush($structure); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème est survenue lors de l'inscription en base.", $e); } - return [ - 'nouvelles' => $nouvelles, - 'modifiees' => $modifiees, - 'supprimees' => $supprimees, - ]; + return $structure; } /** - * @param \Octopus\Entity\Db\Structure $structure + * @param Structure $structure + * @param User $gestionnaire * @return Structure */ - private function createFromOctopus(\Octopus\Entity\Db\Structure $structure) + public function removeGestionnaire($structure, $gestionnaire) { - $type = $this->getStructureTypeByCode($structure->getType()->getCode()); - - $nouvelle = new Structure(); - $nouvelle->setLibelleCourt($structure->getLibelleCourt()); - $nouvelle->setLibelleLong($structure->getLibelleLong()); - $nouvelle->setSigle($structure->getSigle()); - $nouvelle->setType($type); - $nouvelle->setDateOuverture($structure->getDateOuverture()); - $nouvelle->setDateFermeture($structure->getDateFermeture()); - $nouvelle->setSource('OCTOPUS'); - $nouvelle->setIdSource($structure->getId()); - $this->create($nouvelle); - return $nouvelle; + $structure->removeGestionnaire($gestionnaire); + try { + $this->getEntityManager()->flush($structure); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème est survenue lors de l'inscription en base.", $e); + } + return $structure; } /** - * @param Structure $current - * @param \Octopus\Entity\Db\Structure $structure - * @return bool + * @param Structure + * @return Structure */ - private function updateFromOctopus($current, \Octopus\Entity\Db\Structure $structure) + public function update($structure) { - $modification = false; - $typeC = $this->getStructureTypeByCode($current->getType()->getCode()); - $typeO = $this->getStructureTypeByCode($structure->getType()->getCode()); - - if ($current->getLibelleCourt() !== $structure->getLibelleCourt()) { - $current->setLibelleCourt($structure->getLibelleCourt()); - $modification = true; - } - if ($current->getLibelleLong() !== $structure->getLibelleLong()) { - $current->setLibelleLong($structure->getLibelleLong()); - $modification = true; - } - if ($current->getSigle() !== $structure->getSigle()) { - $current->setSigle($structure->getSigle()); - $modification = true; - } - if ($typeC->getId() !== $typeO->getId()) { - $current->setType($typeO); - $modification = true; - } - if ($current->getDateOuverture() != $structure->getDateOuverture()) { - $current->setDateOuverture($structure->getDateOuverture()); - $modification = true; - } - if ($current->getDateFermeture() != $structure->getDateFermeture()) { - $current->setDateFermeture($structure->getDateFermeture()); - $modification = true; + try { + $this->getEntityManager()->flush($structure); + } catch (OptimisticLockException $e) { + throw new RuntimeException("Un problème est survenue lors de l'inscription en base.", $e); } - if ($modification) $this->update($current); - return $modification; + return $structure; } } \ No newline at end of file diff --git a/module/Application/src/Application/Service/Structure/StructureServiceFactory.php b/module/Application/src/Application/Service/Structure/StructureServiceFactory.php index a8138c986eabb0d0ab9e372eef56ed295d04f29f..943beb5010762e6209c8aef3f6729de5e9758902 100644 --- a/module/Application/src/Application/Service/Structure/StructureServiceFactory.php +++ b/module/Application/src/Application/Service/Structure/StructureServiceFactory.php @@ -13,18 +13,15 @@ class StructureServiceFactory { /** * @var EntityManager $entityManager * @var UserService $userService - * @var \Octopus\Service\Structure\StructureService $octopusStructureService */ $entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default'); $userService = $serviceLocator->get(UserService::class); - $octopusStructureService = $serviceLocator->get(\Octopus\Service\Structure\StructureService::class); /** * @var StructureService $service */ $service = new StructureService(); $service->setEntityManager($entityManager); $service->setUserService($userService); - $service->setStructureService($octopusStructureService); return $service; } diff --git a/module/Application/src/Application/Validator/AjoutFicheValidator.php b/module/Application/src/Application/Validator/AjoutFicheValidator.php new file mode 100644 index 0000000000000000000000000000000000000000..000a52d2038360a188f9dfa5820ad3f8362d030b --- /dev/null +++ b/module/Application/src/Application/Validator/AjoutFicheValidator.php @@ -0,0 +1,14 @@ +<?php + +namespace Application\Validator; + +use Zend\Validator\AbstractValidator; + +class AjoutFicheValidator extends AbstractValidator { + + public function isValid($value) + { + var_dump($value); + return true; + } +} \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/AgentStatutViewHelper.php b/module/Application/src/Application/View/Helper/AgentStatutViewHelper.php index 92cd89907b7bf8c08153341ab9f4d787cedb449f..b0acba767eb728d745f2108020808ff168eb9246 100644 --- a/module/Application/src/Application/View/Helper/AgentStatutViewHelper.php +++ b/module/Application/src/Application/View/Helper/AgentStatutViewHelper.php @@ -3,50 +3,35 @@ namespace Application\View\Helper; use Application\Entity\Db\AgentStatut; +use Application\View\Renderer\PhpRenderer; use Zend\View\Helper\AbstractHelper; - +use Zend\View\Helper\Partial; +use Zend\View\Resolver\TemplatePathStack; + + +/** + * Note : les clefs du tableau options sont les suivantes : + * id => l'identifiant du status (OSE-2017-17566-14) + * denomination => le nom de l'agent impliqué (Billy Bob) + * structure => la structure impliquée (DSI) + * periode => la periode (01/01/2001 => 06/06/2006) + * statut => la liste des statuts + * + * si non défini ou à vrai alors les données sont affichées + */ class AgentStatutViewHelper extends AbstractHelper { - /** * @param AgentStatut $statut - * @return string + * @param array $options + * @return string|Partial */ - public function render($statut, $args = []) + public function __invoke($statut, $options = []) { - $texte = ''; - - $texte .= '<div style="border: solid grey 1px; margin: 2px; padding: 2px; border-radius: 5px;">'; - - if (!isset($args['show_id']) || $args['show_id'] !== false) $texte .= '<span class="badge">'. $statut->getIdOrigine(). '</span> '; - if (!isset($args['show_agent']) || $args['show_agent'] !== false) $texte .= '<span class="badge">'. $statut->getAgent()->getDenomination(). '</span> '; - if (!isset($args['show_structure']) || $args['show_structure'] == true) $texte .= '<span class="badge">'. $statut->getStructure()->getLibelleLong(). '</span> '; - $texte .= ($statut->getDebut())?$statut->getDebut()->format('d/m/Y'):'---'; - $texte .= '→'; - $texte .= ($statut->getFin())?$statut->getFin()->format('d/m/Y'):'---'; - - $texte .= '<ul>'; - if ($statut->isTitulaire()) $texte .='<li>Titulaire</li>'; - if ($statut->isCdi()) $texte .='<li>C.D.I.</li>'; - if ($statut->isCdd()) $texte .='<li>C.D.D.</li>'; - if ($statut->isVacataire()) $texte .='<li>Vacataire</li>'; - if ($statut->isEnseignant()) $texte .='<li>Enseignant</li>'; - if ($statut->isAdministratif()) $texte .='<li>Administratif</li>'; - if ($statut->isChercheur()) $texte .='<li>Chercheur</li>'; - if ($statut->isEtudiant()) $texte .='<li>Etudiant</li>'; - if ($statut->isAuditeurLibre()) $texte .='<li>Auditeur libre</li>'; - if ($statut->isDoctorant()) $texte .='<li>Doctorant</li>'; - if ($statut->isDetacheIn()) $texte .='<li>Détaché (in)</li>'; - if ($statut->isDetacheOut()) $texte .='<li>Détaché (out)</li>'; - if ($statut->isDispo()) $texte .='<li>Disponibilité</li>'; - if ($statut->isHeberge()) $texte .='<li>Hébergé</li>'; - if ($statut->isEmerite()) $texte .='<li>Émerite</li>'; - if ($statut->isRetraite()) $texte .='<li>Retraité</li>'; - $texte .= '</ul>'; - - $texte .= '</div>'; - - return $texte; + /** @var PhpRenderer $view */ + $view = $this->getView(); + $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); + return $view->partial('agent-status', ['statut' => $statut, 'options' => $options]); } } \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/AgentViewHelper.php b/module/Application/src/Application/View/Helper/AgentViewHelper.php index edaf50e3d8e64114bbeaa73330f5d19963f5bebf..035486bef4eabc9bc75f403eeaadcf48fb18a372 100644 --- a/module/Application/src/Application/View/Helper/AgentViewHelper.php +++ b/module/Application/src/Application/View/Helper/AgentViewHelper.php @@ -3,70 +3,25 @@ namespace Application\View\Helper; use Application\Entity\Db\Agent; -use Application\Entity\Db\Poste; +use Application\View\Renderer\PhpRenderer; use Zend\View\Helper\AbstractHelper; +use Zend\View\Helper\Partial; +use Zend\View\Resolver\TemplatePathStack; + class AgentViewHelper extends AbstractHelper { - - /** @var Agent */ - protected $agent; - /** * @param Agent $agent - * @return $this - */ - public function __invoke($agent = null) - { - $this->agent = $agent; - return $this; - } - - public function __call($name, $arguments) - { - $attr = call_user_func_array([$this->agent, $name], $arguments); - return $this; - } - - /** - * @param Agent $agent - * @return string + * @param array $options + * @return string|Partial */ - public function render($agent) + public function __invoke($agent, $options = []) { - $texte = '<dl class="dl-horizontal">'; - $texte .= '<dt> Prénom </dt>'; - $texte .= '<dd> '. $agent->getPrenom() . '</dd>'; - $texte .= '<dt> Nom </dt>'; - $texte .= '<dd> '. $agent->getNom() .'</dd>'; - $texte .= '<dt> Numéro poste </dt>'; - $texte .= '<dd> '.$agent->getNumeroPoste() .'</dd>'; - $texte .= '<dt> Date de début </dt>'; - $texte .= '<dd>'. (($agent->getDateDebut())?$agent->getDateDebut()->format('d/m/Y'):'---').'</dd>'; - $texte .= '<dt> Date de fin </dt>'; - $texte .= '<dd>'. (($agent->getDateFin())?$agent->getDateFin()->format('d/m/Y'):'---').'</dd>'; - $texte .= '<dt> Quotité travaillée </dt>'; - $texte .= '<dd>'. $agent->getQuotite().'% </dd>'; - $texte .= '<dt> Status </dt>'; - $texte .= '<dd> '. $agent->getStatus() .'</dd>'; - $texte .= '<dt> Statuts </dt> <br/>'; - foreach ($agent->getStatutsActifs() as $statut) { - $texte .= '<dd> '. $this->getView()->agentStatut()->render($statut, ['show_agent' => false]) .'</dd>'; - } - $texte .= '<dt> Correspondance </dt>'; - $texte .= '<dd> '. $agent->getCorrespondance() .'</dd>'; - $texte .= '<dt> Corps </dt>'; - $texte .= '<dd> '. $agent->getCorps() .'</dd>'; - $texte .= '<dt> Grade </dt>'; - $texte .= '<dd> '. $agent->getGrade() . '</dd>'; - $texte .= '</dl>'; - $texte .= '<br/>'; - - if ($agent->getMissionsComplementaires() !== null) { - $texte .= '<h3>Missions complémentaires</h3>'; - $texte .= $agent->getMissionsComplementaires(); - } + /** @var PhpRenderer $view */ + $view = $this->getView(); + $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); - return $texte; + return $view->partial('agent', ['agent' => $agent, 'options' => $options]); } } \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/FicheMetierExterneViewHelper.php b/module/Application/src/Application/View/Helper/FicheMetierExterneViewHelper.php new file mode 100644 index 0000000000000000000000000000000000000000..4f83f2247dec8aa82b3df1ee22e9dd32d09e5bbe --- /dev/null +++ b/module/Application/src/Application/View/Helper/FicheMetierExterneViewHelper.php @@ -0,0 +1,27 @@ +<?php + +namespace Application\View\Helper; + +use Application\Entity\Db\FicheTypeExterne; +use Application\View\Renderer\PhpRenderer; +use Zend\View\Helper\AbstractHelper; +use Zend\View\Helper\Partial; +use Zend\View\Resolver\TemplatePathStack; + +class FicheMetierExterneViewHelper extends AbstractHelper +{ + /** + * @param FicheTypeExterne $fiche + * @param boolean $actionnable + * @param array $options + * @return string|Partial + */ + public function __invoke($fiche, $actionnable = true, $options = []) + { + /** @var PhpRenderer $view */ + $view = $this->getView(); + $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); + + return $view->partial('fiche-metier-externe', ['fiche' => $fiche, 'actionnable' => $actionnable, 'options' => $options]); + } +} \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/FicheMetierViewHelper.php b/module/Application/src/Application/View/Helper/FicheMetierViewHelper.php new file mode 100644 index 0000000000000000000000000000000000000000..950604a9da13dffbc422235243e1254f63d475f6 --- /dev/null +++ b/module/Application/src/Application/View/Helper/FicheMetierViewHelper.php @@ -0,0 +1,26 @@ +<?php + +namespace Application\View\Helper; + + use Application\Entity\Db\FicheMetier; + use Application\View\Renderer\PhpRenderer; + use Zend\View\Helper\AbstractHelper; + use Zend\View\Helper\Partial; + use Zend\View\Resolver\TemplatePathStack; + +class FicheMetierViewHelper extends AbstractHelper +{ + /** + * @param FicheMetier $fiche + * @param array $options + * @return string|Partial + */ + public function __invoke($fiche, $options = []) + { + /** @var PhpRenderer $view */ + $view = $this->getView(); + $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); + + return $view->partial('fiche-metier', ['fiche' => $fiche, 'options' => $options]); + } +} \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/FicheTypeExterneViewHelper.php b/module/Application/src/Application/View/Helper/FicheTypeExterneViewHelper.php deleted file mode 100644 index a2a7c935d4656f527a72dd55640e94da1938d1f8..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/View/Helper/FicheTypeExterneViewHelper.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -namespace Application\View\Helper; - - -use Application\Entity\Db\Application;use Application\Entity\Db\FicheTypeExterne; -use Zend\View\Helper\AbstractHelper; - -class FicheTypeExterneViewHelper extends AbstractHelper -{ - - /** @var Agent */ - protected $agent; - - /** - * @param Agent $agent - * @return $this - */ - public function __invoke($agent = null) - { - $this->agent = $agent; - return $this; - } - - public function __call($name, $arguments) - { - $attr = call_user_func_array([$this->agent, $name], $arguments); - return $this; - } - - /** - * @param FicheTypeExterne $ficheTypeExterne - * @return string - */ - public function render($ficheTypeExterne, $actionnable = true) - { - $texte = ''; - $texte .= '<div class="panel panel-info">'; - $texte .= ' <div class="panel-heading">'; - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h2>'.$ficheTypeExterne->getFicheType()->getMetier()->getLibelle().'</h2>'; - $texte .= ' </div>'; - $texte .= ' <div class="col-md-1 pull-right">'; - if ($actionnable === true) { - $texte .= ' <a href="' . $this->getView()->url('fiche-poste/modifier-fiche-metier', ['fiche-poste' => $ficheTypeExterne->getFichePoste()->getId(), 'fiche-type-externe' => $ficheTypeExterne->getId()], [], true) . '" class="ajax-modal" data-event="modification">'; - $texte .= ' <span class="icon editer" title="Éditer la fiche type externe"></span></a>'; - $texte .= ' <a href="' . $this->getView()->url('fiche-poste/selectionner-activite', ['fiche-poste' => $ficheTypeExterne->getFichePoste()->getId(), 'fiche-type-externe' => $ficheTypeExterne->getId()], [], true) . '" class="ajax-modal" data-event="modification">'; - $texte .= ' <span class="icon listing" title="Sélectionner les activités associées"></span></a>'; - $texte .= ' <a href="' . $this->getView()->url('fiche-poste/retirer-fiche-metier', ['fiche-poste' => $ficheTypeExterne->getFichePoste()->getId(), 'fiche-type-externe' => $ficheTypeExterne->getId()], [], true) . '">'; - $texte .= ' <span class="icon detruire" title="Retirer la fiche type externe"></span></a>'; - } - $texte .= ' </div>'; - $texte .= ' <div class="col-md-3 pull-right">'; - if ($ficheTypeExterne->getPrincipale()) { - $texte .='Principale'; - } else { - $texte .=$ficheTypeExterne->getQuotite().'%'; - } - $texte .= ' </div>'; - $texte .= ' </div>'; - $texte .= ' </div>'; - $texte .= ' <div class="panel-body">'; - if ($ficheTypeExterne->getPrincipale()) { - $texte .= ' <h3>Missions principales</h3>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getMissionsPrincipales(); - - $texte .= ' <h3>Parcours de formation de base pour la prise de poste </h3>'; - - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Connaissances </h4>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getConnaissances(); - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getConnaissancesFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Compétences opérationnelles </h4>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getCompetencesOperationnelles(); - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getCompetencesOperationnellesFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Compétences comportementales </h4>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getCompetencesComportementales(); - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getCompetencesComportementalesFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Applications </h4>'; - $texte .= ' <ul>'; - foreach ($ficheTypeExterne->getFicheType()->getApplications() as $application) { - $texte .= '<li>'.$application->getLibelle().'</li>'; - } - $texte .= ' </ul>'; - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheTypeExterne->getFicheType()->getApplicationsFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - } - - $texte .= ' <h3> Activités </h3>'; - $activites = explode(";", $ficheTypeExterne->getActivites()); - foreach($ficheTypeExterne->getFicheType()->getActivites() as $activite) { - $idActivite = $activite->getActivite()->getId(); - if (array_search($idActivite, $activites) !== false) { - $texte .= '<h4>' . $activite->getActivite()->getLibelle() . '</h4>'; - $texte .= $activite->getActivite()->getDescription(); - } - } - - $texte .= ' </div>'; - $texte .= '</div>'; - - return $texte; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/FicheTypeViewHelper.php b/module/Application/src/Application/View/Helper/FicheTypeViewHelper.php deleted file mode 100644 index 4d42f63bb490d010cad0c547ffe39287e656a661..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/View/Helper/FicheTypeViewHelper.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php - -namespace Application\View\Helper; - -use Application\Entity\Db\FicheMetierType; -use Application\Entity\Db\FicheMetierTypeActivite; -use Zend\View\Helper\AbstractHelper; - -class FicheTypeViewHelper extends AbstractHelper -{ - - /** - * @param FicheMetierType $ficheMetierType - * @return string - */ - public function render($ficheMetierType) - { - $activites = $ficheMetierType->getActivites(); - usort($activites, function (FicheMetierTypeActivite $a, FicheMetierTypeActivite $b) { return $a->getPosition() < $b->getPosition();}); - - $texte = ''; - - $texte .= '<h2>'.$ficheMetierType->getMetier()->getLibelle().'</h2>'; - - $texte .= ' <div class="panel panel-info">'; - $texte .= ' <div class="panel-heading">'; - $texte .= ' <h2>Missions principales</h2>'; - $texte .= ' </div>'; - $texte .= ' <div class="panel-body">'; - $texte .= ' ' . $ficheMetierType->getMissionsPrincipales(); - $texte .= ' </div>'; - $texte .= ' </div>'; - - - - $texte .= ' <div class="panel panel-info">'; - $texte .= ' <div class="panel-heading">'; - $texte .= ' <h2>Activités</h2>'; - $texte .= ' </div>'; - $texte .= ' <div class="panel-body">'; - foreach($activites as $activite) { - if ($activite->getActivite()->estNonHistorise()) { - $texte .= '<div class="activite">'; - $texte .= '<h3>' . $activite->getActivite()->getLibelle() . '</h3>'; - $texte .= $activite->getActivite()->getDescription(); - $texte .= '</div>'; - } - } - $texte .= ' </div>'; - $texte .= ' </div>'; - - $texte .= ' <div class="panel panel-info">'; - $texte .= ' <div class="panel-heading">'; - $texte .= ' <h2>Parcours de formation de base pour la prise de poste</h2>'; - $texte .= ' </div>'; - $texte .= ' <div class="panel-body">'; - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Connaissances </h4>'; - $texte .= ' ' . $ficheMetierType->getConnaissances(); - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheMetierType->getConnaissancesFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Compétences opérationnelles </h4>'; - $texte .= ' ' . $ficheMetierType->getCompetencesOperationnelles(); - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheMetierType->getCompetencesOperationnellesFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Compétences comportementales </h4>'; - $texte .= ' ' . $ficheMetierType->getCompetencesComportementales(); - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheMetierType->getCompetencesComportementalesFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - - $texte .= ' <div class="row">'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Applications </h4>'; - $texte .= ' <ul>'; - - foreach ($ficheMetierType->getApplications() as $application) { - $texte .= '<li>'.$application->getLibelle().'</li>'; - } - - $texte .= ' </ul>'; - $texte .= ' </div>'; - $texte .= ' <div class="col-md-6">'; - $texte .= ' <h4> Plan de formation </h4>'; - $texte .= ' ' . $ficheMetierType->getApplicationsFormation(); - $texte .= ' </div>'; - $texte .= ' </div>'; - $texte .= ' </div>'; - $texte .= ' </div>'; - - - return $texte; - - } -} \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/PosteViewHelper.php b/module/Application/src/Application/View/Helper/PosteViewHelper.php index aae2745c817cf6ff8b12cbbeb441797e4c982fd7..56cc40994bc52ef53f5fc4cae52a12630e1a4313 100644 --- a/module/Application/src/Application/View/Helper/PosteViewHelper.php +++ b/module/Application/src/Application/View/Helper/PosteViewHelper.php @@ -3,62 +3,24 @@ namespace Application\View\Helper; use Application\Entity\Db\Poste; -use Octopus\Service\Immobilier\ImmobilierServiceAwareTrait; +use Application\View\Renderer\PhpRenderer; use Zend\View\Helper\AbstractHelper; +use Zend\View\Helper\Partial; +use Zend\View\Resolver\TemplatePathStack; class PosteViewHelper extends AbstractHelper { - use ImmobilierServiceAwareTrait; - - /** @var Poste */ - protected $poste; - /** * @param Poste $poste - * @return $this + * @param array $options + * @return string|Partial */ - public function __invoke($poste = null) - { - $this->poste = $poste; - return $this; - } - - public function __call($name, $arguments) + public function __invoke($poste, $options = []) { - $attr = call_user_func_array([$this->poste, $name], $arguments); - return $this; - } - - /** - * @param Poste $poste - * @return string - */ - public function render($poste) - { - $texte = ''; - $texte .= '<dl class="dl-horizontal">'; - $texte .= '<dt> Numéro poste national </dt>'; - $texte .= '<dd class="siham">'.$poste->getNumeroPoste().'</dd>'; - $texte .= '<dt> Affectation du poste </dt>'; - $texte .= '<dd class="siham">'.$poste->getStructure().'</dd>'; - $texte .= '<dt> Localisation du poste </dt>'; -// $texte .= '<dd class="siham">'.$poste->getLocalisation().'</dd>'; - $texte .= '<dd class="siham">'.$this->getImmobiliserService()->getImmobilierBatiment($poste->getLocalisation()).'</dd>'; - $texte .= '<dt> Rattachement hiérarchique </dt>'; - $texte .= '<dd class="siham">'.(($poste->getRattachementHierarchique())?$poste->getRattachementHierarchique()->getDenomination():"---").'</dd>'; - $texte .= '<dt> Catégorie </dt>'; - $texte .= '<dd class="siham">'.$poste->getCorrespondance().'</dd>'; - $texte .= '<dt> Domaine UNICAEN </dt>'; - $texte .= '<dd class="gpeec">'.(($poste->getDomaine())?$poste->getDomaine()->getLibelle():"---").'</dd>'; - $texte .= '<dt> Fonction </dt>'; - - $texte .= '<dd class="gpeec">'.($poste->getFonction())?:"---".'</dd>'; - if ($poste->getLien()) { - $texte .= '<dt> Lien externe </dt>'; - $texte .= '<dd class="gpeec"><a href="'.$poste->getLien().'">'.$poste->getLien().'</a></dd>'; - } - $texte .= '</dl>'; + /** @var PhpRenderer $view */ + $view = $this->getView(); + $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); - return $texte; + return $view->partial('poste', ['poste' => $poste, 'options' => $options]); } } \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/PosteViewHelperFactory.php b/module/Application/src/Application/View/Helper/PosteViewHelperFactory.php deleted file mode 100644 index b7476ba75a97d8e26a88d4a6be6bb4aa276e595d..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/View/Helper/PosteViewHelperFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Application\View\Helper; - -use Octopus\Service\Immobilier\ImmobilierService; -use Zend\View\HelperPluginManager; - -class PosteViewHelperFactory { - - public function __invoke(HelperPluginManager $manager) - { - /** @var ImmobilierService $immobilierService */ - $immobilierService = $manager->getServiceLocator()->get(ImmobilierService::class); - - /** @var PosteViewHelper $helper */ - $helper = new PosteViewHelper(); - $helper->setImmobiliserService($immobilierService); - return $helper; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/SpecificitePosteViewHelper.php b/module/Application/src/Application/View/Helper/SpecificitePosteViewHelper.php index 3b1a71bc3a551d27fe0dc4e720c1830e04149918..66b5649121a6aa22ed3431fc9214725c1d648ddd 100644 --- a/module/Application/src/Application/View/Helper/SpecificitePosteViewHelper.php +++ b/module/Application/src/Application/View/Helper/SpecificitePosteViewHelper.php @@ -3,61 +3,24 @@ namespace Application\View\Helper; use Application\Entity\Db\SpecificitePoste; +use Application\View\Renderer\PhpRenderer; use Zend\View\Helper\AbstractHelper; +use Zend\View\Helper\Partial; +use Zend\View\Resolver\TemplatePathStack; class SpecificitePosteViewHelper extends AbstractHelper { - - /** @var SpecificitePoste */ - protected $specificite; - /** * @param SpecificitePoste $specificite - * @return $this + * @param array $options + * @return string|Partial */ - public function __invoke($specificite = null) + public function __invoke($specificite, $options = []) { - $this->specificite = $specificite; - return $this; - } + /** @var PhpRenderer $view */ + $view = $this->getView(); + $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); - public function __call($name, $arguments) - { - $attr = call_user_func_array([$this->specificite, $name], $arguments); - return $this; - } - - /** - * @param SpecificitePoste $specificite - * @return string - */ - public function render($specificite) - { - $texte = ""; - if ($specificite->getSpecificite()) { - $texte .= '<h3> Spécificité du poste </h3>'; - $texte .= $specificite->getSpecificite(); - } - if ($specificite->getEncadrement()) { - $texte .= '<h3> Encadrement </h3>'; - $texte .= $specificite->getEncadrement(); - } - if ($specificite->getRelationsInternes()) { - $texte .= '<h3> Relations internes à l\'unicaen </h3>'; - $texte .= $specificite->getRelationsInternes(); - } - if ($specificite->getRelationsExternes()) { - $texte .= '<h3> Relations externes à l\'unicaen </h3>'; - $texte .= $specificite->getRelationsExternes(); - } - if ($specificite->getContraintes()) { - $texte .= '<h3> Contraintes particulières d\'exercice </h3>'; - $texte .= $specificite->getContraintes(); - } - if ($specificite->getMoyens()) { - $texte .= '<h3> Moyens et outils mis à disposition </h3>'; - $texte .= $specificite->getMoyens(); - } - return $texte; + return $view->partial('specificite', ['specificite' => $specificite, 'options' => $options]); } } \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/partial/agent-status.phtml b/module/Application/src/Application/View/Helper/partial/agent-status.phtml new file mode 100644 index 0000000000000000000000000000000000000000..732cf53a3683560bb81f3da26bebf7dcae120bcc --- /dev/null +++ b/module/Application/src/Application/View/Helper/partial/agent-status.phtml @@ -0,0 +1,71 @@ +<?php + + +/** + * @var AgentStatut $statut + * @var array $options + */ + +use Application\Entity\Db\AgentStatut; + +?> + +<div class="agent-status"> + <?php if (!isset($options['id']) || $options['id'] !== false) : ?> + <span class="badge"> + <?php echo $statut->getIdOrigine(); ?> + </span> + <?php endif; ?> + + <?php if (!isset($options['denomination']) || $options['denomination'] !== false) : ?> + <span class="badge"> + <?php echo $statut->getAgent()->getDenomination(); ?> + </span> + <?php endif; ?> + + <?php if (!isset($options['structure']) || $options['structure'] !== false) : ?> + <span class="badge structure" title="<?php echo $statut->getStructure()->getLibelleLong(); ?>"> + <?php echo $statut->getStructure()->getLibelleCourt(); ?> + </span> + <?php endif; ?> + + <?php if (!isset($options['periode']) || $options['periode'] !== false) : ?> + <?php + $debut = ($statut->getDebut())?$statut->getDebut()->format('d/m/Y'):'---'; + $fin = ($statut->getFin() && $statut->getFin()->format('d/m/Y') !== '31/12/1999')?$statut->getFin()->format('d/m/Y'):'---'; + ?> + <?php echo $debut; ?> → <?php echo $fin; ?> + <?php endif; ?> + + <?php if (!isset($options['statut']) || $options['statut'] !== false) : ?> + <ul> + <?php + if ($statut->isTitulaire()) echo '<li>Titulaire</li>'; + if ($statut->isCdi()) echo '<li>C.D.I.</li>'; + if ($statut->isCdd()) echo '<li>C.D.D.</li>'; + if ($statut->isVacataire()) echo '<li>Vacataire</li>'; + if ($statut->isEnseignant()) echo '<li>Enseignant</li>'; + if ($statut->isAdministratif()) echo '<li>Administratif</li>'; + if ($statut->isChercheur()) echo '<li>Chercheur</li>'; + if ($statut->isEtudiant()) echo '<li>Etudiant</li>'; + if ($statut->isAuditeurLibre()) echo '<li>Auditeur libre</li>'; + if ($statut->isDoctorant()) echo '<li>Doctorant</li>'; + if ($statut->isDetacheIn()) echo '<li>Détaché (in)</li>'; + if ($statut->isDetacheOut()) echo '<li>Détaché (out)</li>'; + if ($statut->isDispo()) echo '<li>Disponibilité</li>'; + if ($statut->isHeberge()) echo '<li>Hébergé</li>'; + if ($statut->isEmerite()) echo '<li>Émerite</li>'; + if ($statut->isRetraite()) echo '<li>Retraité</li>'; + ?> + </ul> + <?php endif; ?> +</div> + +<style> + div.agent-status { + border: solid grey 1px; + margin: 2px; + padding: 2px; + border-radius: 5px; + } +</style> diff --git a/module/Application/src/Application/View/Helper/partial/agent.phtml b/module/Application/src/Application/View/Helper/partial/agent.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e4c664f78130e1f534f7f06a6f9f6a1415f6ec00 --- /dev/null +++ b/module/Application/src/Application/View/Helper/partial/agent.phtml @@ -0,0 +1,52 @@ +<?php + +/** + * @var Agent $agent + */ + +use Application\Entity\Db\Agent; +use Application\Entity\Db\AgentStatut; + +?> + +<h3> Présentation de l'agent </h3> + +<?php + $correspondance = ($agent->getCorrespondance()) ? ($agent->getCorrespondance()->getLibelleCourt()) . " - " . $agent->getCorrespondance()->getLibelleLong() : "---"; + $corps = ($agent->getCorps()) ? ($agent->getCorps()->getLibelleCourt()) . " - " . $agent->getCorps()->getLibelleLong() : "---"; + $grade = ($agent->getGrade()) ? ($agent->getGrade()->getLibelleCourt()) . " - " . $agent->getGrade()->getLibelleLong() : "---"; +?> + +<dl class="dl-horizontal"> + <dt> Prénom </dt> + <dd> <?php echo $agent->getPrenom(); ?> </dd> + <dt> Nom </dt> + <dd> <?php echo $agent->getNomUsuel(); ?> </dd> + <dt> Quotité travaillée </dt> + <dd> <?php echo $agent->getQuotite(); ?> </dd> + <dt> Correspondance </dt> + <dd> <?php echo $correspondance; ?> </dd> + <dt> Corps </dt> + <dd> <?php echo $corps; ?></dd> + <dt> Grade </dt> + <dd> <?php echo $grade; ?></dd> +</dl> + +<h3>Statuts</h3> + +<?php + $statuts = $agent->getStatuts(); + usort($statuts, function (AgentStatut $a, AgentStatut $b) { return $a->getDebut() < $b->getDebut();}); +?> + +<?php foreach ($statuts as $statut) : ?> + <?php echo $this->agentStatut($statut, ['denomination' => false]); ?> +<?php endforeach; ?> + +<h3> Missions spécifiques </h3> + +<ul> + <?php foreach ($agent->getMissions() as $mission) : ?> + <li> <?php echo $mission->getLibelle(); ?> </li> + <?php endforeach; ?> +</ul> diff --git a/module/Application/src/Application/View/Helper/partial/fiche-metier-externe.phtml b/module/Application/src/Application/View/Helper/partial/fiche-metier-externe.phtml new file mode 100644 index 0000000000000000000000000000000000000000..5a2c33e3cdfabbccbf71cf9fea043a28ad7d82d4 --- /dev/null +++ b/module/Application/src/Application/View/Helper/partial/fiche-metier-externe.phtml @@ -0,0 +1,101 @@ +<?php + +/** + * @var FicheTypeExterne $fiche + * @var boolean $actionnable + */ + +use Application\Entity\Db\FicheTypeExterne; + +?> + + +<div class="panel panel-info"> + <div class="panel-heading"> + <div class="row"> + <div class="col-md-8"> + <h2> <?php echo $fiche->getFicheType()->getMetier()->getLibelle(); ?> </h2> + </div> + <div class="col-md-1 pull-right"> + <?php if ($actionnable === true) : ?> + <a href="<?php echo $this->url('fiche-poste/modifier-fiche-metier', ['fiche-poste' => $fiche->getFichePoste()->getId(), 'fiche-type-externe' => $fiche->getId()], [], true); ?>" + class="ajax-modal" data-event="modification"> + <span class="icon editer" title="Éditer la fiche type externe"></span></a> + <a href="<?php echo $this->url('fiche-poste/selectionner-activite', ['fiche-poste' => $fiche->getFichePoste()->getId(), 'fiche-type-externe' => $fiche->getId()], [], true); ?>" + class="ajax-modal" data-event="modification"> + <span class="icon listing" title="Sélectionner les activités associées"></span></a> + <a href="<?php $this->url('fiche-poste/retirer-fiche-metier', ['fiche-poste' => $fiche->getFichePoste()->getId(), 'fiche-type-externe' => $fiche->getId()], [], true); ?>"> + <span class="icon detruire" title="Retirer la fiche type externe"></span></a> + <?php endif; ?> + </div> + <div class="col-md-2 pull-right"> + <?php if ($fiche->getPrincipale()) : ?> + Principale <br/> + <?php endif ;?> + <?php echo $fiche->getQuotite(); ?> % + </div> + </div> + </div> + <div class="panel-body"> + <h3>Missions principales</h3> + <?php echo $fiche->getFicheType()->getMissionsPrincipales(); ?> + + <h3> Activités </h3> + <?php + $activites = explode(";", $fiche->getActivites()); + ?> + + <?php foreach($fiche->getFicheType()->getActivites() as $activite) : ?> + <?php $idActivite = $activite->getActivite()->getId(); ?> + <?php if (array_search($idActivite, $activites) !== false) : ?> + <h4> <?php echo $activite->getActivite()->getLibelle(); ?> </h4> + <?php echo $activite->getActivite()->getDescription(); ?> + <?php endif; ?> + <?php endforeach; ?> + + <?php if ($fiche->getPrincipale()) : ?> + <h3>Parcours de formation de base pour la prise de poste </h3> + + <h4> Connaissances </h4> + <?php echo $fiche->getFicheType()->getConnaissances(); ?> + <h4> Compétences opérationnelles </h4> + <?php echo $fiche->getFicheType()->getCompetencesOperationnelles(); ?> + <h4> Compétences comportementales </h4> + <?php $fiche->getFicheType()->getCompetencesComportementales(); ?> + + <div class="row"> + <div class="col-md-6"> + <h4> Applications métiers</h4> + + <?php + $applications = []; + foreach ($fiche->getFicheType()->getActivites() as $activite) { + $idActivite = $activite->getActivite()->getId(); + if (array_search($idActivite, $activites) !== false) { + foreach ($activite->getActivite()->getApplications() as $application) { + $applications[] = $application->getLibelle(); + } + } + } + ?> + + <ul> + <?php foreach ($applications as $application) : ?> + <li> <?php echo $application; ?> </li> + <?php endforeach; ?> + </ul> + + </div> + <div class="col-md-6"> + <h4> Plan de formation </h4> + <?php + echo $fiche->getFicheType()->getConnaissancesFormation(); + echo $fiche->getFicheType()->getCompetencesOperationnellesFormation(); + echo $fiche->getFicheType()->getCompetencesComportementalesFormation(); + echo $fiche->getFicheType()->getApplicationsFormation(); + ?> + </div> + </div> + <?php endif; ?> + </div> +</div> \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/partial/fiche-metier.phtml b/module/Application/src/Application/View/Helper/partial/fiche-metier.phtml new file mode 100644 index 0000000000000000000000000000000000000000..fc06d3f4451f12ef9ebc5f674f65fedd2699f039 --- /dev/null +++ b/module/Application/src/Application/View/Helper/partial/fiche-metier.phtml @@ -0,0 +1,93 @@ +<?php + +/** + * @var FicheMetier $fiche + */ + +use Application\Entity\Db\FicheMetier; +use Application\Entity\Db\FicheMetierTypeActivite; + +?> + +<?php + $activites = $fiche->getActivites(); + usort($activites, function (FicheMetierTypeActivite $a, FicheMetierTypeActivite $b) { return $a->getPosition() < $b->getPosition();}); +?> + +<h1> + <?php echo $fiche->getMetier()->getLibelle(); ?> +</h1> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2>Missions principales</h2> + </div> + <div class="panel-body"> + <?php echo $fiche->getMissionsPrincipales(); ?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2>Activités</h2> + </div> + <div class="panel-body"> + + <?php foreach($activites as $activite) : ?> + <?php if ($activite->getActivite()->estNonHistorise()) : ?> + <div class="activite"> + <h3> <?php echo $activite->getActivite()->getLibelle(); ?> </h3> + <?php echo $activite->getActivite()->getDescription(); ?> + </div> + <?php endif ;?> + <?php endforeach; ?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2>Parcours de formation de base pour la prise de poste</h2> + </div> + <div class="panel-body"> + <h3> Connaissances </h3> + <?php echo $fiche->getConnaissances(); ?> + <h3>Compétences opérationnelles </h3> + <?php echo $fiche->getCompetencesOperationnelles(); ?> + <h3> Compétences comportementales </h3> + <?php echo $fiche->getCompetencesComportementales(); ?> + </div> + +<?php + $applications = []; + foreach ($fiche->getActivites() as $activite) { + foreach ($activite->getActivite()->getApplications() as $application) { + $applications[] = $application->getLibelle(); + } + } + foreach ($fiche->getApplications() as $application) { + $applications[] = $application->getLibelle(); + } + sort($applications); + $applications = array_unique($applications); +?> + + <div class="row"> + <div class="col-md-6"> + <h3> Applications métiers</h3> + <ul> + <?php foreach ($applications as $application) : ?> + <li> <?php echo $application; ?> </li> + <?php endforeach; ?> + </ul> + </div> + <div class="col-md-6"> + <h3> Plan de formation </h3> + <?php + echo $fiche->getConnaissancesFormation(); + echo $fiche->getCompetencesOperationnellesFormation(); + echo $fiche->getCompetencesComportementalesFormation(); + echo $fiche->getApplicationsFormation(); + ?> + </div> + </div> +</div> diff --git a/module/Application/src/Application/View/Helper/partial/poste.phtml b/module/Application/src/Application/View/Helper/partial/poste.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e9b2579e7be61c3d26d3384c69bc757f7d1ab320 --- /dev/null +++ b/module/Application/src/Application/View/Helper/partial/poste.phtml @@ -0,0 +1,47 @@ +<?php + +/** + * @var Poste $poste + */ + +use Application\Entity\Db\Poste; + +?> + +<?php + $rattachement = (($poste->getRattachementHierarchique())?$poste->getRattachementHierarchique()->getDenomination():"---"); + $domaine = (($poste->getDomaine())?$poste->getDomaine()->getLibelle():"---"); + $fonction = ($poste->getFonction())?:"---"; +?> + +<dl class="dl-horizontal"> + <dt> Numéro poste national </dt> + <dd class="siham"> <?php echo $poste->getNumeroPoste(); ?> </dd> + <dt> Affectation du poste </dt> + <dd class="siham"> + <span class="badge"><?php echo $poste->getStructure()->getType(); ?></span> + <?php echo $poste->getStructure()->getLibelleLong(); ?> + </dd> + <dt> Localisation du poste </dt> + <dd class="siham"> <?php echo $poste->getLocalisation(); ?> </dd> + <dt> Rattachement hiérarchique </dt> + <dd class="siham"> <?php echo $rattachement; ?> </dd> + <dt> Correspondance </dt> + <dd class="siham"> + BAP <?php echo $poste->getCorrespondance()->getCategorie(); ?> - + <?php echo $poste->getCorrespondance()->getLibelleLong(); ?> + </dd> + <dt> Domaine UNICAEN </dt> + <dd class="gpeec"> <?php echo $domaine; ?></dd> + <dt> Fonction </dt> + <dd class="gpeec"> <?php echo $fonction; ?></dd> + + <?php if ($poste->getLien()) : ?> + <dt> Lien externe </dt> + <dd class="gpeec"> + <a href="<?php echo $poste->getLien(); ?>"> + <?php echo $poste->getLien(); ?> + </a> + </dd> + <?php endif; ?> +</dl> \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/partial/specificite.phtml b/module/Application/src/Application/View/Helper/partial/specificite.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d5f6b3d96b69fd83559c7aa2766f302348d7c554 --- /dev/null +++ b/module/Application/src/Application/View/Helper/partial/specificite.phtml @@ -0,0 +1,39 @@ +<?php + +/** + * @var SpecificitePoste $specificite + */ + +use Application\Entity\Db\SpecificitePoste; + +?> + +<?php if ($specificite->getSpecificite()) : ?> + <h3> Spécificité du poste </h3> + <?php echo $specificite->getSpecificite(); ?> +<?php endif; ?> + +<?php if ($specificite->getEncadrement()) : ?> + <h3> Encadrement </h3> + <?php echo $specificite->getEncadrement(); ?> +<?php endif; ?> + +<?php if ($specificite->getRelationsInternes()) : ?> + <h3> Relations internes à l'unicaen </h3> + <?php echo $specificite->getRelationsInternes(); ?> +<?php endif; ?> + +<?php if ($specificite->getRelationsExternes()) : ?> + <h3> Relations externes à l'unicaen </h3> + <?php echo $specificite->getRelationsExternes(); ?> +<?php endif; ?> + +<?php if ($specificite->getContraintes()) : ?> + <h3> Sujétions ou conditions particulières </h3> + <?php echo $specificite->getContraintes(); ?> +<?php endif; ?> + +<?php if ($specificite->getMoyens()) : ?> + <h3> Moyens et outils mis à disposition </h3> + <?php echo $specificite->getMoyens(); ?> +<?php endif; ?> \ No newline at end of file diff --git a/module/Application/view/application/activite/afficher.phtml b/module/Application/view/application/activite/afficher.phtml index 6affa157ca647ee25d2736b77ca4ec9b3909ef3d..beb9dece311873d71d166479d922933f195b0086 100644 --- a/module/Application/view/application/activite/afficher.phtml +++ b/module/Application/view/application/activite/afficher.phtml @@ -18,4 +18,16 @@ use Application\Entity\Db\Activite; <?php echo $activite->getDescription(); ?> </div> +<h3> + Applications métiers associées + <span class="badge"> + <?php echo count($activite->getApplications()); ?> + </span> +</h3> + + <ul> + <?php foreach ($activite->getApplications() as $application) : ?> + <li><?php echo $application->getLibelle(); ?></li> + <?php endforeach; ?> + </ul> </div> \ No newline at end of file diff --git a/module/Application/view/application/activite/index.phtml b/module/Application/view/application/activite/index.phtml index e18eb4b2f27ab0a4a262050f85c943071c9a6fa8..ad71d0fb74ca394f93f2cc3981cae451320bf176 100644 --- a/module/Application/view/application/activite/index.phtml +++ b/module/Application/view/application/activite/index.phtml @@ -7,7 +7,7 @@ use Application\Entity\Db\Activite; use Application\Provider\Privilege\ActivitePrivileges; -$this->headTitle('Index des activités'); +$this->headTitle('Missions principales'); $canVisualiser = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePrivileges::AFFICHER)); $canAjouter = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePrivileges::AJOUTER)); @@ -16,8 +16,8 @@ $canHistoriser = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePri $canEffacer = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePrivileges::EFFACER)); ?> -<h1> - Activité +<h1 class="page-header"> + Missions principales <span class="badge"> <?php echo count($activites); ?> </span> </h1> @@ -26,20 +26,21 @@ $canEffacer = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePri <?php if ($canAjouter) : ?> <a href="<?php echo $this->url('activite/creer', [], [], true); ?>" class="btn btn-primary action ajax-modal" - data-event="modification" - > + data-event="modification"> <span class="icon ajouter"></span> - Ajouter une activité + Ajouter une mission principale </a> <br/><br/> <?php endif; ?> - <table class="table table-condensed"> + <table id="datatable" class="table table-condensed"> <thead> - <th> Activité </th> - <th> Modification </th> - <th> Modificateur </th> - <th> Action </th> + <tr> + <th> Mission </th> + <th> Applications </th> + <th> Modification </th> + <th style="width:10rem;"> Action </th> + </tr> </thead> <tbody> <?php foreach($activites as $activite) : ?> @@ -48,10 +49,19 @@ $canEffacer = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePri <?php echo $activite->getLibelle(); ?> <br/> </td> <td> - <?php echo $activite->getHistoModification()->format('d/m/Y'); ?> + <small> + <ul> + <?php foreach ($activite->getApplications() as $application) : ?> + <li> <?php echo $application->getLibelle(); ?></li> + <?php endforeach; ?> + </ul> + </small> </td> <td> - <?php echo $activite->getHistoModificateur()->getDisplayName(); ?> + <small> + <?php echo $activite->getHistoModification()->format('d/m/Y'); ?> <br/> + <?php echo $activite->getHistoModificateur()->getDisplayName(); ?> + </small> </td> <td> <?php if ($canVisualiser) : ?> @@ -59,6 +69,8 @@ $canEffacer = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePri class="ajax-modal" > <span class="icon voir" title="Voir l'activité"></span></a> + <?php else : ?> + <span class="icon voir" style="color:lightgrey;"></span> <?php endif; ?> <?php if ($canEditer) : ?> <a href="<?php echo $this->url('activite/editer', ['activite' => $activite->getId()], [], true); ?>" @@ -66,6 +78,8 @@ $canEffacer = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePri data-event="modification" > <span class="icon editer" title="Éditer l'activité"></span></a> + <?php else : ?> + <span class="icon editer" style="color:lightgrey;"></span> <?php endif; ?> <?php if($canHistoriser) :?> <?php if($activite->estNonHistorise()): ?> @@ -77,10 +91,18 @@ $canEffacer = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePri > <span class="icon restaurer" title="Restaurer l'activité"></span></a> <?php endif; ?> + <?php else : ?> + <?php if($activite->estNonHistorise()): ?> + <span class="icon historiser" style="color:lightgrey;"></span> + <?php else : ?> + <span class="icon restaurer" style="color:lightgrey;"></span> + <?php endif; ?> <?php endif; ?> <?php if ($canEffacer) : ?> <a href="<?php echo $this->url('activite/detruire', ['activite' => $activite->getId()], [], true); ?>"> <span class="icon detruire" title="Supprimer l'activité"></span></a> + <?php else : ?> + <span class="icon detruire" style="color:lightgrey;"></span> <?php endif; ?> </td> </tr> @@ -90,6 +112,14 @@ $canEffacer = $this->isAllowed(ActivitePrivileges::getResourceId(ActivitePri </div> <script> + $(document).ready(function() { + $('#datatable').DataTable( { + language: { + url: '/localisation/fr_FR.json' + } + }); + } ); + $(function() { $("body").on("modification", function (event) { event.div.modal('hide'); diff --git a/module/Application/view/application/agent-fichier/index.phtml b/module/Application/view/application/agent-fichier/index.phtml index a2a2307a163a6f3b31b3ebddd2f71442588a9b59..a40e7acd885c3e45344754092c41f397373cd90c 100644 --- a/module/Application/view/application/agent-fichier/index.phtml +++ b/module/Application/view/application/agent-fichier/index.phtml @@ -2,9 +2,9 @@ /** * @var \Application\Entity\Db\Agent $agent - * @var \Fichier\Entity\Db\Fichier $cv - * @var \Fichier\Entity\Db\Fichier $motiv - * @var \Fichier\Entity\Db\Fichier $formations + * @var \Fichier\Entity\Db\Fichier[] $cvs + * @var \Fichier\Entity\Db\Fichier[] $motivs + * @var \Fichier\Entity\Db\Fichier[] $formations */ use Fichier\Entity\Db\Nature; @@ -20,24 +20,40 @@ $this->headTitle('Mes fichiers : '.$agent->getDenomination()); <div class="main"> <h2> Curriculum Vitae </h2> - <?php if ($cv !== null) : ?> - <?php echo $this->fichier()->render($cv, $this->url('agent/fichiers', ['agent' => $agent->getId()], ['force_canonical' => true], true)); ?> + <a href='<?php echo $this->url('agent/upload-fichier', ['agent' => $agent->getId(), 'nature' => Nature::CV], [], true); ?>' class="btn btn-primary zajax-modal" data-event="modification"> + <span class="icon televerser"></span> + Téléverser un fichier + </a> + + <?php if (!empty($cvs)) : ?> + <?php foreach($cvs as $cv) : ?> + <?php echo $this->fichier()->render($cv, $this->url('agent/fichiers', ['agent' => $agent->getId()], ['force_canonical' => true], true)); ?> + <?php endforeach; ?> <?php else : ?> - <a href='<?php echo $this->url('agent/upload-fichier', ['agent' => $agent->getId(), 'nature' => Nature::CV], [], true); ?>' class="btn btn-primary zajax-modal" data-event="modification"> - <span class="icon televerser"></span> - Téléverser un fichier - </a> + + <br/><br/> + + Aucun CV. + <?php endif; ?> <h2> Lettre de motivation </h2> - <?php if ($motiv !== null) : ?> - <?php echo $this->fichier()->render($motiv, $this->url('agent/fichiers', ['agent' => $agent->getId()], ['force_canonical' => true], true)); ?> + <a href='<?php echo $this->url('agent/upload-fichier', ['agent' => $agent->getId(), 'nature' => Nature::MOTIV], [], true); ?>' class="btn btn-primary zajax-modal" data-event="modification"> + <span class="icon televerser"></span> + Téléverser un fichier + </a> + + <?php if (!empty($motivs)) : ?> + <?php foreach($motivs as $motiv) : ?> + <?php echo $this->fichier()->render($motiv, $this->url('agent/fichiers', ['agent' => $agent->getId()], ['force_canonical' => true], true)); ?> + <?php endforeach; ?> <?php else : ?> - <a href='<?php echo $this->url('agent/upload-fichier', ['agent' => $agent->getId(), 'nature' => Nature::MOTIV], [], true); ?>' class="btn btn-primary zajax-modal" data-event="modification"> - <span class="icon televerser"></span> - Téléverser un fichier - </a> + + <br/><br/> + + Aucune lettre. + <?php endif; ?> <h2> Justificatif de formation </h2> @@ -47,9 +63,6 @@ $this->headTitle('Mes fichiers : '.$agent->getDenomination()); Téléverser un fichier </a> - - - <?php if (!empty($formations)) : ?> <?php foreach($formations as $formation) : ?> <?php echo $this->fichier()->render($formation, $this->url('agent/fichiers', ['agent' => $agent->getId()], ['force_canonical' => true], true)); ?> diff --git a/module/Application/view/application/agent/afficher.phtml b/module/Application/view/application/agent/afficher.phtml index 849413a1a579619e76f4e2df50eecd1e31aeae0a..831137a95e0c0a2edb222bd45d9d1436c369a5f4 100644 --- a/module/Application/view/application/agent/afficher.phtml +++ b/module/Application/view/application/agent/afficher.phtml @@ -9,4 +9,4 @@ use Application\Entity\Db\Agent; $this->headTitle("Information sur l'agent"); ?> -<?php echo $this->agent()->render($agent); ?> +<?php echo $this->agent($agent); ?> diff --git a/module/Application/view/application/agent/importer.phtml b/module/Application/view/application/agent/importer.phtml deleted file mode 100644 index 6e5a3037d6a9985369f98206f73fb16b975abaac..0000000000000000000000000000000000000000 --- a/module/Application/view/application/agent/importer.phtml +++ /dev/null @@ -1,3 +0,0 @@ -<?php - -echo $this->form($form); diff --git a/module/Application/view/application/agent/index.phtml b/module/Application/view/application/agent/index.phtml index 09a6369883a9c14ab30eee3b7fd2e5e574864772..e7730f12e2e0c38254d10234e4e15063f63c5e4b 100644 --- a/module/Application/view/application/agent/index.phtml +++ b/module/Application/view/application/agent/index.phtml @@ -10,82 +10,60 @@ use Application\Provider\Privilege\AgentPrivileges; $canAfficher = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::AFFICHER)); $canAjouter = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::AJOUTER)); -$canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::EDITER)); -$canEffacer = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::EFFACER)); +$canModifier = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges::EDITER)); ?> - - -<h1> - Index des affectations +<div class="row"> +<div class="col-md-6"> +<h1 class="page-header"> + Agents <span class="badge"> <?php echo count($agents); ?> </span> </h1> - +</div> +<div class="pull-right col-md-5 alert alert-info"> + <span class="icon synchoniser"></span> + Les agents sont synchronisés depuis Octopus. +</div> +</div> <div class="main"> - <?php if($canAjouter) : ?> - <a - class="btn btn-primary action ajax-modal" - href="<?php echo $this->url('agent/ajouter', [], [], true); ?>" - data-event="modification" - > - <i class="fas fa-plus-square"></i> - Ajouter un agent - </a> - - <a - class="btn btn-primary action ajax-modal" - href="<?php echo $this->url('agent/importer', [], [], true); ?>" - data-event="modification" - > - <i class="fas fa-user-cog"></i> - Importer un agent - </a> - <br/> <br/> - <?php endif; ?> - - <?php if (count($agents) > 0) : ?> - <table class="table table-condensed"> + <table id="agents" class="table table-condensed"> <thead> <tr> - <th> Numero de poste </th> +<!-- <th> Id </th>--> + <th> Source Id </th> <th> Dénomination </th> - <th> Corps </th> + <th> BAP </th> + <th> Grade </th> <th class="action"> Action </th> </tr> </thead> <tbody> <?php foreach ($agents as $agent) : ?> <tr> - <td> <?php echo $agent->getNumeroPoste(); ?> </td> - <td> <?php echo $agent->getPrenom(); ?> <?php echo $agent->getNom(); ?></td> - <td> <?php echo $agent->getCorps(); ?></td> +<!-- <td> --><?php //echo $agent->getId(); ?><!-- </td>--> + <td> <span class="badge"><?php echo $agent->getSourceName(); ?> - <?php echo $agent->getSourceId(); ?></span></td> + <td> <?php echo $agent->getDenomination(); ?></td> + <td> <?php echo ($agent->getCorrespondance())?$agent->getCorrespondance():"---"; ?></td> + <td> <?php echo ($agent->getGrade())?$agent->getGrade():"---"; ?></td> <td> <?php if ($canAfficher) : ?> <a href="<?php echo $this->url('agent/afficher', ['id' => $agent->getId()], [], true); ?>" class="ajax-modal" > - <i class="fas fa-eye" title="Afficher l'agent"></i> - </a> + <span class="icon voir" title="Afficher l'agent"></span></a> <?php endif; ?> <?php if ($canModifier) : ?> - <a href="<?php echo $this->url('agent/modifier', ['id' => $agent->getId()], [], true); ?>" + <a href="<?php echo $this->url('agent/modifier', ['agent' => $agent->getId()], [], true); ?>" class="ajax-modal" - data-event="modification" - > - <i class="fas fa-pencil-alt" title="Éditer l'agent"></i> - </a> - <?php endif; ?> - <?php if ($canEffacer) : ?> - <a href="<?php echo $this->url('agent/supprimer', ['id' => $agent->getId()], [], true); ?>" + data-event="modification-noreload" > - <i class="fas fa-trash-alt" title="Supprimer l'agent"></i> - </a> + <span class="icon editer" title="Éditer la fiche d'un agent "></span></a> <?php endif; ?> </td> </tr> @@ -97,11 +75,25 @@ $canEffacer = $this->isAllowed(AgentPrivileges::getResourceId(AgentPrivileges:: </div> <script> + $(document).ready(function() { + $('#agents').DataTable( { + language: { + url: '/localisation/fr_FR.json' + } + } ); + } ); + $(function() { $("body").on("modification", function (event) { event.div.modal('hide'); window.location.reload(); }); }); + $(function() { + $("body").on("modification-noreload", function (event) { + event.div.modal('hide'); + // window.location.reload(); + }); + }); </script> diff --git a/module/Application/view/application/application/afficher.phtml b/module/Application/view/application/application/afficher.phtml index d9218cff5bc66939759452b73210cb6d7f24054d..8e484a69ca6a963781e114cd8b42f9273cb964a5 100644 --- a/module/Application/view/application/application/afficher.phtml +++ b/module/Application/view/application/application/afficher.phtml @@ -22,7 +22,7 @@ use Application\Entity\Db\Application; </dd> <dt> Actif</dt> <dd> - <?if ($application->isActif()) : ?> + <?php if ($application->isActif()) : ?> <span class="badge" style="background-color: darkgreen;"> </span> <?php else: ?> <span class="badge" style="background-color: darkred;"> </span> diff --git a/module/Application/view/application/application/index.phtml b/module/Application/view/application/application/index.phtml index da81dbce910803ee6aef7b6b136786bfe0aafb33..26780c16b93759ae6d330b2f4936607a5de53302 100644 --- a/module/Application/view/application/application/index.phtml +++ b/module/Application/view/application/application/index.phtml @@ -15,8 +15,8 @@ $canEffacer = $this->isAllowed(ApplicationPrivileges::getResourceId(Applicat $this->headTitle("Index des applications"); ?> -<h1> - Index des applications +<h1 class="page-header"> + Applications <span class="badge"> <?php echo count($applications); ?> </span> @@ -34,7 +34,7 @@ $this->headTitle("Index des applications"); <br/><br/> <?php endif; ?> - <table class="table table-condensed"> + <table id="datatable" class="table table-condensed"> <thead> <tr> <th> Libelle</th> @@ -83,6 +83,14 @@ $this->headTitle("Index des applications"); </div> <script> + $(document).ready(function() { + $('#datatable').DataTable( { + language: { + url: '/localisation/fr_FR.json' + } + }); + }); + $(function() { $("body").on("modification", function (event) { event.div.modal('hide'); diff --git a/module/Application/view/application/entretien-professionnel/afficher.phtml b/module/Application/view/application/entretien-professionnel/afficher.phtml index c8e62c14342af260d9d09fdad4d85d926dc6f122..351803ec87a8feb76c39cb8bde641724c63d8f5a 100644 --- a/module/Application/view/application/entretien-professionnel/afficher.phtml +++ b/module/Application/view/application/entretien-professionnel/afficher.phtml @@ -34,8 +34,8 @@ $this->headTitle('Édition de l\'entretien professionnel'); * @var string $retour */ $formulaire = $entretien->getFormulaireInstance()->getFormulaire(); - $retour = $this->url('entretien-professionnel/modifier', ['entretien' => $entretien->getId()], ['force_canonical' => true], true); - $url = $this->url('autoform/formulaire/afficher-resultat', ['formulaire' => $formulaire->getId(), 'instance' => $entretien->getFormulaireInstance()->getId()], ['query' => ['retour' => $retour], 'force_canonical' => true], true); + $retour = $this->url('entretien-professionnel/modifier', ['entretien' => $entretien->getId()], ['force_canonical' => false], true); + $url = $this->url('autoform/formulaire/afficher-resultat', ['formulaire' => $formulaire->getId(), 'instance' => $entretien->getFormulaireInstance()->getId()], ['query' => ['retour' => $retour], 'force_canonical' => false], true); echo "'".$url."'"; ?>; console.log(url); diff --git a/module/Application/view/application/entretien-professionnel/creer.phtml b/module/Application/view/application/entretien-professionnel/creer.phtml new file mode 100644 index 0000000000000000000000000000000000000000..544a3690c642d9807ee23db285d8d63e2bbd3d33 --- /dev/null +++ b/module/Application/view/application/entretien-professionnel/creer.phtml @@ -0,0 +1,19 @@ +<?php + +/** + * @var \Application\Form\EntretienProfessionnel\EntretienProfessionnelForm $form + */ + +?> + +<h1 class="page-header"> + Ajout d'un entretien professionnel +</h1> + +<?php + echo $this->form($form); +?> + +<script> + $('select').selectpicker(); +</script> diff --git a/module/Application/view/application/entretien-professionnel/index-agent.phtml b/module/Application/view/application/entretien-professionnel/index-agent.phtml index 3ec42d2a071d2934011c4e8ffd458d324cb7f539..d7c608e0b83d2256014aa13a618edd349ca88062 100644 --- a/module/Application/view/application/entretien-professionnel/index-agent.phtml +++ b/module/Application/view/application/entretien-professionnel/index-agent.phtml @@ -34,7 +34,7 @@ $canAfficherEntretien = true; <td> <?php echo $entretien->getAnnee(); ?> </td> <td> <?php echo $entretien->getAgent()->getPrenom(); ?> - <?php echo $entretien->getAgent()->getNom(); ?> + <?php echo $entretien->getAgent()->getNomUsuel(); ?> </td> <td> <?php echo $entretien->getResponsable()->getDisplayName(); ?> </td> <td> <?php echo $entretien->getDateEntretien()->format('d/m/Y'); ?> </td> diff --git a/module/Application/view/application/entretien-professionnel/index.phtml b/module/Application/view/application/entretien-professionnel/index.phtml index 898119cba56bed475e72c5661a579e5e33c2944b..4eac0b2ee43733a5e110da434153e8788e50a6ba 100644 --- a/module/Application/view/application/entretien-professionnel/index.phtml +++ b/module/Application/view/application/entretien-professionnel/index.phtml @@ -38,7 +38,7 @@ $this->headTitle('Index des entretiens professionnel'); <td> <?php echo $entretien->getAnnee(); ?> </td> <td> <?php echo $entretien->getAgent()->getPrenom(); ?> - <?php echo $entretien->getAgent()->getNom(); ?> + <?php echo $entretien->getAgent()->getNomUsuel(); ?> </td> <td> <?php echo $entretien->getResponsable()->getDisplayName(); ?> </td> <td> <?php echo $entretien->getDateEntretien()->format('d/m/Y'); ?> </td> diff --git a/module/Application/view/application/entretien-professionnel/modifier.phtml b/module/Application/view/application/entretien-professionnel/modifier.phtml index 325f42885cc8bdbf2ed7417cd4cfc3207c3252bd..a68401cc9c58636ba5094a61da04f29d17ce5898 100644 --- a/module/Application/view/application/entretien-professionnel/modifier.phtml +++ b/module/Application/view/application/entretien-professionnel/modifier.phtml @@ -12,7 +12,7 @@ $this->headTitle('Édition de l\'entretien professionnel'); <h1 class="page-header"> Entretien professionnel <?php echo $entretien->getAnnee(); ?> <br/> <?php echo $entretien->getAgent()->getPrenom(); ?> - <?php echo $entretien->getAgent()->getNom(); ?> + <?php echo $entretien->getAgent()->getNomUsuel(); ?> </h1> <div class="main"> @@ -30,7 +30,7 @@ $this->headTitle('Édition de l\'entretien professionnel'); <dt> Agent</dt> <dd> <?php echo $entretien->getAgent()->getPrenom(); ?> - <?php echo $entretien->getAgent()->getNom(); ?> + <?php echo $entretien->getAgent()->getNomUsuel(); ?> </dd> <dt> Responsable</dt> <dd> <?php echo $entretien->getResponsable()->getDisplayName(); ?> </dd> @@ -63,8 +63,8 @@ $this->headTitle('Édition de l\'entretien professionnel'); * @var string $retour */ $formulaire = $entretien->getFormulaireInstance()->getFormulaire(); - $retour = $this->url('entretien-professionnel/modifier', ['entretien' => $entretien->getId()], ['force_canonical' => true], true); - $url = $this->url('autoform/formulaire/afficher-formulaire', ['formulaire' => $formulaire->getId(), 'instance' => $entretien->getFormulaireInstance()->getId()], ['query' => ['retour' => $retour], 'force_canonical' => true], true); + $retour = $this->url('entretien-professionnel/modifier', ['entretien' => $entretien->getId()], ['force_canonical' => false], true); + $url = $this->url('autoform/formulaire/afficher-formulaire', ['formulaire' => $formulaire->getId(), 'instance' => $entretien->getFormulaireInstance()->getId()], ['query' => ['retour' => $retour], 'force_canonical' => false], true); echo "'".$url."'"; ?>; console.log(url); diff --git a/module/Application/view/application/fiche-metier-type/afficher.phtml b/module/Application/view/application/fiche-metier-type/afficher.phtml deleted file mode 100644 index 48c5019647ec200a446aaab1e5200122f34ed437..0000000000000000000000000000000000000000 --- a/module/Application/view/application/fiche-metier-type/afficher.phtml +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * @var \Application\Entity\Db\FicheMetierType $fiche - */ - -?> - - -<?php - echo $this->ficheMetierType()->render($fiche); -?> - diff --git a/module/Application/view/application/fiche-metier-type/editer.phtml b/module/Application/view/application/fiche-metier-type/editer.phtml deleted file mode 100644 index 4da3e593ced2c48d049c2da6c03e592aa3266d4e..0000000000000000000000000000000000000000 --- a/module/Application/view/application/fiche-metier-type/editer.phtml +++ /dev/null @@ -1,224 +0,0 @@ -<?php - -use Application\Entity\Db\Application; -use Application\Entity\Db\FicheMetierType; -use Application\Entity\Db\FicheMetierTypeActivite; - -/** - * @var FicheMetierType $fiche - * @var FicheMetierTypeActivite[] $activites - */ - - -$this->headTitle("Affichage de la fiche métier : ".$fiche->getId()); - -$canEditer = true; - - -?> - -<div class="row"> - <div class="col-md-8"> - <h1 class="page-header"> - Fiche métier #<?php echo $fiche->getId(); ?> <br/> - <em><?php echo $fiche->getMetier()->getLibelle(); ?></em> - </h1> - </div> - <div class="col-md-4"> - <?php if ($canEditer) : ?> - <br/> - <br/> - <br/> - <a class="btn btn-primary action ajax-modal pull-right" - data-event="modification" - href="<?php echo $this->url('fiche-metier-type/editer-libelle', ['id' => $fiche->getId()], [] , true); ?>"> - <span class="icon editer"></span> - Éditer libellé - </a> - <?php endif; ?> - </div> -</div> - -<div class="panel panel-info"> - <div class="panel-heading"> - <div class="row"> - <div class="col-md-6"> - <h2> Missions principales </h2> - </div> - <div class="col-md-6"> - <?php if ($canEditer) : ?> - <a class="btn btn-primary action ajax-modal pull-right" - href="<?php echo $this->url('fiche-metier-type/editer-missions-principales', ['id' => $fiche->getId()], [] , true); ?>" - data-event="modification" - > - <span class="icon editer"></span> - Éditer missions principales - </a> - <?php endif; ?> - </div> - </div> - </div> - <div class="panel-body"> - <?php echo $fiche->getMissionsPrincipales(); ?> - </div> -</div> - -<div class="panel panel-info"> - <div class="panel-heading"> - <div class="row"> - <div class="col-md-5"> - <h2> - Activités associées - <span class="badge"> <?php echo count($activites); ?> </span> - </h2> - </div> - <div class="col-md-7"> - <?php if ($canEditer) : ?> - <a class="btn btn-primary action ajax-modal pull-right" - href="<?php echo $this->url('fiche-metier-type/ajouter-nouvelle-activite', ['id' => $fiche->getId()], [] , true); ?>" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter une nouvelle activité - </a> - <a class="btn btn-primary action ajax-modal pull-right" - data-event="modification" - href="<?php echo $this->url('fiche-metier-type/ajouter-activite-existante', ['id' => $fiche->getId()], [] , true); ?>"> - <span class="icon selectionner"></span> - Ajouter une activité existante - </a> - <br/> - <?php endif; ?> - </div> - </div> - </div> - <div class="panel-body"> - <?php foreach ($activites as $ficheActivite): ?> - <h3> <?php echo $ficheActivite->getActivite()->getLibelle(); ?> </h3> - <div class="row"> - <div class="col-md-1"> - <a class="btn btn-default mini ajax-modal" - title="Éditer l'activité" - data-event="modification" - href="<?php echo $this->url('activite/editer', ['activite' => $ficheActivite->getActivite()->getId()], [], true); ?>"> - <span class="icon editer"></span> - </a> - <a class="btn btn-default mini" - title="Retirer l'activité" - href="<?php echo $this->url('fiche-metier-type/retirer-activite', ['id' => $ficheActivite->getId()], [], true); ?>" - > - <span class="icon detruire"></span> - </a> - <a class="btn btn-default mini" - title="Déplacer l'activité vers le haut" - href="<?php echo $this->url('fiche-metier-type/deplacer-activite', ['id' => $ficheActivite->getId(), 'direction' => 'up'], [], true); ?>" - > - <span class="icon monter"></span> - </a> - <a class="btn btn-default mini" - title="Déplacer l'activité vers le bas" - href="<?php echo $this->url('fiche-metier-type/deplacer-activite', ['id' => $ficheActivite->getId(), 'direction' => 'down'], [], true); ?>"> - <span class="icon descendre"></span> - </a> - </div> - <div class="col-md-11"> <?php echo $ficheActivite->getActivite()->getDescription(); ?> </div> - </div> - <?php endforeach;?> - </div> -</div> - -<div class="panel panel-info"> - <div class="panel-heading"> - <h2> Parcours de formation de base pour la prise de poste </h2> - </div> - <div class="panel-body"> - <div class="row"> - <div class="col-md-1"> - <a class="btn btn-default mini ajax-modal" - data-event="modification" - href="<?php echo $this->url('fiche-metier-type/modifier-connaissances', ['id' => $fiche->getId()], [], true); ?>" - > - <span class="icon editer"></span> - </a> - </div> - <div class="col-md-5"> - <h3> Connaissances </h3> - <?php echo $fiche->getConnaissances(); ?> - </div> - <div class="col-md-5"> - <h3> Plan de formation </h3> - <?php echo $fiche->getConnaissancesFormation(); ?> - </div> - </div> - <div class="row"> - <div class="col-md-1"> - <a class="btn btn-default mini ajax-modal" - data-event="modification" - href="<?php echo $this->url('fiche-metier-type/modifier-operationnelle', ['id' => $fiche->getId()], [], true); ?>" - > - <span class="icon editer"></span> - </a> - </div> - <div class="col-md-5"> - <h3> Compétences opérationnelles </h3> - <?php echo $fiche->getCompetencesOperationnelles(); ?> - </div> - <div class="col-md-5"> - <h3> Plan de formation </h3> - <?php echo $fiche->getCompetencesOperationnellesFormation(); ?> - </div> - </div> - <div class="row"> - <div class="col-md-1"> - <a class="btn btn-default mini ajax-modal" - data-event="modification" - href="<?php echo $this->url('fiche-metier-type/modifier-comportementale', ['id' => $fiche->getId()], [], true); ?>" - > - <span class="icon editer"></span> - </a> - </div> - <div class="col-md-5"> - <h3> Compétences comportementales </h3> - <?php echo $fiche->getCompetencesComportementales(); ?> - </div> - <div class="col-md-5"> - <h3> Plan de formation </h3> - <?php echo $fiche->getCompetencesComportementalesFormation(); ?> - </div> - </div> - <div class="row"> - <div class="col-md-1"> - <a class="btn btn-default mini ajax-modal" - data-event="modification" - href="<?php echo $this->url('fiche-metier-type/modifier-application', ['id' => $fiche->getId()], [], true); ?>" - > - <span class="icon editer"></span> - </a> - </div> - <div class="col-md-5"> - <h3> Applications </h3> - <ul> - <?php /** @var Application $application */ ?> - <?php foreach($fiche->getApplications() as $application) : ?> - <li> <?php echo $application->getLibelle(); ?> </li> - <?php endforeach; ?> - </ul> - </div> - <div class="col-md-5"> - <h3> Plan de formation </h3> - <?php echo $fiche->getApplicationsFormation(); ?> - </div> - </div> - </div> -</div> - - -<script> - $(function() { - $("body").on("modification", function (event) { - event.div.modal('hide'); - window.location.reload(); - }); - }); - -</script> diff --git a/module/Application/view/application/fiche-metier-type/index.phtml b/module/Application/view/application/fiche-metier-type/index.phtml deleted file mode 100644 index f25cae7172d4710eeff0644478486dfeebabae8f..0000000000000000000000000000000000000000 --- a/module/Application/view/application/fiche-metier-type/index.phtml +++ /dev/null @@ -1,94 +0,0 @@ -<?php - -use Application\Entity\Db\FicheMetierType; - -/** - * @var FicheMetierType[] $fiches - */ - -$this->headTitle('Index des fiches métiers'); - -$canAjouter = true; -$canEditer = true; -$canVoir = true; -$canHistoriser = true; -$canDetruire = true; -?> - -<h1 class="page-header"> - Index des fiches métiers - <span class="badge"><?php echo count($fiches); ?></span> -</h1> - - -<div class="main"> - - <?php if ($canAjouter) : ?> - <a href="<?php echo $this->url('fiche-metier-type/ajouter', [], [], true); ?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter une fiche métier - </a> - <br/> <br/> - <?php endif; ?> - - <table class="table table-condensed"> - <thead> - <tr> - <th> Libellé </th> - <th> Action </th> - </tr> - </thead> - <tbody> - <?php foreach($fiches as $fiche): ?> - <tr> - <td> <?php echo $fiche->getMetier()->getLibelle(); ?> </td> - <td> - <?php if ($canVoir) : ?> - <a href="<?php echo $this->url('fiche-metier-type/afficher', ['id' => $fiche->getId()], [], true); ?>" - title="Afficher la fiche métier" - class="ajax-modal" - > - <span class="icon voir"></span></a> - <?php endif; ?> - <?php if ($canEditer) : ?> - <a href="<?php echo $this->url('fiche-metier-type/editer', ['id' => $fiche->getId()], [], true); ?>" - title="Éditer la fiche metier"> - <span class="icon editer"></span></a> - <?php endif; ?> - <?php if ($canHistoriser) : ?> - <?php if($fiche->estNonHistorise()) :?> - <a href="<?php echo $this->url('fiche-metier-type/historiser', ['id' => $fiche->getId()], [], true); ?>" - title="Historiser la fiche metier"> - <span class="icon historiser"></span></a> - <?php else: ?> - <a href="<?php echo $this->url('fiche-metier-type/restaurer', ['id' => $fiche->getId()], [], true); ?>" - title="Restaurer la fiche metier"> - <span class="icon restaurer"></span></a> - <?php endif; ?> - <?php endif; ?> - <?php if ($canDetruire) : ?> - <a href="<?php echo $this->url('fiche-metier-type/detruire', ['id' => $fiche->getId()], [], true); ?>" - title="Détruire la fiche metier"> - <span class="icon detruire"></span></a> - <?php endif; ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> -</table> - -</div> - - -<script> - $(function() { - $("body").on("modification", function (event) { - event.div.modal('hide'); - window.location.reload(); - }); - }); - -</script> \ No newline at end of file diff --git a/module/Application/view/application/fiche-metier/afficher.phtml b/module/Application/view/application/fiche-metier/afficher.phtml new file mode 100644 index 0000000000000000000000000000000000000000..dc8a058da38a61d79bc3a9c0e85391288613dd52 --- /dev/null +++ b/module/Application/view/application/fiche-metier/afficher.phtml @@ -0,0 +1,15 @@ +<?php + +/** + * @var FicheMetier $fiche + */ + +use Application\Entity\Db\FicheMetier; + +?> + + +<?php + echo $this->ficheMetier($fiche); +?> + diff --git a/module/Application/view/application/fiche-metier-type/ajouter-activite-existante.phtml b/module/Application/view/application/fiche-metier/ajouter-activite-existante.phtml similarity index 100% rename from module/Application/view/application/fiche-metier-type/ajouter-activite-existante.phtml rename to module/Application/view/application/fiche-metier/ajouter-activite-existante.phtml diff --git a/module/Application/view/application/fiche-metier-type/ajouter.phtml b/module/Application/view/application/fiche-metier/ajouter.phtml similarity index 93% rename from module/Application/view/application/fiche-metier-type/ajouter.phtml rename to module/Application/view/application/fiche-metier/ajouter.phtml index 80de9f92898cd2c614cb79c040a99f24d4b83e75..5cc1b82da98e95e9af6ff6c3a6648a56b6536297 100644 --- a/module/Application/view/application/fiche-metier-type/ajouter.phtml +++ b/module/Application/view/application/fiche-metier/ajouter.phtml @@ -1,7 +1,7 @@ <?php /** - * @var Application\Entity\Db\MetierFamille[] $familles + * @var Application\Entity\Db\FamilleProfessionnelle[] $familles * @var Application\Entity\Db\Metier $metier */ diff --git a/module/Application/view/application/fiche-metier/editer.phtml b/module/Application/view/application/fiche-metier/editer.phtml index 947db1be1ffbd24fadbc70f4c464b7c0842899c0..33a4aa09b880244ddf65ba85c9d3486cbac2447b 100644 --- a/module/Application/view/application/fiche-metier/editer.phtml +++ b/module/Application/view/application/fiche-metier/editer.phtml @@ -1 +1,224 @@ -editer \ No newline at end of file +<?php + +use Application\Entity\Db\Application; +use Application\Entity\Db\FicheMetier; +use Application\Entity\Db\FicheMetierTypeActivite; + +/** + * @var FicheMetier $fiche + * @var FicheMetierTypeActivite[] $activites + */ + + +$this->headTitle("Affichage de la fiche métier : ".$fiche->getId()); + +$canEditer = true; + + +?> + +<div class="row"> + <div class="col-md-8"> + <h1 class="page-header"> + Fiche métier #<?php echo $fiche->getId(); ?> <br/> + <em><?php echo $fiche->getMetier()->getLibelle(); ?></em> + </h1> + </div> + <div class="col-md-4"> + <?php if ($canEditer) : ?> + <br/> + <br/> + <br/> + <a class="btn btn-primary action ajax-modal pull-right" + data-event="modification" + href="<?php echo $this->url('fiche-metier-type/editer-libelle', ['id' => $fiche->getId()], [] , true); ?>"> + <span class="icon editer"></span> + Éditer libellé + </a> + <?php endif; ?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <div class="row"> + <div class="col-md-6"> + <h2> Missions principales </h2> + </div> + <div class="col-md-6"> + <?php if ($canEditer) : ?> + <a class="btn btn-primary action ajax-modal pull-right" + href="<?php echo $this->url('fiche-metier-type/editer-missions-principales', ['id' => $fiche->getId()], [] , true); ?>" + data-event="modification" + > + <span class="icon editer"></span> + Éditer missions principales + </a> + <?php endif; ?> + </div> + </div> + </div> + <div class="panel-body"> + <?php echo $fiche->getMissionsPrincipales(); ?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <div class="row"> + <div class="col-md-5"> + <h2> + Activités associées + <span class="badge"> <?php echo count($activites); ?> </span> + </h2> + </div> + <div class="col-md-7"> + <?php if ($canEditer) : ?> + <a class="btn btn-primary action ajax-modal pull-right" + href="<?php echo $this->url('fiche-metier-type/ajouter-nouvelle-activite', ['id' => $fiche->getId()], [] , true); ?>" + data-event="modification" + > + <span class="icon ajouter"></span> + Ajouter une nouvelle activité + </a> + <a class="btn btn-primary action ajax-modal pull-right" + data-event="modification" + href="<?php echo $this->url('fiche-metier-type/ajouter-activite-existante', ['id' => $fiche->getId()], [] , true); ?>"> + <span class="icon selectionner"></span> + Ajouter une activité existante + </a> + <br/> + <?php endif; ?> + </div> + </div> + </div> + <div class="panel-body"> + <?php foreach ($activites as $ficheActivite): ?> + <h3> <?php echo $ficheActivite->getActivite()->getLibelle(); ?> </h3> + <div class="row"> + <div class="col-md-1"> + <a class="btn btn-default mini ajax-modal" + title="Éditer l'activité" + data-event="modification" + href="<?php echo $this->url('activite/editer', ['activite' => $ficheActivite->getActivite()->getId()], [], true); ?>"> + <span class="icon editer"></span> + </a> + <a class="btn btn-default mini" + title="Retirer l'activité" + href="<?php echo $this->url('fiche-metier-type/retirer-activite', ['id' => $ficheActivite->getId()], [], true); ?>" + > + <span class="icon detruire"></span> + </a> + <a class="btn btn-default mini" + title="Déplacer l'activité vers le haut" + href="<?php echo $this->url('fiche-metier-type/deplacer-activite', ['id' => $ficheActivite->getId(), 'direction' => 'up'], [], true); ?>" + > + <span class="icon monter"></span> + </a> + <a class="btn btn-default mini" + title="Déplacer l'activité vers le bas" + href="<?php echo $this->url('fiche-metier-type/deplacer-activite', ['id' => $ficheActivite->getId(), 'direction' => 'down'], [], true); ?>"> + <span class="icon descendre"></span> + </a> + </div> + <div class="col-md-11"> <?php echo $ficheActivite->getActivite()->getDescription(); ?> </div> + </div> + <?php endforeach;?> + </div> +</div> + +<div class="panel panel-info"> + <div class="panel-heading"> + <h2> Parcours de formation de base pour la prise de poste </h2> + </div> + <div class="panel-body"> + <div class="row"> + <div class="col-md-1"> + <a class="btn btn-default mini ajax-modal" + data-event="modification" + href="<?php echo $this->url('fiche-metier-type/modifier-connaissances', ['id' => $fiche->getId()], [], true); ?>" + > + <span class="icon editer"></span> + </a> + </div> + <div class="col-md-5"> + <h3> Connaissances </h3> + <?php echo $fiche->getConnaissances(); ?> + </div> + <div class="col-md-5"> + <h3> Plan de formation </h3> + <?php echo $fiche->getConnaissancesFormation(); ?> + </div> + </div> + <div class="row"> + <div class="col-md-1"> + <a class="btn btn-default mini ajax-modal" + data-event="modification" + href="<?php echo $this->url('fiche-metier-type/modifier-operationnelle', ['id' => $fiche->getId()], [], true); ?>" + > + <span class="icon editer"></span> + </a> + </div> + <div class="col-md-5"> + <h3> Compétences opérationnelles </h3> + <?php echo $fiche->getCompetencesOperationnelles(); ?> + </div> + <div class="col-md-5"> + <h3> Plan de formation </h3> + <?php echo $fiche->getCompetencesOperationnellesFormation(); ?> + </div> + </div> + <div class="row"> + <div class="col-md-1"> + <a class="btn btn-default mini ajax-modal" + data-event="modification" + href="<?php echo $this->url('fiche-metier-type/modifier-comportementale', ['id' => $fiche->getId()], [], true); ?>" + > + <span class="icon editer"></span> + </a> + </div> + <div class="col-md-5"> + <h3> Compétences comportementales </h3> + <?php echo $fiche->getCompetencesComportementales(); ?> + </div> + <div class="col-md-5"> + <h3> Plan de formation </h3> + <?php echo $fiche->getCompetencesComportementalesFormation(); ?> + </div> + </div> + <div class="row"> + <div class="col-md-1"> + <a class="btn btn-default mini ajax-modal" + data-event="modification" + href="<?php echo $this->url('fiche-metier-type/modifier-application', ['id' => $fiche->getId()], [], true); ?>" + > + <span class="icon editer"></span> + </a> + </div> + <div class="col-md-5"> + <h3> Applications métiers</h3> + <ul> + <?php /** @var Application $application */ ?> + <?php foreach($fiche->getApplications() as $application) : ?> + <li> <?php echo $application->getLibelle(); ?> </li> + <?php endforeach; ?> + </ul> + </div> + <div class="col-md-5"> + <h3> Plan de formation </h3> + <?php echo $fiche->getApplicationsFormation(); ?> + </div> + </div> + </div> +</div> + + +<script> + $(function() { + $("body").on("modification", function (event) { + event.div.modal('hide'); + window.location.reload(); + }); + }); + +</script> diff --git a/module/Application/view/application/fiche-metier/index.phtml b/module/Application/view/application/fiche-metier/index.phtml index f56895df8afd647f473f0e5b2af1c6ae6729eb75..acf6839ef92c9757e37eb8c32c9c593bfa009e05 100644 --- a/module/Application/view/application/fiche-metier/index.phtml +++ b/module/Application/view/application/fiche-metier/index.phtml @@ -1,76 +1,112 @@ <?php +use Application\Entity\Db\FicheMetierType; +use Application\Provider\Privilege\FicheMetierPrivileges; + /** - * @var FichePoste[] $fichesMetiers + * @var FicheMetierType[] $fiches */ -use Application\Entity\Db\FichePoste; -use Application\Provider\Privilege\FicheMetierPrivileges; - -$this->headTitle("Index des fiches métiers"); +$this->headTitle('Index des fiches métiers'); -$canAjouter = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::AJOUTER)); -$canVoir = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::AFFICHER)); -$canHistoriser = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::HISTORISER)); +$canAjouter = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::AJOUTER)); +$canVoir = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::AFFICHER)); +$canHistoriser = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::HISTORISER)); +$canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::EDITER)); +$canDetruire = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPrivileges::EDITER)); ?> <h1 class="page-header"> - Index des fiches métiers - <span class="badge"><?php echo count($fichesMetiers); ?></span> + Fiches métiers + <span class="badge"><?php echo count($fiches); ?></span> </h1> <div class="main"> - <?php if($canAjouter) : ?> - <a href="<?php echo $this->url('fiche-metier/creer', [], [], true); ?>" - class="btn btn-primary action" + <?php if ($canAjouter) : ?> + <a href="<?php echo $this->url('fiche-metier-type/ajouter', [], [], true); ?>" + class="btn btn-primary action ajax-modal" + data-event="modification" > - <i class="fas fa-plus-square"></i> + <span class="icon ajouter"></span> Ajouter une fiche métier </a> <br/> <br/> <?php endif; ?> - -<table class="table table-condensed"> + <table id="datatable" class="table table-condensed"> <thead> - <tr> - <th> Id </th> - <th> Libellé </th> - <th> Dernière modification </th> - <th> Action </th> - </tr> + <tr> + <th> Libellé </th> + <th> Fonction </th> + <th> Domaine </th> + <th> Action </th> + </tr> </thead> <tbody> - <?php foreach($fichesMetiers as $ficheMetier) : ?> - <tr> - <td> <?php echo $ficheMetier->getId(); ?></td> - <td> <?php echo $ficheMetier->getLibelle(); ?></td> - <td> <?php echo $ficheMetier->getHistoModification()->format('H:i:s d/m/Y'); ?></td> - <td> - <?php if ($canVoir) : ?> - <a href="<?php echo $this->url('fiche-metier/afficher', ['id' => $ficheMetier->getId()], [], true); ?>" - title="Afficher la fiche metier"> - <i class='fas fa-eye' title='Afficher la fiche'></i> - </a> - <?php endif; ?> - <?php if ($canHistoriser) : ?> - <?php if ($ficheMetier->getHistoDestruction() === null) : ?> - <a href="<?php echo $this->url('fiche-metier/historiser', ['id' => $ficheMetier->getId()], [], true); ?>" - title="Historiser la fiche metier"> - <i class='fas fa-trash-alt' title='Historiser la fiche'></i> - </a> - <?php else : ?> - <a href="<?php echo $this->url('fiche-metier/restaurer', ['id' => $ficheMetier->getId()], [], true); ?>" - title="Restaurer la fiche metier"> - <span class="glyphicon glyphicon-leaf"></span> - </a> + <?php foreach($fiches as $fiche): ?> + <tr> + <td> <?php echo $fiche->getMetier()->getLibelle(); ?> </td> + <td> <?php echo $fiche->getMetier()->getFonction(); ?> </td> + <td> <?php echo $fiche->getMetier()->getDomaine(); ?> </td> + <td> + <?php if ($canVoir) : ?> + <a href="<?php echo $this->url('fiche-metier-type/afficher', ['id' => $fiche->getId()], [], true); ?>" + title="Afficher la fiche métier" + class="ajax-modal" + > + <span class="icon voir"></span></a> + <?php endif; ?> + <?php if ($canVoir) : ?> + <a href="<?php echo $this->url('fiche-metier-type/export', ['id' => $fiche->getId()], [], true); ?>" + title="Exporter en PDF la fiche métier" + > + <span class="icon pdf"></span></a> + <?php endif; ?> + <?php if ($canEditer) : ?> + <a href="<?php echo $this->url('fiche-metier-type/editer', ['id' => $fiche->getId()], [], true); ?>" + title="Éditer la fiche metier"> + <span class="icon editer"></span></a> <?php endif; ?> - <?php endif; ?> - </td> - </tr> + <?php if ($canHistoriser) : ?> + <?php if($fiche->estNonHistorise()) :?> + <a href="<?php echo $this->url('fiche-metier-type/historiser', ['id' => $fiche->getId()], [], true); ?>" + title="Historiser la fiche metier"> + <span class="icon historiser"></span></a> + <?php else: ?> + <a href="<?php echo $this->url('fiche-metier-type/restaurer', ['id' => $fiche->getId()], [], true); ?>" + title="Restaurer la fiche metier"> + <span class="icon restaurer"></span></a> + <?php endif; ?> + <?php endif; ?> + <?php if ($canDetruire) : ?> + <a href="<?php echo $this->url('fiche-metier-type/detruire', ['id' => $fiche->getId()], [], true); ?>" + title="Détruire la fiche metier"> + <span class="icon detruire"></span></a> + <?php endif; ?> + </td> + </tr> <?php endforeach; ?> </tbody> </table> -</div> \ No newline at end of file + +</div> + + +<script> + $(document).ready(function() { + $('#datatable').DataTable( { + language: { + url: '/localisation/fr_FR.json' + } + } ); + } ); + + $(function() { + $("body").on("modification", function (event) { + event.div.modal('hide'); + window.location.href = 'fiche-metier-type/editer'; + }); + }); +</script> \ No newline at end of file diff --git a/module/Application/view/application/fiche-metier-type/modifier-application.phtml b/module/Application/view/application/fiche-metier/modifier-application.phtml similarity index 100% rename from module/Application/view/application/fiche-metier-type/modifier-application.phtml rename to module/Application/view/application/fiche-metier/modifier-application.phtml diff --git a/module/Application/view/application/fiche-metier-type/modifier-comportementale.phtml b/module/Application/view/application/fiche-metier/modifier-comportementale.phtml similarity index 100% rename from module/Application/view/application/fiche-metier-type/modifier-comportementale.phtml rename to module/Application/view/application/fiche-metier/modifier-comportementale.phtml diff --git a/module/Application/view/application/fiche-metier-type/modifier-connaissances.phtml b/module/Application/view/application/fiche-metier/modifier-connaissances.phtml similarity index 100% rename from module/Application/view/application/fiche-metier-type/modifier-connaissances.phtml rename to module/Application/view/application/fiche-metier/modifier-connaissances.phtml diff --git a/module/Application/view/application/fiche-metier-type/modifier-operationnelle.phtml b/module/Application/view/application/fiche-metier/modifier-operationnelle.phtml similarity index 100% rename from module/Application/view/application/fiche-metier-type/modifier-operationnelle.phtml rename to module/Application/view/application/fiche-metier/modifier-operationnelle.phtml diff --git a/module/Application/view/application/fiche-poste/afficher.phtml b/module/Application/view/application/fiche-poste/afficher.phtml index 127022da918e10d23cf597c647f49b65d9557048..4a29adbc8d525b64296e34ee296ede421481a141 100644 --- a/module/Application/view/application/fiche-poste/afficher.phtml +++ b/module/Application/view/application/fiche-poste/afficher.phtml @@ -27,7 +27,7 @@ $canAssocierMetierType = true; Aucun agent d'associé à ce poste </div> <?php else : ?> - <?php echo $this->agent()->render($agent); ?> + <?php echo $this->agent($agent); ?> <?php endif; ?> </div> </div> @@ -61,7 +61,7 @@ $canAssocierMetierType = true; Aucun poste n'est attaché à ce poste </div> <?php else: ?> - <?php echo $this->poste()->render($fiche->getPoste()); ?> + <?php echo $this->poste($fiche->getPoste()); ?> <?php endif; ?> </div> </div> @@ -73,7 +73,7 @@ $canAssocierMetierType = true; $fichesMetiers = $fiche->getFichesMetiers(); $fichesMetiers = array_filter($fichesMetiers, function (FicheTypeExterne $a) { return !$a->getPrincipale(); }); - usort($fiche->getFichesMetiers(), function (FicheTypeExterne $a, FicheTypeExterne $b) { return ($a->getQuotite() > $b->getQuotite()); }); + usort($fichesMetiers, function (FicheTypeExterne $a, FicheTypeExterne $b) { return ($a->getQuotite() > $b->getQuotite()); }); ?> @@ -95,9 +95,9 @@ $canAssocierMetierType = true; </div> </div> -<?php if ($principal) echo $this->ficheTypeExterne()->render($principal, false); ?> +<?php if ($principal) echo $this->ficheMetierExterne($principal, false); ?> <?php foreach ($fichesMetiers as $ficheType) : ?> - <?php echo $this->ficheTypeExterne()->render($ficheType, false); ?> + <?php echo $this->ficheMetierExterne($ficheType, false); ?> <?php endforeach; ?> @@ -113,7 +113,7 @@ $canAssocierMetierType = true; Aucune spécificité attachée à ce poste. </div> <?php else: ?> - <?php echo $this->specificitePoste()->render($fiche->getSpecificite()); ?> + <?php echo $this->specificitePoste($fiche->getSpecificite()); ?> <?php endif; ?> </div> </div> \ No newline at end of file diff --git a/module/Application/view/application/fiche-poste/editer.phtml b/module/Application/view/application/fiche-poste/editer.phtml index ea3c0b7fe7e32fde2f8aa1435b799a2784a3801d..568ffe4615b640bc417dae6301272ef22e86f7c7 100644 --- a/module/Application/view/application/fiche-poste/editer.phtml +++ b/module/Application/view/application/fiche-poste/editer.phtml @@ -34,7 +34,7 @@ $canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPr </div> <div class="col-md-6"> <?php if($canAssocierAgent) : ?> - <a href="<?php echo $this->url('fiche-poste/associer-agent',['fiche' => $fiche->getId()], [], true); ?>" + <a href="<?php echo $this->url('fiche-poste/associer-agent',['fiche-poste' => $fiche->getId()], [], true); ?>" class="btn btn-primary action ajax-modal pull-right" data-event="modification" > @@ -57,7 +57,7 @@ $canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPr Aucun agent d'associé à ce poste </div> <?php else : ?> - <?php echo $this->agent()->render($agent); ?> + <?php echo $this->agent($agent); ?> <?php endif; ?> </div> </div> @@ -106,7 +106,7 @@ $canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPr Aucun poste n'est attaché à ce poste </div> <?php else: ?> - <?php echo $this->poste()->render($fiche->getPoste()); ?> + <?php echo $this->poste($fiche->getPoste()); ?> <?php endif; ?> </div> </div> @@ -127,7 +127,7 @@ usort($fichesMetiers, function (FicheTypeExterne $a, FicheTypeExterne $b) { retu <div class="panel-heading"> <div class="row"> <div class="col-md-8"> - <h2>Fiche composée de <?php echo count($fichesMetiers); ?> fiche(s) type(s).</h2> + <h2>Fiche composée de <?php echo count($fiche->getFichesMetiers()); ?> fiche(s) type(s).</h2> <ul> <?php if ($principal) : ?> <li> <strong> <?php echo $principal->getFicheType()->getMetier() ?> à <?php echo $principal->getQuotite(); ?>%</strong></li> @@ -150,9 +150,9 @@ usort($fichesMetiers, function (FicheTypeExterne $a, FicheTypeExterne $b) { retu </div> </div> -<?php if ($principal) echo $this->ficheTypeExterne()->render($principal); ?> +<?php if ($principal) echo $this->ficheMetierExterne($principal, true); ?> <?php foreach ($fichesMetiers as $ficheType) : ?> - <?php echo $this->ficheTypeExterne()->render($ficheType); ?> + <?php echo $this->ficheMetierExterne($ficheType, true); ?> <?php endforeach; ?> <!-- SPECIFICITE DU POSTE ---------------------------------------------------------------------------------------------> @@ -182,7 +182,7 @@ usort($fichesMetiers, function (FicheTypeExterne $a, FicheTypeExterne $b) { retu Aucune spécificité attachée à ce poste. </div> <?php else: ?> - <?php echo $this->specificitePoste()->render($fiche->getSpecificite()); ?> + <?php echo $this->specificitePoste($fiche->getSpecificite()); ?> <?php endif; ?> </div> </div> diff --git a/module/Application/view/application/fiche-poste/index.phtml b/module/Application/view/application/fiche-poste/index.phtml index 9e62502b4320cb51b8f3a65c86b57675ea7c4bfe..8980ef4e5d6ad581908b7caec2feebcb96b44da6 100644 --- a/module/Application/view/application/fiche-poste/index.phtml +++ b/module/Application/view/application/fiche-poste/index.phtml @@ -1,6 +1,7 @@ <?php use Application\Entity\Db\FichePoste; +use Application\Provider\Privilege\FichePostePrivileges; /** * @var FichePoste[] $fiches @@ -8,15 +9,15 @@ use Application\Entity\Db\FichePoste; $this->headTitle('Index des fiches de postes'); -$canAjouter = true; -$canVoir = true; -$canHistoriser = true; -$canEditer = true; -$canDetruire = true; +$canAjouter = $this->isAllowed(FichePostePrivileges::getResourceId(FichePostePrivileges::AJOUTER)); +$canVoir = $this->isAllowed(FichePostePrivileges::getResourceId(FichePostePrivileges::AFFICHER)); +$canHistoriser = $this->isAllowed(FichePostePrivileges::getResourceId(FichePostePrivileges::HISTORISER)); +$canEditer = $this->isAllowed(FichePostePrivileges::getResourceId(FichePostePrivileges::EDITER)); +$canDetruire = $this->isAllowed(FichePostePrivileges::getResourceId(FichePostePrivileges::EDITER)); ?> <h1 class="page-header"> - Index des fiches de poste + Fiches de poste <span class="badge"> <?php echo count($fiches); ?> </span> @@ -24,7 +25,6 @@ $canDetruire = true; <div class="main"> - <span class="TODO">REDIRIGER APRES CREATION VERS LA PAGE D EDITION ...</span><br/> <?php if ($canAjouter) : ?> <a href="<?php echo $this->url('fiche-poste/ajouter', [], [], true); ?>" class="btn btn-primary ajax-modal" data-event="modification"> <span class="icon ajouter"></span> @@ -62,6 +62,12 @@ $canDetruire = true; class="ajax-modal"> <span class="icon voir" title="Visualiser la fiche de poste"></span></a> <?php endif; ?> + <?php if ($canVoir) : ?> + <a href="<?php echo $this->url('fiche-poste/export', ['fiche-poste' => $fiche->getId()], [], true); ?>" + title="Exporter en PDF la fiche de poste" + > + <span class="icon pdf"></span></a> + <?php endif; ?> <?php if ($canEditer) : ?> <a href="<?php echo $this->url('fiche-poste/editer', ['fiche-poste' => $fiche->getId()], [], true); ?>"> <span class="icon editer" title="Éditer la fiche de poste"></span></a> @@ -91,7 +97,7 @@ $canDetruire = true; $(function() { $("body").on("modification", function (event) { event.div.modal('hide'); - window.location.reload(); + window.location.href = 'fiche-poste/editer'; }); }); -</script> \ No newline at end of file +</script> diff --git a/module/Application/view/application/fonction/afficher.phtml b/module/Application/view/application/fonction/afficher.phtml deleted file mode 100644 index 739ade7514c0eef1b54691caefc2a8aa5ba9ddf9..0000000000000000000000000000000000000000 --- a/module/Application/view/application/fonction/afficher.phtml +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -use Application\Entity\Db\Fonction; - -/** - * @var Fonction $fonction - */ - -?> - -<dl class="dl-horizontal"> - <dt> Identifiant </dt> - <dd> <?php echo $fonction->getId(); ?></dd> - <dt> Source </dt> - <dd> - <?php echo $fonction->getSource(); ?> - <?php if ($fonction->getIdSource()) : ?> - <?php echo " - ". $fonction->getIdSource() ; ?> - <?php endif; ?> - </dd> - <dt> Libellés </dt> - <dd> - <br/> - <ul> - <?php foreach ($fonction->getLibelles() as $libelle): ?> - <li> - <span class="badge" style="width:2em;background-color: <?php echo ($libelle->getDefault())?"green":"stalegray"; ?>;"> - <?php echo $libelle->getGenre(); ?> - </span> - <?php echo $libelle->getLibelle(); ?> - </li> - <?php endforeach; ?> - </ul> - </dd> - <dt> Modification </dt> - <dd> <?php echo $fonction->getHistoModification()->format('d/m/Y à H:i'); ?></dd> - <dt> Modificateur </dt> - <dd> <?php echo $fonction->getHistoModificateur()->getDisplayName(); ?> </dd> -</dl> - diff --git a/module/Application/view/application/fonction/index.phtml b/module/Application/view/application/fonction/index.phtml deleted file mode 100644 index d4963475bfdcc43ac0a7e1db3b6f23ce80f49a73..0000000000000000000000000000000000000000 --- a/module/Application/view/application/fonction/index.phtml +++ /dev/null @@ -1,131 +0,0 @@ -<?php - -use Application\Entity\Db\Fonction; -use Application\Entity\Db\Source; -use Application\Provider\Privilege\FonctionPrivileges; - -/** - * @var Fonction[] $fonctions - */ - -$this->headTitle('Index dex fonctions'); - -$canAjouter = $this->isAllowed(FonctionPrivileges::getResourceId(FonctionPrivileges::AJOUTER)); -$canModifier = $this->isAllowed(FonctionPrivileges::getResourceId(FonctionPrivileges::EDITER)); -$canHistoriser = $this->isAllowed(FonctionPrivileges::getResourceId(FonctionPrivileges::HISTORISER)); -$canDelete = $this->isAllowed(FonctionPrivileges::getResourceId(FonctionPrivileges::EFFACER)); -$canSynchroniser = $this->isAllowed(FonctionPrivileges::getResourceId(FonctionPrivileges::SYNCHRONISER)); -$canVisualiser = $this->isAllowed(FonctionPrivileges::getResourceId(FonctionPrivileges::AFFICHER)); -?> - -<h1 class="page-header"> - Index des fonctions -</h1> - -<div class="main"> - - <?php if ($canAjouter) : ?> - <a href="<?php echo $this->url('fonction/creer', [], [], true); ?>" class="btn btn-primary action ajax-modal" data-event="modification"> - <span class="icon ajouter"> - Ajouter une fonction - </span> - </a> - <?php endif; ?> - - <?php if ($canSynchroniser) : ?> - <a href="<?php echo $this->url('fonction/synchroniser', [], [], true); ?>" class="btn btn-primary action"> - <span class="icon synchoniser"> - Synchroniser - </span> - </a> - <?php endif; ?> - - <h2> - Fonctions - <span class="badge"> - <?php echo count($fonctions); ?> - </span> - </h2> - - <table class="table table-condensed"> - <thead> - <tr> - <th> Libellés </th> - <th> Source </th> - <th> Action </th> - </tr> - </thead> - <tbody> - <?php foreach($fonctions as $fonction) : ?> - <tr> - <td> - <ul> - <?php foreach ($fonction->getLibelles() as $libelle) : ?> - <li> - <span class="badge" style="width:2em;background-color: <?php echo ($libelle->getDefault())?"green":"stalegray"; ?>;"> - <?php echo $libelle->getGenre(); ?> - </span> - <?php echo $libelle->getLibelle(); ?> - </li> - <?php endforeach; ?> - </ul> - </td> - <td> - <?php //TODO source view helper ?> - <?php echo $fonction->getSource(); ?> - <?php if ($fonction->getIdSource()) : ?> - <?php echo " - ". $fonction->getIdSource() ; ?> - <?php endif; ?> - </td> - <td> - <?php if ($canVisualiser) : ?> - <a href="<?php echo $this->url('fonction/afficher', ['fonction' => $fonction->getId()], [], true); ?>" class="ajax-modal"> - <span class="icon voir" title="Visualiser la fonction"></span></a> - <?php else : ?> - <span class="icon voir" style="color:lightgrey;"></span> - <?php endif; ?> - <?php if ($canModifier && $fonction->getSource() !== Source::Octopus) : ?> - <a href="<?php echo $this->url('fonction/modifier', ['fonction' => $fonction->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> - <span class="icon editer" title="Modifier la fonction"></span></a> - <?php else : ?> - <span class="icon editer" style="color:lightgrey;"></span> - <?php endif; ?> - <?php if ($canHistoriser && $fonction->getSource() !== Source::Octopus) : ?> - <?php if ($fonction->estNonHistorise()) : ?> - <a href="<?php echo $this->url('fonction/historiser', ['fonction' => $fonction->getId()], [], true); ?>"> - <span class="icon historiser" title="Historiser la fonction"></span></a> - <?php else : ?> - <a href="<?php echo $this->url('fonction/restaurer', ['fonction' => $fonction->getId()], [], true); ?>" > - <span class="icon restaurer" title="Restaurer la fonction"></span></a> - <?php endif; ?> - <?php else : ?> - <?php if ($fonction->estNonHistorise()) : ?> - <span class="icon historiser" style="color:lightgrey;"></span> - <?php else : ?> - <span class="icon restaurer" style="color:lightgrey;"></span> - <?php endif; ?> - <?php endif; ?> - <?php if ($canDelete) : ?> - <a href="<?php echo $this->url('fonction/detruire', ['fonction' => $fonction->getId()], [], true); ?>"> - <span class="icon detruire" title="Détruire la fonction"></span></a> - <?php else : ?> - <span class="icon detruire" style="color:lightgrey;"></span> - <?php endif; ?> - </td> - </tr> - - <?php endforeach; ?> - </tbody> - </table> -</div> - - -<script> - $(function() { - $("body").on("modification", function (event) { - event.div.modal('hide'); - window.location.reload(); - }); - }); -</script> - diff --git a/module/Application/view/application/immobilier/index.phtml b/module/Application/view/application/immobilier/index.phtml new file mode 100644 index 0000000000000000000000000000000000000000..1d7e26d57a062635a822e0f394bdcdcd9f4562bb --- /dev/null +++ b/module/Application/view/application/immobilier/index.phtml @@ -0,0 +1,86 @@ +<?php + +use Application\Entity\Db\Batiment; +use Application\Entity\Db\Site; + +/** + * @var Site[] $sites + * @var Batiment[] $batiments + */ + +$this->headTitle('Bâtiments et sites') +?> + +<div class="row"> + <div class="col-md-6"> + <h1 class="page-header"> + Bâtiments et sites + </h1> + </div> + <div class="pull-right col-md-5 alert alert-info"> + <span class="icon synchoniser"></span> + Les bâtiments et sites sont synchronisés depuis Octopus. + </div> +</div> + +<div class="main"> + <h2> + Sites + <span class="badge"> <?php echo count($sites); ?> </span> + </h2> + + <table class="table table-condensed"> + <thead> + <tr> + <th> Id </th> + <th> Libellé </th> + <th> #Batiment </th> + </tr> + </thead> + <tbody> + <?php foreach ($sites as $site) : ?> + <tr> + <td> <?php echo $site->getId(); ?> </td> + <td> <?php echo $site->getLibelle(); ?> </td> + <td> + <?php + $text = ""; + foreach ($site->getBatiments() as $batiment) $text .= $batiment->getLibelle()."\n"; + ?> + <span title="<?php echo $text; ?>"> + <?php echo count($site->getBatiments()); ?> + <span class="icon batiment"></span> + </span> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> +</div> + +<div class="main"> + <h2> + Bâtiments + <span class="badge"> <?php echo count($batiments); ?> </span> + </h2> + + <table class="table table-condensed"> + <thead> + <tr> + <th> Id </th> + <th> Libellé </th> + <th> Site </th> + </tr> + </thead> + <tbody> + <?php foreach($batiments as $batiment) : ?> + <tr> + <td> <?php echo $batiment->getId(); ?></td> + <td> <?php echo $batiment->getLibelle(); ?></td> + <td> <?php echo $batiment->getSite()->getLibelle(); ?></td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + +</div> \ No newline at end of file diff --git a/module/Application/view/application/index/index.phtml b/module/Application/view/application/index/index.phtml index 7c67e00ae935d477251dc285af68f50c0c4d1b29..371204428d68d479a55d5ee07fbdb4a78277bd95 100755 --- a/module/Application/view/application/index/index.phtml +++ b/module/Application/view/application/index/index.phtml @@ -1,6 +1,6 @@ <div class="jumbotron" id="preecog"> - <h1>Prévisionnelle des emplois, des effectifs et des compétences</h1> - <h2>Outil de gestion</h2> + <h1><strong style="color:#19bd81;">Pr</strong>évisionnelle des <strong style="color:#19bd81;">e</strong>mplois, des <strong style="color:#19bd81;">e</strong>ffectifs et des <strong style="color:#19bd81;">co</strong>mpétences</h1> + <h1>Outil de <strong style="color:#19bd81;">g</strong>estion</h1> <div class="col-md-4"> <img style="width:200px;" src="img/PrEECoG.svg"> diff --git a/module/Application/view/application/poste/afficher.phtml b/module/Application/view/application/poste/afficher.phtml index 5cd1c2ff71bea17ad86e1cee7736d7247bed0046..f5c8c8c0d2910fea28e8bf1e7564d1c331f1f2a3 100644 --- a/module/Application/view/application/poste/afficher.phtml +++ b/module/Application/view/application/poste/afficher.phtml @@ -14,5 +14,5 @@ $this->headTitle("Poste numero ".$poste->getNumeroPoste()); <div class="main"> - <?php echo $this->poste()->render($poste); ?> + <?php echo $this->poste($poste); ?> </div> \ No newline at end of file diff --git a/module/Application/view/application/poste/index.phtml b/module/Application/view/application/poste/index.phtml index 7dab67a57af294f3ff47bca13b45a7a5fc35f0a8..e97dfb4fcaa4b2189ca8491fcd94a15069744c69 100644 --- a/module/Application/view/application/poste/index.phtml +++ b/module/Application/view/application/poste/index.phtml @@ -2,21 +2,24 @@ /** * @var Poste[] $postes - * @var \Octopus\Service\Immobilier\ImmobilierService $immobilierService */ use Application\Entity\Db\Poste; +use Application\Provider\Privilege\PostePrivileges; -$canAjouterPoste = true; -$canAfficherPoste = true; -$canModifierPoste = true; -$canSupprimerPoste = true; +$canAjouterPoste = $this->isAllowed(PostePrivileges::getResourceId(PostePrivileges::AJOUTER)); +$canAfficherPoste = $this->isAllowed(PostePrivileges::getResourceId(PostePrivileges::AFFICHER)); +$canModifierPoste = $this->isAllowed(PostePrivileges::getResourceId(PostePrivileges::EDITER)); +$canSupprimerPoste = $this->isAllowed(PostePrivileges::getResourceId(PostePrivileges::EDITER)); $this->headTitle("Index des postes") ?> -<h1> - Index des postes +<h1 class="page-header"> + Postes + <span class="badge"> + <?php echo count($postes); ?> + </span> </h1> @@ -40,6 +43,7 @@ $this->headTitle("Index des postes") <tr> <th> Numero de poste </th> <th> Fonction </th> + <th> Domaine </th> <th> Affectation </th> <th> Localisation </th> <th> Action </th> @@ -50,16 +54,17 @@ $this->headTitle("Index des postes") <tr> <td> <?php echo $poste->getNumeroPoste(); ?> </td> <td> <?php echo $poste->getFonction(); ?> </td> + <td> <?php echo $poste->getDomaine(); ?> </td> <td> - <?php echo $poste->getStructure(); ?> + <?php echo $poste->getStructure()->getLibelleCourt(); ?> </td> - <td> <?php echo $immobilierService->getImmobilierBatiment($poste->getLocalisation()); ?> </td> + <td> <?php echo $poste->getLocalisation(); ?> </td> <td> <?php if($canAfficherPoste) : ?> <a href="<?php echo $this->url('poste/afficher', ['poste' => $poste->getId()], [], true); ?>" class="ajax-modal" > - <i class="fas fa-eye" title="Afficher le poste"></i> + <span class="icon voir" title="Afficher le poste"></span> </a> <?php endif; ?> <?php if($canModifierPoste) : ?> @@ -67,12 +72,12 @@ $this->headTitle("Index des postes") class="ajax-modal" data-event="modification" > - <i class="fas fa-pencil-alt" title="Modifier le poste"></i> + <span class="icon editer" title="Modifier le poste"></span> </a> <?php endif; ?> <?php if($canSupprimerPoste) : ?> <a href="<?php echo $this->url('poste/supprimer', ['poste' => $poste->getId()], [], true); ?>"> - <i class="fas fa-trash-alt" title="Supprimer le poste"></i> + <span class="icon detruire" title="Supprimer le poste"></span> </a> <?php endif; ?> </td> diff --git a/module/Application/view/application/ressource-rh/cartographie.phtml b/module/Application/view/application/ressource-rh/cartographie.phtml new file mode 100644 index 0000000000000000000000000000000000000000..2e7da0c56ca54c756c5bf583c335651a7ecbed53 --- /dev/null +++ b/module/Application/view/application/ressource-rh/cartographie.phtml @@ -0,0 +1,57 @@ +<?php + +/** + * @var array $results + */ + +$this->headTitle('Cartographie des métiers'); +?> + +<h1 class="page-header"> Cartographie des métiers </h1> + +<div class="main"> + + <div class="row"> + + <div class="col-md-5" > + <a class="btn btn-primary action " + href="<?php echo $this->url('ressource-rh/cartographie/export', [], [], true); ?>" + > + Export de la cartographie + </a> + </div> + + <div class="col-md-5 pull-right"> + <div class="alert alert-warning"> + <strong>Attention :</strong> La cartographie se base sur les métiers. Par conséquent, une fonction (resp. un domaine ou une famille) vide ne sera pas cartographié. + </div> + </div> + + </div> + + <table class="table table-condensed"> + <thead> + <tr> + <th> Famille professionnelle </th> + <th> Fonction </th> + <th> Domaine </th> + <th> Métier </th> + <th> #Fiche métier</th> +<!-- <th> #Fiche poste </th>--> + </tr> + </thead> + <tbody> + <?php foreach($results as $result) : ?> + + + <tr> + <td> <?php echo $result['famille']; ?> </td> + <td> <?php echo $result['fonction']; ?> </td> + <td> <?php echo $result['domaine']; ?> </td> + <td> <?php echo $result['metier']; ?> </td> + <td> <?php echo $result['nbFiche']; ?> </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> +</div> diff --git a/module/Application/view/application/ressource-rh/index-corps-grade-status.phtml b/module/Application/view/application/ressource-rh/index-corps-grade-status.phtml deleted file mode 100644 index 878ea8b97e161bde97d78d8ba25ec24f3d40d552..0000000000000000000000000000000000000000 --- a/module/Application/view/application/ressource-rh/index-corps-grade-status.phtml +++ /dev/null @@ -1,222 +0,0 @@ -<?php - -/** - * @var \Application\Entity\Db\AgentStatus[] $status - * @var \Application\Entity\Db\Corps[] $corps - * @var \Application\Entity\Db\Grade[] $grades - */ - -use Application\Provider\Privilege\RessourceRhPrivileges; - -$this->headTitle('Index des corps, grades et status des agents'); - -$canAjouterRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER)); -$canEditerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER)); -$canEffacerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER)); - -?> - -<h1 class="page-header"> - Index des corps, grades et status des agents -</h1> - -<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'status']); ?>" class="btn btn-primary action">Status</a> -<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'corps']); ?>" class="btn btn-primary action">Corps</a> -<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'grade']); ?>" class="btn btn-primary action">Grade</a> - -<div class="main"> - - <a name="status"></a> - <div class="col-md-8"> - <h2> - Status des agents - <span class="badge"> - <?php echo count($status); ?> - </span> - </h2> - </div> - <div class="pull-right"> - <?php if ($canAjouterRessource) : ?> - <a - href="<?php echo $this->url('ressource-rh/agent-status/creer', [], [], true); ?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter un status - </a> - <?php endif; ?> - </div> - <?php if (count($status) > 0) : ?> - <table class="table table-condensed"> - <thead> - <tr> - <th> Id </th> - <th> Libelle </th> - <th class="action"> Action </th> - </tr> - </thead> - <tbody> - <?php foreach ($status as $item) : ?> - <tr> - <td> <?php echo $item->getId(); ?> </td> - <td> <?php echo $item->getLibelle(); ?> </td> - <td> - <?php if ($canEditerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/agent-status/modifier', ['id' => $item->getId()], [], true); ?>" - data-event="modification" - class="ajax-modal" - > - <span class="icon editer" title="Éditer le status"></span></a> - <?php else : ?> - <span class="icon editer" style="color:lightgrey;"></span> - <?php endif; ?> - - <?php if ($canEffacerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/agent-status/effacer', ['id' => $item->getId()], [], true); ?>" > - <span class="icon detruire" title="Effacer le status"></span></a> - <?php else : ?> - <span class="icon detruire" style="color:lightgrey;"></span> - <?php endif; ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> - </table> - <?php endif; ?> -</div> - -<div class="main"> - <a name="corps"></a> - <div class="col-md-8"> - <h2> - Liste des corps - <span class="badge"> - <?php echo count($corps); ?> - </span> - </h2> - </div> - - <div class="pull-right"> - <?php if ($canAjouterRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/corps/creer', [], [], true);?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter un corps - </a> - <?php endif;?> - </div> - - <br/> - - <table class="table table-condensed"> - <thead> - <tr> - <th> Id</th> - <th> Code</th> - <th> Libelle</th> - <th class="action"> Action </th> - </tr> - </thead> - <tbody> - <?php foreach($corps as $corp): ?> - <tr> - <td> <?php echo $corp->getId(); ?> </td> - <td> <?php echo $corp->getCode(); ?> </td> - <td> <?php echo $corp->getLibelle(); ?> </td> - <td> - <?php if ($canEditerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/corps/modifier', ['id' => $corp->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> - <span class="icon editer" title="Éditer le corps"></span></a> - <?php else : ?> - <span class="icon editer" style="color: lightgrey;"></span> - <?php endif; ?> - <?php if ($canEffacerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/corps/effacer', ['id' => $corp->getId()], [], true); ?>"> - <span class="icon detruire" title="Supprimer le corps"></span></a> - <?php else : ?> - <span class="icon detruire" style="color: lightgrey;"></span> - <?php endif; ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> - </table> - -</div> - -<div class="main"> - <a name="grade"></a> - <div class="col-md-8"> - <h2> - Liste des grades - <span class="badge"> - <?php echo count($grades); ?> - </span> - </h2> - </div> - - <div class="pull-right"> - <?php if ($canAjouterRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/grade/ajouter', [], [], true);?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter un grade - </a> - <?php endif;?> - </div> - - <br/> - - <table class="table table-condensed"> - <thead> - <tr> - <th> Id</th> - <th> Corps</th> - <th> Libelle</th> - <th> Progression</th> - <th class="action"> Action </th> - </tr> - </thead> - <tbody> - <?php foreach($grades as $grade): ?> - <tr> - <td> <?php echo $grade->getId(); ?> </td> - <td> <?php echo $grade->getCorps()->getLibelle(); ?> </td> - <td> <?php echo $grade->getLibelle(); ?> </td> - <td> <?php echo $grade->getRang(); ?> </td> - <td> - <?php if ($canEditerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/grade/modifier', ['grade' => $grade->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> - <span class="icon editer" title="Éditer le grade"></span></a> - <?php else : ?> - <span class="icon editer" style="color: lightgrey;"></span> - <?php endif; ?> - <?php if ($canEffacerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/grade/supprimer', ['grade' => $grade->getId()], [], true); ?>"> - <span class="icon detruire" title="Supprimer le grade"></span></a> - <?php else : ?> - <span class="icon detruire" style="color: lightgrey;"></span> - <?php endif; ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> - </table> - -</div> - - - -<script> - $(function() { - $("body").on("modification", function (event) { - event.div.modal('hide'); - window.location.reload(); - }); - }); -</script> diff --git a/module/Application/view/application/ressource-rh/index-corps.phtml b/module/Application/view/application/ressource-rh/index-corps.phtml new file mode 100644 index 0000000000000000000000000000000000000000..6e7066185517ba6193b0c517f4a0087efd682a46 --- /dev/null +++ b/module/Application/view/application/ressource-rh/index-corps.phtml @@ -0,0 +1,93 @@ +<?php + +/** + * @var Corps[] $corps_actifs + * @var Corps[] $corps_historises + */ + +use Application\Entity\Db\Corps; + +$this->headTitle('Index des corps'); + +?> + +<div class="row"> + <div class="col-md-6"> + <h1 class="page-header"> + Corps + <span class="badge"> + <?php echo count($corps_actifs) + count($corps_historises); ?> + </span> + </h1> + </div> + <div class="pull-right col-md-5 alert alert-info"> + <span class="icon synchoniser"></span> + Les corps sont synchronisés depuis Octopus. + </div> +</div> + +<div class="main"> + <h2> + Liste des corps actifs + <span class="badge"> + <?php echo count($corps_actifs); ?> + </span> + </h2> + + <?php if (count($corps_actifs) > 0) : ?> + <table class="table table-condensed"> + <thead> + <tr> + <th> Code </th> + <th> Catégorie </th> + <th> Libellé court </th> + <th> Libellé long </th> + </tr> + </thead> + <tbody> + <?php foreach ($corps_actifs as $grade) : ?> + <tr> + <td> <?php echo $grade->getCode(); ?> </td> + <td> <?php echo $grade->getCategorie(); ?> </td> + <td> <?php echo $grade->getLibelleCourt(); ?> </td> + <td> <?php echo $grade->getLibelleLong(); ?> </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> +</div> + +<div class="main"> + <h2> + Liste des corps historisés + <span class="badge"> + <?php echo count($corps_historises); ?> + </span> + </h2> + + <?php if (count($corps_historises) > 0) : ?> + <table class="table table-condensed"> + <thead> + <tr> + <th> Code </th> + <th> Catégorie </th> + <th> Libellé court </th> + <th> Libellé long </th> + <th> Historisation </th> + </tr> + </thead> + <tbody> + <?php foreach ($corps_historises as $grade) : ?> + <tr> + <td> <?php echo $grade->getCode(); ?> </td> + <td> <?php echo $grade->getCategorie(); ?> </td> + <td> <?php echo $grade->getLibelleCourt(); ?> </td> + <td> <?php echo $grade->getLibelleLong(); ?> </td> + <td> <?php echo $grade->getHisto(); ?> </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> +</div> \ No newline at end of file diff --git a/module/Application/view/application/ressource-rh/index-correspondance.phtml b/module/Application/view/application/ressource-rh/index-correspondance.phtml index 373010c4de146f43f77868690e160a4409f4f74c..79af0d55050ae65cfdda470e7b558450931977d4 100644 --- a/module/Application/view/application/ressource-rh/index-correspondance.phtml +++ b/module/Application/view/application/ressource-rh/index-correspondance.phtml @@ -1,78 +1,55 @@ <?php /** - * @var \Application\Entity\Db\Correspondance[] $correspondances + * @var Correspondance[] $correspondances_actives + * @var Correspondance[] $correspondances_historisees */ -use Application\Provider\Privilege\RessourceRhPrivileges; +use Application\Entity\Db\Correspondance; $this->headTitle('Index des correpondances'); -$canAjouterRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER)); -$canEditerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER)); -$canEffacerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER)); - ?> -<h1 class="page-header"> - Index des correspondances -</h1> - -<div class="main"> - <div class="col-md-8"> - <h2> - Liste des catégorie +<div class="row"> + <div class="col-md-6"> + <h1 class="page-header"> + Correspondances <span class="badge"> - <?php echo count($correspondances); ?> - </span> - </h2> + <?php echo count($correspondances_actives) + count($correspondances_historisees); ?> + </span> + </h1> </div> - <div class="pull-right"> - <?php if ($canAjouterRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/correspondance/creer', [], [], true);?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter une catégorie - </a> - <?php endif;?> + <div class="pull-right col-md-5 alert alert-info"> + <span class="icon synchoniser"></span> + Les correspondances sont synchronisées depuis Octopus. </div> - <?php if (count($correspondances) > 0) : ?> +</div> + + +<div class="main"> + <h2> + Liste des catégorie actives + <span class="badge"> + <?php echo count($correspondances_actives); ?> + </span> + </h2> + + <?php if (count($correspondances_actives) > 0) : ?> <table class="table table-condensed"> <thead> <tr> - <th> Id </th> - <th> Référence </th> - <th> Libelle </th> - <th> Description </th> - <th class="action"> Action </th> + <th> Categorie </th> + <th> Libellé court </th> + <th> Libellé long </th> </tr> </thead> <tbody> - <?php foreach ($correspondances as $correspondance) : ?> + <?php foreach ($correspondances_actives as $correspondance) : ?> <tr> - <td> <?php echo $correspondance->getId(); ?> </td> - <td> <?php echo $correspondance->getReference(); ?> </td> - <td> <?php echo $correspondance->getLibelle(); ?> </td> - <td> <?php echo $correspondance->getDescription(); ?> </td> - <td> - <?php if ($canEditerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/correspondance/modifier', ['id' => $correspondance->getId()], [], true); ?>" - data-event="modification" - class="ajax-modal" - > - <span class="icon editer" title="Éditer la correspondance"></span></a> - <?php else : ?> - <span class="icon editer" style="color: lightgrey;"></span> - <?php endif; ?> - <?php if ($canEffacerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/correspondance/effacer', ['id' => $correspondance->getId()], [], true); ?>" > - <span class="icon detruire" title="Effacer le status"></span></a> - <?php else : ?> - <span class="icon detruire" style="color: lightgrey;"></span> - <?php endif; ?> - </td> + <td> <?php echo $correspondance->getCategorie(); ?> </td> + <td> <?php echo $correspondance->getLibelleCourt(); ?> </td> + <td> <?php echo $correspondance->getLibelleLong(); ?> </td> </tr> <?php endforeach; ?> </tbody> @@ -80,13 +57,34 @@ $canEffacerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId( <?php endif; ?> </div> +<div class="main"> + <h2> + Liste des catégorie historisées + <span class="badge"> + <?php echo count($correspondances_historisees); ?> + </span> + </h2> - -<script> - $(function() { - $("body").on("modification", function (event) { - event.div.modal('hide'); - window.location.reload(); - }); - }); -</script> + <?php if (count($correspondances_historisees) > 0) : ?> + <table class="table table-condensed"> + <thead> + <tr> + <th> Categorie </th> + <th> Libellé court </th> + <th> Libellé long </th> + <th> Historisation </th> + </tr> + </thead> + <tbody> + <?php foreach ($correspondances_historisees as $correspondance) : ?> + <tr> + <td> <?php echo $correspondance->getCategorie(); ?> </td> + <td> <?php echo $correspondance->getLibelleCourt(); ?> </td> + <td> <?php echo $correspondance->getLibelleLong(); ?> </td> + <td> <?php echo $correspondance->getHisto(); ?> </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> +</div> \ No newline at end of file diff --git a/module/Application/view/application/ressource-rh/index-domaine.phtml b/module/Application/view/application/ressource-rh/index-domaine.phtml deleted file mode 100644 index 704ddbd26f533f70196e8441c9fcb8a6aa501147..0000000000000000000000000000000000000000 --- a/module/Application/view/application/ressource-rh/index-domaine.phtml +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -/** - * @var \Application\Entity\Db\Domaine[] $domaines - */ - -use Application\Provider\Privilege\RessourceRhPrivileges; - -$this->headTitle('Index des domaines'); - -$canAjouterRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER)); -$canEditerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER)); -$canEffacerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER)); - -?> - -<h1 class="page-header"> - Index des domaines -</h1> - -<div class="main"> - <div class="col-md-8"> - <h2> - Liste des domaines - <span class="badge"> - <?php echo count($domaines); ?> - </span> - </h2> - </div> - <div class="pull-right"> - <?php if ($canAjouterRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/domaine/ajouter', [], [], true);?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter un domaine - </a> - <?php endif;?> - </div> - <?php if (count($domaines) > 0) : ?> - <table class="table table-condensed"> - <thead> - <tr> - <th> Id </th> - <th> Libelle </th> - <th class="action"> Action </th> - </tr> - </thead> - <tbody> - <?php foreach ($domaines as $domaine) : ?> - <tr> - <td> <?php echo $domaine->getId(); ?> </td> - <td> <?php echo $domaine->getLibelle(); ?> </td> - <td> - <?php if ($canEditerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/domaine/modifier', ['domaine' => $domaine->getId()], [], true); ?>" - data-event="modification" - class="ajax-modal" - > - <span class="icon editer" title="Éditer le domaine"></span></a> - <?php else : ?> - <span class="icon editer" style="color: lightgrey;"></span> - <?php endif; ?> - <?php if ($canEffacerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/domaine/supprimer', ['domaine' => $domaine->getId()], [], true); ?>" > - <span class="icon detruire" title="Effacer le domaine"></span></a> - <?php else : ?> - <span class="icon detruire" style="color: lightgrey;"></span> - <?php endif; ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> - </table> - <?php endif; ?> -</div> - -<script> - $(function() { - $("body").on("modification", function (event) { - event.div.modal('hide'); - window.location.reload(); - }); - }); -</script> diff --git a/module/Application/view/application/ressource-rh/index-grade.phtml b/module/Application/view/application/ressource-rh/index-grade.phtml new file mode 100644 index 0000000000000000000000000000000000000000..c76ec80eb6632d51da107dd25c273570c0b26dcb --- /dev/null +++ b/module/Application/view/application/ressource-rh/index-grade.phtml @@ -0,0 +1,89 @@ +<?php + +/** + * @var Grade[] $grades_actifs + * @var Grade[] $grades_historises + */ + +use Application\Entity\Db\Grade; + +$this->headTitle('Index des grades'); + +?> + +<div class="row"> + <div class="col-md-6"> + <h1 class="page-header"> + Grades + <span class="badge"> + <?php echo count($grades_actifs) + count($grades_historises); ?> + </span> + </h1> + </div> + <div class="pull-right col-md-5 alert alert-info"> + <span class="icon synchoniser"></span> + Les grades sont synchronisés depuis Octopus. + </div> +</div> + +<div class="main"> + <h2> + Liste des grades actifs + <span class="badge"> + <?php echo count($grades_actifs); ?> + </span> + </h2> + + <?php if (count($grades_actifs) > 0) : ?> + <table class="table table-condensed"> + <thead> + <tr> + <th> Code </th> + <th> Libellé court </th> + <th> Libellé long </th> + </tr> + </thead> + <tbody> + <?php foreach ($grades_actifs as $grade) : ?> + <tr> + <td> <?php echo $grade->getCode(); ?> </td> + <td> <?php echo $grade->getLibelleCourt(); ?> </td> + <td> <?php echo $grade->getLibelleLong(); ?> </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> +</div> + +<div class="main"> + <h2> + Liste des corps historisés + <span class="badge"> + <?php echo count($grades_historises); ?> + </span> + </h2> + + <?php if (count($grades_historises) > 0) : ?> + <table class="table table-condensed"> + <thead> + <tr> + <th> Code </th> + <th> Libellé court </th> + <th> Libellé long </th> + <th> Historisation </th> + </tr> + </thead> + <tbody> + <?php foreach ($grades_historises as $grade) : ?> + <tr> + <td> <?php echo $grade->getCode(); ?> </td> + <td> <?php echo $grade->getLibelleCourt(); ?> </td> + <td> <?php echo $grade->getLibelleLong(); ?> </td> + <td> <?php echo $grade->getHisto(); ?> </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> +</div> \ No newline at end of file diff --git a/module/Application/view/application/ressource-rh/index-metier-et-famille.phtml b/module/Application/view/application/ressource-rh/index-metier-et-famille.phtml deleted file mode 100644 index 19d731543809a91e90965dcbb7f7d7043fb3317d..0000000000000000000000000000000000000000 --- a/module/Application/view/application/ressource-rh/index-metier-et-famille.phtml +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -/** - * @var \Application\Entity\Db\Metier[] $metiers - * @var \Application\Entity\Db\MetierFamille[] $familles - */ - -use Application\Provider\Privilege\RessourceRhPrivileges; - -$this->headTitle('Index des métiers et familles de métiers'); - -$canAjouterRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER)); -$canEditerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER)); -$canEffacerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER)); - -?> - -<h1 class="page-header"> - Index des métiers et familles professionnelles -</h1> - -<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'metier']); ?>" class="btn btn-primary action">Métier</a> -<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'famille']); ?>" class="btn btn-primary action">Famille professionnelle</a> - - -<div class="main"> - <a name="metier"></a> - <div class="col-md-8"> - <h2> - Liste des métiers - <span class="badge"> - <?php echo count($metiers); ?> - </span> - </h2> - </div> - <div class="pull-right"> - <?php if ($canAjouterRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/metier/creer', [], [], true);?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter un métier - </a> - <?php endif;?> - </div> - <br/> - <table class="table table-condensed"> - <thead> - <tr> - <th> Id</th> - <th> Libelle </th> - <th> Famille </th> - <th class="action"> Action </th> - </tr> - </thead> - <tbody> - <?php foreach($metiers as $metier): ?> - <tr> - <td> <?php echo $metier->getId(); ?> </td> - <td> <?php echo $metier->getLibelle(); ?> </td> - <td> <?php echo $metier->getFamille()->getLibelle(); ?> </td> - <td> - <?php if ($canEditerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/metier/modifier', ['id' => $metier->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> - <span class="icon editer" title="Éditer l'application"></span></a> - <?php else : ?> - <span class="icon editer" style="color: lightgrey;"></span> - <?php endif; ?> - <?php if ($canEffacerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/metier/effacer', ['id' => $metier->getId()], [], true); ?>"> - <span class="icon detruire" title="Supprimer l'application"></span></a> - <?php else : ?> - <span class="icon detruire" style="color: lightgrey;"></span> - <?php endif; ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> - </table> -</div> - -<div class="main"> - <a name="famille"></a> - <div class="col-md-8"> - <h2> - Liste des familles professionnelles - <span class="badge"> - <?php echo count($familles); ?> - </span> - </h2> - </div> - <div class="pull-right"> - <?php if ($canAjouterRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/famille/creer', [], [], true);?>" - class="btn btn-primary action ajax-modal" - data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter une famille professionnelle - </a> - <?php endif;?> - </div> - <br/> - <table class="table table-condensed"> - <thead> - <tr> - <th> Id</th> - <th> Libelle </th> - <th> #metiers </th> - <th class="action"> Action </th> - </tr> - </thead> - <tbody> - <?php foreach($familles as $famille): ?> - <tr> - <td> <?php echo $famille->getId(); ?> </td> - <td> <?php echo $famille->getLibelle(); ?> </td> - <td> - <?php echo count($famille->getMetiers()); ?> - </td> - <td> - <?php if ($canEditerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/famille/modifier', ['id' => $famille->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> - <span class="icon editer" title="Éditer l'application"></span></a> - <?php else : ?> - <span class="icon editer" style="color: lightgrey;"></span> - <?php endif; ?> - <?php if ($canEffacerRessource) : ?> - <a href="<?php echo $this->url('ressource-rh/famille/effacer', ['id' => $famille->getId()], [], true); ?>"> - <span class="icon detruire" title="Supprimer l'application"></span></a> - <?php else : ?> - <span class="icon detruire" style="color: lightgrey;"></span> - <?php endif; ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> - </table> - -</div> - -<script> - $(function() { - $("body").on("modification", function (event) { - event.div.modal('hide'); - window.location.reload(); - }); - }); -</script> diff --git a/module/Application/view/application/ressource-rh/index-metier-famille-domaine.phtml b/module/Application/view/application/ressource-rh/index-metier-famille-domaine.phtml new file mode 100644 index 0000000000000000000000000000000000000000..c5c9368c54e61e33e5887bfcb4d1ee1e82da357f --- /dev/null +++ b/module/Application/view/application/ressource-rh/index-metier-famille-domaine.phtml @@ -0,0 +1,283 @@ +<?php + +/** + * @var FamilleProfessionnelle[] $familles + * @var Domaine[] $domaines + * @var Fonction[] $fonctions + * @var Metier[] $metiers + */ + +use Application\Entity\Db\Domaine; +use Application\Entity\Db\FamilleProfessionnelle; +use Application\Entity\Db\Fonction; +use Application\Entity\Db\Metier; +use Application\Provider\Privilege\RessourceRhPrivileges; + +$this->headTitle('Métiers, familles professionnelles et domaines'); + +$canAjouterRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER)); +$canEditerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER)); +$canEffacerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER)); + +?> + +<h1 class="page-header"> + Métiers, familles professionnelles et domaines +</h1> + +<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'famille']); ?>" class="btn btn-primary action">Famille professionnelle</a> +<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'domaine']); ?>" class="btn btn-primary action">Domaine</a> +<!--<a href="--><?php //echo $this->url('ressource-rh', [], ['fragment' => 'fonction']); ?><!--" class="btn btn-primary action">Fonction</a>--> +<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'metier']); ?>" class="btn btn-primary action">Métier</a> + +<div class="main"> + <a name="famille"></a> + <div class="col-md-8"> + <h2> + Liste des familles professionnelles + <span class="badge"> + <?php echo count($familles); ?> + </span> + </h2> + </div> + <div class="pull-right"> + <?php if ($canAjouterRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/famille/creer', [], [], true);?>" + class="btn btn-primary action ajax-modal" + data-event="modification" + > + <span class="icon ajouter"></span> + Ajouter une famille professionnelle + </a> + <?php endif;?> + </div> + <br/> + <table class="table table-condensed"> + <thead> + <tr> + <th> Libelle </th> + <th> #domaines </th> + <th class="action"> Action </th> + </tr> + </thead> + <tbody> + <?php foreach($familles as $famille): ?> + <tr> + <td> <?php echo $famille->getLibelle(); ?> </td> + <td> + <?php echo count($famille->getDomaines()); ?> + </td> + <td> + <?php if ($canEditerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/famille/modifier', ['id' => $famille->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> + <span class="icon editer" title="Éditer l'application"></span></a> + <?php else : ?> + <span class="icon editer" style="color: lightgrey;"></span> + <?php endif; ?> + <?php if ($canEffacerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/famille/effacer', ['id' => $famille->getId()], [], true); ?>"> + <span class="icon detruire" title="Supprimer l'application"></span></a> + <?php else : ?> + <span class="icon detruire" style="color: lightgrey;"></span> + <?php endif; ?> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> +</div> + +<br/> + +<div class="main"> + <a name="domaine"></a> + <div class="col-md-8"> + <h2> + Liste des domaines + <span class="badge"> + <?php echo count($domaines); ?> + </span> + </h2> + </div> + <div class="pull-right"> + <?php if ($canAjouterRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/domaine/ajouter', [], [], true);?>" + class="btn btn-primary action ajax-modal" + data-event="modification" + > + <span class="icon ajouter"></span> + Ajouter un domaine + </a> + <?php endif;?> + </div> + <br/> + <table class="table table-condensed"> + <thead> + <tr> + <th> Libelle </th> + <th> Famille professionnelle </th> + <th> #metier </th> + <th class="action"> Action </th> + </tr> + </thead> + <tbody> + <?php foreach($domaines as $domaine): ?> + <tr> + <td> <?php echo $domaine->getLibelle(); ?> </td> + <td> <?php echo $domaine->getFamille(); ?> </td> + <td> + <?php echo count($domaine->getMetiers()); ?> + </td> + <td> + <?php if ($canEditerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/domaine/modifier', ['domaine' => $domaine->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> + <span class="icon editer" title="Éditer le domaine"></span></a> + <?php else : ?> + <span class="icon editer" style="color: lightgrey;"></span> + <?php endif; ?> + <?php if ($canEffacerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/domaine/supprimer', ['domaine' => $domaine->getId()], [], true); ?>"> + <span class="icon detruire" title="Supprimer le domaine"></span></a> + <?php else : ?> + <span class="icon detruire" style="color: lightgrey;"></span> + <?php endif; ?> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> +</div> + +<br/> + +<!--<div class="main">--> +<!-- <a name="fonction"></a>--> +<!-- <div class="col-md-8">--> +<!-- <h2>--> +<!-- Liste des fonctions--> +<!-- <span class="badge">--> +<!-- --><?php //echo count($fonctions); ?> +<!-- </span>--> +<!-- </h2>--> +<!-- </div>--> +<!-- <div class="pull-right">--> +<!-- <div class="alert alert-info"><em> Importer depuis Octopus</em></div>--> +<!-- </div>--> +<!-- <br/>--> +<!-- <table class="table table-condensed">--> +<!-- <thead>--> +<!-- <tr>--> +<!-- <th> Id </th>--> +<!-- <th> Parent </th>--> +<!-- <th> Code </th>--> +<!-- <th> Libellés </th>--> +<!-- <th> Domaine </th>--> +<!-- <th> #métier </th>--> +<!-- <th> Action </th>--> +<!-- </tr>--> +<!-- </thead>--> +<!-- <tbody>--> +<!-- --><?php //foreach($fonctions as $fonction) : ?> +<!-- <tr>--> +<!-- <td> --><?php //echo $fonction->getId(); ?><!-- </td>--> +<!-- <td> --><?php //echo ($fonction !== $fonction->getParent())?$fonction->getParent()->getId():""; ?><!-- </td>--> +<!-- <td> --><?php //echo $fonction->getCode(); ?><!-- </td>--> +<!-- <td>--> +<!-- <ul>--> +<!-- --><?php //foreach($fonction->getLibelles() as $libelle) : ?> +<!-- <li>--> +<!-- <span class="badge" --><?php //if ($libelle->getDefaut() === 'O') echo 'style="background-color:green;"'; ?><!-- >--> +<!-- --><?php //echo $libelle->getGenre(); ?> +<!-- </span>--> +<!-- --><?php //echo $libelle->getLibelle(); ?> +<!-- </li>--> +<!-- --><?php //endforeach; ?> +<!-- </ul>--> +<!-- </td>--> +<!-- <td> --><?php //echo $fonction->getDomaine(); ?><!-- </td>--> +<!-- <td> --><?php //echo count($fonction->getMetiers()); ?><!-- </td>--> +<!-- <td>--> +<!-- --><?php //if ($canEditerRessource) : ?> +<!-- <a href="--><?php //echo $this->url('ressource-rh/fonction/modifier', ['fonction' => $fonction->getId()], [], true); ?><!--" class="ajax-modal" data-event="modification">--> +<!-- <span class="icon editer" title="Éditer l'application"></span></a>--> +<!-- --><?php //else : ?> +<!-- <span class="icon editer" style="color: lightgrey;"></span>--> +<!-- --><?php //endif; ?> +<!-- </td>--> +<!-- </tr>--> +<!-- --><?php //endforeach; ?> +<!-- </tbody>--> +<!-- </table>--> +<!--</div>--> +<!----> +<!--<br/>--> + +<div class="main"> + <a name="metier"></a> + <div class="col-md-8"> + <h2> + Liste des métiers + <span class="badge"> + <?php echo count($metiers); ?> + </span> + </h2> + </div> + <div class="pull-right"> + <?php if ($canAjouterRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/metier/creer', [], [], true);?>" + class="btn btn-primary action ajax-modal" + data-event="modification" + > + <span class="icon ajouter"></span> + Ajouter un métier + </a> + <?php endif;?> + </div> + <br/> + <table class="table table-condensed"> + <thead> + <tr> + <th> Libelle </th> + <th> Domaine </th> + <th> Fonction </th> + <th class="action"> Action </th> + </tr> + </thead> + <tbody> + <?php foreach($metiers as $metier): ?> + <tr> + <td> <?php echo $metier->getLibelle(); ?> </td> + <td> <?php echo $metier->getDomaine(); ?> </td> + <td> <?php echo $metier->getFonction(); ?> </td> + <td> + <?php if ($canEditerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/metier/modifier', ['id' => $metier->getId()], [], true); ?>" class="ajax-modal" data-event="modification"> + <span class="icon editer" title="Éditer l'application"></span></a> + <?php else : ?> + <span class="icon editer" style="color: lightgrey;"></span> + <?php endif; ?> + <?php if ($canEffacerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/metier/effacer', ['id' => $metier->getId()], [], true); ?>"> + <span class="icon detruire" title="Supprimer l'application"></span></a> + <?php else : ?> + <span class="icon detruire" style="color: lightgrey;"></span> + <?php endif; ?> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> +</div> + + + + + +<script> + $(function() { + $("body").on("modification", function (event) { + event.div.modal('hide'); + window.location.reload(); + }); + }); +</script> diff --git a/module/Application/view/application/ressource-rh/index-mission-specifique.phtml b/module/Application/view/application/ressource-rh/index-mission-specifique.phtml new file mode 100644 index 0000000000000000000000000000000000000000..a9020532da369242e84aa54a8b083028c3036c3b --- /dev/null +++ b/module/Application/view/application/ressource-rh/index-mission-specifique.phtml @@ -0,0 +1,112 @@ +<?php + +/** + * @var Application\Entity\Db\MissionSpecifique[] $missions + */ + +use Application\Provider\Privilege\RessourceRhPrivileges; + +$this->headTitle('Index des domaines'); + +$canAjouterRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER)); +$canEditerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER)); +$canHistoriserRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER)); +$canEffacerRessource = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER)); + +?> + +<h1 class="page-header"> + Missions spécifiques + <span class="badge"> + <?php echo count($missions); ?> + </span> +</h1> + +<div class="main"> + <div class="pull-right"> + <?php if ($canAjouterRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/mission-specifique/ajouter', [], [], true);?>" + class="btn btn-primary action ajax-modal" + data-event="modification" + > + <span class="icon ajouter"></span> + Ajouter une mission + </a> + <?php endif;?> + </div> + <?php if (count($missions) > 0) : ?> + <table id="datatable" class="table table-condensed"> + <thead> + <tr> +<!-- <th> Id </th>--> + <th> Libelle </th> + <th> #Agent </th> + <th> Modificateur </th> + <th class="action"> Action </th> + </tr> + </thead> + <tbody> + <?php foreach ($missions as $mission) : ?> + <tr> + <td> <?php echo $mission->getLibelle(); ?> </td> + <td> <?php echo count($mission->getAgents()); ?> </td> + <td> <small> + <?php echo $mission->getHistoModificateur()->getDisplayName(); ?> <br/> + <?php echo $mission->getHistoModification()->format('d/m/Y à H:i'); ?> + </small> + </td> + <td> + <?php if ($canEditerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/mission-specifique/modifier', ['mission' => $mission->getId()], [], true); ?>" + data-event="modification" + class="ajax-modal" + > + <span class="icon editer" title="Éditer le domaine"></span></a> + <?php else : ?> + <span class="icon editer" style="color: lightgrey;"></span> + <?php endif; ?> + <?php if ($canHistoriserRessource) : ?> + <?php if ($mission->getHistoDestruction() === null) : ?> + <a href="<?php echo $this->url('ressource-rh/mission-specifique/historiser', ['mission' => $mission->getId()], [], true); ?>"> + <span class="icon historiser" title="Historiser le domaine"></span></a> + <?php else : ?> + <a href="<?php echo $this->url('ressource-rh/mission-specifique/restaurer', ['mission' => $mission->getId()], [], true); ?>"> + <span class="icon restaurer" title="Restaurer le domaine"></span></a> + <?php endif; ?> + <?php else : ?> + <?php if ($mission->getHistoDestruction() === null) : ?> + <span class="icon historiser" style="color: lightgrey;"></span> + <?php else : ?> + <span class="icon restaurer" style="color: lightgrey;"></span> + <?php endif; ?> + <?php endif; ?> + <?php if ($canEffacerRessource) : ?> + <a href="<?php echo $this->url('ressource-rh/mission-specifique/supprimer', ['mission' => $mission->getId()], [], true); ?>" > + <span class="icon detruire" title="Effacer le domaine"></span></a> + <?php else : ?> + <span class="icon detruire" style="color: lightgrey;"></span> + <?php endif; ?> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> +</div> + +<script> + $(document).ready(function() { + $('#datatable').DataTable( { + language: { + url: '/localisation/fr_FR.json' + } + }); + }); + + $(function() { + $("body").on("modification", function (event) { + event.div.modal('hide'); + window.location.reload(); + }); + }); +</script> diff --git a/module/Application/view/application/ressource-rh/index.phtml b/module/Application/view/application/ressource-rh/index.phtml index bcf17d9857d263755e7daa9c07a9d91af272ad4f..26a55069cb6b4cb6f98ea12b4a787465a7129578 100644 --- a/module/Application/view/application/ressource-rh/index.phtml +++ b/module/Application/view/application/ressource-rh/index.phtml @@ -19,15 +19,16 @@ Parmi les ressources, on retourve : </p> <ul> - <li> les corps, grades et status des agents <span class="manuel"></span> ; </li> - <li> les correspondances associées aux différents postes (BAP, Biblio, ...) <span class="manuel"></span> ; </li> - <li> les domaines unicaen <span class="manuel"></span> ; </li> - <li> les fonctions associés aux agents <span class="manuel"></span> <span class="synchro"></span> ; </li> - <li> les métiers et familles de métiers <span class="manuel"></span> ; </li> - <li> les structures gérées par l'établissement <span class="manuel"></span> <span class="synchro"></span>. </li> + <li> les agents <span class="synchro"></span> et statuts des agent <span class="synchro"></span> ; </li> + <li> les corps <span class="synchro"></span> et grades <span class="synchro"></span> ; </li> + <li> les correspondances associées aux différents postes (BAP, Biblio, ...) <span class="synchro"></span> ; </li> + <li> les familles professionnelles <span class="manuel"></span>, domaines UniCaen <span class="manuel"></span>, fonctions (et leurs libellés) <span class="synchro"></span> et métiers <span class="manuel"></span> ; </li> + <li> les missions spécifiques <span class="manuel"></span> ; </li> + <li> les sites et les batiments gérés par l'établissement <span class="synchro"></span> ; </li> + <li> les structures gérées par l'établissement <span class="synchro"></span>. </li> </ul> - <p> Pour accéder à ces ressources, veuillez utiliser le menu lattéral</p> + <p> Pour accéder à ces ressources, veuillez utiliser le menu lattéral.</p> </div> diff --git a/module/Application/view/application/structure/description.phtml b/module/Application/view/application/structure/description.phtml deleted file mode 100644 index 13e746684ff3b833857ebd98cebfc938ddb80d8c..0000000000000000000000000000000000000000 --- a/module/Application/view/application/structure/description.phtml +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -echo $description; - -?> \ No newline at end of file diff --git a/module/Application/view/application/structure/index.phtml b/module/Application/view/application/structure/index.phtml index 9a7a068f54ffa967e95b2f4f4b3f23e2c242f665..52a39e584721936192a2cfa39e7c3da399d2461b 100644 --- a/module/Application/view/application/structure/index.phtml +++ b/module/Application/view/application/structure/index.phtml @@ -1,56 +1,42 @@ <?php use Application\Provider\Privilege\StructurePrivileges; +use Utilisateur\Entity\Db\Role; $this->headTitle("Index des structures"); /** * @var Application\Entity\Db\Structure[] $structures + * @var \Utilisateur\Entity\Db\User $user + * @var \Utilisateur\Entity\Db\Role $role */ -$canDescription = $this->isAllowed(StructurePrivileges::getResourceId(StructurePrivileges::AFFICHER)); -$canEditer = $this->isAllowed(StructurePrivileges::getResourceId(StructurePrivileges::EDITER)); -$canHistoriser = $this->isAllowed(StructurePrivileges::getResourceId(StructurePrivileges::HISTORISER)); -$canDetruire = $this->isAllowed(StructurePrivileges::getResourceId(StructurePrivileges::EFFACER)); $canGestionnaire = $this->isAllowed(StructurePrivileges::getResourceId(StructurePrivileges::GESTIONNAIRE)); +$canEditer = $this->isAllowed(StructurePrivileges::getResourceId(StructurePrivileges::EDITER)); ?> -<h1 class="page-header"> - Index des structures -</h1> - -<div class="main"> - - - <a href="<?php echo $this->url('structure/creer', [], [], true); ?>" - class="btn btn-primary action ajax-modal" data-event="modification" - > - <span class="icon ajouter"></span> - Ajouter une structure - </a> - - <a href="<?php echo $this->url('structure/synchroniser', [], [], true); ?>" - class="btn btn-primary action" - > +<div class="row"> + <div class="col-md-6"> + <h1 class="page-header"> + Structures + <span class="badge"> + <?php echo count($structures); ?> + </span> + </h1> + </div> + <div class="pull-right col-md-5 alert alert-info"> <span class="icon synchoniser"></span> - Synchroniser - </a> - - <h2> - Structures ouvertes - <span class="badge"> - <?php echo count($structures); ?> - </span> - </h2> + Les structures sont synchronisées depuis Octopus. + </div> +</div> +<div class="main"> - <table class="table table-condensed"> + <table id="structures" class="table table-condensed"> <thead> <tr> <th> Libellé court </th> - <th> Sigle </th> <th> Type </th> - <th> Ouverture </th> - <th> Source </th> + <th> Code </th> <th> Gestionnaire </th> <th> Action </th> </tr> @@ -64,16 +50,8 @@ $canGestionnaire = $this->isAllowed(StructurePrivileges::getResourceId(Struct <sup><span class="icon information" title="<?php echo $structure->getLibelleLong(); ?>"></span></sup> <?php endif; ?> </td> - <td> <?php echo ($structure->getSigle())?:"---"; ?> </td> - <td> <?php echo $structure->getType()->getCode() ?> </td> - <td> <?php echo $structure->getDateOuverture()->format('d/m/Y') ?> </td> - <td> - <?php //TODO source view helper ?> - <?php echo $structure->getSource(); ?> - <?php if ($structure->getIdSource()) : ?> - <?php echo " - ". $structure->getIdSource() ; ?> - <?php endif; ?> - </td> + <td> <?php echo $structure->getType(); ?> </td> + <td> <?php echo $structure->getCode(); ?> </td> <td> <?php if (count($structure->getGestionnaires())) : ?> <?php @@ -89,18 +67,13 @@ $canGestionnaire = $this->isAllowed(StructurePrivileges::getResourceId(Struct <?php endif; ?> </td> <td> - <?php if ($canDescription) : ?> - <a href="<?php echo $this->url('structure/description', ['structure' => $structure->getId()], [], true); ?>" - class="ajax-modal" - > - <span class="icon voir" title="Voir la description"></span></a> - <?php endif; ?> <?php if ($canEditer) : ?> - <a href="<?php echo $this->url('structure/modifier', ['structure' => $structure->getId()], [], true); ?>" - class="ajax-modal" data-event="modification" + <a + href="<?php echo $this->url('structure/editer-description', ['structure' => $structure->getId()], [], true); ?>" + class="ajax-modal" + data-event="modification" > - <span class="icon editer" title="Modifier la structure"></span></a> - + <span class="icon editer" title="Editer la description"></span></a> <?php endif; ?> <?php if ($canGestionnaire) : ?> <a @@ -116,19 +89,6 @@ $canGestionnaire = $this->isAllowed(StructurePrivileges::getResourceId(Struct > <span class="icon retirer-user" title="Retirer un gestionnaire"></span></a> <?php endif; ?> - <?php if ($canHistoriser) : ?> - <?php if($structure->estNonHistorise()) : ?> - <a href="<?php echo $this->url('structure/historiser', ['structure' => $structure->getId()], [], true); ?>"> - <span class="icon historiser" title="Historiser la structure"></span></a> - <?php else : ?> - <a href="<?php echo $this->url('structure/restaurer', ['structure' => $structure->getId()], [], true); ?>"> - <span class="icon restaurer" title="Restaurer la structure"></span></a> - <?php endif; ?> - <?php endif; ?> - <?php if ($canDetruire) : ?> - <a href="<?php echo $this->url('structure/detruire', ['structure' => $structure->getId()], [], true); ?>"> - <span class="icon detruire" title="Supprimer définitivement la structure"></span></a> - <?php endif; ?> </td> </tr> <?php endforeach; ?> @@ -138,6 +98,14 @@ $canGestionnaire = $this->isAllowed(StructurePrivileges::getResourceId(Struct <script> + $(document).ready(function() { + $('#structures').DataTable( { + language: { + url: '/localisation/fr_FR.json' + } + } ); + } ); + $(function() { $("body").on("modification", function (event) { event.div.modal('hide'); diff --git a/module/Application/view/layout/flashMessage.phtml b/module/Application/view/layout/flashMessage.phtml new file mode 100644 index 0000000000000000000000000000000000000000..61235852909c9e9ceb14e26116ed1c5679f77ff3 --- /dev/null +++ b/module/Application/view/layout/flashMessage.phtml @@ -0,0 +1,9 @@ +<?php + +use Application\View\Renderer\PhpRenderer; + +/** @var $this PhpRenderer */ + +echo $this->messenger()->addCurrentMessagesFromFlashMessengerWithNoNamespace(); + +?> diff --git a/module/Application/view/layout/layout.phtml b/module/Application/view/layout/layout.phtml index 828213b1ecdb887a78830b2ca1b8e760f2b2b16a..47d770005ea95608fa1b6de6c706216d5d8bf2c4 100644 --- a/module/Application/view/layout/layout.phtml +++ b/module/Application/view/layout/layout.phtml @@ -4,8 +4,8 @@ <!-- Meta --> <meta charset="utf-8"> <?php echo $this->headMeta()->appendName('viewport', 'width=device-width, initial-scale=1.0') - ->appendName('description', '') - ->appendHttpEquiv("X-UA-Compatible", "IE=edge,chrome=1") ?> + ->appendName('description', '') + ->appendHttpEquiv("X-UA-Compatible", "IE=edge,chrome=1") ?> <!-- Title --> <?php echo $this->headTitle($this->appInfos()->nom)->setSeparator(' - ')->setAutoEscape(false) ?> @@ -95,10 +95,10 @@ <div id="contenu-principal" class="container"> <?php if (($menuSecondaire = $this->navigation()->menuSecondaire('navigation')->setMaxDepth(3)->render())): ?> <div class="row"> - <div id="sidebar" class="col-xs-6 col-md-2" role="navigation"> + <div id="sidebar" class="col-md-2" role="navigation"> <?php echo $menuSecondaire; ?> </div> - <div id="content" class="col-xs-12 col-md-10"> + <div id="content" class="col-md-10"> <?php echo $this->content; ?> </div> </div> diff --git a/module/Autoform/Module.php b/module/Autoform/Module.php index 2d8351108f7a61810c40c41e1d53c1b70af03e7d..a677c2739a66e33ac8ba0971f203127f89b0be6b 100755 --- a/module/Autoform/Module.php +++ b/module/Autoform/Module.php @@ -9,6 +9,7 @@ namespace Autoform; +use Zend\Http\Request as HttpRequest; use Zend\Mvc\ModuleRouteListener; use Zend\Mvc\MvcEvent; use Zend\Stdlib\ArrayUtils; @@ -28,7 +29,7 @@ class Module $eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch', function (MvcEvent $e) { $request = $e->getRequest(); - if ($request->isXmlHttpRequest()) { + if ($request instanceof HttpRequest && $request->isXmlHttpRequest()) { $e->getTarget()->layout('layout/ajax.phtml'); } } diff --git a/module/Autoform/src/Autoform/View/Helper/ChampAsInputHelper.php b/module/Autoform/src/Autoform/View/Helper/ChampAsInputHelper.php index 9a02c8611a681477d6f8b21084b3975b6df273a8..74ff70dee7b20069b7f5c856d708e16de7afa725 100644 --- a/module/Autoform/src/Autoform/View/Helper/ChampAsInputHelper.php +++ b/module/Autoform/src/Autoform/View/Helper/ChampAsInputHelper.php @@ -2,9 +2,11 @@ namespace Autoform\View\Helper; +use Application\View\Renderer\PhpRenderer; use Autoform\Entity\Db\Champ; use Autoform\Entity\Db\FormulaireReponse; use Zend\Form\View\Helper\AbstractHelper; +use Zend\View\Resolver\TemplatePathStack; class ChampAsInputHelper extends AbstractHelper { @@ -18,121 +20,84 @@ class ChampAsInputHelper extends AbstractHelper public function render($champ, $data = null) { $texte = ""; + /** @var PhpRenderer $view */ + $view = $this->getView(); + $view->resolver()->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); + $reponse = (isset($data[$champ->getId()]))?$data[$champ->getId()]->getReponse():null; switch($champ->getElement()) { case Champ::TYPE_LABEL : - $texte .= '<strong>'.$champ->getLibelle().'</strong>'; + $texte .= '<div class="row"><div class="form-group"><strong>'.$champ->getLibelle().'</strong></div></div>'; break; case Champ::TYPE_SPACER : - $texte .= ' <br/>'; + $texte .= '<div class="row"><div class="form-group"> </div></div>'; break; case Champ::TYPE_CHECKBOX : - $texte .= '<div class="form-group">'; - $texte .= '<div class="col-sm-offset-1 col-sm-11">'; - $texte .= '<label>'; - $texte .= '<input type="checkbox" name="'.$champ->getId().'"'; - if ($reponse && $reponse === 'on') $texte .= ' checked '; - $texte .= '/> '.$champ->getLibelle(); - $texte .= '</label>'; - $texte .= '</div>'; - $texte .= '</div>'; + $texte .= $view->partial('input-checkbox', ['champ' => $champ, 'reponse' => $reponse]); break; case Champ::TYPE_TEXT : - $texte .= '<div class="form-group">'; - $texte .= '<label for="text_'.$champ->getId().'" class="col-sm-2 control-label">'; - $texte .= $champ->getLibelle().' : '; - $texte .= '</label>'; - $texte .= '<div class="col-sm-10">'; - $texte .= '<input class="form-control" type="text" id="text_'.$champ->getId().'" name="'.$champ->getId().'" value="'; - if (trim($reponse) !== '') $texte .= $reponse; - $texte .='" />'; - $texte .= '</div>'; - $texte .= '</div>'; + $texte .= $view->partial('input-text', ['champ' => $champ, 'reponse' => $reponse]); break; case Champ::TYPE_TEXTAREA : - $texte .= '<div class="form-group">'; - $texte .= '<label for="textarea_'.$champ->getId().'" class="col-sm-2 control-label">'; - $texte .= $champ->getLibelle(). ' : '; - $texte .= '</label>'; - $texte .= '<div class="col-sm-10">'; - $texte .= '<textarea class="form-control" id="textarea_'.$champ->getId().'" name="'.$champ->getId().'" >'; - if (trim($reponse) !== '') $texte .= $reponse; - $texte .= '</textarea>'; - $texte .= '</div>'; - $texte .= '</div>'; + $texte .= $view->partial('input-textarea', ['champ' => $champ, 'reponse' => $reponse]); break; case Champ::TYPE_SELECT : - $options = explode(';', $champ->getOptions()); - - $texte .= '<div class="form-group">'; - $texte .= '<label for="textarea_'.$champ->getId().'" class="col-sm-2 control-label">'; - $texte .= $champ->getLibelle(). ' : '; - $texte .= '</label>'; - $texte .= '<div class="col-sm-10">'; - $texte .= '<select class="form-control" name="'.$champ->getId().'">'; - $texte .= '<option value="null"></option>'; - foreach ($options as $option) { - $texte .= '<option value="'.$option.'"'; - if ($reponse === $option) $texte .= ' selected '; - $texte .= '>'.$option.'</option>'; - } - $texte .= '</select>'; - $texte .= '</div>'; - $texte .= '</div>'; - break; - case Champ::TYPE_PERIODE : - $isBalisee = false; - $date1 = null; - $date2 = null; - - $periode = ["Année entière", "Premier semestre", "Second semestre", "Balisée"]; - $texte .= '<div class="form-group">'; - $texte .= '<label for="textarea_'.$champ->getId().'" class="col-sm-2 control-label">'; - $texte .= $champ->getLibelle(). ' : '; - $texte .= '</label>'; - $texte .= '<div class="col-sm-10">'; - $texte .= '<select name="select_'.$champ->getId().'">'; - $texte .= '<option value="null"></option>'; - foreach ($periode as $item) { - $texte .= '<option value="'.$item.'"'; - if ($item === $reponse) $texte .= ' selected '; - if ($item === 'Balisée' && substr($reponse, 0,3) === 'Du ' && substr($reponse, 13,4) === ' au ') { - $isBalisee = true; - $texte .= ' selected '; - } - $texte .= '>'.$item.'</option>'; - } - $texte .= '</select>'; - - if ($isBalisee) { - $splits = explode(' ', $reponse); - $splits1 = explode('/', $splits[1]); - $date1 = $splits1[2]. "-" . $splits1[1] . "-" .$splits1[0]; - $splits2 = explode('/', $splits[3]); - $date2 = $splits2[2]. "-" . $splits2[1] . "-" .$splits2[0]; - - } - $texte .= '<span id="datation_'.$champ->getId().'">'; - $texte .= ' du '; - $texte .= '<input type="date" name="debut_'.$champ->getId().'"'; - if ($isBalisee) $texte .=' value="'.$date1.'" '; - $texte .= '/>'; - $texte .= ' au '; - $texte .= '<input type="date" name="fin_'.$champ->getId().'"'; - if ($isBalisee) $texte .=' value="'.$date2.'" '; - $texte .='/>'; - $texte .= '</span>'; - - $texte .= '</div>'; - $texte .= '</div>'; + $texte .= $view->partial('input-select', ['champ' => $champ, 'reponse' => $reponse]); break; + +// case Champ::TYPE_PERIODE : +// $isBalisee = false; +// $date1 = null; +// $date2 = null; +// +// $periode = ["Année entière", "Premier semestre", "Second semestre", "Balisée"]; +// $texte .= '<div class="form-group">'; +// $texte .= '<label for="textarea_'.$champ->getId().'" class="col-sm-2 control-label">'; +// $texte .= $champ->getLibelle(). ' : '; +// $texte .= '</label>'; +// $texte .= '<div class="col-sm-10">'; +// $texte .= '<select name="select_'.$champ->getId().'">'; +// $texte .= '<option value="null"></option>'; +// foreach ($periode as $item) { +// $texte .= '<option value="'.$item.'"'; +// if ($item === $reponse) $texte .= ' selected '; +// if ($item === 'Balisée' && substr($reponse, 0,3) === 'Du ' && substr($reponse, 13,4) === ' au ') { +// $isBalisee = true; +// $texte .= ' selected '; +// } +// $texte .= '>'.$item.'</option>'; +// } +// $texte .= '</select>'; +// +// if ($isBalisee) { +// $splits = explode(' ', $reponse); +// $splits1 = explode('/', $splits[1]); +// $date1 = $splits1[2]. "-" . $splits1[1] . "-" .$splits1[0]; +// $splits2 = explode('/', $splits[3]); +// $date2 = $splits2[2]. "-" . $splits2[1] . "-" .$splits2[0]; +// +// } +// $texte .= '<span id="datation_'.$champ->getId().'">'; +// $texte .= ' du '; +// $texte .= '<input type="date" name="debut_'.$champ->getId().'"'; +// if ($isBalisee) $texte .=' value="'.$date1.'" '; +// $texte .= '/>'; +// $texte .= ' au '; +// $texte .= '<input type="date" name="fin_'.$champ->getId().'"'; +// if ($isBalisee) $texte .=' value="'.$date2.'" '; +// $texte .='/>'; +// $texte .= '</span>'; +// +// $texte .= '</div>'; +// $texte .= '</div>'; +// break; default : $texte .= 'Type ['. $champ->getElement() .'] inconnu !'; break; diff --git a/module/Autoform/src/Autoform/View/Helper/ChampAsResultHelper.php b/module/Autoform/src/Autoform/View/Helper/ChampAsResultHelper.php index 253559dbf145c8231dabe430820233ca33954d77..720e28cd1c97b63cd6cf6e587fc745ca977285c7 100644 --- a/module/Autoform/src/Autoform/View/Helper/ChampAsResultHelper.php +++ b/module/Autoform/src/Autoform/View/Helper/ChampAsResultHelper.php @@ -26,61 +26,24 @@ class ChampAsResultHelper extends AbstractHelper break; case Champ::TYPE_TEXT : $texte .= $champ->getLibelle(). ' : '; - - if ($data === null) { - $length = rand(8, 20); - for ($i = 0; $i < $length; $i++) { - $value = rand(0, 25) + 97; - $texte .= chr($value); - $space = rand(0, 8); - if ($space === 0) $texte .= ' '; - } - } if ($data !== '') { $texte .= $data; } break; case Champ::TYPE_TEXTAREA : $texte .= $champ->getLibelle(). ' : '; - - if ($data === null) { - $length = rand(50, 200); - for ($i = 0; $i < $length; $i++) { - $value = rand(0, 25) + 97; - $texte .= chr($value); - $space = rand(0, 8); - if ($space === 0) $texte .= ' '; - } - } if ($data !== '') { $texte .= $data; } break; case Champ::TYPE_SELECT : $texte .= $champ->getLibelle(). ' : '; - - if ($data === null) { - $options = explode(';', $champ->getOptions()); - $position = rand(0, count($options) - 1); - $texte .= $options[$position]; - } if ($data !== 'null') { $texte .= $data; } break; case Champ::TYPE_PERIODE : $texte .= $champ->getLibelle(). ' : '; - - if ($data === null) { - $periodes = ['Année entière', 'Premier semestre', 'Second semestre', 'Baslisée']; - $periode = rand(0, 3); - - if ($periode !== 3) { - $texte .= $periodes[$periode]; - } else { - $texte .= 'du ' . '01/01/2111' . ' au ' . '02/02/2222'; - } - } if ($data !== 'null') { $texte .= $data; } diff --git a/module/Autoform/src/Autoform/View/Helper/partial/input-checkbox.phtml b/module/Autoform/src/Autoform/View/Helper/partial/input-checkbox.phtml new file mode 100644 index 0000000000000000000000000000000000000000..37839016d08080e0a46945100e45d919a15337bc --- /dev/null +++ b/module/Autoform/src/Autoform/View/Helper/partial/input-checkbox.phtml @@ -0,0 +1,24 @@ +<?php +/** + * @var Champ $champ + * @var string $reponse + */ + +use Autoform\Entity\Db\Champ; + +$options = explode(';', $champ->getOptions()); +?> +<div class="row"> + <div class="form-group"> + <div class="col-sm-offset-1 col-sm-11"> + <label> + <input type="checkbox" name="<?php echo $champ->getId()?>" + <?php if ($reponse && $reponse === 'on') :?> + checked + <?php endif; ?> + /> <?php echo $champ->getLibelle(); ?> + </label> + </div> + </div> +</div> + diff --git a/module/Autoform/src/Autoform/View/Helper/partial/input-select.phtml b/module/Autoform/src/Autoform/View/Helper/partial/input-select.phtml new file mode 100644 index 0000000000000000000000000000000000000000..50cf9055be3ffa255e467a820316ffe39bc17bf4 --- /dev/null +++ b/module/Autoform/src/Autoform/View/Helper/partial/input-select.phtml @@ -0,0 +1,32 @@ +<?php +/** + * @var Champ $champ + * @var string $reponse + */ + +use Autoform\Entity\Db\Champ; + +$options = explode(';', $champ->getOptions()); +?> +<div class="row"> +<div class="form-group" style="display: block;"> + <label for="textarea_<?php echo $champ->getId()?>" class="col-sm-2 control-label"> + <?php echo $champ->getLibelle(); ?> : + </label> + <div class="col-sm-10"> + <select class="form-control" name="<?php echo $champ->getId(); ?>"> + <option value="null"></option> + <?php foreach ($options as $option) : ?> + <option value="<?php echo $option; ?>" + <?php if ($reponse === $option) : ?> + selected + <?php endif; ?> + > + <?php echo $option; ?> + </option> + <?php endforeach; ?> + </select> + </div> +</div> +</div> + diff --git a/module/Autoform/src/Autoform/View/Helper/partial/input-text.phtml b/module/Autoform/src/Autoform/View/Helper/partial/input-text.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d05c3848686e52cb2d187ddf4b7cfebebe4544f3 --- /dev/null +++ b/module/Autoform/src/Autoform/View/Helper/partial/input-text.phtml @@ -0,0 +1,25 @@ +<?php +/** + * @var Champ $champ + * @var string $reponse + */ + +use Autoform\Entity\Db\Champ; + +$options = explode(';', $champ->getOptions()); +?> + +<div class="row"> + <div class="form-group"> + <label for="text_<?php echo $champ->getId()?>" class="col-sm-2 control-label"> + <?php echo $champ->getLibelle()?> : + </label> + <div class="col-sm-10"> + <input class="form-control" type="text" id="text_<?php echo $champ->getId()?>" name="<?php echo $champ->getId()?>" value=" + <?php if (trim($reponse) !== ''): ?> + <?php echo $reponse; ?> + <?php endif; ?> + "/> + </div> + </div> +</div> \ No newline at end of file diff --git a/module/Autoform/src/Autoform/View/Helper/partial/input-textarea.phtml b/module/Autoform/src/Autoform/View/Helper/partial/input-textarea.phtml new file mode 100644 index 0000000000000000000000000000000000000000..6421fa37b098e1bb5edb1058fe43f1cb98286809 --- /dev/null +++ b/module/Autoform/src/Autoform/View/Helper/partial/input-textarea.phtml @@ -0,0 +1,31 @@ +<?php +/** + * @var Champ $champ + * @var string $reponse + */ + +use Autoform\Entity\Db\Champ; + +$options = explode(';', $champ->getOptions()); +?> + +<div class="row"> +<div class="form-group"> + <label for="textarea_<?php echo $champ->getId(); ?>" class="col-sm-2 control-label"> + <?php echo $champ->getLibelle(); ?> : + </label> + <div class="col-sm-10"> + <textarea class="form-control" id="textarea_<?php echo $champ->getId(); ?>" name="<?php echo $champ->getId(); ?>" > + <?php if (trim($reponse) !== ''): ?> + <?php echo $reponse; ?> + <?php endif; ?> + </textarea> + </div> +</div> +</div> + +<style> + textarea { + margin-bottom : 10px; + } +</style> \ No newline at end of file diff --git a/module/Autoform/view/autoform/formulaire/afficher-resultat.phtml b/module/Autoform/view/autoform/formulaire/afficher-resultat.phtml index 023f0466fe584e59753dda5b6b280812c52e43e8..3d3b11f2118192ea38265e8e5ffe341bfdd807e1 100644 --- a/module/Autoform/view/autoform/formulaire/afficher-resultat.phtml +++ b/module/Autoform/view/autoform/formulaire/afficher-resultat.phtml @@ -24,7 +24,7 @@ $results = []; foreach ($champs as $champ) { - if ($reponses[$champ->getId()]) $results[] = $reponses[$champ->getId()]; + if ($champ->getId() && isset($reponses[$champ->getId()])) $results[] = $reponses[$champ->getId()]; } ?> diff --git a/module/Fichier/Module.php b/module/Fichier/Module.php index a858e28f3ea44ac895b7fa3514fc4359e77b2061..3f81ced23cdc4f403b4b5e80a8998651871cf2a8 100755 --- a/module/Fichier/Module.php +++ b/module/Fichier/Module.php @@ -2,6 +2,7 @@ namespace Fichier; +use Zend\Http\Request as HttpRequest; use Zend\Mvc\ModuleRouteListener; use Zend\Mvc\MvcEvent; use Zend\Stdlib\ArrayUtils; @@ -19,7 +20,7 @@ class Module $eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch', function (MvcEvent $e) { $request = $e->getRequest(); - if ($request->isXmlHttpRequest()) { + if ($request instanceof HttpRequest && $request->isXmlHttpRequest()) { $e->getTarget()->layout('layout/ajax.phtml'); } } diff --git a/module/Fichier/src/Fichier/Service/Fichier/FichierService.php b/module/Fichier/src/Fichier/Service/Fichier/FichierService.php index 9fbfa8a1b0b618c4785f1b26c96e210613d849b7..b7b94160d3f47bc9eb409d8ec9e1b681ee216400 100644 --- a/module/Fichier/src/Fichier/Service/Fichier/FichierService.php +++ b/module/Fichier/src/Fichier/Service/Fichier/FichierService.php @@ -239,6 +239,4 @@ class FichierService { } $this->delete($fichier); } - - } \ No newline at end of file diff --git a/module/Utilisateur/Module.php b/module/Utilisateur/Module.php index 29118d53e425e7b48782fe626490f8219198b65a..8f5ea568f5fc4e63d5bdb17b276699383f658bdb 100755 --- a/module/Utilisateur/Module.php +++ b/module/Utilisateur/Module.php @@ -3,6 +3,7 @@ namespace Utilisateur; +use Zend\Http\Request as HttpRequest; use Zend\Mvc\ModuleRouteListener; use Zend\Mvc\MvcEvent; use Zend\Stdlib\ArrayUtils; @@ -22,7 +23,7 @@ class Module $eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch', function (MvcEvent $e) { $request = $e->getRequest(); - if ($request instanceof HttpRequest && $request->isXmlHttpRequest()) { + if ($request instanceof HttpRequest &&$request->isXmlHttpRequest()) { $e->getTarget()->layout('layout/ajax.phtml'); } } diff --git a/public/css/app.css b/public/css/app.css index 67f4de8a7e96229f4493d94af96bd195fcd5a2b0..b3d0acb11bc20e96d4d2019b3160324ee856c843 100755 --- a/public/css/app.css +++ b/public/css/app.css @@ -73,7 +73,8 @@ div#navbar.production { } span.TODO { - background-color: deeppink; + background-color: #fff77e; + font-weight: bold; /*animation: blinker 2s linear infinite;*/ } @@ -87,6 +88,11 @@ div.modal div.modal-header { background-color: #337ab7; color: white; } +button.close { + color: white; + opacity: 1; + font-size: xx-large; +} div.modal div.modal-footer { display: none; @@ -190,6 +196,18 @@ span.icon.power:before { content: "\f011"; } +span.icon.plus:before { + content: "\f067"; +} + +span.icon.minus:before { + content: "\f068"; +} + +span.icon.batiment:before { + content: "\f1ad"; +} + div.survol:hover { background-color: lightgoldenrodyellow; } @@ -341,4 +359,37 @@ div.activite h3 { .modal-dialog { width: 1000px; margin: 30px auto; +} + +/** BADGE STRUCTURE ********************************************************************/ + +span.badge.structure { + border-radius: 0.5em; +} + +span.badge.structure.Servicecentral { + background-color: indianred; +} +span.badge.structure.Sousstructureadministrative { + background-color: indianred; +} +span.badge.structure.Servicecommun { + background-color: indianred; +} + +span.badge.structure.Composante { + background-color: #2B6FB6; +} +span.badge.structure.Département { + background-color: #2B6FB6; +} +span.badge.structure.Antenne { + background-color: #2B6FB6; +} +span.badge.structure.Établissement { + background-color: #2B6FB6; +} + +span.badge.structure.Structurederecherche { + background-color: #3c763d; } \ No newline at end of file