admin: admin section for social work related entities: SocialIssue, SocialAction, Goal, Result, Evaluation

This commit is contained in:
nobohan
2022-05-05 12:07:45 +02:00
parent 10aa727fb3
commit 5daf09334b
27 changed files with 290 additions and 192 deletions

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 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;
@@ -52,11 +52,9 @@ class GoalType extends AbstractType
},
])
->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,14 @@ 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\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\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -44,6 +45,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 +57,13 @@ 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('defaultNotificationDelay', DateIntervalType::class, [
'label' => 'socialAction.defaultNotificationDelay',
'required' => false,
])
->add('desactivationDate', ChillDateType::class, [
'required' => false,
'label' => 'goal.desactivationDate',
]);
}

View File

@@ -11,12 +11,12 @@ 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\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -41,10 +41,8 @@ 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('desactivationDate', ChillDateType::class, [
'label' => 'goal.desactivationDate',
'required' => false,
]);
}