This commit is contained in:
afornerot 2019-03-13 17:30:41 +01:00
parent 47b2c31b3d
commit 5afd7517f6
485 changed files with 19878 additions and 562 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*~

View File

@ -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)) {

View File

@ -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%'
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' ]

View File

@ -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

View File

@ -117,5 +117,6 @@ doctrine:
connection: default
mappings:
CadolesCoreBundle: ~
CadolesPortalBundle: ~

View File

@ -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",

View File

@ -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",

View File

@ -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

View File

@ -1,7 +1,7 @@
<?php
namespace Cadoles\CoreBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
@ -12,7 +12,7 @@ use Doctrine\ORM\EntityManager;
use Cadoles\CoreBundle\Entity\Group;
use Cadoles\CoreBundle\Entity\UserGroup;
class InitDataCommand extends Command
class InitDataCommand extends ContainerAwareCommand
{
protected function configure()
{
@ -31,16 +31,16 @@ class InitDataCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output)
{
$kernel = new \AppKernel('dev', true);
$kernel->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) {

View File

@ -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'),

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -48,7 +48,7 @@ class Sidebar
/**
* @ORM\ManyToOne(targetEntity="Sidebar")
* @ORM\ManyToOne(targetEntity="Sidebar", inversedBy="childs")
* @ORM\JoinColumn(nullable=true)
*/
private $parent;

View File

@ -48,7 +48,7 @@ class Sidebar
/**
* @ORM\ManyToOne(targetEntity="Sidebar")
* @ORM\ManyToOne(targetEntity="Sidebar", inversedBy="childs")
* @ORM\JoinColumn(nullable=true)
*/
private $parent;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -4,7 +4,6 @@ namespace Cadoles\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;