Merge remote-tracking branch 'origin/master' into calendar/synchro-msgraph

This commit is contained in:
2022-05-28 00:30:02 +02:00
295 changed files with 4720 additions and 1727 deletions

View File

@@ -0,0 +1,47 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Form;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\PersonBundle\Entity\Household\Position;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class HouseholdPositionType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', TranslatableStringFormType::class)
->add('allowHolder', CheckboxType::class, [
'required' => false,
'label' => 'household.allowHolder',
])
->add('shareHousehold', CheckboxType::class, [
'required' => false,
'label' => 'household.shareHousehold',
])
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 5,
]);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', Position::class);
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Form;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class OriginType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', TranslatableStringFormType::class)
->add('noActiveAfter', ChillDateType::class, [
'required' => false,
'input' => 'datetime_immutable',
'label' => 'origin.noActiveAfter',
]);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', Origin::class);
}
}

View File

@@ -0,0 +1,40 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Form;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\PersonBundle\Entity\Person\PersonResourceKind;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PersonResourceKindType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', TranslatableStringFormType::class)
->add('isActive', ChoiceType::class, [
'choices' => [
'Active' => true,
'Inactive' => false,
],
]);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', PersonResourceKind::class);
}
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Form;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\PersonBundle\Entity\Relationships\Relation;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class RelationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', TranslatableStringFormType::class, [
'label' => 'relation.title',
])
->add('reverseTitle', TranslatableStringFormType::class, [
'label' => 'relation.reverseTitle',
])
->add('isActive', CheckboxType::class, [
'required' => false,
]);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', Relation::class);
}
}

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Form\SocialWork;
use Chill\MainBundle\Form\Type\DateIntervalType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
@@ -39,9 +40,14 @@ class EvaluationType extends AbstractType
->add('title', TranslatableStringFormType::class, [
'label' => 'Nom',
])
->add('delay')
->add('notificationDelay');
->add('delay', DateIntervalType::class, [
'label' => 'evaluation.delay',
'required' => false,
])
->add('notificationDelay', DateIntervalType::class, [
'label' => 'evaluation.notificationDelay',
'required' => false,
]);
}
public function configureOptions(OptionsResolver $resolver)

View File

@@ -11,13 +11,13 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Form\SocialWork;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\SocialWork\Goal;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\PersonBundle\Entity\SocialWork\Result;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -42,21 +42,18 @@ class GoalType extends AbstractType
->add('title', TranslatableStringFormType::class, [
'label' => 'Nom',
])
->add('socialActions', EntityType::class, [
'class' => SocialAction::class,
->add('results', EntityType::class, [
'class' => Result::class,
'required' => false,
'multiple' => true,
'choice_label' => function (SocialAction $issue) {
return $this->translatableStringHelper->localize($issue->getTitle());
'choice_label' => function (Result $r) {
return $this->translatableStringHelper->localize($r->getTitle());
},
'attr' => ['class' => 'select2 '],
])
->add('desactivationDate', DateType::class, [
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
->add('desactivationDate', ChillDateType::class, [
'required' => false,
'label' => 'goal.desactivationDate',
]);
}

View File

@@ -11,11 +11,11 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Form\SocialWork;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\SocialWork\Result;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -40,13 +40,10 @@ class ResultType extends AbstractType
->add('title', TranslatableStringFormType::class, [
'label' => 'Nom',
])
->add('accompanyingPeriodWorks')
->add('accompanyingPeriodWorkGoals')
->add('desactivationDate', DateType::class, [
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
->add('desactivationDate', ChillDateType::class, [
'required' => false,
'label' => 'goal.desactivationDate',
]);
}

View File

@@ -11,13 +11,18 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Form\SocialWork;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\DateIntervalType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
use Chill\PersonBundle\Entity\SocialWork\Goal;
use Chill\PersonBundle\Entity\SocialWork\Result;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -44,6 +49,7 @@ class SocialActionType extends AbstractType
])
->add('issue', EntityType::class, [
'class' => SocialIssue::class,
'label' => 'socialAction.socialIssue',
'choice_label' => function (SocialIssue $issue) {
return $this->translatableStringHelper->localize($issue->getTitle());
},
@@ -55,12 +61,47 @@ class SocialActionType extends AbstractType
return $this->translatableStringHelper->localize($issue->getTitle());
},
])
->add('defaultNotificationDelay')
->add('desactivationDate', DateType::class, [
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 6,
])
->add('results', EntityType::class, [
'class' => Result::class,
'required' => false,
'multiple' => true,
'attr' => ['class' => 'select2'],
'choice_label' => function (Result $r) {
return $this->translatableStringHelper->localize($r->getTitle());
},
])
->add('goals', EntityType::class, [
'class' => Goal::class,
'required' => false,
'multiple' => true,
'attr' => ['class' => 'select2'],
'choice_label' => function (Goal $g) {
return $this->translatableStringHelper->localize($g->getTitle());
},
])
->add('evaluations', EntityType::class, [
'class' => Evaluation::class,
'required' => false,
'multiple' => true,
'attr' => ['class' => 'select2'],
'choice_label' => function (Evaluation $e) {
return $this->translatableStringHelper->localize($e->getTitle());
},
])
->add('defaultNotificationDelay', DateIntervalType::class, [
'label' => 'socialAction.defaultNotificationDelay',
'required' => false,
])
->add('desactivationDate', ChillDateType::class, [
'required' => false,
'label' => 'goal.desactivationDate',
]);
}

View File

@@ -11,12 +11,13 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Form\SocialWork;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -41,10 +42,12 @@ class SocialIssueType extends AbstractType
'required' => false,
'choice_label' => fn (SocialIssue $issue): ?string => $this->translatableStringHelper->localize($issue->getTitle()),
])
->add('desactivationDate', DateType::class, [
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 6,
])
->add('desactivationDate', ChillDateType::class, [
'label' => 'goal.desactivationDate',
'required' => false,
]);
}