From 94b0432bb91f1e61f7dd69d44be191fef883ef36 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 12 May 2021 15:54:05 +0200 Subject: [PATCH 1/6] Removing spaces at the end of line --- .../DependencyInjection/ChillPersonExtension.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index c9ad36319..3745c6849 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -355,6 +355,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'actions' => [ '_entity' => [ 'roles' => [ +<<<<<<< HEAD Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_PUT => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, @@ -363,6 +364,9 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_GET => true, Request::METHOD_PUT => true, Request::METHOD_PATCH => true, +======= + Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE +>>>>>>> Removing spaces at the end of line ] ], 'participation' => [ @@ -376,6 +380,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE=> \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ] +<<<<<<< HEAD ], 'resource' => [ 'methods' => [ @@ -462,6 +467,10 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, ] ], +======= + ] + +>>>>>>> Removing spaces at the end of line ] ], [ From c32ca59c76b6372e2bee7c62e523dd53c06af83f Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 12 May 2021 15:57:19 +0200 Subject: [PATCH 2/6] Removing spaces at the end of line --- src/Bundle/ChillPersonBundle/config/services.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/config/services.yaml b/src/Bundle/ChillPersonBundle/config/services.yaml index aedea4396..922081d05 100644 --- a/src/Bundle/ChillPersonBundle/config/services.yaml +++ b/src/Bundle/ChillPersonBundle/config/services.yaml @@ -2,9 +2,12 @@ parameters: # cl_chill_person.example.class: Chill\PersonBundle\Example services: +<<<<<<< HEAD _defaults: autowire: true autoconfigure: true +======= +>>>>>>> Removing spaces at the end of line Chill\PersonBundle\Service\: resource: '../Service/' From 25eee8869320f0dd8c93fb543cd55ea23c0cd2c2 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 18 May 2021 10:56:36 +0200 Subject: [PATCH 3/6] Add license text --- .../SocialWork/SocialIssueRepository.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php index b0324ba33..51ced6976 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php @@ -1,6 +1,25 @@ , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ namespace Chill\PersonBundle\Repository\SocialWork; From ad5eed4c2654f48993c101f37b7e39145f041e12 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 18 May 2021 16:24:27 +0200 Subject: [PATCH 4/6] SocialIssues became editable via admin --- .../SocialWork/AdminSocialIssueController.php | 33 ++++++++ .../ChillPersonExtension.php | 30 +++++-- .../Form/SocialWork/SocialIssueType.php | 83 +++++++++++++++++++ .../Repository/PersonRepository.php | 11 +++ .../SocialWork/SocialIssue/edit.html.twig | 12 +++ .../SocialWork/SocialIssue/index.html.twig | 27 ++++++ .../SocialWork/SocialIssue/new.html.twig | 11 +++ .../ChillPersonBundle/config/routes.yaml | 10 +++ .../ChillPersonBundle/config/services.yaml | 3 - .../config/services/form.yaml | 8 +- .../translations/messages.fr.yml | 7 ++ 11 files changed, 222 insertions(+), 13 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialIssueController.php create mode 100644 src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/edit.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/new.html.twig diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialIssueController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialIssueController.php new file mode 100644 index 000000000..35b0df4a2 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialIssueController.php @@ -0,0 +1,33 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\PersonBundle\Controller\SocialWork; + +use Chill\MainBundle\CRUD\Controller\CRUDController; + +/** + * Class AdminSocialIssueController + * Controller for social issues + * + * @package Chill\PersonBundle\Controller + */ +class AdminSocialIssueController extends CRUDController +{ +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 3745c6849..ecc390f59 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -345,6 +345,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ] ] ], + [ + 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, + 'name' => 'social_issue', + 'base_path' => '/admin/social-issue', + 'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialIssueType::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialIssueController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/SocialIssue/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/SocialIssue/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/SocialIssue/edit.html.twig', + ] + ] + ] ], 'apis' => [ [ @@ -355,7 +376,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'actions' => [ '_entity' => [ 'roles' => [ -<<<<<<< HEAD Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_PUT => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, @@ -364,9 +384,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_GET => true, Request::METHOD_PUT => true, Request::METHOD_PATCH => true, -======= - Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ->>>>>>> Removing spaces at the end of line ] ], 'participation' => [ @@ -380,7 +397,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE=> \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ] -<<<<<<< HEAD ], 'resource' => [ 'methods' => [ @@ -467,10 +483,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, ] ], -======= - ] - ->>>>>>> Removing spaces at the end of line ] ], [ diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php new file mode 100644 index 000000000..482ff60f3 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php @@ -0,0 +1,83 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\PersonBundle\Form\SocialWork; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; +use Symfony\Component\Form\Extension\Core\Type\DateType; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\PersonBundle\Entity\SocialWork\SocialIssue; + +/** + * Class SocialIssueType + * + * @package Chill\PersonBundle\Form + */ +class SocialIssueType extends AbstractType +{ + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) { + $this->translatableStringHelper = $translatableStringHelper; + } + + /** + * @param FormBuilderInterface $builder + * @param array $options + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->add('title', TranslatableStringFormType::class, [ + 'label' => 'Nom' + ]) + + ->add('parent', EntityType::class, [ + 'class' => SocialIssue::class, + 'required' => false, + 'choice_label' => function (SocialIssue $issue) { + return $this->translatableStringHelper->localize($issue->getTitle()); + } + ]) + + ->add('desactivationDate', DateType::class, array( + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + 'required' => false, + )); +} + + /** + * @param OptionsResolver $resolver + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', SocialIssue::class) + ; + } +} diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index d99ab590e..6686b55b7 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -18,11 +18,13 @@ namespace Chill\PersonBundle\Repository; + use Chill\PersonBundle\Entity\Person; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; + final class PersonRepository { private EntityRepository $repository; @@ -113,11 +115,20 @@ final class PersonRepository $qb->setParameter('phonenumber', '%'.$phonenumber.'%'); } + + /** + * @param $phonenumber + * @return string + */ protected function parsePhoneNumber(string $phonenumber): string { return \str_replace(' ', '', $phonenumber); } + /** + * @param QueryBuilder $qb + * @param array $centers + */ protected function addByCenters(QueryBuilder $qb, array $centers): void { if (count($centers) > 0) { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/edit.html.twig new file mode 100644 index 000000000..0ae8754fe --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/edit.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillPerson/Admin/layout.html.twig' %} + +{% block title %} +{% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block layout_wvm_content %} +{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_view %}{% endblock %} + {% block content_form_actions_save_and_show %}{% endblock %} +{% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig new file mode 100644 index 000000000..44627852e --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/index.html.twig @@ -0,0 +1,27 @@ +{% extends '@ChillPerson/Admin/layout.html.twig' %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Title'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/new.html.twig new file mode 100644 index 000000000..cc6021021 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/new.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillPerson/Admin/layout.html.twig' %} + +{% block title %} +{% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block layout_wvm_content %} +{% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} +{% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index cd0de3ea3..8b5065bff 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -136,6 +136,16 @@ chill_person_maritalstatus_admin: order: 120 label: 'person_admin.marital status' +chill_person_socialissue_admin: + path: /{_locale}/admin/social-issue + controller: cscrud_social_issue_controller:index + options: + menus: + admin_person: + order: 150 + label: 'person_admin.social_issue' + + chill_person_controllers: resource: "@ChillPersonBundle/Controller" type: annotation diff --git a/src/Bundle/ChillPersonBundle/config/services.yaml b/src/Bundle/ChillPersonBundle/config/services.yaml index 922081d05..aedea4396 100644 --- a/src/Bundle/ChillPersonBundle/config/services.yaml +++ b/src/Bundle/ChillPersonBundle/config/services.yaml @@ -2,12 +2,9 @@ parameters: # cl_chill_person.example.class: Chill\PersonBundle\Example services: -<<<<<<< HEAD _defaults: autowire: true autoconfigure: true -======= ->>>>>>> Removing spaces at the end of line Chill\PersonBundle\Service\: resource: '../Service/' diff --git a/src/Bundle/ChillPersonBundle/config/services/form.yaml b/src/Bundle/ChillPersonBundle/config/services/form.yaml index aa6f36b28..0f415acac 100644 --- a/src/Bundle/ChillPersonBundle/config/services/form.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/form.yaml @@ -32,7 +32,7 @@ services: chill.person.form.type.pick_person: class: Chill\PersonBundle\Form\Type\PickPersonType arguments: - - "@chill.person.repository.person" + - '@Chill\PersonBundle\Repository\PersonRepository' - "@security.token_storage" - "@chill.main.security.authorization.helper" - '@Symfony\Component\Routing\Generator\UrlGeneratorInterface' @@ -53,3 +53,9 @@ services: $em: '@Doctrine\ORM\EntityManagerInterface' tags: - { name: form.type } + + Chill\PersonBundle\Form\SocialWork\SocialIssueType: + arguments: + $translatableStringHelper: '@chill.main.helper.translatable_string' + tags: + - { name: form.type } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 52254295b..5871c4733 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -304,6 +304,12 @@ crud: add_new: Ajouter un nouveau title_new: Nouvel état civil title_edit: Modifier l'état civil + social_issue: + index: + title: Liste des problématiques sociales + add_new: Ajouter une nouvelle problématique sociale + title_new: Nouvelle problématique sociale + title_edit: Modifier la problématique sociale # specific to closing motive closing_motive: @@ -322,6 +328,7 @@ person_admin: marital status list: Liste des états civils marital status explanation: > Configurer la liste des états civils. + social_issue: Problématiques sociales # specific to accompanying period accompanying_period: From 88847cb19c9df824e9b88e81f34f6dce9618917a Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 19 May 2021 14:48:26 +0200 Subject: [PATCH 5/6] Other social entities became editable via admin --- .../SocialWork/AdminEvaluationController.php | 33 +++++++ .../SocialWork/AdminGoalController.php | 33 +++++++ .../SocialWork/AdminResultController.php | 33 +++++++ .../AdminSocialActionController.php | 33 +++++++ .../ChillPersonExtension.php | 92 ++++++++++++++++++- .../Form/SocialWork/EvaluationType.php | 87 ++++++++++++++++++ .../Form/SocialWork/GoalType.php | 87 ++++++++++++++++++ .../Form/SocialWork/ResultType.php | 76 +++++++++++++++ .../Form/SocialWork/SocialActionType.php | 90 ++++++++++++++++++ .../Form/SocialWork/SocialIssueType.php | 6 +- .../SocialWork/Evaluation/index.html.twig | 27 ++++++ .../views/SocialWork/Goal/index.html.twig | 27 ++++++ .../views/SocialWork/Result/index.html.twig | 27 ++++++ .../SocialWork/SocialAction/index.html.twig | 27 ++++++ .../{SocialIssue => }/edit.html.twig | 0 .../{SocialIssue => }/new.html.twig | 0 .../ChillPersonBundle/config/routes.yaml | 40 +++++++- .../config/services/form.yaml | 26 ++++++ .../translations/messages.fr.yml | 23 +++++ 19 files changed, 759 insertions(+), 8 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminGoalController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminResultController.php create mode 100644 src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialActionController.php create mode 100644 src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php create mode 100644 src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php create mode 100644 src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php create mode 100644 src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig rename src/Bundle/ChillPersonBundle/Resources/views/SocialWork/{SocialIssue => }/edit.html.twig (100%) rename src/Bundle/ChillPersonBundle/Resources/views/SocialWork/{SocialIssue => }/new.html.twig (100%) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php new file mode 100644 index 000000000..134cedc74 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php @@ -0,0 +1,33 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\PersonBundle\Controller\SocialWork; + +use Chill\MainBundle\CRUD\Controller\CRUDController; + +/** + * Class AdminSocialIssueController + * Controller for social issues + * + * @package Chill\PersonBundle\Controller + */ +class AdminEvaluationController extends CRUDController +{ +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminGoalController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminGoalController.php new file mode 100644 index 000000000..18e1c9f3b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminGoalController.php @@ -0,0 +1,33 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\PersonBundle\Controller\SocialWork; + +use Chill\MainBundle\CRUD\Controller\CRUDController; + +/** + * Class AdminSocialIssueController + * Controller for social issues + * + * @package Chill\PersonBundle\Controller + */ +class AdminGoalController extends CRUDController +{ +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminResultController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminResultController.php new file mode 100644 index 000000000..80d552282 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminResultController.php @@ -0,0 +1,33 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\PersonBundle\Controller\SocialWork; + +use Chill\MainBundle\CRUD\Controller\CRUDController; + +/** + * Class AdminSocialIssueController + * Controller for social issues + * + * @package Chill\PersonBundle\Controller + */ +class AdminResultController extends CRUDController +{ +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialActionController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialActionController.php new file mode 100644 index 000000000..695ec75a1 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminSocialActionController.php @@ -0,0 +1,33 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\PersonBundle\Controller\SocialWork; + +use Chill\MainBundle\CRUD\Controller\CRUDController; + +/** + * Class AdminSocialIssueController + * Controller for social issues + * + * @package Chill\PersonBundle\Controller + */ +class AdminSocialActionController extends CRUDController +{ +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index ecc390f59..9cc026909 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -348,7 +348,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac [ 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, 'name' => 'social_issue', - 'base_path' => '/admin/social-issue', + 'base_path' => '/admin/social-work/social-issue', 'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialIssueType::class, 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialIssueController::class, 'actions' => [ @@ -358,14 +358,98 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'new' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillPerson/SocialWork/SocialIssue/new.html.twig', + 'template' => '@ChillPerson/SocialWork/new.html.twig', ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillPerson/SocialWork/SocialIssue/edit.html.twig', + 'template' => '@ChillPerson/SocialWork/edit.html.twig', ] ] - ] + ], + [ + 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialAction::class, + 'name' => 'social_action', + 'base_path' => '/admin/social-work/social-action', + 'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialActionType::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialActionController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/SocialAction/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/edit.html.twig', + ] + ] + ], + [ + 'class' => \Chill\PersonBundle\Entity\SocialWork\Goal::class, + 'name' => 'social_goal', + 'base_path' => '/admin/social-work/goal', + 'form_class' => \Chill\PersonBundle\Form\SocialWork\GoalType::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminGoalController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/Goal/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/edit.html.twig', + ] + ] + ], + [ + 'class' => \Chill\PersonBundle\Entity\SocialWork\Result::class, + 'name' => 'social_result', + 'base_path' => '/admin/social-work/result', + 'form_class' => \Chill\PersonBundle\Form\SocialWork\ResultType::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminResultController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/Result/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/edit.html.twig', + ] + ] + ], + [ + 'class' => \Chill\PersonBundle\Entity\SocialWork\Evaluation::class, + 'name' => 'social_evaluation', + 'base_path' => '/admin/social-work/evaluation', + 'form_class' => \Chill\PersonBundle\Form\SocialWork\EvaluationType::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminEvaluationController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/Evaluation/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/SocialWork/edit.html.twig', + ] + ] + ], ], 'apis' => [ [ diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php new file mode 100644 index 000000000..41f44a8fd --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php @@ -0,0 +1,87 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\PersonBundle\Form\SocialWork; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; +use Symfony\Component\Form\Extension\Core\Type\DateType; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\PersonBundle\Entity\SocialWork\Evaluation; + +/** + * Class EvaluationType + * + * @package Chill\PersonBundle\Form + */ +class EvaluationType extends AbstractType +{ + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) { + $this->translatableStringHelper = $translatableStringHelper; + } + + /** + * @param FormBuilderInterface $builder + * @param array $options + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->add('title', TranslatableStringFormType::class, [ + 'label' => 'Nom', + ]) + ->add('delay') + + ->add('notificationDelay'); + /* ]) + + ->add('parent', EntityType::class, [ + 'class' => SocialIssue::class, + 'required' => false, + 'choice_label' => function (SocialIssue $issue) { + return $this->translatableStringHelper->localize($issue->getTitle()); + } + ]) + + ->add('desactivationDate', DateType::class, array( + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + 'required' => false, */ + // ]); +} + + /** + * @param OptionsResolver $resolver + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Evaluation::class) + ; + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php new file mode 100644 index 000000000..9cf9013dc --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php @@ -0,0 +1,87 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\PersonBundle\Form\SocialWork; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; +use Symfony\Component\Form\Extension\Core\Type\DateType; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\PersonBundle\Entity\SocialWork\Goal; +use Chill\PersonBundle\Entity\SocialWork\SocialAction; + +/** + * Class GoalType + * + * @package Chill\PersonBundle\Form + */ +class GoalType extends AbstractType +{ + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) { + $this->translatableStringHelper = $translatableStringHelper; + } + + /** + * @param FormBuilderInterface $builder + * @param array $options + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->add('title', TranslatableStringFormType::class, [ + 'label' => 'Nom' + ]) + + // ->add('socialActions') + + ->add('socialActions', EntityType::class, [ + 'class' => SocialAction::class, + 'required' => false, + 'multiple' => true, + 'choice_label' => function (SocialAction $issue) { + return $this->translatableStringHelper->localize($issue->getTitle()); + } + ]) + + ->add('desactivationDate', DateType::class, [ + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + 'required' => false, + ]); +} + + /** + * @param OptionsResolver $resolver + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Goal::class) + ; + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php new file mode 100644 index 000000000..ee2cefe48 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php @@ -0,0 +1,76 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\PersonBundle\Form\SocialWork; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; +use Symfony\Component\Form\Extension\Core\Type\DateType; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\PersonBundle\Entity\SocialWork\Result; + +/** + * Class ResultType + * + * @package Chill\PersonBundle\Form + */ +class ResultType extends AbstractType +{ + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) { + $this->translatableStringHelper = $translatableStringHelper; + } + + /** + * @param FormBuilderInterface $builder + * @param array $options + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->add('title', TranslatableStringFormType::class, [ + 'label' => 'Nom' + ]) + ->add('accompanyingPeriodWorks') + ->add('accompanyingPeriodWorkGoals') + ->add('desactivationDate', DateType::class, [ + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + 'required' => false, + ]); +} + + /** + * @param OptionsResolver $resolver + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Result::class) + ; + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php new file mode 100644 index 000000000..7613bc2c7 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php @@ -0,0 +1,90 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +namespace Chill\PersonBundle\Form\SocialWork; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Chill\MainBundle\Form\Type\TranslatableStringFormType; +use Symfony\Component\Form\Extension\Core\Type\DateType; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Chill\PersonBundle\Entity\SocialWork\SocialAction; +use Chill\PersonBundle\Entity\SocialWork\SocialIssue; + + +/** + * Class SocialActionType + * + * @package Chill\PersonBundle\Form + */ +class SocialActionType extends AbstractType +{ + /** + * + * @var TranslatableStringHelper + */ + protected $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) { + $this->translatableStringHelper = $translatableStringHelper; + } + + /** + * @param FormBuilderInterface $builder + * @param array $options + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->add('title', TranslatableStringFormType::class, [ + 'label' => 'Nom' + ]) + ->add('issue', EntityType::class, [ + 'class' => SocialIssue::class, + 'choice_label' => function (SocialIssue $issue) { + return $this->translatableStringHelper->localize($issue->getTitle()); + } + ]) + ->add('parent', EntityType::class, [ + 'class' => SocialAction::class, + 'required' => false, + 'choice_label' => function (SocialAction $issue) { + return $this->translatableStringHelper->localize($issue->getTitle()); + } + ]) + ->add('defaultNotificationDelay') + ->add('desactivationDate', DateType::class, [ + 'attr' => array('class' => 'datepicker'), + 'widget'=> 'single_text', + 'format' => 'dd-MM-yyyy', + 'required' => false, + ]); +} + + /** + * @param OptionsResolver $resolver + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', SocialIssue::class) + ; + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php index 482ff60f3..1f21defd9 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php @@ -63,12 +63,12 @@ class SocialIssueType extends AbstractType } ]) - ->add('desactivationDate', DateType::class, array( - 'attr' => array('class' => 'datepicker'), + ->add('desactivationDate', DateType::class, [ + 'attr' => ['class' => 'datepicker'], 'widget'=> 'single_text', 'format' => 'dd-MM-yyyy', 'required' => false, - )); + ]); } /** diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig new file mode 100644 index 000000000..186b2f3ec --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig @@ -0,0 +1,27 @@ +{% extends '@ChillPerson/Admin/layout.html.twig' %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Title'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig new file mode 100644 index 000000000..aa7c239ba --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Goal/index.html.twig @@ -0,0 +1,27 @@ +{% extends '@ChillPerson/Admin/layout.html.twig' %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Title'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig new file mode 100644 index 000000000..f1081aebe --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Result/index.html.twig @@ -0,0 +1,27 @@ +{% extends '@ChillPerson/Admin/layout.html.twig' %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Title'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig new file mode 100644 index 000000000..4c1d5a59d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialAction/index.html.twig @@ -0,0 +1,27 @@ +{% extends '@ChillPerson/Admin/layout.html.twig' %} + +{% block layout_wvm_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Title'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.title|localize_translatable_string }} + +
    +
  • + +
  • +
+ + + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/edit.html.twig similarity index 100% rename from src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/edit.html.twig rename to src/Bundle/ChillPersonBundle/Resources/views/SocialWork/edit.html.twig diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/new.html.twig similarity index 100% rename from src/Bundle/ChillPersonBundle/Resources/views/SocialWork/SocialIssue/new.html.twig rename to src/Bundle/ChillPersonBundle/Resources/views/SocialWork/new.html.twig diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index 8b5065bff..bbcb7c39b 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -137,7 +137,7 @@ chill_person_maritalstatus_admin: label: 'person_admin.marital status' chill_person_socialissue_admin: - path: /{_locale}/admin/social-issue + path: /{_locale}/admin/social-work/social-issue controller: cscrud_social_issue_controller:index options: menus: @@ -145,6 +145,44 @@ chill_person_socialissue_admin: order: 150 label: 'person_admin.social_issue' +chill_person_socialaction_admin: + path: /{_locale}/admin/social-work/social-action + controller: cscrud_social_action_controller:index + options: + menus: + admin_person: + order: 160 + label: 'person_admin.social_action' + + +chill_person_social_evaluation_admin: + path: /{_locale}/admin/social-work/evaluation + controller: cscrud_social_evaluation_controller:index + options: + menus: + admin_person: + order: 170 + label: 'person_admin.social_evaluation' + +chill_person_social_goal_admin: + path: /{_locale}/admin/social-work/goal + controller: cscrud_social_goal_controller:index + options: + menus: + admin_person: + order: 180 + label: 'person_admin.social_goal' + +chill_person_social_result_admin: + path: /{_locale}/admin/social-work/result + controller: cscrud_social_result_controller:index + options: + menus: + admin_person: + order: 190 + label: 'person_admin.social_result' + + chill_person_controllers: resource: "@ChillPersonBundle/Controller" diff --git a/src/Bundle/ChillPersonBundle/config/services/form.yaml b/src/Bundle/ChillPersonBundle/config/services/form.yaml index 0f415acac..b61de615d 100644 --- a/src/Bundle/ChillPersonBundle/config/services/form.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/form.yaml @@ -59,3 +59,29 @@ services: $translatableStringHelper: '@chill.main.helper.translatable_string' tags: - { name: form.type } + + Chill\PersonBundle\Form\SocialWork\SocialActionType: + arguments: + $translatableStringHelper: '@chill.main.helper.translatable_string' + tags: + - { name: form.type } + + Chill\PersonBundle\Form\SocialWork\EvaluationType: + arguments: + $translatableStringHelper: '@chill.main.helper.translatable_string' + tags: + - { name: form.type } + + + Chill\PersonBundle\Form\SocialWork\GoalType: + arguments: + $translatableStringHelper: '@chill.main.helper.translatable_string' + tags: + - { name: form.type } + + + Chill\PersonBundle\Form\SocialWork\ResultType: + arguments: + $translatableStringHelper: '@chill.main.helper.translatable_string' + tags: + - { name: form.type } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 5871c4733..98523a762 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -310,6 +310,25 @@ crud: add_new: Ajouter une nouvelle problématique sociale title_new: Nouvelle problématique sociale title_edit: Modifier la problématique sociale + social_action: + index: + title: Liste des actions d'accompagnements + add_new: Ajouter une nouvelle action d'accompagnements + title_new: Nouvelle action d'accompagnements + title_edit: Modifier l'action d'accompagnements + social_goal: + index: + title: Liste des objectifs d'action d'accompagnements + add_new: Ajouter un nouvel objectif d'action d'accompagnements + title_new: Nouvel objectif + title_edit: Modifier l'objectif + social_result: + index: + title: Liste des résultats d'action d'accompagnements + add_new: Ajouter un nouveau résultat d'action d'accompagnements + title_new: Nouveau résultat + title_edit: Modifier le résultat + # specific to closing motive closing_motive: @@ -329,6 +348,10 @@ person_admin: marital status explanation: > Configurer la liste des états civils. social_issue: Problématiques sociales + social_action: Actions d'accompagnement + social_goal: Buts + social_result: Résultats + social_evaluation: Évaluations # specific to accompanying period accompanying_period: From 3be024bf6bb35c8d2ca26d6b2f4de8085b8537da Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 19 May 2021 15:26:06 +0200 Subject: [PATCH 6/6] Removing un-used code --- .../Form/SocialWork/EvaluationType.php | 18 +----------------- .../Form/SocialWork/GoalType.php | 2 -- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php index 41f44a8fd..b45cd327e 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php @@ -57,23 +57,7 @@ class EvaluationType extends AbstractType ->add('delay') ->add('notificationDelay'); - /* ]) - - ->add('parent', EntityType::class, [ - 'class' => SocialIssue::class, - 'required' => false, - 'choice_label' => function (SocialIssue $issue) { - return $this->translatableStringHelper->localize($issue->getTitle()); - } - ]) - - ->add('desactivationDate', DateType::class, array( - 'attr' => array('class' => 'datepicker'), - 'widget'=> 'single_text', - 'format' => 'dd-MM-yyyy', - 'required' => false, */ - // ]); -} + } /** * @param OptionsResolver $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php index 9cf9013dc..c86a7d6b9 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php @@ -56,8 +56,6 @@ class GoalType extends AbstractType 'label' => 'Nom' ]) - // ->add('socialActions') - ->add('socialActions', EntityType::class, [ 'class' => SocialAction::class, 'required' => false,