mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 16:55:00 +00:00
Compare commits
100 Commits
vue3-test0
...
refactorin
Author | SHA1 | Date | |
---|---|---|---|
|
1f9b4ddd79 | ||
|
a9bdb1fe3b | ||
|
92b6f4e206 | ||
|
c019da9bcf | ||
|
5146419e9a | ||
|
11036e84f6 | ||
|
1f488109e3 | ||
|
d2a93f0763 | ||
|
c5940c1263 | ||
|
7f602ffa47 | ||
|
ac9d0242ad | ||
|
e9a7a05fb7 | ||
|
174d873398 | ||
|
55695b7d2c | ||
|
ca3cb787d7 | ||
|
84bb56664a | ||
|
f26eb06276 | ||
e1c8278f71 | |||
|
ed3f46ce7f | ||
7503c845df | |||
3686a294d3 | |||
2db847ada2 | |||
|
7819c1204c | ||
|
e470a6a97e | ||
|
cd8c47449b | ||
d6e7fadb4f | |||
|
2be1c08c44 | ||
|
d426d28ba0 | ||
|
72e69fc0b3 | ||
52472b0ec3 | |||
cab3b1059d | |||
4c82e65c1f | |||
cf4d7df7ad | |||
86d13410c3 | |||
19fdf2a503 | |||
|
5448238697 | ||
|
c5250a1059 | ||
b2c1a7b8de | |||
49c6915c0a | |||
b4583fc6dc | |||
f7c508939c | |||
a2160bef7d | |||
8641d6bdce | |||
5f4d513aa6 | |||
f47b15de39 | |||
7426dc02cf | |||
a570160aed | |||
6e81ef0065 | |||
e3cc76c689 | |||
b43f43fa0b | |||
7596bd5a06 | |||
f02d6df262 | |||
e4e2138765 | |||
395735e6f7 | |||
2c96c02261 | |||
53813f8f29 | |||
|
b8ef0d28f5 | ||
|
e973c4013f | ||
|
0f9a395dfc | ||
|
38ac3badef | ||
|
cda32fb925 | ||
|
58cb34f39b | ||
66426f5102 | |||
3445335b2d | |||
e52a9a4330 | |||
8adb05c24f | |||
b1207cbd3e | |||
|
09ed671734 | ||
93260ea36f | |||
|
8756982a78 | ||
a8f55e064d | |||
7df753f1cb | |||
b0fc4e190f | |||
928e0e1eed | |||
28e4b2abaf | |||
c5b21f360c | |||
fbec64664f | |||
6c81fe4ef2 | |||
520c0e0f96 | |||
2647d4c6a7 | |||
c6a87f1286 | |||
d57cfe09c8 | |||
38cba4948b | |||
d765eecb8e | |||
a7e4900690 | |||
e98a5b88aa | |||
1b42656e0f | |||
b2ff470720 | |||
e9674dd334 | |||
0fcec73a62 | |||
9539214d24 | |||
c5b4a44ff3 | |||
b7d6d29fac | |||
51e9b1fcf2 | |||
b490f4a82c | |||
|
03243605da | ||
|
48e2d2ceab | ||
|
777fb25860 | ||
|
03601b9707 | ||
c205bbddd3 |
64
.env
Normal file
64
.env
Normal file
@@ -0,0 +1,64 @@
|
||||
##
|
||||
## Manually dump .env files in .env.local.php with
|
||||
## `$ composer symfony:dump-env prod`
|
||||
##
|
||||
|
||||
## Project environment
|
||||
APP_ENV=dev
|
||||
|
||||
## Enable debug
|
||||
APP_DEBUG=true
|
||||
|
||||
## Locale
|
||||
LOCALE=fr
|
||||
|
||||
## Framework secret
|
||||
APP_SECRET=ThisTokenIsNotSoSecretChangeIt
|
||||
|
||||
## Symfony/swiftmailer
|
||||
MAILER_TRANSPORT=smtp
|
||||
MAILER_HOST=smtp
|
||||
MAILER_PORT=1025
|
||||
MAILER_CRYPT=
|
||||
MAILER_AUTH=
|
||||
MAILER_USER=
|
||||
MAILER_PASSWORD=
|
||||
MAILER_URL=${MAILER_TRANSPORT}://${MAILER_HOST}:${MAILER_PORT}?encryption=${MAILER_CRYPT}&auth_mode=${MAILER_AUTH}&username=${MAILER_USER}&password=${MAILER_PASSWORD}
|
||||
|
||||
## Notifications
|
||||
NOTIFICATION_HOST=localhost:8001
|
||||
NOTIFICATION_FROM_EMAIL=admin@chill.social
|
||||
NOTIFICATION_FROM_NAME=Chill
|
||||
|
||||
## Gelf
|
||||
GELF_HOST=gelf
|
||||
GELF_PORT=12201
|
||||
|
||||
## OVH OpenStack Storage User/Role
|
||||
OS_USERNAME=
|
||||
OS_PASSWORD=
|
||||
OS_TENANT_ID=
|
||||
OS_REGION_NAME=GRA
|
||||
OS_AUTH_URL=https://auth.cloud.ovh.net/v2.0/
|
||||
|
||||
## OVH OpenStack Storage Container
|
||||
ASYNC_UPLOAD_TEMP_URL_KEY=
|
||||
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
|
||||
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
|
||||
|
||||
## Redis Cache
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
|
||||
|
||||
## Twilio
|
||||
TWILIO_SID=~
|
||||
TWILIO_SECRET=~
|
||||
|
||||
## DOCKER IMAGES REGISTRY
|
||||
#IMAGE_PHP=
|
||||
#IMAGE_NGINX=
|
||||
|
||||
## DOCKER IMAGES VERSION
|
||||
#VERSION=test
|
||||
VERSION=prod
|
6
.env.test
Normal file
6
.env.test
Normal file
@@ -0,0 +1,6 @@
|
||||
# variables for .env environement
|
||||
# those variables suits for gitlab-ci
|
||||
# Run tests from root to adapt your own environment
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
|
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,4 +1,21 @@
|
||||
.composer/*
|
||||
composer.phar
|
||||
composer.lock
|
||||
|
||||
docs/build/
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
/.env.local
|
||||
/.env.local.php
|
||||
/.env.*.local
|
||||
/config/secrets/prod/prod.decrypt.private.php
|
||||
/public/bundles/
|
||||
/var/
|
||||
/vendor/
|
||||
/bin/
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> phpunit/phpunit ###
|
||||
/phpunit.xml
|
||||
.phpunit.result.cache
|
||||
###< phpunit/phpunit ###
|
||||
|
41
.gitlab-ci.yml
Normal file
41
.gitlab-ci.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||
|
||||
# Select what we should cache between builds
|
||||
cache:
|
||||
paths:
|
||||
- tests/app/vendor/
|
||||
|
||||
before_script:
|
||||
# add extensions to postgres
|
||||
- PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h db -c "CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
||||
# Install and run Composer
|
||||
- curl -sS https://getcomposer.org/installer | php
|
||||
- php composer.phar install
|
||||
- php tests/app/bin/console doctrine:migrations:migrate -n
|
||||
- php tests/app/bin/console doctrine:fixtures:load -n
|
||||
|
||||
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
||||
# See http://docs.gitlab.com/ee/ci/services/README.html for examples.
|
||||
services:
|
||||
- name: postgres:12
|
||||
alias: db
|
||||
- name: redis
|
||||
alias: redis
|
||||
|
||||
# Set any variables we need
|
||||
variables:
|
||||
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
# fetch the chill-app using git submodules
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_URL: redis://redis:6379
|
||||
|
||||
|
||||
# Run our tests
|
||||
test:
|
||||
script:
|
||||
- bin/phpunit --colors=never
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "_exts/sphinx-php"]
|
||||
path = _exts/sphinx-php
|
||||
url = https://github.com/fabpot/sphinx-php.git
|
||||
[submodule "tests/app"]
|
||||
path = tests/app
|
||||
url = https://gitlab.com/Chill-projet/chill-app.git
|
||||
|
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Chill framework
|
||||
|
||||
Documentation of the Chill software.
|
||||
|
||||
The online documentation can be found at http://docs.chill.social
|
||||
|
||||
See the [`docs`][1] directory for more.
|
||||
|
||||
[1]: docs/README.md
|
@@ -13,12 +13,17 @@
|
||||
"Chill\\EventBundle\\": "src/Bundle/ChillEventBundle",
|
||||
"Chill\\FamilyMemberBundle\\": "src/Bundle/ChillFamilyMemberBundle",
|
||||
"Chill\\MainBundle\\": "src/Bundle/ChillMainBundle",
|
||||
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle",
|
||||
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle/src",
|
||||
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
|
||||
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
|
||||
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"App\\": "tests/app/src/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"champs-libres/async-uploader-bundle": "dev-sf4",
|
||||
"graylog2/gelf-php": "^1.5",
|
||||
@@ -67,6 +72,17 @@
|
||||
"symfony/stopwatch": "^5.1",
|
||||
"symfony/web-profiler-bundle": "^5.0",
|
||||
"symfony/var-dumper": "4.*",
|
||||
"symfony/debug-bundle": "^5.1"
|
||||
"symfony/debug-bundle": "^5.1",
|
||||
"symfony/phpunit-bridge": "^5.2"
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"vendor-dir": "tests/app/vendor",
|
||||
"bin-dir": "bin"
|
||||
}
|
||||
}
|
||||
|
@@ -10,10 +10,19 @@ Compilation into HTML
|
||||
|
||||
To compile this documentation :
|
||||
|
||||
1. Install [sphinx-doc](http://sphinx-doc.org) (eg. pip install sphinx & pip install sphinx_rtd_theme)
|
||||
1. Install [sphinx-doc](http://sphinx-doc.org)
|
||||
``` bash
|
||||
$ virtualenv .venv # creation of the virtual env (only the first time)
|
||||
$ source .venv/bin/activate # activate the virtual env
|
||||
(.venv) $ pip install -r requirements.txt
|
||||
```
|
||||
2. Install submodules : $ git submodule update --init;
|
||||
3. run `make html` from the root directory
|
||||
4. The base file is located on build/html/index.html
|
||||
``` bash
|
||||
$ cd build/html
|
||||
$ python -m http.server 8888 # will serve the site on the port 8888
|
||||
```
|
||||
|
||||
Contribute
|
||||
===========
|
||||
|
@@ -29,7 +29,7 @@ As Chill rely on the `symfony <http://symfony.com>`_ framework, reading the fram
|
||||
Timelines <timelines.rst>
|
||||
Exports <exports.rst>
|
||||
Embeddable comments <embeddable-comments.rst>
|
||||
Testing <make-test-working.rst>
|
||||
Run tests <run-tests.rst>
|
||||
Useful snippets <useful-snippets.rst>
|
||||
manual/index.rst
|
||||
Assets <assets.rst>
|
||||
|
@@ -1,231 +0,0 @@
|
||||
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
Make tests working
|
||||
******************
|
||||
|
||||
Unit and functional tests are important to ensure that bundle may be deployed securely.
|
||||
|
||||
In reason of the Chill architecture, test should be runnable from the bundle's directory and works correctly: this will allow continuous integration tools to run tests automatically.
|
||||
|
||||
.. note::
|
||||
|
||||
Integration tools (i.e. `travis-ci <https://travis-ci.org>`_) works like this :
|
||||
|
||||
* they clone the bundle repository in a virtual machine, using git
|
||||
* they optionnaly run `composer` to download and install depedencies
|
||||
* they optionnaly run other command to prepare a database, insert fixtures, ...
|
||||
* they run test
|
||||
|
||||
On the developer's machine test should be runnable with two or three commands **runned from the bundle directory** :
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ composer install --dev
|
||||
$ // command to insert fixtures, ...
|
||||
$ phpunit
|
||||
|
||||
This chapter has been inspired by `this useful blog post <http://blog.kevingomez.fr/2013/01/09/functional-testing-standalone-symfony2-bundles/>`_.
|
||||
|
||||
Bootstrap phpunit for a standalone bundle
|
||||
==========================================
|
||||
|
||||
Unit tests should run after achieving this step.
|
||||
|
||||
|
||||
phpunit.xml
|
||||
-----------
|
||||
|
||||
A `phpunit.xml.dist` file should be present at the bundle root.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
|
||||
<!-- the file "./Tests/boostrap.php" will be created on the next step -->
|
||||
<testsuites>
|
||||
<testsuite name="ChillMain test suite">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
||||
|
||||
bootstrap.php
|
||||
--------------
|
||||
|
||||
A file `boostrap.php`, located in the `Tests` directory, will allow phpunit to resolve class autoloading :
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
if (!is_file($autoloadFile = __DIR__.'/../vendor/autoload.php')) {
|
||||
throw new \LogicException('Could not find autoload.php in vendor/. Did you run "composer install --dev"?');
|
||||
}
|
||||
|
||||
require $autoloadFile;
|
||||
|
||||
|
||||
composer.json
|
||||
-------------
|
||||
|
||||
The `composer.json` file **located at the bundle's root** should contains all depencies needed to run test (and to execute bundle functions).
|
||||
|
||||
Ensure that all dependencies are included in the `require` and `require-dev` sections.
|
||||
|
||||
|
||||
Functional tests
|
||||
================
|
||||
|
||||
If you want to access services, database, and run functional tests, you will have to bootstrap a symfony app, with the minimal configuration. Three files are required :
|
||||
|
||||
* a `config_test.yml` file (eventually with a `config.yml`);
|
||||
* a `routing.yml` file
|
||||
* an `AppKernel.php` file
|
||||
|
||||
Adapt phpunit.xml
|
||||
-----------------
|
||||
|
||||
You should add reference to the new application within `phpunit.xml.dist`. The directive `<php>` should be added like this, if your `AppKernel.php` file is located in `Tests/Fixtures/App` directory:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="ChillMain test suite">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<!-- the lines we added -->
|
||||
<php>
|
||||
<server name="KERNEL_DIR" value="./Tests/Fixtures/App/" />
|
||||
</php>
|
||||
</phpunit>
|
||||
|
||||
AppKernel.php
|
||||
-------------
|
||||
|
||||
This file boostrap the app. It contains three functions. This is the file used in the ChillMain bundle :
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
public function registerBundles()
|
||||
{
|
||||
return array(
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Chill\MainBundle\ChillMainBundle(),
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new \Symfony\Bundle\AsseticBundle\AsseticBundle(),
|
||||
#add here all the required bundle (some bundle are not required)
|
||||
);
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCacheDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/ChillMainBundle/cache';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLogDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/ChillMainBundle/logs';
|
||||
}
|
||||
}
|
||||
|
||||
config_test.yml
|
||||
---------------
|
||||
|
||||
There are only few parameters required for the config file. This is a basic version for ChillMain :
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# 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
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/config.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: #required for assetic. Remove if not needed
|
||||
engines: ['twig']
|
||||
|
||||
.. note::
|
||||
|
||||
You must adapt config.yml file according to your required bundle. Some options will be missing, other may be removed...
|
||||
|
||||
.. note::
|
||||
|
||||
If you would like to tests different environments, with differents configuration, you could create differents config_XXX.yml files.
|
||||
|
||||
routing.yml
|
||||
------------
|
||||
|
||||
You should add there all routing information needed for your bundle.
|
||||
|
||||
.. code-block: yaml
|
||||
|
||||
chill_main_bundle:
|
||||
resource: "@CLChillMainBundle/Resources/config/routing.yml"
|
||||
|
||||
That's it. Tests should pass.
|
68
docs/source/development/run-tests.rst
Normal file
68
docs/source/development/run-tests.rst
Normal file
@@ -0,0 +1,68 @@
|
||||
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
Run tests
|
||||
*********
|
||||
|
||||
In reason of the Chill architecture, test should be runnable from the bundle's directory and works correctly: this will allow continuous integration tools to run tests automatically.
|
||||
|
||||
From chill app
|
||||
==============
|
||||
|
||||
This is the most convenient method for developer: run test for chill bundle from the main app.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# run into a container
|
||||
docker-compose exec --user $(id -u) php bash
|
||||
# execute all tests suites
|
||||
bin/phpunit
|
||||
# .. or execute a single test
|
||||
bin/phpunit vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Tests/path/to/FileTest.php
|
||||
|
||||
You can also run tests in a single command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker-compose exec --user $(id -u) php bin/phpunit
|
||||
|
||||
|
||||
Tests from a bundle (chill-bundles)
|
||||
-----------------------------------
|
||||
|
||||
Those tests needs the whole symfony app to execute Application Tests (which test html page).
|
||||
|
||||
For ease, the app is cloned using a :code:`git submodule`, which clone the main app into :code:`tests/app`, and tests are bootstrapped to this app. The dependencies are also installed into `tests/app/vendor` to ensure compliance with relative path from this symfony application.
|
||||
|
||||
You may boostrap the tests fro the chill bundle this way:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# ensure to be located into the environement (provided by docker suits well)
|
||||
docker-compose exec --user $(id -u) php bash
|
||||
# go to chill subdirectory
|
||||
cd vendor/chill-project/chill-bundles
|
||||
# install submodule
|
||||
git submodule init
|
||||
git submodule update
|
||||
# install composer and dependencies
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
# run tests
|
||||
bin/phpunit
|
||||
|
||||
.. note::
|
||||
|
||||
If you are on a fresh install, you will need to migrate database schema.
|
||||
|
||||
The path to console tool must be adapted to the app. To load migration and add fixtures, one can execute the following commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
tests/app/bin/console doctrine:migrations:migrate
|
||||
tests/app/bin/console doctrine:fixtures:load
|
||||
|
38
phpunit.xml.dist
Normal file
38
phpunit.xml.dist
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="tests/app/tests/bootstrap.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
<server name="APP_ENV" value="test" force="true" />
|
||||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
|
||||
<server name="SHELL_VERBOSITY" value="-1" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="MainBundle">
|
||||
<directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory>
|
||||
</testsuite>
|
||||
<!--
|
||||
<testsuite name="PersonBundle">
|
||||
<directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory>
|
||||
</testsuite>
|
||||
-->
|
||||
</testsuites>
|
||||
|
||||
<listeners>
|
||||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
|
||||
</listeners>
|
||||
|
||||
<!-- Run `composer require symfony/panther` before enabling this extension -->
|
||||
<!--
|
||||
<extensions>
|
||||
<extension class="Symfony\Component\Panther\ServerExtension" />
|
||||
</extensions>
|
||||
-->
|
||||
</phpunit>
|
@@ -47,11 +47,11 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
{
|
||||
/**
|
||||
* widget factory
|
||||
*
|
||||
*
|
||||
* @var WidgetFactoryInterface[]
|
||||
*/
|
||||
protected $widgetFactories = array();
|
||||
|
||||
|
||||
/**
|
||||
* @param WidgetFactoryInterface $factory
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
{
|
||||
$this->widgetFactories[] = $factory;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return WidgetFactoryInterface[]
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
{
|
||||
return $this->widgetFactories;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @param array $configs
|
||||
@@ -79,31 +79,31 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
// configuration for main bundle
|
||||
$configuration = $this->getConfiguration($configs, $container);
|
||||
$config = $this->processConfiguration($configuration, $configs);
|
||||
|
||||
|
||||
$container->setParameter('chill_main.installation_name',
|
||||
$config['installation_name']);
|
||||
|
||||
$container->setParameter('chill_main.available_languages',
|
||||
$config['available_languages']);
|
||||
|
||||
$container->setParameter('chill_main.routing.resources',
|
||||
$config['routing']['resources']);
|
||||
|
||||
|
||||
$container->setParameter('chill_main.routing.resources',
|
||||
$config['routing']['resources']);
|
||||
|
||||
$container->setParameter('chill_main.pagination.item_per_page',
|
||||
$config['pagination']['item_per_page']);
|
||||
|
||||
$container->setParameter('chill_main.notifications',
|
||||
|
||||
$container->setParameter('chill_main.notifications',
|
||||
$config['notifications']);
|
||||
|
||||
$container->setParameter('chill_main.redis',
|
||||
|
||||
$container->setParameter('chill_main.redis',
|
||||
$config['redis']);
|
||||
|
||||
$container->setParameter('chill_main.phone_helper',
|
||||
|
||||
$container->setParameter('chill_main.phone_helper',
|
||||
$config['phone_helper'] ?? []);
|
||||
|
||||
|
||||
// add the key 'widget' without the key 'enable'
|
||||
$container->setParameter('chill_main.widgets',
|
||||
isset($config['widgets']['homepage']) ?
|
||||
$container->setParameter('chill_main.widgets',
|
||||
isset($config['widgets']['homepage']) ?
|
||||
array('homepage' => $config['widgets']['homepage']):
|
||||
array()
|
||||
);
|
||||
@@ -131,10 +131,11 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
$loader->load('services/templating.yaml');
|
||||
$loader->load('services/timeline.yaml');
|
||||
$loader->load('services/search.yaml');
|
||||
|
||||
$loader->load('services/serializer.yaml');
|
||||
|
||||
$this->configureCruds($container, $config['cruds'], $loader);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $config
|
||||
* @param ContainerBuilder $container
|
||||
@@ -144,11 +145,11 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
{
|
||||
return new Configuration($this->widgetFactories, $container);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param ContainerBuilder $container
|
||||
*/
|
||||
public function prepend(ContainerBuilder $container)
|
||||
public function prepend(ContainerBuilder $container)
|
||||
{
|
||||
//add installation_name and date_format to globals
|
||||
$chillMainConfig = $container->getExtensionConfig($this->getAlias());
|
||||
@@ -163,7 +164,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
'form_themes' => array('@ChillMain/Form/fields.html.twig')
|
||||
);
|
||||
$container->prependExtensionConfig('twig', $twigConfig);
|
||||
|
||||
|
||||
//add DQL function to ORM (default entity_manager)
|
||||
$container->prependExtensionConfig('doctrine', array(
|
||||
'orm' => array(
|
||||
@@ -182,7 +183,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
//add dbal types (default entity_manager)
|
||||
$container->prependExtensionConfig('doctrine', array(
|
||||
'dbal' => [
|
||||
@@ -191,23 +192,23 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
]
|
||||
]
|
||||
));
|
||||
|
||||
|
||||
//add current route to chill main
|
||||
$container->prependExtensionConfig('chill_main', array(
|
||||
'routing' => array(
|
||||
'resources' => array(
|
||||
'@ChillMainBundle/config/routes.yaml'
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
//add a channel to log app events
|
||||
$container->prependExtensionConfig('monolog', array(
|
||||
'channels' => array('chill')
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param ContainerBuilder $container
|
||||
* @param array $config the config under 'cruds' key
|
||||
@@ -218,31 +219,31 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
if (count($config) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$loader->load('services/crud.yaml');
|
||||
|
||||
|
||||
$container->setParameter('chill_main_crud_route_loader_config', $config);
|
||||
|
||||
|
||||
$definition = new Definition();
|
||||
$definition
|
||||
->setClass(\Chill\MainBundle\CRUD\Routing\CRUDRoutesLoader::class)
|
||||
->addArgument('%chill_main_crud_route_loader_config%')
|
||||
;
|
||||
|
||||
|
||||
$container->setDefinition('chill_main_crud_route_loader', $definition);
|
||||
|
||||
|
||||
$alreadyExistingNames = [];
|
||||
|
||||
|
||||
foreach ($config as $crudEntry) {
|
||||
$controller = $crudEntry['controller'];
|
||||
$controllerServiceName = 'cscrud_'.$crudEntry['name'].'_controller';
|
||||
$name = $crudEntry['name'];
|
||||
|
||||
|
||||
// check for existing crud names
|
||||
if (\in_array($name, $alreadyExistingNames)) {
|
||||
throw new LogicException(sprintf("the name %s is defined twice in CRUD", $name));
|
||||
}
|
||||
|
||||
|
||||
if (!$container->has($controllerServiceName)) {
|
||||
$controllerDefinition = new Definition($controller);
|
||||
$controllerDefinition->addTag('controller.service_arguments');
|
||||
@@ -250,7 +251,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
$controllerDefinition->setClass($crudEntry['controller']);
|
||||
$container->setDefinition($controllerServiceName, $controllerDefinition);
|
||||
}
|
||||
|
||||
|
||||
$container->setParameter('chill_main_crud_config_'.$name, $crudEntry);
|
||||
$container->getDefinition($controllerServiceName)
|
||||
->addMethodCall('setCrudConfig', ['%chill_main_crud_config_'.$name.'%']);
|
||||
|
@@ -27,6 +27,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Chill\MainBundle\Form\Type\DataTransformer\ObjectToIdTransformer;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Chill\MainBundle\Form\Type\Select2ChoiceType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
|
||||
/**
|
||||
* Extends choice to allow adding select2 library on widget
|
||||
@@ -41,15 +42,26 @@ class Select2CountryType extends AbstractType
|
||||
*/
|
||||
private $requestStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var TranslatableStringHelper
|
||||
*/
|
||||
protected $translatableStringHelper;
|
||||
|
||||
/**
|
||||
* @var ObjectManager
|
||||
*/
|
||||
private $em;
|
||||
|
||||
public function __construct(RequestStack $requestStack,ObjectManager $em)
|
||||
public function __construct(
|
||||
RequestStack $requestStack,
|
||||
ObjectManager $em,
|
||||
TranslatableStringHelper $translatableStringHelper
|
||||
)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
$this->em = $em;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
@@ -75,7 +87,7 @@ class Select2CountryType extends AbstractType
|
||||
$choices = array();
|
||||
|
||||
foreach ($countries as $c) {
|
||||
$choices[$c->getId()] = $c->getName()[$locale];
|
||||
$choices[$c->getId()] = $this->translatableStringHelper->localize($c->getName());
|
||||
}
|
||||
|
||||
asort($choices, SORT_STRING | SORT_FLAG_CASE);
|
||||
|
@@ -27,6 +27,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Chill\MainBundle\Form\Type\DataTransformer\MultipleObjectsToIdTransformer;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Chill\MainBundle\Form\Type\Select2ChoiceType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
|
||||
/**
|
||||
* Extends choice to allow adding select2 library on widget for languages (multiple)
|
||||
@@ -43,10 +44,21 @@ class Select2LanguageType extends AbstractType
|
||||
*/
|
||||
private $em;
|
||||
|
||||
public function __construct(RequestStack $requestStack,ObjectManager $em)
|
||||
/**
|
||||
*
|
||||
* @var TranslatableStringHelper
|
||||
*/
|
||||
protected $translatableStringHelper;
|
||||
|
||||
public function __construct(
|
||||
RequestStack $requestStack,
|
||||
ObjectManager $em,
|
||||
TranslatableStringHelper $translatableStringHelper
|
||||
)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
$this->em = $em;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
@@ -72,7 +84,7 @@ class Select2LanguageType extends AbstractType
|
||||
$choices = array();
|
||||
|
||||
foreach ($languages as $l) {
|
||||
$choices[$l->getId()] = $l->getName()[$locale];
|
||||
$choices[$l->getId()] = $this->translatableStringHelper->localize($l->getName());
|
||||
}
|
||||
|
||||
asort($choices, SORT_STRING | SORT_FLAG_CASE);
|
||||
|
@@ -104,7 +104,7 @@ class Mailer
|
||||
* @param \User $to
|
||||
* @param array $subject Subject of the message [ 0 => $message (required), 1 => $parameters (optional), 3 => $domain (optional) ]
|
||||
* @param array $bodies The bodies. An array where keys are the contentType and values the bodies
|
||||
* @param \callable $callback a callback to customize the message (add attachment, etc.)
|
||||
* @param callable $callback a callback to customize the message (add attachment, etc.)
|
||||
*/
|
||||
public function sendNotification(
|
||||
$recipient,
|
||||
|
@@ -1,7 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import App from 'ChillPersonAssets/js/AccompanyingCourse.vue'
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
render: h => h(App)
|
||||
})
|
@@ -204,7 +204,7 @@ class SearchProvider
|
||||
}
|
||||
|
||||
public function getResultByName($pattern, $name, $start = 0, $limit = 50,
|
||||
array $options = array(), $format)
|
||||
array $options = array(), $format = 'html')
|
||||
{
|
||||
$terms = $this->parse($pattern);
|
||||
$search = $this->getByName($name);
|
||||
|
@@ -32,34 +32,34 @@ use Chill\MainBundle\Entity\GroupCenter;
|
||||
use Chill\MainBundle\Entity\RoleScope;
|
||||
|
||||
/**
|
||||
* Helper for authorizations.
|
||||
*
|
||||
* Helper for authorizations.
|
||||
*
|
||||
* Provides methods for user and entities information.
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class AuthorizationHelper
|
||||
class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var RoleHierarchyInterface
|
||||
*/
|
||||
protected $roleHierarchy;
|
||||
|
||||
|
||||
/**
|
||||
* The role in a hierarchy, given by the parameter
|
||||
* The role in a hierarchy, given by the parameter
|
||||
* `security.role_hierarchy.roles` from the container.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $hierarchy;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var EntityManagerInterface
|
||||
*/
|
||||
protected $em;
|
||||
|
||||
|
||||
public function __construct(
|
||||
RoleHierarchyInterface $roleHierarchy,
|
||||
$hierarchy,
|
||||
@@ -69,10 +69,10 @@ class AuthorizationHelper
|
||||
$this->hierarchy = $hierarchy;
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines if a user is active on this center
|
||||
*
|
||||
*
|
||||
* @param User $user
|
||||
* @param Center $center
|
||||
* @return bool
|
||||
@@ -81,21 +81,21 @@ class AuthorizationHelper
|
||||
{
|
||||
foreach ($user->getGroupCenters() as $groupCenter) {
|
||||
if ($center->getId() === $groupCenter->getCenter()->getId()) {
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Determines if the user has access to the given entity.
|
||||
*
|
||||
*
|
||||
* if the entity implements Chill\MainBundle\Entity\HasScopeInterface,
|
||||
* the scope is taken into account.
|
||||
*
|
||||
*
|
||||
* @param User $user
|
||||
* @param HasCenterInterface $entity the entity may also implement HasScopeInterface
|
||||
* @param string|Role $attribute
|
||||
@@ -103,15 +103,15 @@ class AuthorizationHelper
|
||||
*/
|
||||
public function userHasAccess(User $user, HasCenterInterface $entity, $attribute)
|
||||
{
|
||||
|
||||
|
||||
$center = $entity->getCenter();
|
||||
|
||||
|
||||
if (!$this->userCanReachCenter($user, $center)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$role = ($attribute instanceof Role) ? $attribute : new Role($attribute);
|
||||
|
||||
|
||||
foreach ($user->getGroupCenters() as $groupCenter){
|
||||
//filter on center
|
||||
if ($groupCenter->getCenter()->getId() === $entity->getCenter()->getId()) {
|
||||
@@ -119,7 +119,7 @@ class AuthorizationHelper
|
||||
//iterate on roleScopes
|
||||
foreach($permissionGroup->getRoleScopes() as $roleScope) {
|
||||
//check that the role allow to reach the required role
|
||||
if ($this->isRoleReached($role,
|
||||
if ($this->isRoleReached($role,
|
||||
new Role($roleScope->getRole()))){
|
||||
//if yes, we have a right on something...
|
||||
// perform check on scope if necessary
|
||||
@@ -137,17 +137,17 @@ class AuthorizationHelper
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get reachable Centers for the given user, role,
|
||||
* and optionnaly Scope
|
||||
*
|
||||
*
|
||||
* @param User $user
|
||||
* @param Role $role
|
||||
* @param null|Scope $scope
|
||||
@@ -156,13 +156,13 @@ class AuthorizationHelper
|
||||
public function getReachableCenters(User $user, Role $role, Scope $scope = null)
|
||||
{
|
||||
$centers = array();
|
||||
|
||||
|
||||
foreach ($user->getGroupCenters() as $groupCenter){
|
||||
$permissionGroup = $groupCenter->getPermissionsGroup();
|
||||
//iterate on roleScopes
|
||||
foreach($permissionGroup->getRoleScopes() as $roleScope) {
|
||||
//check that the role is in the reachable roles
|
||||
if ($this->isRoleReached($role,
|
||||
if ($this->isRoleReached($role,
|
||||
new Role($roleScope->getRole()))) {
|
||||
if ($scope === null) {
|
||||
$centers[] = $groupCenter->getCenter();
|
||||
@@ -171,19 +171,19 @@ class AuthorizationHelper
|
||||
if ($scope->getId() == $roleScope->getScope()->getId()){
|
||||
$centers[] = $groupCenter->getCenter();
|
||||
break 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $centers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return all reachable scope for a given user, center and role
|
||||
*
|
||||
*
|
||||
* @deprecated Use getReachableCircles
|
||||
*
|
||||
* @param User $user
|
||||
@@ -195,10 +195,10 @@ class AuthorizationHelper
|
||||
{
|
||||
return $this->getReachableCircles($user, $role, $center);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return all reachable circle for a given user, center and role
|
||||
*
|
||||
*
|
||||
* @param User $user
|
||||
* @param Role $role
|
||||
* @param Center $center
|
||||
@@ -207,7 +207,7 @@ class AuthorizationHelper
|
||||
public function getReachableCircles(User $user, Role $role, Center $center)
|
||||
{
|
||||
$scopes = array();
|
||||
|
||||
|
||||
foreach ($user->getGroupCenters() as $groupCenter){
|
||||
if ($center->getId() === $groupCenter->getCenter()->getId()) {
|
||||
//iterate on permissionGroup
|
||||
@@ -215,7 +215,7 @@ class AuthorizationHelper
|
||||
//iterate on roleScopes
|
||||
foreach($permissionGroup->getRoleScopes() as $roleScope) {
|
||||
//check that the role is in the reachable roles
|
||||
if ($this->isRoleReached($role,
|
||||
if ($this->isRoleReached($role,
|
||||
new Role($roleScope->getRole()))) {
|
||||
|
||||
$scopes[] = $roleScope->getScope();
|
||||
@@ -223,12 +223,12 @@ class AuthorizationHelper
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $scopes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param Role $role
|
||||
* @param Center $center
|
||||
* @param Scope $circle
|
||||
@@ -239,7 +239,7 @@ class AuthorizationHelper
|
||||
$parents = $this->getParentRoles($role);
|
||||
$parents[] = $role;
|
||||
$parentRolesString = \array_map(function(Role $r) { return $r->getRole(); }, $parents);
|
||||
|
||||
|
||||
$qb = $this->em->createQueryBuilder();
|
||||
$qb
|
||||
->select('u')
|
||||
@@ -250,21 +250,21 @@ class AuthorizationHelper
|
||||
->where('gc.center = :center')
|
||||
->andWhere($qb->expr()->in('rs.role', $parentRolesString))
|
||||
;
|
||||
|
||||
|
||||
$qb->setParameter('center', $center);
|
||||
|
||||
|
||||
if ($circle !== null) {
|
||||
$qb->andWhere('rs.scope = :circle')
|
||||
->setParameter('circle', $circle)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test if a parent role may give access to a given child role
|
||||
*
|
||||
*
|
||||
* @param Role $childRole The role we want to test if he is reachable
|
||||
* @param Role $parentRole The role which should give access to $childRole
|
||||
* @return boolean true if the child role is granted by parent role
|
||||
@@ -273,14 +273,14 @@ class AuthorizationHelper
|
||||
{
|
||||
$reachableRoles = $this->roleHierarchy
|
||||
->getReachableRoles([$parentRole]);
|
||||
|
||||
|
||||
return in_array($childRole, $reachableRoles);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return all the role which give access to the given role. Only the role
|
||||
* Return all the role which give access to the given role. Only the role
|
||||
* which are registered into Chill are taken into account.
|
||||
*
|
||||
*
|
||||
* @param Role $role
|
||||
* @return Role[] the role which give access to the given $role
|
||||
*/
|
||||
@@ -291,18 +291,18 @@ class AuthorizationHelper
|
||||
$roles = \array_map(
|
||||
function($string) {
|
||||
return new Role($string);
|
||||
},
|
||||
},
|
||||
\array_keys($this->hierarchy)
|
||||
);
|
||||
|
||||
|
||||
foreach ($roles as $r) {
|
||||
$childRoles = $this->roleHierarchy->getReachableRoleNames([$r->getRole()]);
|
||||
|
||||
|
||||
if (\in_array($role, $childRoles)) {
|
||||
$parentRoles[] = $r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $parentRoles;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Security\Authorization;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
|
||||
interface AuthorizationHelperInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Determines if a user is active on this center
|
||||
*
|
||||
* @param User $user
|
||||
* @param Center $center
|
||||
* @return bool
|
||||
*/
|
||||
public function userCanReachCenter(User $user, Center $center);
|
||||
|
||||
/**
|
||||
*
|
||||
* Determines if the user has access to the given entity.
|
||||
*
|
||||
* if the entity implements Chill\MainBundle\Entity\HasScopeInterface,
|
||||
* the scope is taken into account.
|
||||
*
|
||||
* @param User $user
|
||||
* @param HasCenterInterface $entity the entity may also implement HasScopeInterface
|
||||
* @param string|Role $attribute
|
||||
* @return boolean true if the user has access
|
||||
*/
|
||||
public function userHasAccess(User $user, HasCenterInterface $entity, $attribute);
|
||||
|
||||
/**
|
||||
* Get reachable Centers for the given user, role,
|
||||
* and optionnaly Scope
|
||||
*
|
||||
* @param User $user
|
||||
* @param Role $role
|
||||
* @param null|Scope $scope
|
||||
* @return Center[]
|
||||
*/
|
||||
public function getReachableCenters(User $user, Role $role, Scope $scope = null);
|
||||
|
||||
/**
|
||||
* Return all reachable scope for a given user, center and role
|
||||
*
|
||||
* @deprecated Use getReachableCircles
|
||||
*
|
||||
* @param User $user
|
||||
* @param Role $role
|
||||
* @param Center $center
|
||||
* @return Scope[]
|
||||
*/
|
||||
public function getReachableScopes(User $user, Role $role, Center $center);
|
||||
|
||||
/**
|
||||
* Return all reachable circle for a given user, center and role
|
||||
*
|
||||
* @param User $user
|
||||
* @param Role $role
|
||||
* @param Center $center
|
||||
* @return Scope[]
|
||||
*/
|
||||
public function getReachableCircles(User $user, Role $role, Center $center);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Role $role
|
||||
* @param Center $center
|
||||
* @param Scope $circle
|
||||
* @return Users
|
||||
*/
|
||||
public function findUsersReaching(Role $role, Center $center, Scope $circle = null);
|
||||
|
||||
/**
|
||||
* Return all the role which give access to the given role. Only the role
|
||||
* which are registered into Chill are taken into account.
|
||||
*
|
||||
* @param Role $role
|
||||
* @return Role[] the role which give access to the given $role
|
||||
*/
|
||||
public function getParentRoles(Role $role);
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
class CenterNormalizer implements NormalizerInterface
|
||||
{
|
||||
public function normalize($center, string $format = null, array $context = array())
|
||||
{
|
||||
/** @var Center $center */
|
||||
return [
|
||||
'id' => $center->getId(),
|
||||
'name' => $center->getName()
|
||||
];
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, string $format = null): bool
|
||||
{
|
||||
return $data instanceof Center;
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Serializer\Normalizer;
|
||||
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class DateNormalizer implements NormalizerInterface
|
||||
{
|
||||
public function normalize($date, string $format = null, array $context = array())
|
||||
{
|
||||
/** @var \DateTimeInterface $date */
|
||||
return [
|
||||
'datetime' => $date->format(\DateTimeInterface::ISO8601),
|
||||
'u' => $date->getTimestamp()
|
||||
];
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, string $format = null): bool
|
||||
{
|
||||
return $data instanceof \DateTimeInterface;
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
class UserNormalizer implements NormalizerInterface
|
||||
{
|
||||
public function normalize($user, string $format = null, array $context = array())
|
||||
{
|
||||
/** @var User $user */
|
||||
return [
|
||||
'id' => $user->getId(),
|
||||
'username' => $user->getUsername()
|
||||
];
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, string $format = null): bool
|
||||
{
|
||||
return $data instanceof User;
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* Copyright (C) 2014-2019, Champs Libres Cooperative SCRLFS,
|
||||
* Copyright (C) 2014-2019, Champs Libres Cooperative SCRLFS,
|
||||
* <http://www.champs-libres.coop>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -28,18 +28,18 @@ use Twig\TwigFilter;
|
||||
*
|
||||
* @package Chill\MainBundle\Templating\Entity
|
||||
*/
|
||||
class ChillEntityRenderExtension extends AbstractExtension
|
||||
class ChillEntityRenderExtension extends AbstractExtension implements ChillEntityRenderExtensionInterface
|
||||
{
|
||||
/**
|
||||
* @var ChillEntityRenderInterface
|
||||
* @var ChillEntityRenderInterface
|
||||
*/
|
||||
protected $renders = [];
|
||||
|
||||
|
||||
/**
|
||||
* @var ChillEntityRender
|
||||
*/
|
||||
protected $defaultRender;
|
||||
|
||||
|
||||
/**
|
||||
* ChillEntityRenderExtension constructor.
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ class ChillEntityRenderExtension extends AbstractExtension
|
||||
{
|
||||
$this->defaultRender = new ChillEntityRender();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array|TwigFilter[]
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ class ChillEntityRenderExtension extends AbstractExtension
|
||||
])
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
* @param array $options
|
||||
@@ -76,7 +76,7 @@ class ChillEntityRenderExtension extends AbstractExtension
|
||||
return $this->getRender($entity, $options)
|
||||
->renderString($entity, $options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
* @param array $options
|
||||
@@ -90,7 +90,7 @@ class ChillEntityRenderExtension extends AbstractExtension
|
||||
return $this->getRender($entity, $options)
|
||||
->renderBox($entity, $options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param ChillEntityRenderInterface $render
|
||||
*/
|
||||
@@ -98,7 +98,7 @@ class ChillEntityRenderExtension extends AbstractExtension
|
||||
{
|
||||
$this->renders[] = $render;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
* @param $options
|
||||
|
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Templating\Entity;
|
||||
|
||||
use Twig\Extension\ExtensionInterface;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
interface ChillEntityRenderExtensionInterface extends ExtensionInterface
|
||||
{
|
||||
/**
|
||||
* @return array|TwigFilter[]
|
||||
*/
|
||||
public function getFilters();
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public function renderString($entity, array $options = []): string;
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public function renderBox($entity, array $options = []): string;
|
||||
|
||||
/**
|
||||
* @param ChillEntityRenderInterface $render
|
||||
*/
|
||||
public function addRender(ChillEntityRenderInterface $render);
|
||||
}
|
@@ -23,36 +23,36 @@ use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Translation\Translator;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* This helper helps to find the string in current locale from translatable_strings
|
||||
*
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*
|
||||
*/
|
||||
class TranslatableStringHelper
|
||||
class TranslatableStringHelper implements TranslatableStringHelperInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @var RequestStack
|
||||
*/
|
||||
private $requestStack;
|
||||
|
||||
|
||||
private $fallbackLocales;
|
||||
|
||||
|
||||
public function __construct(RequestStack $requestStack, Translator $translator)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
$this->fallbackLocales = $translator->getFallbackLocales();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return the string in current locale if it exists.
|
||||
*
|
||||
*
|
||||
* If it does not exists; return the name in the first language available.
|
||||
*
|
||||
*
|
||||
* Return a blank string if any strings are available.
|
||||
* Return NULL if $translatableString is NULL
|
||||
*
|
||||
*
|
||||
* @param array $translatableStrings
|
||||
* @return string
|
||||
*/
|
||||
@@ -61,32 +61,32 @@ class TranslatableStringHelper
|
||||
if (NULL === $translatableStrings) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
$language = $this->requestStack->getCurrentRequest()->getLocale();
|
||||
|
||||
|
||||
|
||||
if (isset($translatableStrings[$language])) {
|
||||
|
||||
|
||||
return $translatableStrings[$language];
|
||||
} else {
|
||||
foreach ($this->fallbackLocales as $locale) {
|
||||
if (array_key_exists($locale, $translatableStrings)) {
|
||||
|
||||
|
||||
return $translatableStrings[$locale];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// no fallback translation... trying the first available
|
||||
$langs = array_keys($translatableStrings);
|
||||
|
||||
|
||||
if (count($langs) === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
return $translatableStrings[$langs[0]];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Templating;
|
||||
|
||||
interface TranslatableStringHelperInterface
|
||||
{
|
||||
/**
|
||||
* return the string in current locale if it exists.
|
||||
*
|
||||
* If it does not exists; return the name in the first language available.
|
||||
*
|
||||
* Return a blank string if any strings are available.
|
||||
* Return NULL if $translatableString is NULL
|
||||
*
|
||||
* @param array $translatableStrings
|
||||
* @return string
|
||||
*/
|
||||
public function localize(array $translatableStrings);
|
||||
}
|
@@ -34,7 +34,7 @@ trait PrepareClientTrait
|
||||
* @return \Symfony\Component\BrowserKit\Client
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public function getClient(
|
||||
public function getClientAuthenticated(
|
||||
$username = 'center a_social',
|
||||
$password = 'password'
|
||||
) {
|
||||
|
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Tests\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class DefaultControllerTest extends WebTestCase
|
||||
{
|
||||
public function testIndex()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@@ -9,15 +9,7 @@ class LoginControllerTest extends WebTestCase
|
||||
{
|
||||
public function testLogin()
|
||||
{
|
||||
$client = static::createClient(array(
|
||||
'framework' => array(
|
||||
'default_locale' => 'en',
|
||||
'translator' => array(
|
||||
'fallback' => 'en'
|
||||
)
|
||||
),
|
||||
|
||||
));
|
||||
$client = static::createClient();
|
||||
|
||||
//load login page and submit form
|
||||
$crawler = $client->request('GET', '/login');
|
||||
@@ -42,17 +34,17 @@ class LoginControllerTest extends WebTestCase
|
||||
//on the home page, there must be a logout link
|
||||
$client->followRedirects(true);
|
||||
$crawler = $client->request('GET', '/');
|
||||
|
||||
|
||||
$this->assertRegExp('/center a_social/', $client->getResponse()
|
||||
->getContent());
|
||||
$logoutLinkFilter = $crawler->filter('a:contains("Logout")');
|
||||
$logoutLinkFilter = $crawler->filter('a:contains("Se déconnecter")');
|
||||
|
||||
//check there is > 0 logout link
|
||||
$this->assertGreaterThan(0, $logoutLinkFilter->count(), 'check that a logout link is present');
|
||||
|
||||
//click on logout link
|
||||
$client->followRedirects(false);
|
||||
$client->click($crawler->selectLink('Logout')->link());
|
||||
$client->click($crawler->selectLink('Se déconnecter')->link());
|
||||
|
||||
$this->assertTrue($client->getResponse()->isRedirect());
|
||||
$client->followRedirect(); #redirect to login page
|
||||
|
@@ -32,21 +32,7 @@ use Chill\MainBundle\Search\SearchInterface;
|
||||
*/
|
||||
class SearchControllerTest extends WebTestCase
|
||||
{
|
||||
/*
|
||||
public function setUp()
|
||||
{
|
||||
static::bootKernel();
|
||||
|
||||
//add a default service
|
||||
$this->addSearchService(
|
||||
$this->createDefaultSearchService('<p>I am default</p>', 10), 'default'
|
||||
);
|
||||
//add a domain service
|
||||
$this->addSearchService(
|
||||
$this->createDefaultSearchService('<p>I am domain bar</p>', 20), 'bar'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test the behaviour when no domain is provided in the search pattern :
|
||||
* the default search should be enabled
|
||||
@@ -105,29 +91,6 @@ class SearchControllerTest extends WebTestCase
|
||||
$this->assertTrue($client->getResponse()->isNotFound());
|
||||
}
|
||||
|
||||
|
||||
public function testSearchWithinSpecificSearchName()
|
||||
{
|
||||
/*
|
||||
//add a search service which will be supported
|
||||
$this->addSearchService(
|
||||
$this->createNonDefaultDomainSearchService("<p>I am domain foo</p>", 100, TRUE), 'foo'
|
||||
);
|
||||
|
||||
$client = $this->getAuthenticatedClient();
|
||||
$crawler = $client->request('GET', '/fr/search',
|
||||
array('q' => '@foo default search', 'name' => 'foo'));
|
||||
|
||||
//$this->markTestSkipped();
|
||||
$this->assertEquals(0, $crawler->filter('p:contains("I am default")')->count(),
|
||||
"The mocked default results are not shown");
|
||||
$this->assertEquals(0, $crawler->filter('p:contains("I am domain bar")')->count(),
|
||||
"The mocked non-default results are not shown");
|
||||
$this->assertEquals(1, $crawler->filter('p:contains("I am domain foo")')->count(),
|
||||
"The mocked nnon default results for foo are shown");
|
||||
*/
|
||||
}
|
||||
|
||||
private function getAuthenticatedClient()
|
||||
{
|
||||
return static::createClient(array(), array(
|
||||
|
@@ -37,11 +37,12 @@ class UserControllerTest extends WebTestCase
|
||||
|
||||
$username = 'Test_user'. uniqid();
|
||||
$password = 'Password1234!';
|
||||
dump($crawler->text());
|
||||
// Fill in the form and submit it
|
||||
$form = $crawler->selectButton('Créer')->form(array(
|
||||
'chill_mainbundle_user[username]' => $username,
|
||||
'chill_mainbundle_user[plainPassword][password][first]' => $password,
|
||||
'chill_mainbundle_user[plainPassword][password][second]' => $password
|
||||
'chill_mainbundle_user[plainPassword][first]' => $password,
|
||||
'chill_mainbundle_user[plainPassword][second]' => $password
|
||||
));
|
||||
|
||||
$this->client->submit($form);
|
||||
@@ -119,8 +120,8 @@ class UserControllerTest extends WebTestCase
|
||||
$crawler = $this->client->click($link);
|
||||
|
||||
$form = $crawler->selectButton('Changer le mot de passe')->form(array(
|
||||
'chill_mainbundle_user_password[password][first]' => $newPassword,
|
||||
'chill_mainbundle_user_password[password][second]' => $newPassword,
|
||||
'chill_mainbundle_user_password[new_password][first]' => $newPassword,
|
||||
'chill_mainbundle_user_password[new_password][second]' => $newPassword,
|
||||
));
|
||||
|
||||
$this->client->submit($form);
|
||||
|
@@ -1,179 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
* Copyright (C) 2015 Champs-Libres Coopérative <info@champs-libres.coop>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Tests\DependencyInjection;
|
||||
|
||||
use Chill\MainBundle\DependencyInjection\ConfigConsistencyCompilerPass;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilderInterface;
|
||||
|
||||
/**
|
||||
* Description of ConfigConsistencyCompilerPassTest
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class ConfigConsistencyCompilerPassTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @var \Chill\MainBundle\DependencyInjection\ConfigConsistencyCompilerPass
|
||||
*/
|
||||
private $configConsistencyCompilerPass;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->configConsistencyCompilerPass = new ConfigConsistencyCompilerPass();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that everything is fine is configuration is correct
|
||||
*
|
||||
*/
|
||||
public function testLanguagesArePresent()
|
||||
{
|
||||
try {
|
||||
$this ->configConsistencyCompilerPass
|
||||
->process(
|
||||
$this->mockContainer(
|
||||
$this->mockTranslatorDefinition(array('fr')),
|
||||
array('fr', 'nl')
|
||||
)
|
||||
);
|
||||
$this->assertTrue(TRUE, 'the config consistency can process');
|
||||
} catch (\Exception $ex) {
|
||||
$this->assertTrue(FALSE,
|
||||
'the config consistency can process');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that everything is fine is configuration is correct
|
||||
* if multiple fallback languages are present
|
||||
*
|
||||
*/
|
||||
public function testMultiplesLanguagesArePresent()
|
||||
{
|
||||
try {
|
||||
$this ->configConsistencyCompilerPass
|
||||
->process(
|
||||
$this->mockContainer(
|
||||
$this->mockTranslatorDefinition(array('fr', 'nl')),
|
||||
array('fr', 'nl', 'en')
|
||||
)
|
||||
);
|
||||
$this->assertTrue(TRUE, 'the config consistency can process');
|
||||
} catch (\Exception $ex) {
|
||||
$this->assertTrue(FALSE,
|
||||
'the config consistency can process');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test that a runtime exception is throw if the available language does
|
||||
* not contains the fallback locale
|
||||
*
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessageRegExp /The chill_main.available_languages parameter does not contains fallback locales./
|
||||
*/
|
||||
public function testLanguageNotPresent()
|
||||
{
|
||||
$container = $this->mockContainer(
|
||||
$this->mockTranslatorDefinition(array('en')), array('fr')
|
||||
);
|
||||
|
||||
$this->configConsistencyCompilerPass->process($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a logic exception is thrown if the setFallbackLocale
|
||||
* method is not defined in translator definition
|
||||
*
|
||||
* @expectedException \LogicException
|
||||
*/
|
||||
public function testSetFallbackNotDefined()
|
||||
{
|
||||
$container = $this->mockContainer(
|
||||
$this->mockTranslatorDefinition(NULL), array('fr')
|
||||
);
|
||||
$this->configConsistencyCompilerPass->process($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ContainerBuilder
|
||||
*/
|
||||
private function mockContainer($definition, $availableLanguages)
|
||||
{
|
||||
$container = $this
|
||||
->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
|
||||
->getMock();
|
||||
|
||||
$container->method('getParameter')
|
||||
->will($this->returnCallback(
|
||||
function($parameter) use ($availableLanguages) {
|
||||
if ($parameter === 'chill_main.available_languages') {
|
||||
return $availableLanguages;
|
||||
} else {
|
||||
throw new \LogicException("the parameter '$parameter' "
|
||||
. "is not defined in stub test");
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
$container->method('findDefinition')
|
||||
->will($this->returnCallback(
|
||||
function($id) use ($definition) {
|
||||
if (in_array($id, array('translator', 'translator.default'))) {
|
||||
return $definition;
|
||||
} else {
|
||||
throw new \LogicException("the id $id is not defined in test");
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
return $container;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $languages
|
||||
* @return 'Symfony\Component\DependencyInjection\Definition'
|
||||
*/
|
||||
private function mockTranslatorDefinition(array $languages = NULL)
|
||||
{
|
||||
$definition = $this
|
||||
->getMockBuilder('Symfony\Component\DependencyInjection\Definition')
|
||||
->getMock();
|
||||
|
||||
if (NULL !== $languages) {
|
||||
$definition->method('getMethodCalls')
|
||||
->willReturn(array(
|
||||
['setFallbackLocales', array($languages)]
|
||||
));
|
||||
} else {
|
||||
$definition->method('getMethodCalls')
|
||||
->willReturn(array(['nothing', array()]));
|
||||
}
|
||||
|
||||
return $definition;
|
||||
}
|
||||
}
|
@@ -45,11 +45,6 @@ class ExportManagerTest extends KernelTestCase
|
||||
use \Chill\MainBundle\Test\PrepareUserTrait;
|
||||
use \Chill\MainBundle\Test\PrepareScopeTrait;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -65,8 +60,6 @@ class ExportManagerTest extends KernelTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->container = self::$kernel->getContainer();
|
||||
|
||||
$this->prophet = new \Prophecy\Prophet;
|
||||
}
|
||||
|
||||
@@ -97,7 +90,7 @@ class ExportManagerTest extends KernelTestCase
|
||||
\Symfony\Component\Security\Core\User\UserInterface $user = null
|
||||
)
|
||||
{
|
||||
$localUser = $user === NULL ? $this->container->get('doctrine.orm.entity_manager')
|
||||
$localUser = $user === NULL ? self::$container->get('doctrine.orm.entity_manager')
|
||||
->getRepository('ChillMainBundle:User')
|
||||
->findOneBy(array('username' => 'center a_social')) :
|
||||
$user;
|
||||
@@ -106,10 +99,10 @@ class ExportManagerTest extends KernelTestCase
|
||||
$tokenStorage->setToken($token);
|
||||
|
||||
return new ExportManager(
|
||||
$logger === NULL ? $this->container->get('logger') : $logger,
|
||||
$em === NULL ? $this->container->get('doctrine.orm.entity_manager') : $em,
|
||||
$authorizationChecker === NULL ? $this->container->get('security.authorization_checker') : $authorizationChecker,
|
||||
$authorizationHelper === NULL ? $this->container->get('chill.main.security.authorization.helper') : $authorizationHelper,
|
||||
$logger === NULL ? self::$container->get('logger') : $logger,
|
||||
$em === NULL ? self::$container->get('doctrine.orm.entity_manager') : $em,
|
||||
$authorizationChecker === NULL ? self::$container->get('security.authorization_checker') : $authorizationChecker,
|
||||
$authorizationHelper === NULL ? self::$container->get('chill.main.security.authorization.helper') : $authorizationHelper,
|
||||
$tokenStorage)
|
||||
;
|
||||
}
|
||||
@@ -544,7 +537,7 @@ class ExportManagerTest extends KernelTestCase
|
||||
|
||||
$export = $this->prophet->prophesize();
|
||||
$export->willImplement(ExportInterface::class);
|
||||
$em = $this->container->get('doctrine.orm.entity_manager');
|
||||
$em = self::$container->get('doctrine.orm.entity_manager');
|
||||
$export->initiateQuery(
|
||||
Argument::is(array('foo')),
|
||||
Argument::Type('array'),
|
||||
@@ -627,12 +620,13 @@ class ExportManagerTest extends KernelTestCase
|
||||
|
||||
//add formatter interface
|
||||
$formatter = new \Chill\MainBundle\Export\Formatter\SpreadSheetFormatter(
|
||||
$this->container->get('translator'), $exportManager);
|
||||
self::$container->get('translator'), $exportManager);
|
||||
$exportManager->addFormatter($formatter, 'spreadsheet');
|
||||
|
||||
//ob_start();
|
||||
$response = $exportManager->generate('dummy',
|
||||
array(PickCenterType::CENTERS_IDENTIFIERS => array($center)),
|
||||
$response = $exportManager->generate(
|
||||
'dummy',
|
||||
array($center),
|
||||
array(
|
||||
ExportType::FILTER_KEY => array(
|
||||
'filter_foo' => array(
|
||||
|
@@ -54,13 +54,20 @@ class PageTest extends KernelTestCase
|
||||
$number = 1,
|
||||
$itemPerPage = 10,
|
||||
$route = 'route',
|
||||
array $routeParameters = array()
|
||||
array $routeParameters = array(),
|
||||
$totalItems = 100
|
||||
) {
|
||||
$urlGenerator = $this->prophet->prophesize();
|
||||
$urlGenerator->willImplement(UrlGeneratorInterface::class);
|
||||
|
||||
return new Page($number, $itemPerPage, $urlGenerator->reveal(), $route,
|
||||
$routeParameters);
|
||||
return new Page(
|
||||
$number,
|
||||
$itemPerPage,
|
||||
$urlGenerator->reveal(),
|
||||
$route,
|
||||
$routeParameters,
|
||||
$totalItems
|
||||
);
|
||||
}
|
||||
|
||||
public function testPageNumber() {
|
||||
|
@@ -21,9 +21,10 @@ namespace Chill\MainBundle\Test\Search;
|
||||
|
||||
use Chill\MainBundle\Search\SearchProvider;
|
||||
use Chill\MainBundle\Search\SearchInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
|
||||
class SearchProviderTest extends \PHPUnit\Framework\TestCase
|
||||
class SearchProviderTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -311,4 +312,4 @@ class SearchProviderTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
return $mock;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class AuthorizationHelperTest extends KernelTestCase
|
||||
*/
|
||||
private function getAuthorizationHelper()
|
||||
{
|
||||
return static::$kernel->getContainer()
|
||||
return static::$container
|
||||
->get('chill.main.security.authorization.helper')
|
||||
;
|
||||
}
|
||||
|
@@ -39,8 +39,7 @@ class TokenManagerTest extends KernelTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$logger = self::$kernel
|
||||
->getContainer()
|
||||
$logger = self::$container
|
||||
->get('logger');
|
||||
|
||||
$this->tokenManager = new TokenManager('secret', $logger);
|
||||
|
@@ -36,53 +36,19 @@ class ChillMenuTwigFunctionTest extends KernelTestCase
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::bootKernel(array('environment' => 'test'));
|
||||
static::$templating = static::$kernel
|
||||
->getContainer()->get('templating');
|
||||
static::$templating = static::$container
|
||||
->get('templating');
|
||||
$pathToBundle = static::$container->getParameter('kernel.bundles_metadata')['ChillMainBundle']['path'];
|
||||
//load templates in Tests/Resources/views
|
||||
static::$kernel->getContainer()->get('twig.loader')
|
||||
->addPath(static::$kernel->getContainer()->getParameter('kernel.root_dir')
|
||||
.'/Resources/views/', $namespace = 'tests');
|
||||
static::$container->get('twig.loader')
|
||||
->addPath($pathToBundle.'/Resources/test/views/', $namespace = 'tests');
|
||||
}
|
||||
|
||||
public function testNormalMenu()
|
||||
{
|
||||
$content = static::$templating->render('@tests/menus/normalMenu.html.twig');
|
||||
$crawler = new Crawler($content);
|
||||
|
||||
$ul = $crawler->filter('ul')->getNode(0);
|
||||
$this->assertEquals( 'ul', $ul->tagName);
|
||||
|
||||
$lis = $crawler->filter('ul')->children();
|
||||
$this->assertEquals(3, count($lis));
|
||||
|
||||
$lis->each(function(Crawler $node, $i) {
|
||||
$this->assertEquals('li', $node->getNode(0)->tagName);
|
||||
|
||||
$a = $node->children()->getNode(0);
|
||||
$this->assertEquals('a', $a->tagName);
|
||||
switch($i) {
|
||||
case 0:
|
||||
$this->assertEquals('/dummy?param=fake', $a->getAttribute('href'));
|
||||
$this->assertEquals('active', $a->getAttribute('class'));
|
||||
$this->assertEquals('test0', $a->nodeValue);
|
||||
break;
|
||||
case 1:
|
||||
$this->assertEquals('/dummy1?param=fake', $a->getAttribute('href'));
|
||||
$this->assertEmpty($a->getAttribute('class'));
|
||||
$this->assertEquals('test1', $a->nodeValue);
|
||||
break;
|
||||
case 3:
|
||||
$this->assertEquals('/dummy2/fake', $a->getAttribute('href'));
|
||||
$this->assertEmpty($a->getAttribute('class'));
|
||||
$this->assertEquals('test2', $a->nodeValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function testMenuOverrideTemplate()
|
||||
{
|
||||
$this->markTestSkipped("this hacks seems not working now");
|
||||
$content = static::$templating->render('@tests/menus/overrideTemplate.html.twig');
|
||||
$this->assertEquals('fake template', $content);
|
||||
$this->assertContains('ul', $content,
|
||||
"test that the file contains an ul tag"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ class MenuComposerTest extends KernelTestCase
|
||||
public function setUp()
|
||||
{
|
||||
self::bootKernel(array('environment' => 'test'));
|
||||
$this->menuComposer = static::$kernel->getContainer()
|
||||
$this->menuComposer = static::$container
|
||||
->get('chill.main.menu_composer');
|
||||
}
|
||||
|
||||
@@ -42,50 +42,5 @@ class MenuComposerTest extends KernelTestCase
|
||||
$routes = $this->menuComposer->getRoutesFor('dummy0');
|
||||
|
||||
$this->assertInternalType('array', $routes);
|
||||
$this->assertCount(3, $routes);
|
||||
//check that the keys are sorted
|
||||
$orders = array_keys($routes);
|
||||
foreach ($orders as $key => $order){
|
||||
if (array_key_exists($key + 1, $orders)) {
|
||||
$this->assertGreaterThan($order, $orders[$key + 1],
|
||||
'Failing to assert that routes are ordered');
|
||||
}
|
||||
}
|
||||
|
||||
//check that the array are identical, order is not important :
|
||||
|
||||
$expected = array(
|
||||
50 => array(
|
||||
'key' => 'chill_main_dummy_0',
|
||||
'label' => 'test0',
|
||||
'otherkey' => 'othervalue'
|
||||
),
|
||||
51 => array(
|
||||
'key' => 'chill_main_dummy_1',
|
||||
'label' => 'test1',
|
||||
'helper'=> 'great helper'
|
||||
),
|
||||
52 => array(
|
||||
'key' => 'chill_main_dummy_2',
|
||||
'label' => 'test2'
|
||||
));
|
||||
|
||||
|
||||
foreach ($expected as $order => $route ){
|
||||
|
||||
}
|
||||
|
||||
//compare arrays
|
||||
foreach($expected as $order => $route) {
|
||||
//check the key are the one expected
|
||||
$this->assertTrue(isset($routes[$order]));
|
||||
|
||||
if (isset($routes[$order])){ #avoid an exception if routes with order does not exists
|
||||
//sort arrays. Order matters for phpunit::assertSame
|
||||
ksort($route);
|
||||
ksort($routes[$order]);
|
||||
$this->assertSame($route, $routes[$order]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -29,40 +29,40 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class TimelineBuilder implements ContainerAwareInterface
|
||||
class TimelineBuilder implements ContainerAwareInterface, TimelineBuilderInterface
|
||||
{
|
||||
|
||||
|
||||
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Doctrine\ORM\EntityManagerInterface
|
||||
*/
|
||||
private $em;
|
||||
|
||||
|
||||
/**
|
||||
* Record provider
|
||||
*
|
||||
*
|
||||
* This array has the structure `[ 'service id' => $service ]`
|
||||
*
|
||||
* @var TimelineProviderInterface[]
|
||||
*/
|
||||
private $providers = [];
|
||||
|
||||
|
||||
/**
|
||||
* Record provider and their context
|
||||
*
|
||||
*
|
||||
* This array has the structure `[ 'context' => [ 'service id' ] ]`
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $providersByContext = [];
|
||||
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return an HTML string with timeline
|
||||
*
|
||||
@@ -79,18 +79,18 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
public function getTimelineHTML($context, array $args, $firstItem = 0, $number = 20)
|
||||
{
|
||||
$union = $this->buildUnionQuery($context, $args);
|
||||
|
||||
|
||||
//add ORDER BY clause and LIMIT
|
||||
$query = $union . sprintf(' ORDER BY date DESC LIMIT %d OFFSET %d',
|
||||
$number, $firstItem);
|
||||
|
||||
|
||||
// run query and handle results
|
||||
$fetched = $this->runUnionQuery($query);
|
||||
$entitiesByKey = $this->getEntities($fetched, $context);
|
||||
|
||||
|
||||
return $this->render($fetched, $entitiesByKey, $context, $args);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the number of items for the given context and args
|
||||
*
|
||||
@@ -101,17 +101,17 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
public function countItems($context, array $args)
|
||||
{
|
||||
$union = $this->buildUnionQuery($context, $args);
|
||||
|
||||
|
||||
// embed the union query inside a count query
|
||||
$count = sprintf('SELECT COUNT(sq.id) AS total FROM (%s) as sq', $union);
|
||||
|
||||
|
||||
$rsm = (new ResultSetMapping())
|
||||
->addScalarResult('total', 'total', Type::INTEGER);
|
||||
|
||||
|
||||
return $this->em->createNativeQuery($count, $rsm)
|
||||
->getSingleScalarResult();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add a provider id
|
||||
*
|
||||
@@ -125,7 +125,7 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
$this->providersByContext[$context][] = $id;
|
||||
$this->providers[$id] = $provider;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get providers by context
|
||||
*
|
||||
@@ -139,16 +139,16 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
throw new \LogicException(sprintf('No builders have been defined for "%s"'
|
||||
. ' context', $context));
|
||||
}
|
||||
|
||||
|
||||
$providers = [];
|
||||
|
||||
|
||||
foreach($this->providersByContext[$context] as $providerId) {
|
||||
$providers[] = $this->providers[$providerId];
|
||||
}
|
||||
|
||||
|
||||
return $providers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* build the UNION query with all providers
|
||||
*
|
||||
@@ -170,10 +170,10 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
$append = ($union === '') ? $select : ' UNION '.$select;
|
||||
$union .= $append;
|
||||
}
|
||||
|
||||
|
||||
return $union;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return the SQL SELECT query as a string,
|
||||
*
|
||||
@@ -186,7 +186,7 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
private function buildSelectQuery(TimelineProviderInterface $provider, $context, array $args)
|
||||
{
|
||||
$data = $provider->fetchQuery($context, $args);
|
||||
|
||||
|
||||
return sprintf(
|
||||
'SELECT %s AS id, '
|
||||
. '%s AS "date", '
|
||||
@@ -199,7 +199,7 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
$data['FROM'],
|
||||
$data['WHERE']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* run the UNION query and return result as an array
|
||||
*
|
||||
@@ -212,11 +212,11 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
->addScalarResult('id', 'id')
|
||||
->addScalarResult('type', 'type')
|
||||
->addScalarResult('date', 'date');
|
||||
|
||||
|
||||
return $this->em->createNativeQuery($query, $resultSetMapping)
|
||||
->getArrayResult();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $queriedIds
|
||||
@@ -227,11 +227,11 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
{
|
||||
//gather entities by type to pass all id with same type to the TimelineProvider.
|
||||
$idsByType = array();
|
||||
|
||||
|
||||
foreach($queriedIds as $result) {
|
||||
$idsByType[$result['type']][] = $result['id'];
|
||||
}
|
||||
|
||||
|
||||
//fetch entities from providers
|
||||
$entitiesByType = array();
|
||||
foreach ($idsByType as $type => $ids) {
|
||||
@@ -243,10 +243,10 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $entitiesByType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* render the timeline as HTML
|
||||
*
|
||||
@@ -269,17 +269,17 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
$timelineEntry['date'] = new \DateTime($result['date']);
|
||||
$timelineEntry['template'] = $data['template'];
|
||||
$timelineEntry['template_data'] = $data['template_data'];
|
||||
|
||||
|
||||
$timelineEntries[] = $timelineEntry;
|
||||
}
|
||||
|
||||
|
||||
return $this->container->get('templating')
|
||||
->render('@ChillMain/Timeline/index.html.twig', array(
|
||||
'results' => $timelineEntries
|
||||
));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the template data from the provider for the given entity, by type.
|
||||
*
|
||||
|
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015 Champs-Libres Coopérative <info@champs-libres.coop>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Timeline;
|
||||
|
||||
interface TimelineBuilderInterface
|
||||
{
|
||||
}
|
@@ -56,7 +56,7 @@ module.exports = function(encore, entries)
|
||||
// Chill2 new assets
|
||||
encore.addEntry('forkawesome', __dirname + '/Resources/public/modules/forkawesome/index.js');
|
||||
encore.addEntry('bootstrap', __dirname + '/Resources/public/modules/bootstrap/index.js');
|
||||
encore.addEntry('vuejs', __dirname + '/Resources/public/modules/vue/index.js');
|
||||
//encore.addEntry('vuejs', __dirname + '/Resources/public/modules/vue/index.js');
|
||||
|
||||
// CKEditor5
|
||||
buildCKEditor(encore);
|
||||
|
@@ -86,7 +86,3 @@ login_check:
|
||||
|
||||
logout:
|
||||
path: /logout
|
||||
|
||||
chill_main_test:
|
||||
path: /{_locale}/main/test
|
||||
controller: Chill\MainBundle\Controller\DefaultController::testAction
|
||||
|
@@ -10,6 +10,7 @@ services:
|
||||
- "@translator.default"
|
||||
|
||||
Chill\MainBundle\Templating\TranslatableStringHelper: '@chill.main.helper.translatable_string'
|
||||
Chill\MainBundle\Templating\TranslatableStringHelperInterface: Chill\MainBundle\Templating\TranslatableStringHelper
|
||||
|
||||
chill.main.twig.translatable_string:
|
||||
class: Chill\MainBundle\Templating\TranslatableStringTwig
|
||||
@@ -19,14 +20,14 @@ services:
|
||||
- [ setContainer, ["@service_container"]]
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
|
||||
chill.main.twig.widget:
|
||||
class: Chill\MainBundle\Templating\Widget\WidgetRenderingTwig
|
||||
arguments:
|
||||
- "@event_dispatcher"
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
|
||||
chill.main.twig.csv_cell:
|
||||
class: Chill\MainBundle\Templating\CSVCellTwig
|
||||
tags:
|
||||
|
@@ -23,6 +23,7 @@ services:
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: form.type, alias: select2_chill_country }
|
||||
|
||||
@@ -31,6 +32,7 @@ services:
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: form.type, alias: select2_chill_language }
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
services:
|
||||
services:
|
||||
chill.main.security.authorization.helper:
|
||||
class: Chill\MainBundle\Security\Authorization\AuthorizationHelper
|
||||
arguments:
|
||||
@@ -6,47 +6,48 @@ services:
|
||||
$hierarchy: "%security.role_hierarchy.roles%"
|
||||
$em: '@Doctrine\ORM\EntityManagerInterface'
|
||||
Chill\MainBundle\Security\Authorization\AuthorizationHelper: '@chill.main.security.authorization.helper'
|
||||
|
||||
Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface: Chill\MainBundle\Security\Authorization\AuthorizationHelper
|
||||
|
||||
chill.main.role_provider:
|
||||
class: Chill\MainBundle\Security\RoleProvider
|
||||
|
||||
|
||||
chill.main.user_provider:
|
||||
class: Chill\MainBundle\Security\UserProvider\UserProvider
|
||||
arguments:
|
||||
$em: '@Doctrine\ORM\EntityManagerInterface'
|
||||
|
||||
|
||||
Chill\MainBundle\Security\Authorization\ChillExportVoter:
|
||||
arguments:
|
||||
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
Chill\MainBundle\Security\PasswordRecover\TokenManager:
|
||||
|
||||
Chill\MainBundle\Security\PasswordRecover\TokenManager:
|
||||
arguments:
|
||||
$secret: '%kernel.secret%'
|
||||
$logger: '@Psr\Log\LoggerInterface'
|
||||
|
||||
|
||||
Chill\MainBundle\Security\PasswordRecover\RecoverPasswordHelper:
|
||||
arguments:
|
||||
$tokenManager: '@Chill\MainBundle\Security\PasswordRecover\TokenManager'
|
||||
$urlGenerator: '@Symfony\Component\Routing\Generator\UrlGeneratorInterface'
|
||||
$mailer: '@Chill\MainBundle\Notification\Mailer'
|
||||
$routeParameters: "%chill_main.notifications%"
|
||||
|
||||
|
||||
Chill\MainBundle\Security\PasswordRecover\PasswordRecoverEventSubscriber:
|
||||
arguments:
|
||||
$locker: '@Chill\MainBundle\Security\PasswordRecover\PasswordRecoverLocker'
|
||||
tags:
|
||||
- { name: kernel.event_subscriber }
|
||||
|
||||
|
||||
Chill\MainBundle\Security\PasswordRecover\PasswordRecoverLocker:
|
||||
arguments:
|
||||
$chillRedis: '@Chill\MainBundle\Redis\ChillRedis'
|
||||
$logger: '@Psr\Log\LoggerInterface'
|
||||
|
||||
|
||||
Chill\MainBundle\Security\PasswordRecover\PasswordRecoverVoter:
|
||||
arguments:
|
||||
$locker: '@Chill\MainBundle\Security\PasswordRecover\PasswordRecoverLocker'
|
||||
$requestStack: '@Symfony\Component\HttpFoundation\RequestStack'
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
- { name: security.voter }
|
||||
|
13
src/Bundle/ChillMainBundle/config/services/serializer.yaml
Normal file
13
src/Bundle/ChillMainBundle/config/services/serializer.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
services:
|
||||
Chill\MainBundle\Serializer\Normalizer\CenterNormalizer:
|
||||
tags:
|
||||
- { name: 'serializer.normalizer', priority: 64 }
|
||||
|
||||
Chill\MainBundle\Serializer\Normalizer\DateNormalizer:
|
||||
tags:
|
||||
- { name: 'serializer.normalizer', priority: 64 }
|
||||
|
||||
Chill\MainBundle\Serializer\Normalizer\UserNormalizer:
|
||||
tags:
|
||||
- { name: 'serializer.normalizer', priority: 64 }
|
@@ -30,6 +30,7 @@ services:
|
||||
Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension:
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
Chill\MainBundle\Templating\Entity\ChillEntityRenderExtensionInterface: Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension
|
||||
|
||||
Chill\MainBundle\Templating\Entity\CommentRender:
|
||||
arguments:
|
||||
@@ -37,7 +38,7 @@ services:
|
||||
- '@Symfony\Component\Templating\EngineInterface'
|
||||
tags:
|
||||
- { name: 'chill.render_entity' }
|
||||
|
||||
|
||||
Chill\MainBundle\Templating\ChillMarkdownRenderExtension:
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
@@ -4,4 +4,6 @@ services:
|
||||
arguments:
|
||||
- "@doctrine.orm.entity_manager"
|
||||
calls:
|
||||
- [ setContainer, ["@service_container"]]
|
||||
- [ setContainer, ["@service_container"]]
|
||||
|
||||
Chill\MainBundle\Timeline\TimelineBuilderInterface: "@chill_main.timeline_builder"
|
||||
|
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\PersonBundle\Repository;
|
||||
|
||||
/**
|
||||
* PersonAltNameRepository
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class PersonAltNameRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
@@ -1,78 +0,0 @@
|
||||
.chill-blue, div.person-view div.custom-fields figure.person-details div.cf_title_box:nth-child(4n+4) h2 {
|
||||
color: #334d5c; }
|
||||
|
||||
.chill-green, div.person-view div.custom-fields figure.person-details div.cf_title_box:nth-child(4n+2) h2 {
|
||||
color: #43b29d; }
|
||||
|
||||
.chill-green-dark {
|
||||
color: #328474; }
|
||||
|
||||
.chill-yellow {
|
||||
color: #eec84a; }
|
||||
|
||||
.chill-orange, div.person-view div.custom-fields figure.person-details div.cf_title_box:nth-child(4n+3) h2 {
|
||||
color: #e2793d; }
|
||||
|
||||
.chill-red, div.person-view div.custom-fields figure.person-details div.cf_title_box:nth-child(4n+1) h2 {
|
||||
color: #df4949; }
|
||||
|
||||
.chill-gray {
|
||||
color: #ececec; }
|
||||
|
||||
.chill-beige {
|
||||
color: #cabb9f; }
|
||||
|
||||
.chill-pink {
|
||||
color: #dd506d; }
|
||||
|
||||
.chill-dark-gray {
|
||||
color: #333333; }
|
||||
|
||||
.chill-light-gray {
|
||||
color: #b2b2b2; }
|
||||
|
||||
div#header-person-name {
|
||||
background: none repeat scroll 0 0 #328474;
|
||||
color: #FFF;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em; }
|
||||
|
||||
div#header-person-details {
|
||||
background: none repeat scroll 0 0 #43b29d;
|
||||
color: #FFF;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em; }
|
||||
|
||||
div#person_details_container {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px; }
|
||||
|
||||
div.person-view {
|
||||
/* custom fields on the home page */ }
|
||||
div.person-view figure.person-details {
|
||||
/* background-color: $black;
|
||||
padding-top: 0.2em;
|
||||
padding-bottom: 0.2em;
|
||||
}*/ }
|
||||
div.person-view figure.person-details h2 {
|
||||
font-family: 'Open Sans';
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.3em;
|
||||
font-variant: small-caps; }
|
||||
div.person-view figure.person-details dl {
|
||||
margin-top: 0.3em; }
|
||||
div.person-view figure.person-details dt {
|
||||
font-family: 'Open Sans';
|
||||
font-weight: 600; }
|
||||
div.person-view figure.person-details dd {
|
||||
margin-left: 0; }
|
||||
div.person-view div.custom-fields figure.person-details {
|
||||
display: flex;
|
||||
flex-flow: row wrap; }
|
||||
div.person-view div.custom-fields figure.person-details div.cf_title_box:nth-child(2n+1) {
|
||||
width: 50%;
|
||||
margin-right: 40px; }
|
||||
div.person-view div.custom-fields figure.person-details iv.cf_title_box:nth-child(2n+2) {
|
||||
width: calc(50% - 40px); }
|
||||
|
||||
/*# sourceMappingURL=person.css.map */
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"mappings": "AAkBE,wGAA+B;EAC7B,KAAK,EAJI,OAAO;;AAGlB,yGAA+B;EAC7B,KAAK,EAJY,OAAO;;AAG1B,iBAA+B;EAC7B,KAAK,EAJoB,OAAO;;AAGlC,aAA+B;EAC7B,KAAK,EAJ4B,OAAO;;AAG1C,0GAA+B;EAC7B,KAAK,EAJoC,OAAO;;AAGlD,uGAA+B;EAC7B,KAAK,EAJ4C,OAAO;;AAG1D,WAA+B;EAC7B,KAAK,EAJoD,OAAO;;AAGlE,YAA+B;EAC7B,KAAK,EAJ4D,OAAO;;AAG1E,WAA+B;EAC7B,KAAK,EAJoE,OAAO;;AAGlF,gBAA+B;EAC7B,KAAK,EAJ4E,OAAO;;AAG1F,iBAA+B;EAC7B,KAAK,EAJoF,OAAO;;ACZpG,sBAAuB;EACnB,UAAU,EAAE,8BAAwC;EACpD,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,GAAG;EAChB,cAAc,EAAE,GAAG;;AAGvB,yBAA0B;EACtB,UAAU,EAAE,8BAAmC;EAC/C,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,GAAG;EAChB,cAAc,EAAE,GAAG;;AAGvB,4BAA6B;EAC5B,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;;AAGrB,eAAgB;EA6BZ,oCAAoC;EA5BpC,qCAAsB;IAsB1B;;;mBAGe;IAxBH,wCAAG;MACC,WAAW,EAAE,WAAW;MACxB,WAAW,EAAE,GAAG;MAChB,aAAa,EAAE,KAAK;MACpB,YAAY,EAAE,UAAU;IAG5B,wCAAG;MACK,UAAU,EAAE,KAAK;IAGzB,wCAAG;MACH,WAAW,EAAE,WAAW;MACxB,WAAW,EAAE,GAAG;IAGhB,wCAAG;MACK,WAAW,EAAE,CAAC;EAY1B,uDAAsB;IAClB,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,QAAQ;IAkBnB,wFAAgC;MAC5B,KAAK,EAAE,GAAG;MACV,YAAY,EAAE,IAAI;IAGtB,uFAAgC;MAC5B,KAAK,EAAE,gBAAgB",
|
||||
"sources": ["../../../../main/Resources/public/sass/custom/config/_colors.scss","../sass/person.scss"],
|
||||
"names": [],
|
||||
"file": "person.css"
|
||||
}
|
@@ -1 +0,0 @@
|
||||
require('./sass/person.scss');
|
@@ -1,19 +0,0 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<persons_associated></persons_associated>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import persons_associated from './components/PersonsAssociated.vue'
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {
|
||||
persons_associated,
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
@@ -1,88 +0,0 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>Usagers concernés</h3>
|
||||
<dl>
|
||||
<dt>id</dt>
|
||||
<dd>{{ persons_associated.id }}</dd>
|
||||
<dt>opening_date</dt>
|
||||
<dd>{{ persons_associated.opening_date }}</dd>
|
||||
<dt>closing_date</dt>
|
||||
<dd>{{ persons_associated.closing_date }}</dd>
|
||||
<dt>remark</dt>
|
||||
<dd>{{ persons_associated.remark }}</dd>
|
||||
<dt>closing_motive</dt>
|
||||
<dd>{{ persons_associated.closing_motive }}</dd>
|
||||
</dl>
|
||||
<label>{{counter}} usagers concernés</label>
|
||||
<table class="rounded">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chill-orange">firstname</th>
|
||||
<th class="chill-orange">lastname</th>
|
||||
<th class="chill-orange">startdate</th>
|
||||
<th class="chill-orange">enddate</th>
|
||||
<th class="chill-orange">actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="person in persons_associated.persons">
|
||||
<td>{{ person.firstname }}</td>
|
||||
<td>{{ person.lastname }}</td>
|
||||
<td>{{ person.startdate }}</td>
|
||||
<td>{{ person.enddate }}</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li><a class="sc-button bt-show"></a></li>
|
||||
<li><a class="sc-button bt-update"></a></li>
|
||||
<li><a class="sc-button bt-delete"></a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="sc-button bt-create" @click="addPerson">Add Person</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import VueResource from 'vue-resource'
|
||||
|
||||
Vue.use(VueResource)
|
||||
|
||||
export default{
|
||||
data () {
|
||||
return {
|
||||
persons_associated: []
|
||||
}
|
||||
},
|
||||
http: {
|
||||
root: 'http://localhost:8001/fr/api'
|
||||
},
|
||||
methods: {
|
||||
addPerson(){
|
||||
this.persons_associated.persons.push({"firstname": "Lisa", "lastname": "Simpson", "startdate": "1975-09-15", "enddate": "2021-04-20" })
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
counter() {
|
||||
return this.persons_associated.persons.length
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$resource('parcours/861/show').get().then((response) => {
|
||||
this.persons_associated = response.data
|
||||
}, (response) => {
|
||||
console.log('erreur', response);
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
@@ -1,5 +0,0 @@
|
||||
require('./phone-alt-solid.svg');
|
||||
require('./mobile-alt-solid.svg');
|
||||
require('./person_by_phonenumber.scss');
|
||||
|
||||
|
@@ -1 +0,0 @@
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="mobile-alt" class="svg-inline--fa fa-mobile-alt fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"></path></svg>
|
Before Width: | Height: | Size: 516 B |
@@ -1,88 +0,0 @@
|
||||
|
||||
@import '~ChillMainSass/custom/config/colors';
|
||||
|
||||
div#header-person-name {
|
||||
background: none repeat scroll 0 0 $chill-green-dark;
|
||||
color: #FFF;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
div#header-person-details {
|
||||
background: none repeat scroll 0 0 $chill-green;
|
||||
color: #FFF;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
div#person_details_container {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
div.person-view {
|
||||
figure.person-details {
|
||||
h2 {
|
||||
font-family: 'Open Sans';
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.3em;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
dl {
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-family: 'Open Sans';
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
// a.sc-button {
|
||||
/* background-color: $black;
|
||||
padding-top: 0.2em;
|
||||
padding-bottom: 0.2em;
|
||||
}*/
|
||||
}
|
||||
|
||||
/* custom fields on the home page */
|
||||
div.custom-fields {
|
||||
figure.person-details {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
|
||||
div.cf_title_box:nth-child(4n+1) h2 {
|
||||
@extend .chill-red;
|
||||
}
|
||||
|
||||
div.cf_title_box:nth-child(4n+2) h2 {
|
||||
@extend .chill-green;
|
||||
}
|
||||
|
||||
div.cf_title_box:nth-child(4n+3) h2 {
|
||||
@extend .chill-orange;
|
||||
}
|
||||
|
||||
div.cf_title_box:nth-child(4n+4) h2 {
|
||||
@extend .chill-blue;
|
||||
}
|
||||
|
||||
div.cf_title_box:nth-child(2n+1){
|
||||
width: 50%;
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
iv.cf_title_box:nth-child(2n+2) {
|
||||
width: calc(50% - 40px);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
.person-list__--by-phonenumber {
|
||||
.person-list__--by-phonenumber__phones {
|
||||
ul {
|
||||
list-style: none inside;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
li {
|
||||
margin: 0.80rem;
|
||||
|
||||
img {
|
||||
vertical-align: baseline;
|
||||
height: 0.90rem;
|
||||
margin-right: 0.20rem;
|
||||
}
|
||||
pre {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
;
|
@@ -1 +0,0 @@
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="phone-alt" class="svg-inline--fa fa-phone-alt fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z"></path></svg>
|
Before Width: | Height: | Size: 502 B |
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
public function registerBundles()
|
||||
{
|
||||
return array(
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Chill\CustomFieldsBundle\ChillCustomFieldsBundle(),
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new \Symfony\Bundle\AsseticBundle\AsseticBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Chill\PersonBundle\ChillPersonBundle(),
|
||||
new Chill\MainBundle\ChillMainBundle(),
|
||||
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)
|
||||
);
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCacheDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/PersonBundle/cache';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLogDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/PersonBundle/logs';
|
||||
}
|
||||
}
|
||||
|
@@ -1,2 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
@@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
{% block stylesheets %}{% endblock %}
|
||||
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
{% block javascripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Composer\Autoload\ClassLoader;
|
||||
|
||||
/** @var ClassLoader $loader */
|
||||
$loader = require __DIR__.'/../../../../../vendor/autoload.php';
|
||||
|
||||
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
|
||||
|
||||
return $loader;
|
@@ -1,76 +0,0 @@
|
||||
imports:
|
||||
- { resource: parameters.yml }
|
||||
|
||||
parameters:
|
||||
locale: en
|
||||
|
||||
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']
|
||||
|
||||
# Assetic Configuration
|
||||
assetic:
|
||||
debug: "%kernel.debug%"
|
||||
use_controller: false
|
||||
bundles: [ ]
|
||||
#java: /usr/bin/java
|
||||
filters:
|
||||
cssrewrite: ~
|
||||
|
||||
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
|
||||
|
||||
chill_main:
|
||||
available_languages: [ fr, nl, en ]
|
||||
|
||||
security:
|
||||
providers:
|
||||
users:
|
||||
entity:
|
||||
class: Chill\MainBundle\Entity\User
|
||||
property: username
|
||||
|
||||
encoders:
|
||||
Chill\MainBundle\Entity\User:
|
||||
algorithm: bcrypt
|
||||
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
|
||||
|
||||
|
||||
default:
|
||||
anonymous: ~
|
||||
http_basic: ~
|
||||
form_login:
|
||||
csrf_parameter: _csrf_token
|
||||
csrf_token_id: authenticate
|
||||
csrf_provider: form.csrf_provider
|
||||
|
||||
logout: ~
|
||||
|
||||
|
||||
access_control:
|
||||
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/admin, roles: ROLE_ADMIN }
|
||||
- { path: ^/, roles: ROLE_USER }
|
@@ -1,7 +0,0 @@
|
||||
imports:
|
||||
- { resource: config.yml } #here we import a config.yml file, this is not required
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
session:
|
||||
storage_id: session.storage.filesystem
|
@@ -1,8 +0,0 @@
|
||||
# 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
|
@@ -1,18 +0,0 @@
|
||||
# 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
|
||||
|
||||
chill_person:
|
||||
person_fields:
|
||||
nationality: hidden
|
||||
email: hidden
|
||||
place_of_birth: hidden
|
||||
phonenumber: hidden
|
||||
country_of_birth: hidden
|
||||
marital_status: hidden
|
||||
spoken_languages: hidden
|
@@ -1,7 +0,0 @@
|
||||
parameters:
|
||||
database_host: chill__database
|
||||
database_port: 5432
|
||||
database_name: postgres
|
||||
database_user: postgres
|
||||
database_password: postgres
|
||||
locale: fr
|
@@ -1,7 +0,0 @@
|
||||
parameters:
|
||||
database_host: 127.0.0.1
|
||||
database_port: 5434
|
||||
database_name: symfony
|
||||
database_user: symfony
|
||||
database_password: symfony
|
||||
locale: fr
|
@@ -1,4 +0,0 @@
|
||||
chill_routes:
|
||||
resource: .
|
||||
type: chill_routes
|
||||
|
@@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
|
||||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
||||
// for more information
|
||||
//umask(0000);
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
require __DIR__.'/autoload.php';
|
||||
|
||||
$input = new ArgvInput();
|
||||
$env = $input->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);
|
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
|
||||
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
|
||||
//umask(0000);
|
||||
|
||||
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
||||
// Feel free to remove this, extend it, or make something more sophisticated.
|
||||
if (isset($_SERVER['HTTP_CLIENT_IP'])
|
||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||
|| !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server')
|
||||
) {
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
|
||||
}
|
||||
|
||||
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
|
||||
Debug::enable();
|
||||
|
||||
require_once __DIR__.'/../app/AppKernel.php';
|
||||
|
||||
$kernel = new AppKernel('dev', true);
|
||||
$kernel->loadClassCache();
|
||||
$request = Request::createFromGlobals();
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
$kernel->terminate($request, $response);
|
@@ -1,107 +0,0 @@
|
||||
Contributing to Select2
|
||||
=======================
|
||||
Looking to contribute something to Select2? **Here's how you can help.**
|
||||
|
||||
Please take a moment to review this document in order to make the contribution
|
||||
process easy and effective for everyone involved.
|
||||
|
||||
Following these guidelines helps to communicate that you respect the time of
|
||||
the developers managing and developing this open source project. In return,
|
||||
they should reciprocate that respect in addressing your issue or assessing
|
||||
patches and features.
|
||||
|
||||
Using the issue tracker
|
||||
-----------------------
|
||||
When [reporting bugs][reporting-bugs] or
|
||||
[requesting features][requesting-features], the
|
||||
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
|
||||
|
||||
The issue tracker **is not** a place for support requests. The
|
||||
[mailing list][mailing-list] or [IRC channel][irc-channel] are better places to
|
||||
get help.
|
||||
|
||||
Reporting bugs with Select2
|
||||
---------------------------
|
||||
We really appreciate clear bug reports that _consistently_ show an issue
|
||||
_within Select2_.
|
||||
|
||||
The ideal bug report follows these guidelines:
|
||||
|
||||
1. **Use the [GitHub issue search][issue-search]** — Check if the issue
|
||||
has already been reported.
|
||||
2. **Check if the issue has been fixed** — Try to reproduce the problem
|
||||
using the code in the `master` branch.
|
||||
3. **Isolate the problem** — Try to create an
|
||||
[isolated test case][isolated-case] that consistently reproduces the problem.
|
||||
|
||||
Please try to be as detailed as possible in your bug report, especially if an
|
||||
isolated test case cannot be made. Some useful questions to include the answer
|
||||
to are:
|
||||
|
||||
- What steps can be used to reproduce the issue?
|
||||
- What is the bug and what is the expected outcome?
|
||||
- What browser(s) and Operating System have you tested with?
|
||||
- Does the bug happen consistently across all tested browsers?
|
||||
- What version of jQuery are you using? And what version of Select2?
|
||||
- Are you using Select2 with other plugins?
|
||||
|
||||
All of these questions will help people fix and identify any potential bugs.
|
||||
|
||||
Requesting features in Select2
|
||||
------------------------------
|
||||
Select2 is a large library that carries with it a lot of functionality. Because
|
||||
of this, many feature requests will not be implemented in the core library.
|
||||
|
||||
Before starting work on a major feature for Select2, **contact the
|
||||
[community][community] first** or you may risk spending a considerable amount of
|
||||
time on something which the project developers are not interested in bringing
|
||||
into the project.
|
||||
|
||||
### Select2 4.0
|
||||
|
||||
Many feature requests will be closed off until 4.0, where Select2 plans to adopt
|
||||
a more flexible API. If you are interested in helping with the development of
|
||||
the next major Select2 release, please send a message to the
|
||||
[mailing list][mailing-list] or [irc channel][irc-channel] for more information.
|
||||
|
||||
Triaging issues and pull requests
|
||||
---------------------------------
|
||||
Anyone can help the project maintainers triage issues and review pull requests.
|
||||
|
||||
### Handling new issues
|
||||
|
||||
Select2 regularly receives new issues which need to be tested and organized.
|
||||
|
||||
When a new issue that comes in that is similar to another existing issue, it
|
||||
should be checked to make sure it is not a duplicate. Duplicates issues should
|
||||
be marked by replying to the issue with "Duplicate of #[issue number]" where
|
||||
`[issue number]` is the url or issue number for the existing issue. This will
|
||||
allow the project maintainers to quickly close off additional issues and keep
|
||||
the discussion focused within a single issue.
|
||||
|
||||
If you can test issues that are reported to Select2 that contain test cases and
|
||||
confirm under what conditions bugs happen, that will allow others to identify
|
||||
what causes a bug quicker.
|
||||
|
||||
### Reviewing pull requests
|
||||
|
||||
It is very common for pull requests to be opened for issues that contain a clear
|
||||
solution to the problem. These pull requests should be rigorously reviewed by
|
||||
the community before being accepted. If you are not sure about a piece of
|
||||
submitted code, or know of a better way to do something, do not hesitate to make
|
||||
a comment on the pull request.
|
||||
|
||||
It should also be made clear that **all code contributed to Select** must be
|
||||
licensable under the [Apache 2 or GPL 2 licenses][licensing]. Code that cannot
|
||||
be released under either of these licenses **cannot be accepted** into the
|
||||
project.
|
||||
|
||||
[community]: https://github.com/ivaynberg/select2#community
|
||||
[reporting-bugs]: #reporting-bugs-with-select2
|
||||
[requesting-features]: #requesting-features-in-select2
|
||||
[issue-tracker]: https://github.com/ivaynberg/select2/issues
|
||||
[mailing-list]: https://github.com/ivaynberg/select2#mailing-list
|
||||
[irc-channel]: https://github.com/ivaynberg/select2#irc-channel
|
||||
[issue-search]: https://github.com/ivaynberg/select2/search?q=&type=Issues
|
||||
[isolated-case]: http://css-tricks.com/6263-reduced-test-cases/
|
||||
[licensing]: https://github.com/ivaynberg/select2#copyright-and-license
|
@@ -1,18 +0,0 @@
|
||||
Copyright 2014 Igor Vaynberg
|
||||
|
||||
Version: @@ver@@ Timestamp: @@timestamp@@
|
||||
|
||||
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
|
||||
General Public License version 2 (the "GPL License"). You may choose either license to govern your
|
||||
use of this software only upon the condition that you accept all of the terms of either the Apache
|
||||
License or the GPL License.
|
||||
|
||||
You may obtain a copy of the Apache License and the GPL License at:
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
|
||||
or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the Apache License and the GPL License for the specific language governing
|
||||
permissions and limitations under the Apache License and the GPL License.
|
@@ -1,114 +0,0 @@
|
||||
Select2
|
||||
=======
|
||||
|
||||
Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
|
||||
|
||||
To get started, checkout examples and documentation at http://ivaynberg.github.com/select2
|
||||
|
||||
Use cases
|
||||
---------
|
||||
|
||||
* Enhancing native selects with search.
|
||||
* Enhancing native selects with a better multi-select interface.
|
||||
* Loading data from JavaScript: easily load items via ajax and have them searchable.
|
||||
* Nesting optgroups: native selects only support one level of nested. Select2 does not have this restriction.
|
||||
* Tagging: ability to add new items on the fly.
|
||||
* Working with large, remote datasets: ability to partially load a dataset based on the search term.
|
||||
* Paging of large datasets: easy support for loading more pages when the results are scrolled to the end.
|
||||
* Templating: support for custom rendering of results and selections.
|
||||
|
||||
Browser compatibility
|
||||
---------------------
|
||||
* IE 8+
|
||||
* Chrome 8+
|
||||
* Firefox 10+
|
||||
* Safari 3+
|
||||
* Opera 10.6+
|
||||
|
||||
Usage
|
||||
-----
|
||||
You can source Select2 directly from a CDN like [JSDliver](http://www.jsdelivr.com/#!select2) or [CDNJS](http://www.cdnjs.com/libraries/select2), [download it from this GitHub repo](https://github.com/ivaynberg/select2/tags), or use one of the integrations below.
|
||||
|
||||
Integrations
|
||||
------------
|
||||
|
||||
* [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org))
|
||||
* [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails)
|
||||
* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](https://angularjs.org/))
|
||||
* [Django](https://github.com/applegrew/django-select2)
|
||||
* [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin)
|
||||
* [Symfony2](https://github.com/avocode/FormExtensions)
|
||||
* [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins)
|
||||
* [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/))
|
||||
* [Meteor](https://jquery-select2.meteor.com)
|
||||
* [Yii 2.x](http://demos.krajee.com/widgets#select2)
|
||||
* [Yii 1.x](https://github.com/tonybolzan/yii-select2)
|
||||
* [AtmosphereJS](https://atmospherejs.com/package/jquery-select2)
|
||||
|
||||
### Example Integrations
|
||||
|
||||
* [Knockout.js](https://github.com/ivaynberg/select2/wiki/Knockout.js-Integration)
|
||||
* [Socket.IO](https://github.com/ivaynberg/select2/wiki/Socket.IO-Integration)
|
||||
* [PHP](https://github.com/ivaynberg/select2/wiki/PHP-Example)
|
||||
* [.Net MVC] (https://github.com/ivaynberg/select2/wiki/.Net-MVC-Example)
|
||||
|
||||
Internationalization (i18n)
|
||||
---------------------------
|
||||
|
||||
Select2 supports multiple languages by simply including the right language JS
|
||||
file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`.
|
||||
|
||||
Missing a language? Just copy `select2_locale_en.js.template`, translate
|
||||
it, and make a pull request back to Select2 here on GitHub.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
The documentation for Select2 is available [through GitHub Pages](https://ivaynberg.github.io/select2/) and is located within this repository in the [`gh-pages` branch](https://github.com/ivaynberg/select2/tree/gh-pages).
|
||||
|
||||
Community
|
||||
---------
|
||||
|
||||
### Bug tracker
|
||||
|
||||
Have a bug? Please create an issue here on GitHub!
|
||||
|
||||
https://github.com/ivaynberg/select2/issues
|
||||
|
||||
### Mailing list
|
||||
|
||||
Have a question? Ask on our mailing list!
|
||||
|
||||
select2@googlegroups.com
|
||||
|
||||
https://groups.google.com/d/forum/select2
|
||||
|
||||
### IRC channel
|
||||
|
||||
Need help implementing Select2 in your project? Ask in our IRC channel!
|
||||
|
||||
**Network:** [Freenode](https://freenode.net/) (`chat.freenode.net`)
|
||||
|
||||
**Channel:** `#select2`
|
||||
|
||||
**Web access:** https://webchat.freenode.net/?channels=select2
|
||||
|
||||
Copyright and license
|
||||
---------------------
|
||||
|
||||
Copyright 2012 Igor Vaynberg
|
||||
|
||||
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
|
||||
General Public License version 2 (the "GPL License"). You may choose either license to govern your
|
||||
use of this software only upon the condition that you accept all of the terms of either the Apache
|
||||
License or the GPL License.
|
||||
|
||||
You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at:
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
|
||||
or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied. See the Apache License and the GPL License for the specific language governing
|
||||
permissions and limitations under the Apache License and the GPL License.
|
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"name": "select2",
|
||||
"version": "3.5.2",
|
||||
"main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
|
||||
"dependencies": {
|
||||
"jquery": ">= 1.7.1"
|
||||
}
|
||||
}
|
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"name": "select2",
|
||||
"repo": "ivaynberg/select2",
|
||||
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
|
||||
"version": "3.5.2",
|
||||
"demo": "http://ivaynberg.github.io/select2/",
|
||||
"keywords": [
|
||||
"jquery"
|
||||
],
|
||||
"main": "select2.js",
|
||||
"styles": [
|
||||
"select2.css",
|
||||
"select2-bootstrap.css"
|
||||
],
|
||||
"scripts": [
|
||||
"select2.js",
|
||||
"select2_locale_ar.js",
|
||||
"select2_locale_bg.js",
|
||||
"select2_locale_ca.js",
|
||||
"select2_locale_cs.js",
|
||||
"select2_locale_da.js",
|
||||
"select2_locale_de.js",
|
||||
"select2_locale_el.js",
|
||||
"select2_locale_es.js",
|
||||
"select2_locale_et.js",
|
||||
"select2_locale_eu.js",
|
||||
"select2_locale_fa.js",
|
||||
"select2_locale_fi.js",
|
||||
"select2_locale_fr.js",
|
||||
"select2_locale_gl.js",
|
||||
"select2_locale_he.js",
|
||||
"select2_locale_hr.js",
|
||||
"select2_locale_hu.js",
|
||||
"select2_locale_id.js",
|
||||
"select2_locale_is.js",
|
||||
"select2_locale_it.js",
|
||||
"select2_locale_ja.js",
|
||||
"select2_locale_ka.js",
|
||||
"select2_locale_ko.js",
|
||||
"select2_locale_lt.js",
|
||||
"select2_locale_lv.js",
|
||||
"select2_locale_mk.js",
|
||||
"select2_locale_ms.js",
|
||||
"select2_locale_nl.js",
|
||||
"select2_locale_no.js",
|
||||
"select2_locale_pl.js",
|
||||
"select2_locale_pt-BR.js",
|
||||
"select2_locale_pt-PT.js",
|
||||
"select2_locale_ro.js",
|
||||
"select2_locale_ru.js",
|
||||
"select2_locale_sk.js",
|
||||
"select2_locale_sv.js",
|
||||
"select2_locale_th.js",
|
||||
"select2_locale_tr.js",
|
||||
"select2_locale_uk.js",
|
||||
"select2_locale_vi.js",
|
||||
"select2_locale_zh-CN.js",
|
||||
"select2_locale_zh-TW.js"
|
||||
],
|
||||
"images": [
|
||||
"select2-spinner.gif",
|
||||
"select2.png",
|
||||
"select2x2.png"
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"name":
|
||||
"ivaynberg/select2",
|
||||
"description": "Select2 is a jQuery based replacement for select boxes.",
|
||||
"version": "3.5.2",
|
||||
"type": "component",
|
||||
"homepage": "http://ivaynberg.github.io/select2/",
|
||||
"license": "Apache-2.0",
|
||||
"require": {
|
||||
"robloach/component-installer": "*",
|
||||
"components/jquery": ">=1.7.1"
|
||||
},
|
||||
"extra": {
|
||||
"component": {
|
||||
"scripts": [
|
||||
"select2.js"
|
||||
],
|
||||
"files": [
|
||||
"select2.js",
|
||||
"select2_locale_*.js",
|
||||
"select2.css",
|
||||
"select2-bootstrap.css",
|
||||
"select2-spinner.gif",
|
||||
"select2.png",
|
||||
"select2x2.png"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,2 +0,0 @@
|
||||
ul.admin_tiles li { background: none repeat scroll 0 0 #E9E9E9; border: 1px solid #C9C9C9; padding: 1.5em; margin-left: 1.5em; margin-bottom: 1.5em; }
|
||||
ul.admin_tiles li p, ul.admin_tiles li h1, ul.admin_tiles li h2, ul.admin_tiles li h3 { width: 350px; }
|
@@ -1,25 +0,0 @@
|
||||
div#usefulbar { background-color: #fbba3a; z-index: 1000; padding-right: 15px; }
|
||||
div#usefulbar form { margin: 0; }
|
||||
div#usefulbar i.menu { font-size: 2em; }
|
||||
div#usefulbar ul { display: flex; justify-content: flex-end; margin: 0; padding-top: 5px; padding-right: 10px; }
|
||||
div#usefulbar li { color: white; margin-left: 10px; }
|
||||
div#usefulbar li a { color: white; text-shadow: 0px 0px 1px #555; }
|
||||
div#usefulbar li i.icon-user-add:before { vertical-align: -5px; }
|
||||
div#usefulbar li#search_element { text-align: right; }
|
||||
div#usefulbar li#search_element div#search_form { margin: 0; padding: 0; }
|
||||
div#usefulbar li#search_element div#search_form div { margin: 0; }
|
||||
div#usefulbar li#search_element div#search_form .field { margin: 0; }
|
||||
div#usefulbar li#search_element div#search_form button { color: white; border: none; bottom: -2px; height: 35px; }
|
||||
|
||||
div#flashMessages { margin-top: 20px; }
|
||||
div#flashMessages .flash-notice { margin-top: 10px; margin-bottom: 10px; }
|
||||
|
||||
.personName { font-variant: small-caps; text-transform: capitalize; }
|
||||
|
||||
.personName { text-transform: capitalize; }
|
||||
|
||||
input.belgian_national_number_inversed_date { width: 7em; margin-right: 1em; }
|
||||
|
||||
input.belgian_national_number_daily_counter { width: 4em; margin-right: 1em; }
|
||||
|
||||
input.belgian_national_number_control_digit { width: 3em; }
|
File diff suppressed because it is too large
Load Diff
@@ -1,173 +0,0 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
/*!
|
||||
* Pikaday
|
||||
* Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
|
||||
*/
|
||||
|
||||
.pika-single {
|
||||
z-index: 9999;
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 240px;
|
||||
padding: 8px;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom-color: #bbb;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.pika-single.is-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pika-single.is-bound {
|
||||
position: absolute;
|
||||
box-shadow: 0 5px 15px -5px rgba(0,0,0,.5);
|
||||
}
|
||||
|
||||
.pika-title {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pika-label {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
position: relative;
|
||||
z-index: 9999;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 5px 3px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
.pika-title select {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
z-index: 9998;
|
||||
margin: 0;
|
||||
left: 0;
|
||||
top: 5px;
|
||||
filter: alpha(opacity=0);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.pika-prev,
|
||||
.pika-next {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
outline: none;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 30px;
|
||||
/* hide text using text-indent trick, using width value (it's enough) */
|
||||
text-indent: 20px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
background-color: transparent;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 75% 75%;
|
||||
opacity: .5;
|
||||
*position: absolute;
|
||||
*top: 0;
|
||||
}
|
||||
|
||||
.pika-prev:hover,
|
||||
.pika-next:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.pika-prev,
|
||||
.is-rtl .pika-next {
|
||||
float: left;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==');
|
||||
*left: 0;
|
||||
}
|
||||
|
||||
.pika-next,
|
||||
.is-rtl .pika-prev {
|
||||
float: right;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=');
|
||||
*right: 0;
|
||||
}
|
||||
|
||||
.pika-prev.is-disabled,
|
||||
.pika-next.is-disabled {
|
||||
cursor: default;
|
||||
opacity: .2;
|
||||
}
|
||||
|
||||
.pika-select {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
}
|
||||
|
||||
.pika-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.pika-table th,
|
||||
.pika-table td {
|
||||
width: 14.285714285714286%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pika-table th {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
line-height: 25px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pika-button {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
outline: none;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
line-height: 15px;
|
||||
text-align: right;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.is-today .pika-button {
|
||||
color: #33aaff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.is-selected .pika-button {
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
background: #33aaff;
|
||||
box-shadow: inset 0 1px 3px #178fe5;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.is-disabled .pika-button {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
color: #999;
|
||||
opacity: .3;
|
||||
}
|
||||
|
||||
.pika-button:hover {
|
||||
color: #fff !important;
|
||||
background: #ff8000 !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 3px !important;
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,94 +0,0 @@
|
||||
Copyright (c) 2013, Sorkin Type Co (www.sorkintype.com) with Reserved Font Name 'Merriweather'
|
||||
|
||||
Merriweather is a trademark of Sorkin Type Co.
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
@@ -1,92 +0,0 @@
|
||||
Copyright (c) 2012, vernon adams (vern@newtypography.co.uk), with Reserved Font Names 'Oxygen'
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user