diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b25c15b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/src/cadolesuser-1.0/app/AppKernel.php b/src/cadolesuser-1.0/app/AppKernel.php index 18b8dc5d..9f6e7420 100644 --- a/src/cadolesuser-1.0/app/AppKernel.php +++ b/src/cadolesuser-1.0/app/AppKernel.php @@ -17,24 +17,23 @@ class AppKernel extends Kernel new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new \Symfony\Bundle\MakerBundle\MakerBundle(), - new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Symfony\Bundle\AsseticBundle\AsseticBundle(), + new Gregwar\CaptchaBundle\GregwarCaptchaBundle(), new Oneup\UploaderBundle\OneupUploaderBundle(), new Tetranz\Select2EntityBundle\TetranzSelect2EntityBundle(), - + new Ivory\CKEditorBundle\IvoryCKEditorBundle(), + new LightSaml\SymfonyBridgeBundle\LightSamlSymfonyBridgeBundle(), + new LightSaml\SpBundle\LightSamlSpBundle(), new AppBundle\AppBundle(), - new LightSaml\SymfonyBridgeBundle\LightSamlSymfonyBridgeBundle(), - new LightSaml\SpBundle\LightSamlSpBundle(), new Cadoles\SAMLBundle\CadolesSAMLBundle(), - new Cadoles\CASBundle\CadolesCASBundle(), - - new Cadoles\CoreBundle\CadolesCoreBundle() + new Cadoles\CoreBundle\CadolesCoreBundle(), + new Cadoles\PortalBundle\CadolesPortalBundle() ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { diff --git a/src/cadolesuser-1.0/app/config/config.yml b/src/cadolesuser-1.0/app/config/config.yml index d0c59129..e2db424b 100644 --- a/src/cadolesuser-1.0/app/config/config.yml +++ b/src/cadolesuser-1.0/app/config/config.yml @@ -41,6 +41,7 @@ twig: debug: '%kernel.debug%' strict_variables: '%kernel.debug%' form_themes: + - 'CadolesCoreBundle:Form:fields.html.twig' - 'TetranzSelect2EntityBundle:Form:fields.html.twig' # Swiftmailer Configuration @@ -76,10 +77,13 @@ oneup_uploader: frontend: dropzone # or any uploader you use in the frontend header: frontend: dropzone # or any uploader you use in the frontend + icon: + frontend: dropzone # or any uploader you use in the frontend + # gregwar captcha configuration gregwar_captcha: ~ -#light_saml +# light_saml configuration light_saml_symfony_bridge: own: entity_id: '%saml_entityid%' @@ -90,4 +94,35 @@ light_saml_symfony_bridge: password: ~ party: idp: - files: '%saml_idps_list%' \ No newline at end of file + files: '%saml_idps_list%' + +# ckeditor configuration +ivory_ck_editor: + base_path: "ckeditor" + js_path: "ckeditor/ckeditor.js" + configs: + full_config: + language: fr + toolbar: "my_toolbar_1" + uiColor: "#ffffff" + light_config: + language: fr + toolbar: "my_toolbar_2" + uiColor: "#ffffff" + toolbars: + configs: + my_toolbar_1: [ "@document1", "-", "@clipboard1", "-", "@basicstyles1", "-", "@paragraph1", "/", "@links1", "-", "@insert1", "-", "@styles1", "-" , "@colors1", "-" , "@tools1" ] + my_toolbar_2: [ "@basicstyles1", "-", "@paragraph2", "-", "@insert2", "-", "@styles1"] + + items: + document1: [ 'Source','-','NewPage','DocProps','Preview','Print','-','Templates' ] + clipboard1: [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] + basicstyles1: [ 'Bold','Italic','Underline','RemoveFormat' ] + paragraph1: [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] + paragraph2: [ 'JustifyLeft','JustifyCenter','JustifyRight','NumberedList','BulletedList' ] + links1: [ 'Link','Unlink','Anchor' ] + insert1: [ 'Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] + insert2: [ 'Image','Table','Smiley','Link','Unlink' ] + styles1: [ 'Styles','Format','Font','FontSize' ] + colors1: [ 'TextColor','BGColor' ] + tools1: [ 'Maximize', 'ShowBlocks','-','About' ] \ No newline at end of file diff --git a/src/cadolesuser-1.0/app/config/routing.yml b/src/cadolesuser-1.0/app/config/routing.yml index 8c74772b..478ff958 100644 --- a/src/cadolesuser-1.0/app/config/routing.yml +++ b/src/cadolesuser-1.0/app/config/routing.yml @@ -2,6 +2,10 @@ core: resource: "@CadolesCoreBundle/Resources/config/routing.yml" prefix: / +portal: + resource: "@CadolesPortalBundle/Resources/config/routing.yml" + prefix: / + lightsaml_sp: resource: "@LightSamlSpBundle/Resources/config/routing.yml" prefix: saml diff --git a/src/cadolesuser-1.0/app/config/template.yml b/src/cadolesuser-1.0/app/config/template.yml index 38d784b0..cce0b12e 100644 --- a/src/cadolesuser-1.0/app/config/template.yml +++ b/src/cadolesuser-1.0/app/config/template.yml @@ -117,5 +117,6 @@ doctrine: connection: default mappings: CadolesCoreBundle: ~ + CadolesPortalBundle: ~ \ No newline at end of file diff --git a/src/cadolesuser-1.0/composer.json b/src/cadolesuser-1.0/composer.json index d079f038..91542a74 100644 --- a/src/cadolesuser-1.0/composer.json +++ b/src/cadolesuser-1.0/composer.json @@ -20,10 +20,7 @@ "doctrine/doctrine-fixtures-bundle": "^2.3", "doctrine/doctrine-migrations-bundle": "^1.2", "doctrine/orm": "^2.5", - "gregwar/captcha-bundle": "^2.0", "incenteev/composer-parameter-handler": "^2.0", - "oneup/uploader-bundle": "^1.7", - "ramsey/uuid": "^3.7", "sensio/distribution-bundle": "^5.0.19", "sensio/framework-extra-bundle": "^5.0.0", "symfony/assetic-bundle": "^2.8", @@ -33,11 +30,16 @@ "symfony/polyfill-apcu": "^1.0", "symfony/swiftmailer-bundle": "^2.6.4", "symfony/symfony": "3.4.*", - "tetranz/select2entity-bundle": "2.*", "twig/twig": "^1.0||^2.0", "lightsaml/sp-bundle": "^1.2", - "jasig/phpcas": "~1.3" + "jasig/phpcas": "~1.3", + "egeloen/ckeditor-bundle": "^6.0", + "gregwar/captcha-bundle": "^2.0", + "oneup/uploader-bundle": "^1.7", + "ramsey/uuid": "^3.7", + "tetranz/select2entity-bundle": "2.*" + }, "require-dev": { "sensio/generator-bundle": "^3.0", diff --git a/src/cadolesuser-1.0/composer.lock b/src/cadolesuser-1.0/composer.lock index c75c1ce5..73f1f22a 100644 --- a/src/cadolesuser-1.0/composer.lock +++ b/src/cadolesuser-1.0/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c141093eaee870ccf4cbfbc4b7286f1b", - "content-hash": "212be3bef6194e471c90d1ffdd6f93ea", + "hash": "3d04e5154e3db89d141ea33076fa3fd2", + "content-hash": "a6abd6954f83c62fd9dcca07e8a0cbc3", "packages": [ { "name": "composer/ca-bundle", @@ -1090,6 +1090,128 @@ ], "time": "2017-12-17 02:57:51" }, + { + "name": "egeloen/ckeditor-bundle", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/egeloen/IvoryCKEditorBundle.git", + "reference": "9c9926918d3ae4b4d89ca2db578766ab9829ee7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egeloen/IvoryCKEditorBundle/zipball/9c9926918d3ae4b4d89ca2db578766ab9829ee7a", + "reference": "9c9926918d3ae4b4d89ca2db578766ab9829ee7a", + "shasum": "" + }, + "require": { + "egeloen/json-builder": "^2.0|^3.0", + "php": "^5.6|^7.0", + "symfony/dependency-injection": "^2.7|^3.0", + "symfony/form": "^2.7|^3.0", + "symfony/framework-bundle": "^2.7|^3.0" + }, + "require-dev": { + "composer/composer": "^1.0", + "friendsofphp/php-cs-fixer": "^2.0", + "phpunit/phpunit": "^5.0|^6.0", + "sensio/distribution-bundle": "^3.0.12|^4.0|^5.0", + "symfony/asset": "^2.7|^3.0", + "symfony/console": "^2.7|^3.0", + "symfony/phpunit-bridge": "^2.7|^3.0", + "symfony/templating": "^2.7|^3.0", + "symfony/twig-bridge": "^2.7|^3.0", + "symfony/yaml": "^2.7|^3.0", + "twig/twig": "^1.12" + }, + "suggest": { + "egeloen/form-extra-bundle": "Allows to load CKEditor asynchronously", + "sensio/distribution-bundle": "Allows to install CKEditor via a script handler", + "symfony/asset": "Allows to rewrite/version assets", + "symfony/templating": "Allows to use PHP templates", + "symfony/twig-bridge": "Allows to use Twig templates", + "twig/twig": "Allows to use Twig templates" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "autoload": { + "psr-4": { + "Ivory\\CKEditorBundle\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + } + ], + "description": "Provides a CKEditor integration for your Symfony2 Project.", + "keywords": [ + "CKEditor" + ], + "time": "2017-08-18 08:19:45" + }, + { + "name": "egeloen/json-builder", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/egeloen/ivory-json-builder.git", + "reference": "3e70bc681891d8aca88dd72164caea659739f284" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egeloen/ivory-json-builder/zipball/3e70bc681891d8aca88dd72164caea659739f284", + "reference": "3e70bc681891d8aca88dd72164caea659739f284", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^5.6|^7.0", + "symfony/property-access": "^2.7|^3.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "phpunit/phpunit": "^5.0", + "symfony/phpunit-bridge": "^2.7|^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Ivory\\JsonBuilder\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + } + ], + "description": "JSON builder with escaping control for PHP 5.6+", + "keywords": [ + "Escape", + "builder", + "json" + ], + "time": "2017-02-27 20:18:54" + }, { "name": "fig/link-util", "version": "1.0.0", @@ -3370,16 +3492,16 @@ }, { "name": "twig/twig", - "version": "v2.6.2", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "7d7342c8a4059fefb9b8d07db0cc14007021f9b7" + "reference": "70c59531da43afe598c66135e39cac39475a2f51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/7d7342c8a4059fefb9b8d07db0cc14007021f9b7", - "reference": "7d7342c8a4059fefb9b8d07db0cc14007021f9b7", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/70c59531da43afe598c66135e39cac39475a2f51", + "reference": "70c59531da43afe598c66135e39cac39475a2f51", "shasum": "" }, "require": { @@ -3395,7 +3517,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { @@ -3433,7 +3555,7 @@ "keywords": [ "templating" ], - "time": "2019-01-14 15:00:48" + "time": "2019-03-12 18:48:26" }, { "name": "zendframework/zend-code", @@ -3651,16 +3773,16 @@ }, { "name": "symfony/maker-bundle", - "version": "v1.11.4", + "version": "v1.11.5", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "540996bfdcc14ca38dfe4865c020d965020ae821" + "reference": "186ffc80b8f363e04ea3c2ebf49e1263a84b4e39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/540996bfdcc14ca38dfe4865c020d965020ae821", - "reference": "540996bfdcc14ca38dfe4865c020d965020ae821", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/186ffc80b8f363e04ea3c2ebf49e1263a84b4e39", + "reference": "186ffc80b8f363e04ea3c2ebf49e1263a84b4e39", "shasum": "" }, "require": { @@ -3713,7 +3835,7 @@ "scaffold", "scaffolding" ], - "time": "2019-03-01 20:45:16" + "time": "2019-03-11 15:55:09" }, { "name": "symfony/phpunit-bridge", diff --git a/src/cadolesuser-1.0/scripts/cadolesuser-postservice-01.sh b/src/cadolesuser-1.0/scripts/cadolesuser-postservice-01.sh index b40fd001..f8729cf8 100755 --- a/src/cadolesuser-1.0/scripts/cadolesuser-postservice-01.sh +++ b/src/cadolesuser-1.0/scripts/cadolesuser-postservice-01.sh @@ -25,6 +25,7 @@ php bin/console doctrine:schema:update --force --env=prod --no-debug # Insertion data de base php bin/console Core:InitData +php bin/console Portal:InitData # Generation des assets bin/console --env=dev assetic:dump diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php index dc282428..fc032a8d 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/InitDataCommand.php @@ -1,7 +1,7 @@ boot(); - $kernel->loadClassCache(); - $em = $kernel->getContainer()->get('service_container')->get('doctrine.orm.default_entity_manager'); + $output->writeln(''); + $output->writeln('CORE = Default Data'); + + $em = $this->getContainer()->get('doctrine')->getEntityManager(); $finder = new Finder(); $finder->in('src/Cadoles/CoreBundle/Command/data'); - $output->writeln('Init Data for Core !'); // Init 01 = ce qui templetisé + $output->writeln(' > Parametres 01'); $finder->name('core-init-01.sql'); foreach( $finder as $file ){ $content = $file->getContents(); @@ -50,6 +50,7 @@ class InitDataCommand extends Command } // Init 02 = ce qui est toujours le cas + $output->writeln(' > Parametres 02'); $finder->name('core-init-02.sql'); foreach( $finder as $file ){ $content = $file->getContents(); @@ -59,6 +60,7 @@ class InitDataCommand extends Command } // Init country + $output->writeln(' > Pays'); $finder->name('country.sql'); foreach( $finder as $file ){ $content = $file->getContents(); @@ -69,6 +71,7 @@ class InitDataCommand extends Command } // Init city + $output->writeln(' > Villes'); $finder->name('city.sql'); foreach( $finder as $file ){ $content = $file->getContents(); @@ -82,7 +85,7 @@ class InitDataCommand extends Command // On s'assure que le groupe 'Tout le Monde' existe $group=$em->getRepository('CadolesCoreBundle:Group')->findOneBy(array('fgall'=>true)); if (!$group) { - $output->writeln('Création du groupe Tout le Monde'); + $output->writeln(' > Création du groupe Tout le Monde'); $group = new Group(); $group->setLabel("Tout le Monde"); $group->setFgopen(false); @@ -105,13 +108,15 @@ class InitDataCommand extends Command ->setParameter("groupid",$group->getId()); $datas=$qb->getQuery()->getResult(); foreach($datas as $data) { - $output->writeln("Ratachement ".$data->getId()." ".$data->getUsername()); + $output->writeln(" > Ratachement ".$data->getId()." ".$data->getUsername()); $usergroup=new UserGroup(); $usergroup->setUser($data); $usergroup->setGroup($group); $em->persist($usergroup); $em->flush(); } + + $output->writeln(''); } protected static function determineKernelRootDir(Event $event) { diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 31c635bf..ddada894 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -12,14 +12,20 @@ INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastna TRUNCATE TABLE sidebar; INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`) VALUES -(1000, NULL, 1000, 'CONFIGIRATION', '', 'fa-gear', 'ROLE_ADMIN,ROLE_MODO'), -(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN'), -(1200, 1000, 1200, 'Organisations', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO'), -(1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN'), -(1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN'), -(1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO'), -(1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO'), -(1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO'); +(1000, NULL, 1000, 'CONFIGIRATION', NULL, 'fa-gear', 'ROLE_ADMIN,ROLE_MODO'), +(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN'), +(1200, 1000, 1200, 'Organisations', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO'), +(1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN'), +(1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN'), +(1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO'), +(1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO'), +(1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO'), + +(1500, NULL, 1500, 'PORTAIL', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO'), +(1510, 1500, 1510, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO'), +(1520, 1500, 1520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO'), +(1530, 1500, 1530, 'Annonces', 'cadoles_portal_config_alert', 'fa-warning', 'ROLE_ADMIN,ROLE_MODO'); + DELETE FROM `config` WHERE `changeable` = 0; @@ -33,8 +39,8 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type ('041', 1, 1, 1, 'header', 'header', 'uploads/header/header.png', 'fgheader', 'Image en bannière du site'), ('042', 1, 1, 1, 'integer', 'heightheader', '100', 'fgheader', 'Hauteur de la bannière du site'), -('050', 1, 1, 1, 'color', 'colormain', 'bfbfbf', '', 'Couleur principale de votre site'), -('051', 1, 1, 1, 'color', 'fontcolorhover', '2e3131', '', 'Couleur de la police sur couleur principale'), +('050', 1, 1, 1, 'color', 'colormain', '2c3e50', '', 'Couleur principale de votre site'), +('051', 1, 1, 1, 'color', 'fontcolorhover', 'ffffff', '', 'Couleur de la police sur couleur principale'), ('060', 1, 1, 1, 'font', 'fontfacetitle', 'Anton-Regular', '', 'Police des titres de votre site'), ('061', 1, 1, 1, 'font', 'fontfacebody', 'Helvetica', '', 'Police des titres de votre site'), diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php index 516cd123..ba190065 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -38,9 +37,20 @@ class City * @var ArrayCollection $users * @var User * - * @ORM\OneToMany(targetEntity="User", mappedBy="birhtplace", cascade={"persist"}, orphanRemoval=false) + * @ORM\OneToMany(targetEntity="User", mappedBy="birthplace") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") */ private $users; + + /** + * @var ArrayCollection $registrations + * @var User + * + * @ORM\OneToMany(targetEntity="Registration", mappedBy="birthplace") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") + */ + private $registrations; + /** * Constructor */ @@ -140,4 +150,38 @@ class City { return $this->users; } + + /** + * Add registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + * + * @return City + */ + public function addRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations[] = $registration; + + return $this; + } + + /** + * Remove registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + */ + public function removeRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations->removeElement($registration); + } + + /** + * Get registrations + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getRegistrations() + { + return $this->registrations; + } } diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php~ index 516cd123..ba190065 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/City.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -38,9 +37,20 @@ class City * @var ArrayCollection $users * @var User * - * @ORM\OneToMany(targetEntity="User", mappedBy="birhtplace", cascade={"persist"}, orphanRemoval=false) + * @ORM\OneToMany(targetEntity="User", mappedBy="birthplace") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") */ private $users; + + /** + * @var ArrayCollection $registrations + * @var User + * + * @ORM\OneToMany(targetEntity="Registration", mappedBy="birthplace") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") + */ + private $registrations; + /** * Constructor */ @@ -140,4 +150,38 @@ class City { return $this->users; } + + /** + * Add registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + * + * @return City + */ + public function addRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations[] = $registration; + + return $this; + } + + /** + * Remove registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + */ + public function removeRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations->removeElement($registration); + } + + /** + * Get registrations + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getRegistrations() + { + return $this->registrations; + } } diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php index fff752b4..c201db86 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -37,9 +36,20 @@ class Country * @var ArrayCollection $users * @var User * - * @ORM\OneToMany(targetEntity="User", mappedBy="birhtcountry", cascade={"persist"}, orphanRemoval=false) + * @ORM\OneToMany(targetEntity="User", mappedBy="birthcountry") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") */ private $users; + + /** + * @var ArrayCollection $registrations + * @var User + * + * @ORM\OneToMany(targetEntity="Registration", mappedBy="birthcountry") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") + */ + private $registrations; + /** * Constructor */ @@ -139,4 +149,38 @@ class Country { return $this->users; } + + /** + * Add registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + * + * @return Country + */ + public function addRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations[] = $registration; + + return $this; + } + + /** + * Remove registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + */ + public function removeRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations->removeElement($registration); + } + + /** + * Get registrations + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getRegistrations() + { + return $this->registrations; + } } diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php~ index fff752b4..c201db86 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Country.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -37,9 +36,20 @@ class Country * @var ArrayCollection $users * @var User * - * @ORM\OneToMany(targetEntity="User", mappedBy="birhtcountry", cascade={"persist"}, orphanRemoval=false) + * @ORM\OneToMany(targetEntity="User", mappedBy="birthcountry") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") */ private $users; + + /** + * @var ArrayCollection $registrations + * @var User + * + * @ORM\OneToMany(targetEntity="Registration", mappedBy="birthcountry") + * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") + */ + private $registrations; + /** * Constructor */ @@ -139,4 +149,38 @@ class Country { return $this->users; } + + /** + * Add registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + * + * @return Country + */ + public function addRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations[] = $registration; + + return $this; + } + + /** + * Remove registration + * + * @param \Cadoles\CoreBundle\Entity\Registration $registration + */ + public function removeRegistration(\Cadoles\CoreBundle\Entity\Registration $registration) + { + $this->registrations->removeElement($registration); + } + + /** + * Get registrations + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getRegistrations() + { + return $this->registrations; + } } diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php index c3b4dd35..98c2d0f8 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -63,14 +62,23 @@ class Group */ private $users; + /** + * @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Item", mappedBy="groups") + */ + protected $items; + + /** + * @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Alert", mappedBy="groups") + */ + protected $alerts; - /** * Constructor */ public function __construct() { $this->users = new \Doctrine\Common\Collections\ArrayCollection(); + $this->items = new \Doctrine\Common\Collections\ArrayCollection(); } /** @@ -260,4 +268,72 @@ class Group { return $this->users; } + + /** + * Add item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + * + * @return Group + */ + public function addItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items[] = $item; + + return $this; + } + + /** + * Remove item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + */ + public function removeItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items->removeElement($item); + } + + /** + * Get items + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getItems() + { + return $this->items; + } + + /** + * Add alert + * + * @param \Cadoles\PortalBundle\Entity\Alert $alert + * + * @return Group + */ + public function addAlert(\Cadoles\PortalBundle\Entity\Alert $alert) + { + $this->alerts[] = $alert; + + return $this; + } + + /** + * Remove alert + * + * @param \Cadoles\PortalBundle\Entity\Alert $alert + */ + public function removeAlert(\Cadoles\PortalBundle\Entity\Alert $alert) + { + $this->alerts->removeElement($alert); + } + + /** + * Get alerts + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getAlerts() + { + return $this->alerts; + } } diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php~ index 659aa9e5..98c2d0f8 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Group.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -12,7 +11,8 @@ use Symfony\Component\Validator\Constraints as Assert; * @ORM\Entity * @ORM\Table(name="groupe") * @ORM\HasLifecycleCallbacks() - * + * @ORM\Entity(repositoryClass="Cadoles\CoreBundle\Repository\GroupRepository") + * * @UniqueEntity(fields="label", message="Un group existe déjà avec ce label") */ class Group @@ -62,14 +62,23 @@ class Group */ private $users; + /** + * @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Item", mappedBy="groups") + */ + protected $items; + + /** + * @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Alert", mappedBy="groups") + */ + protected $alerts; - /** * Constructor */ public function __construct() { $this->users = new \Doctrine\Common\Collections\ArrayCollection(); + $this->items = new \Doctrine\Common\Collections\ArrayCollection(); } /** @@ -259,4 +268,72 @@ class Group { return $this->users; } + + /** + * Add item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + * + * @return Group + */ + public function addItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items[] = $item; + + return $this; + } + + /** + * Remove item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + */ + public function removeItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items->removeElement($item); + } + + /** + * Get items + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getItems() + { + return $this->items; + } + + /** + * Add alert + * + * @param \Cadoles\PortalBundle\Entity\Alert $alert + * + * @return Group + */ + public function addAlert(\Cadoles\PortalBundle\Entity\Alert $alert) + { + $this->alerts[] = $alert; + + return $this; + } + + /** + * Remove alert + * + * @param \Cadoles\PortalBundle\Entity\Alert $alert + */ + public function removeAlert(\Cadoles\PortalBundle\Entity\Alert $alert) + { + $this->alerts->removeElement($alert); + } + + /** + * Get alerts + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getAlerts() + { + return $this->alerts; + } } diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php index 4af01f8d..9f49594c 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -70,10 +69,10 @@ class Niveau01 private $users; /** - * @var ArrayCollection $users + * @var ArrayCollection $modos * @var User * - * @ORM\OneToMany(targetEntity="UserModo", mappedBy="service", cascade={"persist"}, orphanRemoval=false) + * @ORM\OneToMany(targetEntity="UserModo", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false) */ private $modos; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php~ index 4af01f8d..9f49594c 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau01.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -70,10 +69,10 @@ class Niveau01 private $users; /** - * @var ArrayCollection $users + * @var ArrayCollection $modos * @var User * - * @ORM\OneToMany(targetEntity="UserModo", mappedBy="service", cascade={"persist"}, orphanRemoval=false) + * @ORM\OneToMany(targetEntity="UserModo", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false) */ private $modos; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php index 1c475dd8..cd406662 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -40,7 +39,7 @@ class Niveau02 private $postaladress; /** - * @ORM\ManyToOne(targetEntity="Niveau01") + * @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="niveau02s") * @ORM\JoinColumn(nullable=false) */ private $niveau01; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php~ index 1c475dd8..cd406662 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Niveau02.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; @@ -40,7 +39,7 @@ class Niveau02 private $postaladress; /** - * @ORM\ManyToOne(targetEntity="Niveau01") + * @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="niveau02s") * @ORM\JoinColumn(nullable=false) */ private $niveau01; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php index f6d6d247..4f04d636 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php @@ -124,26 +124,26 @@ class Registration implements UserInterface, \Serializable private $position; /** - * @ORM\ManyToOne(targetEntity="Country") + * @ORM\ManyToOne(targetEntity="Country", inversedBy="registrations") * @ORM\JoinColumn(nullable=true) * @ORM\OrderBy({"label" = "ASC"}) */ private $birthcountry; /** - * @ORM\ManyToOne(targetEntity="City") + * @ORM\ManyToOne(targetEntity="City", inversedBy="registrations") * @ORM\JoinColumn(nullable=true) */ private $birthplace; /** - * @ORM\ManyToOne(targetEntity="Niveau01") + * @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="registrations") * @ORM\JoinColumn(nullable=false) */ private $niveau01; /** - * @ORM\ManyToOne(targetEntity="Niveau02") + * @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="registrations") * @ORM\JoinColumn(nullable=true) */ private $niveau02; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php~ index f6d6d247..4f04d636 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Registration.php~ @@ -124,26 +124,26 @@ class Registration implements UserInterface, \Serializable private $position; /** - * @ORM\ManyToOne(targetEntity="Country") + * @ORM\ManyToOne(targetEntity="Country", inversedBy="registrations") * @ORM\JoinColumn(nullable=true) * @ORM\OrderBy({"label" = "ASC"}) */ private $birthcountry; /** - * @ORM\ManyToOne(targetEntity="City") + * @ORM\ManyToOne(targetEntity="City", inversedBy="registrations") * @ORM\JoinColumn(nullable=true) */ private $birthplace; /** - * @ORM\ManyToOne(targetEntity="Niveau01") + * @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="registrations") * @ORM\JoinColumn(nullable=false) */ private $niveau01; /** - * @ORM\ManyToOne(targetEntity="Niveau02") + * @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="registrations") * @ORM\JoinColumn(nullable=true) */ private $niveau02; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php index ad189516..de2c406f 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php @@ -48,7 +48,7 @@ class Sidebar /** - * @ORM\ManyToOne(targetEntity="Sidebar") + * @ORM\ManyToOne(targetEntity="Sidebar", inversedBy="childs") * @ORM\JoinColumn(nullable=true) */ private $parent; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php~ index ad189516..de2c406f 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Sidebar.php~ @@ -48,7 +48,7 @@ class Sidebar /** - * @ORM\ManyToOne(targetEntity="Sidebar") + * @ORM\ManyToOne(targetEntity="Sidebar", inversedBy="childs") * @ORM\JoinColumn(nullable=true) */ private $parent; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php index 6209f539..bdccda46 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php~ index 6209f539..bdccda46 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Statut.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php index 1d7d57d3..dec78c92 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php @@ -148,25 +148,25 @@ class User implements UserInterface, \Serializable private $belongingpopulation; /** - * @ORM\ManyToOne(targetEntity="Country") + * @ORM\ManyToOne(targetEntity="Country", inversedBy="users") * @ORM\JoinColumn(nullable=true) */ private $birthcountry; /** - * @ORM\ManyToOne(targetEntity="City") + * @ORM\ManyToOne(targetEntity="City", inversedBy="users") * @ORM\JoinColumn(nullable=true) */ private $birthplace; /** - * @ORM\ManyToOne(targetEntity="Niveau01") + * @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="users") * @ORM\JoinColumn(nullable=false) */ private $niveau01; /** - * @ORM\ManyToOne(targetEntity="Niveau02") + * @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="users") * @ORM\JoinColumn(nullable=true) */ private $niveau02; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php~ index 1d7d57d3..dec78c92 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/User.php~ @@ -148,25 +148,25 @@ class User implements UserInterface, \Serializable private $belongingpopulation; /** - * @ORM\ManyToOne(targetEntity="Country") + * @ORM\ManyToOne(targetEntity="Country", inversedBy="users") * @ORM\JoinColumn(nullable=true) */ private $birthcountry; /** - * @ORM\ManyToOne(targetEntity="City") + * @ORM\ManyToOne(targetEntity="City", inversedBy="users") * @ORM\JoinColumn(nullable=true) */ private $birthplace; /** - * @ORM\ManyToOne(targetEntity="Niveau01") + * @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="users") * @ORM\JoinColumn(nullable=false) */ private $niveau01; /** - * @ORM\ManyToOne(targetEntity="Niveau02") + * @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="users") * @ORM\JoinColumn(nullable=true) */ private $niveau02; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php index 75f2d2d2..05b17238 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php~ index 75f2d2d2..05b17238 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php index 0360b430..662666d8 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php~ index 0360b430..662666d8 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/UserModo.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php index 61605723..5087849f 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php~ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php~ index 61605723..5087849f 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php~ +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Entity/Whitelist.php~ @@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Form/IconChoiceType.php b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Form/IconChoiceType.php new file mode 100644 index 00000000..7e2e842c --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Form/IconChoiceType.php @@ -0,0 +1,69 @@ +kernelRootDir = $kernelRootDir; + } + + public function buildView(FormView $view, FormInterface $form, array $options) + { + // Pass this flag is necessary to render the label as raw. + // See below the twig field template for more details. + $view->vars['raw_label'] = true; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'attr' => [ + // It's the key of the solution and can be done in many ways. + // Now, the rendered ',{ + type:'hidden', + name:'_method' + }).val($el.data('method'))); + + var data = $el.data(); + var match, name; + for(var prop in data) { + if(data.hasOwnProperty(prop)){ + match = prop.match(/^field(.*)$/); + if(match) { + name = match[1]; + $form.append($('',{ + type:'text', + name: name.toLowerCase() + }).val(data[prop])); + } + } + } + + //adding a CSRF if needs + if ($(this).data('csrf')) + { + var csrf = $(this).data('csrf').split(':'); + $form.append($('',{ + type:'hidden', + name:csrf[0] + }).val(csrf[1])); + } + + if($(this).data('confirm')){ + doit = confirm($(this).data('confirm')); + } + + if($(this).data('error')){ + alert($(this).data('error')); + } else { + //add form to parent node + $(this).parent().append($form); + + if(doit){ + $form.submit(); + } + } + + return false; + }); +}); \ No newline at end of file diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Core/home.html.twig b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Core/home.html.twig index 3c181287..7e0d30a8 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Core/home.html.twig +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Core/home.html.twig @@ -9,8 +9,9 @@
- {% if not app.user and moderegistration!="none" and masteridentity=="SQL"%} - Mot de passe oublié ? - {% endif %} + + {% if not app.user and moderegistration!="none" and masteridentity=="SQL"%} + Mot de passe oublié ? + {% endif %} {% endblock %} \ No newline at end of file diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Form/fields.html.twig b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Form/fields.html.twig new file mode 100644 index 00000000..1c9f28ff --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Form/fields.html.twig @@ -0,0 +1,176 @@ +{% extends 'form_div_layout.html.twig' %} + +{# Voir https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig #} + +{# On commence par simplement ajouter le form-group au row de nos formulaires #} +{% block form_row -%} + {% spaceless %} + {% set attr = attr|merge({'help': (attr.help|default(true)) }) %} +
+ {{- form_label(form) }} + {{- form_widget(form) }} + {{ form_errors(form) }} +
+ {% endspaceless %} +{%- endblock form_row %} + +{# Puis on modifie très simplement nos input et textarea +les plus importants pour y ajouter le class imposée par Bootstrap 3 #} +{% block textarea_widget %} + {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %} + {{ parent() }} +{% endblock textarea_widget %} + +{% block form_widget_simple %} + {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %} + {{ parent() }} +{% endblock form_widget_simple %} + +{% block form_label -%} + {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' control-label')|trim}) %} + {% if 'checkbox' not in block_prefixes %} + {% if label is not same as(false) -%} + {% if not compound -%} + {% set label_attr = label_attr|merge({'for': id}) %} + {%- endif %} + {% if required -%} + {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} + {%- endif %} + {% if label is empty -%} + {% set label = name|humanize %} + {%- endif -%} + + {{ label|trans({}, translation_domain)|raw }} + {% if required %}*{% endif %} + + {%- endif %} + {% endif %} +{%- endblock form_label %} + +{# et enfin les erreurs #} +{% block form_errors %} + {% spaceless %} + {% if errors|length > 0 %} + {% if attr.help is defined and attr.help %} +

+ {% for error in errors %} + {{ error.message }}
+ {% endfor %} +

+ {% else %} +
+ + {% for error in errors %} + {{ error.message|raw }}
+ {% endfor %} +
+ {% endif %} + {% endif %} + {% endspaceless %} +{% endblock form_errors %} + +{# Personnalisation des boutons #} +{% block button_widget -%} + {% if label is empty -%} + {% set label = name|humanize %} + {%- endif -%} + {% set attr = attr|merge({'class': (attr.class|default('') ~ '')|trim}) %} + +{%- endblock button_widget %} + +{# Personnalisation des attributs des boutons #} +{% block button_attributes -%} + {% if type is defined and type == 'submit' -%} + {% set class = 'btn-primary' %} + {% else %} + {% set class = 'btn-default' %} + {%- endif -%} + {% set attr = attr|merge({'class': (attr.class|default('') ~ ' btn ' ~ class)|trim}) %} + {{ parent() }} +{%- endblock button_attributes %} + + +{# Personnalisation des select #} +{% block choice_widget_collapsed %} + {% spaceless %} + {% set attr = attr|merge({'class': (attr.class|default('') ~ ' form-control')|trim}) %} + {{ parent() }} + {% endspaceless %} +{%- endblock choice_widget_collapsed %} + +{% block choice_widget %} +{% spaceless %} + {% if expanded %} + + {% else %} + {{ parent() }} + {% endif %} +{% endspaceless %} +{% endblock choice_widget %} + +{% block checkbox_widget %} + {% spaceless %} + + {% endspaceless %} +{% endblock checkbox_widget %} + +{% block radio_widget %} +{% spaceless %} +    +{% endspaceless %} +{% endblock radio_widget %} + +{# Inline date marcro #} +{% macro date_form_widget(form) %} + {% spaceless %} +
+ {{ form_widget(form) }} +
+ {% endspaceless %} +{% endmacro %} + +{# Inline date #} +{% block date_widget %} + {% spaceless %} + {% if widget == 'single_text' %} + {{ block('form_widget_simple') }} + {% else %} + {% import _self as self %} +
+ {{ date_pattern|replace({ + '{{ year }}': self.date_form_widget(form.year), + '{{ month }}': self.date_form_widget(form.month), + '{{ day }}': self.date_form_widget(form.day) + })|raw }} +
+ {% endif %} + {% endspaceless %} +{% endblock date_widget %} + + +{% block file_widget %} + {% spaceless %} + {% set type = type|default('file') %} + + {% endspaceless %} +{% endblock file_widget %} diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Include/head.html.twig b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Include/head.html.twig index 315745fd..84293e8b 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Include/head.html.twig +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/Include/head.html.twig @@ -83,6 +83,128 @@ margin-bottom: 10px; } + .category-list-item { + min-height: 30px; + } + + .category-list-item-placeholder { + border: 2px dotted #3498db; + } + + .alert-list-item { + min-height: 50px; + margin-top: 5px; + } + + .alert-list-item-placeholder { + border: 2px dotted #3498db; + } + + span.item-drag { + display: block; + position: absolute; + left: 0; + top: 0; + z-index: 1000; + width: 32px; + background: rgba(0,0,0,.1); + line-height: 35px; + height: 32px; + text-align: center; + color: #fff; + transition: background .2s; + border-radius: 0 0 10px 0; + } + + .grid-title { + background: transparent; + cursor: pointer; + padding-top: 10px; + } + + .grid { + list-style-type: none; + margin: 0; + padding: 0; + width: 100%; + min-height: 30px; + background: transparent; + margin-bottom: 20px; + } + + .grid .grid-item { + float: left; + margin: 2px; + padding: 0; + width: calc(33.333333333% - 5px); /* 1px more to fix */ + height: 150px; + text-align: center; + position: relative; + display: block; + } + + .grid-item .grid-item-content:hover { + opacity: 0.8; + } + + .grid-item .item-link { + width: 100%; + align-items: center; + justify-content: center; + font-size: 18px !important; + color: #fff; + display: block; + text-align: left; + height: 150px; + } + + .grid-item .item-link a { + color: #fff; + } + + .grid-item .item-link { + text-decoration: none !important; + } + + .grid-item-logo { + display: inline-block; + padding: 10px; + width: 40%; + height: 150px; + vertical-align: middle; + text-align: center; + } + + .grid-item .item-link img { + display: block; + margin: 10 auto; + max-width: 100%; + max-height: 110px; + height: auto; + } + + .grid-item .grid-item-title { + display: inline-block; + vertical-align: top; + padding-top: 15px; + font-size: 12px; + width: 50%; + line-height: 1; + } + + .grid-item .grid-item-title h2 { + font-size: 20px; + margin: 10px 0 0 0; + border-bottom: 1px solid #fff; + padding-bottom: 5px; + margin-bottom: 5px; + text-transform: uppercase; + color: #fff; + } + + .grid-item-placeholder { + border: 2px dotted #3498db; + } +
{% set usesidebar = true %} diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/nosidebar.html.twig b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/nosidebar.html.twig index a0efa154..fc846986 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/nosidebar.html.twig +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/nosidebar.html.twig @@ -4,6 +4,11 @@ {{ include('@CadolesCore/Include/head.html.twig') }} + +
{% set usesidebar = false %} diff --git a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/simple.html.twig b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/simple.html.twig index 849922e6..17f2cdf6 100644 --- a/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/simple.html.twig +++ b/src/cadolesuser-1.0/src/Cadoles/CoreBundle/Resources/views/simple.html.twig @@ -4,6 +4,11 @@ {{ include('@CadolesCore/Include/head.html.twig') }} + +
{% block pagewrapper %} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php index 9a8971ad..42a41a19 100644 --- a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -1,7 +1,7 @@ getContainer()->get('doctrine')->getEntityManager(); + + + $output->writeln('PORTAL = Default Data'); + + // Creation des icons + $output->writeln(' > Creation icons'); + $finder = new Finder(); + $finder->in('web/uploads/icon/'); + $finder->name('icon_*'); + foreach ($finder as $file) { + $image="uploads/icon/".$file->getRelativePathname(); + $entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>$image]); + if(!$entityicon) { + $entityicon = new Icon; + $entityicon->setLabel($image); + $em->persist($entityicon); + } + } + $em->flush(); + $output->writeln(''); } } diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/AlertController.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/AlertController.php new file mode 100644 index 00000000..bc77b0a8 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/AlertController.php @@ -0,0 +1,192 @@ +getDoctrine()->getRepository('CadolesPortalBundle:Alert')->findBy([], ['rowOrder' => 'asc']); + $alertcategorys = $this->getDoctrine()->getRepository('CadolesPortalBundle:Alertcategory')->findAll(); + $groups = $this->getDoctrine()->getRepository('CadolesCoreBundle:Group')->findBy([], ['label' => 'asc']); + + return $this->render($this->labelentity.':list.html.twig', [ + 'alerts' => $alerts, + 'alertcategorys' => $alertcategorys, + 'groups' => $groups + ]); + } + + public function submitAction(Request $request) + { + // Initialisation de l'enregistrement + $data = new Alert(); + + // Création du formulaire + $form = $this->createForm(AlertType::class,$data,array("mode"=>"submit")); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm(null,$form,$request,$data,"submit"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); + $em = $this->getDoctrine()->getManager(); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute($this->labelroute); + } + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'submit', + 'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(), + 'form' => $form->createView() + )); + } + + public function updateAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est modifiable + + // Création du formulaire + $form = $this->createForm(AlertType::class,$data,array( + "mode" => "update" + )); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm($id,$form,$request,$data,"update"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $data = $form->getData(); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute($this->labelroute); + } + + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'update', + 'form' => $form->createView() + )); + } + + public function deleteAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est supprimable + + // Supprimer la donnée + $em = $this->getDoctrine()->getManager(); + $em->remove($data); + $em->flush(); + + return $this->redirectToRoute($this->labelroute); + } + + public function orderAction(Request $request) + { + // S'assurer que c'est un appel ajax + if (!$request->isXmlHttpRequest()) { + return new JsonResponse(array('message' => 'Interdit'), 400); + } + + $output=array(); + $id=$request->request->get('id'); + $order=$request->request->get('order'); + + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository($this->labelentity)->find($id); + if (!$entity) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + $entity->setRoworder($order); + $em->persist($entity); + $em->flush(); + + $response = new Response(json_encode($output)); + $response->headers->set('Content-Type', 'application/json'); + return $response; + } + + protected function getDatas() + { + $em = $this->getDoctrine()->getManager(); + $datas = $em->getRepository($this->labelentity)->findAll(); + return $datas; + } + + protected function getData($id) + { + $em = $this->getDoctrine()->getManager(); + $data = $em->getRepository($this->labelentity)->find($id); + + if (!$data) { + throw $this->createNotFoundException('Unable to find '.$this->labeldata); + } + + return $data; + } + + protected function getErrorForm($id,$form,$request,$data,$mode) { + if ($form->get('submit')->isClicked()&&$mode=="delete") { + } + + if ($form->get('submit')->isClicked() && $mode=="submit") { + } + + if ($form->get('submit')->isClicked() && !$form->isValid()) { + $this->get('session')->getFlashBag()->clear(); + $validator = $this->get('validator'); + $errors = $validator->validate($data); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + + $errors = $form->getErrors(); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + } + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/AlertcategoryController.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/AlertcategoryController.php new file mode 100644 index 00000000..36f46f58 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/AlertcategoryController.php @@ -0,0 +1,150 @@ +createForm(AlertcategoryType::class,$data,array("mode"=>"submit")); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm(null,$form,$request,$data,"submit"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); + $em = $this->getDoctrine()->getManager(); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute("cadoles_portal_config_alert"); + } + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'submit', + 'form' => $form->createView() + )); + } + + public function updateAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est modifiable + + // Création du formulaire + $form = $this->createForm(AlertcategoryType::class,$data,array("mode"=>"update")); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm($id,$form,$request,$data,"update"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $data = $form->getData(); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute("cadoles_portal_config_alert"); + } + + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'update', + 'form' => $form->createView() + )); + } + + public function deleteAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est supprimable + + // Supprimer la donnée + $em = $this->getDoctrine()->getManager(); + $em->remove($data); + $em->flush(); + + return $this->redirectToRoute("cadoles_portal_config_alert"); + } + + protected function getDatas() + { + $em = $this->getDoctrine()->getManager(); + $datas = $em->getRepository($this->labelentity)->findAll(); + return $datas; + } + + protected function getData($id) + { + $em = $this->getDoctrine()->getManager(); + $data = $em->getRepository($this->labelentity)->find($id); + + if (!$data) { + throw $this->createNotFoundException('Unable to find '.$this->labeldata); + } + + return $data; + } + + protected function getErrorForm($id,$form,$request,$data,$mode) { + if ($form->get('submit')->isClicked()&&$mode=="delete") { + } + + if ($form->get('submit')->isClicked() && $mode=="submit") { + } + + if ($form->get('submit')->isClicked() && !$form->isValid()) { + $this->get('session')->getFlashBag()->clear(); + $validator = $this->get('validator'); + $errors = $validator->validate($data); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + + $errors = $form->getErrors(); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + } + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/IconController.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/IconController.php index 5128a756..47c1003b 100644 --- a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/IconController.php +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/IconController.php @@ -14,80 +14,17 @@ use Cadoles\PortalBundle\Form\IconType; class IconController extends Controller { - private $labelroute = 'cadoles_icon_config_icon'; + private $labelroute = 'cadoles_portal_config_icon'; private $labelentity = 'CadolesPortalBundle:Icon'; private $labeldata = 'icon'; private $labeldatas = 'icons'; public function listAction() { - return $this->render('CadolesPortalBundle:Icon:list.html.twig'); + + return $this->render($this->labelentity.':list.html.twig',[$this->labeldatas=>$this->getDatas()]); } - public function ajaxlistAction(Request $request) - { - // S'assurer que c'est un appel ajax - if (!$request->isXmlHttpRequest()) { - return new JsonResponse(array('message' => 'Interdit'), 400); - } - - $em = $this->getDoctrine()->getManager(); - - $start=$request->query->get('start'); - $length= $request->query->get('length'); - $search= $request->query->get('search'); - $draw= $request->query->get('draw'); - $order= $request->query->get('order'); - - // Nombre total d'enregistrement - $total = $em->createQueryBuilder()->select('COUNT(table)')->from($this->labelentity,'table')->getQuery()->getSingleScalarResult(); - - // Nombre d'enregistrement filtré - if($search["value"]=="") - $totalf = $total; - else { - $totalf= $em->createQueryBuilder() - ->select('COUNT(table)') - ->from($this->labelentity,'table') - ->where('table.label LIKE :value') - ->setParameter("value", "%".$search["value"]."%") - ->getQuery() - ->getSingleScalarResult(); - } - - // Construction du tableau de retour - $output = array( - 'draw' => $draw, - 'recordsFiltered' => $totalf, - 'recordsTotal' => $total, - 'data' => array(), - ); - - // Parcours des Enregistrement - $qb = $em->createQueryBuilder(); - $qb->select('table')->from($this->labelentity,'table'); - if($search["value"]!="") { - $qb ->where('table.label LIKE :value') - ->setParameter("value", "%".$search["value"]."%"); - } - switch($order[0]["column"]) { - case 1 : - $qb->orderBy('table.label',$order[0]["dir"]); - break; - } - - $datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult(); - - foreach($datas as $data) { - $action ="$data->getId()))."'>"; - $action.="$data->getId()))."'>"; - array_push($output["data"],array($action,$data->getLabel())); - } - - // Retour - return new Response(json_encode($output), 200); - } - public function submitAction(Request $request) { // Initialisation de l'enregistrement @@ -168,30 +105,18 @@ class IconController extends Controller // Vérifier que cet enregistrement est supprimable - // Création du formulaire - $form = $this->createForm(IconType::class,$data,array("mode"=>"delete")); - - // Récupération des data du formulaire - $form->handleRequest($request); - - // Sur erreur - $this->getErrorForm($id,$form,$request,$data,"delete"); - - // Sur validation - if ($form->get('submit')->isClicked() && $form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $em->remove($data); - $em->flush(); + // Supprimer la donnée + $em = $this->getDoctrine()->getManager(); + $em->remove($data); + $em->flush(); - return $this->redirectToRoute($this->labelroute); - } - - // Affichage du formulaire - return $this->render($this->labelentity.':edit.html.twig', array( - $this->labeldata => $data, - 'mode' => 'delete', - 'form' => $form->createView() - )); + return $this->redirectToRoute($this->labelroute); + } + + + public function iconAction() + { + return $this->render('CadolesPortalBundle:Icon:icon.html.twig'); } protected function getDatas() diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/ItemController.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/ItemController.php new file mode 100644 index 00000000..04520fc8 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/ItemController.php @@ -0,0 +1,202 @@ +getDoctrine()->getRepository('CadolesPortalBundle:Itemcategory')->findBy([], ['rowOrder' => 'asc']); + $groups = $this->getDoctrine()->getRepository('CadolesCoreBundle:Group')->findBy([], ['label' => 'asc']); + + return $this->render($this->labelentity.':list.html.twig', [ + 'itemcategorys' => $itemcategorys, + 'groups' => $groups + ]); + } + + public function submitAction(Request $request) + { + // Initialisation de l'enregistrement + $data = new Item(); + + // Création du formulaire + $form = $this->createForm(ItemType::class,$data,array("mode"=>"submit")); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm(null,$form,$request,$data,"submit"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); + $em = $this->getDoctrine()->getManager(); + + $idicon = $form->get('idicon')->getData(); + $icon=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findoneby(["id"=>$idicon]); + $data->setIcon($icon); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute($this->labelroute); + } + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'submit', + 'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(), + 'form' => $form->createView() + )); + } + + public function updateAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est modifiable + + // Création du formulaire + $form = $this->createForm(ItemType::class,$data,array( + "mode" => "update", + "idicon" => ($data->getIcon()?$data->getIcon()->getId():null), + )); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm($id,$form,$request,$data,"update"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $data = $form->getData(); + + $idicon = $form->get('idicon')->getData(); + $icon=$this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findoneby(["id"=>$idicon]); + $data->setIcon($icon); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute($this->labelroute); + } + + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'update', + 'icons' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Icon")->findAll(), + 'form' => $form->createView() + )); + } + + public function deleteAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est supprimable + + // Supprimer la donnée + $em = $this->getDoctrine()->getManager(); + $em->remove($data); + $em->flush(); + + return $this->redirectToRoute($this->labelroute); + } + + public function orderAction(Request $request) + { + // S'assurer que c'est un appel ajax + if (!$request->isXmlHttpRequest()) { + return new JsonResponse(array('message' => 'Interdit'), 400); + } + + $output=array(); + $id=$request->request->get('id'); + $categoryid=$request->request->get('categoryid'); + $order=$request->request->get('order'); + + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository($this->labelentity)->find($id); + if (!$entity) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + $entity->setRoworder($order); + $entity->setItemcategory($em->getRepository("CadolesPortalBundle:Itemcategory")->find($categoryid)); + $em->persist($entity); + $em->flush(); + + $response = new Response(json_encode($output)); + $response->headers->set('Content-Type', 'application/json'); + return $response; + } + + protected function getDatas() + { + $em = $this->getDoctrine()->getManager(); + $datas = $em->getRepository($this->labelentity)->findAll(); + return $datas; + } + + protected function getData($id) + { + $em = $this->getDoctrine()->getManager(); + $data = $em->getRepository($this->labelentity)->find($id); + + if (!$data) { + throw $this->createNotFoundException('Unable to find '.$this->labeldata); + } + + return $data; + } + + protected function getErrorForm($id,$form,$request,$data,$mode) { + if ($form->get('submit')->isClicked()&&$mode=="delete") { + } + + if ($form->get('submit')->isClicked() && $mode=="submit") { + } + + if ($form->get('submit')->isClicked() && !$form->isValid()) { + $this->get('session')->getFlashBag()->clear(); + $validator = $this->get('validator'); + $errors = $validator->validate($data); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + + $errors = $form->getErrors(); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + } + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/ItemcategoryController.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/ItemcategoryController.php new file mode 100644 index 00000000..ee438fdd --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Controller/ItemcategoryController.php @@ -0,0 +1,177 @@ +createForm(ItemcategoryType::class,$data,array("mode"=>"submit")); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm(null,$form,$request,$data,"submit"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); + $em = $this->getDoctrine()->getManager(); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute("cadoles_portal_config_item"); + } + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'submit', + 'form' => $form->createView() + )); + } + + public function updateAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est modifiable + + // Création du formulaire + $form = $this->createForm(ItemcategoryType::class,$data,array("mode"=>"update")); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur erreur + $this->getErrorForm($id,$form,$request,$data,"update"); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $data = $form->getData(); + + // Sauvegarde + $em->persist($data); + $em->flush(); + + // Retour à la liste + return $this->redirectToRoute("cadoles_portal_config_item"); + } + + + // Affichage du formulaire + return $this->render($this->labelentity.':edit.html.twig', array( + $this->labeldata => $data, + 'mode' => 'update', + 'form' => $form->createView() + )); + } + + public function deleteAction($id,Request $request) + { + // Récupération de l'enregistrement courant + $data=$this->getData($id); + + // Vérifier que cet enregistrement est supprimable + + // Supprimer la donnée + $em = $this->getDoctrine()->getManager(); + $em->remove($data); + $em->flush(); + + return $this->redirectToRoute("cadoles_portal_config_item"); + } + + public function orderAction(Request $request) + { + // S'assurer que c'est un appel ajax + if (!$request->isXmlHttpRequest()) { + return new JsonResponse(array('message' => 'Interdit'), 400); + } + + $output=array(); + $id=$request->request->get('id'); + $order=$request->request->get('order'); + + + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository($this->labelentity)->find($id); + if (!$entity) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + $entity->setRoworder($order); + $em->persist($entity); + $em->flush(); + + $response = new Response(json_encode($output)); + $response->headers->set('Content-Type', 'application/json'); + return $response; + } + + protected function getDatas() + { + $em = $this->getDoctrine()->getManager(); + $datas = $em->getRepository($this->labelentity)->findAll(); + return $datas; + } + + protected function getData($id) + { + $em = $this->getDoctrine()->getManager(); + $data = $em->getRepository($this->labelentity)->find($id); + + if (!$data) { + throw $this->createNotFoundException('Unable to find '.$this->labeldata); + } + + return $data; + } + + protected function getErrorForm($id,$form,$request,$data,$mode) { + if ($form->get('submit')->isClicked()&&$mode=="delete") { + } + + if ($form->get('submit')->isClicked() && $mode=="submit") { + } + + if ($form->get('submit')->isClicked() && !$form->isValid()) { + $this->get('session')->getFlashBag()->clear(); + $validator = $this->get('validator'); + $errors = $validator->validate($data); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + + $errors = $form->getErrors(); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + } + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Alert.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Alert.php new file mode 100644 index 00000000..d9fc2766 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Alert.php @@ -0,0 +1,349 @@ +unpublishedat && + $this->publishedat->getTimestamp() <= $today->getTimestamp() + ) { + return true; + } + if ( + $this->publishedat->getTimestamp() <= $today->getTimestamp() && + $this->unpublishedat->getTimestamp() >= $today->getTimestamp() + ) { + return true; + } + + return false; + } + + // IsPending + public function isPending() + { + $today = new \DateTime(); + if ($this->publishedat->getTimestamp() > $today->getTimestamp()) { + return true; + } + return false; + } + + // IsArchived + public function isArchived() + { + $today = new \DateTime(); + if (null === $this->unpublishedat) { + return true; + } + if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) { + return true; + } + return false; + } + + + + /** + * Constructor + */ + public function __construct() + { + $this->groups = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set title + * + * @param string $title + * + * @return Alert + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * Get title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set content + * + * @param string $content + * + * @return Alert + */ + public function setContent($content) + { + $this->content = $content; + + return $this; + } + + /** + * Get content + * + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Set rowOrder + * + * @param integer $rowOrder + * + * @return Alert + */ + public function setRowOrder($rowOrder) + { + $this->rowOrder = $rowOrder; + + return $this; + } + + /** + * Get rowOrder + * + * @return integer + */ + public function getRowOrder() + { + return $this->rowOrder; + } + + /** + * Set publishedat + * + * @param \DateTime $publishedat + * + * @return Alert + */ + public function setpublishedat($publishedat) + { + $this->publishedat = $publishedat; + + return $this; + } + + /** + * Get publishedat + * + * @return \DateTime + */ + public function getpublishedat() + { + return $this->publishedat; + } + + /** + * Set unpublishedat + * + * @param \DateTime $unpublishedat + * + * @return Alert + */ + public function setUnpublishedat($unpublishedat) + { + $this->unpublishedat = $unpublishedat; + + return $this; + } + + /** + * Get unpublishedat + * + * @return \DateTime + */ + public function getUnpublishedat() + { + return $this->unpublishedat; + } + + /** + * Set roles + * + * @param array $roles + * + * @return Alert + */ + public function setRoles($roles) + { + $this->roles = $roles; + + return $this; + } + + /** + * Get roles + * + * @return array + */ + public function getRoles() + { + return $this->roles; + } + + /** + * Set alertcategory + * + * @param \Cadoles\PortalBundle\Entity\Alertcategory $alertcategory + * + * @return Alert + */ + public function setAlertcategory(\Cadoles\PortalBundle\Entity\Alertcategory $alertcategory) + { + $this->alertcategory = $alertcategory; + + return $this; + } + + /** + * Get alertcategory + * + * @return \Cadoles\PortalBundle\Entity\Alertcategory + */ + public function getAlertcategory() + { + return $this->alertcategory; + } + + /** + * Add group + * + * @param \Cadoles\CoreBundle\Entity\Group $group + * + * @return Alert + */ + public function addGroup(\Cadoles\CoreBundle\Entity\Group $group) + { + $this->groups[] = $group; + + return $this; + } + + /** + * Remove group + * + * @param \Cadoles\CoreBundle\Entity\Group $group + */ + public function removeGroup(\Cadoles\CoreBundle\Entity\Group $group) + { + $this->groups->removeElement($group); + } + + /** + * Get groups + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getGroups() + { + return $this->groups; + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Alertcategory.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Alertcategory.php new file mode 100644 index 00000000..f60c08d6 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Alertcategory.php @@ -0,0 +1,177 @@ +alerts = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set label + * + * @param string $label + * + * @return Alertcategory + */ + public function setLabel($label) + { + $this->label = $label; + + return $this; + } + + /** + * Get label + * + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Set icon + * + * @param string $icon + * + * @return Alertcategory + */ + public function setIcon($icon) + { + $this->icon = $icon; + + return $this; + } + + /** + * Get icon + * + * @return string + */ + public function getIcon() + { + return $this->icon; + } + + /** + * Set color + * + * @param string $color + * + * @return Alertcategory + */ + public function setColor($color) + { + $this->color = $color; + + return $this; + } + + /** + * Get color + * + * @return string + */ + public function getColor() + { + return $this->color; + } + + /** + * Add alert + * + * @param \Cadoles\PortalBundle\Entity\Alert $alert + * + * @return Alertcategory + */ + public function addAlert(\Cadoles\PortalBundle\Entity\Alert $alert) + { + $this->alerts[] = $alert; + + return $this; + } + + /** + * Remove alert + * + * @param \Cadoles\PortalBundle\Entity\Alert $alert + */ + public function removeAlert(\Cadoles\PortalBundle\Entity\Alert $alert) + { + $this->alerts->removeElement($alert); + } + + /** + * Get alerts + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getAlerts() + { + return $this->alerts; + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Icon.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Icon.php index d6686950..b3e80e89 100644 --- a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Icon.php +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Icon.php @@ -4,15 +4,13 @@ namespace Cadoles\PortalBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity * @ORM\Table(name="icon") - * @ORM\HasLifecycleCallbacks() - * + * @ORM\HasLifecycleCallbacks * @UniqueEntity(fields="label", message="Un Icone existe déjà avec ce label") */ class Icon @@ -29,7 +27,13 @@ class Icon */ private $label; - + /** + * @var ArrayCollection $items + * @var Item + * + * @ORM\OneToMany(targetEntity="Item", mappedBy="icon", cascade={"persist"}, orphanRemoval=false) + */ + private $items; /** * Get id @@ -64,4 +68,45 @@ class Icon { return $this->label; } + /** + * Constructor + */ + public function __construct() + { + $this->items = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Add item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + * + * @return Icon + */ + public function addItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items[] = $item; + + return $this; + } + + /** + * Remove item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + */ + public function removeItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items->removeElement($item); + } + + /** + * Get items + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getItems() + { + return $this->items; + } } diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Item.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Item.php new file mode 100644 index 00000000..5af6a2b4 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Item.php @@ -0,0 +1,458 @@ +groups = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set title + * + * @param string $title + * + * @return Item + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * Get title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set subtitle + * + * @param string $subtitle + * + * @return Item + */ + public function setSubtitle($subtitle) + { + $this->subtitle = $subtitle; + + return $this; + } + + /** + * Get subtitle + * + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * Set slug + * + * @param string $slug + * + * @return Item + */ + public function setSlug($slug) + { + $this->slug = $slug; + + return $this; + } + + /** + * Get slug + * + * @return string + */ + public function getSlug() + { + return $this->slug; + } + + /** + * Set url + * + * @param string $url + * + * @return Item + */ + public function setUrl($url) + { + $this->url = $url; + + return $this; + } + + /** + * Get url + * + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Set target + * + * @param string $target + * + * @return Item + */ + public function setTarget($target) + { + $this->target = $target; + + return $this; + } + + /** + * Get target + * + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Set content + * + * @param string $content + * + * @return Item + */ + public function setContent($content) + { + $this->content = $content; + + return $this; + } + + /** + * Get content + * + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Set rowOrder + * + * @param integer $rowOrder + * + * @return Item + */ + public function setRowOrder($rowOrder) + { + $this->rowOrder = $rowOrder; + + return $this; + } + + /** + * Get rowOrder + * + * @return integer + */ + public function getRowOrder() + { + return $this->rowOrder; + } + + /** + * Set protected + * + * @param boolean $protected + * + * @return Item + */ + public function setProtected($protected) + { + $this->protected = $protected; + + return $this; + } + + /** + * Get protected + * + * @return boolean + */ + public function getProtected() + { + return $this->protected; + } + + /** + * Set color + * + * @param string $color + * + * @return Item + */ + public function setColor($color) + { + $this->color = $color; + + return $this; + } + + /** + * Get color + * + * @return string + */ + public function getColor() + { + return $this->color; + } + + /** + * Set icon + * + * @param \Cadoles\PortalBundle\Entity\Icon $icon + * + * @return Item + */ + public function setIcon(\Cadoles\PortalBundle\Entity\Icon $icon = null) + { + $this->icon = $icon; + + return $this; + } + + /** + * Get icon + * + * @return \Cadoles\PortalBundle\Entity\Icon + */ + public function getIcon() + { + return $this->icon; + } + + /** + * Set itemcategory + * + * @param \Cadoles\PortalBundle\Entity\Itemcategory $itemcategory + * + * @return Item + */ + public function setItemcategory(\Cadoles\PortalBundle\Entity\Itemcategory $itemcategory) + { + $this->itemcategory = $itemcategory; + + return $this; + } + + /** + * Get itemcategory + * + * @return \Cadoles\PortalBundle\Entity\Itemcategory + */ + public function getItemcategory() + { + return $this->itemcategory; + } + + /** + * Add group + * + * @param \Cadoles\CoreBundle\Entity\Group $group + * + * @return Item + */ + public function addGroup(\Cadoles\CoreBundle\Entity\Group $group) + { + $this->groups[] = $group; + + return $this; + } + + /** + * Remove group + * + * @param \Cadoles\CoreBundle\Entity\Group $group + */ + public function removeGroup(\Cadoles\CoreBundle\Entity\Group $group) + { + $this->groups->removeElement($group); + } + + /** + * Get groups + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getGroups() + { + return $this->groups; + } + + /** + * Set roles + * + * @param array $roles + * + * @return Item + */ + public function setRoles($roles) + { + $this->roles = $roles; + + return $this; + } + + /** + * Get roles + * + * @return array + */ + public function getRoles() + { + return $this->roles; + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Itemcategory.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Itemcategory.php new file mode 100644 index 00000000..0266221b --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Entity/Itemcategory.php @@ -0,0 +1,150 @@ +items = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set label + * + * @param string $label + * + * @return Itemcategory + */ + public function setLabel($label) + { + $this->label = $label; + + return $this; + } + + /** + * Get label + * + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Set rowOrder + * + * @param integer $rowOrder + * + * @return Itemcategory + */ + public function setRowOrder($rowOrder) + { + $this->rowOrder = $rowOrder; + + return $this; + } + + /** + * Get rowOrder + * + * @return integer + */ + public function getRowOrder() + { + return $this->rowOrder; + } + + /** + * Add item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + * + * @return Itemcategory + */ + public function addItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items[] = $item; + + return $this; + } + + /** + * Remove item + * + * @param \Cadoles\PortalBundle\Entity\Item $item + */ + public function removeItem(\Cadoles\PortalBundle\Entity\Item $item) + { + $this->items->removeElement($item); + } + + /** + * Get items + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getItems() + { + return $this->items; + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/AlertType.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/AlertType.php new file mode 100644 index 00000000..d247ff04 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/AlertType.php @@ -0,0 +1,86 @@ +add("submit", SubmitType::class, [ + "label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"), + "attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success")) + ]) + + ->add('title', TextType::class, [ + 'label' => 'Titre' + ]) + + ->add("content",CKEditorType::class,[ + "config_name" => 'full_config', + "label" => 'Description', + "required" => false, + "disabled" => ($options["mode"]=="delete"?true:false), + "config" => array("height" => "500px") + ]) + + ->add('alertcategory', EntityType::class, [ + 'label' => 'Catégorie', + 'class' => 'CadolesPortalBundle:Alertcategory', + 'choice_label' => 'label', + 'placeholder' => '-- Sélectionnez une Catégorie --' + ]) + + ->add('groups', EntityType::class, [ + "label" => 'Visible pour les Groupes', + "class" => 'CadolesCoreBundle:Group', + "choice_label" => 'label', + "multiple" => true, + "expanded" => true, + "disabled" => ($options["mode"]=="delete"?true:false), + ]) + + ->add('publishedat', DateType::class, [ + 'label' => 'Publier du', + 'input' => 'datetime', + ]) + + ->add('unpublishedat', DateType::class, [ + 'label' => 'jusqu\'au', + 'input' => 'datetime', + 'required' => false, + 'years' => range(date('Y'), date('Y')+10) + ]); + + + $builder->get('publishedat')->addModelTransformer(new CallbackTransformer( + function ($value) { + if (!$value) { + return new \DateTime('now'); + } + return $value; + }, + function ($value) { + return $value; + } + )); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => 'Cadoles\PortalBundle\Entity\Alert', + 'mode' => "string", + ]); + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/AlertcategoryType.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/AlertcategoryType.php new file mode 100644 index 00000000..e15fa8fa --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/AlertcategoryType.php @@ -0,0 +1,61 @@ +add('submit', + SubmitType::class, array( + "label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"), + "attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success")) + ) + ); + + $builder->add('label', + TextType::class, array( + "label" =>"Label", + "disabled" => ($options["mode"]=="delete"?true:false), + ) + ); + + $builder->add('icon', + IconChoiceType::class, array( + "label" => 'Icône' + ) + ); + + $builder->add('color', + ColorType::class, array( + 'label' => 'Couleur', + 'attr' => ['placeholder' => '#FF0066'] + ) + ); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Cadoles\PortalBundle\Entity\Alertcategory', + 'mode' => "string" + )); + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/IconType.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/IconType.php index dc1175b6..c20aba58 100644 --- a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/IconType.php +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/IconType.php @@ -29,10 +29,9 @@ class IconType extends AbstractType ); $builder->add('label', - TextType::class, array( + HiddenType::class, array( "label" =>"Label", - "disabled" => ($options["mode"]=="delete"?true:false), - "attr" => array("class" => "form-control", "style" => "margin-bottom:15px") + "disabled" => ($options["mode"]=="delete"?true:false) ) ); } diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/ItemType.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/ItemType.php new file mode 100644 index 00000000..462d5691 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/ItemType.php @@ -0,0 +1,112 @@ +add("submit", SubmitType::class, [ + "label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"), + "attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success")) + ]) + + ->add("title", TextType::class, [ + "label" => "Titre", + "disabled" => ($options["mode"]=="delete"?true:false), + ]) + + ->add("subtitle", TextareaType::class, [ + "label" => 'Sous Titre', + "required" => false, + "disabled" => ($options["mode"]=="delete"?true:false), + "attr" => array("rows" => '4') + ]) + + ->add("content",CKEditorType::class,[ + "config_name" => 'full_config', + "label" => 'Description', + "required" => false, + "disabled" => ($options["mode"]=="delete"?true:false), + "config" => array("height" => "500px") + ]) + + ->add("itemcategory", EntityType::class, [ + "label" => 'Catégorie', + "class" => 'CadolesPortalBundle:Itemcategory', + "choice_label" => 'label', + "placeholder" => '-- Sélectionnez une Catégorie --', + "disabled" => ($options["mode"]=="delete"?true:false), + ]) + + ->add('roles', ChoiceType::class, [ + "label" => 'Visible pour les Rôles', + "choices" => [ + "Visiteur" => 'ROLE_ANONYME', + "Utilisateur" => 'ROLE_USER', + "Modérateur" => 'ROLE_MODO', + "Administateur" => 'ROLE_ADMIN', + ], + "multiple" => true, + "expanded" => true, + "disabled" => ($options["mode"]=="delete"?true:false), + ]) + + ->add('groups', EntityType::class, [ + "label" => 'Visible pour les Groupes', + "class" => 'CadolesCoreBundle:Group', + "choice_label" => 'label', + "multiple" => true, + "expanded" => true, + "disabled" => ($options["mode"]=="delete"?true:false), + ]) + + ->add('color', ColorType::class, [ + "label" => 'Couleur de la tuile', + "required" => false, + "attr" => ['placeholder' => '#FF0066'], + ]) + + ->add('url') + + ->add('protected', CheckboxType::class, [ + "label" => "Force l'authentification de l'utilisateur", + "required" => false + ]) + + ->add('target', ChoiceType::class, [ + "label" => 'Ouvrir le lien dans', + "choices" => [ + "Onglet courant" => '_self', + "Nouvel onglet/fenêtre" => '_blank', + "iFrame" => 'frame', + ] + ]) + + ->add('idicon', HiddenType::class,['mapped'=> false,'data' => $options["idicon"]]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => 'Cadoles\PortalBundle\Entity\Item', + 'mode' => "string", + 'idicon' => "string", + ]); + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/ItemcategoryType.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/ItemcategoryType.php new file mode 100644 index 00000000..79c6b91c --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Form/ItemcategoryType.php @@ -0,0 +1,46 @@ +add('submit', + SubmitType::class, array( + "label" => ($options["mode"]=="delete"?"Confirmer la Suppression":"Valider"), + "attr" => ($options["mode"]=="delete"?array("class" => "btn btn-danger"):array("class" => "btn btn-success")) + ) + ); + + $builder->add('label', + TextType::class, array( + "label" =>"Label", + "disabled" => ($options["mode"]=="delete"?true:false), + ) + ); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Cadoles\PortalBundle\Entity\Itemcategory', + 'mode' => "string" + )); + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Repository/AlertRepository.php b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Repository/AlertRepository.php new file mode 100644 index 00000000..0b191afd --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Repository/AlertRepository.php @@ -0,0 +1,41 @@ +createQueryBuilder('a'); + $qb->join('a.roles', 'r'); + + if (count($roles)) { + $ids = []; + + foreach ($roles as $r) { + $ids[] = (int) $r->getId(); + } + + $qb->andWhere($qb->expr()->in('r.id', $ids)); + } + + $qb->andWhere('a.publishedAt <= :today') + ->andWhere($qb->expr()->orX( + $qb->expr()->gt('a.unpublishedAt', ':today'), + $qb->expr()->isNull('a.unpublishedAt') + )) + ->orderBy('a.rowOrder', $order); + + return $qb->getQuery() + ->setParameter('today', date('Y-m-d')) + ->getResult() + ; + } +} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml index 3b91f415..e2070f10 100644 --- a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/config/routing.yml @@ -1,25 +1,94 @@ #== Config Icon -cadoles_core_config_icon: +cadoles_portal_config_icon: path: /config/icon - defaults: { _controller: CadolesCoreBundle:Icon:list } + defaults: { _controller: CadolesPortalBundle:Icon:list } -cadoles_core_config_icon_submit: +cadoles_portal_config_icon_submit: path: /config/icon/submit - defaults: { _controller: CadolesCoreBundle:Icon:submit } + defaults: { _controller: CadolesPortalBundle:Icon:submit } -cadoles_core_config_icon_update: +cadoles_portal_config_icon_update: path: /config/icon/update/{id} - defaults: { _controller: CadolesCoreBundle:Icon:update } + defaults: { _controller: CadolesPortalBundle:Icon:update } -cadoles_core_config_icon_delete: +cadoles_portal_config_icon_delete: path: /config/icon/delete/{id} - defaults: { _controller: CadolesCoreBundle:Icon:delete } + defaults: { _controller: CadolesPortalBundle:Icon:delete } -cadoles_core_config_icon_ajax_list: - path: /config/icon/ajax/list - defaults: { _controller: CadolesCoreBundle:Icon:ajaxlist } +cadoles_portal_config_icon_icon: + path: /config/icon/icon + defaults: { _controller: CadolesPortalBundle:Icon:icon } +#== Config Item +cadoles_portal_config_item: + path: /config/item + defaults: { _controller: CadolesPortalBundle:Item:list } + +cadoles_portal_config_item_submit: + path: /config/item/submit + defaults: { _controller: CadolesPortalBundle:Item:submit } + +cadoles_portal_config_item_update: + path: /config/item/update/{id} + defaults: { _controller: CadolesPortalBundle:Item:update } + +cadoles_portal_config_item_delete: + path: /config/item/delete/{id} + defaults: { _controller: CadolesPortalBundle:Item:delete } + +cadoles_portal_config_item_order: + path: /config/item/order + defaults: { _controller: CadolesPortalBundle:Item:order } + +#== Config Item Category +cadoles_portal_config_itemcategory_submit: + path: /config/itemcategory/submit + defaults: { _controller: CadolesPortalBundle:Itemcategory:submit } + +cadoles_portal_config_itemcategory_update: + path: /config/itemcategory/update/{id} + defaults: { _controller: CadolesPortalBundle:Itemcategory:update } + +cadoles_portal_config_itemcategory_delete: + path: /config/itemcategory/delete/{id} + defaults: { _controller: CadolesPortalBundle:Itemcategory:delete } - +cadoles_portal_config_itemcategory_order: + path: /config/itemcategory/order + defaults: { _controller: CadolesPortalBundle:Itemcategory:order } + +#== Config Alert +cadoles_portal_config_alert: + path: /config/alert + defaults: { _controller: CadolesPortalBundle:Alert:list } + +cadoles_portal_config_alert_submit: + path: /config/alert/submit + defaults: { _controller: CadolesPortalBundle:Alert:submit } + +cadoles_portal_config_alert_update: + path: /config/alert/update/{id} + defaults: { _controller: CadolesPortalBundle:Alert:update } + +cadoles_portal_config_alert_delete: + path: /config/alert/delete/{id} + defaults: { _controller: CadolesPortalBundle:Alert:delete } + +cadoles_portal_config_alert_order: + path: /config/alert/order + defaults: { _controller: CadolesPortalBundle:Alert:order } + +#== Config Alert Category +cadoles_portal_config_alertcategory_submit: + path: /config/alertcategory/submit + defaults: { _controller: CadolesPortalBundle:Alertcategory:submit } + +cadoles_portal_config_alertcategory_update: + path: /config/alertcategory/update/{id} + defaults: { _controller: CadolesPortalBundle:Alertcategory:update } + +cadoles_portal_config_alertcategory_delete: + path: /config/alertcategory/delete/{id} + defaults: { _controller: CadolesPortalBundle:Alertcategory:delete } diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/edit.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/edit.html.twig new file mode 100755 index 00000000..7ba39585 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/edit.html.twig @@ -0,0 +1,78 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +{{ form_start(form) }} +

+ {% if mode=="update" %} + Modification Annonces + {% elseif mode=="submit" %} + Création Annonces + {% endif %} +

+ + {{ form_widget(form.submit) }} + Annuler + + {% if mode=="update" %} + + Supprimer + + {% endif %} + +

+ + {% if app.session.flashbag.has('error') %} +
+ Erreur
+ {% for flashMessage in app.session.flashbag.get('error') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + {% if app.session.flashbag.has('notice') %} +
+ Information
+ {% for flashMessage in app.session.flashbag.get('notice') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + +
+
+ {{ form_row(form.title) }} +
+
+ {{ form_row(form.alertcategory) }} +
+
+ +
+
+ {{ form_row(form.content) }} +
+
+ {{ form_row(form.groups) }} +
+ +
+
+
+ {{ form_row(form.publishedat) }} +
+
+ {{ form_row(form.unpublishedat) }} +
+
+ + +{{ form_end(form) }} +{% endblock %} + +{% block localjavascript %} +{% endblock %} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig new file mode 100644 index 00000000..17e4b6f5 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig @@ -0,0 +1,232 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block localstyle %} + .portalalert { + color:#ffffff; + } + + .portalalert .panel-heading a{ + color:#ffffff; + font-size: 22px; + } +{% endblock %} + +{% block pagewrapper %} +

+ Gestion des Annonces +

+ +
+
+

+ Ajouter une Annonce + Ajouter une Catégorie +

+ +
+ {% for alert in alerts %} +
+ + +
+ {{ alert.content|raw }} +
+ + +
+ {% endfor %} +
+
+ +
+
+
+ + Afficher par Catégorie +
+ +
+
+ {% for alertcategory in alertcategorys %} + + {% endfor %} +
+
+
+ +
+
+ + Afficher par Groupes +
+ + +
+ + +
+
+{% endblock %} + +{% block localjavascript %} + $( function() { + var changes = false; + + function updateItems() { + changes = true; + console.log("updateItems"); + $('.alert-list-item:not(.alert-list-item-placeholder').each(function(i) { + var itemid = $(this).data('alert-id'); + $(this).find('input[name="alert_item[rowOrder][]"]').val(i); + + // Mise à jour en base de l'order + $.ajax({ + method: "POST", + url: "{{ path('cadoles_portal_config_alert_order') }}", + data: { + id:itemid, + order:i + } + }); + + }); + } + + $( "#alert-list" ).sortable({ + axis: "y", + placeholder: "alert-list-item alert-list-item-placeholder", + update: updateItems + }); + + $(".alert-category-item").click(function(){ + var $alerts = $('.mse-alert-'+$(this).data('category')); + if($(this).hasClass('active')){ + $alerts.hide(); + } else { + $alerts.show(); + } + $(this).toggleClass('active'); + return false; + }); + + $(".alert-statut-item a").click(function(){ + var activeItem = $(".alert-statut-item a.active"); + var statut = $(this).data('statut'); + var $alerts = $('[class*="mse-alert-"]:not(.mse-alert-'+$(this).data('statut')+')'); + var $alertsToShow = $('.mse-alert-'+$(this).data('statut')); + + if ( activeItem != $(this) ) { + activeItem.toggleClass('active'); + } + + if( statut != "all"){ + if($(this).hasClass('active')){ + $alerts.hide(); + } else { + $alerts.hide(); + $alertsToShow.show(); + } + } else { + $alerts.show(); + } + + $(this).toggleClass('active'); + return false; + + }); + + $('#role-filter a.list-group-item').click(function(){ + $('#role-filter a.list-group-item').removeClass('active'); + $(this).addClass('active'); + if($(this).data('role')){ + $('[class*="mse-alert-"]:not([class*="role-'+$(this).data('role')+'"])').hide(); + $('.role-'+$(this).data('role')).show(); + } else { + $('[class*="mse-alert-"]').show(); + } + return false; + }); + } ); +{% endblock %} + + diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig new file mode 100755 index 00000000..daf8c89a --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig @@ -0,0 +1,75 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +{{ form_start(form) }} +

+ {% if mode=="update" %} + Modification Catégorie d'Annonce + {% elseif mode=="submit" %} + Création Catégorie d'Annonce + {% endif %} +

+ +

+ {{ form_widget(form.submit) }} + Annuler + {% if mode=="update" %} + + Supprimer + + {% endif %} +

+ + {% if app.session.flashbag.has('error') %} +
+ Erreur
+ {% for flashMessage in app.session.flashbag.get('error') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + {% if app.session.flashbag.has('notice') %} +
+ Information
+ {% for flashMessage in app.session.flashbag.get('notice') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} +
+
+ Informations +
+ +
+ {{ form_row(form.label) }} + {{ form_row(form.icon) }} + {{ form_row(form.color) }} +
+
+ + +{{ form_end(form) }} +{% endblock %} + +{% block localjavascript %} + function iformat(icon) { + var originalOption = icon.element; + return $(' ' + icon.text + ''); + } + + $('.select2-icon').select2({ + width: "100%", + formatSelection: iformat, + templateResult: iformat, + formatResult: iformat, + allowHtml: true, + escapeMarkup: function(m) { + return m; + } + }); +{% endblock %} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/edit.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/edit.html.twig index 8dcd1a91..134e94f3 100755 --- a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/edit.html.twig +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/edit.html.twig @@ -4,18 +4,26 @@ {{ form_start(form) }}

{% if mode=="update" %} - Modification Liste Blanche + Modification Icône {% elseif mode=="submit" %} - Création Liste Blanche - {% elseif mode=="delete" %} - Suppression Liste Blanche + Création Icône {% endif %}

- {{ form_widget(form.submit) }} Annuler - + {{ form_widget(form.submit) }} + Annuler + {% if mode=="update" %} + + Supprimer + + {% endif %} +

+ {% if app.session.flashbag.has('error') %}
Erreur
@@ -39,8 +47,11 @@
- {{ form_label(form.label) }} +
+ {{ form_widget(form.label) }} + Modifier +
{{ form_end(form) }} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/icon.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/icon.html.twig new file mode 100755 index 00000000..5ebc63a5 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/icon.html.twig @@ -0,0 +1,36 @@ +{% extends '@CadolesCore/simple.html.twig' %} + +{% block pagewrapper %} + + Annuler + +
+
+{% endblock %} + + + +{% block localjavascript %} + Dropzone.options.MyDropZone = { + acceptedMimeTypes: 'image/*', + maxFiles: 1, + resizeWidth:500, + + success: function( file, response ){ + parent.$("#icon_label").val("uploads/icon/"+response["file"]); + parent.$("#icon_label_img").attr("src","/{{ alias }}/uploads/icon/"+response["file"]); + closeModal(); + } + } + + function closeModal() { + window.parent.$("#mymodal").modal('hide'); + } + + $(window).load(function () { + // On vérifie que l'execution se fait bien dans le cadre d'une modal + if(!window.parent.$("#mymodal #framemodal").length) { + $(location).attr('href',"{{ path('cadoles_core_home') }}"); + } + }); +{% endblock %} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/list.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/list.html.twig index 370825d3..2e9189e7 100644 --- a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/list.html.twig +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/list.html.twig @@ -1,40 +1,13 @@ {% extends '@CadolesCore/base.html.twig' %} {% block pagewrapper %} -

Gestion des Listes Blanche

+

Gestion des Icônes

-

Ajouter

+

Ajouter

-
-
- Liste des Listes Blanche -
- -
-
- - - - - - - -
ActionLabel
-
-
-
+ {% for icon in icons %} + + {% endfor %} {% endblock %} -{% block localjavascript %} - $(document).ready(function() { - $('#dataTables').DataTable({ - columnDefs: [ { "targets": 'no-sort', "orderable": false } ], - responsive: true, - iDisplayLength: 100, - order: [[ 1, "asc" ]], - processing: true, - serverSide: true, - ajax: "{{ path('cadoles_core_config_whitelist_ajax_list') }}", - }); - }); -{% endblock %} + diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig new file mode 100755 index 00000000..079e1f78 --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig @@ -0,0 +1,119 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +{{ form_start(form) }} +

+ {% if mode=="update" %} + Modification Item + {% elseif mode=="submit" %} + Création Item + {% endif %} +

+ + {{ form_widget(form.submit) }} + Annuler + + {% if mode=="update" %} + + Supprimer + + {% endif %} + +

+ + {% if app.session.flashbag.has('error') %} +
+ Erreur
+ {% for flashMessage in app.session.flashbag.get('error') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + {% if app.session.flashbag.has('notice') %} +
+ Information
+ {% for flashMessage in app.session.flashbag.get('notice') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + +
+
+ {{ form_row(form.title) }} + {{ form_row(form.subtitle) }} + {{ form_row(form.content) }} +
+ + +
+ {{ form_row(form.url) }} + {{ form_row(form.target) }} + {{ form_row(form.itemcategory) }} + {{ form_row(form.roles) }} + {{ form_row(form.groups) }} + {{ form_row(form.color) }} + +
+ {% if item.icon %} + + {% endif %} +
+ +
+ {{ form_row(form.idicon) }} + Selectionner un Icône + Détacher l'Icône +
+
+
+ + +{{ form_end(form) }} +{% endblock %} + +{% block localjavascript %} + function selIcon(idicon) { + $("#item_idicon").val(idicon); + $("#diviconsel img").remove(); + + $("#icon-"+idicon).clone().appendTo($("#diviconsel")); + $("#diviconsel img").attr("height","100px"); + $('#selicon').modal('hide'); + } + + function delIcon() { + $("#diviconsel img").remove(); + $("#item_idicon").val(null); + } +{% endblock %} diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Item/list.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Item/list.html.twig new file mode 100644 index 00000000..e55f9cea --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Item/list.html.twig @@ -0,0 +1,207 @@ +{% extends '@CadolesCore/base.html.twig' %} + + +{% block pagewrapper %} +

+ Gestion des Items +

+ +
+
+

+ Ajouter un Item + Ajouter une Categorie +

+ +
+ {% for itemcategory in itemcategorys %} + + {% endfor %} +
+
+ + +
+ + + +
+
+ + Afficher par Groupe +
+
+ +
+
+
+
+ +{% endblock %} + +{% block localjavascript %} + $( function() { + var changes = false; + + $("#allrole").children("span").html($('.grid-item').length); + $("#allgroup").children("span").html($('.grid-item').length); + + $("a[data-role='ROLE_ANONYME']").children("span").html($('.group-ROLE_ANONYME').length); + $("a[data-role='ROLE_USER']").children("span").html($('.group-ROLE_USER').length); + $("a[data-role='ROLE_MODO']").children("span").html($('.group-ROLE_MODO').length); + $("a[data-role='ROLE_ADMIN']").children("span").html($('.group-ROLE_ADMIN').length); + + function updateItems() { + // Pour chaque catégorie + $('.category-list-item:not(.category-list-item-placeholder').each(function(i) { + // On récupère id et order + var categoryid = $(this).data('itemcategory-id'); + $(this).find('input[name="itemcategory[rowOrder][]"]').val(i); + + // Mise à jour en base de l'order + $.ajax({ + method: "POST", + url: "{{ path('cadoles_portal_config_itemcategory_order') }}", + data: { + id:categoryid, + order:i + } + }); + + // Pour chaque item de la catégorie + $(this).find('.grid-item:not(.grid-item-placeholder)').each(function(j) { + // On récupère les id + var itemid = $(this).data('item-id'); + $(this).find('input[name="item[rowOrder][]"]').val(j); + $(this).find('input[name="item[itemcategory][]"]').val(categoryid); + + // Mise à jour en base de l'order + $.ajax({ + method: "POST", + url: "{{ path('cadoles_portal_config_item_order') }}", + data: { + id:itemid, + categoryid:categoryid, + order:j + } + }); + }); + }); + } + + $( ".grid" ).sortable({ + connectWith: ".grid", + placeholder: "grid-item grid-item-placeholder", + update: updateItems + }); + + $( ".category-list" ).sortable({ + axis: "y", + placeholder: "category-list-item category-list-item-placeholder", + update: updateItems + }); + + $('a.list-group-item').click(function(){ + $('#group-filter a.list-group-item').removeClass('active'); + $(this).addClass('active'); + console.log('.group-'+$(this).attr('data-role')); + if($(this).attr('data-role')){ + $('.grid-item').hide(); + $('.group-'+$(this).attr('data-role')).show(); + } else { + $('.grid-item').show(); + } + }); + }); +{% endblock %} + diff --git a/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Itemcategory/edit.html.twig b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Itemcategory/edit.html.twig new file mode 100755 index 00000000..526e535e --- /dev/null +++ b/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Itemcategory/edit.html.twig @@ -0,0 +1,59 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +{{ form_start(form) }} +

+ {% if mode=="update" %} + Modification Catégorie d'Item + {% elseif mode=="submit" %} + Création Catégorie d'Item + {% endif %} +

+ +

+ {{ form_widget(form.submit) }} + Annuler + {% if mode=="update" %} + + Supprimer + + {% endif %} +

+ + {% if app.session.flashbag.has('error') %} +
+ Erreur
+ {% for flashMessage in app.session.flashbag.get('error') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + {% if app.session.flashbag.has('notice') %} +
+ Information
+ {% for flashMessage in app.session.flashbag.get('notice') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} +
+
+ Informations +
+ +
+ {{ form_row(form.label) }} +
+
+ + + +{{ form_end(form) }} +{% endblock %} + +{% block localjavascript %} +{% endblock %} diff --git a/src/cadolesuser-1.0/web/ckeditor/CHANGES.md b/src/cadolesuser-1.0/web/ckeditor/CHANGES.md new file mode 100644 index 00000000..08036149 --- /dev/null +++ b/src/cadolesuser-1.0/web/ckeditor/CHANGES.md @@ -0,0 +1,1358 @@ +CKEditor 4 Changelog +==================== + +## CKEditor 4.7.3 + +New Features: + +* [#568](https://github.com/ckeditor/ckeditor-dev/issues/568): Added possibility to adjust nested editables' filters using the [`CKEDITOR.filter.disallowedContent`](https://docs.ckeditor.com/#!/api/CKEDITOR.filter-property-disallowedContent) property. + +Fixed Issues: + +* [#554](https://github.com/ckeditor/ckeditor-dev/issues/554): Fixed: [`change`](https://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-change) event not fired when typing the first character after pasting into the editor. Thanks to [Daniel Miller](https://github.com/millerdev)! +* [#566](https://github.com/ckeditor/ckeditor-dev/issues/566): Fixed: The CSS `border` shorthand property with zero width (`border: 0px solid #000;`) causes the table to have the border attribute set to 1. +* [#779](https://github.com/ckeditor/ckeditor-dev/issues/779): Fixed: The [Remove Format](https://ckeditor.com/addon/removeformat) plugin removes elements with language definition inserted by the [Language](https://ckeditor.com/addon/language) plugin. +* [#423](https://github.com/ckeditor/ckeditor-dev/issues/423): Fixed: The [Paste from Word](https://ckeditor.com/addon/pastefromword) plugin pastes paragraphs into the editor even if [`CKEDITOR.config.enterMode`](https://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enterMode) is set to `CKEDITOR.ENTER_BR`. +* [#719](https://github.com/ckeditor/ckeditor-dev/issues/719): Fixed: Image inserted using the [Enhanced Image](https://ckeditor.com/addon/image2) plugin can be resized when the editor is in [read-only mode](https://docs.ckeditor.com/#!/guide/dev_readonly). +* [#577](https://github.com/ckeditor/ckeditor-dev/issues/577): Fixed: The "Delete Columns" command provided by the [Table Tools](https://ckeditor.com/addon/tabletools) plugin throws an error when trying to delete columns. +* [#867](https://github.com/ckeditor/ckeditor-dev/issues/867): Fixed: Typing into a selected table throws an error. +* [#817](https://github.com/ckeditor/ckeditor-dev/issues/817): Fixed: The [Save](https://ckeditor.com/addon/save) plugin does not work in [Source Mode](https://ckeditor.com/addon/sourcearea). + +Other Changes: + +* Updated the [WebSpellChecker](http://ckeditor.com/addon/wsc) plugin: + * [#40](https://github.com/WebSpellChecker/ckeditor-plugin-wsc/issues/40): Fixed: IE10 throws an error when spell checking is started. +* [#800](https://github.com/ckeditor/ckeditor-dev/issues/800): Added the [`CKEDITOR.dom.selection.isCollapsed`](https://docs.ckeditor.com/#!/api/CKEDITOR.dom.selection-method-isCollapsed) method which is a simpler way to check if the selection is collapsed. +* [#830](https://github.com/ckeditor/ckeditor-dev/issues/830): Added an option to define which dialog tab should be shown by default when creating [`CKEDITOR.dialogCommand`](https://docs.ckeditor.com/#!/api/CKEDITOR.dialogCommand). + +## CKEditor 4.7.2 + +New Features: + +* [#455](https://github.com/ckeditor/ckeditor-dev/issues/455): Added [Advanced Content Filter](https://docs.ckeditor.com/#!/guide/dev_acf) integration with the [Justify](http://ckeditor.com/addon/justify) plugin. + +Fixed Issues: + +* [#663](https://github.com/ckeditor/ckeditor-dev/issues/663): [Chrome] Fixed: Clicking the scrollbar throws an `Uncaught TypeError: element.is is not a function` error. +* [#694](https://github.com/ckeditor/ckeditor-dev/pull/694): Refactoring in the [Table Selection](http://ckeditor.com/addon/tableselection) plugin: + * [#520](https://github.com/ckeditor/ckeditor-dev/issues/520): Fixed: Widgets cannot be properly pasted into a table cell. + * [#460](https://github.com/ckeditor/ckeditor-dev/issues/460): Fixed: Editor gone after pasting into an editor within a table. +* [#579](https://github.com/ckeditor/ckeditor-dev/issues/579): Fixed: Internal `cke_table-faked-selection-table` class is visible in the Stylesheet Classes field of the [Table Properties](http://ckeditor.com/addon/table) dialog. +* [#545](https://github.com/ckeditor/ckeditor-dev/issues/545): [Edge] Fixed: Error thrown when pressing the [Select All](https://ckeditor.com/addon/selectall) button in [Source Mode](http://ckeditor.com/addon/sourcearea). +* [#582](https://github.com/ckeditor/ckeditor-dev/issues/582): Fixed: Double slash in the path to stylesheet needed by the [Table Selection](http://ckeditor.com/addon/tableselection) plugin. Thanks to [Marius Dumitru Florea](https://github.com/mflorea)! +* [#491](https://github.com/ckeditor/ckeditor-dev/issues/491): Fixed: Unnecessary dependency on the [Editor Toolbar](http://ckeditor.com/addon/toolbar) plugin inside the [Notification](http://ckeditor.com/addon/notification) plugin. +* [#646](https://github.com/ckeditor/ckeditor-dev/issues/646): Fixed: Error thrown into the browser console after opening the [Styles Combo](http://ckeditor.com/addon/stylescombo) plugin menu in the editor without any selection. +* [#501](https://github.com/ckeditor/ckeditor-dev/issues/501): Fixed: Double click does not open the dialog for modifying anchors inserted via the [Link](http://ckeditor.com/addon/link) plugin. +* [#9780](https://dev.ckeditor.com/ticket/9780): [IE8-9] Fixed: Clicking inside an empty [read-only](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-readOnly) editor throws an error. +* [#16820](https://dev.ckeditor.com/ticket/16820): [IE10] Fixed: Clicking below a single horizontal rule throws an error. +* [#426](https://github.com/ckeditor/ckeditor-dev/issues/426): Fixed: The [`range.cloneContents`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.range-method-cloneContents) method selects the whole element when the selection starts at the beginning of that element. +* [#644](https://github.com/ckeditor/ckeditor-dev/issues/644): Fixed: The [`range.extractContents`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.range-method-extractContents) method returns an incorrect result when multiple nodes are selected. +* [#684](https://github.com/ckeditor/ckeditor-dev/issues/684): Fixed: The [`elementPath.contains`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.elementPath-method-contains) method incorrectly excludes the last element instead of root when the `fromTop` parameter is set to `true`. + +Other Changes: + +* Updated the [SCAYT](http://ckeditor.com/addon/scayt) (Spell Check As You Type) plugin: + * [#148](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/148): Fixed: SCAYT leaves underlined word after the CKEditor Replace dialog corrects it. +* [#751](https://github.com/ckeditor/ckeditor-dev/issues/751): Added the [`CKEDITOR.dom.nodeList.toArray`](https://docs.ckeditor.com/#!/api/CKEDITOR.dom.nodeList-method-toArray) method which returns an array representation of a [node list](https://docs.ckeditor.com/#!/api/CKEDITOR.dom.nodeList). + +## CKEditor 4.7.1 + +New Features: + +* Added a new Mexican Spanish localization. Thanks to [David Alexandro Rodriguez](https://www.transifex.com/user/profile/darsco16/)! +* [#413](https://github.com/ckeditor/ckeditor-dev/issues/413): Added Paste as Plain Text keyboard shortcut to the [Accessibility Help](http://ckeditor.com/addon/a11yhelp) instructions. + +Fixed Issues: + +* [#515](https://github.com/ckeditor/ckeditor-dev/issues/515): [Chrome] Fixed: Mouse actions on CKEditor scrollbar throw an exception when the [Table Selection](http://ckeditor.com/addon/tableselection) plugin is loaded. +* [#493](https://github.com/ckeditor/ckeditor-dev/issues/493): Fixed: Selection started from a nested table causes an error in the browser while scrolling down. +* [#415](https://github.com/ckeditor/ckeditor-dev/issues/415): [Firefox] Fixed: Enter key breaks the table structure when pressed in a table selection. +* [#457](https://github.com/ckeditor/ckeditor-dev/issues/457): Fixed: Error thrown when deleting content from the editor with no selection. +* [#478](https://github.com/ckeditor/ckeditor-dev/issues/478): [Chrome] Fixed: Error thrown by the [Enter Key](http://ckeditor.com/addon/enterkey) plugin when pressing Enter with no selection. +* [#424](https://github.com/ckeditor/ckeditor-dev/issues/424): Fixed: Error thrown by [Tab Key Handling](http://ckeditor.com/addon/tab) and [Indent List](http://ckeditor.com/addon/indentlist) plugins when pressing Tab with no selection in inline editor. +* [#476](https://github.com/ckeditor/ckeditor-dev/issues/476): Fixed: Anchors inserted with the [Link](http://ckeditor.com/addon/link) plugin on collapsed selection cannot be edited. +* [#417](https://github.com/ckeditor/ckeditor-dev/issues/417): Fixed: The [Table Resize](http://ckeditor.com/addon/tableresize) plugin throws an error when used with a table with only header or footer rows. +* [#523](https://github.com/ckeditor/ckeditor-dev/issues/523): Fixed: The [`editor.getCommandKeystroke`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getCommandKeystroke) method does not obtain the correct keystroke. +* [#534](https://github.com/ckeditor/ckeditor-dev/issues/534): [IE] Fixed: [Paste from Word](http://ckeditor.com/addon/pastefromword) does not work in Quirks Mode. +* [#450](https://github.com/ckeditor/ckeditor-dev/issues/450): Fixed: [`CKEDITOR.filter`](http://docs.ckeditor.com/#!/api/CKEDITOR.filter) incorrectly transforms the `margin` CSS property. + +## CKEditor 4.7 + +**Important Notes:** + +* [#13793](http://dev.ckeditor.com/ticket/13793): The [`embed_provider`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-embed_provider) configuration option for the [Media Embed](http://ckeditor.com/addon/embed) and [Semantic Media Embed](http://ckeditor.com/addon/embedsemantic) plugins is no longer preset by default. +* The [UI Color](http://ckeditor.com/addon/uicolor) plugin now uses a custom color picker instead of the `YUI 2.7.0` library which has some known vulnerabilities (it's a security precaution, there was no security issue in CKEditor due to the way it was used). + +New Features: + +* [#16755](http://dev.ckeditor.com/ticket/16755): Added the [Table Selection](http://ckeditor.com/addon/tableselection) plugin that lets you select and manipulate an arbitrary rectangular table fragment (a few cells, a row or a column). +* [#16961](http://dev.ckeditor.com/ticket/16961): Added support for pasting from Microsoft Excel. +* [#13381](http://dev.ckeditor.com/ticket/13381): Dynamic code evaluation call in [`CKEDITOR.template`](http://docs.ckeditor.com/#!/api/CKEDITOR.template) removed. CKEditor can now be used without the `unsafe-eval` Content Security Policy. Thanks to [Caridy Patiño](http://caridy.name)! +* [#16971](http://dev.ckeditor.com/ticket/16971): Added support for color in the `background` property containing also other styles for table cells in the [Table Tools](http://ckeditor.com/addon/tabletools) plugin. +* [#16847](http://dev.ckeditor.com/ticket/16847): Added support for parsing and inlining any formatting created using the Microsoft Word style system to the [Paste from Word](http://ckeditor.com/addon/pastefromword) plugin. +* [#16818](http://dev.ckeditor.com/ticket/16818): Added table cell height parsing in the [Paste from Word](http://ckeditor.com/addon/pastefromword) plugin. +* [#16850](http://dev.ckeditor.com/ticket/16850): Added a new [`config.enableContextMenu`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enableContextMenu) configuration option for enabling and disabling the [context menu](http://ckeditor.com/addon/contextmenu). +* [#16937](http://dev.ckeditor.com/ticket/16937): The `command` parameter in [CKEDITOR.editor.getCommandKeystroke](http://docs.ckeditor.dev/#!/api/CKEDITOR.editor-method-getCommandKeystroke) now also accepts a command name as an argument. +* [#17010](http://dev.ckeditor.com/ticket/17010): The [`CKEDITOR.dom.range.shrink`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.range-method-shrink) method now allows for skipping bogus `
` elements. + +Fixed Issues: + +* [#16935](http://dev.ckeditor.com/ticket/16935): [Chrome] Fixed: Blurring the editor in [Source Mode](http://ckeditor.com/addon/sourcearea) throws an error. +* [#16825](http://dev.ckeditor.com/ticket/16825): [Chrome] Fixed: Error thrown when destroying a focused inline editor. +* [#16857](http://dev.ckeditor.com/ticket/16857): Fixed: Ctrl+Shift+V blocked by [Copy Formatting](http://ckeditor.com/addon/copyformatting). +* [#16845](https://dev.ckeditor.com/ticket/16845): [IE] Fixed: Cursor jumps to the top of the scrolled editor after focusing it when the [Copy Formatting](http://ckeditor.com/addon/copyformatting) plugin is enabled. +* [#16786](http://dev.ckeditor.com/ticket/16786): Fixed: Added missing translations for the [Copy Formatting](http://ckeditor.com/addon/copyformatting) plugin. +* [#14714](http://dev.ckeditor.com/ticket/14714): [WebKit/Blink] Fixed: Exception thrown on refocusing a blurred inline editor. +* [#16913](http://dev.ckeditor.com/ticket/16913): [Firefox, IE] Fixed: [Paste as Plain Text](http://ckeditor.com/addon/pastetext) keystroke does not work. +* [#16968](http://dev.ckeditor.com/ticket/16968): Fixed: [Safari] [Paste as Plain Text](http://ckeditor.com/addon/pastetext) is not handled by the editor. +* [#16912](http://dev.ckeditor.com/ticket/16912): Fixed: Exception thrown when a single image is pasted using [Paste from Word](http://ckeditor.com/addon/pastefromword). +* [#16821](http://dev.ckeditor.com/ticket/16821): Fixed: Extraneous `` elements with `height` style stacked when [pasting from Word](http://ckeditor.com/addon/pastefromword). +* [#16866](http://dev.ckeditor.com/ticket/16866): [IE, Edge] Fixed: Whitespaces not preserved when [pasting from Word](http://ckeditor.com/addon/pastefromword). +* [#16860](http://dev.ckeditor.com/ticket/16860): Fixed: Paragraphs which only look like lists incorrectly transformed into them when [pasting from Word](http://ckeditor.com/addon/pastefromword). +* [#16817](http://dev.ckeditor.com/ticket/16817): Fixed: When [pasting from Word](http://ckeditor.com/addon/pastefromword), paragraphs are transformed into lists with some corrupted data. +* [#16833](http://dev.ckeditor.com/ticket/16833): [IE11] Fixed: Malformed list with headers [pasted from Word](http://ckeditor.com/addon/pastefromword). +* [#16826](http://dev.ckeditor.com/ticket/16826): [IE] Fixed: Superfluous paragraphs within lists [pasted from Word](http://ckeditor.com/addon/pastefromword). +* [#12465](http://dev.ckeditor.com/ticket/12465): Fixed: Cannot change the state of checkboxes or radio buttons if the properties dialog was invoked with a double-click. +* [#13062](http://dev.ckeditor.com/ticket/13062): Fixed: Impossible to unlink when the caret is at the edge of the link. +* [#13585](http://dev.ckeditor.com/ticket/13585): Fixed: Error when wrapping two adjacent `
` elements with a `
`. +* [#16811](http://dev.ckeditor.com/ticket/16811): Fixed: Table alignment is not preserved by the [Paste from Word](http://ckeditor.com/addon/pastefromword) plugin. +* [#16810](http://dev.ckeditor.com/ticket/16810): Fixed: Vertical align in tables is not supported by the [Paste from Word](http://ckeditor.com/addon/pastefromword) plugin. +* [#11956](http://dev.ckeditor.com/ticket/11956): [Blink, IE] Fixed: [Link](http://ckeditor.com/addon/link) dialog does not open on a double click on the second word of the link with a background color or other styles. +* [#10472](http://dev.ckeditor.com/ticket/10472): Fixed: Unable to use [Table Resize](http://ckeditor.com/addon/tableresize) on table header and footer. +* [#14762](http://dev.ckeditor.com/ticket/14762): Fixed: Hovering over an empty table (without rows or cells) throws an error when the [Table Resize](http://ckeditor.com/addon/tableresize) plugin is active. +* [#16777](https://dev.ckeditor.com/ticket/16777): [Edge] Fixed: The [Clipboard](http://ckeditor.com/addon/clipboard) plugin does not allow to drop widgets into the editor. +* [#14894](https://dev.ckeditor.com/ticket/14894): [Chrome] Fixed: The editor scrolls to the top after focusing or when a dialog is opened. +* [#14769](https://dev.ckeditor.com/ticket/14769): Fixed: URLs with '-' in host are not detected by the [Auto Link](http://ckeditor.com/addon/autolink) plugin. +* [#16804](https://dev.ckeditor.com/ticket/16804): Fixed: Focus is not on the first menu item when the user opens a context menu or a drop-down list from the editor toolbar. +* [#14407](https://dev.ckeditor.com/ticket/14407): [IE] Fixed: Non-editable widgets can be edited. +* [#16927](https://dev.ckeditor.com/ticket/16927): Fixed: An error thrown if a bundle containing the [Color Button](http://ckeditor.com/addon/colorbutton) plugin is run in ES5 strict mode. Thanks to [Igor Rubinovich](https://github.com/IgorRubinovich)! +* [#16920](http://dev.ckeditor.com/ticket/16920): Fixed: Several plugins not using the [Dialog](http://ckeditor.com/addon/dialog) plugin as a direct dependency. +* [PR#336](https://github.com/ckeditor/ckeditor-dev/pull/336): Fixed: Typo in [`CKEDITOR.getCss`](http://docs.ckeditor.com/#!/api/CKEDITOR-method-getCss) API documentation. Thanks to [knusperpixel](https://github.com/knusperpixel)! +* [#17027](http://dev.ckeditor.com/ticket/17027): Fixed: Command event data should be initialized as an empty object. +* Fixed the behavior of HTML parser when parsing `src`/`srcdoc` attributes of the `