mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Merge branch '207_activity_bugfix' into 'master'
option added to distinguish between edit and new action so that modification... See merge request Chill-Projet/chill-bundles!168
This commit is contained in:
commit
7ed61398ea
@ -27,3 +27,4 @@ Version 1.5.5
|
|||||||
=============
|
=============
|
||||||
|
|
||||||
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
|
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
|
||||||
|
- fix bug: error when trying to edit activity of which the type has been deactivated
|
||||||
|
@ -174,6 +174,10 @@ class ActivityController extends AbstractController
|
|||||||
$activityType = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityType::class)
|
$activityType = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityType::class)
|
||||||
->find($activityType_id);
|
->find($activityType_id);
|
||||||
|
|
||||||
|
if (isset($activityType) && !$activityType->isActive()) {
|
||||||
|
throw new \InvalidArgumentException('Activity type must be active');
|
||||||
|
}
|
||||||
|
|
||||||
$activityData = null;
|
$activityData = null;
|
||||||
if ($request->query->has('activityData')) {
|
if ($request->query->has('activityData')) {
|
||||||
$activityData = $request->query->get('activityData');
|
$activityData = $request->query->get('activityData');
|
||||||
|
@ -93,15 +93,13 @@ class ActivityType extends AbstractType
|
|||||||
/** @var \Chill\ActivityBundle\Entity\ActivityType $activityType */
|
/** @var \Chill\ActivityBundle\Entity\ActivityType $activityType */
|
||||||
$activityType = $options['activityType'];
|
$activityType = $options['activityType'];
|
||||||
|
|
||||||
if (!$activityType->isActive()) {
|
|
||||||
throw new \InvalidArgumentException('Activity type must be active');
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO revoir la gestion des center au niveau du form des activité.
|
// TODO revoir la gestion des center au niveau du form des activité.
|
||||||
if ($options['center']) {
|
if ($options['center']) {
|
||||||
$builder->add('scope', ScopePickerType::class, [
|
$builder->add('scope', ScopePickerType::class, [
|
||||||
'center' => $options['center'],
|
'center' => $options['center'],
|
||||||
'role' => $options['role']
|
'role' => $options['role'],
|
||||||
|
// TODO make required again once scope and rights are fixed
|
||||||
|
'required' => false
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user