Merge branch 'issue_43_admin_for_prob_soc' into 'master'

WIP : Issue 43 admin for prob soc

See merge request Chill-Projet/chill-bundles!56
This commit is contained in:
Marc Ducobu 2021-08-06 13:36:31 +00:00
commit 6b4e27a531
23 changed files with 974 additions and 1 deletions

View File

@ -0,0 +1,33 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\PersonBundle\Controller\SocialWork;
use Chill\MainBundle\CRUD\Controller\CRUDController;
/**
* Class AdminSocialIssueController
* Controller for social issues
*
* @package Chill\PersonBundle\Controller
*/
class AdminEvaluationController extends CRUDController
{
}

View File

@ -0,0 +1,33 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\PersonBundle\Controller\SocialWork;
use Chill\MainBundle\CRUD\Controller\CRUDController;
/**
* Class AdminSocialIssueController
* Controller for social issues
*
* @package Chill\PersonBundle\Controller
*/
class AdminGoalController extends CRUDController
{
}

View File

@ -0,0 +1,33 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\PersonBundle\Controller\SocialWork;
use Chill\MainBundle\CRUD\Controller\CRUDController;
/**
* Class AdminSocialIssueController
* Controller for social issues
*
* @package Chill\PersonBundle\Controller
*/
class AdminResultController extends CRUDController
{
}

View File

@ -0,0 +1,33 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\PersonBundle\Controller\SocialWork;
use Chill\MainBundle\CRUD\Controller\CRUDController;
/**
* Class AdminSocialIssueController
* Controller for social issues
*
* @package Chill\PersonBundle\Controller
*/
class AdminSocialActionController extends CRUDController
{
}

View File

@ -0,0 +1,33 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\PersonBundle\Controller\SocialWork;
use Chill\MainBundle\CRUD\Controller\CRUDController;
/**
* Class AdminSocialIssueController
* Controller for social issues
*
* @package Chill\PersonBundle\Controller
*/
class AdminSocialIssueController extends CRUDController
{
}

View File

@ -345,6 +345,111 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
]
]
],
[
'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class,
'name' => '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' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillPerson/SocialWork/SocialIssue/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\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' => [
[

View File

@ -0,0 +1,71 @@
<?php
/*
*
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\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');
}
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', Evaluation::class)
;
}
}

View File

@ -0,0 +1,85 @@
<?php
/*
*
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\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', 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)
;
}
}

View File

@ -0,0 +1,76 @@
<?php
/*
*
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\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)
;
}
}

View File

@ -0,0 +1,90 @@
<?php
/*
*
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\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)
;
}
}

View File

@ -0,0 +1,83 @@
<?php
/*
*
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\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, [
'attr' => ['class' => 'datepicker'],
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
'required' => false,
]);
}
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', SocialIssue::class)
;
}
}

View File

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

View File

@ -1,6 +1,25 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\PersonBundle\Repository\SocialWork;

View File

@ -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 %}
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Title'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.title|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_social_evaluation_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -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 %}
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Title'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.title|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_social_goal_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -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 %}
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Title'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.title|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_social_result_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -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 %}
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Title'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.title|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_social_action_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -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 %}
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Title'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.title|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_social_issue_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% endembed %}
{% endblock %}

View File

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

View File

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

View File

@ -136,6 +136,54 @@ chill_person_maritalstatus_admin:
order: 120
label: 'person_admin.marital status'
chill_person_socialissue_admin:
path: /{_locale}/admin/social-work/social-issue
controller: cscrud_social_issue_controller:index
options:
menus:
admin_person:
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"
type: annotation

View File

@ -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,35 @@ 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 }
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 }

View File

@ -304,6 +304,31 @@ 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
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:
@ -322,6 +347,11 @@ person_admin:
marital status list: Liste des états civils
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: