From 221698d102bc4d43f182669bde8b5b8fca8d9353 Mon Sep 17 00:00:00 2001 From: Ducobu Marc Date: Tue, 30 Jun 2015 22:01:35 +0200 Subject: [PATCH 001/163] Initial commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..75ea82d3a --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Activity +The bundle for recording activities From 452f3fba86c76747dfa0e7598a948e9f379ef257 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 30 Jun 2015 22:07:55 +0200 Subject: [PATCH 002/163] skeleton of the bundle --- ChillActivityBundle.php | 9 ++++++ Controller/DefaultController.php | 13 +++++++++ .../ChillActivityExtension.php | 28 ++++++++++++++++++ DependencyInjection/Configuration.php | 29 +++++++++++++++++++ Resources/config/routing.yml | 3 ++ Resources/config/services.yml | 4 +++ Resources/doc/index.rst | 0 Resources/translations/messages.fr.xlf | 11 +++++++ Resources/views/Default/index.html.twig | 1 + Tests/Controller/DefaultControllerTest.php | 17 +++++++++++ 10 files changed, 115 insertions(+) create mode 100644 ChillActivityBundle.php create mode 100644 Controller/DefaultController.php create mode 100644 DependencyInjection/ChillActivityExtension.php create mode 100644 DependencyInjection/Configuration.php create mode 100644 Resources/config/routing.yml create mode 100644 Resources/config/services.yml create mode 100644 Resources/doc/index.rst create mode 100644 Resources/translations/messages.fr.xlf create mode 100644 Resources/views/Default/index.html.twig create mode 100644 Tests/Controller/DefaultControllerTest.php diff --git a/ChillActivityBundle.php b/ChillActivityBundle.php new file mode 100644 index 000000000..36c396474 --- /dev/null +++ b/ChillActivityBundle.php @@ -0,0 +1,9 @@ +render('ChillActivityBundle:Default:index.html.twig', array('name' => $name)); + } +} diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php new file mode 100644 index 000000000..9340c40f5 --- /dev/null +++ b/DependencyInjection/ChillActivityExtension.php @@ -0,0 +1,28 @@ +processConfiguration($configuration, $configs); + + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.yml'); + } +} diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php new file mode 100644 index 000000000..a177c28c4 --- /dev/null +++ b/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +root('chill_activity'); + + // Here you should define the parameters that are allowed to + // configure your bundle. See the documentation linked above for + // more information on that topic. + + return $treeBuilder; + } +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml new file mode 100644 index 000000000..6f006d159 --- /dev/null +++ b/Resources/config/routing.yml @@ -0,0 +1,3 @@ +chill_activity_homepage: + path: /hello/{name} + defaults: { _controller: ChillActivityBundle:Default:index } diff --git a/Resources/config/services.yml b/Resources/config/services.yml new file mode 100644 index 000000000..7a089a4b2 --- /dev/null +++ b/Resources/config/services.yml @@ -0,0 +1,4 @@ +services: +# chill_activity.example: +# class: Chill\ActivityBundle\Example +# arguments: [@service_id, "plain_value", %parameter%] diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst new file mode 100644 index 000000000..e69de29bb diff --git a/Resources/translations/messages.fr.xlf b/Resources/translations/messages.fr.xlf new file mode 100644 index 000000000..fd59e6c16 --- /dev/null +++ b/Resources/translations/messages.fr.xlf @@ -0,0 +1,11 @@ + + + + + + Symfony2 is great + J'aime Symfony2 + + + + diff --git a/Resources/views/Default/index.html.twig b/Resources/views/Default/index.html.twig new file mode 100644 index 000000000..4ce626e9b --- /dev/null +++ b/Resources/views/Default/index.html.twig @@ -0,0 +1 @@ +Hello {{ name }}! diff --git a/Tests/Controller/DefaultControllerTest.php b/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 000000000..c653df136 --- /dev/null +++ b/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,17 @@ +request('GET', '/hello/Fabien'); + + $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); + } +} From 4dd1efa57f70d8004afc972422ba0e08a0c512b0 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 30 Jun 2015 22:16:43 +0200 Subject: [PATCH 003/163] Generation of composer.json --- .gitignore | 1 + composer.json | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 .gitignore create mode 100644 composer.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..57872d0f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/composer.json b/composer.json new file mode 100644 index 000000000..c484a43b6 --- /dev/null +++ b/composer.json @@ -0,0 +1,13 @@ +{ + "name": "chill-project/activity", + "description": "This bundle extend chill for recording the different activities of the user", + "type": "symfony-bundle", + "license": "AGPL-3.0", + "authors": [ + { + "name": "Champs-Libres", + "email": "info@champs-libres.coop" + } + ], + "require": {} +} From 5c4cfc45e6cee4c515289ded145e000f8b5080f2 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 30 Jun 2015 22:48:16 +0200 Subject: [PATCH 004/163] Improving composer.json --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index c484a43b6..2bb1e980f 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,11 @@ "description": "This bundle extend chill for recording the different activities of the user", "type": "symfony-bundle", "license": "AGPL-3.0", + "keywords" : ["chill", "social work"], + "homepage" : "https://github.com/Chill-project/Activity", + "autoload": { + "psr-4": { "Chill\\ActivityBundle\\": "" } + }, "authors": [ { "name": "Champs-Libres", From 5bc7bdab2dbccaeb7de5a63ea4f41cd5a4d5c3f6 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 09:53:36 +0200 Subject: [PATCH 005/163] Initialisation of the bundle --- Entity/Activity.php | 311 ++++++++++++++++++ Entity/ActivityReason.php | 133 ++++++++ Entity/ActivityReasonCategory.php | 102 ++++++ Entity/ActivityType.php | 73 ++++ Resources/config/doctrine/Activity.orm.yml | 30 ++ .../config/doctrine/ActivityReason.orm.yml | 19 ++ .../doctrine/ActivityReasonCategory.orm.yml | 16 + .../config/doctrine/ActivityType.orm.yml | 14 + .../migrations/Version20150701091248.php | 63 ++++ 9 files changed, 761 insertions(+) create mode 100644 Entity/Activity.php create mode 100644 Entity/ActivityReason.php create mode 100644 Entity/ActivityReasonCategory.php create mode 100644 Entity/ActivityType.php create mode 100644 Resources/config/doctrine/Activity.orm.yml create mode 100644 Resources/config/doctrine/ActivityReason.orm.yml create mode 100644 Resources/config/doctrine/ActivityReasonCategory.orm.yml create mode 100644 Resources/config/doctrine/ActivityType.orm.yml create mode 100644 Resources/migrations/Version20150701091248.php diff --git a/Entity/Activity.php b/Entity/Activity.php new file mode 100644 index 000000000..e4662983d --- /dev/null +++ b/Entity/Activity.php @@ -0,0 +1,311 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Entity; + +use Chill\MainBundle\Entity\Scope; +use Chill\MainBundle\Entity\User; +use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\ActivityBundle\Entity\ActivityType; +use Chill\PersonBundle\Entity\Person; + +/** + * Activity + */ +class Activity +{ + /** + * @var integer + */ + private $id; + + /** + * @var User + */ + private $user; + + /** + * @var \DateTime + */ + private $date; + + /** + * @var \DateTime + */ + private $durationTime; + + /** + * @var string + */ + private $remark; + + /** + * @var boolean + */ + private $attendee; + + /** + * @var ActivityReason + */ + private $reason; + + /** + * @var ActivityType + */ + private $type; + + /** + * @var Scope + */ + private $scope; + + /** + * @var Person + */ + private $person; + + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set user + * + * @param User $user + * + * @return Activity + */ + public function setUserr(User $user) + { + $this->user = $user; + + return $this; + } + + /** + * Get user + * + * @return User + */ + public function getUser() + { + return $this->user; + } + + /** + * Set date + * + * @param \DateTime $date + * + * @return Activity + */ + public function setDate($date) + { + $this->date = $date; + + return $this; + } + + /** + * Get date + * + * @return \DateTime + */ + public function getDate() + { + return $this->date; + } + + /** + * Set durationTime + * + * @param \DateTime $durationTime + * + * @return Activity + */ + public function setDurationTime($durationTime) + { + $this->durationTime = $durationTime; + + return $this; + } + + /** + * Get durationTime + * + * @return \DateTime + */ + public function getDurationTime() + { + return $this->durationTime; + } + + /** + * Set remark + * + * @param string $remark + * + * @return Activity + */ + public function setRemark($remark) + { + $this->remark = $remark; + + return $this; + } + + /** + * Get remark + * + * @return string + */ + public function getRemark() + { + return $this->remark; + } + + /** + * Set attendee + * + * @param boolean $attendee + * + * @return Activity + */ + public function setAttendee($attendee) + { + $this->attendee = $attendee; + + return $this; + } + + /** + * Get attendee + * + * @return boolean + */ + public function getAttendee() + { + return $this->attendee; + } + + /** + * Set reason + * + * @param ActivityReason $reason + * + * @return Activity + */ + public function setReason(ActivityReason $reason) + { + $this->reason = $reason; + + return $this; + } + + /** + * Get reason + * + * @return ActivityReason + */ + public function getReason() + { + return $this->reason; + } + + /** + * Set type + * + * @param ActivityType $type + * + * @return Activity + */ + public function setType(ActivityType $type) + { + $this->type = $type; + + return $this; + } + + /** + * Get type + * + * @return ActivityType + */ + public function getType() + { + return $this->type; + } + + /** + * Set scope + * + * @param Scope $scope + * + * @return Activity + */ + public function setScope(Scope $scope) + { + $this->scope = $scope; + + return $this; + } + + /** + * Get scope + * + * @return Scope + */ + public function getScope() + { + return $this->scope; + } + + /** + * Set person + * + * @param Person $person + * + * @return Activity + */ + public function setPerson(Person $person) + { + $this->person = $person; + + return $this; + } + + /** + * Get person + * + * @return Person + */ + public function getPerson() + { + return $this->person; + } +} + diff --git a/Entity/ActivityReason.php b/Entity/ActivityReason.php new file mode 100644 index 000000000..10f9243a6 --- /dev/null +++ b/Entity/ActivityReason.php @@ -0,0 +1,133 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Entity; + +use Chill\ActivityBundle\Entity\ActivityReasonCategory; + +/** + * ActivityReason + */ +class ActivityReason +{ + /** + * @var integer + */ + private $id; + + /** + * @var string + */ + private $label; + + /** + * @var ActivityReasonCategory + */ + private $category; + + /** + * @var boolean + */ + private $active; + + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set label + * + * @param string $label + * + * @return ActivityReason + */ + public function setLabel($label) + { + $this->label = $label; + + return $this; + } + + /** + * Get label + * + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Set category + * + * @param ActivityReasonCategory $category + * + * @return ActivityReason + */ + public function setCategory(ActivityReasonCategory $category) + { + $this->category = $category; + + return $this; + } + + /** + * Get category + * + * @return ActivityReasonCategory + */ + public function getCategory() + { + return $this->category; + } + + /** + * Set active + * + * @param boolean $active + * + * @return ActivityReason + */ + public function setActive($active) + { + $this->active = $active; + + return $this; + } + + /** + * Get active + * + * @return boolean + */ + public function getActive() + { + return $this->active; + } +} + diff --git a/Entity/ActivityReasonCategory.php b/Entity/ActivityReasonCategory.php new file mode 100644 index 000000000..c7af694c5 --- /dev/null +++ b/Entity/ActivityReasonCategory.php @@ -0,0 +1,102 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Entity; + +/** + * ActivityReasonCategory + */ +class ActivityReasonCategory +{ + /** + * @var integer + */ + private $id; + + /** + * @var string + */ + private $label; + + /** + * @var boolean + */ + private $active; + + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set label + * + * @param string $label + * + * @return ActivityReasonCategory + */ + public function setLabel($label) + { + $this->label = $label; + + return $this; + } + + /** + * Get label + * + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Set active + * + * @param boolean $active + * + * @return ActivityReasonCategory + */ + public function setActive($active) + { + $this->active = $active; + + return $this; + } + + /** + * Get active + * + * @return boolean + */ + public function getActive() + { + return $this->active; + } +} + diff --git a/Entity/ActivityType.php b/Entity/ActivityType.php new file mode 100644 index 000000000..0fadc77a0 --- /dev/null +++ b/Entity/ActivityType.php @@ -0,0 +1,73 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Entity; + +/** + * ActivityType + */ +class ActivityType +{ + /** + * @var integer + */ + private $id; + + /** + * @var string + */ + private $name; + + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set name + * + * @param string $name + * + * @return ActivityType + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } +} + diff --git a/Resources/config/doctrine/Activity.orm.yml b/Resources/config/doctrine/Activity.orm.yml new file mode 100644 index 000000000..22ebc3219 --- /dev/null +++ b/Resources/config/doctrine/Activity.orm.yml @@ -0,0 +1,30 @@ +Chill\ActivityBundle\Entity\Activity: + type: entity + table: null + id: + id: + type: integer + id: true + generator: + strategy: AUTO + fields: + date: + type: datetime + durationTime: + type: time + remark: + type: text + attendee: + type: boolean + manyToOne: + user: + targetEntity: Chill\MainBundle\Entity\User + scope: + targetEntity: Chill\MainBundle\Entity\Scope + reason: + targetEntity: Chill\ActivityBundle\Entity\ActivityReason + type: + targetEntity: Chill\ActivityBundle\Entity\ActivityType + person: + targetEntity: Chill\PersonBundle\Entity\Person + lifecycleCallbacks: { } diff --git a/Resources/config/doctrine/ActivityReason.orm.yml b/Resources/config/doctrine/ActivityReason.orm.yml new file mode 100644 index 000000000..00cfdb03f --- /dev/null +++ b/Resources/config/doctrine/ActivityReason.orm.yml @@ -0,0 +1,19 @@ +Chill\ActivityBundle\Entity\ActivityReason: + type: entity + table: null + id: + id: + type: integer + id: true + generator: + strategy: AUTO + fields: + label: + type: string + length: 255 + active: + type: boolean + manyToOne: + category: + targetEntity: Chill\ActivityBundle\Entity\ActivityReasonCategory + lifecycleCallbacks: { } \ No newline at end of file diff --git a/Resources/config/doctrine/ActivityReasonCategory.orm.yml b/Resources/config/doctrine/ActivityReasonCategory.orm.yml new file mode 100644 index 000000000..96e0b667d --- /dev/null +++ b/Resources/config/doctrine/ActivityReasonCategory.orm.yml @@ -0,0 +1,16 @@ +Chill\ActivityBundle\Entity\ActivityReasonCategory: + type: entity + table: null + id: + id: + type: integer + id: true + generator: + strategy: AUTO + fields: + label: + type: string + length: 255 + active: + type: boolean + lifecycleCallbacks: { } diff --git a/Resources/config/doctrine/ActivityType.orm.yml b/Resources/config/doctrine/ActivityType.orm.yml new file mode 100644 index 000000000..d6691e25b --- /dev/null +++ b/Resources/config/doctrine/ActivityType.orm.yml @@ -0,0 +1,14 @@ +Chill\ActivityBundle\Entity\ActivityType: + type: entity + table: null + id: + id: + type: integer + id: true + generator: + strategy: AUTO + fields: + name: + type: string + length: 255 + lifecycleCallbacks: { } diff --git a/Resources/migrations/Version20150701091248.php b/Resources/migrations/Version20150701091248.php new file mode 100644 index 000000000..6173fbdaa --- /dev/null +++ b/Resources/migrations/Version20150701091248.php @@ -0,0 +1,63 @@ +abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('CREATE SEQUENCE Activity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE ActivityReason_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE ActivityReasonCategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE ActivityType_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE Activity (id INT NOT NULL, user_id INT DEFAULT NULL, scope_id INT DEFAULT NULL, reason_id INT DEFAULT NULL, type_id INT DEFAULT NULL, person_id INT DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, durationTime TIME(0) WITHOUT TIME ZONE NOT NULL, remark TEXT NOT NULL, attendee BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_55026B0CA76ED395 ON Activity (user_id)'); + $this->addSql('CREATE INDEX IDX_55026B0C682B5931 ON Activity (scope_id)'); + $this->addSql('CREATE INDEX IDX_55026B0C59BB1592 ON Activity (reason_id)'); + $this->addSql('CREATE INDEX IDX_55026B0CC54C8C93 ON Activity (type_id)'); + $this->addSql('CREATE INDEX IDX_55026B0C217BBB47 ON Activity (person_id)'); + $this->addSql('CREATE TABLE ActivityReason (id INT NOT NULL, category_id INT DEFAULT NULL, label VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_654A2FCD12469DE2 ON ActivityReason (category_id)'); + $this->addSql('CREATE TABLE ActivityReasonCategory (id INT NOT NULL, label VARCHAR(255) NOT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE ActivityType (id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE Activity ADD CONSTRAINT FK_55026B0CA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE Activity ADD CONSTRAINT FK_55026B0C682B5931 FOREIGN KEY (scope_id) REFERENCES scopes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE Activity ADD CONSTRAINT FK_55026B0C59BB1592 FOREIGN KEY (reason_id) REFERENCES ActivityReason (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE Activity ADD CONSTRAINT FK_55026B0CC54C8C93 FOREIGN KEY (type_id) REFERENCES ActivityType (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE Activity ADD CONSTRAINT FK_55026B0C217BBB47 FOREIGN KEY (person_id) REFERENCES Person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE ActivityReason ADD CONSTRAINT FK_654A2FCD12469DE2 FOREIGN KEY (category_id) REFERENCES ActivityReasonCategory (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE Activity DROP CONSTRAINT FK_55026B0C59BB1592'); + $this->addSql('ALTER TABLE ActivityReason DROP CONSTRAINT FK_654A2FCD12469DE2'); + $this->addSql('ALTER TABLE Activity DROP CONSTRAINT FK_55026B0CC54C8C93'); + $this->addSql('DROP SEQUENCE Activity_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE ActivityReason_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE ActivityReasonCategory_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE ActivityType_id_seq CASCADE'); + $this->addSql('DROP TABLE Activity'); + $this->addSql('DROP TABLE ActivityReason'); + $this->addSql('DROP TABLE ActivityReasonCategory'); + $this->addSql('DROP TABLE ActivityType'); + } +} \ No newline at end of file From cfc7b725d86e7a0a5a01d3c5f8f0594ff0589d2a Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 11:14:41 +0200 Subject: [PATCH 006/163] Enabling console --- Tests/Fixtures/App/.DS_Store | Bin 0 -> 6148 bytes Tests/Fixtures/App/app/.DS_Store | Bin 0 -> 6148 bytes Tests/Fixtures/App/app/AppKernel.php | 39 + .../App/app/DoctrineMigrations/.gitignore | 2 + Tests/Fixtures/App/app/Resources/.DS_Store | Bin 0 -> 6148 bytes Tests/Fixtures/App/app/autoload.php | 13 + Tests/Fixtures/App/app/bootstrap.php.cache | 3101 +++++++++++ .../cache/dev/appDevDebugProjectContainer.php | 4685 +++++++++++++++++ .../dev/appDevDebugProjectContainer.php.meta | 1 + .../cache/dev/appDevDebugProjectContainer.xml | 3568 +++++++++++++ .../appDevDebugProjectContainerCompiler.log | 438 ++ Tests/Fixtures/App/app/cache/dev/classes.map | 88 + Tests/Fixtures/App/app/config/config.yml | 74 + Tests/Fixtures/App/app/config/config_dev.yml | 7 + Tests/Fixtures/App/app/config/config_test.yml | 8 + ...mizable_entities_test_not_empty_config.yml | 9 + .../App/app/config/parameters.travis.yml | 7 + Tests/Fixtures/App/app/config/parameters.yml | 7 + .../App/app/config/parameters.yml.dist | 7 + Tests/Fixtures/App/app/config/routing.yml | 10 + Tests/Fixtures/App/app/console | 27 + Tests/Fixtures/App/web/app_dev.php | 30 + composer.json | 36 +- 23 files changed, 12156 insertions(+), 1 deletion(-) create mode 100644 Tests/Fixtures/App/.DS_Store create mode 100644 Tests/Fixtures/App/app/.DS_Store create mode 100644 Tests/Fixtures/App/app/AppKernel.php create mode 100644 Tests/Fixtures/App/app/DoctrineMigrations/.gitignore create mode 100644 Tests/Fixtures/App/app/Resources/.DS_Store create mode 100644 Tests/Fixtures/App/app/autoload.php create mode 100644 Tests/Fixtures/App/app/bootstrap.php.cache create mode 100644 Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php create mode 100644 Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta create mode 100644 Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml create mode 100644 Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log create mode 100644 Tests/Fixtures/App/app/cache/dev/classes.map create mode 100644 Tests/Fixtures/App/app/config/config.yml create mode 100644 Tests/Fixtures/App/app/config/config_dev.yml create mode 100644 Tests/Fixtures/App/app/config/config_test.yml create mode 100644 Tests/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml create mode 100644 Tests/Fixtures/App/app/config/parameters.travis.yml create mode 100644 Tests/Fixtures/App/app/config/parameters.yml create mode 100644 Tests/Fixtures/App/app/config/parameters.yml.dist create mode 100644 Tests/Fixtures/App/app/config/routing.yml create mode 100755 Tests/Fixtures/App/app/console create mode 100644 Tests/Fixtures/App/web/app_dev.php diff --git a/Tests/Fixtures/App/.DS_Store b/Tests/Fixtures/App/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a00f962abeadbc07d074195d25166f1626619cdd GIT binary patch literal 6148 zcmeHK%}T>S5Z-O8ru7n0LGY5R;GxAzud&vnP^ehMN=-!I{p*W3DVN`PE?-z!Tr!HKWqiz)(pjq)j#`P6 z4CA^pIF&Qu`L4E`PSX3dkHWA&u^snV_@l15wjTzGBLaW$CAHHQfftVI;V|&xPD{P7 zExe@HHP@R1{{m8*PT(JlSh%7ul1rnAPuJWSk1OT!wpFQC(`{>9tASnJsimp;WEh)U zyL*QxQF?WKb9;CH@c8_q_JCvAD60x4*tc%jj1)S)DO zx6TxYcdZ3_4vKl318fYK}{*-|aDpX#P literal 0 HcmV?d00001 diff --git a/Tests/Fixtures/App/app/.DS_Store b/Tests/Fixtures/App/app/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..160f0c174dcf116cfbbb3e721ad8c751ba4cc45a GIT binary patch literal 6148 zcmeHKO-sW-5Pe&FsCX%O@t8lL!G92I^(0bI@7lDWqBi8C=q*3pH#19Vi9&mkA~Rw3 z&Cbs3X5W--7eE*_vvXhwU_ce@9kTgBWL&f(z334PI!A>XC7w{=tP|~yePlptcZ?|( zd}^%MufVg`F=st<+Vi5G-ZWKRGGl@V#?D#m3Mt+hQ8K2XJ)yP0E5~x3FU2KuU+~5! z#ghIH%otI!C$rkfDOXz0OLfhfqf2UyFGk-pSKd!nyr%b)cEc?3rnuk?1yO!`g1hYM zHtuRm9`><}{!Y$-GvEyD!~oB1k-?Fnx6Xhw;0&x7kncl670e>GhWhDXqgMc8pKcY} za+i>tBw`k^HRK2-SSry{L%d=HOQ%1HaaqLH(9#ifWzG{<4)KN(bana@4M)ffy>$kh zflUSutUHwR|LXVq|7Mc+oB?OxUojB+getEnvironment(), array('dev', 'test'))) { + $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); + $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); + $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); + $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); + } + + return $bundles; + } + + public function registerContainerConfiguration(LoaderInterface $loader) + { + $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); + } +} diff --git a/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore b/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/Tests/Fixtures/App/app/Resources/.DS_Store b/Tests/Fixtures/App/app/Resources/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0parameters = $parameters; +} +public function all() +{ +return $this->parameters; +} +public function keys() +{ +return array_keys($this->parameters); +} +public function replace(array $parameters = array()) +{ +$this->parameters = $parameters; +} +public function add(array $parameters = array()) +{ +$this->parameters = array_replace($this->parameters, $parameters); +} +public function get($path, $default = null, $deep = false) +{ +if (!$deep || false === $pos = strpos($path,'[')) { +return array_key_exists($path, $this->parameters) ? $this->parameters[$path] : $default; +} +$root = substr($path, 0, $pos); +if (!array_key_exists($root, $this->parameters)) { +return $default; +} +$value = $this->parameters[$root]; +$currentKey = null; +for ($i = $pos, $c = strlen($path); $i < $c; $i++) { +$char = $path[$i]; +if ('['=== $char) { +if (null !== $currentKey) { +throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "[" at position %d.', $i)); +} +$currentKey =''; +} elseif (']'=== $char) { +if (null === $currentKey) { +throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "]" at position %d.', $i)); +} +if (!is_array($value) || !array_key_exists($currentKey, $value)) { +return $default; +} +$value = $value[$currentKey]; +$currentKey = null; +} else { +if (null === $currentKey) { +throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "%s" at position %d.', $char, $i)); +} +$currentKey .= $char; +} +} +if (null !== $currentKey) { +throw new \InvalidArgumentException(sprintf('Malformed path. Path must end with "]".')); +} +return $value; +} +public function set($key, $value) +{ +$this->parameters[$key] = $value; +} +public function has($key) +{ +return array_key_exists($key, $this->parameters); +} +public function remove($key) +{ +unset($this->parameters[$key]); +} +public function getAlpha($key, $default ='', $deep = false) +{ +return preg_replace('/[^[:alpha:]]/','', $this->get($key, $default, $deep)); +} +public function getAlnum($key, $default ='', $deep = false) +{ +return preg_replace('/[^[:alnum:]]/','', $this->get($key, $default, $deep)); +} +public function getDigits($key, $default ='', $deep = false) +{ +return str_replace(array('-','+'),'', $this->filter($key, $default, $deep, FILTER_SANITIZE_NUMBER_INT)); +} +public function getInt($key, $default = 0, $deep = false) +{ +return (int) $this->get($key, $default, $deep); +} +public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array()) +{ +$value = $this->get($key, $default, $deep); +if (!is_array($options) && $options) { +$options = array('flags'=> $options); +} +if (is_array($value) && !isset($options['flags'])) { +$options['flags'] = FILTER_REQUIRE_ARRAY; +} +return filter_var($value, $filter, $options); +} +public function getIterator() +{ +return new \ArrayIterator($this->parameters); +} +public function count() +{ +return count($this->parameters); +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class HeaderBag implements \IteratorAggregate, \Countable +{ +protected $headers = array(); +protected $cacheControl = array(); +public function __construct(array $headers = array()) +{ +foreach ($headers as $key => $values) { +$this->set($key, $values); +} +} +public function __toString() +{ +if (!$this->headers) { +return''; +} +$max = max(array_map('strlen', array_keys($this->headers))) + 1; +$content =''; +ksort($this->headers); +foreach ($this->headers as $name => $values) { +$name = implode('-', array_map('ucfirst', explode('-', $name))); +foreach ($values as $value) { +$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); +} +} +return $content; +} +public function all() +{ +return $this->headers; +} +public function keys() +{ +return array_keys($this->headers); +} +public function replace(array $headers = array()) +{ +$this->headers = array(); +$this->add($headers); +} +public function add(array $headers) +{ +foreach ($headers as $key => $values) { +$this->set($key, $values); +} +} +public function get($key, $default = null, $first = true) +{ +$key = strtr(strtolower($key),'_','-'); +if (!array_key_exists($key, $this->headers)) { +if (null === $default) { +return $first ? null : array(); +} +return $first ? $default : array($default); +} +if ($first) { +return count($this->headers[$key]) ? $this->headers[$key][0] : $default; +} +return $this->headers[$key]; +} +public function set($key, $values, $replace = true) +{ +$key = strtr(strtolower($key),'_','-'); +$values = array_values((array) $values); +if (true === $replace || !isset($this->headers[$key])) { +$this->headers[$key] = $values; +} else { +$this->headers[$key] = array_merge($this->headers[$key], $values); +} +if ('cache-control'=== $key) { +$this->cacheControl = $this->parseCacheControl($values[0]); +} +} +public function has($key) +{ +return array_key_exists(strtr(strtolower($key),'_','-'), $this->headers); +} +public function contains($key, $value) +{ +return in_array($value, $this->get($key, null, false)); +} +public function remove($key) +{ +$key = strtr(strtolower($key),'_','-'); +unset($this->headers[$key]); +if ('cache-control'=== $key) { +$this->cacheControl = array(); +} +} +public function getDate($key, \DateTime $default = null) +{ +if (null === $value = $this->get($key)) { +return $default; +} +if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { +throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value)); +} +return $date; +} +public function addCacheControlDirective($key, $value = true) +{ +$this->cacheControl[$key] = $value; +$this->set('Cache-Control', $this->getCacheControlHeader()); +} +public function hasCacheControlDirective($key) +{ +return array_key_exists($key, $this->cacheControl); +} +public function getCacheControlDirective($key) +{ +return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; +} +public function removeCacheControlDirective($key) +{ +unset($this->cacheControl[$key]); +$this->set('Cache-Control', $this->getCacheControlHeader()); +} +public function getIterator() +{ +return new \ArrayIterator($this->headers); +} +public function count() +{ +return count($this->headers); +} +protected function getCacheControlHeader() +{ +$parts = array(); +ksort($this->cacheControl); +foreach ($this->cacheControl as $key => $value) { +if (true === $value) { +$parts[] = $key; +} else { +if (preg_match('#[^a-zA-Z0-9._-]#', $value)) { +$value ='"'.$value.'"'; +} +$parts[] = "$key=$value"; +} +} +return implode(', ', $parts); +} +protected function parseCacheControl($header) +{ +$cacheControl = array(); +preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER); +foreach ($matches as $match) { +$cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true); +} +return $cacheControl; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +use Symfony\Component\HttpFoundation\File\UploadedFile; +class FileBag extends ParameterBag +{ +private static $fileKeys = array('error','name','size','tmp_name','type'); +public function __construct(array $parameters = array()) +{ +$this->replace($parameters); +} +public function replace(array $files = array()) +{ +$this->parameters = array(); +$this->add($files); +} +public function set($key, $value) +{ +if (!is_array($value) && !$value instanceof UploadedFile) { +throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); +} +parent::set($key, $this->convertFileInformation($value)); +} +public function add(array $files = array()) +{ +foreach ($files as $key => $file) { +$this->set($key, $file); +} +} +protected function convertFileInformation($file) +{ +if ($file instanceof UploadedFile) { +return $file; +} +$file = $this->fixPhpFilesArray($file); +if (is_array($file)) { +$keys = array_keys($file); +sort($keys); +if ($keys == self::$fileKeys) { +if (UPLOAD_ERR_NO_FILE == $file['error']) { +$file = null; +} else { +$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']); +} +} else { +$file = array_map(array($this,'convertFileInformation'), $file); +} +} +return $file; +} +protected function fixPhpFilesArray($data) +{ +if (!is_array($data)) { +return $data; +} +$keys = array_keys($data); +sort($keys); +if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) { +return $data; +} +$files = $data; +foreach (self::$fileKeys as $k) { +unset($files[$k]); +} +foreach (array_keys($data['name']) as $key) { +$files[$key] = $this->fixPhpFilesArray(array('error'=> $data['error'][$key],'name'=> $data['name'][$key],'type'=> $data['type'][$key],'tmp_name'=> $data['tmp_name'][$key],'size'=> $data['size'][$key], +)); +} +return $files; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class ServerBag extends ParameterBag +{ +public function getHeaders() +{ +$headers = array(); +$contentHeaders = array('CONTENT_LENGTH'=> true,'CONTENT_MD5'=> true,'CONTENT_TYPE'=> true); +foreach ($this->parameters as $key => $value) { +if (0 === strpos($key,'HTTP_')) { +$headers[substr($key, 5)] = $value; +} +elseif (isset($contentHeaders[$key])) { +$headers[$key] = $value; +} +} +if (isset($this->parameters['PHP_AUTH_USER'])) { +$headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; +$headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] :''; +} else { +$authorizationHeader = null; +if (isset($this->parameters['HTTP_AUTHORIZATION'])) { +$authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; +} elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { +$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; +} +if (null !== $authorizationHeader) { +if (0 === stripos($authorizationHeader,'basic ')) { +$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); +if (count($exploded) == 2) { +list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded; +} +} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest '))) { +$headers['PHP_AUTH_DIGEST'] = $authorizationHeader; +$this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; +} +} +} +if (isset($headers['PHP_AUTH_USER'])) { +$headers['AUTHORIZATION'] ='Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); +} elseif (isset($headers['PHP_AUTH_DIGEST'])) { +$headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; +} +return $headers; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +use Symfony\Component\HttpFoundation\Session\SessionInterface; +class Request +{ +const HEADER_CLIENT_IP ='client_ip'; +const HEADER_CLIENT_HOST ='client_host'; +const HEADER_CLIENT_PROTO ='client_proto'; +const HEADER_CLIENT_PORT ='client_port'; +protected static $trustedProxies = array(); +protected static $trustedHostPatterns = array(); +protected static $trustedHosts = array(); +protected static $trustedHeaders = array( +self::HEADER_CLIENT_IP =>'X_FORWARDED_FOR', +self::HEADER_CLIENT_HOST =>'X_FORWARDED_HOST', +self::HEADER_CLIENT_PROTO =>'X_FORWARDED_PROTO', +self::HEADER_CLIENT_PORT =>'X_FORWARDED_PORT', +); +protected static $httpMethodParameterOverride = false; +public $attributes; +public $request; +public $query; +public $server; +public $files; +public $cookies; +public $headers; +protected $content; +protected $languages; +protected $charsets; +protected $encodings; +protected $acceptableContentTypes; +protected $pathInfo; +protected $requestUri; +protected $baseUrl; +protected $basePath; +protected $method; +protected $format; +protected $session; +protected $locale; +protected $defaultLocale ='en'; +protected static $formats; +protected static $requestFactory; +public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); +} +public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +$this->request = new ParameterBag($request); +$this->query = new ParameterBag($query); +$this->attributes = new ParameterBag($attributes); +$this->cookies = new ParameterBag($cookies); +$this->files = new FileBag($files); +$this->server = new ServerBag($server); +$this->headers = new HeaderBag($this->server->getHeaders()); +$this->content = $content; +$this->languages = null; +$this->charsets = null; +$this->encodings = null; +$this->acceptableContentTypes = null; +$this->pathInfo = null; +$this->requestUri = null; +$this->baseUrl = null; +$this->basePath = null; +$this->method = null; +$this->format = null; +} +public static function createFromGlobals() +{ +$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); +if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded') +&& in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH')) +) { +parse_str($request->getContent(), $data); +$request->request = new ParameterBag($data); +} +return $request; +} +public static function create($uri, $method ='GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null) +{ +$server = array_replace(array('SERVER_NAME'=>'localhost','SERVER_PORT'=> 80,'HTTP_HOST'=>'localhost','HTTP_USER_AGENT'=>'Symfony/2.X','HTTP_ACCEPT'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','HTTP_ACCEPT_LANGUAGE'=>'en-us,en;q=0.5','HTTP_ACCEPT_CHARSET'=>'ISO-8859-1,utf-8;q=0.7,*;q=0.7','REMOTE_ADDR'=>'127.0.0.1','SCRIPT_NAME'=>'','SCRIPT_FILENAME'=>'','SERVER_PROTOCOL'=>'HTTP/1.1','REQUEST_TIME'=> time(), +), $server); +$server['PATH_INFO'] =''; +$server['REQUEST_METHOD'] = strtoupper($method); +$components = parse_url($uri); +if (isset($components['host'])) { +$server['SERVER_NAME'] = $components['host']; +$server['HTTP_HOST'] = $components['host']; +} +if (isset($components['scheme'])) { +if ('https'=== $components['scheme']) { +$server['HTTPS'] ='on'; +$server['SERVER_PORT'] = 443; +} else { +unset($server['HTTPS']); +$server['SERVER_PORT'] = 80; +} +} +if (isset($components['port'])) { +$server['SERVER_PORT'] = $components['port']; +$server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port']; +} +if (isset($components['user'])) { +$server['PHP_AUTH_USER'] = $components['user']; +} +if (isset($components['pass'])) { +$server['PHP_AUTH_PW'] = $components['pass']; +} +if (!isset($components['path'])) { +$components['path'] ='/'; +} +switch (strtoupper($method)) { +case'POST': +case'PUT': +case'DELETE': +if (!isset($server['CONTENT_TYPE'])) { +$server['CONTENT_TYPE'] ='application/x-www-form-urlencoded'; +} +case'PATCH': +$request = $parameters; +$query = array(); +break; +default: +$request = array(); +$query = $parameters; +break; +} +$queryString =''; +if (isset($components['query'])) { +parse_str(html_entity_decode($components['query']), $qs); +if ($query) { +$query = array_replace($qs, $query); +$queryString = http_build_query($query,'','&'); +} else { +$query = $qs; +$queryString = $components['query']; +} +} elseif ($query) { +$queryString = http_build_query($query,'','&'); +} +$server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :''); +$server['QUERY_STRING'] = $queryString; +return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content); +} +public static function setFactory($callable) +{ +self::$requestFactory = $callable; +} +public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) +{ +$dup = clone $this; +if ($query !== null) { +$dup->query = new ParameterBag($query); +} +if ($request !== null) { +$dup->request = new ParameterBag($request); +} +if ($attributes !== null) { +$dup->attributes = new ParameterBag($attributes); +} +if ($cookies !== null) { +$dup->cookies = new ParameterBag($cookies); +} +if ($files !== null) { +$dup->files = new FileBag($files); +} +if ($server !== null) { +$dup->server = new ServerBag($server); +$dup->headers = new HeaderBag($dup->server->getHeaders()); +} +$dup->languages = null; +$dup->charsets = null; +$dup->encodings = null; +$dup->acceptableContentTypes = null; +$dup->pathInfo = null; +$dup->requestUri = null; +$dup->baseUrl = null; +$dup->basePath = null; +$dup->method = null; +$dup->format = null; +if (!$dup->get('_format') && $this->get('_format')) { +$dup->attributes->set('_format', $this->get('_format')); +} +if (!$dup->getRequestFormat(null)) { +$dup->setRequestFormat($format = $this->getRequestFormat(null)); +} +return $dup; +} +public function __clone() +{ +$this->query = clone $this->query; +$this->request = clone $this->request; +$this->attributes = clone $this->attributes; +$this->cookies = clone $this->cookies; +$this->files = clone $this->files; +$this->server = clone $this->server; +$this->headers = clone $this->headers; +} +public function __toString() +{ +return +sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". +$this->headers."\r\n". +$this->getContent(); +} +public function overrideGlobals() +{ +$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), null,'&'))); +$_GET = $this->query->all(); +$_POST = $this->request->all(); +$_SERVER = $this->server->all(); +$_COOKIE = $this->cookies->all(); +foreach ($this->headers->all() as $key => $value) { +$key = strtoupper(str_replace('-','_', $key)); +if (in_array($key, array('CONTENT_TYPE','CONTENT_LENGTH'))) { +$_SERVER[$key] = implode(', ', $value); +} else { +$_SERVER['HTTP_'.$key] = implode(', ', $value); +} +} +$request = array('g'=> $_GET,'p'=> $_POST,'c'=> $_COOKIE); +$requestOrder = ini_get('request_order') ?: ini_get('variables_order'); +$requestOrder = preg_replace('#[^cgp]#','', strtolower($requestOrder)) ?:'gp'; +$_REQUEST = array(); +foreach (str_split($requestOrder) as $order) { +$_REQUEST = array_merge($_REQUEST, $request[$order]); +} +} +public static function setTrustedProxies(array $proxies) +{ +self::$trustedProxies = $proxies; +} +public static function getTrustedProxies() +{ +return self::$trustedProxies; +} +public static function setTrustedHosts(array $hostPatterns) +{ +self::$trustedHostPatterns = array_map(function ($hostPattern) { +return sprintf('{%s}i', str_replace('}','\\}', $hostPattern)); +}, $hostPatterns); +self::$trustedHosts = array(); +} +public static function getTrustedHosts() +{ +return self::$trustedHostPatterns; +} +public static function setTrustedHeaderName($key, $value) +{ +if (!array_key_exists($key, self::$trustedHeaders)) { +throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key)); +} +self::$trustedHeaders[$key] = $value; +} +public static function getTrustedHeaderName($key) +{ +if (!array_key_exists($key, self::$trustedHeaders)) { +throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key)); +} +return self::$trustedHeaders[$key]; +} +public static function normalizeQueryString($qs) +{ +if (''== $qs) { +return''; +} +$parts = array(); +$order = array(); +foreach (explode('&', $qs) as $param) { +if (''=== $param ||'='=== $param[0]) { +continue; +} +$keyValuePair = explode('=', $param, 2); +$parts[] = isset($keyValuePair[1]) ? +rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : +rawurlencode(urldecode($keyValuePair[0])); +$order[] = urldecode($keyValuePair[0]); +} +array_multisort($order, SORT_ASC, $parts); +return implode('&', $parts); +} +public static function enableHttpMethodParameterOverride() +{ +self::$httpMethodParameterOverride = true; +} +public static function getHttpMethodParameterOverride() +{ +return self::$httpMethodParameterOverride; +} +public function get($key, $default = null, $deep = false) +{ +return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep); +} +public function getSession() +{ +return $this->session; +} +public function hasPreviousSession() +{ +return $this->hasSession() && $this->cookies->has($this->session->getName()); +} +public function hasSession() +{ +return null !== $this->session; +} +public function setSession(SessionInterface $session) +{ +$this->session = $session; +} +public function getClientIps() +{ +$ip = $this->server->get('REMOTE_ADDR'); +if (!self::$trustedProxies) { +return array($ip); +} +if (!self::$trustedHeaders[self::HEADER_CLIENT_IP] || !$this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) { +return array($ip); +} +$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP]))); +$clientIps[] = $ip; +$ip = $clientIps[0]; +foreach ($clientIps as $key => $clientIp) { +if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { +unset($clientIps[$key]); +} +} +return $clientIps ? array_reverse($clientIps) : array($ip); +} +public function getClientIp() +{ +$ipAddresses = $this->getClientIps(); +return $ipAddresses[0]; +} +public function getScriptName() +{ +return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME','')); +} +public function getPathInfo() +{ +if (null === $this->pathInfo) { +$this->pathInfo = $this->preparePathInfo(); +} +return $this->pathInfo; +} +public function getBasePath() +{ +if (null === $this->basePath) { +$this->basePath = $this->prepareBasePath(); +} +return $this->basePath; +} +public function getBaseUrl() +{ +if (null === $this->baseUrl) { +$this->baseUrl = $this->prepareBaseUrl(); +} +return $this->baseUrl; +} +public function getScheme() +{ +return $this->isSecure() ?'https':'http'; +} +public function getPort() +{ +if (self::$trustedProxies) { +if (self::$trustedHeaders[self::HEADER_CLIENT_PORT] && $port = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PORT])) { +return $port; +} +if (self::$trustedHeaders[self::HEADER_CLIENT_PROTO] &&'https'=== $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO],'http')) { +return 443; +} +} +if ($host = $this->headers->get('HOST')) { +if ($host[0] ==='[') { +$pos = strpos($host,':', strrpos($host,']')); +} else { +$pos = strrpos($host,':'); +} +if (false !== $pos) { +return intval(substr($host, $pos + 1)); +} +return'https'=== $this->getScheme() ? 443 : 80; +} +return $this->server->get('SERVER_PORT'); +} +public function getUser() +{ +return $this->headers->get('PHP_AUTH_USER'); +} +public function getPassword() +{ +return $this->headers->get('PHP_AUTH_PW'); +} +public function getUserInfo() +{ +$userinfo = $this->getUser(); +$pass = $this->getPassword(); +if (''!= $pass) { +$userinfo .= ":$pass"; +} +return $userinfo; +} +public function getHttpHost() +{ +$scheme = $this->getScheme(); +$port = $this->getPort(); +if (('http'== $scheme && $port == 80) || ('https'== $scheme && $port == 443)) { +return $this->getHost(); +} +return $this->getHost().':'.$port; +} +public function getRequestUri() +{ +if (null === $this->requestUri) { +$this->requestUri = $this->prepareRequestUri(); +} +return $this->requestUri; +} +public function getSchemeAndHttpHost() +{ +return $this->getScheme().'://'.$this->getHttpHost(); +} +public function getUri() +{ +if (null !== $qs = $this->getQueryString()) { +$qs ='?'.$qs; +} +return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; +} +public function getUriForPath($path) +{ +return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; +} +public function getQueryString() +{ +$qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); +return''=== $qs ? null : $qs; +} +public function isSecure() +{ +if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) { +return in_array(strtolower(current(explode(',', $proto))), array('https','on','ssl','1')); +} +$https = $this->server->get('HTTPS'); +return !empty($https) &&'off'!== strtolower($https); +} +public function getHost() +{ +if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_HOST] && $host = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_HOST])) { +$elements = explode(',', $host); +$host = $elements[count($elements) - 1]; +} elseif (!$host = $this->headers->get('HOST')) { +if (!$host = $this->server->get('SERVER_NAME')) { +$host = $this->server->get('SERVER_ADDR',''); +} +} +$host = strtolower(preg_replace('/:\d+$/','', trim($host))); +if ($host &&''!== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/','', $host)) { +throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host)); +} +if (count(self::$trustedHostPatterns) > 0) { +if (in_array($host, self::$trustedHosts)) { +return $host; +} +foreach (self::$trustedHostPatterns as $pattern) { +if (preg_match($pattern, $host)) { +self::$trustedHosts[] = $host; +return $host; +} +} +throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host)); +} +return $host; +} +public function setMethod($method) +{ +$this->method = null; +$this->server->set('REQUEST_METHOD', $method); +} +public function getMethod() +{ +if (null === $this->method) { +$this->method = strtoupper($this->server->get('REQUEST_METHOD','GET')); +if ('POST'=== $this->method) { +if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { +$this->method = strtoupper($method); +} elseif (self::$httpMethodParameterOverride) { +$this->method = strtoupper($this->request->get('_method', $this->query->get('_method','POST'))); +} +} +} +return $this->method; +} +public function getRealMethod() +{ +return strtoupper($this->server->get('REQUEST_METHOD','GET')); +} +public function getMimeType($format) +{ +if (null === static::$formats) { +static::initializeFormats(); +} +return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; +} +public function getFormat($mimeType) +{ +if (false !== $pos = strpos($mimeType,';')) { +$mimeType = substr($mimeType, 0, $pos); +} +if (null === static::$formats) { +static::initializeFormats(); +} +foreach (static::$formats as $format => $mimeTypes) { +if (in_array($mimeType, (array) $mimeTypes)) { +return $format; +} +} +} +public function setFormat($format, $mimeTypes) +{ +if (null === static::$formats) { +static::initializeFormats(); +} +static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes); +} +public function getRequestFormat($default ='html') +{ +if (null === $this->format) { +$this->format = $this->get('_format', $default); +} +return $this->format; +} +public function setRequestFormat($format) +{ +$this->format = $format; +} +public function getContentType() +{ +return $this->getFormat($this->headers->get('CONTENT_TYPE')); +} +public function setDefaultLocale($locale) +{ +$this->defaultLocale = $locale; +if (null === $this->locale) { +$this->setPhpDefaultLocale($locale); +} +} +public function getDefaultLocale() +{ +return $this->defaultLocale; +} +public function setLocale($locale) +{ +$this->setPhpDefaultLocale($this->locale = $locale); +} +public function getLocale() +{ +return null === $this->locale ? $this->defaultLocale : $this->locale; +} +public function isMethod($method) +{ +return $this->getMethod() === strtoupper($method); +} +public function isMethodSafe() +{ +return in_array($this->getMethod(), array('GET','HEAD')); +} +public function getContent($asResource = false) +{ +if (false === $this->content || (true === $asResource && null !== $this->content)) { +throw new \LogicException('getContent() can only be called once when using the resource return type.'); +} +if (true === $asResource) { +$this->content = false; +return fopen('php://input','rb'); +} +if (null === $this->content) { +$this->content = file_get_contents('php://input'); +} +return $this->content; +} +public function getETags() +{ +return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY); +} +public function isNoCache() +{ +return $this->headers->hasCacheControlDirective('no-cache') ||'no-cache'== $this->headers->get('Pragma'); +} +public function getPreferredLanguage(array $locales = null) +{ +$preferredLanguages = $this->getLanguages(); +if (empty($locales)) { +return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null; +} +if (!$preferredLanguages) { +return $locales[0]; +} +$extendedPreferredLanguages = array(); +foreach ($preferredLanguages as $language) { +$extendedPreferredLanguages[] = $language; +if (false !== $position = strpos($language,'_')) { +$superLanguage = substr($language, 0, $position); +if (!in_array($superLanguage, $preferredLanguages)) { +$extendedPreferredLanguages[] = $superLanguage; +} +} +} +$preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales)); +return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $locales[0]; +} +public function getLanguages() +{ +if (null !== $this->languages) { +return $this->languages; +} +$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); +$this->languages = array(); +foreach (array_keys($languages) as $lang) { +if (strstr($lang,'-')) { +$codes = explode('-', $lang); +if ($codes[0] =='i') { +if (count($codes) > 1) { +$lang = $codes[1]; +} +} else { +for ($i = 0, $max = count($codes); $i < $max; $i++) { +if ($i == 0) { +$lang = strtolower($codes[0]); +} else { +$lang .='_'.strtoupper($codes[$i]); +} +} +} +} +$this->languages[] = $lang; +} +return $this->languages; +} +public function getCharsets() +{ +if (null !== $this->charsets) { +return $this->charsets; +} +return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()); +} +public function getEncodings() +{ +if (null !== $this->encodings) { +return $this->encodings; +} +return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all()); +} +public function getAcceptableContentTypes() +{ +if (null !== $this->acceptableContentTypes) { +return $this->acceptableContentTypes; +} +return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()); +} +public function isXmlHttpRequest() +{ +return'XMLHttpRequest'== $this->headers->get('X-Requested-With'); +} +protected function prepareRequestUri() +{ +$requestUri =''; +if ($this->headers->has('X_ORIGINAL_URL')) { +$requestUri = $this->headers->get('X_ORIGINAL_URL'); +$this->headers->remove('X_ORIGINAL_URL'); +$this->server->remove('HTTP_X_ORIGINAL_URL'); +$this->server->remove('UNENCODED_URL'); +$this->server->remove('IIS_WasUrlRewritten'); +} elseif ($this->headers->has('X_REWRITE_URL')) { +$requestUri = $this->headers->get('X_REWRITE_URL'); +$this->headers->remove('X_REWRITE_URL'); +} elseif ($this->server->get('IIS_WasUrlRewritten') =='1'&& $this->server->get('UNENCODED_URL') !='') { +$requestUri = $this->server->get('UNENCODED_URL'); +$this->server->remove('UNENCODED_URL'); +$this->server->remove('IIS_WasUrlRewritten'); +} elseif ($this->server->has('REQUEST_URI')) { +$requestUri = $this->server->get('REQUEST_URI'); +$schemeAndHttpHost = $this->getSchemeAndHttpHost(); +if (strpos($requestUri, $schemeAndHttpHost) === 0) { +$requestUri = substr($requestUri, strlen($schemeAndHttpHost)); +} +} elseif ($this->server->has('ORIG_PATH_INFO')) { +$requestUri = $this->server->get('ORIG_PATH_INFO'); +if (''!= $this->server->get('QUERY_STRING')) { +$requestUri .='?'.$this->server->get('QUERY_STRING'); +} +$this->server->remove('ORIG_PATH_INFO'); +} +$this->server->set('REQUEST_URI', $requestUri); +return $requestUri; +} +protected function prepareBaseUrl() +{ +$filename = basename($this->server->get('SCRIPT_FILENAME')); +if (basename($this->server->get('SCRIPT_NAME')) === $filename) { +$baseUrl = $this->server->get('SCRIPT_NAME'); +} elseif (basename($this->server->get('PHP_SELF')) === $filename) { +$baseUrl = $this->server->get('PHP_SELF'); +} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) { +$baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); } else { +$path = $this->server->get('PHP_SELF',''); +$file = $this->server->get('SCRIPT_FILENAME',''); +$segs = explode('/', trim($file,'/')); +$segs = array_reverse($segs); +$index = 0; +$last = count($segs); +$baseUrl =''; +do { +$seg = $segs[$index]; +$baseUrl ='/'.$seg.$baseUrl; +++$index; +} while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); +} +$requestUri = $this->getRequestUri(); +if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { +return $prefix; +} +if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, dirname($baseUrl))) { +return rtrim($prefix,'/'); +} +$truncatedRequestUri = $requestUri; +if (false !== $pos = strpos($requestUri,'?')) { +$truncatedRequestUri = substr($requestUri, 0, $pos); +} +$basename = basename($baseUrl); +if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) { +return''; +} +if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) { +$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); +} +return rtrim($baseUrl,'/'); +} +protected function prepareBasePath() +{ +$filename = basename($this->server->get('SCRIPT_FILENAME')); +$baseUrl = $this->getBaseUrl(); +if (empty($baseUrl)) { +return''; +} +if (basename($baseUrl) === $filename) { +$basePath = dirname($baseUrl); +} else { +$basePath = $baseUrl; +} +if ('\\'=== DIRECTORY_SEPARATOR) { +$basePath = str_replace('\\','/', $basePath); +} +return rtrim($basePath,'/'); +} +protected function preparePathInfo() +{ +$baseUrl = $this->getBaseUrl(); +if (null === ($requestUri = $this->getRequestUri())) { +return'/'; +} +$pathInfo ='/'; +if ($pos = strpos($requestUri,'?')) { +$requestUri = substr($requestUri, 0, $pos); +} +if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) { +return'/'; +} elseif (null === $baseUrl) { +return $requestUri; +} +return (string) $pathInfo; +} +protected static function initializeFormats() +{ +static::$formats = array('html'=> array('text/html','application/xhtml+xml'),'txt'=> array('text/plain'),'js'=> array('application/javascript','application/x-javascript','text/javascript'),'css'=> array('text/css'),'json'=> array('application/json','application/x-json'),'xml'=> array('text/xml','application/xml','application/x-xml'),'rdf'=> array('application/rdf+xml'),'atom'=> array('application/atom+xml'),'rss'=> array('application/rss+xml'), +); +} +private function setPhpDefaultLocale($locale) +{ +try { +if (class_exists('Locale', false)) { +\Locale::setDefault($locale); +} +} catch (\Exception $e) { +} +} +private function getUrlencodedPrefix($string, $prefix) +{ +if (0 !== strpos(rawurldecode($string), $prefix)) { +return false; +} +$len = strlen($prefix); +if (preg_match("#^(%[[:xdigit:]]{2}|.){{$len}}#", $string, $match)) { +return $match[0]; +} +return false; +} +private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +if (self::$requestFactory) { +$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content); +if (!$request instanceof Request) { +throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.'); +} +return $request; +} +return new static($query, $request, $attributes, $cookies, $files, $server, $content); +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class Response +{ +const HTTP_CONTINUE = 100; +const HTTP_SWITCHING_PROTOCOLS = 101; +const HTTP_PROCESSING = 102; const HTTP_OK = 200; +const HTTP_CREATED = 201; +const HTTP_ACCEPTED = 202; +const HTTP_NON_AUTHORITATIVE_INFORMATION = 203; +const HTTP_NO_CONTENT = 204; +const HTTP_RESET_CONTENT = 205; +const HTTP_PARTIAL_CONTENT = 206; +const HTTP_MULTI_STATUS = 207; const HTTP_ALREADY_REPORTED = 208; const HTTP_IM_USED = 226; const HTTP_MULTIPLE_CHOICES = 300; +const HTTP_MOVED_PERMANENTLY = 301; +const HTTP_FOUND = 302; +const HTTP_SEE_OTHER = 303; +const HTTP_NOT_MODIFIED = 304; +const HTTP_USE_PROXY = 305; +const HTTP_RESERVED = 306; +const HTTP_TEMPORARY_REDIRECT = 307; +const HTTP_PERMANENTLY_REDIRECT = 308; const HTTP_BAD_REQUEST = 400; +const HTTP_UNAUTHORIZED = 401; +const HTTP_PAYMENT_REQUIRED = 402; +const HTTP_FORBIDDEN = 403; +const HTTP_NOT_FOUND = 404; +const HTTP_METHOD_NOT_ALLOWED = 405; +const HTTP_NOT_ACCEPTABLE = 406; +const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; +const HTTP_REQUEST_TIMEOUT = 408; +const HTTP_CONFLICT = 409; +const HTTP_GONE = 410; +const HTTP_LENGTH_REQUIRED = 411; +const HTTP_PRECONDITION_FAILED = 412; +const HTTP_REQUEST_ENTITY_TOO_LARGE = 413; +const HTTP_REQUEST_URI_TOO_LONG = 414; +const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; +const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; +const HTTP_EXPECTATION_FAILED = 417; +const HTTP_I_AM_A_TEAPOT = 418; const HTTP_UNPROCESSABLE_ENTITY = 422; const HTTP_LOCKED = 423; const HTTP_FAILED_DEPENDENCY = 424; const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; const HTTP_UPGRADE_REQUIRED = 426; const HTTP_PRECONDITION_REQUIRED = 428; const HTTP_TOO_MANY_REQUESTS = 429; const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; const HTTP_INTERNAL_SERVER_ERROR = 500; +const HTTP_NOT_IMPLEMENTED = 501; +const HTTP_BAD_GATEWAY = 502; +const HTTP_SERVICE_UNAVAILABLE = 503; +const HTTP_GATEWAY_TIMEOUT = 504; +const HTTP_VERSION_NOT_SUPPORTED = 505; +const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; const HTTP_INSUFFICIENT_STORAGE = 507; const HTTP_LOOP_DETECTED = 508; const HTTP_NOT_EXTENDED = 510; const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; +public $headers; +protected $content; +protected $version; +protected $statusCode; +protected $statusText; +protected $charset; +public static $statusTexts = array( +100 =>'Continue', +101 =>'Switching Protocols', +102 =>'Processing', 200 =>'OK', +201 =>'Created', +202 =>'Accepted', +203 =>'Non-Authoritative Information', +204 =>'No Content', +205 =>'Reset Content', +206 =>'Partial Content', +207 =>'Multi-Status', 208 =>'Already Reported', 226 =>'IM Used', 300 =>'Multiple Choices', +301 =>'Moved Permanently', +302 =>'Found', +303 =>'See Other', +304 =>'Not Modified', +305 =>'Use Proxy', +306 =>'Reserved', +307 =>'Temporary Redirect', +308 =>'Permanent Redirect', 400 =>'Bad Request', +401 =>'Unauthorized', +402 =>'Payment Required', +403 =>'Forbidden', +404 =>'Not Found', +405 =>'Method Not Allowed', +406 =>'Not Acceptable', +407 =>'Proxy Authentication Required', +408 =>'Request Timeout', +409 =>'Conflict', +410 =>'Gone', +411 =>'Length Required', +412 =>'Precondition Failed', +413 =>'Request Entity Too Large', +414 =>'Request-URI Too Long', +415 =>'Unsupported Media Type', +416 =>'Requested Range Not Satisfiable', +417 =>'Expectation Failed', +418 =>'I\'m a teapot', 422 =>'Unprocessable Entity', 423 =>'Locked', 424 =>'Failed Dependency', 425 =>'Reserved for WebDAV advanced collections expired proposal', 426 =>'Upgrade Required', 428 =>'Precondition Required', 429 =>'Too Many Requests', 431 =>'Request Header Fields Too Large', 500 =>'Internal Server Error', +501 =>'Not Implemented', +502 =>'Bad Gateway', +503 =>'Service Unavailable', +504 =>'Gateway Timeout', +505 =>'HTTP Version Not Supported', +506 =>'Variant Also Negotiates (Experimental)', 507 =>'Insufficient Storage', 508 =>'Loop Detected', 510 =>'Not Extended', 511 =>'Network Authentication Required', ); +public function __construct($content ='', $status = 200, $headers = array()) +{ +$this->headers = new ResponseHeaderBag($headers); +$this->setContent($content); +$this->setStatusCode($status); +$this->setProtocolVersion('1.0'); +if (!$this->headers->has('Date')) { +$this->setDate(new \DateTime(null, new \DateTimeZone('UTC'))); +} +} +public static function create($content ='', $status = 200, $headers = array()) +{ +return new static($content, $status, $headers); +} +public function __toString() +{ +return +sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". +$this->headers."\r\n". +$this->getContent(); +} +public function __clone() +{ +$this->headers = clone $this->headers; +} +public function prepare(Request $request) +{ +$headers = $this->headers; +if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) { +$this->setContent(null); +$headers->remove('Content-Type'); +$headers->remove('Content-Length'); +} else { +if (!$headers->has('Content-Type')) { +$format = $request->getRequestFormat(); +if (null !== $format && $mimeType = $request->getMimeType($format)) { +$headers->set('Content-Type', $mimeType); +} +} +$charset = $this->charset ?:'UTF-8'; +if (!$headers->has('Content-Type')) { +$headers->set('Content-Type','text/html; charset='.$charset); +} elseif (0 === stripos($headers->get('Content-Type'),'text/') && false === stripos($headers->get('Content-Type'),'charset')) { +$headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); +} +if ($headers->has('Transfer-Encoding')) { +$headers->remove('Content-Length'); +} +if ($request->isMethod('HEAD')) { +$length = $headers->get('Content-Length'); +$this->setContent(null); +if ($length) { +$headers->set('Content-Length', $length); +} +} +} +if ('HTTP/1.0'!= $request->server->get('SERVER_PROTOCOL')) { +$this->setProtocolVersion('1.1'); +} +if ('1.0'== $this->getProtocolVersion() &&'no-cache'== $this->headers->get('Cache-Control')) { +$this->headers->set('pragma','no-cache'); +$this->headers->set('expires', -1); +} +$this->ensureIEOverSSLCompatibility($request); +return $this; +} +public function sendHeaders() +{ +if (headers_sent()) { +return $this; +} +header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode); +foreach ($this->headers->allPreserveCase() as $name => $values) { +foreach ($values as $value) { +header($name.': '.$value, false, $this->statusCode); +} +} +foreach ($this->headers->getCookies() as $cookie) { +setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); +} +return $this; +} +public function sendContent() +{ +echo $this->content; +return $this; +} +public function send() +{ +$this->sendHeaders(); +$this->sendContent(); +if (function_exists('fastcgi_finish_request')) { +fastcgi_finish_request(); +} elseif ('cli'!== PHP_SAPI) { +static::closeOutputBuffers(0, true); +flush(); +} +return $this; +} +public function setContent($content) +{ +if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content,'__toString'))) { +throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content))); +} +$this->content = (string) $content; +return $this; +} +public function getContent() +{ +return $this->content; +} +public function setProtocolVersion($version) +{ +$this->version = $version; +return $this; +} +public function getProtocolVersion() +{ +return $this->version; +} +public function setStatusCode($code, $text = null) +{ +$this->statusCode = $code = (int) $code; +if ($this->isInvalid()) { +throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code)); +} +if (null === $text) { +$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] :''; +return $this; +} +if (false === $text) { +$this->statusText =''; +return $this; +} +$this->statusText = $text; +return $this; +} +public function getStatusCode() +{ +return $this->statusCode; +} +public function setCharset($charset) +{ +$this->charset = $charset; +return $this; +} +public function getCharset() +{ +return $this->charset; +} +public function isCacheable() +{ +if (!in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) { +return false; +} +if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) { +return false; +} +return $this->isValidateable() || $this->isFresh(); +} +public function isFresh() +{ +return $this->getTtl() > 0; +} +public function isValidateable() +{ +return $this->headers->has('Last-Modified') || $this->headers->has('ETag'); +} +public function setPrivate() +{ +$this->headers->removeCacheControlDirective('public'); +$this->headers->addCacheControlDirective('private'); +return $this; +} +public function setPublic() +{ +$this->headers->addCacheControlDirective('public'); +$this->headers->removeCacheControlDirective('private'); +return $this; +} +public function mustRevalidate() +{ +return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('proxy-revalidate'); +} +public function getDate() +{ +return $this->headers->getDate('Date', new \DateTime()); +} +public function setDate(\DateTime $date) +{ +$date->setTimezone(new \DateTimeZone('UTC')); +$this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT'); +return $this; +} +public function getAge() +{ +if (null !== $age = $this->headers->get('Age')) { +return (int) $age; +} +return max(time() - $this->getDate()->format('U'), 0); +} +public function expire() +{ +if ($this->isFresh()) { +$this->headers->set('Age', $this->getMaxAge()); +} +return $this; +} +public function getExpires() +{ +try { +return $this->headers->getDate('Expires'); +} catch (\RuntimeException $e) { +return \DateTime::createFromFormat(DATE_RFC2822,'Sat, 01 Jan 00 00:00:00 +0000'); +} +} +public function setExpires(\DateTime $date = null) +{ +if (null === $date) { +$this->headers->remove('Expires'); +} else { +$date = clone $date; +$date->setTimezone(new \DateTimeZone('UTC')); +$this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT'); +} +return $this; +} +public function getMaxAge() +{ +if ($this->headers->hasCacheControlDirective('s-maxage')) { +return (int) $this->headers->getCacheControlDirective('s-maxage'); +} +if ($this->headers->hasCacheControlDirective('max-age')) { +return (int) $this->headers->getCacheControlDirective('max-age'); +} +if (null !== $this->getExpires()) { +return $this->getExpires()->format('U') - $this->getDate()->format('U'); +} +} +public function setMaxAge($value) +{ +$this->headers->addCacheControlDirective('max-age', $value); +return $this; +} +public function setSharedMaxAge($value) +{ +$this->setPublic(); +$this->headers->addCacheControlDirective('s-maxage', $value); +return $this; +} +public function getTtl() +{ +if (null !== $maxAge = $this->getMaxAge()) { +return $maxAge - $this->getAge(); +} +} +public function setTtl($seconds) +{ +$this->setSharedMaxAge($this->getAge() + $seconds); +return $this; +} +public function setClientTtl($seconds) +{ +$this->setMaxAge($this->getAge() + $seconds); +return $this; +} +public function getLastModified() +{ +return $this->headers->getDate('Last-Modified'); +} +public function setLastModified(\DateTime $date = null) +{ +if (null === $date) { +$this->headers->remove('Last-Modified'); +} else { +$date = clone $date; +$date->setTimezone(new \DateTimeZone('UTC')); +$this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT'); +} +return $this; +} +public function getEtag() +{ +return $this->headers->get('ETag'); +} +public function setEtag($etag = null, $weak = false) +{ +if (null === $etag) { +$this->headers->remove('Etag'); +} else { +if (0 !== strpos($etag,'"')) { +$etag ='"'.$etag.'"'; +} +$this->headers->set('ETag', (true === $weak ?'W/':'').$etag); +} +return $this; +} +public function setCache(array $options) +{ +if ($diff = array_diff(array_keys($options), array('etag','last_modified','max_age','s_maxage','private','public'))) { +throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff)))); +} +if (isset($options['etag'])) { +$this->setEtag($options['etag']); +} +if (isset($options['last_modified'])) { +$this->setLastModified($options['last_modified']); +} +if (isset($options['max_age'])) { +$this->setMaxAge($options['max_age']); +} +if (isset($options['s_maxage'])) { +$this->setSharedMaxAge($options['s_maxage']); +} +if (isset($options['public'])) { +if ($options['public']) { +$this->setPublic(); +} else { +$this->setPrivate(); +} +} +if (isset($options['private'])) { +if ($options['private']) { +$this->setPrivate(); +} else { +$this->setPublic(); +} +} +return $this; +} +public function setNotModified() +{ +$this->setStatusCode(304); +$this->setContent(null); +foreach (array('Allow','Content-Encoding','Content-Language','Content-Length','Content-MD5','Content-Type','Last-Modified') as $header) { +$this->headers->remove($header); +} +return $this; +} +public function hasVary() +{ +return null !== $this->headers->get('Vary'); +} +public function getVary() +{ +if (!$vary = $this->headers->get('Vary', null, false)) { +return array(); +} +$ret = array(); +foreach ($vary as $item) { +$ret = array_merge($ret, preg_split('/[\s,]+/', $item)); +} +return $ret; +} +public function setVary($headers, $replace = true) +{ +$this->headers->set('Vary', $headers, $replace); +return $this; +} +public function isNotModified(Request $request) +{ +if (!$request->isMethodSafe()) { +return false; +} +$notModified = false; +$lastModified = $this->headers->get('Last-Modified'); +$modifiedSince = $request->headers->get('If-Modified-Since'); +if ($etags = $request->getEtags()) { +$notModified = in_array($this->getEtag(), $etags) || in_array('*', $etags); +} +if ($modifiedSince && $lastModified) { +$notModified = strtotime($modifiedSince) >= strtotime($lastModified) && (!$etags || $notModified); +} +if ($notModified) { +$this->setNotModified(); +} +return $notModified; +} +public function isInvalid() +{ +return $this->statusCode < 100 || $this->statusCode >= 600; +} +public function isInformational() +{ +return $this->statusCode >= 100 && $this->statusCode < 200; +} +public function isSuccessful() +{ +return $this->statusCode >= 200 && $this->statusCode < 300; +} +public function isRedirection() +{ +return $this->statusCode >= 300 && $this->statusCode < 400; +} +public function isClientError() +{ +return $this->statusCode >= 400 && $this->statusCode < 500; +} +public function isServerError() +{ +return $this->statusCode >= 500 && $this->statusCode < 600; +} +public function isOk() +{ +return 200 === $this->statusCode; +} +public function isForbidden() +{ +return 403 === $this->statusCode; +} +public function isNotFound() +{ +return 404 === $this->statusCode; +} +public function isRedirect($location = null) +{ +return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location')); +} +public function isEmpty() +{ +return in_array($this->statusCode, array(204, 304)); +} +public static function closeOutputBuffers($targetLevel, $flush) +{ +$status = ob_get_status(true); +$level = count($status); +while ($level-- > $targetLevel +&& (!empty($status[$level]['del']) +|| (isset($status[$level]['flags']) +&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE) +&& ($status[$level]['flags'] & ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE)) +) +) +) { +if ($flush) { +ob_end_flush(); +} else { +ob_end_clean(); +} +} +} +protected function ensureIEOverSSLCompatibility(Request $request) +{ +if (false !== stripos($this->headers->get('Content-Disposition'),'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) { +if (intval(preg_replace("/(MSIE )(.*?);/","$2", $match[0])) < 9) { +$this->headers->remove('Cache-Control'); +} +} +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class ResponseHeaderBag extends HeaderBag +{ +const COOKIES_FLAT ='flat'; +const COOKIES_ARRAY ='array'; +const DISPOSITION_ATTACHMENT ='attachment'; +const DISPOSITION_INLINE ='inline'; +protected $computedCacheControl = array(); +protected $cookies = array(); +protected $headerNames = array(); +public function __construct(array $headers = array()) +{ +parent::__construct($headers); +if (!isset($this->headers['cache-control'])) { +$this->set('Cache-Control',''); +} +} +public function __toString() +{ +$cookies =''; +foreach ($this->getCookies() as $cookie) { +$cookies .='Set-Cookie: '.$cookie."\r\n"; +} +ksort($this->headerNames); +return parent::__toString().$cookies; +} +public function allPreserveCase() +{ +return array_combine($this->headerNames, $this->headers); +} +public function replace(array $headers = array()) +{ +$this->headerNames = array(); +parent::replace($headers); +if (!isset($this->headers['cache-control'])) { +$this->set('Cache-Control',''); +} +} +public function set($key, $values, $replace = true) +{ +parent::set($key, $values, $replace); +$uniqueKey = strtr(strtolower($key),'_','-'); +$this->headerNames[$uniqueKey] = $key; +if (in_array($uniqueKey, array('cache-control','etag','last-modified','expires'))) { +$computed = $this->computeCacheControlValue(); +$this->headers['cache-control'] = array($computed); +$this->headerNames['cache-control'] ='Cache-Control'; +$this->computedCacheControl = $this->parseCacheControl($computed); +} +} +public function remove($key) +{ +parent::remove($key); +$uniqueKey = strtr(strtolower($key),'_','-'); +unset($this->headerNames[$uniqueKey]); +if ('cache-control'=== $uniqueKey) { +$this->computedCacheControl = array(); +} +} +public function hasCacheControlDirective($key) +{ +return array_key_exists($key, $this->computedCacheControl); +} +public function getCacheControlDirective($key) +{ +return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null; +} +public function setCookie(Cookie $cookie) +{ +$this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; +} +public function removeCookie($name, $path ='/', $domain = null) +{ +if (null === $path) { +$path ='/'; +} +unset($this->cookies[$domain][$path][$name]); +if (empty($this->cookies[$domain][$path])) { +unset($this->cookies[$domain][$path]); +if (empty($this->cookies[$domain])) { +unset($this->cookies[$domain]); +} +} +} +public function getCookies($format = self::COOKIES_FLAT) +{ +if (!in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) { +throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY)))); +} +if (self::COOKIES_ARRAY === $format) { +return $this->cookies; +} +$flattenedCookies = array(); +foreach ($this->cookies as $path) { +foreach ($path as $cookies) { +foreach ($cookies as $cookie) { +$flattenedCookies[] = $cookie; +} +} +} +return $flattenedCookies; +} +public function clearCookie($name, $path ='/', $domain = null) +{ +$this->setCookie(new Cookie($name, null, 1, $path, $domain)); +} +public function makeDisposition($disposition, $filename, $filenameFallback ='') +{ +if (!in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) { +throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE)); +} +if (''== $filenameFallback) { +$filenameFallback = $filename; +} +if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) { +throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.'); +} +if (false !== strpos($filenameFallback,'%')) { +throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.'); +} +if (false !== strpos($filename,'/') || false !== strpos($filename,'\\') || false !== strpos($filenameFallback,'/') || false !== strpos($filenameFallback,'\\')) { +throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.'); +} +$output = sprintf('%s; filename="%s"', $disposition, str_replace('"','\\"', $filenameFallback)); +if ($filename !== $filenameFallback) { +$output .= sprintf("; filename*=utf-8''%s", rawurlencode($filename)); +} +return $output; +} +protected function computeCacheControlValue() +{ +if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) { +return'no-cache'; +} +if (!$this->cacheControl) { +return'private, must-revalidate'; +} +$header = $this->getCacheControlHeader(); +if (isset($this->cacheControl['public']) || isset($this->cacheControl['private'])) { +return $header; +} +if (!isset($this->cacheControl['s-maxage'])) { +return $header.', private'; +} +return $header; +} +} +} +namespace Symfony\Component\DependencyInjection +{ +interface ContainerAwareInterface +{ +public function setContainer(ContainerInterface $container = null); +} +} +namespace Symfony\Component\DependencyInjection +{ +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; +interface ContainerInterface +{ +const EXCEPTION_ON_INVALID_REFERENCE = 1; +const NULL_ON_INVALID_REFERENCE = 2; +const IGNORE_ON_INVALID_REFERENCE = 3; +const SCOPE_CONTAINER ='container'; +const SCOPE_PROTOTYPE ='prototype'; +public function set($id, $service, $scope = self::SCOPE_CONTAINER); +public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); +public function has($id); +public function getParameter($name); +public function hasParameter($name); +public function setParameter($name, $value); +public function enterScope($name); +public function leaveScope($name); +public function addScope(ScopeInterface $scope); +public function hasScope($name); +public function isScopeActive($name); +} +} +namespace Symfony\Component\DependencyInjection +{ +interface IntrospectableContainerInterface extends ContainerInterface +{ +public function initialized($id); +} +} +namespace Symfony\Component\DependencyInjection +{ +use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +class Container implements IntrospectableContainerInterface +{ +protected $parameterBag; +protected $services = array(); +protected $methodMap = array(); +protected $aliases = array(); +protected $scopes = array(); +protected $scopeChildren = array(); +protected $scopedServices = array(); +protected $scopeStacks = array(); +protected $loading = array(); +public function __construct(ParameterBagInterface $parameterBag = null) +{ +$this->parameterBag = $parameterBag ?: new ParameterBag(); +$this->set('service_container', $this); +} +public function compile() +{ +$this->parameterBag->resolve(); +$this->parameterBag = new FrozenParameterBag($this->parameterBag->all()); +} +public function isFrozen() +{ +return $this->parameterBag instanceof FrozenParameterBag; +} +public function getParameterBag() +{ +return $this->parameterBag; +} +public function getParameter($name) +{ +return $this->parameterBag->get($name); +} +public function hasParameter($name) +{ +return $this->parameterBag->has($name); +} +public function setParameter($name, $value) +{ +$this->parameterBag->set($name, $value); +} +public function set($id, $service, $scope = self::SCOPE_CONTAINER) +{ +if (self::SCOPE_PROTOTYPE === $scope) { +throw new InvalidArgumentException(sprintf('You cannot set service "%s" of scope "prototype".', $id)); +} +$id = strtolower($id); +if ('service_container'=== $id) { +return; +} +if (self::SCOPE_CONTAINER !== $scope) { +if (!isset($this->scopedServices[$scope])) { +throw new RuntimeException(sprintf('You cannot set service "%s" of inactive scope.', $id)); +} +$this->scopedServices[$scope][$id] = $service; +} +$this->services[$id] = $service; +if (method_exists($this, $method ='synchronize'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) { +$this->$method(); +} +if (self::SCOPE_CONTAINER !== $scope && null === $service) { +unset($this->scopedServices[$scope][$id]); +} +if (null === $service) { +unset($this->services[$id]); +} +} +public function has($id) +{ +$id = strtolower($id); +if ('service_container'=== $id) { +return true; +} +return isset($this->services[$id]) +|| array_key_exists($id, $this->services) +|| isset($this->aliases[$id]) +|| method_exists($this,'get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service') +; +} +public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) +{ +foreach (array(false, true) as $strtolower) { +if ($strtolower) { +$id = strtolower($id); +} +if ('service_container'=== $id) { +return $this; +} +if (isset($this->aliases[$id])) { +$id = $this->aliases[$id]; +} +if (isset($this->services[$id]) || array_key_exists($id, $this->services)) { +return $this->services[$id]; +} +} +if (isset($this->loading[$id])) { +throw new ServiceCircularReferenceException($id, array_keys($this->loading)); +} +if (isset($this->methodMap[$id])) { +$method = $this->methodMap[$id]; +} elseif (method_exists($this, $method ='get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) { +} else { +if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) { +if (!$id) { +throw new ServiceNotFoundException($id); +} +$alternatives = array(); +foreach (array_keys($this->services) as $key) { +$lev = levenshtein($id, $key); +if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) { +$alternatives[] = $key; +} +} +throw new ServiceNotFoundException($id, null, null, $alternatives); +} +return; +} +$this->loading[$id] = true; +try { +$service = $this->$method(); +} catch (\Exception $e) { +unset($this->loading[$id]); +if (array_key_exists($id, $this->services)) { +unset($this->services[$id]); +} +if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { +return; +} +throw $e; +} +unset($this->loading[$id]); +return $service; +} +public function initialized($id) +{ +$id = strtolower($id); +if ('service_container'=== $id) { +return true; +} +return isset($this->services[$id]) || array_key_exists($id, $this->services); +} +public function getServiceIds() +{ +$ids = array(); +$r = new \ReflectionClass($this); +foreach ($r->getMethods() as $method) { +if (preg_match('/^get(.+)Service$/', $method->name, $match)) { +$ids[] = self::underscore($match[1]); +} +} +$ids[] ='service_container'; +return array_unique(array_merge($ids, array_keys($this->services))); +} +public function enterScope($name) +{ +if (!isset($this->scopes[$name])) { +throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name)); +} +if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) { +throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name])); +} +if (isset($this->scopedServices[$name])) { +$services = array($this->services, $name => $this->scopedServices[$name]); +unset($this->scopedServices[$name]); +foreach ($this->scopeChildren[$name] as $child) { +if (isset($this->scopedServices[$child])) { +$services[$child] = $this->scopedServices[$child]; +unset($this->scopedServices[$child]); +} +} +$this->services = call_user_func_array('array_diff_key', $services); +array_shift($services); +if (!isset($this->scopeStacks[$name])) { +$this->scopeStacks[$name] = new \SplStack(); +} +$this->scopeStacks[$name]->push($services); +} +$this->scopedServices[$name] = array(); +} +public function leaveScope($name) +{ +if (!isset($this->scopedServices[$name])) { +throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name)); +} +$services = array($this->services, $this->scopedServices[$name]); +unset($this->scopedServices[$name]); +foreach ($this->scopeChildren[$name] as $child) { +if (!isset($this->scopedServices[$child])) { +continue; +} +$services[] = $this->scopedServices[$child]; +unset($this->scopedServices[$child]); +} +$this->services = call_user_func_array('array_diff_key', $services); +if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) { +$services = $this->scopeStacks[$name]->pop(); +$this->scopedServices += $services; +foreach ($services as $array) { +foreach ($array as $id => $service) { +$this->set($id, $service, $name); +} +} +} +} +public function addScope(ScopeInterface $scope) +{ +$name = $scope->getName(); +$parentScope = $scope->getParentName(); +if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) { +throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name)); +} +if (isset($this->scopes[$name])) { +throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name)); +} +if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) { +throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope)); +} +$this->scopes[$name] = $parentScope; +$this->scopeChildren[$name] = array(); +while ($parentScope !== self::SCOPE_CONTAINER) { +$this->scopeChildren[$parentScope][] = $name; +$parentScope = $this->scopes[$parentScope]; +} +} +public function hasScope($name) +{ +return isset($this->scopes[$name]); +} +public function isScopeActive($name) +{ +return isset($this->scopedServices[$name]); +} +public static function camelize($id) +{ +return strtr(ucwords(strtr($id, array('_'=>' ','.'=>'_ ','\\'=>'_ '))), array(' '=>'')); +} +public static function underscore($id) +{ +return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/','/([a-z\d])([A-Z])/'), array('\\1_\\2','\\1_\\2'), strtr($id,'_','.'))); +} +} +} +namespace Symfony\Component\HttpKernel +{ +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +interface HttpKernelInterface +{ +const MASTER_REQUEST = 1; +const SUB_REQUEST = 2; +public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true); +} +} +namespace Symfony\Component\HttpKernel +{ +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; +use Symfony\Component\Config\Loader\LoaderInterface; +interface KernelInterface extends HttpKernelInterface, \Serializable +{ +public function registerBundles(); +public function registerContainerConfiguration(LoaderInterface $loader); +public function boot(); +public function shutdown(); +public function getBundles(); +public function isClassInActiveBundle($class); +public function getBundle($name, $first = true); +public function locateResource($name, $dir = null, $first = true); +public function getName(); +public function getEnvironment(); +public function isDebug(); +public function getRootDir(); +public function getContainer(); +public function getStartTime(); +public function getCacheDir(); +public function getLogDir(); +public function getCharset(); +} +} +namespace Symfony\Component\HttpKernel +{ +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +interface TerminableInterface +{ +public function terminate(Request $request, Response $response); +} +} +namespace Symfony\Component\HttpKernel +{ +use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator; +use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\PhpDumper; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\DependencyInjection\Loader\IniFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use Symfony\Component\DependencyInjection\Loader\ClosureLoader; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; +use Symfony\Component\HttpKernel\Config\FileLocator; +use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass; +use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass; +use Symfony\Component\Config\Loader\LoaderResolver; +use Symfony\Component\Config\Loader\DelegatingLoader; +use Symfony\Component\Config\ConfigCache; +use Symfony\Component\ClassLoader\ClassCollectionLoader; +abstract class Kernel implements KernelInterface, TerminableInterface +{ +protected $bundles = array(); +protected $bundleMap; +protected $container; +protected $rootDir; +protected $environment; +protected $debug; +protected $booted = false; +protected $name; +protected $startTime; +protected $loadClassCache; +const VERSION ='2.5.6'; +const VERSION_ID ='20506'; +const MAJOR_VERSION ='2'; +const MINOR_VERSION ='5'; +const RELEASE_VERSION ='6'; +const EXTRA_VERSION =''; +public function __construct($environment, $debug) +{ +$this->environment = $environment; +$this->debug = (bool) $debug; +$this->rootDir = $this->getRootDir(); +$this->name = $this->getName(); +if ($this->debug) { +$this->startTime = microtime(true); +} +$this->init(); +} +public function init() +{ +} +public function __clone() +{ +if ($this->debug) { +$this->startTime = microtime(true); +} +$this->booted = false; +$this->container = null; +} +public function boot() +{ +if (true === $this->booted) { +return; +} +if ($this->loadClassCache) { +$this->doLoadClassCache($this->loadClassCache[0], $this->loadClassCache[1]); +} +$this->initializeBundles(); +$this->initializeContainer(); +foreach ($this->getBundles() as $bundle) { +$bundle->setContainer($this->container); +$bundle->boot(); +} +$this->booted = true; +} +public function terminate(Request $request, Response $response) +{ +if (false === $this->booted) { +return; +} +if ($this->getHttpKernel() instanceof TerminableInterface) { +$this->getHttpKernel()->terminate($request, $response); +} +} +public function shutdown() +{ +if (false === $this->booted) { +return; +} +$this->booted = false; +foreach ($this->getBundles() as $bundle) { +$bundle->shutdown(); +$bundle->setContainer(null); +} +$this->container = null; +} +public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) +{ +if (false === $this->booted) { +$this->boot(); +} +return $this->getHttpKernel()->handle($request, $type, $catch); +} +protected function getHttpKernel() +{ +return $this->container->get('http_kernel'); +} +public function getBundles() +{ +return $this->bundles; +} +public function isClassInActiveBundle($class) +{ +foreach ($this->getBundles() as $bundle) { +if (0 === strpos($class, $bundle->getNamespace())) { +return true; +} +} +return false; +} +public function getBundle($name, $first = true) +{ +if (!isset($this->bundleMap[$name])) { +throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, get_class($this))); +} +if (true === $first) { +return $this->bundleMap[$name][0]; +} +return $this->bundleMap[$name]; +} +public function locateResource($name, $dir = null, $first = true) +{ +if ('@'!== $name[0]) { +throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name)); +} +if (false !== strpos($name,'..')) { +throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name)); +} +$bundleName = substr($name, 1); +$path =''; +if (false !== strpos($bundleName,'/')) { +list($bundleName, $path) = explode('/', $bundleName, 2); +} +$isResource = 0 === strpos($path,'Resources') && null !== $dir; +$overridePath = substr($path, 9); +$resourceBundle = null; +$bundles = $this->getBundle($bundleName, false); +$files = array(); +foreach ($bundles as $bundle) { +if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) { +if (null !== $resourceBundle) { +throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.', +$file, +$resourceBundle, +$dir.'/'.$bundles[0]->getName().$overridePath +)); +} +if ($first) { +return $file; +} +$files[] = $file; +} +if (file_exists($file = $bundle->getPath().'/'.$path)) { +if ($first && !$isResource) { +return $file; +} +$files[] = $file; +$resourceBundle = $bundle->getName(); +} +} +if (count($files) > 0) { +return $first && $isResource ? $files[0] : $files; +} +throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name)); +} +public function getName() +{ +if (null === $this->name) { +$this->name = preg_replace('/[^a-zA-Z0-9_]+/','', basename($this->rootDir)); +} +return $this->name; +} +public function getEnvironment() +{ +return $this->environment; +} +public function isDebug() +{ +return $this->debug; +} +public function getRootDir() +{ +if (null === $this->rootDir) { +$r = new \ReflectionObject($this); +$this->rootDir = str_replace('\\','/', dirname($r->getFileName())); +} +return $this->rootDir; +} +public function getContainer() +{ +return $this->container; +} +public function loadClassCache($name ='classes', $extension ='.php') +{ +$this->loadClassCache = array($name, $extension); +} +public function setClassCache(array $classes) +{ +file_put_contents($this->getCacheDir().'/classes.map', sprintf('debug ? $this->startTime : -INF; +} +public function getCacheDir() +{ +return $this->rootDir.'/cache/'.$this->environment; +} +public function getLogDir() +{ +return $this->rootDir.'/logs'; +} +public function getCharset() +{ +return'UTF-8'; +} +protected function doLoadClassCache($name, $extension) +{ +if (!$this->booted && is_file($this->getCacheDir().'/classes.map')) { +ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension); +} +} +protected function initializeBundles() +{ +$this->bundles = array(); +$topMostBundles = array(); +$directChildren = array(); +foreach ($this->registerBundles() as $bundle) { +$name = $bundle->getName(); +if (isset($this->bundles[$name])) { +throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name)); +} +$this->bundles[$name] = $bundle; +if ($parentName = $bundle->getParent()) { +if (isset($directChildren[$parentName])) { +throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName])); +} +if ($parentName == $name) { +throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name)); +} +$directChildren[$parentName] = $name; +} else { +$topMostBundles[$name] = $bundle; +} +} +if (!empty($directChildren) && count($diff = array_diff_key($directChildren, $this->bundles))) { +$diff = array_keys($diff); +throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0])); +} +$this->bundleMap = array(); +foreach ($topMostBundles as $name => $bundle) { +$bundleMap = array($bundle); +$hierarchy = array($name); +while (isset($directChildren[$name])) { +$name = $directChildren[$name]; +array_unshift($bundleMap, $this->bundles[$name]); +$hierarchy[] = $name; +} +foreach ($hierarchy as $bundle) { +$this->bundleMap[$bundle] = $bundleMap; +array_pop($bundleMap); +} +} +} +protected function getContainerClass() +{ +return $this->name.ucfirst($this->environment).($this->debug ?'Debug':'').'ProjectContainer'; +} +protected function getContainerBaseClass() +{ +return'Container'; +} +protected function initializeContainer() +{ +$class = $this->getContainerClass(); +$cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug); +$fresh = true; +if (!$cache->isFresh()) { +$container = $this->buildContainer(); +$container->compile(); +$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass()); +$fresh = false; +} +require_once $cache; +$this->container = new $class(); +$this->container->set('kernel', $this); +if (!$fresh && $this->container->has('cache_warmer')) { +$this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir')); +} +} +protected function getKernelParameters() +{ +$bundles = array(); +foreach ($this->bundles as $name => $bundle) { +$bundles[$name] = get_class($bundle); +} +return array_merge( +array('kernel.root_dir'=> $this->rootDir,'kernel.environment'=> $this->environment,'kernel.debug'=> $this->debug,'kernel.name'=> $this->name,'kernel.cache_dir'=> $this->getCacheDir(),'kernel.logs_dir'=> $this->getLogDir(),'kernel.bundles'=> $bundles,'kernel.charset'=> $this->getCharset(),'kernel.container_class'=> $this->getContainerClass(), +), +$this->getEnvParameters() +); +} +protected function getEnvParameters() +{ +$parameters = array(); +foreach ($_SERVER as $key => $value) { +if (0 === strpos($key,'SYMFONY__')) { +$parameters[strtolower(str_replace('__','.', substr($key, 9)))] = $value; +} +} +return $parameters; +} +protected function buildContainer() +{ +foreach (array('cache'=> $this->getCacheDir(),'logs'=> $this->getLogDir()) as $name => $dir) { +if (!is_dir($dir)) { +if (false === @mkdir($dir, 0777, true)) { +throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir)); +} +} elseif (!is_writable($dir)) { +throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir)); +} +} +$container = $this->getContainerBuilder(); +$container->addObjectResource($this); +$this->prepareContainer($container); +if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) { +$container->merge($cont); +} +$container->addCompilerPass(new AddClassesToCachePass($this)); +return $container; +} +protected function prepareContainer(ContainerBuilder $container) +{ +$extensions = array(); +foreach ($this->bundles as $bundle) { +if ($extension = $bundle->getContainerExtension()) { +$container->registerExtension($extension); +$extensions[] = $extension->getAlias(); +} +if ($this->debug) { +$container->addObjectResource($bundle); +} +} +foreach ($this->bundles as $bundle) { +$bundle->build($container); +} +$container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions)); +} +protected function getContainerBuilder() +{ +$container = new ContainerBuilder(new ParameterBag($this->getKernelParameters())); +if (class_exists('ProxyManager\Configuration')) { +$container->setProxyInstantiator(new RuntimeInstantiator()); +} +return $container; +} +protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass) +{ +$dumper = new PhpDumper($container); +if (class_exists('ProxyManager\Configuration')) { +$dumper->setProxyDumper(new ProxyDumper()); +} +$content = $dumper->dump(array('class'=> $class,'base_class'=> $baseClass)); +if (!$this->debug) { +$content = static::stripComments($content); +} +$cache->write($content, $container->getResources()); +} +protected function getContainerLoader(ContainerInterface $container) +{ +$locator = new FileLocator($this); +$resolver = new LoaderResolver(array( +new XmlFileLoader($container, $locator), +new YamlFileLoader($container, $locator), +new IniFileLoader($container, $locator), +new PhpFileLoader($container, $locator), +new ClosureLoader($container), +)); +return new DelegatingLoader($resolver); +} +public static function stripComments($source) +{ +if (!function_exists('token_get_all')) { +return $source; +} +$rawChunk =''; +$output =''; +$tokens = token_get_all($source); +$ignoreSpace = false; +for (reset($tokens); false !== $token = current($tokens); next($tokens)) { +if (is_string($token)) { +$rawChunk .= $token; +} elseif (T_START_HEREDOC === $token[0]) { +$output .= $rawChunk.$token[1]; +do { +$token = next($tokens); +$output .= $token[1]; +} while ($token[0] !== T_END_HEREDOC); +$rawChunk =''; +} elseif (T_WHITESPACE === $token[0]) { +if ($ignoreSpace) { +$ignoreSpace = false; +continue; +} +$rawChunk .= preg_replace(array('/\n{2,}/S'),"\n", $token[1]); +} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) { +$ignoreSpace = true; +} else { +$rawChunk .= $token[1]; +if (T_OPEN_TAG === $token[0]) { +$ignoreSpace = true; +} +} +} +$output .= $rawChunk; +return $output; +} +public function serialize() +{ +return serialize(array($this->environment, $this->debug)); +} +public function unserialize($data) +{ +list($environment, $debug) = unserialize($data); +$this->__construct($environment, $debug); +} +} +} +namespace Symfony\Component\ClassLoader +{ +class ApcClassLoader +{ +private $prefix; +protected $decorated; +public function __construct($prefix, $decorated) +{ +if (!extension_loaded('apc')) { +throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.'); +} +if (!method_exists($decorated,'findFile')) { +throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); +} +$this->prefix = $prefix; +$this->decorated = $decorated; +} +public function register($prepend = false) +{ +spl_autoload_register(array($this,'loadClass'), true, $prepend); +} +public function unregister() +{ +spl_autoload_unregister(array($this,'loadClass')); +} +public function loadClass($class) +{ +if ($file = $this->findFile($class)) { +require $file; +return true; +} +} +public function findFile($class) +{ +if (false === $file = apc_fetch($this->prefix.$class)) { +apc_store($this->prefix.$class, $file = $this->decorated->findFile($class)); +} +return $file; +} +public function __call($method, $args) +{ +return call_user_func_array(array($this->decorated, $method), $args); +} +} +} +namespace Symfony\Component\HttpKernel\Bundle +{ +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; +interface BundleInterface extends ContainerAwareInterface +{ +public function boot(); +public function shutdown(); +public function build(ContainerBuilder $container); +public function getContainerExtension(); +public function getParent(); +public function getName(); +public function getNamespace(); +public function getPath(); +} +} +namespace Symfony\Component\DependencyInjection +{ +abstract class ContainerAware implements ContainerAwareInterface +{ +protected $container; +public function setContainer(ContainerInterface $container = null) +{ +$this->container = $container; +} +} +} +namespace Symfony\Component\HttpKernel\Bundle +{ +use Symfony\Component\DependencyInjection\ContainerAware; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\Console\Application; +use Symfony\Component\Finder\Finder; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; +abstract class Bundle extends ContainerAware implements BundleInterface +{ +protected $name; +protected $extension; +protected $path; +public function boot() +{ +} +public function shutdown() +{ +} +public function build(ContainerBuilder $container) +{ +} +public function getContainerExtension() +{ +if (null === $this->extension) { +$basename = preg_replace('/Bundle$/','', $this->getName()); +$class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension'; +if (class_exists($class)) { +$extension = new $class(); +$expectedAlias = Container::underscore($basename); +if ($expectedAlias != $extension->getAlias()) { +throw new \LogicException(sprintf('The extension alias for the default extension of a '.'bundle must be the underscored version of the '.'bundle name ("%s" instead of "%s")', +$expectedAlias, $extension->getAlias() +)); +} +$this->extension = $extension; +} else { +$this->extension = false; +} +} +if ($this->extension) { +return $this->extension; +} +} +public function getNamespace() +{ +$class = get_class($this); +return substr($class, 0, strrpos($class,'\\')); +} +public function getPath() +{ +if (null === $this->path) { +$reflected = new \ReflectionObject($this); +$this->path = dirname($reflected->getFileName()); +} +return $this->path; +} +public function getParent() +{ +} +final public function getName() +{ +if (null !== $this->name) { +return $this->name; +} +$name = get_class($this); +$pos = strrpos($name,'\\'); +return $this->name = false === $pos ? $name : substr($name, $pos + 1); +} +public function registerCommands(Application $application) +{ +if (!is_dir($dir = $this->getPath().'/Command')) { +return; +} +$finder = new Finder(); +$finder->files()->name('*Command.php')->in($dir); +$prefix = $this->getNamespace().'\\Command'; +foreach ($finder as $file) { +$ns = $prefix; +if ($relativePath = $file->getRelativePath()) { +$ns .='\\'.strtr($relativePath,'/','\\'); +} +$class = $ns.'\\'.$file->getBasename('.php'); +if ($this->container) { +$alias ='console.command.'.strtolower(str_replace('\\','_', $class)); +if ($this->container->has($alias)) { +continue; +} +} +$r = new \ReflectionClass($class); +if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) { +$application->add($r->newInstance()); +} +} +} +} +} +namespace Symfony\Component\Config +{ +use Symfony\Component\Config\Resource\ResourceInterface; +use Symfony\Component\Filesystem\Exception\IOException; +use Symfony\Component\Filesystem\Filesystem; +class ConfigCache +{ +private $debug; +private $file; +public function __construct($file, $debug) +{ +$this->file = $file; +$this->debug = (bool) $debug; +} +public function __toString() +{ +return $this->file; +} +public function isFresh() +{ +if (!is_file($this->file)) { +return false; +} +if (!$this->debug) { +return true; +} +$metadata = $this->getMetaFile(); +if (!is_file($metadata)) { +return false; +} +$time = filemtime($this->file); +$meta = unserialize(file_get_contents($metadata)); +foreach ($meta as $resource) { +if (!$resource->isFresh($time)) { +return false; +} +} +return true; +} +public function write($content, array $metadata = null) +{ +$mode = 0666; +$umask = umask(); +$filesystem = new Filesystem(); +$filesystem->dumpFile($this->file, $content, null); +try { +$filesystem->chmod($this->file, $mode, $umask); +} catch (IOException $e) { +} +if (null !== $metadata && true === $this->debug) { +$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null); +try { +$filesystem->chmod($this->getMetaFile(), $mode, $umask); +} catch (IOException $e) { +} +} +} +private function getMetaFile() +{ +return $this->file.'.meta'; +} +} +} +namespace Symfony\Component\HttpKernel +{ +use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; +use Symfony\Component\HttpKernel\Event\FilterControllerEvent; +use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\Event\FinishRequestEvent; +use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; +use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Event\PostResponseEvent; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +class HttpKernel implements HttpKernelInterface, TerminableInterface +{ +protected $dispatcher; +protected $resolver; +protected $requestStack; +public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null) +{ +$this->dispatcher = $dispatcher; +$this->resolver = $resolver; +$this->requestStack = $requestStack ?: new RequestStack(); +} +public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) +{ +try { +return $this->handleRaw($request, $type); +} catch (\Exception $e) { +if (false === $catch) { +$this->finishRequest($request, $type); +throw $e; +} +return $this->handleException($e, $request, $type); +} +} +public function terminate(Request $request, Response $response) +{ +$this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this, $request, $response)); +} +public function terminateWithException(\Exception $exception) +{ +if (!$request = $this->requestStack->getMasterRequest()) { +throw new \LogicException('Request stack is empty', 0, $exception); +} +$response = $this->handleException($exception, $request, self::MASTER_REQUEST); +$response->sendHeaders(); +$response->sendContent(); +$this->terminate($request, $response); +} +private function handleRaw(Request $request, $type = self::MASTER_REQUEST) +{ +$this->requestStack->push($request); +$event = new GetResponseEvent($this, $request, $type); +$this->dispatcher->dispatch(KernelEvents::REQUEST, $event); +if ($event->hasResponse()) { +return $this->filterResponse($event->getResponse(), $request, $type); +} +if (false === $controller = $this->resolver->getController($request)) { +throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". Maybe you forgot to add the matching route in your routing configuration?', $request->getPathInfo())); +} +$event = new FilterControllerEvent($this, $controller, $request, $type); +$this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event); +$controller = $event->getController(); +$arguments = $this->resolver->getArguments($request, $controller); +$response = call_user_func_array($controller, $arguments); +if (!$response instanceof Response) { +$event = new GetResponseForControllerResultEvent($this, $request, $type, $response); +$this->dispatcher->dispatch(KernelEvents::VIEW, $event); +if ($event->hasResponse()) { +$response = $event->getResponse(); +} +if (!$response instanceof Response) { +$msg = sprintf('The controller must return a response (%s given).', $this->varToString($response)); +if (null === $response) { +$msg .=' Did you forget to add a return statement somewhere in your controller?'; +} +throw new \LogicException($msg); +} +} +return $this->filterResponse($response, $request, $type); +} +private function filterResponse(Response $response, Request $request, $type) +{ +$event = new FilterResponseEvent($this, $request, $type, $response); +$this->dispatcher->dispatch(KernelEvents::RESPONSE, $event); +$this->finishRequest($request, $type); +return $event->getResponse(); +} +private function finishRequest(Request $request, $type) +{ +$this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type)); +$this->requestStack->pop(); +} +private function handleException(\Exception $e, $request, $type) +{ +$event = new GetResponseForExceptionEvent($this, $request, $type, $e); +$this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event); +$e = $event->getException(); +if (!$event->hasResponse()) { +$this->finishRequest($request, $type); +throw $e; +} +$response = $event->getResponse(); +if ($response->headers->has('X-Status-Code')) { +$response->setStatusCode($response->headers->get('X-Status-Code')); +$response->headers->remove('X-Status-Code'); +} elseif (!$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) { +if ($e instanceof HttpExceptionInterface) { +$response->setStatusCode($e->getStatusCode()); +$response->headers->add($e->getHeaders()); +} else { +$response->setStatusCode(500); +} +} +try { +return $this->filterResponse($response, $request, $type); +} catch (\Exception $e) { +return $response; +} +} +private function varToString($var) +{ +if (is_object($var)) { +return sprintf('Object(%s)', get_class($var)); +} +if (is_array($var)) { +$a = array(); +foreach ($var as $k => $v) { +$a[] = sprintf('%s => %s', $k, $this->varToString($v)); +} +return sprintf("Array(%s)", implode(', ', $a)); +} +if (is_resource($var)) { +return sprintf('Resource(%s)', get_resource_type($var)); +} +if (null === $var) { +return'null'; +} +if (false === $var) { +return'false'; +} +if (true === $var) { +return'true'; +} +return (string) $var; +} +} +} +namespace Symfony\Component\HttpKernel\DependencyInjection +{ +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\HttpKernel; +use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Scope; +class ContainerAwareHttpKernel extends HttpKernel +{ +protected $container; +public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null) +{ +parent::__construct($dispatcher, $controllerResolver, $requestStack); +$this->container = $container; +if (!$container->hasScope('request')) { +$container->addScope(new Scope('request')); +} +} +public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) +{ +$request->headers->set('X-Php-Ob-Level', ob_get_level()); +$this->container->enterScope('request'); +$this->container->set('request', $request,'request'); +try { +$response = parent::handle($request, $type, $catch); +} catch (\Exception $e) { +$this->container->set('request', null,'request'); +$this->container->leaveScope('request'); +throw $e; +} +$this->container->set('request', null,'request'); +$this->container->leaveScope('request'); +return $response; +} +} +} + +namespace { return $loader; } + \ No newline at end of file diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php new file mode 100644 index 000000000..244a71020 --- /dev/null +++ b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php @@ -0,0 +1,4685 @@ +parameters = $this->getDefaultParameters(); + + $this->services = + $this->scopedServices = + $this->scopeStacks = array(); + $this->scopes = array('request' => 'container'); + $this->scopeChildren = array('request' => array()); + $this->methodMap = array( + 'annotation_reader' => 'getAnnotationReaderService', + 'assetic.asset_factory' => 'getAssetic_AssetFactoryService', + 'assetic.asset_manager' => 'getAssetic_AssetManagerService', + 'assetic.filter.cssrewrite' => 'getAssetic_Filter_CssrewriteService', + 'assetic.filter_manager' => 'getAssetic_FilterManagerService', + 'assets.context' => 'getAssets_ContextService', + 'assets.packages' => 'getAssets_PackagesService', + 'cache_clearer' => 'getCacheClearerService', + 'cache_warmer' => 'getCacheWarmerService', + 'chill.custom_field.choice' => 'getChill_CustomField_ChoiceService', + 'chill.custom_field.custom_field_choice_type' => 'getChill_CustomField_CustomFieldChoiceTypeService', + 'chill.custom_field.custom_field_type' => 'getChill_CustomField_CustomFieldTypeService', + 'chill.custom_field.custom_fields_group_linked_custom_fields' => 'getChill_CustomField_CustomFieldsGroupLinkedCustomFieldsService', + 'chill.custom_field.custom_fields_group_type' => 'getChill_CustomField_CustomFieldsGroupTypeService', + 'chill.custom_field.custom_fields_title_type' => 'getChill_CustomField_CustomFieldsTitleTypeService', + 'chill.custom_field.helper' => 'getChill_CustomField_HelperService', + 'chill.custom_field.provider' => 'getChill_CustomField_ProviderService', + 'chill.custom_field.text' => 'getChill_CustomField_TextService', + 'chill.custom_field.title' => 'getChill_CustomField_TitleService', + 'chill.custom_field.twig.custom_fields_rendering' => 'getChill_CustomField_Twig_CustomFieldsRenderingService', + 'chill.main.form.data_transformer.center_transformer' => 'getChill_Main_Form_DataTransformer_CenterTransformerService', + 'chill.main.form.type.center' => 'getChill_Main_Form_Type_CenterService', + 'chill.main.form.type.select2choice' => 'getChill_Main_Form_Type_Select2choiceService', + 'chill.main.form.type.select2country' => 'getChill_Main_Form_Type_Select2countryService', + 'chill.main.form.type.select2entity' => 'getChill_Main_Form_Type_Select2entityService', + 'chill.main.form.type.select2language' => 'getChill_Main_Form_Type_Select2languageService', + 'chill.main.form.type.translatable.string' => 'getChill_Main_Form_Type_Translatable_StringService', + 'chill.main.helper.translatable_string' => 'getChill_Main_Helper_TranslatableStringService', + 'chill.main.menu_composer' => 'getChill_Main_MenuComposerService', + 'chill.main.routes_loader' => 'getChill_Main_RoutesLoaderService', + 'chill.main.search_provider' => 'getChill_Main_SearchProviderService', + 'chill.main.security.authorization.helper' => 'getChill_Main_Security_Authorization_HelperService', + 'chill.main.timeline_builder' => 'getChill_Main_TimelineBuilderService', + 'chill.main.twig.chill_menu' => 'getChill_Main_Twig_ChillMenuService', + 'chill.main.twig.csv_cell' => 'getChill_Main_Twig_CsvCellService', + 'chill.main.twig.translatable_string' => 'getChill_Main_Twig_TranslatableStringService', + 'chill.person.accompanying_period_closing_motive' => 'getChill_Person_AccompanyingPeriodClosingMotiveService', + 'chill.person.search_person' => 'getChill_Person_SearchPersonService', + 'chill.person.security.authorization.person' => 'getChill_Person_Security_Authorization_PersonService', + 'chill.person.timeline.accompanying_period_closing' => 'getChill_Person_Timeline_AccompanyingPeriodClosingService', + 'chill.person.timeline.accompanying_period_opening' => 'getChill_Person_Timeline_AccompanyingPeriodOpeningService', + 'controller_name_converter' => 'getControllerNameConverterService', + 'data_collector.dump' => 'getDataCollector_DumpService', + 'data_collector.form' => 'getDataCollector_FormService', + 'data_collector.form.extractor' => 'getDataCollector_Form_ExtractorService', + 'data_collector.request' => 'getDataCollector_RequestService', + 'data_collector.router' => 'getDataCollector_RouterService', + 'data_collector.translation' => 'getDataCollector_TranslationService', + 'debug.controller_resolver' => 'getDebug_ControllerResolverService', + 'debug.debug_handlers_listener' => 'getDebug_DebugHandlersListenerService', + 'debug.dump_listener' => 'getDebug_DumpListenerService', + 'debug.event_dispatcher' => 'getDebug_EventDispatcherService', + 'debug.stopwatch' => 'getDebug_StopwatchService', + 'doctrine' => 'getDoctrineService', + 'doctrine.dbal.connection_factory' => 'getDoctrine_Dbal_ConnectionFactoryService', + 'doctrine.dbal.default_connection' => 'getDoctrine_Dbal_DefaultConnectionService', + 'doctrine.dbal.logger.profiling.default' => 'getDoctrine_Dbal_Logger_Profiling_DefaultService', + 'doctrine.orm.default_entity_listener_resolver' => 'getDoctrine_Orm_DefaultEntityListenerResolverService', + 'doctrine.orm.default_entity_manager' => 'getDoctrine_Orm_DefaultEntityManagerService', + 'doctrine.orm.default_listeners.attach_entity_listeners' => 'getDoctrine_Orm_DefaultListeners_AttachEntityListenersService', + 'doctrine.orm.default_manager_configurator' => 'getDoctrine_Orm_DefaultManagerConfiguratorService', + 'doctrine.orm.validator.unique' => 'getDoctrine_Orm_Validator_UniqueService', + 'doctrine.orm.validator_initializer' => 'getDoctrine_Orm_ValidatorInitializerService', + 'doctrine_cache.providers.doctrine.orm.default_metadata_cache' => 'getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService', + 'doctrine_cache.providers.doctrine.orm.default_query_cache' => 'getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService', + 'doctrine_cache.providers.doctrine.orm.default_result_cache' => 'getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService', + 'file_locator' => 'getFileLocatorService', + 'filesystem' => 'getFilesystemService', + 'form.csrf_provider' => 'getForm_CsrfProviderService', + 'form.factory' => 'getForm_FactoryService', + 'form.registry' => 'getForm_RegistryService', + 'form.resolved_type_factory' => 'getForm_ResolvedTypeFactoryService', + 'form.type.birthday' => 'getForm_Type_BirthdayService', + 'form.type.button' => 'getForm_Type_ButtonService', + 'form.type.checkbox' => 'getForm_Type_CheckboxService', + 'form.type.choice' => 'getForm_Type_ChoiceService', + 'form.type.collection' => 'getForm_Type_CollectionService', + 'form.type.country' => 'getForm_Type_CountryService', + 'form.type.currency' => 'getForm_Type_CurrencyService', + 'form.type.date' => 'getForm_Type_DateService', + 'form.type.datetime' => 'getForm_Type_DatetimeService', + 'form.type.email' => 'getForm_Type_EmailService', + 'form.type.entity' => 'getForm_Type_EntityService', + 'form.type.file' => 'getForm_Type_FileService', + 'form.type.form' => 'getForm_Type_FormService', + 'form.type.hidden' => 'getForm_Type_HiddenService', + 'form.type.integer' => 'getForm_Type_IntegerService', + 'form.type.language' => 'getForm_Type_LanguageService', + 'form.type.locale' => 'getForm_Type_LocaleService', + 'form.type.money' => 'getForm_Type_MoneyService', + 'form.type.number' => 'getForm_Type_NumberService', + 'form.type.password' => 'getForm_Type_PasswordService', + 'form.type.percent' => 'getForm_Type_PercentService', + 'form.type.radio' => 'getForm_Type_RadioService', + 'form.type.repeated' => 'getForm_Type_RepeatedService', + 'form.type.reset' => 'getForm_Type_ResetService', + 'form.type.search' => 'getForm_Type_SearchService', + 'form.type.submit' => 'getForm_Type_SubmitService', + 'form.type.text' => 'getForm_Type_TextService', + 'form.type.textarea' => 'getForm_Type_TextareaService', + 'form.type.time' => 'getForm_Type_TimeService', + 'form.type.timezone' => 'getForm_Type_TimezoneService', + 'form.type.url' => 'getForm_Type_UrlService', + 'form.type_extension.csrf' => 'getForm_TypeExtension_CsrfService', + 'form.type_extension.form.data_collector' => 'getForm_TypeExtension_Form_DataCollectorService', + 'form.type_extension.form.http_foundation' => 'getForm_TypeExtension_Form_HttpFoundationService', + 'form.type_extension.form.validator' => 'getForm_TypeExtension_Form_ValidatorService', + 'form.type_extension.repeated.validator' => 'getForm_TypeExtension_Repeated_ValidatorService', + 'form.type_extension.submit.validator' => 'getForm_TypeExtension_Submit_ValidatorService', + 'form.type_guesser.doctrine' => 'getForm_TypeGuesser_DoctrineService', + 'form.type_guesser.validator' => 'getForm_TypeGuesser_ValidatorService', + 'fragment.handler' => 'getFragment_HandlerService', + 'fragment.renderer.esi' => 'getFragment_Renderer_EsiService', + 'fragment.renderer.hinclude' => 'getFragment_Renderer_HincludeService', + 'fragment.renderer.inline' => 'getFragment_Renderer_InlineService', + 'fragment.renderer.ssi' => 'getFragment_Renderer_SsiService', + 'http_kernel' => 'getHttpKernelService', + 'kernel' => 'getKernelService', + 'locale_listener' => 'getLocaleListenerService', + 'logger' => 'getLoggerService', + 'monolog.handler.debug' => 'getMonolog_Handler_DebugService', + 'monolog.logger.assetic' => 'getMonolog_Logger_AsseticService', + 'monolog.logger.doctrine' => 'getMonolog_Logger_DoctrineService', + 'monolog.logger.event' => 'getMonolog_Logger_EventService', + 'monolog.logger.php' => 'getMonolog_Logger_PhpService', + 'monolog.logger.profiler' => 'getMonolog_Logger_ProfilerService', + 'monolog.logger.request' => 'getMonolog_Logger_RequestService', + 'monolog.logger.router' => 'getMonolog_Logger_RouterService', + 'monolog.logger.security' => 'getMonolog_Logger_SecurityService', + 'monolog.logger.templating' => 'getMonolog_Logger_TemplatingService', + 'monolog.logger.translation' => 'getMonolog_Logger_TranslationService', + 'profiler' => 'getProfilerService', + 'profiler_listener' => 'getProfilerListenerService', + 'property_accessor' => 'getPropertyAccessorService', + 'request' => 'getRequestService', + 'request_stack' => 'getRequestStackService', + 'response_listener' => 'getResponseListenerService', + 'router' => 'getRouterService', + 'router.request_context' => 'getRouter_RequestContextService', + 'router_listener' => 'getRouterListenerService', + 'routing.loader' => 'getRouting_LoaderService', + 'security.access.decision_manager' => 'getSecurity_Access_DecisionManagerService', + 'security.authentication.manager' => 'getSecurity_Authentication_ManagerService', + 'security.authentication.trust_resolver' => 'getSecurity_Authentication_TrustResolverService', + 'security.authentication_utils' => 'getSecurity_AuthenticationUtilsService', + 'security.authorization_checker' => 'getSecurity_AuthorizationCheckerService', + 'security.context' => 'getSecurity_ContextService', + 'security.csrf.token_manager' => 'getSecurity_Csrf_TokenManagerService', + 'security.encoder_factory' => 'getSecurity_EncoderFactoryService', + 'security.firewall' => 'getSecurity_FirewallService', + 'security.firewall.map.context.default' => 'getSecurity_Firewall_Map_Context_DefaultService', + 'security.firewall.map.context.dev' => 'getSecurity_Firewall_Map_Context_DevService', + 'security.logout_url_generator' => 'getSecurity_LogoutUrlGeneratorService', + 'security.password_encoder' => 'getSecurity_PasswordEncoderService', + 'security.rememberme.response_listener' => 'getSecurity_Rememberme_ResponseListenerService', + 'security.role_hierarchy' => 'getSecurity_RoleHierarchyService', + 'security.secure_random' => 'getSecurity_SecureRandomService', + 'security.token_storage' => 'getSecurity_TokenStorageService', + 'security.user.provider.concrete.chain_provider' => 'getSecurity_User_Provider_Concrete_ChainProviderService', + 'security.user.provider.concrete.in_memory' => 'getSecurity_User_Provider_Concrete_InMemoryService', + 'security.user.provider.concrete.users' => 'getSecurity_User_Provider_Concrete_UsersService', + 'security.validator.user_password' => 'getSecurity_Validator_UserPasswordService', + 'sensio_distribution.security_checker' => 'getSensioDistribution_SecurityCheckerService', + 'sensio_distribution.security_checker.command' => 'getSensioDistribution_SecurityChecker_CommandService', + 'sensio_distribution.webconfigurator' => 'getSensioDistribution_WebconfiguratorService', + 'sensio_framework_extra.cache.listener' => 'getSensioFrameworkExtra_Cache_ListenerService', + 'sensio_framework_extra.controller.listener' => 'getSensioFrameworkExtra_Controller_ListenerService', + 'sensio_framework_extra.converter.datetime' => 'getSensioFrameworkExtra_Converter_DatetimeService', + 'sensio_framework_extra.converter.doctrine.orm' => 'getSensioFrameworkExtra_Converter_Doctrine_OrmService', + 'sensio_framework_extra.converter.listener' => 'getSensioFrameworkExtra_Converter_ListenerService', + 'sensio_framework_extra.converter.manager' => 'getSensioFrameworkExtra_Converter_ManagerService', + 'sensio_framework_extra.security.listener' => 'getSensioFrameworkExtra_Security_ListenerService', + 'sensio_framework_extra.view.guesser' => 'getSensioFrameworkExtra_View_GuesserService', + 'sensio_framework_extra.view.listener' => 'getSensioFrameworkExtra_View_ListenerService', + 'service_container' => 'getServiceContainerService', + 'session' => 'getSessionService', + 'session.handler' => 'getSession_HandlerService', + 'session.save_listener' => 'getSession_SaveListenerService', + 'session.storage.filesystem' => 'getSession_Storage_FilesystemService', + 'session.storage.metadata_bag' => 'getSession_Storage_MetadataBagService', + 'session.storage.native' => 'getSession_Storage_NativeService', + 'session.storage.php_bridge' => 'getSession_Storage_PhpBridgeService', + 'session_listener' => 'getSessionListenerService', + 'streamed_response_listener' => 'getStreamedResponseListenerService', + 'swiftmailer.email_sender.listener' => 'getSwiftmailer_EmailSender_ListenerService', + 'swiftmailer.mailer.default' => 'getSwiftmailer_Mailer_DefaultService', + 'swiftmailer.mailer.default.plugin.messagelogger' => 'getSwiftmailer_Mailer_Default_Plugin_MessageloggerService', + 'swiftmailer.mailer.default.transport' => 'getSwiftmailer_Mailer_Default_TransportService', + 'templating' => 'getTemplatingService', + 'templating.filename_parser' => 'getTemplating_FilenameParserService', + 'templating.helper.assets' => 'getTemplating_Helper_AssetsService', + 'templating.helper.logout_url' => 'getTemplating_Helper_LogoutUrlService', + 'templating.helper.router' => 'getTemplating_Helper_RouterService', + 'templating.helper.security' => 'getTemplating_Helper_SecurityService', + 'templating.loader' => 'getTemplating_LoaderService', + 'templating.locator' => 'getTemplating_LocatorService', + 'templating.name_parser' => 'getTemplating_NameParserService', + 'test.client' => 'getTest_ClientService', + 'test.client.cookiejar' => 'getTest_Client_CookiejarService', + 'test.client.history' => 'getTest_Client_HistoryService', + 'test.session.listener' => 'getTest_Session_ListenerService', + 'translation.dumper.csv' => 'getTranslation_Dumper_CsvService', + 'translation.dumper.ini' => 'getTranslation_Dumper_IniService', + 'translation.dumper.json' => 'getTranslation_Dumper_JsonService', + 'translation.dumper.mo' => 'getTranslation_Dumper_MoService', + 'translation.dumper.php' => 'getTranslation_Dumper_PhpService', + 'translation.dumper.po' => 'getTranslation_Dumper_PoService', + 'translation.dumper.qt' => 'getTranslation_Dumper_QtService', + 'translation.dumper.res' => 'getTranslation_Dumper_ResService', + 'translation.dumper.xliff' => 'getTranslation_Dumper_XliffService', + 'translation.dumper.yml' => 'getTranslation_Dumper_YmlService', + 'translation.extractor' => 'getTranslation_ExtractorService', + 'translation.extractor.php' => 'getTranslation_Extractor_PhpService', + 'translation.loader' => 'getTranslation_LoaderService', + 'translation.loader.csv' => 'getTranslation_Loader_CsvService', + 'translation.loader.dat' => 'getTranslation_Loader_DatService', + 'translation.loader.ini' => 'getTranslation_Loader_IniService', + 'translation.loader.json' => 'getTranslation_Loader_JsonService', + 'translation.loader.mo' => 'getTranslation_Loader_MoService', + 'translation.loader.php' => 'getTranslation_Loader_PhpService', + 'translation.loader.po' => 'getTranslation_Loader_PoService', + 'translation.loader.qt' => 'getTranslation_Loader_QtService', + 'translation.loader.res' => 'getTranslation_Loader_ResService', + 'translation.loader.xliff' => 'getTranslation_Loader_XliffService', + 'translation.loader.yml' => 'getTranslation_Loader_YmlService', + 'translation.writer' => 'getTranslation_WriterService', + 'translator' => 'getTranslatorService', + 'translator.default' => 'getTranslator_DefaultService', + 'translator_listener' => 'getTranslatorListenerService', + 'twig' => 'getTwigService', + 'twig.controller.exception' => 'getTwig_Controller_ExceptionService', + 'twig.controller.preview_error' => 'getTwig_Controller_PreviewErrorService', + 'twig.exception_listener' => 'getTwig_ExceptionListenerService', + 'twig.loader' => 'getTwig_LoaderService', + 'twig.profile' => 'getTwig_ProfileService', + 'twig.translation.extractor' => 'getTwig_Translation_ExtractorService', + 'twig_intl' => 'getTwigIntlService', + 'uri_signer' => 'getUriSignerService', + 'validator' => 'getValidatorService', + 'validator.builder' => 'getValidator_BuilderService', + 'validator.email' => 'getValidator_EmailService', + 'validator.expression' => 'getValidator_ExpressionService', + 'var_dumper.cli_dumper' => 'getVarDumper_CliDumperService', + 'var_dumper.cloner' => 'getVarDumper_ClonerService', + 'web_profiler.controller.exception' => 'getWebProfiler_Controller_ExceptionService', + 'web_profiler.controller.profiler' => 'getWebProfiler_Controller_ProfilerService', + 'web_profiler.controller.router' => 'getWebProfiler_Controller_RouterService', + ); + $this->aliases = array( + 'console.command.sensiolabs_security_command_securitycheckercommand' => 'sensio_distribution.security_checker.command', + 'database_connection' => 'doctrine.dbal.default_connection', + 'doctrine.orm.default_metadata_cache' => 'doctrine_cache.providers.doctrine.orm.default_metadata_cache', + 'doctrine.orm.default_query_cache' => 'doctrine_cache.providers.doctrine.orm.default_query_cache', + 'doctrine.orm.default_result_cache' => 'doctrine_cache.providers.doctrine.orm.default_result_cache', + 'doctrine.orm.entity_manager' => 'doctrine.orm.default_entity_manager', + 'event_dispatcher' => 'debug.event_dispatcher', + 'mailer' => 'swiftmailer.mailer.default', + 'sensio.distribution.webconfigurator' => 'sensio_distribution.webconfigurator', + 'session.storage' => 'session.storage.filesystem', + 'swiftmailer.mailer' => 'swiftmailer.mailer.default', + 'swiftmailer.plugin.messagelogger' => 'swiftmailer.mailer.default.plugin.messagelogger', + 'swiftmailer.transport' => 'swiftmailer.mailer.default.transport', + ); + } + + /** + * {@inheritdoc} + */ + public function compile() + { + throw new LogicException('You cannot compile a dumped frozen container.'); + } + + /** + * Gets the 'annotation_reader' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\Common\Annotations\FileCacheReader A Doctrine\Common\Annotations\FileCacheReader instance. + */ + protected function getAnnotationReaderService() + { + return $this->services['annotation_reader'] = new \Doctrine\Common\Annotations\FileCacheReader(new \Doctrine\Common\Annotations\AnnotationReader(), '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/annotations', true); + } + + /** + * Gets the 'assetic.asset_manager' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Assetic\Factory\LazyAssetManager A Assetic\Factory\LazyAssetManager instance. + */ + protected function getAssetic_AssetManagerService() + { + $a = $this->get('templating.loader'); + + $this->services['assetic.asset_manager'] = $instance = new \Assetic\Factory\LazyAssetManager($this->get('assetic.asset_factory'), array('twig' => new \Assetic\Factory\Loader\CachedFormulaLoader(new \Assetic\Extension\Twig\TwigFormulaLoader($this->get('twig'), $this->get('monolog.logger.assetic', ContainerInterface::NULL_ON_INVALID_REFERENCE)), new \Assetic\Cache\ConfigCache('/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/assetic/config'), true))); + + $instance->addResource(new \Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource(array(0 => new \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource($a, 'ChillPersonBundle', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources/ChillPersonBundle/views', '/\\.[^.]+\\.twig$/'), 1 => new \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource($a, 'ChillPersonBundle', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/views', '/\\.[^.]+\\.twig$/'))), 'twig'); + $instance->addResource(new \Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource(array(0 => new \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource($a, 'ChillMainBundle', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources/ChillMainBundle/views', '/\\.[^.]+\\.twig$/'), 1 => new \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource($a, 'ChillMainBundle', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/views', '/\\.[^.]+\\.twig$/'))), 'twig'); + $instance->addResource(new \Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource($a, '', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources/views', '/\\.[^.]+\\.twig$/'), 'twig'); + + return $instance; + } + + /** + * Gets the 'assetic.filter.cssrewrite' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Assetic\Filter\CssRewriteFilter A Assetic\Filter\CssRewriteFilter instance. + */ + protected function getAssetic_Filter_CssrewriteService() + { + return $this->services['assetic.filter.cssrewrite'] = new \Assetic\Filter\CssRewriteFilter(); + } + + /** + * Gets the 'assetic.filter_manager' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\AsseticBundle\FilterManager A Symfony\Bundle\AsseticBundle\FilterManager instance. + */ + protected function getAssetic_FilterManagerService() + { + return $this->services['assetic.filter_manager'] = new \Symfony\Bundle\AsseticBundle\FilterManager($this, array('cssrewrite' => 'assetic.filter.cssrewrite')); + } + + /** + * Gets the 'assets.context' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Asset\Context\RequestStackContext A Symfony\Component\Asset\Context\RequestStackContext instance. + */ + protected function getAssets_ContextService() + { + return $this->services['assets.context'] = new \Symfony\Component\Asset\Context\RequestStackContext($this->get('request_stack')); + } + + /** + * Gets the 'assets.packages' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Asset\Packages A Symfony\Component\Asset\Packages instance. + */ + protected function getAssets_PackagesService() + { + return $this->services['assets.packages'] = new \Symfony\Component\Asset\Packages(new \Symfony\Component\Asset\PathPackage('', new \Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy(), $this->get('assets.context')), array()); + } + + /** + * Gets the 'cache_clearer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer A Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer instance. + */ + protected function getCacheClearerService() + { + return $this->services['cache_clearer'] = new \Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer(array()); + } + + /** + * Gets the 'cache_warmer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate A Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate instance. + */ + protected function getCacheWarmerService() + { + return $this->services['cache_warmer'] = new \Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate(array(0 => new \Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer(new \Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder($this->get('kernel'), $this->get('templating.filename_parser'), '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources'), $this->get('templating.locator')), 1 => new \Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer($this), 2 => new \Symfony\Bundle\FrameworkBundle\CacheWarmer\TranslationsCacheWarmer($this->get('translator.default')), 3 => new \Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer($this->get('router')), 4 => new \Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer($this->get('doctrine')))); + } + + /** + * Gets the 'chill.custom_field.choice' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice A Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice instance. + */ + protected function getChill_CustomField_ChoiceService() + { + return $this->services['chill.custom_field.choice'] = new \Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice($this->get('request_stack'), $this->get('translator.default'), $this->get('templating'), $this->get('chill.main.helper.translatable_string')); + } + + /** + * Gets the 'chill.custom_field.custom_field_choice_type' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Form\CustomFieldType A Chill\CustomFieldsBundle\Form\CustomFieldType instance. + */ + protected function getChill_CustomField_CustomFieldChoiceTypeService() + { + return $this->services['chill.custom_field.custom_field_choice_type'] = new \Chill\CustomFieldsBundle\Form\CustomFieldType($this->get('chill.custom_field.provider')); + } + + /** + * Gets the 'chill.custom_field.custom_field_type' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Form\Type\CustomFieldType A Chill\CustomFieldsBundle\Form\Type\CustomFieldType instance. + */ + protected function getChill_CustomField_CustomFieldTypeService() + { + return $this->services['chill.custom_field.custom_field_type'] = new \Chill\CustomFieldsBundle\Form\Type\CustomFieldType($this->get('doctrine.orm.default_entity_manager'), $this->get('chill.custom_field.provider')); + } + + /** + * Gets the 'chill.custom_field.custom_fields_group_linked_custom_fields' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Form\Type\LinkedCustomFieldsType A Chill\CustomFieldsBundle\Form\Type\LinkedCustomFieldsType instance. + */ + protected function getChill_CustomField_CustomFieldsGroupLinkedCustomFieldsService() + { + return $this->services['chill.custom_field.custom_fields_group_linked_custom_fields'] = new \Chill\CustomFieldsBundle\Form\Type\LinkedCustomFieldsType($this->get('chill.main.helper.translatable_string')); + } + + /** + * Gets the 'chill.custom_field.custom_fields_group_type' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Form\CustomFieldsGroupType A Chill\CustomFieldsBundle\Form\CustomFieldsGroupType instance. + */ + protected function getChill_CustomField_CustomFieldsGroupTypeService() + { + return $this->services['chill.custom_field.custom_fields_group_type'] = new \Chill\CustomFieldsBundle\Form\CustomFieldsGroupType(array(0 => array('class' => 'Chill\\PersonBundle\\Entity\\Person', 'name' => 'PersonEntity', 'options' => array())), $this->get('translator')); + } + + /** + * Gets the 'chill.custom_field.custom_fields_title_type' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Form\Type\CustomFieldsTitleType A Chill\CustomFieldsBundle\Form\Type\CustomFieldsTitleType instance. + */ + protected function getChill_CustomField_CustomFieldsTitleTypeService() + { + return $this->services['chill.custom_field.custom_fields_title_type'] = new \Chill\CustomFieldsBundle\Form\Type\CustomFieldsTitleType(); + } + + /** + * Gets the 'chill.custom_field.helper' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Service\CustomFieldsHelper A Chill\CustomFieldsBundle\Service\CustomFieldsHelper instance. + */ + protected function getChill_CustomField_HelperService() + { + return $this->services['chill.custom_field.helper'] = new \Chill\CustomFieldsBundle\Service\CustomFieldsHelper($this->get('doctrine.orm.default_entity_manager'), $this->get('chill.custom_field.provider')); + } + + /** + * Gets the 'chill.custom_field.provider' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Service\CustomFieldProvider A Chill\CustomFieldsBundle\Service\CustomFieldProvider instance. + */ + protected function getChill_CustomField_ProviderService() + { + $this->services['chill.custom_field.provider'] = $instance = new \Chill\CustomFieldsBundle\Service\CustomFieldProvider(); + + $instance->addCustomField($this->get('chill.custom_field.text'), 'text'); + $instance->addCustomField($this->get('chill.custom_field.choice'), 'choice'); + $instance->addCustomField($this->get('chill.custom_field.title'), 'title'); + + return $instance; + } + + /** + * Gets the 'chill.custom_field.text' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\CustomFields\CustomFieldText A Chill\CustomFieldsBundle\CustomFields\CustomFieldText instance. + */ + protected function getChill_CustomField_TextService() + { + return $this->services['chill.custom_field.text'] = new \Chill\CustomFieldsBundle\CustomFields\CustomFieldText($this->get('request_stack'), $this->get('templating'), $this->get('chill.main.helper.translatable_string')); + } + + /** + * Gets the 'chill.custom_field.title' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\CustomFields\CustomFieldTitle A Chill\CustomFieldsBundle\CustomFields\CustomFieldTitle instance. + */ + protected function getChill_CustomField_TitleService() + { + return $this->services['chill.custom_field.title'] = new \Chill\CustomFieldsBundle\CustomFields\CustomFieldTitle($this->get('request_stack'), $this->get('templating'), $this->get('chill.main.helper.translatable_string')); + } + + /** + * Gets the 'chill.custom_field.twig.custom_fields_rendering' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\CustomFieldsBundle\Templating\Twig\CustomFieldRenderingTwig A Chill\CustomFieldsBundle\Templating\Twig\CustomFieldRenderingTwig instance. + */ + protected function getChill_CustomField_Twig_CustomFieldsRenderingService() + { + $this->services['chill.custom_field.twig.custom_fields_rendering'] = $instance = new \Chill\CustomFieldsBundle\Templating\Twig\CustomFieldRenderingTwig(); + + $instance->setContainer($this); + + return $instance; + } + + /** + * Gets the 'chill.main.form.data_transformer.center_transformer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Form\Type\DataTransformer\CenterTransformer A Chill\MainBundle\Form\Type\DataTransformer\CenterTransformer instance. + */ + protected function getChill_Main_Form_DataTransformer_CenterTransformerService() + { + return $this->services['chill.main.form.data_transformer.center_transformer'] = new \Chill\MainBundle\Form\Type\DataTransformer\CenterTransformer($this->get('doctrine.orm.default_entity_manager')); + } + + /** + * Gets the 'chill.main.form.type.center' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Form\Type\CenterType A Chill\MainBundle\Form\Type\CenterType instance. + */ + protected function getChill_Main_Form_Type_CenterService() + { + return $this->services['chill.main.form.type.center'] = new \Chill\MainBundle\Form\Type\CenterType($this->get('security.token_storage'), $this->get('chill.main.form.data_transformer.center_transformer')); + } + + /** + * Gets the 'chill.main.form.type.select2choice' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Form\Type\Select2ChoiceType A Chill\MainBundle\Form\Type\Select2ChoiceType instance. + */ + protected function getChill_Main_Form_Type_Select2choiceService() + { + return $this->services['chill.main.form.type.select2choice'] = new \Chill\MainBundle\Form\Type\Select2ChoiceType(); + } + + /** + * Gets the 'chill.main.form.type.select2country' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Form\Type\Select2CountryType A Chill\MainBundle\Form\Type\Select2CountryType instance. + */ + protected function getChill_Main_Form_Type_Select2countryService() + { + return $this->services['chill.main.form.type.select2country'] = new \Chill\MainBundle\Form\Type\Select2CountryType($this->get('request_stack'), $this->get('doctrine.orm.default_entity_manager')); + } + + /** + * Gets the 'chill.main.form.type.select2entity' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Form\Type\Select2EntityType A Chill\MainBundle\Form\Type\Select2EntityType instance. + */ + protected function getChill_Main_Form_Type_Select2entityService() + { + return $this->services['chill.main.form.type.select2entity'] = new \Chill\MainBundle\Form\Type\Select2EntityType(); + } + + /** + * Gets the 'chill.main.form.type.select2language' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Form\Type\Select2LanguageType A Chill\MainBundle\Form\Type\Select2LanguageType instance. + */ + protected function getChill_Main_Form_Type_Select2languageService() + { + return $this->services['chill.main.form.type.select2language'] = new \Chill\MainBundle\Form\Type\Select2LanguageType($this->get('request_stack'), $this->get('doctrine.orm.default_entity_manager')); + } + + /** + * Gets the 'chill.main.form.type.translatable.string' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Form\Type\TranslatableStringFormType A Chill\MainBundle\Form\Type\TranslatableStringFormType instance. + */ + protected function getChill_Main_Form_Type_Translatable_StringService() + { + return $this->services['chill.main.form.type.translatable.string'] = new \Chill\MainBundle\Form\Type\TranslatableStringFormType(array(0 => 'fr'), $this->get('translator.default')); + } + + /** + * Gets the 'chill.main.helper.translatable_string' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Templating\TranslatableStringHelper A Chill\MainBundle\Templating\TranslatableStringHelper instance. + */ + protected function getChill_Main_Helper_TranslatableStringService() + { + return $this->services['chill.main.helper.translatable_string'] = new \Chill\MainBundle\Templating\TranslatableStringHelper($this->get('request_stack'), $this->get('translator.default')); + } + + /** + * Gets the 'chill.main.menu_composer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Routing\MenuComposer A Chill\MainBundle\Routing\MenuComposer instance. + */ + protected function getChill_Main_MenuComposerService() + { + $this->services['chill.main.menu_composer'] = $instance = new \Chill\MainBundle\Routing\MenuComposer(); + + $instance->setContainer($this); + + return $instance; + } + + /** + * Gets the 'chill.main.routes_loader' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Routing\Loader\ChillRoutesLoader A Chill\MainBundle\Routing\Loader\ChillRoutesLoader instance. + */ + protected function getChill_Main_RoutesLoaderService() + { + return $this->services['chill.main.routes_loader'] = new \Chill\MainBundle\Routing\Loader\ChillRoutesLoader(array(0 => '@ChillPersonBundle/Resources/config/routing.yml', 1 => '@ChillCustomFieldsBundle/Resources/config/routing.yml', 2 => '@ChillMainBundle/Resources/config/routing.yml')); + } + + /** + * Gets the 'chill.main.search_provider' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Search\SearchProvider A Chill\MainBundle\Search\SearchProvider instance. + */ + protected function getChill_Main_SearchProviderService() + { + $this->services['chill.main.search_provider'] = $instance = new \Chill\MainBundle\Search\SearchProvider(); + + $instance->addSearchService($this->get('chill.person.search_person'), 'person_regular'); + + return $instance; + } + + /** + * Gets the 'chill.main.security.authorization.helper' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Security\Authorization\AuthorizationHelper A Chill\MainBundle\Security\Authorization\AuthorizationHelper instance. + */ + protected function getChill_Main_Security_Authorization_HelperService() + { + return $this->services['chill.main.security.authorization.helper'] = new \Chill\MainBundle\Security\Authorization\AuthorizationHelper($this->get('security.role_hierarchy')); + } + + /** + * Gets the 'chill.main.timeline_builder' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Timeline\TimelineBuilder A Chill\MainBundle\Timeline\TimelineBuilder instance. + */ + protected function getChill_Main_TimelineBuilderService() + { + $this->services['chill.main.timeline_builder'] = $instance = new \Chill\MainBundle\Timeline\TimelineBuilder($this->get('doctrine.orm.default_entity_manager')); + + $instance->setContainer($this); + $instance->addProvider('person', 'chill.person.timeline.accompanying_period_opening'); + $instance->addProvider('person', 'chill.person.timeline.accompanying_period_closing'); + + return $instance; + } + + /** + * Gets the 'chill.main.twig.chill_menu' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Routing\MenuTwig A Chill\MainBundle\Routing\MenuTwig instance. + */ + protected function getChill_Main_Twig_ChillMenuService() + { + $this->services['chill.main.twig.chill_menu'] = $instance = new \Chill\MainBundle\Routing\MenuTwig($this->get('chill.main.menu_composer')); + + $instance->setContainer($this); + + return $instance; + } + + /** + * Gets the 'chill.main.twig.csv_cell' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Templating\CSVCellTwig A Chill\MainBundle\Templating\CSVCellTwig instance. + */ + protected function getChill_Main_Twig_CsvCellService() + { + return $this->services['chill.main.twig.csv_cell'] = new \Chill\MainBundle\Templating\CSVCellTwig(); + } + + /** + * Gets the 'chill.main.twig.translatable_string' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\MainBundle\Templating\TranslatableStringTwig A Chill\MainBundle\Templating\TranslatableStringTwig instance. + */ + protected function getChill_Main_Twig_TranslatableStringService() + { + $this->services['chill.main.twig.translatable_string'] = $instance = new \Chill\MainBundle\Templating\TranslatableStringTwig(); + + $instance->setContainer($this); + + return $instance; + } + + /** + * Gets the 'chill.person.accompanying_period_closing_motive' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\PersonBundle\Form\Type\ClosingMotiveType A Chill\PersonBundle\Form\Type\ClosingMotiveType instance. + * + * @throws InactiveScopeException when the 'chill.person.accompanying_period_closing_motive' service is requested while the 'request' scope is not active + */ + protected function getChill_Person_AccompanyingPeriodClosingMotiveService() + { + if (!isset($this->scopedServices['request'])) { + throw new InactiveScopeException('chill.person.accompanying_period_closing_motive', 'request'); + } + + return $this->services['chill.person.accompanying_period_closing_motive'] = $this->scopedServices['request']['chill.person.accompanying_period_closing_motive'] = new \Chill\PersonBundle\Form\Type\ClosingMotiveType($this->get('request')); + } + + /** + * Gets the 'chill.person.search_person' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\PersonBundle\Search\PersonSearch A Chill\PersonBundle\Search\PersonSearch instance. + */ + protected function getChill_Person_SearchPersonService() + { + $this->services['chill.person.search_person'] = $instance = new \Chill\PersonBundle\Search\PersonSearch($this->get('doctrine.orm.default_entity_manager'), $this->get('security.token_storage'), $this->get('chill.main.security.authorization.helper')); + + $instance->setContainer($this); + + return $instance; + } + + /** + * Gets the 'chill.person.security.authorization.person' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\PersonBundle\Security\Authorization\PersonVoter A Chill\PersonBundle\Security\Authorization\PersonVoter instance. + */ + protected function getChill_Person_Security_Authorization_PersonService() + { + return $this->services['chill.person.security.authorization.person'] = new \Chill\PersonBundle\Security\Authorization\PersonVoter($this->get('chill.main.security.authorization.helper')); + } + + /** + * Gets the 'chill.person.timeline.accompanying_period_closing' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodClosing A Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodClosing instance. + */ + protected function getChill_Person_Timeline_AccompanyingPeriodClosingService() + { + return $this->services['chill.person.timeline.accompanying_period_closing'] = new \Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodClosing($this->get('doctrine.orm.default_entity_manager')); + } + + /** + * Gets the 'chill.person.timeline.accompanying_period_opening' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodOpening A Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodOpening instance. + */ + protected function getChill_Person_Timeline_AccompanyingPeriodOpeningService() + { + return $this->services['chill.person.timeline.accompanying_period_opening'] = new \Chill\PersonBundle\Timeline\TimelineAccompanyingPeriodOpening($this->get('doctrine.orm.default_entity_manager')); + } + + /** + * Gets the 'data_collector.dump' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\DataCollector\DumpDataCollector A Symfony\Component\HttpKernel\DataCollector\DumpDataCollector instance. + */ + protected function getDataCollector_DumpService() + { + return $this->services['data_collector.dump'] = new \Symfony\Component\HttpKernel\DataCollector\DumpDataCollector($this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE), NULL, 'UTF-8', NULL, NULL); + } + + /** + * Gets the 'data_collector.form' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\DataCollector\FormDataCollector A Symfony\Component\Form\Extension\DataCollector\FormDataCollector instance. + */ + protected function getDataCollector_FormService() + { + return $this->services['data_collector.form'] = new \Symfony\Component\Form\Extension\DataCollector\FormDataCollector($this->get('data_collector.form.extractor')); + } + + /** + * Gets the 'data_collector.form.extractor' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\DataCollector\FormDataExtractor A Symfony\Component\Form\Extension\DataCollector\FormDataExtractor instance. + */ + protected function getDataCollector_Form_ExtractorService() + { + return $this->services['data_collector.form.extractor'] = new \Symfony\Component\Form\Extension\DataCollector\FormDataExtractor(); + } + + /** + * Gets the 'data_collector.request' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\DataCollector\RequestDataCollector A Symfony\Component\HttpKernel\DataCollector\RequestDataCollector instance. + */ + protected function getDataCollector_RequestService() + { + return $this->services['data_collector.request'] = new \Symfony\Component\HttpKernel\DataCollector\RequestDataCollector(); + } + + /** + * Gets the 'data_collector.router' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector A Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector instance. + */ + protected function getDataCollector_RouterService() + { + return $this->services['data_collector.router'] = new \Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector(); + } + + /** + * Gets the 'data_collector.translation' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\DataCollector\TranslationDataCollector A Symfony\Component\Translation\DataCollector\TranslationDataCollector instance. + */ + protected function getDataCollector_TranslationService() + { + return $this->services['data_collector.translation'] = new \Symfony\Component\Translation\DataCollector\TranslationDataCollector($this->get('translator')); + } + + /** + * Gets the 'debug.controller_resolver' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Controller\TraceableControllerResolver A Symfony\Component\HttpKernel\Controller\TraceableControllerResolver instance. + */ + protected function getDebug_ControllerResolverService() + { + return $this->services['debug.controller_resolver'] = new \Symfony\Component\HttpKernel\Controller\TraceableControllerResolver(new \Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver($this, $this->get('controller_name_converter'), $this->get('monolog.logger.request', ContainerInterface::NULL_ON_INVALID_REFERENCE)), $this->get('debug.stopwatch')); + } + + /** + * Gets the 'debug.debug_handlers_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\DebugHandlersListener A Symfony\Component\HttpKernel\EventListener\DebugHandlersListener instance. + */ + protected function getDebug_DebugHandlersListenerService() + { + return $this->services['debug.debug_handlers_listener'] = new \Symfony\Component\HttpKernel\EventListener\DebugHandlersListener('', $this->get('monolog.logger.php', ContainerInterface::NULL_ON_INVALID_REFERENCE), NULL, NULL, true, NULL); + } + + /** + * Gets the 'debug.dump_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\DumpListener A Symfony\Component\HttpKernel\EventListener\DumpListener instance. + */ + protected function getDebug_DumpListenerService() + { + return $this->services['debug.dump_listener'] = new \Symfony\Component\HttpKernel\EventListener\DumpListener($this->get('var_dumper.cloner'), $this->get('data_collector.dump')); + } + + /** + * Gets the 'debug.event_dispatcher' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher A Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher instance. + */ + protected function getDebug_EventDispatcherService() + { + $this->services['debug.event_dispatcher'] = $instance = new \Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher(new \Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher($this), $this->get('debug.stopwatch'), $this->get('monolog.logger.event', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + + $instance->addListenerService('kernel.controller', array(0 => 'data_collector.router', 1 => 'onKernelController'), 0); + $instance->addSubscriberService('response_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener'); + $instance->addSubscriberService('streamed_response_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener'); + $instance->addSubscriberService('locale_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener'); + $instance->addSubscriberService('translator_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\TranslatorListener'); + $instance->addSubscriberService('test.session.listener', 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\TestSessionListener'); + $instance->addSubscriberService('session_listener', 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener'); + $instance->addSubscriberService('session.save_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\SaveSessionListener'); + $instance->addSubscriberService('profiler_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\ProfilerListener'); + $instance->addSubscriberService('data_collector.request', 'Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector'); + $instance->addSubscriberService('router_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener'); + $instance->addSubscriberService('debug.debug_handlers_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener'); + $instance->addSubscriberService('security.firewall', 'Symfony\\Component\\Security\\Http\\Firewall'); + $instance->addSubscriberService('security.rememberme.response_listener', 'Symfony\\Component\\Security\\Http\\RememberMe\\ResponseListener'); + $instance->addSubscriberService('twig.exception_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener'); + $instance->addSubscriberService('swiftmailer.email_sender.listener', 'Symfony\\Bundle\\SwiftmailerBundle\\EventListener\\EmailSenderListener'); + $instance->addSubscriberService('sensio_framework_extra.controller.listener', 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ControllerListener'); + $instance->addSubscriberService('sensio_framework_extra.converter.listener', 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ParamConverterListener'); + $instance->addSubscriberService('sensio_framework_extra.view.listener', 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\TemplateListener'); + $instance->addSubscriberService('sensio_framework_extra.cache.listener', 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\HttpCacheListener'); + $instance->addSubscriberService('sensio_framework_extra.security.listener', 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener'); + $instance->addSubscriberService('debug.dump_listener', 'Symfony\\Component\\HttpKernel\\EventListener\\DumpListener'); + + return $instance; + } + + /** + * Gets the 'debug.stopwatch' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Stopwatch\Stopwatch A Symfony\Component\Stopwatch\Stopwatch instance. + */ + protected function getDebug_StopwatchService() + { + return $this->services['debug.stopwatch'] = new \Symfony\Component\Stopwatch\Stopwatch(); + } + + /** + * Gets the 'doctrine' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\Bundle\DoctrineBundle\Registry A Doctrine\Bundle\DoctrineBundle\Registry instance. + */ + protected function getDoctrineService() + { + return $this->services['doctrine'] = new \Doctrine\Bundle\DoctrineBundle\Registry($this, array('default' => 'doctrine.dbal.default_connection'), array('default' => 'doctrine.orm.default_entity_manager'), 'default', 'default'); + } + + /** + * Gets the 'doctrine.dbal.connection_factory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\Bundle\DoctrineBundle\ConnectionFactory A Doctrine\Bundle\DoctrineBundle\ConnectionFactory instance. + */ + protected function getDoctrine_Dbal_ConnectionFactoryService() + { + return $this->services['doctrine.dbal.connection_factory'] = new \Doctrine\Bundle\DoctrineBundle\ConnectionFactory(array()); + } + + /** + * Gets the 'doctrine.dbal.default_connection' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\DBAL\Connection A Doctrine\DBAL\Connection instance. + */ + protected function getDoctrine_Dbal_DefaultConnectionService() + { + $a = new \Doctrine\DBAL\Logging\LoggerChain(); + $a->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger($this->get('monolog.logger.doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE))); + $a->addLogger($this->get('doctrine.dbal.logger.profiling.default')); + + $b = new \Doctrine\DBAL\Configuration(); + $b->setSQLLogger($a); + + $c = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this); + $c->addEventListener(array(0 => 'loadClassMetadata'), $this->get('doctrine.orm.default_listeners.attach_entity_listeners')); + + return $this->services['doctrine.dbal.default_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_pgsql', 'host' => '127.0.0.1', 'port' => 5432, 'dbname' => 'chill_test', 'user' => 'chill', 'password' => 'chill', 'charset' => 'UTF8', 'driverOptions' => array()), $b, $c, array()); + } + + /** + * Gets the 'doctrine.orm.default_entity_listener_resolver' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\ORM\Mapping\DefaultEntityListenerResolver A Doctrine\ORM\Mapping\DefaultEntityListenerResolver instance. + */ + protected function getDoctrine_Orm_DefaultEntityListenerResolverService() + { + return $this->services['doctrine.orm.default_entity_listener_resolver'] = new \Doctrine\ORM\Mapping\DefaultEntityListenerResolver(); + } + + /** + * Gets the 'doctrine.orm.default_entity_manager' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\ORM\EntityManager A Doctrine\ORM\EntityManager instance. + */ + protected function getDoctrine_Orm_DefaultEntityManagerService() + { + $a = new \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver(array('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/config/doctrine' => 'Chill\\MainBundle\\Entity', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/config/doctrine' => 'Chill\\CustomFieldsBundle\\Entity', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/config/doctrine' => 'Chill\\PersonBundle\\Entity', '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/config/doctrine' => 'Chill\\ActivityBundle\\Entity')); + $a->setGlobalBasename('mapping'); + + $b = new \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain(); + $b->addDriver($a, 'Chill\\MainBundle\\Entity'); + $b->addDriver($a, 'Chill\\CustomFieldsBundle\\Entity'); + $b->addDriver($a, 'Chill\\PersonBundle\\Entity'); + $b->addDriver($a, 'Chill\\ActivityBundle\\Entity'); + + $c = new \Doctrine\ORM\Configuration(); + $c->setEntityNamespaces(array('ChillMainBundle' => 'Chill\\MainBundle\\Entity', 'ChillCustomFieldsBundle' => 'Chill\\CustomFieldsBundle\\Entity', 'ChillPersonBundle' => 'Chill\\PersonBundle\\Entity', 'ChillActivityBundle' => 'Chill\\ActivityBundle\\Entity')); + $c->setMetadataCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_metadata_cache')); + $c->setQueryCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_query_cache')); + $c->setResultCacheImpl($this->get('doctrine_cache.providers.doctrine.orm.default_result_cache')); + $c->setMetadataDriverImpl($b); + $c->setProxyDir('/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/doctrine/orm/Proxies'); + $c->setProxyNamespace('Proxies'); + $c->setAutoGenerateProxyClasses(true); + $c->setClassMetadataFactoryName('Doctrine\\ORM\\Mapping\\ClassMetadataFactory'); + $c->setDefaultRepositoryClassName('Doctrine\\ORM\\EntityRepository'); + $c->setNamingStrategy(new \Doctrine\ORM\Mapping\DefaultNamingStrategy()); + $c->setQuoteStrategy(new \Doctrine\ORM\Mapping\DefaultQuoteStrategy()); + $c->setEntityListenerResolver($this->get('doctrine.orm.default_entity_listener_resolver')); + $c->addCustomStringFunction('unaccent', 'Chill\\MainBundle\\Doctrine\\DQL\\Unaccent'); + + $this->services['doctrine.orm.default_entity_manager'] = $instance = \Doctrine\ORM\EntityManager::create($this->get('doctrine.dbal.default_connection'), $c); + + $this->get('doctrine.orm.default_manager_configurator')->configure($instance); + + return $instance; + } + + /** + * Gets the 'doctrine.orm.default_listeners.attach_entity_listeners' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\ORM\Tools\AttachEntityListenersListener A Doctrine\ORM\Tools\AttachEntityListenersListener instance. + */ + protected function getDoctrine_Orm_DefaultListeners_AttachEntityListenersService() + { + return $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] = new \Doctrine\ORM\Tools\AttachEntityListenersListener(); + } + + /** + * Gets the 'doctrine.orm.default_manager_configurator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\Bundle\DoctrineBundle\ManagerConfigurator A Doctrine\Bundle\DoctrineBundle\ManagerConfigurator instance. + */ + protected function getDoctrine_Orm_DefaultManagerConfiguratorService() + { + return $this->services['doctrine.orm.default_manager_configurator'] = new \Doctrine\Bundle\DoctrineBundle\ManagerConfigurator(array(), array()); + } + + /** + * Gets the 'doctrine.orm.validator.unique' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator A Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator instance. + */ + protected function getDoctrine_Orm_Validator_UniqueService() + { + return $this->services['doctrine.orm.validator.unique'] = new \Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator($this->get('doctrine')); + } + + /** + * Gets the 'doctrine.orm.validator_initializer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Doctrine\Validator\DoctrineInitializer A Symfony\Bridge\Doctrine\Validator\DoctrineInitializer instance. + */ + protected function getDoctrine_Orm_ValidatorInitializerService() + { + return $this->services['doctrine.orm.validator_initializer'] = new \Symfony\Bridge\Doctrine\Validator\DoctrineInitializer($this->get('doctrine')); + } + + /** + * Gets the 'doctrine_cache.providers.doctrine.orm.default_metadata_cache' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\Common\Cache\ArrayCache A Doctrine\Common\Cache\ArrayCache instance. + */ + protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultMetadataCacheService() + { + $this->services['doctrine_cache.providers.doctrine.orm.default_metadata_cache'] = $instance = new \Doctrine\Common\Cache\ArrayCache(); + + $instance->setNamespace('sf2orm_default_c0b41a363c751fd9be0caf57d83082a61e71edafd3180cccf326d0e99751ea74'); + + return $instance; + } + + /** + * Gets the 'doctrine_cache.providers.doctrine.orm.default_query_cache' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\Common\Cache\ArrayCache A Doctrine\Common\Cache\ArrayCache instance. + */ + protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService() + { + $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \Doctrine\Common\Cache\ArrayCache(); + + $instance->setNamespace('sf2orm_default_c0b41a363c751fd9be0caf57d83082a61e71edafd3180cccf326d0e99751ea74'); + + return $instance; + } + + /** + * Gets the 'doctrine_cache.providers.doctrine.orm.default_result_cache' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Doctrine\Common\Cache\ArrayCache A Doctrine\Common\Cache\ArrayCache instance. + */ + protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultResultCacheService() + { + $this->services['doctrine_cache.providers.doctrine.orm.default_result_cache'] = $instance = new \Doctrine\Common\Cache\ArrayCache(); + + $instance->setNamespace('sf2orm_default_c0b41a363c751fd9be0caf57d83082a61e71edafd3180cccf326d0e99751ea74'); + + return $instance; + } + + /** + * Gets the 'file_locator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Config\FileLocator A Symfony\Component\HttpKernel\Config\FileLocator instance. + */ + protected function getFileLocatorService() + { + return $this->services['file_locator'] = new \Symfony\Component\HttpKernel\Config\FileLocator($this->get('kernel'), '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources'); + } + + /** + * Gets the 'filesystem' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Filesystem\Filesystem A Symfony\Component\Filesystem\Filesystem instance. + */ + protected function getFilesystemService() + { + return $this->services['filesystem'] = new \Symfony\Component\Filesystem\Filesystem(); + } + + /** + * Gets the 'form.csrf_provider' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter A Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter instance. + */ + protected function getForm_CsrfProviderService() + { + return $this->services['form.csrf_provider'] = new \Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter($this->get('security.csrf.token_manager')); + } + + /** + * Gets the 'form.factory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\FormFactory A Symfony\Component\Form\FormFactory instance. + */ + protected function getForm_FactoryService() + { + return $this->services['form.factory'] = new \Symfony\Component\Form\FormFactory($this->get('form.registry'), $this->get('form.resolved_type_factory')); + } + + /** + * Gets the 'form.registry' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\FormRegistry A Symfony\Component\Form\FormRegistry instance. + */ + protected function getForm_RegistryService() + { + return $this->services['form.registry'] = new \Symfony\Component\Form\FormRegistry(array(0 => new \Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension($this, array('form' => 'form.type.form', 'birthday' => 'form.type.birthday', 'checkbox' => 'form.type.checkbox', 'choice' => 'form.type.choice', 'collection' => 'form.type.collection', 'country' => 'form.type.country', 'date' => 'form.type.date', 'datetime' => 'form.type.datetime', 'email' => 'form.type.email', 'file' => 'form.type.file', 'hidden' => 'form.type.hidden', 'integer' => 'form.type.integer', 'language' => 'form.type.language', 'locale' => 'form.type.locale', 'money' => 'form.type.money', 'number' => 'form.type.number', 'password' => 'form.type.password', 'percent' => 'form.type.percent', 'radio' => 'form.type.radio', 'repeated' => 'form.type.repeated', 'search' => 'form.type.search', 'textarea' => 'form.type.textarea', 'text' => 'form.type.text', 'time' => 'form.type.time', 'timezone' => 'form.type.timezone', 'url' => 'form.type.url', 'button' => 'form.type.button', 'submit' => 'form.type.submit', 'reset' => 'form.type.reset', 'currency' => 'form.type.currency', 'entity' => 'form.type.entity', 'translatable_string' => 'chill.main.form.type.translatable.string', 'select2_choice' => 'chill.main.form.type.select2choice', 'select2_entity' => 'chill.main.form.type.select2entity', 'select2_chill_country' => 'chill.main.form.type.select2country', 'select2_chill_language' => 'chill.main.form.type.select2language', 'center' => 'chill.main.form.type.center', 'custom_field_choice' => 'chill.custom_field.custom_field_choice_type', 'custom_fields_group' => 'chill.custom_field.custom_fields_group_type', 'custom_field' => 'chill.custom_field.custom_field_type', 'custom_fields_group_linked_custom_fields' => 'chill.custom_field.custom_fields_group_linked_custom_fields', 'custom_field_title' => 'chill.custom_field.custom_fields_title_type', 'closing_motive' => 'chill.person.accompanying_period_closing_motive'), array('form' => array(0 => 'form.type_extension.form.http_foundation', 1 => 'form.type_extension.form.validator', 2 => 'form.type_extension.csrf', 3 => 'form.type_extension.form.data_collector'), 'repeated' => array(0 => 'form.type_extension.repeated.validator'), 'submit' => array(0 => 'form.type_extension.submit.validator')), array(0 => 'form.type_guesser.validator', 1 => 'form.type_guesser.doctrine'))), $this->get('form.resolved_type_factory')); + } + + /** + * Gets the 'form.resolved_type_factory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeFactoryDataCollectorProxy A Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeFactoryDataCollectorProxy instance. + */ + protected function getForm_ResolvedTypeFactoryService() + { + return $this->services['form.resolved_type_factory'] = new \Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeFactoryDataCollectorProxy(new \Symfony\Component\Form\ResolvedFormTypeFactory(), $this->get('data_collector.form')); + } + + /** + * Gets the 'form.type.birthday' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\BirthdayType A Symfony\Component\Form\Extension\Core\Type\BirthdayType instance. + */ + protected function getForm_Type_BirthdayService() + { + return $this->services['form.type.birthday'] = new \Symfony\Component\Form\Extension\Core\Type\BirthdayType(); + } + + /** + * Gets the 'form.type.button' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\ButtonType A Symfony\Component\Form\Extension\Core\Type\ButtonType instance. + */ + protected function getForm_Type_ButtonService() + { + return $this->services['form.type.button'] = new \Symfony\Component\Form\Extension\Core\Type\ButtonType(); + } + + /** + * Gets the 'form.type.checkbox' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\CheckboxType A Symfony\Component\Form\Extension\Core\Type\CheckboxType instance. + */ + protected function getForm_Type_CheckboxService() + { + return $this->services['form.type.checkbox'] = new \Symfony\Component\Form\Extension\Core\Type\CheckboxType(); + } + + /** + * Gets the 'form.type.choice' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\ChoiceType A Symfony\Component\Form\Extension\Core\Type\ChoiceType instance. + */ + protected function getForm_Type_ChoiceService() + { + return $this->services['form.type.choice'] = new \Symfony\Component\Form\Extension\Core\Type\ChoiceType(); + } + + /** + * Gets the 'form.type.collection' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\CollectionType A Symfony\Component\Form\Extension\Core\Type\CollectionType instance. + */ + protected function getForm_Type_CollectionService() + { + return $this->services['form.type.collection'] = new \Symfony\Component\Form\Extension\Core\Type\CollectionType(); + } + + /** + * Gets the 'form.type.country' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\CountryType A Symfony\Component\Form\Extension\Core\Type\CountryType instance. + */ + protected function getForm_Type_CountryService() + { + return $this->services['form.type.country'] = new \Symfony\Component\Form\Extension\Core\Type\CountryType(); + } + + /** + * Gets the 'form.type.currency' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\CurrencyType A Symfony\Component\Form\Extension\Core\Type\CurrencyType instance. + */ + protected function getForm_Type_CurrencyService() + { + return $this->services['form.type.currency'] = new \Symfony\Component\Form\Extension\Core\Type\CurrencyType(); + } + + /** + * Gets the 'form.type.date' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\DateType A Symfony\Component\Form\Extension\Core\Type\DateType instance. + */ + protected function getForm_Type_DateService() + { + return $this->services['form.type.date'] = new \Symfony\Component\Form\Extension\Core\Type\DateType(); + } + + /** + * Gets the 'form.type.datetime' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\DateTimeType A Symfony\Component\Form\Extension\Core\Type\DateTimeType instance. + */ + protected function getForm_Type_DatetimeService() + { + return $this->services['form.type.datetime'] = new \Symfony\Component\Form\Extension\Core\Type\DateTimeType(); + } + + /** + * Gets the 'form.type.email' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\EmailType A Symfony\Component\Form\Extension\Core\Type\EmailType instance. + */ + protected function getForm_Type_EmailService() + { + return $this->services['form.type.email'] = new \Symfony\Component\Form\Extension\Core\Type\EmailType(); + } + + /** + * Gets the 'form.type.entity' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Doctrine\Form\Type\EntityType A Symfony\Bridge\Doctrine\Form\Type\EntityType instance. + */ + protected function getForm_Type_EntityService() + { + return $this->services['form.type.entity'] = new \Symfony\Bridge\Doctrine\Form\Type\EntityType($this->get('doctrine')); + } + + /** + * Gets the 'form.type.file' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\FileType A Symfony\Component\Form\Extension\Core\Type\FileType instance. + */ + protected function getForm_Type_FileService() + { + return $this->services['form.type.file'] = new \Symfony\Component\Form\Extension\Core\Type\FileType(); + } + + /** + * Gets the 'form.type.form' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\FormType A Symfony\Component\Form\Extension\Core\Type\FormType instance. + */ + protected function getForm_Type_FormService() + { + return $this->services['form.type.form'] = new \Symfony\Component\Form\Extension\Core\Type\FormType($this->get('property_accessor')); + } + + /** + * Gets the 'form.type.hidden' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\HiddenType A Symfony\Component\Form\Extension\Core\Type\HiddenType instance. + */ + protected function getForm_Type_HiddenService() + { + return $this->services['form.type.hidden'] = new \Symfony\Component\Form\Extension\Core\Type\HiddenType(); + } + + /** + * Gets the 'form.type.integer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\IntegerType A Symfony\Component\Form\Extension\Core\Type\IntegerType instance. + */ + protected function getForm_Type_IntegerService() + { + return $this->services['form.type.integer'] = new \Symfony\Component\Form\Extension\Core\Type\IntegerType(); + } + + /** + * Gets the 'form.type.language' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\LanguageType A Symfony\Component\Form\Extension\Core\Type\LanguageType instance. + */ + protected function getForm_Type_LanguageService() + { + return $this->services['form.type.language'] = new \Symfony\Component\Form\Extension\Core\Type\LanguageType(); + } + + /** + * Gets the 'form.type.locale' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\LocaleType A Symfony\Component\Form\Extension\Core\Type\LocaleType instance. + */ + protected function getForm_Type_LocaleService() + { + return $this->services['form.type.locale'] = new \Symfony\Component\Form\Extension\Core\Type\LocaleType(); + } + + /** + * Gets the 'form.type.money' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\MoneyType A Symfony\Component\Form\Extension\Core\Type\MoneyType instance. + */ + protected function getForm_Type_MoneyService() + { + return $this->services['form.type.money'] = new \Symfony\Component\Form\Extension\Core\Type\MoneyType(); + } + + /** + * Gets the 'form.type.number' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\NumberType A Symfony\Component\Form\Extension\Core\Type\NumberType instance. + */ + protected function getForm_Type_NumberService() + { + return $this->services['form.type.number'] = new \Symfony\Component\Form\Extension\Core\Type\NumberType(); + } + + /** + * Gets the 'form.type.password' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\PasswordType A Symfony\Component\Form\Extension\Core\Type\PasswordType instance. + */ + protected function getForm_Type_PasswordService() + { + return $this->services['form.type.password'] = new \Symfony\Component\Form\Extension\Core\Type\PasswordType(); + } + + /** + * Gets the 'form.type.percent' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\PercentType A Symfony\Component\Form\Extension\Core\Type\PercentType instance. + */ + protected function getForm_Type_PercentService() + { + return $this->services['form.type.percent'] = new \Symfony\Component\Form\Extension\Core\Type\PercentType(); + } + + /** + * Gets the 'form.type.radio' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\RadioType A Symfony\Component\Form\Extension\Core\Type\RadioType instance. + */ + protected function getForm_Type_RadioService() + { + return $this->services['form.type.radio'] = new \Symfony\Component\Form\Extension\Core\Type\RadioType(); + } + + /** + * Gets the 'form.type.repeated' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\RepeatedType A Symfony\Component\Form\Extension\Core\Type\RepeatedType instance. + */ + protected function getForm_Type_RepeatedService() + { + return $this->services['form.type.repeated'] = new \Symfony\Component\Form\Extension\Core\Type\RepeatedType(); + } + + /** + * Gets the 'form.type.reset' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\ResetType A Symfony\Component\Form\Extension\Core\Type\ResetType instance. + */ + protected function getForm_Type_ResetService() + { + return $this->services['form.type.reset'] = new \Symfony\Component\Form\Extension\Core\Type\ResetType(); + } + + /** + * Gets the 'form.type.search' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\SearchType A Symfony\Component\Form\Extension\Core\Type\SearchType instance. + */ + protected function getForm_Type_SearchService() + { + return $this->services['form.type.search'] = new \Symfony\Component\Form\Extension\Core\Type\SearchType(); + } + + /** + * Gets the 'form.type.submit' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\SubmitType A Symfony\Component\Form\Extension\Core\Type\SubmitType instance. + */ + protected function getForm_Type_SubmitService() + { + return $this->services['form.type.submit'] = new \Symfony\Component\Form\Extension\Core\Type\SubmitType(); + } + + /** + * Gets the 'form.type.text' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\TextType A Symfony\Component\Form\Extension\Core\Type\TextType instance. + */ + protected function getForm_Type_TextService() + { + return $this->services['form.type.text'] = new \Symfony\Component\Form\Extension\Core\Type\TextType(); + } + + /** + * Gets the 'form.type.textarea' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\TextareaType A Symfony\Component\Form\Extension\Core\Type\TextareaType instance. + */ + protected function getForm_Type_TextareaService() + { + return $this->services['form.type.textarea'] = new \Symfony\Component\Form\Extension\Core\Type\TextareaType(); + } + + /** + * Gets the 'form.type.time' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\TimeType A Symfony\Component\Form\Extension\Core\Type\TimeType instance. + */ + protected function getForm_Type_TimeService() + { + return $this->services['form.type.time'] = new \Symfony\Component\Form\Extension\Core\Type\TimeType(); + } + + /** + * Gets the 'form.type.timezone' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\TimezoneType A Symfony\Component\Form\Extension\Core\Type\TimezoneType instance. + */ + protected function getForm_Type_TimezoneService() + { + return $this->services['form.type.timezone'] = new \Symfony\Component\Form\Extension\Core\Type\TimezoneType(); + } + + /** + * Gets the 'form.type.url' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Core\Type\UrlType A Symfony\Component\Form\Extension\Core\Type\UrlType instance. + */ + protected function getForm_Type_UrlService() + { + return $this->services['form.type.url'] = new \Symfony\Component\Form\Extension\Core\Type\UrlType(); + } + + /** + * Gets the 'form.type_extension.csrf' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Csrf\Type\FormTypeCsrfExtension A Symfony\Component\Form\Extension\Csrf\Type\FormTypeCsrfExtension instance. + */ + protected function getForm_TypeExtension_CsrfService() + { + return $this->services['form.type_extension.csrf'] = new \Symfony\Component\Form\Extension\Csrf\Type\FormTypeCsrfExtension($this->get('security.csrf.token_manager'), true, '_token', $this->get('translator.default'), 'validators'); + } + + /** + * Gets the 'form.type_extension.form.data_collector' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\DataCollector\Type\DataCollectorTypeExtension A Symfony\Component\Form\Extension\DataCollector\Type\DataCollectorTypeExtension instance. + */ + protected function getForm_TypeExtension_Form_DataCollectorService() + { + return $this->services['form.type_extension.form.data_collector'] = new \Symfony\Component\Form\Extension\DataCollector\Type\DataCollectorTypeExtension($this->get('data_collector.form')); + } + + /** + * Gets the 'form.type_extension.form.http_foundation' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension A Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension instance. + */ + protected function getForm_TypeExtension_Form_HttpFoundationService() + { + return $this->services['form.type_extension.form.http_foundation'] = new \Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension(new \Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler(new \Symfony\Component\Form\Util\ServerParams($this->get('request_stack')))); + } + + /** + * Gets the 'form.type_extension.form.validator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension A Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension instance. + */ + protected function getForm_TypeExtension_Form_ValidatorService() + { + return $this->services['form.type_extension.form.validator'] = new \Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension($this->get('validator')); + } + + /** + * Gets the 'form.type_extension.repeated.validator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Validator\Type\RepeatedTypeValidatorExtension A Symfony\Component\Form\Extension\Validator\Type\RepeatedTypeValidatorExtension instance. + */ + protected function getForm_TypeExtension_Repeated_ValidatorService() + { + return $this->services['form.type_extension.repeated.validator'] = new \Symfony\Component\Form\Extension\Validator\Type\RepeatedTypeValidatorExtension(); + } + + /** + * Gets the 'form.type_extension.submit.validator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Validator\Type\SubmitTypeValidatorExtension A Symfony\Component\Form\Extension\Validator\Type\SubmitTypeValidatorExtension instance. + */ + protected function getForm_TypeExtension_Submit_ValidatorService() + { + return $this->services['form.type_extension.submit.validator'] = new \Symfony\Component\Form\Extension\Validator\Type\SubmitTypeValidatorExtension(); + } + + /** + * Gets the 'form.type_guesser.doctrine' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser A Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser instance. + */ + protected function getForm_TypeGuesser_DoctrineService() + { + return $this->services['form.type_guesser.doctrine'] = new \Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser($this->get('doctrine')); + } + + /** + * Gets the 'form.type_guesser.validator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser A Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser instance. + */ + protected function getForm_TypeGuesser_ValidatorService() + { + return $this->services['form.type_guesser.validator'] = new \Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser($this->get('validator')); + } + + /** + * Gets the 'fragment.handler' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\DependencyInjection\LazyLoadingFragmentHandler A Symfony\Component\HttpKernel\DependencyInjection\LazyLoadingFragmentHandler instance. + */ + protected function getFragment_HandlerService() + { + $this->services['fragment.handler'] = $instance = new \Symfony\Component\HttpKernel\DependencyInjection\LazyLoadingFragmentHandler($this, true, $this->get('request_stack')); + + $instance->addRendererService('inline', 'fragment.renderer.inline'); + $instance->addRendererService('hinclude', 'fragment.renderer.hinclude'); + $instance->addRendererService('hinclude', 'fragment.renderer.hinclude'); + $instance->addRendererService('esi', 'fragment.renderer.esi'); + $instance->addRendererService('ssi', 'fragment.renderer.ssi'); + + return $instance; + } + + /** + * Gets the 'fragment.renderer.esi' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Fragment\EsiFragmentRenderer A Symfony\Component\HttpKernel\Fragment\EsiFragmentRenderer instance. + */ + protected function getFragment_Renderer_EsiService() + { + $this->services['fragment.renderer.esi'] = $instance = new \Symfony\Component\HttpKernel\Fragment\EsiFragmentRenderer(NULL, $this->get('fragment.renderer.inline'), $this->get('uri_signer')); + + $instance->setFragmentPath('/_fragment'); + + return $instance; + } + + /** + * Gets the 'fragment.renderer.hinclude' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer A Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer instance. + */ + protected function getFragment_Renderer_HincludeService() + { + $this->services['fragment.renderer.hinclude'] = $instance = new \Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer($this->get('twig'), $this->get('uri_signer'), NULL); + + $instance->setFragmentPath('/_fragment'); + + return $instance; + } + + /** + * Gets the 'fragment.renderer.inline' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer A Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer instance. + */ + protected function getFragment_Renderer_InlineService() + { + $this->services['fragment.renderer.inline'] = $instance = new \Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer($this->get('http_kernel'), $this->get('debug.event_dispatcher')); + + $instance->setFragmentPath('/_fragment'); + + return $instance; + } + + /** + * Gets the 'fragment.renderer.ssi' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Fragment\SsiFragmentRenderer A Symfony\Component\HttpKernel\Fragment\SsiFragmentRenderer instance. + */ + protected function getFragment_Renderer_SsiService() + { + $this->services['fragment.renderer.ssi'] = $instance = new \Symfony\Component\HttpKernel\Fragment\SsiFragmentRenderer(NULL, $this->get('fragment.renderer.inline'), $this->get('uri_signer')); + + $instance->setFragmentPath('/_fragment'); + + return $instance; + } + + /** + * Gets the 'http_kernel' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel A Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel instance. + */ + protected function getHttpKernelService() + { + return $this->services['http_kernel'] = new \Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel($this->get('debug.event_dispatcher'), $this, $this->get('debug.controller_resolver'), $this->get('request_stack'), false); + } + + /** + * Gets the 'kernel' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @throws RuntimeException always since this service is expected to be injected dynamically + */ + protected function getKernelService() + { + throw new RuntimeException('You have requested a synthetic service ("kernel"). The DIC does not know how to construct this service.'); + } + + /** + * Gets the 'locale_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\LocaleListener A Symfony\Component\HttpKernel\EventListener\LocaleListener instance. + */ + protected function getLocaleListenerService() + { + return $this->services['locale_listener'] = new \Symfony\Component\HttpKernel\EventListener\LocaleListener('fr', $this->get('router', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('request_stack')); + } + + /** + * Gets the 'logger' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getLoggerService() + { + $this->services['logger'] = $instance = new \Symfony\Bridge\Monolog\Logger('app'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.handler.debug' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Handler\DebugHandler A Symfony\Bridge\Monolog\Handler\DebugHandler instance. + */ + protected function getMonolog_Handler_DebugService() + { + return $this->services['monolog.handler.debug'] = new \Symfony\Bridge\Monolog\Handler\DebugHandler(100, true); + } + + /** + * Gets the 'monolog.logger.assetic' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_AsseticService() + { + $this->services['monolog.logger.assetic'] = $instance = new \Symfony\Bridge\Monolog\Logger('assetic'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.doctrine' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_DoctrineService() + { + $this->services['monolog.logger.doctrine'] = $instance = new \Symfony\Bridge\Monolog\Logger('doctrine'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.event' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_EventService() + { + $this->services['monolog.logger.event'] = $instance = new \Symfony\Bridge\Monolog\Logger('event'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.php' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_PhpService() + { + $this->services['monolog.logger.php'] = $instance = new \Symfony\Bridge\Monolog\Logger('php'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.profiler' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_ProfilerService() + { + $this->services['monolog.logger.profiler'] = $instance = new \Symfony\Bridge\Monolog\Logger('profiler'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.request' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_RequestService() + { + $this->services['monolog.logger.request'] = $instance = new \Symfony\Bridge\Monolog\Logger('request'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.router' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_RouterService() + { + $this->services['monolog.logger.router'] = $instance = new \Symfony\Bridge\Monolog\Logger('router'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.security' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_SecurityService() + { + $this->services['monolog.logger.security'] = $instance = new \Symfony\Bridge\Monolog\Logger('security'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.templating' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_TemplatingService() + { + $this->services['monolog.logger.templating'] = $instance = new \Symfony\Bridge\Monolog\Logger('templating'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'monolog.logger.translation' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Monolog\Logger A Symfony\Bridge\Monolog\Logger instance. + */ + protected function getMonolog_Logger_TranslationService() + { + $this->services['monolog.logger.translation'] = $instance = new \Symfony\Bridge\Monolog\Logger('translation'); + + $instance->pushHandler($this->get('monolog.handler.debug')); + + return $instance; + } + + /** + * Gets the 'profiler' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\Profiler\Profiler A Symfony\Component\HttpKernel\Profiler\Profiler instance. + */ + protected function getProfilerService() + { + $a = $this->get('monolog.logger.profiler', ContainerInterface::NULL_ON_INVALID_REFERENCE); + $b = $this->get('kernel', ContainerInterface::NULL_ON_INVALID_REFERENCE); + + $c = new \Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector(); + if ($this->has('kernel')) { + $c->setKernel($b); + } + + $d = new \Doctrine\Bundle\DoctrineBundle\DataCollector\DoctrineDataCollector($this->get('doctrine')); + $d->addLogger('default', $this->get('doctrine.dbal.logger.profiling.default')); + + $this->services['profiler'] = $instance = new \Symfony\Component\HttpKernel\Profiler\Profiler(new \Symfony\Component\HttpKernel\Profiler\FileProfilerStorage('file:/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/profiler', '', '', 86400), $a); + + $instance->add($c); + $instance->add($this->get('data_collector.request')); + $instance->add(new \Symfony\Bundle\FrameworkBundle\DataCollector\AjaxDataCollector()); + $instance->add(new \Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector()); + $instance->add(new \Symfony\Component\HttpKernel\DataCollector\EventDataCollector($this->get('debug.event_dispatcher', ContainerInterface::NULL_ON_INVALID_REFERENCE))); + $instance->add(new \Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector($a)); + $instance->add(new \Symfony\Component\HttpKernel\DataCollector\TimeDataCollector($b, $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE))); + $instance->add(new \Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector()); + $instance->add($this->get('data_collector.router')); + $instance->add($this->get('data_collector.form')); + $instance->add($this->get('data_collector.translation')); + $instance->add(new \Symfony\Bridge\Twig\DataCollector\TwigDataCollector($this->get('twig.profile'))); + $instance->add(new \Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector($this->get('security.token_storage', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('security.role_hierarchy'))); + $instance->add(new \Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector($this)); + $instance->add($d); + $instance->add($this->get('data_collector.dump')); + + return $instance; + } + + /** + * Gets the 'profiler_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\ProfilerListener A Symfony\Component\HttpKernel\EventListener\ProfilerListener instance. + */ + protected function getProfilerListenerService() + { + return $this->services['profiler_listener'] = new \Symfony\Component\HttpKernel\EventListener\ProfilerListener($this->get('profiler'), NULL, false, false, $this->get('request_stack')); + } + + /** + * Gets the 'property_accessor' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\PropertyAccess\PropertyAccessor A Symfony\Component\PropertyAccess\PropertyAccessor instance. + */ + protected function getPropertyAccessorService() + { + return $this->services['property_accessor'] = new \Symfony\Component\PropertyAccess\PropertyAccessor(false, false); + } + + /** + * Gets the 'request' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @throws RuntimeException always since this service is expected to be injected dynamically + * @throws InactiveScopeException when the 'request' service is requested while the 'request' scope is not active + */ + protected function getRequestService() + { + if (!isset($this->scopedServices['request'])) { + throw new InactiveScopeException('request', 'request'); + } + + throw new RuntimeException('You have requested a synthetic service ("request"). The DIC does not know how to construct this service.'); + } + + /** + * Gets the 'request_stack' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpFoundation\RequestStack A Symfony\Component\HttpFoundation\RequestStack instance. + */ + protected function getRequestStackService() + { + return $this->services['request_stack'] = new \Symfony\Component\HttpFoundation\RequestStack(); + } + + /** + * Gets the 'response_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\ResponseListener A Symfony\Component\HttpKernel\EventListener\ResponseListener instance. + */ + protected function getResponseListenerService() + { + return $this->services['response_listener'] = new \Symfony\Component\HttpKernel\EventListener\ResponseListener('UTF-8'); + } + + /** + * Gets the 'router' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Routing\Router A Symfony\Bundle\FrameworkBundle\Routing\Router instance. + */ + protected function getRouterService() + { + return $this->services['router'] = new \Symfony\Bundle\FrameworkBundle\Routing\Router($this, '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/config/routing.yml', array('cache_dir' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev', 'debug' => true, 'generator_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_dumper_class' => 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper', 'generator_cache_class' => 'appDevUrlGenerator', 'matcher_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', 'matcher_base_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', 'matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper', 'matcher_cache_class' => 'appDevUrlMatcher', 'strict_requirements' => true), $this->get('router.request_context', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('monolog.logger.router', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'router_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\RouterListener A Symfony\Component\HttpKernel\EventListener\RouterListener instance. + */ + protected function getRouterListenerService() + { + return $this->services['router_listener'] = new \Symfony\Component\HttpKernel\EventListener\RouterListener($this->get('router'), $this->get('router.request_context', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('monolog.logger.request', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('request_stack')); + } + + /** + * Gets the 'routing.loader' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader A Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader instance. + */ + protected function getRouting_LoaderService() + { + $a = $this->get('file_locator'); + $b = $this->get('annotation_reader'); + + $c = new \Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader($b); + + $d = new \Symfony\Component\Config\Loader\LoaderResolver(); + $d->addLoader(new \Symfony\Component\Routing\Loader\XmlFileLoader($a)); + $d->addLoader(new \Symfony\Component\Routing\Loader\YamlFileLoader($a)); + $d->addLoader(new \Symfony\Component\Routing\Loader\PhpFileLoader($a)); + $d->addLoader(new \Symfony\Component\Routing\Loader\AnnotationDirectoryLoader($a, $c)); + $d->addLoader(new \Symfony\Component\Routing\Loader\AnnotationFileLoader($a, $c)); + $d->addLoader($c); + $d->addLoader($this->get('chill.main.routes_loader')); + + return $this->services['routing.loader'] = new \Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader($this->get('controller_name_converter'), $this->get('monolog.logger.router', ContainerInterface::NULL_ON_INVALID_REFERENCE), $d); + } + + /** + * Gets the 'security.authentication_utils' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Http\Authentication\AuthenticationUtils A Symfony\Component\Security\Http\Authentication\AuthenticationUtils instance. + */ + protected function getSecurity_AuthenticationUtilsService() + { + return $this->services['security.authentication_utils'] = new \Symfony\Component\Security\Http\Authentication\AuthenticationUtils($this->get('request_stack')); + } + + /** + * Gets the 'security.authorization_checker' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Core\Authorization\AuthorizationChecker A Symfony\Component\Security\Core\Authorization\AuthorizationChecker instance. + */ + protected function getSecurity_AuthorizationCheckerService() + { + return $this->services['security.authorization_checker'] = new \Symfony\Component\Security\Core\Authorization\AuthorizationChecker($this->get('security.token_storage'), $this->get('security.authentication.manager'), $this->get('security.access.decision_manager'), false); + } + + /** + * Gets the 'security.context' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Core\SecurityContext A Symfony\Component\Security\Core\SecurityContext instance. + */ + protected function getSecurity_ContextService() + { + return $this->services['security.context'] = new \Symfony\Component\Security\Core\SecurityContext($this->get('security.token_storage'), $this->get('security.authorization_checker')); + } + + /** + * Gets the 'security.csrf.token_manager' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Csrf\CsrfTokenManager A Symfony\Component\Security\Csrf\CsrfTokenManager instance. + */ + protected function getSecurity_Csrf_TokenManagerService() + { + return $this->services['security.csrf.token_manager'] = new \Symfony\Component\Security\Csrf\CsrfTokenManager(new \Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator($this->get('security.secure_random')), new \Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage($this->get('session'))); + } + + /** + * Gets the 'security.encoder_factory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Core\Encoder\EncoderFactory A Symfony\Component\Security\Core\Encoder\EncoderFactory instance. + */ + protected function getSecurity_EncoderFactoryService() + { + return $this->services['security.encoder_factory'] = new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array('Chill\\MainBundle\\Entity\\User' => array('class' => 'Symfony\\Component\\Security\\Core\\Encoder\\BCryptPasswordEncoder', 'arguments' => array(0 => 13)), 'Symfony\\Component\\Security\\Core\\User\\User' => array('class' => 'Symfony\\Component\\Security\\Core\\Encoder\\PlaintextPasswordEncoder', 'arguments' => array(0 => false)))); + } + + /** + * Gets the 'security.firewall' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Http\Firewall A Symfony\Component\Security\Http\Firewall instance. + */ + protected function getSecurity_FirewallService() + { + return $this->services['security.firewall'] = new \Symfony\Component\Security\Http\Firewall(new \Symfony\Bundle\SecurityBundle\Security\FirewallMap($this, array('security.firewall.map.context.dev' => new \Symfony\Component\HttpFoundation\RequestMatcher('^/(_(profiler|wdt)|css|images|js)/'), 'security.firewall.map.context.default' => NULL)), $this->get('debug.event_dispatcher')); + } + + /** + * Gets the 'security.firewall.map.context.default' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\SecurityBundle\Security\FirewallContext A Symfony\Bundle\SecurityBundle\Security\FirewallContext instance. + */ + protected function getSecurity_Firewall_Map_Context_DefaultService() + { + $a = $this->get('monolog.logger.security', ContainerInterface::NULL_ON_INVALID_REFERENCE); + $b = $this->get('security.token_storage'); + $c = $this->get('debug.event_dispatcher', ContainerInterface::NULL_ON_INVALID_REFERENCE); + $d = $this->get('router', ContainerInterface::NULL_ON_INVALID_REFERENCE); + $e = $this->get('http_kernel'); + $f = $this->get('security.authentication.manager'); + + $g = new \Symfony\Component\Security\Http\AccessMap(); + + $h = new \Symfony\Component\Security\Http\HttpUtils($d, $d); + + $i = new \Symfony\Component\Security\Http\Firewall\LogoutListener($b, $h, new \Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler($h, '/'), array('csrf_parameter' => '_csrf_token', 'intention' => 'logout', 'logout_path' => '/logout')); + $i->addHandler(new \Symfony\Component\Security\Http\Logout\SessionLogoutHandler()); + + $j = new \Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler($h, array()); + $j->setOptions(array('always_use_default_target_path' => false, 'default_target_path' => '/', 'login_path' => '/login', 'target_path_parameter' => '_target_path', 'use_referer' => false)); + $j->setProviderKey('default'); + + $k = new \Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler($e, $h, array(), $a); + $k->setOptions(array('login_path' => '/login', 'failure_path' => NULL, 'failure_forward' => false, 'failure_path_parameter' => '_failure_path')); + + return $this->services['security.firewall.map.context.default'] = new \Symfony\Bundle\SecurityBundle\Security\FirewallContext(array(0 => new \Symfony\Component\Security\Http\Firewall\ChannelListener($g, new \Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint(80, 443), $a), 1 => new \Symfony\Component\Security\Http\Firewall\ContextListener($b, array(0 => $this->get('security.user.provider.concrete.chain_provider'), 1 => $this->get('security.user.provider.concrete.in_memory'), 2 => $this->get('security.user.provider.concrete.users')), 'default', $a, $c), 2 => $i, 3 => new \Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener($b, $f, new \Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy('migrate'), $h, 'default', $j, $k, array('csrf_parameter' => '_csrf_token', 'intention' => 'authenticate', 'check_path' => '/login_check', 'use_forward' => false, 'require_previous_session' => true, 'username_parameter' => '_username', 'password_parameter' => '_password', 'post_only' => true), $a, $c, $this->get('form.csrf_provider')), 4 => new \Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener($b, '5593aedf3be85', $a, $f), 5 => new \Symfony\Component\Security\Http\Firewall\AccessListener($b, $this->get('security.access.decision_manager'), $g, $f)), new \Symfony\Component\Security\Http\Firewall\ExceptionListener($b, $this->get('security.authentication.trust_resolver'), $h, 'default', new \Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint($e, $h, '/login', false), NULL, NULL, $a)); + } + + /** + * Gets the 'security.firewall.map.context.dev' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\SecurityBundle\Security\FirewallContext A Symfony\Bundle\SecurityBundle\Security\FirewallContext instance. + */ + protected function getSecurity_Firewall_Map_Context_DevService() + { + return $this->services['security.firewall.map.context.dev'] = new \Symfony\Bundle\SecurityBundle\Security\FirewallContext(array(), NULL); + } + + /** + * Gets the 'security.password_encoder' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Core\Encoder\UserPasswordEncoder A Symfony\Component\Security\Core\Encoder\UserPasswordEncoder instance. + */ + protected function getSecurity_PasswordEncoderService() + { + return $this->services['security.password_encoder'] = new \Symfony\Component\Security\Core\Encoder\UserPasswordEncoder($this->get('security.encoder_factory')); + } + + /** + * Gets the 'security.rememberme.response_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Http\RememberMe\ResponseListener A Symfony\Component\Security\Http\RememberMe\ResponseListener instance. + */ + protected function getSecurity_Rememberme_ResponseListenerService() + { + return $this->services['security.rememberme.response_listener'] = new \Symfony\Component\Security\Http\RememberMe\ResponseListener(); + } + + /** + * Gets the 'security.secure_random' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Core\Util\SecureRandom A Symfony\Component\Security\Core\Util\SecureRandom instance. + */ + protected function getSecurity_SecureRandomService() + { + return $this->services['security.secure_random'] = new \Symfony\Component\Security\Core\Util\SecureRandom('/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/secure_random.seed', $this->get('monolog.logger.security', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'security.token_storage' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage A Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage instance. + */ + protected function getSecurity_TokenStorageService() + { + return $this->services['security.token_storage'] = new \Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage(); + } + + /** + * Gets the 'security.validator.user_password' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator A Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator instance. + */ + protected function getSecurity_Validator_UserPasswordService() + { + return $this->services['security.validator.user_password'] = new \Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator($this->get('security.token_storage'), $this->get('security.encoder_factory')); + } + + /** + * Gets the 'sensio_distribution.security_checker' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \SensioLabs\Security\SecurityChecker A SensioLabs\Security\SecurityChecker instance. + */ + protected function getSensioDistribution_SecurityCheckerService() + { + return $this->services['sensio_distribution.security_checker'] = new \SensioLabs\Security\SecurityChecker(); + } + + /** + * Gets the 'sensio_distribution.security_checker.command' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \SensioLabs\Security\Command\SecurityCheckerCommand A SensioLabs\Security\Command\SecurityCheckerCommand instance. + */ + protected function getSensioDistribution_SecurityChecker_CommandService() + { + return $this->services['sensio_distribution.security_checker.command'] = new \SensioLabs\Security\Command\SecurityCheckerCommand($this->get('sensio_distribution.security_checker')); + } + + /** + * Gets the 'sensio_distribution.webconfigurator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\DistributionBundle\Configurator\Configurator A Sensio\Bundle\DistributionBundle\Configurator\Configurator instance. + */ + protected function getSensioDistribution_WebconfiguratorService() + { + $this->services['sensio_distribution.webconfigurator'] = $instance = new \Sensio\Bundle\DistributionBundle\Configurator\Configurator('/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app'); + + $instance->addStep(new \Sensio\Bundle\DistributionBundle\Configurator\Step\DoctrineStep(), 10); + $instance->addStep(new \Sensio\Bundle\DistributionBundle\Configurator\Step\SecretStep(), 0); + + return $instance; + } + + /** + * Gets the 'sensio_framework_extra.cache.listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener A Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener instance. + */ + protected function getSensioFrameworkExtra_Cache_ListenerService() + { + return $this->services['sensio_framework_extra.cache.listener'] = new \Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener(); + } + + /** + * Gets the 'sensio_framework_extra.controller.listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener A Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener instance. + */ + protected function getSensioFrameworkExtra_Controller_ListenerService() + { + return $this->services['sensio_framework_extra.controller.listener'] = new \Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener($this->get('annotation_reader')); + } + + /** + * Gets the 'sensio_framework_extra.converter.datetime' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter A Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter instance. + */ + protected function getSensioFrameworkExtra_Converter_DatetimeService() + { + return $this->services['sensio_framework_extra.converter.datetime'] = new \Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter(); + } + + /** + * Gets the 'sensio_framework_extra.converter.doctrine.orm' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter A Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter instance. + */ + protected function getSensioFrameworkExtra_Converter_Doctrine_OrmService() + { + return $this->services['sensio_framework_extra.converter.doctrine.orm'] = new \Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter($this->get('doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'sensio_framework_extra.converter.listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener A Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener instance. + */ + protected function getSensioFrameworkExtra_Converter_ListenerService() + { + return $this->services['sensio_framework_extra.converter.listener'] = new \Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener($this->get('sensio_framework_extra.converter.manager'), true); + } + + /** + * Gets the 'sensio_framework_extra.converter.manager' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager A Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager instance. + */ + protected function getSensioFrameworkExtra_Converter_ManagerService() + { + $this->services['sensio_framework_extra.converter.manager'] = $instance = new \Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager(); + + $instance->add($this->get('sensio_framework_extra.converter.doctrine.orm'), 0, 'doctrine.orm'); + $instance->add($this->get('sensio_framework_extra.converter.datetime'), 0, 'datetime'); + + return $instance; + } + + /** + * Gets the 'sensio_framework_extra.security.listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener A Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener instance. + */ + protected function getSensioFrameworkExtra_Security_ListenerService() + { + return $this->services['sensio_framework_extra.security.listener'] = new \Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener(NULL, new \Sensio\Bundle\FrameworkExtraBundle\Security\ExpressionLanguage(), $this->get('security.authentication.trust_resolver', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('security.role_hierarchy', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('security.token_storage', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('security.authorization_checker', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'sensio_framework_extra.view.guesser' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser A Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser instance. + */ + protected function getSensioFrameworkExtra_View_GuesserService() + { + return $this->services['sensio_framework_extra.view.guesser'] = new \Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser($this->get('kernel')); + } + + /** + * Gets the 'sensio_framework_extra.view.listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener A Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener instance. + */ + protected function getSensioFrameworkExtra_View_ListenerService() + { + return $this->services['sensio_framework_extra.view.listener'] = new \Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener($this); + } + + /** + * Gets the 'service_container' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @throws RuntimeException always since this service is expected to be injected dynamically + */ + protected function getServiceContainerService() + { + throw new RuntimeException('You have requested a synthetic service ("service_container"). The DIC does not know how to construct this service.'); + } + + /** + * Gets the 'session' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpFoundation\Session\Session A Symfony\Component\HttpFoundation\Session\Session instance. + */ + protected function getSessionService() + { + return $this->services['session'] = new \Symfony\Component\HttpFoundation\Session\Session($this->get('session.storage.filesystem'), new \Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag(), new \Symfony\Component\HttpFoundation\Session\Flash\FlashBag()); + } + + /** + * Gets the 'session.handler' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler A Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler instance. + */ + protected function getSession_HandlerService() + { + return $this->services['session.handler'] = new \Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler('/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/sessions'); + } + + /** + * Gets the 'session.save_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\SaveSessionListener A Symfony\Component\HttpKernel\EventListener\SaveSessionListener instance. + */ + protected function getSession_SaveListenerService() + { + return $this->services['session.save_listener'] = new \Symfony\Component\HttpKernel\EventListener\SaveSessionListener(); + } + + /** + * Gets the 'session.storage.filesystem' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage A Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage instance. + */ + protected function getSession_Storage_FilesystemService() + { + return $this->services['session.storage.filesystem'] = new \Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage('/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/sessions', 'MOCKSESSID', $this->get('session.storage.metadata_bag')); + } + + /** + * Gets the 'session.storage.native' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage A Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage instance. + */ + protected function getSession_Storage_NativeService() + { + return $this->services['session.storage.native'] = new \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage(array('gc_probability' => 1), $this->get('session.handler'), $this->get('session.storage.metadata_bag')); + } + + /** + * Gets the 'session.storage.php_bridge' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage A Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage instance. + */ + protected function getSession_Storage_PhpBridgeService() + { + return $this->services['session.storage.php_bridge'] = new \Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage($this->get('session.handler'), $this->get('session.storage.metadata_bag')); + } + + /** + * Gets the 'session_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\EventListener\SessionListener A Symfony\Bundle\FrameworkBundle\EventListener\SessionListener instance. + */ + protected function getSessionListenerService() + { + return $this->services['session_listener'] = new \Symfony\Bundle\FrameworkBundle\EventListener\SessionListener($this); + } + + /** + * Gets the 'streamed_response_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\StreamedResponseListener A Symfony\Component\HttpKernel\EventListener\StreamedResponseListener instance. + */ + protected function getStreamedResponseListenerService() + { + return $this->services['streamed_response_listener'] = new \Symfony\Component\HttpKernel\EventListener\StreamedResponseListener(); + } + + /** + * Gets the 'swiftmailer.email_sender.listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener A Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener instance. + */ + protected function getSwiftmailer_EmailSender_ListenerService() + { + return $this->services['swiftmailer.email_sender.listener'] = new \Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener($this, $this->get('logger', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'swiftmailer.mailer.default' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Swift_Mailer A Swift_Mailer instance. + */ + protected function getSwiftmailer_Mailer_DefaultService() + { + return $this->services['swiftmailer.mailer.default'] = new \Swift_Mailer($this->get('swiftmailer.mailer.default.transport')); + } + + /** + * Gets the 'swiftmailer.mailer.default.plugin.messagelogger' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Swift_Plugins_MessageLogger A Swift_Plugins_MessageLogger instance. + */ + protected function getSwiftmailer_Mailer_Default_Plugin_MessageloggerService() + { + return $this->services['swiftmailer.mailer.default.plugin.messagelogger'] = new \Swift_Plugins_MessageLogger(); + } + + /** + * Gets the 'swiftmailer.mailer.default.transport' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Swift_Transport_EsmtpTransport A Swift_Transport_EsmtpTransport instance. + */ + protected function getSwiftmailer_Mailer_Default_TransportService() + { + $a = new \Swift_Transport_Esmtp_AuthHandler(array(0 => new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), 1 => new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), 2 => new \Swift_Transport_Esmtp_Auth_PlainAuthenticator())); + $a->setUsername(NULL); + $a->setPassword(NULL); + $a->setAuthMode(NULL); + + $this->services['swiftmailer.mailer.default.transport'] = $instance = new \Swift_Transport_EsmtpTransport(new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory()), array(0 => $a), new \Swift_Events_SimpleEventDispatcher()); + + $instance->setHost('localhost'); + $instance->setPort(25); + $instance->setEncryption(NULL); + $instance->setTimeout(30); + $instance->setSourceIp(NULL); + $instance->registerPlugin($this->get('swiftmailer.mailer.default.plugin.messagelogger')); + + return $instance; + } + + /** + * Gets the 'templating' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\TwigBundle\TwigEngine A Symfony\Bundle\TwigBundle\TwigEngine instance. + */ + protected function getTemplatingService() + { + return $this->services['templating'] = new \Symfony\Bundle\TwigBundle\TwigEngine($this->get('twig'), $this->get('templating.name_parser'), $this->get('templating.locator')); + } + + /** + * Gets the 'templating.filename_parser' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser A Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser instance. + */ + protected function getTemplating_FilenameParserService() + { + return $this->services['templating.filename_parser'] = new \Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser(); + } + + /** + * Gets the 'templating.helper.assets' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper A Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper instance. + */ + protected function getTemplating_Helper_AssetsService() + { + return $this->services['templating.helper.assets'] = new \Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper($this->get('assets.packages'), array()); + } + + /** + * Gets the 'templating.helper.logout_url' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper A Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper instance. + */ + protected function getTemplating_Helper_LogoutUrlService() + { + return $this->services['templating.helper.logout_url'] = new \Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper($this->get('security.logout_url_generator')); + } + + /** + * Gets the 'templating.helper.router' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper A Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper instance. + */ + protected function getTemplating_Helper_RouterService() + { + return $this->services['templating.helper.router'] = new \Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper($this->get('router')); + } + + /** + * Gets the 'templating.helper.security' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper A Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper instance. + */ + protected function getTemplating_Helper_SecurityService() + { + return $this->services['templating.helper.security'] = new \Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper($this->get('security.authorization_checker', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'templating.loader' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader A Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader instance. + */ + protected function getTemplating_LoaderService() + { + return $this->services['templating.loader'] = new \Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader($this->get('templating.locator')); + } + + /** + * Gets the 'templating.name_parser' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser A Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser instance. + */ + protected function getTemplating_NameParserService() + { + return $this->services['templating.name_parser'] = new \Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser($this->get('kernel')); + } + + /** + * Gets the 'test.client' service. + * + * @return \Symfony\Bundle\FrameworkBundle\Client A Symfony\Bundle\FrameworkBundle\Client instance. + */ + protected function getTest_ClientService() + { + return new \Symfony\Bundle\FrameworkBundle\Client($this->get('kernel'), array(), new \Symfony\Component\BrowserKit\History(), new \Symfony\Component\BrowserKit\CookieJar()); + } + + /** + * Gets the 'test.client.cookiejar' service. + * + * @return \Symfony\Component\BrowserKit\CookieJar A Symfony\Component\BrowserKit\CookieJar instance. + */ + protected function getTest_Client_CookiejarService() + { + return new \Symfony\Component\BrowserKit\CookieJar(); + } + + /** + * Gets the 'test.client.history' service. + * + * @return \Symfony\Component\BrowserKit\History A Symfony\Component\BrowserKit\History instance. + */ + protected function getTest_Client_HistoryService() + { + return new \Symfony\Component\BrowserKit\History(); + } + + /** + * Gets the 'test.session.listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener A Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener instance. + */ + protected function getTest_Session_ListenerService() + { + return $this->services['test.session.listener'] = new \Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener($this); + } + + /** + * Gets the 'translation.dumper.csv' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\CsvFileDumper A Symfony\Component\Translation\Dumper\CsvFileDumper instance. + */ + protected function getTranslation_Dumper_CsvService() + { + return $this->services['translation.dumper.csv'] = new \Symfony\Component\Translation\Dumper\CsvFileDumper(); + } + + /** + * Gets the 'translation.dumper.ini' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\IniFileDumper A Symfony\Component\Translation\Dumper\IniFileDumper instance. + */ + protected function getTranslation_Dumper_IniService() + { + return $this->services['translation.dumper.ini'] = new \Symfony\Component\Translation\Dumper\IniFileDumper(); + } + + /** + * Gets the 'translation.dumper.json' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\JsonFileDumper A Symfony\Component\Translation\Dumper\JsonFileDumper instance. + */ + protected function getTranslation_Dumper_JsonService() + { + return $this->services['translation.dumper.json'] = new \Symfony\Component\Translation\Dumper\JsonFileDumper(); + } + + /** + * Gets the 'translation.dumper.mo' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\MoFileDumper A Symfony\Component\Translation\Dumper\MoFileDumper instance. + */ + protected function getTranslation_Dumper_MoService() + { + return $this->services['translation.dumper.mo'] = new \Symfony\Component\Translation\Dumper\MoFileDumper(); + } + + /** + * Gets the 'translation.dumper.php' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\PhpFileDumper A Symfony\Component\Translation\Dumper\PhpFileDumper instance. + */ + protected function getTranslation_Dumper_PhpService() + { + return $this->services['translation.dumper.php'] = new \Symfony\Component\Translation\Dumper\PhpFileDumper(); + } + + /** + * Gets the 'translation.dumper.po' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\PoFileDumper A Symfony\Component\Translation\Dumper\PoFileDumper instance. + */ + protected function getTranslation_Dumper_PoService() + { + return $this->services['translation.dumper.po'] = new \Symfony\Component\Translation\Dumper\PoFileDumper(); + } + + /** + * Gets the 'translation.dumper.qt' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\QtFileDumper A Symfony\Component\Translation\Dumper\QtFileDumper instance. + */ + protected function getTranslation_Dumper_QtService() + { + return $this->services['translation.dumper.qt'] = new \Symfony\Component\Translation\Dumper\QtFileDumper(); + } + + /** + * Gets the 'translation.dumper.res' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\IcuResFileDumper A Symfony\Component\Translation\Dumper\IcuResFileDumper instance. + */ + protected function getTranslation_Dumper_ResService() + { + return $this->services['translation.dumper.res'] = new \Symfony\Component\Translation\Dumper\IcuResFileDumper(); + } + + /** + * Gets the 'translation.dumper.xliff' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\XliffFileDumper A Symfony\Component\Translation\Dumper\XliffFileDumper instance. + */ + protected function getTranslation_Dumper_XliffService() + { + return $this->services['translation.dumper.xliff'] = new \Symfony\Component\Translation\Dumper\XliffFileDumper(); + } + + /** + * Gets the 'translation.dumper.yml' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Dumper\YamlFileDumper A Symfony\Component\Translation\Dumper\YamlFileDumper instance. + */ + protected function getTranslation_Dumper_YmlService() + { + return $this->services['translation.dumper.yml'] = new \Symfony\Component\Translation\Dumper\YamlFileDumper(); + } + + /** + * Gets the 'translation.extractor' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Extractor\ChainExtractor A Symfony\Component\Translation\Extractor\ChainExtractor instance. + */ + protected function getTranslation_ExtractorService() + { + $this->services['translation.extractor'] = $instance = new \Symfony\Component\Translation\Extractor\ChainExtractor(); + + $instance->addExtractor('php', $this->get('translation.extractor.php')); + $instance->addExtractor('twig', $this->get('twig.translation.extractor')); + + return $instance; + } + + /** + * Gets the 'translation.extractor.php' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor A Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor instance. + */ + protected function getTranslation_Extractor_PhpService() + { + return $this->services['translation.extractor.php'] = new \Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor(); + } + + /** + * Gets the 'translation.loader' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader A Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader instance. + */ + protected function getTranslation_LoaderService() + { + $a = $this->get('translation.loader.xliff'); + + $this->services['translation.loader'] = $instance = new \Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader(); + + $instance->addLoader('php', $this->get('translation.loader.php')); + $instance->addLoader('yml', $this->get('translation.loader.yml')); + $instance->addLoader('xlf', $a); + $instance->addLoader('xliff', $a); + $instance->addLoader('po', $this->get('translation.loader.po')); + $instance->addLoader('mo', $this->get('translation.loader.mo')); + $instance->addLoader('ts', $this->get('translation.loader.qt')); + $instance->addLoader('csv', $this->get('translation.loader.csv')); + $instance->addLoader('res', $this->get('translation.loader.res')); + $instance->addLoader('dat', $this->get('translation.loader.dat')); + $instance->addLoader('ini', $this->get('translation.loader.ini')); + $instance->addLoader('json', $this->get('translation.loader.json')); + + return $instance; + } + + /** + * Gets the 'translation.loader.csv' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\CsvFileLoader A Symfony\Component\Translation\Loader\CsvFileLoader instance. + */ + protected function getTranslation_Loader_CsvService() + { + return $this->services['translation.loader.csv'] = new \Symfony\Component\Translation\Loader\CsvFileLoader(); + } + + /** + * Gets the 'translation.loader.dat' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\IcuDatFileLoader A Symfony\Component\Translation\Loader\IcuDatFileLoader instance. + */ + protected function getTranslation_Loader_DatService() + { + return $this->services['translation.loader.dat'] = new \Symfony\Component\Translation\Loader\IcuDatFileLoader(); + } + + /** + * Gets the 'translation.loader.ini' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\IniFileLoader A Symfony\Component\Translation\Loader\IniFileLoader instance. + */ + protected function getTranslation_Loader_IniService() + { + return $this->services['translation.loader.ini'] = new \Symfony\Component\Translation\Loader\IniFileLoader(); + } + + /** + * Gets the 'translation.loader.json' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\JsonFileLoader A Symfony\Component\Translation\Loader\JsonFileLoader instance. + */ + protected function getTranslation_Loader_JsonService() + { + return $this->services['translation.loader.json'] = new \Symfony\Component\Translation\Loader\JsonFileLoader(); + } + + /** + * Gets the 'translation.loader.mo' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\MoFileLoader A Symfony\Component\Translation\Loader\MoFileLoader instance. + */ + protected function getTranslation_Loader_MoService() + { + return $this->services['translation.loader.mo'] = new \Symfony\Component\Translation\Loader\MoFileLoader(); + } + + /** + * Gets the 'translation.loader.php' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\PhpFileLoader A Symfony\Component\Translation\Loader\PhpFileLoader instance. + */ + protected function getTranslation_Loader_PhpService() + { + return $this->services['translation.loader.php'] = new \Symfony\Component\Translation\Loader\PhpFileLoader(); + } + + /** + * Gets the 'translation.loader.po' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\PoFileLoader A Symfony\Component\Translation\Loader\PoFileLoader instance. + */ + protected function getTranslation_Loader_PoService() + { + return $this->services['translation.loader.po'] = new \Symfony\Component\Translation\Loader\PoFileLoader(); + } + + /** + * Gets the 'translation.loader.qt' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\QtFileLoader A Symfony\Component\Translation\Loader\QtFileLoader instance. + */ + protected function getTranslation_Loader_QtService() + { + return $this->services['translation.loader.qt'] = new \Symfony\Component\Translation\Loader\QtFileLoader(); + } + + /** + * Gets the 'translation.loader.res' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\IcuResFileLoader A Symfony\Component\Translation\Loader\IcuResFileLoader instance. + */ + protected function getTranslation_Loader_ResService() + { + return $this->services['translation.loader.res'] = new \Symfony\Component\Translation\Loader\IcuResFileLoader(); + } + + /** + * Gets the 'translation.loader.xliff' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\XliffFileLoader A Symfony\Component\Translation\Loader\XliffFileLoader instance. + */ + protected function getTranslation_Loader_XliffService() + { + return $this->services['translation.loader.xliff'] = new \Symfony\Component\Translation\Loader\XliffFileLoader(); + } + + /** + * Gets the 'translation.loader.yml' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Loader\YamlFileLoader A Symfony\Component\Translation\Loader\YamlFileLoader instance. + */ + protected function getTranslation_Loader_YmlService() + { + return $this->services['translation.loader.yml'] = new \Symfony\Component\Translation\Loader\YamlFileLoader(); + } + + /** + * Gets the 'translation.writer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\Writer\TranslationWriter A Symfony\Component\Translation\Writer\TranslationWriter instance. + */ + protected function getTranslation_WriterService() + { + $this->services['translation.writer'] = $instance = new \Symfony\Component\Translation\Writer\TranslationWriter(); + + $instance->addDumper('php', $this->get('translation.dumper.php')); + $instance->addDumper('xlf', $this->get('translation.dumper.xliff')); + $instance->addDumper('po', $this->get('translation.dumper.po')); + $instance->addDumper('mo', $this->get('translation.dumper.mo')); + $instance->addDumper('yml', $this->get('translation.dumper.yml')); + $instance->addDumper('ts', $this->get('translation.dumper.qt')); + $instance->addDumper('csv', $this->get('translation.dumper.csv')); + $instance->addDumper('ini', $this->get('translation.dumper.ini')); + $instance->addDumper('json', $this->get('translation.dumper.json')); + $instance->addDumper('res', $this->get('translation.dumper.res')); + + return $instance; + } + + /** + * Gets the 'translator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Translation\DataCollectorTranslator A Symfony\Component\Translation\DataCollectorTranslator instance. + */ + protected function getTranslatorService() + { + return $this->services['translator'] = new \Symfony\Component\Translation\DataCollectorTranslator(new \Symfony\Component\Translation\LoggingTranslator($this->get('translator.default'), $this->get('monolog.logger.translation'))); + } + + /** + * Gets the 'translator.default' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\FrameworkBundle\Translation\Translator A Symfony\Bundle\FrameworkBundle\Translation\Translator instance. + */ + protected function getTranslator_DefaultService() + { + $this->services['translator.default'] = $instance = new \Symfony\Bundle\FrameworkBundle\Translation\Translator($this, new \Symfony\Component\Translation\MessageSelector(), array('translation.loader.php' => array(0 => 'php'), 'translation.loader.yml' => array(0 => 'yml'), 'translation.loader.xliff' => array(0 => 'xlf', 1 => 'xliff'), 'translation.loader.po' => array(0 => 'po'), 'translation.loader.mo' => array(0 => 'mo'), 'translation.loader.qt' => array(0 => 'ts'), 'translation.loader.csv' => array(0 => 'csv'), 'translation.loader.res' => array(0 => 'res'), 'translation.loader.dat' => array(0 => 'dat'), 'translation.loader.ini' => array(0 => 'ini'), 'translation.loader.json' => array(0 => 'json')), array('cache_dir' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/translations', 'debug' => true, 'resource_files' => array('af' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf'), 'ar' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ar.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ar.xlf'), 'az' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.az.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.az.xlf'), 'bg' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.bg.xlf'), 'ca' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ca.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ca.xlf'), 'cs' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.cs.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.cs.xlf'), 'cy' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf'), 'da' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.da.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.da.xlf'), 'de' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.de.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.de.xlf'), 'el' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.el.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.el.xlf'), 'en' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.en.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.en.xlf', 3 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/messages.en.yml'), 'es' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.es.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.es.xlf'), 'et' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.et.xlf'), 'eu' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.eu.xlf'), 'fa' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fa.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.fa.xlf'), 'fi' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fi.xlf'), 'fr' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fr.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.fr.xlf', 3 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/translations/messages.fr.yml', 4 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/translations/messages.fr.yml', 5 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/messages.fr.yml', 6 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/validators.fr.yml', 7 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/translations/messages.fr.xlf'), 'gl' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.gl.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.gl.xlf'), 'he' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.he.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.he.xlf'), 'hr' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf'), 'hu' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hu.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.hu.xlf'), 'hy' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hy.xlf'), 'id' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.id.xlf'), 'it' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.it.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.it.xlf'), 'ja' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ja.xlf'), 'lb' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lb.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.lb.xlf'), 'lt' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lt.xlf'), 'mn' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.mn.xlf'), 'nb' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.nb.xlf'), 'nl' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.nl.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.nl.xlf', 3 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/translations/messages.nl.yml', 4 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/translations/messages.nl.yml', 5 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/messages.nl.yml', 6 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/validators.nl.yml'), 'no' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.no.xlf'), 'pl' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pl.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.pl.xlf'), 'pt' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt.xlf'), 'pt_BR' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt_BR.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.pt_BR.xlf'), 'ro' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ro.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ro.xlf'), 'ru' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ru.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ru.xlf'), 'sk' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sk.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sk.xlf'), 'sl' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sl.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sl.xlf'), 'sq' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf'), 'sr_Cyrl' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Cyrl.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sr_Cyrl.xlf'), 'sr_Latn' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Latn.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sr_Latn.xlf'), 'sv' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf', 2 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sv.xlf'), 'th' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf'), 'tr' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.tr.xlf'), 'uk' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.uk.xlf'), 'vi' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf'), 'zh_CN' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf', 1 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.zh_CN.xlf'), 'zh_TW' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf'), 'lv' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lv.xlf'), 'pt_PT' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.pt_PT.xlf'), 'ua' => array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ua.xlf'))), array()); + + $instance->setFallbackLocales(array(0 => 'fr')); + + return $instance; + } + + /** + * Gets the 'translator_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\TranslatorListener A Symfony\Component\HttpKernel\EventListener\TranslatorListener instance. + */ + protected function getTranslatorListenerService() + { + return $this->services['translator_listener'] = new \Symfony\Component\HttpKernel\EventListener\TranslatorListener($this->get('translator'), $this->get('request_stack')); + } + + /** + * Gets the 'twig' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Twig_Environment A Twig_Environment instance. + */ + protected function getTwigService() + { + $a = $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE); + $b = $this->get('request_stack'); + $c = $this->get('fragment.handler'); + + $d = new \Symfony\Bridge\Twig\Extension\HttpFoundationExtension($b); + + $e = new \Symfony\Bridge\Twig\AppVariable(); + $e->setEnvironment('dev'); + $e->setDebug(true); + if ($this->has('security.token_storage')) { + $e->setTokenStorage($this->get('security.token_storage', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + if ($this->has('request_stack')) { + $e->setRequestStack($b); + } + $e->setContainer($this); + + $this->services['twig'] = $instance = new \Twig_Environment($this->get('twig.loader'), array('form_themes' => array(0 => 'form_div_layout.html.twig', 1 => 'ChillCustomFieldsBundle:Form:fields.html.twig', 2 => 'ChillMainBundle:Form:fields.html.twig'), 'exception_controller' => 'twig.controller.exception:showAction', 'autoescape' => 'filename', 'cache' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/twig', 'charset' => 'UTF-8', 'debug' => true, 'paths' => array(), 'date' => array('format' => 'F j, Y H:i', 'interval_format' => '%d days', 'timezone' => NULL), 'number_format' => array('decimals' => 0, 'decimal_point' => '.', 'thousands_separator' => ','))); + + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\LogoutUrlExtension($this->get('security.logout_url_generator'))); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\SecurityExtension($this->get('security.authorization_checker', ContainerInterface::NULL_ON_INVALID_REFERENCE))); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\ProfilerExtension($this->get('twig.profile'), $a)); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\TranslationExtension($this->get('translator'))); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\AssetExtension($this->get('assets.packages'), $d)); + $instance->addExtension(new \Symfony\Bundle\TwigBundle\Extension\ActionsExtension($c)); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\CodeExtension(NULL, '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app', 'UTF-8')); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\RoutingExtension($this->get('router'))); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\YamlExtension()); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\StopwatchExtension($a, true)); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\ExpressionExtension()); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\HttpKernelExtension($c)); + $instance->addExtension($d); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\FormExtension(new \Symfony\Bridge\Twig\Form\TwigRenderer(new \Symfony\Bridge\Twig\Form\TwigRendererEngine(array(0 => 'form_div_layout.html.twig', 1 => 'ChillCustomFieldsBundle:Form:fields.html.twig', 2 => 'ChillMainBundle:Form:fields.html.twig')), $this->get('security.csrf.token_manager', ContainerInterface::NULL_ON_INVALID_REFERENCE)))); + $instance->addExtension(new \Twig_Extension_Debug()); + $instance->addExtension(new \Symfony\Bundle\AsseticBundle\Twig\AsseticExtension($this->get('assetic.asset_factory'), $this->get('templating.name_parser'), false, array(), array(0 => 'ChillPersonBundle', 1 => 'ChillMainBundle'), new \Symfony\Bundle\AsseticBundle\DefaultValueSupplier($this))); + $instance->addExtension(new \Doctrine\Bundle\DoctrineBundle\Twig\DoctrineExtension()); + $instance->addExtension($this->get('chill.main.twig.chill_menu')); + $instance->addExtension($this->get('twig_intl')); + $instance->addExtension($this->get('chill.main.twig.translatable_string')); + $instance->addExtension($this->get('chill.main.twig.csv_cell')); + $instance->addExtension($this->get('chill.custom_field.twig.custom_fields_rendering')); + $instance->addExtension(new \Symfony\Bridge\Twig\Extension\DumpExtension($this->get('var_dumper.cloner'))); + $instance->addExtension(new \Symfony\Bundle\WebProfilerBundle\Twig\WebProfilerExtension()); + $instance->addGlobal('app', $e); + $instance->addGlobal('installation', array('name' => 'Chill')); + $instance->addGlobal('available_languages', array(0 => 'fr')); + call_user_func(array(new \Symfony\Bundle\TwigBundle\DependencyInjection\Configurator\EnvironmentConfigurator('F j, Y H:i', '%d days', NULL, 0, '.', ','), 'configure'), $instance); + + return $instance; + } + + /** + * Gets the 'twig.controller.exception' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\TwigBundle\Controller\ExceptionController A Symfony\Bundle\TwigBundle\Controller\ExceptionController instance. + */ + protected function getTwig_Controller_ExceptionService() + { + return $this->services['twig.controller.exception'] = new \Symfony\Bundle\TwigBundle\Controller\ExceptionController($this->get('twig'), true); + } + + /** + * Gets the 'twig.controller.preview_error' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\TwigBundle\Controller\PreviewErrorController A Symfony\Bundle\TwigBundle\Controller\PreviewErrorController instance. + */ + protected function getTwig_Controller_PreviewErrorService() + { + return $this->services['twig.controller.preview_error'] = new \Symfony\Bundle\TwigBundle\Controller\PreviewErrorController($this->get('http_kernel'), 'twig.controller.exception:showAction'); + } + + /** + * Gets the 'twig.exception_listener' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\EventListener\ExceptionListener A Symfony\Component\HttpKernel\EventListener\ExceptionListener instance. + */ + protected function getTwig_ExceptionListenerService() + { + return $this->services['twig.exception_listener'] = new \Symfony\Component\HttpKernel\EventListener\ExceptionListener('twig.controller.exception:showAction', $this->get('monolog.logger.request', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'twig.loader' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\TwigBundle\Loader\FilesystemLoader A Symfony\Bundle\TwigBundle\Loader\FilesystemLoader instance. + */ + protected function getTwig_LoaderService() + { + $this->services['twig.loader'] = $instance = new \Symfony\Bundle\TwigBundle\Loader\FilesystemLoader($this->get('templating.locator'), $this->get('templating.name_parser')); + + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views', 'Framework'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views', 'Security'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views', 'Twig'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle/Resources/views', 'Swiftmailer'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/Resources/views', 'Doctrine'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/views', 'ChillMain'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/views', 'ChillCustomFields'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/views', 'ChillPerson'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/views', 'ChillActivity'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle/Resources/views', 'Debug'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views', 'WebProfiler'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views', 'SensioDistribution'); + $instance->addPath('/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form'); + + return $instance; + } + + /** + * Gets the 'twig.profile' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Twig_Profiler_Profile A Twig_Profiler_Profile instance. + */ + protected function getTwig_ProfileService() + { + return $this->services['twig.profile'] = new \Twig_Profiler_Profile(); + } + + /** + * Gets the 'twig.translation.extractor' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bridge\Twig\Translation\TwigExtractor A Symfony\Bridge\Twig\Translation\TwigExtractor instance. + */ + protected function getTwig_Translation_ExtractorService() + { + return $this->services['twig.translation.extractor'] = new \Symfony\Bridge\Twig\Translation\TwigExtractor($this->get('twig')); + } + + /** + * Gets the 'twig_intl' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Twig_Extensions_Extension_Intl A Twig_Extensions_Extension_Intl instance. + */ + protected function getTwigIntlService() + { + return $this->services['twig_intl'] = new \Twig_Extensions_Extension_Intl(); + } + + /** + * Gets the 'uri_signer' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\HttpKernel\UriSigner A Symfony\Component\HttpKernel\UriSigner instance. + */ + protected function getUriSignerService() + { + return $this->services['uri_signer'] = new \Symfony\Component\HttpKernel\UriSigner('Not very secret'); + } + + /** + * Gets the 'validator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Validator\Validator\ValidatorInterface A Symfony\Component\Validator\Validator\ValidatorInterface instance. + */ + protected function getValidatorService() + { + return $this->services['validator'] = $this->get('validator.builder')->getValidator(); + } + + /** + * Gets the 'validator.builder' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Validator\ValidatorBuilderInterface A Symfony\Component\Validator\ValidatorBuilderInterface instance. + */ + protected function getValidator_BuilderService() + { + $this->services['validator.builder'] = $instance = \Symfony\Component\Validator\Validation::createValidatorBuilder(); + + $instance->setConstraintValidatorFactory(new \Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory($this, array('validator.expression' => 'validator.expression', 'Symfony\\Component\\Validator\\Constraints\\EmailValidator' => 'validator.email', 'security.validator.user_password' => 'security.validator.user_password', 'doctrine.orm.validator.unique' => 'doctrine.orm.validator.unique'))); + $instance->setTranslator($this->get('translator')); + $instance->setTranslationDomain('validators'); + $instance->addXmlMappings(array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml')); + $instance->addYamlMappings(array(0 => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/config/validation.yml')); + $instance->addMethodMapping('loadValidatorMetadata'); + $instance->addObjectInitializers(array(0 => $this->get('doctrine.orm.validator_initializer'))); + + return $instance; + } + + /** + * Gets the 'validator.email' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Validator\Constraints\EmailValidator A Symfony\Component\Validator\Constraints\EmailValidator instance. + */ + protected function getValidator_EmailService() + { + return $this->services['validator.email'] = new \Symfony\Component\Validator\Constraints\EmailValidator(false); + } + + /** + * Gets the 'validator.expression' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\Validator\Constraints\ExpressionValidator A Symfony\Component\Validator\Constraints\ExpressionValidator instance. + */ + protected function getValidator_ExpressionService() + { + return $this->services['validator.expression'] = new \Symfony\Component\Validator\Constraints\ExpressionValidator($this->get('property_accessor')); + } + + /** + * Gets the 'var_dumper.cli_dumper' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\VarDumper\Dumper\CliDumper A Symfony\Component\VarDumper\Dumper\CliDumper instance. + */ + protected function getVarDumper_CliDumperService() + { + return $this->services['var_dumper.cli_dumper'] = new \Symfony\Component\VarDumper\Dumper\CliDumper(NULL, 'UTF-8'); + } + + /** + * Gets the 'var_dumper.cloner' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Component\VarDumper\Cloner\VarCloner A Symfony\Component\VarDumper\Cloner\VarCloner instance. + */ + protected function getVarDumper_ClonerService() + { + $this->services['var_dumper.cloner'] = $instance = new \Symfony\Component\VarDumper\Cloner\VarCloner(); + + $instance->setMaxItems(2500); + $instance->setMaxString(-1); + + return $instance; + } + + /** + * Gets the 'web_profiler.controller.exception' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController A Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController instance. + */ + protected function getWebProfiler_Controller_ExceptionService() + { + return $this->services['web_profiler.controller.exception'] = new \Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController($this->get('profiler', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('twig'), true); + } + + /** + * Gets the 'web_profiler.controller.profiler' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController A Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController instance. + */ + protected function getWebProfiler_Controller_ProfilerService() + { + return $this->services['web_profiler.controller.profiler'] = new \Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController($this->get('router', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('profiler', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('twig'), array('data_collector.config' => array(0 => 'config', 1 => '@WebProfiler/Collector/config.html.twig'), 'data_collector.request' => array(0 => 'request', 1 => '@WebProfiler/Collector/request.html.twig'), 'data_collector.ajax' => array(0 => 'ajax', 1 => '@WebProfiler/Collector/ajax.html.twig'), 'data_collector.exception' => array(0 => 'exception', 1 => '@WebProfiler/Collector/exception.html.twig'), 'data_collector.events' => array(0 => 'events', 1 => '@WebProfiler/Collector/events.html.twig'), 'data_collector.logger' => array(0 => 'logger', 1 => '@WebProfiler/Collector/logger.html.twig'), 'data_collector.time' => array(0 => 'time', 1 => '@WebProfiler/Collector/time.html.twig'), 'data_collector.memory' => array(0 => 'memory', 1 => '@WebProfiler/Collector/memory.html.twig'), 'data_collector.router' => array(0 => 'router', 1 => '@WebProfiler/Collector/router.html.twig'), 'data_collector.form' => array(0 => 'form', 1 => '@WebProfiler/Collector/form.html.twig'), 'data_collector.translation' => array(0 => 'translation', 1 => '@WebProfiler/Collector/translation.html.twig'), 'data_collector.twig' => array(0 => 'twig', 1 => '@WebProfiler/Collector/twig.html.twig'), 'data_collector.security' => array(0 => 'security', 1 => '@Security/Collector/security.html.twig'), 'swiftmailer.data_collector' => array(0 => 'swiftmailer', 1 => '@Swiftmailer/Collector/swiftmailer.html.twig'), 'data_collector.doctrine' => array(0 => 'db', 1 => '@Doctrine/Collector/db.html.twig'), 'data_collector.dump' => array(0 => 'dump', 1 => '@Debug/Profiler/dump.html.twig')), 'bottom'); + } + + /** + * Gets the 'web_profiler.controller.router' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \Symfony\Bundle\WebProfilerBundle\Controller\RouterController A Symfony\Bundle\WebProfilerBundle\Controller\RouterController instance. + */ + protected function getWebProfiler_Controller_RouterService() + { + return $this->services['web_profiler.controller.router'] = new \Symfony\Bundle\WebProfilerBundle\Controller\RouterController($this->get('profiler', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('twig'), $this->get('router', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + /** + * Gets the 'assetic.asset_factory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Bundle\AsseticBundle\Factory\AssetFactory A Symfony\Bundle\AsseticBundle\Factory\AssetFactory instance. + */ + protected function getAssetic_AssetFactoryService() + { + return $this->services['assetic.asset_factory'] = new \Symfony\Bundle\AsseticBundle\Factory\AssetFactory($this->get('kernel'), $this, $this->getParameterBag(), '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/../web', true); + } + + /** + * Gets the 'controller_name_converter' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser A Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser instance. + */ + protected function getControllerNameConverterService() + { + return $this->services['controller_name_converter'] = new \Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser($this->get('kernel')); + } + + /** + * Gets the 'doctrine.dbal.logger.profiling.default' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Doctrine\DBAL\Logging\DebugStack A Doctrine\DBAL\Logging\DebugStack instance. + */ + protected function getDoctrine_Dbal_Logger_Profiling_DefaultService() + { + return $this->services['doctrine.dbal.logger.profiling.default'] = new \Doctrine\DBAL\Logging\DebugStack(); + } + + /** + * Gets the 'router.request_context' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Routing\RequestContext A Symfony\Component\Routing\RequestContext instance. + */ + protected function getRouter_RequestContextService() + { + return $this->services['router.request_context'] = new \Symfony\Component\Routing\RequestContext('', 'GET', 'localhost', 'http', 80, 443); + } + + /** + * Gets the 'security.access.decision_manager' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Security\Core\Authorization\AccessDecisionManager A Symfony\Component\Security\Core\Authorization\AccessDecisionManager instance. + */ + protected function getSecurity_Access_DecisionManagerService() + { + $a = $this->get('security.authentication.trust_resolver'); + $b = $this->get('security.role_hierarchy'); + + return $this->services['security.access.decision_manager'] = new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager(array(0 => $this->get('chill.person.security.authorization.person'), 1 => new \Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter(new \Symfony\Component\Security\Core\Authorization\ExpressionLanguage(), $a, $b), 2 => new \Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter($b), 3 => new \Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter($a)), 'affirmative', false, true); + } + + /** + * Gets the 'security.authentication.manager' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager A Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager instance. + */ + protected function getSecurity_Authentication_ManagerService() + { + $this->services['security.authentication.manager'] = $instance = new \Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager(array(0 => new \Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider($this->get('security.user.provider.concrete.chain_provider'), new \Symfony\Component\Security\Core\User\UserChecker(), 'default', $this->get('security.encoder_factory'), true), 1 => new \Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider('5593aedf3be85')), true); + + $instance->setEventDispatcher($this->get('debug.event_dispatcher')); + + return $instance; + } + + /** + * Gets the 'security.authentication.trust_resolver' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver A Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver instance. + */ + protected function getSecurity_Authentication_TrustResolverService() + { + return $this->services['security.authentication.trust_resolver'] = new \Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver('Symfony\\Component\\Security\\Core\\Authentication\\Token\\AnonymousToken', 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken'); + } + + /** + * Gets the 'security.logout_url_generator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Security\Http\Logout\LogoutUrlGenerator A Symfony\Component\Security\Http\Logout\LogoutUrlGenerator instance. + */ + protected function getSecurity_LogoutUrlGeneratorService() + { + $this->services['security.logout_url_generator'] = $instance = new \Symfony\Component\Security\Http\Logout\LogoutUrlGenerator($this->get('request_stack', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('router', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('security.token_storage', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + + $instance->registerListener('default', '/logout', 'logout', '_csrf_token', NULL); + + return $instance; + } + + /** + * Gets the 'security.role_hierarchy' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Security\Core\Role\RoleHierarchy A Symfony\Component\Security\Core\Role\RoleHierarchy instance. + */ + protected function getSecurity_RoleHierarchyService() + { + return $this->services['security.role_hierarchy'] = new \Symfony\Component\Security\Core\Role\RoleHierarchy(array('CHILL_PERSON_UPDATE' => array(0 => 'CHILL_PERSON_SEE'), 'CHILL_PERSON_CREATE' => array(0 => 'CHILL_PERSON_SEE'))); + } + + /** + * Gets the 'security.user.provider.concrete.chain_provider' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Security\Core\User\ChainUserProvider A Symfony\Component\Security\Core\User\ChainUserProvider instance. + */ + protected function getSecurity_User_Provider_Concrete_ChainProviderService() + { + return $this->services['security.user.provider.concrete.chain_provider'] = new \Symfony\Component\Security\Core\User\ChainUserProvider(array(0 => $this->get('security.user.provider.concrete.in_memory'), 1 => $this->get('security.user.provider.concrete.users'))); + } + + /** + * Gets the 'security.user.provider.concrete.in_memory' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\Security\Core\User\InMemoryUserProvider A Symfony\Component\Security\Core\User\InMemoryUserProvider instance. + */ + protected function getSecurity_User_Provider_Concrete_InMemoryService() + { + $this->services['security.user.provider.concrete.in_memory'] = $instance = new \Symfony\Component\Security\Core\User\InMemoryUserProvider(); + + $instance->createUser(new \Symfony\Component\Security\Core\User\User('admin', 'olala', array(0 => 'ROLE_ADMIN'))); + + return $instance; + } + + /** + * Gets the 'security.user.provider.concrete.users' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Bridge\Doctrine\Security\User\EntityUserProvider A Symfony\Bridge\Doctrine\Security\User\EntityUserProvider instance. + */ + protected function getSecurity_User_Provider_Concrete_UsersService() + { + return $this->services['security.user.provider.concrete.users'] = new \Symfony\Bridge\Doctrine\Security\User\EntityUserProvider($this->get('doctrine'), 'Chill\\MainBundle\\Entity\\User', 'username', NULL); + } + + /** + * Gets the 'session.storage.metadata_bag' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag A Symfony\Component\HttpFoundation\Session\Storage\MetadataBag instance. + */ + protected function getSession_Storage_MetadataBagService() + { + return $this->services['session.storage.metadata_bag'] = new \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag('_sf2_meta', '0'); + } + + /** + * Gets the 'templating.locator' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * This service is private. + * If you want to be able to request this service from the container directly, + * make it public, otherwise you might end up with broken code. + * + * @return \Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator A Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator instance. + */ + protected function getTemplating_LocatorService() + { + return $this->services['templating.locator'] = new \Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator($this->get('file_locator'), '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev'); + } + + /** + * {@inheritdoc} + */ + public function getParameter($name) + { + $name = strtolower($name); + + if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) { + throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name)); + } + + return $this->parameters[$name]; + } + + /** + * {@inheritdoc} + */ + public function hasParameter($name) + { + $name = strtolower($name); + + return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters); + } + + /** + * {@inheritdoc} + */ + public function setParameter($name, $value) + { + throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); + } + + /** + * {@inheritdoc} + */ + public function getParameterBag() + { + if (null === $this->parameterBag) { + $this->parameterBag = new FrozenParameterBag($this->parameters); + } + + return $this->parameterBag; + } + + /** + * Gets the default parameters. + * + * @return array An array of the default parameters + */ + protected function getDefaultParameters() + { + return array( + 'kernel.root_dir' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app', + 'kernel.environment' => 'dev', + 'kernel.debug' => true, + 'kernel.name' => 'app', + 'kernel.cache_dir' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev', + 'kernel.logs_dir' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/logs', + 'kernel.bundles' => array( + 'FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle', + 'SecurityBundle' => 'Symfony\\Bundle\\SecurityBundle\\SecurityBundle', + 'TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle', + 'MonologBundle' => 'Symfony\\Bundle\\MonologBundle\\MonologBundle', + 'SwiftmailerBundle' => 'Symfony\\Bundle\\SwiftmailerBundle\\SwiftmailerBundle', + 'AsseticBundle' => 'Symfony\\Bundle\\AsseticBundle\\AsseticBundle', + 'DoctrineBundle' => 'Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle', + 'SensioFrameworkExtraBundle' => 'Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle', + 'ChillMainBundle' => 'Chill\\MainBundle\\ChillMainBundle', + 'ChillCustomFieldsBundle' => 'Chill\\CustomFieldsBundle\\ChillCustomFieldsBundle', + 'ChillPersonBundle' => 'Chill\\PersonBundle\\ChillPersonBundle', + 'ChillActivityBundle' => 'Chill\\ActivityBundle\\ChillActivityBundle', + 'DebugBundle' => 'Symfony\\Bundle\\DebugBundle\\DebugBundle', + 'WebProfilerBundle' => 'Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle', + 'SensioDistributionBundle' => 'Sensio\\Bundle\\DistributionBundle\\SensioDistributionBundle', + 'SensioGeneratorBundle' => 'Sensio\\Bundle\\GeneratorBundle\\SensioGeneratorBundle', + ), + 'kernel.charset' => 'UTF-8', + 'kernel.container_class' => 'appDevDebugProjectContainer', + 'database_host' => '127.0.0.1', + 'database_port' => 5432, + 'database_name' => 'chill_test', + 'database_user' => 'chill', + 'database_password' => 'chill', + 'locale' => 'fr', + 'controller_resolver.class' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', + 'controller_name_converter.class' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', + 'response_listener.class' => 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', + 'streamed_response_listener.class' => 'Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener', + 'locale_listener.class' => 'Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener', + 'event_dispatcher.class' => 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', + 'http_kernel.class' => 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel', + 'filesystem.class' => 'Symfony\\Component\\Filesystem\\Filesystem', + 'cache_warmer.class' => 'Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerAggregate', + 'cache_clearer.class' => 'Symfony\\Component\\HttpKernel\\CacheClearer\\ChainCacheClearer', + 'file_locator.class' => 'Symfony\\Component\\HttpKernel\\Config\\FileLocator', + 'uri_signer.class' => 'Symfony\\Component\\HttpKernel\\UriSigner', + 'request_stack.class' => 'Symfony\\Component\\HttpFoundation\\RequestStack', + 'fragment.handler.class' => 'Symfony\\Component\\HttpKernel\\DependencyInjection\\LazyLoadingFragmentHandler', + 'fragment.renderer.inline.class' => 'Symfony\\Component\\HttpKernel\\Fragment\\InlineFragmentRenderer', + 'fragment.renderer.hinclude.class' => 'Symfony\\Component\\HttpKernel\\Fragment\\HIncludeFragmentRenderer', + 'fragment.renderer.hinclude.global_template' => NULL, + 'fragment.renderer.esi.class' => 'Symfony\\Component\\HttpKernel\\Fragment\\EsiFragmentRenderer', + 'fragment.path' => '/_fragment', + 'translator.class' => 'Symfony\\Bundle\\FrameworkBundle\\Translation\\Translator', + 'translator.identity.class' => 'Symfony\\Component\\Translation\\IdentityTranslator', + 'translator.selector.class' => 'Symfony\\Component\\Translation\\MessageSelector', + 'translation.loader.php.class' => 'Symfony\\Component\\Translation\\Loader\\PhpFileLoader', + 'translation.loader.yml.class' => 'Symfony\\Component\\Translation\\Loader\\YamlFileLoader', + 'translation.loader.xliff.class' => 'Symfony\\Component\\Translation\\Loader\\XliffFileLoader', + 'translation.loader.po.class' => 'Symfony\\Component\\Translation\\Loader\\PoFileLoader', + 'translation.loader.mo.class' => 'Symfony\\Component\\Translation\\Loader\\MoFileLoader', + 'translation.loader.qt.class' => 'Symfony\\Component\\Translation\\Loader\\QtFileLoader', + 'translation.loader.csv.class' => 'Symfony\\Component\\Translation\\Loader\\CsvFileLoader', + 'translation.loader.res.class' => 'Symfony\\Component\\Translation\\Loader\\IcuResFileLoader', + 'translation.loader.dat.class' => 'Symfony\\Component\\Translation\\Loader\\IcuDatFileLoader', + 'translation.loader.ini.class' => 'Symfony\\Component\\Translation\\Loader\\IniFileLoader', + 'translation.loader.json.class' => 'Symfony\\Component\\Translation\\Loader\\JsonFileLoader', + 'translation.dumper.php.class' => 'Symfony\\Component\\Translation\\Dumper\\PhpFileDumper', + 'translation.dumper.xliff.class' => 'Symfony\\Component\\Translation\\Dumper\\XliffFileDumper', + 'translation.dumper.po.class' => 'Symfony\\Component\\Translation\\Dumper\\PoFileDumper', + 'translation.dumper.mo.class' => 'Symfony\\Component\\Translation\\Dumper\\MoFileDumper', + 'translation.dumper.yml.class' => 'Symfony\\Component\\Translation\\Dumper\\YamlFileDumper', + 'translation.dumper.qt.class' => 'Symfony\\Component\\Translation\\Dumper\\QtFileDumper', + 'translation.dumper.csv.class' => 'Symfony\\Component\\Translation\\Dumper\\CsvFileDumper', + 'translation.dumper.ini.class' => 'Symfony\\Component\\Translation\\Dumper\\IniFileDumper', + 'translation.dumper.json.class' => 'Symfony\\Component\\Translation\\Dumper\\JsonFileDumper', + 'translation.dumper.res.class' => 'Symfony\\Component\\Translation\\Dumper\\IcuResFileDumper', + 'translation.extractor.php.class' => 'Symfony\\Bundle\\FrameworkBundle\\Translation\\PhpExtractor', + 'translation.loader.class' => 'Symfony\\Bundle\\FrameworkBundle\\Translation\\TranslationLoader', + 'translation.extractor.class' => 'Symfony\\Component\\Translation\\Extractor\\ChainExtractor', + 'translation.writer.class' => 'Symfony\\Component\\Translation\\Writer\\TranslationWriter', + 'property_accessor.class' => 'Symfony\\Component\\PropertyAccess\\PropertyAccessor', + 'kernel.secret' => 'Not very secret', + 'kernel.http_method_override' => true, + 'kernel.trusted_hosts' => array( + + ), + 'kernel.trusted_proxies' => array( + + ), + 'kernel.default_locale' => 'fr', + 'test.client.class' => 'Symfony\\Bundle\\FrameworkBundle\\Client', + 'test.client.parameters' => array( + + ), + 'test.client.history.class' => 'Symfony\\Component\\BrowserKit\\History', + 'test.client.cookiejar.class' => 'Symfony\\Component\\BrowserKit\\CookieJar', + 'test.session.listener.class' => 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\TestSessionListener', + 'session.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Session', + 'session.flashbag.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag', + 'session.attribute_bag.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag', + 'session.storage.metadata_bag.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\MetadataBag', + 'session.metadata.storage_key' => '_sf2_meta', + 'session.storage.native.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', + 'session.storage.php_bridge.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', + 'session.storage.mock_file.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\MockFileSessionStorage', + 'session.handler.native_file.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', + 'session.handler.write_check.class' => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\WriteCheckSessionHandler', + 'session_listener.class' => 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', + 'session.storage.options' => array( + 'gc_probability' => 1, + ), + 'session.save_path' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/sessions', + 'session.metadata.update_threshold' => '0', + 'security.secure_random.class' => 'Symfony\\Component\\Security\\Core\\Util\\SecureRandom', + 'form.resolved_type_factory.class' => 'Symfony\\Component\\Form\\ResolvedFormTypeFactory', + 'form.registry.class' => 'Symfony\\Component\\Form\\FormRegistry', + 'form.factory.class' => 'Symfony\\Component\\Form\\FormFactory', + 'form.extension.class' => 'Symfony\\Component\\Form\\Extension\\DependencyInjection\\DependencyInjectionExtension', + 'form.type_guesser.validator.class' => 'Symfony\\Component\\Form\\Extension\\Validator\\ValidatorTypeGuesser', + 'form.type_extension.form.request_handler.class' => 'Symfony\\Component\\Form\\Extension\\HttpFoundation\\HttpFoundationRequestHandler', + 'form.type_extension.csrf.enabled' => true, + 'form.type_extension.csrf.field_name' => '_token', + 'security.csrf.token_generator.class' => 'Symfony\\Component\\Security\\Csrf\\TokenGenerator\\UriSafeTokenGenerator', + 'security.csrf.token_storage.class' => 'Symfony\\Component\\Security\\Csrf\\TokenStorage\\SessionTokenStorage', + 'security.csrf.token_manager.class' => 'Symfony\\Component\\Security\\Csrf\\CsrfTokenManager', + 'templating.engine.delegating.class' => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\DelegatingEngine', + 'templating.name_parser.class' => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', + 'templating.filename_parser.class' => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateFilenameParser', + 'templating.cache_warmer.template_paths.class' => 'Symfony\\Bundle\\FrameworkBundle\\CacheWarmer\\TemplatePathsCacheWarmer', + 'templating.locator.class' => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocator', + 'templating.loader.filesystem.class' => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', + 'templating.loader.cache.class' => 'Symfony\\Component\\Templating\\Loader\\CacheLoader', + 'templating.loader.chain.class' => 'Symfony\\Component\\Templating\\Loader\\ChainLoader', + 'templating.finder.class' => 'Symfony\\Bundle\\FrameworkBundle\\CacheWarmer\\TemplateFinder', + 'templating.helper.assets.class' => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\AssetsHelper', + 'templating.helper.router.class' => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\RouterHelper', + 'templating.helper.code.file_link_format' => NULL, + 'templating.loader.cache.path' => NULL, + 'templating.engines' => array( + 0 => 'twig', + ), + 'validator.class' => 'Symfony\\Component\\Validator\\Validator\\ValidatorInterface', + 'validator.builder.class' => 'Symfony\\Component\\Validator\\ValidatorBuilderInterface', + 'validator.builder.factory.class' => 'Symfony\\Component\\Validator\\Validation', + 'validator.mapping.cache.apc.class' => 'Symfony\\Component\\Validator\\Mapping\\Cache\\ApcCache', + 'validator.mapping.cache.prefix' => '', + 'validator.validator_factory.class' => 'Symfony\\Bundle\\FrameworkBundle\\Validator\\ConstraintValidatorFactory', + 'validator.expression.class' => 'Symfony\\Component\\Validator\\Constraints\\ExpressionValidator', + 'validator.email.class' => 'Symfony\\Component\\Validator\\Constraints\\EmailValidator', + 'validator.translation_domain' => 'validators', + 'validator.api' => '2.5-bc', + 'translator.logging' => true, + 'profiler.class' => 'Symfony\\Component\\HttpKernel\\Profiler\\Profiler', + 'profiler_listener.class' => 'Symfony\\Component\\HttpKernel\\EventListener\\ProfilerListener', + 'data_collector.config.class' => 'Symfony\\Component\\HttpKernel\\DataCollector\\ConfigDataCollector', + 'data_collector.request.class' => 'Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector', + 'data_collector.exception.class' => 'Symfony\\Component\\HttpKernel\\DataCollector\\ExceptionDataCollector', + 'data_collector.events.class' => 'Symfony\\Component\\HttpKernel\\DataCollector\\EventDataCollector', + 'data_collector.logger.class' => 'Symfony\\Component\\HttpKernel\\DataCollector\\LoggerDataCollector', + 'data_collector.time.class' => 'Symfony\\Component\\HttpKernel\\DataCollector\\TimeDataCollector', + 'data_collector.memory.class' => 'Symfony\\Component\\HttpKernel\\DataCollector\\MemoryDataCollector', + 'data_collector.router.class' => 'Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector', + 'form.resolved_type_factory.data_collector_proxy.class' => 'Symfony\\Component\\Form\\Extension\\DataCollector\\Proxy\\ResolvedTypeFactoryDataCollectorProxy', + 'form.type_extension.form.data_collector.class' => 'Symfony\\Component\\Form\\Extension\\DataCollector\\Type\\DataCollectorTypeExtension', + 'data_collector.form.class' => 'Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataCollector', + 'data_collector.form.extractor.class' => 'Symfony\\Component\\Form\\Extension\\DataCollector\\FormDataExtractor', + 'profiler_listener.only_exceptions' => false, + 'profiler_listener.only_master_requests' => false, + 'profiler.storage.dsn' => 'file:/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/profiler', + 'profiler.storage.username' => '', + 'profiler.storage.password' => '', + 'profiler.storage.lifetime' => 86400, + 'router.class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\Router', + 'router.request_context.class' => 'Symfony\\Component\\Routing\\RequestContext', + 'routing.loader.class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\DelegatingLoader', + 'routing.resolver.class' => 'Symfony\\Component\\Config\\Loader\\LoaderResolver', + 'routing.loader.xml.class' => 'Symfony\\Component\\Routing\\Loader\\XmlFileLoader', + 'routing.loader.yml.class' => 'Symfony\\Component\\Routing\\Loader\\YamlFileLoader', + 'routing.loader.php.class' => 'Symfony\\Component\\Routing\\Loader\\PhpFileLoader', + 'router.options.generator_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', + 'router.options.generator_base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', + 'router.options.generator_dumper_class' => 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper', + 'router.options.matcher_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', + 'router.options.matcher_base_class' => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', + 'router.options.matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper', + 'router.cache_warmer.class' => 'Symfony\\Bundle\\FrameworkBundle\\CacheWarmer\\RouterCacheWarmer', + 'router.options.matcher.cache_class' => 'appDevUrlMatcher', + 'router.options.generator.cache_class' => 'appDevUrlGenerator', + 'router_listener.class' => 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', + 'router.request_context.host' => 'localhost', + 'router.request_context.scheme' => 'http', + 'router.request_context.base_url' => '', + 'router.resource' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/config/routing.yml', + 'router.cache_class_prefix' => 'appDev', + 'request_listener.http_port' => 80, + 'request_listener.https_port' => 443, + 'annotations.reader.class' => 'Doctrine\\Common\\Annotations\\AnnotationReader', + 'annotations.cached_reader.class' => 'Doctrine\\Common\\Annotations\\CachedReader', + 'annotations.file_cache_reader.class' => 'Doctrine\\Common\\Annotations\\FileCacheReader', + 'debug.debug_handlers_listener.class' => 'Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener', + 'debug.stopwatch.class' => 'Symfony\\Component\\Stopwatch\\Stopwatch', + 'debug.error_handler.throw_at' => -1, + 'debug.event_dispatcher.class' => 'Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher', + 'debug.container.dump' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml', + 'debug.controller_resolver.class' => 'Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver', + 'security.context.class' => 'Symfony\\Component\\Security\\Core\\SecurityContext', + 'security.user_checker.class' => 'Symfony\\Component\\Security\\Core\\User\\UserChecker', + 'security.encoder_factory.generic.class' => 'Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactory', + 'security.encoder.digest.class' => 'Symfony\\Component\\Security\\Core\\Encoder\\MessageDigestPasswordEncoder', + 'security.encoder.plain.class' => 'Symfony\\Component\\Security\\Core\\Encoder\\PlaintextPasswordEncoder', + 'security.encoder.pbkdf2.class' => 'Symfony\\Component\\Security\\Core\\Encoder\\Pbkdf2PasswordEncoder', + 'security.encoder.bcrypt.class' => 'Symfony\\Component\\Security\\Core\\Encoder\\BCryptPasswordEncoder', + 'security.user.provider.in_memory.class' => 'Symfony\\Component\\Security\\Core\\User\\InMemoryUserProvider', + 'security.user.provider.in_memory.user.class' => 'Symfony\\Component\\Security\\Core\\User\\User', + 'security.user.provider.chain.class' => 'Symfony\\Component\\Security\\Core\\User\\ChainUserProvider', + 'security.authentication.trust_resolver.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationTrustResolver', + 'security.authentication.trust_resolver.anonymous_class' => 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\AnonymousToken', + 'security.authentication.trust_resolver.rememberme_class' => 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken', + 'security.authentication.manager.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager', + 'security.authentication.session_strategy.class' => 'Symfony\\Component\\Security\\Http\\Session\\SessionAuthenticationStrategy', + 'security.access.decision_manager.class' => 'Symfony\\Component\\Security\\Core\\Authorization\\AccessDecisionManager', + 'security.access.simple_role_voter.class' => 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\RoleVoter', + 'security.access.authenticated_voter.class' => 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter', + 'security.access.role_hierarchy_voter.class' => 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\RoleHierarchyVoter', + 'security.access.expression_voter.class' => 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\ExpressionVoter', + 'security.firewall.class' => 'Symfony\\Component\\Security\\Http\\Firewall', + 'security.firewall.map.class' => 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallMap', + 'security.firewall.context.class' => 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallContext', + 'security.matcher.class' => 'Symfony\\Component\\HttpFoundation\\RequestMatcher', + 'security.expression_matcher.class' => 'Symfony\\Component\\HttpFoundation\\ExpressionRequestMatcher', + 'security.role_hierarchy.class' => 'Symfony\\Component\\Security\\Core\\Role\\RoleHierarchy', + 'security.http_utils.class' => 'Symfony\\Component\\Security\\Http\\HttpUtils', + 'security.validator.user_password.class' => 'Symfony\\Component\\Security\\Core\\Validator\\Constraints\\UserPasswordValidator', + 'security.expression_language.class' => 'Symfony\\Component\\Security\\Core\\Authorization\\ExpressionLanguage', + 'security.authentication.retry_entry_point.class' => 'Symfony\\Component\\Security\\Http\\EntryPoint\\RetryAuthenticationEntryPoint', + 'security.channel_listener.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\ChannelListener', + 'security.authentication.form_entry_point.class' => 'Symfony\\Component\\Security\\Http\\EntryPoint\\FormAuthenticationEntryPoint', + 'security.authentication.listener.form.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\UsernamePasswordFormAuthenticationListener', + 'security.authentication.listener.simple_form.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\SimpleFormAuthenticationListener', + 'security.authentication.listener.simple_preauth.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\SimplePreAuthenticationListener', + 'security.authentication.listener.basic.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\BasicAuthenticationListener', + 'security.authentication.basic_entry_point.class' => 'Symfony\\Component\\Security\\Http\\EntryPoint\\BasicAuthenticationEntryPoint', + 'security.authentication.listener.digest.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\DigestAuthenticationListener', + 'security.authentication.digest_entry_point.class' => 'Symfony\\Component\\Security\\Http\\EntryPoint\\DigestAuthenticationEntryPoint', + 'security.authentication.listener.x509.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\X509AuthenticationListener', + 'security.authentication.listener.anonymous.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\AnonymousAuthenticationListener', + 'security.authentication.switchuser_listener.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\SwitchUserListener', + 'security.logout_listener.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\LogoutListener', + 'security.logout.handler.session.class' => 'Symfony\\Component\\Security\\Http\\Logout\\SessionLogoutHandler', + 'security.logout.handler.cookie_clearing.class' => 'Symfony\\Component\\Security\\Http\\Logout\\CookieClearingLogoutHandler', + 'security.logout.success_handler.class' => 'Symfony\\Component\\Security\\Http\\Logout\\DefaultLogoutSuccessHandler', + 'security.access_listener.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\AccessListener', + 'security.access_map.class' => 'Symfony\\Component\\Security\\Http\\AccessMap', + 'security.exception_listener.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\ExceptionListener', + 'security.context_listener.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\ContextListener', + 'security.authentication.provider.dao.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\Provider\\DaoAuthenticationProvider', + 'security.authentication.provider.simple.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\Provider\\SimpleAuthenticationProvider', + 'security.authentication.provider.pre_authenticated.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\Provider\\PreAuthenticatedAuthenticationProvider', + 'security.authentication.provider.anonymous.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\Provider\\AnonymousAuthenticationProvider', + 'security.authentication.success_handler.class' => 'Symfony\\Component\\Security\\Http\\Authentication\\DefaultAuthenticationSuccessHandler', + 'security.authentication.failure_handler.class' => 'Symfony\\Component\\Security\\Http\\Authentication\\DefaultAuthenticationFailureHandler', + 'security.authentication.simple_success_failure_handler.class' => 'Symfony\\Component\\Security\\Http\\Authentication\\SimpleAuthenticationHandler', + 'security.authentication.provider.rememberme.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\Provider\\RememberMeAuthenticationProvider', + 'security.authentication.listener.rememberme.class' => 'Symfony\\Component\\Security\\Http\\Firewall\\RememberMeListener', + 'security.rememberme.token.provider.in_memory.class' => 'Symfony\\Component\\Security\\Core\\Authentication\\RememberMe\\InMemoryTokenProvider', + 'security.authentication.rememberme.services.persistent.class' => 'Symfony\\Component\\Security\\Http\\RememberMe\\PersistentTokenBasedRememberMeServices', + 'security.authentication.rememberme.services.simplehash.class' => 'Symfony\\Component\\Security\\Http\\RememberMe\\TokenBasedRememberMeServices', + 'security.rememberme.response_listener.class' => 'Symfony\\Component\\Security\\Http\\RememberMe\\ResponseListener', + 'templating.helper.logout_url.class' => 'Symfony\\Bundle\\SecurityBundle\\Templating\\Helper\\LogoutUrlHelper', + 'templating.helper.security.class' => 'Symfony\\Bundle\\SecurityBundle\\Templating\\Helper\\SecurityHelper', + 'twig.extension.logout_url.class' => 'Symfony\\Bridge\\Twig\\Extension\\LogoutUrlExtension', + 'twig.extension.security.class' => 'Symfony\\Bridge\\Twig\\Extension\\SecurityExtension', + 'data_collector.security.class' => 'Symfony\\Bundle\\SecurityBundle\\DataCollector\\SecurityDataCollector', + 'security.access.denied_url' => NULL, + 'security.authentication.manager.erase_credentials' => true, + 'security.authentication.session_strategy.strategy' => 'migrate', + 'security.access.always_authenticate_before_granting' => false, + 'security.authentication.hide_user_not_found' => true, + 'security.role_hierarchy.roles' => array( + 'CHILL_PERSON_UPDATE' => array( + 0 => 'CHILL_PERSON_SEE', + ), + 'CHILL_PERSON_CREATE' => array( + 0 => 'CHILL_PERSON_SEE', + ), + ), + 'twig.class' => 'Twig_Environment', + 'twig.loader.filesystem.class' => 'Symfony\\Bundle\\TwigBundle\\Loader\\FilesystemLoader', + 'twig.loader.chain.class' => 'Twig_Loader_Chain', + 'templating.engine.twig.class' => 'Symfony\\Bundle\\TwigBundle\\TwigEngine', + 'twig.cache_warmer.class' => 'Symfony\\Bundle\\TwigBundle\\CacheWarmer\\TemplateCacheCacheWarmer', + 'twig.extension.trans.class' => 'Symfony\\Bridge\\Twig\\Extension\\TranslationExtension', + 'twig.extension.actions.class' => 'Symfony\\Bundle\\TwigBundle\\Extension\\ActionsExtension', + 'twig.extension.code.class' => 'Symfony\\Bridge\\Twig\\Extension\\CodeExtension', + 'twig.extension.routing.class' => 'Symfony\\Bridge\\Twig\\Extension\\RoutingExtension', + 'twig.extension.yaml.class' => 'Symfony\\Bridge\\Twig\\Extension\\YamlExtension', + 'twig.extension.form.class' => 'Symfony\\Bridge\\Twig\\Extension\\FormExtension', + 'twig.extension.httpkernel.class' => 'Symfony\\Bridge\\Twig\\Extension\\HttpKernelExtension', + 'twig.extension.debug.stopwatch.class' => 'Symfony\\Bridge\\Twig\\Extension\\StopwatchExtension', + 'twig.extension.expression.class' => 'Symfony\\Bridge\\Twig\\Extension\\ExpressionExtension', + 'twig.form.engine.class' => 'Symfony\\Bridge\\Twig\\Form\\TwigRendererEngine', + 'twig.form.renderer.class' => 'Symfony\\Bridge\\Twig\\Form\\TwigRenderer', + 'twig.translation.extractor.class' => 'Symfony\\Bridge\\Twig\\Translation\\TwigExtractor', + 'twig.exception_listener.class' => 'Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener', + 'twig.controller.exception.class' => 'Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController', + 'twig.controller.preview_error.class' => 'Symfony\\Bundle\\TwigBundle\\Controller\\PreviewErrorController', + 'twig.exception_listener.controller' => 'twig.controller.exception:showAction', + 'twig.form.resources' => array( + 0 => 'form_div_layout.html.twig', + 1 => 'ChillCustomFieldsBundle:Form:fields.html.twig', + 2 => 'ChillMainBundle:Form:fields.html.twig', + ), + 'monolog.logger.class' => 'Symfony\\Bridge\\Monolog\\Logger', + 'monolog.gelf.publisher.class' => 'Gelf\\MessagePublisher', + 'monolog.gelfphp.publisher.class' => 'Gelf\\Publisher', + 'monolog.handler.stream.class' => 'Monolog\\Handler\\StreamHandler', + 'monolog.handler.console.class' => 'Symfony\\Bridge\\Monolog\\Handler\\ConsoleHandler', + 'monolog.handler.group.class' => 'Monolog\\Handler\\GroupHandler', + 'monolog.handler.buffer.class' => 'Monolog\\Handler\\BufferHandler', + 'monolog.handler.rotating_file.class' => 'Monolog\\Handler\\RotatingFileHandler', + 'monolog.handler.syslog.class' => 'Monolog\\Handler\\SyslogHandler', + 'monolog.handler.syslogudp.class' => 'Monolog\\Handler\\SyslogUdpHandler', + 'monolog.handler.null.class' => 'Monolog\\Handler\\NullHandler', + 'monolog.handler.test.class' => 'Monolog\\Handler\\TestHandler', + 'monolog.handler.gelf.class' => 'Monolog\\Handler\\GelfHandler', + 'monolog.handler.rollbar.class' => 'Monolog\\Handler\\RollbarHandler', + 'monolog.handler.flowdock.class' => 'Monolog\\Handler\\FlowdockHandler', + 'monolog.handler.browser_console.class' => 'Monolog\\Handler\\BrowserConsoleHandler', + 'monolog.handler.firephp.class' => 'Symfony\\Bridge\\Monolog\\Handler\\FirePHPHandler', + 'monolog.handler.chromephp.class' => 'Symfony\\Bridge\\Monolog\\Handler\\ChromePhpHandler', + 'monolog.handler.debug.class' => 'Symfony\\Bridge\\Monolog\\Handler\\DebugHandler', + 'monolog.handler.swift_mailer.class' => 'Symfony\\Bridge\\Monolog\\Handler\\SwiftMailerHandler', + 'monolog.handler.native_mailer.class' => 'Monolog\\Handler\\NativeMailerHandler', + 'monolog.handler.socket.class' => 'Monolog\\Handler\\SocketHandler', + 'monolog.handler.pushover.class' => 'Monolog\\Handler\\PushoverHandler', + 'monolog.handler.raven.class' => 'Monolog\\Handler\\RavenHandler', + 'monolog.handler.newrelic.class' => 'Monolog\\Handler\\NewRelicHandler', + 'monolog.handler.hipchat.class' => 'Monolog\\Handler\\HipChatHandler', + 'monolog.handler.slack.class' => 'Monolog\\Handler\\SlackHandler', + 'monolog.handler.cube.class' => 'Monolog\\Handler\\CubeHandler', + 'monolog.handler.amqp.class' => 'Monolog\\Handler\\AmqpHandler', + 'monolog.handler.error_log.class' => 'Monolog\\Handler\\ErrorLogHandler', + 'monolog.handler.loggly.class' => 'Monolog\\Handler\\LogglyHandler', + 'monolog.handler.logentries.class' => 'Monolog\\Handler\\LogEntriesHandler', + 'monolog.handler.whatfailuregroup.class' => 'Monolog\\Handler\\WhatFailureGroupHandler', + 'monolog.activation_strategy.not_found.class' => 'Symfony\\Bundle\\MonologBundle\\NotFoundActivationStrategy', + 'monolog.handler.fingers_crossed.class' => 'Monolog\\Handler\\FingersCrossedHandler', + 'monolog.handler.fingers_crossed.error_level_activation_strategy.class' => 'Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy', + 'monolog.handler.filter.class' => 'Monolog\\Handler\\FilterHandler', + 'monolog.handler.mongo.class' => 'Monolog\\Handler\\MongoDBHandler', + 'monolog.mongo.client.class' => 'MongoClient', + 'monolog.handler.elasticsearch.class' => 'Monolog\\Handler\\ElasticSearchHandler', + 'monolog.elastica.client.class' => 'Elastica\\Client', + 'monolog.swift_mailer.handlers' => array( + + ), + 'monolog.handlers_to_channels' => array( + + ), + 'swiftmailer.class' => 'Swift_Mailer', + 'swiftmailer.transport.sendmail.class' => 'Swift_Transport_SendmailTransport', + 'swiftmailer.transport.mail.class' => 'Swift_Transport_MailTransport', + 'swiftmailer.transport.failover.class' => 'Swift_Transport_FailoverTransport', + 'swiftmailer.plugin.redirecting.class' => 'Swift_Plugins_RedirectingPlugin', + 'swiftmailer.plugin.impersonate.class' => 'Swift_Plugins_ImpersonatePlugin', + 'swiftmailer.plugin.messagelogger.class' => 'Swift_Plugins_MessageLogger', + 'swiftmailer.plugin.antiflood.class' => 'Swift_Plugins_AntiFloodPlugin', + 'swiftmailer.transport.smtp.class' => 'Swift_Transport_EsmtpTransport', + 'swiftmailer.plugin.blackhole.class' => 'Swift_Plugins_BlackholePlugin', + 'swiftmailer.spool.file.class' => 'Swift_FileSpool', + 'swiftmailer.spool.memory.class' => 'Swift_MemorySpool', + 'swiftmailer.email_sender.listener.class' => 'Symfony\\Bundle\\SwiftmailerBundle\\EventListener\\EmailSenderListener', + 'swiftmailer.data_collector.class' => 'Symfony\\Bundle\\SwiftmailerBundle\\DataCollector\\MessageDataCollector', + 'swiftmailer.mailer.default.transport.name' => 'smtp', + 'swiftmailer.mailer.default.delivery.enabled' => true, + 'swiftmailer.mailer.default.transport.smtp.encryption' => NULL, + 'swiftmailer.mailer.default.transport.smtp.port' => 25, + 'swiftmailer.mailer.default.transport.smtp.host' => 'localhost', + 'swiftmailer.mailer.default.transport.smtp.username' => NULL, + 'swiftmailer.mailer.default.transport.smtp.password' => NULL, + 'swiftmailer.mailer.default.transport.smtp.auth_mode' => NULL, + 'swiftmailer.mailer.default.transport.smtp.timeout' => 30, + 'swiftmailer.mailer.default.transport.smtp.source_ip' => NULL, + 'swiftmailer.mailer.default.spool.enabled' => false, + 'swiftmailer.mailer.default.plugin.impersonate' => NULL, + 'swiftmailer.mailer.default.single_address' => NULL, + 'swiftmailer.spool.enabled' => false, + 'swiftmailer.delivery.enabled' => true, + 'swiftmailer.single_address' => NULL, + 'swiftmailer.mailers' => array( + 'default' => 'swiftmailer.mailer.default', + ), + 'swiftmailer.default_mailer' => 'default', + 'assetic.asset_factory.class' => 'Symfony\\Bundle\\AsseticBundle\\Factory\\AssetFactory', + 'assetic.asset_manager.class' => 'Assetic\\Factory\\LazyAssetManager', + 'assetic.asset_manager_cache_warmer.class' => 'Symfony\\Bundle\\AsseticBundle\\CacheWarmer\\AssetManagerCacheWarmer', + 'assetic.cached_formula_loader.class' => 'Assetic\\Factory\\Loader\\CachedFormulaLoader', + 'assetic.config_cache.class' => 'Assetic\\Cache\\ConfigCache', + 'assetic.config_loader.class' => 'Symfony\\Bundle\\AsseticBundle\\Factory\\Loader\\ConfigurationLoader', + 'assetic.config_resource.class' => 'Symfony\\Bundle\\AsseticBundle\\Factory\\Resource\\ConfigurationResource', + 'assetic.coalescing_directory_resource.class' => 'Symfony\\Bundle\\AsseticBundle\\Factory\\Resource\\CoalescingDirectoryResource', + 'assetic.directory_resource.class' => 'Symfony\\Bundle\\AsseticBundle\\Factory\\Resource\\DirectoryResource', + 'assetic.filter_manager.class' => 'Symfony\\Bundle\\AsseticBundle\\FilterManager', + 'assetic.worker.ensure_filter.class' => 'Assetic\\Factory\\Worker\\EnsureFilterWorker', + 'assetic.worker.cache_busting.class' => 'Assetic\\Factory\\Worker\\CacheBustingWorker', + 'assetic.value_supplier.class' => 'Symfony\\Bundle\\AsseticBundle\\DefaultValueSupplier', + 'assetic.node.paths' => array( + + ), + 'assetic.cache_dir' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/assetic', + 'assetic.bundles' => array( + 0 => 'ChillPersonBundle', + 1 => 'ChillMainBundle', + ), + 'assetic.twig_extension.class' => 'Symfony\\Bundle\\AsseticBundle\\Twig\\AsseticExtension', + 'assetic.twig_formula_loader.class' => 'Assetic\\Extension\\Twig\\TwigFormulaLoader', + 'assetic.helper.dynamic.class' => 'Symfony\\Bundle\\AsseticBundle\\Templating\\DynamicAsseticHelper', + 'assetic.helper.static.class' => 'Symfony\\Bundle\\AsseticBundle\\Templating\\StaticAsseticHelper', + 'assetic.php_formula_loader.class' => 'Symfony\\Bundle\\AsseticBundle\\Factory\\Loader\\AsseticHelperFormulaLoader', + 'assetic.debug' => true, + 'assetic.use_controller' => false, + 'assetic.enable_profiler' => false, + 'assetic.read_from' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/../web', + 'assetic.write_to' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/../web', + 'assetic.variables' => array( + + ), + 'assetic.java.bin' => '/usr/bin/java', + 'assetic.node.bin' => '/usr/local/bin/node', + 'assetic.ruby.bin' => '/usr/local/opt/ruby/bin/ruby', + 'assetic.sass.bin' => '/usr/local/bin/sass', + 'assetic.filter.cssrewrite.class' => 'Assetic\\Filter\\CssRewriteFilter', + 'assetic.twig_extension.functions' => array( + + ), + 'doctrine_cache.apc.class' => 'Doctrine\\Common\\Cache\\ApcCache', + 'doctrine_cache.array.class' => 'Doctrine\\Common\\Cache\\ArrayCache', + 'doctrine_cache.file_system.class' => 'Doctrine\\Common\\Cache\\FilesystemCache', + 'doctrine_cache.php_file.class' => 'Doctrine\\Common\\Cache\\PhpFileCache', + 'doctrine_cache.mongodb.class' => 'Doctrine\\Common\\Cache\\MongoDBCache', + 'doctrine_cache.mongodb.collection.class' => 'MongoCollection', + 'doctrine_cache.mongodb.connection.class' => 'MongoClient', + 'doctrine_cache.mongodb.server' => 'localhost:27017', + 'doctrine_cache.riak.class' => 'Doctrine\\Common\\Cache\\RiakCache', + 'doctrine_cache.riak.bucket.class' => 'Riak\\Bucket', + 'doctrine_cache.riak.connection.class' => 'Riak\\Connection', + 'doctrine_cache.riak.bucket_property_list.class' => 'Riak\\BucketPropertyList', + 'doctrine_cache.riak.host' => 'localhost', + 'doctrine_cache.riak.port' => 8087, + 'doctrine_cache.memcache.class' => 'Doctrine\\Common\\Cache\\MemcacheCache', + 'doctrine_cache.memcache.connection.class' => 'Memcache', + 'doctrine_cache.memcache.host' => 'localhost', + 'doctrine_cache.memcache.port' => 11211, + 'doctrine_cache.memcached.class' => 'Doctrine\\Common\\Cache\\MemcachedCache', + 'doctrine_cache.memcached.connection.class' => 'Memcached', + 'doctrine_cache.memcached.host' => 'localhost', + 'doctrine_cache.memcached.port' => 11211, + 'doctrine_cache.redis.class' => 'Doctrine\\Common\\Cache\\RedisCache', + 'doctrine_cache.redis.connection.class' => 'Redis', + 'doctrine_cache.redis.host' => 'localhost', + 'doctrine_cache.redis.port' => 6379, + 'doctrine_cache.couchbase.class' => 'Doctrine\\Common\\Cache\\CouchbaseCache', + 'doctrine_cache.couchbase.connection.class' => 'Couchbase', + 'doctrine_cache.couchbase.hostnames' => 'localhost:8091', + 'doctrine_cache.wincache.class' => 'Doctrine\\Common\\Cache\\WinCacheCache', + 'doctrine_cache.xcache.class' => 'Doctrine\\Common\\Cache\\XcacheCache', + 'doctrine_cache.zenddata.class' => 'Doctrine\\Common\\Cache\\ZendDataCache', + 'doctrine_cache.security.acl.cache.class' => 'Doctrine\\Bundle\\DoctrineCacheBundle\\Acl\\Model\\AclCache', + 'doctrine.dbal.logger.chain.class' => 'Doctrine\\DBAL\\Logging\\LoggerChain', + 'doctrine.dbal.logger.profiling.class' => 'Doctrine\\DBAL\\Logging\\DebugStack', + 'doctrine.dbal.logger.class' => 'Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger', + 'doctrine.dbal.configuration.class' => 'Doctrine\\DBAL\\Configuration', + 'doctrine.data_collector.class' => 'Doctrine\\Bundle\\DoctrineBundle\\DataCollector\\DoctrineDataCollector', + 'doctrine.dbal.connection.event_manager.class' => 'Symfony\\Bridge\\Doctrine\\ContainerAwareEventManager', + 'doctrine.dbal.connection_factory.class' => 'Doctrine\\Bundle\\DoctrineBundle\\ConnectionFactory', + 'doctrine.dbal.events.mysql_session_init.class' => 'Doctrine\\DBAL\\Event\\Listeners\\MysqlSessionInit', + 'doctrine.dbal.events.oracle_session_init.class' => 'Doctrine\\DBAL\\Event\\Listeners\\OracleSessionInit', + 'doctrine.class' => 'Doctrine\\Bundle\\DoctrineBundle\\Registry', + 'doctrine.entity_managers' => array( + 'default' => 'doctrine.orm.default_entity_manager', + ), + 'doctrine.default_entity_manager' => 'default', + 'doctrine.dbal.connection_factory.types' => array( + + ), + 'doctrine.connections' => array( + 'default' => 'doctrine.dbal.default_connection', + ), + 'doctrine.default_connection' => 'default', + 'doctrine.orm.configuration.class' => 'Doctrine\\ORM\\Configuration', + 'doctrine.orm.entity_manager.class' => 'Doctrine\\ORM\\EntityManager', + 'doctrine.orm.manager_configurator.class' => 'Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator', + 'doctrine.orm.cache.array.class' => 'Doctrine\\Common\\Cache\\ArrayCache', + 'doctrine.orm.cache.apc.class' => 'Doctrine\\Common\\Cache\\ApcCache', + 'doctrine.orm.cache.memcache.class' => 'Doctrine\\Common\\Cache\\MemcacheCache', + 'doctrine.orm.cache.memcache_host' => 'localhost', + 'doctrine.orm.cache.memcache_port' => 11211, + 'doctrine.orm.cache.memcache_instance.class' => 'Memcache', + 'doctrine.orm.cache.memcached.class' => 'Doctrine\\Common\\Cache\\MemcachedCache', + 'doctrine.orm.cache.memcached_host' => 'localhost', + 'doctrine.orm.cache.memcached_port' => 11211, + 'doctrine.orm.cache.memcached_instance.class' => 'Memcached', + 'doctrine.orm.cache.redis.class' => 'Doctrine\\Common\\Cache\\RedisCache', + 'doctrine.orm.cache.redis_host' => 'localhost', + 'doctrine.orm.cache.redis_port' => 6379, + 'doctrine.orm.cache.redis_instance.class' => 'Redis', + 'doctrine.orm.cache.xcache.class' => 'Doctrine\\Common\\Cache\\XcacheCache', + 'doctrine.orm.cache.wincache.class' => 'Doctrine\\Common\\Cache\\WinCacheCache', + 'doctrine.orm.cache.zenddata.class' => 'Doctrine\\Common\\Cache\\ZendDataCache', + 'doctrine.orm.metadata.driver_chain.class' => 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriverChain', + 'doctrine.orm.metadata.annotation.class' => 'Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver', + 'doctrine.orm.metadata.xml.class' => 'Doctrine\\ORM\\Mapping\\Driver\\SimplifiedXmlDriver', + 'doctrine.orm.metadata.yml.class' => 'Doctrine\\ORM\\Mapping\\Driver\\SimplifiedYamlDriver', + 'doctrine.orm.metadata.php.class' => 'Doctrine\\ORM\\Mapping\\Driver\\PHPDriver', + 'doctrine.orm.metadata.staticphp.class' => 'Doctrine\\ORM\\Mapping\\Driver\\StaticPHPDriver', + 'doctrine.orm.proxy_cache_warmer.class' => 'Symfony\\Bridge\\Doctrine\\CacheWarmer\\ProxyCacheWarmer', + 'form.type_guesser.doctrine.class' => 'Symfony\\Bridge\\Doctrine\\Form\\DoctrineOrmTypeGuesser', + 'doctrine.orm.validator.unique.class' => 'Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntityValidator', + 'doctrine.orm.validator_initializer.class' => 'Symfony\\Bridge\\Doctrine\\Validator\\DoctrineInitializer', + 'doctrine.orm.security.user.provider.class' => 'Symfony\\Bridge\\Doctrine\\Security\\User\\EntityUserProvider', + 'doctrine.orm.listeners.resolve_target_entity.class' => 'Doctrine\\ORM\\Tools\\ResolveTargetEntityListener', + 'doctrine.orm.listeners.attach_entity_listeners.class' => 'Doctrine\\ORM\\Tools\\AttachEntityListenersListener', + 'doctrine.orm.naming_strategy.default.class' => 'Doctrine\\ORM\\Mapping\\DefaultNamingStrategy', + 'doctrine.orm.naming_strategy.underscore.class' => 'Doctrine\\ORM\\Mapping\\UnderscoreNamingStrategy', + 'doctrine.orm.quote_strategy.default.class' => 'Doctrine\\ORM\\Mapping\\DefaultQuoteStrategy', + 'doctrine.orm.quote_strategy.ansi.class' => 'Doctrine\\ORM\\Mapping\\AnsiQuoteStrategy', + 'doctrine.orm.entity_listener_resolver.class' => 'Doctrine\\ORM\\Mapping\\DefaultEntityListenerResolver', + 'doctrine.orm.second_level_cache.default_cache_factory.class' => 'Doctrine\\ORM\\Cache\\DefaultCacheFactory', + 'doctrine.orm.second_level_cache.default_region.class' => 'Doctrine\\ORM\\Cache\\Region\\DefaultRegion', + 'doctrine.orm.second_level_cache.filelock_region.class' => 'Doctrine\\ORM\\Cache\\Region\\FileLockRegion', + 'doctrine.orm.second_level_cache.logger_chain.class' => 'Doctrine\\ORM\\Cache\\Logging\\CacheLoggerChain', + 'doctrine.orm.second_level_cache.logger_statistics.class' => 'Doctrine\\ORM\\Cache\\Logging\\StatisticsCacheLogger', + 'doctrine.orm.second_level_cache.cache_configuration.class' => 'Doctrine\\ORM\\Cache\\CacheConfiguration', + 'doctrine.orm.second_level_cache.regions_configuration.class' => 'Doctrine\\ORM\\Cache\\RegionsConfiguration', + 'doctrine.orm.auto_generate_proxy_classes' => true, + 'doctrine.orm.proxy_dir' => '/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/doctrine/orm/Proxies', + 'doctrine.orm.proxy_namespace' => 'Proxies', + 'sensio_framework_extra.view.guesser.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\Templating\\TemplateGuesser', + 'sensio_framework_extra.controller.listener.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ControllerListener', + 'sensio_framework_extra.routing.loader.annot_dir.class' => 'Symfony\\Component\\Routing\\Loader\\AnnotationDirectoryLoader', + 'sensio_framework_extra.routing.loader.annot_file.class' => 'Symfony\\Component\\Routing\\Loader\\AnnotationFileLoader', + 'sensio_framework_extra.routing.loader.annot_class.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\Routing\\AnnotatedRouteControllerLoader', + 'sensio_framework_extra.converter.listener.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ParamConverterListener', + 'sensio_framework_extra.converter.manager.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterManager', + 'sensio_framework_extra.converter.doctrine.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DoctrineParamConverter', + 'sensio_framework_extra.converter.datetime.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DateTimeParamConverter', + 'sensio_framework_extra.view.listener.class' => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\TemplateListener', + 'chill_main.installation_name' => 'Chill', + 'chill_main.available_languages' => array( + 0 => 'fr', + ), + 'chill_main.routing.resources' => array( + 0 => '@ChillPersonBundle/Resources/config/routing.yml', + 1 => '@ChillCustomFieldsBundle/Resources/config/routing.yml', + 2 => '@ChillMainBundle/Resources/config/routing.yml', + ), + 'chill_custom_fields.customizables_entities' => array( + 0 => array( + 'class' => 'Chill\\PersonBundle\\Entity\\Person', + 'name' => 'PersonEntity', + 'options' => array( + + ), + ), + ), + 'cl_chill_person.search.use_double_metaphone' => false, + 'web_profiler.controller.profiler.class' => 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\ProfilerController', + 'web_profiler.controller.router.class' => 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\RouterController', + 'web_profiler.controller.exception.class' => 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\ExceptionController', + 'twig.extension.webprofiler.class' => 'Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension', + 'web_profiler.debug_toolbar.position' => 'bottom', + 'sensio_distribution.webconfigurator.class' => 'Sensio\\Bundle\\DistributionBundle\\Configurator\\Configurator', + 'sensio_distribution.webconfigurator.doctrine_step.class' => 'Sensio\\Bundle\\DistributionBundle\\Configurator\\Step\\DoctrineStep', + 'sensio_distribution.webconfigurator.secret_step.class' => 'Sensio\\Bundle\\DistributionBundle\\Configurator\\Step\\SecretStep', + 'sensio_distribution.security_checker.class' => 'SensioLabs\\Security\\SecurityChecker', + 'sensio_distribution.security_checker.command.class' => 'SensioLabs\\Security\\Command\\SecurityCheckerCommand', + 'data_collector.templates' => array( + 'data_collector.config' => array( + 0 => 'config', + 1 => '@WebProfiler/Collector/config.html.twig', + ), + 'data_collector.request' => array( + 0 => 'request', + 1 => '@WebProfiler/Collector/request.html.twig', + ), + 'data_collector.ajax' => array( + 0 => 'ajax', + 1 => '@WebProfiler/Collector/ajax.html.twig', + ), + 'data_collector.exception' => array( + 0 => 'exception', + 1 => '@WebProfiler/Collector/exception.html.twig', + ), + 'data_collector.events' => array( + 0 => 'events', + 1 => '@WebProfiler/Collector/events.html.twig', + ), + 'data_collector.logger' => array( + 0 => 'logger', + 1 => '@WebProfiler/Collector/logger.html.twig', + ), + 'data_collector.time' => array( + 0 => 'time', + 1 => '@WebProfiler/Collector/time.html.twig', + ), + 'data_collector.memory' => array( + 0 => 'memory', + 1 => '@WebProfiler/Collector/memory.html.twig', + ), + 'data_collector.router' => array( + 0 => 'router', + 1 => '@WebProfiler/Collector/router.html.twig', + ), + 'data_collector.form' => array( + 0 => 'form', + 1 => '@WebProfiler/Collector/form.html.twig', + ), + 'data_collector.translation' => array( + 0 => 'translation', + 1 => '@WebProfiler/Collector/translation.html.twig', + ), + 'data_collector.twig' => array( + 0 => 'twig', + 1 => '@WebProfiler/Collector/twig.html.twig', + ), + 'data_collector.security' => array( + 0 => 'security', + 1 => '@Security/Collector/security.html.twig', + ), + 'swiftmailer.data_collector' => array( + 0 => 'swiftmailer', + 1 => '@Swiftmailer/Collector/swiftmailer.html.twig', + ), + 'data_collector.doctrine' => array( + 0 => 'db', + 1 => '@Doctrine/Collector/db.html.twig', + ), + 'data_collector.dump' => array( + 0 => 'dump', + 1 => '@Debug/Profiler/dump.html.twig', + ), + ), + 'console.command.ids' => array( + 0 => 'sensio_distribution.security_checker.command', + ), + ); + } +} diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta new file mode 100644 index 000000000..2905bf191 --- /dev/null +++ b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta @@ -0,0 +1 @@ +a:200:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":102:{s:94:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/AppKernel.php";}i:1;C:46:"Symfony\Component\Config\Resource\FileResource":109:{s:100:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/bootstrap.php.cache";}i:2;C:46:"Symfony\Component\Config\Resource\FileResource":144:{s:135:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php";}i:5;C:46:"Symfony\Component\Config\Resource\FileResource":142:{s:133:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/SecurityBundle.php";}i:8;C:46:"Symfony\Component\Config\Resource\FileResource":134:{s:125:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigBundle.php";}i:11;C:46:"Symfony\Component\Config\Resource\FileResource":114:{s:105:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/MonologBundle.php";}i:14;C:46:"Symfony\Component\Config\Resource\FileResource":122:{s:113:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle/SwiftmailerBundle.php";}i:17;C:46:"Symfony\Component\Config\Resource\FileResource":114:{s:105:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/AsseticBundle.php";}i:20;C:46:"Symfony\Component\Config\Resource\FileResource":117:{s:108:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/DoctrineBundle.php";}i:23;C:46:"Symfony\Component\Config\Resource\FileResource":134:{s:125:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/SensioFrameworkExtraBundle.php";}i:26;C:46:"Symfony\Component\Config\Resource\FileResource":112:{s:103:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/ChillMainBundle.php";}i:29;C:46:"Symfony\Component\Config\Resource\FileResource":129:{s:120:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/ChillCustomFieldsBundle.php";}i:32;C:46:"Symfony\Component\Config\Resource\FileResource":116:{s:107:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/ChillPersonBundle.php";}i:35;C:46:"Symfony\Component\Config\Resource\FileResource":89:{s:81:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/ChillActivityBundle.php";}i:38;C:46:"Symfony\Component\Config\Resource\FileResource":136:{s:127:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle/DebugBundle.php";}i:41;C:46:"Symfony\Component\Config\Resource\FileResource":148:{s:139:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php";}i:44;C:46:"Symfony\Component\Config\Resource\FileResource":162:{s:153:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/SensioDistributionBundle.php";}i:47;C:46:"Symfony\Component\Config\Resource\FileResource":153:{s:144:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/SensioGeneratorBundle.php";}i:50;C:46:"Symfony\Component\Config\Resource\FileResource":177:{s:168:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RoutingResolverPass.php";}i:51;C:46:"Symfony\Component\Config\Resource\FileResource":170:{s:161:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php";}i:52;C:46:"Symfony\Component\Config\Resource\FileResource":173:{s:164:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php";}i:53;C:46:"Symfony\Component\Config\Resource\FileResource":172:{s:163:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php";}i:54;C:46:"Symfony\Component\Config\Resource\FileResource":185:{s:176:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConstraintValidatorsPass.php";}i:55;C:46:"Symfony\Component\Config\Resource\FileResource":186:{s:177:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php";}i:56;C:46:"Symfony\Component\Config\Resource\FileResource":179:{s:170:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php";}i:57;C:46:"Symfony\Component\Config\Resource\FileResource":166:{s:157:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php";}i:58;C:46:"Symfony\Component\Config\Resource\FileResource":172:{s:163:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslatorPass.php";}i:59;C:46:"Symfony\Component\Config\Resource\FileResource":179:{s:170:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/LoggingTranslatorPass.php";}i:60;C:46:"Symfony\Component\Config\Resource\FileResource":176:{s:167:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheWarmerPass.php";}i:61;C:46:"Symfony\Component\Config\Resource\FileResource":177:{s:168:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php";}i:62;C:46:"Symfony\Component\Config\Resource\FileResource":192:{s:183:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php";}i:63;C:46:"Symfony\Component\Config\Resource\FileResource":182:{s:173:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationExtractorPass.php";}i:64;C:46:"Symfony\Component\Config\Resource\FileResource":179:{s:170:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationDumperPass.php";}i:65;C:46:"Symfony\Component\Config\Resource\FileResource":167:{s:158:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/FragmentRendererPass.php";}i:66;C:46:"Symfony\Component\Config\Resource\FileResource":172:{s:163:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/SerializerPass.php";}i:67;C:46:"Symfony\Component\Config\Resource\FileResource":187:{s:178:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php";}i:68;C:46:"Symfony\Component\Config\Resource\FileResource":179:{s:170:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php";}i:69;C:46:"Symfony\Component\Config\Resource\FileResource":178:{s:169:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php";}i:70;C:46:"Symfony\Component\Config\Resource\FileResource":166:{s:157:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php";}i:71;C:46:"Symfony\Component\Config\Resource\FileResource":172:{s:163:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php";}i:72;C:46:"Symfony\Component\Config\Resource\FileResource":167:{s:158:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php";}i:73;C:46:"Symfony\Component\Config\Resource\FileResource":174:{s:165:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php";}i:74;C:46:"Symfony\Component\Config\Resource\FileResource":147:{s:138:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/DependencyInjection/Compiler/LoggerChannelPass.php";}i:75;C:46:"Symfony\Component\Config\Resource\FileResource":146:{s:137:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/DependencyInjection/Compiler/DebugHandlerPass.php";}i:76;C:46:"Symfony\Component\Config\Resource\FileResource":147:{s:138:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/DependencyInjection/Compiler/AddProcessorsPass.php";}i:77;C:46:"Symfony\Component\Config\Resource\FileResource":157:{s:148:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/DependencyInjection/Compiler/AddSwiftMailerTransportPass.php";}i:78;C:46:"Symfony\Component\Config\Resource\FileResource":153:{s:144:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle/DependencyInjection/Compiler/RegisterPluginsPass.php";}i:79;C:46:"Symfony\Component\Config\Resource\FileResource":151:{s:142:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/TemplateResourcesPass.php";}i:80;C:46:"Symfony\Component\Config\Resource\FileResource":152:{s:143:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/CheckClosureFilterPass.php";}i:81;C:46:"Symfony\Component\Config\Resource\FileResource":153:{s:144:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/CheckCssEmbedFilterPass.php";}i:82;C:46:"Symfony\Component\Config\Resource\FileResource":148:{s:139:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/CheckYuiFilterPass.php";}i:83;C:46:"Symfony\Component\Config\Resource\FileResource":149:{s:140:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/SprocketsFilterPass.php";}i:84;C:46:"Symfony\Component\Config\Resource\FileResource":144:{s:135:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/TemplatingPass.php";}i:85;C:46:"Symfony\Component\Config\Resource\FileResource":146:{s:137:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/AssetFactoryPass.php";}i:86;C:46:"Symfony\Component\Config\Resource\FileResource":146:{s:137:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/AssetManagerPass.php";}i:87;C:46:"Symfony\Component\Config\Resource\FileResource":147:{s:138:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/FilterManagerPass.php";}i:88;C:46:"Symfony\Component\Config\Resource\FileResource":148:{s:139:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/Compiler/RouterResourcePass.php";}i:89;C:46:"Symfony\Component\Config\Resource\FileResource":195:{s:186:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php";}i:90;C:46:"Symfony\Component\Config\Resource\FileResource":177:{s:168:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php";}i:91;C:46:"Symfony\Component\Config\Resource\FileResource":150:{s:141:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/DependencyInjection/Compiler/EntityListenerPass.php";}i:92;C:46:"Symfony\Component\Config\Resource\FileResource":158:{s:149:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/DependencyInjection/Compiler/AddParamConverterPass.php";}i:93;C:46:"Symfony\Component\Config\Resource\FileResource":147:{s:138:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/DependencyInjection/Compiler/LegacyPass.php";}i:94;C:46:"Symfony\Component\Config\Resource\FileResource":147:{s:138:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/DependencyInjection/SearchableServicesCompilerPass.php";}i:95;C:46:"Symfony\Component\Config\Resource\FileResource":146:{s:137:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/DependencyInjection/ConfigConsistencyCompilerPass.php";}i:96;C:46:"Symfony\Component\Config\Resource\FileResource":138:{s:129:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/DependencyInjection/TimelineCompilerClass.php";}i:97;C:46:"Symfony\Component\Config\Resource\FileResource":149:{s:140:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/DependencyInjection/CustomFieldCompilerPass.php";}i:98;C:46:"Symfony\Component\Config\Resource\FileResource":175:{s:166:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle/DependencyInjection/Compiler/DumpDataCollectorPass.php";}i:99;C:46:"Symfony\Component\Config\Resource\FileResource":176:{s:167:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/DependencyInjection/Compiler/StepsPass.php";}i:100;C:46:"Symfony\Component\Config\Resource\FileResource":111:{s:102:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/config/config_dev.yml";}i:101;C:46:"Symfony\Component\Config\Resource\FileResource":106:{s:98:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/config/config.yml";}i:102;C:46:"Symfony\Component\Config\Resource\FileResource":111:{s:102:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/config/parameters.yml";}i:103;C:46:"Symfony\Component\Config\Resource\FileResource":168:{s:159:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php";}i:104;C:46:"Symfony\Component\Config\Resource\FileResource":178:{s:169:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php";}i:105;C:46:"Symfony\Component\Config\Resource\FileResource":176:{s:167:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php";}i:153;C:46:"Symfony\Component\Config\Resource\FileResource":175:{s:166:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php";}i:154;C:46:"Symfony\Component\Config\Resource\FileResource":165:{s:156:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php";}i:155;C:46:"Symfony\Component\Config\Resource\FileResource":177:{s:168:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php";}i:156;C:46:"Symfony\Component\Config\Resource\FileResource":172:{s:163:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php";}i:157;C:46:"Symfony\Component\Config\Resource\FileResource":175:{s:166:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php";}i:158;C:46:"Symfony\Component\Config\Resource\FileResource":173:{s:164:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php";}i:159;C:46:"Symfony\Component\Config\Resource\FileResource":173:{s:164:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php";}i:160;C:46:"Symfony\Component\Config\Resource\FileResource":172:{s:163:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php";}i:161;C:46:"Symfony\Component\Config\Resource\FileResource":171:{s:162:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php";}i:163;C:46:"Symfony\Component\Config\Resource\FileResource":169:{s:160:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php";}i:164;C:46:"Symfony\Component\Config\Resource\FileResource":174:{s:165:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php";}i:165;C:46:"Symfony\Component\Config\Resource\FileResource":179:{s:170:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php";}i:166;C:46:"Symfony\Component\Config\Resource\FileResource":157:{s:148:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php";}i:167;C:46:"Symfony\Component\Config\Resource\FileResource":189:{s:180:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php";}i:171;C:46:"Symfony\Component\Config\Resource\FileResource":167:{s:158:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php";}i:172;C:46:"Symfony\Component\Config\Resource\FileResource":156:{s:147:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php";}i:173;C:46:"Symfony\Component\Config\Resource\FileResource":155:{s:146:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Extension/Extension.php";}i:174;C:46:"Symfony\Component\Config\Resource\FileResource":149:{s:140:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml";}i:175;C:46:"Symfony\Component\Config\Resource\FileResource":154:{s:145:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml";}i:176;C:46:"Symfony\Component\Config\Resource\FileResource":163:{s:154:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/fragment_renderer.xml";}i:177;C:46:"Symfony\Component\Config\Resource\FileResource":157:{s:148:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml";}i:178;C:46:"Symfony\Component\Config\Resource\FileResource":161:{s:152:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/property_access.xml";}i:179;C:46:"Symfony\Component\Config\Resource\FileResource":150:{s:141:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml";}i:180;C:46:"Symfony\Component\Config\Resource\FileResource":153:{s:144:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml";}i:181;C:46:"Symfony\Component\Config\Resource\FileResource":154:{s:145:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/security.xml";}i:182;C:46:"Symfony\Component\Config\Resource\FileResource":150:{s:141:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml";}i:183;C:46:"Symfony\Component\Config\Resource\FileResource":155:{s:146:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form_csrf.xml";}i:184;C:46:"Symfony\Component\Config\Resource\FileResource":159:{s:150:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/security_csrf.xml";}i:185;C:46:"Symfony\Component\Config\Resource\FileResource":152:{s:143:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/assets.xml";}i:186;C:46:"Symfony\Component\Config\Resource\FileResource":156:{s:147:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating.xml";}i:187;C:46:"Symfony\Component\Config\Resource\FileResource":155:{s:146:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml";}i:188;C:46:"Symfony\Component\Config\Resource\FileResource":148:{s:139:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml";}i:189;C:46:"Symfony\Component\Config\Resource\FileResource":126:{s:117:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/config/validation.yml";}i:190;C:51:"Symfony\Component\Config\Resource\DirectoryResource":160:{a:2:{i:0;s:135:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations";i:1;N;}}i:191;C:51:"Symfony\Component\Config\Resource\DirectoryResource":155:{a:2:{i:0;s:130:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations";i:1;N;}}i:192;C:51:"Symfony\Component\Config\Resource\DirectoryResource":177:{a:2:{i:0;s:152:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations";i:1;N;}}i:193;C:51:"Symfony\Component\Config\Resource\DirectoryResource":131:{a:2:{i:0;s:106:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/translations";i:1;N;}}i:194;C:51:"Symfony\Component\Config\Resource\DirectoryResource":140:{a:2:{i:0;s:115:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/translations";i:1;N;}}i:195;C:51:"Symfony\Component\Config\Resource\DirectoryResource":133:{a:2:{i:0;s:108:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations";i:1;N;}}i:196;C:51:"Symfony\Component\Config\Resource\DirectoryResource":104:{a:2:{i:0;s:80:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/translations";i:1;N;}}i:197;C:46:"Symfony\Component\Config\Resource\FileResource":155:{s:146:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml";}i:198;C:46:"Symfony\Component\Config\Resource\FileResource":156:{s:147:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml";}i:199;C:46:"Symfony\Component\Config\Resource\FileResource":156:{s:147:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form_debug.xml";}i:200;C:46:"Symfony\Component\Config\Resource\FileResource":163:{s:154:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_debug.xml";}i:201;C:46:"Symfony\Component\Config\Resource\FileResource":153:{s:144:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml";}i:202;C:46:"Symfony\Component\Config\Resource\FileResource":157:{s:148:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.xml";}i:203;C:46:"Symfony\Component\Config\Resource\FileResource":156:{s:147:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml";}i:204;C:46:"Symfony\Component\Config\Resource\FileResource":151:{s:142:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml";}i:205;C:46:"Symfony\Component\Config\Resource\FileResource":165:{s:156:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php";}i:208;C:46:"Symfony\Component\Config\Resource\FileResource":153:{s:144:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml";}i:209;C:46:"Symfony\Component\Config\Resource\FileResource":163:{s:154:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.xml";}i:210;C:46:"Symfony\Component\Config\Resource\FileResource":164:{s:155:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/security_rememberme.xml";}i:211;C:46:"Symfony\Component\Config\Resource\FileResource":159:{s:150:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_php.xml";}i:212;C:46:"Symfony\Component\Config\Resource\FileResource":160:{s:151:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/templating_twig.xml";}i:213;C:46:"Symfony\Component\Config\Resource\FileResource":155:{s:146:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml";}i:214;C:46:"Symfony\Component\Config\Resource\FileResource":157:{s:148:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php";}i:217;C:46:"Symfony\Component\Config\Resource\FileResource":145:{s:136:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml";}i:218;C:46:"Symfony\Component\Config\Resource\FileResource":157:{s:148:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php";}i:219;C:46:"Symfony\Component\Config\Resource\FileResource":137:{s:128:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/DependencyInjection/MonologExtension.php";}i:222;C:46:"Symfony\Component\Config\Resource\FileResource":134:{s:125:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php";}i:223;C:46:"Symfony\Component\Config\Resource\FileResource":125:{s:116:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/Resources/config/monolog.xml";}i:224;C:46:"Symfony\Component\Config\Resource\FileResource":145:{s:136:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle/DependencyInjection/SwiftmailerExtension.php";}i:227;C:46:"Symfony\Component\Config\Resource\FileResource":133:{s:124:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle/Resources/config/swiftmailer.xml";}i:228;C:46:"Symfony\Component\Config\Resource\FileResource":137:{s:128:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/DependencyInjection/AsseticExtension.php";}i:231;C:46:"Symfony\Component\Config\Resource\FileResource":125:{s:116:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/Resources/config/assetic.xml";}i:232;C:46:"Symfony\Component\Config\Resource\FileResource":133:{s:124:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/Resources/config/templating_twig.xml";}i:233;C:46:"Symfony\Component\Config\Resource\FileResource":132:{s:123:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/Resources/config/templating_php.xml";}i:234;C:46:"Symfony\Component\Config\Resource\FileResource":136:{s:127:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/Resources/config/filters/cssrewrite.xml";}i:235;C:46:"Symfony\Component\Config\Resource\FileResource":140:{s:131:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/DependencyInjection/DoctrineExtension.php";}i:236;C:46:"Symfony\Component\Config\Resource\FileResource":167:{s:158:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php";}i:239;C:46:"Symfony\Component\Config\Resource\FileResource":170:{s:161:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-cache-bundle/Doctrine/Bundle/DoctrineCacheBundle/Resources/config/services.xml";}i:240;C:46:"Symfony\Component\Config\Resource\FileResource":124:{s:115:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/Resources/config/dbal.xml";}i:241;C:46:"Symfony\Component\Config\Resource\FileResource":123:{s:114:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/Resources/config/orm.xml";}i:242;C:46:"Symfony\Component\Config\Resource\FileResource":141:{s:132:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config";}i:243;C:46:"Symfony\Component\Config\Resource\FileResource":124:{s:115:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle";}i:244;C:46:"Symfony\Component\Config\Resource\FileResource":140:{s:131:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config";}i:245;C:46:"Symfony\Component\Config\Resource\FileResource":123:{s:114:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle";}i:246;C:46:"Symfony\Component\Config\Resource\FileResource":136:{s:127:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config";}i:247;C:46:"Symfony\Component\Config\Resource\FileResource":119:{s:110:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle";}i:248;C:46:"Symfony\Component\Config\Resource\FileResource":113:{s:104:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle/Resources/config";}i:249;C:46:"Symfony\Component\Config\Resource\FileResource":95:{s:87:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/monolog-bundle";}i:250;C:46:"Symfony\Component\Config\Resource\FileResource":117:{s:108:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle/Resources/config";}i:251;C:46:"Symfony\Component\Config\Resource\FileResource":99:{s:91:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle";}i:252;C:46:"Symfony\Component\Config\Resource\FileResource":113:{s:104:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle/Resources/config";}i:253;C:46:"Symfony\Component\Config\Resource\FileResource":95:{s:87:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/assetic-bundle";}i:254;C:46:"Symfony\Component\Config\Resource\FileResource":115:{s:106:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/Resources/config";}i:255;C:46:"Symfony\Component\Config\Resource\FileResource":97:{s:89:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle";}i:256;C:46:"Symfony\Component\Config\Resource\FileResource":120:{s:111:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config";}i:257;C:46:"Symfony\Component\Config\Resource\FileResource":102:{s:94:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle";}i:258;C:46:"Symfony\Component\Config\Resource\FileResource":118:{s:109:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/config/doctrine";}i:259;C:46:"Symfony\Component\Config\Resource\FileResource":127:{s:118:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/config/doctrine";}i:260;C:46:"Symfony\Component\Config\Resource\FileResource":120:{s:111:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/config/doctrine";}i:261;C:46:"Symfony\Component\Config\Resource\FileResource":91:{s:83:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/config/doctrine";}i:262;C:46:"Symfony\Component\Config\Resource\FileResource":137:{s:128:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle/Resources/config";}i:263;C:46:"Symfony\Component\Config\Resource\FileResource":120:{s:111:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle";}i:264;C:46:"Symfony\Component\Config\Resource\FileResource":143:{s:134:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config";}i:265;C:46:"Symfony\Component\Config\Resource\FileResource":126:{s:117:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle";}i:266;C:46:"Symfony\Component\Config\Resource\FileResource":150:{s:141:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config";}i:267;C:46:"Symfony\Component\Config\Resource\FileResource":133:{s:124:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle";}i:268;C:46:"Symfony\Component\Config\Resource\FileResource":137:{s:128:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources";}i:269;C:46:"Symfony\Component\Config\Resource\FileResource":127:{s:118:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle";}i:270;C:46:"Symfony\Component\Config\Resource\FileResource":157:{s:148:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/DependencyInjection/SensioFrameworkExtraExtension.php";}i:273;C:46:"Symfony\Component\Config\Resource\FileResource":141:{s:132:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/DependencyInjection/Configuration.php";}i:274;C:46:"Symfony\Component\Config\Resource\FileResource":133:{s:124:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config/services.xml";}i:275;C:46:"Symfony\Component\Config\Resource\FileResource":136:{s:127:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config/annotations.xml";}i:276;C:46:"Symfony\Component\Config\Resource\FileResource":132:{s:123:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config/routing.xml";}i:277;C:46:"Symfony\Component\Config\Resource\FileResource":135:{s:126:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config/converters.xml";}i:278;C:46:"Symfony\Component\Config\Resource\FileResource":129:{s:120:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config/view.xml";}i:279;C:46:"Symfony\Component\Config\Resource\FileResource":130:{s:121:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config/cache.xml";}i:280;C:46:"Symfony\Component\Config\Resource\FileResource":133:{s:124:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/framework-extra-bundle/Resources/config/security.xml";}i:281;C:46:"Symfony\Component\Config\Resource\FileResource":135:{s:126:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/DependencyInjection/ChillMainExtension.php";}i:284;C:46:"Symfony\Component\Config\Resource\FileResource":122:{s:113:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/config/services.yml";}i:285;C:46:"Symfony\Component\Config\Resource\FileResource":152:{s:143:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/DependencyInjection/ChillCustomFieldsExtension.php";}i:288;C:46:"Symfony\Component\Config\Resource\FileResource":131:{s:122:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/config/services.yml";}i:289;C:46:"Symfony\Component\Config\Resource\FileResource":139:{s:130:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/DependencyInjection/ChillPersonExtension.php";}i:292;C:46:"Symfony\Component\Config\Resource\FileResource":124:{s:115:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/config/services.yml";}i:293;C:46:"Symfony\Component\Config\Resource\FileResource":113:{s:104:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/DependencyInjection/ChillActivityExtension.php";}i:296;C:46:"Symfony\Component\Config\Resource\FileResource":95:{s:87:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/config/services.yml";}i:297;C:46:"Symfony\Component\Config\Resource\FileResource":159:{s:150:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php";}i:300;C:46:"Symfony\Component\Config\Resource\FileResource":150:{s:141:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle/Resources/config/services.xml";}i:301;C:46:"Symfony\Component\Config\Resource\FileResource":171:{s:162:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php";}i:304;C:46:"Symfony\Component\Config\Resource\FileResource":164:{s:155:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php";}i:305;C:46:"Symfony\Component\Config\Resource\FileResource":156:{s:147:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml";}i:306;C:46:"Symfony\Component\Config\Resource\FileResource":185:{s:176:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/DependencyInjection/SensioDistributionExtension.php";}i:309;C:46:"Symfony\Component\Config\Resource\FileResource":170:{s:161:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/webconfigurator.xml";}i:310;C:46:"Symfony\Component\Config\Resource\FileResource":163:{s:154:"/Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/config/security.xml";}} \ No newline at end of file diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml new file mode 100644 index 000000000..5bf68a34e --- /dev/null +++ b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml @@ -0,0 +1,3568 @@ + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app + dev + true + app + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/logs + + Symfony\Bundle\FrameworkBundle\FrameworkBundle + Symfony\Bundle\SecurityBundle\SecurityBundle + Symfony\Bundle\TwigBundle\TwigBundle + Symfony\Bundle\MonologBundle\MonologBundle + Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle + Symfony\Bundle\AsseticBundle\AsseticBundle + Doctrine\Bundle\DoctrineBundle\DoctrineBundle + Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle + Chill\MainBundle\ChillMainBundle + Chill\CustomFieldsBundle\ChillCustomFieldsBundle + Chill\PersonBundle\ChillPersonBundle + Chill\ActivityBundle\ChillActivityBundle + Symfony\Bundle\DebugBundle\DebugBundle + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle + Sensio\Bundle\DistributionBundle\SensioDistributionBundle + Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle + + UTF-8 + appDevDebugProjectContainer + 127.0.0.1 + 5432 + chill_test + chill + chill + fr + Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver + Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser + Symfony\Component\HttpKernel\EventListener\ResponseListener + Symfony\Component\HttpKernel\EventListener\StreamedResponseListener + Symfony\Component\HttpKernel\EventListener\LocaleListener + Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher + Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel + Symfony\Component\Filesystem\Filesystem + Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate + Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer + Symfony\Component\HttpKernel\Config\FileLocator + Symfony\Component\HttpKernel\UriSigner + Symfony\Component\HttpFoundation\RequestStack + Symfony\Component\HttpKernel\DependencyInjection\LazyLoadingFragmentHandler + Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer + Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer + null + Symfony\Component\HttpKernel\Fragment\EsiFragmentRenderer + /_fragment + Symfony\Bundle\FrameworkBundle\Translation\Translator + Symfony\Component\Translation\IdentityTranslator + Symfony\Component\Translation\MessageSelector + Symfony\Component\Translation\Loader\PhpFileLoader + Symfony\Component\Translation\Loader\YamlFileLoader + Symfony\Component\Translation\Loader\XliffFileLoader + Symfony\Component\Translation\Loader\PoFileLoader + Symfony\Component\Translation\Loader\MoFileLoader + Symfony\Component\Translation\Loader\QtFileLoader + Symfony\Component\Translation\Loader\CsvFileLoader + Symfony\Component\Translation\Loader\IcuResFileLoader + Symfony\Component\Translation\Loader\IcuDatFileLoader + Symfony\Component\Translation\Loader\IniFileLoader + Symfony\Component\Translation\Loader\JsonFileLoader + Symfony\Component\Translation\Dumper\PhpFileDumper + Symfony\Component\Translation\Dumper\XliffFileDumper + Symfony\Component\Translation\Dumper\PoFileDumper + Symfony\Component\Translation\Dumper\MoFileDumper + Symfony\Component\Translation\Dumper\YamlFileDumper + Symfony\Component\Translation\Dumper\QtFileDumper + Symfony\Component\Translation\Dumper\CsvFileDumper + Symfony\Component\Translation\Dumper\IniFileDumper + Symfony\Component\Translation\Dumper\JsonFileDumper + Symfony\Component\Translation\Dumper\IcuResFileDumper + Symfony\Bundle\FrameworkBundle\Translation\PhpExtractor + Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader + Symfony\Component\Translation\Extractor\ChainExtractor + Symfony\Component\Translation\Writer\TranslationWriter + Symfony\Component\PropertyAccess\PropertyAccessor + Not very secret + true + + + fr + Symfony\Bundle\FrameworkBundle\Client + + Symfony\Component\BrowserKit\History + Symfony\Component\BrowserKit\CookieJar + Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener + Symfony\Component\HttpFoundation\Session\Session + Symfony\Component\HttpFoundation\Session\Flash\FlashBag + Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag + Symfony\Component\HttpFoundation\Session\Storage\MetadataBag + _sf2_meta + Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage + Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage + Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage + Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler + Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler + Symfony\Bundle\FrameworkBundle\EventListener\SessionListener + + 1 + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/sessions + 0 + Symfony\Component\Security\Core\Util\SecureRandom + Symfony\Component\Form\ResolvedFormTypeFactory + Symfony\Component\Form\FormRegistry + Symfony\Component\Form\FormFactory + Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension + Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser + Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler + true + _token + Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator + Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage + Symfony\Component\Security\Csrf\CsrfTokenManager + Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine + Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser + Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser + Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer + Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator + Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader + Symfony\Component\Templating\Loader\CacheLoader + Symfony\Component\Templating\Loader\ChainLoader + Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder + Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper + Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper + null + null + + twig + + Symfony\Component\Validator\Validator\ValidatorInterface + Symfony\Component\Validator\ValidatorBuilderInterface + Symfony\Component\Validator\Validation + Symfony\Component\Validator\Mapping\Cache\ApcCache + + Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory + Symfony\Component\Validator\Constraints\ExpressionValidator + Symfony\Component\Validator\Constraints\EmailValidator + validators + 2.5-bc + true + Symfony\Component\HttpKernel\Profiler\Profiler + Symfony\Component\HttpKernel\EventListener\ProfilerListener + Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector + Symfony\Component\HttpKernel\DataCollector\RequestDataCollector + Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector + Symfony\Component\HttpKernel\DataCollector\EventDataCollector + Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector + Symfony\Component\HttpKernel\DataCollector\TimeDataCollector + Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector + Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector + Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeFactoryDataCollectorProxy + Symfony\Component\Form\Extension\DataCollector\Type\DataCollectorTypeExtension + Symfony\Component\Form\Extension\DataCollector\FormDataCollector + Symfony\Component\Form\Extension\DataCollector\FormDataExtractor + false + false + file:/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/profiler + + + 86400 + Symfony\Bundle\FrameworkBundle\Routing\Router + Symfony\Component\Routing\RequestContext + Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader + Symfony\Component\Config\Loader\LoaderResolver + Symfony\Component\Routing\Loader\XmlFileLoader + Symfony\Component\Routing\Loader\YamlFileLoader + Symfony\Component\Routing\Loader\PhpFileLoader + Symfony\Component\Routing\Generator\UrlGenerator + Symfony\Component\Routing\Generator\UrlGenerator + Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper + Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher + Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher + Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper + Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer + appDevUrlMatcher + appDevUrlGenerator + Symfony\Component\HttpKernel\EventListener\RouterListener + localhost + http + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/config/routing.yml + appDev + 80 + 443 + Doctrine\Common\Annotations\AnnotationReader + Doctrine\Common\Annotations\CachedReader + Doctrine\Common\Annotations\FileCacheReader + Symfony\Component\HttpKernel\EventListener\DebugHandlersListener + Symfony\Component\Stopwatch\Stopwatch + -1 + Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml + Symfony\Component\HttpKernel\Controller\TraceableControllerResolver + Symfony\Component\Security\Core\SecurityContext + Symfony\Component\Security\Core\User\UserChecker + Symfony\Component\Security\Core\Encoder\EncoderFactory + Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder + Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder + Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder + Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder + Symfony\Component\Security\Core\User\InMemoryUserProvider + Symfony\Component\Security\Core\User\User + Symfony\Component\Security\Core\User\ChainUserProvider + Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver + Symfony\Component\Security\Core\Authentication\Token\AnonymousToken + Symfony\Component\Security\Core\Authentication\Token\RememberMeToken + Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager + Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy + Symfony\Component\Security\Core\Authorization\AccessDecisionManager + Symfony\Component\Security\Core\Authorization\Voter\RoleVoter + Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter + Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter + Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter + Symfony\Component\Security\Http\Firewall + Symfony\Bundle\SecurityBundle\Security\FirewallMap + Symfony\Bundle\SecurityBundle\Security\FirewallContext + Symfony\Component\HttpFoundation\RequestMatcher + Symfony\Component\HttpFoundation\ExpressionRequestMatcher + Symfony\Component\Security\Core\Role\RoleHierarchy + Symfony\Component\Security\Http\HttpUtils + Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator + Symfony\Component\Security\Core\Authorization\ExpressionLanguage + Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint + Symfony\Component\Security\Http\Firewall\ChannelListener + Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint + Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener + Symfony\Component\Security\Http\Firewall\SimpleFormAuthenticationListener + Symfony\Component\Security\Http\Firewall\SimplePreAuthenticationListener + Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener + Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint + Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener + Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint + Symfony\Component\Security\Http\Firewall\X509AuthenticationListener + Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener + Symfony\Component\Security\Http\Firewall\SwitchUserListener + Symfony\Component\Security\Http\Firewall\LogoutListener + Symfony\Component\Security\Http\Logout\SessionLogoutHandler + Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler + Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler + Symfony\Component\Security\Http\Firewall\AccessListener + Symfony\Component\Security\Http\AccessMap + Symfony\Component\Security\Http\Firewall\ExceptionListener + Symfony\Component\Security\Http\Firewall\ContextListener + Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider + Symfony\Component\Security\Core\Authentication\Provider\SimpleAuthenticationProvider + Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider + Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider + Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler + Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler + Symfony\Component\Security\Http\Authentication\SimpleAuthenticationHandler + Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider + Symfony\Component\Security\Http\Firewall\RememberMeListener + Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider + Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices + Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices + Symfony\Component\Security\Http\RememberMe\ResponseListener + Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper + Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper + Symfony\Bridge\Twig\Extension\LogoutUrlExtension + Symfony\Bridge\Twig\Extension\SecurityExtension + Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector + null + true + migrate + false + true + + + CHILL_PERSON_SEE + + + CHILL_PERSON_SEE + + + Twig_Environment + Symfony\Bundle\TwigBundle\Loader\FilesystemLoader + Twig_Loader_Chain + Symfony\Bundle\TwigBundle\TwigEngine + Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer + Symfony\Bridge\Twig\Extension\TranslationExtension + Symfony\Bundle\TwigBundle\Extension\ActionsExtension + Symfony\Bridge\Twig\Extension\CodeExtension + Symfony\Bridge\Twig\Extension\RoutingExtension + Symfony\Bridge\Twig\Extension\YamlExtension + Symfony\Bridge\Twig\Extension\FormExtension + Symfony\Bridge\Twig\Extension\HttpKernelExtension + Symfony\Bridge\Twig\Extension\StopwatchExtension + Symfony\Bridge\Twig\Extension\ExpressionExtension + Symfony\Bridge\Twig\Form\TwigRendererEngine + Symfony\Bridge\Twig\Form\TwigRenderer + Symfony\Bridge\Twig\Translation\TwigExtractor + Symfony\Component\HttpKernel\EventListener\ExceptionListener + Symfony\Bundle\TwigBundle\Controller\ExceptionController + Symfony\Bundle\TwigBundle\Controller\PreviewErrorController + twig.controller.exception:showAction + + form_div_layout.html.twig + ChillCustomFieldsBundle:Form:fields.html.twig + ChillMainBundle:Form:fields.html.twig + + Symfony\Bridge\Monolog\Logger + Gelf\MessagePublisher + Gelf\Publisher + Monolog\Handler\StreamHandler + Symfony\Bridge\Monolog\Handler\ConsoleHandler + Monolog\Handler\GroupHandler + Monolog\Handler\BufferHandler + Monolog\Handler\RotatingFileHandler + Monolog\Handler\SyslogHandler + Monolog\Handler\SyslogUdpHandler + Monolog\Handler\NullHandler + Monolog\Handler\TestHandler + Monolog\Handler\GelfHandler + Monolog\Handler\RollbarHandler + Monolog\Handler\FlowdockHandler + Monolog\Handler\BrowserConsoleHandler + Symfony\Bridge\Monolog\Handler\FirePHPHandler + Symfony\Bridge\Monolog\Handler\ChromePhpHandler + Symfony\Bridge\Monolog\Handler\DebugHandler + Symfony\Bridge\Monolog\Handler\SwiftMailerHandler + Monolog\Handler\NativeMailerHandler + Monolog\Handler\SocketHandler + Monolog\Handler\PushoverHandler + Monolog\Handler\RavenHandler + Monolog\Handler\NewRelicHandler + Monolog\Handler\HipChatHandler + Monolog\Handler\SlackHandler + Monolog\Handler\CubeHandler + Monolog\Handler\AmqpHandler + Monolog\Handler\ErrorLogHandler + Monolog\Handler\LogglyHandler + Monolog\Handler\LogEntriesHandler + Monolog\Handler\WhatFailureGroupHandler + Symfony\Bundle\MonologBundle\NotFoundActivationStrategy + Monolog\Handler\FingersCrossedHandler + Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy + Monolog\Handler\FilterHandler + Monolog\Handler\MongoDBHandler + MongoClient + Monolog\Handler\ElasticSearchHandler + Elastica\Client + + + Swift_Mailer + Swift_Transport_SendmailTransport + Swift_Transport_MailTransport + Swift_Transport_FailoverTransport + Swift_Plugins_RedirectingPlugin + Swift_Plugins_ImpersonatePlugin + Swift_Plugins_MessageLogger + Swift_Plugins_AntiFloodPlugin + Swift_Transport_EsmtpTransport + Swift_Plugins_BlackholePlugin + Swift_FileSpool + Swift_MemorySpool + Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener + Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector + smtp + true + null + 25 + localhost + null + null + null + 30 + null + false + null + null + false + true + null + + swiftmailer.mailer.default + + default + Symfony\Bundle\AsseticBundle\Factory\AssetFactory + Assetic\Factory\LazyAssetManager + Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer + Assetic\Factory\Loader\CachedFormulaLoader + Assetic\Cache\ConfigCache + Symfony\Bundle\AsseticBundle\Factory\Loader\ConfigurationLoader + Symfony\Bundle\AsseticBundle\Factory\Resource\ConfigurationResource + Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource + Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource + Symfony\Bundle\AsseticBundle\FilterManager + Assetic\Factory\Worker\EnsureFilterWorker + Assetic\Factory\Worker\CacheBustingWorker + Symfony\Bundle\AsseticBundle\DefaultValueSupplier + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/assetic + + ChillPersonBundle + ChillMainBundle + + Symfony\Bundle\AsseticBundle\Twig\AsseticExtension + Assetic\Extension\Twig\TwigFormulaLoader + Symfony\Bundle\AsseticBundle\Templating\DynamicAsseticHelper + Symfony\Bundle\AsseticBundle\Templating\StaticAsseticHelper + Symfony\Bundle\AsseticBundle\Factory\Loader\AsseticHelperFormulaLoader + true + false + false + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/../web + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/../web + + /usr/bin/java + /usr/local/bin/node + /usr/local/opt/ruby/bin/ruby + /usr/local/bin/sass + Assetic\Filter\CssRewriteFilter + + Doctrine\Common\Cache\ApcCache + Doctrine\Common\Cache\ArrayCache + Doctrine\Common\Cache\FilesystemCache + Doctrine\Common\Cache\PhpFileCache + Doctrine\Common\Cache\MongoDBCache + MongoCollection + MongoClient + localhost:27017 + Doctrine\Common\Cache\RiakCache + Riak\Bucket + Riak\Connection + Riak\BucketPropertyList + localhost + 8087 + Doctrine\Common\Cache\MemcacheCache + Memcache + localhost + 11211 + Doctrine\Common\Cache\MemcachedCache + Memcached + localhost + 11211 + Doctrine\Common\Cache\RedisCache + Redis + localhost + 6379 + Doctrine\Common\Cache\CouchbaseCache + Couchbase + localhost:8091 + Doctrine\Common\Cache\WinCacheCache + Doctrine\Common\Cache\XcacheCache + Doctrine\Common\Cache\ZendDataCache + Doctrine\Bundle\DoctrineCacheBundle\Acl\Model\AclCache + Doctrine\DBAL\Logging\LoggerChain + Doctrine\DBAL\Logging\DebugStack + Symfony\Bridge\Doctrine\Logger\DbalLogger + Doctrine\DBAL\Configuration + Doctrine\Bundle\DoctrineBundle\DataCollector\DoctrineDataCollector + Symfony\Bridge\Doctrine\ContainerAwareEventManager + Doctrine\Bundle\DoctrineBundle\ConnectionFactory + Doctrine\DBAL\Event\Listeners\MysqlSessionInit + Doctrine\DBAL\Event\Listeners\OracleSessionInit + Doctrine\Bundle\DoctrineBundle\Registry + + doctrine.orm.default_entity_manager + + default + + + doctrine.dbal.default_connection + + default + Doctrine\ORM\Configuration + Doctrine\ORM\EntityManager + Doctrine\Bundle\DoctrineBundle\ManagerConfigurator + Doctrine\Common\Cache\ArrayCache + Doctrine\Common\Cache\ApcCache + Doctrine\Common\Cache\MemcacheCache + localhost + 11211 + Memcache + Doctrine\Common\Cache\MemcachedCache + localhost + 11211 + Memcached + Doctrine\Common\Cache\RedisCache + localhost + 6379 + Redis + Doctrine\Common\Cache\XcacheCache + Doctrine\Common\Cache\WinCacheCache + Doctrine\Common\Cache\ZendDataCache + Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain + Doctrine\ORM\Mapping\Driver\AnnotationDriver + Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver + Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver + Doctrine\ORM\Mapping\Driver\PHPDriver + Doctrine\ORM\Mapping\Driver\StaticPHPDriver + Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer + Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser + Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator + Symfony\Bridge\Doctrine\Validator\DoctrineInitializer + Symfony\Bridge\Doctrine\Security\User\EntityUserProvider + Doctrine\ORM\Tools\ResolveTargetEntityListener + Doctrine\ORM\Tools\AttachEntityListenersListener + Doctrine\ORM\Mapping\DefaultNamingStrategy + Doctrine\ORM\Mapping\UnderscoreNamingStrategy + Doctrine\ORM\Mapping\DefaultQuoteStrategy + Doctrine\ORM\Mapping\AnsiQuoteStrategy + Doctrine\ORM\Mapping\DefaultEntityListenerResolver + Doctrine\ORM\Cache\DefaultCacheFactory + Doctrine\ORM\Cache\Region\DefaultRegion + Doctrine\ORM\Cache\Region\FileLockRegion + Doctrine\ORM\Cache\Logging\CacheLoggerChain + Doctrine\ORM\Cache\Logging\StatisticsCacheLogger + Doctrine\ORM\Cache\CacheConfiguration + Doctrine\ORM\Cache\RegionsConfiguration + true + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/doctrine/orm/Proxies + Proxies + Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser + Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener + Symfony\Component\Routing\Loader\AnnotationDirectoryLoader + Symfony\Component\Routing\Loader\AnnotationFileLoader + Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader + Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener + Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager + Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter + Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter + Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener + Chill + + fr + + + @ChillPersonBundle/Resources/config/routing.yml + @ChillCustomFieldsBundle/Resources/config/routing.yml + @ChillMainBundle/Resources/config/routing.yml + + + + Chill\PersonBundle\Entity\Person + PersonEntity + + + + false + Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController + Symfony\Bundle\WebProfilerBundle\Controller\RouterController + Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController + Symfony\Bundle\WebProfilerBundle\Twig\WebProfilerExtension + bottom + Sensio\Bundle\DistributionBundle\Configurator\Configurator + Sensio\Bundle\DistributionBundle\Configurator\Step\DoctrineStep + Sensio\Bundle\DistributionBundle\Configurator\Step\SecretStep + SensioLabs\Security\SecurityChecker + SensioLabs\Security\Command\SecurityCheckerCommand + + + config + @WebProfiler/Collector/config.html.twig + + + request + @WebProfiler/Collector/request.html.twig + + + ajax + @WebProfiler/Collector/ajax.html.twig + + + exception + @WebProfiler/Collector/exception.html.twig + + + events + @WebProfiler/Collector/events.html.twig + + + logger + @WebProfiler/Collector/logger.html.twig + + + time + @WebProfiler/Collector/time.html.twig + + + memory + @WebProfiler/Collector/memory.html.twig + + + router + @WebProfiler/Collector/router.html.twig + + + form + @WebProfiler/Collector/form.html.twig + + + translation + @WebProfiler/Collector/translation.html.twig + + + twig + @WebProfiler/Collector/twig.html.twig + + + security + @Security/Collector/security.html.twig + + + swiftmailer + @Swiftmailer/Collector/swiftmailer.html.twig + + + db + @Doctrine/Collector/db.html.twig + + + dump + @Debug/Profiler/dump.html.twig + + + + sensio_distribution.security_checker.command + + + + + + + + + + UTF-8 + + + + + + + fr + + + + + + + + + + + + + + false + + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources + + + Not very secret + + + + true + + + inline + fragment.renderer.inline + + + hinclude + fragment.renderer.hinclude + + + hinclude + fragment.renderer.hinclude + + + esi + fragment.renderer.esi + + + ssi + fragment.renderer.ssi + + + + + + + + /_fragment + + + + + + + + null + + /_fragment + + + + + null + + + + /_fragment + + + + + null + + + + /_fragment + + + + + + + + + + php + + + yml + + + xlf + xliff + + + po + + + mo + + + ts + + + csv + + + res + + + dat + + + ini + + + json + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/translations + true + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ar.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ar.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.az.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.az.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.bg.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ca.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ca.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.cs.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.cs.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.da.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.da.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.de.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.de.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.el.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.el.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.en.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.en.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/messages.en.yml + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.es.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.es.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.et.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.eu.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fa.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.fa.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fi.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.fr.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.fr.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/translations/messages.fr.yml + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/translations/messages.fr.yml + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/messages.fr.yml + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/validators.fr.yml + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/translations/messages.fr.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.gl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.gl.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.he.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.he.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hr.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hu.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.hu.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.hy.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.id.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.it.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.it.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ja.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lb.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.lb.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lt.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.mn.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.nb.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.nl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.nl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/translations/messages.nl.yml + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/translations/messages.nl.yml + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/messages.nl.yml + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/translations/validators.nl.yml + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.no.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.pl.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.pt_BR.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.pt_BR.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ro.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ro.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.ru.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ru.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sk.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sk.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sl.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Cyrl.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sr_Cyrl.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sr_Latn.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sr_Latn.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.sv.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.sv.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.tr.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.uk.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.zh_CN.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/translations/validators.lv.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.pt_PT.xlf + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Exception/../Resources/translations/security.ua.xlf + + + + + + + fr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + php + + + + yml + + + + xlf + + + + xliff + + + + po + + + + mo + + + + ts + + + + csv + + + + res + + + + dat + + + + ini + + + + json + + + + + + php + + + + twig + + + + + + php + + + + xlf + + + + po + + + + mo + + + + yml + + + + ts + + + + csv + + + + ini + + + + json + + + + res + + + + + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + _sf2_meta + 0 + + + + 1 + + + + + + + + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/secure_random.seed + + + + + + + + + + + + + + + form.type.form + form.type.birthday + form.type.checkbox + form.type.choice + form.type.collection + form.type.country + form.type.date + form.type.datetime + form.type.email + form.type.file + form.type.hidden + form.type.integer + form.type.language + form.type.locale + form.type.money + form.type.number + form.type.password + form.type.percent + form.type.radio + form.type.repeated + form.type.search + form.type.textarea + form.type.text + form.type.time + form.type.timezone + form.type.url + form.type.button + form.type.submit + form.type.reset + form.type.currency + form.type.entity + chill.main.form.type.translatable.string + chill.main.form.type.select2choice + chill.main.form.type.select2entity + chill.main.form.type.select2country + chill.main.form.type.select2language + chill.main.form.type.center + chill.custom_field.custom_field_choice_type + chill.custom_field.custom_fields_group_type + chill.custom_field.custom_field_type + chill.custom_field.custom_fields_group_linked_custom_fields + chill.custom_field.custom_fields_title_type + chill.person.accompanying_period_closing_motive + + + + form.type_extension.form.http_foundation + form.type_extension.form.validator + form.type_extension.csrf + form.type_extension.form.data_collector + + + form.type_extension.repeated.validator + + + form.type_extension.submit.validator + + + + form.type_guesser.validator + form.type_guesser.doctrine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + _token + + validators + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev + + + + + + + + + + + + + + + + + + + + validator.expression + validator.email + security.validator.user_password + doctrine.orm.validator.unique + + + + + + + + + validators + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/config/validation.yml + + + + loadValidatorMetadata + + + + + + + + + + + + + + + false + + + + + + file:/Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/profiler + + + 86400 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + + + + + + + + + + + + + null + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GET + localhost + http + 80 + 443 + + + + + + + + + + + + + + + null + null + true + null + + + + + + + + + + + + + kernel.controller + + data_collector.router + onKernelController + + 0 + + + response_listener + Symfony\Component\HttpKernel\EventListener\ResponseListener + + + streamed_response_listener + Symfony\Component\HttpKernel\EventListener\StreamedResponseListener + + + locale_listener + Symfony\Component\HttpKernel\EventListener\LocaleListener + + + translator_listener + Symfony\Component\HttpKernel\EventListener\TranslatorListener + + + test.session.listener + Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener + + + session_listener + Symfony\Bundle\FrameworkBundle\EventListener\SessionListener + + + session.save_listener + Symfony\Component\HttpKernel\EventListener\SaveSessionListener + + + profiler_listener + Symfony\Component\HttpKernel\EventListener\ProfilerListener + + + data_collector.request + Symfony\Component\HttpKernel\DataCollector\RequestDataCollector + + + router_listener + Symfony\Component\HttpKernel\EventListener\RouterListener + + + debug.debug_handlers_listener + Symfony\Component\HttpKernel\EventListener\DebugHandlersListener + + + security.firewall + Symfony\Component\Security\Http\Firewall + + + security.rememberme.response_listener + Symfony\Component\Security\Http\RememberMe\ResponseListener + + + twig.exception_listener + Symfony\Component\HttpKernel\EventListener\ExceptionListener + + + swiftmailer.email_sender.listener + Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener + + + sensio_framework_extra.controller.listener + Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener + + + sensio_framework_extra.converter.listener + Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener + + + sensio_framework_extra.view.listener + Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener + + + sensio_framework_extra.cache.listener + Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener + + + sensio_framework_extra.security.listener + Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener + + + debug.dump_listener + Symfony\Component\HttpKernel\EventListener\DumpListener + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + default + + true + + + + + 5593aedf3be85 + + + + true + + + + + + Symfony\Component\Security\Core\Authentication\Token\AnonymousToken + Symfony\Component\Security\Core\Authentication\Token\RememberMeToken + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + affirmative + false + true + + + + + CHILL_PERSON_SEE + + + CHILL_PERSON_SEE + + + + + + + + + + + + ^/(_(profiler|wdt)|css|images|js)/ + + + null + + + + + + + + + + + default + /logout + logout + _csrf_token + null + + + + + + + + + + + + + + + + + + + + + + + + + + + + + admin + olala + + ROLE_ADMIN + + + + + + + + Chill\MainBundle\Entity\User + username + null + + + + null + + + + + + + + + + + + 80 + 443 + + + + + + + + + + + + + + default + + + + + + + + + + + + + + + + + + + + + + / + + + + _csrf_token + logout + /logout + + + + + + + + + + + + + + + + migrate + + + + + + + + + default + + + + + + + + + + + + false + / + /login + _target_path + false + + + + default + + + + + + + + + + + + + + + + + /login + null + false + _failure_path + + + + + + _csrf_token + authenticate + /login_check + false + true + _username + _password + true + + + + + + + + + + 5593aedf3be85 + + + + + + + + + + + + + + + + + + + + + + + + + + + default + + + + + + + + + + /login + false + + + null + null + + + + + + + + + form_div_layout.html.twig + ChillCustomFieldsBundle:Form:fields.html.twig + ChillMainBundle:Form:fields.html.twig + + twig.controller.exception:showAction + filename + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/twig + UTF-8 + true + + + F j, Y H:i + %d days + null + + + 0 + . + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + null + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app + UTF-8 + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + form_div_layout.html.twig + ChillCustomFieldsBundle:Form:fields.html.twig + ChillMainBundle:Form:fields.html.twig + + + + + + + + + + + + + + + + + + + + + + + + false + + + ChillPersonBundle + ChillMainBundle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + app + + + + dev + + + true + + + + + + + + + + + + + + + installation + + Chill + + + + available_languages + + fr + + + + + F j, Y H:i + %d days + null + 0 + . + , + + + + + + + + + + + + twig.controller.exception:showAction + + + + + true + + + + twig.controller.exception:showAction + + + + + + + + + + + + + + + + assetic.filter.cssrewrite + + + + + + + + + + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/assetic/config + + + true + + + + + + + + + + + + + ChillPersonBundle + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources/ChillPersonBundle/views + /\.[^.]+\.twig$/ + + + + + + ChillPersonBundle + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/views + /\.[^.]+\.twig$/ + + + + + + twig + + + + + + + + + + + ChillMainBundle + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources/ChillMainBundle/views + /\.[^.]+\.twig$/ + + + + + + ChillMainBundle + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/views + /\.[^.]+\.twig$/ + + + + + + twig + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/Resources/views + /\.[^.]+\.twig$/ + + + twig + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/../web + true + + + + + + + + + + + doctrine.dbal.default_connection + + + doctrine.orm.default_entity_manager + + default + default + + + + + pdo_pgsql + 127.0.0.1 + 5432 + chill_test + chill + chill + UTF8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + loadClassMetadata + + + + + + + + + + + + + + + + + + + + + + + + + + + sf2orm_default_c0b41a363c751fd9be0caf57d83082a61e71edafd3180cccf326d0e99751ea74 + + + + + sf2orm_default_c0b41a363c751fd9be0caf57d83082a61e71edafd3180cccf326d0e99751ea74 + + + + + sf2orm_default_c0b41a363c751fd9be0caf57d83082a61e71edafd3180cccf326d0e99751ea74 + + + + + + + + + + + + + + + + + Chill\MainBundle\Entity + Chill\CustomFieldsBundle\Entity + Chill\PersonBundle\Entity + Chill\ActivityBundle\Entity + + + + + + + + + + + + + + + + + + + Chill\MainBundle\Entity + Chill\CustomFieldsBundle\Entity + Chill\PersonBundle\Entity + Chill\ActivityBundle\Entity + + + mapping + + + + Chill\MainBundle\Entity + + + + + + Chill\MainBundle\Entity + Chill\CustomFieldsBundle\Entity + Chill\PersonBundle\Entity + Chill\ActivityBundle\Entity + + + mapping + + + + Chill\CustomFieldsBundle\Entity + + + + + + Chill\MainBundle\Entity + Chill\CustomFieldsBundle\Entity + Chill\PersonBundle\Entity + Chill\ActivityBundle\Entity + + + mapping + + + + Chill\PersonBundle\Entity + + + + + + Chill\MainBundle\Entity + Chill\CustomFieldsBundle\Entity + Chill\PersonBundle\Entity + Chill\ActivityBundle\Entity + + + mapping + + + + Chill\ActivityBundle\Entity + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/doctrine/orm/Proxies + + + Proxies + + + true + + + Doctrine\ORM\Mapping\ClassMetadataFactory + + + Doctrine\ORM\EntityRepository + + + + + + + + + + + + + + + + unaccent + Chill\MainBundle\Doctrine\DQL\Unaccent + + + + + + + + + + + + + + + + + true + + + + + 0 + doctrine.orm + + + + 0 + datetime + + + + + + + + + + + + + + + + + + + null + + + + + + + + + + + + @ChillPersonBundle/Resources/config/routing.yml + @ChillCustomFieldsBundle/Resources/config/routing.yml + @ChillMainBundle/Resources/config/routing.yml + + + + + + + + + + + + + + + + + + + + + fr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + person_regular + + + + + + + + + person + chill.person.timeline.accompanying_period_opening + + + person + chill.person.timeline.accompanying_period_closing + + + + + + + + + text + + + + choice + + + + title + + + + + + + + + + + Chill\PersonBundle\Entity\Person + PersonEntity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + null + UTF-8 + null + null + + + + + + + + + 2500 + + + -1 + + + + null + UTF-8 + + + + + + + + config + @WebProfiler/Collector/config.html.twig + + + request + @WebProfiler/Collector/request.html.twig + + + ajax + @WebProfiler/Collector/ajax.html.twig + + + exception + @WebProfiler/Collector/exception.html.twig + + + events + @WebProfiler/Collector/events.html.twig + + + logger + @WebProfiler/Collector/logger.html.twig + + + time + @WebProfiler/Collector/time.html.twig + + + memory + @WebProfiler/Collector/memory.html.twig + + + router + @WebProfiler/Collector/router.html.twig + + + form + @WebProfiler/Collector/form.html.twig + + + translation + @WebProfiler/Collector/translation.html.twig + + + twig + @WebProfiler/Collector/twig.html.twig + + + security + @Security/Collector/security.html.twig + + + swiftmailer + @Swiftmailer/Collector/swiftmailer.html.twig + + + db + @Doctrine/Collector/db.html.twig + + + dump + @Debug/Profiler/dump.html.twig + + + bottom + + + + + + + + + + true + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app + + + + + + + 10 + + + + + + + + 0 + + + + + + + + + request + + + + + + translation + + + + + + security + + + + + + templating + + + + + + profiler + + + + + + router + + + + + + php + + + + + + event + + + + + + assetic + + + + + + doctrine + + + + + + 100 + true + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/sessions + MOCKSESSID + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/sessions + + + + + + + + + + + + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/config/routing.yml + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev + true + Symfony\Component\Routing\Generator\UrlGenerator + Symfony\Component\Routing\Generator\UrlGenerator + Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper + appDevUrlGenerator + Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher + Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher + Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper + appDevUrlMatcher + true + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Tests/Fixtures/App/app/cache/dev/annotations + true + + + + + %security.encoder.bcrypt.class% + + 13 + + + + %security.encoder.plain.class% + + false + + + + + + + + + + + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views + Framework + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/views + Security + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views + Twig + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/swiftmailer-bundle/Resources/views + Swiftmailer + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/doctrine/doctrine-bundle/Resources/views + Doctrine + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/main/Resources/views + ChillMain + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/custom-fields/Resources/views + ChillCustomFields + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/chill-project/person/Resources/views + ChillPerson + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/Resources/views + ChillActivity + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/DebugBundle/Resources/views + Debug + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views + WebProfiler + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/views + SensioDistribution + + + /Users/marcu/Projects/Chill/vendor/chill-project/activity/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form + + + + app + + + + + + + + + + + + + + + + + + + + + + + + + + + + null + + + null + + + null + + + + + + + + + localhost + + + 25 + + + null + + + 30 + + + null + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log new file mode 100644 index 000000000..897e964b5 --- /dev/null +++ b/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log @@ -0,0 +1,438 @@ +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "assets._default_package" (parent: assets.path_package). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.user.provider.concrete.chain_provider" (parent: security.user.provider.chain). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.user.provider.concrete.in_memory" (parent: security.user.provider.in_memory). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.user.provider.concrete.in_memory_admin" (parent: security.user.provider.in_memory.user). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.user.provider.concrete.users" (parent: doctrine.orm.security.user.provider). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.firewall.map.context.dev" (parent: security.firewall.context). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.context_listener.0" (parent: security.context_listener). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.logout_listener.default" (parent: security.logout_listener). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.logout.success_handler.default" (parent: security.logout.success_handler). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.provider.dao.default" (parent: security.authentication.provider.dao). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.success_handler.default.form_login" (parent: security.authentication.success_handler). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.failure_handler.default.form_login" (parent: security.authentication.failure_handler). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.listener.form" (parent: security.authentication.listener.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.listener.form.default" (parent: security.authentication.listener.form). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.form_entry_point.default" (parent: security.authentication.form_entry_point). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.listener.anonymous.default" (parent: security.authentication.listener.anonymous). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.authentication.provider.anonymous.default" (parent: security.authentication.provider.anonymous). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.exception_listener.default" (parent: security.exception_listener). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "security.firewall.map.context.default" (parent: security.firewall.context). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "swiftmailer.mailer.default.transport.eventdispatcher" (parent: swiftmailer.transport.eventdispatcher.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "swiftmailer.mailer.default.transport.authhandler" (parent: swiftmailer.transport.authhandler.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "swiftmailer.mailer.default.transport.buffer" (parent: swiftmailer.transport.buffer.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "swiftmailer.mailer.default.transport.smtp" (parent: swiftmailer.transport.smtp.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "swiftmailer.mailer.default" (parent: swiftmailer.mailer.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "swiftmailer.mailer.default.plugin.messagelogger" (parent: swiftmailer.plugin.messagelogger.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.dbal.default_connection.configuration" (parent: doctrine.dbal.connection.configuration). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.dbal.logger.profiling.default" (parent: doctrine.dbal.logger.profiling). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.dbal.logger.chain.default" (parent: doctrine.dbal.logger.chain). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.dbal.default_connection.event_manager" (parent: doctrine.dbal.connection.event_manager). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.dbal.default_connection" (parent: doctrine.dbal.connection). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.orm.default_configuration" (parent: doctrine.orm.configuration). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine_cache.providers.doctrine.orm.default_metadata_cache" (parent: doctrine_cache.abstract.array). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine_cache.providers.doctrine.orm.default_result_cache" (parent: doctrine_cache.abstract.array). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine_cache.providers.doctrine.orm.default_query_cache" (parent: doctrine_cache.abstract.array). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.orm.default_manager_configurator" (parent: doctrine.orm.manager_configurator.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "doctrine.orm.default_entity_manager" (parent: doctrine.orm.entity_manager.abstract). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.request" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.translation" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.security" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.templating" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.profiler" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.router" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.php" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.event" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.assetic" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass: Resolving inheritance for "monolog.logger.doctrine" (parent: monolog.logger_prototype). +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "validator.mapping.class_metadata_factory"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "assetic.value_supplier"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "doctrine.dbal.event_manager"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "doctrine.orm.metadata.annotation_reader"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "doctrine.orm.default_entity_manager.event_manager"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "sensio_framework_extra.security.expression_language"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "translator.logging.inner"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass: Removed service "translator.data_collector.inner"; reason: private alias +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "assets.path_package"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "assets.url_package"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "assets.static_version_strategy"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.firewall.context"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.user.provider.in_memory"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.user.provider.in_memory.user"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.user.provider.chain"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.logout_listener"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.logout.handler.cookie_clearing"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.logout.success_handler"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.form_entry_point"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.custom_success_handler"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.success_handler"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.custom_failure_handler"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.failure_handler"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.form"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.simple_form"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.simple_success_failure_handler"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.simple_preauth"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.x509"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.remote_user"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.basic"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.digest"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.provider.dao"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.provider.simple"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.provider.pre_authenticated"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.exception_listener"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.switchuser_listener"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.listener.rememberme"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.provider.rememberme"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.rememberme.services.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.rememberme.services.persistent"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "security.authentication.rememberme.services.simplehash"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "monolog.logger_prototype"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.mailer.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.sendmail.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.mail.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.null.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.buffer.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.authhandler.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.eventdispatcher.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.plugin.redirecting.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.plugin.antiflood.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.plugin.impersonate.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.plugin.messagelogger.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.smtp.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.transport.spool.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.spool.file.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "swiftmailer.spool.memory.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "assetic.worker.ensure_filter"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.apc"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.array"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.file_system"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.php_file"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.memcache"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.memcached"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.redis"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.wincache"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.xcache"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.zenddata"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.mongodb"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.riak"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine_cache.abstract.couchbase"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.dbal.logger.chain"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.dbal.logger.profiling"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.dbal.connection"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.dbal.connection.event_manager"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.dbal.connection.configuration"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.orm.configuration"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.orm.entity_manager.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.orm.manager_configurator.abstract"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "doctrine.orm.security.user.provider"; reason: abstract +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "session" previously pointing to "session.storage.mock_file" to "session.storage.filesystem". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "session.storage.native" previously pointing to "session.handler.native_file" to "session.handler". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "session.storage.php_bridge" previously pointing to "session.handler.native_file" to "session.handler". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "assetic.twig_directory_resource.kernel" previously pointing to "templating.loader.filesystem" to "templating.loader". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "chill.custom_field.text" previously pointing to "templating.engine.twig" to "templating". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "chill.custom_field.choice" previously pointing to "templating.engine.twig" to "templating". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "chill.custom_field.title" previously pointing to "templating.engine.twig" to "templating". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "translator_listener" previously pointing to "translator.data_collector" to "translator". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "validator.builder" previously pointing to "translator.data_collector" to "translator". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "data_collector.translation" previously pointing to "translator.data_collector" to "translator". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "twig.extension.trans" previously pointing to "translator.data_collector" to "translator". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "chill.custom_field.custom_fields_group_type" previously pointing to "translator.data_collector" to "translator". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "locale_listener" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "templating.helper.router" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "router.cache_warmer" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "router_listener" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "security.logout_url_generator" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "security.http_utils" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "security.http_utils" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "twig.extension.routing" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "web_profiler.controller.profiler" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "web_profiler.controller.router" previously pointing to "router.default" to "router". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "sensio_framework_extra.controller.listener" previously pointing to "annotations.file_cache_reader" to "annotation_reader". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "sensio_framework_extra.routing.loader.annot_class" previously pointing to "annotations.file_cache_reader" to "annotation_reader". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "security.user_password_encoder.generic" previously pointing to "security.encoder_factory.generic" to "security.encoder_factory". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "security.validator.user_password" previously pointing to "security.encoder_factory.generic" to "security.encoder_factory". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "security.authentication.provider.dao.default" previously pointing to "security.encoder_factory.generic" to "security.encoder_factory". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "twig" previously pointing to "twig.loader.filesystem" to "twig.loader". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "swiftmailer.email_sender.listener" previously pointing to "monolog.logger" to "logger". +Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass: Changed reference of service "swiftmailer.mailer.default" previously pointing to "swiftmailer.mailer.default.transport.smtp" to "swiftmailer.mailer.default.transport". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "templating.cache_warmer.template_paths" to "cache_warmer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.asset_manager_cache_warmer" to "cache_warmer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "translation.warmer" to "cache_warmer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "router.cache_warmer" to "cache_warmer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.proxy_cache_warmer" to "cache_warmer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "translator.selector" to "translator.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "test.client.history" to "test.client". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "test.client.cookiejar" to "test.client". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "session.attribute_bag" to "session". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "session.flash_bag" to "session". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "16f9ce82abe2adc8b44c9c8d29afbc93d322e7fad5e23fae42fb16c689658c58_1" to "form.resolved_type_factory". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "form.extension" to "form.registry". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "form.type_extension.form.request_handler" to "form.type_extension.form.http_foundation". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "form.server_params" to "form.type_extension.form.request_handler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.csrf.token_generator" to "security.csrf.token_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.csrf.token_storage" to "security.csrf.token_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assets._default_package" to "assets.packages". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "validator.validator_factory" to "validator.builder". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "profiler.storage" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.config" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.ajax" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.exception" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.events" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.logger" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.time" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.memory" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.twig" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.security" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "swiftmailer.data_collector" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "data_collector.doctrine" to "profiler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "routing.loader.xml" to "routing.resolver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "routing.loader.yml" to "routing.resolver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "routing.loader.php" to "routing.resolver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_framework_extra.routing.loader.annot_dir" to "routing.resolver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_framework_extra.routing.loader.annot_file" to "routing.resolver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "routing.resolver" to "routing.loader". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "debug.event_dispatcher.parent" to "debug.event_dispatcher". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "controller_resolver" to "debug.controller_resolver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.provider.dao.default" to "security.authentication.manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.provider.anonymous.default" to "security.authentication.manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.access.expression_voter" to "security.access.decision_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.access.role_hierarchy_voter" to "security.access.decision_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.access.authenticated_voter" to "security.access.decision_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.expression_language" to "security.access.expression_voter". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.firewall.map" to "security.firewall". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.request_matcher.5314eeb91110adf24b9b678372bb11bbe00e8858c519c088bfb65f525181ad3bf573fd1d" to "security.firewall.map". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.retry_entry_point" to "security.channel_listener". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.user.provider.concrete.in_memory_admin" to "security.user.provider.concrete.in_memory". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.logout.success_handler.default" to "security.logout_listener.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.logout.handler.session" to "security.logout_listener.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.user_checker" to "security.authentication.provider.dao.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.session_strategy" to "security.authentication.listener.form.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.success_handler.default.form_login" to "security.authentication.listener.form.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.failure_handler.default.form_login" to "security.authentication.listener.form.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.form_entry_point.default" to "security.exception_listener.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.channel_listener" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.context_listener.0" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.logout_listener.default" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.listener.form.default" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.authentication.listener.anonymous.default" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.access_listener" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.exception_listener.default" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.logout_url" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.security" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.profiler" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.trans" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.assets" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.actions" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.code" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.routing" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.yaml" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.debug.stopwatch" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.expression" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.httpkernel" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.form" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.debug" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.twig_extension" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.twig.doctrine_extension" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.dump" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.webprofiler" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.app_variable" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.configurator.environment" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.form.renderer" to "twig.extension.form". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.form.engine" to "twig.form.renderer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "0ae0165e1c986a63ecc244514317fc4860d8c97fd0529833a00cfb95d75a4d92_1" to "swiftmailer.mailer.default.transport.authhandler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "0ae0165e1c986a63ecc244514317fc4860d8c97fd0529833a00cfb95d75a4d92_2" to "swiftmailer.mailer.default.transport.authhandler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "0ae0165e1c986a63ecc244514317fc4860d8c97fd0529833a00cfb95d75a4d92_3" to "swiftmailer.mailer.default.transport.authhandler". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "swiftmailer.transport.replacementfactory" to "swiftmailer.mailer.default.transport.buffer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.twig_formula_loader" to "assetic.asset_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.twig_directory_resource.chillpersonbundle" to "assetic.asset_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.twig_directory_resource.chillmainbundle" to "assetic.asset_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.twig_directory_resource.kernel" to "assetic.asset_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.parameter_bag" to "assetic.asset_factory". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.value_supplier.default" to "assetic.twig_extension". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.twig_formula_loader.real" to "assetic.twig_formula_loader". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assetic.config_cache" to "assetic.twig_formula_loader". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.dbal.logger.chain.default" to "doctrine.dbal.default_connection.configuration". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.dbal.logger" to "doctrine.dbal.logger.chain.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.dbal.default_connection.configuration" to "doctrine.dbal.default_connection". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.dbal.default_connection.event_manager" to "doctrine.dbal.default_connection". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.default_metadata_driver" to "doctrine.orm.default_configuration". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.naming_strategy.default" to "doctrine.orm.default_configuration". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.quote_strategy.default" to "doctrine.orm.default_configuration". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.default_yml_metadata_driver" to "doctrine.orm.default_metadata_driver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.default_yml_metadata_driver" to "doctrine.orm.default_metadata_driver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.default_yml_metadata_driver" to "doctrine.orm.default_metadata_driver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.default_yml_metadata_driver" to "doctrine.orm.default_metadata_driver". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "doctrine.orm.default_configuration" to "doctrine.orm.default_entity_manager". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_framework_extra.security.expression_language.default" to "sensio_framework_extra.security.listener". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_distribution.webconfigurator.doctrine_step" to "sensio_distribution.webconfigurator". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_distribution.webconfigurator.secret_step" to "sensio_distribution.webconfigurator". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "translator.logging" to "translator". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "swiftmailer.mailer.default.transport.buffer" to "swiftmailer.mailer.default.transport". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "swiftmailer.mailer.default.transport.authhandler" to "swiftmailer.mailer.default.transport". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "swiftmailer.mailer.default.transport.eventdispatcher" to "swiftmailer.mailer.default.transport". +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "controller_resolver"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "translator.logging"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "translator.selector"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "translation.warmer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "session.flash_bag"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "session.attribute_bag"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "session.handler.write_check"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "form.extension"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "form.type_extension.form.request_handler"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "form.server_params"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.csrf.token_generator"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.csrf.token_storage"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assets.empty_package"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assets._default_package"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "templating.engine.delegating"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "templating.cache_warmer.template_paths"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "templating.loader.cache"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "templating.loader.chain"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "validator.mapping.cache.apc"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "validator.validator_factory"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "profiler.storage"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.config"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.ajax"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.exception"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.events"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.logger"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.time"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.memory"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "16f9ce82abe2adc8b44c9c8d29afbc93d322e7fad5e23fae42fb16c689658c58_1"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "routing.resolver"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "routing.loader.xml"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "routing.loader.yml"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "routing.loader.php"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "router.cache_warmer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "annotations.cached_reader"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "debug.event_dispatcher.parent"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.session_strategy"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.user_checker"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.expression_language"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.access.authenticated_voter"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.access.role_hierarchy_voter"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.access.expression_voter"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.firewall.map"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.listener.anonymous"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.provider.anonymous"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.retry_entry_point"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.basic_entry_point"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.digest_entry_point"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.channel_listener"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.context_listener"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.logout.handler.session"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.access_listener"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.rememberme.token.provider.in_memory"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.logout_url"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.security"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.security"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.user.provider.concrete.in_memory_admin"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.request_matcher.5314eeb91110adf24b9b678372bb11bbe00e8858c519c088bfb65f525181ad3bf573fd1d"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.context_listener.0"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.logout_listener.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.logout.success_handler.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.provider.dao.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.success_handler.default.form_login"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.failure_handler.default.form_login"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.listener.form.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.form_entry_point.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.listener.anonymous.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.authentication.provider.anonymous.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.exception_listener.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.app_variable"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.cache_warmer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.loader.native_filesystem"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.loader.chain"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.profiler"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.twig"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.trans"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.assets"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.actions"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.code"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.routing"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.yaml"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.debug.stopwatch"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.expression"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.httpkernel"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.form"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.debug"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.form.engine"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.form.renderer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.configurator.environment"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.chrome_php"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.gelf_message"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.html"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.json"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.line"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.loggly"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.normalizer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.scalar"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "monolog.formatter.wildfire"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "0ae0165e1c986a63ecc244514317fc4860d8c97fd0529833a00cfb95d75a4d92_3"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "0ae0165e1c986a63ecc244514317fc4860d8c97fd0529833a00cfb95d75a4d92_2"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "0ae0165e1c986a63ecc244514317fc4860d8c97fd0529833a00cfb95d75a4d92_1"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "swiftmailer.transport.failover"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "swiftmailer.transport.mailinvoker"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "swiftmailer.transport.replacementfactory"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "swiftmailer.data_collector"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "swiftmailer.mailer.default.transport.eventdispatcher"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "swiftmailer.mailer.default.transport.authhandler"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "swiftmailer.mailer.default.transport.buffer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.config_cache"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.asset_manager_cache_warmer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.worker.cache_busting"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.parameter_bag"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.value_supplier.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.twig_extension"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.twig_formula_loader"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.twig_formula_loader.real"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.dbal.logger"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "data_collector.doctrine"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.twig.doctrine_extension"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.dbal.default_connection.configuration"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.dbal.logger.chain.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.dbal.default_connection.event_manager"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.proxy_cache_warmer"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.listeners.resolve_target_entity"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.naming_strategy.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.naming_strategy.underscore"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.quote_strategy.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.quote_strategy.ansi"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.default_configuration"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.default_yml_metadata_driver"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "doctrine.orm.default_metadata_driver"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "sensio_framework_extra.routing.loader.annot_dir"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "sensio_framework_extra.routing.loader.annot_file"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "sensio_framework_extra.security.expression_language.default"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.dump"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.webprofiler"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "sensio_distribution.webconfigurator.doctrine_step"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "sensio_distribution.webconfigurator.secret_step"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.twig_directory_resource.chillpersonbundle"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.twig_directory_resource.chillmainbundle"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assetic.twig_directory_resource.kernel"; reason: unused +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "templating.finder" to "cache_warmer". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "assets.empty_version_strategy" to "assets.packages". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_framework_extra.routing.loader.annot_class" to "routing.loader". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_framework_extra.routing.loader.annot_class" to "routing.loader". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "sensio_framework_extra.routing.loader.annot_class" to "routing.loader". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.access_map" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.http_utils" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.http_utils" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.http_utils" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.http_utils" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.http_utils" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.access_map" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.http_utils" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.http_utils" to "security.firewall.map.context.default". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.httpfoundation" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "twig.extension.httpfoundation" to "twig". +Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "annotations.reader" to "annotation_reader". +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "assets.empty_version_strategy"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "templating.finder"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "annotations.reader"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.http_utils"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "security.access_map"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "twig.extension.httpfoundation"; reason: unused +Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass: Removed service "sensio_framework_extra.routing.loader.annot_class"; reason: unused \ No newline at end of file diff --git a/Tests/Fixtures/App/app/cache/dev/classes.map b/Tests/Fixtures/App/app/cache/dev/classes.map new file mode 100644 index 000000000..c0e7129f2 --- /dev/null +++ b/Tests/Fixtures/App/app/cache/dev/classes.map @@ -0,0 +1,88 @@ + 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', + 1 => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', + 2 => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', + 3 => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', + 4 => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', + 5 => 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', + 6 => 'Symfony\\Component\\HttpFoundation\\Session\\Session', + 7 => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', + 8 => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', + 9 => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', + 10 => 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocator', + 11 => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', + 12 => 'Symfony\\Component\\Routing\\RequestContext', + 13 => 'Symfony\\Component\\Routing\\Router', + 14 => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', + 15 => 'Symfony\\Bundle\\FrameworkBundle\\Routing\\Router', + 16 => 'Symfony\\Component\\Config\\FileLocator', + 17 => 'Symfony\\Component\\Debug\\ErrorHandler', + 18 => 'Symfony\\Component\\EventDispatcher\\Event', + 19 => 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', + 20 => 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', + 21 => 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', + 22 => 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', + 23 => 'Symfony\\Component\\HttpKernel\\Event\\KernelEvent', + 24 => 'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent', + 25 => 'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent', + 26 => 'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent', + 27 => 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent', + 28 => 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent', + 29 => 'Symfony\\Component\\HttpKernel\\KernelEvents', + 30 => 'Symfony\\Component\\HttpKernel\\Config\\FileLocator', + 31 => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', + 32 => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', + 33 => 'Symfony\\Component\\Security\\Http\\Firewall', + 34 => 'Symfony\\Component\\Security\\Core\\User\\UserProviderInterface', + 35 => 'Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager', + 36 => 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage', + 37 => 'Symfony\\Component\\Security\\Core\\Authorization\\AccessDecisionManager', + 38 => 'Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationChecker', + 39 => 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface', + 40 => 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallMap', + 41 => 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallContext', + 42 => 'Symfony\\Component\\HttpFoundation\\RequestMatcher', + 43 => 'Twig_Environment', + 44 => 'Twig_Extension', + 45 => 'Twig_Extension_Core', + 46 => 'Twig_Extension_Escaper', + 47 => 'Twig_Extension_Optimizer', + 48 => 'Twig_LoaderInterface', + 49 => 'Twig_Markup', + 50 => 'Twig_Template', + 51 => 'Monolog\\Formatter\\FormatterInterface', + 52 => 'Monolog\\Formatter\\LineFormatter', + 53 => 'Monolog\\Handler\\HandlerInterface', + 54 => 'Monolog\\Handler\\AbstractHandler', + 55 => 'Monolog\\Handler\\AbstractProcessingHandler', + 56 => 'Monolog\\Handler\\StreamHandler', + 57 => 'Monolog\\Handler\\FingersCrossedHandler', + 58 => 'Monolog\\Handler\\FilterHandler', + 59 => 'Monolog\\Handler\\TestHandler', + 60 => 'Monolog\\Logger', + 61 => 'Symfony\\Bridge\\Monolog\\Logger', + 62 => 'Symfony\\Bridge\\Monolog\\Handler\\DebugHandler', + 63 => 'Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface', + 64 => 'Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy', + 65 => 'Symfony\\Bundle\\AsseticBundle\\DefaultValueSupplier', + 66 => 'Symfony\\Bundle\\AsseticBundle\\Factory\\AssetFactory', + 67 => 'Doctrine\\Common\\Annotations\\DocLexer', + 68 => 'Doctrine\\Common\\Annotations\\FileCacheReader', + 69 => 'Doctrine\\Common\\Annotations\\PhpParser', + 70 => 'Doctrine\\Common\\Annotations\\Reader', + 71 => 'Doctrine\\Common\\Lexer', + 72 => 'Doctrine\\Common\\Persistence\\ConnectionRegistry', + 73 => 'Doctrine\\Common\\Persistence\\Proxy', + 74 => 'Doctrine\\Common\\Util\\ClassUtils', + 75 => 'Doctrine\\Bundle\\DoctrineBundle\\Registry', + 76 => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ControllerListener', + 77 => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ParamConverterListener', + 78 => 'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DateTimeParamConverter', + 79 => 'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DoctrineParamConverter', + 80 => 'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface', + 81 => 'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterManager', + 82 => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\TemplateListener', + 83 => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\HttpCacheListener', + 84 => 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener', + 85 => 'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ConfigurationAnnotation', +); \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/config.yml b/Tests/Fixtures/App/app/config/config.yml new file mode 100644 index 000000000..971fe37b6 --- /dev/null +++ b/Tests/Fixtures/App/app/config/config.yml @@ -0,0 +1,74 @@ +imports: + - { resource: parameters.yml } + +framework: + secret: Not very secret + router: { resource: "%kernel.root_dir%/config/routing.yml" } + form: true + csrf_protection: true + session: ~ + default_locale: fr + translator: { fallback: fr } + profiler: { only_exceptions: false } + templating: + engines: ['twig'] + +doctrine: + dbal: + driver: pdo_pgsql + host: "%database_host%" + port: "%database_port%" + dbname: "%database_name%" + user: "%database_user%" + password: "%database_password%" + charset: UTF8 + orm: + auto_generate_proxy_classes: "%kernel.debug%" + auto_mapping: true + +# Assetic Configuration +assetic: + debug: "%kernel.debug%" + use_controller: false + bundles: [ ] + #java: /usr/bin/java + filters: + cssrewrite: ~ + + +security: + providers: + chain_provider: + chain : + providers: [in_memory, users] + in_memory: + memory: + users: + admin: { password: olala, roles: 'ROLE_ADMIN' } + users: + entity: + class: Chill\MainBundle\Entity\User + property: username + + encoders: + Chill\MainBundle\Entity\User: + algorithm: bcrypt + Symfony\Component\Security\Core\User\User: plaintext + + firewalls: + dev: + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + + default: + anonymous: ~ + form_login: + csrf_parameter: _csrf_token + intention: authenticate + csrf_provider: form.csrf_provider + logout: ~ + access_control: + #disable authentication for tests + #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } + #- { path: ^/admin, roles: ROLE_ADMIN } + #- { path: ^/, roles: ROLE_USER } \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/config_dev.yml b/Tests/Fixtures/App/app/config/config_dev.yml new file mode 100644 index 000000000..81e0f80f4 --- /dev/null +++ b/Tests/Fixtures/App/app/config/config_dev.yml @@ -0,0 +1,7 @@ +imports: + - { resource: config.yml } #here we import a config.yml file, this is not required + +framework: + test: ~ + session: + storage_id: session.storage.filesystem \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/config_test.yml b/Tests/Fixtures/App/app/config/config_test.yml new file mode 100644 index 000000000..fbef213f6 --- /dev/null +++ b/Tests/Fixtures/App/app/config/config_test.yml @@ -0,0 +1,8 @@ +# config/config_test.yml +imports: + - { resource: config.yml } #here we import a config.yml file, this is not required + +framework: + test: ~ + session: + storage_id: session.storage.filesystem \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml b/Tests/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml new file mode 100644 index 000000000..44d956bf1 --- /dev/null +++ b/Tests/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml @@ -0,0 +1,9 @@ + +#required by ConfigCustomizablesEntitiesTest::testNotEmptyConfig + +imports: + - { resource: config_test.yml } + +chill_custom_fields: + customizables_entities: + - { class: Test\With\A\Dummy\Entity, name: test } \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/parameters.travis.yml b/Tests/Fixtures/App/app/config/parameters.travis.yml new file mode 100644 index 000000000..28d5cd26c --- /dev/null +++ b/Tests/Fixtures/App/app/config/parameters.travis.yml @@ -0,0 +1,7 @@ +parameters: + database_host: 127.0.0.1 + database_port: 5432 + database_name: test0 + database_user: postgres + database_password: postgres + locale: fr \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/parameters.yml b/Tests/Fixtures/App/app/config/parameters.yml new file mode 100644 index 000000000..28326fefe --- /dev/null +++ b/Tests/Fixtures/App/app/config/parameters.yml @@ -0,0 +1,7 @@ +parameters: + database_host: 127.0.0.1 + database_port: 5432 + database_name: chill_test + database_user: chill + database_password: chill + locale: fr \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/parameters.yml.dist b/Tests/Fixtures/App/app/config/parameters.yml.dist new file mode 100644 index 000000000..3221c992b --- /dev/null +++ b/Tests/Fixtures/App/app/config/parameters.yml.dist @@ -0,0 +1,7 @@ +parameters: + database_host: 127.0.0.1 + database_port: 5434 + database_name: symfony + database_user: symfony + database_password: symfony + locale: fr \ No newline at end of file diff --git a/Tests/Fixtures/App/app/config/routing.yml b/Tests/Fixtures/App/app/config/routing.yml new file mode 100644 index 000000000..7f31da766 --- /dev/null +++ b/Tests/Fixtures/App/app/config/routing.yml @@ -0,0 +1,10 @@ +cl_custom_fields: + resource: . + type: chill_routes + +chill_main: + resource: "@ChillMainBundle/Resources/config/routing.yml" + +test_custom_field_form_render: + path: /customfieldsgroup/test/render/{id} + defaults: { _controller: ChillCustomFieldsBundle:CustomFieldsGroup:renderForm } \ No newline at end of file diff --git a/Tests/Fixtures/App/app/console b/Tests/Fixtures/App/app/console new file mode 100755 index 000000000..fa6a36e24 --- /dev/null +++ b/Tests/Fixtures/App/app/console @@ -0,0 +1,27 @@ +#!/usr/bin/env php +getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); +$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod'; + +if ($debug) { + Debug::enable(); +} + +$kernel = new AppKernel($env, $debug); +$application = new Application($kernel); +$application->run($input); diff --git a/Tests/Fixtures/App/web/app_dev.php b/Tests/Fixtures/App/web/app_dev.php new file mode 100644 index 000000000..e0279c2ae --- /dev/null +++ b/Tests/Fixtures/App/web/app_dev.php @@ -0,0 +1,30 @@ +loadClassCache(); +$request = Request::createFromGlobals(); +$response = $kernel->handle($request); +$response->send(); +$kernel->terminate($request, $response); diff --git a/composer.json b/composer.json index 2bb1e980f..e0cdd2e3a 100644 --- a/composer.json +++ b/composer.json @@ -14,5 +14,39 @@ "email": "info@champs-libres.coop" } ], - "require": {} + "require": { + "twig/extensions": "^1.2", + "symfony/assetic-bundle": "~2.3", + "symfony/framework-bundle": "~2.7", + "symfony/yaml": "~2.7", + "symfony/symfony": "~2.7", + "doctrine/dbal": "~2.5", + "doctrine/orm": "~2.4", + "doctrine/common": "~2.4", + "doctrine/doctrine-bundle": "~1.2", + "chill-project/main": "dev-master@dev", + "chill-project/custom-fields": "dev-master@dev", + "chill-project/person": "dev-master@dev", + "champs-libres/composer-bundle-migration": "~1.0", + "doctrine/doctrine-migrations-bundle": "dev-master@dev", + "doctrine/migrations": "~1.0@dev" + }, + "require-dev": { + "doctrine/doctrine-fixtures-bundle": "~2.2", + "fzaninotto/faker": "~1", + "monolog/monolog": "^1.14", + "symfony/monolog-bundle": "^2.7", + "sensio/generator-bundle": "^2.5" + }, + "scripts": { + "post-install-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ], + "post-update-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ] + }, + "extra": { + "app-migrations-dir": "Tests/Fixtures/App/app/DoctrineMigrations" + } } From 5738de5033b14ff1fba4bb0818acb0e2c7688bae Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 13:34:14 +0200 Subject: [PATCH 007/163] Adding generated files --- Controller/ActivityController.php | 224 ++++++++++++++++++ .../ActivityReasonCategoryController.php | 224 ++++++++++++++++++ Controller/ActivityReasonController.php | 224 ++++++++++++++++++ Controller/ActivityTypeController.php | 224 ++++++++++++++++++ Form/ActivityReasonCategoryType.php | 40 ++++ Form/ActivityReasonType.php | 41 ++++ Form/ActivityType.php | 47 ++++ Form/ActivityTypeType.php | 39 +++ Resources/config/routing.yml | 16 ++ Resources/config/routing/activity.yml | 30 +++ Resources/config/routing/activityreason.yml | 30 +++ .../config/routing/activityreasoncategory.yml | 30 +++ Resources/config/routing/activitytype.yml | 30 +++ Resources/views/Activity/edit.html.twig | 16 ++ Resources/views/Activity/index.html.twig | 47 ++++ Resources/views/Activity/new.html.twig | 15 ++ Resources/views/Activity/show.html.twig | 44 ++++ Resources/views/ActivityReason/edit.html.twig | 16 ++ .../views/ActivityReason/index.html.twig | 43 ++++ Resources/views/ActivityReason/new.html.twig | 15 ++ Resources/views/ActivityReason/show.html.twig | 36 +++ .../ActivityReasonCategory/edit.html.twig | 16 ++ .../ActivityReasonCategory/index.html.twig | 43 ++++ .../ActivityReasonCategory/new.html.twig | 15 ++ .../ActivityReasonCategory/show.html.twig | 36 +++ Resources/views/ActivityType/edit.html.twig | 16 ++ Resources/views/ActivityType/index.html.twig | 41 ++++ Resources/views/ActivityType/new.html.twig | 15 ++ Resources/views/ActivityType/show.html.twig | 32 +++ Tests/Controller/ActivityControllerTest.php | 55 +++++ .../ActivityReasonCategoryControllerTest.php | 55 +++++ .../ActivityReasonControllerTest.php | 55 +++++ .../Controller/ActivityTypeControllerTest.php | 55 +++++ 33 files changed, 1865 insertions(+) create mode 100644 Controller/ActivityController.php create mode 100644 Controller/ActivityReasonCategoryController.php create mode 100644 Controller/ActivityReasonController.php create mode 100644 Controller/ActivityTypeController.php create mode 100644 Form/ActivityReasonCategoryType.php create mode 100644 Form/ActivityReasonType.php create mode 100644 Form/ActivityType.php create mode 100644 Form/ActivityTypeType.php create mode 100644 Resources/config/routing/activity.yml create mode 100644 Resources/config/routing/activityreason.yml create mode 100644 Resources/config/routing/activityreasoncategory.yml create mode 100644 Resources/config/routing/activitytype.yml create mode 100644 Resources/views/Activity/edit.html.twig create mode 100644 Resources/views/Activity/index.html.twig create mode 100644 Resources/views/Activity/new.html.twig create mode 100644 Resources/views/Activity/show.html.twig create mode 100644 Resources/views/ActivityReason/edit.html.twig create mode 100644 Resources/views/ActivityReason/index.html.twig create mode 100644 Resources/views/ActivityReason/new.html.twig create mode 100644 Resources/views/ActivityReason/show.html.twig create mode 100644 Resources/views/ActivityReasonCategory/edit.html.twig create mode 100644 Resources/views/ActivityReasonCategory/index.html.twig create mode 100644 Resources/views/ActivityReasonCategory/new.html.twig create mode 100644 Resources/views/ActivityReasonCategory/show.html.twig create mode 100644 Resources/views/ActivityType/edit.html.twig create mode 100644 Resources/views/ActivityType/index.html.twig create mode 100644 Resources/views/ActivityType/new.html.twig create mode 100644 Resources/views/ActivityType/show.html.twig create mode 100644 Tests/Controller/ActivityControllerTest.php create mode 100644 Tests/Controller/ActivityReasonCategoryControllerTest.php create mode 100644 Tests/Controller/ActivityReasonControllerTest.php create mode 100644 Tests/Controller/ActivityTypeControllerTest.php diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php new file mode 100644 index 000000000..4ecc17ac3 --- /dev/null +++ b/Controller/ActivityController.php @@ -0,0 +1,224 @@ +getDoctrine()->getManager(); + + $entities = $em->getRepository('ChillActivityBundle:Activity')->findAll(); + + return $this->render('ChillActivityBundle:Activity:index.html.twig', array( + 'entities' => $entities, + )); + } + /** + * Creates a new Activity entity. + * + */ + public function createAction(Request $request) + { + $entity = new Activity(); + $form = $this->createCreateForm($entity); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($entity); + $em->flush(); + + return $this->redirect($this->generateUrl('activity_show', array('id' => $entity->getId()))); + } + + return $this->render('ChillActivityBundle:Activity:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Creates a form to create a Activity entity. + * + * @param Activity $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createCreateForm(Activity $entity) + { + $form = $this->createForm(new ActivityType(), $entity, array( + 'action' => $this->generateUrl('activity_create'), + 'method' => 'POST', + )); + + $form->add('submit', 'submit', array('label' => 'Create')); + + return $form; + } + + /** + * Displays a form to create a new Activity entity. + * + */ + public function newAction() + { + $entity = new Activity(); + $form = $this->createCreateForm($entity); + + return $this->render('ChillActivityBundle:Activity:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a Activity entity. + * + */ + public function showAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find Activity entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:Activity:show.html.twig', array( + 'entity' => $entity, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing Activity entity. + * + */ + public function editAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find Activity entity.'); + } + + $editForm = $this->createEditForm($entity); + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Creates a form to edit a Activity entity. + * + * @param Activity $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createEditForm(Activity $entity) + { + $form = $this->createForm(new ActivityType(), $entity, array( + 'action' => $this->generateUrl('activity_update', array('id' => $entity->getId())), + 'method' => 'PUT', + )); + + $form->add('submit', 'submit', array('label' => 'Update')); + + return $form; + } + /** + * Edits an existing Activity entity. + * + */ + public function updateAction(Request $request, $id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find Activity entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + $editForm = $this->createEditForm($entity); + $editForm->handleRequest($request); + + if ($editForm->isValid()) { + $em->flush(); + + return $this->redirect($this->generateUrl('activity_edit', array('id' => $id))); + } + + return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + /** + * Deletes a Activity entity. + * + */ + public function deleteAction(Request $request, $id) + { + $form = $this->createDeleteForm($id); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find Activity entity.'); + } + + $em->remove($entity); + $em->flush(); + } + + return $this->redirect($this->generateUrl('activity')); + } + + /** + * Creates a form to delete a Activity entity by id. + * + * @param mixed $id The entity id + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm($id) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('activity_delete', array('id' => $id))) + ->setMethod('DELETE') + ->add('submit', 'submit', array('label' => 'Delete')) + ->getForm() + ; + } +} diff --git a/Controller/ActivityReasonCategoryController.php b/Controller/ActivityReasonCategoryController.php new file mode 100644 index 000000000..5d7208377 --- /dev/null +++ b/Controller/ActivityReasonCategoryController.php @@ -0,0 +1,224 @@ +getDoctrine()->getManager(); + + $entities = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->findAll(); + + return $this->render('ChillActivityBundle:ActivityReasonCategory:index.html.twig', array( + 'entities' => $entities, + )); + } + /** + * Creates a new ActivityReasonCategory entity. + * + */ + public function createAction(Request $request) + { + $entity = new ActivityReasonCategory(); + $form = $this->createCreateForm($entity); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($entity); + $em->flush(); + + return $this->redirect($this->generateUrl('activityreasoncategory_show', array('id' => $entity->getId()))); + } + + return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Creates a form to create a ActivityReasonCategory entity. + * + * @param ActivityReasonCategory $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createCreateForm(ActivityReasonCategory $entity) + { + $form = $this->createForm(new ActivityReasonCategoryType(), $entity, array( + 'action' => $this->generateUrl('activityreasoncategory_create'), + 'method' => 'POST', + )); + + $form->add('submit', 'submit', array('label' => 'Create')); + + return $form; + } + + /** + * Displays a form to create a new ActivityReasonCategory entity. + * + */ + public function newAction() + { + $entity = new ActivityReasonCategory(); + $form = $this->createCreateForm($entity); + + return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a ActivityReasonCategory entity. + * + */ + public function showAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:ActivityReasonCategory:show.html.twig', array( + 'entity' => $entity, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing ActivityReasonCategory entity. + * + */ + public function editAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); + } + + $editForm = $this->createEditForm($entity); + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Creates a form to edit a ActivityReasonCategory entity. + * + * @param ActivityReasonCategory $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createEditForm(ActivityReasonCategory $entity) + { + $form = $this->createForm(new ActivityReasonCategoryType(), $entity, array( + 'action' => $this->generateUrl('activityreasoncategory_update', array('id' => $entity->getId())), + 'method' => 'PUT', + )); + + $form->add('submit', 'submit', array('label' => 'Update')); + + return $form; + } + /** + * Edits an existing ActivityReasonCategory entity. + * + */ + public function updateAction(Request $request, $id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + $editForm = $this->createEditForm($entity); + $editForm->handleRequest($request); + + if ($editForm->isValid()) { + $em->flush(); + + return $this->redirect($this->generateUrl('activityreasoncategory_edit', array('id' => $id))); + } + + return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + /** + * Deletes a ActivityReasonCategory entity. + * + */ + public function deleteAction(Request $request, $id) + { + $form = $this->createDeleteForm($id); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); + } + + $em->remove($entity); + $em->flush(); + } + + return $this->redirect($this->generateUrl('activityreasoncategory')); + } + + /** + * Creates a form to delete a ActivityReasonCategory entity by id. + * + * @param mixed $id The entity id + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm($id) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('activityreasoncategory_delete', array('id' => $id))) + ->setMethod('DELETE') + ->add('submit', 'submit', array('label' => 'Delete')) + ->getForm() + ; + } +} diff --git a/Controller/ActivityReasonController.php b/Controller/ActivityReasonController.php new file mode 100644 index 000000000..6f46efe21 --- /dev/null +++ b/Controller/ActivityReasonController.php @@ -0,0 +1,224 @@ +getDoctrine()->getManager(); + + $entities = $em->getRepository('ChillActivityBundle:ActivityReason')->findAll(); + + return $this->render('ChillActivityBundle:ActivityReason:index.html.twig', array( + 'entities' => $entities, + )); + } + /** + * Creates a new ActivityReason entity. + * + */ + public function createAction(Request $request) + { + $entity = new ActivityReason(); + $form = $this->createCreateForm($entity); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($entity); + $em->flush(); + + return $this->redirect($this->generateUrl('activityreason_show', array('id' => $entity->getId()))); + } + + return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Creates a form to create a ActivityReason entity. + * + * @param ActivityReason $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createCreateForm(ActivityReason $entity) + { + $form = $this->createForm(new ActivityReasonType(), $entity, array( + 'action' => $this->generateUrl('activityreason_create'), + 'method' => 'POST', + )); + + $form->add('submit', 'submit', array('label' => 'Create')); + + return $form; + } + + /** + * Displays a form to create a new ActivityReason entity. + * + */ + public function newAction() + { + $entity = new ActivityReason(); + $form = $this->createCreateForm($entity); + + return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a ActivityReason entity. + * + */ + public function showAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReason entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:ActivityReason:show.html.twig', array( + 'entity' => $entity, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing ActivityReason entity. + * + */ + public function editAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReason entity.'); + } + + $editForm = $this->createEditForm($entity); + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Creates a form to edit a ActivityReason entity. + * + * @param ActivityReason $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createEditForm(ActivityReason $entity) + { + $form = $this->createForm(new ActivityReasonType(), $entity, array( + 'action' => $this->generateUrl('activityreason_update', array('id' => $entity->getId())), + 'method' => 'PUT', + )); + + $form->add('submit', 'submit', array('label' => 'Update')); + + return $form; + } + /** + * Edits an existing ActivityReason entity. + * + */ + public function updateAction(Request $request, $id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReason entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + $editForm = $this->createEditForm($entity); + $editForm->handleRequest($request); + + if ($editForm->isValid()) { + $em->flush(); + + return $this->redirect($this->generateUrl('activityreason_edit', array('id' => $id))); + } + + return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + /** + * Deletes a ActivityReason entity. + * + */ + public function deleteAction(Request $request, $id) + { + $form = $this->createDeleteForm($id); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityReason entity.'); + } + + $em->remove($entity); + $em->flush(); + } + + return $this->redirect($this->generateUrl('activityreason')); + } + + /** + * Creates a form to delete a ActivityReason entity by id. + * + * @param mixed $id The entity id + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm($id) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('activityreason_delete', array('id' => $id))) + ->setMethod('DELETE') + ->add('submit', 'submit', array('label' => 'Delete')) + ->getForm() + ; + } +} diff --git a/Controller/ActivityTypeController.php b/Controller/ActivityTypeController.php new file mode 100644 index 000000000..6ca00c1d2 --- /dev/null +++ b/Controller/ActivityTypeController.php @@ -0,0 +1,224 @@ +getDoctrine()->getManager(); + + $entities = $em->getRepository('ChillActivityBundle:ActivityType')->findAll(); + + return $this->render('ChillActivityBundle:ActivityType:index.html.twig', array( + 'entities' => $entities, + )); + } + /** + * Creates a new ActivityType entity. + * + */ + public function createAction(Request $request) + { + $entity = new ActivityType(); + $form = $this->createCreateForm($entity); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($entity); + $em->flush(); + + return $this->redirect($this->generateUrl('activitytype_show', array('id' => $entity->getId()))); + } + + return $this->render('ChillActivityBundle:ActivityType:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Creates a form to create a ActivityType entity. + * + * @param ActivityType $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createCreateForm(ActivityType $entity) + { + $form = $this->createForm(new ActivityTypeType(), $entity, array( + 'action' => $this->generateUrl('activitytype_create'), + 'method' => 'POST', + )); + + $form->add('submit', 'submit', array('label' => 'Create')); + + return $form; + } + + /** + * Displays a form to create a new ActivityType entity. + * + */ + public function newAction() + { + $entity = new ActivityType(); + $form = $this->createCreateForm($entity); + + return $this->render('ChillActivityBundle:ActivityType:new.html.twig', array( + 'entity' => $entity, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a ActivityType entity. + * + */ + public function showAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityType entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:ActivityType:show.html.twig', array( + 'entity' => $entity, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing ActivityType entity. + * + */ + public function editAction($id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityType entity.'); + } + + $editForm = $this->createEditForm($entity); + $deleteForm = $this->createDeleteForm($id); + + return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Creates a form to edit a ActivityType entity. + * + * @param ActivityType $entity The entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createEditForm(ActivityType $entity) + { + $form = $this->createForm(new ActivityTypeType(), $entity, array( + 'action' => $this->generateUrl('activitytype_update', array('id' => $entity->getId())), + 'method' => 'PUT', + )); + + $form->add('submit', 'submit', array('label' => 'Update')); + + return $form; + } + /** + * Edits an existing ActivityType entity. + * + */ + public function updateAction(Request $request, $id) + { + $em = $this->getDoctrine()->getManager(); + + $entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityType entity.'); + } + + $deleteForm = $this->createDeleteForm($id); + $editForm = $this->createEditForm($entity); + $editForm->handleRequest($request); + + if ($editForm->isValid()) { + $em->flush(); + + return $this->redirect($this->generateUrl('activitytype_edit', array('id' => $id))); + } + + return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array( + 'entity' => $entity, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + /** + * Deletes a ActivityType entity. + * + */ + public function deleteAction(Request $request, $id) + { + $form = $this->createDeleteForm($id); + $form->handleRequest($request); + + if ($form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id); + + if (!$entity) { + throw $this->createNotFoundException('Unable to find ActivityType entity.'); + } + + $em->remove($entity); + $em->flush(); + } + + return $this->redirect($this->generateUrl('activitytype')); + } + + /** + * Creates a form to delete a ActivityType entity by id. + * + * @param mixed $id The entity id + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm($id) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('activitytype_delete', array('id' => $id))) + ->setMethod('DELETE') + ->add('submit', 'submit', array('label' => 'Delete')) + ->getForm() + ; + } +} diff --git a/Form/ActivityReasonCategoryType.php b/Form/ActivityReasonCategoryType.php new file mode 100644 index 000000000..4b21f3e3c --- /dev/null +++ b/Form/ActivityReasonCategoryType.php @@ -0,0 +1,40 @@ +add('label') + ->add('active') + ; + } + + /** + * @param OptionsResolverInterface $resolver + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Chill\ActivityBundle\Entity\ActivityReasonCategory' + )); + } + + /** + * @return string + */ + public function getName() + { + return 'chill_activitybundle_activityreasoncategory'; + } +} diff --git a/Form/ActivityReasonType.php b/Form/ActivityReasonType.php new file mode 100644 index 000000000..43704fe03 --- /dev/null +++ b/Form/ActivityReasonType.php @@ -0,0 +1,41 @@ +add('label') + ->add('active') + ->add('category') + ; + } + + /** + * @param OptionsResolverInterface $resolver + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Chill\ActivityBundle\Entity\ActivityReason' + )); + } + + /** + * @return string + */ + public function getName() + { + return 'chill_activitybundle_activityreason'; + } +} diff --git a/Form/ActivityType.php b/Form/ActivityType.php new file mode 100644 index 000000000..b51e9af28 --- /dev/null +++ b/Form/ActivityType.php @@ -0,0 +1,47 @@ +add('date') + ->add('durationTime') + ->add('remark') + ->add('attendee') + ->add('user') + ->add('scope') + ->add('reason') + ->add('type') + ->add('person') + ; + } + + /** + * @param OptionsResolverInterface $resolver + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Chill\ActivityBundle\Entity\Activity' + )); + } + + /** + * @return string + */ + public function getName() + { + return 'chill_activitybundle_activity'; + } +} diff --git a/Form/ActivityTypeType.php b/Form/ActivityTypeType.php new file mode 100644 index 000000000..cbc5d5afa --- /dev/null +++ b/Form/ActivityTypeType.php @@ -0,0 +1,39 @@ +add('name') + ; + } + + /** + * @param OptionsResolverInterface $resolver + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Chill\ActivityBundle\Entity\ActivityType' + )); + } + + /** + * @return string + */ + public function getName() + { + return 'chill_activitybundle_activitytype'; + } +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 6f006d159..9f70adcf7 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -1,3 +1,19 @@ +chill_activity_activity: + resource: "@ChillActivityBundle/Resources/config/routing/activity.yml" + prefix: /activity + +chill_activity_activityreason: + resource: "@ChillActivityBundle/Resources/config/routing/activityreason.yml" + prefix: /activityreason + +chill_activity_activityreasoncategory: + resource: "@ChillActivityBundle/Resources/config/routing/activityreasoncategory.yml" + prefix: /activityreasoncategory + +chill_activity_activitytype: + resource: "@ChillActivityBundle/Resources/config/routing/activitytype.yml" + prefix: /activitytype + chill_activity_homepage: path: /hello/{name} defaults: { _controller: ChillActivityBundle:Default:index } diff --git a/Resources/config/routing/activity.yml b/Resources/config/routing/activity.yml new file mode 100644 index 000000000..9efeac928 --- /dev/null +++ b/Resources/config/routing/activity.yml @@ -0,0 +1,30 @@ +activity: + path: / + defaults: { _controller: "ChillActivityBundle:Activity:index" } + +activity_show: + path: /{id}/show + defaults: { _controller: "ChillActivityBundle:Activity:show" } + +activity_new: + path: /new + defaults: { _controller: "ChillActivityBundle:Activity:new" } + +activity_create: + path: /create + defaults: { _controller: "ChillActivityBundle:Activity:create" } + methods: POST + +activity_edit: + path: /{id}/edit + defaults: { _controller: "ChillActivityBundle:Activity:edit" } + +activity_update: + path: /{id}/update + defaults: { _controller: "ChillActivityBundle:Activity:update" } + methods: [POST, PUT] + +activity_delete: + path: /{id}/delete + defaults: { _controller: "ChillActivityBundle:Activity:delete" } + methods: [POST, DELETE] diff --git a/Resources/config/routing/activityreason.yml b/Resources/config/routing/activityreason.yml new file mode 100644 index 000000000..367982cc5 --- /dev/null +++ b/Resources/config/routing/activityreason.yml @@ -0,0 +1,30 @@ +activityreason: + path: / + defaults: { _controller: "ChillActivityBundle:ActivityReason:index" } + +activityreason_show: + path: /{id}/show + defaults: { _controller: "ChillActivityBundle:ActivityReason:show" } + +activityreason_new: + path: /new + defaults: { _controller: "ChillActivityBundle:ActivityReason:new" } + +activityreason_create: + path: /create + defaults: { _controller: "ChillActivityBundle:ActivityReason:create" } + methods: POST + +activityreason_edit: + path: /{id}/edit + defaults: { _controller: "ChillActivityBundle:ActivityReason:edit" } + +activityreason_update: + path: /{id}/update + defaults: { _controller: "ChillActivityBundle:ActivityReason:update" } + methods: [POST, PUT] + +activityreason_delete: + path: /{id}/delete + defaults: { _controller: "ChillActivityBundle:ActivityReason:delete" } + methods: [POST, DELETE] diff --git a/Resources/config/routing/activityreasoncategory.yml b/Resources/config/routing/activityreasoncategory.yml new file mode 100644 index 000000000..f318ef408 --- /dev/null +++ b/Resources/config/routing/activityreasoncategory.yml @@ -0,0 +1,30 @@ +activityreasoncategory: + path: / + defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:index" } + +activityreasoncategory_show: + path: /{id}/show + defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:show" } + +activityreasoncategory_new: + path: /new + defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:new" } + +activityreasoncategory_create: + path: /create + defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:create" } + methods: POST + +activityreasoncategory_edit: + path: /{id}/edit + defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:edit" } + +activityreasoncategory_update: + path: /{id}/update + defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:update" } + methods: [POST, PUT] + +activityreasoncategory_delete: + path: /{id}/delete + defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:delete" } + methods: [POST, DELETE] diff --git a/Resources/config/routing/activitytype.yml b/Resources/config/routing/activitytype.yml new file mode 100644 index 000000000..c850cf3ca --- /dev/null +++ b/Resources/config/routing/activitytype.yml @@ -0,0 +1,30 @@ +activitytype: + path: / + defaults: { _controller: "ChillActivityBundle:ActivityType:index" } + +activitytype_show: + path: /{id}/show + defaults: { _controller: "ChillActivityBundle:ActivityType:show" } + +activitytype_new: + path: /new + defaults: { _controller: "ChillActivityBundle:ActivityType:new" } + +activitytype_create: + path: /create + defaults: { _controller: "ChillActivityBundle:ActivityType:create" } + methods: POST + +activitytype_edit: + path: /{id}/edit + defaults: { _controller: "ChillActivityBundle:ActivityType:edit" } + +activitytype_update: + path: /{id}/update + defaults: { _controller: "ChillActivityBundle:ActivityType:update" } + methods: [POST, PUT] + +activitytype_delete: + path: /{id}/delete + defaults: { _controller: "ChillActivityBundle:ActivityType:delete" } + methods: [POST, DELETE] diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig new file mode 100644 index 000000000..846ec0bc5 --- /dev/null +++ b/Resources/views/Activity/edit.html.twig @@ -0,0 +1,16 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

Activity edit

+ + {{ form(edit_form) }} + + +{% endblock %} diff --git a/Resources/views/Activity/index.html.twig b/Resources/views/Activity/index.html.twig new file mode 100644 index 000000000..c13361585 --- /dev/null +++ b/Resources/views/Activity/index.html.twig @@ -0,0 +1,47 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

Activity list

+ + + + + + + + + + + + + + {% for entity in entities %} + + + + + + + + + {% endfor %} + +
IdDateDurationtimeRemarkAttendeeActions
{{ entity.id }}{% if entity.date %}{{ entity.date|date('Y-m-d H:i:s') }}{% endif %}{{ entity.durationTime }}{{ entity.remark }}{{ entity.attendee }} + +
+ + + {% endblock %} diff --git a/Resources/views/Activity/new.html.twig b/Resources/views/Activity/new.html.twig new file mode 100644 index 000000000..94c3169e7 --- /dev/null +++ b/Resources/views/Activity/new.html.twig @@ -0,0 +1,15 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

Activity creation

+ + {{ form(form) }} + + +{% endblock %} diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig new file mode 100644 index 000000000..eb939fcc4 --- /dev/null +++ b/Resources/views/Activity/show.html.twig @@ -0,0 +1,44 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

Activity

+ + + + + + + + + + + + + + + + + + + + + + + + +
Id{{ entity.id }}
Date{{ entity.date|date('Y-m-d H:i:s') }}
Durationtime{{ entity.durationTime }}
Remark{{ entity.remark }}
Attendee{{ entity.attendee }}
+ + +{% endblock %} diff --git a/Resources/views/ActivityReason/edit.html.twig b/Resources/views/ActivityReason/edit.html.twig new file mode 100644 index 000000000..d2db39938 --- /dev/null +++ b/Resources/views/ActivityReason/edit.html.twig @@ -0,0 +1,16 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReason edit

+ + {{ form(edit_form) }} + + +{% endblock %} diff --git a/Resources/views/ActivityReason/index.html.twig b/Resources/views/ActivityReason/index.html.twig new file mode 100644 index 000000000..947381a8a --- /dev/null +++ b/Resources/views/ActivityReason/index.html.twig @@ -0,0 +1,43 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReason list

+ + + + + + + + + + + + {% for entity in entities %} + + + + + + + {% endfor %} + +
IdLabelActiveActions
{{ entity.id }}{{ entity.label }}{{ entity.active }} + +
+ + + {% endblock %} diff --git a/Resources/views/ActivityReason/new.html.twig b/Resources/views/ActivityReason/new.html.twig new file mode 100644 index 000000000..b37d3bf10 --- /dev/null +++ b/Resources/views/ActivityReason/new.html.twig @@ -0,0 +1,15 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReason creation

+ + {{ form(form) }} + + +{% endblock %} diff --git a/Resources/views/ActivityReason/show.html.twig b/Resources/views/ActivityReason/show.html.twig new file mode 100644 index 000000000..d287fc07c --- /dev/null +++ b/Resources/views/ActivityReason/show.html.twig @@ -0,0 +1,36 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReason

+ + + + + + + + + + + + + + + + +
Id{{ entity.id }}
Label{{ entity.label }}
Active{{ entity.active }}
+ + +{% endblock %} diff --git a/Resources/views/ActivityReasonCategory/edit.html.twig b/Resources/views/ActivityReasonCategory/edit.html.twig new file mode 100644 index 000000000..7fefcef98 --- /dev/null +++ b/Resources/views/ActivityReasonCategory/edit.html.twig @@ -0,0 +1,16 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReasonCategory edit

+ + {{ form(edit_form) }} + + +{% endblock %} diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig new file mode 100644 index 000000000..7979148c7 --- /dev/null +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -0,0 +1,43 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReasonCategory list

+ + + + + + + + + + + + {% for entity in entities %} + + + + + + + {% endfor %} + +
IdLabelActiveActions
{{ entity.id }}{{ entity.label }}{{ entity.active }} + +
+ + + {% endblock %} diff --git a/Resources/views/ActivityReasonCategory/new.html.twig b/Resources/views/ActivityReasonCategory/new.html.twig new file mode 100644 index 000000000..feddcfed8 --- /dev/null +++ b/Resources/views/ActivityReasonCategory/new.html.twig @@ -0,0 +1,15 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReasonCategory creation

+ + {{ form(form) }} + + +{% endblock %} diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig new file mode 100644 index 000000000..bd9bb4bb2 --- /dev/null +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -0,0 +1,36 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityReasonCategory

+ + + + + + + + + + + + + + + + +
Id{{ entity.id }}
Label{{ entity.label }}
Active{{ entity.active }}
+ + +{% endblock %} diff --git a/Resources/views/ActivityType/edit.html.twig b/Resources/views/ActivityType/edit.html.twig new file mode 100644 index 000000000..aa88e761c --- /dev/null +++ b/Resources/views/ActivityType/edit.html.twig @@ -0,0 +1,16 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityType edit

+ + {{ form(edit_form) }} + + +{% endblock %} diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig new file mode 100644 index 000000000..0dc63aad3 --- /dev/null +++ b/Resources/views/ActivityType/index.html.twig @@ -0,0 +1,41 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityType list

+ + + + + + + + + + + {% for entity in entities %} + + + + + + {% endfor %} + +
IdNameActions
{{ entity.id }}{{ entity.name }} + +
+ + + {% endblock %} diff --git a/Resources/views/ActivityType/new.html.twig b/Resources/views/ActivityType/new.html.twig new file mode 100644 index 000000000..7e43c1668 --- /dev/null +++ b/Resources/views/ActivityType/new.html.twig @@ -0,0 +1,15 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityType creation

+ + {{ form(form) }} + + +{% endblock %} diff --git a/Resources/views/ActivityType/show.html.twig b/Resources/views/ActivityType/show.html.twig new file mode 100644 index 000000000..08aa01aff --- /dev/null +++ b/Resources/views/ActivityType/show.html.twig @@ -0,0 +1,32 @@ +{% extends '::base.html.twig' %} + +{% block body -%} +

ActivityType

+ + + + + + + + + + + + +
Id{{ entity.id }}
Name{{ entity.name }}
+ + +{% endblock %} diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php new file mode 100644 index 000000000..2a0cb3c21 --- /dev/null +++ b/Tests/Controller/ActivityControllerTest.php @@ -0,0 +1,55 @@ +request('GET', '/activity/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activity/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'chill_activitybundle_activity[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'chill_activitybundle_activity[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +} diff --git a/Tests/Controller/ActivityReasonCategoryControllerTest.php b/Tests/Controller/ActivityReasonCategoryControllerTest.php new file mode 100644 index 000000000..09dbbfb86 --- /dev/null +++ b/Tests/Controller/ActivityReasonCategoryControllerTest.php @@ -0,0 +1,55 @@ +request('GET', '/activityreasoncategory/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activityreasoncategory/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'chill_activitybundle_activityreasoncategory[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'chill_activitybundle_activityreasoncategory[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +} diff --git a/Tests/Controller/ActivityReasonControllerTest.php b/Tests/Controller/ActivityReasonControllerTest.php new file mode 100644 index 000000000..d1adc9ca4 --- /dev/null +++ b/Tests/Controller/ActivityReasonControllerTest.php @@ -0,0 +1,55 @@ +request('GET', '/activityreason/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activityreason/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'chill_activitybundle_activityreason[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'chill_activitybundle_activityreason[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +} diff --git a/Tests/Controller/ActivityTypeControllerTest.php b/Tests/Controller/ActivityTypeControllerTest.php new file mode 100644 index 000000000..07c72c3dd --- /dev/null +++ b/Tests/Controller/ActivityTypeControllerTest.php @@ -0,0 +1,55 @@ +request('GET', '/activitytype/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activitytype/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'chill_activitybundle_activitytype[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'chill_activitybundle_activitytype[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +} From 6d53ab6cb7f9f2a407c2cf64f6abcf5017eb5e64 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 16:34:03 +0200 Subject: [PATCH 008/163] loading activity routes automaticaly --- .../ChillActivityExtension.php | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 9340c40f5..de0aa0de2 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -1,18 +1,39 @@ , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + namespace Chill\ActivityBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; /** * This is the class that loads and manages your bundle configuration * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html} */ -class ChillActivityExtension extends Extension +class ChillActivityExtension extends Extension implements PrependExtensionInterface { /** * {@inheritdoc} @@ -25,4 +46,19 @@ class ChillActivityExtension extends Extension $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); } + + /* (non-PHPdoc) + * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() + */ + public function prepend(ContainerBuilder $container) + { + //add routes for custom bundle + $container->prependExtensionConfig('chill_main', array( + 'routing' => array( + 'resources' => array( + '@ChillActivityBundle/Resources/config/routing.yml' + ) + ) + )); + } } From c2a36ef928c8d49b0b5e7b985a81993c2aa98b14 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 18:12:25 +0200 Subject: [PATCH 009/163] Renaming route + in admin --- .../ActivityReasonCategoryController.php | 12 ++++---- Controller/ActivityReasonController.php | 12 ++++---- Controller/ActivityTypeController.php | 12 ++++---- Resources/config/routing.yml | 10 ++----- Resources/config/routing/activityreason.yml | 28 +++++++++---------- .../config/routing/activityreasoncategory.yml | 28 +++++++++---------- Resources/config/routing/activitytype.yml | 26 ++++++++--------- Resources/views/ActivityReason/edit.html.twig | 2 +- .../views/ActivityReason/index.html.twig | 8 +++--- Resources/views/ActivityReason/new.html.twig | 2 +- Resources/views/ActivityReason/show.html.twig | 4 +-- .../ActivityReasonCategory/edit.html.twig | 2 +- .../ActivityReasonCategory/index.html.twig | 8 +++--- .../ActivityReasonCategory/new.html.twig | 2 +- .../ActivityReasonCategory/show.html.twig | 4 +-- Resources/views/ActivityType/edit.html.twig | 2 +- Resources/views/ActivityType/index.html.twig | 8 +++--- Resources/views/ActivityType/new.html.twig | 2 +- Resources/views/ActivityType/show.html.twig | 4 +-- 19 files changed, 86 insertions(+), 90 deletions(-) diff --git a/Controller/ActivityReasonCategoryController.php b/Controller/ActivityReasonCategoryController.php index 5d7208377..225c52415 100644 --- a/Controller/ActivityReasonCategoryController.php +++ b/Controller/ActivityReasonCategoryController.php @@ -44,7 +44,7 @@ class ActivityReasonCategoryController extends Controller $em->persist($entity); $em->flush(); - return $this->redirect($this->generateUrl('activityreasoncategory_show', array('id' => $entity->getId()))); + return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory_show', array('id' => $entity->getId()))); } return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', array( @@ -63,7 +63,7 @@ class ActivityReasonCategoryController extends Controller private function createCreateForm(ActivityReasonCategory $entity) { $form = $this->createForm(new ActivityReasonCategoryType(), $entity, array( - 'action' => $this->generateUrl('activityreasoncategory_create'), + 'action' => $this->generateUrl('chill_activity_activityreasoncategory_create'), 'method' => 'POST', )); @@ -143,7 +143,7 @@ class ActivityReasonCategoryController extends Controller private function createEditForm(ActivityReasonCategory $entity) { $form = $this->createForm(new ActivityReasonCategoryType(), $entity, array( - 'action' => $this->generateUrl('activityreasoncategory_update', array('id' => $entity->getId())), + 'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', array('id' => $entity->getId())), 'method' => 'PUT', )); @@ -172,7 +172,7 @@ class ActivityReasonCategoryController extends Controller if ($editForm->isValid()) { $em->flush(); - return $this->redirect($this->generateUrl('activityreasoncategory_edit', array('id' => $id))); + return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory_edit', array('id' => $id))); } return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array( @@ -202,7 +202,7 @@ class ActivityReasonCategoryController extends Controller $em->flush(); } - return $this->redirect($this->generateUrl('activityreasoncategory')); + return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory')); } /** @@ -215,7 +215,7 @@ class ActivityReasonCategoryController extends Controller private function createDeleteForm($id) { return $this->createFormBuilder() - ->setAction($this->generateUrl('activityreasoncategory_delete', array('id' => $id))) + ->setAction($this->generateUrl('chill_activity_activityreasoncategory_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Delete')) ->getForm() diff --git a/Controller/ActivityReasonController.php b/Controller/ActivityReasonController.php index 6f46efe21..c2093be87 100644 --- a/Controller/ActivityReasonController.php +++ b/Controller/ActivityReasonController.php @@ -44,7 +44,7 @@ class ActivityReasonController extends Controller $em->persist($entity); $em->flush(); - return $this->redirect($this->generateUrl('activityreason_show', array('id' => $entity->getId()))); + return $this->redirect($this->generateUrl('chill_activity_activityreason_show', array('id' => $entity->getId()))); } return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array( @@ -63,7 +63,7 @@ class ActivityReasonController extends Controller private function createCreateForm(ActivityReason $entity) { $form = $this->createForm(new ActivityReasonType(), $entity, array( - 'action' => $this->generateUrl('activityreason_create'), + 'action' => $this->generateUrl('chill_activity_activityreason_create'), 'method' => 'POST', )); @@ -143,7 +143,7 @@ class ActivityReasonController extends Controller private function createEditForm(ActivityReason $entity) { $form = $this->createForm(new ActivityReasonType(), $entity, array( - 'action' => $this->generateUrl('activityreason_update', array('id' => $entity->getId())), + 'action' => $this->generateUrl('chill_activity_activityreason_update', array('id' => $entity->getId())), 'method' => 'PUT', )); @@ -172,7 +172,7 @@ class ActivityReasonController extends Controller if ($editForm->isValid()) { $em->flush(); - return $this->redirect($this->generateUrl('activityreason_edit', array('id' => $id))); + return $this->redirect($this->generateUrl('chill_activity_activityreason_edit', array('id' => $id))); } return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array( @@ -202,7 +202,7 @@ class ActivityReasonController extends Controller $em->flush(); } - return $this->redirect($this->generateUrl('activityreason')); + return $this->redirect($this->generateUrl('chill_activity_activityreason')); } /** @@ -215,7 +215,7 @@ class ActivityReasonController extends Controller private function createDeleteForm($id) { return $this->createFormBuilder() - ->setAction($this->generateUrl('activityreason_delete', array('id' => $id))) + ->setAction($this->generateUrl('chill_activity_activityreason_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Delete')) ->getForm() diff --git a/Controller/ActivityTypeController.php b/Controller/ActivityTypeController.php index 6ca00c1d2..308f698ec 100644 --- a/Controller/ActivityTypeController.php +++ b/Controller/ActivityTypeController.php @@ -44,7 +44,7 @@ class ActivityTypeController extends Controller $em->persist($entity); $em->flush(); - return $this->redirect($this->generateUrl('activitytype_show', array('id' => $entity->getId()))); + return $this->redirect($this->generateUrl('chill_activity_activitytype_show', array('id' => $entity->getId()))); } return $this->render('ChillActivityBundle:ActivityType:new.html.twig', array( @@ -63,7 +63,7 @@ class ActivityTypeController extends Controller private function createCreateForm(ActivityType $entity) { $form = $this->createForm(new ActivityTypeType(), $entity, array( - 'action' => $this->generateUrl('activitytype_create'), + 'action' => $this->generateUrl('chill_activity_activitytype_create'), 'method' => 'POST', )); @@ -143,7 +143,7 @@ class ActivityTypeController extends Controller private function createEditForm(ActivityType $entity) { $form = $this->createForm(new ActivityTypeType(), $entity, array( - 'action' => $this->generateUrl('activitytype_update', array('id' => $entity->getId())), + 'action' => $this->generateUrl('chill_activity_activitytype_update', array('id' => $entity->getId())), 'method' => 'PUT', )); @@ -172,7 +172,7 @@ class ActivityTypeController extends Controller if ($editForm->isValid()) { $em->flush(); - return $this->redirect($this->generateUrl('activitytype_edit', array('id' => $id))); + return $this->redirect($this->generateUrl('chill_activity_activitytype_edit', array('id' => $id))); } return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array( @@ -202,7 +202,7 @@ class ActivityTypeController extends Controller $em->flush(); } - return $this->redirect($this->generateUrl('activitytype')); + return $this->redirect($this->generateUrl('chill_activity_activitytype')); } /** @@ -215,7 +215,7 @@ class ActivityTypeController extends Controller private function createDeleteForm($id) { return $this->createFormBuilder() - ->setAction($this->generateUrl('activitytype_delete', array('id' => $id))) + ->setAction($this->generateUrl('chill_activity_activitytype_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Delete')) ->getForm() diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 9f70adcf7..a3fde0da5 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -4,16 +4,12 @@ chill_activity_activity: chill_activity_activityreason: resource: "@ChillActivityBundle/Resources/config/routing/activityreason.yml" - prefix: /activityreason + prefix: / chill_activity_activityreasoncategory: resource: "@ChillActivityBundle/Resources/config/routing/activityreasoncategory.yml" - prefix: /activityreasoncategory + prefix: / chill_activity_activitytype: resource: "@ChillActivityBundle/Resources/config/routing/activitytype.yml" - prefix: /activitytype - -chill_activity_homepage: - path: /hello/{name} - defaults: { _controller: ChillActivityBundle:Default:index } + prefix: / diff --git a/Resources/config/routing/activityreason.yml b/Resources/config/routing/activityreason.yml index 367982cc5..a3c193258 100644 --- a/Resources/config/routing/activityreason.yml +++ b/Resources/config/routing/activityreason.yml @@ -1,30 +1,30 @@ -activityreason: - path: / +chill_activity_activityreason: + path: /{_locale}/admin/activityreason/ defaults: { _controller: "ChillActivityBundle:ActivityReason:index" } -activityreason_show: - path: /{id}/show +chill_activity_activityreason_show: + path: /{_locale}/admin/activityreason/{id}/show defaults: { _controller: "ChillActivityBundle:ActivityReason:show" } -activityreason_new: - path: /new +chill_activity_activityreason_new: + path: /{_locale}/admin/activityreason/new defaults: { _controller: "ChillActivityBundle:ActivityReason:new" } -activityreason_create: - path: /create +chill_activity_activityreason_create: + path: /{_locale}/admin/activityreason/create defaults: { _controller: "ChillActivityBundle:ActivityReason:create" } methods: POST -activityreason_edit: - path: /{id}/edit +chill_activity_activityreason_edit: + path: /{_locale}/admin/activityreason/{id}/edit defaults: { _controller: "ChillActivityBundle:ActivityReason:edit" } -activityreason_update: - path: /{id}/update +chill_activity_activityreason_update: + path: /{_locale}/admin/activityreason/{id}/update defaults: { _controller: "ChillActivityBundle:ActivityReason:update" } methods: [POST, PUT] -activityreason_delete: - path: /{id}/delete +chill_activity_activityreason_delete: + path: /{_locale}/admin/activityreason/{id}/delete defaults: { _controller: "ChillActivityBundle:ActivityReason:delete" } methods: [POST, DELETE] diff --git a/Resources/config/routing/activityreasoncategory.yml b/Resources/config/routing/activityreasoncategory.yml index f318ef408..595414517 100644 --- a/Resources/config/routing/activityreasoncategory.yml +++ b/Resources/config/routing/activityreasoncategory.yml @@ -1,30 +1,30 @@ -activityreasoncategory: - path: / +chill_activity_activityreasoncategory: + path: /{_locale}/admin/activityreasoncategory/ defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:index" } -activityreasoncategory_show: - path: /{id}/show +chill_activity_activityreasoncategory_show: + path: /{_locale}/admin/activityreasoncategory/{id}/show defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:show" } -activityreasoncategory_new: - path: /new +chill_activity_activityreasoncategory_new: + path: /{_locale}/admin/activityreasoncategory/new defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:new" } -activityreasoncategory_create: - path: /create +chill_activity_activityreasoncategory_create: + path: /{_locale}/admin/activityreasoncategory/create defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:create" } methods: POST -activityreasoncategory_edit: - path: /{id}/edit +chill_activity_activityreasoncategory_edit: + path: /{_locale}/admin/activityreasoncategory/{id}/edit defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:edit" } -activityreasoncategory_update: - path: /{id}/update +chill_activity_activityreasoncategory_update: + path: /{_locale}/admin/activityreasoncategory/{id}/update defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:update" } methods: [POST, PUT] -activityreasoncategory_delete: - path: /{id}/delete +chill_activity_activityreasoncategory_delete: + path: /{_locale}/admin/activityreasoncategory/{id}/delete defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:delete" } methods: [POST, DELETE] diff --git a/Resources/config/routing/activitytype.yml b/Resources/config/routing/activitytype.yml index c850cf3ca..b239dc3b3 100644 --- a/Resources/config/routing/activitytype.yml +++ b/Resources/config/routing/activitytype.yml @@ -1,30 +1,30 @@ activitytype: - path: / + path: /{_locale}/admin/activitytype/ defaults: { _controller: "ChillActivityBundle:ActivityType:index" } -activitytype_show: - path: /{id}/show +chill_activity_activitytype_show: + path: /{_locale}/admin/activitytype/{id}/show defaults: { _controller: "ChillActivityBundle:ActivityType:show" } -activitytype_new: - path: /new +chill_activity_activitytype_new: + path: /{_locale}/admin/activitytype/new defaults: { _controller: "ChillActivityBundle:ActivityType:new" } -activitytype_create: - path: /create +chill_activity_activitytype_create: + path: /{_locale}/admin/activitytype/create defaults: { _controller: "ChillActivityBundle:ActivityType:create" } methods: POST -activitytype_edit: - path: /{id}/edit +chill_activity_activitytype_edit: + path: /{_locale}/admin/activitytype/{id}/edit defaults: { _controller: "ChillActivityBundle:ActivityType:edit" } -activitytype_update: - path: /{id}/update +chill_activity_activitytype_update: + path: /{_locale}/admin/activitytype/{id}/update defaults: { _controller: "ChillActivityBundle:ActivityType:update" } methods: [POST, PUT] -activitytype_delete: - path: /{id}/delete +chill_activity_activitytype_delete: + path: /{_locale}/admin/activitytype/{id}/delete defaults: { _controller: "ChillActivityBundle:ActivityType:delete" } methods: [POST, DELETE] diff --git a/Resources/views/ActivityReason/edit.html.twig b/Resources/views/ActivityReason/edit.html.twig index d2db39938..c81c8f0eb 100644 --- a/Resources/views/ActivityReason/edit.html.twig +++ b/Resources/views/ActivityReason/edit.html.twig @@ -7,7 +7,7 @@
  • - + Back to the list
  • diff --git a/Resources/views/ActivityReason/index.html.twig b/Resources/views/ActivityReason/index.html.twig index 947381a8a..96df53900 100644 --- a/Resources/views/ActivityReason/index.html.twig +++ b/Resources/views/ActivityReason/index.html.twig @@ -15,16 +15,16 @@ {% for entity in entities %} - {{ entity.id }} + {{ entity.id }} {{ entity.label }} {{ entity.active }} @@ -35,7 +35,7 @@
    • - + Create a new entry
    • diff --git a/Resources/views/ActivityReason/new.html.twig b/Resources/views/ActivityReason/new.html.twig index b37d3bf10..b56935a79 100644 --- a/Resources/views/ActivityReason/new.html.twig +++ b/Resources/views/ActivityReason/new.html.twig @@ -7,7 +7,7 @@
      • - + Back to the list
      • diff --git a/Resources/views/ActivityReason/show.html.twig b/Resources/views/ActivityReason/show.html.twig index d287fc07c..322dff794 100644 --- a/Resources/views/ActivityReason/show.html.twig +++ b/Resources/views/ActivityReason/show.html.twig @@ -22,12 +22,12 @@
        • - + Back to the list
        • - + Edit
        • diff --git a/Resources/views/ActivityReasonCategory/edit.html.twig b/Resources/views/ActivityReasonCategory/edit.html.twig index 7fefcef98..8f0b3c61b 100644 --- a/Resources/views/ActivityReasonCategory/edit.html.twig +++ b/Resources/views/ActivityReasonCategory/edit.html.twig @@ -7,7 +7,7 @@
          • - + Back to the list
          • diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig index 7979148c7..c3f8942b0 100644 --- a/Resources/views/ActivityReasonCategory/index.html.twig +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -15,16 +15,16 @@ {% for entity in entities %} - {{ entity.id }} + {{ entity.id }} {{ entity.label }} {{ entity.active }} @@ -35,7 +35,7 @@
            • - + Create a new entry
            • diff --git a/Resources/views/ActivityReasonCategory/new.html.twig b/Resources/views/ActivityReasonCategory/new.html.twig index feddcfed8..408e5c0a3 100644 --- a/Resources/views/ActivityReasonCategory/new.html.twig +++ b/Resources/views/ActivityReasonCategory/new.html.twig @@ -7,7 +7,7 @@
              • - + Back to the list
              • diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig index bd9bb4bb2..f10e18e75 100644 --- a/Resources/views/ActivityReasonCategory/show.html.twig +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -22,12 +22,12 @@
                • - + Back to the list
                • - + Edit
                • diff --git a/Resources/views/ActivityType/edit.html.twig b/Resources/views/ActivityType/edit.html.twig index aa88e761c..b6c3e982e 100644 --- a/Resources/views/ActivityType/edit.html.twig +++ b/Resources/views/ActivityType/edit.html.twig @@ -7,7 +7,7 @@
                  • - + Back to the list
                  • diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig index 0dc63aad3..096223642 100644 --- a/Resources/views/ActivityType/index.html.twig +++ b/Resources/views/ActivityType/index.html.twig @@ -14,15 +14,15 @@ {% for entity in entities %} - {{ entity.id }} + {{ entity.id }} {{ entity.name }} @@ -33,7 +33,7 @@
                    • - + Create a new entry
                    • diff --git a/Resources/views/ActivityType/new.html.twig b/Resources/views/ActivityType/new.html.twig index 7e43c1668..d6cc6c25f 100644 --- a/Resources/views/ActivityType/new.html.twig +++ b/Resources/views/ActivityType/new.html.twig @@ -7,7 +7,7 @@
                      • - + Back to the list
                      • diff --git a/Resources/views/ActivityType/show.html.twig b/Resources/views/ActivityType/show.html.twig index 08aa01aff..0ec182f88 100644 --- a/Resources/views/ActivityType/show.html.twig +++ b/Resources/views/ActivityType/show.html.twig @@ -18,12 +18,12 @@
                        • - + Back to the list
                        • - + Edit
                        • From b07c6ee6fbe9bf9ff72a5e55e374d45860da8594 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 18:21:31 +0200 Subject: [PATCH 010/163] Removing default view --- Resources/views/Default/index.html.twig | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Resources/views/Default/index.html.twig diff --git a/Resources/views/Default/index.html.twig b/Resources/views/Default/index.html.twig deleted file mode 100644 index 4ce626e9b..000000000 --- a/Resources/views/Default/index.html.twig +++ /dev/null @@ -1 +0,0 @@ -Hello {{ name }}! From b430ac30b0b632ab5e0dcf0451a09800b4e34b23 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 18:22:06 +0200 Subject: [PATCH 011/163] Adding admin template --- Resources/views/ActivityReason/edit.html.twig | 20 +++++++++++++++++-- .../views/ActivityReason/index.html.twig | 20 +++++++++++++++++-- Resources/views/ActivityReason/new.html.twig | 20 +++++++++++++++++-- Resources/views/ActivityReason/show.html.twig | 20 +++++++++++++++++-- .../ActivityReasonCategory/edit.html.twig | 20 +++++++++++++++++-- .../ActivityReasonCategory/index.html.twig | 20 +++++++++++++++++-- .../ActivityReasonCategory/new.html.twig | 20 +++++++++++++++++-- .../ActivityReasonCategory/show.html.twig | 20 +++++++++++++++++-- Resources/views/ActivityType/edit.html.twig | 20 +++++++++++++++++-- Resources/views/ActivityType/index.html.twig | 20 +++++++++++++++++-- Resources/views/ActivityType/new.html.twig | 20 +++++++++++++++++-- Resources/views/ActivityType/show.html.twig | 20 +++++++++++++++++-- 12 files changed, 216 insertions(+), 24 deletions(-) diff --git a/Resources/views/ActivityReason/edit.html.twig b/Resources/views/ActivityReason/edit.html.twig index c81c8f0eb..cf775fb30 100644 --- a/Resources/views/ActivityReason/edit.html.twig +++ b/Resources/views/ActivityReason/edit.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReason edit

                          {{ form(edit_form) }} diff --git a/Resources/views/ActivityReason/index.html.twig b/Resources/views/ActivityReason/index.html.twig index 96df53900..3108a589f 100644 --- a/Resources/views/ActivityReason/index.html.twig +++ b/Resources/views/ActivityReason/index.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReason list

                          diff --git a/Resources/views/ActivityReason/new.html.twig b/Resources/views/ActivityReason/new.html.twig index b56935a79..afc45a5df 100644 --- a/Resources/views/ActivityReason/new.html.twig +++ b/Resources/views/ActivityReason/new.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReason creation

                          {{ form(form) }} diff --git a/Resources/views/ActivityReason/show.html.twig b/Resources/views/ActivityReason/show.html.twig index 322dff794..0055d90f8 100644 --- a/Resources/views/ActivityReason/show.html.twig +++ b/Resources/views/ActivityReason/show.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReason

                          diff --git a/Resources/views/ActivityReasonCategory/edit.html.twig b/Resources/views/ActivityReasonCategory/edit.html.twig index 8f0b3c61b..09b81b375 100644 --- a/Resources/views/ActivityReasonCategory/edit.html.twig +++ b/Resources/views/ActivityReasonCategory/edit.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReasonCategory edit

                          {{ form(edit_form) }} diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig index c3f8942b0..3b8333cf3 100644 --- a/Resources/views/ActivityReasonCategory/index.html.twig +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReasonCategory list

                          diff --git a/Resources/views/ActivityReasonCategory/new.html.twig b/Resources/views/ActivityReasonCategory/new.html.twig index 408e5c0a3..d4eb215f7 100644 --- a/Resources/views/ActivityReasonCategory/new.html.twig +++ b/Resources/views/ActivityReasonCategory/new.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReasonCategory creation

                          {{ form(form) }} diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig index f10e18e75..98242281b 100644 --- a/Resources/views/ActivityReasonCategory/show.html.twig +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityReasonCategory

                          diff --git a/Resources/views/ActivityType/edit.html.twig b/Resources/views/ActivityType/edit.html.twig index b6c3e982e..67fdd3b1c 100644 --- a/Resources/views/ActivityType/edit.html.twig +++ b/Resources/views/ActivityType/edit.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityType edit

                          {{ form(edit_form) }} diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig index 096223642..9cf952b77 100644 --- a/Resources/views/ActivityType/index.html.twig +++ b/Resources/views/ActivityType/index.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityType list

                          diff --git a/Resources/views/ActivityType/new.html.twig b/Resources/views/ActivityType/new.html.twig index d6cc6c25f..8417bdafd 100644 --- a/Resources/views/ActivityType/new.html.twig +++ b/Resources/views/ActivityType/new.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityType creation

                          {{ form(form) }} diff --git a/Resources/views/ActivityType/show.html.twig b/Resources/views/ActivityType/show.html.twig index 0ec182f88..89198cc88 100644 --- a/Resources/views/ActivityType/show.html.twig +++ b/Resources/views/ActivityType/show.html.twig @@ -1,6 +1,22 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillMainBundle::Admin/layout.html.twig" %} -{% block body -%} +{% block admin_content %}

                          ActivityType

                          From f4fb039289d412f6edca8bc77b85248536b264dd Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 1 Jul 2015 18:26:38 +0200 Subject: [PATCH 012/163] Adding route into the admin menu --- Resources/config/routing/activityreason.yml | 5 +++++ Resources/config/routing/activityreasoncategory.yml | 5 +++++ Resources/config/routing/activitytype.yml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/Resources/config/routing/activityreason.yml b/Resources/config/routing/activityreason.yml index a3c193258..18e0003c6 100644 --- a/Resources/config/routing/activityreason.yml +++ b/Resources/config/routing/activityreason.yml @@ -1,6 +1,11 @@ chill_activity_activityreason: path: /{_locale}/admin/activityreason/ defaults: { _controller: "ChillActivityBundle:ActivityReason:index" } + options: + menus: + admin: + order: 2000 + label: "Activity Reasons" chill_activity_activityreason_show: path: /{_locale}/admin/activityreason/{id}/show diff --git a/Resources/config/routing/activityreasoncategory.yml b/Resources/config/routing/activityreasoncategory.yml index 595414517..717f6d352 100644 --- a/Resources/config/routing/activityreasoncategory.yml +++ b/Resources/config/routing/activityreasoncategory.yml @@ -1,6 +1,11 @@ chill_activity_activityreasoncategory: path: /{_locale}/admin/activityreasoncategory/ defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:index" } + options: + menus: + admin: + order: 2010 + label: "Activity Reasons Category" chill_activity_activityreasoncategory_show: path: /{_locale}/admin/activityreasoncategory/{id}/show diff --git a/Resources/config/routing/activitytype.yml b/Resources/config/routing/activitytype.yml index b239dc3b3..942b202fe 100644 --- a/Resources/config/routing/activitytype.yml +++ b/Resources/config/routing/activitytype.yml @@ -1,6 +1,11 @@ activitytype: path: /{_locale}/admin/activitytype/ defaults: { _controller: "ChillActivityBundle:ActivityType:index" } + options: + menus: + admin: + order: 2020 + label: "Activity Types" chill_activity_activitytype_show: path: /{_locale}/admin/activitytype/{id}/show From e9fdfb341dc5530996564ca17e40d5fd6f2d018a Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Thu, 2 Jul 2015 10:55:08 +0200 Subject: [PATCH 013/163] Adding composer.lock in .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 57872d0f1..55940e57c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /vendor/ +composer.lock \ No newline at end of file From 5bd8b22569555d73aa2e0aa54b7a9cebf79c94be Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Thu, 2 Jul 2015 11:33:16 +0200 Subject: [PATCH 014/163] Activity Reasons, Activity Reasons Category, Activity Types in Translatable strings --- Entity/ActivityReason.php | 35 +++++++--- Entity/ActivityReasonCategory.php | 37 +++++++--- Entity/ActivityType.php | 23 +++++-- Form/ActivityReasonCategoryType.php | 2 +- Form/ActivityReasonType.php | 4 +- Form/ActivityTypeType.php | 2 +- .../TranslatableActivityReasonCategory.php | 68 +++++++++++++++++++ .../config/doctrine/ActivityReason.orm.yml | 5 +- .../doctrine/ActivityReasonCategory.orm.yml | 5 +- .../config/doctrine/ActivityType.orm.yml | 3 +- Resources/config/routing/activitytype.yml | 2 +- Resources/config/services.yml | 9 ++- .../migrations/Version20150702093317.php | 64 +++++++++++++++++ .../views/ActivityReason/index.html.twig | 4 +- Resources/views/ActivityReason/show.html.twig | 4 +- .../ActivityReasonCategory/index.html.twig | 4 +- .../ActivityReasonCategory/show.html.twig | 4 +- Resources/views/ActivityType/index.html.twig | 2 +- Resources/views/ActivityType/show.html.twig | 2 +- 19 files changed, 228 insertions(+), 51 deletions(-) create mode 100644 Form/Type/TranslatableActivityReasonCategory.php create mode 100644 Resources/migrations/Version20150702093317.php diff --git a/Entity/ActivityReason.php b/Entity/ActivityReason.php index 10f9243a6..8ad072039 100644 --- a/Entity/ActivityReason.php +++ b/Entity/ActivityReason.php @@ -33,9 +33,9 @@ class ActivityReason private $id; /** - * @var string + * @var array */ - private $label; + private $name; /** * @var ActivityReasonCategory @@ -59,29 +59,42 @@ class ActivityReason } /** - * Set label + * Set name * - * @param string $label + * @param array $name * * @return ActivityReason */ - public function setLabel($label) + public function setName($name) { - $this->label = $label; + $this->name = $name; return $this; } /** - * Get label + * Get name * - * @return string + * @return array | string */ - public function getLabel() + public function getName($locale = null) { - return $this->label; + if ($locale) { + if (isset($this->name[$locale])) { + return $this->name[$locale]; + } else { + foreach ($this->name as $name) { + if (!empty($name)) { + return $name; + } + } + } + return ''; + } else { + return $this->name; + } } - + /** * Set category * diff --git a/Entity/ActivityReasonCategory.php b/Entity/ActivityReasonCategory.php index c7af694c5..22da06d74 100644 --- a/Entity/ActivityReasonCategory.php +++ b/Entity/ActivityReasonCategory.php @@ -33,12 +33,18 @@ class ActivityReasonCategory /** * @var string */ - private $label; + private $name; /** * @var boolean */ private $active; + + + public function __toString() + { + return 'blop'; + } /** @@ -52,27 +58,40 @@ class ActivityReasonCategory } /** - * Set label + * Set name * - * @param string $label + * @param array $name * * @return ActivityReasonCategory */ - public function setLabel($label) + public function setName($name) { - $this->label = $label; + $this->name = $name; return $this; } /** - * Get label + * Get name * - * @return string + * @return array */ - public function getLabel() + public function getName($locale = null) { - return $this->label; + if ($locale) { + if (isset($this->name[$locale])) { + return $this->name[$locale]; + } else { + foreach ($this->name as $name) { + if (!empty($name)) { + return $name; + } + } + } + return ''; + } else { + return $this->name; + } } /** diff --git a/Entity/ActivityType.php b/Entity/ActivityType.php index 0fadc77a0..2af64f861 100644 --- a/Entity/ActivityType.php +++ b/Entity/ActivityType.php @@ -31,7 +31,7 @@ class ActivityType private $id; /** - * @var string + * @var array */ private $name; @@ -49,7 +49,7 @@ class ActivityType /** * Set name * - * @param string $name + * @param array $name * * @return ActivityType */ @@ -63,11 +63,24 @@ class ActivityType /** * Get name * - * @return string + * @return array | string */ - public function getName() + public function getName($locale = null) { - return $this->name; + if ($locale) { + if (isset($this->name[$locale])) { + return $this->name[$locale]; + } else { + foreach ($this->name as $name) { + if (!empty($name)) { + return $name; + } + } + } + return ''; + } else { + return $this->name; + } } } diff --git a/Form/ActivityReasonCategoryType.php b/Form/ActivityReasonCategoryType.php index 4b21f3e3c..3e05011e0 100644 --- a/Form/ActivityReasonCategoryType.php +++ b/Form/ActivityReasonCategoryType.php @@ -15,7 +15,7 @@ class ActivityReasonCategoryType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('label') + ->add('name', 'translatable_string') ->add('active') ; } diff --git a/Form/ActivityReasonType.php b/Form/ActivityReasonType.php index 43704fe03..fd3939e29 100644 --- a/Form/ActivityReasonType.php +++ b/Form/ActivityReasonType.php @@ -15,9 +15,9 @@ class ActivityReasonType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('label') + ->add('name', 'translatable_string') ->add('active') - ->add('category') + ->add('category', 'translatable_activity_reason_category') ; } diff --git a/Form/ActivityTypeType.php b/Form/ActivityTypeType.php index cbc5d5afa..278c23a9a 100644 --- a/Form/ActivityTypeType.php +++ b/Form/ActivityTypeType.php @@ -15,7 +15,7 @@ class ActivityTypeType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name') + ->add('name', 'translatable_string') ; } diff --git a/Form/Type/TranslatableActivityReasonCategory.php b/Form/Type/TranslatableActivityReasonCategory.php new file mode 100644 index 000000000..83495f274 --- /dev/null +++ b/Form/Type/TranslatableActivityReasonCategory.php @@ -0,0 +1,68 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Form\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\HttpFoundation\RequestStack; + +/** + * Description of TranslatableActivityReasonCategory + * + * @author Champs-Libres Coop + */ + + +class TranslatableActivityReasonCategory extends AbstractType +{ + /** + * @var RequestStack + */ + private $requestStack; + + public function __construct(RequestStack $requestStack) + { + $this->requestStack = $requestStack; + } + + public function getName() + { + return 'translatable_activity_reason_category'; + } + + public function getParent() + { + return 'entity'; + } + + public function configureOptions(OptionsResolver $resolver) + { + $locale = $this->requestStack->getCurrentRequest()->getLocale(); + $resolver->setDefaults( + array( + 'class' => 'ChillActivityBundle:ActivityReasonCategory', + 'property' => 'name['.$locale.']' + ) + ); + } +} diff --git a/Resources/config/doctrine/ActivityReason.orm.yml b/Resources/config/doctrine/ActivityReason.orm.yml index 00cfdb03f..86a4542cc 100644 --- a/Resources/config/doctrine/ActivityReason.orm.yml +++ b/Resources/config/doctrine/ActivityReason.orm.yml @@ -8,9 +8,8 @@ Chill\ActivityBundle\Entity\ActivityReason: generator: strategy: AUTO fields: - label: - type: string - length: 255 + name: + type: json_array active: type: boolean manyToOne: diff --git a/Resources/config/doctrine/ActivityReasonCategory.orm.yml b/Resources/config/doctrine/ActivityReasonCategory.orm.yml index 96e0b667d..830129740 100644 --- a/Resources/config/doctrine/ActivityReasonCategory.orm.yml +++ b/Resources/config/doctrine/ActivityReasonCategory.orm.yml @@ -8,9 +8,8 @@ Chill\ActivityBundle\Entity\ActivityReasonCategory: generator: strategy: AUTO fields: - label: - type: string - length: 255 + name: + type: json_array active: type: boolean lifecycleCallbacks: { } diff --git a/Resources/config/doctrine/ActivityType.orm.yml b/Resources/config/doctrine/ActivityType.orm.yml index d6691e25b..fb3878343 100644 --- a/Resources/config/doctrine/ActivityType.orm.yml +++ b/Resources/config/doctrine/ActivityType.orm.yml @@ -9,6 +9,5 @@ Chill\ActivityBundle\Entity\ActivityType: strategy: AUTO fields: name: - type: string - length: 255 + type: json_array lifecycleCallbacks: { } diff --git a/Resources/config/routing/activitytype.yml b/Resources/config/routing/activitytype.yml index 942b202fe..621be8bdc 100644 --- a/Resources/config/routing/activitytype.yml +++ b/Resources/config/routing/activitytype.yml @@ -1,4 +1,4 @@ -activitytype: +chill_activity_activitytype: path: /{_locale}/admin/activitytype/ defaults: { _controller: "ChillActivityBundle:ActivityType:index" } options: diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 7a089a4b2..2b4b8c630 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,4 +1,7 @@ services: -# chill_activity.example: -# class: Chill\ActivityBundle\Example -# arguments: [@service_id, "plain_value", %parameter%] + chill.activity.form.type.translatableactivityreasoncategory: + class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory + arguments: + - "@request_stack" + tags: + - { name: form.type, alias: translatable_activity_reason_category } \ No newline at end of file diff --git a/Resources/migrations/Version20150702093317.php b/Resources/migrations/Version20150702093317.php new file mode 100644 index 000000000..6f65e63ef --- /dev/null +++ b/Resources/migrations/Version20150702093317.php @@ -0,0 +1,64 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Application\Migrations; + +use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\DBAL\Schema\Schema; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +class Version20150702093317 extends AbstractMigration +{ + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + // this up() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN label;'); + $this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN name JSON;'); + $this->addSql('ALTER TABLE ActivityReason DROP COLUMN label;'); + $this->addSql('ALTER TABLE ActivityReason ADD COLUMN name JSON;'); + $this->addSql('ALTER TABLE ActivityType DROP COLUMN name;'); + $this->addSql('ALTER TABLE ActivityType ADD COLUMN name JSON;'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN name;'); + $this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN label VARCHAR(255) NOT NULL;'); + $this->addSql('ALTER TABLE ActivityReason DROP COLUMN name;'); + $this->addSql('ALTER TABLE ActivityReason ADD COLUMN label VARCHAR(255) NOT NULL;'); + $this->addSql('ALTER TABLE ActivityType DROP COLUMN name;'); + $this->addSql('ALTER TABLE ActivityType ADD COLUMN name VARCHAR(255) NOT NULL;'); + } +} \ No newline at end of file diff --git a/Resources/views/ActivityReason/index.html.twig b/Resources/views/ActivityReason/index.html.twig index 3108a589f..97915def3 100644 --- a/Resources/views/ActivityReason/index.html.twig +++ b/Resources/views/ActivityReason/index.html.twig @@ -23,7 +23,7 @@ - + @@ -32,7 +32,7 @@ {% for entity in entities %} - + - - + + diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig index 3b8333cf3..b33b5a1d2 100644 --- a/Resources/views/ActivityReasonCategory/index.html.twig +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -23,7 +23,7 @@ - + @@ -32,7 +32,7 @@ {% for entity in entities %} - + - - + + diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig index 9cf952b77..68b3556e1 100644 --- a/Resources/views/ActivityType/index.html.twig +++ b/Resources/views/ActivityType/index.html.twig @@ -31,7 +31,7 @@ {% for entity in entities %} - + - +
                          IdLabelName Active Actions
                          {{ entity.id }}{{ entity.label }}{{ entity.name|localize_translatable_string }} {{ entity.active }}
                            diff --git a/Resources/views/ActivityReason/show.html.twig b/Resources/views/ActivityReason/show.html.twig index 0055d90f8..9aea54df2 100644 --- a/Resources/views/ActivityReason/show.html.twig +++ b/Resources/views/ActivityReason/show.html.twig @@ -26,8 +26,8 @@
                          {{ entity.id }}
                          Label{{ entity.label }}Name{{ entity.name|localize_translatable_string }}
                          Active
                          IdLabelName Active Actions
                          {{ entity.id }}{{ entity.label }}{{ entity.name|localize_translatable_string }} {{ entity.active }}
                            diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig index 98242281b..617543a91 100644 --- a/Resources/views/ActivityReasonCategory/show.html.twig +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -26,8 +26,8 @@
                          {{ entity.id }}
                          Label{{ entity.label }}Name{{ entity.name|localize_translatable_string }}
                          Active
                          {{ entity.id }}{{ entity.name }}{{ entity.name|localize_translatable_string }}
                          • diff --git a/Resources/views/ActivityType/show.html.twig b/Resources/views/ActivityType/show.html.twig index 89198cc88..6899df806 100644 --- a/Resources/views/ActivityType/show.html.twig +++ b/Resources/views/ActivityType/show.html.twig @@ -27,7 +27,7 @@
                          Name{{ entity.name }}{{ entity.name|localize_translatable_string }}
                          From 77b59958ec3936157005f1203c11d068e520879a Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Thu, 2 Jul 2015 11:33:35 +0200 Subject: [PATCH 015/163] Adding license --- .../migrations/Version20150701091248.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Resources/migrations/Version20150701091248.php b/Resources/migrations/Version20150701091248.php index 6173fbdaa..18573b82e 100644 --- a/Resources/migrations/Version20150701091248.php +++ b/Resources/migrations/Version20150701091248.php @@ -1,5 +1,25 @@ , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + namespace Application\Migrations; use Doctrine\DBAL\Migrations\AbstractMigration; From 24bd8c9a1d6b0d74749acef160138bf1ff1360c6 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Thu, 2 Jul 2015 14:38:48 +0200 Subject: [PATCH 016/163] Removing DefaultController --- Controller/DefaultController.php | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 Controller/DefaultController.php diff --git a/Controller/DefaultController.php b/Controller/DefaultController.php deleted file mode 100644 index 12f546d5a..000000000 --- a/Controller/DefaultController.php +++ /dev/null @@ -1,13 +0,0 @@ -render('ChillActivityBundle:Default:index.html.twig', array('name' => $name)); - } -} From 86b24f58ac9a1c7c8f3480627e7dcb5677acd082 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Thu, 2 Jul 2015 15:41:11 +0200 Subject: [PATCH 017/163] First step of integration code generated --- Controller/ActivityController.php | 63 ++++++++++++++++------ Form/ActivityType.php | 8 +-- Resources/config/routing.yml | 2 +- Resources/config/routing/activity.yml | 40 ++++++++------ Resources/views/Activity/edit.html.twig | 26 +++++++-- Resources/views/Activity/index.html.twig | 47 ----------------- Resources/views/Activity/list.html.twig | 67 ++++++++++++++++++++++++ Resources/views/Activity/new.html.twig | 28 ++++++++-- Resources/views/Activity/show.html.twig | 4 +- 9 files changed, 193 insertions(+), 92 deletions(-) delete mode 100644 Resources/views/Activity/index.html.twig create mode 100644 Resources/views/Activity/list.html.twig diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 4ecc17ac3..0c89842db 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -1,5 +1,25 @@ , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + namespace Chill\ActivityBundle\Controller; use Symfony\Component\HttpFoundation\Request; @@ -19,24 +39,28 @@ class ActivityController extends Controller * Lists all Activity entities. * */ - public function indexAction() + public function listAction($person_id, Request $request) { $em = $this->getDoctrine()->getManager(); + $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + $activities = $em->getRepository('ChillActivityBundle:Activity')->findAll(); - $entities = $em->getRepository('ChillActivityBundle:Activity')->findAll(); - - return $this->render('ChillActivityBundle:Activity:index.html.twig', array( - 'entities' => $entities, + return $this->render('ChillActivityBundle:Activity:list.html.twig', array( + 'activities' => $activities, + 'person' => $person )); } /** * Creates a new Activity entity. * */ - public function createAction(Request $request) + public function createAction($person_id, Request $request) { + $em = $this->getDoctrine()->getManager(); + $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + $entity = new Activity(); - $form = $this->createCreateForm($entity); + $form = $this->createCreateForm($entity, $person); $form->handleRequest($request); if ($form->isValid()) { @@ -44,12 +68,13 @@ class ActivityController extends Controller $em->persist($entity); $em->flush(); - return $this->redirect($this->generateUrl('activity_show', array('id' => $entity->getId()))); + return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $entity->getId()))); } return $this->render('ChillActivityBundle:Activity:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), + 'person' => $person )); } @@ -60,10 +85,10 @@ class ActivityController extends Controller * * @return \Symfony\Component\Form\Form The form */ - private function createCreateForm(Activity $entity) + private function createCreateForm(Activity $entity, $person) { $form = $this->createForm(new ActivityType(), $entity, array( - 'action' => $this->generateUrl('activity_create'), + 'action' => $this->generateUrl('chill_activity_activity_create', ['person_id' => $person->getId()]), 'method' => 'POST', )); @@ -76,12 +101,16 @@ class ActivityController extends Controller * Displays a form to create a new Activity entity. * */ - public function newAction() + public function newAction($person_id) { + $em = $this->getDoctrine()->getManager(); + $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + $entity = new Activity(); - $form = $this->createCreateForm($entity); + $form = $this->createCreateForm($entity, $person); return $this->render('ChillActivityBundle:Activity:new.html.twig', array( + 'person' => $person, 'entity' => $entity, 'form' => $form->createView(), )); @@ -113,9 +142,10 @@ class ActivityController extends Controller * Displays a form to edit an existing Activity entity. * */ - public function editAction($id) + public function editAction($person_id, $id) { $em = $this->getDoctrine()->getManager(); + $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); @@ -130,6 +160,7 @@ class ActivityController extends Controller 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), + 'person' => $$person )); } @@ -143,7 +174,7 @@ class ActivityController extends Controller private function createEditForm(Activity $entity) { $form = $this->createForm(new ActivityType(), $entity, array( - 'action' => $this->generateUrl('activity_update', array('id' => $entity->getId())), + 'action' => $this->generateUrl('chill_activity_activity_update', array('id' => $entity->getId())), 'method' => 'PUT', )); @@ -172,7 +203,7 @@ class ActivityController extends Controller if ($editForm->isValid()) { $em->flush(); - return $this->redirect($this->generateUrl('activity_edit', array('id' => $id))); + return $this->redirect($this->generateUrl('chill_activity_activity_edit', array('id' => $id))); } return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( @@ -215,7 +246,7 @@ class ActivityController extends Controller private function createDeleteForm($id) { return $this->createFormBuilder() - ->setAction($this->generateUrl('activity_delete', array('id' => $id))) + ->setAction($this->generateUrl('chill_activity_activity_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Delete')) ->getForm() diff --git a/Form/ActivityType.php b/Form/ActivityType.php index b51e9af28..80be41de9 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -20,10 +20,10 @@ class ActivityType extends AbstractType ->add('remark') ->add('attendee') ->add('user') - ->add('scope') - ->add('reason') - ->add('type') - ->add('person') + //->add('scope') + //->add('reason') + //->add('type') + //->add('person') ; } diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index a3fde0da5..0f18ae49f 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -1,6 +1,6 @@ chill_activity_activity: resource: "@ChillActivityBundle/Resources/config/routing/activity.yml" - prefix: /activity + prefix: / chill_activity_activityreason: resource: "@ChillActivityBundle/Resources/config/routing/activityreason.yml" diff --git a/Resources/config/routing/activity.yml b/Resources/config/routing/activity.yml index 9efeac928..63d4c5723 100644 --- a/Resources/config/routing/activity.yml +++ b/Resources/config/routing/activity.yml @@ -1,30 +1,40 @@ -activity: - path: / - defaults: { _controller: "ChillActivityBundle:Activity:index" } +chill_activity_activity_list: + path: /{_locale}/person/{person_id}/activity/ + defaults: { _controller: "ChillActivityBundle:Activity:list" } + options: + menus: + person: + order: 201 + label: Activity list -activity_show: - path: /{id}/show +chill_activity_activity_show: + path: /{_locale}/person/{person_id}/activity/{id}/show defaults: { _controller: "ChillActivityBundle:Activity:show" } -activity_new: - path: /new +chill_activity_activity_new: + path: /{_locale}/person/{person_id}/activity/new defaults: { _controller: "ChillActivityBundle:Activity:new" } + options: + menus: + person: + order: 200 + label: Add an activity -activity_create: - path: /create +chill_activity_activity_create: + path: /{_locale}/person/{person_id}/activity/create defaults: { _controller: "ChillActivityBundle:Activity:create" } methods: POST -activity_edit: - path: /{id}/edit +chill_activity_activity_edit: + path: /{_locale}/person/{person_id}/activity/{id}/edit defaults: { _controller: "ChillActivityBundle:Activity:edit" } -activity_update: - path: /{id}/update +chill_activity_activity_update: + path: /{_locale}/person/{person_id}/activity/{id}/update defaults: { _controller: "ChillActivityBundle:Activity:update" } methods: [POST, PUT] -activity_delete: - path: /{id}/delete +chill_activity_activity_delete: + path: /{_locale}/person/{person_id}/activity/{id}/delete defaults: { _controller: "ChillActivityBundle:Activity:delete" } methods: [POST, DELETE] diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index 846ec0bc5..4c04aae3b 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -1,13 +1,33 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillPersonBundle::layout.html.twig" %} -{% block body -%} +{% set activeRouteKey = 'chill_activity_activity_list' %} + +{% block title %}{{ 'Activity edit' |trans }}{% endblock title %} + +{% block personcontent %}

                          Activity edit

                          {{ form(edit_form) }}
                          • - + Back to the list
                          • diff --git a/Resources/views/Activity/index.html.twig b/Resources/views/Activity/index.html.twig deleted file mode 100644 index c13361585..000000000 --- a/Resources/views/Activity/index.html.twig +++ /dev/null @@ -1,47 +0,0 @@ -{% extends '::base.html.twig' %} - -{% block body -%} -

                            Activity list

                            - - - - - - - - - - - - - - {% for entity in entities %} - - - - - - - - - {% endfor %} - -
                            IdDateDurationtimeRemarkAttendeeActions
                            {{ entity.id }}{% if entity.date %}{{ entity.date|date('Y-m-d H:i:s') }}{% endif %}{{ entity.durationTime }}{{ entity.remark }}{{ entity.attendee }} - -
                            - - - {% endblock %} diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig new file mode 100644 index 000000000..b39338eb8 --- /dev/null +++ b/Resources/views/Activity/list.html.twig @@ -0,0 +1,67 @@ +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillPersonBundle::layout.html.twig" %} + +{% set activeRouteKey = 'chill_activity_activity_list' %} + +{% block title %}{{ 'Activity list' |trans }}{% endblock title %} + +{% block personcontent %} +

                            Activity list

                            + + + + + + + + + + + + + + {% for activity in activities %} + + + + + + + + + {% endfor %} + +
                            IdDateDurationtimeRemarkAttendeeActions
                            {{ activity.id }}{% if activity.date %}{{ activity.date|date('Y-m-d H:i:s') }}{% endif %}{{ activity.durationTime }}{{ activity.remark }}{{ activity.attendee }} + +
                            + + +{% endblock %} diff --git a/Resources/views/Activity/new.html.twig b/Resources/views/Activity/new.html.twig index 94c3169e7..645bf3cf7 100644 --- a/Resources/views/Activity/new.html.twig +++ b/Resources/views/Activity/new.html.twig @@ -1,15 +1,35 @@ -{% extends '::base.html.twig' %} +{# + * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} +{% extends "ChillPersonBundle::layout.html.twig" %} -{% block body -%} +{% set activeRouteKey = 'chill_activity_activity_new' %} + +{% block title %}{{ 'Activity create' |trans }}{% endblock title %} + +{% block personcontent %}

                            Activity creation

                            {{ form(form) }} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index eb939fcc4..c405a4a87 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -30,12 +30,12 @@
                            • - + Back to the list
                            • - + Edit
                            • From be78c250911b0b4791b98f72878704e688bf4be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 2 Jul 2015 23:36:43 +0200 Subject: [PATCH 018/163] improve activity form - create as a service with required depedencies (required for scope) - add scope - fix date show - adapt controller accordingly --- Controller/ActivityController.php | 22 +++++++-- Entity/Activity.php | 2 +- Form/ActivityType.php | 77 +++++++++++++++++++++++++++++-- Resources/config/services.yml | 14 +++++- 4 files changed, 102 insertions(+), 13 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 0c89842db..3bfe26aae 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -27,6 +27,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Form\ActivityType; +use Symfony\Component\Security\Core\Role\Role; +use Chill\PersonBundle\Entity\Person; /** * Activity controller. @@ -59,6 +61,12 @@ class ActivityController extends Controller $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + /**if ($person === NULL) { + throw $this->createNotFoundException('person not found'); + }*/ + + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + $entity = new Activity(); $form = $this->createCreateForm($entity, $person); $form->handleRequest($request); @@ -85,12 +93,16 @@ class ActivityController extends Controller * * @return \Symfony\Component\Form\Form The form */ - private function createCreateForm(Activity $entity, $person) + private function createCreateForm(Activity $entity, Person $person) { - $form = $this->createForm(new ActivityType(), $entity, array( - 'action' => $this->generateUrl('chill_activity_activity_create', ['person_id' => $person->getId()]), - 'method' => 'POST', - )); + $form = $this->createForm('chill_activitybundle_activity', $entity, + array( + 'action' => $this->generateUrl('chill_activity_activity_create', ['person_id' => $person->getId()]), + 'method' => 'POST', + 'center' => $person->getCenter(), + 'role' => new Role('CHILL_ACTIVITY_CREATE') + ) + ); $form->add('submit', 'submit', array('label' => 'Create')); diff --git a/Entity/Activity.php b/Entity/Activity.php index e4662983d..084f1a067 100644 --- a/Entity/Activity.php +++ b/Entity/Activity.php @@ -99,7 +99,7 @@ class Activity * * @return Activity */ - public function setUserr(User $user) + public function setUser(User $user) { $this->user = $user; diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 80be41de9..f22b79440 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -4,10 +4,57 @@ namespace Chill\ActivityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Chill\MainBundle\Form\Type\AppendScopeChoiceTypeTrait; +use Chill\MainBundle\Security\Authorization\AuthorizationHelper; +use Doctrine\Common\Persistence\ObjectManager; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; +use Chill\MainBundle\Entity\User; class ActivityType extends AbstractType { + + use AppendScopeChoiceTypeTrait; + + /** + * the user running this form + * + * @var User + */ + protected $user; + + /** + * + * @var AuthorizationHelper + */ + protected $authorizationHelper; + + /** + * + * @var ObjectManager + */ + protected $om; + + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + public function __construct(TokenStorageInterface $tokenStorage, + AuthorizationHelper $authorizationHelper, ObjectManager $om, + TranslatableStringHelper $translatableStringHelper) + { + if (!$tokenStorage->getToken()->getUser() instanceof User) { + throw new \RuntimeException("you should have a valid user"); + } + $this->user = $tokenStorage->getToken()->getUser(); + $this->authorizationHelper = $authorizationHelper; + $this->om = $om; + $this->translatableStringHelper = $translatableStringHelper; + } + /** * @param FormBuilderInterface $builder * @param array $options @@ -15,26 +62,46 @@ class ActivityType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('date') + ->add('date', 'date', array( + 'required' => true, + 'widget' => 'single_text', + 'format' => 'dd-MM-yyyy') + ) ->add('durationTime') - ->add('remark') - ->add('attendee') + ->add('remark', 'textarea', array( + 'required' => false, + 'empty_data' => '' + )) + ->add('attendee', 'choice', array( + 'expanded' => true, + 'required' => false, + 'choices' => array( + true => 'present', + false => 'not present' + ) + )) ->add('user') //->add('scope') //->add('reason') //->add('type') //->add('person') ; + + $this->appendScopeChoices($builder, $options['role'], + $options['center'], $this->user, $this->authorizationHelper, + $this->translatableStringHelper, $this->om); } /** * @param OptionsResolverInterface $resolver */ - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Chill\ActivityBundle\Entity\Activity' )); + + $this->appendScopeChoicesOptions($resolver); } /** diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 2b4b8c630..a06eae7d3 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,7 +1,17 @@ services: - chill.activity.form.type.translatableactivityreasoncategory: + chill.activity.form.type.translatableactivityreasoncategory: class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory arguments: - "@request_stack" tags: - - { name: form.type, alias: translatable_activity_reason_category } \ No newline at end of file + - { name: form.type, alias: translatable_activity_reason_category } + + chill.activity.form.type.activity: + class: Chill\ActivityBundle\Form\ActivityType + arguments: + - "@security.token_storage" + - "@chill.main.security.authorization.helper" + - "@doctrine.orm.entity_manager" + - "@chill.main.helper.translatable_string" + tags: + - { name: form.type, alias: chill_activitybundle_activity } \ No newline at end of file From faffdee1ab2db18e7d22c6740ea543496e789867 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 3 Jul 2015 09:40:30 +0200 Subject: [PATCH 019/163] Integration code generated --- Controller/ActivityController.php | 18 +++++++++++++----- Entity/Activity.php | 2 +- Form/ActivityType.php | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 0c89842db..0c4f12793 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -68,7 +68,9 @@ class ActivityController extends Controller $em->persist($entity); $em->flush(); - return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $entity->getId()))); + return $this->redirect( + $this->generateUrl('chill_activity_activity_show', + array('id' => $entity->getId(), 'person_id' => $person_id))); } return $this->render('ChillActivityBundle:Activity:new.html.twig', array( @@ -107,6 +109,9 @@ class ActivityController extends Controller $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); $entity = new Activity(); + $entity->setUser($this->get('security.context')->getToken()->getUser()); + $entity->setDate(new \DateTime('now')); + $form = $this->createCreateForm($entity, $person); return $this->render('ChillActivityBundle:Activity:new.html.twig', array( @@ -120,9 +125,10 @@ class ActivityController extends Controller * Finds and displays a Activity entity. * */ - public function showAction($id) + public function showAction($person_id, $id) { $em = $this->getDoctrine()->getManager(); + $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); @@ -130,7 +136,7 @@ class ActivityController extends Controller throw $this->createNotFoundException('Unable to find Activity entity.'); } - $deleteForm = $this->createDeleteForm($id); + $deleteForm = $this->createDeleteForm($id, $person); return $this->render('ChillActivityBundle:Activity:show.html.twig', array( 'entity' => $entity, @@ -243,10 +249,12 @@ class ActivityController extends Controller * * @return \Symfony\Component\Form\Form The form */ - private function createDeleteForm($id) + private function createDeleteForm($id, $person) { return $this->createFormBuilder() - ->setAction($this->generateUrl('chill_activity_activity_delete', array('id' => $id))) + ->setAction($this->generateUrl( + 'chill_activity_activity_delete', + array('id' => $id, 'person_id' => $person->getId()))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Delete')) ->getForm() diff --git a/Entity/Activity.php b/Entity/Activity.php index e4662983d..084f1a067 100644 --- a/Entity/Activity.php +++ b/Entity/Activity.php @@ -99,7 +99,7 @@ class Activity * * @return Activity */ - public function setUserr(User $user) + public function setUser(User $user) { $this->user = $user; diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 80be41de9..04237bdc3 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -15,10 +15,10 @@ class ActivityType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('date') + ->add('date', 'date', array('widget' => 'single_text', 'format' => 'dd-MM-yyyy')) ->add('durationTime') ->add('remark') - ->add('attendee') + ->add('attendee', 'checkbox', array('required' => false)) ->add('user') //->add('scope') //->add('reason') From 9c565063af33e6e0c8b5590d3496512d22382087 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 3 Jul 2015 10:15:50 +0200 Subject: [PATCH 020/163] Displaying ActivtyReason & ActivityType into activity creation form --- Form/ActivityType.php | 6 +-- Form/Type/TranslatableActivityReason.php | 66 ++++++++++++++++++++++++ Form/Type/TranslatableActivityType.php | 66 ++++++++++++++++++++++++ Resources/config/services.yml | 14 +++++ 4 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 Form/Type/TranslatableActivityReason.php create mode 100644 Form/Type/TranslatableActivityType.php diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 7cf7cdc52..9f754dce0 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -81,9 +81,9 @@ class ActivityType extends AbstractType ) )) ->add('user') - //->add('scope') - //->add('reason') - //->add('type') + ->add('scope') + ->add('reason', 'translatable_activity_reason') + ->add('type', 'translatable_activity_type') //->add('person') ; diff --git a/Form/Type/TranslatableActivityReason.php b/Form/Type/TranslatableActivityReason.php new file mode 100644 index 000000000..776dd0ee2 --- /dev/null +++ b/Form/Type/TranslatableActivityReason.php @@ -0,0 +1,66 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Form\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\HttpFoundation\RequestStack; + +/** + * Description of TranslatableActivityReason + * + * @author Champs-Libres Coop + */ +class TranslatableActivityReason extends AbstractType +{ + /** + * @var RequestStack + */ + private $requestStack; + + public function __construct(RequestStack $requestStack) + { + $this->requestStack = $requestStack; + } + + public function getName() + { + return 'translatable_activity_reason'; + } + + public function getParent() + { + return 'entity'; + } + + public function configureOptions(OptionsResolver $resolver) + { + $locale = $this->requestStack->getCurrentRequest()->getLocale(); + $resolver->setDefaults( + array( + 'class' => 'ChillActivityBundle:ActivityReason', + 'property' => 'name['.$locale.']' + ) + ); + } +} diff --git a/Form/Type/TranslatableActivityType.php b/Form/Type/TranslatableActivityType.php new file mode 100644 index 000000000..4ce59ae82 --- /dev/null +++ b/Form/Type/TranslatableActivityType.php @@ -0,0 +1,66 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Form\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\HttpFoundation\RequestStack; + +/** + * Description of TranslatableActivityType + * + * @author Champs-Libres Coop + */ +class TranslatableActivityType extends AbstractType +{ + /** + * @var RequestStack + */ + private $requestStack; + + public function __construct(RequestStack $requestStack) + { + $this->requestStack = $requestStack; + } + + public function getName() + { + return 'translatable_activity_type'; + } + + public function getParent() + { + return 'entity'; + } + + public function configureOptions(OptionsResolver $resolver) + { + $locale = $this->requestStack->getCurrentRequest()->getLocale(); + $resolver->setDefaults( + array( + 'class' => 'ChillActivityBundle:ActivityType', + 'property' => 'name['.$locale.']' + ) + ); + } +} diff --git a/Resources/config/services.yml b/Resources/config/services.yml index a06eae7d3..81d68773c 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -6,6 +6,20 @@ services: tags: - { name: form.type, alias: translatable_activity_reason_category } + chill.activity.form.type.translatableactivityreason: + class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason + arguments: + - "@request_stack" + tags: + - { name: form.type, alias: translatable_activity_reason } + + chill.activity.form.type.translatableactivitytype: + class: Chill\ActivityBundle\Form\Type\TranslatableActivityType + arguments: + - "@request_stack" + tags: + - { name: form.type, alias: translatable_activity_type } + chill.activity.form.type.activity: class: Chill\ActivityBundle\Form\ActivityType arguments: From f1ff5e3c3862fff23f6c61b8455378708e2f53e2 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 3 Jul 2015 12:11:27 +0200 Subject: [PATCH 021/163] Adding data fixtures --- DataFixtures/ORM/LoadActivity.php | 44 ++++++++++++ DataFixtures/ORM/LoadActivityReason.php | 67 +++++++++++++++++++ .../ORM/LoadActivityReasonCategory.php | 65 ++++++++++++++++++ DataFixtures/ORM/LoadActivityType.php | 62 +++++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 DataFixtures/ORM/LoadActivity.php create mode 100644 DataFixtures/ORM/LoadActivityReason.php create mode 100644 DataFixtures/ORM/LoadActivityReasonCategory.php create mode 100644 DataFixtures/ORM/LoadActivityType.php diff --git a/DataFixtures/ORM/LoadActivity.php b/DataFixtures/ORM/LoadActivity.php new file mode 100644 index 000000000..c65ddc696 --- /dev/null +++ b/DataFixtures/ORM/LoadActivity.php @@ -0,0 +1,44 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\DataFixtures\ORM; + +use Doctrine\Common\DataFixtures\AbstractFixture; +use Doctrine\Common\DataFixtures\OrderedFixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; + +/** + * Description of LoadActivity + * + * @author Champs-Libres Coop + */ +class LoadActivity extends AbstractFixture implements OrderedFixtureInterface//, ContainerAwareInterface +{ + public function getOrder() + { + return 16400; + } + + public function load(ObjectManager $manager) + { + } +} diff --git a/DataFixtures/ORM/LoadActivityReason.php b/DataFixtures/ORM/LoadActivityReason.php new file mode 100644 index 000000000..c334c3c1d --- /dev/null +++ b/DataFixtures/ORM/LoadActivityReason.php @@ -0,0 +1,67 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\DataFixtures\ORM; + +use Doctrine\Common\DataFixtures\AbstractFixture; +use Doctrine\Common\DataFixtures\OrderedFixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; +use Chill\ActivityBundle\Entity\ActivityReason; + +/** + * Description of LoadActivityReason + * + * @author Champs-Libres Coop + */ +class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterface +{ + public function getOrder() + { + return 16300; + } + + public function load(ObjectManager $manager) + { + $reasons = [ + [ + 'name' => ['fr' => 'Reason 1 - FR', 'en' => 'Reason 1 - EN', 'nl' => 'Reason 1 - NL'], + 'category' => 'activity_reason_category_0'], + [ + 'name' => ['fr' => 'Reason 2 - FR', 'en' => 'Reason 2 - EN', 'nl' => 'Reason 2 - NL'], + 'category' => 'activity_reason_category_1'], + [ + 'name' => ['fr' => 'Reason 2 - FR', 'en' => 'Reason 2 - EN', 'nl' => 'Reason 2 - NL'], + 'category' => 'activity_reason_category_2'] + ]; + + foreach ($reasons as $r) { + print "Creating activity reason : " . $r['name']['en'] . "\n"; + $activityReason = (new ActivityReason()) + ->setName(($r['name'])) + ->setActive(true) + ->setCategory($this->getReference($r['category'])); + $manager->persist($activityReason); + } + + $manager->flush(); + } +} diff --git a/DataFixtures/ORM/LoadActivityReasonCategory.php b/DataFixtures/ORM/LoadActivityReasonCategory.php new file mode 100644 index 000000000..6ef4cd08b --- /dev/null +++ b/DataFixtures/ORM/LoadActivityReasonCategory.php @@ -0,0 +1,65 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\DataFixtures\ORM; + +use Doctrine\Common\DataFixtures\AbstractFixture; +use Doctrine\Common\DataFixtures\OrderedFixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; +use Chill\ActivityBundle\Entity\ActivityReasonCategory; +/** + * Description of LoadActivityReasonCategory + * + * @author Champs-Libres Coop + */ +class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface +{ + public function getOrder() + { + return 16200; + } + + public function load(ObjectManager $manager) + { + $categs = [ + ['name' => + ['fr' => 'Reason Cat 1 - FR', 'en' => 'Reason Cat 1 - EN', 'nl' => 'Reason Cat 1 - NL']], + ['name' => + ['fr' => 'Reason Cat 2 - FR', 'en' => 'Reason Cat 2 - EN', 'nl' => 'Reason Cat 2 - NL']], + ['name' => + ['fr' => 'Reason Cat 2 - FR', 'en' => 'Reason Cat 2 - EN', 'nl' => 'Reason Cat 2 - NL']] + ]; + + foreach ($categs as $i => $c) { + print "Creating activity reason category : " . $c['name']['en'] . "\n"; + $activityReasonCategory = (new ActivityReasonCategory()) + ->setName(($c['name'])) + ->setActive(true); + $manager->persist($activityReasonCategory); + $this->addReference( + 'activity_reason_category_'.$i, + $activityReasonCategory); + } + + $manager->flush(); + } +} diff --git a/DataFixtures/ORM/LoadActivityType.php b/DataFixtures/ORM/LoadActivityType.php new file mode 100644 index 000000000..8d0dcfa97 --- /dev/null +++ b/DataFixtures/ORM/LoadActivityType.php @@ -0,0 +1,62 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\DataFixtures\ORM; + +use Doctrine\Common\DataFixtures\AbstractFixture; +use Doctrine\Common\DataFixtures\OrderedFixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; +use Chill\ActivityBundle\Entity\ActivityType; + +/** + * Description of LoadActivityType + * + * @author Champs-Libres Coop + */ +class LoadActivityType extends AbstractFixture implements OrderedFixtureInterface +{ + public function getOrder() + { + return 16100; + } + + public function load(ObjectManager $manager) + { + $types = [ + [ 'name' => + ['fr' => 'Appel téléphonique', 'en' => 'Telephone call', 'nl' => 'Telefoon appel']], + [ 'name' => + ['fr' => 'Entretien', 'en' => 'Interview', 'nl' => 'Vraaggesprek']], + [ 'name' => + ['fr' => 'Inspection', 'en' => 'Inspection', 'nl' => 'Inspectie']] + ]; + + foreach ($types as $t) { + print "Creating activity type : " . $t['name']['en'] . "\n"; + $activityType = (new ActivityType()) + ->setName(($t['name'])); + $manager->persist($activityType); + } + + $manager->flush(); + } +} From fba95263eb4fc8ee7dd634d60d8fc5a85e0f1f8f Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 3 Jul 2015 19:03:03 +0200 Subject: [PATCH 022/163] Adding better fixtures activity reason & activity reason category --- DataFixtures/ORM/LoadActivityReason.php | 21 +++++++++++++------ .../ORM/LoadActivityReasonCategory.php | 10 ++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/DataFixtures/ORM/LoadActivityReason.php b/DataFixtures/ORM/LoadActivityReason.php index c334c3c1d..1dbd18f11 100644 --- a/DataFixtures/ORM/LoadActivityReason.php +++ b/DataFixtures/ORM/LoadActivityReason.php @@ -43,14 +43,23 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf { $reasons = [ [ - 'name' => ['fr' => 'Reason 1 - FR', 'en' => 'Reason 1 - EN', 'nl' => 'Reason 1 - NL'], - 'category' => 'activity_reason_category_0'], + 'name' => ['fr' => 'Recherche logement', 'en' => 'Housing research', 'nl' => 'Woning zoektoch'], + 'category' => 'cat_Housing'], [ - 'name' => ['fr' => 'Reason 2 - FR', 'en' => 'Reason 2 - EN', 'nl' => 'Reason 2 - NL'], - 'category' => 'activity_reason_category_1'], + 'name' => ['fr' => 'Problème avec propriétaire', 'en' => 'Landlord problems', 'nl' => 'Huisbaas problemen'], + 'category' => 'cat_Housing'], [ - 'name' => ['fr' => 'Reason 2 - FR', 'en' => 'Reason 2 - EN', 'nl' => 'Reason 2 - NL'], - 'category' => 'activity_reason_category_2'] + 'name' => ['fr' => 'Retard de payement', 'en' => 'Payement problems', 'nl' => 'Betalings vertragingen'], + 'category' => 'cat_Housing'], + [ + 'name' => ['fr' => 'Explication législation', 'en' => 'Legislation explanation', 'nl' => 'Legislative uitleg'], + 'category' => 'cat_Unemployment procedure'], + [ + 'name' => ['fr' => 'Coaching entretien d\'activation', 'en' => 'Interview coaching', 'nl' => 'Interview coaching'], + 'category' => 'cat_Unemployment procedure'], + [ + 'name' => ['fr' => 'Récupération des allocations', 'en' => 'Allowance recovery', 'nl' => 'Terugwinning van de uitkeringen'], + 'category' => 'cat_Unemployment procedure'] ]; foreach ($reasons as $r) { diff --git a/DataFixtures/ORM/LoadActivityReasonCategory.php b/DataFixtures/ORM/LoadActivityReasonCategory.php index 6ef4cd08b..7e34ac77f 100644 --- a/DataFixtures/ORM/LoadActivityReasonCategory.php +++ b/DataFixtures/ORM/LoadActivityReasonCategory.php @@ -42,21 +42,19 @@ class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtu { $categs = [ ['name' => - ['fr' => 'Reason Cat 1 - FR', 'en' => 'Reason Cat 1 - EN', 'nl' => 'Reason Cat 1 - NL']], + ['fr' => 'Logement', 'en' => 'Housing', 'nl' => 'Woning']], ['name' => - ['fr' => 'Reason Cat 2 - FR', 'en' => 'Reason Cat 2 - EN', 'nl' => 'Reason Cat 2 - NL']], - ['name' => - ['fr' => 'Reason Cat 2 - FR', 'en' => 'Reason Cat 2 - EN', 'nl' => 'Reason Cat 2 - NL']] + ['fr' => 'Démarches chômage', 'en' => 'Unemployment procedure', 'nl' => 'Werkloosheid werkwijze']], ]; - foreach ($categs as $i => $c) { + foreach ($categs as $c) { print "Creating activity reason category : " . $c['name']['en'] . "\n"; $activityReasonCategory = (new ActivityReasonCategory()) ->setName(($c['name'])) ->setActive(true); $manager->persist($activityReasonCategory); $this->addReference( - 'activity_reason_category_'.$i, + 'cat_'.$c['name']['en'], $activityReasonCategory); } From 508bf02dbad3bb1abb328a4f0dde971bd8bc9418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 3 Jul 2015 09:44:54 +0200 Subject: [PATCH 023/163] move fixture to test directory refs #561 --- {Tests => Test}/Fixtures/App/.DS_Store | Bin {Tests => Test}/Fixtures/App/app/.DS_Store | Bin {Tests => Test}/Fixtures/App/app/AppKernel.php | 0 .../Fixtures/App/app/DoctrineMigrations/.gitignore | 0 .../Fixtures/App/app/Resources/.DS_Store | Bin {Tests => Test}/Fixtures/App/app/autoload.php | 0 .../Fixtures/App/app/bootstrap.php.cache | 0 .../app/cache/dev/appDevDebugProjectContainer.php | 0 .../cache/dev/appDevDebugProjectContainer.php.meta | 0 .../app/cache/dev/appDevDebugProjectContainer.xml | 0 .../dev/appDevDebugProjectContainerCompiler.log | 0 .../Fixtures/App/app/cache/dev/classes.map | 0 {Tests => Test}/Fixtures/App/app/config/config.yml | 0 .../Fixtures/App/app/config/config_dev.yml | 0 .../Fixtures/App/app/config/config_test.yml | 0 ..._customizable_entities_test_not_empty_config.yml | 0 .../Fixtures/App/app/config/parameters.travis.yml | 0 .../Fixtures/App/app/config/parameters.yml | 0 .../Fixtures/App/app/config/parameters.yml.dist | 0 {Tests => Test}/Fixtures/App/app/config/routing.yml | 0 {Tests => Test}/Fixtures/App/app/console | 0 {Tests => Test}/Fixtures/App/web/app_dev.php | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {Tests => Test}/Fixtures/App/.DS_Store (100%) rename {Tests => Test}/Fixtures/App/app/.DS_Store (100%) rename {Tests => Test}/Fixtures/App/app/AppKernel.php (100%) rename {Tests => Test}/Fixtures/App/app/DoctrineMigrations/.gitignore (100%) rename {Tests => Test}/Fixtures/App/app/Resources/.DS_Store (100%) rename {Tests => Test}/Fixtures/App/app/autoload.php (100%) rename {Tests => Test}/Fixtures/App/app/bootstrap.php.cache (100%) rename {Tests => Test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php (100%) rename {Tests => Test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta (100%) rename {Tests => Test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml (100%) rename {Tests => Test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log (100%) rename {Tests => Test}/Fixtures/App/app/cache/dev/classes.map (100%) rename {Tests => Test}/Fixtures/App/app/config/config.yml (100%) rename {Tests => Test}/Fixtures/App/app/config/config_dev.yml (100%) rename {Tests => Test}/Fixtures/App/app/config/config_test.yml (100%) rename {Tests => Test}/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml (100%) rename {Tests => Test}/Fixtures/App/app/config/parameters.travis.yml (100%) rename {Tests => Test}/Fixtures/App/app/config/parameters.yml (100%) rename {Tests => Test}/Fixtures/App/app/config/parameters.yml.dist (100%) rename {Tests => Test}/Fixtures/App/app/config/routing.yml (100%) rename {Tests => Test}/Fixtures/App/app/console (100%) rename {Tests => Test}/Fixtures/App/web/app_dev.php (100%) diff --git a/Tests/Fixtures/App/.DS_Store b/Test/Fixtures/App/.DS_Store similarity index 100% rename from Tests/Fixtures/App/.DS_Store rename to Test/Fixtures/App/.DS_Store diff --git a/Tests/Fixtures/App/app/.DS_Store b/Test/Fixtures/App/app/.DS_Store similarity index 100% rename from Tests/Fixtures/App/app/.DS_Store rename to Test/Fixtures/App/app/.DS_Store diff --git a/Tests/Fixtures/App/app/AppKernel.php b/Test/Fixtures/App/app/AppKernel.php similarity index 100% rename from Tests/Fixtures/App/app/AppKernel.php rename to Test/Fixtures/App/app/AppKernel.php diff --git a/Tests/Fixtures/App/app/DoctrineMigrations/.gitignore b/Test/Fixtures/App/app/DoctrineMigrations/.gitignore similarity index 100% rename from Tests/Fixtures/App/app/DoctrineMigrations/.gitignore rename to Test/Fixtures/App/app/DoctrineMigrations/.gitignore diff --git a/Tests/Fixtures/App/app/Resources/.DS_Store b/Test/Fixtures/App/app/Resources/.DS_Store similarity index 100% rename from Tests/Fixtures/App/app/Resources/.DS_Store rename to Test/Fixtures/App/app/Resources/.DS_Store diff --git a/Tests/Fixtures/App/app/autoload.php b/Test/Fixtures/App/app/autoload.php similarity index 100% rename from Tests/Fixtures/App/app/autoload.php rename to Test/Fixtures/App/app/autoload.php diff --git a/Tests/Fixtures/App/app/bootstrap.php.cache b/Test/Fixtures/App/app/bootstrap.php.cache similarity index 100% rename from Tests/Fixtures/App/app/bootstrap.php.cache rename to Test/Fixtures/App/app/bootstrap.php.cache diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php b/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php similarity index 100% rename from Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php rename to Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta b/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta similarity index 100% rename from Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta rename to Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml b/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml similarity index 100% rename from Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml rename to Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml diff --git a/Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log b/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log similarity index 100% rename from Tests/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log rename to Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log diff --git a/Tests/Fixtures/App/app/cache/dev/classes.map b/Test/Fixtures/App/app/cache/dev/classes.map similarity index 100% rename from Tests/Fixtures/App/app/cache/dev/classes.map rename to Test/Fixtures/App/app/cache/dev/classes.map diff --git a/Tests/Fixtures/App/app/config/config.yml b/Test/Fixtures/App/app/config/config.yml similarity index 100% rename from Tests/Fixtures/App/app/config/config.yml rename to Test/Fixtures/App/app/config/config.yml diff --git a/Tests/Fixtures/App/app/config/config_dev.yml b/Test/Fixtures/App/app/config/config_dev.yml similarity index 100% rename from Tests/Fixtures/App/app/config/config_dev.yml rename to Test/Fixtures/App/app/config/config_dev.yml diff --git a/Tests/Fixtures/App/app/config/config_test.yml b/Test/Fixtures/App/app/config/config_test.yml similarity index 100% rename from Tests/Fixtures/App/app/config/config_test.yml rename to Test/Fixtures/App/app/config/config_test.yml diff --git a/Tests/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml b/Test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml similarity index 100% rename from Tests/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml rename to Test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml diff --git a/Tests/Fixtures/App/app/config/parameters.travis.yml b/Test/Fixtures/App/app/config/parameters.travis.yml similarity index 100% rename from Tests/Fixtures/App/app/config/parameters.travis.yml rename to Test/Fixtures/App/app/config/parameters.travis.yml diff --git a/Tests/Fixtures/App/app/config/parameters.yml b/Test/Fixtures/App/app/config/parameters.yml similarity index 100% rename from Tests/Fixtures/App/app/config/parameters.yml rename to Test/Fixtures/App/app/config/parameters.yml diff --git a/Tests/Fixtures/App/app/config/parameters.yml.dist b/Test/Fixtures/App/app/config/parameters.yml.dist similarity index 100% rename from Tests/Fixtures/App/app/config/parameters.yml.dist rename to Test/Fixtures/App/app/config/parameters.yml.dist diff --git a/Tests/Fixtures/App/app/config/routing.yml b/Test/Fixtures/App/app/config/routing.yml similarity index 100% rename from Tests/Fixtures/App/app/config/routing.yml rename to Test/Fixtures/App/app/config/routing.yml diff --git a/Tests/Fixtures/App/app/console b/Test/Fixtures/App/app/console similarity index 100% rename from Tests/Fixtures/App/app/console rename to Test/Fixtures/App/app/console diff --git a/Tests/Fixtures/App/web/app_dev.php b/Test/Fixtures/App/web/app_dev.php similarity index 100% rename from Tests/Fixtures/App/web/app_dev.php rename to Test/Fixtures/App/web/app_dev.php From eb1157054128da539ef5afb316a41b1d75e1795e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 3 Jul 2015 21:34:48 +0200 Subject: [PATCH 024/163] add acl to activity + bootstrap php --- DataFixtures/ORM/LoadReportACL.php | 84 +++++++++ .../ChillActivityExtension.php | 18 +- Entity/Activity.php | 16 +- Resources/config/services.yml | 9 +- Security/Authorization/ActivityVoter.php | 66 +++++++ Test/Fixtures/bootstrap.php | 8 + Test/PrepareActivityTrait.php | 49 +++++ .../Authorization/ActivityVoterTest.php | 176 ++++++++++++++++++ phpunit.xml.dist | 23 +++ 9 files changed, 446 insertions(+), 3 deletions(-) create mode 100644 DataFixtures/ORM/LoadReportACL.php create mode 100644 Security/Authorization/ActivityVoter.php create mode 100644 Test/Fixtures/bootstrap.php create mode 100644 Test/PrepareActivityTrait.php create mode 100644 Tests/Security/Authorization/ActivityVoterTest.php create mode 100644 phpunit.xml.dist diff --git a/DataFixtures/ORM/LoadReportACL.php b/DataFixtures/ORM/LoadReportACL.php new file mode 100644 index 000000000..b20f29b97 --- /dev/null +++ b/DataFixtures/ORM/LoadReportACL.php @@ -0,0 +1,84 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\DataFixtures\ORM; + +use Doctrine\Common\DataFixtures\AbstractFixture; +use Doctrine\Common\DataFixtures\OrderedFixtureInterface; +use Doctrine\Common\Persistence\ObjectManager; +use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; +use Chill\MainBundle\Entity\RoleScope; +use Chill\MainBundle\DataFixtures\ORM\LoadScopes; + +/** + * Add a role CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE for all groups except administrative, + * and a role CHILL_ACTIVITY_SEE for administrative + * + * @author Julien Fastré + */ +class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface +{ + public function getOrder() + { + return 17999; + } + + + public function load(ObjectManager $manager) + { + foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { + $permissionsGroup = $this->getReference($permissionsGroupRef); + foreach (LoadScopes::$references as $scopeRef){ + $scope = $this->getReference($scopeRef); + //create permission group + switch ($permissionsGroup->getName()) { + case 'social': + if ($scope->getName()['en'] === 'administrative') { + break 2; // we do not want any power on administrative + } + break; + case 'administrative': + case 'direction': + if (in_array($scope->getName()['en'], array('administrative', 'social'))) { + break 2; // we do not want any power on social or administrative + } + break; + } + + printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE to %s " + . "permission group, scope '%s' \n", + $permissionsGroup->getName(), $scope->getName()['en']); + $roleScopeUpdate = (new RoleScope()) + ->setRole('CHILL_ACTIVITY_UPDATE') + ->setScope($scope); + $permissionsGroup->addRoleScope($roleScopeUpdate); + $roleScopeCreate = (new RoleScope()) + ->setRole('CHILL_ACTIVITY_CREATE') + ->setScope($scope); + $permissionsGroup->addRoleScope($roleScopeCreate); + $manager->persist($roleScopeUpdate); + $manager->persist($roleScopeCreate); + } + + } + + $manager->flush(); + } + +} diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index de0aa0de2..262925889 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -46,11 +46,17 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); } + + public function prepend(ContainerBuilder $container) + { + $this->prependRoutes($container); + $this->prependAuthorization($container); + } /* (non-PHPdoc) * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ - public function prepend(ContainerBuilder $container) + public function prependRoutes(ContainerBuilder $container) { //add routes for custom bundle $container->prependExtensionConfig('chill_main', array( @@ -61,4 +67,14 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf ) )); } + + public function prependAuthorization(ContainerBuilder $container) + { + $container->prependExtensionConfig('security', array( + 'role_hierarchy' => array( + 'CHILL_ACTIVITY_UPDATE' => array('CHILL_ACTIVITY_SEE'), + 'CHILL_ACTIVITY_CREATE' => array('CHILL_ACTIVITY_SEE') + ) + )); + } } diff --git a/Entity/Activity.php b/Entity/Activity.php index 084f1a067..e7ca954a7 100644 --- a/Entity/Activity.php +++ b/Entity/Activity.php @@ -25,11 +25,13 @@ use Chill\MainBundle\Entity\User; use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityType; use Chill\PersonBundle\Entity\Person; +use Chill\MainBundle\Entity\HasCenterInterface; +use Chill\MainBundle\Entity\HasScopeInterface; /** * Activity */ -class Activity +class Activity implements HasCenterInterface, HasScopeInterface { /** * @var integer @@ -307,5 +309,17 @@ class Activity { return $this->person; } + + /** + * get the center + * + * center is extracted from person + * + * @return \Chill\MainBundle\Entity\Center + */ + public function getCenter() + { + return $this->person->getCenter(); + } } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 81d68773c..2a24edf02 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -28,4 +28,11 @@ services: - "@doctrine.orm.entity_manager" - "@chill.main.helper.translatable_string" tags: - - { name: form.type, alias: chill_activitybundle_activity } \ No newline at end of file + - { name: form.type, alias: chill_activitybundle_activity } + + chill.activity.security.authorization.activity_voter: + class: Chill\ActivityBundle\Security\Authorization\ActivityVoter + arguments: + - "@chill.main.security.authorization.helper" + tags: + - { name: security.voter } \ No newline at end of file diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php new file mode 100644 index 000000000..b6f82c1ed --- /dev/null +++ b/Security/Authorization/ActivityVoter.php @@ -0,0 +1,66 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Security\Authorization; + +use Chill\MainBundle\Security\Authorization\AbstractChillVoter; +use Chill\MainBundle\Security\Authorization\AuthorizationHelper; + +/** + * + * + * @author Julien Fastré + */ +class ActivityVoter extends AbstractChillVoter +{ + const CREATE = 'CHILL_ACTIVITY_CREATE'; + const SEE = 'CHILL_ACTIVITY_SEE'; + const UPDATE = 'CHILL_ACTIVITY_UPDATE'; + + /** + * + * @var AuthorizationHelper + */ + protected $helper; + + public function __construct(AuthorizationHelper $helper) + { + $this->helper = $helper; + } + + protected function getSupportedAttributes() + { + return array(self::CREATE, self::SEE, self::UPDATE); + } + + protected function getSupportedClasses() + { + return array('Chill\ActivityBundle\Entity\Activity'); + } + + protected function isGranted($attribute, $report, $user = null) + { + if (! $user instanceof \Chill\MainBundle\Entity\User){ + + return false; + } + + return $this->helper->userHasAccess($user, $report, $attribute); + } +} diff --git a/Test/Fixtures/bootstrap.php b/Test/Fixtures/bootstrap.php new file mode 100644 index 000000000..0279b4ee6 --- /dev/null +++ b/Test/Fixtures/bootstrap.php @@ -0,0 +1,8 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Test; + +use Chill\ActivityBundle\Entity\Activity; +use Chill\MainBundle\Entity\Scope; +use Chill\PersonBundle\Entity\Person; + +/** + * Prepare entities useful in tests + * + * + * @author Julien Fastré + */ +trait PrepareActivityTrait +{ + /** + * Return an activity with a scope and a person inside + * + * @param Scope $scope + * @param Person $person + * @return Activity + */ + public function prepareActivity(Scope $scope, Person $person) + { + return (new Activity()) + ->setScope($scope) + ->setPerson($person) + ; + } + +} diff --git a/Tests/Security/Authorization/ActivityVoterTest.php b/Tests/Security/Authorization/ActivityVoterTest.php new file mode 100644 index 000000000..2a9cd6fae --- /dev/null +++ b/Tests/Security/Authorization/ActivityVoterTest.php @@ -0,0 +1,176 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Security\Authorization; + +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; +use Chill\MainBundle\Entity\Center; +use Chill\MainBundle\Entity\User; +use Chill\MainBundle\Entity\Scope; +use Chill\MainBundle\Test\PrepareUserTrait; +use Chill\MainBundle\Test\PrepareCenterTrait; +use Chill\MainBundle\Test\PrepareScopeTrait; +use Chill\PersonBundle\Test\PreparePersonTrait; +use Chill\ActivityBundle\Test\PrepareActivityTrait; + +/** + * + * + * @author Julien Fastré + */ +class ActivityVoterTest extends KernelTestCase +{ + use PrepareUserTrait, PrepareCenterTrait, PrepareScopeTrait, + PreparePersonTrait, PrepareActivityTrait; + + /** + * + * @var \Chill\PersonBundle\Security\Authorization\PersonVoter + */ + protected $voter; + + /** + * + * @var \Prophecy\Prophet + */ + protected $prophet; + + public function setUp() + { + static::bootKernel(); + $this->voter = static::$kernel->getContainer() + ->get('chill.activity.security.authorization.activity_voter'); + $this->prophet = new \Prophecy\Prophet(); + } + + public function testNullUser() + { + $token = $this->prepareToken(); + $center = $this->prepareCenter(1, 'center'); + $person = $this->preparePerson($center); + $scope = $this->prepareScope(1, 'default'); + $activity = $this->prepareActivity($scope, $person); + + $this->assertEquals( + VoterInterface::ACCESS_DENIED, + $this->voter->vote($token, $activity, array('CHILL_ACTIVITY_SEE')), + "assert that a null user is not allowed to see" + ); + } + + /** + * + * @dataProvider dataProvider_testVoteAction + * @param type $expectedResult + * @param User $user + * @param Scope $scope + * @param Center $center + * @param string $attribute + * @param string $message + */ + public function testVoteAction($expectedResult, User $user, Scope $scope, + Center $center, $attribute, $message) + { + $token = $this->prepareToken($user); + $activity = $this->prepareActivity($scope, $this->preparePerson($center)); + + $this->assertEquals( + $expectedResult, + $this->voter->vote($token, $activity, array($attribute)), + $message + ); + } + + public function dataProvider_testVoteAction() + { + $centerA = $this->prepareCenter(1, 'center A'); + $centerB = $this->prepareCenter(2, 'center B'); + $scopeA = $this->prepareScope(1, 'scope default'); + $scopeB = $this->prepareScope(2, 'scope B'); + $scopeC = $this->prepareScope(3, 'scope C'); + + $userA = $this->prepareUser(array( + array( + 'center' => $centerA, + 'permissionsGroup' => array( + ['scope' => $scopeB, 'role' => 'CHILL_ACTIVITY_CREATE'], + ['scope' => $scopeA, 'role' => 'CHILL_ACTIVITY_SEE'] + ) + ), + array( + 'center' => $centerB, + 'permissionsGroup' => array( + ['scope' => $scopeA, 'role' => 'CHILL_ACTIVITY_CREATE'], + ['scope' => $scopeC, 'role' => 'CHILL_ACTIVITY_CREATE'] + ) + ) + + )); + + return array( + array( + VoterInterface::ACCESS_GRANTED, + $userA, + $scopeB, + $centerA, + 'CHILL_ACTIVITY_CREATE', + 'assert that a user granted with same rights' + ), + array( + VoterInterface::ACCESS_GRANTED, + $userA, + $scopeB, + $centerA, + 'CHILL_ACTIVITY_SEE', + 'assert that a user granted with inheritance rights' + ), + array( + VoterInterface::ACCESS_DENIED, + $userA, + $scopeC, + $centerA, + 'CHILL_ACTIVITY_SEE', + 'assert that a suer is denied if he is not granted right on this center' + + ) + ); + } + + /** + * prepare a token interface with correct rights + * + * if $permissions = null, user will be null (no user associated with token + * + * @return \Symfony\Component\Security\Core\Authentication\Token\TokenInterface + */ + protected function prepareToken(User $user = null) + { + $token = $this->prophet->prophesize(); + $token + ->willImplement('\Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + if ($user === NULL) { + $token->getUser()->willReturn(null); + } else { + $token->getUser()->willReturn($user); + } + + return $token->reveal(); + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 000000000..6592949a7 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,23 @@ + + + + + + ./Tests + + + + + ./ + + ./Resources + ./Tests + ./vendor + + + + + + + + From 9ca47ada83ebc0d2fb9e675409cdf25537ac5ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 3 Jul 2015 21:35:49 +0200 Subject: [PATCH 025/163] add fixtures to gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 55940e57c..e8811ec63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /vendor/ -composer.lock \ No newline at end of file +composer.lock +Tests/Fixtures/App/app/DoctrineMigrations/* +Test/Fixtures/App/app/cache/* From 402ce86330c2daa0b8da712d8c27e435fc213c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 3 Jul 2015 22:33:29 +0200 Subject: [PATCH 026/163] improve activity controller & rendering --- Controller/ActivityController.php | 63 ++++++++++++++++--- DataFixtures/ORM/LoadReportACL.php | 2 +- .../migrations/Version20150701091248.php | 2 +- Resources/views/Activity/edit.html.twig | 2 +- Resources/views/Activity/show.html.twig | 4 +- 5 files changed, 58 insertions(+), 15 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index fe9d171b7..3e0c9e696 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -61,18 +61,23 @@ class ActivityController extends Controller $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); - /**if ($person === NULL) { + if ($person === NULL) { throw $this->createNotFoundException('person not found'); - }*/ + } $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); $entity = new Activity(); + $entity->setPerson($person); $form = $this->createCreateForm($entity, $person); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); + + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity, + 'creation of this activity not allowed'); + $em->persist($entity); $em->flush(); @@ -95,13 +100,15 @@ class ActivityController extends Controller * * @return \Symfony\Component\Form\Form The form */ - private function createCreateForm(Activity $entity, Person $person) + private function createCreateForm(Activity $entity) { $form = $this->createForm('chill_activitybundle_activity', $entity, array( - 'action' => $this->generateUrl('chill_activity_activity_create', ['person_id' => $person->getId()]), + 'action' => $this->generateUrl('chill_activity_activity_create', [ + 'person_id' => $entity->getPerson()->getId(), + ]), 'method' => 'POST', - 'center' => $person->getCenter(), + 'center' => $entity->getCenter(), 'role' => new Role('CHILL_ACTIVITY_CREATE') ) ); @@ -120,10 +127,19 @@ class ActivityController extends Controller $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + if ($person === NULL){ + throw $this->createNotFoundException('Person not found'); + } + + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + $entity = new Activity(); - $entity->setUser($this->get('security.context')->getToken()->getUser()); + $entity->setUser($this->get('security.token_storage')->getToken()->getUser()); + $entity->setPerson($person); $entity->setDate(new \DateTime('now')); + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity); + $form = $this->createCreateForm($entity, $person); return $this->render('ChillActivityBundle:Activity:new.html.twig', array( @@ -141,16 +157,25 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + + if (!$person) { + throw $this->createNotFoundException('person not found'); + } + + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity); $deleteForm = $this->createDeleteForm($id, $person); return $this->render('ChillActivityBundle:Activity:show.html.twig', array( + 'person' => $person, 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); @@ -164,21 +189,29 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + + if (!$person) { + throw $this->createNotFoundException('person not found'); + } + + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $editForm = $this->createEditForm($entity); - $deleteForm = $this->createDeleteForm($id); + $deleteForm = $this->createDeleteForm($id, $person); return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), - 'person' => $$person + 'person' => $person )); } @@ -191,9 +224,15 @@ class ActivityController extends Controller */ private function createEditForm(Activity $entity) { - $form = $this->createForm(new ActivityType(), $entity, array( - 'action' => $this->generateUrl('chill_activity_activity_update', array('id' => $entity->getId())), + $form = $this->createForm('chill_activitybundle_activity', $entity, array( + 'action' => $this->generateUrl('chill_activity_activity_update', + array( + 'id' => $entity->getId(), + 'person_id' => $entity->getPerson()->getId() + )), 'method' => 'PUT', + 'center' => $entity->getCenter(), + 'role' => new Role('CHILL_ACTIVITY_UPDATE') )); $form->add('submit', 'submit', array('label' => 'Update')); @@ -213,6 +252,8 @@ class ActivityController extends Controller if (!$entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $deleteForm = $this->createDeleteForm($id); $editForm = $this->createEditForm($entity); @@ -246,6 +287,8 @@ class ActivityController extends Controller if (!$entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $em->remove($entity); $em->flush(); diff --git a/DataFixtures/ORM/LoadReportACL.php b/DataFixtures/ORM/LoadReportACL.php index b20f29b97..e9d2d3092 100644 --- a/DataFixtures/ORM/LoadReportACL.php +++ b/DataFixtures/ORM/LoadReportACL.php @@ -36,7 +36,7 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac { public function getOrder() { - return 17999; + return 16000; } diff --git a/Resources/migrations/Version20150701091248.php b/Resources/migrations/Version20150701091248.php index 18573b82e..3dcabea2f 100644 --- a/Resources/migrations/Version20150701091248.php +++ b/Resources/migrations/Version20150701091248.php @@ -42,7 +42,7 @@ class Version20150701091248 extends AbstractMigration $this->addSql('CREATE SEQUENCE ActivityReason_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE ActivityReasonCategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE ActivityType_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE Activity (id INT NOT NULL, user_id INT DEFAULT NULL, scope_id INT DEFAULT NULL, reason_id INT DEFAULT NULL, type_id INT DEFAULT NULL, person_id INT DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, durationTime TIME(0) WITHOUT TIME ZONE NOT NULL, remark TEXT NOT NULL, attendee BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE Activity (id INT NOT NULL, user_id INT DEFAULT NULL, scope_id INT DEFAULT NULL, reason_id INT DEFAULT NULL, type_id INT DEFAULT NULL, person_id INT DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, durationTime TIME(0) WITHOUT TIME ZONE NOT NULL, remark TEXT NOT NULL, attendee BOOLEAN, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_55026B0CA76ED395 ON Activity (user_id)'); $this->addSql('CREATE INDEX IDX_55026B0C682B5931 ON Activity (scope_id)'); $this->addSql('CREATE INDEX IDX_55026B0C59BB1592 ON Activity (reason_id)'); diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index 4c04aae3b..34eda0653 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -27,7 +27,7 @@
                              • - + Back to the list
                              • diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index c405a4a87..950d33ffd 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -11,11 +11,11 @@ Date - {{ entity.date|date('Y-m-d H:i:s') }} + {{ entity.date|localizeddate('long', 'none') }} Durationtime - {{ entity.durationTime }} + {{ entity.durationTime|localizeddate('long', 'none') }} Remark From 2f1386c230cc73375ff1dae9514fa5a215f888e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 3 Jul 2015 22:36:14 +0200 Subject: [PATCH 027/163] set activity show inside chillpersonbundle layout --- Resources/views/Activity/show.html.twig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 950d33ffd..fbe8f987e 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -1,6 +1,8 @@ -{% extends '::base.html.twig' %} +{% extends "ChillPersonBundle::layout.html.twig" %} -{% block body -%} +{% set activeRouteKey = 'chill_activity_activity_list' %} + +{% block personcontent -%}

                                Activity

                                @@ -41,4 +43,4 @@
                              • {{ form(delete_form) }}
                              • -{% endblock %} +{% endblock personcontent %} From e65f78ab31b3054da9f5c58babb0e35cf4a4f6e8 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sat, 4 Jul 2015 20:38:13 +0200 Subject: [PATCH 028/163] Debug : enable creation of an acitivy --- Controller/ActivityController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 3e0c9e696..18613b5f9 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -138,8 +138,6 @@ class ActivityController extends Controller $entity->setPerson($person); $entity->setDate(new \DateTime('now')); - $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity); - $form = $this->createCreateForm($entity, $person); return $this->render('ChillActivityBundle:Activity:new.html.twig', array( From 5af14b230732fabe5d69f4c7ab4ef94d8aa67cd6 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sat, 4 Jul 2015 21:22:56 +0200 Subject: [PATCH 029/163] time type for durationTime in form --- Form/ActivityType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 9f754dce0..bf8fc492d 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -67,7 +67,7 @@ class ActivityType extends AbstractType 'widget' => 'single_text', 'format' => 'dd-MM-yyyy') ) - ->add('durationTime') + ->add('durationTime', 'time') ->add('remark', 'textarea', array( 'required' => false, 'empty_data' => '' From 7d4f865f10e444cdd88cfe7134ffb6a05da7fc28 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sat, 4 Jul 2015 21:23:19 +0200 Subject: [PATCH 030/163] remark & attendee can be null --- .../migrations/Version20150704091347.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Resources/migrations/Version20150704091347.php diff --git a/Resources/migrations/Version20150704091347.php b/Resources/migrations/Version20150704091347.php new file mode 100644 index 000000000..1f13f95ee --- /dev/null +++ b/Resources/migrations/Version20150704091347.php @@ -0,0 +1,57 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Application\Migrations; + +use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\DBAL\Schema\Schema; + +/** + * Db Migration + * + */ +class Version20150704091347 extends AbstractMigration +{ + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + // this up() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE Activity ALTER COLUMN remark DROP NOT NULL;'); + $this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE Activity ALTER COLUMN remark SET NOT NULL;'); + $this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;'); + } +} From 4788a2dc535743e6a91578abbdbf497583054c3c Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 10:29:09 +0200 Subject: [PATCH 031/163] Fixing file name error : LoadReportACL -> LoadActivitytACL --- DataFixtures/ORM/{LoadReportACL.php => LoadActivitytACL.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename DataFixtures/ORM/{LoadReportACL.php => LoadActivitytACL.php} (100%) diff --git a/DataFixtures/ORM/LoadReportACL.php b/DataFixtures/ORM/LoadActivitytACL.php similarity index 100% rename from DataFixtures/ORM/LoadReportACL.php rename to DataFixtures/ORM/LoadActivitytACL.php From 40a99a521e26e460f093de72ae3b6ac8d222a10f Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 10:35:54 +0200 Subject: [PATCH 032/163] Good format for duration time --- Resources/views/Activity/show.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index fbe8f987e..8516f9049 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -17,7 +17,7 @@ - + From 33461d90cebdc748297758f471d73fab0cb0356f Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 10:41:26 +0200 Subject: [PATCH 033/163] Good format for date & durationTIme --- Resources/views/Activity/list.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index b39338eb8..dc89b94c6 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -38,8 +38,8 @@ {% for activity in activities %} - - + + {% endfor %} From a637d8ad2133b1df4ae5e51fb967d4b4cea94832 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 11:20:21 +0200 Subject: [PATCH 036/163] updating the activity show --- Resources/views/Activity/show.html.twig | 72 ++++++++++++------------- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 8516f9049..32717fa48 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -3,44 +3,38 @@ {% set activeRouteKey = 'chill_activity_activity_list' %} {% block personcontent -%} -

                                Activity

                                + + {{ 'Edit the activity'|trans }} + + +
                                +
                                {{ 'Person'|trans }}
                                +
                                {{ entity.person }}
                                +
                                {{ 'Scope'|trans }}
                                +
                                {{ entity.scope.name|localize_translatable_string }}
                                +
                                {{ 'Date'|trans }}
                                +
                                {{ entity.date|localizeddate('long', 'none') }}
                                +
                                {{ 'Duration Time'|trans }}
                                +
                                {{ entity.durationTime|date('H:i') }}
                                +
                                {{ 'User'|trans }}
                                +
                                {{ entity.user }}
                                +
                                {{ 'Reason'|trans }}
                                +
                                {{ entity.reason.name | localize_translatable_string }}
                                +
                                {{ 'Type'|trans }}
                                +
                                {{ entity.type.name | localize_translatable_string }}
                                +
                                {{ 'Attendee'|trans }}
                                +
                                {{ entity.attendee }}
                                +
                                {{ 'Remark'|trans }}
                                +
                                {{ entity.remark }}
                                +
                                {{ ''|trans }}
                                +
                                +
                                {{ ''|trans }}
                                +
                                +
                                -
                                Durationtime{{ entity.durationTime|localizeddate('long', 'none') }}{{ entity.durationTime|date('H:i') }}
                                Remark
                                {{ activity.id }}{% if activity.date %}{{ activity.date|date('Y-m-d H:i:s') }}{% endif %}{{ activity.durationTime }}{% if activity.date %}{{ activity.date|date('Y-m-d') }}{% endif %}{{ activity.durationTime|date('H:i') }} {{ activity.remark }} {{ activity.attendee }} From 2c9cddceccc365af1b1f3c907b4b0aaf2e64841a Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 11:07:32 +0200 Subject: [PATCH 034/163] Better list of activities --- Resources/views/Activity/list.html.twig | 45 +++++++++++-------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index dc89b94c6..807650bce 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -21,47 +21,40 @@ {% block title %}{{ 'Activity list' |trans }}{% endblock title %} {% block personcontent %} -

                                Activity list

                                - - - - - - - + + + + + + + {% for activity in activities %} - - + - + + + {% endfor %}
                                IdDateDurationtimeRemarkAttendeeActions{{'Date' | trans }}{{'Duration Time' | trans }}{{'Reason' | trans}}{{'Type' | trans}}{{'Attendee' | trans }}
                                {{ activity.id }}{% if activity.date %}{{ activity.date|date('Y-m-d') }}{% endif %}{% if activity.date %}{{ activity.date|localizeddate('long', 'none') }}{% endif %} {{ activity.durationTime|date('H:i') }}{{ activity.remark }}{{ activity.reason.name | localize_translatable_string }}{{ activity.type.name | localize_translatable_string }} {{ activity.attendee }} - + {{ 'Show the activity' | trans }} + + {{ 'Edit the report' | trans }}
                                - +

                                + + {{ 'Add a new activity' | trans }} + +

                                {% endblock %} From d937b80038e114c1936516b2daf90a1ea7867f49 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 11:19:48 +0200 Subject: [PATCH 035/163] Error in label : report -> activity --- Resources/views/Activity/list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index 807650bce..5e2871555 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -45,7 +45,7 @@ {{ 'Show the activity' | trans }}
                                - {{ 'Edit the report' | trans }} + {{ 'Edit the activity' | trans }}
                                - - - - - - - - - - - - - - - - - - - - - - -
                                Id{{ entity.id }}
                                Date{{ entity.date|localizeddate('long', 'none') }}
                                Durationtime{{ entity.durationTime|date('H:i') }}
                                Remark{{ entity.remark }}
                                Attendee{{ entity.attendee }}
                                - - + + {{ 'Edit the activity'|trans }} + + + {{ form(delete_form) }} {% endblock personcontent %} From 9927be9e2f49cba12187725f8922e7de6626edb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 11:08:00 +0200 Subject: [PATCH 037/163] forget parameters.yml --- .gitignore | 1 + Test/Fixtures/App/app/config/parameters.yml | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 Test/Fixtures/App/app/config/parameters.yml diff --git a/.gitignore b/.gitignore index e8811ec63..bd3f24341 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ composer.lock Tests/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/cache/* +Test/Fixtures/App/app/config/parameters.yml diff --git a/Test/Fixtures/App/app/config/parameters.yml b/Test/Fixtures/App/app/config/parameters.yml deleted file mode 100644 index 28326fefe..000000000 --- a/Test/Fixtures/App/app/config/parameters.yml +++ /dev/null @@ -1,7 +0,0 @@ -parameters: - database_host: 127.0.0.1 - database_port: 5432 - database_name: chill_test - database_user: chill - database_password: chill - locale: fr \ No newline at end of file From c4b2bfa8ff29ace3e75143189737b065a2745fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 11:17:01 +0200 Subject: [PATCH 038/163] add fixtures into timeline --- Resources/config/services.yml | 12 +- Resources/translations/messages.fr.yml | 5 + .../activity_person_context.html.twig | 13 ++ Tests/Timeline/TimelineProviderTest.php | 36 +++ Timeline/TimelineActivityProvider.php | 205 ++++++++++++++++++ 5 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 Resources/translations/messages.fr.yml create mode 100644 Resources/views/Timeline/activity_person_context.html.twig create mode 100644 Tests/Timeline/TimelineProviderTest.php create mode 100644 Timeline/TimelineActivityProvider.php diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 2a24edf02..c5532dc9b 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -35,4 +35,14 @@ services: arguments: - "@chill.main.security.authorization.helper" tags: - - { name: security.voter } \ No newline at end of file + - { name: security.voter } + + + chill.activity.timeline: + class: Chill\ActivityBundle\Timeline\TimelineActivityProvider + arguments: + - '@doctrine.orm.entity_manager' + - '@chill.main.security.authorization.helper' + - '@security.token_storage' + tags: + - { name: chill.timeline, context: 'person' } \ No newline at end of file diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml new file mode 100644 index 000000000..cd3e69010 --- /dev/null +++ b/Resources/translations/messages.fr.yml @@ -0,0 +1,5 @@ +#timeline +'%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date% +Activity: Activité +View the activity: Voir l'activité + diff --git a/Resources/views/Timeline/activity_person_context.html.twig b/Resources/views/Timeline/activity_person_context.html.twig new file mode 100644 index 000000000..eea0dbd1d --- /dev/null +++ b/Resources/views/Timeline/activity_person_context.html.twig @@ -0,0 +1,13 @@ +
                                +

                                {{ 'Activity'|trans }}

                                +
                                + {{ '%user% has done an %activity_type% on %date%'|trans( + { + '%user%' : user, + '%activity_type%': activity.type.name|localize_translatable_string, + '%date%' : activity.date|localizeddate('long', 'none') } + ) }} {{ 'View the activity'|trans }} + +
                                +
                                diff --git a/Tests/Timeline/TimelineProviderTest.php b/Tests/Timeline/TimelineProviderTest.php new file mode 100644 index 000000000..7c25cc0d9 --- /dev/null +++ b/Tests/Timeline/TimelineProviderTest.php @@ -0,0 +1,36 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Timeline; + +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; + +/** + * + * + * @author Julien Fastré + */ +class TimelineProviderTest extends WebTestCase +{ + public function testAnActivityIsShownOnTimeline() + { + $this->markTestSkipped("we have to write fixtures before writing this tests"); + } + +} diff --git a/Timeline/TimelineActivityProvider.php b/Timeline/TimelineActivityProvider.php new file mode 100644 index 000000000..b54fe34b0 --- /dev/null +++ b/Timeline/TimelineActivityProvider.php @@ -0,0 +1,205 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Timeline; + +use Chill\MainBundle\Timeline\TimelineProviderInterface; +use Doctrine\ORM\EntityManager; +use Chill\MainBundle\Security\Authorization\AuthorizationHelper; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; +use Symfony\Component\Security\Core\Role\Role; +use Doctrine\ORM\Mapping\ClassMetadata; +use Chill\PersonBundle\Entity\Person; +use Chill\MainBundle\Entity\Scope; + +/** + * Provide activity for inclusion in timeline + * + * @author Julien Fastré + * @author Champs Libres + */ +class TimelineActivityProvider implements TimelineProviderInterface +{ + + /** + * + * @var EntityManager + */ + protected $em; + + /** + * + * @var AuthorizationHelper + */ + protected $helper; + + /** + * + * @var \Chill\MainBundle\Entity\User + */ + protected $user; + + public function __construct(EntityManager $em, AuthorizationHelper $helper, + TokenStorage $storage) + { + $this->em = $em; + $this->helper = $helper; + + if (!$storage->getToken()->getUser() instanceof \Chill\MainBundle\Entity\User) + { + throw new \RuntimeException('A user should be authenticated !'); + } + + $this->user = $storage->getToken()->getUser(); + } + + /** + * + * {@inheritDoc} + */ + public function fetchQuery($context, array $args) + { + $this->checkContext($context); + + $metadataActivity = $this->em->getClassMetadata('ChillActivityBundle:Activity'); + $metadataPerson = $this->em->getClassMetadata('ChillPersonBundle:Person'); + + return array( + 'id' => $metadataActivity->getTableName() + .'.'.$metadataActivity->getColumnName('id'), + 'type' => 'activity', + 'date' => $metadataActivity->getTableName() + .'.'.$metadataActivity->getColumnName('date'), + 'FROM' => $this->getFromClause($metadataActivity, $metadataPerson), + 'WHERE' => $this->getWhereClause($metadataActivity, $metadataPerson, + $args['person']) + ); + } + + private function getWhereClause(ClassMetadata $metadataActivity, + ClassMetadata $metadataPerson, Person $person) + { + $role = new Role('CHILL_ACTIVITY_SEE'); + $reachableCenters = $this->helper->getReachableCenters($this->user, + $role); + $associationMapping = $metadataActivity->getAssociationMapping('person'); + + // we start with activities having the person_id linked to person + // (currently only context "person" is supported) + $whereClause = sprintf('%s = %d', + $associationMapping['joinColumns'][0]['name'], + $person->getId()); + + // we add acl (reachable center and scopes) + $centerAndScopeLines = array(); + foreach ($reachableCenters as $center) { + $reachablesScopesId = array_map( + function(Scope $scope) { return $scope->getId(); }, + $this->helper->getReachableScopes($this->user, $role, + $person->getCenter()) + ); + + $centerAndScopeLines[] = sprintf('(%s = %d AND %s IN (%s))', + $metadataPerson->getTableName().'.'. + $metadataPerson->getAssociationMapping('center')['joinColumns'][0]['name'], + $center->getId(), + $metadataActivity->getTableName().'.'. + $metadataActivity->getAssociationMapping('scope')['joinColumns'][0]['name'], + implode(',', $reachablesScopesId)); + + } + $whereClause .= ' AND ('.implode(' OR ', $centerAndScopeLines).')'; + + return $whereClause; + } + + private function getFromClause(ClassMetadata $metadataActivity, + ClassMetadata $metadataPerson) + { + $associationMapping = $metadataActivity->getAssociationMapping('person'); + + return $metadataActivity->getTableName().' JOIN ' + .$metadataPerson->getTableName().' ON ' + .$metadataPerson->getTableName().'.'. + $associationMapping['joinColumns'][0]['referencedColumnName'] + .' = ' + .$associationMapping['joinColumns'][0]['name'] + ; + } + + /** + * + * {@inheritDoc} + */ + public function getEntities(array $ids) + { + $activities = $this->em->getRepository('ChillActivityBundle:Activity') + ->findBy(array('id' => $ids)); + + $result = array(); + foreach($activities as $activity) { + $result[$activity->getId()] = $activity; + } + + return $result; + } + + /** + * + * {@inheritDoc} + */ + public function getEntityTemplate($entity, $context, array $args) + { + $this->checkContext($context); + + return array( + 'template' => 'ChillActivityBundle:Timeline:activity_person_context.html.twig', + 'template_data' => array( + 'activity' => $entity, + 'person' => $args['person'], + 'user' => $entity->getUser() + ) + ); + } + + /** + * + * {@inheritDoc} + */ + public function supportsType($type) + { + return $type === 'activity'; + } + + /** + * check if the context is supported + * + * @param string $context + * @throws \LogicException if the context is not supported + */ + private function checkContext($context) + { + if ($context !== 'person') { + throw new \LogicException("The context '$context' is not " + . "supported. Currently only 'person' is supported"); + } + } + +} From 6f9015ac088208ad8a34fd6fb2a764ba969ba965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 11:19:46 +0200 Subject: [PATCH 039/163] mark test as skipped for now --- Tests/Controller/ActivityControllerTest.php | 5 +++++ .../ActivityReasonCategoryControllerTest.php | 4 ++++ .../Controller/ActivityReasonControllerTest.php | 4 ++++ Tests/Controller/ActivityTypeControllerTest.php | 4 ++++ Tests/Controller/DefaultControllerTest.php | 17 ----------------- 5 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 Tests/Controller/DefaultControllerTest.php diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php index 2a0cb3c21..6fd1dd06e 100644 --- a/Tests/Controller/ActivityControllerTest.php +++ b/Tests/Controller/ActivityControllerTest.php @@ -6,6 +6,11 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class ActivityControllerTest extends WebTestCase { + public function testToWrite() + { + $this->markTestSkipped(); + } + /* public function testCompleteScenario() { diff --git a/Tests/Controller/ActivityReasonCategoryControllerTest.php b/Tests/Controller/ActivityReasonCategoryControllerTest.php index 09dbbfb86..9222d4b39 100644 --- a/Tests/Controller/ActivityReasonCategoryControllerTest.php +++ b/Tests/Controller/ActivityReasonCategoryControllerTest.php @@ -6,6 +6,10 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class ActivityReasonCategoryControllerTest extends WebTestCase { + public function testToWrite() + { + $this->markTestSkipped(); + } /* public function testCompleteScenario() { diff --git a/Tests/Controller/ActivityReasonControllerTest.php b/Tests/Controller/ActivityReasonControllerTest.php index d1adc9ca4..5ee8cf977 100644 --- a/Tests/Controller/ActivityReasonControllerTest.php +++ b/Tests/Controller/ActivityReasonControllerTest.php @@ -6,6 +6,10 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class ActivityReasonControllerTest extends WebTestCase { + public function testToWrite() + { + $this->markTestSkipped(); + } /* public function testCompleteScenario() { diff --git a/Tests/Controller/ActivityTypeControllerTest.php b/Tests/Controller/ActivityTypeControllerTest.php index 07c72c3dd..9249f14ae 100644 --- a/Tests/Controller/ActivityTypeControllerTest.php +++ b/Tests/Controller/ActivityTypeControllerTest.php @@ -6,6 +6,10 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class ActivityTypeControllerTest extends WebTestCase { + public function testToWrite() + { + $this->markTestSkipped(); + } /* public function testCompleteScenario() { diff --git a/Tests/Controller/DefaultControllerTest.php b/Tests/Controller/DefaultControllerTest.php deleted file mode 100644 index c653df136..000000000 --- a/Tests/Controller/DefaultControllerTest.php +++ /dev/null @@ -1,17 +0,0 @@ -request('GET', '/hello/Fabien'); - - $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); - } -} From a4e3089150e02fef896b732ef7899a4b87f5ca80 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 11:42:33 +0200 Subject: [PATCH 040/163] Debuging updating form --- Controller/ActivityController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 18613b5f9..21a61cd01 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -241,10 +241,11 @@ class ActivityController extends Controller * Edits an existing Activity entity. * */ - public function updateAction(Request $request, $id) + public function updateAction(Request $request, $person_id, $id) { $em = $this->getDoctrine()->getManager(); - + + $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); if (!$entity) { @@ -253,14 +254,14 @@ class ActivityController extends Controller $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); - $deleteForm = $this->createDeleteForm($id); + $deleteForm = $this->createDeleteForm($id, $person); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); if ($editForm->isValid()) { $em->flush(); - return $this->redirect($this->generateUrl('chill_activity_activity_edit', array('id' => $id))); + return $this->redirect($this->generateUrl('chill_activity_activity_edit', array('id' => $id, 'person_id' => $person_id))); } return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( From bc2b89db031eb6855663350ce5d8481c4b088d26 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sun, 5 Jul 2015 11:45:15 +0200 Subject: [PATCH 041/163] updating edit template --- Resources/views/Activity/edit.html.twig | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index 34eda0653..7d140cc55 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -21,16 +21,7 @@ {% block title %}{{ 'Activity edit' |trans }}{% endblock title %} {% block personcontent %} -

                                Activity edit

                                - {{ form(edit_form) }} - + {# {{ form(delete_form) }} #} {% endblock %} From afdac5390d45e6a5aa3fd7885055dba4576b958e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 11:45:45 +0200 Subject: [PATCH 042/163] add translations I rewrote some messages to be more consistent and avoid multiplication of messages --- Resources/config/routing/activity.yml | 2 +- Resources/translations/messages.fr.yml | 23 +++++++++++++++++-- Resources/views/Activity/new.html.twig | 4 ++-- .../activity_person_context.html.twig | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Resources/config/routing/activity.yml b/Resources/config/routing/activity.yml index 63d4c5723..b2bc76201 100644 --- a/Resources/config/routing/activity.yml +++ b/Resources/config/routing/activity.yml @@ -18,7 +18,7 @@ chill_activity_activity_new: menus: person: order: 200 - label: Add an activity + label: Add a new activity chill_activity_activity_create: path: /{_locale}/person/{person_id}/activity/create diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index cd3e69010..88934216a 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -1,5 +1,24 @@ +#general +Show the activity: Voir l'activité +Edit the activity: Modifier l'activité +Activity: Activité +Duration time: Durée +Duration Time: Durée +Reason: Sujet +Attendee: Présence de la personne +Remark: Notes +Add a new activity: Ajouter une nouvelle activité +Activity list: Liste des activités +present: présent +not present: absent +Delete: Supprimer + +#forms +Activity creation: Nouvelle activité +Create: Créer +Back to the list: Retour à la liste + #timeline '%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date% -Activity: Activité -View the activity: Voir l'activité + diff --git a/Resources/views/Activity/new.html.twig b/Resources/views/Activity/new.html.twig index 645bf3cf7..7e036ef68 100644 --- a/Resources/views/Activity/new.html.twig +++ b/Resources/views/Activity/new.html.twig @@ -21,14 +21,14 @@ {% block title %}{{ 'Activity create' |trans }}{% endblock title %} {% block personcontent %} -

                                Activity creation

                                +

                                {{ "Activity creation"|trans }}

                                {{ form(form) }} diff --git a/Resources/views/Timeline/activity_person_context.html.twig b/Resources/views/Timeline/activity_person_context.html.twig index eea0dbd1d..381db4174 100644 --- a/Resources/views/Timeline/activity_person_context.html.twig +++ b/Resources/views/Timeline/activity_person_context.html.twig @@ -7,7 +7,7 @@ '%activity_type%': activity.type.name|localize_translatable_string, '%date%' : activity.date|localizeddate('long', 'none') } ) }} {{ 'View the activity'|trans }} + { 'person_id': person.id, 'id': activity.id} ) }}">{{ 'Show the activity'|trans }} From f7ab4824db8146f83b76596de529feeeaf5a1567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 11:48:53 +0200 Subject: [PATCH 043/163] add translation in update form --- Resources/translations/messages.fr.yml | 2 ++ Resources/views/Activity/edit.html.twig | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 88934216a..574b12017 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -12,6 +12,8 @@ Activity list: Liste des activités present: présent not present: absent Delete: Supprimer +Update: Mettre à jour +Update activity: Édition de l'activité #forms Activity creation: Nouvelle activité diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index 7d140cc55..5b96d5f4b 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -21,6 +21,8 @@ {% block title %}{{ 'Activity edit' |trans }}{% endblock title %} {% block personcontent %} +

                                {{ "Update activity"|trans }}

                                + {{ form(edit_form) }} {# {{ form(delete_form) }} #} From 943032a9188bd8f375b60ed4e3fe5f7c3ea05cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 23:23:29 +0200 Subject: [PATCH 044/163] layout of time widget --- Form/ActivityType.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Form/ActivityType.php b/Form/ActivityType.php index bf8fc492d..b6c52fb4a 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -67,7 +67,10 @@ class ActivityType extends AbstractType 'widget' => 'single_text', 'format' => 'dd-MM-yyyy') ) - ->add('durationTime', 'time') + ->add('durationTime', 'time', array( + 'widget' => 'text', + 'hours' => array(0, 1, 2, 3, 4, 5, 6, 7, 8) + )) ->add('remark', 'textarea', array( 'required' => false, 'empty_data' => '' From 7f367a857e3abe61d89035a486992591d4b1d61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 23:45:49 +0200 Subject: [PATCH 045/163] layout of show and list - remove attendee from list - multiple case in show + layout --- Resources/translations/messages.fr.yml | 1 + Resources/views/Activity/list.html.twig | 2 -- Resources/views/Activity/show.html.twig | 6 ++++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 574b12017..54cf7de0b 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -14,6 +14,7 @@ not present: absent Delete: Supprimer Update: Mettre à jour Update activity: Édition de l'activité +Scope: Cercle #forms Activity creation: Nouvelle activité diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index 5e2871555..c68371dd5 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -28,7 +28,6 @@ {{'Duration Time' | trans }} {{'Reason' | trans}} {{'Type' | trans}} - {{'Attendee' | trans }} @@ -40,7 +39,6 @@ {{ activity.durationTime|date('H:i') }} {{ activity.reason.name | localize_translatable_string }} {{ activity.type.name | localize_translatable_string }} - {{ activity.attendee }} {{ 'Show the activity' | trans }} diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 32717fa48..f09b3a8de 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -3,6 +3,8 @@ {% set activeRouteKey = 'chill_activity_activity_list' %} {% block personcontent -%} +

                                {{ "Activity"|trans }}

                                + {{ 'Edit the activity'|trans }} @@ -23,9 +25,9 @@
                                {{ 'Type'|trans }}
                                {{ entity.type.name | localize_translatable_string }}
                                {{ 'Attendee'|trans }}
                                -
                                {{ entity.attendee }}
                                +
                                {% if entity.attendee is not null %}{% if entity.attendee %}{{ 'present'|trans|capitalize }} {% else %} {{ 'not present'|trans|capitalize }}{% endif %}{% else %}{{ 'None'|trans|capitalize }}{% endif %}
                                {{ 'Remark'|trans }}
                                -
                                {{ entity.remark }}
                                +
                                {% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}
                                {{ entity.remark }}
                                {% endif %}
                                {{ ''|trans }}
                                {{ ''|trans }}
                                From e0561340a5b8c5286b6b3041222b4f913b5cc20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 5 Jul 2015 23:58:15 +0200 Subject: [PATCH 046/163] add layout for form, consistency with reports - add buttons at the bottom --- Controller/ActivityController.php | 2 -- Resources/translations/messages.fr.yml | 2 ++ Resources/views/Activity/edit.html.twig | 15 ++++++++++++++- Resources/views/Activity/new.html.twig | 20 ++++++++++++-------- Resources/views/Activity/show.html.twig | 2 +- 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 21a61cd01..a99007a81 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -113,8 +113,6 @@ class ActivityController extends Controller ) ); - $form->add('submit', 'submit', array('label' => 'Create')); - return $form; } diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 54cf7de0b..90950fbf7 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -20,6 +20,8 @@ Scope: Cercle Activity creation: Nouvelle activité Create: Créer Back to the list: Retour à la liste +Save activity: Sauver l'activité +Reset form: Remise à zéro du formulaire #timeline '%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date% diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index 5b96d5f4b..d92ecab39 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -23,7 +23,20 @@ {% block personcontent %}

                                {{ "Update activity"|trans }}

                                - {{ form(edit_form) }} + {{ form_start(edit_form) }} + + {{ form_widget(edit_form) }} +
                                + + +
                                + {{ form_end(edit_form) }} {# {{ form(delete_form) }} #} {% endblock %} + +{% block js %} + +{% endblock %} diff --git a/Resources/views/Activity/new.html.twig b/Resources/views/Activity/new.html.twig index 7e036ef68..4e55698a0 100644 --- a/Resources/views/Activity/new.html.twig +++ b/Resources/views/Activity/new.html.twig @@ -23,13 +23,17 @@ {% block personcontent %}

                                {{ "Activity creation"|trans }}

                                - {{ form(form) }} + {{ form_start(form) }} - + {{ form_widget(form) }} +
                                + +
                                + {{ form_end(form) }} +{% endblock %} + +{% block js %} + {% endblock %} \ No newline at end of file diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index f09b3a8de..1be4948d9 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -38,5 +38,5 @@ {{ 'Edit the activity'|trans }} - {{ form(delete_form) }} + {# {{ form(delete_form) }} #} {% endblock personcontent %} From e36c195ecf7d8d744a5cc53c9cd53d96955c63f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 6 Jul 2015 00:10:13 +0200 Subject: [PATCH 047/163] add flashbag message for activity --- Controller/ActivityController.php | 31 +++++++++++++++++++++++--- Resources/translations/messages.fr.yml | 5 +++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index a99007a81..21e87264e 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -80,11 +80,24 @@ class ActivityController extends Controller $em->persist($entity); $em->flush(); + + $this->get('session') + ->getFlashBag() + ->add('success', + $this->get('translator') + ->trans('Success : activity created!') + ); return $this->redirect( $this->generateUrl('chill_activity_activity_show', array('id' => $entity->getId(), 'person_id' => $person_id))); } + + $this->get('session') + ->getFlashBag()->add('danger', + $this->get('translator') + ->trans('The form is not valid. The activity has not been created !') + ); return $this->render('ChillActivityBundle:Activity:new.html.twig', array( 'entity' => $entity, @@ -231,8 +244,6 @@ class ActivityController extends Controller 'role' => new Role('CHILL_ACTIVITY_UPDATE') )); - $form->add('submit', 'submit', array('label' => 'Update')); - return $form; } /** @@ -258,9 +269,23 @@ class ActivityController extends Controller if ($editForm->isValid()) { $em->flush(); + + $this->get('session') + ->getFlashBag() + ->add('success', + $this->get('translator') + ->trans('Success : activity updated!') + ); - return $this->redirect($this->generateUrl('chill_activity_activity_edit', array('id' => $id, 'person_id' => $person_id))); + return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $id, 'person_id' => $person_id))); } + + $this->get('session') + ->getFlashBag() + ->add('danger', + $this->get('translator') + ->trans('The form is not valid. The activity has not been updated !') + ); return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( 'entity' => $entity, diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 90950fbf7..82172eca1 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -26,4 +26,9 @@ Reset form: Remise à zéro du formulaire #timeline '%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date% +#controller +'Success : activity created!': Bravo ! L'activité a été créée. +'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'activité n'a pas été créée. +'Success : activity updated!': Bravo ! L'activité a été mise à jour. +'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour. From e1eeb1bdaba290f6f49fd3226aead4acfd742ee5 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Mon, 6 Jul 2015 00:27:16 +0200 Subject: [PATCH 048/163] Adding activity fixtures --- DataFixtures/ORM/LoadActivity.php | 95 ++++++++++++++++++++++++- DataFixtures/ORM/LoadActivityReason.php | 5 ++ DataFixtures/ORM/LoadActivityType.php | 5 ++ 3 files changed, 103 insertions(+), 2 deletions(-) diff --git a/DataFixtures/ORM/LoadActivity.php b/DataFixtures/ORM/LoadActivity.php index c65ddc696..fe14fd86c 100644 --- a/DataFixtures/ORM/LoadActivity.php +++ b/DataFixtures/ORM/LoadActivity.php @@ -25,20 +25,111 @@ namespace Chill\ActivityBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; +use Faker\Factory as FakerFactory; +use Chill\ActivityBundle\Entity\Activity; +use Chill\MainBundle\DataFixtures\ORM\LoadUsers; +use Chill\ActivityBundle\DataFixtures\ORM\LoadActivityReason; +use Chill\ActivityBundle\DataFixtures\ORM\LoadActivityType; +use Chill\MainBundle\DataFixtures\ORM\LoadScopes; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; /** - * Description of LoadActivity + * Load reports into DB * * @author Champs-Libres Coop */ -class LoadActivity extends AbstractFixture implements OrderedFixtureInterface//, ContainerAwareInterface +class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface { + use \Symfony\Component\DependencyInjection\ContainerAwareTrait; + + /** + * @var \Faker\Generator + */ + private $faker; + + public function __construct() + { + $this->faker = FakerFactory::create('fr_FR'); + } + public function getOrder() { return 16400; } + /** + * Return a random scope + * + * @return \Chill\MainBundle\Entity\Scope + */ + private function getRandomScope() + { + $scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)]; + return $this->getReference($scopeRef); + } + + /** + * Return a random activityType + * + * @return \Chill\ActivityBundle\Entity\ActivityType + */ + private function getRandomActivityType() + { + $typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)]; + return $this->getReference($typeRef); + } + + /** + * Return a random activityReason + * + * @return \Chill\ActivityBundle\Entity\ActivityReason + */ + private function getRandomActivityReason() + { + $reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)]; + return $this->getReference($reasonRef); + } + + /** + * Return a random user + * + * @return \Chill\MainBundle\Entity\User + */ + private function getRandomUser() + { + $userRef = array_rand(LoadUsers::$refs); + return $this->getReference($userRef); + } + + public function newRandomActivity($person) + { + $activity = (new Activity()) + ->setUser($this->getRandomUser()) + ->setPerson($person) + ->setDate($this->faker->dateTimeThisYear()) + ->setDurationTime($this->faker->dateTime(36000)) + ->setType($this->getRandomActivityType()) + ->setReason($this->getRandomActivityReason()) + ->setScope($this->getRandomScope()) + ->setAttendee($this->faker->boolean()) + ->setRemark('A remark'); + return $activity; + } + public function load(ObjectManager $manager) { + $persons = $this->container->get('doctrine.orm.entity_manager') + ->getRepository('ChillPersonBundle:Person') + ->findAll(); + + foreach($persons as $person) { + $activityNbr = rand(0,3); + for($i = 0; $i < $activityNbr; $i ++) { + print "Creating an activity type for : ".$person."\n"; + $activity = $this->newRandomActivity($person); + $manager->persist($activity); + } + } + $manager->flush(); } } diff --git a/DataFixtures/ORM/LoadActivityReason.php b/DataFixtures/ORM/LoadActivityReason.php index 1dbd18f11..64c58ee7e 100644 --- a/DataFixtures/ORM/LoadActivityReason.php +++ b/DataFixtures/ORM/LoadActivityReason.php @@ -39,6 +39,8 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf return 16300; } + public static $references = array(); + public function load(ObjectManager $manager) { $reasons = [ @@ -69,6 +71,9 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf ->setActive(true) ->setCategory($this->getReference($r['category'])); $manager->persist($activityReason); + $reference = 'activity_reason_'.$r['name']['en']; + $this->addReference($reference, $activityReason); + static::$references[] = $reference; } $manager->flush(); diff --git a/DataFixtures/ORM/LoadActivityType.php b/DataFixtures/ORM/LoadActivityType.php index 8d0dcfa97..405c89606 100644 --- a/DataFixtures/ORM/LoadActivityType.php +++ b/DataFixtures/ORM/LoadActivityType.php @@ -38,6 +38,8 @@ class LoadActivityType extends AbstractFixture implements OrderedFixtureInterfac { return 16100; } + + public static $references = array(); public function load(ObjectManager $manager) { @@ -55,6 +57,9 @@ class LoadActivityType extends AbstractFixture implements OrderedFixtureInterfac $activityType = (new ActivityType()) ->setName(($t['name'])); $manager->persist($activityType); + $reference = 'activity_type_'.$t['name']['en']; + $this->addReference($reference, $activityType); + static::$references[] = $reference; } $manager->flush(); From 7675f0e250735d1b8d4185f0a4e0470db893f276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 6 Jul 2015 00:55:39 +0200 Subject: [PATCH 049/163] add grouping and fix localization of trans. string in ActivityReason the label of activity type is now handled by translatableStringHelper. Reasons are also grouped by categories. This is thanks to PR https://github.com/symfony/symfony/pull/14050 --- Form/Type/TranslatableActivityReason.php | 20 ++++++++++++-------- Resources/config/services.yml | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Form/Type/TranslatableActivityReason.php b/Form/Type/TranslatableActivityReason.php index 776dd0ee2..8ce5d42d3 100644 --- a/Form/Type/TranslatableActivityReason.php +++ b/Form/Type/TranslatableActivityReason.php @@ -25,6 +25,7 @@ namespace Chill\ActivityBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\HttpFoundation\RequestStack; +use Chill\MainBundle\Templating\TranslatableStringHelper; /** * Description of TranslatableActivityReason @@ -33,14 +34,12 @@ use Symfony\Component\HttpFoundation\RequestStack; */ class TranslatableActivityReason extends AbstractType { - /** - * @var RequestStack - */ - private $requestStack; - public function __construct(RequestStack $requestStack) + private $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) { - $this->requestStack = $requestStack; + $this->translatableStringHelper = $translatableStringHelper; } public function getName() @@ -55,11 +54,16 @@ class TranslatableActivityReason extends AbstractType public function configureOptions(OptionsResolver $resolver) { - $locale = $this->requestStack->getCurrentRequest()->getLocale(); + $helper = $this->translatableStringHelper; $resolver->setDefaults( array( 'class' => 'ChillActivityBundle:ActivityReason', - 'property' => 'name['.$locale.']' + 'choice_label' => function($choice, $key) use ($helper) { + return $helper->localize($choice->getName()); + }, + 'group_by' => function($choice, $key) use ($helper) { + return $helper->localize($choice->getCategory()->getName()); + } ) ); } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index c5532dc9b..64e72f8f5 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -9,7 +9,7 @@ services: chill.activity.form.type.translatableactivityreason: class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason arguments: - - "@request_stack" + - "@chill.main.helper.translatable_string" tags: - { name: form.type, alias: translatable_activity_reason } From c7962c8afdf24545651ead3182c42e3d010d672b Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Mon, 6 Jul 2015 09:10:58 +0200 Subject: [PATCH 050/163] Display only the activities of a person --- Controller/ActivityController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 21e87264e..7ff2e78ea 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -24,9 +24,7 @@ namespace Chill\ActivityBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; - use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Form\ActivityType; use Symfony\Component\Security\Core\Role\Role; use Chill\PersonBundle\Entity\Person; @@ -45,7 +43,14 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); - $activities = $em->getRepository('ChillActivityBundle:Activity')->findAll(); + + $reachableScopes = $this->get('chill.main.security.authorization.helper') + ->getReachableScopes($this->getUser(), new Role('CHILL_ACTIVITY_SEE'), + $person->getCenter()); + + $activities = $em->getRepository('ChillActivityBundle:Activity') + ->findBy(array('person' => $person, 'scope' => $reachableScopes)); + return $this->render('ChillActivityBundle:Activity:list.html.twig', array( 'activities' => $activities, From 7008284479a90f2cad6990122e74eee795b45819 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 26 Aug 2015 13:34:17 +0200 Subject: [PATCH 051/163] Adding colors for table header of Activity/list --- Resources/views/Activity/list.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index c68371dd5..0cd6a5008 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -24,9 +24,9 @@ - - - + + + From 4daa44ed57ae656f31c7ac748f7808997a6344a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Sep 2015 23:08:32 +0200 Subject: [PATCH 052/163] implements role declaration in activity close #610 @0h15 --- Resources/config/services.yml | 1 + Resources/translations/messages.fr.yml | 4 ++++ Security/Authorization/ActivityVoter.php | 14 +++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 64e72f8f5..39ba42839 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -36,6 +36,7 @@ services: - "@chill.main.security.authorization.helper" tags: - { name: security.voter } + - { name: chill.role } chill.activity.timeline: diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 82172eca1..9fc56b438 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -32,3 +32,7 @@ Reset form: Remise à zéro du formulaire 'Success : activity updated!': Bravo ! L'activité a été mise à jour. 'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour. +# CONTROLLER +CHILL_ACTIVITY_CREATE: Créer une activité +CHILL_ACTIVITY_UPDATE: Modifier une activité +CHILL_ACTIVITY_SEE: Voir une activité \ No newline at end of file diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php index b6f82c1ed..0e9ffc2ed 100644 --- a/Security/Authorization/ActivityVoter.php +++ b/Security/Authorization/ActivityVoter.php @@ -21,13 +21,14 @@ namespace Chill\ActivityBundle\Security\Authorization; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; +use Chill\MainBundle\Security\ProvideRoleInterface; /** * * * @author Julien Fastré */ -class ActivityVoter extends AbstractChillVoter +class ActivityVoter extends AbstractChillVoter implements ProvideRoleInterface { const CREATE = 'CHILL_ACTIVITY_CREATE'; const SEE = 'CHILL_ACTIVITY_SEE'; @@ -63,4 +64,15 @@ class ActivityVoter extends AbstractChillVoter return $this->helper->userHasAccess($user, $report, $attribute); } + + public function getRoles() + { + return $this->getSupportedAttributes(); + } + + public function getRolesWithoutScope() + { + return array(); + } + } From ab707e907902e7860c4901974a1af1ec47fd92aa Mon Sep 17 00:00:00 2001 From: Champs-Libres-Bot Date: Wed, 23 Sep 2015 16:20:54 +0200 Subject: [PATCH 053/163] add issue tracker --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 75ea82d3a..eeab3b80a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # Activity The bundle for recording activities + + +Issue tracker : https://redmine.champs-libres.coop/projects/activity/issues From 74c03078c427566f13a0561abbf419978d8decf9 Mon Sep 17 00:00:00 2001 From: Champs-Libres-Bot Date: Wed, 23 Sep 2015 16:24:19 +0200 Subject: [PATCH 054/163] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index eeab3b80a..3836e2034 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ The bundle for recording activities Issue tracker : https://redmine.champs-libres.coop/projects/activity/issues + +Documentation: http://docs.chill.social From 4bd5d70fb28f58b1c108f2994e865e7ed6b09ada Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Mon, 28 Sep 2015 14:08:03 +0200 Subject: [PATCH 055/163] Remove required in form #622 --- Form/ActivityReasonCategoryType.php | 2 +- Form/ActivityReasonType.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Form/ActivityReasonCategoryType.php b/Form/ActivityReasonCategoryType.php index 3e05011e0..90d0b400a 100644 --- a/Form/ActivityReasonCategoryType.php +++ b/Form/ActivityReasonCategoryType.php @@ -16,7 +16,7 @@ class ActivityReasonCategoryType extends AbstractType { $builder ->add('name', 'translatable_string') - ->add('active') + ->add('active', 'checkbox', array('required' => false)) ; } diff --git a/Form/ActivityReasonType.php b/Form/ActivityReasonType.php index fd3939e29..695451cd0 100644 --- a/Form/ActivityReasonType.php +++ b/Form/ActivityReasonType.php @@ -16,7 +16,7 @@ class ActivityReasonType extends AbstractType { $builder ->add('name', 'translatable_string') - ->add('active') + ->add('active', 'checkbox', array('required' => false)) ->add('category', 'translatable_activity_reason_category') ; } From 0ecfcae98b72b8d2701007f3cd61a21e88f08a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 29 Sep 2015 17:18:29 +0200 Subject: [PATCH 056/163] fix layout and menu for activity configuration close #614 1h00 --- Controller/AdminController.php | 38 +++++++++++++++++++ Resources/config/routing.yml | 21 ++++++++++ Resources/config/routing/activityreason.yml | 2 +- .../config/routing/activityreasoncategory.yml | 2 +- Resources/config/routing/activitytype.yml | 2 +- Resources/translations/messages.fr.xlf | 11 ------ Resources/translations/messages.fr.yml | 21 +++++++++- Resources/views/ActivityReason/edit.html.twig | 14 ++++--- .../views/ActivityReason/index.html.twig | 22 +++++------ Resources/views/ActivityReason/new.html.twig | 13 +++++-- Resources/views/ActivityReason/show.html.twig | 25 ++++++------ .../ActivityReasonCategory/edit.html.twig | 2 +- .../ActivityReasonCategory/index.html.twig | 2 +- .../ActivityReasonCategory/new.html.twig | 2 +- .../ActivityReasonCategory/show.html.twig | 2 +- Resources/views/ActivityType/edit.html.twig | 2 +- Resources/views/ActivityType/index.html.twig | 2 +- Resources/views/ActivityType/new.html.twig | 2 +- Resources/views/ActivityType/show.html.twig | 2 +- .../views/Admin/layout_activity.html.twig | 31 +++++++++++++++ Resources/views/Admin/menu_activity.html.twig | 20 ++++++++++ 21 files changed, 180 insertions(+), 58 deletions(-) create mode 100644 Controller/AdminController.php delete mode 100644 Resources/translations/messages.fr.xlf create mode 100644 Resources/views/Admin/layout_activity.html.twig create mode 100644 Resources/views/Admin/menu_activity.html.twig diff --git a/Controller/AdminController.php b/Controller/AdminController.php new file mode 100644 index 000000000..bf543ae0a --- /dev/null +++ b/Controller/AdminController.php @@ -0,0 +1,38 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Controller; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +/** + * Controller for activity configuration + * + * @author Julien Fastré + * @author Champs Libres + */ +class AdminController extends Controller +{ + public function indexActivityAction() + { + return $this->render('ChillActivityBundle:Admin:layout_activity.html.twig'); + } +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 0f18ae49f..5eaf6124a 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -13,3 +13,24 @@ chill_activity_activityreasoncategory: chill_activity_activitytype: resource: "@ChillActivityBundle/Resources/config/routing/activitytype.yml" prefix: / + +chill_admin_activity_index: + path: /{_locale}/admin/activity + defaults: { _controller: ChillActivityBundle:Admin:indexActivity } + options: + menus: + admin: + label: Activity configuration + order: 2000 + +chill_admin_activity_back_to_admin: + path: /{_locale}/admin/activity_back_to_main + defaults: + _controller: FrameworkBundle:Redirect:urlRedirect + path: /{_locale}/admin + permanent: true + options: + menus: + admin_activity: + order: 0 + label: Main admin menu diff --git a/Resources/config/routing/activityreason.yml b/Resources/config/routing/activityreason.yml index 18e0003c6..497cf81c0 100644 --- a/Resources/config/routing/activityreason.yml +++ b/Resources/config/routing/activityreason.yml @@ -3,7 +3,7 @@ chill_activity_activityreason: defaults: { _controller: "ChillActivityBundle:ActivityReason:index" } options: menus: - admin: + admin_activity: order: 2000 label: "Activity Reasons" diff --git a/Resources/config/routing/activityreasoncategory.yml b/Resources/config/routing/activityreasoncategory.yml index 717f6d352..7053f6721 100644 --- a/Resources/config/routing/activityreasoncategory.yml +++ b/Resources/config/routing/activityreasoncategory.yml @@ -3,7 +3,7 @@ chill_activity_activityreasoncategory: defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:index" } options: menus: - admin: + admin_activity: order: 2010 label: "Activity Reasons Category" diff --git a/Resources/config/routing/activitytype.yml b/Resources/config/routing/activitytype.yml index 621be8bdc..3a73151a3 100644 --- a/Resources/config/routing/activitytype.yml +++ b/Resources/config/routing/activitytype.yml @@ -3,7 +3,7 @@ chill_activity_activitytype: defaults: { _controller: "ChillActivityBundle:ActivityType:index" } options: menus: - admin: + admin_activity: order: 2020 label: "Activity Types" diff --git a/Resources/translations/messages.fr.xlf b/Resources/translations/messages.fr.xlf deleted file mode 100644 index fd59e6c16..000000000 --- a/Resources/translations/messages.fr.xlf +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Symfony2 is great - J'aime Symfony2 - - - - diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 9fc56b438..549b6564c 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -32,7 +32,24 @@ Reset form: Remise à zéro du formulaire 'Success : activity updated!': Bravo ! L'activité a été mise à jour. 'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour. -# CONTROLLER +# ROLES CHILL_ACTIVITY_CREATE: Créer une activité CHILL_ACTIVITY_UPDATE: Modifier une activité -CHILL_ACTIVITY_SEE: Voir une activité \ No newline at end of file +CHILL_ACTIVITY_SEE: Voir une activité + +# admin +Activity configuration menu: Configuration des activités +Activity Types: Types d'activité +Activity Reasons: Sujets d'une activité +Activity Reasons Category: Catégories d'activités + +# activity reason admin +ActivityReason list: Liste des sujets +Create a new activity reason: Créer un nouveau sujet +Active: Actif +Category: Catégorie +ActivityReason creation: Nouveau sujet +ActivityReason edit: Modification d'un sujet +ActivityReason: Sujet d'activité +The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé +The entity is active and will be proposed: Le sujet est actif et sera proposé diff --git a/Resources/views/ActivityReason/edit.html.twig b/Resources/views/ActivityReason/edit.html.twig index cf775fb30..d7f8e782f 100644 --- a/Resources/views/ActivityReason/edit.html.twig +++ b/Resources/views/ActivityReason/edit.html.twig @@ -14,19 +14,23 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                ActivityReason edit

                                +

                                {{ 'ActivityReason edit'|trans }}

                                - {{ form(edit_form) }} + {{ form_start(edit_form) }} + {{ form_row(edit_form.name) }} + {{ form_row(edit_form.active) }} + {{ form_row(edit_form.category) }} + {{ form_row(edit_form.submit, { 'attr': { 'class' : 'sc-button orange' } } ) }} + {{ form_end(edit_form) }} {% endblock %} diff --git a/Resources/views/ActivityReason/index.html.twig b/Resources/views/ActivityReason/index.html.twig index 97915def3..fbee5efcf 100644 --- a/Resources/views/ActivityReason/index.html.twig +++ b/Resources/views/ActivityReason/index.html.twig @@ -14,33 +14,29 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                ActivityReason list

                                +

                                {{ 'ActivityReason list'|trans }}

                                {{'Date' | trans }}{{'Duration Time' | trans }}{{'Reason' | trans}}{{'Date' | trans }}{{'Duration Time' | trans }}{{'Reason' | trans}} {{'Type' | trans}}
                                - - - - + + {% for entity in entities %} - - - - + + @@ -52,7 +48,7 @@ diff --git a/Resources/views/ActivityReason/new.html.twig b/Resources/views/ActivityReason/new.html.twig index afc45a5df..e033ec6c0 100644 --- a/Resources/views/ActivityReason/new.html.twig +++ b/Resources/views/ActivityReason/new.html.twig @@ -14,17 +14,22 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                ActivityReason creation

                                +

                                {{ 'ActivityReason creation'|trans }}

                                - {{ form(form) }} + {{ form_start(form) }} + {{ form_row(form.name) }} + {{ form_row(form.active) }} + {{ form_row(form.category) }} + {{ form_row(form.submit, { 'attr': { 'class' : 'sc-button green' } } ) }} + {{ form_end(form) }} diff --git a/Resources/views/ActivityReason/show.html.twig b/Resources/views/ActivityReason/show.html.twig index 9aea54df2..830fd466e 100644 --- a/Resources/views/ActivityReason/show.html.twig +++ b/Resources/views/ActivityReason/show.html.twig @@ -14,24 +14,26 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                ActivityReason

                                +

                                {{ 'ActivityReason'|trans }}

                                IdNameActiveActions{{ 'Name'|trans }}{{ 'Actions'|trans }}
                                {{ entity.id }}{{ entity.name|localize_translatable_string }}{{ entity.active }}
                                {{ entity.name|localize_translatable_string }}
                                - - - - - + - - + +
                                Id{{ entity.id }}
                                Name{{ 'Name'|trans }} {{ entity.name|localize_translatable_string }}
                                Active{{ entity.active }}{{ 'Active' }} + {% if entity.active %} +

                                {{ 'The entity is active and will be proposed'|trans }}

                                + {% else %} +

                                {{ "The entity is inactive and won't be proposed"|trans }}

                                + {% endif %} +
                                @@ -39,14 +41,13 @@ {% endblock %} diff --git a/Resources/views/ActivityReasonCategory/edit.html.twig b/Resources/views/ActivityReasonCategory/edit.html.twig index 09b81b375..edc630cdb 100644 --- a/Resources/views/ActivityReasonCategory/edit.html.twig +++ b/Resources/views/ActivityReasonCategory/edit.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityReasonCategory edit

                                diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig index b33b5a1d2..afbd867cd 100644 --- a/Resources/views/ActivityReasonCategory/index.html.twig +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityReasonCategory list

                                diff --git a/Resources/views/ActivityReasonCategory/new.html.twig b/Resources/views/ActivityReasonCategory/new.html.twig index d4eb215f7..4e4c348da 100644 --- a/Resources/views/ActivityReasonCategory/new.html.twig +++ b/Resources/views/ActivityReasonCategory/new.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityReasonCategory creation

                                diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig index 617543a91..a7fe9fa3a 100644 --- a/Resources/views/ActivityReasonCategory/show.html.twig +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityReasonCategory

                                diff --git a/Resources/views/ActivityType/edit.html.twig b/Resources/views/ActivityType/edit.html.twig index 67fdd3b1c..6d6d7660b 100644 --- a/Resources/views/ActivityType/edit.html.twig +++ b/Resources/views/ActivityType/edit.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityType edit

                                diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig index 68b3556e1..5ade83943 100644 --- a/Resources/views/ActivityType/index.html.twig +++ b/Resources/views/ActivityType/index.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityType list

                                diff --git a/Resources/views/ActivityType/new.html.twig b/Resources/views/ActivityType/new.html.twig index 8417bdafd..3310cd011 100644 --- a/Resources/views/ActivityType/new.html.twig +++ b/Resources/views/ActivityType/new.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityType creation

                                diff --git a/Resources/views/ActivityType/show.html.twig b/Resources/views/ActivityType/show.html.twig index 6899df806..9d100684d 100644 --- a/Resources/views/ActivityType/show.html.twig +++ b/Resources/views/ActivityType/show.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillMainBundle::Admin/layout.html.twig" %} +{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %}

                                ActivityType

                                diff --git a/Resources/views/Admin/layout_activity.html.twig b/Resources/views/Admin/layout_activity.html.twig new file mode 100644 index 000000000..6392d751a --- /dev/null +++ b/Resources/views/Admin/layout_activity.html.twig @@ -0,0 +1,31 @@ +{# + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + / + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} + +{% extends "ChillMainBundle::layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('admin_activity', { + 'layout': 'ChillActivityBundle::Admin/menu_activity.html.twig', + }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block admin_content %} +

                                {{ 'Activity configuration' |trans }}

                                + {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/Resources/views/Admin/menu_activity.html.twig b/Resources/views/Admin/menu_activity.html.twig new file mode 100644 index 000000000..2e00763bb --- /dev/null +++ b/Resources/views/Admin/menu_activity.html.twig @@ -0,0 +1,20 @@ +{# + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + / + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . +#} + +{% extends "ChillMainBundle::Menu/verticalMenu.html.twig" %} +{% block v_menu_title %}{{ 'Activity configuration menu'|trans }}{% endblock %} \ No newline at end of file From 744a68f195a7430fa942995c90b8ff89ef9c7367 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Thu, 1 Oct 2015 16:35:10 +0200 Subject: [PATCH 057/163] Category unactive implies all the reasons with this category as unactive - refs #622 --- Entity/ActivityReasonCategory.php | 25 +++++++++++++++---- .../doctrine/ActivityReasonCategory.orm.yml | 4 +++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Entity/ActivityReasonCategory.php b/Entity/ActivityReasonCategory.php index 22da06d74..0106ab881 100644 --- a/Entity/ActivityReasonCategory.php +++ b/Entity/ActivityReasonCategory.php @@ -20,6 +20,8 @@ namespace Chill\ActivityBundle\Entity; +use Doctrine\Common\Collections\ArrayCollection; + /** * ActivityReasonCategory */ @@ -40,13 +42,19 @@ class ActivityReasonCategory */ private $active; + /** @var ArrayCollection array of ActivityReason */ + private $reasons; + + public function __construct() + { + $this->reasons = new ArrayCollection(); + } public function __toString() { - return 'blop'; + return 'ActivityReasonCategory('.$this->getName('x').')'; } - /** * Get id * @@ -95,16 +103,23 @@ class ActivityReasonCategory } /** - * Set active + * Declare a category as active (or not). When a category is set + * as unactive, all the reason have this entity as category is also + * set as unactive * * @param boolean $active - * * @return ActivityReasonCategory */ public function setActive($active) { + if($this->active !== $active && !$active) { + foreach ($this->reasons as $reason) { + $reason->setActive($active); + } + } + $this->active = $active; - + return $this; } diff --git a/Resources/config/doctrine/ActivityReasonCategory.orm.yml b/Resources/config/doctrine/ActivityReasonCategory.orm.yml index 830129740..33487eb7b 100644 --- a/Resources/config/doctrine/ActivityReasonCategory.orm.yml +++ b/Resources/config/doctrine/ActivityReasonCategory.orm.yml @@ -12,4 +12,8 @@ Chill\ActivityBundle\Entity\ActivityReasonCategory: type: json_array active: type: boolean + oneToMany: + reasons: + targetEntity: Chill\ActivityBundle\Entity\ActivityReason + mappedBy: category lifecycleCallbacks: { } From e32dad56174b29addc50688227a00ba2b93dc097 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Thu, 1 Oct 2015 16:44:30 +0200 Subject: [PATCH 058/163] Setting an inactive category unactivate the reason - refs #622 --- Entity/ActivityReason.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Entity/ActivityReason.php b/Entity/ActivityReason.php index 8ad072039..fb196b8d9 100644 --- a/Entity/ActivityReason.php +++ b/Entity/ActivityReason.php @@ -96,7 +96,8 @@ class ActivityReason } /** - * Set category + * Set category of the reason. If you set to the reason an inactive + * category, the reason will become inactive * * @param ActivityReasonCategory $category * @@ -104,6 +105,10 @@ class ActivityReason */ public function setCategory(ActivityReasonCategory $category) { + if($this->category !== $category && ! $category->getActive()) { + $this->setActive(False); + } + $this->category = $category; return $this; From e8f8c8e52dfc61620314c236d0bbd2acac02f11e Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 2 Oct 2015 14:41:52 +0200 Subject: [PATCH 059/163] Admin form : only display active ActivityReasonCategory in the ActivityReason form --- Form/Type/TranslatableActivityReasonCategory.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Form/Type/TranslatableActivityReasonCategory.php b/Form/Type/TranslatableActivityReasonCategory.php index 83495f274..ec90c2f9f 100644 --- a/Form/Type/TranslatableActivityReasonCategory.php +++ b/Form/Type/TranslatableActivityReasonCategory.php @@ -25,6 +25,7 @@ namespace Chill\ActivityBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\HttpFoundation\RequestStack; +use Doctrine\ORM\EntityRepository; /** * Description of TranslatableActivityReasonCategory @@ -61,7 +62,11 @@ class TranslatableActivityReasonCategory extends AbstractType $resolver->setDefaults( array( 'class' => 'ChillActivityBundle:ActivityReasonCategory', - 'property' => 'name['.$locale.']' + 'property' => 'name['.$locale.']', + 'query_builder' => function (EntityRepository $er) { + return $er->createQueryBuilder('c') + ->where('c.active = true'); + } ) ); } From 4ef4a64ea65fdd088766ddd46e3a5f14592b9a6f Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 2 Oct 2015 14:55:58 +0200 Subject: [PATCH 060/163] Template for ActivityReasonCategory with translation + better looking - refs #622 --- Resources/views/ActivityReason/show.html.twig | 4 +- .../ActivityReasonCategory/index.html.twig | 42 +++++++++++-------- .../ActivityReasonCategory/show.html.twig | 16 +++---- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Resources/views/ActivityReason/show.html.twig b/Resources/views/ActivityReason/show.html.twig index 830fd466e..e9d07d5b6 100644 --- a/Resources/views/ActivityReason/show.html.twig +++ b/Resources/views/ActivityReason/show.html.twig @@ -26,14 +26,14 @@ {{ entity.name|localize_translatable_string }} - {{ 'Active' }} + {{ 'Active'|trans }} {% if entity.active %}

                                {{ 'The entity is active and will be proposed'|trans }}

                                {% else %}

                                {{ "The entity is inactive and won't be proposed"|trans }}

                                {% endif %} - + diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig index afbd867cd..43135ade8 100644 --- a/Resources/views/ActivityReasonCategory/index.html.twig +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -22,37 +22,45 @@ - - - - + + + {% for entity in entities %} - - - + + {% endfor %}
                                IdNameActiveActions{{ 'Name'|trans }}{{ 'Active'|trans }}Active{{ 'Actions'|trans }}
                                {{ entity.id }}{{ entity.name|localize_translatable_string }}{{ entity.active }} - + + {{ entity.name|localize_translatable_string }} + + + {% if entity.active %} +

                                {{ 'Active'|trans }}

                                + {% else %} +

                                {{ "Inactive"|trans }}

                                + {% endif %} +
                                +
                                -
                                  + diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig index a7fe9fa3a..162948acc 100644 --- a/Resources/views/ActivityReasonCategory/show.html.twig +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -22,16 +22,18 @@ - - - - - + - - + +
                                  Id{{ entity.id }}
                                  Name{{ 'Name'|trans }} {{ entity.name|localize_translatable_string }}
                                  Active{{ entity.active }}{{ 'Active'|trans }} + {% if entity.active %} +

                                  {{ 'The entity is active and will be proposed'|trans }}

                                  + {% else %} +

                                  {{ "The entity is inactive and won't be proposed"|trans }}

                                  + {% endif %} +
                                  From 0bee5e46dbc045cb3408bbfbcbe7dc702b9ed3c7 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 2 Oct 2015 15:16:37 +0200 Subject: [PATCH 061/163] Only active reason are displayed in the activity encoding form --- Form/Type/TranslatableActivityReason.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Form/Type/TranslatableActivityReason.php b/Form/Type/TranslatableActivityReason.php index 8ce5d42d3..f93e42d62 100644 --- a/Form/Type/TranslatableActivityReason.php +++ b/Form/Type/TranslatableActivityReason.php @@ -24,8 +24,8 @@ namespace Chill\ActivityBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; -use Symfony\Component\HttpFoundation\RequestStack; use Chill\MainBundle\Templating\TranslatableStringHelper; +use Doctrine\ORM\EntityRepository; /** * Description of TranslatableActivityReason @@ -63,6 +63,10 @@ class TranslatableActivityReason extends AbstractType }, 'group_by' => function($choice, $key) use ($helper) { return $helper->localize($choice->getCategory()->getName()); + }, + 'query_builder' => function (EntityRepository $er) { + return $er->createQueryBuilder('r') + ->where('r.active = true'); } ) ); From bebee4fbeb37db986535fd73373f39f4063d76c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 2 Oct 2015 13:57:23 +0200 Subject: [PATCH 062/163] layout and clean activity reason crud --- .../ActivityReasonCategoryController.php | 47 ------------------- Entity/ActivityReason.php | 2 +- Entity/ActivityReasonCategory.php | 2 +- Resources/translations/messages.fr.yml | 12 ++++- .../ActivityReasonCategory/edit.html.twig | 11 +++-- .../ActivityReasonCategory/index.html.twig | 34 +++++--------- .../ActivityReasonCategory/new.html.twig | 10 ++-- .../ActivityReasonCategory/show.html.twig | 17 ++++--- 8 files changed, 46 insertions(+), 89 deletions(-) diff --git a/Controller/ActivityReasonCategoryController.php b/Controller/ActivityReasonCategoryController.php index 225c52415..8374f3f3e 100644 --- a/Controller/ActivityReasonCategoryController.php +++ b/Controller/ActivityReasonCategoryController.php @@ -101,11 +101,8 @@ class ActivityReasonCategoryController extends Controller throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); } - $deleteForm = $this->createDeleteForm($id); - return $this->render('ChillActivityBundle:ActivityReasonCategory:show.html.twig', array( 'entity' => $entity, - 'delete_form' => $deleteForm->createView(), )); } @@ -124,12 +121,10 @@ class ActivityReasonCategoryController extends Controller } $editForm = $this->createEditForm($entity); - $deleteForm = $this->createDeleteForm($id); return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), )); } @@ -165,7 +160,6 @@ class ActivityReasonCategoryController extends Controller throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); } - $deleteForm = $this->createDeleteForm($id); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); @@ -178,47 +172,6 @@ class ActivityReasonCategoryController extends Controller return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), )); } - /** - * Deletes a ActivityReasonCategory entity. - * - */ - public function deleteAction(Request $request, $id) - { - $form = $this->createDeleteForm($id); - $form->handleRequest($request); - - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); - } - - $em->remove($entity); - $em->flush(); - } - - return $this->redirect($this->generateUrl('chill_activity_activityreasoncategory')); - } - - /** - * Creates a form to delete a ActivityReasonCategory entity by id. - * - * @param mixed $id The entity id - * - * @return \Symfony\Component\Form\Form The form - */ - private function createDeleteForm($id) - { - return $this->createFormBuilder() - ->setAction($this->generateUrl('chill_activity_activityreasoncategory_delete', array('id' => $id))) - ->setMethod('DELETE') - ->add('submit', 'submit', array('label' => 'Delete')) - ->getForm() - ; - } } diff --git a/Entity/ActivityReason.php b/Entity/ActivityReason.php index fb196b8d9..77eaf4029 100644 --- a/Entity/ActivityReason.php +++ b/Entity/ActivityReason.php @@ -45,7 +45,7 @@ class ActivityReason /** * @var boolean */ - private $active; + private $active = true; /** diff --git a/Entity/ActivityReasonCategory.php b/Entity/ActivityReasonCategory.php index 0106ab881..0c97d37d8 100644 --- a/Entity/ActivityReasonCategory.php +++ b/Entity/ActivityReasonCategory.php @@ -40,7 +40,7 @@ class ActivityReasonCategory /** * @var boolean */ - private $active; + private $active = true; /** @var ArrayCollection array of ActivityReason */ private $reasons; diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 549b6564c..5728aa5de 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -41,7 +41,8 @@ CHILL_ACTIVITY_SEE: Voir une activité Activity configuration menu: Configuration des activités Activity Types: Types d'activité Activity Reasons: Sujets d'une activité -Activity Reasons Category: Catégories d'activités +Activity Reasons Category: Catégories de sujet d'activités +Activity configuration: Configuration des activités # activity reason admin ActivityReason list: Liste des sujets @@ -53,3 +54,12 @@ ActivityReason edit: Modification d'un sujet ActivityReason: Sujet d'activité The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé The entity is active and will be proposed: Le sujet est actif et sera proposé + +#activity reason category admin +ActivityReasonCategory list: Catégories de sujets +Create a new activity category reason: Créer une nouvelle catégorie +ActivityReasonCategory creation: Nouvelle catégorie de sujet +ActivityReasonCategory edit: Modification d'une catégorie de sujet +ActivityReasonCategory: Catégorie de sujet d'activité +ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée +ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée diff --git a/Resources/views/ActivityReasonCategory/edit.html.twig b/Resources/views/ActivityReasonCategory/edit.html.twig index edc630cdb..2ff334b3b 100644 --- a/Resources/views/ActivityReasonCategory/edit.html.twig +++ b/Resources/views/ActivityReasonCategory/edit.html.twig @@ -17,16 +17,19 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityReasonCategory edit

                                  +

                                  {{ 'ActivityReasonCategory edit'|trans }}

                                  - {{ form(edit_form) }} + {{ form_start(edit_form) }} + {{ form_row(edit_form.name) }} + {{ form_row(edit_form.active) }} + {{ form_row(edit_form.submit, { 'attr': { 'class': 'sc-button orange' } } ) }} + {{ form_end(edit_form) }} {% endblock %} diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/Resources/views/ActivityReasonCategory/index.html.twig index 43135ade8..606d17b72 100644 --- a/Resources/views/ActivityReasonCategory/index.html.twig +++ b/Resources/views/ActivityReasonCategory/index.html.twig @@ -17,40 +17,28 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityReasonCategory list

                                  +

                                  {{ 'ActivityReasonCategory list'|trans }}

                                  - {% for entity in entities %} + - - {% endfor %} @@ -60,7 +48,7 @@ diff --git a/Resources/views/ActivityReasonCategory/new.html.twig b/Resources/views/ActivityReasonCategory/new.html.twig index 4e4c348da..8f90f8909 100644 --- a/Resources/views/ActivityReasonCategory/new.html.twig +++ b/Resources/views/ActivityReasonCategory/new.html.twig @@ -17,14 +17,18 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityReasonCategory creation

                                  +

                                  {{ 'ActivityReasonCategory creation'|trans }}

                                  - {{ form(form) }} + {{ form_start(form) }} + {{ form_row(form.name) }} + {{ form_row(form.active) }} + {{ form_widget(form.submit, { 'attr': { 'class' : 'sc-button blue' } } ) }} +

                                  {{ form_end(form) }}

                                  diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/Resources/views/ActivityReasonCategory/show.html.twig index 162948acc..37fbffe3a 100644 --- a/Resources/views/ActivityReasonCategory/show.html.twig +++ b/Resources/views/ActivityReasonCategory/show.html.twig @@ -17,7 +17,7 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityReasonCategory

                                  +

                                  {{ 'ActivityReasonCategory'|trans }}

                                  {{ 'Name'|trans }}{{ 'Active'|trans }}Active {{ 'Actions'|trans }}
                                  {{ entity.name|localize_translatable_string }} - - {{ entity.name|localize_translatable_string }} - - - {% if entity.active %} -

                                  {{ 'Active'|trans }}

                                  - {% else %} -

                                  {{ "Inactive"|trans }}

                                  - {% endif %} -
                                  - +
                                  @@ -28,11 +28,11 @@ @@ -41,14 +41,13 @@ {% endblock %} From 216d0c55be8c497c10d5d1ee6d26d0c0bfdfa1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 2 Oct 2015 23:04:56 +0200 Subject: [PATCH 063/163] remove delete actions & form in controller --- Controller/ActivityReasonController.php | 51 +------------------------ 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/Controller/ActivityReasonController.php b/Controller/ActivityReasonController.php index c2093be87..1f9d3cd69 100644 --- a/Controller/ActivityReasonController.php +++ b/Controller/ActivityReasonController.php @@ -101,11 +101,8 @@ class ActivityReasonController extends Controller throw $this->createNotFoundException('Unable to find ActivityReason entity.'); } - $deleteForm = $this->createDeleteForm($id); - return $this->render('ChillActivityBundle:ActivityReason:show.html.twig', array( 'entity' => $entity, - 'delete_form' => $deleteForm->createView(), )); } @@ -124,12 +121,10 @@ class ActivityReasonController extends Controller } $editForm = $this->createEditForm($entity); - $deleteForm = $this->createDeleteForm($id); return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array( 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm->createView() )); } @@ -165,7 +160,6 @@ class ActivityReasonController extends Controller throw $this->createNotFoundException('Unable to find ActivityReason entity.'); } - $deleteForm = $this->createDeleteForm($id); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); @@ -177,48 +171,7 @@ class ActivityReasonController extends Controller return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array( 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm->createView() )); } - /** - * Deletes a ActivityReason entity. - * - */ - public function deleteAction(Request $request, $id) - { - $form = $this->createDeleteForm($id); - $form->handleRequest($request); - - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find ActivityReason entity.'); - } - - $em->remove($entity); - $em->flush(); - } - - return $this->redirect($this->generateUrl('chill_activity_activityreason')); - } - - /** - * Creates a form to delete a ActivityReason entity by id. - * - * @param mixed $id The entity id - * - * @return \Symfony\Component\Form\Form The form - */ - private function createDeleteForm($id) - { - return $this->createFormBuilder() - ->setAction($this->generateUrl('chill_activity_activityreason_delete', array('id' => $id))) - ->setMethod('DELETE') - ->add('submit', 'submit', array('label' => 'Delete')) - ->getForm() - ; - } } From 795c1a74ed5fed27ced5b28d27d7e24712f253d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 2 Oct 2015 23:25:49 +0200 Subject: [PATCH 064/163] layout and clean activity type CRUD --- Controller/ActivityTypeController.php | 51 +------------------- Resources/translations/messages.fr.yml | 7 +++ Resources/views/ActivityType/edit.html.twig | 10 ++-- Resources/views/ActivityType/index.html.twig | 16 +++--- Resources/views/ActivityType/new.html.twig | 9 ++-- Resources/views/ActivityType/show.html.twig | 13 ++--- 6 files changed, 32 insertions(+), 74 deletions(-) diff --git a/Controller/ActivityTypeController.php b/Controller/ActivityTypeController.php index 308f698ec..0c61040b8 100644 --- a/Controller/ActivityTypeController.php +++ b/Controller/ActivityTypeController.php @@ -101,11 +101,8 @@ class ActivityTypeController extends Controller throw $this->createNotFoundException('Unable to find ActivityType entity.'); } - $deleteForm = $this->createDeleteForm($id); - return $this->render('ChillActivityBundle:ActivityType:show.html.twig', array( 'entity' => $entity, - 'delete_form' => $deleteForm->createView(), )); } @@ -124,12 +121,10 @@ class ActivityTypeController extends Controller } $editForm = $this->createEditForm($entity); - $deleteForm = $this->createDeleteForm($id); return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array( 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm->createView() )); } @@ -164,8 +159,7 @@ class ActivityTypeController extends Controller if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityType entity.'); } - - $deleteForm = $this->createDeleteForm($id); + $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); @@ -178,47 +172,6 @@ class ActivityTypeController extends Controller return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), )); } - /** - * Deletes a ActivityType entity. - * - */ - public function deleteAction(Request $request, $id) - { - $form = $this->createDeleteForm($id); - $form->handleRequest($request); - - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find ActivityType entity.'); - } - - $em->remove($entity); - $em->flush(); - } - - return $this->redirect($this->generateUrl('chill_activity_activitytype')); - } - - /** - * Creates a form to delete a ActivityType entity by id. - * - * @param mixed $id The entity id - * - * @return \Symfony\Component\Form\Form The form - */ - private function createDeleteForm($id) - { - return $this->createFormBuilder() - ->setAction($this->generateUrl('chill_activity_activitytype_delete', array('id' => $id))) - ->setMethod('DELETE') - ->add('submit', 'submit', array('label' => 'Delete')) - ->getForm() - ; - } } diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 5728aa5de..0d4086327 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -63,3 +63,10 @@ ActivityReasonCategory edit: Modification d'une catégorie de sujet ActivityReasonCategory: Catégorie de sujet d'activité ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée + +# activity type admin +ActivityType list: Types d'activités +Create a new activity type: Créer un nouveau type d'activité +ActivityType creation: Nouveau type d'activité +ActivityType: Type d'activité +ActivityType edit: Modifier une activité \ No newline at end of file diff --git a/Resources/views/ActivityType/edit.html.twig b/Resources/views/ActivityType/edit.html.twig index 6d6d7660b..124e41065 100644 --- a/Resources/views/ActivityType/edit.html.twig +++ b/Resources/views/ActivityType/edit.html.twig @@ -17,16 +17,18 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityType edit

                                  +

                                  {{ 'ActivityType edit'|trans }}

                                  - {{ form(edit_form) }} + {{ form_start(edit_form) }} + {{ form_row(edit_form.name) }} + {{ form_row(edit_form.submit, { 'attr' : { 'class' : 'sc-button orange' } } ) }} + {{ form_end(edit_form) }} {% endblock %} diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig index 5ade83943..e1b714888 100644 --- a/Resources/views/ActivityType/index.html.twig +++ b/Resources/views/ActivityType/index.html.twig @@ -17,28 +17,26 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityType list

                                  +

                                  {{ 'ActivityType list'|trans }}

                                  {{ 'Active'|trans }} - {% if entity.active %} -

                                  {{ 'The entity is active and will be proposed'|trans }}

                                  - {% else %} -

                                  {{ "The entity is inactive and won't be proposed"|trans }}

                                  - {% endif %} + {%- if entity.active -%} + {{ 'ActivityReasonCategory is active and will be proposed'|trans }} + {%- else -%} + {{ "ActivityReasonCategory is inactive and won't be proposed"|trans }} + {%- endif -%}
                                  - - - + + {% for entity in entities %} - - + @@ -50,7 +48,7 @@ diff --git a/Resources/views/ActivityType/new.html.twig b/Resources/views/ActivityType/new.html.twig index 3310cd011..0b1f17829 100644 --- a/Resources/views/ActivityType/new.html.twig +++ b/Resources/views/ActivityType/new.html.twig @@ -17,14 +17,17 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityType creation

                                  +

                                  {{ 'ActivityType creation'|trans }}

                                  - {{ form(form) }} + {{ form_start(form) }} + {{ form_row(form.name) }} + {{ form_row(form.submit, { 'attr' : { 'class' : 'sc-button blue' } } ) }} + {{ form_end(form) }} diff --git a/Resources/views/ActivityType/show.html.twig b/Resources/views/ActivityType/show.html.twig index 9d100684d..6e4e656be 100644 --- a/Resources/views/ActivityType/show.html.twig +++ b/Resources/views/ActivityType/show.html.twig @@ -17,16 +17,12 @@ {% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %} {% block admin_content %} -

                                  ActivityType

                                  +

                                  {{ 'ActivityType'|trans }}

                                  IdNameActions{{ 'Name'|trans }}{{ 'Actions'|trans }}
                                  {{ entity.id }}{{ entity.name|localize_translatable_string }}{{ entity.name|localize_translatable_string }}
                                  - - - - - + @@ -35,14 +31,13 @@ {% endblock %} From 22afd3b3fa2a6a2a1fbf63f4ec380edeace910a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 2 Oct 2015 23:40:06 +0200 Subject: [PATCH 065/163] fix bug in redirection to admin index --- Controller/AdminController.php | 5 +++++ Resources/config/routing.yml | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Controller/AdminController.php b/Controller/AdminController.php index bf543ae0a..313f36c4f 100644 --- a/Controller/AdminController.php +++ b/Controller/AdminController.php @@ -35,4 +35,9 @@ class AdminController extends Controller { return $this->render('ChillActivityBundle:Admin:layout_activity.html.twig'); } + + public function redirectToAdminIndexAction() + { + return $this->redirectToRoute('chill_main_admin_central'); + } } diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 5eaf6124a..1912e0222 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -23,12 +23,10 @@ chill_admin_activity_index: label: Activity configuration order: 2000 -chill_admin_activity_back_to_admin: - path: /{_locale}/admin/activity_back_to_main +chill_admin_activity_redirect_to_admin_index: + path: /{_locale}/admin/activity_redirect_to_main defaults: - _controller: FrameworkBundle:Redirect:urlRedirect - path: /{_locale}/admin - permanent: true + _controller: ChillActivityBundle:Admin:redirectToAdminIndex options: menus: admin_activity: From 8eccbea522b8a73c1d90107ebd40e45accc02572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 8 Oct 2015 15:41:23 +0200 Subject: [PATCH 066/163] fix address for storing doctrineMigrationsFile into correct directory for tests --- .gitignore | 1 + composer.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bd3f24341..4b827b7fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /vendor/ composer.lock Tests/Fixtures/App/app/DoctrineMigrations/* +Test/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/cache/* Test/Fixtures/App/app/config/parameters.yml diff --git a/composer.json b/composer.json index e0cdd2e3a..5c82b5f1a 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,6 @@ ] }, "extra": { - "app-migrations-dir": "Tests/Fixtures/App/app/DoctrineMigrations" + "app-migrations-dir": "Test/Fixtures/App/app/DoctrineMigrations" } } From 2e1153d42b4bbefdbc84c3299886063851fe73ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 8 Oct 2015 15:43:26 +0200 Subject: [PATCH 067/163] add parameters for gitlab-ci --- Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist diff --git a/Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist b/Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist new file mode 100644 index 000000000..f734a35c7 --- /dev/null +++ b/Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist @@ -0,0 +1,7 @@ +parameters: + database_host: 127.0.0.1 + database_port: 5432 + database_name: postgres + database_user: postgres + database_password: postgres + locale: fr From fa5da95bf160c8658d956a8390cc656a1b212730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 8 Oct 2015 17:21:48 +0200 Subject: [PATCH 068/163] first impl on test on TranslatableActivityReasonType Currently skipped due to the amount of work required and the expectance refs #651 --- .../Type/TranslatableActivityReasonTest.php | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 Tests/Form/Type/TranslatableActivityReasonTest.php diff --git a/Tests/Form/Type/TranslatableActivityReasonTest.php b/Tests/Form/Type/TranslatableActivityReasonTest.php new file mode 100644 index 000000000..59812009e --- /dev/null +++ b/Tests/Form/Type/TranslatableActivityReasonTest.php @@ -0,0 +1,110 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Form\Type; + +use Symfony\Component\Form\Test\TypeTestCase; +use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Component\Form\PreloadedExtension; + +/** + * Test translatableActivityReason + * + * @author Julien Fastré + * @author Champs Libres + */ +class TranslatableActivityReasonTest extends TypeTestCase +{ + /** + * + * @var Prophecy\Prophet + */ + private static $prophet; + + public function setUp() + { + parent::setUp(); + + + } + + protected function getExtensions() + { + $entityType = $this->getEntityType(); + + return array(new PreloadedExtension(array( + 'entity' => $entityType + ), array())); + } + + + public function testSimple() + { + $translatableActivityReasonType = new TranslatableActivityReason( + $this->getTranslatableStringHelper() + ); + + $this->markTestSkipped("See issue 651"); + } + + /** + * + * @param string $locale + * @param string $fallbackLocale + * @return TranslatableStringHelper + */ + protected function getTranslatableStringHelper($locale = 'en', + $fallbackLocale = 'en') + { + $prophet = new \Prophecy\Prophet; + $requestStack = $prophet->prophesize(); + $request = $prophet->prophesize(); + $translator = $prophet->prophesize(); + + $request->willExtend('Symfony\Component\HttpFoundation\Request'); + $request->getLocale()->willReturn($fallbackLocale); + + $requestStack->willExtend('Symfony\Component\HttpFoundation\RequestStack'); + $requestStack->getCurrentRequest()->will(function () use ($request) { + return $request; + }); + + $translator->willExtend('Symfony\Component\Translation\Translator'); + $translator->getFallbackLocales()->willReturn($locale); + + return new TranslatableStringHelper($requestStack->reveal(), + $translator->reveal()); + + } + + /** + * + * @return \Symfony\Bridge\Doctrine\Form\Type\EntityType + */ + protected function getEntityType() + { + $managerRegistry = (new \Prophecy\Prophet())->prophesize(); + + $managerRegistry->willImplement('Doctrine\Common\Persistence\ManagerRegistry'); + + return new \Symfony\Bridge\Doctrine\Form\Type\EntityType($managerRegistry->reveal()); + } +} From e79ca23f2ce79687a5c782b67f5da208df344dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 8 Oct 2015 18:24:25 +0200 Subject: [PATCH 069/163] add test for complete activity crud (without errors) + fix some errors in controller (discovered with tests) --- Controller/ActivityController.php | 6 ++ Test/Fixtures/App/app/config/config.yml | 1 + Tests/Controller/ActivityControllerTest.php | 112 +++++++++++++++----- 3 files changed, 92 insertions(+), 27 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 7ff2e78ea..0a74497f9 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -44,6 +44,12 @@ class ActivityController extends Controller $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); + if ($person === NULL) { + throw $this->createNotFoundException('Person not found'); + } + + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + $reachableScopes = $this->get('chill.main.security.authorization.helper') ->getReachableScopes($this->getUser(), new Role('CHILL_ACTIVITY_SEE'), $person->getCenter()); diff --git a/Test/Fixtures/App/app/config/config.yml b/Test/Fixtures/App/app/config/config.yml index 971fe37b6..d799db6f8 100644 --- a/Test/Fixtures/App/app/config/config.yml +++ b/Test/Fixtures/App/app/config/config.yml @@ -67,6 +67,7 @@ security: intention: authenticate csrf_provider: form.csrf_provider logout: ~ + http_basic: access_control: #disable authentication for tests #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php index 6fd1dd06e..f3587f443 100644 --- a/Tests/Controller/ActivityControllerTest.php +++ b/Tests/Controller/ActivityControllerTest.php @@ -6,55 +6,113 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class ActivityControllerTest extends WebTestCase { - public function testToWrite() + + public function testAccessIsDeniedForUnauthenticated() { - $this->markTestSkipped(); + $client = $this->createClient(); + + $crawler = $client->request('GET', sprintf('fr/person/%d/activity/', + $this->getPersonFromFixtures()->getId())); + + $this->assertTrue($client->getResponse()->isRedirect('http://localhost/login'), + 'the page does not redirect to http://localhost/login'); } - /* public function testCompleteScenario() { // Create a new client to browse the application - $client = static::createClient(); + $client = $this->getAuthenticatedClient(); + $person = $this->getPersonFromFixtures(); // Create a new entry in the database - $crawler = $client->request('GET', '/activity/'); - $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activity/"); - $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + $crawler = $client->request('GET', sprintf('en/person/%d/activity/', + $person->getId())); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), + "Unexpected HTTP status code for GET /activity/"); + $crawler = $client->click($crawler->selectLink('Ajouter une nouvelle activité') + ->link()); // Fill in the form and submit it - $form = $crawler->selectButton('Create')->form(array( - 'chill_activitybundle_activity[field_name]' => 'Test', - // ... other fields to fill + $form = $crawler->selectButton('Ajouter une nouvelle activité')->form(array( + 'chill_activitybundle_activity'=> array( + 'date' => '15-01-2015', + 'durationTime' => array( + 'hour' => '1', + 'minute' => '30' + ), + 'remark' => 'blabla', + 'scope' => 1, + 'reason' => 2, + 'type' => 3 + ) )); $client->submit($form); + + $this->assertTrue($client->getResponse()->isRedirect()); $crawler = $client->followRedirect(); // Check data in the show view - $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + $this->assertGreaterThan(0, $crawler->filter('dd:contains("January 15, 2015")')->count(), + 'Missing element dd:contains("January 15, 2015")'); // Edit the entity - $crawler = $client->click($crawler->selectLink('Edit')->link()); - - $form = $crawler->selectButton('Update')->form(array( - 'chill_activitybundle_activity[field_name]' => 'Foo', - // ... other fields to fill + $crawler = $client->click($crawler->selectLink("Modifier l'activité")->link()); + + $form = $crawler->selectButton("Sauver l'activité")->form(array( + 'chill_activitybundle_activity' => array( + 'date' => '25-01-2015', + 'remark' => 'Foo' + ) )); $client->submit($form); + + $this->assertTrue($client->getResponse()->isRedirect()); + $crawler = $client->followRedirect(); - - // Check the element contains an attribute with value equals "Foo" - $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); - - // Delete the entity - $client->submit($crawler->selectButton('Delete')->form()); - $crawler = $client->followRedirect(); - - // Check the entity has been delete on the list - $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + + // check that new data are present + $this->assertGreaterThan(0, + $crawler->filter('dd:contains("January 25, 2015")')->count(), + 'Missing element dd:contains("January 25, 2015")'); + $this->assertGreaterThan(0, + $crawler->filter('dd:contains("Foo")')->count(), + 'Missing element dd:contains("Foo")'); } - */ + /** + * + * @return \Symfony\Component\BrowserKit\Client + */ + private function getAuthenticatedClient() + { + return static::createClient(array(), array( + 'PHP_AUTH_USER' => 'center a_social', + 'PHP_AUTH_PW' => 'password', + )); + } + + /** + * + * @return \Chill\PersonBundle\Entity\Person + */ + private function getPersonFromFixtures() + { + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager'); + + $person = $em->getRepository('ChillPersonBundle:Person') + ->findOneBy(array( + 'firstName' => 'Depardieu', + 'lastName' => 'Gérard' + )); + + if ($person === NULL) { + throw new \RuntimeException("We need a person with firstname Gérard and" + . " lastname Depardieu. Did you add fixtures ?"); + } + + return $person; + } } From fee5b00e35f811ee8698049fd79dc866f7307172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 8 Oct 2015 22:36:08 +0200 Subject: [PATCH 070/163] use random activityType, activityReason, scope in test --- Tests/Controller/ActivityControllerTest.php | 66 ++++++++++++++++++++- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php index f3587f443..517366ceb 100644 --- a/Tests/Controller/ActivityControllerTest.php +++ b/Tests/Controller/ActivityControllerTest.php @@ -3,6 +3,7 @@ namespace Chill\ActivityBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; +use Symfony\Component\Security\Core\Role\Role; class ActivityControllerTest extends WebTestCase { @@ -41,9 +42,9 @@ class ActivityControllerTest extends WebTestCase 'minute' => '30' ), 'remark' => 'blabla', - 'scope' => 1, - 'reason' => 2, - 'type' => 3 + 'scope' => $this->getRandomScope('center a_social', 'Center A')->getId(), + 'reason' => $this->getRandomActivityReason()->getId(), + 'type' => $this->getRandomActivityType()->getId() ) )); @@ -115,4 +116,63 @@ class ActivityControllerTest extends WebTestCase return $person; } + + /** + * + * @param string $username + * @param string $centerName + * @return \Chill\MainBundle\Entity\Scope + */ + private function getRandomScope($username, $centerName) + { + $user = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('ChillMainBundle:User') + ->findOneByUsername($username); + + if ($user === NULL) { + throw new \RuntimeException("The user with username $username " + . "does not exists in database. Did you add fixtures ?"); + } + + $center = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('ChillMainBundle:Center') + ->findOneByName($centerName); + + $reachableScopes = static::$kernel->getContainer() + ->get('chill.main.security.authorization.helper') + ->getReachableScopes($user, new Role('CHILL_ACTIVITY_UPDATE'), + $center); + + return $reachableScopes[array_rand($reachableScopes)]; + } + + /** + * + * @return \Chill\ActivityBundle\Entity\ActivityReason + */ + private function getRandomActivityReason() + { + $reasons = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('ChillActivityBundle:ActivityReason') + ->findAll(); + + return $reasons[array_rand($reasons)]; + } + + /** + * + * @return \Chill\ActivityBundle\Entity\ActivityType + */ + private function getRandomActivityType() + { + $types = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('ChillActivityBundle:ActivityType') + ->findAll(); + + return $types[array_rand($types)]; + } } From 8e75f0b4aca13e2c034d86e14010a3c26f3ab0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 26 Oct 2015 20:46:59 +0100 Subject: [PATCH 071/163] adding gitlab-ci to project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Squashed commit of the following: commit 7de95e8e1e829f2ebeeb0bcea750e9fd2cdfa4b4 Author: Julien Fastré Date: Mon Oct 19 23:40:01 2015 +0200 adapting config for build commit c554816956ee1d0f0144824392a5f5984b389d1a Author: Julien Fastré Date: Mon Oct 19 22:42:39 2015 +0200 add gitlab-ci to project --- .gitlab-ci.yml | 17 ++++++++ Test/Fixtures/App/app/AppKernel.php | 40 +++++++++++-------- ...itlab-ci.dist => parameters.gitlab-ci.yml} | 2 +- 3 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 .gitlab-ci.yml rename Test/Fixtures/App/app/config/{parameters.yml.gitlab-ci.dist => parameters.gitlab-ci.yml} (79%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..02ac74a1a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +services: + - chill/database:latest + +before_script: + - export GITHUB_COMPOSER_AUTH=$GITHUB_TOKEN + - composer install --no-interaction + - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml +# - php Test/Fixtures/App/app/console --env=test cache:warmup + - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction + - php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction + +test:php-5.6: + stage: test + script: phpunit --testdox +test:php-7: + stage: test + script: phpunit --testdox diff --git a/Test/Fixtures/App/app/AppKernel.php b/Test/Fixtures/App/app/AppKernel.php index 4cf584f1d..d639d79d5 100644 --- a/Test/Fixtures/App/app/AppKernel.php +++ b/Test/Fixtures/App/app/AppKernel.php @@ -7,33 +7,41 @@ class AppKernel extends Kernel { public function registerBundles() { - $bundles = array( + return array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), + new Chill\CustomFieldsBundle\ChillCustomFieldsBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), - new Symfony\Bundle\MonologBundle\MonologBundle(), - new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), - new Symfony\Bundle\AsseticBundle\AsseticBundle(), + new \Symfony\Bundle\AsseticBundle\AsseticBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), - new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), - new Chill\MainBundle\ChillMainBundle(), - new Chill\CustomFieldsBundle\ChillCustomFieldsBundle(), new Chill\PersonBundle\ChillPersonBundle(), + new Chill\MainBundle\ChillMainBundle(), new Chill\ActivityBundle\ChillActivityBundle(), + new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), + new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), + new Symfony\Bundle\MonologBundle\MonologBundle(), + #add here all the required bundle (some bundle are not required) ); - - if (in_array($this->getEnvironment(), array('dev', 'test'))) { - $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); - $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); - $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); - $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); - } - - return $bundles; } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); } + + /** + * @return string + */ + public function getCacheDir() + { + return sys_get_temp_dir().'/ActivityBundle/cache'; + } + + /** + * @return string + */ + public function getLogDir() + { + return sys_get_temp_dir().'/ActivityBundle/logs'; + } } diff --git a/Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist b/Test/Fixtures/App/app/config/parameters.gitlab-ci.yml similarity index 79% rename from Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist rename to Test/Fixtures/App/app/config/parameters.gitlab-ci.yml index f734a35c7..9e3b75daf 100644 --- a/Test/Fixtures/App/app/config/parameters.yml.gitlab-ci.dist +++ b/Test/Fixtures/App/app/config/parameters.gitlab-ci.yml @@ -1,5 +1,5 @@ parameters: - database_host: 127.0.0.1 + database_host: chill__database database_port: 5432 database_name: postgres database_user: postgres From 7ce86ab15fde228ff4cad447539d80756f93d5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 26 Oct 2015 22:26:41 +0100 Subject: [PATCH 072/163] use github token for auth --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02ac74a1a..d8d62a688 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ services: - chill/database:latest before_script: - - export GITHUB_COMPOSER_AUTH=$GITHUB_TOKEN + - composer config github-oauth.github.com $GITHUB_TOKEN - composer install --no-interaction - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml # - php Test/Fixtures/App/app/console --env=test cache:warmup @@ -14,4 +14,4 @@ test:php-5.6: script: phpunit --testdox test:php-7: stage: test - script: phpunit --testdox + script: phpunit --testdox \ No newline at end of file From fc8c01815932a6a5b7ff245fa6b49722f43cef2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 27 Oct 2015 21:11:26 +0100 Subject: [PATCH 073/163] add tests for authentication/authorization Check the user which access to creation, modification, list, is authorized to see the user and have the permissions on activity. --- Controller/ActivityController.php | 2 + Tests/Controller/ActivityControllerTest.php | 154 +++++++++++++++++++- 2 files changed, 148 insertions(+), 8 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 0a74497f9..3c8cf7906 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -160,6 +160,8 @@ class ActivityController extends Controller $entity->setPerson($person); $entity->setDate(new \DateTime('now')); + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity); + $form = $this->createCreateForm($entity, $person); return $this->render('ChillActivityBundle:Activity:new.html.twig', array( diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php index 517366ceb..780bdef00 100644 --- a/Tests/Controller/ActivityControllerTest.php +++ b/Tests/Controller/ActivityControllerTest.php @@ -4,21 +4,95 @@ namespace Chill\ActivityBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\Security\Core\Role\Role; +use Symfony\Component\HttpFoundation\Response; class ActivityControllerTest extends WebTestCase { - public function testAccessIsDeniedForUnauthenticated() + /** + * @dataProvider getSecuredPagesUnauthenticated + */ + public function testAccessIsDeniedForUnauthenticated($url) { $client = $this->createClient(); - - $crawler = $client->request('GET', sprintf('fr/person/%d/activity/', - $this->getPersonFromFixtures()->getId())); - + + $client->request('GET', $url); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertTrue($client->getResponse()->isRedirect('http://localhost/login'), - 'the page does not redirect to http://localhost/login'); + sprintf('the page "%s" does not redirect to http://localhost/login', $url)); } + /** + * + * @dataProvider getSecuredPagesAuthenticated + * @param type $client + * @param type $url + */ + public function testAccessIsDeniedForUnauthorized($client, $url) + { + $client->request('GET', $url); + + $this->assertEquals(403, $client->getResponse()->getStatusCode()); + } + + public function getSecuredPagesAuthenticated() + { + static::bootKernel(); + + $person = $this->getPersonFromFixtures(); + $activities = $this->getActivitiesForPerson($person); + + + $user = $this->createFakeUser(); + + + + return array( + array( + $this->getAuthenticatedClient('center b_social'), + sprintf('fr/person/%d/activity/', $person->getId()) + ), + array( + $this->getAuthenticatedClient('center b_social'), + sprintf('fr/person/%d/activity/new', $person->getId()) + ), + array( + $this->getAuthenticatedClient('center b_social'), + sprintf('fr/person/%d/activity/%d/show', $person->getId(), $activities[0]->getId()) + ), + array( + $this->getAuthenticatedClient('center b_social'), + sprintf('fr/person/%d/activity/%d/edit', $person->getId(), $activities[0]->getId()) + ), + array( + $this->getAuthenticatedClient($user->getUsername()), + sprintf('fr/person/%d/activity/new', $person->getId()) + ) + ); + } + + + + /** + * Provide a client unauthenticated and + * + */ + public function getSecuredPagesUnauthenticated() + { + static::bootKernel(); + $person = $this->getPersonFromFixtures(); + $activities = $this->getActivitiesForPerson($person); + + return array( + [ sprintf('fr/person/%d/activity/', $person->getId()) ], + [ sprintf('fr/person/%d/activity/new', $person->getId()) ], + [ sprintf('fr/person/%d/activity/%d/show', $person->getId(), $activities[0]->getId()) ], + [ sprintf('fr/person/%d/activity/%d/edit', $person->getId(), $activities[0]->getId()) ], + ); + } + + public function testCompleteScenario() { // Create a new client to browse the application @@ -86,10 +160,10 @@ class ActivityControllerTest extends WebTestCase * * @return \Symfony\Component\BrowserKit\Client */ - private function getAuthenticatedClient() + private function getAuthenticatedClient($username = 'center a_social') { return static::createClient(array(), array( - 'PHP_AUTH_USER' => 'center a_social', + 'PHP_AUTH_USER' => $username, 'PHP_AUTH_PW' => 'password', )); } @@ -117,6 +191,22 @@ class ActivityControllerTest extends WebTestCase return $person; } + private function getActivitiesForPerson(\Chill\PersonBundle\Entity\Person $person) + { + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager'); + + $activities = $em->getRepository('ChillActivityBundle:Activity') + ->findBy(array('person' => $person)); + + if (count($activities) === 0) { + throw new \RuntimeException("We need activities associated with this " + . "person. Did you forget to add fixtures ?"); + } + + return $activities; + } + /** * * @param string $username @@ -175,4 +265,52 @@ class ActivityControllerTest extends WebTestCase return $types[array_rand($types)]; } + + /** + * create a user without any permissions on CHILL_ACTIVITY_* but with + * permissions on center. + * + * @return \Chill\MainBundle\Entity\User a fake user within a group without activity + */ + private function createFakeUser() + { + $container = static::$kernel->getContainer(); + $em = $container->get('doctrine.orm.entity_manager'); + + //get the social PermissionGroup, and remove CHILL_ACTIVITY_* + $socialPermissionGroup = $em + ->getRepository('ChillMainBundle:PermissionsGroup') + ->findOneByName('social'); + $withoutActivityPermissionGroup = (new \Chill\MainBundle\Entity\PermissionsGroup()) + ->setName('social without activity'); + //copy role scopes where ACTIVITY is not present + foreach ($socialPermissionGroup->getRoleScopes() as $roleScope) { + if (!strpos($roleScope->getRole(), 'ACTIVITY')) { + $withoutActivityPermissionGroup->addRoleScope($roleScope); + } + } + //create groupCenter + $groupCenter = new \Chill\MainBundle\Entity\GroupCenter(); + $groupCenter->setCenter($em->getRepository('ChillMainBundle:Center') + ->findOneBy(array('name' => 'Center A'))) + ->setPermissionsGroup($withoutActivityPermissionGroup); + $em->persist($withoutActivityPermissionGroup); + $em->persist($groupCenter); + + //create user + $faker = \Faker\Factory::create(); + $username = $faker->name; + $user = new \Chill\MainBundle\Entity\User(); + $user + ->setPassword($container->get('security.password_encoder') + ->encodePassword($user, 'password')) + ->setUsername($username) + ->addGroupCenter($groupCenter); + + $em->persist($user); + + $em->flush(); + + return $user; + } } From abbcf50fcc6ddede0e6359e0c05d1dc90a337416 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 30 Oct 2015 10:21:12 +0100 Subject: [PATCH 074/163] Admin activity on Admin Section menu --- Resources/config/routing.yml | 7 ++++--- Resources/views/Admin/layout_activity.html.twig | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 1912e0222..12f84465f 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -13,16 +13,17 @@ chill_activity_activityreasoncategory: chill_activity_activitytype: resource: "@ChillActivityBundle/Resources/config/routing/activitytype.yml" prefix: / - + chill_admin_activity_index: path: /{_locale}/admin/activity defaults: { _controller: ChillActivityBundle:Admin:indexActivity } options: menus: - admin: + admin_section: label: Activity configuration order: 2000 - + icons: [tag] + chill_admin_activity_redirect_to_admin_index: path: /{_locale}/admin/activity_redirect_to_main defaults: diff --git a/Resources/views/Admin/layout_activity.html.twig b/Resources/views/Admin/layout_activity.html.twig index 6392d751a..1fb3e6f80 100644 --- a/Resources/views/Admin/layout_activity.html.twig +++ b/Resources/views/Admin/layout_activity.html.twig @@ -16,7 +16,7 @@ * along with this program. If not, see . #} -{% extends "ChillMainBundle::layoutWithVerticalMenu.html.twig" %} +{% extends "ChillMainBundle::Admin/layoutWithVerticalMenu.html.twig" %} {% block vertical_menu_content %} {{ chill_menu('admin_activity', { From 8c979c30804d95950e37824dcc6bbd2163146e20 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 30 Oct 2015 15:54:44 +0100 Subject: [PATCH 075/163] Removing old issue tracker information --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3836e2034..aaf1f7e08 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Activity + The bundle for recording activities +Documentation & installation +============================ -Issue tracker : https://redmine.champs-libres.coop/projects/activity/issues - -Documentation: http://docs.chill.social +Read documentation here : http://chill.readthedocs.org \ No newline at end of file From 508b933ab904271d59b9596b86cf215155da264a Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 4 Dec 2015 19:30:35 +0100 Subject: [PATCH 076/163] Improving UI --- Resources/views/Activity/list.html.twig | 6 +++--- Resources/views/Activity/new.html.twig | 2 +- Resources/views/Activity/show.html.twig | 10 ++-------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index 0cd6a5008..9bed49ec5 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -40,10 +40,10 @@ {% endfor %} @@ -51,7 +51,7 @@
                                  Id{{ entity.id }}
                                  Name{{ 'Name'|trans }} {{ entity.name|localize_translatable_string }}
                                  {{ activity.reason.name | localize_translatable_string }} {{ activity.type.name | localize_translatable_string }} - {{ 'Show the activity' | trans }} + {{ 'Show' | trans }} - {{ 'Edit the activity' | trans }} + {{ 'Edit' | trans }}

                                  - + {{ 'Add a new activity' | trans }}

                                  diff --git a/Resources/views/Activity/new.html.twig b/Resources/views/Activity/new.html.twig index 4e55698a0..dbea1350c 100644 --- a/Resources/views/Activity/new.html.twig +++ b/Resources/views/Activity/new.html.twig @@ -21,7 +21,7 @@ {% block title %}{{ 'Activity create' |trans }}{% endblock title %} {% block personcontent %} -

                                  {{ "Activity creation"|trans }}

                                  +

                                  {{ "Activity creation"|trans }}

                                  {{ form_start(form) }} diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 1be4948d9..1e282778e 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -3,11 +3,7 @@ {% set activeRouteKey = 'chill_activity_activity_list' %} {% block personcontent -%} -

                                  {{ "Activity"|trans }}

                                  - - - {{ 'Edit the activity'|trans }} - +

                                  {{ "Activity"|trans }}

                                  {{ 'Person'|trans }}
                                  @@ -34,9 +30,7 @@
                                  - + {{ 'Edit the activity'|trans }} - - {# {{ form(delete_form) }} #} {% endblock personcontent %} From 65e7a130c51421ec3e2e7a268fc59f842ec3253a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Dec 2015 21:55:19 +0100 Subject: [PATCH 077/163] adapt config for test to symfony 2.8 replace intention by 'csrf_token_id' in security part --- Test/Fixtures/App/app/config/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test/Fixtures/App/app/config/config.yml b/Test/Fixtures/App/app/config/config.yml index d799db6f8..be6e8f94e 100644 --- a/Test/Fixtures/App/app/config/config.yml +++ b/Test/Fixtures/App/app/config/config.yml @@ -64,7 +64,7 @@ security: anonymous: ~ form_login: csrf_parameter: _csrf_token - intention: authenticate + csrf_token_id: authenticate csrf_provider: form.csrf_provider logout: ~ http_basic: From 3c65e2d58546d33d27a8a85de101c57bdc233a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 2 Jan 2016 16:47:55 +0100 Subject: [PATCH 078/163] [export] add an export 'count activity' and first filters - reason aggregator - reason filter - count activity export --- Export/Aggregator/ReasonAggregator.php | 88 ++++++++++++++++++++++++ Export/Export/CountActivity.php | 77 +++++++++++++++++++++ Export/Filter/ActivityReasonFilter.php | 92 ++++++++++++++++++++++++++ Resources/config/services.yml | 19 +++++- 4 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 Export/Aggregator/ReasonAggregator.php create mode 100644 Export/Export/CountActivity.php create mode 100644 Export/Filter/ActivityReasonFilter.php diff --git a/Export/Aggregator/ReasonAggregator.php b/Export/Aggregator/ReasonAggregator.php new file mode 100644 index 000000000..e24457525 --- /dev/null +++ b/Export/Aggregator/ReasonAggregator.php @@ -0,0 +1,88 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Aggregator; + +use Symfony\Component\Form\FormBuilderInterface; +use Doctrine\ORM\QueryBuilder; +use Chill\MainBundle\Export\AggregatorInterface; + +/** + * + * + * @author Julien Fastré + */ +class ReasonAggregator implements AggregatorInterface +{ + public function alterQuery(QueryBuilder $qb, $data) + { + // add select element + if ($data['level'] === 'reason') { + $elem = 'reason.id'; + $alias = 'activity_reason_id'; + } elseif ($data['level'] === 'category') { + $elem = 'category.id'; + $alias = 'activity_category_id'; + } else { + throw new \RuntimeException('the data provided are not recognised'); + } + + $qb->addSelect($elem.' as '.$alias); + + // make a jointure + $qb->join('activity.reason', 'reason'); + // join category if necessary + if ($alias === 'activity_category_id') { + $qb->join('reason.category', 'category'); + } + + // add the "group by" part + $groupBy = $qb->getDQLPart('groupBy'); + + if (count($groupBy) > 0) { + $qb->addGroupBy($alias); + } else { + $qb->groupBy($alias); + } + } + + public function applyOn() + { + return 'activity'; + } + + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('level', 'choice', array( + 'choices' => array( + 'By reason' => 'reason', + 'By category of reason' => 'category' + ), + 'choices_as_values' => true, + 'multiple' => false, + 'expanded' => true + )); + } + + public function getTitle() + { + return "Aggregate by activity reason"; + } + +} diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php new file mode 100644 index 000000000..237f58ca6 --- /dev/null +++ b/Export/Export/CountActivity.php @@ -0,0 +1,77 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Export; + +use Chill\MainBundle\Export\ExportInterface; +use Doctrine\ORM\Query\Expr\Join; +use Doctrine\ORM\QueryBuilder; + +/** + * + * + * @author Julien Fastré + */ +class CountActivity implements ExportInterface +{ + + public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) + { + throw new \LogicException('This export does not requires a form.'); + } + + public function getDescription() + { + return "Count activities"; + } + + public function getTitle() + { + return "Count activities"; + } + + public function getType() + { + return 'activity'; + } + + public function initiateQuery(QueryBuilder $qb, array $requiredModifiers) + { + $qb->select('COUNT(activity.id) as export_count_activity') + ->from('ChillActivityBundle:Activity', 'activity') + ; + + if (in_array('person', $requiredModifiers)) { + $qb->join('activity.person', 'person'); + } + + return $qb; + } + + public function hasForm() + { + return false; + } + + public function supportsModifiers() + { + return array('person', 'activity'); + } + +} diff --git a/Export/Filter/ActivityReasonFilter.php b/Export/Filter/ActivityReasonFilter.php new file mode 100644 index 000000000..6b7ad68f7 --- /dev/null +++ b/Export/Filter/ActivityReasonFilter.php @@ -0,0 +1,92 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Filter; + +use Chill\MainBundle\Export\FilterInterface; +use Doctrine\ORM\QueryBuilder; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Doctrine\ORM\Query\Expr; + +/** + * + * + * @author Julien Fastré + */ +class ActivityReasonFilter implements FilterInterface +{ + /** + * + * @var TranslatableStringHelper + */ + public $translatableStringHelper; + + public function __construct(TranslatableStringHelper $helper) + { + $this->translatableStringHelper = $helper; + } + + + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->in('activity.reason', ':selected_activity_reasons'); + + if ($where instanceof Expr\Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('selected_activity_reasons', $data['reasons']); + } + + public function applyOn() + { + return 'activity'; + } + + public function buildForm(FormBuilderInterface $builder) + { + //create a local copy of translatableStringHelper + $helper = $this->translatableStringHelper; + + $builder->add('reasons', EntityType::class, array( + 'class' => 'ChillActivityBundle:ActivityReason', + 'choice_label' => function (ActivityReason $reason) use ($helper) { + return $helper->localize($reason->getName()); + }, + 'group_by' => function(ActivityReason $reason) use ($helper) { + return $helper->localize($reason->getCategory()->getName()); + }, + 'multiple' => true, + 'expanded' => false + )); + } + + public function getTitle() + { + + } + +} diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 39ba42839..090ff55ac 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -46,4 +46,21 @@ services: - '@chill.main.security.authorization.helper' - '@security.token_storage' tags: - - { name: chill.timeline, context: 'person' } \ No newline at end of file + - { name: chill.timeline, context: 'person' } + + chill.activity.export.count_activity: + class: Chill\ActivityBundle\Export\Export\CountActivity + tags: + - { name: chill.export, alias: 'count_activity' } + + chill.activity.export.reason_filter: + class: Chill\ActivityBundle\Export\Filter\ActivityReasonFilter + arguments: + - "@chill.main.helper.translatable_string" + tags: + - { name: chill.export_filter, alias: 'activity_reason_filter' } + + chill.activity.export.reason_aggregator: + class: Chill\ActivityBundle\Export\Aggregator\ReasonAggregator + tags: + - { name: chill.export_aggregator, alias: activity_reason } \ No newline at end of file From af359c9a2b8ebb6983b1e4e4997e5a945eb424f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 24 Jan 2016 22:26:38 +0100 Subject: [PATCH 079/163] add dummy acl for export [WIP][ci-skip] --- Export/Export/CountActivity.php | 6 ++++++ Export/Filter/ActivityReasonFilter.php | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index 237f58ca6..e8ede154a 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -22,6 +22,7 @@ namespace Chill\ActivityBundle\Export\Export; use Chill\MainBundle\Export\ExportInterface; use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; +use Symfony\Component\Security\Core\Role\Role; /** * @@ -73,5 +74,10 @@ class CountActivity implements ExportInterface { return array('person', 'activity'); } + + public function requiredRole() + { + return new Role('dummy'); + } } diff --git a/Export/Filter/ActivityReasonFilter.php b/Export/Filter/ActivityReasonFilter.php index 6b7ad68f7..6b0107200 100644 --- a/Export/Filter/ActivityReasonFilter.php +++ b/Export/Filter/ActivityReasonFilter.php @@ -26,6 +26,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Chill\ActivityBundle\Entity\ActivityReason; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\Query\Expr; +use Symfony\Component\Security\Core\Role\Role; /** * @@ -86,7 +87,11 @@ class ActivityReasonFilter implements FilterInterface public function getTitle() { - + return 'Filter by reason'; + } + + public function requiredRole() + { + return new Role('dummy'); } - } From 1671be107f4b9c239522dbe1db8934f33f98b274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 26 Jan 2016 11:47:34 +0100 Subject: [PATCH 080/163] implements dummy role --- Export/Aggregator/ReasonAggregator.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Export/Aggregator/ReasonAggregator.php b/Export/Aggregator/ReasonAggregator.php index e24457525..7a97cad47 100644 --- a/Export/Aggregator/ReasonAggregator.php +++ b/Export/Aggregator/ReasonAggregator.php @@ -22,6 +22,7 @@ namespace Chill\ActivityBundle\Export\Aggregator; use Symfony\Component\Form\FormBuilderInterface; use Doctrine\ORM\QueryBuilder; use Chill\MainBundle\Export\AggregatorInterface; +use Symfony\Component\Security\Core\Role\Role; /** * @@ -84,5 +85,10 @@ class ReasonAggregator implements AggregatorInterface { return "Aggregate by activity reason"; } + + public function requiredRole() + { + return new Role('dummy'); + } } From 9f7fe059911b9464534336f6a468249112db1394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 26 Jan 2016 12:21:16 +0100 Subject: [PATCH 081/163] implements required role in export --- Export/Export/CountActivity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index e8ede154a..abfd8f89f 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -52,7 +52,7 @@ class CountActivity implements ExportInterface return 'activity'; } - public function initiateQuery(QueryBuilder $qb, array $requiredModifiers) + public function initiateQuery(QueryBuilder $qb, array $requiredModifiers, $acl) { $qb->select('COUNT(activity.id) as export_count_activity') ->from('ChillActivityBundle:Activity', 'activity') From 7619b41cd43adb876e3b3870ed7cbdcd1532d701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 1 Feb 2016 00:01:21 +0100 Subject: [PATCH 082/163] adapting classes to new interfaces --- .../ChillActivityExtension.php | 7 +- Export/Aggregator/ReasonAggregator.php | 24 +++++- Export/Export/CountActivity.php | 32 +++++++- Export/Filter/ActivityReasonFilter.php | 5 +- Resources/config/services.yml | 8 ++ Security/Authorization/ActivityStatsVoter.php | 76 +++++++++++++++++++ 6 files changed, 144 insertions(+), 8 deletions(-) create mode 100644 Security/Authorization/ActivityStatsVoter.php diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 262925889..72dc28583 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -27,6 +27,8 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; +use Chill\ActivityBundle\Security\Authorization\ActivityVoter; /** * This is the class that loads and manages your bundle configuration @@ -72,8 +74,9 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf { $container->prependExtensionConfig('security', array( 'role_hierarchy' => array( - 'CHILL_ACTIVITY_UPDATE' => array('CHILL_ACTIVITY_SEE'), - 'CHILL_ACTIVITY_CREATE' => array('CHILL_ACTIVITY_SEE') + ActivityVoter::UPDATE => array(ActivityVoter::SEE), + ActivityVoter::CREATE => array(ActivityVoter::SEE), + ActivityVoter::SEE => array(ActivityStatsVoter::STATS) ) )); } diff --git a/Export/Aggregator/ReasonAggregator.php b/Export/Aggregator/ReasonAggregator.php index 7a97cad47..5698d4071 100644 --- a/Export/Aggregator/ReasonAggregator.php +++ b/Export/Aggregator/ReasonAggregator.php @@ -23,6 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Doctrine\ORM\QueryBuilder; use Chill\MainBundle\Export\AggregatorInterface; use Symfony\Component\Security\Core\Role\Role; +use Chill\ActivityBundle\Security\Authorization\ActivityVoter; /** * @@ -86,9 +87,28 @@ class ReasonAggregator implements AggregatorInterface return "Aggregate by activity reason"; } - public function requiredRole() + public function addRole() { - return new Role('dummy'); + return new Role(ActivityVoter::SEE); + } + + public function getLabels($key, array $values, $data) + { + return array_combine($values, $values); + + } + + public function getQueryKeys($data) + { + // add select element + if ($data['level'] === 'reason') { + return array('activity_reason_id'); + } elseif ($data['level'] === 'category') { + return array ('activity_category_id'); + } else { + throw new \RuntimeException('the data provided are not recognised'); + } + } } diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index abfd8f89f..11f7aebf5 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -20,9 +20,10 @@ namespace Chill\ActivityBundle\Export\Export; use Chill\MainBundle\Export\ExportInterface; -use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Security\Core\Role\Role; +use Doctrine\ORM\Query; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; /** * @@ -77,7 +78,34 @@ class CountActivity implements ExportInterface public function requiredRole() { - return new Role('dummy'); + return new Role(ActivityStatsVoter::STATS); + } + + public function getAllowedFormattersTypes() + { + return array(\Chill\MainBundle\Export\FormatterInterface::TYPE_TABULAR); + } + + public function getLabels($key, array $values, $data) + { + if ($key !== 'export_count_activity') { + throw new \LogicException("the key $key is not used by this export"); + } + + $labels = array_combine($values, $values); + $labels['_header'] = 'Number of activities'; + + return $labels; + } + + public function getQueryKeys($data) + { + return array('export_count_activity'); + } + + public function getResult(QueryBuilder $qb, $data) + { + return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR); } } diff --git a/Export/Filter/ActivityReasonFilter.php b/Export/Filter/ActivityReasonFilter.php index 6b0107200..9f2059fbe 100644 --- a/Export/Filter/ActivityReasonFilter.php +++ b/Export/Filter/ActivityReasonFilter.php @@ -27,6 +27,7 @@ use Chill\ActivityBundle\Entity\ActivityReason; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\Query\Expr; use Symfony\Component\Security\Core\Role\Role; +use Chill\ActivityBundle\Security\Authorization\ActivityVoter; /** * @@ -90,8 +91,8 @@ class ActivityReasonFilter implements FilterInterface return 'Filter by reason'; } - public function requiredRole() + public function addRole() { - return new Role('dummy'); + return new Role(ActivityVoter::SEE); } } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 090ff55ac..37383ab2e 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -38,6 +38,14 @@ services: - { name: security.voter } - { name: chill.role } + chill.activity.security.authorization.activity_stats_voter: + class: Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter + arguments: + - "@chill.main.security.authorization.helper" + tags: + - { name: security.voter } + - { name: chill.role } + chill.activity.timeline: class: Chill\ActivityBundle\Timeline\TimelineActivityProvider diff --git a/Security/Authorization/ActivityStatsVoter.php b/Security/Authorization/ActivityStatsVoter.php new file mode 100644 index 000000000..94eedf1fb --- /dev/null +++ b/Security/Authorization/ActivityStatsVoter.php @@ -0,0 +1,76 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Security\Authorization; + +use Chill\MainBundle\Security\Authorization\AbstractChillVoter; +use Chill\MainBundle\Security\Authorization\AuthorizationHelper; +use Chill\MainBundle\Security\ProvideRoleInterface; +use Chill\ActivityBundle\Security\Authorization\ActivityVoter; + +/** + * + * + * @author Julien Fastré + */ +class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterface +{ + const STATS = 'CHILL_ACTIVITY_STATS'; + + /** + * + * @var AuthorizationHelper + */ + protected $helper; + + public function __construct(AuthorizationHelper $helper) + { + $this->helper = $helper; + } + + protected function getSupportedAttributes() + { + return array(self::STATS, ActivityVoter::SEE); + } + + protected function getSupportedClasses() + { + return array('Chill\MainBundle\Entity\Center'); + } + + protected function isGranted($attribute, $object, $user = null) + { + if (!$user instanceof \Symfony\Component\Security\Core\User\UserInterface) { + return false; + } + + return $this->helper->userHasAccess($user, $object, $attribute); + } + + public function getRoles() + { + $this->getSupportedAttributes(); + } + + public function getRolesWithoutScope() + { + $this->getSupportedAttributes(); + } + +} From 42f7bdb7425e2f7ad6d3322f46046f1f170529b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 5 Feb 2016 15:05:27 +0100 Subject: [PATCH 083/163] adapt to new ExportInterface --- Export/Export/CountActivity.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index 11f7aebf5..9e1c420f4 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -35,7 +35,7 @@ class CountActivity implements ExportInterface public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) { - throw new \LogicException('This export does not requires a form.'); + } public function getDescription() @@ -53,7 +53,7 @@ class CountActivity implements ExportInterface return 'activity'; } - public function initiateQuery(QueryBuilder $qb, array $requiredModifiers, $acl) + public function initiateQuery(QueryBuilder $qb, array $requiredModifiers, array $acl, array $data = array()) { $qb->select('COUNT(activity.id) as export_count_activity') ->from('ChillActivityBundle:Activity', 'activity') @@ -65,11 +65,6 @@ class CountActivity implements ExportInterface return $qb; } - - public function hasForm() - { - return false; - } public function supportsModifiers() { From c60d6acf9764aef5224ac318440e86e790fc6771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 22 Feb 2016 14:48:35 +0100 Subject: [PATCH 084/163] An activity may have multiple reasons The relationship between Activity and Reasons is now many-to-many. Some improvement in show activity layout. refs #4 #7 --- DataFixtures/ORM/LoadActivity.php | 17 +++- Entity/Activity.php | 29 ++++--- Form/ActivityType.php | 5 +- Resources/config/doctrine/Activity.orm.yml | 5 +- .../migrations/Version20160222103457.php | 79 +++++++++++++++++++ Resources/translations/messages.fr.yml | 4 +- Resources/views/Activity/edit.html.twig | 13 ++- Resources/views/Activity/list.html.twig | 26 ++++-- Resources/views/Activity/show.html.twig | 39 ++++++--- .../views/ActivityReason/macro.html.twig | 3 + Tests/Controller/ActivityControllerTest.php | 16 +++- 11 files changed, 197 insertions(+), 39 deletions(-) create mode 100644 Resources/migrations/Version20160222103457.php create mode 100644 Resources/views/ActivityReason/macro.html.twig diff --git a/DataFixtures/ORM/LoadActivity.php b/DataFixtures/ORM/LoadActivity.php index fe14fd86c..ce1be9ceb 100644 --- a/DataFixtures/ORM/LoadActivity.php +++ b/DataFixtures/ORM/LoadActivity.php @@ -84,9 +84,15 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C * * @return \Chill\ActivityBundle\Entity\ActivityReason */ - private function getRandomActivityReason() + private function getRandomActivityReason(array $excludingIds) { $reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)]; + + if (in_array($this->getReference($reasonRef)->getId(), $excludingIds)) { + // we have a reason which should be excluded. Find another... + return $this->getRandomActivityReason($excludingIds); + } + return $this->getReference($reasonRef); } @@ -109,10 +115,17 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C ->setDate($this->faker->dateTimeThisYear()) ->setDurationTime($this->faker->dateTime(36000)) ->setType($this->getRandomActivityType()) - ->setReason($this->getRandomActivityReason()) ->setScope($this->getRandomScope()) ->setAttendee($this->faker->boolean()) ->setRemark('A remark'); + + $usedId = array(); + for ($i = 0; $i < rand(0, 4); $i++) { + $reason = $this->getRandomActivityReason($usedId); + $usedId[] = $reason->getId(); + $activity->addReason($reason); + } + return $activity; } diff --git a/Entity/Activity.php b/Entity/Activity.php index e7ca954a7..954ae7e34 100644 --- a/Entity/Activity.php +++ b/Entity/Activity.php @@ -27,6 +27,7 @@ use Chill\ActivityBundle\Entity\ActivityType; use Chill\PersonBundle\Entity\Person; use Chill\MainBundle\Entity\HasCenterInterface; use Chill\MainBundle\Entity\HasScopeInterface; +use Doctrine\Common\Collections\ArrayCollection; /** * Activity @@ -64,9 +65,9 @@ class Activity implements HasCenterInterface, HasScopeInterface private $attendee; /** - * @var ActivityReason + * @var \Doctrine\Common\Collections\Collection */ - private $reason; + private $reasons; /** * @var ActivityType @@ -82,6 +83,11 @@ class Activity implements HasCenterInterface, HasScopeInterface * @var Person */ private $person; + + public function __construct() + { + $this->reasons = new ArrayCollection(); + } /** @@ -215,27 +221,32 @@ class Activity implements HasCenterInterface, HasScopeInterface } /** - * Set reason + * Add a reason * * @param ActivityReason $reason * * @return Activity */ - public function setReason(ActivityReason $reason) + public function addReason(ActivityReason $reason) { - $this->reason = $reason; + $this->reasons[] = $reason; return $this; } + + public function removeReason(ActivityReason $reason) + { + $this->reasons->removeElement($reason); + } /** - * Get reason + * Get reasons * - * @return ActivityReason + * @return \Doctrine\Common\Collections\Collection */ - public function getReason() + public function getReasons() { - return $this->reason; + return $this->reasons; } /** diff --git a/Form/ActivityType.php b/Form/ActivityType.php index b6c52fb4a..1c9580cb4 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -85,7 +85,10 @@ class ActivityType extends AbstractType )) ->add('user') ->add('scope') - ->add('reason', 'translatable_activity_reason') + ->add('reasons', 'translatable_activity_reason', array( + 'multiple' => true, + 'required' => false + )) ->add('type', 'translatable_activity_type') //->add('person') ; diff --git a/Resources/config/doctrine/Activity.orm.yml b/Resources/config/doctrine/Activity.orm.yml index 22ebc3219..bed936936 100644 --- a/Resources/config/doctrine/Activity.orm.yml +++ b/Resources/config/doctrine/Activity.orm.yml @@ -16,13 +16,14 @@ Chill\ActivityBundle\Entity\Activity: type: text attendee: type: boolean + manyToMany: + reasons: + targetEntity: Chill\ActivityBundle\Entity\ActivityReason manyToOne: user: targetEntity: Chill\MainBundle\Entity\User scope: targetEntity: Chill\MainBundle\Entity\Scope - reason: - targetEntity: Chill\ActivityBundle\Entity\ActivityReason type: targetEntity: Chill\ActivityBundle\Entity\ActivityType person: diff --git a/Resources/migrations/Version20160222103457.php b/Resources/migrations/Version20160222103457.php new file mode 100644 index 000000000..c08be5c2f --- /dev/null +++ b/Resources/migrations/Version20160222103457.php @@ -0,0 +1,79 @@ +abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', + 'Migration can only be executed safely on \'postgresql\'.'); + + // create the new table activity reason + $this->addSql('CREATE TABLE activity_activityreason (' + . 'activity_id INT NOT NULL, ' + . 'activityreason_id INT NOT NULL, ' + . 'PRIMARY KEY(activity_id, activityreason_id))' + ); + $this->addSql('CREATE INDEX IDX_338A864381C06096 ON activity_activityreason (activity_id)'); + $this->addSql('CREATE INDEX IDX_338A8643D771E0FC ON activity_activityreason (activityreason_id)'); + $this->addSql('ALTER TABLE activity_activityreason ' + . 'ADD CONSTRAINT FK_338A864381C06096 FOREIGN KEY (activity_id) ' + . 'REFERENCES Activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE activity_activityreason ' + . 'ADD CONSTRAINT FK_338A8643D771E0FC FOREIGN KEY (activityreason_id) ' + . 'REFERENCES ActivityReason (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + + // migrate old data to new table + $this->addSql('INSERT INTO activity_activityreason (activity_id, activityreason_id) ' + . 'SELECT id, reason_id FROM activity WHERE reason_id IS NOT NULL'); + + + // remove old column + $this->addSql('ALTER TABLE activity DROP CONSTRAINT fk_55026b0c59bb1592'); + $this->addSql('DROP INDEX idx_55026b0c59bb1592'); + $this->addSql('ALTER TABLE activity DROP reason_id'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', + 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE Activity ADD reason_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE Activity ADD CONSTRAINT ' + . 'fk_55026b0c59bb1592 FOREIGN KEY (reason_id) ' + . 'REFERENCES activityreason (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX idx_55026b0c59bb1592 ON Activity (reason_id)'); + + // try to keep at least on activity reason... + $this->addSql('UPDATE activity + SET reason_id=rid + FROM ( + SELECT activity_id AS aid, MIN(activityreason_id) AS rid + FROM activity_activityreason + GROUP BY activity_id ) AS sb + WHERE sb.aid = activity.id' + ); + + + $this->addSql('DROP TABLE activity_activityreason'); + + } +} diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 0d4086327..387159c9e 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -4,7 +4,7 @@ Edit the activity: Modifier l'activité Activity: Activité Duration time: Durée Duration Time: Durée -Reason: Sujet +Reasons: Sujets Attendee: Présence de la personne Remark: Notes Add a new activity: Ajouter une nouvelle activité @@ -15,6 +15,8 @@ Delete: Supprimer Update: Mettre à jour Update activity: Édition de l'activité Scope: Cercle +Activity data: Données de l'activité +No reason associated: Aucun sujet #forms Activity creation: Nouvelle activité diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index d92ecab39..456bb3221 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -18,12 +18,23 @@ {% set activeRouteKey = 'chill_activity_activity_list' %} -{% block title %}{{ 'Activity edit' |trans }}{% endblock title %} +{% block title 'Update activity'|trans %} {% block personcontent %}

                                  {{ "Update activity"|trans }}

                                  {{ form_start(edit_form) }} + + {{ form_row(edit_form.user) }} + {{ form_row(edit_form.scope) }} + +

                                  {{ 'Activity data'|trans }}

                                  + {{ form_row(edit_form.date) }} + {{ form_row(edit_form.durationTime) }} + {{ form_row(edit_form.remark) }} + {{ form_row(edit_form.attendee) }} + {{ form_row(edit_form.reasons) }} + {{ form_row(edit_form.type) }} {{ form_widget(edit_form) }}
                                  diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index 9bed49ec5..cfaf9cf89 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -16,6 +16,8 @@ #} {% extends "ChillPersonBundle::layout.html.twig" %} +{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %} + {% set activeRouteKey = 'chill_activity_activity_list' %} {% block title %}{{ 'Activity list' |trans }}{% endblock title %} @@ -26,10 +28,9 @@ {{'Date' | trans }} {{'Duration Time' | trans }} - {{'Reason' | trans}} + {{'Reasons' | trans}} {{'Type' | trans}} - - +   @@ -37,13 +38,22 @@ {% if activity.date %}{{ activity.date|localizeddate('long', 'none') }}{% endif %} {{ activity.durationTime|date('H:i') }} - {{ activity.reason.name | localize_translatable_string }} + + {%- if activity.reasons is empty -%} + {{ 'No reason associated'|trans }} + {%- else -%} + {% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %} + {%- endif -%} + {{ activity.type.name | localize_translatable_string }} - {{ 'Show' | trans }} - - - {{ 'Edit' | trans }} +
                                    +
                                  • + {{ 'show'|trans|capitalize }} +
                                  • +
                                  • + {{ 'Edit' | trans }} +
                                  • {% endfor %} diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 1e282778e..b3c86aeb5 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -2,28 +2,43 @@ {% set activeRouteKey = 'chill_activity_activity_list' %} +{% block title 'Activity'|trans %} + +{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %} + {% block personcontent -%} -

                                    {{ "Activity"|trans }}

                                    +

                                    {{ "Activity"|trans }}

                                    -
                                    -
                                    {{ 'Person'|trans }}
                                    -
                                    {{ entity.person }}
                                    +
                                    +
                                    {{ 'User'|trans }}
                                    +
                                    {{ entity.user }}
                                    {{ 'Scope'|trans }}
                                    {{ entity.scope.name|localize_translatable_string }}
                                    + +

                                    {{ 'Activity data'|trans }}

                                    +
                                    {{ 'Person'|trans }}
                                    +
                                    {{ entity.person }}
                                    +
                                    {{ 'Date'|trans }}
                                    {{ entity.date|localizeddate('long', 'none') }}
                                    {{ 'Duration Time'|trans }}
                                    {{ entity.durationTime|date('H:i') }}
                                    -
                                    {{ 'User'|trans }}
                                    -
                                    {{ entity.user }}
                                    -
                                    {{ 'Reason'|trans }}
                                    -
                                    {{ entity.reason.name | localize_translatable_string }}
                                    -
                                    {{ 'Type'|trans }}
                                    -
                                    {{ entity.type.name | localize_translatable_string }}
                                    +
                                    {{ 'Remark'|trans }}
                                    +
                                    {% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}
                                    {{ entity.remark|nl2br }}
                                    {% endif %}
                                    +
                                    {{ 'Attendee'|trans }}
                                    {% if entity.attendee is not null %}{% if entity.attendee %}{{ 'present'|trans|capitalize }} {% else %} {{ 'not present'|trans|capitalize }}{% endif %}{% else %}{{ 'None'|trans|capitalize }}{% endif %}
                                    -
                                    {{ 'Remark'|trans }}
                                    -
                                    {% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}
                                    {{ entity.remark }}
                                    {% endif %}
                                    + +
                                    {{ 'Reasons'|trans }}
                                    + {%- if entity.reasons is empty -%} +
                                    {{ 'No reason associated'|trans }}
                                    + {%- else -%} +
                                    {% for r in entity.reasons %}{{ m.reason(r) }} {% endfor %}
                                    + {%- endif -%} + +
                                    {{ 'Type'|trans }}
                                    +
                                    {{ entity.type.name | localize_translatable_string }}
                                    +
                                    {{ ''|trans }}
                                    {{ ''|trans }}
                                    diff --git a/Resources/views/ActivityReason/macro.html.twig b/Resources/views/ActivityReason/macro.html.twig new file mode 100644 index 000000000..7385327a5 --- /dev/null +++ b/Resources/views/ActivityReason/macro.html.twig @@ -0,0 +1,3 @@ +{%- macro reason(r) -%} + {{ r.name | localize_translatable_string }} +{%- endmacro -%} \ No newline at end of file diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php index 780bdef00..485c8e21e 100644 --- a/Tests/Controller/ActivityControllerTest.php +++ b/Tests/Controller/ActivityControllerTest.php @@ -106,6 +106,9 @@ class ActivityControllerTest extends WebTestCase "Unexpected HTTP status code for GET /activity/"); $crawler = $client->click($crawler->selectLink('Ajouter une nouvelle activité') ->link()); + + $reason1 = $this->getRandomActivityReason(); + $reason2 = $this->getRandomActivityReason(array($reason1->getId())); // Fill in the form and submit it $form = $crawler->selectButton('Ajouter une nouvelle activité')->form(array( @@ -117,10 +120,10 @@ class ActivityControllerTest extends WebTestCase ), 'remark' => 'blabla', 'scope' => $this->getRandomScope('center a_social', 'Center A')->getId(), - 'reason' => $this->getRandomActivityReason()->getId(), 'type' => $this->getRandomActivityType()->getId() ) )); + $form['chill_activitybundle_activity[reasons]']->select(array ($reason1->getId(), $reason2->getId())); $client->submit($form); @@ -240,16 +243,23 @@ class ActivityControllerTest extends WebTestCase /** * + * @param int[] $excludeIds An array of id to exclude * @return \Chill\ActivityBundle\Entity\ActivityReason */ - private function getRandomActivityReason() + private function getRandomActivityReason(array $excludeIds = array()) { $reasons = static::$kernel->getContainer() ->get('doctrine.orm.entity_manager') ->getRepository('ChillActivityBundle:ActivityReason') ->findAll(); - return $reasons[array_rand($reasons)]; + $reason = $reasons[array_rand($reasons)]; + + if (in_array($reason->getId(), $excludeIds)) { + return $this->getRandomActivityReason($excludeIds); + } + + return $reason; } /** From d8bf3a643115c784a07e1b53500ec9b017d0bc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 22 Feb 2016 14:51:48 +0100 Subject: [PATCH 085/163] add mapping_types information to allow jsonb from postgresql --- Test/Fixtures/App/app/config/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Test/Fixtures/App/app/config/config.yml b/Test/Fixtures/App/app/config/config.yml index be6e8f94e..a73bfb2ec 100644 --- a/Test/Fixtures/App/app/config/config.yml +++ b/Test/Fixtures/App/app/config/config.yml @@ -22,6 +22,8 @@ doctrine: user: "%database_user%" password: "%database_password%" charset: UTF8 + mapping_types: + jsonb: json_array orm: auto_generate_proxy_classes: "%kernel.debug%" auto_mapping: true From 737d0f4c52337dca451492a2c8e5202057dd26ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 23 Feb 2016 14:49:42 +0100 Subject: [PATCH 086/163] Add license --- LICENSE | 661 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 661 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..2def0e883 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. \ No newline at end of file From 1b851e8f09e5b751bd99179b47c96bfbb4ec16e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 23 Feb 2016 15:32:17 +0100 Subject: [PATCH 087/163] upgrade dependency on doctrine-migration-bundle to ~1.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5c82b5f1a..3ae3b49a1 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "chill-project/custom-fields": "dev-master@dev", "chill-project/person": "dev-master@dev", "champs-libres/composer-bundle-migration": "~1.0", - "doctrine/doctrine-migrations-bundle": "dev-master@dev", + "doctrine/doctrine-migrations-bundle": "~1.1", "doctrine/migrations": "~1.0@dev" }, "require-dev": { From 77b7333fea9024a38a6cc6d9c29e8ffa3e4886b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Mar 2016 13:38:05 +0100 Subject: [PATCH 088/163] Allow encoding of an activity with configuration preset durations fix #11 The activity form allow to receive pre-configured activity durations. Those duration can be configured through the option chill_activity.form.time_duration : ```yaml chill_activity: form: time_duration: - { label: '12 minutes', seconds: 720 } # - ... ``` If a pre-existing activity receives a different time, the time is added to the list of pre-configured duration time. --- Controller/ActivityController.php | 2 +- .../ChillActivityExtension.php | 2 + DependencyInjection/Configuration.php | 72 +++++- Form/ActivityType.php | 90 +++++++- Resources/config/services.yml | 1 + Resources/translations/messages.fr.yml | 14 ++ Resources/views/Activity/new.html.twig | 4 +- Tests/Controller/ActivityControllerTest.php | 5 +- Tests/Form/ActivityTypeTest.php | 205 ++++++++++++++++++ 9 files changed, 374 insertions(+), 21 deletions(-) create mode 100644 Tests/Form/ActivityTypeTest.php diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 3c8cf7906..da03b3150 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -289,7 +289,7 @@ class ActivityController extends Controller $this->get('translator') ->trans('Success : activity updated!') ); - +//die(); return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $id, 'person_id' => $person_id))); } diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 262925889..b66544a65 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -42,6 +42,8 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); + + $container->setParameter('chill_activity.form.time_duration', $config['form']['time_duration']); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index a177c28c4..58706054d 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -19,10 +19,76 @@ class Configuration implements ConfigurationInterface { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('chill_activity'); + + $rootNode + ->children() + ->arrayNode('form') + ->canBeEnabled() + ->children() + ->arrayNode('time_duration') + ->isRequired() + ->requiresAtLeastOneElement() + ->defaultValue( + array( + [ 'label' => '5 minutes', 'seconds' => 300], + [ 'label' => '10 minutes', 'seconds' => 600], + [ 'label' => '15 minutes', 'seconds' => 900], + [ 'label' => '20 minutes', 'seconds' => 1200], + [ 'label' => '25 minutes', 'seconds' => 1500], + [ 'label' => '30 minutes', 'seconds' => 1800], + [ 'label' => '45 minutes', 'seconds' => 2700], + [ 'label' => '1 hour', 'seconds' => 3600], + [ 'label' => '1 hour 15', 'seconds' => 4500], + [ 'label' => '1 hour 30', 'seconds' => 5400], + [ 'label' => '1 hour 45', 'seconds' => 6300], + [ 'label' => '2 hours', 'seconds' => 7200], + ) + ) + ->info('The intervals of time to show in activity form') - // Here you should define the parameters that are allowed to - // configure your bundle. See the documentation linked above for - // more information on that topic. + ->prototype('array') + ->children() + ->scalarNode('seconds') + ->info("The number of seconds of this duration. Must be an integer.") + ->cannotBeEmpty() + ->validate() + ->ifTrue(function($data) { + return !is_int($data); + })->thenInvalid("The value %s is not a valid integer") + ->end() + ->end() + ->scalarNode('label') + ->cannotBeEmpty() + ->info("The label to show into fields") + ->end() + ->end() + + ->end() +// ->validate() +// +// ->ifTrue(function ($data) { +// // test this is an array +// if (!is_array($data)) { +// return true; +// } +// +// foreach ($data as $k => $v) { +// if (!is_string($k)) { +// return true; +// } +// if (!is_int($v)) { +// return true; +// } +// } +// +// }) +// ->thenInvalid("The data are invalid. The keys must be a string and the value integers") +// ->end() + ->end() + ->end() + + ->end() + ->end(); return $treeBuilder; } diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 1c9580cb4..65e977e42 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -11,6 +11,13 @@ use Doctrine\Common\Persistence\ObjectManager; use Chill\MainBundle\Templating\TranslatableStringHelper; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Chill\MainBundle\Entity\User; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\DateTimeType; +use Chill\ActivityBundle\Form\Type\TranslatableActivityType; +use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; class ActivityType extends AbstractType { @@ -42,9 +49,14 @@ class ActivityType extends AbstractType */ protected $translatableStringHelper; - public function __construct(TokenStorageInterface $tokenStorage, - AuthorizationHelper $authorizationHelper, ObjectManager $om, - TranslatableStringHelper $translatableStringHelper) + protected $timeChoices; + + public function __construct( + TokenStorageInterface $tokenStorage, + AuthorizationHelper $authorizationHelper, ObjectManager $om, + TranslatableStringHelper $translatableStringHelper, + array $timeChoices + ) { if (!$tokenStorage->getToken()->getUser() instanceof User) { throw new \RuntimeException("you should have a valid user"); @@ -53,6 +65,7 @@ class ActivityType extends AbstractType $this->authorizationHelper = $authorizationHelper; $this->om = $om; $this->translatableStringHelper = $translatableStringHelper; + $this->timeChoices = $timeChoices; } /** @@ -61,21 +74,32 @@ class ActivityType extends AbstractType */ public function buildForm(FormBuilderInterface $builder, array $options) { + // handle times choices + $timeChoices = array(); + + foreach ($this->timeChoices as $e) { + $timeChoices[$e['label']] = $e['seconds']; + }; + + $durationTimeTransformer = new DateTimeToTimestampTransformer('GMT', 'GMT'); + $durationTimeOptions = array( + 'choices' => $timeChoices, + 'choices_as_values' => true, + 'placeholder' => 'Choose the duration', + ); + $builder ->add('date', 'date', array( 'required' => true, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy') ) - ->add('durationTime', 'time', array( - 'widget' => 'text', - 'hours' => array(0, 1, 2, 3, 4, 5, 6, 7, 8) - )) + ->add('durationTime', ChoiceType::class, $durationTimeOptions) ->add('remark', 'textarea', array( 'required' => false, 'empty_data' => '' )) - ->add('attendee', 'choice', array( + ->add('attendee', ChoiceType::class, array( 'expanded' => true, 'required' => false, 'choices' => array( @@ -85,17 +109,61 @@ class ActivityType extends AbstractType )) ->add('user') ->add('scope') - ->add('reasons', 'translatable_activity_reason', array( + ->add('reasons', TranslatableActivityReason::class, array( 'multiple' => true, 'required' => false )) - ->add('type', 'translatable_activity_type') - //->add('person') + ->add('type', TranslatableActivityType::class) ; $this->appendScopeChoices($builder, $options['role'], $options['center'], $this->user, $this->authorizationHelper, $this->translatableStringHelper, $this->om); + + $builder->get('durationTime') + ->addModelTransformer($durationTimeTransformer); + + + $builder->get('durationTime') + ->addEventListener( + FormEvents::PRE_SET_DATA, + function(FormEvent $formEvent) use ( + $timeChoices, + $builder, + $durationTimeTransformer, + $durationTimeOptions + ) + { + // set the timezone to GMT, and fix the difference between current and GMT + // the datetimetransformer will then handle timezone as GMT + $timezoneUTC = new \DateTimeZone('GMT'); + /* @var $data \DateTime */ + $data = $formEvent->getData() === NULL ? + \DateTime::createFromFormat('U', 300) : + $formEvent->getData(); + $seconds = $data->getTimezone()->getOffset($data); + $data->setTimeZone($timezoneUTC); + $data->add(new \DateInterval('PT'.$seconds.'S')); + + // test if the timestamp is in the choices. + // If not, recreate the field with the new timestamp + if (!in_array($data->getTimestamp(), $timeChoices)) { + // the data are not in the possible values. add them + $timeChoices[$data->format('H:i')] = $data->getTimestamp(); + $form = $builder->create( + 'durationTime', + ChoiceType::class, + array_merge( + $durationTimeOptions, + array( + 'choices' => $timeChoices, + 'auto_initialize' => false + ) + )); + $form->addModelTransformer($durationTimeTransformer); + $formEvent->getForm()->getParent()->add($form->getForm()); + } + }); } /** diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 39ba42839..751bf979d 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -27,6 +27,7 @@ services: - "@chill.main.security.authorization.helper" - "@doctrine.orm.entity_manager" - "@chill.main.helper.translatable_string" + - "%chill_activity.form.time_duration%" tags: - { name: form.type, alias: chill_activitybundle_activity } diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 387159c9e..b0803985e 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -24,6 +24,20 @@ Create: Créer Back to the list: Retour à la liste Save activity: Sauver l'activité Reset form: Remise à zéro du formulaire +Choose the duration: Choisir la durée +5 minutes: 5 minutes +10 minutes: 10 minutes +15 minutes: 15 minutes +20 minutes: 20 minutes +25 minutes: 25 minutes +30 minutes: 30 minutes +45 minutes: 45 minutes +1 hour: 1 heure +1 hour 15: 1 heure 15 +1 hour 30: 1 heure 30 +1 hour 45: 1 heure 45 +2 hours: 2 heures + #timeline '%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date% diff --git a/Resources/views/Activity/new.html.twig b/Resources/views/Activity/new.html.twig index dbea1350c..33643c400 100644 --- a/Resources/views/Activity/new.html.twig +++ b/Resources/views/Activity/new.html.twig @@ -18,13 +18,13 @@ {% set activeRouteKey = 'chill_activity_activity_new' %} -{% block title %}{{ 'Activity create' |trans }}{% endblock title %} +{% block title 'Activity creation' |trans %} {% block personcontent %}

                                    {{ "Activity creation"|trans }}

                                    {{ form_start(form) }} - + {{ form_widget(form) }}
                                    diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php index 485c8e21e..81c280703 100644 --- a/Tests/Controller/ActivityControllerTest.php +++ b/Tests/Controller/ActivityControllerTest.php @@ -114,10 +114,7 @@ class ActivityControllerTest extends WebTestCase $form = $crawler->selectButton('Ajouter une nouvelle activité')->form(array( 'chill_activitybundle_activity'=> array( 'date' => '15-01-2015', - 'durationTime' => array( - 'hour' => '1', - 'minute' => '30' - ), + 'durationTime' => 600, 'remark' => 'blabla', 'scope' => $this->getRandomScope('center a_social', 'Center A')->getId(), 'type' => $this->getRandomActivityType()->getId() diff --git a/Tests/Form/ActivityTypeTest.php b/Tests/Form/ActivityTypeTest.php new file mode 100644 index 000000000..6bb0f032c --- /dev/null +++ b/Tests/Form/ActivityTypeTest.php @@ -0,0 +1,205 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Form; + +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use Chill\ActivityBundle\Form\ActivityType; +use Chill\ActivityBundle\Entity\Activity; +use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; +use Symfony\Component\Security\Core\Role\Role; +use Symfony\Component\Form\Extension\Core\Type\FormType; + +/** + * + * + * @author Julien Fastré + */ +class ActivityTypeTest extends KernelTestCase +{ + /** + * + * @var \Symfony\Component\Form\FormBuilderInterface + */ + protected $formBuilder; + + /** + * + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected $container; + + /** + * + * @var \Symfony\Component\Security\Core\User\UserInterface + */ + protected $user; + + /** + * + * @var \Chill\MainBundle\Entity\Center + */ + protected $center; + + public function setUp() + { + self::bootKernel(); + + $this->container = self::$kernel->getContainer(); + + $prophet = new \Prophecy\Prophet; + + + $this->formBuilder = $this->container + ->get('form.factory') + ->createBuilder(FormType::class, null, array( + 'csrf_protection' => false, + 'csrf_field_name' => '_token' + )); + + $request = new \Symfony\Component\HttpFoundation\Request(); + $request->setLocale('fr'); + + self::$kernel->getContainer() + ->get('request_stack') + ->push($request); + + $this->user = $this->container->get('doctrine.orm.entity_manager') + ->getRepository('ChillMainBundle:User') + ->findOneBy(array('username' => 'center a_social')); + $this->center = $this->container->get('doctrine.orm.entity_manager') + ->getRepository('ChillMainBundle:Center') + ->findOneBy(array('name' => 'Center A')); + $token = $prophet->prophesize(); + $token->willExtend(AbstractToken::class); + $token->getUser()->willReturn($this->user); + $this->container->get('security.token_storage') + ->setToken($token->reveal()); + + } + + public function testForm() + { + $form = $this->formBuilder + ->add('activity', ActivityType::class, array( + 'center' => $this->center, + 'role' => new Role('CHILL_ACTIVITY_CREATE') + )) + ->getForm(); + + $form->submit(array()); + + $this->assertTrue($form->isSynchronized()); + $this->assertTrue($form->isValid()); + $this->assertInstanceOf(Activity::class, $form->getData()['activity']); + + } + + public function testFormSubmitting() + { + $form = $this->formBuilder + ->add('activity', ActivityType::class, array( + 'center' => $this->center, + 'role' => new Role('CHILL_ACTIVITY_CREATE') + )) + ->getForm(); + + $form->submit(array( 'activity' => array( + 'date' => '9-3-2015', + 'durationTime' => 300, + 'remark' => 'blabla', + 'attendee' => true + ))); + +// var_dump($form->getErrors()->count()); var_dump($form->isValid()); +// foreach($form->getErrors() as $e) { fwrite(STDOUT, var_dump($e->getMessage())); } +// var_dump($form->getErrors()); + + $this->assertTrue($form->isSynchronized(), "Test the form is synchronized"); + $this->assertTrue($form->isValid(), "test the form is valid"); + $this->assertInstanceOf(Activity::class, $form->getData()['activity']); + + // test the activity + /* @var $activity Activity */ + $activity = $form->getData()['activity']; + + $this->assertEquals('09-03-2015', $activity->getDate()->format('d-m-Y'), + "Test the date is correct"); + $this->assertEquals('00:05', $activity->getDurationTime()->format('H:i'), + "Test the formatted hour is correct"); + $this->assertEquals(true, $activity->getAttendee()); + $this->assertEquals('blabla', $activity->getRemark()); + + } + + /** + * Test that the form correctly build even with a durationTime which is not in + * the listed in the possible durationTime + */ + public function testFormWithActivityHavingDifferentTime() + { + $activity = new Activity(); + $activity->setDurationTime(\DateTime::createFromFormat('U', 60)); + + $builder = $this->container + ->get('form.factory') + ->createBuilder(FormType::class, array('activity' => $activity), array( + 'csrf_protection' => false, + 'csrf_field_name' => '_token' + )); + + $form = $builder + ->add('activity', ActivityType::class, array( + 'center' => $this->center, + 'role' => new Role('CHILL_ACTIVITY_CREATE') + )) + ->getForm(); + + + $form->submit(array( 'activity' => array( + 'date' => '9-3-2015', + 'durationTime' => 60, + 'remark' => 'blabla', + 'attendee' => true + ))); + + $this->assertTrue($form->isSynchronized()); + $this->assertTrue($form->isValid()); + + // test the activity + /* @var $activity Activity */ + $activity = $form->getData()['activity']; + + $this->assertEquals('00:01', $activity->getDurationTime()->format('H:i'), + "Test the formatted hour is correct"); + + // test the view : we want to be sure that the entry with 60 seconds exists + $view = $form->createView(); + + $this->assertTrue(isset($view['activity']['durationTime'])); + + // map all the values in an array + $values = array_map(function($choice) { return $choice->value; }, + $view['activity']['durationTime']->vars['choices']); + + $this->assertContains(60, $values); + + } + +} From 3acea7967ccd792ef1c11445adb243afa8ff1e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Mar 2016 14:42:42 +0100 Subject: [PATCH 089/163] fix the layout of the forms The layout is now consistent with the view page --- Resources/views/Activity/edit.html.twig | 3 ++- Resources/views/Activity/new.html.twig | 13 ++++++++++++- Resources/views/Activity/show.html.twig | 9 ++------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index 456bb3221..c0e082920 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -31,10 +31,11 @@

                                    {{ 'Activity data'|trans }}

                                    {{ form_row(edit_form.date) }} {{ form_row(edit_form.durationTime) }} + {{ form_row(edit_form.type) }} {{ form_row(edit_form.remark) }} {{ form_row(edit_form.attendee) }} {{ form_row(edit_form.reasons) }} - {{ form_row(edit_form.type) }} + {{ form_widget(edit_form) }}
                                    diff --git a/Resources/views/Activity/new.html.twig b/Resources/views/Activity/new.html.twig index 33643c400..d380b61d5 100644 --- a/Resources/views/Activity/new.html.twig +++ b/Resources/views/Activity/new.html.twig @@ -25,7 +25,18 @@ {{ form_start(form) }} - {{ form_widget(form) }} + {{ form_row(form.user) }} + {{ form_row(form.scope) }} + +

                                    {{ 'Activity data'|trans }}

                                    + + {{ form_row(form.date) }} + {{ form_row(form.durationTime) }} + {{ form_row(form.type) }} + {{ form_row(form.remark) }} + {{ form_row(form.attendee) }} + {{ form_row(form.reasons) }} +
                                    diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index b3c86aeb5..292a35aa4 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -23,6 +23,8 @@
                                    {{ entity.date|localizeddate('long', 'none') }}
                                    {{ 'Duration Time'|trans }}
                                    {{ entity.durationTime|date('H:i') }}
                                    +
                                    {{ 'Type'|trans }}
                                    +
                                    {{ entity.type.name | localize_translatable_string }}
                                    {{ 'Remark'|trans }}
                                    {% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}
                                    {{ entity.remark|nl2br }}
                                    {% endif %}
                                    @@ -36,13 +38,6 @@
                                    {% for r in entity.reasons %}{{ m.reason(r) }} {% endfor %}
                                    {%- endif -%} -
                                    {{ 'Type'|trans }}
                                    -
                                    {{ entity.type.name | localize_translatable_string }}
                                    - -
                                    {{ ''|trans }}
                                    -
                                    -
                                    {{ ''|trans }}
                                    -
                                    From 97df048dfbd213618d0fa0bedf9b6e52072ff262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Mar 2016 15:17:54 +0100 Subject: [PATCH 090/163] add a placeholder in form. Force to choose a type fix #5 --- Form/ActivityType.php | 4 +++- Resources/translations/messages.fr.yml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 65e977e42..23e829bb7 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -113,7 +113,9 @@ class ActivityType extends AbstractType 'multiple' => true, 'required' => false )) - ->add('type', TranslatableActivityType::class) + ->add('type', TranslatableActivityType::class, array( + 'placeholder' => 'Choose a type' + )) ; $this->appendScopeChoices($builder, $options['role'], diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index b0803985e..9660908e0 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -25,6 +25,7 @@ Back to the list: Retour à la liste Save activity: Sauver l'activité Reset form: Remise à zéro du formulaire Choose the duration: Choisir la durée +Choose a type: Choisir un type 5 minutes: 5 minutes 10 minutes: 10 minutes 15 minutes: 15 minutes From 1ab0b95e7447f7fd6cf0c3953272e962f1c788eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Mar 2016 20:54:38 +0100 Subject: [PATCH 091/163] order the type alphabetically Improve also the form "TranslatableActivityType" to use the TranslatableStringHelper. --- .../ChillActivityExtension.php | 1 + Form/Type/TranslatableActivityType.php | 48 ++++++-- Resources/config/services.yml | 3 +- Resources/config/services/repositories.yml | 6 + .../Type/TranslatableActivityTypeTest.php | 115 ++++++++++++++++++ 5 files changed, 163 insertions(+), 10 deletions(-) create mode 100644 Resources/config/services/repositories.yml create mode 100644 Tests/Form/Type/TranslatableActivityTypeTest.php diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index b66544a65..4a2f5795b 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -47,6 +47,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); + $loader->load('services/repositories.yml'); } public function prepend(ContainerBuilder $container) diff --git a/Form/Type/TranslatableActivityType.php b/Form/Type/TranslatableActivityType.php index 4ce59ae82..6e4865bb7 100644 --- a/Form/Type/TranslatableActivityType.php +++ b/Form/Type/TranslatableActivityType.php @@ -25,6 +25,10 @@ namespace Chill\ActivityBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Doctrine\ORM\EntityRepository; +use Chill\ActivityBundle\Entity\ActivityType; /** * Description of TranslatableActivityType @@ -33,14 +37,22 @@ use Symfony\Component\HttpFoundation\RequestStack; */ class TranslatableActivityType extends AbstractType { - /** - * @var RequestStack - */ - private $requestStack; - public function __construct(RequestStack $requestStack) + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + protected $activityTypeRepository; + + public function __construct( + TranslatableStringHelper $helper, + EntityRepository $activityTypeRepository + ) { - $this->requestStack = $requestStack; + $this->translatableStringHelper = $helper; + $this->activityTypeRepository = $activityTypeRepository; } public function getName() @@ -50,16 +62,34 @@ class TranslatableActivityType extends AbstractType public function getParent() { - return 'entity'; + return EntityType::class; } public function configureOptions(OptionsResolver $resolver) { - $locale = $this->requestStack->getCurrentRequest()->getLocale(); + // create a local copy for use in closures + $translatableStringHelper = $this->translatableStringHelper; + $types = $this->activityTypeRepository->findAll(); + + // sort by alphabetical order + usort($types, function(ActivityType $typeA, ActivityType $typeB) use ($translatableStringHelper) { + $strA = $translatableStringHelper->localize($typeA->getName()); + $strB = $translatableStringHelper->localize($typeB->getName()); + + if ($strA === $strB) { + return 0; + } + + return $strA < $strB ? -1 : 1; + }); + $resolver->setDefaults( array( 'class' => 'ChillActivityBundle:ActivityType', - 'property' => 'name['.$locale.']' + 'choices' => $types, + 'choice_label' => function (ActivityType $type) use ($translatableStringHelper) { + return $translatableStringHelper->localize($type->getName()); + } ) ); } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 751bf979d..4be25af03 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -16,7 +16,8 @@ services: chill.activity.form.type.translatableactivitytype: class: Chill\ActivityBundle\Form\Type\TranslatableActivityType arguments: - - "@request_stack" + - "@chill.main.helper.translatable_string" + - "@chill_activity.repository.activity_type" tags: - { name: form.type, alias: translatable_activity_type } diff --git a/Resources/config/services/repositories.yml b/Resources/config/services/repositories.yml new file mode 100644 index 000000000..967c67bc3 --- /dev/null +++ b/Resources/config/services/repositories.yml @@ -0,0 +1,6 @@ +services: + chill_activity.repository.activity_type: + class: Doctrine\ORM\EntityRepository + factory: ['@doctrine.orm.entity_manager', getRepository] + arguments: + - 'Chill\ActivityBundle\Entity\ActivityType' diff --git a/Tests/Form/Type/TranslatableActivityTypeTest.php b/Tests/Form/Type/TranslatableActivityTypeTest.php new file mode 100644 index 000000000..89007d4d0 --- /dev/null +++ b/Tests/Form/Type/TranslatableActivityTypeTest.php @@ -0,0 +1,115 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Form\Type; + +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use Chill\ActivityBundle\Form\Type\TranslatableActivityType; +use Symfony\Component\Form\Extension\Core\Type\FormType; + +/** + * + * + * @author Julien Fastré + */ +class TranslatableActivityTypeTest extends KernelTestCase +{ + + /** + * + * @var \Symfony\Component\Form\FormBuilderInterface + */ + protected $builder; + + /** + * + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected $container; + + public function setUp() + { + self::bootKernel(); + + $this->container = self::$kernel->getContainer(); + + $this->builder = $this->container + ->get('form.factory') + ->createBuilder(FormType::class, null, array( + 'csrf_protection' => false, + 'csrf_field_name' => '_token' + )); + + $request = new \Symfony\Component\HttpFoundation\Request(); + $request->setLocale('fr'); + + $this->container->get('request_stack') + ->push($request); + } + + /** + * + * @return \Chill\ActivityBundle\Entity\ActivityType + */ + protected function getRandomType() + { + $types = $this->container->get('doctrine.orm.entity_manager') + ->getRepository('ChillActivityBundle:ActivityType') + ->findAll(); + + return $types[array_rand($types)]; + } + + public function testForm() + { + $type = $this->getRandomType(); + $form = $this->builder->add('type', TranslatableActivityType::class) + ->getForm(); + + $form->submit(array( + 'type' => $type->getId() + )); + + $this->assertTrue($form->isSynchronized()); + $this->assertInstanceOf(\Chill\ActivityBundle\Entity\ActivityType::class, + $form->getData()['type'], + "The data is an instance of Chill\ActivityBundle\Entity\ActivityType"); + $this->assertEquals($type->getId(), $form->getData()['type']->getId()); + + // test the ordering of the types in the form + $view = $form->createView(); + + $this->assertGreaterThan(0, count($view['type']->vars['choices']), + "test that there are at least one choice"); + + foreach($view['type']->vars['choices'] as $choice) { + // initialize the previous value is not set (this is the first) + if (!isset($previous)) { + $previous = $choice->label; + } else { + $this->assertTrue($previous < $choice->label); + $previous = $choice->label; + } + } + + } + + + +} From f863b9db2490a45ff9246863b17d14e3bc4f785e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 25 Apr 2016 21:58:04 +0200 Subject: [PATCH 092/163] adapt to new exportInterface see Chill-project/Chill-Main#9 --- Export/Export/CountActivity.php | 19 +++++++++++++++++-- Resources/config/services.yml | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index 9e1c420f4..514da92d2 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -24,6 +24,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Security\Core\Role\Role; use Doctrine\ORM\Query; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; +use Doctrine\ORM\EntityManagerInterface; /** * @@ -32,6 +33,18 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; */ class CountActivity implements ExportInterface { + /** + * + * @var EntityManagerInterface + */ + protected $entityManager; + + public function __construct( + EntityManagerInterface $em + ) + { + $this->entityManager = $em; + } public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) { @@ -53,8 +66,10 @@ class CountActivity implements ExportInterface return 'activity'; } - public function initiateQuery(QueryBuilder $qb, array $requiredModifiers, array $acl, array $data = array()) + public function initiateQuery(array $requiredModifiers, array $acl, array $data = array()) { + $qb = $this->entityManager->createQueryBuilder(); + $qb->select('COUNT(activity.id) as export_count_activity') ->from('ChillActivityBundle:Activity', 'activity') ; @@ -98,7 +113,7 @@ class CountActivity implements ExportInterface return array('export_count_activity'); } - public function getResult(QueryBuilder $qb, $data) + public function getResult($qb, $data) { return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR); } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index f7247068d..aa8f93660 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -60,6 +60,8 @@ services: chill.activity.export.count_activity: class: Chill\ActivityBundle\Export\Export\CountActivity + arguments: + - "@doctrine.orm.entity_manager" tags: - { name: chill.export, alias: 'count_activity' } From 79fa06640affb2ccd3b1fd319708e7eed38b8e6b Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Fri, 6 May 2016 16:31:04 +0200 Subject: [PATCH 093/163] Improving the timeline UI --- Resources/views/Timeline/activity_person_context.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/views/Timeline/activity_person_context.html.twig b/Resources/views/Timeline/activity_person_context.html.twig index 381db4174..686219619 100644 --- a/Resources/views/Timeline/activity_person_context.html.twig +++ b/Resources/views/Timeline/activity_person_context.html.twig @@ -1,5 +1,5 @@ -
                                    -

                                    {{ 'Activity'|trans }}

                                    +
                                    +

                                    {{ activity.date|localizeddate('long', 'none') }} / {{ 'Activity'|trans }}

                                    {{ '%user% has done an %activity_type% on %date%'|trans( { From dfaa4b096886b66ee8c1cd1ede2094ba57b14464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 7 Jun 2016 13:58:53 +0200 Subject: [PATCH 094/163] ordering activities by date fix #15 --- Controller/ActivityController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index da03b3150..f7a6dc80a 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -55,7 +55,10 @@ class ActivityController extends Controller $person->getCenter()); $activities = $em->getRepository('ChillActivityBundle:Activity') - ->findBy(array('person' => $person, 'scope' => $reachableScopes)); + ->findBy( + array('person' => $person, 'scope' => $reachableScopes), + array('date' => 'DESC') + ); return $this->render('ChillActivityBundle:Activity:list.html.twig', array( From 1e476b39da19e668368660613a7914b9757fe084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 8 Jun 2016 21:26:30 +0200 Subject: [PATCH 095/163] adding the possibility to remove activities fix #28 --- Controller/ActivityController.php | 70 ++++++++++++++----- DataFixtures/ORM/LoadActivitytACL.php | 8 ++- .../ChillActivityExtension.php | 3 +- Resources/config/routing/activity.yml | 2 +- Resources/translations/messages.fr.yml | 8 ++- .../views/Activity/confirm_delete.html.twig | 19 +++++ Resources/views/Activity/list.html.twig | 9 +++ Resources/views/Activity/show.html.twig | 18 ++++- Security/Authorization/ActivityVoter.php | 3 +- Tests/Controller/ActivityControllerTest.php | 37 +++++++++- 10 files changed, 152 insertions(+), 25 deletions(-) create mode 100644 Resources/views/Activity/confirm_delete.html.twig diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index f7a6dc80a..b0c09bc2e 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -309,30 +309,68 @@ class ActivityController extends Controller 'delete_form' => $deleteForm->createView(), )); } + /** * Deletes a Activity entity. * */ - public function deleteAction(Request $request, $id) + public function deleteAction(Request $request, $id, $person_id) { - $form = $this->createDeleteForm($id); - $form->handleRequest($request); + $em = $this->getDoctrine()->getManager(); + + /* @var $activity Activity */ + $activity = $em->getRepository('ChillActivityBundle:Activity') + ->find($id); + $person = $activity->getPerson(); - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find Activity entity.'); - } - - $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); - - $em->remove($entity); - $em->flush(); + if (!$activity) { + throw $this->createNotFoundException('Unable to find Activity entity.'); } + + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity); + + $form = $this->createDeleteForm($id, $person); + + if ($request->getMethod() === Request::METHOD_DELETE) { + $form->handleRequest($request); - return $this->redirect($this->generateUrl('activity')); + if ($form->isValid()) { + $logger = $this->get('chill.main.logger'); + + $logger->notice("An activity has been removed", array( + 'by_user' => $this->getUser()->getUsername(), + 'activity_id' => $activity->getId(), + 'person_id' => $activity->getPerson()->getId(), + 'remark' => $activity->getRemark(), + 'scope_id' => $activity->getScope()->getId(), + 'reasons_ids' => $activity->getReasons() + ->map(function ($ar) { return $ar->getId(); }) + ->toArray(), + 'type_id' => $activity->getType()->getId(), + 'duration' => $activity->getDurationTime()->format('U'), + 'date' => $activity->getDate()->format('Y-m-d'), + 'attendee' => $activity->getAttendee() + )); + + $em->remove($activity); + $em->flush(); + + $this->addFlash('success', $this->get('translator') + ->trans("The activity has been successfully removed.")); + + return $this->redirect($this->generateUrl( + 'chill_activity_activity_list', array( + 'person_id' => $person_id + ))); + } + } + + return $this->render('ChillActivityBundle:Activity:confirm_delete.html.twig', array( + 'activity' => $activity, + 'delete_form' => $form->createView() + )); + + } /** diff --git a/DataFixtures/ORM/LoadActivitytACL.php b/DataFixtures/ORM/LoadActivitytACL.php index e9d2d3092..e423f39f6 100644 --- a/DataFixtures/ORM/LoadActivitytACL.php +++ b/DataFixtures/ORM/LoadActivitytACL.php @@ -61,7 +61,7 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac break; } - printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE to %s " + printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE & CHILL_ACTIVITY_DELETE to %s " . "permission group, scope '%s' \n", $permissionsGroup->getName(), $scope->getName()['en']); $roleScopeUpdate = (new RoleScope()) @@ -72,8 +72,14 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac ->setRole('CHILL_ACTIVITY_CREATE') ->setScope($scope); $permissionsGroup->addRoleScope($roleScopeCreate); + $roleScopeDelete = (new RoleScope()) + ->setRole('CHILL_ACTIVITY_DELETE') + ->setScope($scope); + $permissionsGroup->addRoleScope($roleScopeDelete); + $manager->persist($roleScopeUpdate); $manager->persist($roleScopeCreate); + $manager->persist($roleScopeDelete); } } diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index d5a96f21b..20bcbbfed 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -79,7 +79,8 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf 'role_hierarchy' => array( ActivityVoter::UPDATE => array(ActivityVoter::SEE), ActivityVoter::CREATE => array(ActivityVoter::SEE), - ActivityVoter::SEE => array(ActivityStatsVoter::STATS) + ActivityVoter::SEE => array(ActivityStatsVoter::STATS), + ActivityVoter::DELETE => array(ActivityVoter::SEE) ) )); } diff --git a/Resources/config/routing/activity.yml b/Resources/config/routing/activity.yml index b2bc76201..6d287eec7 100644 --- a/Resources/config/routing/activity.yml +++ b/Resources/config/routing/activity.yml @@ -37,4 +37,4 @@ chill_activity_activity_update: chill_activity_activity_delete: path: /{_locale}/person/{person_id}/activity/{id}/delete defaults: { _controller: "ChillActivityBundle:Activity:delete" } - methods: [POST, DELETE] + methods: [GET, POST, DELETE] diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 9660908e0..8672649f3 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -53,6 +53,7 @@ Choose a type: Choisir un type CHILL_ACTIVITY_CREATE: Créer une activité CHILL_ACTIVITY_UPDATE: Modifier une activité CHILL_ACTIVITY_SEE: Voir une activité +CHILL_ACTIVITY_DELETE: Supprimer une activité # admin Activity configuration menu: Configuration des activités @@ -86,4 +87,9 @@ ActivityType list: Types d'activités Create a new activity type: Créer un nouveau type d'activité ActivityType creation: Nouveau type d'activité ActivityType: Type d'activité -ActivityType edit: Modifier une activité \ No newline at end of file +ActivityType edit: Modifier une activité + +# activity delete +Remove activity: Supprimer une activité +Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer une activité qui concerne "%name%" ? +The activity has been successfully removed.: L'activité a été supprimée. \ No newline at end of file diff --git a/Resources/views/Activity/confirm_delete.html.twig b/Resources/views/Activity/confirm_delete.html.twig new file mode 100644 index 000000000..3d3f9b0ae --- /dev/null +++ b/Resources/views/Activity/confirm_delete.html.twig @@ -0,0 +1,19 @@ +{% extends "ChillPersonBundle::layout.html.twig" %} + +{% set activeRouteKey = 'chill_activity_activity_list' %} +{% set person = activity.person %} + +{% block title 'Remove activity'|trans %} + +{% block personcontent %} + +{{ include('ChillMainBundle:Util:confirmation_template.html.twig', + { + 'title' : 'Remove activity'|trans, + 'confirm_question' : 'Are you sure you want to remove the activity about "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname } ), + 'cancel_route' : 'chill_activity_activity_list', + 'cancel_parameters' : { 'person_id' : activity.person.id, 'id' : activity.id }, + 'form' : delete_form + } ) }} + +{% endblock %} diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index cfaf9cf89..16f9ebed9 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -51,9 +51,18 @@
                                  • {{ 'show'|trans|capitalize }}
                                  • + {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
                                  • {{ 'Edit' | trans }}
                                  • + {% endif %} + {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %} +
                                  • + + {{ 'Delete'|trans }} + +
                                  • + {% endif %} {% endfor %} diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 292a35aa4..db769ee18 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -40,7 +40,19 @@
                                    - - {{ 'Edit the activity'|trans }} - + + {% endblock personcontent %} diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php index 0e9ffc2ed..d1318a485 100644 --- a/Security/Authorization/ActivityVoter.php +++ b/Security/Authorization/ActivityVoter.php @@ -33,6 +33,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleInterface const CREATE = 'CHILL_ACTIVITY_CREATE'; const SEE = 'CHILL_ACTIVITY_SEE'; const UPDATE = 'CHILL_ACTIVITY_UPDATE'; + const DELETE = 'CHILL_ACTIVITY_DELETE'; /** * @@ -47,7 +48,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleInterface protected function getSupportedAttributes() { - return array(self::CREATE, self::SEE, self::UPDATE); + return array(self::CREATE, self::SEE, self::UPDATE, self::DELETE); } protected function getSupportedClasses() diff --git a/Tests/Controller/ActivityControllerTest.php b/Tests/Controller/ActivityControllerTest.php index 81c280703..a9f840190 100644 --- a/Tests/Controller/ActivityControllerTest.php +++ b/Tests/Controller/ActivityControllerTest.php @@ -154,6 +154,22 @@ class ActivityControllerTest extends WebTestCase $this->assertGreaterThan(0, $crawler->filter('dd:contains("Foo")')->count(), 'Missing element dd:contains("Foo")'); + + // delete the actvity + $crawler = $client->click($crawler->selectLink("Supprimer")->link()); + + $button = $crawler->selectButton('Supprimer'); + + $form = $button->form(); + + $client->submit($form); + $this->assertTrue($client->getResponse()->isRedirect(sprintf('/en/person/%d/activity/', + $person->getId()))); + + $crawler = $client->followRedirect(); + + $this->assertNotContains('January 25, 2015', $crawler->text()); + } /** @@ -230,10 +246,29 @@ class ActivityControllerTest extends WebTestCase ->getRepository('ChillMainBundle:Center') ->findOneByName($centerName); - $reachableScopes = static::$kernel->getContainer() + // get scope reachable by both role UPDATE and DELETE + $reachableScopesUpdate = static::$kernel->getContainer() ->get('chill.main.security.authorization.helper') ->getReachableScopes($user, new Role('CHILL_ACTIVITY_UPDATE'), $center); + $reachableScopesDelete = static::$kernel->getContainer() + ->get('chill.main.security.authorization.helper') + ->getReachableScopes($user, new Role('CHILL_ACTIVITY_DELETE'), + $center); + $reachableScopesId = array_intersect( + array_map(function ($s) { return $s->getId(); }, $reachableScopesDelete), + array_map(function ($s) { return $s->getId(); }, $reachableScopesUpdate) + ); + if (count($reachableScopesId) === 0) { + throw new \RuntimeException("there are not scope reachable for " + . "both CHILL_ACTIVITY_UPDATE and CHILL_ACTIVITY_DELETE"); + } + + foreach($reachableScopesUpdate as $scope) { + if (in_array($scope->getId(), $reachableScopesId)) { + $reachableScopes[] = $scope; + } + } return $reachableScopes[array_rand($reachableScopes)]; } From ef76453fbc2513c570517474ecb1a443233c7aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 8 Jun 2016 21:35:31 +0200 Subject: [PATCH 096/163] add a title on page "list activities" and statement if empty fix #16 --- Resources/translations/messages.fr.yml | 1 + Resources/views/Activity/list.html.twig | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 8672649f3..15eee98d2 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -17,6 +17,7 @@ Update activity: Édition de l'activité Scope: Cercle Activity data: Données de l'activité No reason associated: Aucun sujet +There isn't any activities.: Aucune activité enregistrée. #forms Activity creation: Nouvelle activité diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index 16f9ebed9..d2d53d64c 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -23,6 +23,11 @@ {% block title %}{{ 'Activity list' |trans }}{% endblock title %} {% block personcontent %} +

                                    {{ 'Activity list' |trans }}

                                    + + {% if activities|length == 0 %} +

                                    {{ "There isn't any activities."|trans }}

                                    + {% else %} @@ -68,7 +73,8 @@ {% endfor %}
                                    - + {% endif %} +

                                    {{ 'Add a new activity' | trans }} From 09f46d804a38b7eed3c70772c082a917636f32d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 2 Sep 2016 08:23:43 +0200 Subject: [PATCH 097/163] adding translation for export --- Export/Export/CountActivity.php | 4 ++-- Resources/translations/messages.fr.yml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index 514da92d2..57ce19369 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -27,7 +27,7 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Doctrine\ORM\EntityManagerInterface; /** - * + * * * @author Julien Fastré */ @@ -53,7 +53,7 @@ class CountActivity implements ExportInterface public function getDescription() { - return "Count activities"; + return "Count activities by various parameters."; } public function getTitle() diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 15eee98d2..cfa46f634 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -93,4 +93,8 @@ ActivityType edit: Modifier une activité # activity delete Remove activity: Supprimer une activité Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer une activité qui concerne "%name%" ? -The activity has been successfully removed.: L'activité a été supprimée. \ No newline at end of file +The activity has been successfully removed.: L'activité a été supprimée. + +# exports +Count activities: Nombre d'activités +Count activities by various parameters.: Compte le nombre d'activités enregistrées en fonction de différents paramètres. From 79dd4bfac82db47b2a8ef29e35417aff05b7ccba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 2 Sep 2016 14:38:34 +0200 Subject: [PATCH 098/163] Removing the --testdox argument on phpunit This should improve the readability on tests result (which test fails). --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8d62a688..366fb05ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ before_script: test:php-5.6: stage: test - script: phpunit --testdox + script: phpunit test:php-7: stage: test - script: phpunit --testdox \ No newline at end of file + script: phpunit \ No newline at end of file From 5dda66342aa82b83d3514ad7ec7c151ef8448ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Nov 2016 23:00:13 +0100 Subject: [PATCH 099/163] add an "active" field on activity type --- Entity/ActivityType.php | 38 +++++++++++++++++++ Form/ActivityType.php | 3 +- Form/ActivityTypeType.php | 14 +++++-- Form/Type/TranslatableActivityType.php | 33 ++++++++-------- .../config/doctrine/ActivityType.orm.yml | 3 ++ .../migrations/Version20161114085659.php | 29 ++++++++++++++ Resources/views/ActivityType/index.html.twig | 18 ++++++--- .../Type/TranslatableActivityTypeTest.php | 9 +++-- 8 files changed, 116 insertions(+), 31 deletions(-) create mode 100644 Resources/migrations/Version20161114085659.php diff --git a/Entity/ActivityType.php b/Entity/ActivityType.php index 2af64f861..9e0065358 100644 --- a/Entity/ActivityType.php +++ b/Entity/ActivityType.php @@ -34,6 +34,8 @@ class ActivityType * @var array */ private $name; + + private $active = true; /** @@ -82,5 +84,41 @@ class ActivityType return $this->name; } } + + /** + * get active + * + * return true if the type is active. + * + * @return boolean true if the type is active + */ + public function getActive() { + return $this->active; + } + + /** + * get active + * + * return true if the type is active + * + * @return boolean true if the type is active + */ + public function isActive() { + return $this->getActive(); + } + + /** + * set active + * + * set to true if the type is active + * + * @param boolean $active + * @return \Chill\ActivityBundle\Entity\ActivityType + */ + public function setActive($active) { + $this->active = $active; + return $this; + } + } diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 23e829bb7..f3f92377d 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -114,7 +114,8 @@ class ActivityType extends AbstractType 'required' => false )) ->add('type', TranslatableActivityType::class, array( - 'placeholder' => 'Choose a type' + 'placeholder' => 'Choose a type', + 'active_only' => true )) ; diff --git a/Form/ActivityTypeType.php b/Form/ActivityTypeType.php index 278c23a9a..146f0abca 100644 --- a/Form/ActivityTypeType.php +++ b/Form/ActivityTypeType.php @@ -4,7 +4,8 @@ namespace Chill\ActivityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; class ActivityTypeType extends AbstractType { @@ -16,13 +17,20 @@ class ActivityTypeType extends AbstractType { $builder ->add('name', 'translatable_string') - ; + ->add('active', ChoiceType::class, array( + 'choices' => array( + 'Yes' => true, + 'No' => false + ), + 'choices_as_values' => true, + 'expanded' => true + )); } /** * @param OptionsResolverInterface $resolver */ - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Chill\ActivityBundle\Entity\ActivityType' diff --git a/Form/Type/TranslatableActivityType.php b/Form/Type/TranslatableActivityType.php index 6e4865bb7..89399e551 100644 --- a/Form/Type/TranslatableActivityType.php +++ b/Form/Type/TranslatableActivityType.php @@ -65,30 +65,27 @@ class TranslatableActivityType extends AbstractType return EntityType::class; } + public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options) { + /* @var $qb \Doctrine\ORM\QueryBuilder */ + $qb = $options['query_builder']; + + if ($options['active_only'] === true) { + $qb->where($qb->expr()->eq('at.active', ':active')); + $qb->setParameter('active', true, \Doctrine\DBAL\Types\Type::BOOLEAN); + } + } + public function configureOptions(OptionsResolver $resolver) { - // create a local copy for use in closures - $translatableStringHelper = $this->translatableStringHelper; - $types = $this->activityTypeRepository->findAll(); - - // sort by alphabetical order - usort($types, function(ActivityType $typeA, ActivityType $typeB) use ($translatableStringHelper) { - $strA = $translatableStringHelper->localize($typeA->getName()); - $strB = $translatableStringHelper->localize($typeB->getName()); - - if ($strA === $strB) { - return 0; - } - - return $strA < $strB ? -1 : 1; - }); $resolver->setDefaults( array( 'class' => 'ChillActivityBundle:ActivityType', - 'choices' => $types, - 'choice_label' => function (ActivityType $type) use ($translatableStringHelper) { - return $translatableStringHelper->localize($type->getName()); + 'active_only' => true, + 'query_builder' => $this->activityTypeRepository + ->createQueryBuilder('at'), + 'choice_label' => function (ActivityType $type) { + return $this->translatableStringHelper->localize($type->getName()); } ) ); diff --git a/Resources/config/doctrine/ActivityType.orm.yml b/Resources/config/doctrine/ActivityType.orm.yml index fb3878343..5965cd9a0 100644 --- a/Resources/config/doctrine/ActivityType.orm.yml +++ b/Resources/config/doctrine/ActivityType.orm.yml @@ -10,4 +10,7 @@ Chill\ActivityBundle\Entity\ActivityType: fields: name: type: json_array + active: + type: boolean + default: true lifecycleCallbacks: { } diff --git a/Resources/migrations/Version20161114085659.php b/Resources/migrations/Version20161114085659.php new file mode 100644 index 000000000..cd23b4ffa --- /dev/null +++ b/Resources/migrations/Version20161114085659.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE activitytype ADD active BOOLEAN NOT NULL DEFAULT \'t\''); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('ALTER TABLE ActivityType DROP active'); + } +} diff --git a/Resources/views/ActivityType/index.html.twig b/Resources/views/ActivityType/index.html.twig index e1b714888..7c4a77c89 100644 --- a/Resources/views/ActivityType/index.html.twig +++ b/Resources/views/ActivityType/index.html.twig @@ -23,6 +23,7 @@ {{ 'Name'|trans }} + {{ 'Active'|trans }} {{ 'Actions'|trans }} @@ -30,13 +31,20 @@ {% for entity in entities %} {{ entity.name|localize_translatable_string }} + + {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + -

                                      + @@ -45,9 +53,9 @@ -
                                        +
                                        • - + {{ 'Create a new activity type'|trans }}
                                        • diff --git a/Tests/Form/Type/TranslatableActivityTypeTest.php b/Tests/Form/Type/TranslatableActivityTypeTest.php index 89007d4d0..b0f1e6e95 100644 --- a/Tests/Form/Type/TranslatableActivityTypeTest.php +++ b/Tests/Form/Type/TranslatableActivityTypeTest.php @@ -67,11 +67,11 @@ class TranslatableActivityTypeTest extends KernelTestCase * * @return \Chill\ActivityBundle\Entity\ActivityType */ - protected function getRandomType() + protected function getRandomType($active = true) { $types = $this->container->get('doctrine.orm.entity_manager') ->getRepository('ChillActivityBundle:ActivityType') - ->findAll(); + ->findBy(array('active' => $active)); return $types[array_rand($types)]; } @@ -93,7 +93,8 @@ class TranslatableActivityTypeTest extends KernelTestCase $this->assertEquals($type->getId(), $form->getData()['type']->getId()); // test the ordering of the types in the form - $view = $form->createView(); + // since 2016-11-14 the types are not alphabetically ordered, skipping + /*$view = $form->createView(); $this->assertGreaterThan(0, count($view['type']->vars['choices']), "test that there are at least one choice"); @@ -106,7 +107,7 @@ class TranslatableActivityTypeTest extends KernelTestCase $this->assertTrue($previous < $choice->label); $previous = $choice->label; } - } + }*/ } From 9f3cdfdff8491428a26b59880f92dfbc58bdcc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 15 Nov 2016 14:32:11 +0100 Subject: [PATCH 100/163] improve layout of activity type form --- Resources/views/ActivityType/edit.html.twig | 24 +++++++++++++-------- Resources/views/ActivityType/new.html.twig | 22 +++++++++++-------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Resources/views/ActivityType/edit.html.twig b/Resources/views/ActivityType/edit.html.twig index 124e41065..fafcf519f 100644 --- a/Resources/views/ActivityType/edit.html.twig +++ b/Resources/views/ActivityType/edit.html.twig @@ -20,15 +20,21 @@

                                          {{ 'ActivityType edit'|trans }}

                                          {{ form_start(edit_form) }} + {{ form_row(edit_form.active) }} {{ form_row(edit_form.name) }} - {{ form_row(edit_form.submit, { 'attr' : { 'class' : 'sc-button orange' } } ) }} - {{ form_end(edit_form) }} + + - + + + {{ form_end(edit_form) }} {% endblock %} diff --git a/Resources/views/ActivityType/new.html.twig b/Resources/views/ActivityType/new.html.twig index 0b1f17829..d356e12d3 100644 --- a/Resources/views/ActivityType/new.html.twig +++ b/Resources/views/ActivityType/new.html.twig @@ -20,15 +20,19 @@

                                          {{ 'ActivityType creation'|trans }}

                                          {{ form_start(form) }} + {{ form_row(form.active) }} {{ form_row(form.name) }} - {{ form_row(form.submit, { 'attr' : { 'class' : 'sc-button blue' } } ) }} + + {{ form_end(form) }} - - + {% endblock %} From f37f78f3a8db5d1f907cb3ce7760ca6d97dc37a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 20 Nov 2016 22:21:44 +0100 Subject: [PATCH 101/163] adding deploy to packagist into pipeline --- .gitlab-ci.yml | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 366fb05ed..ba03dee4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,32 @@ -services: - - chill/database:latest - -before_script: - - composer config github-oauth.github.com $GITHUB_TOKEN - - composer install --no-interaction - - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml -# - php Test/Fixtures/App/app/console --env=test cache:warmup - - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction - - php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction +.test_definition: &test_definition + services: + - chill/database:latest + + before_script: + - composer config github-oauth.github.com $GITHUB_TOKEN + - composer install --no-interaction + - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml + # - php Test/Fixtures/App/app/console --env=test cache:warmup + - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction + - php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction test:php-5.6: stage: test + <<: *test_definition script: phpunit test:php-7: stage: test - script: phpunit \ No newline at end of file + <<: *test_definition + script: phpunit + + +deploy-packagist: + stage: deploy + image: chill/ci-image:php-7 + before_script: + # test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set + - if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi + - if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi + script: + - STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}") + - if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi From f4ec64c483bf4160e5de62d7bb61bece699e0097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 20 Nov 2016 22:24:20 +0100 Subject: [PATCH 102/163] fix error in gitlab-ci --- .gitlab-ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba03dee4f..2d1836adb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,23 +1,23 @@ .test_definition: &test_definition - services: - - chill/database:latest - - before_script: - - composer config github-oauth.github.com $GITHUB_TOKEN - - composer install --no-interaction - - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml - # - php Test/Fixtures/App/app/console --env=test cache:warmup - - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction - - php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction + services: + - chill/database:latest + + before_script: + - composer config github-oauth.github.com $GITHUB_TOKEN + - composer install --no-interaction + - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml + # - php Test/Fixtures/App/app/console --env=test cache:warmup + - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction + - php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction test:php-5.6: - stage: test - <<: *test_definition - script: phpunit + stage: test + <<: *test_definition + script: phpunit test:php-7: - stage: test - <<: *test_definition - script: phpunit + stage: test + <<: *test_definition + script: phpunit deploy-packagist: From d5d88ca95421233ea7199e7d11963b799c56d735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 12 Dec 2016 22:18:03 +0100 Subject: [PATCH 103/163] adding apigen & publicaiton of api --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++++++++ apigen.neon | 10 ++++++++++ 2 files changed, 47 insertions(+) create mode 100644 apigen.neon diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d1836adb..018aa7702 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,12 @@ - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction - php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction +stages: + - test + - deploy + - build-doc + - deploy-doc + test:php-5.6: stage: test <<: *test_definition @@ -30,3 +36,34 @@ deploy-packagist: script: - STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}") - if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi + +# deploy documentation +api-doc-build: + stage: build-doc + environment: api-doc + image: chill/ci-image:php-7 + before_script: + - mkdir api-doc + script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME + artifacts: + paths: + - "api-doc/" + name: api + expire_in: '2h' + only: + - master + - tags + +api-doc-deploy: + stage: deploy-doc + image: pallet/swiftclient:latest + before_script: + # test that CONTAINER_API variable is set + - if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi + # go to api-doc to have and url with PROJECT/BUILD + - cd api-doc + # upload, and keep files during 1 year + script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME" + only: + - master + - tags diff --git a/apigen.neon b/apigen.neon new file mode 100644 index 000000000..5fefb1f80 --- /dev/null +++ b/apigen.neon @@ -0,0 +1,10 @@ +# configuration for apigen + +source: + - . + +exclude: + - vendor/* + - Test* + +title: Chill Activity Bundle From 96bb765b03358dda14a8f67dbc7bdb25137a0563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 18 Dec 2016 21:57:08 +0100 Subject: [PATCH 104/163] remove memory_limit on composer install --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 018aa7702..0164ffc9f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ before_script: - composer config github-oauth.github.com $GITHUB_TOKEN - - composer install --no-interaction + - php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml # - php Test/Fixtures/App/app/console --env=test cache:warmup - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction From a7dfc5e1bd3642a0450e3cc1265dc0b95070eb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 12 Jan 2017 14:42:18 +0100 Subject: [PATCH 105/163] moving export services definition to new file --- .../ChillActivityExtension.php | 1 + Resources/config/services.yml | 19 ------------------- Resources/config/services/export.yml | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 Resources/config/services/export.yml diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 20bcbbfed..a26343419 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -49,6 +49,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); + $loader->load('services/export.yml'); $loader->load('services/repositories.yml'); } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index aa8f93660..3df2ececf 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -57,22 +57,3 @@ services: - '@security.token_storage' tags: - { name: chill.timeline, context: 'person' } - - chill.activity.export.count_activity: - class: Chill\ActivityBundle\Export\Export\CountActivity - arguments: - - "@doctrine.orm.entity_manager" - tags: - - { name: chill.export, alias: 'count_activity' } - - chill.activity.export.reason_filter: - class: Chill\ActivityBundle\Export\Filter\ActivityReasonFilter - arguments: - - "@chill.main.helper.translatable_string" - tags: - - { name: chill.export_filter, alias: 'activity_reason_filter' } - - chill.activity.export.reason_aggregator: - class: Chill\ActivityBundle\Export\Aggregator\ReasonAggregator - tags: - - { name: chill.export_aggregator, alias: activity_reason } \ No newline at end of file diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml new file mode 100644 index 000000000..94875c3c2 --- /dev/null +++ b/Resources/config/services/export.yml @@ -0,0 +1,19 @@ +services: + chill.activity.export.count_activity: + class: Chill\ActivityBundle\Export\Export\CountActivity + arguments: + - "@doctrine.orm.entity_manager" + tags: + - { name: chill.export, alias: 'count_activity' } + + chill.activity.export.reason_filter: + class: Chill\ActivityBundle\Export\Filter\ActivityReasonFilter + arguments: + - "@chill.main.helper.translatable_string" + tags: + - { name: chill.export_filter, alias: 'activity_reason_filter' } + + chill.activity.export.reason_aggregator: + class: Chill\ActivityBundle\Export\Aggregator\ReasonAggregator + tags: + - { name: chill.export_aggregator, alias: activity_reason } From 2997614a04861a8c33afd5611d60bd5000e83ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 12 Jan 2017 15:25:21 +0100 Subject: [PATCH 106/163] update export & aggregator & filter to new api + add tests --- .gitignore | 1 + Export/Aggregator/ReasonAggregator.php | 133 +++++++++++++++--- Export/Export/CountActivity.php | 11 +- Export/Filter/ActivityReasonFilter.php | 61 +++++++- Resources/config/services/export.yml | 5 + Resources/config/services/repositories.yml | 12 ++ Resources/translations/messages.fr.yml | 10 ++ .../Aggregator/ReasonAggregatorTest.php | 93 ++++++++++++ Tests/Export/Export/CountActivityTest.php | 50 +++++++ .../Filter/ActivityReasonFilterTest.php | 109 ++++++++++++++ 10 files changed, 459 insertions(+), 26 deletions(-) create mode 100644 Tests/Export/Aggregator/ReasonAggregatorTest.php create mode 100644 Tests/Export/Export/CountActivityTest.php create mode 100644 Tests/Export/Filter/ActivityReasonFilterTest.php diff --git a/.gitignore b/.gitignore index 4b827b7fb..c71baeafc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Tests/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/cache/* Test/Fixtures/App/app/config/parameters.yml +/nbproject/private/ \ No newline at end of file diff --git a/Export/Aggregator/ReasonAggregator.php b/Export/Aggregator/ReasonAggregator.php index 5698d4071..c6504ae7b 100644 --- a/Export/Aggregator/ReasonAggregator.php +++ b/Export/Aggregator/ReasonAggregator.php @@ -24,6 +24,8 @@ use Doctrine\ORM\QueryBuilder; use Chill\MainBundle\Export\AggregatorInterface; use Symfony\Component\Security\Core\Role\Role; use Chill\ActivityBundle\Security\Authorization\ActivityVoter; +use Doctrine\ORM\EntityRepository; +use Chill\MainBundle\Templating\TranslatableStringHelper; /** * @@ -32,26 +34,65 @@ use Chill\ActivityBundle\Security\Authorization\ActivityVoter; */ class ReasonAggregator implements AggregatorInterface { + /** + * + * @var EntityRepository + */ + protected $categoryRepository; + + /** + * + * @var EntityRepository + */ + protected $reasonRepository; + + /** + * + * @var TranslatableStringHelper + */ + protected $stringHelper; + + public function __construct( + EntityRepository $categoryRepository, + EntityRepository $reasonRepository, + TranslatableStringHelper $stringHelper + ) { + $this->categoryRepository = $categoryRepository; + $this->reasonRepository = $reasonRepository; + $this->stringHelper = $stringHelper; + } + public function alterQuery(QueryBuilder $qb, $data) { // add select element - if ($data['level'] === 'reason') { - $elem = 'reason.id'; - $alias = 'activity_reason_id'; - } elseif ($data['level'] === 'category') { + if ($data['level'] === 'reasons') { + $elem = 'reasons.id'; + $alias = 'activity_reasons_id'; + } elseif ($data['level'] === 'categories') { $elem = 'category.id'; - $alias = 'activity_category_id'; + $alias = 'activity_categories_id'; } else { - throw new \RuntimeException('the data provided are not recognised'); + throw new \RuntimeException('the data provided are not recognized'); } $qb->addSelect($elem.' as '.$alias); + // make a jointure only if needed + // add a join to reasons only if needed + if (array_key_exists('activity', $qb->getDQLPart('join'))) { + // we want to avoid multiple join on same object + if (!$this->checkJoinAlreadyDefined($qb->getDQLPart('join')['activity'], 'reasons')) { + $qb->add('join', new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')); + } + } else { + $qb->join('activity.reasons', 'reasons'); + } - // make a jointure - $qb->join('activity.reason', 'reason'); // join category if necessary - if ($alias === 'activity_category_id') { - $qb->join('reason.category', 'category'); + if ($alias === 'activity_categories_id') { + // add join only if needed + if (!$this->checkJoinAlreadyDefined($qb->getDQLPart('join')['activity'], 'category')) { + $qb->join('reasons.category', 'category'); + } } // add the "group by" part @@ -63,6 +104,24 @@ class ReasonAggregator implements AggregatorInterface $qb->groupBy($alias); } } + + /** + * Check if a join between Activity and another alias + * + * @param Join[] $joins + * @param string $alias the alias to search for + * @return boolean + */ + private function checkJoinAlreadyDefined(array $joins, $alias) + { + foreach ($joins as $join) { + if ($join->getAlias() === $alias) { + return true; + } + } + + return false; + } public function applyOn() { @@ -73,12 +132,13 @@ class ReasonAggregator implements AggregatorInterface { $builder->add('level', 'choice', array( 'choices' => array( - 'By reason' => 'reason', - 'By category of reason' => 'category' + 'By reason' => 'reasons', + 'By category of reason' => 'categories' ), 'choices_as_values' => true, 'multiple' => false, - 'expanded' => true + 'expanded' => true, + 'label' => 'Reason\'s level' )); } @@ -94,17 +154,54 @@ class ReasonAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return array_combine($values, $values); + // for performance reason, we load data from db only once + switch ($data['level']) { + case 'reasons': + $this->reasonRepository->findBy(array('id' => $values)); + break; + case 'categories': + $this->categoryRepository->findBy(array('id' => $values)); + break; + default: + throw new \RuntimeException(sprintf("the level data '%s' is invalid", + $data['level'])); + } + + return function($value) use ($data) { + if ($value === '_header') { + return $data['level'] === 'reasons' ? + 'Group by reasons' + : + 'Group by categories of reason' + ; + } + + switch ($data['level']) { + case 'reasons': + $n = $this->reasonRepository->find($value) + ->getName() + ; + break; + case 'categories': + $n = $this->categoryRepository->find($value) + ->getName() + ; + break; + // no need for a default : the default was already set above + } + + return $this->stringHelper->localize($n); + }; } public function getQueryKeys($data) { // add select element - if ($data['level'] === 'reason') { - return array('activity_reason_id'); - } elseif ($data['level'] === 'category') { - return array ('activity_category_id'); + if ($data['level'] === 'reasons') { + return array('activity_reasons_id'); + } elseif ($data['level'] === 'categories') { + return array ('activity_categories_id'); } else { throw new \RuntimeException('the data provided are not recognised'); } diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index 57ce19369..cdab3dd74 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -102,10 +102,13 @@ class CountActivity implements ExportInterface throw new \LogicException("the key $key is not used by this export"); } - $labels = array_combine($values, $values); - $labels['_header'] = 'Number of activities'; - - return $labels; + return function($value) { + return $value === '_header' ? + 'Number of activities' + : + $value + ; + }; } public function getQueryKeys($data) diff --git a/Export/Filter/ActivityReasonFilter.php b/Export/Filter/ActivityReasonFilter.php index 9f2059fbe..32b05b01e 100644 --- a/Export/Filter/ActivityReasonFilter.php +++ b/Export/Filter/ActivityReasonFilter.php @@ -28,6 +28,8 @@ use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\Query\Expr; use Symfony\Component\Security\Core\Role\Role; use Chill\ActivityBundle\Security\Authorization\ActivityVoter; +use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\Query\Expr\Join; /** * @@ -40,18 +42,38 @@ class ActivityReasonFilter implements FilterInterface * * @var TranslatableStringHelper */ - public $translatableStringHelper; + protected $translatableStringHelper; - public function __construct(TranslatableStringHelper $helper) - { + /** + * The repository for activity reasons + * + * @var EntityRepository + */ + protected $reasonRepository; + + public function __construct( + TranslatableStringHelper $helper, + EntityRepository $reasonRepository + ) { $this->translatableStringHelper = $helper; + $this->reasonRepository = $reasonRepository; } public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); - $clause = $qb->expr()->in('activity.reason', ':selected_activity_reasons'); + $join = $qb->getDQLPart('join'); + $clause = $qb->expr()->in('reasons', ':selected_activity_reasons'); + // add a join to reasons only if needed + if (array_key_exists('activity', $join)) { + // we want to avoid multiple join on same object + if (!$this->checkJoinAlreadyDefined($join['activity'])) { + $qb->add('join', new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')); + } + } else { + $qb->join('activity.reasons', 'reasons'); + } if ($where instanceof Expr\Andx) { $where->add($clause); @@ -62,6 +84,23 @@ class ActivityReasonFilter implements FilterInterface $qb->add('where', $where); $qb->setParameter('selected_activity_reasons', $data['reasons']); } + + /** + * Check if a join between Activity and Reason is already defined + * + * @param Join[] $joins + * @return boolean + */ + private function checkJoinAlreadyDefined(array $joins) + { + foreach ($joins as $join) { + if ($join->getAlias() === 'reasons') { + return true; + } + } + + return false; + } public function applyOn() { @@ -95,4 +134,18 @@ class ActivityReasonFilter implements FilterInterface { return new Role(ActivityVoter::SEE); } + + public function describeAction($data, $format = 'string') + { + // collect all the reasons'name used in this filter in one array + $reasonsNames = array_map( + function(ActivityReason $r) { + return "\"".$this->translatableStringHelper->localize($r->getName())."\""; + }, + $this->reasonRepository->findBy(array('id' => $data['reasons']->toArray())) + ); + + return array("Filtered by reasons: only %list%", + ["%list%" => implode(", ", $reasonsNames)]); + } } diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml index 94875c3c2..26b69ebab 100644 --- a/Resources/config/services/export.yml +++ b/Resources/config/services/export.yml @@ -10,10 +10,15 @@ services: class: Chill\ActivityBundle\Export\Filter\ActivityReasonFilter arguments: - "@chill.main.helper.translatable_string" + - "@chill_activity.repository.reason" tags: - { name: chill.export_filter, alias: 'activity_reason_filter' } chill.activity.export.reason_aggregator: class: Chill\ActivityBundle\Export\Aggregator\ReasonAggregator + arguments: + - "@chill_activity.repository.reason_category" + - "@chill_activity.repository.reason" + - "@chill.main.helper.translatable_string" tags: - { name: chill.export_aggregator, alias: activity_reason } diff --git a/Resources/config/services/repositories.yml b/Resources/config/services/repositories.yml index 967c67bc3..2867782b4 100644 --- a/Resources/config/services/repositories.yml +++ b/Resources/config/services/repositories.yml @@ -4,3 +4,15 @@ services: factory: ['@doctrine.orm.entity_manager', getRepository] arguments: - 'Chill\ActivityBundle\Entity\ActivityType' + + chill_activity.repository.reason: + class: Doctrine\ORM\EntityRepository + factory: ['@doctrine.orm.entity_manager', getRepository] + arguments: + - 'Chill\ActivityBundle\Entity\ActivityReason' + + chill_activity.repository.reason_category: + class: Doctrine\ORM\EntityRepository + factory: ['@doctrine.orm.entity_manager', getRepository] + arguments: + - 'Chill\ActivityBundle\Entity\ActivityReasonCategory' diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index cfa46f634..dfa72bb7a 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -98,3 +98,13 @@ The activity has been successfully removed.: L'activité a été supprimée. # exports Count activities: Nombre d'activités Count activities by various parameters.: Compte le nombre d'activités enregistrées en fonction de différents paramètres. + +#filters +Filter by reason: Filtrer par sujet d'activité +'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%' + +#aggregators +Aggregate by activity reason: Aggréger par sujet de l'activité +By reason: Par sujet +By category of reason: Par catégorie de sujet +Reason's level: Niveau du sujet diff --git a/Tests/Export/Aggregator/ReasonAggregatorTest.php b/Tests/Export/Aggregator/ReasonAggregatorTest.php new file mode 100644 index 000000000..f508fcde2 --- /dev/null +++ b/Tests/Export/Aggregator/ReasonAggregatorTest.php @@ -0,0 +1,93 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Aggregator; + +use Chill\MainBundle\Test\Export\AbstractAggregatorTest; + +/** + * + * + * @author Julien Fastré + */ +class ReasonAggregatorTest extends AbstractAggregatorTest +{ + /** + * + * @var \Chill\ActivityBundle\Export\Aggregator\ReasonAggregator + */ + private $aggregator; + + public function setUp() + { + static::bootKernel(); + + $container = static::$kernel->getContainer(); + + $this->aggregator = $container->get('chill.activity.export.reason_aggregator'); + + // add a fake request with a default locale (used in translatable string) + $prophet = new \Prophecy\Prophet; + $request = $prophet->prophesize(); + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $container->get('request_stack') + ->push($request->reveal()); + } + + public function getAggregator() + { + return $this->aggregator; + } + + public function getFormData() + { + return array( + array('level' => 'reasons'), + array('level' => 'categories') + ); + } + + public function getQueryBuilders() + { + if (static::$kernel === null) { + static::bootKernel(); + } + + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager'); + + return array( + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons') + ->join('reasons.category', 'category') + ); + } + +} diff --git a/Tests/Export/Export/CountActivityTest.php b/Tests/Export/Export/CountActivityTest.php new file mode 100644 index 000000000..4f9918fd0 --- /dev/null +++ b/Tests/Export/Export/CountActivityTest.php @@ -0,0 +1,50 @@ + + */ +class CountActivityTest extends AbstractExportTest +{ + /** + * + * @var + */ + private $export; + + public function setUp() + { + static::bootKernel(); + + /* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ + $container = self::$kernel->getContainer(); + + $this->export = $container->get('chill.activity.export.count_activity'); + } + + public function getExport() + { + return $this->export; + } + + public function getFormData() + { + return array( + array() + ); + } + + public function getModifiersCombination() + { + return array( + array('activity'), + array('activity', 'person') + ); + } + +} diff --git a/Tests/Export/Filter/ActivityReasonFilterTest.php b/Tests/Export/Filter/ActivityReasonFilterTest.php new file mode 100644 index 000000000..1c4ca4c21 --- /dev/null +++ b/Tests/Export/Filter/ActivityReasonFilterTest.php @@ -0,0 +1,109 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Filter; + +use Chill\MainBundle\Test\Export\AbstractFilterTest; +use Doctrine\Common\Collections\ArrayCollection; + +/** + * + * + * @author Julien Fastré + */ +class ActivityReasonFilterTest extends AbstractFilterTest +{ + /** + * + * @var \Chill\PersonBundle\Export\Filter\GenderFilter + */ + private $filter; + + public function setUp() + { + static::bootKernel(); + + $container = static::$kernel->getContainer(); + + $this->filter = $container->get('chill.activity.export.reason_filter'); + + // add a fake request with a default locale (used in translatable string) + $prophet = new \Prophecy\Prophet; + $request = $prophet->prophesize(); + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $container->get('request_stack') + ->push($request->reveal()); + } + + + public function getFilter() + { + return $this->filter; + } + + public function getFormData() + { + if (static::$kernel === null) { + static::bootKernel(); + } + + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager') + ; + + $reasons = $em->createQuery("SELECT reason " + . "FROM ChillActivityBundle:ActivityReason reason") + ->getResult(); + + // generate an array of 5 different combination of results + for ($i=0; $i < 5; $i++) { + $r[] = array('reasons' => new ArrayCollection(array_splice($reasons, ($i + 1) * -1))); + } + + return $r; + } + + public function getQueryBuilders() + { + if (static::$kernel === null) { + static::bootKernel(); + } + + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager'); + + return array( + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons') + ->join('reasons.category', 'category') + ); + } + +} From 9ad651a5d8609303b02465837e7d2a0cf3b8f09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 12 Jan 2017 17:59:06 +0100 Subject: [PATCH 107/163] rename ReasonAggregator => ActivityReasonAggregator for consistency --- .../{ReasonAggregator.php => ActivityReasonAggregator.php} | 2 +- Resources/config/services/export.yml | 2 +- ...nAggregatorTest.php => ActivityReasonAggregatorTest.php} | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename Export/Aggregator/{ReasonAggregator.php => ActivityReasonAggregator.php} (99%) rename Tests/Export/Aggregator/{ReasonAggregatorTest.php => ActivityReasonAggregatorTest.php} (93%) diff --git a/Export/Aggregator/ReasonAggregator.php b/Export/Aggregator/ActivityReasonAggregator.php similarity index 99% rename from Export/Aggregator/ReasonAggregator.php rename to Export/Aggregator/ActivityReasonAggregator.php index c6504ae7b..8bcf9d1c8 100644 --- a/Export/Aggregator/ReasonAggregator.php +++ b/Export/Aggregator/ActivityReasonAggregator.php @@ -32,7 +32,7 @@ use Chill\MainBundle\Templating\TranslatableStringHelper; * * @author Julien Fastré */ -class ReasonAggregator implements AggregatorInterface +class ActivityReasonAggregator implements AggregatorInterface { /** * diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml index 26b69ebab..3221a4ab5 100644 --- a/Resources/config/services/export.yml +++ b/Resources/config/services/export.yml @@ -15,7 +15,7 @@ services: - { name: chill.export_filter, alias: 'activity_reason_filter' } chill.activity.export.reason_aggregator: - class: Chill\ActivityBundle\Export\Aggregator\ReasonAggregator + class: Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator arguments: - "@chill_activity.repository.reason_category" - "@chill_activity.repository.reason" diff --git a/Tests/Export/Aggregator/ReasonAggregatorTest.php b/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php similarity index 93% rename from Tests/Export/Aggregator/ReasonAggregatorTest.php rename to Tests/Export/Aggregator/ActivityReasonAggregatorTest.php index f508fcde2..a79ee50d3 100644 --- a/Tests/Export/Aggregator/ReasonAggregatorTest.php +++ b/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php @@ -22,15 +22,15 @@ namespace Chill\ActivityBundle\Tests\Aggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; /** - * + * Add tests for ActivityReasonAggregator * * @author Julien Fastré */ -class ReasonAggregatorTest extends AbstractAggregatorTest +class ActivityReasonAggregatorTest extends AbstractAggregatorTest { /** * - * @var \Chill\ActivityBundle\Export\Aggregator\ReasonAggregator + * @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator */ private $aggregator; From f792d02e435901146c10885a61b47d9035de633d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 16 Jan 2017 15:20:08 +0100 Subject: [PATCH 108/163] fix error: add missing return statements --- Security/Authorization/ActivityStatsVoter.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Security/Authorization/ActivityStatsVoter.php b/Security/Authorization/ActivityStatsVoter.php index 94eedf1fb..f3285ba7e 100644 --- a/Security/Authorization/ActivityStatsVoter.php +++ b/Security/Authorization/ActivityStatsVoter.php @@ -32,6 +32,7 @@ use Chill\ActivityBundle\Security\Authorization\ActivityVoter; class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterface { const STATS = 'CHILL_ACTIVITY_STATS'; + const LISTS = 'CHILL_ACTIVITY_LIST'; /** * @@ -46,7 +47,7 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterf protected function getSupportedAttributes() { - return array(self::STATS, ActivityVoter::SEE); + return array(self::STATS, ActivityVoter::SEE, self::LISTS); } protected function getSupportedClasses() @@ -65,12 +66,12 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterf public function getRoles() { - $this->getSupportedAttributes(); + return $this->getSupportedAttributes(); } public function getRolesWithoutScope() { - $this->getSupportedAttributes(); + return $this->getSupportedAttributes(); } } From faf5b7ca9416615a6c60594d311984407ebb7348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 16 Jan 2017 15:22:41 +0100 Subject: [PATCH 109/163] fix role hierarchy --- DependencyInjection/ChillActivityExtension.php | 1 - Security/Authorization/ActivityStatsVoter.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index a26343419..613fa7493 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -80,7 +80,6 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf 'role_hierarchy' => array( ActivityVoter::UPDATE => array(ActivityVoter::SEE), ActivityVoter::CREATE => array(ActivityVoter::SEE), - ActivityVoter::SEE => array(ActivityStatsVoter::STATS), ActivityVoter::DELETE => array(ActivityVoter::SEE) ) )); diff --git a/Security/Authorization/ActivityStatsVoter.php b/Security/Authorization/ActivityStatsVoter.php index f3285ba7e..66788041a 100644 --- a/Security/Authorization/ActivityStatsVoter.php +++ b/Security/Authorization/ActivityStatsVoter.php @@ -22,7 +22,7 @@ namespace Chill\ActivityBundle\Security\Authorization; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\ProvideRoleInterface; -use Chill\ActivityBundle\Security\Authorization\ActivityVoter; +use Chill\MainBundle\Entity\Center; /** * @@ -47,12 +47,12 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterf protected function getSupportedAttributes() { - return array(self::STATS, ActivityVoter::SEE, self::LISTS); + return array(self::STATS, self::LISTS); } protected function getSupportedClasses() { - return array('Chill\MainBundle\Entity\Center'); + return array(Center::class); } protected function isGranted($attribute, $object, $user = null) From b36ec02b6542879f2bb694c300a2b14510986234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 16 Jan 2017 19:53:27 +0100 Subject: [PATCH 110/163] fix required role --- Export/Aggregator/ActivityReasonAggregator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Export/Aggregator/ActivityReasonAggregator.php b/Export/Aggregator/ActivityReasonAggregator.php index 8bcf9d1c8..a0d01baf2 100644 --- a/Export/Aggregator/ActivityReasonAggregator.php +++ b/Export/Aggregator/ActivityReasonAggregator.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Doctrine\ORM\QueryBuilder; use Chill\MainBundle\Export\AggregatorInterface; use Symfony\Component\Security\Core\Role\Role; -use Chill\ActivityBundle\Security\Authorization\ActivityVoter; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Doctrine\ORM\EntityRepository; use Chill\MainBundle\Templating\TranslatableStringHelper; @@ -149,7 +149,7 @@ class ActivityReasonAggregator implements AggregatorInterface public function addRole() { - return new Role(ActivityVoter::SEE); + return new Role(ActivityStatsVoter::STATS); } public function getLabels($key, array $values, $data) From 67c8c19885bcfb6ca3f0643429cee1875b04fd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 17 Jan 2017 00:34:32 +0100 Subject: [PATCH 111/163] improve exports & add new filter, export, aggregators --- .../Aggregator/ActivityReasonAggregator.php | 41 ++- Export/Export/ListActivity.php | 287 ++++++++++++++++++ Export/Filter/ActivityDateFilter.php | 132 ++++++++ Export/Filter/ActivityReasonFilter.php | 31 +- .../PersonHavingActivityBetweenDateFilter.php | 205 +++++++++++++ Resources/config/services/export.yml | 26 +- Resources/translations/messages.fr.yml | 6 + Tests/Export/Export/ListActivityTest.php | 93 ++++++ 8 files changed, 793 insertions(+), 28 deletions(-) create mode 100644 Export/Export/ListActivity.php create mode 100644 Export/Filter/ActivityDateFilter.php create mode 100644 Export/Filter/PersonHavingActivityBetweenDateFilter.php create mode 100644 Tests/Export/Export/ListActivityTest.php diff --git a/Export/Aggregator/ActivityReasonAggregator.php b/Export/Aggregator/ActivityReasonAggregator.php index a0d01baf2..b33c321ee 100644 --- a/Export/Aggregator/ActivityReasonAggregator.php +++ b/Export/Aggregator/ActivityReasonAggregator.php @@ -26,6 +26,7 @@ use Symfony\Component\Security\Core\Role\Role; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Doctrine\ORM\EntityRepository; use Chill\MainBundle\Templating\TranslatableStringHelper; +use Doctrine\ORM\Query\Expr\Join; /** * @@ -76,15 +77,23 @@ class ActivityReasonAggregator implements AggregatorInterface } $qb->addSelect($elem.' as '.$alias); + // make a jointure only if needed - // add a join to reasons only if needed - if (array_key_exists('activity', $qb->getDQLPart('join'))) { - // we want to avoid multiple join on same object - if (!$this->checkJoinAlreadyDefined($qb->getDQLPart('join')['activity'], 'reasons')) { - $qb->add('join', new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')); - } - } else { - $qb->join('activity.reasons', 'reasons'); + $join = $qb->getDQLPart('join'); + if ( + (array_key_exists('activity', $join) + && + !$this->checkJoinAlreadyDefined($join['activity'], 'reasons') + ) + OR + (! array_key_exists('activity', $join)) + ) { + $qb->add( + 'join', + array('activity' => + new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons') + ), + true); } // join category if necessary @@ -178,19 +187,21 @@ class ActivityReasonAggregator implements AggregatorInterface switch ($data['level']) { case 'reasons': - $n = $this->reasonRepository->find($value) - ->getName() + /* @var $r \Chill\ActivityBundle\Entity\ActivityReason */ + $r = $this->reasonRepository->find($value); + + return $this->stringHelper->localize($r->getCategory()->getName()) + ." > " + . $this->stringHelper->localize($r->getName()); ; break; case 'categories': - $n = $this->categoryRepository->find($value) - ->getName() - ; + $c = $this->categoryRepository->find($value); + + return $this->stringHelper->localize($c->getName()); break; // no need for a default : the default was already set above } - - return $this->stringHelper->localize($n); }; } diff --git a/Export/Export/ListActivity.php b/Export/Export/ListActivity.php new file mode 100644 index 000000000..394d16df8 --- /dev/null +++ b/Export/Export/ListActivity.php @@ -0,0 +1,287 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Export; + +use Chill\MainBundle\Export\ListInterface; +use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\MainBundle\Entity\User; +use Chill\MainBundle\Entity\Scope; +use Chill\ActivityBundle\Entity\ActivityType; +use Doctrine\ORM\Query\Expr; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Component\Security\Core\Role\Role; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; +use Symfony\Component\Form\FormBuilderInterface; +use Doctrine\ORM\EntityManagerInterface; +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\Constraints\Callback; +use Doctrine\ORM\Query; +use Chill\MainBundle\Export\FormatterInterface; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Validator\Context\ExecutionContextInterface; + +/** + * Create a list for all activities + * + * @author Julien Fastré + */ +class ListActivity implements ListInterface +{ + + /** + * + * @var EntityManagerInterface + */ + protected $entityManager; + + /** + * + * @var TranslatorInterface + */ + protected $translator; + + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + protected $fields = array( + 'id', + 'date', + 'durationTime', + 'attendee', + 'list_reasons', + 'user_username', + 'circle_name', + 'type_name', + 'person_firstname', + 'person_lastname', + 'person_id' + ); + + public function __construct( + EntityManagerInterface $em, + TranslatorInterface $translator, + TranslatableStringHelper $translatableStringHelper + ) + { + $this->entityManager = $em; + $this->translator = $translator; + $this->translatableStringHelper = $translatableStringHelper; + } + + /** + * {@inheritDoc} + * + * @param FormBuilderInterface $builder + */ + public function buildForm(FormBuilderInterface $builder) + { + $builder->add('fields', ChoiceType::class, array( + 'multiple' => true, + 'expanded' => true, + 'choices' => array_combine($this->fields, $this->fields), + 'label' => 'Fields to include in export', + 'constraints' => [new Callback(array( + 'callback' => function($selected, ExecutionContextInterface $context) { + if (count($selected) === 0) { + $context->buildViolation('You must select at least one element') + ->atPath('fields') + ->addViolation(); + } + } + ))] + )); + + } + + /** + * {@inheritDoc} + * + * @return type + */ + public function getAllowedFormattersTypes() + { + return array(FormatterInterface::TYPE_LIST); + } + + public function getDescription() + { + return "List activities"; + } + + public function getLabels($key, array $values, $data) + { + switch ($key) + { + case 'date' : + return function($value) { + if ($value === '_header') return 'date'; + + $date = \DateTime::createFromFormat('Y-m-d H:i:s', $value); + + return $date->format('d-m-Y'); + }; + case 'attendee': + return function($value) { + if ($value === '_header') return 'attendee'; + + return $value ? 1 : 0; + }; + case 'list_reasons' : + /* @var $activityReasonsRepository EntityRepository */ + $activityRepository = $this->entityManager + ->getRepository('ChillActivityBundle:Activity'); + + return function($value) use ($activityRepository) { + if ($value === '_header') return 'activity reasons'; + + $activity = $activityRepository + ->find($value); + + return implode(", ", array_map(function(ActivityReason $r) { + + return '"'. + $this->translatableStringHelper->localize($r->getCategory()->getName()) + .' > '. + $this->translatableStringHelper->localize($r->getName()) + .'"'; + }, $activity->getReasons()->toArray())); + }; + case 'circle_name' : + return function($value) { + if ($value === '_header') return 'circle'; + + return $this->translatableStringHelper + ->localize(json_decode($value, true)); + }; + case 'type_name' : + return function($value) { + if ($value === '_header') return 'activity type'; + + return $this->translatableStringHelper + ->localize(json_decode($value, true)); + }; + default: + return function($value) use ($key) { + if ($value === '_header') return $key; + + return $value; + }; + } + } + + public function getQueryKeys($data) + { + return $data['fields']; + } + + public function getResult($query, $data) + { + return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); + } + + public function getTitle() + { + return 'List activities'; + } + + public function getType() + { + return 'activity'; + } + + public function initiateQuery(array $requiredModifiers, array $acl, array $data = array()) + { + $centers = array_map(function($el) { return $el['center']; }, $acl); + + // throw an error if any fields are present + if (!\array_key_exists('fields', $data)) { + throw new \Doctrine\DBAL\Exception\InvalidArgumentException("any fields " + . "have been checked"); + } + + $qb = $this->entityManager->createQueryBuilder(); + + $qb + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.person', 'person') + ->join('person.center', 'center') + ->andWhere('center IN (:authorized_centers)') + ->setParameter('authorized_centers', $centers); + ; + + foreach ($this->fields as $f) { + if (in_array($f, $data['fields'])) { + switch ($f) { + case 'id': + $qb->addSelect('activity.id AS id'); + break; + case 'person_firstname': + $qb->addSelect('person.firstName AS person_firstname'); + break; + case 'person_lastname': + $qb->addSelect('person.lastName AS person_lastname'); + break; + case 'person_id': + $qb->addSelect('person.id AS person_id'); + break; + case 'user_username': + $qb->join('activity.user', 'user'); + $qb->addSelect('user.username AS user_username'); + break; + case 'circle_name': + $qb->join('activity.scope', 'circle'); + $qb->addSelect('circle.name AS circle_name'); + break; + case 'type_name': + $qb->join('activity.type', 'type'); + $qb->addSelect('type.name AS type_name'); + break; + case 'list_reasons': + // this is a trick... The reasons is filled with the + // activity id which will be used to load reasons + $qb->addSelect('activity.id AS list_reasons'); + break; + default: + $qb->addSelect(sprintf('activity.%s as %s', $f, $f)); + break; + } + + } + } + + + + return $qb; + } + + public function requiredRole() + { + return new Role(ActivityStatsVoter::LISTS); + } + + public function supportsModifiers() + { + return array('activity', 'person'); + } + +} diff --git a/Export/Filter/ActivityDateFilter.php b/Export/Filter/ActivityDateFilter.php new file mode 100644 index 000000000..50b7ce6db --- /dev/null +++ b/Export/Filter/ActivityDateFilter.php @@ -0,0 +1,132 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Filter; + +use Chill\MainBundle\Export\FilterInterface; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\Extension\Core\Type\DateType; +use Symfony\Component\Form\FormError; +use Chill\MainBundle\Form\Type\Export\FilterType; +use Doctrine\ORM\Query\Expr; + +/** + * + * + * @author Julien Fastré + */ +class ActivityDateFilter implements FilterInterface +{ + + public function addRole() + { + return null; + } + + public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->between('activity.date', ':date_from', + ':date_to'); + + if ($where instanceof Expr\Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('date_from', $data['date_from']); + $qb->setParameter('date_to', $data['date_to']); + } + + public function applyOn() + { + return 'activity'; + } + + public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) + { + $builder->add('date_from', DateType::class, array( + 'label' => "Activities after this date", + 'data' => new \DateTime(), + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + )); + + $builder->add('date_to', DateType::class, array( + 'label' => "Activities before this date", + 'data' => new \DateTime(), + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + )); + + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { + /* @var $filterForm \Symfony\Component\Form\FormInterface */ + $filterForm = $event->getForm()->getParent(); + $enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData(); + + if ($enabled === true) { + // if the filter is enabled, add some validation + $form = $event->getForm(); + $date_from = $form->get('date_from')->getData(); + $date_to = $form->get('date_to')->getData(); + + // check that fields are not empty + if ($date_from === null) { + $form->get('date_from')->addError(new FormError('This field ' + . 'should not be empty')); + } + if ($date_to === null) { + $form->get('date_to')->addError(new FormError('This field ' + . 'should not be empty')); + } + + // check that date_from is before date_to + if ( + ($date_from !== null && $date_to !== null) + && + $date_from >= $date_to + ) { + $form->get('date_to')->addError(new FormError('This date ' + . 'should be after the date given in "activities after" field')); + } + } + }); + } + + public function describeAction($data, $format = 'string') + { + return array( + "Filtered by date of activity: only between %date_from% and %date_to%", + array( + "%date_from%" => $data['date_from']->format('d-m-Y'), + '%date_to%' => $data['date_to']->format('d-m-Y') + )); + } + + public function getTitle() + { + return "Filtered by date activity"; + } + +} diff --git a/Export/Filter/ActivityReasonFilter.php b/Export/Filter/ActivityReasonFilter.php index 32b05b01e..1dc1b1854 100644 --- a/Export/Filter/ActivityReasonFilter.php +++ b/Export/Filter/ActivityReasonFilter.php @@ -27,7 +27,7 @@ use Chill\ActivityBundle\Entity\ActivityReason; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\Query\Expr; use Symfony\Component\Security\Core\Role\Role; -use Chill\ActivityBundle\Security\Authorization\ActivityVoter; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query\Expr\Join; @@ -65,16 +65,23 @@ class ActivityReasonFilter implements FilterInterface $where = $qb->getDQLPart('where'); $join = $qb->getDQLPart('join'); $clause = $qb->expr()->in('reasons', ':selected_activity_reasons'); + //dump($join); // add a join to reasons only if needed - if (array_key_exists('activity', $join)) { - // we want to avoid multiple join on same object - if (!$this->checkJoinAlreadyDefined($join['activity'])) { - $qb->add('join', new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')); - } - } else { - $qb->join('activity.reasons', 'reasons'); + if ( + (array_key_exists('activity', $join) + && + !$this->checkJoinAlreadyDefined($join['activity'], 'reasons') + ) + OR + (! array_key_exists('activity', $join)) + ) { + $qb->add( + 'join', + array('activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')), + true + ); } - + if ($where instanceof Expr\Andx) { $where->add($clause); } else { @@ -91,10 +98,10 @@ class ActivityReasonFilter implements FilterInterface * @param Join[] $joins * @return boolean */ - private function checkJoinAlreadyDefined(array $joins) + private function checkJoinAlreadyDefined(array $joins, $alias) { foreach ($joins as $join) { - if ($join->getAlias() === 'reasons') { + if ($join->getAlias() === $alias) { return true; } } @@ -132,7 +139,7 @@ class ActivityReasonFilter implements FilterInterface public function addRole() { - return new Role(ActivityVoter::SEE); + return new Role(ActivityStatsVoter::STATS); } public function describeAction($data, $format = 'string') diff --git a/Export/Filter/PersonHavingActivityBetweenDateFilter.php b/Export/Filter/PersonHavingActivityBetweenDateFilter.php new file mode 100644 index 000000000..23e353c11 --- /dev/null +++ b/Export/Filter/PersonHavingActivityBetweenDateFilter.php @@ -0,0 +1,205 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Filter; + +use Chill\MainBundle\Export\FilterInterface; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\Extension\Core\Type\DateType; +use Symfony\Component\Form\FormError; +use Chill\MainBundle\Form\Type\Export\FilterType; +use Doctrine\ORM\Query\Expr; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\ActivityBundle\Entity\ActivityReason; +use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\EntityManager; +use Chill\PersonBundle\Export\Declarations; + +/** + * + * + * @author Julien Fastré + */ +class PersonHavingActivityBetweenDateFilter implements FilterInterface +{ + + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + /** + * + * @var EntityRepository + */ + protected $activityReasonRepository; + + public function __construct( + TranslatableStringHelper $translatableStringHelper, + EntityRepository $activityReasonRepository + ) { + $this->translatableStringHelper = $translatableStringHelper; + $this->activityReasonRepository = $activityReasonRepository; + } + + + public function addRole() + { + return null; + } + + public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) + { + // create a query for activity + $sqb = $qb->getEntityManager()->createQueryBuilder(); + $sqb->select("person_person_having_activity.id") + ->from("ChillActivityBundle:Activity", "activity_person_having_activity") + ->join("activity_person_having_activity.person", "person_person_having_activity") + ; + // add clause between date + $sqb->where("activity_person_having_activity.date BETWEEN " + . ":person_having_activity_between_date_from" + . " AND " + . ":person_having_activity_between_date_to"); + // add clause activity reason + $sqb->join('activity_person_having_activity.reasons', + 'reasons_person_having_activity'); + $sqb->andWhere( + $sqb->expr()->in( + 'reasons_person_having_activity', + ":person_having_activity_reasons") + ); + + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->in('person.id', $sqb->getDQL()); + + if ($where instanceof Expr\Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('person_having_activity_between_date_from', + $data['date_from']); + $qb->setParameter('person_having_activity_between_date_to', + $data['date_to']); + $qb->setParameter('person_having_activity_reasons', $data['reasons']); + } + + public function applyOn() + { + return Declarations::PERSON_IMPLIED_IN; + } + + public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) + { + $builder->add('date_from', DateType::class, array( + 'label' => "Implied in an activity after this date", + 'data' => new \DateTime(), + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + )); + + $builder->add('date_to', DateType::class, array( + 'label' => "Implied in an activity before this date", + 'data' => new \DateTime(), + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + )); + + $builder->add('reasons', EntityType::class, array( + 'class' => 'ChillActivityBundle:ActivityReason', + 'choice_label' => function (ActivityReason $reason) { + return $this->translatableStringHelper + ->localize($reason->getName()); + }, + 'group_by' => function(ActivityReason $reason) { + return $this->translatableStringHelper + ->localize($reason->getCategory()->getName()); + }, + 'data' => $this->activityReasonRepository->findAll(), + 'multiple' => true, + 'expanded' => false, + 'label' => "Activity reasons for those activities" + )); + + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { + /* @var $filterForm \Symfony\Component\Form\FormInterface */ + $filterForm = $event->getForm()->getParent(); + $enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData(); + + if ($enabled === true) { + // if the filter is enabled, add some validation + $form = $event->getForm(); + $date_from = $form->get('date_from')->getData(); + $date_to = $form->get('date_to')->getData(); + + // check that fields are not empty + if ($date_from === null) { + $form->get('date_from')->addError(new FormError('This field ' + . 'should not be empty')); + } + if ($date_to === null) { + $form->get('date_to')->addError(new FormError('This field ' + . 'should not be empty')); + } + + // check that date_from is before date_to + if ( + ($date_from !== null && $date_to !== null) + && + $date_from >= $date_to + ) { + $form->get('date_to')->addError(new FormError('This date ' + . 'should be after the date given in "Implied in an ' + . 'activity after this date" field')); + } + } + }); + } + + public function describeAction($data, $format = 'string') + { + return array( + "Filtered by person having an activity between %date_from% and " + . "%date_to% with reasons %reasons_name%", + array( + "%date_from%" => $data['date_from']->format('d-m-Y'), + '%date_to%' => $data['date_to']->format('d-m-Y'), + "%reasons_name%" => implode(", ", array_map( + function (ActivityReason $r) { + return '"'.$this->translatableStringHelper-> + localize($r->getName()).'"'; + }, + $data['reasons'])) + )); + } + + public function getTitle() + { + return "Filtered by person having an activity in a period"; + } + +} diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml index 3221a4ab5..daf4fef57 100644 --- a/Resources/config/services/export.yml +++ b/Resources/config/services/export.yml @@ -6,6 +6,15 @@ services: tags: - { name: chill.export, alias: 'count_activity' } + chill.activity.export.list_activity: + class: Chill\ActivityBundle\Export\Export\ListActivity + arguments: + - "@doctrine.orm.entity_manager" + - "@translator" + - "@chill.main.helper.translatable_string" + tags: + - { name: chill.export, alias: 'list_activity' } + chill.activity.export.reason_filter: class: Chill\ActivityBundle\Export\Filter\ActivityReasonFilter arguments: @@ -14,6 +23,21 @@ services: tags: - { name: chill.export_filter, alias: 'activity_reason_filter' } + chill.activity.export.date_filter: + class: Chill\ActivityBundle\Export\Filter\ActivityDateFilter + tags: + - { name: chill.export_filter, alias: 'activity_date_filter' } + + chill.activity.export.person_having_an_activity_between_date_filter: + class: Chill\ActivityBundle\Export\Filter\PersonHavingActivityBetweenDateFilter + arguments: + - "@chill.main.helper.translatable_string" + - "@chill_activity.repository.reason" + tags: + - #0 register as a filter + name: chill.export_filter + alias: 'activity_person_having_ac_bw_date_filter' + chill.activity.export.reason_aggregator: class: Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator arguments: @@ -21,4 +45,4 @@ services: - "@chill_activity.repository.reason" - "@chill.main.helper.translatable_string" tags: - - { name: chill.export_aggregator, alias: activity_reason } + - { name: chill.export_aggregator, alias: activity_reason_aggregator } diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index dfa72bb7a..b426463dc 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -103,6 +103,12 @@ Count activities by various parameters.: Compte le nombre d'activités enregistr Filter by reason: Filtrer par sujet d'activité 'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%' + +"Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'activité: uniquement entre %date_from% et %date_to%" + +Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par personnes associées à une activité entre %date_from% et %date_to% avec les sujets %reasons_name% +Activity reasons for those activities: Sujets de ces activités + #aggregators Aggregate by activity reason: Aggréger par sujet de l'activité By reason: Par sujet diff --git a/Tests/Export/Export/ListActivityTest.php b/Tests/Export/Export/ListActivityTest.php new file mode 100644 index 000000000..dbb660e55 --- /dev/null +++ b/Tests/Export/Export/ListActivityTest.php @@ -0,0 +1,93 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Export\Export; + +use Chill\MainBundle\Test\Export\AbstractExportTest; + +/** + * + * + * @author Julien Fastré + */ +class ListActivityTest extends AbstractExportTest +{ + /** + * + * @var \Chill\ActivityBundle\Export\Export\ListActivity + */ + private $export; + + public function setUp() + { + static::bootKernel(); + + /* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ + $container = self::$kernel->getContainer(); + + $this->export = $container->get('chill.activity.export.list_activity'); + + // add a fake request with a default locale (used in translatable string) + $prophet = new \Prophecy\Prophet; + $request = $prophet->prophesize(); + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $container->get('request_stack') + ->push($request->reveal()); + } + + + + public function getFormData() + { + return array( + array('fields' => array( + 'id', + 'date', + 'durationTime', + 'attendee', + 'user_username', + 'circle_name', + 'type_name', + 'person_firstname', + 'person_lastname', + 'person_id' + )), + array('fields' => array( + 'id', + 'list_reasons' + )), + ); + } + + public function getModifiersCombination() + { + return array( + array('activity'), + array('activity', 'person') + ); + } + + public function getExport() + { + return $this->export; + } + +} From 9bcd7a2c1011315fea928f0341547d24a0a5cb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 31 Jan 2017 15:34:41 +0100 Subject: [PATCH 112/163] improve exports and filters --- Export/Aggregator/ActivityTypeAggregator.php | 157 +++++++++++++++++ Export/Export/StatActivityDuration.php | 159 ++++++++++++++++++ Resources/config/services/export.yml | 16 ++ Resources/translations/messages.fr.yml | 3 + .../Aggregator/ActivityTypeAggregatorTest.php | 92 ++++++++++ .../Export/StatActivityDurationSumTest.php | 50 ++++++ ...sonHavingActivityBetweenDateFilterTest.php | 117 +++++++++++++ 7 files changed, 594 insertions(+) create mode 100644 Export/Aggregator/ActivityTypeAggregator.php create mode 100644 Export/Export/StatActivityDuration.php create mode 100644 Tests/Export/Aggregator/ActivityTypeAggregatorTest.php create mode 100644 Tests/Export/Export/StatActivityDurationSumTest.php create mode 100644 Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php diff --git a/Export/Aggregator/ActivityTypeAggregator.php b/Export/Aggregator/ActivityTypeAggregator.php new file mode 100644 index 000000000..544ae98ac --- /dev/null +++ b/Export/Aggregator/ActivityTypeAggregator.php @@ -0,0 +1,157 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Aggregator; + +use Symfony\Component\Form\FormBuilderInterface; +use Doctrine\ORM\QueryBuilder; +use Chill\MainBundle\Export\AggregatorInterface; +use Symfony\Component\Security\Core\Role\Role; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; +use Doctrine\ORM\EntityRepository; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Doctrine\ORM\Query\Expr\Join; + +/** + * + * + * @author Julien Fastré + */ +class ActivityTypeAggregator implements AggregatorInterface +{ + + /** + * + * @var EntityRepository + */ + protected $typeRepository; + + /** + * + * @var TranslatableStringHelper + */ + protected $stringHelper; + + const KEY = 'activity_type_aggregator'; + + public function __construct( + EntityRepository $typeRepository, + TranslatableStringHelper $stringHelper + ) { + $this->typeRepository = $typeRepository; + $this->stringHelper = $stringHelper; + } + + public function alterQuery(QueryBuilder $qb, $data) + { + // add select element + $qb->addSelect(sprintf('IDENTITY(activity.type) AS %s', self::KEY)); + + // make a jointure only if needed + /*$join = $qb->getDQLPart('join'); + if ( + (array_key_exists('activity', $join) + && + !$this->checkJoinAlreadyDefined($join['activity'], 'reasons') + ) + OR + (! array_key_exists('activity', $join)) + ) { + $qb->add( + 'join', + array('activity' => + new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons') + ), + true); + } + + // join category if necessary + if ($alias === 'activity_categories_id') { + // add join only if needed + if (!$this->checkJoinAlreadyDefined($qb->getDQLPart('join')['activity'], 'category')) { + $qb->join('reasons.category', 'category'); + } + }*/ + + // add the "group by" part + $groupBy = $qb->addGroupBy(self::KEY); + } + + /** + * Check if a join between Activity and another alias + * + * @param Join[] $joins + * @param string $alias the alias to search for + * @return boolean + */ + private function checkJoinAlreadyDefined(array $joins, $alias) + { + foreach ($joins as $join) { + if ($join->getAlias() === $alias) { + return true; + } + } + + return false; + } + + public function applyOn() + { + return 'activity'; + } + + public function buildForm(FormBuilderInterface $builder) + { + // no form required for this aggregator + } + + public function getTitle() + { + return "Aggregate by activity type"; + } + + public function addRole() + { + return new Role(ActivityStatsVoter::STATS); + } + + public function getLabels($key, array $values, $data) + { + // for performance reason, we load data from db only once + $this->typeRepository->findBy(array('id' => $values)); + + return function($value) use ($data) { + if ($value === '_header') { + return 'Activity type'; + } + + /* @var $r \Chill\ActivityBundle\Entity\ActivityType */ + $t = $this->typeRepository->find($value); + + return $this->stringHelper->localize($t->getName()); + }; + + } + + public function getQueryKeys($data) + { + return array(self::KEY); + } + +} diff --git a/Export/Export/StatActivityDuration.php b/Export/Export/StatActivityDuration.php new file mode 100644 index 000000000..8fd4ec00b --- /dev/null +++ b/Export/Export/StatActivityDuration.php @@ -0,0 +1,159 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Export; + +use Chill\MainBundle\Export\ExportInterface; +use Doctrine\ORM\QueryBuilder; +use Symfony\Component\Security\Core\Role\Role; +use Doctrine\ORM\Query; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; +use Doctrine\ORM\EntityManagerInterface; + +/** + * This export allow to compute stats on activity duration. + * + * The desired stat must be given in constructor. + * + * + * @author Julien Fastré + */ +class StatActivityDuration implements ExportInterface +{ + /** + * + * @var EntityManagerInterface + */ + protected $entityManager; + + const SUM = 'sum'; + + /** + * The action for this report. + * + * @var string + */ + protected $action; + + /** + * constructor + * + * @param EntityManagerInterface $em + * @param string $action the stat to perform + */ + public function __construct( + EntityManagerInterface $em, + $action = 'sum' + ) + { + $this->entityManager = $em; + $this->action = $action; + } + + public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) + { + + } + + public function getDescription() + { + if ($this->action === self::SUM) { + return "Sum activities duration by various parameters."; + } + } + + public function getTitle() + { + if ($this->action === self::SUM) { + return "Sum activity duration"; + } + + } + + public function getType() + { + return 'activity'; + } + + public function initiateQuery(array $requiredModifiers, array $acl, array $data = array()) + { + $centers = array_map(function($el) { return $el['center']; }, $acl); + $qb = $this->entityManager->createQueryBuilder(); + + if ($this->action === self::SUM) { + $select = "SUM(activity.durationTime) AS export_stat_activity"; + } + + $qb->select($select) + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.person', 'person') + ->join('person.center', 'center') + ->where($qb->expr()->in('center', ':centers')) + ->setParameter(':centers', $centers) + ; + + return $qb; + } + + public function supportsModifiers() + { + return array('person', 'activity'); + } + + public function requiredRole() + { + return new Role(ActivityStatsVoter::STATS); + } + + public function getAllowedFormattersTypes() + { + return array(\Chill\MainBundle\Export\FormatterInterface::TYPE_TABULAR); + } + + public function getLabels($key, array $values, $data) + { + if ($key !== 'export_stat_activity') { + throw new \LogicException("the key $key is not used by this export"); + } + + switch ($this->action) { + case self::SUM: + $header = "Sum of activities duration"; + } + + return function($value) use ($header) { + return $value === '_header' ? + $header + : + $value + ; + }; + } + + public function getQueryKeys($data) + { + return array('export_stat_activity'); + } + + public function getResult($qb, $data) + { + return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR); + } + +} diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml index daf4fef57..871d65e2b 100644 --- a/Resources/config/services/export.yml +++ b/Resources/config/services/export.yml @@ -6,6 +6,14 @@ services: tags: - { name: chill.export, alias: 'count_activity' } + chill.activity.export.sum_activity_duration: + class: Chill\ActivityBundle\Export\Export\StatActivityDuration + arguments: + - "@doctrine.orm.entity_manager" + - "sum" + tags: + - { name: chill.export, alias: 'sum_activity_duration' } + chill.activity.export.list_activity: class: Chill\ActivityBundle\Export\Export\ListActivity arguments: @@ -46,3 +54,11 @@ services: - "@chill.main.helper.translatable_string" tags: - { name: chill.export_aggregator, alias: activity_reason_aggregator } + + chill.activity.export.type_aggregator: + class: Chill\ActivityBundle\Export\Aggregator\ActivityTypeAggregator + arguments: + - "@chill_activity.repository.activity_type" + - "@chill.main.helper.translatable_string" + tags: + - { name: chill.export_aggregator, alias: activity_type_aggregator } diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index b426463dc..3af06d041 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -106,6 +106,9 @@ Filter by reason: Filtrer par sujet d'activité "Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'activité: uniquement entre %date_from% et %date_to%" +Filtered by person having an activity in a period: Uniquement les personnes ayant eu une activité dans la période donnée +Implied in an activity after this date: Impliqué dans une activité après cette date +Implied in an activity before this date: Impliqué dans une activité avant cette date Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par personnes associées à une activité entre %date_from% et %date_to% avec les sujets %reasons_name% Activity reasons for those activities: Sujets de ces activités diff --git a/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php b/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php new file mode 100644 index 000000000..d3e4efd84 --- /dev/null +++ b/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php @@ -0,0 +1,92 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Aggregator; + +use Chill\MainBundle\Test\Export\AbstractAggregatorTest; + +/** + * Add tests for ActivityTypeAggregator + * + * @author Julien Fastré + */ +class ActivityTypeAggregatorTest extends AbstractAggregatorTest +{ + /** + * + * @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator + */ + private $aggregator; + + public function setUp() + { + static::bootKernel(); + + $container = static::$kernel->getContainer(); + + $this->aggregator = $container->get('chill.activity.export.type_aggregator'); + + // add a fake request with a default locale (used in translatable string) + $prophet = new \Prophecy\Prophet; + $request = $prophet->prophesize(); + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $container->get('request_stack') + ->push($request->reveal()); + } + + public function getAggregator() + { + return $this->aggregator; + } + + public function getFormData() + { + return array( + array() + ); + } + + public function getQueryBuilders() + { + if (static::$kernel === null) { + static::bootKernel(); + } + + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager'); + + return array( + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons') + ->join('reasons.category', 'category') + ); + } + +} diff --git a/Tests/Export/Export/StatActivityDurationSumTest.php b/Tests/Export/Export/StatActivityDurationSumTest.php new file mode 100644 index 000000000..f43374fd8 --- /dev/null +++ b/Tests/Export/Export/StatActivityDurationSumTest.php @@ -0,0 +1,50 @@ + + */ +class StatActivityDurationSumTest extends AbstractExportTest +{ + /** + * + * @var \Chill\ActivityBundle\Export\Export\StatActivityDuration + */ + private $export; + + public function setUp() + { + static::bootKernel(); + + /* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ + $container = self::$kernel->getContainer(); + + $this->export = $container->get('chill.activity.export.sum_activity_duration'); + } + + public function getExport() + { + return $this->export; + } + + public function getFormData() + { + return array( + array() + ); + } + + public function getModifiersCombination() + { + return array( + array('activity'), + array('activity', 'person') + ); + } + +} diff --git a/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php b/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php new file mode 100644 index 000000000..5b922e6f3 --- /dev/null +++ b/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php @@ -0,0 +1,117 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\ActivityBundle\Tests\Filter; + +use Chill\MainBundle\Test\Export\AbstractFilterTest; + +/** + * + * + * @author Julien Fastré + */ +class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest +{ + /** + * + * @var \Chill\PersonBundle\Export\Filter\PersonHavingActivityBetweenDateFilter + */ + private $filter; + + public function setUp() + { + static::bootKernel(); + + $container = static::$kernel->getContainer(); + + $this->filter = $container->get('chill.activity.export.' + . 'person_having_an_activity_between_date_filter'); + + // add a fake request with a default locale (used in translatable string) + $prophet = new \Prophecy\Prophet; + $request = $prophet->prophesize(); + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $container->get('request_stack') + ->push($request->reveal()); + } + + public function getFilter() + { + return $this->filter; + } + + public function getFormData() + { + $date_from = \DateTime::createFromFormat('Y-m-d', '2015-01-15'); + $date_to = new \DateTime(); // today + $reasons = $this->getActivityReasons(); + + + $data = array(); + for ($i = 0; $i < 4; $i++) { + $data[] = array( + 'date_from' => $date_from, + 'date_to' => $date_to, + 'reasons' => array_slice($reasons, 0, 1 + $i) + ); + } + + return $data; + } + + /** + * Return all activity reasons + * + * @return \Chill\ActivityBundle\Entity\ActivityReason[] + */ + private function getActivityReasons() + { + if (static::$kernel === null) { + static::bootKernel(); + } + + return static::$kernel->getContainer() + ->get('chill_activity.repository.reason') + ->findAll(); + } + + public function getQueryBuilders() + { + if (static::$kernel === null) { + static::bootKernel(); + } + + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager'); + + return array( + $em->createQueryBuilder() + ->select('count(person.id)') + ->from('ChillPersonBundle:Person', 'person') + // add a fake where clause + ->where('person.id > 0'), + $em->createQueryBuilder() + ->select('count(person.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.person', 'person') + // add a fake where clause + ->where('person.id > 0'), + ); + } +} From 7a76868f6a21cd9136b0eaacaddcf312a8e6bc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 26 Feb 2017 00:12:52 +0100 Subject: [PATCH 113/163] add validation to activityreasonaggregator --- Export/Aggregator/ActivityReasonAggregator.php | 15 +++++++++++++-- Resources/translations/validators.fr.yml | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Resources/translations/validators.fr.yml diff --git a/Export/Aggregator/ActivityReasonAggregator.php b/Export/Aggregator/ActivityReasonAggregator.php index b33c321ee..33eb0499e 100644 --- a/Export/Aggregator/ActivityReasonAggregator.php +++ b/Export/Aggregator/ActivityReasonAggregator.php @@ -27,13 +27,16 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Doctrine\ORM\EntityRepository; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\Query\Expr\Join; +use Chill\MainBundle\Export\ExportElementValidatedInterface; +use Symfony\Component\Validator\Context\ExecutionContextInterface; /** * * * @author Julien Fastré */ -class ActivityReasonAggregator implements AggregatorInterface +class ActivityReasonAggregator implements AggregatorInterface, + ExportElementValidatedInterface { /** * @@ -150,8 +153,16 @@ class ActivityReasonAggregator implements AggregatorInterface 'label' => 'Reason\'s level' )); } + + public function validateForm($data, ExecutionContextInterface $context) + { + if ($data['level'] === null) { + $context->buildViolation("The reasons's level should not be empty") + ->addViolation(); + } + } - public function getTitle() + public function getTitle() { return "Aggregate by activity reason"; } diff --git a/Resources/translations/validators.fr.yml b/Resources/translations/validators.fr.yml new file mode 100644 index 000000000..831969641 --- /dev/null +++ b/Resources/translations/validators.fr.yml @@ -0,0 +1 @@ +The reasons's level should not be empty: Le niveau du sujet ne peut pas être vide From 13f3a1f55fa0c46b83101f45189c0d41655088ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 26 Feb 2017 01:04:02 +0100 Subject: [PATCH 114/163] add validation and translations --- Export/Filter/ActivityDateFilter.php | 28 ++++++++++--- Export/Filter/ActivityReasonFilter.php | 15 ++++++- .../PersonHavingActivityBetweenDateFilter.php | 39 +++++++++++++++---- Resources/config/services/export.yml | 3 ++ Resources/translations/messages.fr.yml | 7 +++- Resources/translations/validators.fr.yml | 1 + 6 files changed, 76 insertions(+), 17 deletions(-) diff --git a/Export/Filter/ActivityDateFilter.php b/Export/Filter/ActivityDateFilter.php index 50b7ce6db..dca4cec30 100644 --- a/Export/Filter/ActivityDateFilter.php +++ b/Export/Filter/ActivityDateFilter.php @@ -26,6 +26,7 @@ use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\FormError; use Chill\MainBundle\Form\Type\Export\FilterType; use Doctrine\ORM\Query\Expr; +use Symfony\Component\Translation\TranslatorInterface; /** * @@ -34,6 +35,17 @@ use Doctrine\ORM\Query\Expr; */ class ActivityDateFilter implements FilterInterface { + /** + * + * @var TranslatorInterface + */ + protected $translator; + + function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + public function addRole() { @@ -93,12 +105,14 @@ class ActivityDateFilter implements FilterInterface // check that fields are not empty if ($date_from === null) { - $form->get('date_from')->addError(new FormError('This field ' - . 'should not be empty')); + $form->get('date_from')->addError(new FormError( + $this->translator->trans('This field ' + . 'should not be empty'))); } if ($date_to === null) { - $form->get('date_to')->addError(new FormError('This field ' - . 'should not be empty')); + $form->get('date_to')->addError(new FormError( + $this->translator->trans('This field ' + . 'should not be empty'))); } // check that date_from is before date_to @@ -107,8 +121,10 @@ class ActivityDateFilter implements FilterInterface && $date_from >= $date_to ) { - $form->get('date_to')->addError(new FormError('This date ' - . 'should be after the date given in "activities after" field')); + $form->get('date_to')->addError(new FormError( + $this->translator->trans('This date should be after ' + . 'the date given in "Implied in an activity after ' + . 'this date" field'))); } } }); diff --git a/Export/Filter/ActivityReasonFilter.php b/Export/Filter/ActivityReasonFilter.php index 1dc1b1854..37157af60 100644 --- a/Export/Filter/ActivityReasonFilter.php +++ b/Export/Filter/ActivityReasonFilter.php @@ -30,13 +30,16 @@ use Symfony\Component\Security\Core\Role\Role; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query\Expr\Join; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Chill\MainBundle\Export\ExportElementValidatedInterface; /** * * * @author Julien Fastré */ -class ActivityReasonFilter implements FilterInterface +class ActivityReasonFilter implements FilterInterface, + ExportElementValidatedInterface { /** * @@ -131,8 +134,16 @@ class ActivityReasonFilter implements FilterInterface 'expanded' => false )); } + + public function validateForm($data, ExecutionContextInterface $context) + { + if ($data['reasons'] === null || count($data['reasons']) === 0) { + $context->buildViolation("At least one reason must be choosen") + ->addViolation(); + } + } - public function getTitle() + public function getTitle() { return 'Filter by reason'; } diff --git a/Export/Filter/PersonHavingActivityBetweenDateFilter.php b/Export/Filter/PersonHavingActivityBetweenDateFilter.php index 23e353c11..cf444bd0a 100644 --- a/Export/Filter/PersonHavingActivityBetweenDateFilter.php +++ b/Export/Filter/PersonHavingActivityBetweenDateFilter.php @@ -32,13 +32,17 @@ use Chill\ActivityBundle\Entity\ActivityReason; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityManager; use Chill\PersonBundle\Export\Declarations; +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Chill\MainBundle\Export\ExportElementValidatedInterface; /** * * * @author Julien Fastré */ -class PersonHavingActivityBetweenDateFilter implements FilterInterface +class PersonHavingActivityBetweenDateFilter implements FilterInterface, + ExportElementValidatedInterface { /** @@ -53,12 +57,20 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface */ protected $activityReasonRepository; + /** + * + * @var TranslatorInterface + */ + protected $translator; + public function __construct( TranslatableStringHelper $translatableStringHelper, - EntityRepository $activityReasonRepository + EntityRepository $activityReasonRepository, + TranslatorInterface $translator ) { $this->translatableStringHelper = $translatableStringHelper; $this->activityReasonRepository = $activityReasonRepository; + $this->translator = $translator; } @@ -158,12 +170,14 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface // check that fields are not empty if ($date_from === null) { - $form->get('date_from')->addError(new FormError('This field ' - . 'should not be empty')); + $form->get('date_from')->addError(new FormError( + $this->translator->trans('This field ' + . 'should not be empty'))); } if ($date_to === null) { - $form->get('date_to')->addError(new FormError('This field ' - . 'should not be empty')); + $form->get('date_to')->addError(new FormError( + $this->translator->trans('This field ' + . 'should not be empty'))); } // check that date_from is before date_to @@ -172,13 +186,22 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface && $date_from >= $date_to ) { - $form->get('date_to')->addError(new FormError('This date ' + $form->get('date_to')->addError(new FormError( + $this->translator->trans('This date ' . 'should be after the date given in "Implied in an ' - . 'activity after this date" field')); + . 'activity after this date" field'))); } } }); } + + public function validateForm($data, ExecutionContextInterface $context) + { + if ($data['reasons'] === null || count($data['reasons']) === 0) { + $context->buildViolation("At least one reason must be choosen") + ->addViolation(); + } + } public function describeAction($data, $format = 'string') { diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml index 871d65e2b..cb6ff5f52 100644 --- a/Resources/config/services/export.yml +++ b/Resources/config/services/export.yml @@ -33,6 +33,8 @@ services: chill.activity.export.date_filter: class: Chill\ActivityBundle\Export\Filter\ActivityDateFilter + arguments: + - "@translator" tags: - { name: chill.export_filter, alias: 'activity_date_filter' } @@ -41,6 +43,7 @@ services: arguments: - "@chill.main.helper.translatable_string" - "@chill_activity.repository.reason" + - "@translator" tags: - #0 register as a filter name: chill.export_filter diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 3af06d041..6883fabe4 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -103,8 +103,11 @@ Count activities by various parameters.: Compte le nombre d'activités enregistr Filter by reason: Filtrer par sujet d'activité 'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%' - +Filtered by date activity: Filtrer par date d'activité +Activities after this date: Activités après cette date +Activities before this date: Activités avant cette date "Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'activité: uniquement entre %date_from% et %date_to%" +This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "activités après cette date" Filtered by person having an activity in a period: Uniquement les personnes ayant eu une activité dans la période donnée Implied in an activity after this date: Impliqué dans une activité après cette date @@ -112,8 +115,10 @@ Implied in an activity before this date: Impliqué dans une activité avant cett Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par personnes associées à une activité entre %date_from% et %date_to% avec les sujets %reasons_name% Activity reasons for those activities: Sujets de ces activités + #aggregators Aggregate by activity reason: Aggréger par sujet de l'activité By reason: Par sujet By category of reason: Par catégorie de sujet Reason's level: Niveau du sujet +Aggregate by activity type: Aggréger par date d'activité diff --git a/Resources/translations/validators.fr.yml b/Resources/translations/validators.fr.yml index 831969641..edda0b67b 100644 --- a/Resources/translations/validators.fr.yml +++ b/Resources/translations/validators.fr.yml @@ -1 +1,2 @@ The reasons's level should not be empty: Le niveau du sujet ne peut pas être vide +At least one reason must be choosen: Au moins un sujet doit être choisi From 38d69f097c136cd94e813a3f9b45008046611d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 19 Apr 2017 21:26:22 +0200 Subject: [PATCH 115/163] fix translation and make hierarchy in roles --- Resources/translations/messages.fr.yml | 15 +++++++++++++++ Security/Authorization/ActivityVoter.php | 10 ++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 6883fabe4..9b502f3a4 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -4,8 +4,13 @@ Edit the activity: Modifier l'activité Activity: Activité Duration time: Durée Duration Time: Durée +durationTime: durée Reasons: Sujets Attendee: Présence de la personne +attendee: présence de la personne +list_reasons: liste des sujets +user_username: nom de l'utilisateur +circle_name: nom du cercle Remark: Notes Add a new activity: Ajouter une nouvelle activité Activity list: Liste des activités @@ -18,6 +23,10 @@ Scope: Cercle Activity data: Données de l'activité No reason associated: Aucun sujet There isn't any activities.: Aucune activité enregistrée. +type_name: type de l'activité +person_firstname: prénom +person_lastname: nom de famille +person_id: identifiant de la personne #forms Activity creation: Nouvelle activité @@ -55,6 +64,8 @@ CHILL_ACTIVITY_CREATE: Créer une activité CHILL_ACTIVITY_UPDATE: Modifier une activité CHILL_ACTIVITY_SEE: Voir une activité CHILL_ACTIVITY_DELETE: Supprimer une activité +CHILL_ACTIVITY_STATS: Statistique des activités +CHILL_ACTIVITY_LIST: Liste des activités # admin Activity configuration menu: Configuration des activités @@ -98,6 +109,9 @@ The activity has been successfully removed.: L'activité a été supprimée. # exports Count activities: Nombre d'activités Count activities by various parameters.: Compte le nombre d'activités enregistrées en fonction de différents paramètres. +Sum activity duration: Total de la durée des activités +Sum activities duration by various parameters.: Additionne la durée des activités en fonction de différents paramètres. +List activities: Liste les activités #filters Filter by reason: Filtrer par sujet d'activité @@ -122,3 +136,4 @@ By reason: Par sujet By category of reason: Par catégorie de sujet Reason's level: Niveau du sujet Aggregate by activity type: Aggréger par date d'activité + diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php index d1318a485..4836b5665 100644 --- a/Security/Authorization/ActivityVoter.php +++ b/Security/Authorization/ActivityVoter.php @@ -21,14 +21,14 @@ namespace Chill\ActivityBundle\Security\Authorization; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; -use Chill\MainBundle\Security\ProvideRoleInterface; +use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; /** * * * @author Julien Fastré */ -class ActivityVoter extends AbstractChillVoter implements ProvideRoleInterface +class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { const CREATE = 'CHILL_ACTIVITY_CREATE'; const SEE = 'CHILL_ACTIVITY_SEE'; @@ -75,5 +75,11 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleInterface { return array(); } + + + public function getRolesWithHierarchy() + { + return [ 'Activity' => $this->getRoles() ]; + } } From f7c9e6f3b86ebd540fbe1db147efdd28b52cdfef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 19 Apr 2017 21:36:25 +0200 Subject: [PATCH 116/163] fix composer to add dev deps if required --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3ae3b49a1..0ab304810 100644 --- a/composer.json +++ b/composer.json @@ -48,5 +48,7 @@ }, "extra": { "app-migrations-dir": "Test/Fixtures/App/app/DoctrineMigrations" - } + }, + "minimum-stability": "dev", + "prefer-stable": true } From 239ea38e92ad66e2ffc1907d6741076739ca3fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 20 Jun 2017 15:17:51 +0200 Subject: [PATCH 117/163] add ACTIVITY_SEE_DETAILS role This new role allow to see the details (remark + reasons) in the timeline. --- DependencyInjection/ChillActivityExtension.php | 7 ++++--- .../Timeline/activity_person_context.html.twig | 17 +++++++++++++++++ Security/Authorization/ActivityStatsVoter.php | 8 ++++++-- Security/Authorization/ActivityVoter.php | 4 +++- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 613fa7493..9567514aa 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -78,9 +78,10 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf { $container->prependExtensionConfig('security', array( 'role_hierarchy' => array( - ActivityVoter::UPDATE => array(ActivityVoter::SEE), - ActivityVoter::CREATE => array(ActivityVoter::SEE), - ActivityVoter::DELETE => array(ActivityVoter::SEE) + ActivityVoter::UPDATE => array(ActivityVoter::SEE_DETAILS), + ActivityVoter::CREATE => array(ActivityVoter::SEE_DETAILS), + ActivityVoter::DELETE => array(ActivityVoter::SEE_DETAILS), + ActivityVoter::SEE_DETAILS => array(ActivityVoter::SEE) ) )); } diff --git a/Resources/views/Timeline/activity_person_context.html.twig b/Resources/views/Timeline/activity_person_context.html.twig index 686219619..21b704f6d 100644 --- a/Resources/views/Timeline/activity_person_context.html.twig +++ b/Resources/views/Timeline/activity_person_context.html.twig @@ -1,3 +1,5 @@ +{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %} +

                                          {{ activity.date|localizeddate('long', 'none') }} / {{ 'Activity'|trans }}

                                          @@ -9,5 +11,20 @@ ) }} {{ 'Show the activity'|trans }} + {% if is_granted(constant('Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter::SEE_DETAILS'), activity) %} +
                                          +
                                          {{ 'Remark'|trans }}
                                          +
                                          {% if activity.remark is empty %}{{ 'No remarks'|trans }}{% else %}
                                          {{ activity.remark|nl2br }}
                                          {% endif %}
                                          + +
                                          {{ 'Reasons'|trans }}
                                          + {%- if activity.reasons is empty -%} +
                                          {{ 'No reason associated'|trans }}
                                          + {%- else -%} +
                                          {% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %}
                                          + {%- endif -%} + +
                                          + {% endif %} +
                                          diff --git a/Security/Authorization/ActivityStatsVoter.php b/Security/Authorization/ActivityStatsVoter.php index 66788041a..dc8832635 100644 --- a/Security/Authorization/ActivityStatsVoter.php +++ b/Security/Authorization/ActivityStatsVoter.php @@ -21,7 +21,7 @@ namespace Chill\ActivityBundle\Security\Authorization; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; -use Chill\MainBundle\Security\ProvideRoleInterface; +use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; use Chill\MainBundle\Entity\Center; /** @@ -29,7 +29,7 @@ use Chill\MainBundle\Entity\Center; * * @author Julien Fastré */ -class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterface +class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { const STATS = 'CHILL_ACTIVITY_STATS'; const LISTS = 'CHILL_ACTIVITY_LIST'; @@ -74,4 +74,8 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleInterf return $this->getSupportedAttributes(); } + public function getRolesWithHierarchy() + { + return [ 'Activity' => $this->getRoles() ]; + } } diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php index 4836b5665..b4d0feb2f 100644 --- a/Security/Authorization/ActivityVoter.php +++ b/Security/Authorization/ActivityVoter.php @@ -32,6 +32,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn { const CREATE = 'CHILL_ACTIVITY_CREATE'; const SEE = 'CHILL_ACTIVITY_SEE'; + const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS'; const UPDATE = 'CHILL_ACTIVITY_UPDATE'; const DELETE = 'CHILL_ACTIVITY_DELETE'; @@ -48,7 +49,8 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn protected function getSupportedAttributes() { - return array(self::CREATE, self::SEE, self::UPDATE, self::DELETE); + return array(self::CREATE, self::SEE, self::UPDATE, self::DELETE, + self::SEE_DETAILS); } protected function getSupportedClasses() From 50e5242176e03ec04feb989008c4d4691c92c7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 20 Jun 2017 15:21:29 +0200 Subject: [PATCH 118/163] update phpunit to last version and internal packages --- .gitlab-ci.yml | 5 +++-- composer.json | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0164ffc9f..83a9d555a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,11 +19,12 @@ stages: test:php-5.6: stage: test <<: *test_definition - script: phpunit + script: php vendor/bin/phpunit + allow_failure: true test:php-7: stage: test <<: *test_definition - script: phpunit + script: php vendor/bin/phpunit deploy-packagist: diff --git a/composer.json b/composer.json index 0ab304810..308b64699 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "chill-project/person": "dev-master@dev", "champs-libres/composer-bundle-migration": "~1.0", "doctrine/doctrine-migrations-bundle": "~1.1", - "doctrine/migrations": "~1.0@dev" + "doctrine/migrations": "~1.0@dev", + "phpunit/phpunit": "^6.2" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "~2.2", From 8a00fbf4f928f8c81ad3fc9e0351c95a8c9fa3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 20 Jun 2017 16:29:19 +0200 Subject: [PATCH 119/163] set stricter image, remove php5.6 tests --- .gitlab-ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 83a9d555a..651b9361f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,15 +16,17 @@ stages: - build-doc - deploy-doc -test:php-5.6: - stage: test - <<: *test_definition - script: php vendor/bin/phpunit - allow_failure: true test:php-7: stage: test + image: chill/ci-image:php-7 <<: *test_definition script: php vendor/bin/phpunit +test:php-7.1: + stage: test + image: chill/ci-image:php-7.1 + <<: *test_definition + script: php vendor/bin/phpunit + deploy-packagist: From 3ce64271662985dc8296a8f0f257f3d683cc274d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 20 Jun 2017 16:47:24 +0200 Subject: [PATCH 120/163] remove bootstrap.php.cache and force re-generation on each install --- .gitignore | 3 ++- composer.json | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c71baeafc..b749d005b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ Tests/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/cache/* Test/Fixtures/App/app/config/parameters.yml -/nbproject/private/ \ No newline at end of file +/nbproject/private/ +Test/Fixtures/App/app/bootstrap.php.cache diff --git a/composer.json b/composer.json index 308b64699..d1ec794d0 100644 --- a/composer.json +++ b/composer.json @@ -41,14 +41,17 @@ }, "scripts": { "post-install-cmd": [ - "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap" ], "post-update-cmd": [ - "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap" ] }, "extra": { - "app-migrations-dir": "Test/Fixtures/App/app/DoctrineMigrations" + "app-migrations-dir": "Test/Fixtures/App/app/DoctrineMigrations", + "symfony-app-dir": "Test/Fixtures/App/app/" }, "minimum-stability": "dev", "prefer-stable": true From 87a3cd20eeccf1af0e9d55ad0030f175bb35c1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 3 Jul 2017 21:49:21 +0200 Subject: [PATCH 121/163] move test/Fixtures to a new directory --- .gitlab-ci.yml | 7 +- .../test}/Fixtures/App/app/AppKernel.php | 0 .../App/app/DoctrineMigrations/.gitignore | 0 .../Fixtures/App/app/Resources/.DS_Store | Bin .../test}/Fixtures/App/app/autoload.php | 6 +- .../test/Fixtures/App/app/bootstrap.php.cache | 1362 ++++++++ .../cache/dev/appDevDebugProjectContainer.php | 0 .../dev/appDevDebugProjectContainer.php.meta | 0 .../cache/dev/appDevDebugProjectContainer.xml | 0 .../appDevDebugProjectContainerCompiler.log | 0 .../Fixtures/App/app/cache/dev/classes.map | 0 .../test}/Fixtures/App/app/config/config.yml | 0 .../Fixtures/App/app/config/config_dev.yml | 0 .../Fixtures/App/app/config/config_test.yml | 0 ...mizable_entities_test_not_empty_config.yml | 0 .../App/app/config/parameters.gitlab-ci.yml | 0 .../App/app/config/parameters.travis.yml | 0 .../Fixtures/App/app/config/parameters.yml | 8 + .../App/app/config/parameters.yml.dist | 0 .../test}/Fixtures/App/app/config/routing.yml | 0 .../test}/Fixtures/App/app/console | 19 +- .../test}/Fixtures/App/web/app_dev.php | 0 Test/Fixtures/App/app/bootstrap.php.cache | 3101 ----------------- Test/Fixtures/bootstrap.php | 8 - composer.json | 3 + phpunit.xml.dist | 4 +- 26 files changed, 1390 insertions(+), 3128 deletions(-) rename {Test => Resources/test}/Fixtures/App/app/AppKernel.php (100%) rename {Test => Resources/test}/Fixtures/App/app/DoctrineMigrations/.gitignore (100%) rename {Test => Resources/test}/Fixtures/App/app/Resources/.DS_Store (100%) rename {Test => Resources/test}/Fixtures/App/app/autoload.php (64%) create mode 100644 Resources/test/Fixtures/App/app/bootstrap.php.cache rename {Test => Resources/test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php (100%) rename {Test => Resources/test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta (100%) rename {Test => Resources/test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml (100%) rename {Test => Resources/test}/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log (100%) rename {Test => Resources/test}/Fixtures/App/app/cache/dev/classes.map (100%) rename {Test => Resources/test}/Fixtures/App/app/config/config.yml (100%) rename {Test => Resources/test}/Fixtures/App/app/config/config_dev.yml (100%) rename {Test => Resources/test}/Fixtures/App/app/config/config_test.yml (100%) rename {Test => Resources/test}/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml (100%) rename {Test => Resources/test}/Fixtures/App/app/config/parameters.gitlab-ci.yml (100%) rename {Test => Resources/test}/Fixtures/App/app/config/parameters.travis.yml (100%) create mode 100644 Resources/test/Fixtures/App/app/config/parameters.yml rename {Test => Resources/test}/Fixtures/App/app/config/parameters.yml.dist (100%) rename {Test => Resources/test}/Fixtures/App/app/config/routing.yml (100%) rename {Test => Resources/test}/Fixtures/App/app/console (75%) rename {Test => Resources/test}/Fixtures/App/web/app_dev.php (100%) delete mode 100644 Test/Fixtures/App/app/bootstrap.php.cache delete mode 100644 Test/Fixtures/bootstrap.php diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 651b9361f..af5c0b5d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,10 +5,9 @@ before_script: - composer config github-oauth.github.com $GITHUB_TOKEN - php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction - - cp Test/Fixtures/App/app/config/parameters.gitlab-ci.yml Test/Fixtures/App/app/config/parameters.yml - # - php Test/Fixtures/App/app/console --env=test cache:warmup - - php Test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction - - php Test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction + - cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml + - php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction + - php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction stages: - test diff --git a/Test/Fixtures/App/app/AppKernel.php b/Resources/test/Fixtures/App/app/AppKernel.php similarity index 100% rename from Test/Fixtures/App/app/AppKernel.php rename to Resources/test/Fixtures/App/app/AppKernel.php diff --git a/Test/Fixtures/App/app/DoctrineMigrations/.gitignore b/Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore similarity index 100% rename from Test/Fixtures/App/app/DoctrineMigrations/.gitignore rename to Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore diff --git a/Test/Fixtures/App/app/Resources/.DS_Store b/Resources/test/Fixtures/App/app/Resources/.DS_Store similarity index 100% rename from Test/Fixtures/App/app/Resources/.DS_Store rename to Resources/test/Fixtures/App/app/Resources/.DS_Store diff --git a/Test/Fixtures/App/app/autoload.php b/Resources/test/Fixtures/App/app/autoload.php similarity index 64% rename from Test/Fixtures/App/app/autoload.php rename to Resources/test/Fixtures/App/app/autoload.php index 57a507088..39dc0e2ba 100644 --- a/Test/Fixtures/App/app/autoload.php +++ b/Resources/test/Fixtures/App/app/autoload.php @@ -3,10 +3,8 @@ use Doctrine\Common\Annotations\AnnotationRegistry; use Composer\Autoload\ClassLoader; -/** - * @var ClassLoader $loader - */ -$loader = require __DIR__.'/../../../../vendor/autoload.php'; +/** @var ClassLoader $loader */ +$loader = require __DIR__.'/../../../../../vendor/autoload.php'; AnnotationRegistry::registerLoader(array($loader, 'loadClass')); diff --git a/Resources/test/Fixtures/App/app/bootstrap.php.cache b/Resources/test/Fixtures/App/app/bootstrap.php.cache new file mode 100644 index 000000000..d193afe4c --- /dev/null +++ b/Resources/test/Fixtures/App/app/bootstrap.php.cache @@ -0,0 +1,1362 @@ +parameters = $parameters; +} +public function all() +{ +return $this->parameters; +} +public function keys() +{ +return array_keys($this->parameters); +} +public function replace(array $parameters = array()) +{ +$this->parameters = $parameters; +} +public function add(array $parameters = array()) +{ +$this->parameters = array_replace($this->parameters, $parameters); +} +public function get($key, $default = null, $deep = false) +{ +if ($deep) { +@trigger_error('Using paths to find deeper items in '.__METHOD__.' is deprecated since version 2.8 and will be removed in 3.0. Filter the returned value in your own code instead.', E_USER_DEPRECATED); +} +if (!$deep || false === $pos = strpos($key,'[')) { +return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; +} +$root = substr($key, 0, $pos); +if (!array_key_exists($root, $this->parameters)) { +return $default; +} +$value = $this->parameters[$root]; +$currentKey = null; +for ($i = $pos, $c = strlen($key); $i < $c; ++$i) { +$char = $key[$i]; +if ('['=== $char) { +if (null !== $currentKey) { +throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "[" at position %d.', $i)); +} +$currentKey =''; +} elseif (']'=== $char) { +if (null === $currentKey) { +throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "]" at position %d.', $i)); +} +if (!is_array($value) || !array_key_exists($currentKey, $value)) { +return $default; +} +$value = $value[$currentKey]; +$currentKey = null; +} else { +if (null === $currentKey) { +throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "%s" at position %d.', $char, $i)); +} +$currentKey .= $char; +} +} +if (null !== $currentKey) { +throw new \InvalidArgumentException('Malformed path. Path must end with "]".'); +} +return $value; +} +public function set($key, $value) +{ +$this->parameters[$key] = $value; +} +public function has($key) +{ +return array_key_exists($key, $this->parameters); +} +public function remove($key) +{ +unset($this->parameters[$key]); +} +public function getAlpha($key, $default ='', $deep = false) +{ +return preg_replace('/[^[:alpha:]]/','', $this->get($key, $default, $deep)); +} +public function getAlnum($key, $default ='', $deep = false) +{ +return preg_replace('/[^[:alnum:]]/','', $this->get($key, $default, $deep)); +} +public function getDigits($key, $default ='', $deep = false) +{ +return str_replace(array('-','+'),'', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT, array(), $deep)); +} +public function getInt($key, $default = 0, $deep = false) +{ +return (int) $this->get($key, $default, $deep); +} +public function getBoolean($key, $default = false, $deep = false) +{ +return $this->filter($key, $default, FILTER_VALIDATE_BOOLEAN, array(), $deep); +} +public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = array(), $deep = false) +{ +static $filters = null; +if (null === $filters) { +foreach (filter_list() as $tmp) { +$filters[filter_id($tmp)] = 1; +} +} +if (is_bool($filter) || !isset($filters[$filter]) || is_array($deep)) { +@trigger_error('Passing the $deep boolean as 3rd argument to the '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Remove it altogether as the $deep argument will be removed in 3.0.', E_USER_DEPRECATED); +$tmp = $deep; +$deep = $filter; +$filter = $options; +$options = $tmp; +} +$value = $this->get($key, $default, $deep); +if (!is_array($options) && $options) { +$options = array('flags'=> $options); +} +if (is_array($value) && !isset($options['flags'])) { +$options['flags'] = FILTER_REQUIRE_ARRAY; +} +return filter_var($value, $filter, $options); +} +public function getIterator() +{ +return new \ArrayIterator($this->parameters); +} +public function count() +{ +return count($this->parameters); +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class HeaderBag implements \IteratorAggregate, \Countable +{ +protected $headers = array(); +protected $cacheControl = array(); +public function __construct(array $headers = array()) +{ +foreach ($headers as $key => $values) { +$this->set($key, $values); +} +} +public function __toString() +{ +if (!$this->headers) { +return''; +} +$max = max(array_map('strlen', array_keys($this->headers))) + 1; +$content =''; +ksort($this->headers); +foreach ($this->headers as $name => $values) { +$name = implode('-', array_map('ucfirst', explode('-', $name))); +foreach ($values as $value) { +$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); +} +} +return $content; +} +public function all() +{ +return $this->headers; +} +public function keys() +{ +return array_keys($this->headers); +} +public function replace(array $headers = array()) +{ +$this->headers = array(); +$this->add($headers); +} +public function add(array $headers) +{ +foreach ($headers as $key => $values) { +$this->set($key, $values); +} +} +public function get($key, $default = null, $first = true) +{ +$key = str_replace('_','-', strtolower($key)); +if (!array_key_exists($key, $this->headers)) { +if (null === $default) { +return $first ? null : array(); +} +return $first ? $default : array($default); +} +if ($first) { +return count($this->headers[$key]) ? $this->headers[$key][0] : $default; +} +return $this->headers[$key]; +} +public function set($key, $values, $replace = true) +{ +$key = str_replace('_','-', strtolower($key)); +$values = array_values((array) $values); +if (true === $replace || !isset($this->headers[$key])) { +$this->headers[$key] = $values; +} else { +$this->headers[$key] = array_merge($this->headers[$key], $values); +} +if ('cache-control'=== $key) { +$this->cacheControl = $this->parseCacheControl($values[0]); +} +} +public function has($key) +{ +return array_key_exists(str_replace('_','-', strtolower($key)), $this->headers); +} +public function contains($key, $value) +{ +return in_array($value, $this->get($key, null, false)); +} +public function remove($key) +{ +$key = str_replace('_','-', strtolower($key)); +unset($this->headers[$key]); +if ('cache-control'=== $key) { +$this->cacheControl = array(); +} +} +public function getDate($key, \DateTime $default = null) +{ +if (null === $value = $this->get($key)) { +return $default; +} +if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { +throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value)); +} +return $date; +} +public function addCacheControlDirective($key, $value = true) +{ +$this->cacheControl[$key] = $value; +$this->set('Cache-Control', $this->getCacheControlHeader()); +} +public function hasCacheControlDirective($key) +{ +return array_key_exists($key, $this->cacheControl); +} +public function getCacheControlDirective($key) +{ +return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; +} +public function removeCacheControlDirective($key) +{ +unset($this->cacheControl[$key]); +$this->set('Cache-Control', $this->getCacheControlHeader()); +} +public function getIterator() +{ +return new \ArrayIterator($this->headers); +} +public function count() +{ +return count($this->headers); +} +protected function getCacheControlHeader() +{ +$parts = array(); +ksort($this->cacheControl); +foreach ($this->cacheControl as $key => $value) { +if (true === $value) { +$parts[] = $key; +} else { +if (preg_match('#[^a-zA-Z0-9._-]#', $value)) { +$value ='"'.$value.'"'; +} +$parts[] = "$key=$value"; +} +} +return implode(', ', $parts); +} +protected function parseCacheControl($header) +{ +$cacheControl = array(); +preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER); +foreach ($matches as $match) { +$cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true); +} +return $cacheControl; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +use Symfony\Component\HttpFoundation\File\UploadedFile; +class FileBag extends ParameterBag +{ +private static $fileKeys = array('error','name','size','tmp_name','type'); +public function __construct(array $parameters = array()) +{ +$this->replace($parameters); +} +public function replace(array $files = array()) +{ +$this->parameters = array(); +$this->add($files); +} +public function set($key, $value) +{ +if (!is_array($value) && !$value instanceof UploadedFile) { +throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); +} +parent::set($key, $this->convertFileInformation($value)); +} +public function add(array $files = array()) +{ +foreach ($files as $key => $file) { +$this->set($key, $file); +} +} +protected function convertFileInformation($file) +{ +if ($file instanceof UploadedFile) { +return $file; +} +$file = $this->fixPhpFilesArray($file); +if (is_array($file)) { +$keys = array_keys($file); +sort($keys); +if ($keys == self::$fileKeys) { +if (UPLOAD_ERR_NO_FILE == $file['error']) { +$file = null; +} else { +$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']); +} +} else { +$file = array_map(array($this,'convertFileInformation'), $file); +} +} +return $file; +} +protected function fixPhpFilesArray($data) +{ +if (!is_array($data)) { +return $data; +} +$keys = array_keys($data); +sort($keys); +if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) { +return $data; +} +$files = $data; +foreach (self::$fileKeys as $k) { +unset($files[$k]); +} +foreach ($data['name'] as $key => $name) { +$files[$key] = $this->fixPhpFilesArray(array('error'=> $data['error'][$key],'name'=> $name,'type'=> $data['type'][$key],'tmp_name'=> $data['tmp_name'][$key],'size'=> $data['size'][$key], +)); +} +return $files; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +class ServerBag extends ParameterBag +{ +public function getHeaders() +{ +$headers = array(); +$contentHeaders = array('CONTENT_LENGTH'=> true,'CONTENT_MD5'=> true,'CONTENT_TYPE'=> true); +foreach ($this->parameters as $key => $value) { +if (0 === strpos($key,'HTTP_')) { +$headers[substr($key, 5)] = $value; +} +elseif (isset($contentHeaders[$key])) { +$headers[$key] = $value; +} +} +if (isset($this->parameters['PHP_AUTH_USER'])) { +$headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; +$headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] :''; +} else { +$authorizationHeader = null; +if (isset($this->parameters['HTTP_AUTHORIZATION'])) { +$authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; +} elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { +$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; +} +if (null !== $authorizationHeader) { +if (0 === stripos($authorizationHeader,'basic ')) { +$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); +if (count($exploded) == 2) { +list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded; +} +} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest '))) { +$headers['PHP_AUTH_DIGEST'] = $authorizationHeader; +$this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; +} elseif (0 === stripos($authorizationHeader,'bearer ')) { +$headers['AUTHORIZATION'] = $authorizationHeader; +} +} +} +if (isset($headers['AUTHORIZATION'])) { +return $headers; +} +if (isset($headers['PHP_AUTH_USER'])) { +$headers['AUTHORIZATION'] ='Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); +} elseif (isset($headers['PHP_AUTH_DIGEST'])) { +$headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; +} +return $headers; +} +} +} +namespace Symfony\Component\HttpFoundation +{ +use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; +use Symfony\Component\HttpFoundation\Session\SessionInterface; +class Request +{ +const HEADER_FORWARDED ='forwarded'; +const HEADER_CLIENT_IP ='client_ip'; +const HEADER_CLIENT_HOST ='client_host'; +const HEADER_CLIENT_PROTO ='client_proto'; +const HEADER_CLIENT_PORT ='client_port'; +const METHOD_HEAD ='HEAD'; +const METHOD_GET ='GET'; +const METHOD_POST ='POST'; +const METHOD_PUT ='PUT'; +const METHOD_PATCH ='PATCH'; +const METHOD_DELETE ='DELETE'; +const METHOD_PURGE ='PURGE'; +const METHOD_OPTIONS ='OPTIONS'; +const METHOD_TRACE ='TRACE'; +const METHOD_CONNECT ='CONNECT'; +protected static $trustedProxies = array(); +protected static $trustedHostPatterns = array(); +protected static $trustedHosts = array(); +protected static $trustedHeaders = array( +self::HEADER_FORWARDED =>'FORWARDED', +self::HEADER_CLIENT_IP =>'X_FORWARDED_FOR', +self::HEADER_CLIENT_HOST =>'X_FORWARDED_HOST', +self::HEADER_CLIENT_PROTO =>'X_FORWARDED_PROTO', +self::HEADER_CLIENT_PORT =>'X_FORWARDED_PORT', +); +protected static $httpMethodParameterOverride = false; +public $attributes; +public $request; +public $query; +public $server; +public $files; +public $cookies; +public $headers; +protected $content; +protected $languages; +protected $charsets; +protected $encodings; +protected $acceptableContentTypes; +protected $pathInfo; +protected $requestUri; +protected $baseUrl; +protected $basePath; +protected $method; +protected $format; +protected $session; +protected $locale; +protected $defaultLocale ='en'; +protected static $formats; +protected static $requestFactory; +private $isForwardedValid = true; +private static $forwardedParams = array( +self::HEADER_CLIENT_IP =>'for', +self::HEADER_CLIENT_HOST =>'host', +self::HEADER_CLIENT_PROTO =>'proto', +self::HEADER_CLIENT_PORT =>'host', +); +public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); +} +public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +$this->request = new ParameterBag($request); +$this->query = new ParameterBag($query); +$this->attributes = new ParameterBag($attributes); +$this->cookies = new ParameterBag($cookies); +$this->files = new FileBag($files); +$this->server = new ServerBag($server); +$this->headers = new HeaderBag($this->server->getHeaders()); +$this->content = $content; +$this->languages = null; +$this->charsets = null; +$this->encodings = null; +$this->acceptableContentTypes = null; +$this->pathInfo = null; +$this->requestUri = null; +$this->baseUrl = null; +$this->basePath = null; +$this->method = null; +$this->format = null; +} +public static function createFromGlobals() +{ +$server = $_SERVER; +if ('cli-server'=== PHP_SAPI) { +if (array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) { +$server['CONTENT_LENGTH'] = $_SERVER['HTTP_CONTENT_LENGTH']; +} +if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) { +$server['CONTENT_TYPE'] = $_SERVER['HTTP_CONTENT_TYPE']; +} +} +$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $server); +if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded') +&& in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH')) +) { +parse_str($request->getContent(), $data); +$request->request = new ParameterBag($data); +} +return $request; +} +public static function create($uri, $method ='GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null) +{ +$server = array_replace(array('SERVER_NAME'=>'localhost','SERVER_PORT'=> 80,'HTTP_HOST'=>'localhost','HTTP_USER_AGENT'=>'Symfony/2.X','HTTP_ACCEPT'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','HTTP_ACCEPT_LANGUAGE'=>'en-us,en;q=0.5','HTTP_ACCEPT_CHARSET'=>'ISO-8859-1,utf-8;q=0.7,*;q=0.7','REMOTE_ADDR'=>'127.0.0.1','SCRIPT_NAME'=>'','SCRIPT_FILENAME'=>'','SERVER_PROTOCOL'=>'HTTP/1.1','REQUEST_TIME'=> time(), +), $server); +$server['PATH_INFO'] =''; +$server['REQUEST_METHOD'] = strtoupper($method); +$components = parse_url($uri); +if (isset($components['host'])) { +$server['SERVER_NAME'] = $components['host']; +$server['HTTP_HOST'] = $components['host']; +} +if (isset($components['scheme'])) { +if ('https'=== $components['scheme']) { +$server['HTTPS'] ='on'; +$server['SERVER_PORT'] = 443; +} else { +unset($server['HTTPS']); +$server['SERVER_PORT'] = 80; +} +} +if (isset($components['port'])) { +$server['SERVER_PORT'] = $components['port']; +$server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port']; +} +if (isset($components['user'])) { +$server['PHP_AUTH_USER'] = $components['user']; +} +if (isset($components['pass'])) { +$server['PHP_AUTH_PW'] = $components['pass']; +} +if (!isset($components['path'])) { +$components['path'] ='/'; +} +switch (strtoupper($method)) { +case'POST': +case'PUT': +case'DELETE': +if (!isset($server['CONTENT_TYPE'])) { +$server['CONTENT_TYPE'] ='application/x-www-form-urlencoded'; +} +case'PATCH': +$request = $parameters; +$query = array(); +break; +default: +$request = array(); +$query = $parameters; +break; +} +$queryString =''; +if (isset($components['query'])) { +parse_str(html_entity_decode($components['query']), $qs); +if ($query) { +$query = array_replace($qs, $query); +$queryString = http_build_query($query,'','&'); +} else { +$query = $qs; +$queryString = $components['query']; +} +} elseif ($query) { +$queryString = http_build_query($query,'','&'); +} +$server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :''); +$server['QUERY_STRING'] = $queryString; +return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content); +} +public static function setFactory($callable) +{ +self::$requestFactory = $callable; +} +public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) +{ +$dup = clone $this; +if ($query !== null) { +$dup->query = new ParameterBag($query); +} +if ($request !== null) { +$dup->request = new ParameterBag($request); +} +if ($attributes !== null) { +$dup->attributes = new ParameterBag($attributes); +} +if ($cookies !== null) { +$dup->cookies = new ParameterBag($cookies); +} +if ($files !== null) { +$dup->files = new FileBag($files); +} +if ($server !== null) { +$dup->server = new ServerBag($server); +$dup->headers = new HeaderBag($dup->server->getHeaders()); +} +$dup->languages = null; +$dup->charsets = null; +$dup->encodings = null; +$dup->acceptableContentTypes = null; +$dup->pathInfo = null; +$dup->requestUri = null; +$dup->baseUrl = null; +$dup->basePath = null; +$dup->method = null; +$dup->format = null; +if (!$dup->get('_format') && $this->get('_format')) { +$dup->attributes->set('_format', $this->get('_format')); +} +if (!$dup->getRequestFormat(null)) { +$dup->setRequestFormat($this->getRequestFormat(null)); +} +return $dup; +} +public function __clone() +{ +$this->query = clone $this->query; +$this->request = clone $this->request; +$this->attributes = clone $this->attributes; +$this->cookies = clone $this->cookies; +$this->files = clone $this->files; +$this->server = clone $this->server; +$this->headers = clone $this->headers; +} +public function __toString() +{ +try { +$content = $this->getContent(); +} catch (\LogicException $e) { +return trigger_error($e, E_USER_ERROR); +} +return +sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". +$this->headers."\r\n". +$content; +} +public function overrideGlobals() +{ +$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), null,'&'))); +$_GET = $this->query->all(); +$_POST = $this->request->all(); +$_SERVER = $this->server->all(); +$_COOKIE = $this->cookies->all(); +foreach ($this->headers->all() as $key => $value) { +$key = strtoupper(str_replace('-','_', $key)); +if (in_array($key, array('CONTENT_TYPE','CONTENT_LENGTH'))) { +$_SERVER[$key] = implode(', ', $value); +} else { +$_SERVER['HTTP_'.$key] = implode(', ', $value); +} +} +$request = array('g'=> $_GET,'p'=> $_POST,'c'=> $_COOKIE); +$requestOrder = ini_get('request_order') ?: ini_get('variables_order'); +$requestOrder = preg_replace('#[^cgp]#','', strtolower($requestOrder)) ?:'gp'; +$_REQUEST = array(); +foreach (str_split($requestOrder) as $order) { +$_REQUEST = array_merge($_REQUEST, $request[$order]); +} +} +public static function setTrustedProxies(array $proxies) +{ +self::$trustedProxies = $proxies; +} +public static function getTrustedProxies() +{ +return self::$trustedProxies; +} +public static function setTrustedHosts(array $hostPatterns) +{ +self::$trustedHostPatterns = array_map(function ($hostPattern) { +return sprintf('#%s#i', $hostPattern); +}, $hostPatterns); +self::$trustedHosts = array(); +} +public static function getTrustedHosts() +{ +return self::$trustedHostPatterns; +} +public static function setTrustedHeaderName($key, $value) +{ +if (!array_key_exists($key, self::$trustedHeaders)) { +throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key)); +} +self::$trustedHeaders[$key] = $value; +} +public static function getTrustedHeaderName($key) +{ +if (!array_key_exists($key, self::$trustedHeaders)) { +throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key)); +} +return self::$trustedHeaders[$key]; +} +public static function normalizeQueryString($qs) +{ +if (''== $qs) { +return''; +} +$parts = array(); +$order = array(); +foreach (explode('&', $qs) as $param) { +if (''=== $param ||'='=== $param[0]) { +continue; +} +$keyValuePair = explode('=', $param, 2); +$parts[] = isset($keyValuePair[1]) ? +rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : +rawurlencode(urldecode($keyValuePair[0])); +$order[] = urldecode($keyValuePair[0]); +} +array_multisort($order, SORT_ASC, $parts); +return implode('&', $parts); +} +public static function enableHttpMethodParameterOverride() +{ +self::$httpMethodParameterOverride = true; +} +public static function getHttpMethodParameterOverride() +{ +return self::$httpMethodParameterOverride; +} +public function get($key, $default = null, $deep = false) +{ +if ($deep) { +@trigger_error('Using paths to find deeper items in '.__METHOD__.' is deprecated since version 2.8 and will be removed in 3.0. Filter the returned value in your own code instead.', E_USER_DEPRECATED); +} +if ($this !== $result = $this->query->get($key, $this, $deep)) { +return $result; +} +if ($this !== $result = $this->attributes->get($key, $this, $deep)) { +return $result; +} +if ($this !== $result = $this->request->get($key, $this, $deep)) { +return $result; +} +return $default; +} +public function getSession() +{ +return $this->session; +} +public function hasPreviousSession() +{ +return $this->hasSession() && $this->cookies->has($this->session->getName()); +} +public function hasSession() +{ +return null !== $this->session; +} +public function setSession(SessionInterface $session) +{ +$this->session = $session; +} +public function getClientIps() +{ +$ip = $this->server->get('REMOTE_ADDR'); +if (!$this->isFromTrustedProxy()) { +return array($ip); +} +return $this->getTrustedValues(self::HEADER_CLIENT_IP, $ip) ?: array($ip); +} +public function getClientIp() +{ +$ipAddresses = $this->getClientIps(); +return $ipAddresses[0]; +} +public function getScriptName() +{ +return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME','')); +} +public function getPathInfo() +{ +if (null === $this->pathInfo) { +$this->pathInfo = $this->preparePathInfo(); +} +return $this->pathInfo; +} +public function getBasePath() +{ +if (null === $this->basePath) { +$this->basePath = $this->prepareBasePath(); +} +return $this->basePath; +} +public function getBaseUrl() +{ +if (null === $this->baseUrl) { +$this->baseUrl = $this->prepareBaseUrl(); +} +return $this->baseUrl; +} +public function getScheme() +{ +return $this->isSecure() ?'https':'http'; +} +public function getPort() +{ +if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_PORT)) { +$host = $host[0]; +} elseif ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_HOST)) { +$host = $host[0]; +} elseif (!$host = $this->headers->get('HOST')) { +return $this->server->get('SERVER_PORT'); +} +if ($host[0] ==='[') { +$pos = strpos($host,':', strrpos($host,']')); +} else { +$pos = strrpos($host,':'); +} +if (false !== $pos) { +return (int) substr($host, $pos + 1); +} +return'https'=== $this->getScheme() ? 443 : 80; +} +public function getUser() +{ +return $this->headers->get('PHP_AUTH_USER'); +} +public function getPassword() +{ +return $this->headers->get('PHP_AUTH_PW'); +} +public function getUserInfo() +{ +$userinfo = $this->getUser(); +$pass = $this->getPassword(); +if (''!= $pass) { +$userinfo .= ":$pass"; +} +return $userinfo; +} +public function getHttpHost() +{ +$scheme = $this->getScheme(); +$port = $this->getPort(); +if (('http'== $scheme && $port == 80) || ('https'== $scheme && $port == 443)) { +return $this->getHost(); +} +return $this->getHost().':'.$port; +} +public function getRequestUri() +{ +if (null === $this->requestUri) { +$this->requestUri = $this->prepareRequestUri(); +} +return $this->requestUri; +} +public function getSchemeAndHttpHost() +{ +return $this->getScheme().'://'.$this->getHttpHost(); +} +public function getUri() +{ +if (null !== $qs = $this->getQueryString()) { +$qs ='?'.$qs; +} +return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; +} +public function getUriForPath($path) +{ +return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; +} +public function getRelativeUriForPath($path) +{ +if (!isset($path[0]) ||'/'!== $path[0]) { +return $path; +} +if ($path === $basePath = $this->getPathInfo()) { +return''; +} +$sourceDirs = explode('/', isset($basePath[0]) &&'/'=== $basePath[0] ? substr($basePath, 1) : $basePath); +$targetDirs = explode('/', isset($path[0]) &&'/'=== $path[0] ? substr($path, 1) : $path); +array_pop($sourceDirs); +$targetFile = array_pop($targetDirs); +foreach ($sourceDirs as $i => $dir) { +if (isset($targetDirs[$i]) && $dir === $targetDirs[$i]) { +unset($sourceDirs[$i], $targetDirs[$i]); +} else { +break; +} +} +$targetDirs[] = $targetFile; +$path = str_repeat('../', count($sourceDirs)).implode('/', $targetDirs); +return !isset($path[0]) ||'/'=== $path[0] +|| false !== ($colonPos = strpos($path,':')) && ($colonPos < ($slashPos = strpos($path,'/')) || false === $slashPos) +? "./$path" : $path; +} +public function getQueryString() +{ +$qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); +return''=== $qs ? null : $qs; +} +public function isSecure() +{ +if ($this->isFromTrustedProxy() && $proto = $this->getTrustedValues(self::HEADER_CLIENT_PROTO)) { +return in_array(strtolower($proto[0]), array('https','on','ssl','1'), true); +} +$https = $this->server->get('HTTPS'); +return !empty($https) &&'off'!== strtolower($https); +} +public function getHost() +{ +if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_HOST)) { +$host = $host[0]; +} elseif (!$host = $this->headers->get('HOST')) { +if (!$host = $this->server->get('SERVER_NAME')) { +$host = $this->server->get('SERVER_ADDR',''); +} +} +$host = strtolower(preg_replace('/:\d+$/','', trim($host))); +if ($host &&''!== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/','', $host)) { +throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host)); +} +if (count(self::$trustedHostPatterns) > 0) { +if (in_array($host, self::$trustedHosts)) { +return $host; +} +foreach (self::$trustedHostPatterns as $pattern) { +if (preg_match($pattern, $host)) { +self::$trustedHosts[] = $host; +return $host; +} +} +throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host)); +} +return $host; +} +public function setMethod($method) +{ +$this->method = null; +$this->server->set('REQUEST_METHOD', $method); +} +public function getMethod() +{ +if (null === $this->method) { +$this->method = strtoupper($this->server->get('REQUEST_METHOD','GET')); +if ('POST'=== $this->method) { +if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { +$this->method = strtoupper($method); +} elseif (self::$httpMethodParameterOverride) { +$this->method = strtoupper($this->request->get('_method', $this->query->get('_method','POST'))); +} +} +} +return $this->method; +} +public function getRealMethod() +{ +return strtoupper($this->server->get('REQUEST_METHOD','GET')); +} +public function getMimeType($format) +{ +if (null === static::$formats) { +static::initializeFormats(); +} +return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; +} +public function getFormat($mimeType) +{ +$canonicalMimeType = null; +if (false !== $pos = strpos($mimeType,';')) { +$canonicalMimeType = substr($mimeType, 0, $pos); +} +if (null === static::$formats) { +static::initializeFormats(); +} +foreach (static::$formats as $format => $mimeTypes) { +if (in_array($mimeType, (array) $mimeTypes)) { +return $format; +} +if (null !== $canonicalMimeType && in_array($canonicalMimeType, (array) $mimeTypes)) { +return $format; +} +} +} +public function setFormat($format, $mimeTypes) +{ +if (null === static::$formats) { +static::initializeFormats(); +} +static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes); +} +public function getRequestFormat($default ='html') +{ +if (null === $this->format) { +$this->format = $this->get('_format'); +} +return null === $this->format ? $default : $this->format; +} +public function setRequestFormat($format) +{ +$this->format = $format; +} +public function getContentType() +{ +return $this->getFormat($this->headers->get('CONTENT_TYPE')); +} +public function setDefaultLocale($locale) +{ +$this->defaultLocale = $locale; +if (null === $this->locale) { +$this->setPhpDefaultLocale($locale); +} +} +public function getDefaultLocale() +{ +return $this->defaultLocale; +} +public function setLocale($locale) +{ +$this->setPhpDefaultLocale($this->locale = $locale); +} +public function getLocale() +{ +return null === $this->locale ? $this->defaultLocale : $this->locale; +} +public function isMethod($method) +{ +return $this->getMethod() === strtoupper($method); +} +public function isMethodSafe() +{ +return in_array($this->getMethod(), 0 < func_num_args() && !func_get_arg(0) ? array('GET','HEAD','OPTIONS','TRACE') : array('GET','HEAD')); +} +public function isMethodCacheable() +{ +return in_array($this->getMethod(), array('GET','HEAD')); +} +public function getContent($asResource = false) +{ +$currentContentIsResource = is_resource($this->content); +if (\PHP_VERSION_ID < 50600 && false === $this->content) { +throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); +} +if (true === $asResource) { +if ($currentContentIsResource) { +rewind($this->content); +return $this->content; +} +if (is_string($this->content)) { +$resource = fopen('php://temp','r+'); +fwrite($resource, $this->content); +rewind($resource); +return $resource; +} +$this->content = false; +return fopen('php://input','rb'); +} +if ($currentContentIsResource) { +rewind($this->content); +return stream_get_contents($this->content); +} +if (null === $this->content || false === $this->content) { +$this->content = file_get_contents('php://input'); +} +return $this->content; +} +public function getETags() +{ +return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY); +} +public function isNoCache() +{ +return $this->headers->hasCacheControlDirective('no-cache') ||'no-cache'== $this->headers->get('Pragma'); +} +public function getPreferredLanguage(array $locales = null) +{ +$preferredLanguages = $this->getLanguages(); +if (empty($locales)) { +return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null; +} +if (!$preferredLanguages) { +return $locales[0]; +} +$extendedPreferredLanguages = array(); +foreach ($preferredLanguages as $language) { +$extendedPreferredLanguages[] = $language; +if (false !== $position = strpos($language,'_')) { +$superLanguage = substr($language, 0, $position); +if (!in_array($superLanguage, $preferredLanguages)) { +$extendedPreferredLanguages[] = $superLanguage; +} +} +} +$preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales)); +return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $locales[0]; +} +public function getLanguages() +{ +if (null !== $this->languages) { +return $this->languages; +} +$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); +$this->languages = array(); +foreach ($languages as $lang => $acceptHeaderItem) { +if (false !== strpos($lang,'-')) { +$codes = explode('-', $lang); +if ('i'=== $codes[0]) { +if (count($codes) > 1) { +$lang = $codes[1]; +} +} else { +for ($i = 0, $max = count($codes); $i < $max; ++$i) { +if ($i === 0) { +$lang = strtolower($codes[0]); +} else { +$lang .='_'.strtoupper($codes[$i]); +} +} +} +} +$this->languages[] = $lang; +} +return $this->languages; +} +public function getCharsets() +{ +if (null !== $this->charsets) { +return $this->charsets; +} +return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()); +} +public function getEncodings() +{ +if (null !== $this->encodings) { +return $this->encodings; +} +return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all()); +} +public function getAcceptableContentTypes() +{ +if (null !== $this->acceptableContentTypes) { +return $this->acceptableContentTypes; +} +return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()); +} +public function isXmlHttpRequest() +{ +return'XMLHttpRequest'== $this->headers->get('X-Requested-With'); +} +protected function prepareRequestUri() +{ +$requestUri =''; +if ($this->headers->has('X_ORIGINAL_URL')) { +$requestUri = $this->headers->get('X_ORIGINAL_URL'); +$this->headers->remove('X_ORIGINAL_URL'); +$this->server->remove('HTTP_X_ORIGINAL_URL'); +$this->server->remove('UNENCODED_URL'); +$this->server->remove('IIS_WasUrlRewritten'); +} elseif ($this->headers->has('X_REWRITE_URL')) { +$requestUri = $this->headers->get('X_REWRITE_URL'); +$this->headers->remove('X_REWRITE_URL'); +} elseif ($this->server->get('IIS_WasUrlRewritten') =='1'&& $this->server->get('UNENCODED_URL') !='') { +$requestUri = $this->server->get('UNENCODED_URL'); +$this->server->remove('UNENCODED_URL'); +$this->server->remove('IIS_WasUrlRewritten'); +} elseif ($this->server->has('REQUEST_URI')) { +$requestUri = $this->server->get('REQUEST_URI'); +$schemeAndHttpHost = $this->getSchemeAndHttpHost(); +if (strpos($requestUri, $schemeAndHttpHost) === 0) { +$requestUri = substr($requestUri, strlen($schemeAndHttpHost)); +} +} elseif ($this->server->has('ORIG_PATH_INFO')) { +$requestUri = $this->server->get('ORIG_PATH_INFO'); +if (''!= $this->server->get('QUERY_STRING')) { +$requestUri .='?'.$this->server->get('QUERY_STRING'); +} +$this->server->remove('ORIG_PATH_INFO'); +} +$this->server->set('REQUEST_URI', $requestUri); +return $requestUri; +} +protected function prepareBaseUrl() +{ +$filename = basename($this->server->get('SCRIPT_FILENAME')); +if (basename($this->server->get('SCRIPT_NAME')) === $filename) { +$baseUrl = $this->server->get('SCRIPT_NAME'); +} elseif (basename($this->server->get('PHP_SELF')) === $filename) { +$baseUrl = $this->server->get('PHP_SELF'); +} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) { +$baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); } else { +$path = $this->server->get('PHP_SELF',''); +$file = $this->server->get('SCRIPT_FILENAME',''); +$segs = explode('/', trim($file,'/')); +$segs = array_reverse($segs); +$index = 0; +$last = count($segs); +$baseUrl =''; +do { +$seg = $segs[$index]; +$baseUrl ='/'.$seg.$baseUrl; +++$index; +} while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); +} +$requestUri = $this->getRequestUri(); +if ($requestUri !==''&& $requestUri[0] !=='/') { +$requestUri ='/'.$requestUri; +} +if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { +return $prefix; +} +if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, rtrim(dirname($baseUrl),'/'.DIRECTORY_SEPARATOR).'/')) { +return rtrim($prefix,'/'.DIRECTORY_SEPARATOR); +} +$truncatedRequestUri = $requestUri; +if (false !== $pos = strpos($requestUri,'?')) { +$truncatedRequestUri = substr($requestUri, 0, $pos); +} +$basename = basename($baseUrl); +if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) { +return''; +} +if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) { +$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); +} +return rtrim($baseUrl,'/'.DIRECTORY_SEPARATOR); +} +protected function prepareBasePath() +{ +$filename = basename($this->server->get('SCRIPT_FILENAME')); +$baseUrl = $this->getBaseUrl(); +if (empty($baseUrl)) { +return''; +} +if (basename($baseUrl) === $filename) { +$basePath = dirname($baseUrl); +} else { +$basePath = $baseUrl; +} +if ('\\'=== DIRECTORY_SEPARATOR) { +$basePath = str_replace('\\','/', $basePath); +} +return rtrim($basePath,'/'); +} +protected function preparePathInfo() +{ +$baseUrl = $this->getBaseUrl(); +if (null === ($requestUri = $this->getRequestUri())) { +return'/'; +} +if (false !== $pos = strpos($requestUri,'?')) { +$requestUri = substr($requestUri, 0, $pos); +} +if ($requestUri !==''&& $requestUri[0] !=='/') { +$requestUri ='/'.$requestUri; +} +$pathInfo = substr($requestUri, strlen($baseUrl)); +if (null !== $baseUrl && (false === $pathInfo ||''=== $pathInfo)) { +return'/'; +} elseif (null === $baseUrl) { +return $requestUri; +} +return (string) $pathInfo; +} +protected static function initializeFormats() +{ +static::$formats = array('html'=> array('text/html','application/xhtml+xml'),'txt'=> array('text/plain'),'js'=> array('application/javascript','application/x-javascript','text/javascript'),'css'=> array('text/css'),'json'=> array('application/json','application/x-json'),'xml'=> array('text/xml','application/xml','application/x-xml'),'rdf'=> array('application/rdf+xml'),'atom'=> array('application/atom+xml'),'rss'=> array('application/rss+xml'),'form'=> array('application/x-www-form-urlencoded'), +); +} +private function setPhpDefaultLocale($locale) +{ +try { +if (class_exists('Locale', false)) { +\Locale::setDefault($locale); +} +} catch (\Exception $e) { +} +} +private function getUrlencodedPrefix($string, $prefix) +{ +if (0 !== strpos(rawurldecode($string), $prefix)) { +return false; +} +$len = strlen($prefix); +if (preg_match(sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) { +return $match[0]; +} +return false; +} +private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) +{ +if (self::$requestFactory) { +$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content); +if (!$request instanceof self) { +throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.'); +} +return $request; +} +return new static($query, $request, $attributes, $cookies, $files, $server, $content); +} +private function isFromTrustedProxy() +{ +return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR'), self::$trustedProxies); +} +private function getTrustedValues($type, $ip = null) +{ +$clientValues = array(); +$forwardedValues = array(); +if (self::$trustedHeaders[$type] && $this->headers->has(self::$trustedHeaders[$type])) { +foreach (explode(',', $this->headers->get(self::$trustedHeaders[$type])) as $v) { +$clientValues[] = (self::HEADER_CLIENT_PORT === $type ?'0.0.0.0:':'').trim($v); +} +} +if (self::$trustedHeaders[self::HEADER_FORWARDED] && $this->headers->has(self::$trustedHeaders[self::HEADER_FORWARDED])) { +$forwardedValues = $this->headers->get(self::$trustedHeaders[self::HEADER_FORWARDED]); +$forwardedValues = preg_match_all(sprintf('{(?:%s)=(?:"?\[?)([a-zA-Z0-9\.:_\-/]*+)}', self::$forwardedParams[$type]), $forwardedValues, $matches) ? $matches[1] : array(); +} +if (null !== $ip) { +$clientValues = $this->normalizeAndFilterClientIps($clientValues, $ip); +$forwardedValues = $this->normalizeAndFilterClientIps($forwardedValues, $ip); +} +if ($forwardedValues === $clientValues || !$clientValues) { +return $forwardedValues; +} +if (!$forwardedValues) { +return $clientValues; +} +if (!$this->isForwardedValid) { +return null !== $ip ? array('0.0.0.0', $ip) : array(); +} +$this->isForwardedValid = false; +throw new ConflictingHeadersException(sprintf('The request has both a trusted "%s" header and a trusted "%s" header, conflicting with each other. You should either configure your proxy to remove one of them, or configure your project to distrust the offending one.', self::$trustedHeaders[self::HEADER_FORWARDED], self::$trustedHeaders[$type])); +} +private function normalizeAndFilterClientIps(array $clientIps, $ip) +{ +if (!$clientIps) { +return array(); +} +$clientIps[] = $ip; $firstTrustedIp = null; +foreach ($clientIps as $key => $clientIp) { +if (preg_match('{((?:\d+\.){3}\d+)\:\d+}', $clientIp, $match)) { +$clientIps[$key] = $clientIp = $match[1]; +} +if (!filter_var($clientIp, FILTER_VALIDATE_IP)) { +unset($clientIps[$key]); +continue; +} +if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { +unset($clientIps[$key]); +if (null === $firstTrustedIp) { +$firstTrustedIp = $clientIp; +} +} +} +return $clientIps ? array_reverse($clientIps) : array($firstTrustedIp); +} +} +} diff --git a/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php b/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php similarity index 100% rename from Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php rename to Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php diff --git a/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta b/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta similarity index 100% rename from Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta rename to Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta diff --git a/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml b/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml similarity index 100% rename from Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml rename to Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml diff --git a/Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log b/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log similarity index 100% rename from Test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log rename to Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log diff --git a/Test/Fixtures/App/app/cache/dev/classes.map b/Resources/test/Fixtures/App/app/cache/dev/classes.map similarity index 100% rename from Test/Fixtures/App/app/cache/dev/classes.map rename to Resources/test/Fixtures/App/app/cache/dev/classes.map diff --git a/Test/Fixtures/App/app/config/config.yml b/Resources/test/Fixtures/App/app/config/config.yml similarity index 100% rename from Test/Fixtures/App/app/config/config.yml rename to Resources/test/Fixtures/App/app/config/config.yml diff --git a/Test/Fixtures/App/app/config/config_dev.yml b/Resources/test/Fixtures/App/app/config/config_dev.yml similarity index 100% rename from Test/Fixtures/App/app/config/config_dev.yml rename to Resources/test/Fixtures/App/app/config/config_dev.yml diff --git a/Test/Fixtures/App/app/config/config_test.yml b/Resources/test/Fixtures/App/app/config/config_test.yml similarity index 100% rename from Test/Fixtures/App/app/config/config_test.yml rename to Resources/test/Fixtures/App/app/config/config_test.yml diff --git a/Test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml b/Resources/test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml similarity index 100% rename from Test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml rename to Resources/test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml diff --git a/Test/Fixtures/App/app/config/parameters.gitlab-ci.yml b/Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml similarity index 100% rename from Test/Fixtures/App/app/config/parameters.gitlab-ci.yml rename to Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml diff --git a/Test/Fixtures/App/app/config/parameters.travis.yml b/Resources/test/Fixtures/App/app/config/parameters.travis.yml similarity index 100% rename from Test/Fixtures/App/app/config/parameters.travis.yml rename to Resources/test/Fixtures/App/app/config/parameters.travis.yml diff --git a/Resources/test/Fixtures/App/app/config/parameters.yml b/Resources/test/Fixtures/App/app/config/parameters.yml new file mode 100644 index 000000000..1c82dd4dd --- /dev/null +++ b/Resources/test/Fixtures/App/app/config/parameters.yml @@ -0,0 +1,8 @@ +parameters: + database_host: 127.0.0.1 + database_port: 5454 +# database_port: 5435 + database_name: postgres + database_user: postgres + database_password: postgres + locale: fr diff --git a/Test/Fixtures/App/app/config/parameters.yml.dist b/Resources/test/Fixtures/App/app/config/parameters.yml.dist similarity index 100% rename from Test/Fixtures/App/app/config/parameters.yml.dist rename to Resources/test/Fixtures/App/app/config/parameters.yml.dist diff --git a/Test/Fixtures/App/app/config/routing.yml b/Resources/test/Fixtures/App/app/config/routing.yml similarity index 100% rename from Test/Fixtures/App/app/config/routing.yml rename to Resources/test/Fixtures/App/app/config/routing.yml diff --git a/Test/Fixtures/App/app/console b/Resources/test/Fixtures/App/app/console similarity index 75% rename from Test/Fixtures/App/app/console rename to Resources/test/Fixtures/App/app/console index fa6a36e24..3086a63d5 100755 --- a/Test/Fixtures/App/app/console +++ b/Resources/test/Fixtures/App/app/console @@ -1,19 +1,20 @@ #!/usr/bin/env php getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod'; diff --git a/Test/Fixtures/App/web/app_dev.php b/Resources/test/Fixtures/App/web/app_dev.php similarity index 100% rename from Test/Fixtures/App/web/app_dev.php rename to Resources/test/Fixtures/App/web/app_dev.php diff --git a/Test/Fixtures/App/app/bootstrap.php.cache b/Test/Fixtures/App/app/bootstrap.php.cache deleted file mode 100644 index e0e844e21..000000000 --- a/Test/Fixtures/App/app/bootstrap.php.cache +++ /dev/null @@ -1,3101 +0,0 @@ -parameters = $parameters; -} -public function all() -{ -return $this->parameters; -} -public function keys() -{ -return array_keys($this->parameters); -} -public function replace(array $parameters = array()) -{ -$this->parameters = $parameters; -} -public function add(array $parameters = array()) -{ -$this->parameters = array_replace($this->parameters, $parameters); -} -public function get($path, $default = null, $deep = false) -{ -if (!$deep || false === $pos = strpos($path,'[')) { -return array_key_exists($path, $this->parameters) ? $this->parameters[$path] : $default; -} -$root = substr($path, 0, $pos); -if (!array_key_exists($root, $this->parameters)) { -return $default; -} -$value = $this->parameters[$root]; -$currentKey = null; -for ($i = $pos, $c = strlen($path); $i < $c; $i++) { -$char = $path[$i]; -if ('['=== $char) { -if (null !== $currentKey) { -throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "[" at position %d.', $i)); -} -$currentKey =''; -} elseif (']'=== $char) { -if (null === $currentKey) { -throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "]" at position %d.', $i)); -} -if (!is_array($value) || !array_key_exists($currentKey, $value)) { -return $default; -} -$value = $value[$currentKey]; -$currentKey = null; -} else { -if (null === $currentKey) { -throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "%s" at position %d.', $char, $i)); -} -$currentKey .= $char; -} -} -if (null !== $currentKey) { -throw new \InvalidArgumentException(sprintf('Malformed path. Path must end with "]".')); -} -return $value; -} -public function set($key, $value) -{ -$this->parameters[$key] = $value; -} -public function has($key) -{ -return array_key_exists($key, $this->parameters); -} -public function remove($key) -{ -unset($this->parameters[$key]); -} -public function getAlpha($key, $default ='', $deep = false) -{ -return preg_replace('/[^[:alpha:]]/','', $this->get($key, $default, $deep)); -} -public function getAlnum($key, $default ='', $deep = false) -{ -return preg_replace('/[^[:alnum:]]/','', $this->get($key, $default, $deep)); -} -public function getDigits($key, $default ='', $deep = false) -{ -return str_replace(array('-','+'),'', $this->filter($key, $default, $deep, FILTER_SANITIZE_NUMBER_INT)); -} -public function getInt($key, $default = 0, $deep = false) -{ -return (int) $this->get($key, $default, $deep); -} -public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array()) -{ -$value = $this->get($key, $default, $deep); -if (!is_array($options) && $options) { -$options = array('flags'=> $options); -} -if (is_array($value) && !isset($options['flags'])) { -$options['flags'] = FILTER_REQUIRE_ARRAY; -} -return filter_var($value, $filter, $options); -} -public function getIterator() -{ -return new \ArrayIterator($this->parameters); -} -public function count() -{ -return count($this->parameters); -} -} -} -namespace Symfony\Component\HttpFoundation -{ -class HeaderBag implements \IteratorAggregate, \Countable -{ -protected $headers = array(); -protected $cacheControl = array(); -public function __construct(array $headers = array()) -{ -foreach ($headers as $key => $values) { -$this->set($key, $values); -} -} -public function __toString() -{ -if (!$this->headers) { -return''; -} -$max = max(array_map('strlen', array_keys($this->headers))) + 1; -$content =''; -ksort($this->headers); -foreach ($this->headers as $name => $values) { -$name = implode('-', array_map('ucfirst', explode('-', $name))); -foreach ($values as $value) { -$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); -} -} -return $content; -} -public function all() -{ -return $this->headers; -} -public function keys() -{ -return array_keys($this->headers); -} -public function replace(array $headers = array()) -{ -$this->headers = array(); -$this->add($headers); -} -public function add(array $headers) -{ -foreach ($headers as $key => $values) { -$this->set($key, $values); -} -} -public function get($key, $default = null, $first = true) -{ -$key = strtr(strtolower($key),'_','-'); -if (!array_key_exists($key, $this->headers)) { -if (null === $default) { -return $first ? null : array(); -} -return $first ? $default : array($default); -} -if ($first) { -return count($this->headers[$key]) ? $this->headers[$key][0] : $default; -} -return $this->headers[$key]; -} -public function set($key, $values, $replace = true) -{ -$key = strtr(strtolower($key),'_','-'); -$values = array_values((array) $values); -if (true === $replace || !isset($this->headers[$key])) { -$this->headers[$key] = $values; -} else { -$this->headers[$key] = array_merge($this->headers[$key], $values); -} -if ('cache-control'=== $key) { -$this->cacheControl = $this->parseCacheControl($values[0]); -} -} -public function has($key) -{ -return array_key_exists(strtr(strtolower($key),'_','-'), $this->headers); -} -public function contains($key, $value) -{ -return in_array($value, $this->get($key, null, false)); -} -public function remove($key) -{ -$key = strtr(strtolower($key),'_','-'); -unset($this->headers[$key]); -if ('cache-control'=== $key) { -$this->cacheControl = array(); -} -} -public function getDate($key, \DateTime $default = null) -{ -if (null === $value = $this->get($key)) { -return $default; -} -if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { -throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value)); -} -return $date; -} -public function addCacheControlDirective($key, $value = true) -{ -$this->cacheControl[$key] = $value; -$this->set('Cache-Control', $this->getCacheControlHeader()); -} -public function hasCacheControlDirective($key) -{ -return array_key_exists($key, $this->cacheControl); -} -public function getCacheControlDirective($key) -{ -return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; -} -public function removeCacheControlDirective($key) -{ -unset($this->cacheControl[$key]); -$this->set('Cache-Control', $this->getCacheControlHeader()); -} -public function getIterator() -{ -return new \ArrayIterator($this->headers); -} -public function count() -{ -return count($this->headers); -} -protected function getCacheControlHeader() -{ -$parts = array(); -ksort($this->cacheControl); -foreach ($this->cacheControl as $key => $value) { -if (true === $value) { -$parts[] = $key; -} else { -if (preg_match('#[^a-zA-Z0-9._-]#', $value)) { -$value ='"'.$value.'"'; -} -$parts[] = "$key=$value"; -} -} -return implode(', ', $parts); -} -protected function parseCacheControl($header) -{ -$cacheControl = array(); -preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER); -foreach ($matches as $match) { -$cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true); -} -return $cacheControl; -} -} -} -namespace Symfony\Component\HttpFoundation -{ -use Symfony\Component\HttpFoundation\File\UploadedFile; -class FileBag extends ParameterBag -{ -private static $fileKeys = array('error','name','size','tmp_name','type'); -public function __construct(array $parameters = array()) -{ -$this->replace($parameters); -} -public function replace(array $files = array()) -{ -$this->parameters = array(); -$this->add($files); -} -public function set($key, $value) -{ -if (!is_array($value) && !$value instanceof UploadedFile) { -throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); -} -parent::set($key, $this->convertFileInformation($value)); -} -public function add(array $files = array()) -{ -foreach ($files as $key => $file) { -$this->set($key, $file); -} -} -protected function convertFileInformation($file) -{ -if ($file instanceof UploadedFile) { -return $file; -} -$file = $this->fixPhpFilesArray($file); -if (is_array($file)) { -$keys = array_keys($file); -sort($keys); -if ($keys == self::$fileKeys) { -if (UPLOAD_ERR_NO_FILE == $file['error']) { -$file = null; -} else { -$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']); -} -} else { -$file = array_map(array($this,'convertFileInformation'), $file); -} -} -return $file; -} -protected function fixPhpFilesArray($data) -{ -if (!is_array($data)) { -return $data; -} -$keys = array_keys($data); -sort($keys); -if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) { -return $data; -} -$files = $data; -foreach (self::$fileKeys as $k) { -unset($files[$k]); -} -foreach (array_keys($data['name']) as $key) { -$files[$key] = $this->fixPhpFilesArray(array('error'=> $data['error'][$key],'name'=> $data['name'][$key],'type'=> $data['type'][$key],'tmp_name'=> $data['tmp_name'][$key],'size'=> $data['size'][$key], -)); -} -return $files; -} -} -} -namespace Symfony\Component\HttpFoundation -{ -class ServerBag extends ParameterBag -{ -public function getHeaders() -{ -$headers = array(); -$contentHeaders = array('CONTENT_LENGTH'=> true,'CONTENT_MD5'=> true,'CONTENT_TYPE'=> true); -foreach ($this->parameters as $key => $value) { -if (0 === strpos($key,'HTTP_')) { -$headers[substr($key, 5)] = $value; -} -elseif (isset($contentHeaders[$key])) { -$headers[$key] = $value; -} -} -if (isset($this->parameters['PHP_AUTH_USER'])) { -$headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; -$headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] :''; -} else { -$authorizationHeader = null; -if (isset($this->parameters['HTTP_AUTHORIZATION'])) { -$authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; -} elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { -$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; -} -if (null !== $authorizationHeader) { -if (0 === stripos($authorizationHeader,'basic ')) { -$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); -if (count($exploded) == 2) { -list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded; -} -} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest '))) { -$headers['PHP_AUTH_DIGEST'] = $authorizationHeader; -$this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; -} -} -} -if (isset($headers['PHP_AUTH_USER'])) { -$headers['AUTHORIZATION'] ='Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); -} elseif (isset($headers['PHP_AUTH_DIGEST'])) { -$headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; -} -return $headers; -} -} -} -namespace Symfony\Component\HttpFoundation -{ -use Symfony\Component\HttpFoundation\Session\SessionInterface; -class Request -{ -const HEADER_CLIENT_IP ='client_ip'; -const HEADER_CLIENT_HOST ='client_host'; -const HEADER_CLIENT_PROTO ='client_proto'; -const HEADER_CLIENT_PORT ='client_port'; -protected static $trustedProxies = array(); -protected static $trustedHostPatterns = array(); -protected static $trustedHosts = array(); -protected static $trustedHeaders = array( -self::HEADER_CLIENT_IP =>'X_FORWARDED_FOR', -self::HEADER_CLIENT_HOST =>'X_FORWARDED_HOST', -self::HEADER_CLIENT_PROTO =>'X_FORWARDED_PROTO', -self::HEADER_CLIENT_PORT =>'X_FORWARDED_PORT', -); -protected static $httpMethodParameterOverride = false; -public $attributes; -public $request; -public $query; -public $server; -public $files; -public $cookies; -public $headers; -protected $content; -protected $languages; -protected $charsets; -protected $encodings; -protected $acceptableContentTypes; -protected $pathInfo; -protected $requestUri; -protected $baseUrl; -protected $basePath; -protected $method; -protected $format; -protected $session; -protected $locale; -protected $defaultLocale ='en'; -protected static $formats; -protected static $requestFactory; -public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) -{ -$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); -} -public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) -{ -$this->request = new ParameterBag($request); -$this->query = new ParameterBag($query); -$this->attributes = new ParameterBag($attributes); -$this->cookies = new ParameterBag($cookies); -$this->files = new FileBag($files); -$this->server = new ServerBag($server); -$this->headers = new HeaderBag($this->server->getHeaders()); -$this->content = $content; -$this->languages = null; -$this->charsets = null; -$this->encodings = null; -$this->acceptableContentTypes = null; -$this->pathInfo = null; -$this->requestUri = null; -$this->baseUrl = null; -$this->basePath = null; -$this->method = null; -$this->format = null; -} -public static function createFromGlobals() -{ -$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); -if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded') -&& in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH')) -) { -parse_str($request->getContent(), $data); -$request->request = new ParameterBag($data); -} -return $request; -} -public static function create($uri, $method ='GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null) -{ -$server = array_replace(array('SERVER_NAME'=>'localhost','SERVER_PORT'=> 80,'HTTP_HOST'=>'localhost','HTTP_USER_AGENT'=>'Symfony/2.X','HTTP_ACCEPT'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','HTTP_ACCEPT_LANGUAGE'=>'en-us,en;q=0.5','HTTP_ACCEPT_CHARSET'=>'ISO-8859-1,utf-8;q=0.7,*;q=0.7','REMOTE_ADDR'=>'127.0.0.1','SCRIPT_NAME'=>'','SCRIPT_FILENAME'=>'','SERVER_PROTOCOL'=>'HTTP/1.1','REQUEST_TIME'=> time(), -), $server); -$server['PATH_INFO'] =''; -$server['REQUEST_METHOD'] = strtoupper($method); -$components = parse_url($uri); -if (isset($components['host'])) { -$server['SERVER_NAME'] = $components['host']; -$server['HTTP_HOST'] = $components['host']; -} -if (isset($components['scheme'])) { -if ('https'=== $components['scheme']) { -$server['HTTPS'] ='on'; -$server['SERVER_PORT'] = 443; -} else { -unset($server['HTTPS']); -$server['SERVER_PORT'] = 80; -} -} -if (isset($components['port'])) { -$server['SERVER_PORT'] = $components['port']; -$server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port']; -} -if (isset($components['user'])) { -$server['PHP_AUTH_USER'] = $components['user']; -} -if (isset($components['pass'])) { -$server['PHP_AUTH_PW'] = $components['pass']; -} -if (!isset($components['path'])) { -$components['path'] ='/'; -} -switch (strtoupper($method)) { -case'POST': -case'PUT': -case'DELETE': -if (!isset($server['CONTENT_TYPE'])) { -$server['CONTENT_TYPE'] ='application/x-www-form-urlencoded'; -} -case'PATCH': -$request = $parameters; -$query = array(); -break; -default: -$request = array(); -$query = $parameters; -break; -} -$queryString =''; -if (isset($components['query'])) { -parse_str(html_entity_decode($components['query']), $qs); -if ($query) { -$query = array_replace($qs, $query); -$queryString = http_build_query($query,'','&'); -} else { -$query = $qs; -$queryString = $components['query']; -} -} elseif ($query) { -$queryString = http_build_query($query,'','&'); -} -$server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :''); -$server['QUERY_STRING'] = $queryString; -return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content); -} -public static function setFactory($callable) -{ -self::$requestFactory = $callable; -} -public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) -{ -$dup = clone $this; -if ($query !== null) { -$dup->query = new ParameterBag($query); -} -if ($request !== null) { -$dup->request = new ParameterBag($request); -} -if ($attributes !== null) { -$dup->attributes = new ParameterBag($attributes); -} -if ($cookies !== null) { -$dup->cookies = new ParameterBag($cookies); -} -if ($files !== null) { -$dup->files = new FileBag($files); -} -if ($server !== null) { -$dup->server = new ServerBag($server); -$dup->headers = new HeaderBag($dup->server->getHeaders()); -} -$dup->languages = null; -$dup->charsets = null; -$dup->encodings = null; -$dup->acceptableContentTypes = null; -$dup->pathInfo = null; -$dup->requestUri = null; -$dup->baseUrl = null; -$dup->basePath = null; -$dup->method = null; -$dup->format = null; -if (!$dup->get('_format') && $this->get('_format')) { -$dup->attributes->set('_format', $this->get('_format')); -} -if (!$dup->getRequestFormat(null)) { -$dup->setRequestFormat($format = $this->getRequestFormat(null)); -} -return $dup; -} -public function __clone() -{ -$this->query = clone $this->query; -$this->request = clone $this->request; -$this->attributes = clone $this->attributes; -$this->cookies = clone $this->cookies; -$this->files = clone $this->files; -$this->server = clone $this->server; -$this->headers = clone $this->headers; -} -public function __toString() -{ -return -sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". -$this->headers."\r\n". -$this->getContent(); -} -public function overrideGlobals() -{ -$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), null,'&'))); -$_GET = $this->query->all(); -$_POST = $this->request->all(); -$_SERVER = $this->server->all(); -$_COOKIE = $this->cookies->all(); -foreach ($this->headers->all() as $key => $value) { -$key = strtoupper(str_replace('-','_', $key)); -if (in_array($key, array('CONTENT_TYPE','CONTENT_LENGTH'))) { -$_SERVER[$key] = implode(', ', $value); -} else { -$_SERVER['HTTP_'.$key] = implode(', ', $value); -} -} -$request = array('g'=> $_GET,'p'=> $_POST,'c'=> $_COOKIE); -$requestOrder = ini_get('request_order') ?: ini_get('variables_order'); -$requestOrder = preg_replace('#[^cgp]#','', strtolower($requestOrder)) ?:'gp'; -$_REQUEST = array(); -foreach (str_split($requestOrder) as $order) { -$_REQUEST = array_merge($_REQUEST, $request[$order]); -} -} -public static function setTrustedProxies(array $proxies) -{ -self::$trustedProxies = $proxies; -} -public static function getTrustedProxies() -{ -return self::$trustedProxies; -} -public static function setTrustedHosts(array $hostPatterns) -{ -self::$trustedHostPatterns = array_map(function ($hostPattern) { -return sprintf('{%s}i', str_replace('}','\\}', $hostPattern)); -}, $hostPatterns); -self::$trustedHosts = array(); -} -public static function getTrustedHosts() -{ -return self::$trustedHostPatterns; -} -public static function setTrustedHeaderName($key, $value) -{ -if (!array_key_exists($key, self::$trustedHeaders)) { -throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key)); -} -self::$trustedHeaders[$key] = $value; -} -public static function getTrustedHeaderName($key) -{ -if (!array_key_exists($key, self::$trustedHeaders)) { -throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key)); -} -return self::$trustedHeaders[$key]; -} -public static function normalizeQueryString($qs) -{ -if (''== $qs) { -return''; -} -$parts = array(); -$order = array(); -foreach (explode('&', $qs) as $param) { -if (''=== $param ||'='=== $param[0]) { -continue; -} -$keyValuePair = explode('=', $param, 2); -$parts[] = isset($keyValuePair[1]) ? -rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : -rawurlencode(urldecode($keyValuePair[0])); -$order[] = urldecode($keyValuePair[0]); -} -array_multisort($order, SORT_ASC, $parts); -return implode('&', $parts); -} -public static function enableHttpMethodParameterOverride() -{ -self::$httpMethodParameterOverride = true; -} -public static function getHttpMethodParameterOverride() -{ -return self::$httpMethodParameterOverride; -} -public function get($key, $default = null, $deep = false) -{ -return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep); -} -public function getSession() -{ -return $this->session; -} -public function hasPreviousSession() -{ -return $this->hasSession() && $this->cookies->has($this->session->getName()); -} -public function hasSession() -{ -return null !== $this->session; -} -public function setSession(SessionInterface $session) -{ -$this->session = $session; -} -public function getClientIps() -{ -$ip = $this->server->get('REMOTE_ADDR'); -if (!self::$trustedProxies) { -return array($ip); -} -if (!self::$trustedHeaders[self::HEADER_CLIENT_IP] || !$this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) { -return array($ip); -} -$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP]))); -$clientIps[] = $ip; -$ip = $clientIps[0]; -foreach ($clientIps as $key => $clientIp) { -if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { -unset($clientIps[$key]); -} -} -return $clientIps ? array_reverse($clientIps) : array($ip); -} -public function getClientIp() -{ -$ipAddresses = $this->getClientIps(); -return $ipAddresses[0]; -} -public function getScriptName() -{ -return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME','')); -} -public function getPathInfo() -{ -if (null === $this->pathInfo) { -$this->pathInfo = $this->preparePathInfo(); -} -return $this->pathInfo; -} -public function getBasePath() -{ -if (null === $this->basePath) { -$this->basePath = $this->prepareBasePath(); -} -return $this->basePath; -} -public function getBaseUrl() -{ -if (null === $this->baseUrl) { -$this->baseUrl = $this->prepareBaseUrl(); -} -return $this->baseUrl; -} -public function getScheme() -{ -return $this->isSecure() ?'https':'http'; -} -public function getPort() -{ -if (self::$trustedProxies) { -if (self::$trustedHeaders[self::HEADER_CLIENT_PORT] && $port = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PORT])) { -return $port; -} -if (self::$trustedHeaders[self::HEADER_CLIENT_PROTO] &&'https'=== $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO],'http')) { -return 443; -} -} -if ($host = $this->headers->get('HOST')) { -if ($host[0] ==='[') { -$pos = strpos($host,':', strrpos($host,']')); -} else { -$pos = strrpos($host,':'); -} -if (false !== $pos) { -return intval(substr($host, $pos + 1)); -} -return'https'=== $this->getScheme() ? 443 : 80; -} -return $this->server->get('SERVER_PORT'); -} -public function getUser() -{ -return $this->headers->get('PHP_AUTH_USER'); -} -public function getPassword() -{ -return $this->headers->get('PHP_AUTH_PW'); -} -public function getUserInfo() -{ -$userinfo = $this->getUser(); -$pass = $this->getPassword(); -if (''!= $pass) { -$userinfo .= ":$pass"; -} -return $userinfo; -} -public function getHttpHost() -{ -$scheme = $this->getScheme(); -$port = $this->getPort(); -if (('http'== $scheme && $port == 80) || ('https'== $scheme && $port == 443)) { -return $this->getHost(); -} -return $this->getHost().':'.$port; -} -public function getRequestUri() -{ -if (null === $this->requestUri) { -$this->requestUri = $this->prepareRequestUri(); -} -return $this->requestUri; -} -public function getSchemeAndHttpHost() -{ -return $this->getScheme().'://'.$this->getHttpHost(); -} -public function getUri() -{ -if (null !== $qs = $this->getQueryString()) { -$qs ='?'.$qs; -} -return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; -} -public function getUriForPath($path) -{ -return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; -} -public function getQueryString() -{ -$qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); -return''=== $qs ? null : $qs; -} -public function isSecure() -{ -if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) { -return in_array(strtolower(current(explode(',', $proto))), array('https','on','ssl','1')); -} -$https = $this->server->get('HTTPS'); -return !empty($https) &&'off'!== strtolower($https); -} -public function getHost() -{ -if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_HOST] && $host = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_HOST])) { -$elements = explode(',', $host); -$host = $elements[count($elements) - 1]; -} elseif (!$host = $this->headers->get('HOST')) { -if (!$host = $this->server->get('SERVER_NAME')) { -$host = $this->server->get('SERVER_ADDR',''); -} -} -$host = strtolower(preg_replace('/:\d+$/','', trim($host))); -if ($host &&''!== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/','', $host)) { -throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host)); -} -if (count(self::$trustedHostPatterns) > 0) { -if (in_array($host, self::$trustedHosts)) { -return $host; -} -foreach (self::$trustedHostPatterns as $pattern) { -if (preg_match($pattern, $host)) { -self::$trustedHosts[] = $host; -return $host; -} -} -throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host)); -} -return $host; -} -public function setMethod($method) -{ -$this->method = null; -$this->server->set('REQUEST_METHOD', $method); -} -public function getMethod() -{ -if (null === $this->method) { -$this->method = strtoupper($this->server->get('REQUEST_METHOD','GET')); -if ('POST'=== $this->method) { -if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { -$this->method = strtoupper($method); -} elseif (self::$httpMethodParameterOverride) { -$this->method = strtoupper($this->request->get('_method', $this->query->get('_method','POST'))); -} -} -} -return $this->method; -} -public function getRealMethod() -{ -return strtoupper($this->server->get('REQUEST_METHOD','GET')); -} -public function getMimeType($format) -{ -if (null === static::$formats) { -static::initializeFormats(); -} -return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; -} -public function getFormat($mimeType) -{ -if (false !== $pos = strpos($mimeType,';')) { -$mimeType = substr($mimeType, 0, $pos); -} -if (null === static::$formats) { -static::initializeFormats(); -} -foreach (static::$formats as $format => $mimeTypes) { -if (in_array($mimeType, (array) $mimeTypes)) { -return $format; -} -} -} -public function setFormat($format, $mimeTypes) -{ -if (null === static::$formats) { -static::initializeFormats(); -} -static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes); -} -public function getRequestFormat($default ='html') -{ -if (null === $this->format) { -$this->format = $this->get('_format', $default); -} -return $this->format; -} -public function setRequestFormat($format) -{ -$this->format = $format; -} -public function getContentType() -{ -return $this->getFormat($this->headers->get('CONTENT_TYPE')); -} -public function setDefaultLocale($locale) -{ -$this->defaultLocale = $locale; -if (null === $this->locale) { -$this->setPhpDefaultLocale($locale); -} -} -public function getDefaultLocale() -{ -return $this->defaultLocale; -} -public function setLocale($locale) -{ -$this->setPhpDefaultLocale($this->locale = $locale); -} -public function getLocale() -{ -return null === $this->locale ? $this->defaultLocale : $this->locale; -} -public function isMethod($method) -{ -return $this->getMethod() === strtoupper($method); -} -public function isMethodSafe() -{ -return in_array($this->getMethod(), array('GET','HEAD')); -} -public function getContent($asResource = false) -{ -if (false === $this->content || (true === $asResource && null !== $this->content)) { -throw new \LogicException('getContent() can only be called once when using the resource return type.'); -} -if (true === $asResource) { -$this->content = false; -return fopen('php://input','rb'); -} -if (null === $this->content) { -$this->content = file_get_contents('php://input'); -} -return $this->content; -} -public function getETags() -{ -return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY); -} -public function isNoCache() -{ -return $this->headers->hasCacheControlDirective('no-cache') ||'no-cache'== $this->headers->get('Pragma'); -} -public function getPreferredLanguage(array $locales = null) -{ -$preferredLanguages = $this->getLanguages(); -if (empty($locales)) { -return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null; -} -if (!$preferredLanguages) { -return $locales[0]; -} -$extendedPreferredLanguages = array(); -foreach ($preferredLanguages as $language) { -$extendedPreferredLanguages[] = $language; -if (false !== $position = strpos($language,'_')) { -$superLanguage = substr($language, 0, $position); -if (!in_array($superLanguage, $preferredLanguages)) { -$extendedPreferredLanguages[] = $superLanguage; -} -} -} -$preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales)); -return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $locales[0]; -} -public function getLanguages() -{ -if (null !== $this->languages) { -return $this->languages; -} -$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); -$this->languages = array(); -foreach (array_keys($languages) as $lang) { -if (strstr($lang,'-')) { -$codes = explode('-', $lang); -if ($codes[0] =='i') { -if (count($codes) > 1) { -$lang = $codes[1]; -} -} else { -for ($i = 0, $max = count($codes); $i < $max; $i++) { -if ($i == 0) { -$lang = strtolower($codes[0]); -} else { -$lang .='_'.strtoupper($codes[$i]); -} -} -} -} -$this->languages[] = $lang; -} -return $this->languages; -} -public function getCharsets() -{ -if (null !== $this->charsets) { -return $this->charsets; -} -return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()); -} -public function getEncodings() -{ -if (null !== $this->encodings) { -return $this->encodings; -} -return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all()); -} -public function getAcceptableContentTypes() -{ -if (null !== $this->acceptableContentTypes) { -return $this->acceptableContentTypes; -} -return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()); -} -public function isXmlHttpRequest() -{ -return'XMLHttpRequest'== $this->headers->get('X-Requested-With'); -} -protected function prepareRequestUri() -{ -$requestUri =''; -if ($this->headers->has('X_ORIGINAL_URL')) { -$requestUri = $this->headers->get('X_ORIGINAL_URL'); -$this->headers->remove('X_ORIGINAL_URL'); -$this->server->remove('HTTP_X_ORIGINAL_URL'); -$this->server->remove('UNENCODED_URL'); -$this->server->remove('IIS_WasUrlRewritten'); -} elseif ($this->headers->has('X_REWRITE_URL')) { -$requestUri = $this->headers->get('X_REWRITE_URL'); -$this->headers->remove('X_REWRITE_URL'); -} elseif ($this->server->get('IIS_WasUrlRewritten') =='1'&& $this->server->get('UNENCODED_URL') !='') { -$requestUri = $this->server->get('UNENCODED_URL'); -$this->server->remove('UNENCODED_URL'); -$this->server->remove('IIS_WasUrlRewritten'); -} elseif ($this->server->has('REQUEST_URI')) { -$requestUri = $this->server->get('REQUEST_URI'); -$schemeAndHttpHost = $this->getSchemeAndHttpHost(); -if (strpos($requestUri, $schemeAndHttpHost) === 0) { -$requestUri = substr($requestUri, strlen($schemeAndHttpHost)); -} -} elseif ($this->server->has('ORIG_PATH_INFO')) { -$requestUri = $this->server->get('ORIG_PATH_INFO'); -if (''!= $this->server->get('QUERY_STRING')) { -$requestUri .='?'.$this->server->get('QUERY_STRING'); -} -$this->server->remove('ORIG_PATH_INFO'); -} -$this->server->set('REQUEST_URI', $requestUri); -return $requestUri; -} -protected function prepareBaseUrl() -{ -$filename = basename($this->server->get('SCRIPT_FILENAME')); -if (basename($this->server->get('SCRIPT_NAME')) === $filename) { -$baseUrl = $this->server->get('SCRIPT_NAME'); -} elseif (basename($this->server->get('PHP_SELF')) === $filename) { -$baseUrl = $this->server->get('PHP_SELF'); -} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) { -$baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); } else { -$path = $this->server->get('PHP_SELF',''); -$file = $this->server->get('SCRIPT_FILENAME',''); -$segs = explode('/', trim($file,'/')); -$segs = array_reverse($segs); -$index = 0; -$last = count($segs); -$baseUrl =''; -do { -$seg = $segs[$index]; -$baseUrl ='/'.$seg.$baseUrl; -++$index; -} while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); -} -$requestUri = $this->getRequestUri(); -if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { -return $prefix; -} -if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, dirname($baseUrl))) { -return rtrim($prefix,'/'); -} -$truncatedRequestUri = $requestUri; -if (false !== $pos = strpos($requestUri,'?')) { -$truncatedRequestUri = substr($requestUri, 0, $pos); -} -$basename = basename($baseUrl); -if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) { -return''; -} -if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) { -$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); -} -return rtrim($baseUrl,'/'); -} -protected function prepareBasePath() -{ -$filename = basename($this->server->get('SCRIPT_FILENAME')); -$baseUrl = $this->getBaseUrl(); -if (empty($baseUrl)) { -return''; -} -if (basename($baseUrl) === $filename) { -$basePath = dirname($baseUrl); -} else { -$basePath = $baseUrl; -} -if ('\\'=== DIRECTORY_SEPARATOR) { -$basePath = str_replace('\\','/', $basePath); -} -return rtrim($basePath,'/'); -} -protected function preparePathInfo() -{ -$baseUrl = $this->getBaseUrl(); -if (null === ($requestUri = $this->getRequestUri())) { -return'/'; -} -$pathInfo ='/'; -if ($pos = strpos($requestUri,'?')) { -$requestUri = substr($requestUri, 0, $pos); -} -if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) { -return'/'; -} elseif (null === $baseUrl) { -return $requestUri; -} -return (string) $pathInfo; -} -protected static function initializeFormats() -{ -static::$formats = array('html'=> array('text/html','application/xhtml+xml'),'txt'=> array('text/plain'),'js'=> array('application/javascript','application/x-javascript','text/javascript'),'css'=> array('text/css'),'json'=> array('application/json','application/x-json'),'xml'=> array('text/xml','application/xml','application/x-xml'),'rdf'=> array('application/rdf+xml'),'atom'=> array('application/atom+xml'),'rss'=> array('application/rss+xml'), -); -} -private function setPhpDefaultLocale($locale) -{ -try { -if (class_exists('Locale', false)) { -\Locale::setDefault($locale); -} -} catch (\Exception $e) { -} -} -private function getUrlencodedPrefix($string, $prefix) -{ -if (0 !== strpos(rawurldecode($string), $prefix)) { -return false; -} -$len = strlen($prefix); -if (preg_match("#^(%[[:xdigit:]]{2}|.){{$len}}#", $string, $match)) { -return $match[0]; -} -return false; -} -private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) -{ -if (self::$requestFactory) { -$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content); -if (!$request instanceof Request) { -throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.'); -} -return $request; -} -return new static($query, $request, $attributes, $cookies, $files, $server, $content); -} -} -} -namespace Symfony\Component\HttpFoundation -{ -class Response -{ -const HTTP_CONTINUE = 100; -const HTTP_SWITCHING_PROTOCOLS = 101; -const HTTP_PROCESSING = 102; const HTTP_OK = 200; -const HTTP_CREATED = 201; -const HTTP_ACCEPTED = 202; -const HTTP_NON_AUTHORITATIVE_INFORMATION = 203; -const HTTP_NO_CONTENT = 204; -const HTTP_RESET_CONTENT = 205; -const HTTP_PARTIAL_CONTENT = 206; -const HTTP_MULTI_STATUS = 207; const HTTP_ALREADY_REPORTED = 208; const HTTP_IM_USED = 226; const HTTP_MULTIPLE_CHOICES = 300; -const HTTP_MOVED_PERMANENTLY = 301; -const HTTP_FOUND = 302; -const HTTP_SEE_OTHER = 303; -const HTTP_NOT_MODIFIED = 304; -const HTTP_USE_PROXY = 305; -const HTTP_RESERVED = 306; -const HTTP_TEMPORARY_REDIRECT = 307; -const HTTP_PERMANENTLY_REDIRECT = 308; const HTTP_BAD_REQUEST = 400; -const HTTP_UNAUTHORIZED = 401; -const HTTP_PAYMENT_REQUIRED = 402; -const HTTP_FORBIDDEN = 403; -const HTTP_NOT_FOUND = 404; -const HTTP_METHOD_NOT_ALLOWED = 405; -const HTTP_NOT_ACCEPTABLE = 406; -const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; -const HTTP_REQUEST_TIMEOUT = 408; -const HTTP_CONFLICT = 409; -const HTTP_GONE = 410; -const HTTP_LENGTH_REQUIRED = 411; -const HTTP_PRECONDITION_FAILED = 412; -const HTTP_REQUEST_ENTITY_TOO_LARGE = 413; -const HTTP_REQUEST_URI_TOO_LONG = 414; -const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; -const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; -const HTTP_EXPECTATION_FAILED = 417; -const HTTP_I_AM_A_TEAPOT = 418; const HTTP_UNPROCESSABLE_ENTITY = 422; const HTTP_LOCKED = 423; const HTTP_FAILED_DEPENDENCY = 424; const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; const HTTP_UPGRADE_REQUIRED = 426; const HTTP_PRECONDITION_REQUIRED = 428; const HTTP_TOO_MANY_REQUESTS = 429; const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; const HTTP_INTERNAL_SERVER_ERROR = 500; -const HTTP_NOT_IMPLEMENTED = 501; -const HTTP_BAD_GATEWAY = 502; -const HTTP_SERVICE_UNAVAILABLE = 503; -const HTTP_GATEWAY_TIMEOUT = 504; -const HTTP_VERSION_NOT_SUPPORTED = 505; -const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; const HTTP_INSUFFICIENT_STORAGE = 507; const HTTP_LOOP_DETECTED = 508; const HTTP_NOT_EXTENDED = 510; const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; -public $headers; -protected $content; -protected $version; -protected $statusCode; -protected $statusText; -protected $charset; -public static $statusTexts = array( -100 =>'Continue', -101 =>'Switching Protocols', -102 =>'Processing', 200 =>'OK', -201 =>'Created', -202 =>'Accepted', -203 =>'Non-Authoritative Information', -204 =>'No Content', -205 =>'Reset Content', -206 =>'Partial Content', -207 =>'Multi-Status', 208 =>'Already Reported', 226 =>'IM Used', 300 =>'Multiple Choices', -301 =>'Moved Permanently', -302 =>'Found', -303 =>'See Other', -304 =>'Not Modified', -305 =>'Use Proxy', -306 =>'Reserved', -307 =>'Temporary Redirect', -308 =>'Permanent Redirect', 400 =>'Bad Request', -401 =>'Unauthorized', -402 =>'Payment Required', -403 =>'Forbidden', -404 =>'Not Found', -405 =>'Method Not Allowed', -406 =>'Not Acceptable', -407 =>'Proxy Authentication Required', -408 =>'Request Timeout', -409 =>'Conflict', -410 =>'Gone', -411 =>'Length Required', -412 =>'Precondition Failed', -413 =>'Request Entity Too Large', -414 =>'Request-URI Too Long', -415 =>'Unsupported Media Type', -416 =>'Requested Range Not Satisfiable', -417 =>'Expectation Failed', -418 =>'I\'m a teapot', 422 =>'Unprocessable Entity', 423 =>'Locked', 424 =>'Failed Dependency', 425 =>'Reserved for WebDAV advanced collections expired proposal', 426 =>'Upgrade Required', 428 =>'Precondition Required', 429 =>'Too Many Requests', 431 =>'Request Header Fields Too Large', 500 =>'Internal Server Error', -501 =>'Not Implemented', -502 =>'Bad Gateway', -503 =>'Service Unavailable', -504 =>'Gateway Timeout', -505 =>'HTTP Version Not Supported', -506 =>'Variant Also Negotiates (Experimental)', 507 =>'Insufficient Storage', 508 =>'Loop Detected', 510 =>'Not Extended', 511 =>'Network Authentication Required', ); -public function __construct($content ='', $status = 200, $headers = array()) -{ -$this->headers = new ResponseHeaderBag($headers); -$this->setContent($content); -$this->setStatusCode($status); -$this->setProtocolVersion('1.0'); -if (!$this->headers->has('Date')) { -$this->setDate(new \DateTime(null, new \DateTimeZone('UTC'))); -} -} -public static function create($content ='', $status = 200, $headers = array()) -{ -return new static($content, $status, $headers); -} -public function __toString() -{ -return -sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". -$this->headers."\r\n". -$this->getContent(); -} -public function __clone() -{ -$this->headers = clone $this->headers; -} -public function prepare(Request $request) -{ -$headers = $this->headers; -if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) { -$this->setContent(null); -$headers->remove('Content-Type'); -$headers->remove('Content-Length'); -} else { -if (!$headers->has('Content-Type')) { -$format = $request->getRequestFormat(); -if (null !== $format && $mimeType = $request->getMimeType($format)) { -$headers->set('Content-Type', $mimeType); -} -} -$charset = $this->charset ?:'UTF-8'; -if (!$headers->has('Content-Type')) { -$headers->set('Content-Type','text/html; charset='.$charset); -} elseif (0 === stripos($headers->get('Content-Type'),'text/') && false === stripos($headers->get('Content-Type'),'charset')) { -$headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); -} -if ($headers->has('Transfer-Encoding')) { -$headers->remove('Content-Length'); -} -if ($request->isMethod('HEAD')) { -$length = $headers->get('Content-Length'); -$this->setContent(null); -if ($length) { -$headers->set('Content-Length', $length); -} -} -} -if ('HTTP/1.0'!= $request->server->get('SERVER_PROTOCOL')) { -$this->setProtocolVersion('1.1'); -} -if ('1.0'== $this->getProtocolVersion() &&'no-cache'== $this->headers->get('Cache-Control')) { -$this->headers->set('pragma','no-cache'); -$this->headers->set('expires', -1); -} -$this->ensureIEOverSSLCompatibility($request); -return $this; -} -public function sendHeaders() -{ -if (headers_sent()) { -return $this; -} -header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode); -foreach ($this->headers->allPreserveCase() as $name => $values) { -foreach ($values as $value) { -header($name.': '.$value, false, $this->statusCode); -} -} -foreach ($this->headers->getCookies() as $cookie) { -setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); -} -return $this; -} -public function sendContent() -{ -echo $this->content; -return $this; -} -public function send() -{ -$this->sendHeaders(); -$this->sendContent(); -if (function_exists('fastcgi_finish_request')) { -fastcgi_finish_request(); -} elseif ('cli'!== PHP_SAPI) { -static::closeOutputBuffers(0, true); -flush(); -} -return $this; -} -public function setContent($content) -{ -if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content,'__toString'))) { -throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content))); -} -$this->content = (string) $content; -return $this; -} -public function getContent() -{ -return $this->content; -} -public function setProtocolVersion($version) -{ -$this->version = $version; -return $this; -} -public function getProtocolVersion() -{ -return $this->version; -} -public function setStatusCode($code, $text = null) -{ -$this->statusCode = $code = (int) $code; -if ($this->isInvalid()) { -throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code)); -} -if (null === $text) { -$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] :''; -return $this; -} -if (false === $text) { -$this->statusText =''; -return $this; -} -$this->statusText = $text; -return $this; -} -public function getStatusCode() -{ -return $this->statusCode; -} -public function setCharset($charset) -{ -$this->charset = $charset; -return $this; -} -public function getCharset() -{ -return $this->charset; -} -public function isCacheable() -{ -if (!in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) { -return false; -} -if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) { -return false; -} -return $this->isValidateable() || $this->isFresh(); -} -public function isFresh() -{ -return $this->getTtl() > 0; -} -public function isValidateable() -{ -return $this->headers->has('Last-Modified') || $this->headers->has('ETag'); -} -public function setPrivate() -{ -$this->headers->removeCacheControlDirective('public'); -$this->headers->addCacheControlDirective('private'); -return $this; -} -public function setPublic() -{ -$this->headers->addCacheControlDirective('public'); -$this->headers->removeCacheControlDirective('private'); -return $this; -} -public function mustRevalidate() -{ -return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('proxy-revalidate'); -} -public function getDate() -{ -return $this->headers->getDate('Date', new \DateTime()); -} -public function setDate(\DateTime $date) -{ -$date->setTimezone(new \DateTimeZone('UTC')); -$this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT'); -return $this; -} -public function getAge() -{ -if (null !== $age = $this->headers->get('Age')) { -return (int) $age; -} -return max(time() - $this->getDate()->format('U'), 0); -} -public function expire() -{ -if ($this->isFresh()) { -$this->headers->set('Age', $this->getMaxAge()); -} -return $this; -} -public function getExpires() -{ -try { -return $this->headers->getDate('Expires'); -} catch (\RuntimeException $e) { -return \DateTime::createFromFormat(DATE_RFC2822,'Sat, 01 Jan 00 00:00:00 +0000'); -} -} -public function setExpires(\DateTime $date = null) -{ -if (null === $date) { -$this->headers->remove('Expires'); -} else { -$date = clone $date; -$date->setTimezone(new \DateTimeZone('UTC')); -$this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT'); -} -return $this; -} -public function getMaxAge() -{ -if ($this->headers->hasCacheControlDirective('s-maxage')) { -return (int) $this->headers->getCacheControlDirective('s-maxage'); -} -if ($this->headers->hasCacheControlDirective('max-age')) { -return (int) $this->headers->getCacheControlDirective('max-age'); -} -if (null !== $this->getExpires()) { -return $this->getExpires()->format('U') - $this->getDate()->format('U'); -} -} -public function setMaxAge($value) -{ -$this->headers->addCacheControlDirective('max-age', $value); -return $this; -} -public function setSharedMaxAge($value) -{ -$this->setPublic(); -$this->headers->addCacheControlDirective('s-maxage', $value); -return $this; -} -public function getTtl() -{ -if (null !== $maxAge = $this->getMaxAge()) { -return $maxAge - $this->getAge(); -} -} -public function setTtl($seconds) -{ -$this->setSharedMaxAge($this->getAge() + $seconds); -return $this; -} -public function setClientTtl($seconds) -{ -$this->setMaxAge($this->getAge() + $seconds); -return $this; -} -public function getLastModified() -{ -return $this->headers->getDate('Last-Modified'); -} -public function setLastModified(\DateTime $date = null) -{ -if (null === $date) { -$this->headers->remove('Last-Modified'); -} else { -$date = clone $date; -$date->setTimezone(new \DateTimeZone('UTC')); -$this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT'); -} -return $this; -} -public function getEtag() -{ -return $this->headers->get('ETag'); -} -public function setEtag($etag = null, $weak = false) -{ -if (null === $etag) { -$this->headers->remove('Etag'); -} else { -if (0 !== strpos($etag,'"')) { -$etag ='"'.$etag.'"'; -} -$this->headers->set('ETag', (true === $weak ?'W/':'').$etag); -} -return $this; -} -public function setCache(array $options) -{ -if ($diff = array_diff(array_keys($options), array('etag','last_modified','max_age','s_maxage','private','public'))) { -throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff)))); -} -if (isset($options['etag'])) { -$this->setEtag($options['etag']); -} -if (isset($options['last_modified'])) { -$this->setLastModified($options['last_modified']); -} -if (isset($options['max_age'])) { -$this->setMaxAge($options['max_age']); -} -if (isset($options['s_maxage'])) { -$this->setSharedMaxAge($options['s_maxage']); -} -if (isset($options['public'])) { -if ($options['public']) { -$this->setPublic(); -} else { -$this->setPrivate(); -} -} -if (isset($options['private'])) { -if ($options['private']) { -$this->setPrivate(); -} else { -$this->setPublic(); -} -} -return $this; -} -public function setNotModified() -{ -$this->setStatusCode(304); -$this->setContent(null); -foreach (array('Allow','Content-Encoding','Content-Language','Content-Length','Content-MD5','Content-Type','Last-Modified') as $header) { -$this->headers->remove($header); -} -return $this; -} -public function hasVary() -{ -return null !== $this->headers->get('Vary'); -} -public function getVary() -{ -if (!$vary = $this->headers->get('Vary', null, false)) { -return array(); -} -$ret = array(); -foreach ($vary as $item) { -$ret = array_merge($ret, preg_split('/[\s,]+/', $item)); -} -return $ret; -} -public function setVary($headers, $replace = true) -{ -$this->headers->set('Vary', $headers, $replace); -return $this; -} -public function isNotModified(Request $request) -{ -if (!$request->isMethodSafe()) { -return false; -} -$notModified = false; -$lastModified = $this->headers->get('Last-Modified'); -$modifiedSince = $request->headers->get('If-Modified-Since'); -if ($etags = $request->getEtags()) { -$notModified = in_array($this->getEtag(), $etags) || in_array('*', $etags); -} -if ($modifiedSince && $lastModified) { -$notModified = strtotime($modifiedSince) >= strtotime($lastModified) && (!$etags || $notModified); -} -if ($notModified) { -$this->setNotModified(); -} -return $notModified; -} -public function isInvalid() -{ -return $this->statusCode < 100 || $this->statusCode >= 600; -} -public function isInformational() -{ -return $this->statusCode >= 100 && $this->statusCode < 200; -} -public function isSuccessful() -{ -return $this->statusCode >= 200 && $this->statusCode < 300; -} -public function isRedirection() -{ -return $this->statusCode >= 300 && $this->statusCode < 400; -} -public function isClientError() -{ -return $this->statusCode >= 400 && $this->statusCode < 500; -} -public function isServerError() -{ -return $this->statusCode >= 500 && $this->statusCode < 600; -} -public function isOk() -{ -return 200 === $this->statusCode; -} -public function isForbidden() -{ -return 403 === $this->statusCode; -} -public function isNotFound() -{ -return 404 === $this->statusCode; -} -public function isRedirect($location = null) -{ -return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location')); -} -public function isEmpty() -{ -return in_array($this->statusCode, array(204, 304)); -} -public static function closeOutputBuffers($targetLevel, $flush) -{ -$status = ob_get_status(true); -$level = count($status); -while ($level-- > $targetLevel -&& (!empty($status[$level]['del']) -|| (isset($status[$level]['flags']) -&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE) -&& ($status[$level]['flags'] & ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE)) -) -) -) { -if ($flush) { -ob_end_flush(); -} else { -ob_end_clean(); -} -} -} -protected function ensureIEOverSSLCompatibility(Request $request) -{ -if (false !== stripos($this->headers->get('Content-Disposition'),'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) { -if (intval(preg_replace("/(MSIE )(.*?);/","$2", $match[0])) < 9) { -$this->headers->remove('Cache-Control'); -} -} -} -} -} -namespace Symfony\Component\HttpFoundation -{ -class ResponseHeaderBag extends HeaderBag -{ -const COOKIES_FLAT ='flat'; -const COOKIES_ARRAY ='array'; -const DISPOSITION_ATTACHMENT ='attachment'; -const DISPOSITION_INLINE ='inline'; -protected $computedCacheControl = array(); -protected $cookies = array(); -protected $headerNames = array(); -public function __construct(array $headers = array()) -{ -parent::__construct($headers); -if (!isset($this->headers['cache-control'])) { -$this->set('Cache-Control',''); -} -} -public function __toString() -{ -$cookies =''; -foreach ($this->getCookies() as $cookie) { -$cookies .='Set-Cookie: '.$cookie."\r\n"; -} -ksort($this->headerNames); -return parent::__toString().$cookies; -} -public function allPreserveCase() -{ -return array_combine($this->headerNames, $this->headers); -} -public function replace(array $headers = array()) -{ -$this->headerNames = array(); -parent::replace($headers); -if (!isset($this->headers['cache-control'])) { -$this->set('Cache-Control',''); -} -} -public function set($key, $values, $replace = true) -{ -parent::set($key, $values, $replace); -$uniqueKey = strtr(strtolower($key),'_','-'); -$this->headerNames[$uniqueKey] = $key; -if (in_array($uniqueKey, array('cache-control','etag','last-modified','expires'))) { -$computed = $this->computeCacheControlValue(); -$this->headers['cache-control'] = array($computed); -$this->headerNames['cache-control'] ='Cache-Control'; -$this->computedCacheControl = $this->parseCacheControl($computed); -} -} -public function remove($key) -{ -parent::remove($key); -$uniqueKey = strtr(strtolower($key),'_','-'); -unset($this->headerNames[$uniqueKey]); -if ('cache-control'=== $uniqueKey) { -$this->computedCacheControl = array(); -} -} -public function hasCacheControlDirective($key) -{ -return array_key_exists($key, $this->computedCacheControl); -} -public function getCacheControlDirective($key) -{ -return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null; -} -public function setCookie(Cookie $cookie) -{ -$this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; -} -public function removeCookie($name, $path ='/', $domain = null) -{ -if (null === $path) { -$path ='/'; -} -unset($this->cookies[$domain][$path][$name]); -if (empty($this->cookies[$domain][$path])) { -unset($this->cookies[$domain][$path]); -if (empty($this->cookies[$domain])) { -unset($this->cookies[$domain]); -} -} -} -public function getCookies($format = self::COOKIES_FLAT) -{ -if (!in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) { -throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY)))); -} -if (self::COOKIES_ARRAY === $format) { -return $this->cookies; -} -$flattenedCookies = array(); -foreach ($this->cookies as $path) { -foreach ($path as $cookies) { -foreach ($cookies as $cookie) { -$flattenedCookies[] = $cookie; -} -} -} -return $flattenedCookies; -} -public function clearCookie($name, $path ='/', $domain = null) -{ -$this->setCookie(new Cookie($name, null, 1, $path, $domain)); -} -public function makeDisposition($disposition, $filename, $filenameFallback ='') -{ -if (!in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) { -throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE)); -} -if (''== $filenameFallback) { -$filenameFallback = $filename; -} -if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) { -throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.'); -} -if (false !== strpos($filenameFallback,'%')) { -throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.'); -} -if (false !== strpos($filename,'/') || false !== strpos($filename,'\\') || false !== strpos($filenameFallback,'/') || false !== strpos($filenameFallback,'\\')) { -throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.'); -} -$output = sprintf('%s; filename="%s"', $disposition, str_replace('"','\\"', $filenameFallback)); -if ($filename !== $filenameFallback) { -$output .= sprintf("; filename*=utf-8''%s", rawurlencode($filename)); -} -return $output; -} -protected function computeCacheControlValue() -{ -if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) { -return'no-cache'; -} -if (!$this->cacheControl) { -return'private, must-revalidate'; -} -$header = $this->getCacheControlHeader(); -if (isset($this->cacheControl['public']) || isset($this->cacheControl['private'])) { -return $header; -} -if (!isset($this->cacheControl['s-maxage'])) { -return $header.', private'; -} -return $header; -} -} -} -namespace Symfony\Component\DependencyInjection -{ -interface ContainerAwareInterface -{ -public function setContainer(ContainerInterface $container = null); -} -} -namespace Symfony\Component\DependencyInjection -{ -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; -use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; -interface ContainerInterface -{ -const EXCEPTION_ON_INVALID_REFERENCE = 1; -const NULL_ON_INVALID_REFERENCE = 2; -const IGNORE_ON_INVALID_REFERENCE = 3; -const SCOPE_CONTAINER ='container'; -const SCOPE_PROTOTYPE ='prototype'; -public function set($id, $service, $scope = self::SCOPE_CONTAINER); -public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); -public function has($id); -public function getParameter($name); -public function hasParameter($name); -public function setParameter($name, $value); -public function enterScope($name); -public function leaveScope($name); -public function addScope(ScopeInterface $scope); -public function hasScope($name); -public function isScopeActive($name); -} -} -namespace Symfony\Component\DependencyInjection -{ -interface IntrospectableContainerInterface extends ContainerInterface -{ -public function initialized($id); -} -} -namespace Symfony\Component\DependencyInjection -{ -use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; -use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; -class Container implements IntrospectableContainerInterface -{ -protected $parameterBag; -protected $services = array(); -protected $methodMap = array(); -protected $aliases = array(); -protected $scopes = array(); -protected $scopeChildren = array(); -protected $scopedServices = array(); -protected $scopeStacks = array(); -protected $loading = array(); -public function __construct(ParameterBagInterface $parameterBag = null) -{ -$this->parameterBag = $parameterBag ?: new ParameterBag(); -$this->set('service_container', $this); -} -public function compile() -{ -$this->parameterBag->resolve(); -$this->parameterBag = new FrozenParameterBag($this->parameterBag->all()); -} -public function isFrozen() -{ -return $this->parameterBag instanceof FrozenParameterBag; -} -public function getParameterBag() -{ -return $this->parameterBag; -} -public function getParameter($name) -{ -return $this->parameterBag->get($name); -} -public function hasParameter($name) -{ -return $this->parameterBag->has($name); -} -public function setParameter($name, $value) -{ -$this->parameterBag->set($name, $value); -} -public function set($id, $service, $scope = self::SCOPE_CONTAINER) -{ -if (self::SCOPE_PROTOTYPE === $scope) { -throw new InvalidArgumentException(sprintf('You cannot set service "%s" of scope "prototype".', $id)); -} -$id = strtolower($id); -if ('service_container'=== $id) { -return; -} -if (self::SCOPE_CONTAINER !== $scope) { -if (!isset($this->scopedServices[$scope])) { -throw new RuntimeException(sprintf('You cannot set service "%s" of inactive scope.', $id)); -} -$this->scopedServices[$scope][$id] = $service; -} -$this->services[$id] = $service; -if (method_exists($this, $method ='synchronize'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) { -$this->$method(); -} -if (self::SCOPE_CONTAINER !== $scope && null === $service) { -unset($this->scopedServices[$scope][$id]); -} -if (null === $service) { -unset($this->services[$id]); -} -} -public function has($id) -{ -$id = strtolower($id); -if ('service_container'=== $id) { -return true; -} -return isset($this->services[$id]) -|| array_key_exists($id, $this->services) -|| isset($this->aliases[$id]) -|| method_exists($this,'get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service') -; -} -public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) -{ -foreach (array(false, true) as $strtolower) { -if ($strtolower) { -$id = strtolower($id); -} -if ('service_container'=== $id) { -return $this; -} -if (isset($this->aliases[$id])) { -$id = $this->aliases[$id]; -} -if (isset($this->services[$id]) || array_key_exists($id, $this->services)) { -return $this->services[$id]; -} -} -if (isset($this->loading[$id])) { -throw new ServiceCircularReferenceException($id, array_keys($this->loading)); -} -if (isset($this->methodMap[$id])) { -$method = $this->methodMap[$id]; -} elseif (method_exists($this, $method ='get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) { -} else { -if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) { -if (!$id) { -throw new ServiceNotFoundException($id); -} -$alternatives = array(); -foreach (array_keys($this->services) as $key) { -$lev = levenshtein($id, $key); -if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) { -$alternatives[] = $key; -} -} -throw new ServiceNotFoundException($id, null, null, $alternatives); -} -return; -} -$this->loading[$id] = true; -try { -$service = $this->$method(); -} catch (\Exception $e) { -unset($this->loading[$id]); -if (array_key_exists($id, $this->services)) { -unset($this->services[$id]); -} -if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { -return; -} -throw $e; -} -unset($this->loading[$id]); -return $service; -} -public function initialized($id) -{ -$id = strtolower($id); -if ('service_container'=== $id) { -return true; -} -return isset($this->services[$id]) || array_key_exists($id, $this->services); -} -public function getServiceIds() -{ -$ids = array(); -$r = new \ReflectionClass($this); -foreach ($r->getMethods() as $method) { -if (preg_match('/^get(.+)Service$/', $method->name, $match)) { -$ids[] = self::underscore($match[1]); -} -} -$ids[] ='service_container'; -return array_unique(array_merge($ids, array_keys($this->services))); -} -public function enterScope($name) -{ -if (!isset($this->scopes[$name])) { -throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name)); -} -if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) { -throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name])); -} -if (isset($this->scopedServices[$name])) { -$services = array($this->services, $name => $this->scopedServices[$name]); -unset($this->scopedServices[$name]); -foreach ($this->scopeChildren[$name] as $child) { -if (isset($this->scopedServices[$child])) { -$services[$child] = $this->scopedServices[$child]; -unset($this->scopedServices[$child]); -} -} -$this->services = call_user_func_array('array_diff_key', $services); -array_shift($services); -if (!isset($this->scopeStacks[$name])) { -$this->scopeStacks[$name] = new \SplStack(); -} -$this->scopeStacks[$name]->push($services); -} -$this->scopedServices[$name] = array(); -} -public function leaveScope($name) -{ -if (!isset($this->scopedServices[$name])) { -throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name)); -} -$services = array($this->services, $this->scopedServices[$name]); -unset($this->scopedServices[$name]); -foreach ($this->scopeChildren[$name] as $child) { -if (!isset($this->scopedServices[$child])) { -continue; -} -$services[] = $this->scopedServices[$child]; -unset($this->scopedServices[$child]); -} -$this->services = call_user_func_array('array_diff_key', $services); -if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) { -$services = $this->scopeStacks[$name]->pop(); -$this->scopedServices += $services; -foreach ($services as $array) { -foreach ($array as $id => $service) { -$this->set($id, $service, $name); -} -} -} -} -public function addScope(ScopeInterface $scope) -{ -$name = $scope->getName(); -$parentScope = $scope->getParentName(); -if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) { -throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name)); -} -if (isset($this->scopes[$name])) { -throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name)); -} -if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) { -throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope)); -} -$this->scopes[$name] = $parentScope; -$this->scopeChildren[$name] = array(); -while ($parentScope !== self::SCOPE_CONTAINER) { -$this->scopeChildren[$parentScope][] = $name; -$parentScope = $this->scopes[$parentScope]; -} -} -public function hasScope($name) -{ -return isset($this->scopes[$name]); -} -public function isScopeActive($name) -{ -return isset($this->scopedServices[$name]); -} -public static function camelize($id) -{ -return strtr(ucwords(strtr($id, array('_'=>' ','.'=>'_ ','\\'=>'_ '))), array(' '=>'')); -} -public static function underscore($id) -{ -return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/','/([a-z\d])([A-Z])/'), array('\\1_\\2','\\1_\\2'), strtr($id,'_','.'))); -} -} -} -namespace Symfony\Component\HttpKernel -{ -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -interface HttpKernelInterface -{ -const MASTER_REQUEST = 1; -const SUB_REQUEST = 2; -public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true); -} -} -namespace Symfony\Component\HttpKernel -{ -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; -use Symfony\Component\Config\Loader\LoaderInterface; -interface KernelInterface extends HttpKernelInterface, \Serializable -{ -public function registerBundles(); -public function registerContainerConfiguration(LoaderInterface $loader); -public function boot(); -public function shutdown(); -public function getBundles(); -public function isClassInActiveBundle($class); -public function getBundle($name, $first = true); -public function locateResource($name, $dir = null, $first = true); -public function getName(); -public function getEnvironment(); -public function isDebug(); -public function getRootDir(); -public function getContainer(); -public function getStartTime(); -public function getCacheDir(); -public function getLogDir(); -public function getCharset(); -} -} -namespace Symfony\Component\HttpKernel -{ -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -interface TerminableInterface -{ -public function terminate(Request $request, Response $response); -} -} -namespace Symfony\Component\HttpKernel -{ -use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator; -use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Dumper\PhpDumper; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\DependencyInjection\Loader\ClosureLoader; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; -use Symfony\Component\HttpKernel\Config\FileLocator; -use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass; -use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass; -use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\Loader\DelegatingLoader; -use Symfony\Component\Config\ConfigCache; -use Symfony\Component\ClassLoader\ClassCollectionLoader; -abstract class Kernel implements KernelInterface, TerminableInterface -{ -protected $bundles = array(); -protected $bundleMap; -protected $container; -protected $rootDir; -protected $environment; -protected $debug; -protected $booted = false; -protected $name; -protected $startTime; -protected $loadClassCache; -const VERSION ='2.5.6'; -const VERSION_ID ='20506'; -const MAJOR_VERSION ='2'; -const MINOR_VERSION ='5'; -const RELEASE_VERSION ='6'; -const EXTRA_VERSION =''; -public function __construct($environment, $debug) -{ -$this->environment = $environment; -$this->debug = (bool) $debug; -$this->rootDir = $this->getRootDir(); -$this->name = $this->getName(); -if ($this->debug) { -$this->startTime = microtime(true); -} -$this->init(); -} -public function init() -{ -} -public function __clone() -{ -if ($this->debug) { -$this->startTime = microtime(true); -} -$this->booted = false; -$this->container = null; -} -public function boot() -{ -if (true === $this->booted) { -return; -} -if ($this->loadClassCache) { -$this->doLoadClassCache($this->loadClassCache[0], $this->loadClassCache[1]); -} -$this->initializeBundles(); -$this->initializeContainer(); -foreach ($this->getBundles() as $bundle) { -$bundle->setContainer($this->container); -$bundle->boot(); -} -$this->booted = true; -} -public function terminate(Request $request, Response $response) -{ -if (false === $this->booted) { -return; -} -if ($this->getHttpKernel() instanceof TerminableInterface) { -$this->getHttpKernel()->terminate($request, $response); -} -} -public function shutdown() -{ -if (false === $this->booted) { -return; -} -$this->booted = false; -foreach ($this->getBundles() as $bundle) { -$bundle->shutdown(); -$bundle->setContainer(null); -} -$this->container = null; -} -public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) -{ -if (false === $this->booted) { -$this->boot(); -} -return $this->getHttpKernel()->handle($request, $type, $catch); -} -protected function getHttpKernel() -{ -return $this->container->get('http_kernel'); -} -public function getBundles() -{ -return $this->bundles; -} -public function isClassInActiveBundle($class) -{ -foreach ($this->getBundles() as $bundle) { -if (0 === strpos($class, $bundle->getNamespace())) { -return true; -} -} -return false; -} -public function getBundle($name, $first = true) -{ -if (!isset($this->bundleMap[$name])) { -throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, get_class($this))); -} -if (true === $first) { -return $this->bundleMap[$name][0]; -} -return $this->bundleMap[$name]; -} -public function locateResource($name, $dir = null, $first = true) -{ -if ('@'!== $name[0]) { -throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name)); -} -if (false !== strpos($name,'..')) { -throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name)); -} -$bundleName = substr($name, 1); -$path =''; -if (false !== strpos($bundleName,'/')) { -list($bundleName, $path) = explode('/', $bundleName, 2); -} -$isResource = 0 === strpos($path,'Resources') && null !== $dir; -$overridePath = substr($path, 9); -$resourceBundle = null; -$bundles = $this->getBundle($bundleName, false); -$files = array(); -foreach ($bundles as $bundle) { -if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) { -if (null !== $resourceBundle) { -throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.', -$file, -$resourceBundle, -$dir.'/'.$bundles[0]->getName().$overridePath -)); -} -if ($first) { -return $file; -} -$files[] = $file; -} -if (file_exists($file = $bundle->getPath().'/'.$path)) { -if ($first && !$isResource) { -return $file; -} -$files[] = $file; -$resourceBundle = $bundle->getName(); -} -} -if (count($files) > 0) { -return $first && $isResource ? $files[0] : $files; -} -throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name)); -} -public function getName() -{ -if (null === $this->name) { -$this->name = preg_replace('/[^a-zA-Z0-9_]+/','', basename($this->rootDir)); -} -return $this->name; -} -public function getEnvironment() -{ -return $this->environment; -} -public function isDebug() -{ -return $this->debug; -} -public function getRootDir() -{ -if (null === $this->rootDir) { -$r = new \ReflectionObject($this); -$this->rootDir = str_replace('\\','/', dirname($r->getFileName())); -} -return $this->rootDir; -} -public function getContainer() -{ -return $this->container; -} -public function loadClassCache($name ='classes', $extension ='.php') -{ -$this->loadClassCache = array($name, $extension); -} -public function setClassCache(array $classes) -{ -file_put_contents($this->getCacheDir().'/classes.map', sprintf('debug ? $this->startTime : -INF; -} -public function getCacheDir() -{ -return $this->rootDir.'/cache/'.$this->environment; -} -public function getLogDir() -{ -return $this->rootDir.'/logs'; -} -public function getCharset() -{ -return'UTF-8'; -} -protected function doLoadClassCache($name, $extension) -{ -if (!$this->booted && is_file($this->getCacheDir().'/classes.map')) { -ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension); -} -} -protected function initializeBundles() -{ -$this->bundles = array(); -$topMostBundles = array(); -$directChildren = array(); -foreach ($this->registerBundles() as $bundle) { -$name = $bundle->getName(); -if (isset($this->bundles[$name])) { -throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name)); -} -$this->bundles[$name] = $bundle; -if ($parentName = $bundle->getParent()) { -if (isset($directChildren[$parentName])) { -throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName])); -} -if ($parentName == $name) { -throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name)); -} -$directChildren[$parentName] = $name; -} else { -$topMostBundles[$name] = $bundle; -} -} -if (!empty($directChildren) && count($diff = array_diff_key($directChildren, $this->bundles))) { -$diff = array_keys($diff); -throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0])); -} -$this->bundleMap = array(); -foreach ($topMostBundles as $name => $bundle) { -$bundleMap = array($bundle); -$hierarchy = array($name); -while (isset($directChildren[$name])) { -$name = $directChildren[$name]; -array_unshift($bundleMap, $this->bundles[$name]); -$hierarchy[] = $name; -} -foreach ($hierarchy as $bundle) { -$this->bundleMap[$bundle] = $bundleMap; -array_pop($bundleMap); -} -} -} -protected function getContainerClass() -{ -return $this->name.ucfirst($this->environment).($this->debug ?'Debug':'').'ProjectContainer'; -} -protected function getContainerBaseClass() -{ -return'Container'; -} -protected function initializeContainer() -{ -$class = $this->getContainerClass(); -$cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug); -$fresh = true; -if (!$cache->isFresh()) { -$container = $this->buildContainer(); -$container->compile(); -$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass()); -$fresh = false; -} -require_once $cache; -$this->container = new $class(); -$this->container->set('kernel', $this); -if (!$fresh && $this->container->has('cache_warmer')) { -$this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir')); -} -} -protected function getKernelParameters() -{ -$bundles = array(); -foreach ($this->bundles as $name => $bundle) { -$bundles[$name] = get_class($bundle); -} -return array_merge( -array('kernel.root_dir'=> $this->rootDir,'kernel.environment'=> $this->environment,'kernel.debug'=> $this->debug,'kernel.name'=> $this->name,'kernel.cache_dir'=> $this->getCacheDir(),'kernel.logs_dir'=> $this->getLogDir(),'kernel.bundles'=> $bundles,'kernel.charset'=> $this->getCharset(),'kernel.container_class'=> $this->getContainerClass(), -), -$this->getEnvParameters() -); -} -protected function getEnvParameters() -{ -$parameters = array(); -foreach ($_SERVER as $key => $value) { -if (0 === strpos($key,'SYMFONY__')) { -$parameters[strtolower(str_replace('__','.', substr($key, 9)))] = $value; -} -} -return $parameters; -} -protected function buildContainer() -{ -foreach (array('cache'=> $this->getCacheDir(),'logs'=> $this->getLogDir()) as $name => $dir) { -if (!is_dir($dir)) { -if (false === @mkdir($dir, 0777, true)) { -throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir)); -} -} elseif (!is_writable($dir)) { -throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir)); -} -} -$container = $this->getContainerBuilder(); -$container->addObjectResource($this); -$this->prepareContainer($container); -if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) { -$container->merge($cont); -} -$container->addCompilerPass(new AddClassesToCachePass($this)); -return $container; -} -protected function prepareContainer(ContainerBuilder $container) -{ -$extensions = array(); -foreach ($this->bundles as $bundle) { -if ($extension = $bundle->getContainerExtension()) { -$container->registerExtension($extension); -$extensions[] = $extension->getAlias(); -} -if ($this->debug) { -$container->addObjectResource($bundle); -} -} -foreach ($this->bundles as $bundle) { -$bundle->build($container); -} -$container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions)); -} -protected function getContainerBuilder() -{ -$container = new ContainerBuilder(new ParameterBag($this->getKernelParameters())); -if (class_exists('ProxyManager\Configuration')) { -$container->setProxyInstantiator(new RuntimeInstantiator()); -} -return $container; -} -protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass) -{ -$dumper = new PhpDumper($container); -if (class_exists('ProxyManager\Configuration')) { -$dumper->setProxyDumper(new ProxyDumper()); -} -$content = $dumper->dump(array('class'=> $class,'base_class'=> $baseClass)); -if (!$this->debug) { -$content = static::stripComments($content); -} -$cache->write($content, $container->getResources()); -} -protected function getContainerLoader(ContainerInterface $container) -{ -$locator = new FileLocator($this); -$resolver = new LoaderResolver(array( -new XmlFileLoader($container, $locator), -new YamlFileLoader($container, $locator), -new IniFileLoader($container, $locator), -new PhpFileLoader($container, $locator), -new ClosureLoader($container), -)); -return new DelegatingLoader($resolver); -} -public static function stripComments($source) -{ -if (!function_exists('token_get_all')) { -return $source; -} -$rawChunk =''; -$output =''; -$tokens = token_get_all($source); -$ignoreSpace = false; -for (reset($tokens); false !== $token = current($tokens); next($tokens)) { -if (is_string($token)) { -$rawChunk .= $token; -} elseif (T_START_HEREDOC === $token[0]) { -$output .= $rawChunk.$token[1]; -do { -$token = next($tokens); -$output .= $token[1]; -} while ($token[0] !== T_END_HEREDOC); -$rawChunk =''; -} elseif (T_WHITESPACE === $token[0]) { -if ($ignoreSpace) { -$ignoreSpace = false; -continue; -} -$rawChunk .= preg_replace(array('/\n{2,}/S'),"\n", $token[1]); -} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) { -$ignoreSpace = true; -} else { -$rawChunk .= $token[1]; -if (T_OPEN_TAG === $token[0]) { -$ignoreSpace = true; -} -} -} -$output .= $rawChunk; -return $output; -} -public function serialize() -{ -return serialize(array($this->environment, $this->debug)); -} -public function unserialize($data) -{ -list($environment, $debug) = unserialize($data); -$this->__construct($environment, $debug); -} -} -} -namespace Symfony\Component\ClassLoader -{ -class ApcClassLoader -{ -private $prefix; -protected $decorated; -public function __construct($prefix, $decorated) -{ -if (!extension_loaded('apc')) { -throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.'); -} -if (!method_exists($decorated,'findFile')) { -throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); -} -$this->prefix = $prefix; -$this->decorated = $decorated; -} -public function register($prepend = false) -{ -spl_autoload_register(array($this,'loadClass'), true, $prepend); -} -public function unregister() -{ -spl_autoload_unregister(array($this,'loadClass')); -} -public function loadClass($class) -{ -if ($file = $this->findFile($class)) { -require $file; -return true; -} -} -public function findFile($class) -{ -if (false === $file = apc_fetch($this->prefix.$class)) { -apc_store($this->prefix.$class, $file = $this->decorated->findFile($class)); -} -return $file; -} -public function __call($method, $args) -{ -return call_user_func_array(array($this->decorated, $method), $args); -} -} -} -namespace Symfony\Component\HttpKernel\Bundle -{ -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; -interface BundleInterface extends ContainerAwareInterface -{ -public function boot(); -public function shutdown(); -public function build(ContainerBuilder $container); -public function getContainerExtension(); -public function getParent(); -public function getName(); -public function getNamespace(); -public function getPath(); -} -} -namespace Symfony\Component\DependencyInjection -{ -abstract class ContainerAware implements ContainerAwareInterface -{ -protected $container; -public function setContainer(ContainerInterface $container = null) -{ -$this->container = $container; -} -} -} -namespace Symfony\Component\HttpKernel\Bundle -{ -use Symfony\Component\DependencyInjection\ContainerAware; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\Console\Application; -use Symfony\Component\Finder\Finder; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; -abstract class Bundle extends ContainerAware implements BundleInterface -{ -protected $name; -protected $extension; -protected $path; -public function boot() -{ -} -public function shutdown() -{ -} -public function build(ContainerBuilder $container) -{ -} -public function getContainerExtension() -{ -if (null === $this->extension) { -$basename = preg_replace('/Bundle$/','', $this->getName()); -$class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension'; -if (class_exists($class)) { -$extension = new $class(); -$expectedAlias = Container::underscore($basename); -if ($expectedAlias != $extension->getAlias()) { -throw new \LogicException(sprintf('The extension alias for the default extension of a '.'bundle must be the underscored version of the '.'bundle name ("%s" instead of "%s")', -$expectedAlias, $extension->getAlias() -)); -} -$this->extension = $extension; -} else { -$this->extension = false; -} -} -if ($this->extension) { -return $this->extension; -} -} -public function getNamespace() -{ -$class = get_class($this); -return substr($class, 0, strrpos($class,'\\')); -} -public function getPath() -{ -if (null === $this->path) { -$reflected = new \ReflectionObject($this); -$this->path = dirname($reflected->getFileName()); -} -return $this->path; -} -public function getParent() -{ -} -final public function getName() -{ -if (null !== $this->name) { -return $this->name; -} -$name = get_class($this); -$pos = strrpos($name,'\\'); -return $this->name = false === $pos ? $name : substr($name, $pos + 1); -} -public function registerCommands(Application $application) -{ -if (!is_dir($dir = $this->getPath().'/Command')) { -return; -} -$finder = new Finder(); -$finder->files()->name('*Command.php')->in($dir); -$prefix = $this->getNamespace().'\\Command'; -foreach ($finder as $file) { -$ns = $prefix; -if ($relativePath = $file->getRelativePath()) { -$ns .='\\'.strtr($relativePath,'/','\\'); -} -$class = $ns.'\\'.$file->getBasename('.php'); -if ($this->container) { -$alias ='console.command.'.strtolower(str_replace('\\','_', $class)); -if ($this->container->has($alias)) { -continue; -} -} -$r = new \ReflectionClass($class); -if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) { -$application->add($r->newInstance()); -} -} -} -} -} -namespace Symfony\Component\Config -{ -use Symfony\Component\Config\Resource\ResourceInterface; -use Symfony\Component\Filesystem\Exception\IOException; -use Symfony\Component\Filesystem\Filesystem; -class ConfigCache -{ -private $debug; -private $file; -public function __construct($file, $debug) -{ -$this->file = $file; -$this->debug = (bool) $debug; -} -public function __toString() -{ -return $this->file; -} -public function isFresh() -{ -if (!is_file($this->file)) { -return false; -} -if (!$this->debug) { -return true; -} -$metadata = $this->getMetaFile(); -if (!is_file($metadata)) { -return false; -} -$time = filemtime($this->file); -$meta = unserialize(file_get_contents($metadata)); -foreach ($meta as $resource) { -if (!$resource->isFresh($time)) { -return false; -} -} -return true; -} -public function write($content, array $metadata = null) -{ -$mode = 0666; -$umask = umask(); -$filesystem = new Filesystem(); -$filesystem->dumpFile($this->file, $content, null); -try { -$filesystem->chmod($this->file, $mode, $umask); -} catch (IOException $e) { -} -if (null !== $metadata && true === $this->debug) { -$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null); -try { -$filesystem->chmod($this->getMetaFile(), $mode, $umask); -} catch (IOException $e) { -} -} -} -private function getMetaFile() -{ -return $this->file.'.meta'; -} -} -} -namespace Symfony\Component\HttpKernel -{ -use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\Event\FinishRequestEvent; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; -use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; -use Symfony\Component\HttpKernel\Event\PostResponseEvent; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -class HttpKernel implements HttpKernelInterface, TerminableInterface -{ -protected $dispatcher; -protected $resolver; -protected $requestStack; -public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null) -{ -$this->dispatcher = $dispatcher; -$this->resolver = $resolver; -$this->requestStack = $requestStack ?: new RequestStack(); -} -public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) -{ -try { -return $this->handleRaw($request, $type); -} catch (\Exception $e) { -if (false === $catch) { -$this->finishRequest($request, $type); -throw $e; -} -return $this->handleException($e, $request, $type); -} -} -public function terminate(Request $request, Response $response) -{ -$this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this, $request, $response)); -} -public function terminateWithException(\Exception $exception) -{ -if (!$request = $this->requestStack->getMasterRequest()) { -throw new \LogicException('Request stack is empty', 0, $exception); -} -$response = $this->handleException($exception, $request, self::MASTER_REQUEST); -$response->sendHeaders(); -$response->sendContent(); -$this->terminate($request, $response); -} -private function handleRaw(Request $request, $type = self::MASTER_REQUEST) -{ -$this->requestStack->push($request); -$event = new GetResponseEvent($this, $request, $type); -$this->dispatcher->dispatch(KernelEvents::REQUEST, $event); -if ($event->hasResponse()) { -return $this->filterResponse($event->getResponse(), $request, $type); -} -if (false === $controller = $this->resolver->getController($request)) { -throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". Maybe you forgot to add the matching route in your routing configuration?', $request->getPathInfo())); -} -$event = new FilterControllerEvent($this, $controller, $request, $type); -$this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event); -$controller = $event->getController(); -$arguments = $this->resolver->getArguments($request, $controller); -$response = call_user_func_array($controller, $arguments); -if (!$response instanceof Response) { -$event = new GetResponseForControllerResultEvent($this, $request, $type, $response); -$this->dispatcher->dispatch(KernelEvents::VIEW, $event); -if ($event->hasResponse()) { -$response = $event->getResponse(); -} -if (!$response instanceof Response) { -$msg = sprintf('The controller must return a response (%s given).', $this->varToString($response)); -if (null === $response) { -$msg .=' Did you forget to add a return statement somewhere in your controller?'; -} -throw new \LogicException($msg); -} -} -return $this->filterResponse($response, $request, $type); -} -private function filterResponse(Response $response, Request $request, $type) -{ -$event = new FilterResponseEvent($this, $request, $type, $response); -$this->dispatcher->dispatch(KernelEvents::RESPONSE, $event); -$this->finishRequest($request, $type); -return $event->getResponse(); -} -private function finishRequest(Request $request, $type) -{ -$this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type)); -$this->requestStack->pop(); -} -private function handleException(\Exception $e, $request, $type) -{ -$event = new GetResponseForExceptionEvent($this, $request, $type, $e); -$this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event); -$e = $event->getException(); -if (!$event->hasResponse()) { -$this->finishRequest($request, $type); -throw $e; -} -$response = $event->getResponse(); -if ($response->headers->has('X-Status-Code')) { -$response->setStatusCode($response->headers->get('X-Status-Code')); -$response->headers->remove('X-Status-Code'); -} elseif (!$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) { -if ($e instanceof HttpExceptionInterface) { -$response->setStatusCode($e->getStatusCode()); -$response->headers->add($e->getHeaders()); -} else { -$response->setStatusCode(500); -} -} -try { -return $this->filterResponse($response, $request, $type); -} catch (\Exception $e) { -return $response; -} -} -private function varToString($var) -{ -if (is_object($var)) { -return sprintf('Object(%s)', get_class($var)); -} -if (is_array($var)) { -$a = array(); -foreach ($var as $k => $v) { -$a[] = sprintf('%s => %s', $k, $this->varToString($v)); -} -return sprintf("Array(%s)", implode(', ', $a)); -} -if (is_resource($var)) { -return sprintf('Resource(%s)', get_resource_type($var)); -} -if (null === $var) { -return'null'; -} -if (false === $var) { -return'false'; -} -if (true === $var) { -return'true'; -} -return (string) $var; -} -} -} -namespace Symfony\Component\HttpKernel\DependencyInjection -{ -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\HttpKernel; -use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Scope; -class ContainerAwareHttpKernel extends HttpKernel -{ -protected $container; -public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null) -{ -parent::__construct($dispatcher, $controllerResolver, $requestStack); -$this->container = $container; -if (!$container->hasScope('request')) { -$container->addScope(new Scope('request')); -} -} -public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) -{ -$request->headers->set('X-Php-Ob-Level', ob_get_level()); -$this->container->enterScope('request'); -$this->container->set('request', $request,'request'); -try { -$response = parent::handle($request, $type, $catch); -} catch (\Exception $e) { -$this->container->set('request', null,'request'); -$this->container->leaveScope('request'); -throw $e; -} -$this->container->set('request', null,'request'); -$this->container->leaveScope('request'); -return $response; -} -} -} - -namespace { return $loader; } - \ No newline at end of file diff --git a/Test/Fixtures/bootstrap.php b/Test/Fixtures/bootstrap.php deleted file mode 100644 index 0279b4ee6..000000000 --- a/Test/Fixtures/bootstrap.php +++ /dev/null @@ -1,8 +0,0 @@ - - + ./Tests @@ -17,7 +17,7 @@ - + From dff0d1564771493de13551f8417dd57afb65fd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 3 Jul 2017 21:50:02 +0200 Subject: [PATCH 122/163] add missing translation --- Resources/translations/messages.fr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 9b502f3a4..e8a6d793a 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -63,6 +63,7 @@ Choose a type: Choisir un type CHILL_ACTIVITY_CREATE: Créer une activité CHILL_ACTIVITY_UPDATE: Modifier une activité CHILL_ACTIVITY_SEE: Voir une activité +CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des activités CHILL_ACTIVITY_DELETE: Supprimer une activité CHILL_ACTIVITY_STATS: Statistique des activités CHILL_ACTIVITY_LIST: Liste des activités From 7ccb46c0c4849b1abf3c05da1c9a6709e4297d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 3 Jul 2017 21:52:25 +0200 Subject: [PATCH 123/163] fix directory for storing doctrinemigration versions --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 113f0811b..72d1058e5 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ ] }, "extra": { - "app-migrations-dir": "Test/Fixtures/App/app/DoctrineMigrations", + "app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations", "symfony-app-dir": "Test/Fixtures/App/app/" }, "minimum-stability": "dev", From b154f5db6530d74651df8bae5951e834f5d12d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 19 Aug 2017 20:11:45 +0200 Subject: [PATCH 124/163] improve layout of list --- Resources/views/Activity/edit.html.twig | 14 ++++++++---- Resources/views/Activity/list.html.twig | 29 ++++++++++++++++-------- Resources/views/Activity/show.html.twig | 7 +++++- Test/Fixtures/App/.DS_Store | Bin 6148 -> 0 bytes Test/Fixtures/App/app/.DS_Store | Bin 6148 -> 0 bytes 5 files changed, 35 insertions(+), 15 deletions(-) delete mode 100644 Test/Fixtures/App/.DS_Store delete mode 100644 Test/Fixtures/App/app/.DS_Store diff --git a/Resources/views/Activity/edit.html.twig b/Resources/views/Activity/edit.html.twig index c0e082920..0c52cadf4 100644 --- a/Resources/views/Activity/edit.html.twig +++ b/Resources/views/Activity/edit.html.twig @@ -38,10 +38,16 @@ {{ form_widget(edit_form) }} -
                                          - - -
                                          + {{ form_end(edit_form) }} {# {{ form(delete_form) }} #} diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index d2d53d64c..1379d3472 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -26,7 +26,10 @@

                                          {{ 'Activity list' |trans }}

                                          {% if activities|length == 0 %} -

                                          {{ "There isn't any activities."|trans }}

                                          +

                                          + {{ "There isn't any activities."|trans }} + +

                                          {% else %} @@ -54,17 +57,21 @@
                                          {% endif %} -

                                          - - {{ 'Add a new activity' | trans }} - -

                                          + {% endblock %} diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index db769ee18..5f3b00b9f 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -41,9 +41,14 @@
                                            +
                                          • + + {{ 'Back to the list'|trans }} + +
                                          • - {{ 'Edit the activity'|trans }} + {{ 'Edit the activity'|trans }}
                                          • {% if is_granted('CHILL_ACTIVITY_DELETE', entity) %} diff --git a/Test/Fixtures/App/.DS_Store b/Test/Fixtures/App/.DS_Store deleted file mode 100644 index a00f962abeadbc07d074195d25166f1626619cdd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8ru7n0LGY5R;GxAzud&vnP^ehMN=-!I{p*W3DVN`PE?-z!Tr!HKWqiz)(pjq)j#`P6 z4CA^pIF&Qu`L4E`PSX3dkHWA&u^snV_@l15wjTzGBLaW$CAHHQfftVI;V|&xPD{P7 zExe@HHP@R1{{m8*PT(JlSh%7ul1rnAPuJWSk1OT!wpFQC(`{>9tASnJsimp;WEh)U zyL*QxQF?WKb9;CH@c8_q_JCvAD60x4*tc%jj1)S)DO zx6TxYcdZ3_4vKl318fYK}{*-|aDpX#P diff --git a/Test/Fixtures/App/app/.DS_Store b/Test/Fixtures/App/app/.DS_Store deleted file mode 100644 index 160f0c174dcf116cfbbb3e721ad8c751ba4cc45a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5Pe&FsCX%O@t8lL!G92I^(0bI@7lDWqBi8C=q*3pH#19Vi9&mkA~Rw3 z&Cbs3X5W--7eE*_vvXhwU_ce@9kTgBWL&f(z334PI!A>XC7w{=tP|~yePlptcZ?|( zd}^%MufVg`F=st<+Vi5G-ZWKRGGl@V#?D#m3Mt+hQ8K2XJ)yP0E5~x3FU2KuU+~5! z#ghIH%otI!C$rkfDOXz0OLfhfqf2UyFGk-pSKd!nyr%b)cEc?3rnuk?1yO!`g1hYM zHtuRm9`><}{!Y$-GvEyD!~oB1k-?Fnx6Xhw;0&x7kncl670e>GhWhDXqgMc8pKcY} za+i>tBw`k^HRK2-SSry{L%d=HOQ%1HaaqLH(9#ifWzG{<4)KN(bana@4M)ffy>$kh zflUSutUHwR|LXVq|7Mc+oB?OxUojB+ Date: Sat, 19 Aug 2017 21:46:35 +0200 Subject: [PATCH 125/163] adapt to main layout for list --- Resources/views/Activity/list.html.twig | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index 1379d3472..4061d6469 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -28,7 +28,7 @@ {% if activities|length == 0 %}

                                            {{ "There isn't any activities."|trans }} - +

                                            {% else %} @@ -57,22 +57,16 @@ From 837beb4cb2fc3468e052163fb96deb469004df07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 19 Aug 2017 23:08:00 +0200 Subject: [PATCH 126/163] layout of timeline --- Resources/translations/messages.fr.yml | 2 +- .../activity_person_context.html.twig | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index e8a6d793a..1546320c5 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -51,7 +51,7 @@ Choose a type: Choisir un type #timeline -'%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date% +'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"' #controller 'Success : activity created!': Bravo ! L'activité a été créée. diff --git a/Resources/views/Timeline/activity_person_context.html.twig b/Resources/views/Timeline/activity_person_context.html.twig index 21b704f6d..6d08d5b14 100644 --- a/Resources/views/Timeline/activity_person_context.html.twig +++ b/Resources/views/Timeline/activity_person_context.html.twig @@ -3,13 +3,13 @@

                                            {{ activity.date|localizeddate('long', 'none') }} / {{ 'Activity'|trans }}

                                            - {{ '%user% has done an %activity_type% on %date%'|trans( + {{ '%user% has done an %activity_type%'|trans( { '%user%' : user, '%activity_type%': activity.type.name|localize_translatable_string, '%date%' : activity.date|localizeddate('long', 'none') } - ) }} {{ 'Show the activity'|trans }} + ) }} + {% if is_granted(constant('Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter::SEE_DETAILS'), activity) %}
                                            @@ -27,4 +27,19 @@ {% endif %}
                                            + +
                                            From b596a7a9c91e8fad43051c00c232693e5dcd2ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 29 Aug 2017 18:11:06 +0200 Subject: [PATCH 127/163] add permission for list and stats Required for tests. This will also allow for default user to execute reports --- DataFixtures/ORM/LoadActivitytACL.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/DataFixtures/ORM/LoadActivitytACL.php b/DataFixtures/ORM/LoadActivitytACL.php index e423f39f6..304e9f41d 100644 --- a/DataFixtures/ORM/LoadActivitytACL.php +++ b/DataFixtures/ORM/LoadActivitytACL.php @@ -25,6 +25,7 @@ use Doctrine\Common\Persistence\ObjectManager; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; use Chill\MainBundle\Entity\RoleScope; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; /** * Add a role CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE for all groups except administrative, @@ -61,7 +62,7 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac break; } - printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE & CHILL_ACTIVITY_DELETE to %s " + printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE & CHILL_ACTIVITY_DELETE, and stats and list permissions to %s " . "permission group, scope '%s' \n", $permissionsGroup->getName(), $scope->getName()['en']); $roleScopeUpdate = (new RoleScope()) @@ -76,6 +77,14 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac ->setRole('CHILL_ACTIVITY_DELETE') ->setScope($scope); $permissionsGroup->addRoleScope($roleScopeDelete); + $roleScopeList = (new RoleScope()) + ->setRole(ActivityStatsVoter::LISTS) + ; + $permissionsGroup->addRoleScope($roleScopeList); + $roleScopeStat = (new RoleScope()) + ->setRole(ActivityStatsVoter::STATS) + ; + $permissionsGroup->addRoleScope($roleScopeStat); $manager->persist($roleScopeUpdate); $manager->persist($roleScopeCreate); From 4399c96036b28aa1ad06eeef614fb37571ddf63b Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 4 Apr 2018 15:59:24 +0200 Subject: [PATCH 128/163] fix deprecations: use fqcn instead of 'choice' --- .../Aggregator/ActivityReasonAggregator.php | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/Export/Aggregator/ActivityReasonAggregator.php b/Export/Aggregator/ActivityReasonAggregator.php index 33eb0499e..4cf422eec 100644 --- a/Export/Aggregator/ActivityReasonAggregator.php +++ b/Export/Aggregator/ActivityReasonAggregator.php @@ -29,9 +29,10 @@ use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\Query\Expr\Join; use Chill\MainBundle\Export\ExportElementValidatedInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; /** - * + * * * @author Julien Fastré */ @@ -43,19 +44,19 @@ class ActivityReasonAggregator implements AggregatorInterface, * @var EntityRepository */ protected $categoryRepository; - + /** * * @var EntityRepository */ protected $reasonRepository; - + /** * * @var TranslatableStringHelper */ protected $stringHelper; - + public function __construct( EntityRepository $categoryRepository, EntityRepository $reasonRepository, @@ -65,7 +66,7 @@ class ActivityReasonAggregator implements AggregatorInterface, $this->reasonRepository = $reasonRepository; $this->stringHelper = $stringHelper; } - + public function alterQuery(QueryBuilder $qb, $data) { // add select element @@ -78,9 +79,9 @@ class ActivityReasonAggregator implements AggregatorInterface, } else { throw new \RuntimeException('the data provided are not recognized'); } - + $qb->addSelect($elem.' as '.$alias); - + // make a jointure only if needed $join = $qb->getDQLPart('join'); if ( @@ -92,13 +93,13 @@ class ActivityReasonAggregator implements AggregatorInterface, (! array_key_exists('activity', $join)) ) { $qb->add( - 'join', - array('activity' => + 'join', + array('activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons') - ), + ), true); } - + // join category if necessary if ($alias === 'activity_categories_id') { // add join only if needed @@ -106,20 +107,20 @@ class ActivityReasonAggregator implements AggregatorInterface, $qb->join('reasons.category', 'category'); } } - + // add the "group by" part $groupBy = $qb->getDQLPart('groupBy'); - + if (count($groupBy) > 0) { $qb->addGroupBy($alias); } else { $qb->groupBy($alias); } } - + /** * Check if a join between Activity and another alias - * + * * @param Join[] $joins * @param string $alias the alias to search for * @return boolean @@ -131,7 +132,7 @@ class ActivityReasonAggregator implements AggregatorInterface, return true; } } - + return false; } @@ -142,7 +143,7 @@ class ActivityReasonAggregator implements AggregatorInterface, public function buildForm(FormBuilderInterface $builder) { - $builder->add('level', 'choice', array( + $builder->add('level', ChoiceType::class, array( 'choices' => array( 'By reason' => 'reasons', 'By category of reason' => 'categories' @@ -153,7 +154,7 @@ class ActivityReasonAggregator implements AggregatorInterface, 'label' => 'Reason\'s level' )); } - + public function validateForm($data, ExecutionContextInterface $context) { if ($data['level'] === null) { @@ -166,7 +167,7 @@ class ActivityReasonAggregator implements AggregatorInterface, { return "Aggregate by activity reason"; } - + public function addRole() { return new Role(ActivityStatsVoter::STATS); @@ -186,7 +187,7 @@ class ActivityReasonAggregator implements AggregatorInterface, throw new \RuntimeException(sprintf("the level data '%s' is invalid", $data['level'])); } - + return function($value) use ($data) { if ($value === '_header') { return $data['level'] === 'reasons' ? @@ -195,12 +196,12 @@ class ActivityReasonAggregator implements AggregatorInterface, 'Group by categories of reason' ; } - + switch ($data['level']) { case 'reasons': /* @var $r \Chill\ActivityBundle\Entity\ActivityReason */ $r = $this->reasonRepository->find($value); - + return $this->stringHelper->localize($r->getCategory()->getName()) ." > " . $this->stringHelper->localize($r->getName()); @@ -208,13 +209,13 @@ class ActivityReasonAggregator implements AggregatorInterface, break; case 'categories': $c = $this->categoryRepository->find($value); - + return $this->stringHelper->localize($c->getName()); break; // no need for a default : the default was already set above } }; - + } public function getQueryKeys($data) @@ -227,7 +228,7 @@ class ActivityReasonAggregator implements AggregatorInterface, } else { throw new \RuntimeException('the data provided are not recognised'); } - + } } From 95f32a8fcb303987691903a73fec90ef738feccc Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 4 Apr 2018 17:04:25 +0200 Subject: [PATCH 129/163] fix deprecations: setDefaultOptions -> configureOptions --- Form/ActivityReasonCategoryType.php | 6 +++--- Form/ActivityReasonType.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Form/ActivityReasonCategoryType.php b/Form/ActivityReasonCategoryType.php index 90d0b400a..174a25fc4 100644 --- a/Form/ActivityReasonCategoryType.php +++ b/Form/ActivityReasonCategoryType.php @@ -4,7 +4,7 @@ namespace Chill\ActivityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityReasonCategoryType extends AbstractType { @@ -19,11 +19,11 @@ class ActivityReasonCategoryType extends AbstractType ->add('active', 'checkbox', array('required' => false)) ; } - + /** * @param OptionsResolverInterface $resolver */ - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Chill\ActivityBundle\Entity\ActivityReasonCategory' diff --git a/Form/ActivityReasonType.php b/Form/ActivityReasonType.php index 695451cd0..12b5c6176 100644 --- a/Form/ActivityReasonType.php +++ b/Form/ActivityReasonType.php @@ -4,7 +4,7 @@ namespace Chill\ActivityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityReasonType extends AbstractType { @@ -20,11 +20,11 @@ class ActivityReasonType extends AbstractType ->add('category', 'translatable_activity_reason_category') ; } - + /** - * @param OptionsResolverInterface $resolver + * @param OptionsResolver $resolver */ - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Chill\ActivityBundle\Entity\ActivityReason' From 4143e773b632bb6d07feb70816bcc1de53fbb24a Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 4 Apr 2018 17:54:17 +0200 Subject: [PATCH 130/163] fix deprecations: use choices_as_values=true and flip content of the choice options --- Export/Export/ListActivity.php | 73 +++++++++++++++++----------------- Form/ActivityType.php | 69 ++++++++++++++++---------------- 2 files changed, 72 insertions(+), 70 deletions(-) diff --git a/Export/Export/ListActivity.php b/Export/Export/ListActivity.php index 394d16df8..e050518fc 100644 --- a/Export/Export/ListActivity.php +++ b/Export/Export/ListActivity.php @@ -44,39 +44,39 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; */ class ListActivity implements ListInterface { - + /** * * @var EntityManagerInterface */ protected $entityManager; - + /** * * @var TranslatorInterface */ protected $translator; - + /** - * - * @var TranslatableStringHelper + * + * @var TranslatableStringHelper */ protected $translatableStringHelper; - + protected $fields = array( - 'id', - 'date', - 'durationTime', - 'attendee', - 'list_reasons', - 'user_username', - 'circle_name', - 'type_name', + 'id', + 'date', + 'durationTime', + 'attendee', + 'list_reasons', + 'user_username', + 'circle_name', + 'type_name', 'person_firstname', 'person_lastname', 'person_id' ); - + public function __construct( EntityManagerInterface $em, TranslatorInterface $translator, @@ -87,10 +87,10 @@ class ListActivity implements ListInterface $this->translator = $translator; $this->translatableStringHelper = $translatableStringHelper; } - + /** * {@inheritDoc} - * + * * @param FormBuilderInterface $builder */ public function buildForm(FormBuilderInterface $builder) @@ -99,6 +99,7 @@ class ListActivity implements ListInterface 'multiple' => true, 'expanded' => true, 'choices' => array_combine($this->fields, $this->fields), + 'choices_as_values' => true, 'label' => 'Fields to include in export', 'constraints' => [new Callback(array( 'callback' => function($selected, ExecutionContextInterface $context) { @@ -115,7 +116,7 @@ class ListActivity implements ListInterface /** * {@inheritDoc} - * + * * @return type */ public function getAllowedFormattersTypes() @@ -130,35 +131,35 @@ class ListActivity implements ListInterface public function getLabels($key, array $values, $data) { - switch ($key) + switch ($key) { case 'date' : return function($value) { if ($value === '_header') return 'date'; - + $date = \DateTime::createFromFormat('Y-m-d H:i:s', $value); - + return $date->format('d-m-Y'); }; case 'attendee': return function($value) { if ($value === '_header') return 'attendee'; - + return $value ? 1 : 0; }; case 'list_reasons' : /* @var $activityReasonsRepository EntityRepository */ $activityRepository = $this->entityManager ->getRepository('ChillActivityBundle:Activity'); - + return function($value) use ($activityRepository) { if ($value === '_header') return 'activity reasons'; - + $activity = $activityRepository ->find($value); - + return implode(", ", array_map(function(ActivityReason $r) { - + return '"'. $this->translatableStringHelper->localize($r->getCategory()->getName()) .' > '. @@ -169,21 +170,21 @@ class ListActivity implements ListInterface case 'circle_name' : return function($value) { if ($value === '_header') return 'circle'; - + return $this->translatableStringHelper ->localize(json_decode($value, true)); }; case 'type_name' : return function($value) { if ($value === '_header') return 'activity type'; - + return $this->translatableStringHelper ->localize(json_decode($value, true)); }; default: return function($value) use ($key) { if ($value === '_header') return $key; - + return $value; }; } @@ -212,15 +213,15 @@ class ListActivity implements ListInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = array()) { $centers = array_map(function($el) { return $el['center']; }, $acl); - + // throw an error if any fields are present if (!\array_key_exists('fields', $data)) { throw new \Doctrine\DBAL\Exception\InvalidArgumentException("any fields " . "have been checked"); } - + $qb = $this->entityManager->createQueryBuilder(); - + $qb ->from('ChillActivityBundle:Activity', 'activity') ->join('activity.person', 'person') @@ -228,7 +229,7 @@ class ListActivity implements ListInterface ->andWhere('center IN (:authorized_centers)') ->setParameter('authorized_centers', $centers); ; - + foreach ($this->fields as $f) { if (in_array($f, $data['fields'])) { switch ($f) { @@ -265,12 +266,12 @@ class ListActivity implements ListInterface $qb->addSelect(sprintf('activity.%s as %s', $f, $f)); break; } - + } } - - + + return $qb; } diff --git a/Form/ActivityType.php b/Form/ActivityType.php index f3f92377d..1f598c4c7 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -21,42 +21,42 @@ use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; class ActivityType extends AbstractType { - + use AppendScopeChoiceTypeTrait; - + /** * the user running this form * * @var User */ protected $user; - + /** * * @var AuthorizationHelper */ protected $authorizationHelper; - + /** * * @var ObjectManager */ protected $om; - + /** * * @var TranslatableStringHelper */ protected $translatableStringHelper; - + protected $timeChoices; - + public function __construct( - TokenStorageInterface $tokenStorage, - AuthorizationHelper $authorizationHelper, ObjectManager $om, + TokenStorageInterface $tokenStorage, + AuthorizationHelper $authorizationHelper, ObjectManager $om, TranslatableStringHelper $translatableStringHelper, array $timeChoices - ) + ) { if (!$tokenStorage->getToken()->getUser() instanceof User) { throw new \RuntimeException("you should have a valid user"); @@ -67,7 +67,7 @@ class ActivityType extends AbstractType $this->translatableStringHelper = $translatableStringHelper; $this->timeChoices = $timeChoices; } - + /** * @param FormBuilderInterface $builder * @param array $options @@ -76,35 +76,36 @@ class ActivityType extends AbstractType { // handle times choices $timeChoices = array(); - + foreach ($this->timeChoices as $e) { $timeChoices[$e['label']] = $e['seconds']; }; - + $durationTimeTransformer = new DateTimeToTimestampTransformer('GMT', 'GMT'); $durationTimeOptions = array( 'choices' => $timeChoices, 'choices_as_values' => true, 'placeholder' => 'Choose the duration', ); - + $builder ->add('date', 'date', array( - 'required' => true, - 'widget' => 'single_text', + 'required' => true, + 'widget' => 'single_text', 'format' => 'dd-MM-yyyy') ) ->add('durationTime', ChoiceType::class, $durationTimeOptions) ->add('remark', 'textarea', array( 'required' => false, 'empty_data' => '' - )) + )) ->add('attendee', ChoiceType::class, array( 'expanded' => true, 'required' => false, + 'choices_as_values' => true, 'choices' => array( - true => 'present', - false => 'not present' + 'present' => true, + 'not present' => false ) )) ->add('user') @@ -118,44 +119,44 @@ class ActivityType extends AbstractType 'active_only' => true )) ; - - $this->appendScopeChoices($builder, $options['role'], - $options['center'], $this->user, $this->authorizationHelper, + + $this->appendScopeChoices($builder, $options['role'], + $options['center'], $this->user, $this->authorizationHelper, $this->translatableStringHelper, $this->om); - + $builder->get('durationTime') ->addModelTransformer($durationTimeTransformer); - - + + $builder->get('durationTime') ->addEventListener( - FormEvents::PRE_SET_DATA, + FormEvents::PRE_SET_DATA, function(FormEvent $formEvent) use ( - $timeChoices, + $timeChoices, $builder, $durationTimeTransformer, $durationTimeOptions - ) + ) { // set the timezone to GMT, and fix the difference between current and GMT // the datetimetransformer will then handle timezone as GMT $timezoneUTC = new \DateTimeZone('GMT'); /* @var $data \DateTime */ - $data = $formEvent->getData() === NULL ? + $data = $formEvent->getData() === NULL ? \DateTime::createFromFormat('U', 300) : $formEvent->getData(); $seconds = $data->getTimezone()->getOffset($data); $data->setTimeZone($timezoneUTC); $data->add(new \DateInterval('PT'.$seconds.'S')); - // test if the timestamp is in the choices. + // test if the timestamp is in the choices. // If not, recreate the field with the new timestamp if (!in_array($data->getTimestamp(), $timeChoices)) { // the data are not in the possible values. add them $timeChoices[$data->format('H:i')] = $data->getTimestamp(); $form = $builder->create( - 'durationTime', - ChoiceType::class, + 'durationTime', + ChoiceType::class, array_merge( $durationTimeOptions, array( @@ -168,7 +169,7 @@ class ActivityType extends AbstractType } }); } - + /** * @param OptionsResolverInterface $resolver */ @@ -177,7 +178,7 @@ class ActivityType extends AbstractType $resolver->setDefaults(array( 'data_class' => 'Chill\ActivityBundle\Entity\Activity' )); - + $this->appendScopeChoicesOptions($resolver); } From b6f9d1156ef2bc9d886269c1ae375d9b1155b5e3 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 4 Apr 2018 18:24:36 +0200 Subject: [PATCH 131/163] fix deprecations: use fqcn for textarea --- Form/ActivityType.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 1f598c4c7..b6dcd248f 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -15,6 +15,7 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTra use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\DateTimeType; use Chill\ActivityBundle\Form\Type\TranslatableActivityType; use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; @@ -95,7 +96,7 @@ class ActivityType extends AbstractType 'format' => 'dd-MM-yyyy') ) ->add('durationTime', ChoiceType::class, $durationTimeOptions) - ->add('remark', 'textarea', array( + ->add('remark', TextareaType::class, array( 'required' => false, 'empty_data' => '' )) From 6327d2578393bb2ea611197d8262b31c45f63a18 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 Apr 2018 10:34:41 +0200 Subject: [PATCH 132/163] fix deprecations: use fqcn in the activity bundle --- Controller/ActivityController.php | 95 ++++++++++--------- .../ActivityReasonCategoryController.php | 5 +- Controller/ActivityReasonController.php | 5 +- Controller/ActivityTypeController.php | 7 +- Form/ActivityReasonCategoryType.php | 6 +- Form/ActivityReasonType.php | 6 +- Form/ActivityTypeType.php | 5 +- 7 files changed, 69 insertions(+), 60 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index b0c09bc2e..b42475e25 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -3,7 +3,7 @@ /* * Chill is a software for social workers * - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, * , * * This program is free software: you can redistribute it and/or modify @@ -24,6 +24,7 @@ namespace Chill\ActivityBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Chill\ActivityBundle\Entity\Activity; use Symfony\Component\Security\Core\Role\Role; use Chill\PersonBundle\Entity\Person; @@ -43,23 +44,23 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); - + if ($person === NULL) { throw $this->createNotFoundException('Person not found'); } - + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); - + $reachableScopes = $this->get('chill.main.security.authorization.helper') ->getReachableScopes($this->getUser(), new Role('CHILL_ACTIVITY_SEE'), $person->getCenter()); - + $activities = $em->getRepository('ChillActivityBundle:Activity') ->findBy( array('person' => $person, 'scope' => $reachableScopes), array('date' => 'DESC') ); - + return $this->render('ChillActivityBundle:Activity:list.html.twig', array( 'activities' => $activities, @@ -74,13 +75,13 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); - + if ($person === NULL) { throw $this->createNotFoundException('person not found'); } - + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); - + $entity = new Activity(); $entity->setPerson($person); $form = $this->createCreateForm($entity, $person); @@ -88,16 +89,16 @@ class ActivityController extends Controller if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); - - $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity, + + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity, 'creation of this activity not allowed'); - + $em->persist($entity); $em->flush(); - + $this->get('session') ->getFlashBag() - ->add('success', + ->add('success', $this->get('translator') ->trans('Success : activity created!') ); @@ -106,7 +107,7 @@ class ActivityController extends Controller $this->generateUrl('chill_activity_activity_show', array('id' => $entity->getId(), 'person_id' => $person_id))); } - + $this->get('session') ->getFlashBag()->add('danger', $this->get('translator') @@ -129,7 +130,7 @@ class ActivityController extends Controller */ private function createCreateForm(Activity $entity) { - $form = $this->createForm('chill_activitybundle_activity', $entity, + $form = $this->createForm('chill_activitybundle_activity', $entity, array( 'action' => $this->generateUrl('chill_activity_activity_create', [ 'person_id' => $entity->getPerson()->getId(), @@ -151,20 +152,20 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); - + if ($person === NULL){ throw $this->createNotFoundException('Person not found'); } - + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); - + $entity = new Activity(); $entity->setUser($this->get('security.token_storage')->getToken()->getUser()); $entity->setPerson($person); $entity->setDate(new \DateTime('now')); - + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity); - + $form = $this->createCreateForm($entity, $person); return $this->render('ChillActivityBundle:Activity:new.html.twig', array( @@ -182,11 +183,11 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); - + if (!$person) { throw $this->createNotFoundException('person not found'); } - + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); @@ -194,7 +195,7 @@ class ActivityController extends Controller if (!$entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } - + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity); $deleteForm = $this->createDeleteForm($id, $person); @@ -214,11 +215,11 @@ class ActivityController extends Controller { $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); - + if (!$person) { throw $this->createNotFoundException('person not found'); } - + $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); @@ -226,7 +227,7 @@ class ActivityController extends Controller if (!$entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } - + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $editForm = $this->createEditForm($entity); @@ -250,9 +251,9 @@ class ActivityController extends Controller private function createEditForm(Activity $entity) { $form = $this->createForm('chill_activitybundle_activity', $entity, array( - 'action' => $this->generateUrl('chill_activity_activity_update', + 'action' => $this->generateUrl('chill_activity_activity_update', array( - 'id' => $entity->getId(), + 'id' => $entity->getId(), 'person_id' => $entity->getPerson()->getId() )), 'method' => 'PUT', @@ -269,14 +270,14 @@ class ActivityController extends Controller public function updateAction(Request $request, $person_id, $id) { $em = $this->getDoctrine()->getManager(); - + $person = $em->getRepository('ChillPersonBundle:Person')->find($person_id); $entity = $em->getRepository('ChillActivityBundle:Activity')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } - + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $deleteForm = $this->createDeleteForm($id, $person); @@ -285,17 +286,17 @@ class ActivityController extends Controller if ($editForm->isValid()) { $em->flush(); - + $this->get('session') ->getFlashBag() - ->add('success', + ->add('success', $this->get('translator') ->trans('Success : activity updated!') ); //die(); return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $id, 'person_id' => $person_id))); } - + $this->get('session') ->getFlashBag() ->add('danger', @@ -309,7 +310,7 @@ class ActivityController extends Controller 'delete_form' => $deleteForm->createView(), )); } - + /** * Deletes a Activity entity. * @@ -317,7 +318,7 @@ class ActivityController extends Controller public function deleteAction(Request $request, $id, $person_id) { $em = $this->getDoctrine()->getManager(); - + /* @var $activity Activity */ $activity = $em->getRepository('ChillActivityBundle:Activity') ->find($id); @@ -326,17 +327,17 @@ class ActivityController extends Controller if (!$activity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } - + $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity); - + $form = $this->createDeleteForm($id, $person); - + if ($request->getMethod() === Request::METHOD_DELETE) { $form->handleRequest($request); if ($form->isValid()) { $logger = $this->get('chill.main.logger'); - + $logger->notice("An activity has been removed", array( 'by_user' => $this->getUser()->getUsername(), 'activity_id' => $activity->getId(), @@ -351,26 +352,26 @@ class ActivityController extends Controller 'date' => $activity->getDate()->format('Y-m-d'), 'attendee' => $activity->getAttendee() )); - + $em->remove($activity); $em->flush(); - + $this->addFlash('success', $this->get('translator') ->trans("The activity has been successfully removed.")); - + return $this->redirect($this->generateUrl( 'chill_activity_activity_list', array( 'person_id' => $person_id ))); } } - + return $this->render('ChillActivityBundle:Activity:confirm_delete.html.twig', array( 'activity' => $activity, 'delete_form' => $form->createView() )); - - + + } /** @@ -387,7 +388,7 @@ class ActivityController extends Controller 'chill_activity_activity_delete', array('id' => $id, 'person_id' => $person->getId()))) ->setMethod('DELETE') - ->add('submit', 'submit', array('label' => 'Delete')) + ->add('submit', SubmitType::class, array('label' => 'Delete')) ->getForm() ; } diff --git a/Controller/ActivityReasonCategoryController.php b/Controller/ActivityReasonCategoryController.php index 8374f3f3e..f9f0abe4c 100644 --- a/Controller/ActivityReasonCategoryController.php +++ b/Controller/ActivityReasonCategoryController.php @@ -4,6 +4,7 @@ namespace Chill\ActivityBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Chill\ActivityBundle\Entity\ActivityReasonCategory; use Chill\ActivityBundle\Form\ActivityReasonCategoryType; @@ -67,7 +68,7 @@ class ActivityReasonCategoryController extends Controller 'method' => 'POST', )); - $form->add('submit', 'submit', array('label' => 'Create')); + $form->add('submit', SubmitType::class, array('label' => 'Create')); return $form; } @@ -142,7 +143,7 @@ class ActivityReasonCategoryController extends Controller 'method' => 'PUT', )); - $form->add('submit', 'submit', array('label' => 'Update')); + $form->add('submit', SubmitType::class, array('label' => 'Update')); return $form; } diff --git a/Controller/ActivityReasonController.php b/Controller/ActivityReasonController.php index 1f9d3cd69..b6374ec54 100644 --- a/Controller/ActivityReasonController.php +++ b/Controller/ActivityReasonController.php @@ -4,6 +4,7 @@ namespace Chill\ActivityBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Form\ActivityReasonType; @@ -67,7 +68,7 @@ class ActivityReasonController extends Controller 'method' => 'POST', )); - $form->add('submit', 'submit', array('label' => 'Create')); + $form->add('submit', SubmitType::class, array('label' => 'Create')); return $form; } @@ -142,7 +143,7 @@ class ActivityReasonController extends Controller 'method' => 'PUT', )); - $form->add('submit', 'submit', array('label' => 'Update')); + $form->add('submit', SubmitType::class, array('label' => 'Update')); return $form; } diff --git a/Controller/ActivityTypeController.php b/Controller/ActivityTypeController.php index 0c61040b8..39e4cb647 100644 --- a/Controller/ActivityTypeController.php +++ b/Controller/ActivityTypeController.php @@ -4,6 +4,7 @@ namespace Chill\ActivityBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Chill\ActivityBundle\Entity\ActivityType; use Chill\ActivityBundle\Form\ActivityTypeType; @@ -67,7 +68,7 @@ class ActivityTypeController extends Controller 'method' => 'POST', )); - $form->add('submit', 'submit', array('label' => 'Create')); + $form->add('submit', SubmitType::class, array('label' => 'Create')); return $form; } @@ -142,7 +143,7 @@ class ActivityTypeController extends Controller 'method' => 'PUT', )); - $form->add('submit', 'submit', array('label' => 'Update')); + $form->add('submit', SubmitType::class, array('label' => 'Update')); return $form; } @@ -159,7 +160,7 @@ class ActivityTypeController extends Controller if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityType entity.'); } - + $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); diff --git a/Form/ActivityReasonCategoryType.php b/Form/ActivityReasonCategoryType.php index 174a25fc4..43b7dfe0f 100644 --- a/Form/ActivityReasonCategoryType.php +++ b/Form/ActivityReasonCategoryType.php @@ -5,6 +5,8 @@ namespace Chill\ActivityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; class ActivityReasonCategoryType extends AbstractType { @@ -15,8 +17,8 @@ class ActivityReasonCategoryType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name', 'translatable_string') - ->add('active', 'checkbox', array('required' => false)) + ->add('name', TranslatableStringFormType::class) + ->add('active', CheckboxType::class, array('required' => false)) ; } diff --git a/Form/ActivityReasonType.php b/Form/ActivityReasonType.php index 12b5c6176..7671ea2cc 100644 --- a/Form/ActivityReasonType.php +++ b/Form/ActivityReasonType.php @@ -5,6 +5,8 @@ namespace Chill\ActivityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; class ActivityReasonType extends AbstractType { @@ -15,8 +17,8 @@ class ActivityReasonType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name', 'translatable_string') - ->add('active', 'checkbox', array('required' => false)) + ->add('name', TranslatableStringFormType::class) + ->add('active', CheckboxType::class, array('required' => false)) ->add('category', 'translatable_activity_reason_category') ; } diff --git a/Form/ActivityTypeType.php b/Form/ActivityTypeType.php index 146f0abca..55e4bace1 100644 --- a/Form/ActivityTypeType.php +++ b/Form/ActivityTypeType.php @@ -6,6 +6,7 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; class ActivityTypeType extends AbstractType { @@ -16,7 +17,7 @@ class ActivityTypeType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name', 'translatable_string') + ->add('name', TranslatableStringFormType::class) ->add('active', ChoiceType::class, array( 'choices' => array( 'Yes' => true, @@ -26,7 +27,7 @@ class ActivityTypeType extends AbstractType 'expanded' => true )); } - + /** * @param OptionsResolverInterface $resolver */ From ed00833eb853de5cd98fe7f3e0bafe58fa732b55 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 Apr 2018 10:43:01 +0200 Subject: [PATCH 133/163] fix deprecations: implement abstract method supports and voteOnAttribute for ActivityVoter --- Security/Authorization/ActivityVoter.php | 45 +++++++++++++----------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php index b4d0feb2f..79b5b8202 100644 --- a/Security/Authorization/ActivityVoter.php +++ b/Security/Authorization/ActivityVoter.php @@ -19,12 +19,16 @@ namespace Chill\ActivityBundle\Security\Authorization; +use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; + use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; +use Chill\MainBundle\Entity\User; +use Chill\ActivityBundle\Entity\Activity; /** - * + * * * @author Julien Fastré */ @@ -35,39 +39,40 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS'; const UPDATE = 'CHILL_ACTIVITY_UPDATE'; const DELETE = 'CHILL_ACTIVITY_DELETE'; - + /** * * @var AuthorizationHelper */ protected $helper; - + public function __construct(AuthorizationHelper $helper) { $this->helper = $helper; } - - protected function getSupportedAttributes() - { - return array(self::CREATE, self::SEE, self::UPDATE, self::DELETE, - self::SEE_DETAILS); - } - protected function getSupportedClasses() - { - return array('Chill\ActivityBundle\Entity\Activity'); - } - protected function isGranted($attribute, $report, $user = null) + protected function supports($attribute, $subject) { - if (! $user instanceof \Chill\MainBundle\Entity\User){ - + if ($subject instanceof Activity) { + return \in_array($attribute, [ + self::CREATE, self::SEE, self::UPDATE, self::DELETE, + self::SEE_DETAILS + ]); + } else { return false; } - - return $this->helper->userHasAccess($user, $report, $attribute); } + protected function voteOnAttribute($attribute, $subject, TokenInterface $token) + { + if (!$token->getUser() instanceof User) { + return false; + } + return $this->helper->userHasAccess($token->getUser(), $subject, $attribute); + } + + public function getRoles() { return $this->getSupportedAttributes(); @@ -77,8 +82,8 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn { return array(); } - - + + public function getRolesWithHierarchy() { return [ 'Activity' => $this->getRoles() ]; From 478e1c505d3cb51d8a0152e270cd90119d49cd6f Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 Apr 2018 11:45:58 +0200 Subject: [PATCH 134/163] fix deprecation: no more passing of type instances --- Controller/ActivityController.php | 8 ++++--- .../ActivityReasonCategoryController.php | 4 ++-- Controller/ActivityReasonController.php | 4 ++-- Controller/ActivityTypeController.php | 4 ++-- Form/ActivityType.php | 3 ++- Form/Type/TranslatableActivityReason.php | 23 ++++++++++--------- .../TranslatableActivityReasonCategory.php | 21 +++++++++-------- 7 files changed, 36 insertions(+), 31 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index b42475e25..9a24cb503 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -25,9 +25,11 @@ namespace Chill\ActivityBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Form\Extension\Core\Type\SubmitType; -use Chill\ActivityBundle\Entity\Activity; use Symfony\Component\Security\Core\Role\Role; + +use Chill\ActivityBundle\Entity\Activity; use Chill\PersonBundle\Entity\Person; +use Chill\ActivityBundle\Form\ActivityType; /** * Activity controller. @@ -130,7 +132,7 @@ class ActivityController extends Controller */ private function createCreateForm(Activity $entity) { - $form = $this->createForm('chill_activitybundle_activity', $entity, + $form = $this->createForm(ActivityType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activity_create', [ 'person_id' => $entity->getPerson()->getId(), @@ -250,7 +252,7 @@ class ActivityController extends Controller */ private function createEditForm(Activity $entity) { - $form = $this->createForm('chill_activitybundle_activity', $entity, array( + $form = $this->createForm(ActivityType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activity_update', array( 'id' => $entity->getId(), diff --git a/Controller/ActivityReasonCategoryController.php b/Controller/ActivityReasonCategoryController.php index f9f0abe4c..90b72384b 100644 --- a/Controller/ActivityReasonCategoryController.php +++ b/Controller/ActivityReasonCategoryController.php @@ -63,7 +63,7 @@ class ActivityReasonCategoryController extends Controller */ private function createCreateForm(ActivityReasonCategory $entity) { - $form = $this->createForm(new ActivityReasonCategoryType(), $entity, array( + $form = $this->createForm(ActivityReasonCategoryType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activityreasoncategory_create'), 'method' => 'POST', )); @@ -138,7 +138,7 @@ class ActivityReasonCategoryController extends Controller */ private function createEditForm(ActivityReasonCategory $entity) { - $form = $this->createForm(new ActivityReasonCategoryType(), $entity, array( + $form = $this->createForm(ActivityReasonCategoryType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', array('id' => $entity->getId())), 'method' => 'PUT', )); diff --git a/Controller/ActivityReasonController.php b/Controller/ActivityReasonController.php index b6374ec54..c09756942 100644 --- a/Controller/ActivityReasonController.php +++ b/Controller/ActivityReasonController.php @@ -63,7 +63,7 @@ class ActivityReasonController extends Controller */ private function createCreateForm(ActivityReason $entity) { - $form = $this->createForm(new ActivityReasonType(), $entity, array( + $form = $this->createForm(ActivityReasonType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activityreason_create'), 'method' => 'POST', )); @@ -138,7 +138,7 @@ class ActivityReasonController extends Controller */ private function createEditForm(ActivityReason $entity) { - $form = $this->createForm(new ActivityReasonType(), $entity, array( + $form = $this->createForm(ActivityReasonType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activityreason_update', array('id' => $entity->getId())), 'method' => 'PUT', )); diff --git a/Controller/ActivityTypeController.php b/Controller/ActivityTypeController.php index 39e4cb647..db004470a 100644 --- a/Controller/ActivityTypeController.php +++ b/Controller/ActivityTypeController.php @@ -63,7 +63,7 @@ class ActivityTypeController extends Controller */ private function createCreateForm(ActivityType $entity) { - $form = $this->createForm(new ActivityTypeType(), $entity, array( + $form = $this->createForm(ActivityTypeType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activitytype_create'), 'method' => 'POST', )); @@ -138,7 +138,7 @@ class ActivityTypeController extends Controller */ private function createEditForm(ActivityType $entity) { - $form = $this->createForm(new ActivityTypeType(), $entity, array( + $form = $this->createForm(ActivityTypeType::class, $entity, array( 'action' => $this->generateUrl('chill_activity_activitytype_update', array('id' => $entity->getId())), 'method' => 'PUT', )); diff --git a/Form/ActivityType.php b/Form/ActivityType.php index b6dcd248f..68ecf2794 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\DateTimeType; +use Symfony\Component\Form\Extension\Core\Type\DateType; use Chill\ActivityBundle\Form\Type\TranslatableActivityType; use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; @@ -90,7 +91,7 @@ class ActivityType extends AbstractType ); $builder - ->add('date', 'date', array( + ->add('date', DateType::class, array( 'required' => true, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy') diff --git a/Form/Type/TranslatableActivityReason.php b/Form/Type/TranslatableActivityReason.php index f93e42d62..2a41d4210 100644 --- a/Form/Type/TranslatableActivityReason.php +++ b/Form/Type/TranslatableActivityReason.php @@ -2,20 +2,20 @@ /* * Chill is a software for social workers - * - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + * + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, * , - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ @@ -24,6 +24,7 @@ namespace Chill\ActivityBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\EntityRepository; @@ -34,24 +35,24 @@ use Doctrine\ORM\EntityRepository; */ class TranslatableActivityReason extends AbstractType { - + private $translatableStringHelper; - + public function __construct(TranslatableStringHelper $translatableStringHelper) { $this->translatableStringHelper = $translatableStringHelper; } - + public function getName() { return 'translatable_activity_reason'; } - + public function getParent() { - return 'entity'; + return EntityType::class; } - + public function configureOptions(OptionsResolver $resolver) { $helper = $this->translatableStringHelper; diff --git a/Form/Type/TranslatableActivityReasonCategory.php b/Form/Type/TranslatableActivityReasonCategory.php index ec90c2f9f..cd9686b1c 100644 --- a/Form/Type/TranslatableActivityReasonCategory.php +++ b/Form/Type/TranslatableActivityReasonCategory.php @@ -2,20 +2,20 @@ /* * Chill is a software for social workers - * - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + * + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, * , - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ @@ -25,6 +25,7 @@ namespace Chill\ActivityBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Doctrine\ORM\EntityRepository; /** @@ -40,22 +41,22 @@ class TranslatableActivityReasonCategory extends AbstractType * @var RequestStack */ private $requestStack; - + public function __construct(RequestStack $requestStack) { $this->requestStack = $requestStack; } - + public function getName() { return 'translatable_activity_reason_category'; } - + public function getParent() { - return 'entity'; + return EntityType::class; } - + public function configureOptions(OptionsResolver $resolver) { $locale = $this->requestStack->getCurrentRequest()->getLocale(); From 5aa87ffdb4a550379cd06e2942733bc13da61d9a Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 Apr 2018 15:04:47 +0200 Subject: [PATCH 135/163] fix deprecations: use fqcn + change 'property' in 'choice_label' --- Form/ActivityReasonType.php | 3 ++- Form/Type/TranslatableActivityReasonCategory.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Form/ActivityReasonType.php b/Form/ActivityReasonType.php index 7671ea2cc..a7fad4a2f 100644 --- a/Form/ActivityReasonType.php +++ b/Form/ActivityReasonType.php @@ -7,6 +7,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; +use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory; class ActivityReasonType extends AbstractType { @@ -19,7 +20,7 @@ class ActivityReasonType extends AbstractType $builder ->add('name', TranslatableStringFormType::class) ->add('active', CheckboxType::class, array('required' => false)) - ->add('category', 'translatable_activity_reason_category') + ->add('category', TranslatableActivityReasonCategory::class) ; } diff --git a/Form/Type/TranslatableActivityReasonCategory.php b/Form/Type/TranslatableActivityReasonCategory.php index cd9686b1c..c01ff2a01 100644 --- a/Form/Type/TranslatableActivityReasonCategory.php +++ b/Form/Type/TranslatableActivityReasonCategory.php @@ -63,7 +63,7 @@ class TranslatableActivityReasonCategory extends AbstractType $resolver->setDefaults( array( 'class' => 'ChillActivityBundle:ActivityReasonCategory', - 'property' => 'name['.$locale.']', + 'choice_label' => 'name['.$locale.']', 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('c') ->where('c.active = true'); From ea5d3f794030de8bbd579b3f166a4f517f9fc498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 6 Apr 2018 02:41:32 +0200 Subject: [PATCH 136/163] branch upgrade-sf3 to same branch in other repo --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 72d1058e5..56ab6005b 100644 --- a/composer.json +++ b/composer.json @@ -27,9 +27,8 @@ "doctrine/orm": "~2.4", "doctrine/common": "~2.4", "doctrine/doctrine-bundle": "~1.2", - "chill-project/main": "dev-master@dev", - "chill-project/custom-fields": "dev-master@dev", - "chill-project/person": "dev-master@dev", + "chill-project/main": "dev-upgrade-sf3@dev", + "chill-project/person": "dev-upgrade-sf3@dev", "champs-libres/composer-bundle-migration": "~1.0", "doctrine/doctrine-migrations-bundle": "~1.1", "doctrine/migrations": "~1.0@dev", From b84a77d9de48ff2a00dda6b45c2b63151cebbac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 6 Apr 2018 02:42:11 +0200 Subject: [PATCH 137/163] fix invocation of old method and upgrade ActivitySTatVoter to sf3 --- Security/Authorization/ActivityStatsVoter.php | 17 ++++++++++++++--- Security/Authorization/ActivityVoter.php | 13 ++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Security/Authorization/ActivityStatsVoter.php b/Security/Authorization/ActivityStatsVoter.php index dc8832635..93d8117a9 100644 --- a/Security/Authorization/ActivityStatsVoter.php +++ b/Security/Authorization/ActivityStatsVoter.php @@ -45,7 +45,7 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar $this->helper = $helper; } - protected function getSupportedAttributes() + private function getAttributes() { return array(self::STATS, self::LISTS); } @@ -54,6 +54,17 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar { return array(Center::class); } + + protected function supports($attribute, $subject) + { + if ($subject instanceof Center + && \in_array($attribute, $this->getAttributes())) { + + return true; + } + + return false; + } protected function isGranted($attribute, $object, $user = null) { @@ -66,12 +77,12 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar public function getRoles() { - return $this->getSupportedAttributes(); + return $this->getAttributes(); } public function getRolesWithoutScope() { - return $this->getSupportedAttributes(); + return $this->getAttributes(); } public function getRolesWithHierarchy() diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php index 79b5b8202..5d0d50906 100644 --- a/Security/Authorization/ActivityVoter.php +++ b/Security/Authorization/ActivityVoter.php @@ -55,10 +55,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn protected function supports($attribute, $subject) { if ($subject instanceof Activity) { - return \in_array($attribute, [ - self::CREATE, self::SEE, self::UPDATE, self::DELETE, - self::SEE_DETAILS - ]); + return \in_array($attribute, $this->getAttributes()); } else { return false; } @@ -71,11 +68,17 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn } return $this->helper->userHasAccess($token->getUser(), $subject, $attribute); } + + private function getAttributes() + { + return [ self::CREATE, self::SEE, self::UPDATE, self::DELETE, + self::SEE_DETAILS ]; + } public function getRoles() { - return $this->getSupportedAttributes(); + return $this->getAttributes(); } public function getRolesWithoutScope() From 96e1b1db4d4891f0520e0d0a88a03ff5a5b289d9 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 9 Apr 2018 10:06:34 +0200 Subject: [PATCH 138/163] fix deprecations: getName -> getBlockPrefix in Forms --- Form/ActivityReasonCategoryType.php | 2 +- Form/ActivityReasonType.php | 2 +- Form/ActivityType.php | 2 +- Form/ActivityTypeType.php | 2 +- Form/Type/TranslatableActivityReason.php | 2 +- .../TranslatableActivityReasonCategory.php | 2 +- Form/Type/TranslatableActivityType.php | 32 +++++++++---------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Form/ActivityReasonCategoryType.php b/Form/ActivityReasonCategoryType.php index 43b7dfe0f..5f566393f 100644 --- a/Form/ActivityReasonCategoryType.php +++ b/Form/ActivityReasonCategoryType.php @@ -35,7 +35,7 @@ class ActivityReasonCategoryType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_activitybundle_activityreasoncategory'; } diff --git a/Form/ActivityReasonType.php b/Form/ActivityReasonType.php index a7fad4a2f..f46930faa 100644 --- a/Form/ActivityReasonType.php +++ b/Form/ActivityReasonType.php @@ -37,7 +37,7 @@ class ActivityReasonType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_activitybundle_activityreason'; } diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 68ecf2794..30f5d2e88 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -187,7 +187,7 @@ class ActivityType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_activitybundle_activity'; } diff --git a/Form/ActivityTypeType.php b/Form/ActivityTypeType.php index 55e4bace1..b3d400bf8 100644 --- a/Form/ActivityTypeType.php +++ b/Form/ActivityTypeType.php @@ -41,7 +41,7 @@ class ActivityTypeType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_activitybundle_activitytype'; } diff --git a/Form/Type/TranslatableActivityReason.php b/Form/Type/TranslatableActivityReason.php index 2a41d4210..af8a7dcd1 100644 --- a/Form/Type/TranslatableActivityReason.php +++ b/Form/Type/TranslatableActivityReason.php @@ -43,7 +43,7 @@ class TranslatableActivityReason extends AbstractType $this->translatableStringHelper = $translatableStringHelper; } - public function getName() + public function getBlockPrefix() { return 'translatable_activity_reason'; } diff --git a/Form/Type/TranslatableActivityReasonCategory.php b/Form/Type/TranslatableActivityReasonCategory.php index c01ff2a01..6dd04023c 100644 --- a/Form/Type/TranslatableActivityReasonCategory.php +++ b/Form/Type/TranslatableActivityReasonCategory.php @@ -47,7 +47,7 @@ class TranslatableActivityReasonCategory extends AbstractType $this->requestStack = $requestStack; } - public function getName() + public function getBlockPrefix() { return 'translatable_activity_reason_category'; } diff --git a/Form/Type/TranslatableActivityType.php b/Form/Type/TranslatableActivityType.php index 89399e551..f21184a30 100644 --- a/Form/Type/TranslatableActivityType.php +++ b/Form/Type/TranslatableActivityType.php @@ -2,20 +2,20 @@ /* * Chill is a software for social workers - * - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + * + * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, * , - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ @@ -37,15 +37,15 @@ use Chill\ActivityBundle\Entity\ActivityType; */ class TranslatableActivityType extends AbstractType { - + /** * * @var TranslatableStringHelper */ protected $translatableStringHelper; - + protected $activityTypeRepository; - + public function __construct( TranslatableStringHelper $helper, EntityRepository $activityTypeRepository @@ -54,30 +54,30 @@ class TranslatableActivityType extends AbstractType $this->translatableStringHelper = $helper; $this->activityTypeRepository = $activityTypeRepository; } - - public function getName() + + public function getBlockPrefix() { return 'translatable_activity_type'; } - + public function getParent() { return EntityType::class; } - + public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options) { /* @var $qb \Doctrine\ORM\QueryBuilder */ $qb = $options['query_builder']; - + if ($options['active_only'] === true) { $qb->where($qb->expr()->eq('at.active', ':active')); $qb->setParameter('active', true, \Doctrine\DBAL\Types\Type::BOOLEAN); - } + } } - + public function configureOptions(OptionsResolver $resolver) { - + $resolver->setDefaults( array( 'class' => 'ChillActivityBundle:ActivityType', From e052de7bb07f992f087dba08d54b571e0ffcd5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 13 Apr 2018 14:17:45 +0200 Subject: [PATCH 139/163] add parameters.yml to gitignore --- .gitignore | 1 + Resources/test/Fixtures/App/app/config/parameters.yml | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 Resources/test/Fixtures/App/app/config/parameters.yml diff --git a/.gitignore b/.gitignore index b749d005b..8aa30e672 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ Tests/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/DoctrineMigrations/* Test/Fixtures/App/app/cache/* Test/Fixtures/App/app/config/parameters.yml +Resources/test/Fixtures/App/app/config/parameters.yml /nbproject/private/ Test/Fixtures/App/app/bootstrap.php.cache diff --git a/Resources/test/Fixtures/App/app/config/parameters.yml b/Resources/test/Fixtures/App/app/config/parameters.yml deleted file mode 100644 index 1c82dd4dd..000000000 --- a/Resources/test/Fixtures/App/app/config/parameters.yml +++ /dev/null @@ -1,8 +0,0 @@ -parameters: - database_host: 127.0.0.1 - database_port: 5454 -# database_port: 5435 - database_name: postgres - database_user: postgres - database_password: postgres - locale: fr From 307ef4ae62f3e80194aa9ad495c6ce2b165c5126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 19 Apr 2018 12:53:58 +0200 Subject: [PATCH 140/163] remove deps to symfony/framework-bundle --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 56ab6005b..9397d2e18 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,6 @@ "require": { "twig/extensions": "^1.2", "symfony/assetic-bundle": "~2.3", - "symfony/framework-bundle": "~2.7", "symfony/yaml": "~2.7", "symfony/symfony": "~2.7", "doctrine/dbal": "~2.5", From 491620946bc50f2b6467b5c14427f3e45d05e782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 24 Apr 2018 14:47:08 +0200 Subject: [PATCH 141/163] switch composer.json to sf 3 --- composer.json | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 9397d2e18..ef19e8061 100644 --- a/composer.json +++ b/composer.json @@ -18,27 +18,14 @@ } ], "require": { - "twig/extensions": "^1.2", - "symfony/assetic-bundle": "~2.3", - "symfony/yaml": "~2.7", - "symfony/symfony": "~2.7", - "doctrine/dbal": "~2.5", - "doctrine/orm": "~2.4", - "doctrine/common": "~2.4", - "doctrine/doctrine-bundle": "~1.2", "chill-project/main": "dev-upgrade-sf3@dev", - "chill-project/person": "dev-upgrade-sf3@dev", - "champs-libres/composer-bundle-migration": "~1.0", - "doctrine/doctrine-migrations-bundle": "~1.1", - "doctrine/migrations": "~1.0@dev", - "phpunit/phpunit": "^6.2" + "chill-project/person": "dev-upgrade-sf3@dev" }, "require-dev": { - "doctrine/doctrine-fixtures-bundle": "~2.2", + "doctrine/doctrine-fixtures-bundle": "~3", "fzaninotto/faker": "~1", "monolog/monolog": "^1.14", - "symfony/monolog-bundle": "^2.7", - "sensio/generator-bundle": "^2.5" + "phpunit/phpunit": "~6" }, "scripts": { "post-install-cmd": [ From 6e8982958ebb3941ce93c927e6f567c25938d8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 4 May 2018 22:49:38 +0200 Subject: [PATCH 142/163] re-enable fixtures with sf3 --- DependencyInjection/ChillActivityExtension.php | 1 + Resources/config/services/fixtures.yml | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 Resources/config/services/fixtures.yml diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 9567514aa..844e13355 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -51,6 +51,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader->load('services.yml'); $loader->load('services/export.yml'); $loader->load('services/repositories.yml'); + $loader->load('services/fixtures.yml'); } public function prepend(ContainerBuilder $container) diff --git a/Resources/config/services/fixtures.yml b/Resources/config/services/fixtures.yml new file mode 100644 index 000000000..140386592 --- /dev/null +++ b/Resources/config/services/fixtures.yml @@ -0,0 +1,4 @@ +services: + Chill\ActivityBundle\DataFixtures\ORM\: + resource: ../../../DataFixtures/ORM + tags: [ 'doctrine.fixture.orm' ] From b0ee67f8b5eea8b6bd56fdc416b3e2185106dee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 8 Jun 2018 17:49:35 +0200 Subject: [PATCH 143/163] handle menu with new menuBuilder api --- .../ChillActivityExtension.php | 1 + Menu/MenuBuilder.php | 88 +++++++++++++++++++ Resources/config/routing/activity.yml | 10 --- Resources/config/services/menu.yml | 8 ++ 4 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 Menu/MenuBuilder.php create mode 100644 Resources/config/services/menu.yml diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 844e13355..ab0059155 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -52,6 +52,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader->load('services/export.yml'); $loader->load('services/repositories.yml'); $loader->load('services/fixtures.yml'); + $loader->load('services/menu.yml'); } public function prepend(ContainerBuilder $container) diff --git a/Menu/MenuBuilder.php b/Menu/MenuBuilder.php new file mode 100644 index 000000000..f11aa28bc --- /dev/null +++ b/Menu/MenuBuilder.php @@ -0,0 +1,88 @@ + + */ +class MenuBuilder implements LocalMenuBuilderInterface +{ + /** + * + * @var TokenStorageInterface + */ + protected $tokenStorage; + + /** + * + * @var TranslatorInterface + */ + protected $translator; + + /** + * + * @var AuthorizationHelper + */ + protected $authorizationHelper; + + public function __construct( + TokenStorageInterface $tokenStorage, + TranslatorInterface $translator, + AuthorizationHelper $authorizationHelper + ) { + $this->tokenStorage = $tokenStorage; + $this->translator = $translator; + $this->authorizationHelper = $authorizationHelper; + } + + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + /* @var $person \Chill\PersonBundle\Entity\Person */ + $person = $parameters['person']; + $user = $this->tokenStorage->getToken()->getUser(); + $roleSee = new Role(ActivityVoter::SEE); + $roleAdd = new Role(ActivityVoter::CREATE); + + if ($this->authorizationHelper->userHasAccess($user, $person, $roleSee)) { + $menu->addChild($this->translator->trans('Activity list'), [ + 'route' => 'chill_activity_activity_list', + 'routeParameters' => [ + 'person_id' => $person->getId() + ] + ]) + ->setExtras([ + 'order' => 201 + ]); + } + + if ($this->authorizationHelper->userHasAccess($user, $person, $roleAdd)) { + $menu->addChild($this->translator->trans('Add a new activity'), [ + 'route' => 'chill_activity_activity_new', + 'routeParameters' => [ + 'person_id' => $person->getId() + ] + ]) + ->setExtras([ + 'order' => 200 + ]); + } + } + + public static function getMenuIds(): array + { + return [ 'person' ]; + } +} diff --git a/Resources/config/routing/activity.yml b/Resources/config/routing/activity.yml index 6d287eec7..5b49b93e5 100644 --- a/Resources/config/routing/activity.yml +++ b/Resources/config/routing/activity.yml @@ -1,11 +1,6 @@ chill_activity_activity_list: path: /{_locale}/person/{person_id}/activity/ defaults: { _controller: "ChillActivityBundle:Activity:list" } - options: - menus: - person: - order: 201 - label: Activity list chill_activity_activity_show: path: /{_locale}/person/{person_id}/activity/{id}/show @@ -14,11 +9,6 @@ chill_activity_activity_show: chill_activity_activity_new: path: /{_locale}/person/{person_id}/activity/new defaults: { _controller: "ChillActivityBundle:Activity:new" } - options: - menus: - person: - order: 200 - label: Add a new activity chill_activity_activity_create: path: /{_locale}/person/{person_id}/activity/create diff --git a/Resources/config/services/menu.yml b/Resources/config/services/menu.yml new file mode 100644 index 000000000..2a0434996 --- /dev/null +++ b/Resources/config/services/menu.yml @@ -0,0 +1,8 @@ +services: + Chill\ActivityBundle\Menu\MenuBuilder: + arguments: + $authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper' + $tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface' + $translator: '@Symfony\Component\Translation\TranslatorInterface' + tags: + - { name: 'chill.menu_builder' } From b4c50bccb41ef374efc6b361c4d926692f5bbee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 17 Aug 2018 13:40:25 +0200 Subject: [PATCH 144/163] insert entries in person menu dynamically, according to acl --- .../ChillActivityExtension.php | 1 + Menu/PersonMenuBuilder.php | 83 +++++++++++++++++++ Resources/config/routing/activity.yml | 10 --- Resources/config/services/menu.yml | 7 ++ Security/Authorization/ActivityVoter.php | 14 ++++ 5 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 Menu/PersonMenuBuilder.php create mode 100644 Resources/config/services/menu.yml diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 844e13355..ab0059155 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -52,6 +52,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader->load('services/export.yml'); $loader->load('services/repositories.yml'); $loader->load('services/fixtures.yml'); + $loader->load('services/menu.yml'); } public function prepend(ContainerBuilder $container) diff --git a/Menu/PersonMenuBuilder.php b/Menu/PersonMenuBuilder.php new file mode 100644 index 000000000..7c8092227 --- /dev/null +++ b/Menu/PersonMenuBuilder.php @@ -0,0 +1,83 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\ActivityBundle\Menu; + +use Chill\MainBundle\Routing\LocalMenuBuilderInterface; +use Knp\Menu\MenuItem; +use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; +use Chill\ActivityBundle\Security\Authorization\ActivityVoter; +use Symfony\Component\Translation\TranslatorInterface; + +/** + * + * + * @author Julien Fastré + */ +class PersonMenuBuilder implements LocalMenuBuilderInterface +{ + /** + * + * @var TranslatorInterface + */ + protected $translator; + + /** + * + * @var AuthorizationCheckerInterface + */ + protected $authorizationChecker; + + public function __construct( + AuthorizationCheckerInterface $authorizationChecker, + TranslatorInterface $translator) + { + $this->translator = $translator; + $this->authorizationChecker = $authorizationChecker; + } + + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + /* @var $person \Chill\PersonBundle\Entity\Person */ + $person = $parameters['person']; + + if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { + $menu->addChild( + $this->translator->trans('Activity list'), [ + 'route' => 'chill_activity_activity_list', + 'routeParameters' => [ 'person_id' => $person->getId() ], + ]) + ->setExtra('order', 201) + ; + } + if ($this->authorizationChecker->isGranted(ActivityVoter::CREATE, $person)) { + $menu->addChild( + $this->translator->trans('Add a new activity'), [ + 'route' => 'chill_activity_activity_new', + 'routeParameters' => [ 'person_id' => $person->getId() ], + ]) + ->setExtra('order', 200) + ; + } + } + + public static function getMenuIds(): array + { + return ['person']; + } +} diff --git a/Resources/config/routing/activity.yml b/Resources/config/routing/activity.yml index 6d287eec7..5b49b93e5 100644 --- a/Resources/config/routing/activity.yml +++ b/Resources/config/routing/activity.yml @@ -1,11 +1,6 @@ chill_activity_activity_list: path: /{_locale}/person/{person_id}/activity/ defaults: { _controller: "ChillActivityBundle:Activity:list" } - options: - menus: - person: - order: 201 - label: Activity list chill_activity_activity_show: path: /{_locale}/person/{person_id}/activity/{id}/show @@ -14,11 +9,6 @@ chill_activity_activity_show: chill_activity_activity_new: path: /{_locale}/person/{person_id}/activity/new defaults: { _controller: "ChillActivityBundle:Activity:new" } - options: - menus: - person: - order: 200 - label: Add a new activity chill_activity_activity_create: path: /{_locale}/person/{person_id}/activity/create diff --git a/Resources/config/services/menu.yml b/Resources/config/services/menu.yml new file mode 100644 index 000000000..a70eb0e05 --- /dev/null +++ b/Resources/config/services/menu.yml @@ -0,0 +1,7 @@ +services: + Chill\ActivityBundle\Menu\PersonMenuBuilder: + arguments: + $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' + $translator: '@Symfony\Component\Translation\TranslatorInterface' + tags: + - { name: 'chill.menu_builder' } \ No newline at end of file diff --git a/Security/Authorization/ActivityVoter.php b/Security/Authorization/ActivityVoter.php index 5d0d50906..79cb6d852 100644 --- a/Security/Authorization/ActivityVoter.php +++ b/Security/Authorization/ActivityVoter.php @@ -26,6 +26,8 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; use Chill\MainBundle\Entity\User; use Chill\ActivityBundle\Entity\Activity; +use Chill\PersonBundle\Entity\Person; +use Symfony\Component\Security\Core\Role\Role; /** * @@ -56,6 +58,10 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn { if ($subject instanceof Activity) { return \in_array($attribute, $this->getAttributes()); + } elseif ($subject instanceof Person) { + return $attribute === self::SEE + || + $attribute === self::CREATE; } else { return false; } @@ -66,6 +72,14 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn if (!$token->getUser() instanceof User) { return false; } + + if ($subject instanceof Person) { + $centers = $this->helper->getReachableCenters($token->getUser(), new Role($attribute)); + + return \in_array($subject->getCenter(), $centers); + } + + /* @var $subject Activity */ return $this->helper->userHasAccess($token->getUser(), $subject, $attribute); } From 7b7d30797f391dff813de1ab923c83370b1c6046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 21 Aug 2018 14:05:25 +0200 Subject: [PATCH 145/163] fix error when no access to activity in timeline query --- Timeline/TimelineActivityProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Timeline/TimelineActivityProvider.php b/Timeline/TimelineActivityProvider.php index b54fe34b0..a19a659e1 100644 --- a/Timeline/TimelineActivityProvider.php +++ b/Timeline/TimelineActivityProvider.php @@ -101,6 +101,10 @@ class TimelineActivityProvider implements TimelineProviderInterface $role); $associationMapping = $metadataActivity->getAssociationMapping('person'); + if (count($reachableCenters) === 0) { + return 'FALSE = TRUE'; + } + // we start with activities having the person_id linked to person // (currently only context "person" is supported) $whereClause = sprintf('%s = %d', From 6e8f72f5cca15034846fe294b74712a25532f900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 29 Aug 2018 23:18:37 +0200 Subject: [PATCH 146/163] fix error in user loading and validate scope/user consistency --- Controller/ActivityController.php | 7 ++--- Entity/Activity.php | 6 +++++ Form/ActivityType.php | 36 +++++++++++++------------ Resources/translations/messages.fr.yml | 1 + Resources/views/Activity/show.html.twig | 2 +- 5 files changed, 31 insertions(+), 21 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 9a24cb503..a312bd480 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -295,18 +295,19 @@ class ActivityController extends Controller $this->get('translator') ->trans('Success : activity updated!') ); -//die(); + return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $id, 'person_id' => $person_id))); } $this->get('session') ->getFlashBag() - ->add('danger', + ->add('error', $this->get('translator') - ->trans('The form is not valid. The activity has not been updated !') + ->trans('This form contains errors') ); return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( + 'person' => $entity->getPerson(), 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), diff --git a/Entity/Activity.php b/Entity/Activity.php index 954ae7e34..637438f85 100644 --- a/Entity/Activity.php +++ b/Entity/Activity.php @@ -28,9 +28,15 @@ use Chill\PersonBundle\Entity\Person; use Chill\MainBundle\Entity\HasCenterInterface; use Chill\MainBundle\Entity\HasScopeInterface; use Doctrine\Common\Collections\ArrayCollection; +use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency; /** * Activity + * @UserCircleConsistency( + * "CHILL_ACTIVITY_SEE_DETAILS", + * getUserFunction="getUser", + * path="scope" + * ) */ class Activity implements HasCenterInterface, HasScopeInterface { diff --git a/Form/ActivityType.php b/Form/ActivityType.php index 30f5d2e88..fd4514b56 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -5,7 +5,6 @@ namespace Chill\ActivityBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use Chill\MainBundle\Form\Type\AppendScopeChoiceTypeTrait; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Doctrine\Common\Persistence\ObjectManager; use Chill\MainBundle\Templating\TranslatableStringHelper; @@ -16,16 +15,15 @@ use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; -use Symfony\Component\Form\Extension\Core\Type\DateTimeType; -use Symfony\Component\Form\Extension\Core\Type\DateType; use Chill\ActivityBundle\Form\Type\TranslatableActivityType; use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; +use Chill\MainBundle\Form\Type\UserPickerType; +use Chill\MainBundle\Form\Type\ScopePickerType; +use Chill\MainBundle\Form\Type\ChillDateType; class ActivityType extends AbstractType { - use AppendScopeChoiceTypeTrait; - /** * the user running this form * @@ -91,11 +89,9 @@ class ActivityType extends AbstractType ); $builder - ->add('date', DateType::class, array( - 'required' => true, - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy') - ) + ->add('date', ChillDateType::class, array( + 'required' => true + )) ->add('durationTime', ChoiceType::class, $durationTimeOptions) ->add('remark', TextareaType::class, array( 'required' => false, @@ -110,8 +106,14 @@ class ActivityType extends AbstractType 'not present' => false ) )) - ->add('user') - ->add('scope') + ->add('user', UserPickerType::class, [ + 'center' => $options['center'], + 'role' => $options['role'] + ]) + ->add('scope', ScopePickerType::class, [ + 'center' => $options['center'], + 'role' => $options['role'] + ]) ->add('reasons', TranslatableActivityReason::class, array( 'multiple' => true, 'required' => false @@ -122,10 +124,6 @@ class ActivityType extends AbstractType )) ; - $this->appendScopeChoices($builder, $options['role'], - $options['center'], $this->user, $this->authorizationHelper, - $this->translatableStringHelper, $this->om); - $builder->get('durationTime') ->addModelTransformer($durationTimeTransformer); @@ -181,7 +179,11 @@ class ActivityType extends AbstractType 'data_class' => 'Chill\ActivityBundle\Entity\Activity' )); - $this->appendScopeChoicesOptions($resolver); + $resolver + ->setRequired(array('center', 'role')) + ->setAllowedTypes('center', 'Chill\MainBundle\Entity\Center') + ->setAllowedTypes('role', 'Symfony\Component\Security\Core\Role\Role') + ; } /** diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 1546320c5..63620fb49 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -12,6 +12,7 @@ list_reasons: liste des sujets user_username: nom de l'utilisateur circle_name: nom du cercle Remark: Notes +No remarks: Aucune note Add a new activity: Ajouter une nouvelle activité Activity list: Liste des activités present: présent diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 5f3b00b9f..8a9bb3afc 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -26,7 +26,7 @@
                                            {{ 'Type'|trans }}
                                            {{ entity.type.name | localize_translatable_string }}
                                            {{ 'Remark'|trans }}
                                            -
                                            {% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}
                                            {{ entity.remark|nl2br }}
                                            {% endif %}
                                            +
                                            {% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}
                                            {{ entity.remark|nl2br }}
                                            {% endif %}
                                            {{ 'Attendee'|trans }}
                                            {% if entity.attendee is not null %}{% if entity.attendee %}{{ 'present'|trans|capitalize }} {% else %} {{ 'not present'|trans|capitalize }}{% endif %}{% else %}{{ 'None'|trans|capitalize }}{% endif %}
                                            From 2fe2d130a049b630f561477168b090ea2e7e744a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 10 Sep 2018 10:44:40 +0200 Subject: [PATCH 147/163] deploy on every change to packagist --- .gitlab-ci.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af5c0b5d1..f3c009a96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,27 +10,20 @@ - php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction stages: - - test - deploy + - test - build-doc - deploy-doc -test:php-7: +test:php-7.2: stage: test - image: chill/ci-image:php-7 + image: chill/ci-image:php-7.2 <<: *test_definition script: php vendor/bin/phpunit -test:php-7.1: - stage: test - image: chill/ci-image:php-7.1 - <<: *test_definition - script: php vendor/bin/phpunit - - deploy-packagist: stage: deploy - image: chill/ci-image:php-7 + image: chill/ci-image:php-7.2 before_script: # test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set - if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi @@ -43,7 +36,7 @@ deploy-packagist: api-doc-build: stage: build-doc environment: api-doc - image: chill/ci-image:php-7 + image: chill/ci-image:php-7.2 before_script: - mkdir api-doc script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME From 8503628d9620682b4b3a20498e1f8de9b4018414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 10 Sep 2018 11:26:18 +0200 Subject: [PATCH 148/163] set deps to stable branches --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ef19e8061..043c685af 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,8 @@ } ], "require": { - "chill-project/main": "dev-upgrade-sf3@dev", - "chill-project/person": "dev-upgrade-sf3@dev" + "chill-project/main": "~1.5", + "chill-project/person": "~1.5" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "~3", From efe27bf1008a0446d3ae3c3ad2afe69e51428920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 12 Sep 2018 10:54:00 +0200 Subject: [PATCH 149/163] [activity report count] do not count activities from centers not selected --- CHANGELOG.md | 6 ++++++ Export/Export/CountActivity.php | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..aa01db268 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ + +Master branch +============= + +- [report activity count] fix error: do not show centers which are not selected in results. + diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index cdab3dd74..00f741fce 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -69,6 +69,7 @@ class CountActivity implements ExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = array()) { $qb = $this->entityManager->createQueryBuilder(); + $centers = array_map(function($el) { return $el['center']; }, $acl); $qb->select('COUNT(activity.id) as export_count_activity') ->from('ChillActivityBundle:Activity', 'activity') @@ -78,6 +79,10 @@ class CountActivity implements ExportInterface $qb->join('activity.person', 'person'); } + $qb->where($qb->expr()->in('person.center', ':centers')) + ->setParameter('centers', $centers) + ; + return $qb; } From 4163f7a6fb9480c9e4c03d91f330b7ee6b67e8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 12 Sep 2018 10:56:17 +0200 Subject: [PATCH 150/163] switch changelog to 1.5.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa01db268..88a7e4351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -Master branch +Version 1.5.1 ============= - [report activity count] fix error: do not show centers which are not selected in results. From fad1821c2f34b007a29a45d52722ed69f48b22e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 5 Oct 2018 11:01:00 +0200 Subject: [PATCH 151/163] fix translation in exports / aggregator. The activity type aggregator is shown. --- CHANGELOG.md | 6 +++++ Export/Aggregator/ActivityTypeAggregator.php | 26 -------------------- Export/Export/CountActivity.php | 4 +-- Resources/translations/messages.fr.yml | 5 +++- 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a7e4351..1da0df3a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,9 @@ Version 1.5.1 - [report activity count] fix error: do not show centers which are not selected in results. +Master branch +============= + +- [aggregate by activity type] fix translation in aggregate activity type +- fix some translation in export +- fix error when persons not loaded by other aggregators / filters diff --git a/Export/Aggregator/ActivityTypeAggregator.php b/Export/Aggregator/ActivityTypeAggregator.php index 544ae98ac..3dec544ba 100644 --- a/Export/Aggregator/ActivityTypeAggregator.php +++ b/Export/Aggregator/ActivityTypeAggregator.php @@ -63,32 +63,6 @@ class ActivityTypeAggregator implements AggregatorInterface // add select element $qb->addSelect(sprintf('IDENTITY(activity.type) AS %s', self::KEY)); - // make a jointure only if needed - /*$join = $qb->getDQLPart('join'); - if ( - (array_key_exists('activity', $join) - && - !$this->checkJoinAlreadyDefined($join['activity'], 'reasons') - ) - OR - (! array_key_exists('activity', $join)) - ) { - $qb->add( - 'join', - array('activity' => - new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons') - ), - true); - } - - // join category if necessary - if ($alias === 'activity_categories_id') { - // add join only if needed - if (!$this->checkJoinAlreadyDefined($qb->getDQLPart('join')['activity'], 'category')) { - $qb->join('reasons.category', 'category'); - } - }*/ - // add the "group by" part $groupBy = $qb->addGroupBy(self::KEY); } diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index 00f741fce..97a837520 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -75,9 +75,7 @@ class CountActivity implements ExportInterface ->from('ChillActivityBundle:Activity', 'activity') ; - if (in_array('person', $requiredModifiers)) { - $qb->join('activity.person', 'person'); - } + $qb->join('activity.person', 'person'); $qb->where($qb->expr()->in('person.center', ':centers')) ->setParameter('centers', $centers) diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 63620fb49..55e367d32 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -114,6 +114,7 @@ Count activities by various parameters.: Compte le nombre d'activités enregistr Sum activity duration: Total de la durée des activités Sum activities duration by various parameters.: Additionne la durée des activités en fonction de différents paramètres. List activities: Liste les activités +Number of activities: Nombre d'activités #filters Filter by reason: Filtrer par sujet d'activité @@ -137,5 +138,7 @@ Aggregate by activity reason: Aggréger par sujet de l'activité By reason: Par sujet By category of reason: Par catégorie de sujet Reason's level: Niveau du sujet -Aggregate by activity type: Aggréger par date d'activité +Aggregate by activity type: Aggréger par type d'activité +Activity type: Type d'activité +Group by reasons: Sujet d'activité From 5959edb01a4fa406fbda683340bc580d3e867d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 5 Oct 2018 11:21:45 +0200 Subject: [PATCH 152/163] [export] add filter "filter activity by activity type" --- CHANGELOG.md | 2 + Export/Filter/ActivityTypeFilter.php | 148 +++++++++++++++++++++++++ Resources/config/services/export.yml | 8 ++ Resources/translations/messages.fr.yml | 3 +- 4 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 Export/Filter/ActivityTypeFilter.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da0df3a3..16ac704c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,3 +10,5 @@ Master branch - [aggregate by activity type] fix translation in aggregate activity type - fix some translation in export - fix error when persons not loaded by other aggregators / filters +- add "filter by activity type" filter + diff --git a/Export/Filter/ActivityTypeFilter.php b/Export/Filter/ActivityTypeFilter.php new file mode 100644 index 000000000..b3616da10 --- /dev/null +++ b/Export/Filter/ActivityTypeFilter.php @@ -0,0 +1,148 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Export\Filter; + +use Chill\MainBundle\Export\FilterInterface; +use Doctrine\ORM\QueryBuilder; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Doctrine\ORM\Query\Expr; +use Symfony\Component\Security\Core\Role\Role; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; +use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\Query\Expr\Join; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Chill\MainBundle\Export\ExportElementValidatedInterface; +use Chill\ActivityBundle\Entity\ActivityType; + +/** + * + * + */ +class ActivityTypeFilter implements FilterInterface, + ExportElementValidatedInterface +{ + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + /** + * The repository for activity reasons + * + * @var EntityRepository + */ + protected $typeRepository; + + public function __construct( + TranslatableStringHelper $helper, + EntityRepository $typeRepository + ) { + $this->translatableStringHelper = $helper; + $this->typeRepository = $typeRepository; + } + + + public function alterQuery(QueryBuilder $qb, $data) + { + $where = $qb->getDQLPart('where'); + $clause = $qb->expr()->in('activity.type', ':selected_activity_types'); + + if ($where instanceof Expr\Andx) { + $where->add($clause); + } else { + $where = $qb->expr()->andX($clause); + } + + $qb->add('where', $where); + $qb->setParameter('selected_activity_types', $data['types']); + } + + /** + * Check if a join between Activity and Reason is already defined + * + * @param Join[] $joins + * @return boolean + */ + private function checkJoinAlreadyDefined(array $joins, $alias) + { + foreach ($joins as $join) { + if ($join->getAlias() === $alias) { + return true; + } + } + + return false; + } + + public function applyOn() + { + return 'activity'; + } + + public function buildForm(FormBuilderInterface $builder) + { + //create a local copy of translatableStringHelper + $helper = $this->translatableStringHelper; + + $builder->add('types', EntityType::class, array( + 'class' => ActivityType::class, + 'choice_label' => function (ActivityType $type) use ($helper) { + return $helper->localize($type->getName()); + }, + 'multiple' => true, + 'expanded' => false + )); + } + + public function validateForm($data, ExecutionContextInterface $context) + { + if ($data['types'] === null || count($data['types']) === 0) { + $context->buildViolation("At least one type must be choosen") + ->addViolation(); + } + } + + public function getTitle() + { + return 'Filter by activity type'; + } + + public function addRole() + { + return new Role(ActivityStatsVoter::STATS); + } + + public function describeAction($data, $format = 'string') + { + // collect all the reasons'name used in this filter in one array + $reasonsNames = array_map( + function(ActivityType $t) { + return "\"".$this->translatableStringHelper->localize($t->getName())."\""; + }, + $this->typeRepository->findBy(array('id' => $data['types']->toArray())) + ); + + return array("Filtered by activity type: only %list%", + ["%list%" => implode(", ", $reasonsNames)]); + } +} diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml index cb6ff5f52..61d5cc18b 100644 --- a/Resources/config/services/export.yml +++ b/Resources/config/services/export.yml @@ -31,6 +31,14 @@ services: tags: - { name: chill.export_filter, alias: 'activity_reason_filter' } + chill.activity.export.type_filter: + class: Chill\ActivityBundle\Export\Filter\ActivityTypeFilter + arguments: + - "@chill.main.helper.translatable_string" + - "@chill_activity.repository.activity_type" + tags: + - { name: chill.export_filter, alias: 'activity_type_filter' } + chill.activity.export.date_filter: class: Chill\ActivityBundle\Export\Filter\ActivityDateFilter arguments: diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 55e367d32..edbaa0967 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -119,7 +119,7 @@ Number of activities: Nombre d'activités #filters Filter by reason: Filtrer par sujet d'activité 'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%' - +'Filtered by activity type: only %list%': "Filtré par type d'activity: seulement %list%" Filtered by date activity: Filtrer par date d'activité Activities after this date: Activités après cette date Activities before this date: Activités avant cette date @@ -132,6 +132,7 @@ Implied in an activity before this date: Impliqué dans une activité avant cett Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par personnes associées à une activité entre %date_from% et %date_to% avec les sujets %reasons_name% Activity reasons for those activities: Sujets de ces activités +Filter by activity type: Filtrer par type d'activité #aggregators Aggregate by activity reason: Aggréger par sujet de l'activité From 8847d315641e02f3079e6fd02986e244acf7cf18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 5 Oct 2018 11:22:58 +0200 Subject: [PATCH 153/163] prepare for release 1.5.2 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16ac704c9..fdbf9e6d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Version 1.5.1 - [report activity count] fix error: do not show centers which are not selected in results. -Master branch +Version 1.5.2 ============= - [aggregate by activity type] fix translation in aggregate activity type From 13333ed54a8c4f3665459db2de5e1c1fe17df820 Mon Sep 17 00:00:00 2001 From: Mat Date: Tue, 16 Oct 2018 10:02:26 +0200 Subject: [PATCH 154/163] privacyEvent, add event to activity list and show actions --- Controller/ActivityController.php | 37 +++++++++++++++++-- .../ChillActivityExtension.php | 1 + Resources/config/services/controller.yml | 5 +++ 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 Resources/config/services/controller.yml diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index a312bd480..80007f415 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -22,6 +22,8 @@ namespace Chill\ActivityBundle\Controller; +use Chill\PersonBundle\Privacy\PrivacyEvent; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Form\Extension\Core\Type\SubmitType; @@ -37,7 +39,22 @@ use Chill\ActivityBundle\Form\ActivityType; */ class ActivityController extends Controller { - + + /** + * @var EventDispatcherInterface + */ + protected $eventDispatcher; + + /** + * ActivityController constructor. + * + * @param EventDispatcherInterface $eventDispatcher + */ + public function __construct(EventDispatcherInterface $eventDispatcher) + { + $this->eventDispatcher = $eventDispatcher; + } + /** * Lists all Activity entities. * @@ -62,8 +79,13 @@ class ActivityController extends Controller array('person' => $person, 'scope' => $reachableScopes), array('date' => 'DESC') ); - - + + $event = new PrivacyEvent($person, array( + 'element_class' => Activity::class, + 'action' => 'list' + )); + $this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event); + return $this->render('ChillActivityBundle:Activity:list.html.twig', array( 'activities' => $activities, 'person' => $person @@ -201,7 +223,14 @@ class ActivityController extends Controller $this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity); $deleteForm = $this->createDeleteForm($id, $person); - + + $event = new PrivacyEvent($person, array( + 'element_class' => Activity::class, + 'element_id' => intval($id), + 'action' => 'show' + )); + $this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event); + return $this->render('ChillActivityBundle:Activity:show.html.twig', array( 'person' => $person, 'entity' => $entity, diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index ab0059155..0a5144a17 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -53,6 +53,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader->load('services/repositories.yml'); $loader->load('services/fixtures.yml'); $loader->load('services/menu.yml'); + $loader->load('services/controller.yml'); } public function prepend(ContainerBuilder $container) diff --git a/Resources/config/services/controller.yml b/Resources/config/services/controller.yml new file mode 100644 index 000000000..075c52679 --- /dev/null +++ b/Resources/config/services/controller.yml @@ -0,0 +1,5 @@ +services: + Chill\ActivityBundle\Controller\ActivityController: + arguments: + $eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface' + tags: ['controller.service_arguments'] From b6ab04f3e31fa6a2e09fd4639507f8c22f0c5dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 19 Oct 2018 12:36:59 +0200 Subject: [PATCH 155/163] add privacy event to edit, update actions --- Controller/ActivityController.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 80007f415..54f50c4af 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -28,7 +28,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Security\Core\Role\Role; - use Chill\ActivityBundle\Entity\Activity; use Chill\PersonBundle\Entity\Person; use Chill\ActivityBundle\Form\ActivityType; @@ -226,7 +225,7 @@ class ActivityController extends Controller $event = new PrivacyEvent($person, array( 'element_class' => Activity::class, - 'element_id' => intval($id), + 'element_id' => $entity->getId(), 'action' => 'show' )); $this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event); @@ -263,6 +262,13 @@ class ActivityController extends Controller $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id, $person); + + $event = new PrivacyEvent($person, array( + 'element_class' => Activity::class, + 'element_id' => $entity->getId(), + 'action' => 'show' + )); + $this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event); return $this->render('ChillActivityBundle:Activity:edit.html.twig', array( 'entity' => $entity, @@ -314,6 +320,13 @@ class ActivityController extends Controller $deleteForm = $this->createDeleteForm($id, $person); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); + + $event = new PrivacyEvent($person, array( + 'element_class' => Activity::class, + 'element_id' => $entity->getId(), + 'action' => 'update' + )); + $this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event); if ($editForm->isValid()) { $em->flush(); From 5eff3f33d8c7efce731430b2d164e5475c44fb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 19 Oct 2018 12:40:12 +0200 Subject: [PATCH 156/163] fix action description in privacy events logs --- Controller/ActivityController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/ActivityController.php b/Controller/ActivityController.php index 54f50c4af..8e6c25e76 100644 --- a/Controller/ActivityController.php +++ b/Controller/ActivityController.php @@ -266,7 +266,7 @@ class ActivityController extends Controller $event = new PrivacyEvent($person, array( 'element_class' => Activity::class, 'element_id' => $entity->getId(), - 'action' => 'show' + 'action' => 'edit' )); $this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event); From adee1b67a2e471af25074ec86c3413fc831424d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 19 Oct 2018 12:42:28 +0200 Subject: [PATCH 157/163] add changelog for privacy events --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a7e4351..a556edeba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,8 @@ Version 1.5.1 - [report activity count] fix error: do not show centers which are not selected in results. +Branch privacyEvent +================== + +- add privacy events to activity list / show / edit + From 3e786f2e187b7010d6adea2c4e6c11c106def5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 11 Jan 2019 12:30:57 +0100 Subject: [PATCH 158/163] Add aggregator by user for activities --- Export/Aggregator/ActivityUserAggregator.php | 99 +++++++++++++++++++ Resources/config/services/export.yml | 7 ++ Resources/translations/messages.fr.yml | 6 +- .../Aggregator/ActivityUserAggregatorTest.php | 91 +++++++++++++++++ 4 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 Export/Aggregator/ActivityUserAggregator.php create mode 100644 Tests/Export/Aggregator/ActivityUserAggregatorTest.php diff --git a/Export/Aggregator/ActivityUserAggregator.php b/Export/Aggregator/ActivityUserAggregator.php new file mode 100644 index 000000000..ca01e0ae5 --- /dev/null +++ b/Export/Aggregator/ActivityUserAggregator.php @@ -0,0 +1,99 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\ActivityBundle\Export\Aggregator; + +use Symfony\Component\Form\FormBuilderInterface; +use Doctrine\ORM\QueryBuilder; +use Chill\MainBundle\Export\AggregatorInterface; +use Symfony\Component\Security\Core\Role\Role; +use Doctrine\ORM\Query\Expr\Join; +use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; +use Doctrine\ORM\EntityManagerInterface; +use Chill\MainBundle\Entity\User; + +/** + * + * + * @author Julien Fastré + */ +class ActivityUserAggregator implements AggregatorInterface +{ + /** + * + * @var EntityManagerInterface + */ + protected $em; + + const KEY = 'activity_user_id'; + + function __construct(EntityManagerInterface $em) + { + $this->em = $em; + } + + public function addRole() + { + return new Role(ActivityStatsVoter::STATS); + } + + public function alterQuery(QueryBuilder $qb, $data) + { + // add select element + $qb->addSelect(sprintf('IDENTITY(activity.user) AS %s', self::KEY)); + + // add the "group by" part + $qb->addGroupBy(self::KEY); + } + + public function applyOn(): string + { + return 'activity'; + } + + public function buildForm(FormBuilderInterface $builder) + { + // nothing to add + } + + public function getLabels($key, $values, $data): \Closure + { + // preload users at once + $this->em->getRepository(User::class) + ->findBy(['id' => $values]); + + return function($value) { + switch ($value) { + case '_header': + return 'activity user'; + default: + return $this->em->getRepository(User::class)->find($value) + ->getUsername(); + } + }; + } + + public function getQueryKeys($data) + { + return [ self::KEY ]; + } + + public function getTitle(): string + { + return "Aggregate by activity user"; + } +} diff --git a/Resources/config/services/export.yml b/Resources/config/services/export.yml index cb6ff5f52..8fdb98bbf 100644 --- a/Resources/config/services/export.yml +++ b/Resources/config/services/export.yml @@ -65,3 +65,10 @@ services: - "@chill.main.helper.translatable_string" tags: - { name: chill.export_aggregator, alias: activity_type_aggregator } + + chill.activity.export.user_aggregator: + class: Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator + arguments: + $em: "@doctrine.orm.entity_manager" + tags: + - { name: chill.export_aggregator, alias: activity_user_aggregator } diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 63620fb49..b4bc1ad05 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -138,4 +138,8 @@ By reason: Par sujet By category of reason: Par catégorie de sujet Reason's level: Niveau du sujet Aggregate by activity type: Aggréger par date d'activité - +Aggregate by activity type: Aggréger par type d'activité +Activity type: Type d'activité +Group by reasons: Sujet d'activité +Activity user: Utilisateur lié à l'activity +Aggregate by activity user: Aggréger par utilisateur lié à l'activité diff --git a/Tests/Export/Aggregator/ActivityUserAggregatorTest.php b/Tests/Export/Aggregator/ActivityUserAggregatorTest.php new file mode 100644 index 000000000..45f974a56 --- /dev/null +++ b/Tests/Export/Aggregator/ActivityUserAggregatorTest.php @@ -0,0 +1,91 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\ActivityBundle\Tests\Aggregator; + +use Chill\MainBundle\Test\Export\AbstractAggregatorTest; + +/** + * Add tests for ActivityUsernAggregator + * + */ +class ActivityUserAggregatorTest extends AbstractAggregatorTest +{ + /** + * + * @var \Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator + */ + private $aggregator; + + public function setUp() + { + static::bootKernel(); + + $container = static::$kernel->getContainer(); + + $this->aggregator = $container->get('chill.activity.export.user_aggregator'); + + // add a fake request with a default locale (used in translatable string) + $prophet = new \Prophecy\Prophet; + $request = $prophet->prophesize(); + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $container->get('request_stack') + ->push($request->reveal()); + } + + public function getAggregator() + { + return $this->aggregator; + } + + public function getFormData() + { + return array( + array() + ); + } + + public function getQueryBuilders() + { + if (static::$kernel === null) { + static::bootKernel(); + } + + $em = static::$kernel->getContainer() + ->get('doctrine.orm.entity_manager'); + + return array( + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons'), + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.reasons', 'reasons') + ->join('reasons.category', 'category') + ); + } + +} From 4c7673f3fdeed86b89506da65c0e6f4a1f54a43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 11 Jan 2019 12:33:05 +0100 Subject: [PATCH 159/163] fix bug when extracting activities without filter / aggregators introducing persons --- CHANGELOG.md | 6 ++++++ Export/Export/CountActivity.php | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a7e4351..4bbf3ff45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,9 @@ Version 1.5.1 - [report activity count] fix error: do not show centers which are not selected in results. +`master branch` +============== + +- [report activity]: add aggregator for activity users +- fix bug: error when extracting activities without filter / aggregators selecting persons + diff --git a/Export/Export/CountActivity.php b/Export/Export/CountActivity.php index 00f741fce..3498d7a13 100644 --- a/Export/Export/CountActivity.php +++ b/Export/Export/CountActivity.php @@ -73,12 +73,9 @@ class CountActivity implements ExportInterface $qb->select('COUNT(activity.id) as export_count_activity') ->from('ChillActivityBundle:Activity', 'activity') + ->join('activity.person', 'person') ; - if (in_array('person', $requiredModifiers)) { - $qb->join('activity.person', 'person'); - } - $qb->where($qb->expr()->in('person.center', ':centers')) ->setParameter('centers', $centers) ; From 544466d504e637adfce83973e932436ec9b9016e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 11 Jan 2019 16:52:21 +0100 Subject: [PATCH 160/163] switch to 1.5.4 --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0314f711..c2b13f38d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,8 @@ Version 1.5.3 - add privacy events to activity list / show / edit -`master branch` -=============== +Version 1.5.4 +============= - [report activity]: add aggregator for activity users - fix bug: error when extracting activities without filter / aggregators selecting persons From a9349becf73f4d3634ddaff84ca89e3e6171207a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 21 Apr 2020 14:41:40 +0200 Subject: [PATCH 161/163] replace dropdown for selecting reasons and use chillEntity for reason rendering --- CHANGELOG.md | 4 + .../ChillActivityExtension.php | 2 + Form/ActivityType.php | 2 +- Form/Type/TranslatableActivityReason.php | 40 ++++++--- Resources/config/services.yml | 35 +------- Resources/config/services/form.yml | 35 ++++++++ Resources/config/services/templating.yml | 7 ++ Resources/public/activity/activity.scss | 10 +++ Resources/public/index.js | 1 + Resources/views/Activity/list.html.twig | 9 +- Resources/views/Activity/show.html.twig | 2 +- .../activity_person_context.html.twig | 2 +- Templating/Entity/ActivityReasonRender.php | 86 +++++++++++++++++++ chill.webpack.config.js | 4 + 14 files changed, 186 insertions(+), 53 deletions(-) create mode 100644 Resources/config/services/form.yml create mode 100644 Resources/config/services/templating.yml create mode 100644 Resources/public/activity/activity.scss create mode 100644 Resources/public/index.js create mode 100644 Templating/Entity/ActivityReasonRender.php create mode 100644 chill.webpack.config.js diff --git a/CHANGELOG.md b/CHANGELOG.md index c2b13f38d..37519663c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,3 +23,7 @@ Version 1.5.4 - [report activity]: add aggregator for activity users - fix bug: error when extracting activities without filter / aggregators selecting persons +Master branch +============ + +- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php index 0a5144a17..1bc1c4bb9 100644 --- a/DependencyInjection/ChillActivityExtension.php +++ b/DependencyInjection/ChillActivityExtension.php @@ -54,6 +54,8 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader->load('services/fixtures.yml'); $loader->load('services/menu.yml'); $loader->load('services/controller.yml'); + $loader->load('services/form.yml'); + $loader->load('services/templating.yml'); } public function prepend(ContainerBuilder $container) diff --git a/Form/ActivityType.php b/Form/ActivityType.php index fd4514b56..407ceaa70 100644 --- a/Form/ActivityType.php +++ b/Form/ActivityType.php @@ -116,7 +116,7 @@ class ActivityType extends AbstractType ]) ->add('reasons', TranslatableActivityReason::class, array( 'multiple' => true, - 'required' => false + 'required' => false, )) ->add('type', TranslatableActivityType::class, array( 'placeholder' => 'Choose a type', diff --git a/Form/Type/TranslatableActivityReason.php b/Form/Type/TranslatableActivityReason.php index af8a7dcd1..8043f95ba 100644 --- a/Form/Type/TranslatableActivityReason.php +++ b/Form/Type/TranslatableActivityReason.php @@ -3,7 +3,7 @@ /* * Chill is a software for social workers * - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, + * Copyright (C) 2014-2020, Champs Libres Cooperative SCRLFS, * , * * This program is free software: you can redistribute it and/or modify @@ -27,20 +27,34 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\EntityRepository; +use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\ActivityBundle\Templating\Entity\ActivityReasonRender; /** - * Description of TranslatableActivityReason - * - * @author Champs-Libres Coop + * FormType to choose amongst activity reasons + * */ class TranslatableActivityReason extends AbstractType { - private $translatableStringHelper; + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + /** + * + * @var ActivityReasonRender + */ + protected $reasonRender; - public function __construct(TranslatableStringHelper $translatableStringHelper) - { + public function __construct( + TranslatableStringHelper $translatableStringHelper, + ActivityReasonRender $reasonRender + ) { $this->translatableStringHelper = $translatableStringHelper; + $this->reasonRender = $reasonRender; } public function getBlockPrefix() @@ -55,20 +69,20 @@ class TranslatableActivityReason extends AbstractType public function configureOptions(OptionsResolver $resolver) { - $helper = $this->translatableStringHelper; $resolver->setDefaults( array( 'class' => 'ChillActivityBundle:ActivityReason', - 'choice_label' => function($choice, $key) use ($helper) { - return $helper->localize($choice->getName()); + 'choice_label' => function(ActivityReason $choice) { + return $this->reasonRender->renderString($choice, []); }, - 'group_by' => function($choice, $key) use ($helper) { - return $helper->localize($choice->getCategory()->getName()); + 'group_by' => function(ActivityReason $choice) { + return $this->translatableStringHelper->localize($choice->getCategory()->getName()); }, 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('r') ->where('r.active = true'); - } + }, + 'attr' => [ 'class' => ' select2 '] ) ); } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 3df2ececf..fc3b65faf 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,37 +1,4 @@ -services: - chill.activity.form.type.translatableactivityreasoncategory: - class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory - arguments: - - "@request_stack" - tags: - - { name: form.type, alias: translatable_activity_reason_category } - - chill.activity.form.type.translatableactivityreason: - class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason - arguments: - - "@chill.main.helper.translatable_string" - tags: - - { name: form.type, alias: translatable_activity_reason } - - chill.activity.form.type.translatableactivitytype: - class: Chill\ActivityBundle\Form\Type\TranslatableActivityType - arguments: - - "@chill.main.helper.translatable_string" - - "@chill_activity.repository.activity_type" - tags: - - { name: form.type, alias: translatable_activity_type } - - chill.activity.form.type.activity: - class: Chill\ActivityBundle\Form\ActivityType - arguments: - - "@security.token_storage" - - "@chill.main.security.authorization.helper" - - "@doctrine.orm.entity_manager" - - "@chill.main.helper.translatable_string" - - "%chill_activity.form.time_duration%" - tags: - - { name: form.type, alias: chill_activitybundle_activity } - +services: chill.activity.security.authorization.activity_voter: class: Chill\ActivityBundle\Security\Authorization\ActivityVoter arguments: diff --git a/Resources/config/services/form.yml b/Resources/config/services/form.yml new file mode 100644 index 000000000..e9f81c14e --- /dev/null +++ b/Resources/config/services/form.yml @@ -0,0 +1,35 @@ +--- +services: + chill.activity.form.type.translatableactivityreasoncategory: + class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory + arguments: + - "@request_stack" + tags: + - { name: form.type, alias: translatable_activity_reason_category } + + chill.activity.form.type.translatableactivityreason: + class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason + arguments: + $translatableStringHelper: "@chill.main.helper.translatable_string" + $reasonRender: '@Chill\ActivityBundle\Templating\Entity\ActivityReasonRender' + tags: + - { name: form.type, alias: translatable_activity_reason } + + chill.activity.form.type.translatableactivitytype: + class: Chill\ActivityBundle\Form\Type\TranslatableActivityType + arguments: + - "@chill.main.helper.translatable_string" + - "@chill_activity.repository.activity_type" + tags: + - { name: form.type, alias: translatable_activity_type } + + chill.activity.form.type.activity: + class: Chill\ActivityBundle\Form\ActivityType + arguments: + - "@security.token_storage" + - "@chill.main.security.authorization.helper" + - "@doctrine.orm.entity_manager" + - "@chill.main.helper.translatable_string" + - "%chill_activity.form.time_duration%" + tags: + - { name: form.type, alias: chill_activitybundle_activity } diff --git a/Resources/config/services/templating.yml b/Resources/config/services/templating.yml new file mode 100644 index 000000000..e96f72211 --- /dev/null +++ b/Resources/config/services/templating.yml @@ -0,0 +1,7 @@ +--- +services: + Chill\ActivityBundle\Templating\Entity\ActivityReasonRender: + arguments: + $translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper' + tags: + - { name: 'chill.render_entity' } diff --git a/Resources/public/activity/activity.scss b/Resources/public/activity/activity.scss new file mode 100644 index 000000000..bef8788f8 --- /dev/null +++ b/Resources/public/activity/activity.scss @@ -0,0 +1,10 @@ +@import '~ChillMainSass/custom/config/colors'; +@import '~ChillMainSass/custom/mixins/entity'; + +.chill-entity.chill-entity__activity-reason { + @include entity($chill-pink, white); +} + +.activity { + color: $chill-green; +} diff --git a/Resources/public/index.js b/Resources/public/index.js new file mode 100644 index 000000000..74b2a8646 --- /dev/null +++ b/Resources/public/index.js @@ -0,0 +1 @@ +require('./activity/activity.scss'); diff --git a/Resources/views/Activity/list.html.twig b/Resources/views/Activity/list.html.twig index 4061d6469..061990614 100644 --- a/Resources/views/Activity/list.html.twig +++ b/Resources/views/Activity/list.html.twig @@ -16,8 +16,6 @@ #} {% extends "ChillPersonBundle::layout.html.twig" %} -{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %} - {% set activeRouteKey = 'chill_activity_activity_list' %} {% block title %}{{ 'Activity list' |trans }}{% endblock title %} @@ -47,10 +45,15 @@
                                            diff --git a/Resources/views/Activity/show.html.twig b/Resources/views/Activity/show.html.twig index 8a9bb3afc..e5bf0da51 100644 --- a/Resources/views/Activity/show.html.twig +++ b/Resources/views/Activity/show.html.twig @@ -35,7 +35,7 @@ {%- if entity.reasons is empty -%}
                                            {{ 'No reason associated'|trans }}
                                            {%- else -%} -
                                            {% for r in entity.reasons %}{{ m.reason(r) }} {% endfor %}
                                            +
                                            {% for r in entity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}
                                            {%- endif -%} diff --git a/Resources/views/Timeline/activity_person_context.html.twig b/Resources/views/Timeline/activity_person_context.html.twig index 6d08d5b14..0af6d456c 100644 --- a/Resources/views/Timeline/activity_person_context.html.twig +++ b/Resources/views/Timeline/activity_person_context.html.twig @@ -20,7 +20,7 @@ {%- if activity.reasons is empty -%}
                                            {{ 'No reason associated'|trans }}
                                            {%- else -%} -
                                            {% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %}
                                            +
                                            {% for r in activity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}
                                            {%- endif -%} diff --git a/Templating/Entity/ActivityReasonRender.php b/Templating/Entity/ActivityReasonRender.php new file mode 100644 index 000000000..f405621c5 --- /dev/null +++ b/Templating/Entity/ActivityReasonRender.php @@ -0,0 +1,86 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\ActivityBundle\Templating\Entity; + +use Chill\MainBundle\Templating\Entity\AbstractChillEntityRender; +use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\MainBundle\Templating\TranslatableStringHelper; + +/** + * Render activity reason + * + */ +class ActivityReasonRender extends AbstractChillEntityRender +{ + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) + { + $this->translatableStringHelper = $translatableStringHelper; + } + + + public function renderBox($entity, array $options): string + { + return + $this->getDefaultOpeningBox('activity-reason'). + ' '. + ''. + $this->translatableStringHelper->localize( + $entity->getCategory()->getName() + ). + ''. + ' > '. + ''. + $this->translatableStringHelper->localize( + $entity->getName() + ). + ''. + $this->getDefaultClosingBox() + ; + } + + /** + * + * @param ActivityReason $entity + * @param array $options + * @return string + */ + public function renderString($entity, array $options): string + { + return $this->translatableStringHelper->localize( + $entity->getCategory()->getName() + ). + ' > '. + $this->translatableStringHelper->localize( + $entity->getName() + ); + } + + public function supports($entity, array $options): bool + { + return $entity instanceof ActivityReason; + } +} diff --git a/chill.webpack.config.js b/chill.webpack.config.js new file mode 100644 index 000000000..724184f63 --- /dev/null +++ b/chill.webpack.config.js @@ -0,0 +1,4 @@ +// this file loads all assets from the Chill person bundle +module.exports = function(encore, entries) { + entries.push(__dirname + '/Resources/public/index.js'); +}; From b2b637b4dbd0de35ad4f3a433b0dee1a2b0a918f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 21 Apr 2020 14:43:34 +0200 Subject: [PATCH 162/163] update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37519663c..871ead4bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ Version 1.5.4 - [report activity]: add aggregator for activity users - fix bug: error when extracting activities without filter / aggregators selecting persons -Master branch -============ +Version 1.5.5 +============= - [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering From 64ace8efa436e5188d95ba77e0f6e5aec1b64b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 18 Mar 2021 12:46:39 +0100 Subject: [PATCH 163/163] Prepare for moving into monorepo --- .../Bundle/ChillActivityBundle/.gitignore | 0 .../Bundle/ChillActivityBundle/.gitlab-ci.yml | 0 .../Bundle/ChillActivityBundle/CHANGELOG.md | 0 .../ChillActivityBundle/ChillActivityBundle.php | 0 .../Controller}/ActivityController.php | 0 .../ActivityReasonCategoryController.php | 0 .../Controller}/ActivityReasonController.php | 0 .../Controller}/ActivityTypeController.php | 0 .../Controller}/AdminController.php | 0 .../DataFixtures}/ORM/LoadActivity.php | 0 .../DataFixtures}/ORM/LoadActivityReason.php | 0 .../ORM/LoadActivityReasonCategory.php | 0 .../DataFixtures}/ORM/LoadActivityType.php | 0 .../DataFixtures}/ORM/LoadActivitytACL.php | 0 .../DependencyInjection}/ChillActivityExtension.php | 0 .../DependencyInjection}/Configuration.php | 0 .../Bundle/ChillActivityBundle/Entity}/Activity.php | 0 .../ChillActivityBundle/Entity}/ActivityReason.php | 0 .../Entity}/ActivityReasonCategory.php | 0 .../ChillActivityBundle/Entity}/ActivityType.php | 0 .../Export}/Aggregator/ActivityReasonAggregator.php | 0 .../Export}/Aggregator/ActivityTypeAggregator.php | 0 .../Export}/Aggregator/ActivityUserAggregator.php | 0 .../Export}/Export/CountActivity.php | 0 .../Export}/Export/ListActivity.php | 0 .../Export}/Export/StatActivityDuration.php | 0 .../Export}/Filter/ActivityDateFilter.php | 0 .../Export}/Filter/ActivityReasonFilter.php | 0 .../Export}/Filter/ActivityTypeFilter.php | 0 .../PersonHavingActivityBetweenDateFilter.php | 0 .../Form}/ActivityReasonCategoryType.php | 0 .../Form}/ActivityReasonType.php | 0 .../ChillActivityBundle/Form}/ActivityType.php | 0 .../ChillActivityBundle/Form}/ActivityTypeType.php | 0 .../Form}/Type/TranslatableActivityReason.php | 0 .../Type/TranslatableActivityReasonCategory.php | 0 .../Form}/Type/TranslatableActivityType.php | 0 LICENSE => src/Bundle/ChillActivityBundle/LICENSE | 0 .../ChillActivityBundle/Menu}/MenuBuilder.php | 0 .../ChillActivityBundle/Menu}/PersonMenuBuilder.php | 0 .../Bundle/ChillActivityBundle/README.md | 0 .../Resources}/config/doctrine/Activity.orm.yml | 0 .../config/doctrine/ActivityReason.orm.yml | 0 .../config/doctrine/ActivityReasonCategory.orm.yml | 0 .../Resources}/config/doctrine/ActivityType.orm.yml | 0 .../Resources}/config/routing.yml | 0 .../Resources}/config/routing/activity.yml | 0 .../Resources}/config/routing/activityreason.yml | 0 .../config/routing/activityreasoncategory.yml | 0 .../Resources}/config/routing/activitytype.yml | 0 .../Resources}/config/services.yml | 0 .../Resources}/config/services/controller.yml | 0 .../Resources}/config/services/export.yml | 0 .../Resources}/config/services/fixtures.yml | 0 .../Resources}/config/services/form.yml | 0 .../Resources}/config/services/menu.yml | 0 .../Resources}/config/services/repositories.yml | 0 .../Resources}/config/services/templating.yml | 0 .../ChillActivityBundle/Resources}/doc/index.rst | 0 .../Resources}/migrations/Version20150701091248.php | 0 .../Resources}/migrations/Version20150702093317.php | 0 .../Resources}/migrations/Version20150704091347.php | 0 .../Resources}/migrations/Version20160222103457.php | 0 .../Resources}/migrations/Version20161114085659.php | 0 .../Resources}/public/activity/activity.scss | 0 .../ChillActivityBundle/Resources}/public/index.js | 0 .../Resources}/test/Fixtures/App/app/AppKernel.php | 0 .../Fixtures/App/app/DoctrineMigrations/.gitignore | 0 .../test/Fixtures/App/app/Resources/.DS_Store | Bin .../Resources}/test/Fixtures/App/app/autoload.php | 0 .../test/Fixtures/App/app/bootstrap.php.cache | 0 .../app/cache/dev/appDevDebugProjectContainer.php | 0 .../cache/dev/appDevDebugProjectContainer.php.meta | 0 .../app/cache/dev/appDevDebugProjectContainer.xml | 0 .../dev/appDevDebugProjectContainerCompiler.log | 0 .../test/Fixtures/App/app/cache/dev/classes.map | 0 .../test/Fixtures/App/app/config/config.yml | 0 .../test/Fixtures/App/app/config/config_dev.yml | 0 .../test/Fixtures/App/app/config/config_test.yml | 0 ..._customizable_entities_test_not_empty_config.yml | 0 .../App/app/config/parameters.gitlab-ci.yml | 0 .../Fixtures/App/app/config/parameters.travis.yml | 0 .../Fixtures/App/app/config/parameters.yml.dist | 0 .../test/Fixtures/App/app/config/routing.yml | 0 .../Resources}/test/Fixtures/App/app/console | 0 .../Resources}/test/Fixtures/App/web/app_dev.php | 0 .../Resources}/translations/messages.fr.yml | 0 .../Resources}/translations/validators.fr.yml | 0 .../views/Activity/confirm_delete.html.twig | 0 .../Resources}/views/Activity/edit.html.twig | 0 .../Resources}/views/Activity/list.html.twig | 0 .../Resources}/views/Activity/new.html.twig | 0 .../Resources}/views/Activity/show.html.twig | 0 .../Resources}/views/ActivityReason/edit.html.twig | 0 .../Resources}/views/ActivityReason/index.html.twig | 0 .../Resources}/views/ActivityReason/macro.html.twig | 0 .../Resources}/views/ActivityReason/new.html.twig | 0 .../Resources}/views/ActivityReason/show.html.twig | 0 .../views/ActivityReasonCategory/edit.html.twig | 0 .../views/ActivityReasonCategory/index.html.twig | 0 .../views/ActivityReasonCategory/new.html.twig | 0 .../views/ActivityReasonCategory/show.html.twig | 0 .../Resources}/views/ActivityType/edit.html.twig | 0 .../Resources}/views/ActivityType/index.html.twig | 0 .../Resources}/views/ActivityType/new.html.twig | 0 .../Resources}/views/ActivityType/show.html.twig | 0 .../views/Admin/layout_activity.html.twig | 0 .../Resources}/views/Admin/menu_activity.html.twig | 0 .../Timeline/activity_person_context.html.twig | 0 .../Security}/Authorization/ActivityStatsVoter.php | 0 .../Security}/Authorization/ActivityVoter.php | 0 .../Templating}/Entity/ActivityReasonRender.php | 0 .../Test}/PrepareActivityTrait.php | 0 .../Tests}/Controller/ActivityControllerTest.php | 0 .../ActivityReasonCategoryControllerTest.php | 0 .../Controller/ActivityReasonControllerTest.php | 0 .../Controller/ActivityTypeControllerTest.php | 0 .../Aggregator/ActivityReasonAggregatorTest.php | 0 .../Aggregator/ActivityTypeAggregatorTest.php | 0 .../Aggregator/ActivityUserAggregatorTest.php | 0 .../Tests}/Export/Export/CountActivityTest.php | 0 .../Tests}/Export/Export/ListActivityTest.php | 0 .../Export/Export/StatActivityDurationSumTest.php | 0 .../Export/Filter/ActivityReasonFilterTest.php | 0 .../PersonHavingActivityBetweenDateFilterTest.php | 0 .../Tests}/Form/ActivityTypeTest.php | 0 .../Form/Type/TranslatableActivityReasonTest.php | 0 .../Form/Type/TranslatableActivityTypeTest.php | 0 .../Security/Authorization/ActivityVoterTest.php | 0 .../Tests}/Timeline/TimelineProviderTest.php | 0 .../Timeline}/TimelineActivityProvider.php | 0 .../Bundle/ChillActivityBundle/apigen.neon | 0 .../ChillActivityBundle/chill.webpack.config.js | 0 .../Bundle/ChillActivityBundle/composer.json | 0 .../Bundle/ChillActivityBundle/phpunit.xml.dist | 0 135 files changed, 0 insertions(+), 0 deletions(-) rename .gitignore => src/Bundle/ChillActivityBundle/.gitignore (100%) rename .gitlab-ci.yml => src/Bundle/ChillActivityBundle/.gitlab-ci.yml (100%) rename CHANGELOG.md => src/Bundle/ChillActivityBundle/CHANGELOG.md (100%) rename ChillActivityBundle.php => src/Bundle/ChillActivityBundle/ChillActivityBundle.php (100%) rename {Controller => src/Bundle/ChillActivityBundle/Controller}/ActivityController.php (100%) rename {Controller => src/Bundle/ChillActivityBundle/Controller}/ActivityReasonCategoryController.php (100%) rename {Controller => src/Bundle/ChillActivityBundle/Controller}/ActivityReasonController.php (100%) rename {Controller => src/Bundle/ChillActivityBundle/Controller}/ActivityTypeController.php (100%) rename {Controller => src/Bundle/ChillActivityBundle/Controller}/AdminController.php (100%) rename {DataFixtures => src/Bundle/ChillActivityBundle/DataFixtures}/ORM/LoadActivity.php (100%) rename {DataFixtures => src/Bundle/ChillActivityBundle/DataFixtures}/ORM/LoadActivityReason.php (100%) rename {DataFixtures => src/Bundle/ChillActivityBundle/DataFixtures}/ORM/LoadActivityReasonCategory.php (100%) rename {DataFixtures => src/Bundle/ChillActivityBundle/DataFixtures}/ORM/LoadActivityType.php (100%) rename {DataFixtures => src/Bundle/ChillActivityBundle/DataFixtures}/ORM/LoadActivitytACL.php (100%) rename {DependencyInjection => src/Bundle/ChillActivityBundle/DependencyInjection}/ChillActivityExtension.php (100%) rename {DependencyInjection => src/Bundle/ChillActivityBundle/DependencyInjection}/Configuration.php (100%) rename {Entity => src/Bundle/ChillActivityBundle/Entity}/Activity.php (100%) rename {Entity => src/Bundle/ChillActivityBundle/Entity}/ActivityReason.php (100%) rename {Entity => src/Bundle/ChillActivityBundle/Entity}/ActivityReasonCategory.php (100%) rename {Entity => src/Bundle/ChillActivityBundle/Entity}/ActivityType.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Aggregator/ActivityReasonAggregator.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Aggregator/ActivityTypeAggregator.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Aggregator/ActivityUserAggregator.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Export/CountActivity.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Export/ListActivity.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Export/StatActivityDuration.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Filter/ActivityDateFilter.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Filter/ActivityReasonFilter.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Filter/ActivityTypeFilter.php (100%) rename {Export => src/Bundle/ChillActivityBundle/Export}/Filter/PersonHavingActivityBetweenDateFilter.php (100%) rename {Form => src/Bundle/ChillActivityBundle/Form}/ActivityReasonCategoryType.php (100%) rename {Form => src/Bundle/ChillActivityBundle/Form}/ActivityReasonType.php (100%) rename {Form => src/Bundle/ChillActivityBundle/Form}/ActivityType.php (100%) rename {Form => src/Bundle/ChillActivityBundle/Form}/ActivityTypeType.php (100%) rename {Form => src/Bundle/ChillActivityBundle/Form}/Type/TranslatableActivityReason.php (100%) rename {Form => src/Bundle/ChillActivityBundle/Form}/Type/TranslatableActivityReasonCategory.php (100%) rename {Form => src/Bundle/ChillActivityBundle/Form}/Type/TranslatableActivityType.php (100%) rename LICENSE => src/Bundle/ChillActivityBundle/LICENSE (100%) rename {Menu => src/Bundle/ChillActivityBundle/Menu}/MenuBuilder.php (100%) rename {Menu => src/Bundle/ChillActivityBundle/Menu}/PersonMenuBuilder.php (100%) rename README.md => src/Bundle/ChillActivityBundle/README.md (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/doctrine/Activity.orm.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/doctrine/ActivityReason.orm.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/doctrine/ActivityReasonCategory.orm.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/doctrine/ActivityType.orm.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/routing.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/routing/activity.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/routing/activityreason.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/routing/activityreasoncategory.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/routing/activitytype.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services/controller.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services/export.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services/fixtures.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services/form.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services/menu.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services/repositories.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/config/services/templating.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/doc/index.rst (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/migrations/Version20150701091248.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/migrations/Version20150702093317.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/migrations/Version20150704091347.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/migrations/Version20160222103457.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/migrations/Version20161114085659.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/public/activity/activity.scss (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/public/index.js (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/AppKernel.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/DoctrineMigrations/.gitignore (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/Resources/.DS_Store (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/autoload.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/bootstrap.php.cache (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/cache/dev/classes.map (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/config.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/config_dev.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/config_test.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/parameters.gitlab-ci.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/parameters.travis.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/parameters.yml.dist (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/config/routing.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/app/console (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/test/Fixtures/App/web/app_dev.php (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/translations/messages.fr.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/translations/validators.fr.yml (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Activity/confirm_delete.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Activity/edit.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Activity/list.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Activity/new.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Activity/show.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReason/edit.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReason/index.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReason/macro.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReason/new.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReason/show.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReasonCategory/edit.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReasonCategory/index.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReasonCategory/new.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityReasonCategory/show.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityType/edit.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityType/index.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityType/new.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/ActivityType/show.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Admin/layout_activity.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Admin/menu_activity.html.twig (100%) rename {Resources => src/Bundle/ChillActivityBundle/Resources}/views/Timeline/activity_person_context.html.twig (100%) rename {Security => src/Bundle/ChillActivityBundle/Security}/Authorization/ActivityStatsVoter.php (100%) rename {Security => src/Bundle/ChillActivityBundle/Security}/Authorization/ActivityVoter.php (100%) rename {Templating => src/Bundle/ChillActivityBundle/Templating}/Entity/ActivityReasonRender.php (100%) rename {Test => src/Bundle/ChillActivityBundle/Test}/PrepareActivityTrait.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Controller/ActivityControllerTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Controller/ActivityReasonCategoryControllerTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Controller/ActivityReasonControllerTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Controller/ActivityTypeControllerTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Aggregator/ActivityReasonAggregatorTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Aggregator/ActivityTypeAggregatorTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Aggregator/ActivityUserAggregatorTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Export/CountActivityTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Export/ListActivityTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Export/StatActivityDurationSumTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Filter/ActivityReasonFilterTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Form/ActivityTypeTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Form/Type/TranslatableActivityReasonTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Form/Type/TranslatableActivityTypeTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Security/Authorization/ActivityVoterTest.php (100%) rename {Tests => src/Bundle/ChillActivityBundle/Tests}/Timeline/TimelineProviderTest.php (100%) rename {Timeline => src/Bundle/ChillActivityBundle/Timeline}/TimelineActivityProvider.php (100%) rename apigen.neon => src/Bundle/ChillActivityBundle/apigen.neon (100%) rename chill.webpack.config.js => src/Bundle/ChillActivityBundle/chill.webpack.config.js (100%) rename composer.json => src/Bundle/ChillActivityBundle/composer.json (100%) rename phpunit.xml.dist => src/Bundle/ChillActivityBundle/phpunit.xml.dist (100%) diff --git a/.gitignore b/src/Bundle/ChillActivityBundle/.gitignore similarity index 100% rename from .gitignore rename to src/Bundle/ChillActivityBundle/.gitignore diff --git a/.gitlab-ci.yml b/src/Bundle/ChillActivityBundle/.gitlab-ci.yml similarity index 100% rename from .gitlab-ci.yml rename to src/Bundle/ChillActivityBundle/.gitlab-ci.yml diff --git a/CHANGELOG.md b/src/Bundle/ChillActivityBundle/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to src/Bundle/ChillActivityBundle/CHANGELOG.md diff --git a/ChillActivityBundle.php b/src/Bundle/ChillActivityBundle/ChillActivityBundle.php similarity index 100% rename from ChillActivityBundle.php rename to src/Bundle/ChillActivityBundle/ChillActivityBundle.php diff --git a/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php similarity index 100% rename from Controller/ActivityController.php rename to src/Bundle/ChillActivityBundle/Controller/ActivityController.php diff --git a/Controller/ActivityReasonCategoryController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php similarity index 100% rename from Controller/ActivityReasonCategoryController.php rename to src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php diff --git a/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php similarity index 100% rename from Controller/ActivityReasonController.php rename to src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php diff --git a/Controller/ActivityTypeController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityTypeController.php similarity index 100% rename from Controller/ActivityTypeController.php rename to src/Bundle/ChillActivityBundle/Controller/ActivityTypeController.php diff --git a/Controller/AdminController.php b/src/Bundle/ChillActivityBundle/Controller/AdminController.php similarity index 100% rename from Controller/AdminController.php rename to src/Bundle/ChillActivityBundle/Controller/AdminController.php diff --git a/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php similarity index 100% rename from DataFixtures/ORM/LoadActivity.php rename to src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php diff --git a/DataFixtures/ORM/LoadActivityReason.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php similarity index 100% rename from DataFixtures/ORM/LoadActivityReason.php rename to src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php diff --git a/DataFixtures/ORM/LoadActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php similarity index 100% rename from DataFixtures/ORM/LoadActivityReasonCategory.php rename to src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php diff --git a/DataFixtures/ORM/LoadActivityType.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php similarity index 100% rename from DataFixtures/ORM/LoadActivityType.php rename to src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php diff --git a/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php similarity index 100% rename from DataFixtures/ORM/LoadActivitytACL.php rename to src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php diff --git a/DependencyInjection/ChillActivityExtension.php b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php similarity index 100% rename from DependencyInjection/ChillActivityExtension.php rename to src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php diff --git a/DependencyInjection/Configuration.php b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php similarity index 100% rename from DependencyInjection/Configuration.php rename to src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php diff --git a/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php similarity index 100% rename from Entity/Activity.php rename to src/Bundle/ChillActivityBundle/Entity/Activity.php diff --git a/Entity/ActivityReason.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php similarity index 100% rename from Entity/ActivityReason.php rename to src/Bundle/ChillActivityBundle/Entity/ActivityReason.php diff --git a/Entity/ActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php similarity index 100% rename from Entity/ActivityReasonCategory.php rename to src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php diff --git a/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php similarity index 100% rename from Entity/ActivityType.php rename to src/Bundle/ChillActivityBundle/Entity/ActivityType.php diff --git a/Export/Aggregator/ActivityReasonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php similarity index 100% rename from Export/Aggregator/ActivityReasonAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php diff --git a/Export/Aggregator/ActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php similarity index 100% rename from Export/Aggregator/ActivityTypeAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php diff --git a/Export/Aggregator/ActivityUserAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php similarity index 100% rename from Export/Aggregator/ActivityUserAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php diff --git a/Export/Export/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/CountActivity.php similarity index 100% rename from Export/Export/CountActivity.php rename to src/Bundle/ChillActivityBundle/Export/Export/CountActivity.php diff --git a/Export/Export/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php similarity index 100% rename from Export/Export/ListActivity.php rename to src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php diff --git a/Export/Export/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php similarity index 100% rename from Export/Export/StatActivityDuration.php rename to src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php diff --git a/Export/Filter/ActivityDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php similarity index 100% rename from Export/Filter/ActivityDateFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php diff --git a/Export/Filter/ActivityReasonFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php similarity index 100% rename from Export/Filter/ActivityReasonFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php diff --git a/Export/Filter/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php similarity index 100% rename from Export/Filter/ActivityTypeFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php diff --git a/Export/Filter/PersonHavingActivityBetweenDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php similarity index 100% rename from Export/Filter/PersonHavingActivityBetweenDateFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php diff --git a/Form/ActivityReasonCategoryType.php b/src/Bundle/ChillActivityBundle/Form/ActivityReasonCategoryType.php similarity index 100% rename from Form/ActivityReasonCategoryType.php rename to src/Bundle/ChillActivityBundle/Form/ActivityReasonCategoryType.php diff --git a/Form/ActivityReasonType.php b/src/Bundle/ChillActivityBundle/Form/ActivityReasonType.php similarity index 100% rename from Form/ActivityReasonType.php rename to src/Bundle/ChillActivityBundle/Form/ActivityReasonType.php diff --git a/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php similarity index 100% rename from Form/ActivityType.php rename to src/Bundle/ChillActivityBundle/Form/ActivityType.php diff --git a/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php similarity index 100% rename from Form/ActivityTypeType.php rename to src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php diff --git a/Form/Type/TranslatableActivityReason.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReason.php similarity index 100% rename from Form/Type/TranslatableActivityReason.php rename to src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReason.php diff --git a/Form/Type/TranslatableActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategory.php similarity index 100% rename from Form/Type/TranslatableActivityReasonCategory.php rename to src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategory.php diff --git a/Form/Type/TranslatableActivityType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php similarity index 100% rename from Form/Type/TranslatableActivityType.php rename to src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php diff --git a/LICENSE b/src/Bundle/ChillActivityBundle/LICENSE similarity index 100% rename from LICENSE rename to src/Bundle/ChillActivityBundle/LICENSE diff --git a/Menu/MenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/MenuBuilder.php similarity index 100% rename from Menu/MenuBuilder.php rename to src/Bundle/ChillActivityBundle/Menu/MenuBuilder.php diff --git a/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php similarity index 100% rename from Menu/PersonMenuBuilder.php rename to src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php diff --git a/README.md b/src/Bundle/ChillActivityBundle/README.md similarity index 100% rename from README.md rename to src/Bundle/ChillActivityBundle/README.md diff --git a/Resources/config/doctrine/Activity.orm.yml b/src/Bundle/ChillActivityBundle/Resources/config/doctrine/Activity.orm.yml similarity index 100% rename from Resources/config/doctrine/Activity.orm.yml rename to src/Bundle/ChillActivityBundle/Resources/config/doctrine/Activity.orm.yml diff --git a/Resources/config/doctrine/ActivityReason.orm.yml b/src/Bundle/ChillActivityBundle/Resources/config/doctrine/ActivityReason.orm.yml similarity index 100% rename from Resources/config/doctrine/ActivityReason.orm.yml rename to src/Bundle/ChillActivityBundle/Resources/config/doctrine/ActivityReason.orm.yml diff --git a/Resources/config/doctrine/ActivityReasonCategory.orm.yml b/src/Bundle/ChillActivityBundle/Resources/config/doctrine/ActivityReasonCategory.orm.yml similarity index 100% rename from Resources/config/doctrine/ActivityReasonCategory.orm.yml rename to src/Bundle/ChillActivityBundle/Resources/config/doctrine/ActivityReasonCategory.orm.yml diff --git a/Resources/config/doctrine/ActivityType.orm.yml b/src/Bundle/ChillActivityBundle/Resources/config/doctrine/ActivityType.orm.yml similarity index 100% rename from Resources/config/doctrine/ActivityType.orm.yml rename to src/Bundle/ChillActivityBundle/Resources/config/doctrine/ActivityType.orm.yml diff --git a/Resources/config/routing.yml b/src/Bundle/ChillActivityBundle/Resources/config/routing.yml similarity index 100% rename from Resources/config/routing.yml rename to src/Bundle/ChillActivityBundle/Resources/config/routing.yml diff --git a/Resources/config/routing/activity.yml b/src/Bundle/ChillActivityBundle/Resources/config/routing/activity.yml similarity index 100% rename from Resources/config/routing/activity.yml rename to src/Bundle/ChillActivityBundle/Resources/config/routing/activity.yml diff --git a/Resources/config/routing/activityreason.yml b/src/Bundle/ChillActivityBundle/Resources/config/routing/activityreason.yml similarity index 100% rename from Resources/config/routing/activityreason.yml rename to src/Bundle/ChillActivityBundle/Resources/config/routing/activityreason.yml diff --git a/Resources/config/routing/activityreasoncategory.yml b/src/Bundle/ChillActivityBundle/Resources/config/routing/activityreasoncategory.yml similarity index 100% rename from Resources/config/routing/activityreasoncategory.yml rename to src/Bundle/ChillActivityBundle/Resources/config/routing/activityreasoncategory.yml diff --git a/Resources/config/routing/activitytype.yml b/src/Bundle/ChillActivityBundle/Resources/config/routing/activitytype.yml similarity index 100% rename from Resources/config/routing/activitytype.yml rename to src/Bundle/ChillActivityBundle/Resources/config/routing/activitytype.yml diff --git a/Resources/config/services.yml b/src/Bundle/ChillActivityBundle/Resources/config/services.yml similarity index 100% rename from Resources/config/services.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services.yml diff --git a/Resources/config/services/controller.yml b/src/Bundle/ChillActivityBundle/Resources/config/services/controller.yml similarity index 100% rename from Resources/config/services/controller.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services/controller.yml diff --git a/Resources/config/services/export.yml b/src/Bundle/ChillActivityBundle/Resources/config/services/export.yml similarity index 100% rename from Resources/config/services/export.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services/export.yml diff --git a/Resources/config/services/fixtures.yml b/src/Bundle/ChillActivityBundle/Resources/config/services/fixtures.yml similarity index 100% rename from Resources/config/services/fixtures.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services/fixtures.yml diff --git a/Resources/config/services/form.yml b/src/Bundle/ChillActivityBundle/Resources/config/services/form.yml similarity index 100% rename from Resources/config/services/form.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services/form.yml diff --git a/Resources/config/services/menu.yml b/src/Bundle/ChillActivityBundle/Resources/config/services/menu.yml similarity index 100% rename from Resources/config/services/menu.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services/menu.yml diff --git a/Resources/config/services/repositories.yml b/src/Bundle/ChillActivityBundle/Resources/config/services/repositories.yml similarity index 100% rename from Resources/config/services/repositories.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services/repositories.yml diff --git a/Resources/config/services/templating.yml b/src/Bundle/ChillActivityBundle/Resources/config/services/templating.yml similarity index 100% rename from Resources/config/services/templating.yml rename to src/Bundle/ChillActivityBundle/Resources/config/services/templating.yml diff --git a/Resources/doc/index.rst b/src/Bundle/ChillActivityBundle/Resources/doc/index.rst similarity index 100% rename from Resources/doc/index.rst rename to src/Bundle/ChillActivityBundle/Resources/doc/index.rst diff --git a/Resources/migrations/Version20150701091248.php b/src/Bundle/ChillActivityBundle/Resources/migrations/Version20150701091248.php similarity index 100% rename from Resources/migrations/Version20150701091248.php rename to src/Bundle/ChillActivityBundle/Resources/migrations/Version20150701091248.php diff --git a/Resources/migrations/Version20150702093317.php b/src/Bundle/ChillActivityBundle/Resources/migrations/Version20150702093317.php similarity index 100% rename from Resources/migrations/Version20150702093317.php rename to src/Bundle/ChillActivityBundle/Resources/migrations/Version20150702093317.php diff --git a/Resources/migrations/Version20150704091347.php b/src/Bundle/ChillActivityBundle/Resources/migrations/Version20150704091347.php similarity index 100% rename from Resources/migrations/Version20150704091347.php rename to src/Bundle/ChillActivityBundle/Resources/migrations/Version20150704091347.php diff --git a/Resources/migrations/Version20160222103457.php b/src/Bundle/ChillActivityBundle/Resources/migrations/Version20160222103457.php similarity index 100% rename from Resources/migrations/Version20160222103457.php rename to src/Bundle/ChillActivityBundle/Resources/migrations/Version20160222103457.php diff --git a/Resources/migrations/Version20161114085659.php b/src/Bundle/ChillActivityBundle/Resources/migrations/Version20161114085659.php similarity index 100% rename from Resources/migrations/Version20161114085659.php rename to src/Bundle/ChillActivityBundle/Resources/migrations/Version20161114085659.php diff --git a/Resources/public/activity/activity.scss b/src/Bundle/ChillActivityBundle/Resources/public/activity/activity.scss similarity index 100% rename from Resources/public/activity/activity.scss rename to src/Bundle/ChillActivityBundle/Resources/public/activity/activity.scss diff --git a/Resources/public/index.js b/src/Bundle/ChillActivityBundle/Resources/public/index.js similarity index 100% rename from Resources/public/index.js rename to src/Bundle/ChillActivityBundle/Resources/public/index.js diff --git a/Resources/test/Fixtures/App/app/AppKernel.php b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/AppKernel.php similarity index 100% rename from Resources/test/Fixtures/App/app/AppKernel.php rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/AppKernel.php diff --git a/Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore similarity index 100% rename from Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore diff --git a/Resources/test/Fixtures/App/app/Resources/.DS_Store b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/Resources/.DS_Store similarity index 100% rename from Resources/test/Fixtures/App/app/Resources/.DS_Store rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/Resources/.DS_Store diff --git a/Resources/test/Fixtures/App/app/autoload.php b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/autoload.php similarity index 100% rename from Resources/test/Fixtures/App/app/autoload.php rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/autoload.php diff --git a/Resources/test/Fixtures/App/app/bootstrap.php.cache b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/bootstrap.php.cache similarity index 100% rename from Resources/test/Fixtures/App/app/bootstrap.php.cache rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/bootstrap.php.cache diff --git a/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php similarity index 100% rename from Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php diff --git a/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta similarity index 100% rename from Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.php.meta diff --git a/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml similarity index 100% rename from Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainer.xml diff --git a/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log similarity index 100% rename from Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/appDevDebugProjectContainerCompiler.log diff --git a/Resources/test/Fixtures/App/app/cache/dev/classes.map b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/classes.map similarity index 100% rename from Resources/test/Fixtures/App/app/cache/dev/classes.map rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/cache/dev/classes.map diff --git a/Resources/test/Fixtures/App/app/config/config.yml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config.yml similarity index 100% rename from Resources/test/Fixtures/App/app/config/config.yml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config.yml diff --git a/Resources/test/Fixtures/App/app/config/config_dev.yml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config_dev.yml similarity index 100% rename from Resources/test/Fixtures/App/app/config/config_dev.yml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config_dev.yml diff --git a/Resources/test/Fixtures/App/app/config/config_test.yml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config_test.yml similarity index 100% rename from Resources/test/Fixtures/App/app/config/config_test.yml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config_test.yml diff --git a/Resources/test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml similarity index 100% rename from Resources/test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/config_test_customizable_entities_test_not_empty_config.yml diff --git a/Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml similarity index 100% rename from Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml diff --git a/Resources/test/Fixtures/App/app/config/parameters.travis.yml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/parameters.travis.yml similarity index 100% rename from Resources/test/Fixtures/App/app/config/parameters.travis.yml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/parameters.travis.yml diff --git a/Resources/test/Fixtures/App/app/config/parameters.yml.dist b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/parameters.yml.dist similarity index 100% rename from Resources/test/Fixtures/App/app/config/parameters.yml.dist rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/parameters.yml.dist diff --git a/Resources/test/Fixtures/App/app/config/routing.yml b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/routing.yml similarity index 100% rename from Resources/test/Fixtures/App/app/config/routing.yml rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/config/routing.yml diff --git a/Resources/test/Fixtures/App/app/console b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/console similarity index 100% rename from Resources/test/Fixtures/App/app/console rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/console diff --git a/Resources/test/Fixtures/App/web/app_dev.php b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php similarity index 100% rename from Resources/test/Fixtures/App/web/app_dev.php rename to src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php diff --git a/Resources/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/Resources/translations/messages.fr.yml similarity index 100% rename from Resources/translations/messages.fr.yml rename to src/Bundle/ChillActivityBundle/Resources/translations/messages.fr.yml diff --git a/Resources/translations/validators.fr.yml b/src/Bundle/ChillActivityBundle/Resources/translations/validators.fr.yml similarity index 100% rename from Resources/translations/validators.fr.yml rename to src/Bundle/ChillActivityBundle/Resources/translations/validators.fr.yml diff --git a/Resources/views/Activity/confirm_delete.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/confirm_delete.html.twig similarity index 100% rename from Resources/views/Activity/confirm_delete.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Activity/confirm_delete.html.twig diff --git a/Resources/views/Activity/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig similarity index 100% rename from Resources/views/Activity/edit.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig diff --git a/Resources/views/Activity/list.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig similarity index 100% rename from Resources/views/Activity/list.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig diff --git a/Resources/views/Activity/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig similarity index 100% rename from Resources/views/Activity/new.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig diff --git a/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig similarity index 100% rename from Resources/views/Activity/show.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig diff --git a/Resources/views/ActivityReason/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/edit.html.twig similarity index 100% rename from Resources/views/ActivityReason/edit.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/edit.html.twig diff --git a/Resources/views/ActivityReason/index.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/index.html.twig similarity index 100% rename from Resources/views/ActivityReason/index.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/index.html.twig diff --git a/Resources/views/ActivityReason/macro.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/macro.html.twig similarity index 100% rename from Resources/views/ActivityReason/macro.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/macro.html.twig diff --git a/Resources/views/ActivityReason/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/new.html.twig similarity index 100% rename from Resources/views/ActivityReason/new.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/new.html.twig diff --git a/Resources/views/ActivityReason/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/show.html.twig similarity index 100% rename from Resources/views/ActivityReason/show.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReason/show.html.twig diff --git a/Resources/views/ActivityReasonCategory/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/edit.html.twig similarity index 100% rename from Resources/views/ActivityReasonCategory/edit.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/edit.html.twig diff --git a/Resources/views/ActivityReasonCategory/index.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/index.html.twig similarity index 100% rename from Resources/views/ActivityReasonCategory/index.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/index.html.twig diff --git a/Resources/views/ActivityReasonCategory/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/new.html.twig similarity index 100% rename from Resources/views/ActivityReasonCategory/new.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/new.html.twig diff --git a/Resources/views/ActivityReasonCategory/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/show.html.twig similarity index 100% rename from Resources/views/ActivityReasonCategory/show.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/show.html.twig diff --git a/Resources/views/ActivityType/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityType/edit.html.twig similarity index 100% rename from Resources/views/ActivityType/edit.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityType/edit.html.twig diff --git a/Resources/views/ActivityType/index.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityType/index.html.twig similarity index 100% rename from Resources/views/ActivityType/index.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityType/index.html.twig diff --git a/Resources/views/ActivityType/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityType/new.html.twig similarity index 100% rename from Resources/views/ActivityType/new.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityType/new.html.twig diff --git a/Resources/views/ActivityType/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityType/show.html.twig similarity index 100% rename from Resources/views/ActivityType/show.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/ActivityType/show.html.twig diff --git a/Resources/views/Admin/layout_activity.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Admin/layout_activity.html.twig similarity index 100% rename from Resources/views/Admin/layout_activity.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Admin/layout_activity.html.twig diff --git a/Resources/views/Admin/menu_activity.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Admin/menu_activity.html.twig similarity index 100% rename from Resources/views/Admin/menu_activity.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Admin/menu_activity.html.twig diff --git a/Resources/views/Timeline/activity_person_context.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Timeline/activity_person_context.html.twig similarity index 100% rename from Resources/views/Timeline/activity_person_context.html.twig rename to src/Bundle/ChillActivityBundle/Resources/views/Timeline/activity_person_context.html.twig diff --git a/Security/Authorization/ActivityStatsVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php similarity index 100% rename from Security/Authorization/ActivityStatsVoter.php rename to src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php diff --git a/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php similarity index 100% rename from Security/Authorization/ActivityVoter.php rename to src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php diff --git a/Templating/Entity/ActivityReasonRender.php b/src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php similarity index 100% rename from Templating/Entity/ActivityReasonRender.php rename to src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php diff --git a/Test/PrepareActivityTrait.php b/src/Bundle/ChillActivityBundle/Test/PrepareActivityTrait.php similarity index 100% rename from Test/PrepareActivityTrait.php rename to src/Bundle/ChillActivityBundle/Test/PrepareActivityTrait.php diff --git a/Tests/Controller/ActivityControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php similarity index 100% rename from Tests/Controller/ActivityControllerTest.php rename to src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php diff --git a/Tests/Controller/ActivityReasonCategoryControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php similarity index 100% rename from Tests/Controller/ActivityReasonCategoryControllerTest.php rename to src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php diff --git a/Tests/Controller/ActivityReasonControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php similarity index 100% rename from Tests/Controller/ActivityReasonControllerTest.php rename to src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php diff --git a/Tests/Controller/ActivityTypeControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php similarity index 100% rename from Tests/Controller/ActivityTypeControllerTest.php rename to src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php diff --git a/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php similarity index 100% rename from Tests/Export/Aggregator/ActivityReasonAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php diff --git a/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php similarity index 100% rename from Tests/Export/Aggregator/ActivityTypeAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php diff --git a/Tests/Export/Aggregator/ActivityUserAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityUserAggregatorTest.php similarity index 100% rename from Tests/Export/Aggregator/ActivityUserAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityUserAggregatorTest.php diff --git a/Tests/Export/Export/CountActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/CountActivityTest.php similarity index 100% rename from Tests/Export/Export/CountActivityTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Export/CountActivityTest.php diff --git a/Tests/Export/Export/ListActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/ListActivityTest.php similarity index 100% rename from Tests/Export/Export/ListActivityTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Export/ListActivityTest.php diff --git a/Tests/Export/Export/StatActivityDurationSumTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/StatActivityDurationSumTest.php similarity index 100% rename from Tests/Export/Export/StatActivityDurationSumTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Export/StatActivityDurationSumTest.php diff --git a/Tests/Export/Filter/ActivityReasonFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityReasonFilterTest.php similarity index 100% rename from Tests/Export/Filter/ActivityReasonFilterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityReasonFilterTest.php diff --git a/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php similarity index 100% rename from Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php diff --git a/Tests/Form/ActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php similarity index 100% rename from Tests/Form/ActivityTypeTest.php rename to src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php diff --git a/Tests/Form/Type/TranslatableActivityReasonTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php similarity index 100% rename from Tests/Form/Type/TranslatableActivityReasonTest.php rename to src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php diff --git a/Tests/Form/Type/TranslatableActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php similarity index 100% rename from Tests/Form/Type/TranslatableActivityTypeTest.php rename to src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php diff --git a/Tests/Security/Authorization/ActivityVoterTest.php b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php similarity index 100% rename from Tests/Security/Authorization/ActivityVoterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php diff --git a/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php similarity index 100% rename from Tests/Timeline/TimelineProviderTest.php rename to src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php diff --git a/Timeline/TimelineActivityProvider.php b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php similarity index 100% rename from Timeline/TimelineActivityProvider.php rename to src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php diff --git a/apigen.neon b/src/Bundle/ChillActivityBundle/apigen.neon similarity index 100% rename from apigen.neon rename to src/Bundle/ChillActivityBundle/apigen.neon diff --git a/chill.webpack.config.js b/src/Bundle/ChillActivityBundle/chill.webpack.config.js similarity index 100% rename from chill.webpack.config.js rename to src/Bundle/ChillActivityBundle/chill.webpack.config.js diff --git a/composer.json b/src/Bundle/ChillActivityBundle/composer.json similarity index 100% rename from composer.json rename to src/Bundle/ChillActivityBundle/composer.json diff --git a/phpunit.xml.dist b/src/Bundle/ChillActivityBundle/phpunit.xml.dist similarity index 100% rename from phpunit.xml.dist rename to src/Bundle/ChillActivityBundle/phpunit.xml.dist
                                            • - - - +
                                            • {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
                                            • - - - +
                                            • {% endif %} {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
                                            • - - - +
                                            • {% endif %}
                                            {% if activity.date %}{{ activity.date|localizeddate('long', 'none') }}{% endif %} {{ activity.durationTime|date('H:i') }} + {% if activity.remark is not empty %} +
                                            + {{ activity.remark|truncate(250, true) }} +
                                            + {% endif %} {%- if activity.reasons is empty -%} {{ 'No reason associated'|trans }} {%- else -%} - {% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %} + {% for r in activity.reasons %}{{ r|chill_entity_render_box }} {% endfor %} {%- endif -%}
                                            {{ activity.type.name | localize_translatable_string }}