Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • soluris/madis
  • matt.faure2/madis
  • enzo48/madis
  • sylsyl/madis
  • mvalois/madis
  • manududoubs/madis
6 results
Show changes
Commits on Source (3016)
......@@ -2,9 +2,12 @@
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
###> Base_url ###
APP_URL=http://localhost
###> DOCKER ###
DOCKER_IMAGE_PHP=registry.gitlab.com/soluris/madis/php:1.0
DOCKER_IMAGE_NGINX=registry.gitlab.com/soluris/madis/nginx:1.0
DOCKER_IMAGE_PHP=gitlab.adullact.net:4567/soluris/madis/php:1.2
DOCKER_IMAGE_NGINX=gitlab.adullact.net:4567/soluris/madis/nginx:1.2
HTTPD_PORT=8888
MYSQL_DATABASE=madis
......@@ -23,6 +26,9 @@ PHP_FPM_PORT=9000
DATABASE_URL=mysql://user:user_pass@db:3306/madis
###< doctrine/doctrine-bundle ###
### message know me at connexion ###
APP_CONNEXION_STATUS_KNOW=false
###> symfony/framework-bundle ###
APP_APPLICATION_NAME="Madis"
# Idle time is 1,5 hours in seconds
......@@ -30,35 +36,124 @@ APP_COOKIE_IDLE_TIMEOUT=5400
# Cookie lifetime is 4 hours in seconds
APP_COOKIE_LIFETIME=14400
APP_DEFAULT_REFERENT="Référent RGPD"
APP_DPO_ADDRESS_CITY="Saintes"
APP_DPO_ADDRESS_STREET="2 rue des Rochers"
APP_DPO_ADDRESS_ZIP_CODE="17100"
# Informations du DPD
APP_DPO_CIVILITY=m
APP_DPO_FIRST_NAME=Michaël
APP_DPO_LAST_NAME=Edlich
APP_DPO_COMPANY=Soluris
APP_DPO_JOB="Chargé de mission Solutions Documentaires Electroniques"
APP_DPO_MAIL=m.edlich@soluris.fr
APP_DPO_PHONE_NUMBER=0546923905
APP_DPO_FIRST_NAME="Prénom"
APP_DPO_LAST_NAME="Nom"
APP_DPO_JOB="Titre de poste"
APP_DPO_MAIL=MonAdresseEmail@Domaine.fr
APP_DPO_PHONE_NUMBER=0123456789
APP_DPO_COMPANY="Nom de la structure"
APP_DPO_ADDRESS_STREET="Rue"
APP_DPO_ADDRESS_CITY="Ville"
APP_DPO_ADDRESS_ZIP_CODE="11111"
APP_DPO_IMAGE_LOGO_COULEUR="images/logo_madis_2020_couleur.png"
APP_ENV=dev
APP_FOOTER_PROVIDER_NAME=SOLURIS
APP_FOOTER_PROVIDER_URL="https://example.fr"
APP_IMAGE_FAVICON_PATH="favicon.ico"
APP_IMAGE_SIDEBAR_BOTTOM_TARGET_URL="htpps//example.fr"
APP_FOOTER_PROVIDER_NAME="Nom de la structure"
APP_FOOTER_PROVIDER_URL="https://www.soluris.fr"
APP_IMAGE_FAVICON_PATH="images/logo_madis_2020_favicon.png"
APP_IMAGE_SIDEBAR_BOTTOM_TARGET_URL="https://www.soluris.fr"
APP_IMAGE_SIDEBAR_BOTTOM_PATH="images/soluris-logo-white.png"
APP_IMAGE_SIDEBAR_REDUCED_PATH="images/icon-32x32.png"
APP_IMAGE_SIDEBAR_REDUCED_PATH="images/logo_madis_2020_favicon.png"
APP_IMAGE_LOGO_BLANC="images/logo_madis_2020_blanc.png"
APP_IMAGE_LOGO_COULEUR="images/logo_madis_2020_couleur.png"
APP_COMMUNE_SVG_REDUCED_PATH="images/commune.svg"
APP_IMPERSONATE_CREATOR_IS_ADMIN=0
APP_MAIL_RECEIVER_DEV=~
APP_MAIL_SENDER_EMAIL=ne-pas-repondre@awkan.fr
APP_MAIL_SENDER_EMAIL=ne-pas-repondre@soluris.fr
APP_MAIL_SENDER_NAME="Madis"
APP_SECRET=a98f56b9ea67f189df8ed6a39c548503
# lifetime duration for log journal
APP_LOG_JOURNAL_DURATION=6months
# number of lines displayed in the user dashboard for journalisation list
APP_USER_DASHBOARD_JOURNALISATION_LIMIT=15
# number of lines displayed in the user dashboard for action plan list
APP_USER_DASHBOARD_ACTION_PLAN_LIMIT=10
# number of lines displayed for each datatable
APP_DATATABLE_DEFAULT_PAGE_LENGTH=15
# Password security configuration
# password minimum length
APP_PASSWORD_REQUIRE_MIN_LENGTH=14
# if true, the password requires uppercase AND lowercase character
APP_PASSWORD_REQUIRE_CASE_DIFF=true
# if true, the password requires at least 1 letter
APP_PASSWORD_REQUIRE_LETTERS=true
# if true, the password requires at least 1 number
APP_PASSWORD_REQUIRE_NUMBERS=true
# if true, the password requires at least 1 special character (&!?, etc)
APP_PASSWORD_REQUIRE_SPECIAL_CHARACTERS=true
# global maximum upload size for file uploads
APP_MAX_UPLOAD_SIZE=4M
# Maximum number of login attempts before the user account is deactivated
APP_MAX_LOGIN_ATTEMPTS=10
# number of unread notificaitons to display on the admin dashboard
APP_NOTIFICATION_DASHBOARD_NUMBER=15
# number of unread notificaitons to display on the page header
APP_NOTIFICATION_HEADER_NUMBER=5
# Whether to show notifications on the admin dashboard
APP_NOTIFICATION_DASHBOARD_SHOWN=true
# Number of days before a inactive user notification is sent
APP_INACTIVE_USER_NOTIFICATION_DELAY_DAYS=365
# Number of days before a late request notification is sent
APP_REQUEST_NOTIFICATION_DELAY_DAYS=61
# Number of days before a late Survey (indice de maturité) notificaiton is sent
APP_SURVEY_NOTIFICATION_DELAY_DAYS=365
APP_NOTIFICATION_EMAIL_FIRST_LINE="Des modifications ont été apportées dans <a href='https://madis.fr'>Madis</a>"
# Activate notification module
APP_ACTIVATE_NOTIFICATIONS=true
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-bundle ###
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=gmail://username:password@localhost
###< symfony/swiftmailer-bundle ###
###> CONFORMITE ORGANISATION TOOLTIP ###
###> Value used to display in tooltip in the form for the evaluation of the Conformité Organisation ###
TOOLTIP_CONFORMITE_ORGANISATION_INEXISTANTE="Rien n'est fait"
TOOLTIP_CONFORMITE_ORGANISATION_TRES_ELOIGNEE="La ou les pratique(s) sont très éloignées de la définition (Pratique < 20%)."
TOOLTIP_CONFORMITE_ORGANISATION_PARTIELLE="La ou les pratique(s) sont partielles (20% < Pratique > 80%) au regard de la définition.<br/>Elles ne sont pas documentées."
TOOLTIP_CONFORMITE_ORGANISATION_QUASI_CONFORME="La ou les pratiques sont conformes ou quasiment conforme à la définition (80% < Pratique > 100%)."
TOOLTIP_CONFORMITE_ORGANISATION_MESURABLE="La ou les pratiques sont conforme à la définition.<br/>Elles sont documentées et contrôlables dans le cas d'un audit."
TOOLTIP_CONFORMITE_ORGANISATION_REVISEE="La ou les pratiques sont coordonnées et conforme à la définition.<br/>Des évaluations sont réalisées.<br/>Des améliorations sont systématiquement apportées à partir de l'analyse des évaluations effectuées."
###> knplabs/knp-snappy-bundle ###
WKHTMLTOPDF_PATH=/usr/local/bin/wkhtmltopdf
WKHTMLTOIMAGE_PATH=/usr/local/bin/wkhtmltoimage
###< knplabs/knp-snappy-bundle ###
###> lexik/jwt-authentication-bundle ###
JWT_PRIVATE_KEY_PATH=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY_PATH=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=your_secret_passphrase
###> lexik/jwt-authentication-bundle ###
###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
###< nelmio/cors-bundle ###
###> symfony/mailer ###
MAILER_DSN=null://null
###< symfony/mailer ###
###> SSO LOGIN ###
SSO_TITLE="SSO"
SSO_ICON="images/sso-icon.png"
# sso user info field used to identify user on the app
SSO_KEY_FIELD="sub"
# leave empty to disable SSO logout on app logout
SSO_LOGOUT_URL=
###> Value used for oauth2 client config see config/packages/knpu_oauth2_client.yaml ###
# leave empty to disable SSO (available types: lemonLdap and keycloak)
OAUTH_TYPE=
OAUTH_URL=https://xxxxxxxxxx/auth
OAUTH_REALM=REALM
OAUTH_CLIENT_ID=XXXXX
OAUTH_CLIENT_SECRET=XXXXX
###< SSO LOGIN ###
......@@ -3,8 +3,8 @@
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
###> DOCKER ###
DOCKER_IMAGE_PHP=registry.gitlab.com/soluris/madis/php:1.0
DOCKER_IMAGE_NGINX=registry.gitlab.com/soluris/madis/nginx:1.0
DOCKER_IMAGE_PHP=gitlab.adullact.net:4567/soluris/madis/php:1.2
DOCKER_IMAGE_NGINX=gitlab.adullact.net:4567/soluris/madis/nginx:1.2
HTTPD_PORT=8888
MYSQL_DATABASE=rgpd
......@@ -20,6 +20,9 @@ PHP_FPM_PORT=9000
DATABASE_URL=mysql://user:user_pass@db:3306/rgpd
###< doctrine/doctrine-bundle ###
### message know me at connexion ###
APP_CONNEXION_STATUS_KNOW=false
###> symfony/framework-bundle ###
APP_APPLICATION_NAME="Gestion RGPD"
# Idle time is 1,5 hours in seconds
......@@ -27,35 +30,102 @@ APP_COOKIE_IDLE_TIMEOUT=5400
# Cookie lifetime is 4 hours in seconds
APP_COOKIE_LIFETIME=14400
APP_DEFAULT_REFERENT="Référent RGPD"
APP_DPO_ADDRESS_CITY="Saintes"
APP_DPO_ADDRESS_STREET="2 rue des Rochers"
APP_DPO_ADDRESS_ZIP_CODE="17100"
# Informations du DPD
APP_DPO_CIVILITY=m
APP_DPO_FIRST_NAME=Michaël
APP_DPO_LAST_NAME=Edlich
APP_DPO_COMPANY=Soluris
APP_DPO_JOB="Chargé de mission Solutions Documentaires Electroniques"
APP_DPO_MAIL=m.edlich@soluris.fr
APP_DPO_PHONE_NUMBER=0546923905
APP_DPO_FIRST_NAME="Prénom"
APP_DPO_LAST_NAME="Nom"
APP_DPO_JOB="Titre de poste"
APP_DPO_MAIL=MonAdresseEmail@Domaine.fr
APP_DPO_PHONE_NUMBER=0123456789
APP_DPO_COMPANY="Nom de la structure"
APP_DPO_ADDRESS_STREET="Rue"
APP_DPO_ADDRESS_CITY="Ville"
APP_DPO_ADDRESS_ZIP_CODE="11111"
APP_DPO_IMAGE_LOGO_COULEUR="images/logo_madis_2020_couleur.png"
APP_ENV=dev
APP_FOOTER_PROVIDER_NAME=SOLURIS
APP_FOOTER_PROVIDER_URL="https://example.fr"
APP_IMAGE_FAVICON_PATH="favicon.ico"
APP_IMAGE_SIDEBAR_BOTTOM_TARGET_URL="https://example.fr"
APP_FOOTER_PROVIDER_NAME="Nom de la structure"
APP_FOOTER_PROVIDER_URL="https://www.soluris.fr"
APP_IMAGE_FAVICON_PATH="images/logo_madis_2020_favicon.png"
APP_IMAGE_SIDEBAR_BOTTOM_TARGET_URL="https://www.soluris.fr"
APP_IMAGE_SIDEBAR_BOTTOM_PATH="images/soluris-logo-white.png"
APP_IMAGE_SIDEBAR_REDUCED_PATH="images/icon-32x32.png"
APP_IMAGE_SIDEBAR_REDUCED_PATH="images/logo_madis_2020_favicon.png"
APP_IMAGE_LOGO_BLANC="images/logo_madis_2020_blanc.png"
APP_IMAGE_LOGO_COULEUR="images/logo_madis_2020_couleur.png"
APP_COMMUNE_SVG_REDUCED_PATH="images/commune.svg"
APP_IMPERSONATE_CREATOR_IS_ADMIN=0
APP_MAIL_RECEIVER_DEV=~
APP_MAIL_SENDER_EMAIL=ne-pas-repondre@awkan.fr
APP_MAIL_SENDER_EMAIL=ne-pas-repondre@soluris.fr
APP_MAIL_SENDER_NAME="Madis"
APP_SECRET=a98f56b9ea67f189df8ed6a39c548503
# global maximum upload size for file uploads
APP_MAX_UPLOAD_SIZE=4M
# Maximum number of login attempts before the user account is deactivated
APP_MAX_LOGIN_ATTEMPTS=10
APP_NOTIFICATION_DASHBOARD_NUMBER=15
APP_NOTIFICATION_HEADER_NUMBER=5
APP_NOTIFICATION_DASHBOARD_SHOWN=true
APP_ACTIVATE_NOTIFICATIONS=true
APP_INACTIVE_USER_NOTIFICATION_DELAY_DAYS=365
# Number of days before a late request notification is sent
APP_REQUEST_NOTIFICATION_DELAY_DAYS=61
APP_SURVEY_NOTIFICATION_DELAY_DAYS=365
APP_NOTIFICATION_EMAIL_FIRST_LINE="Des modifications ont été apportées dans <a href='https://madis.fr'>Madis</a>"
APP_USER_DASHBOARD_ACTION_PLAN_LIMIT=10
APP_USER_DASHBOARD_JOURNALISATION_LIMIT=10
# number of lines displayed for each datatable
APP_DATATABLE_DEFAULT_PAGE_LENGTH=15
APP_LOG_JOURNAL_DURATION=6months
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###> CONFORMITE ORGANISATION TOOLTIP ###
###> Value used to display in tooltip in the form for the evaluation of the Conformité Organisation ###
TOOLTIP_CONFORMITE_ORGANISATION_INEXISTANTE="Rien n'est fait"
TOOLTIP_CONFORMITE_ORGANISATION_TRES_ELOIGNEE="La ou les pratique(s) sont très éloignées de la définition (Pratique < 20%)."
TOOLTIP_CONFORMITE_ORGANISATION_PARTIELLE="La ou les pratique(s) sont partielles (20% < Pratique > 80%) au regard de la définition.<br/>Elles ne sont pas documentées."
TOOLTIP_CONFORMITE_ORGANISATION_QUASI_CONFORME="La ou les pratiques sont conformes ou quasiment conforme à la définition (80% < Pratique > 100%)."
TOOLTIP_CONFORMITE_ORGANISATION_MESURABLE="La ou les pratiques sont conforme à la définition.<br/>Elles sont documentées et contrôlables dans le cas d'un audit."
TOOLTIP_CONFORMITE_ORGANISATION_REVISEE="La ou les pratiques sont coordonnées et conforme à la définition.<br/>Des évaluations sont réalisées.<br/>Des améliorations sont systématiquement apportées à partir de l'analyse des évaluations effectuées."
###> knplabs/knp-snappy-bundle ###
WKHTMLTOPDF_PATH=/usr/local/bin/wkhtmltopdf
WKHTMLTOIMAGE_PATH=/usr/local/bin/wkhtmltoimage
###< knplabs/knp-snappy-bundle ###
###< symfony/framework-bundle ###
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
MAILER_DSN=null://localhost
###< symfony/swiftmailer-bundle ###
###> lexik/jwt-authentication-bundle ###
JWT_PRIVATE_KEY_PATH=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY_PATH=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=your_secret_passphrase
###> lexik/jwt-authentication-bundle ###
KERNEL_CLASS=App\Kernel
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
###> SSO LOGIN ###
SSO_TITLE="SSO"
SSO_ICON="images/sso-icon.png"
# sso user info field used to identify user on the app
SSO_KEY_FIELD="sub"
# leave empty to disable SSO logout on app logout
SSO_LOGOUT_URL=
###> Value used for oauth2 client config see config/packages/knpu_oauth2_client.yaml ###
# leave empty to disable SSO (available types: lemonLdap and keycloak)
OAUTH_TYPE=keycloak
OAUTH_URL=https://xxxxxxxxxx/auth
OAUTH_REALM=REALM
OAUTH_CLIENT_ID=XXXXX
OAUTH_CLIENT_SECRET=XXXXX
###< SSO LOGIN ###
## Hooks git
#### 1. Copy .git-hooks directory into project
#### 2. Deplace the hooks to the git's hook repository
Execute this command from your local at the root directory of your project
```bash
cp -R .git-hooks/hooks/* .git/hooks
chmod -R 744 .git/hooks
```
#### 3. Change the git's hook path configuration
Execute this command from your local at the root directory of your project
```bash
git config core.hooksPath .git/hooks
```
This command tell to git where he haves to check for hooks.
By default the hooks path is in .git/hooks, but maybe in future other hooks will be create.
#!/bin/bash
echo Running $BASH_SOURCE
FILES=$(find .git/hooks/pre-commit-scripts -type f|grep "pre-commit-*")
for FILE in $FILES
do
echo "Execution of pre-commit hook: $FILE"
./$FILE
if [ $? -eq 1 ]
then
exit 1
fi
done
#!/bin/bash
# PHP CodeSniffer pre-commit hook for git
#
# Inspired by https://github.com/s0enke/git-hooks/blob/master/phpcs-pre-commit/pre-commit
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
function checkFile
{
echo "Checking file: $1"
# Set config file depending on file
CONFIG_FILE=""
# Launch csfixer
PATHTOFOLDER=$('PWD')
# Exec command
echo "Command csfixer: bash $PATHTOFOLDER/docker-service csFixer \"$1 $CONFIG_FILE\""
OUTPUT=$(bash $PATHTOFOLDER/docker-service csFixer "$1 $CONFIG_FILE")
EXEC_SUCCESS=$?
# Add file to git or show error
if [ "$EXEC_SUCCESS" -gt "1" ]
then
echo "An error occured while php-cs-fixer on file: $FILE_WITHOUT_DIR, error msg: $OUTPUT"
exit "$EXEC_SUCCESS"
else
GITADD="git add $1"
$($GITADD)
fi
}
function checkPhpStan
{
echo "Checking php stan:"
# Set config file depending on file
CONFIG_FILE=""
# Launch csfixer
PATHTOFOLDER=$('PWD')
# Exec command
echo "Command phpStan: bash $PATHTOFOLDER/docker-service phpStan"
OUTPUT=$(bash $PATHTOFOLDER/docker-service phpStan)
EXEC_SUCCESS=$?
# Add file to git or show error
if [ "$OUTPUT" != "" ]
then
echo "An error occured while php stan: $OUTPUT"
exit 1
fi
}
checkPhpStan
# this is the magic:
# retrieve all files in staging area that are added, modified or renamed
# but no deletions etc
FILES=$(git diff-index --name-only --cached --diff-filter=ACMR HEAD -- | grep -e "\.php$")
if [ "$FILES" == "" ]; then
exit 0
fi
# match files against whitelist
for FILE in $FILES
do
RETVAL=$?
if [ "$RETVAL" -eq "0" ]
then
checkFile "$FILE"
fi
done
exit 0
* text=auto eol=lf
###> symfony/framework-bundle ###
/.env
/bin/phpunit
/public/bundles/
/public/custom/
/public/uploads/
......@@ -15,14 +16,28 @@ behat.yml
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###
###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###
###> symfony/phpunit-bridge ###
.phpunit
###< symfony/phpunit-bridge ###
###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
###< lexik/jwt-authentication-bundle ###
.history
###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
###> symfony/webpack-encore-pack ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-pack ###
###> friends-of-behat/symfony-extension ###
/behat.yml
###< friends-of-behat/symfony-extension ###
/.php-cs-fixer.cache
/.idea/
variables:
DOCKER_DRIVER: overlay2
DOCKER_IMAGE_PHP: registry.gitlab.com/soluris/madis/php:1.0
DOCKER_IMAGE_NGINX: registry.gitlab.com/soluris/madis/nginx:1.0
stages:
- cache
......@@ -10,15 +6,16 @@ stages:
- quality-assurance-report
.job-base-template: &job-base-defintion
image: mykiwi/docker
services:
- docker:dind
image: jakzal/phpqa:php8.1
.vendor-install-template: &vendor-install-defintion
script:
- docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY
before_script:
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- ln -f -s .env.test .env
- apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
- docker-php-ext-install gd
# re-install vendors to prevent from ci cache failure
- docker run --rm --env-file=./.env.dist --env-file=.env.test -v ${PWD}:/var/www/gestion-rgpd $DOCKER_IMAGE_PHP composer install --prefer-dist --no-interaction --optimize-autoloader --no-scripts
- composer --version && composer install -vv --prefer-dist --no-interaction --optimize-autoloader --no-scripts || echo "Composer install fail"
.cache-pull-template: &cache-pull-defintion
cache:
......@@ -28,15 +25,15 @@ stages:
policy: pull
create_cache:
image: ${DOCKER_IMAGE_PHP}
image: jakzal/phpqa:php8.1
script:
- composer install --prefer-dist --no-interaction --optimize-autoloader --no-scripts
- apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
- docker-php-ext-install gd
- composer --version && composer install -vv --prefer-dist --no-interaction --optimize-autoloader --no-scripts || echo "Composer install fail"
cache:
key: "$CI_PROJECT_PATH-php"
paths:
- vendor
tags:
- docker
stage: cache
except:
- master
......@@ -46,18 +43,34 @@ unit_tests:
<<: *vendor-install-defintion
<<: *cache-pull-defintion
script:
- make tu-report
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
- pecl install xdebug
- echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini
- php -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-text --colors=never --coverage-html var/artefacts/coverage/
coverage: /^\s+Lines:\s+(\d+)\.\d+%/
artifacts:
paths:
- var/artefacts/coverage/
expire_in: 1 month
tags:
- docker
stage: tests
except:
- master
check-coverage:
image: alpine:latest
stage: quality-assurance
variables:
JOB_NAME: unit_tests
TARGET_BRANCH: develop
before_script:
- apk add --update --no-cache curl jq
rules:
- if: '$CI_COMMIT_BRANCH != $TARGET_BRANCH'
script:
- TARGET_PIPELINE_ID=`curl -s "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines?ref=${TARGET_BRANCH}&status=success" | jq ".[0].id"`
- TARGET_COVERAGE=`curl -s "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${TARGET_PIPELINE_ID}/jobs" | jq --arg JOB_NAME "$JOB_NAME" '.[] | select(.name==$JOB_NAME) | .coverage'`
- CURRENT_COVERAGE=`curl -s "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs" | jq --arg JOB_NAME "$JOB_NAME" '.[] | select(.name==$JOB_NAME) | .coverage'`
- if [ "$CURRENT_COVERAGE" -lt "$TARGET_COVERAGE" ]; then echo "Coverage decreased from ${TARGET_COVERAGE} to ${CURRENT_COVERAGE}" && exit 1; fi;
# TODO validate doctrine migrations and schema
check-security:
......@@ -65,7 +78,7 @@ check-security:
<<: *vendor-install-defintion
<<: *cache-pull-defintion
script:
- make security
- local-php-security-checker
stage: quality-assurance
except:
- master
......@@ -75,7 +88,7 @@ phpstan:
<<: *vendor-install-defintion
<<: *cache-pull-defintion
script:
- make phpstan
- phpstan analyse -c phpstan.neon -l2 src
stage: quality-assurance
except:
- master
......@@ -86,7 +99,10 @@ lint:
<<: *cache-pull-defintion
script:
- cp -f .env.dist .env
- make lint
- bin/console lint:twig templates
- bin/console lint:yaml config
- bin/console lint:yaml src
- bin/console lint:yaml fixtures
stage: quality-assurance
except:
- master
......@@ -94,7 +110,7 @@ lint:
phpmd:
<<: *job-base-defintion
script:
- make phpmd
- phpmd src/ html .phpmd.xml --reportfile var/artefacts/phpmd/index.html --ignore-violations-on-exit
artifacts:
paths:
- var/artefacts/phpmd
......@@ -106,7 +122,7 @@ phpmd:
php-cs-fixer:
<<: *job-base-defintion
script:
- make php-cs-fixer
- php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --using-cache=no --verbose --diff --stop-on-violation
stage: quality-assurance
except:
- master
......@@ -114,7 +130,7 @@ php-cs-fixer:
phpmetrics:
<<: *job-base-defintion
script:
- make phpmetrics
- phpmetrics --report-html=var/artefacts/phpmetrics --exclude=migrations .
artifacts:
paths:
- var/artefacts/phpmetrics
......
<!DOCTYPE html>
<html lang="en">
<html lang="fr-FR">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
......@@ -9,11 +9,11 @@
<section class="section">
<div class="container">
<h1 class="title has-text-dark">
<a href="https://gitlab.com/PLACEHOLDER_PROJECT_PATH">PLACEHOLDER_PROJECT_PATH</a>
<a href="https://gitlab.adullact.net/PLACEHOLDER_PROJECT_PATH">PLACEHOLDER_PROJECT_PATH</a>
</h1>
<h2>Rapports sur la qualité du code</h2>
<p style="margin-bottom: 1rem; font-style: italic; font-size: 0.8rem;">
Basé sur le commit : <a href="https://gitlab.com/PLACEHOLDER_PROJECT_PATH/tree/PLACEHOLDER_GIT_COMMIT_SHA" target="_blank">PLACEHOLDER_GIT_COMMIT_SHA</a>
Basé sur le commit : <a href="https://gitlab.adullact.net/PLACEHOLDER_PROJECT_PATH/tree/PLACEHOLDER_GIT_COMMIT_SHA" target="_blank">PLACEHOLDER_GIT_COMMIT_SHA</a>
</p>
<div class="tile is-ancestor has-text-grey-darker">
<div class="tile is-parent">
......
v8.9
......@@ -5,12 +5,17 @@ $finder = PhpCsFixer\Finder::create()
->exclude(['bin', 'config', 'public', 'templates', 'translations', 'var', 'vendor'])
;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
$config = new PhpCsFixer\Config();
return $config->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'align_multiline_comment' => true,
'binary_operator_spaces' => ['align_equals' => true, 'align_double_arrow' => true],
'binary_operator_spaces' =>
['operators' => [
'=>' => 'align_single_space_minimal',
'=' => 'align_single_space_minimal',
]]
,
'blank_line_before_statement' => ['statements' => ['return', 'throw']],
'concat_space' => ['spacing' => 'one'],
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
......@@ -18,6 +23,6 @@ return PhpCsFixer\Config::create()
'no_useless_return' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
])
])
->setFinder($finder)
;
;
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"
# Build documentation in the "docs/" directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: false
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
This diff is collapsed.
Contribution
============
## Contributeurs historiques
* **BOURLARD Donovan** - Travail initial
* **ANODE Stratégie Digitale** - Maintenance et évolutions
Des contributions ont peut-être été faites sur le projet. Pour analyser la liste des contributeurs, référez-vous au dépôt de code sur GitLab.
Si vous souhaitez contribuer à Madis, veuillez vous référer à la documentation vous correspondant :
- [Signaler un problème ou une suggestion d'amélioration](#signaler-un-problème-ou-une-suggestion-damélioration)
- [Proposer un développement d'une fonctionnalité](#proposer-un-développement-dune-fonctionnalité)
1. [Création d'un ticket](#1-création-dun-ticket)
2. [Développements](#2-développements)
3. [Traitement de la demande de fusion par les mainteneurs](#3-traitement-de-la-demande-de-fusion-par-les-mainteneurs)
## Signaler un problème ou une suggestion d'amélioration
Avant toute contribution, merci de vérifier qu'une demande similaire n'est pas déjà en cours ou résolue. Pour cela, veuillez vérifier :
1. Que le problème soit bien présent dans la [dernière version](https://gitlab.adullact.net/soluris/madis/-/tags) (Consulter le [journal des modifications (Changelog)](CHANGELOG.md#changelog)) ;
2. Qu'un [ticket ouvert](https://gitlab.adullact.net/soluris/madis/-/issues) ne décrit pas déjà votre demande (dans ce cas, participez à la discussion de ce dernier).
Dans le cas où il n'y aurait pas de ticket déjà ouvert, il faudra alors en créer un. Il est recommandé de donner au ticket un titre concis et le plus explicite possible.
**Recommandation Madis** : Il est proposé que chaque ticket soit préfixé par le nom du module. Par exemple, un ticket pour le registre des traitements aura comme titre `[Traitements] Mon titre explicite et concis`.
La description du ticket détaille et précise le propos. Il est possible d'ajouter des images, voire des fichiers. Veuillez apporter un maximum d'informations pour permettre un traitement efficace de celui-ci.
## Proposer un développement d'une fonctionnalité
Il est possible de proposer un développement que ce soit pour le correctif d'un problème, pour l'amélioration de Madis, ou encore le développement de nouvelles fonctionnalités.
### 1. Création d'un ticket
En général, avant de réaliser des développements, il est préférable de commencer par [créer un ticket](#signaler-un-problème-ou-une-suggestion-damélioration) regroupant vos intentions de développement pour le partager au reste de la communauté et de la faire réagir. Cela permet par exemple, d'anticiper le fait qu'une fonctionnalité ou un correctif ne corresponde pas à Madis et à ses utilisateurs, ou soit incomplète.
La discussion se fait sous forme de commentaires du ticket. Pour les contributeurs ayant un peu d'expérience, il est suggéré de mettre à jour la description de l'issue au gré de la discussion.
### 2. Développements
Dans les recommandations de travail collaboratif, il est proposé de créer une nouvelle branche à partir de la `develop` pour chaque nouveau travail. Par convention, il est conseillé de préfixer le nom la branche nouvellement créée par l'id du ticket associé.
Avant tout développement, vous devez suivre et respecter l'[architecture et la qualité du code existant](doc/developpement/2-architecture-et-qualite.md#architecture-et-qualité), de plus il est important de respecter plusieurs éléments :
- Le projet Madis étant sous licence AGPLv3, tout ajout de librairie au projet Madis doit donc être conforme avec celle-ci ;
- Les conventions de codage ;
- La sécurité ;
- L'accessibilité selon les [critères et tests du RGAA](https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/).
Une fois le code développé et testé, vous devez pousser votre code vers le GitLab et faire un merge request de votre branche vers la branche `develop`. Gérer les éventuels conflits en les corrigeant. Lors du merge, vous devrez faire référence au ticket associé si ce n'est pas déjà le cas, et éventuellement apporter des informations détaillées de votre développement.
### 3. Traitement de la demande de fusion par les mainteneurs
Le lancement de la merge request génère une notification aux mainteneurs. Ces derniers traitent la merge request. Une phase de recettage est réalisée, et un nouvel espace de discussion est possible entre mainteneur et développeur.
Si tout est conforme, le mainteneur valide la merge request et le code est passé dans la branche develop. Celui-ci sera alors intégré directement dans une nouvelle version Madis, ou dans une version future.
This diff is collapsed.
QA = docker run --rm --workdir=/project -v `pwd`:/project jakzal/phpqa:php8.1
ARTEFACTS = var/artefacts
# This file allows one to run tests on docker like they do on gitlab.
##
## Tests
## -----
##
tests: tu
tu: ## Run unit tests
$(QA) vendor/bin/phpunit
tu-report: ## Run unit tests
$(QA) phpdbg -d memory_limit=-1 -qrr ./vendor/bin/phpunit --coverage-text --coverage-html var/artefacts/coverage/
# use xdebug instead of phpdbg to generate coverage because phpdbg crashes
$(QA) sh -c 'pecl install xdebug && echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini && php -d xdebug.mode=coverage -d memory_limit=-1 ./vendor/bin/phpunit --coverage-text --coverage-html $(ARTEFACTS)/coverage/'
.PHONY: tu tu-report
......@@ -16,8 +24,6 @@ tu-report: ## Run unit tests
## -----------------
##
QA = docker run --rm -v `pwd`:/project mykiwi/phaudit:7.1
ARTEFACTS = var/artefacts
lint: ## Lints twig and yaml files
lint: lint-twig lint-yaml
......@@ -31,13 +37,12 @@ lint-yaml: ## Lint twig templates
$(QA) bin/console lint:yaml fixtures
security: ## Check security of your dependencies (https://security.sensiolabs.org/)
$(QA) ./vendor/bin/security-checker security:check
$(QA) local-php-security-checker
phploc: ## PHPLoc (https://github.com/sebastianbergmann/phploc)
$(QA) phploc src/
pdepend: ## PHP_Depend (https://pdepend.org)
pdepend: artefacts
$(QA) pdepend \
--summary-xml=$(ARTEFACTS)/pdepend_summary.xml \
--jdepend-chart=$(ARTEFACTS)/pdepend_jdepend.svg \
......@@ -60,10 +65,10 @@ phpmetrics: ## PhpMetrics (http://www.phpmetrics.org)
$(QA) phpmetrics --report-html=$(ARTEFACTS)/phpmetrics --exclude=migrations .
php-cs-fixer: ## php-cs-fixer (http://cs.sensiolabs.org)
$(QA) php-cs-fixer fix --config=.php_cs.dist --dry-run --using-cache=no --verbose --diff
$(QA) php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --using-cache=no --verbose --diff --stop-on-violation
apply-php-cs-fixer: ## apply php-cs-fixer fixes
$(QA) php-cs-fixer fix --using-cache=no --verbose --diff
$(QA) php-cs-fixer fix --config=.php-cs-fixer.dist.php --using-cache=no --verbose --diff
phpstan: ## PHP Static Analysis Tool (https://github.com/phpstan/phpstan)
$(QA) phpstan analyse -c phpstan.neon -l2 src
......
# Madis
[![CI](https://gitlab.com/soluris/madis/badges/master/pipeline.svg?style=flat)](https://example.gitlab.com/soluris/madis/badges/commits/master)
[![coverage](https://gitlab.com/soluris/madis/badges/master/coverage.svg?style=flat)](https://gitlab.com/soluris/madis/)
Accompagnement dans la gestion du Règlement Général à la Protection des Données (RGPD).
# Table des matières
- [Installation de MADIS](doc/installation)
- [Pré-requis pour lancer l'installation de MADIS](doc/installation/1-pre-requis.md)
- [Configurer les services (NGINX, ...)](doc/installation/2-configurer-les-services.md)
- [Cloner le dépôt de code MADIS depuis GIT](doc/installation/3-cloner-le-depot-git-de-madis.md)
- [Configurer MADIS et effectuer son premier lancement](doc/installation/4-premiere-configuration-de-madis.md)
- [Paramétrage complémentaire](doc/installation/5-parametrages-complementaires.md)
- [Gestion de l'application](doc/gestion-application)
- [Requêtes SQL](doc/gestion-application/1-requetes-sql.md)
- [Maintenance applicative & montées de versions](doc/maintenance-applicative)
- [Pré-requis pour lancer l'installation de MADIS](doc/maintenance-applicative/1-pre-requis.md)
- [Réaliser une montée/descente de version de MADIS](doc/maintenance-applicative/2-realiser-une-montee-de-version.md)
- [Problèmes possibles et connus lors de mises à jour](doc/maintenance-applicative/3-problemes-possible-lors-de-mises-a-jour.md)
- [[DEVELOPPEURS] Documentation technique](doc/developpement)
- [Pré-requis pour lancer l'installation de MADIS](doc/developpement/1-pre-requis.md)
- [Architecture applicative](doc/developpement/2-architecture-applicative.md)
- [Les bonnes pratiques de développement](doc/developpement/3-bonnes-pratiques-de-developpement.md)
- [Effectuer la maintenance et les montées de versions](doc/developpement/4-maintenance-et-montee-de-version.md)
- [Qualité du code](doc/developpement/5-qualite-de-code.md)
## Stack technique
Le projet est construit avec :
* [Symfony 3.4+](http://symfony.com/doc/current/index.html) - Comme framework backend (évolue selon les mises à jour)
* [AdminLTE 2](https://adminlte.io/) - Comme framework CSS
## Contributeurs
* __BOURLARD Donovan__ - Initial work
Des contributions ont peut-être été faites sur le projet.
Pour analyser la liste des contributeurs, référez vous au déôt de code sur Gitlab.
L'application Madis est une application pensée par [Soluris](https://www.soluris.fr) pour vous accompagner dans la gestion du Règlement Général à la Protection des Données (RGPD).
## Table des matières
- [Licence d'utilisation de Madis](LICENSE.md)
- [Installation de Madis](doc/installation#madis-installation)
- [Installer Madis par script](doc/installation/1-installation-script.md#installer-madis-par-script)
- [Installer Madis manuellement](doc/installation/2-installation-manuelle.md#installation-manuelle)
- [Journal des modifications (Changelog)](CHANGELOG.md#changelog)
- [Documentation utilisateur](https://documentation-madis.readthedocs.io/fr/latest/docutilisateur.html)
- [Maintenance et gestion applicative](doc/maintenance-et-gestion-application#maintenance-et-gestion-applicative)
- [Paramétrage complémentaire et .env](doc/maintenance-et-gestion-application/1-parametrages-complementaires-et-env.md#paramétrage-complémentaire-et-env)
- [Mettre à jour Madis](doc/maintenance-et-gestion-application/2-mettre-a-jour-madis.md#mettre-à-jour-madis)
- [Requêtes SQL](doc/maintenance-et-gestion-application/3-requetes-sql.md#requêtes-sql)
- [Documentation technique développeurs](doc/developpement#madis-documentation-technique-développeurs)
- [Lancer la stack de développement](doc/developpement/1-lancer-stack-developpement.md#lancer-la-stack-de-développement)
- [Architecture et qualité](doc/developpement/2-architecture-et-qualite.md#architecture-et-qualité)
- [Déployer une nouvelle version](doc/developpement/3-deployer-une-nouvelle-version.md#déployer-une-nouvelle-version)
- [Contribuer au projet](CONTRIBUTING.md#contribution)
# Informations de mises à jour
Il est possible que vous deviez réaliser des actions manuelles lors
de vos montées de version de MADIS.
De ce fait, répertoriez-vous à ce qui est écrit ci-dessous.
**_Note: Si aucune trace n'est présente dans ce fichier pour la version
que vous souhaitez installer, c'est que vous n'avez rien à faire._**
De manière préventive, n'oubliez pas de faire un dump de votre base de
données avant d'effectuer une montée de version.
# Passage en v1.6.0
### Paramétrage de la subrogation d'un utilisateur
Dans le `.env` vous pouvez modifier les informations liées à la subrogation des utilisateurs.
Dans le cas où vous créez des données pour les collectivité,
vous pouvez choisir si vous souhaitez faire afficher le nom de la personne sur qui l'admin s'est connectée
ou le nom de l'admin lui même.
_Note : Vous pouvez aller regarder le fichier `.env.dist` en guise d'exemple._
Pour cela, ajoutez la variable suivante dans votre `.env` et configurez la.
- Mettre `1` si le nom de l'admin doit apparaitre
- Mettre `0` si le nom de la personne sur laquelle l'admin s'est connecté doit apparaitre
```text
APP_IMPERSONATE_CREATOR_IS_ADMIN=0
```
# Passage en v1.5.0
### Paramétrage des timeout Cookie
Dans le `.env` vous pouvez modifier les informations liées à la durée de vie
des cookies ainsi que la deconnexion au bout d'un certain temps d'inactivité
Pour cela, ajoutez les variables suivantes dans votre `.env`.
```text
# Déconnexion pour une inactivité au bout de 1h30 (en secondes)
APP_COOKIE_IDLE_TIMEOUT=5400
# Déxonnexion au bout de 4h (en secondes), même si j'utilise l'application
APP_COOKIE_LIFETIME=14400
```
Il vous faudra également vérifier que dans votre fichier `php.ini`
la variable `session.gc_maxlifetime` égale ou supérieure à votre durée d'inactivité.
Le cas échéant, la session pourrait être supprimée pour inactivité par PHP et non par
votre configuration de MADIS.
Pour prendre connaissance de l'emplacement de votre fichier `php.ini`,
utilisez la commande `php --ini`. Une fois modifié, il vous suffira de restarter votre PHP.
# Passage en v1.4.0
**Note d'attention :** Cette nouvelle version va modifier vos données présentes
en Base de Données. Pensez à créer une sauvegarde de votre BDD au cas où.
### Possibilité de configurer les logos & le fournisseur de service
Dans le `.env` vous pouvez modifier les informations des logos et
du fournisseur de service MADIS (si vous ne souhaitez modifier les
informations, copiez les variables comme affichées dans l'exemple)
Ajoutez les variables suivantes dans votre `.env`.
```text
APP_FOOTER_PROVIDER_NAME=SOLURIS
APP_FOOTER_PROVIDER_URL="https://soluris.fr"
APP_IMAGE_FAVICON_PATH="favicon.ico"
APP_IMAGE_SIDEBAR_BOTTOM_TARGET_URL="https://soluris.fr"
APP_IMAGE_SIDEBAR_BOTTOM_PATH="images/soluris-logo-white.png"
APP_IMAGE_SIDEBAR_REDUCED_PATH="images/icon-32x32.png"
```
_Note: Vous pourrez venir modifier ces variables plus tard._
Si vous souhaitez ajouter vos propres images, le dossier `public/custom`
n'est pas versionné dans GIT.
De ce fait, si vous souhaitez ajouter un favicon dans
`public/custom/images/favicon.ico` par exemple, il vous suffira de changer
`APP_IMAGE_FAVICON_PATH="favicon.ico"` par `APP_IMAGE_FAVICON_PATH="custom/images/favicon.ico"`
(le dossier `public` étant déjà ciblé par défaut).
Finissez par lancer la commande `bin/console cache:clear` pour que ces
données soient appliquées
# Passage en v1.3.1
### Ajout de l'adresse du DPD moral / par défaut
Modifier le fichier `.env` pour y ajouter les 3 champs suivants,
dans la section `symfony/framework-bundle` comme montré ci-dessous.
_Note: Vous pouvez vous aider du fichier `.env.dist`
qui est le fichier de référence, avec des valeurs par défaut._
```text
###> symfony/framework-bundle ###
APP_DPO_ADDRESS_CITY="Saintes"
APP_DPO_ADDRESS_STREET="2 rue des Rochers"
APP_DPO_ADDRESS_ZIP_CODE="17100"
###< symfony/framework-bundle ###
```
/* GLOBAL */
a:not([href]).banner-impersonate {
cursor: not-allowed;
a:focus, button:focus, input[type=submit] {
outline: 1px dashed !important;
}
table a:hover,
table a:focus {
text-decoration: underline;
}
.float-left {
float: left;
}
.mt-2 {
margin: 5px 0 0;
}
tbody th[scope] {
font-weight: initial;
}
/* Bootstrap v5.3 */
.p-0 {
padding: 0 !important;
}
.p-2 {
padding: 2rem;
}
.ps-0 {
padding-left: 0 !important;
}
.ps-1 {
padding-left: 1rem !important;
}
.m-0 {
margin : 0 !important;
}
.ms-2 {
margin-left: 2rem !important;
}
.mb-1 {
margin-bottom: 1rem !important;
}
.mb-2 {
margin-bottom: 2rem !important;
}
.d-flex {
display: flex;
}
.flex-wrap {
flex-wrap: wrap;
}
.justify-content-between {
justify-content: space-between;
}
.overflow-x-auto {
overflow-x: auto !important;
}
/* Impersonate */
......@@ -10,47 +61,213 @@ body > div.banner-impersonate {
text-align: center;
vertical-align: middle;
font-weight: bold;
a {
text-decoration: underline;
font-style: italic;
margin-left: 1em;
font-size: small;
}
div {
p {
line-height: 50px;
}
}
a:not([href]).banner-impersonate {
cursor: not-allowed;
}
.login-box-body h3.login-box-title {
text-align: center;
margin-top: 0.2em;
margin-bottom: 1em;
}
/* Header */
.main-header .logo-mini img {
max-width: 2em;
max-height: 2em;
.main-header {
.logo {
background-color: #3c8dbc !important;
&:hover {
background-color: initial;
}
}
.logo-mini img {
max-width: 2em;
max-height: 2em;
}
.logo-lg img {
width: 65%;
}
.sidebar-toggle:before {
content: "";
}
.btn {
border: none;
border-radius: 0;
}
.nav-button {
color: #fff;
padding: 15px;
background-color: transparent;
}
button.nav-button:hover, button.nav-button:focus {
color: #fff;
background: rgba(0,0,0,0.1);
}
}
button.header-menu-active {
background-color: rgba(0,0,0,0.1) !important;
}
.header-menu {
background-color: #222d32 !important;
width:100% !important;
border:none !important;
padding: 0;
right: 0 !important;
a {
padding: 12px 15px !important;
color: #b8c7ce !important;
&:hover {
background-color: #1e282c !important;
color: #fff !important;
}
&:focus {
background-color: #222d32 !important;
color: #b8c7ce !important;
}
}
li.active a {
border-left: 3px solid #3c8dbc;
color: #fff !important;
background-color: #1e282c !important;
}
}
.main-header .sidebar-toggle:before {
content: "";
/* Skiplinks */
.skiplinks {
position: absolute;
transform: translateY(-100%);
}
.skiplinks:focus-within {
position: relative;
transform: translateY(0);
}
/* Footer */
.footer-public > footer {
margin-left:0;
}
footer a {
text-decoration: underline;
}
/* Sidebar */
.sidebar-logo {
& img {
width: 195px;
height: auto;
}
& img {
width: 195px;
height: auto;
}
}
.sidebar-collapse .sidebar-logo {
display: none;
display: none;
}
.sidebar-menu, .main-sidebar .user-panel, .sidebar-menu>li.header {
font-size: 14px;
> span {
display:block;
padding: 25px 10px 10px 0;
}
}
.sidebar-menu {
background-color: #222d32;
li.header > span:first-child {
padding: 10px 25px 10px 0;
font-size: 12px;
}
li.header {
padding: 0 0 0 15px;
color: #b8c7ce !important;
}
}
.sidebar-mini.sidebar-collapse .main-sidebar > .sidebar > .sidebar-menu li.header:hover {
overflow: visible;
> .sidebar-menu > li:hover > a > span {
display: block !important;
position: absolute;
width: 200px;
left: 50px;
top: 0;
margin-left: -3px;
padding: 12px 5px 12px 20px;
background-color: inherit;
}
}
.sidebar-mini.sidebar-collapse .sidebar-menu > li:not(.treeview) > a > span {
border-bottom-right-radius: 4px;
}
.sidebar-mini.sidebar-collapse .main-sidebar > .sidebar > .sidebar-menu > li.header{
display:block !important;
> span {
display:none !important;
}
> ul {
display:block !important;
width:auto;
}
}
.sidebar-mini .main-sidebar > .sidebar > .sidebar-menu > li.header > .sidebar-menu {
margin-left: -15px !important;
}
/* Breadcrumb */
.content-header .breadcrumb a {
color:#444;
text-decoration:none;
display:inline-block;
&:hover,
&:focus {
text-decoration: underline;
}
}
.content-header .breadcrumb li {
padding: 0;
}
.content-header .breadcrumb a > .fa,
.content-header .breadcrumb a > .glyphicon,
.content-header .breadcrumb a >.ion {
margin-right:5px;
}
.content-header .breadcrumb li+li:before {
content:'>\00a0';
padding: 0 5px;
color: #ccc;
}
.breadcrumb li.active {
color: #726C6C;
}
/* Form */
.form-group>label.required:after {
content: '*';
.form-group>label.required:after,
thead th.required:after {
content: " (Obligatoire)";
font-size: 85%;
font-style: italic;
font-weight: normal;
}
.complex-choice-group label.col-sm-2 {
text-align: left;
width: 100%;
.radio {
margin-top: 0;
}
.complex-choice-group {
display: flex;
align-items: start;
.checkbox {
margin: 0;
}
}
.question-no-margin {
.form-group {
margin-bottom: 0;
}
}
td div.bootstrap-select {
max-width: 450px;
}
.delay-group {
.one-line {
......@@ -62,15 +279,61 @@ body > div.banner-impersonate {
}
}
}
table .dropdown.bootstrap-select,
.select-width .dropdown.bootstrap-select {
width: 100% !important;
}
select[multiple] > option {
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}
.bootstrap-select > div.dropdown-menu {
width: 100%;
min-width: 100% !important;
z-index: 1030;
a {
padding-left: 8px;
padding-right: 8px;
}
span.text {
width: calc(100% - 20px);
overflow: hidden;
text-overflow: ellipsis;
margin-right: 0 !important;
}
span.glyphicon {
right: 0 !important;
}
}
.has-feedback .form-control-feedback {
pointer-events: auto;
cursor: pointer;
}
textarea {
max-width: 100%;
min-width: 100%;
min-height: 34px;
}
textarea.textareaheight {
height: 34px;
}
.js-collection-wrapper i.fa-times {
color: #ff746d;
}
/* Pages */
div.action-bar {
margin-bottom: 1em;
.content-wrapper.public{
margin-left: 0;
}
#table_info {
display: flex;
}
/* DatePicker */
.daterangepicker {
z-index: 5 !important;
font-family: inherit !important;
}
/* Show */
......@@ -78,52 +341,350 @@ body.show .content ul {
-webkit-padding-start: 15px;
}
/* Tooltip */
.stacked-bar-graph .tooltipchart {
position: relative;
}
.tooltipchart .tooltipcharttext {
visibility: hidden;
background-color: black;
color: #fff;
text-align: center;
padding: 5px;
border-radius: 6px;
height: 30px;
display: block;
position: absolute;
z-index: 2;
top: 120%;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
&::after {
content: " ";
position: absolute;
bottom: 100%; /* At the top of the tooltip */
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent black transparent;
}
}
.tooltipchart:hover .tooltipcharttext {
visibility: visible;
}
#tooltip {
display:none;
position:fixed;
overflow:hidden;
span.collectivity-name{
font-size:medium;
font-weight: bold;
}
}
.tooltip-box{
border: solid #01C0EF 1px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
background: #fff;
border-radius: 2px;
margin-bottom: 15px;
padding:5px;
}
.report{
display:flex;
flex-direction: column;
justify-content: space-around;
margin-top: 2rem;
i{
font-size: 33px;
}
}
.map-wrapper {
.row {
overflow: hidden;
margin-right:0;
}
padding:0;
[class*="col-"]{
margin-bottom: -99999px;
padding-bottom: 99999px;
}
}
.table > tbody > tr > td.concerned-people-type {
padding-left: 30px;
}
.custom-checkbox {
margin-top: 8px;
margin-bottom: 16px;
div > label {
padding-right: 0;
cursor: pointer;
}
}
/* LOADER */
.lds-ellipsis {
.content-header-custom-padding {
padding: 15px 0;
}
.stacked-bar-graph {
width: 100%;
height: 20px;
span {
display: inline-block;
height:100%;
box-sizing: border-box;
float: left;
}
.bar-conforme {
background: #00A65A;
}
.bar-non-conforme-mineure {
background: #F39C12;
}
.bar-non-conforme-majeure {
background: #DD4B39;
}
}
.reponse-modal-button {
background-color: transparent;
}
div.mesurement-hide {
display: inline-block;
position: relative;
width: 14px;
height: 14px;
div {
position: absolute;
top: 6px;
width: 2px;
height: 2px;
border-radius: 50%;
background: #000000;
animation-timing-function: cubic-bezier(0, 1, 1, 0);
> i.primary-i {
color: #3779B6;
}
div:nth-child(1) {
left: 1.3px;
animation: lds-ellipsis1 0.6s infinite;
> i.warning-i {
color: #F1902A;
}
div:nth-child(2) {
left: 1.3px;
animation: lds-ellipsis2 0.6s infinite;
> div {
display: none;
z-index: 1;
}
div:nth-child(3) {
left: 5.7px;
animation: lds-ellipsis2 0.6s infinite;
> i:hover + div.primary {
border: solid #3779B6 1px;
}
> i:hover + div.warning {
border: solid #F1902A 1px;
}
div:nth-child(4) {
left: 10px;
animation: lds-ellipsis3 0.6s infinite;
> i:hover + div {
display: block;
position: absolute;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
background: #fff;
border-radius: 2px;
padding: 5px;
> ul {
font-weight: bold;
}
}
}
@keyframes lds-ellipsis1 {
0% { transform: scale(0); }
100% { transform: scale(1); }
td.reponse-vertical-align {
vertical-align: middle !important;
}
.js-table-collection-wrapper .checkbox label {
display: flex;
justify-content: center;
align-items: center;
}
.craue_formflow_buttons {
display: inline;
}
.dic-darkgreen {
background: #d3f4e4;
}
.dic-lightgreen {
background: #ddede0;
}
.dic-lightpink {
background: #f4e7e6;
}
.dic-darkpink {
background: #fbd7dd;
}
@keyframes lds-ellipsis3 {
0% { transform: scale(1); }
100% { transform: scale(0); }
.dic-nocolor {
background: #ffffff;
vertical-align: middle !important;
}
@keyframes lds-ellipsis2 {
0% { transform: translate(0, 0); }
100% { transform: translate(4px, 0); }
.dic-border-right {
border-right: 1px solid black;
}
.dic-border-top {
border-top: 1px solid black;
}
.dic-table {
text-align: center;
width: 80%;
td {
width: 20%;
border-top: none !important;
}
}
.border-0 {
border: none;
}
shadow {
box-shadow : 0 .5rem 1rem rgba(0,0,0,.15)!important;
}
#documentation-grid tr {
display: flex;
justify-content: space-between;
flex-direction: column;
}
#documentation-grid>tbody>tr>td{
border : none;
line-height: 1;
}
.cards thead {
display: none;
}
tr.selected td:before {
color: #CCC;
}
td.action > a {
white-space: nowrap;
}
div.dt-buttons {
position: initial;
}
div.dt-button-background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.7);
background: -ms-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
background: -moz-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
background: -o-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
background: -webkit-gradient(radial, center center, 0, center center, 497, color-stop(0, rgba(0,0,0,0.3)), color-stop(1, rgba(0,0,0,0.7)));
background: -webkit-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
background: radial-gradient(ellipse farthest-corner at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
z-index: 4001;
}
div.dt-button-collection {
position: absolute;
top: 43px !important;
left: 10px !important;
width: 150px;
margin-top: 3px;
padding: 8px 8px 4px 8px;
border: 1px solid rgba(0,0,0,0.4);
background-color: white;
overflow: hidden;
z-index: 4002;
border-radius: 5px;
box-shadow: 3px 3px 5px #000;
box-sizing: border-box;
button.dt-button:active:not(.disabled), button.dt-button.active:not(.disabled), div.dt-button:active:not(.disabled), div.dt-button.active:not(.disabled), a.dt-button:active:not(.disabled), a.dt-button.active:not(.disabled) {
background-color: #dadada;
background-image: -webkit-linear-gradient(top, #f0f0f0 0%, #dadada 100%);
background-image: -moz-linear-gradient(top, #f0f0f0 0%, #dadada 100%);
background-image: -ms-linear-gradient(top, #f0f0f0 0%, #dadada 100%);
background-image: -o-linear-gradient(top, #f0f0f0 0%, #dadada 100%);
background-image: linear-gradient(to bottom, #f0f0f0 0%, #dadada 100%);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#f0f0f0', EndColorStr='#dadada');
box-shadow: inset 1px 1px 3px #666;
}
}
button.dt-button, div.dt-button, a.dt-button {
position: relative;
display: inline-block;
box-sizing: border-box;
margin-right: 0.333em;
margin-bottom: 0.333em;
padding: 0.5em 1em;
border: 1px solid #999;
border-radius: 2px;
cursor: pointer;
font-size: 0.88em;
line-height: 1.6em;
color: black;
white-space: nowrap;
overflow: hidden;
background-color: #e9e9e9;
background-image: -webkit-linear-gradient(top, #fff 0%, #e9e9e9 100%);
background-image: -moz-linear-gradient(top, #fff 0%, #e9e9e9 100%);
background-image: -ms-linear-gradient(top, #fff 0%, #e9e9e9 100%);
background-image: -o-linear-gradient(top, #fff 0%, #e9e9e9 100%);
background-image: linear-gradient(to bottom, #fff 0%, #e9e9e9 100%);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='white', EndColorStr='#e9e9e9');
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-decoration: none;
outline: none;
text-overflow: ellipsis;
}
/* ---------- NOTIFICATIONS ---------- */
#notifications i.fa-bell {
font-size: 16px;
}
#notifications .badge {
position: relative;
top: -10px;
left: -5px;
}
#notifications .dropdown-large {
min-width:550px;
}
#notifications .single-notification {
background-color : #deedf6;
}
.notification-link-underline a:hover,
.notification-link-underline a:focus {
text-decoration: underline;
}
/* -------- LOGIN PAGE -------------- */
.login-logo img {
width: 80%;
}
#sso_login {
border-top: 1px solid #666;
margin-top: 20px;
&>span {
position: relative;
top: -11px;
background: #fff;
padding: 2px;
}
}
td.actions > a {
white-space: nowrap;
}
$(document).ready(function() {
// Handle complex form on user page
$('input.select-frequency:not(:checked)').parents('tr').find('select').attr('disabled', 'disabled')
$('input.select-frequency').on('change', function(ev){
$('input.select-frequency').parents('table').find('select').attr('disabled', 'disabled')
$(ev.currentTarget).parents('tr').find('select').removeAttr('disabled')
})
/* Simple fields */
$('input[type=password]').each(function() {
let input = $(this);
......@@ -15,14 +21,18 @@ $(document).ready(function() {
$('.complex-choice-group').each(function(idx) {
var check = $(this).find('.check input');
var comment = $(this).find('.comment input');
var commentarea = $(this).find('.comment textarea');
// Disable comment on unchecked line
comment.prop('disabled', !check.is(':checked'));
commentarea.prop('disabled', !check.is(':checked'));
// Check | Uncheck : Disable comment on unchecked line
check.on('change', function() {
var comment = $(this).closest('.complex-choice-group').find('.comment input');
comment.prop('disabled', !check.is(':checked'));
var commentarea = $(this).closest('.complex-choice-group').find('.comment textarea');
commentarea.prop('disabled', !check.is(':checked'));
})
});
......@@ -31,10 +41,6 @@ $(document).ready(function() {
var period = $(this).find('select[id$="period"]');
var check = $(this).find('input[id$="otherDelay"]');
var comment = $(this).find('textarea[id$="comment"]');
console.log(number);
console.log(period);
console.log(check);
console.log(comment);
// Disable comment on unchecked line
number.prop('disabled', check.is(':checked'));
......@@ -64,6 +70,12 @@ $(document).ready(function() {
checkCollectivityDifferentItManager();
});
// Check Collectivity services | onLoad & onChange
checkCollectivityDifferentServices();
$('#collectivity_isServicesEnabled').on('change', function() {
checkCollectivityDifferentServices();
});
// Check Mesurement status | onLoad & onChange
checkMesurementStatus();
$('#mesurement_status').on('change', function() {
......@@ -87,6 +99,27 @@ $(document).ready(function() {
$('#request_applicant_concernedPeople').on('change', function() {
checkRequestConcernedPeople();
});
// Check request state hide or show reason block | onLoad & onChange
checkRequestStateRejectionReason();
$("#request_state").on('change', function() {
checkRequestStateRejectionReason()
});
checkUserCollectivitesReferees();
$('input:radio[name="user[roles]"]').change(function() {
checkUserCollectivitesReferees();
});
// Check Contractor dpo | onLoad & onChange
checkContractorHasDpo();
$('#contractor_hasDpo').on('change', function() {
checkContractorHasDpo();
});
// Remove role from selects + add aria-label
traiterBoutons();
});
function checkMesurementStatus()
......@@ -124,6 +157,8 @@ function checkDifferentDpo(id, boxId)
});
// Be sure to not disable checkbox
id.prop('disabled', false);
$('#collectivity_nbrCnil').prop('disabled', false)
$('#collectivity_nbrCnil').prop('required', false)
}
function checkDifferentItManager(id, boxId)
......@@ -138,6 +173,25 @@ function checkDifferentItManager(id, boxId)
id.prop('disabled', false);
}
function checkDifferentServices(id, boxId)
{
boxId.find('input').each(function() {
$(this).prop('readonly', !id.is(':checked'));
});
boxId.find('select').each(function() {
$(this).prop('readonly', !id.is(':checked'));
});
boxId.find('#add-services').each(function() {
if ($('#collectivity_isServicesEnabled').prop('checked')) {
$('#add-services').css('display', 'inline-table');
} else {
$('#add-services').css('display', 'none');
}
})
// Be sure to not disable checkbox
id.prop('disabled', false);
}
function checkCollectivityDifferentDpo()
{
let differentDpo = $('#collectivity_differentDpo');
......@@ -154,6 +208,14 @@ function checkCollectivityDifferentItManager()
checkDifferentItManager(differentItManager, boxItManager);
}
function checkCollectivityDifferentServices()
{
let differentServices = $('#collectivity_isServicesEnabled');
let boxServices = $('body.user_collectivity.form #box-services');
checkDifferentServices(differentServices, boxServices);
}
function checkProfileDifferentDpo()
{
let differentDpo = $('#collectivity_differentDpo');
......@@ -169,3 +231,75 @@ function checkProfileDifferentItManager()
checkDifferentItManager(differentItManager, boxItManager);
}
function checkRequestStateRejectionReason()
{
let selectedCountry = $("#request_state").children("option:selected").val();
let blockSateRejectionReason = $('#request_StateRejectionReason_div');
let fieldSateRejectionReason = $('#request_stateRejectionReason');
if (selectedCountry === "denied") {
blockSateRejectionReason.show();
fieldSateRejectionReason.prop('required',true);
} else {
blockSateRejectionReason.hide();
fieldSateRejectionReason.prop('required',false);
fieldSateRejectionReason.val("");
}
}
function checkUserCollectivitesReferees()
{
let selectedRole = $('input:radio[name="user[roles]"]:checked').val();
let blockUserCollectivitesReferees = $('#user_collectivitesReferees_div');
let fieldUserCollectivitesReferees = $('#user_collectivitesReferees');
if ("ROLE_REFERENT" === selectedRole) {
blockUserCollectivitesReferees.show();
fieldUserCollectivitesReferees.prop('required',true);
} else {
blockUserCollectivitesReferees.hide();
fieldUserCollectivitesReferees.prop('required',false);
fieldUserCollectivitesReferees.val("");
}
}
function checkContractorHasDpo()
{
let hasDpo = $('#contractor_hasDpo');
let boxDpo = $('body.registry_contractor.form #box-dpo');
checkDifferentDpo(hasDpo, boxDpo);
}
window.modifyDatatable = function () {
$('.dataTables_info').removeAttr('aria-live')
$('.dataTables_processing').attr('role', 'status')
$('.dataTables_paginate').each(function() {
var el = $(this)
var id = el.attr('id')
var cls = el.attr('class')
el.wrap( "<nav role='navigation' aria-label='Pagination'></nav>" );
})
}
function traiterBoutons() {
const buttons = [];
const selects = $('select.selectpicker')
selects.each(function() {
const btn = $(this).next('button')
if (btn.length) {
buttons.push(btn)
}
})
if (buttons.length < selects.length) {
setTimeout(traiterBoutons, 100)
return;
}
for (let i in buttons) {
const but = buttons[i]
but.removeAttr('role');
but.attr('aria-label', buttons[i].prevObject.attr('aria-label'));
}
}