mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-26 09:33:50 +00:00
add ordoring field & Display Activity type by Category
This commit is contained in:
@@ -27,7 +27,6 @@ use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
@@ -104,12 +103,24 @@ class ActivityController extends AbstractController
|
||||
throw $this->createNotFoundException('Person not found');
|
||||
}
|
||||
|
||||
$activityTypes = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityType::class)
|
||||
->findBy(['active' => true]);
|
||||
$data = [];
|
||||
|
||||
$activityTypeCategories = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityTypeCategory::class)
|
||||
->findBy(['active' => true], ['ordering' => 'ASC']);
|
||||
|
||||
foreach ($activityTypeCategories as $activityTypeCategory) {
|
||||
$activityTypes = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityType::class)
|
||||
->findBy(['active' => true, 'category' => $activityTypeCategory], ['ordering' => 'ASC']);
|
||||
|
||||
$data[] = [
|
||||
'activityTypeCategory' => $activityTypeCategory,
|
||||
'activityTypes' => $activityTypes,
|
||||
];
|
||||
}
|
||||
|
||||
return $this->render('ChillActivityBundle:Activity:selectType.html.twig', [
|
||||
'person' => $person,
|
||||
'activityTypes' => $activityTypes,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user