add conferences, debriefings, projects, theme types, establishment groups
This commit is contained in:
parent
2a1a7d40f5
commit
3730d8d5cc
145
src/Controller/ConferenceAdminController.php
Normal file
145
src/Controller/ConferenceAdminController.php
Normal file
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller\Admin\Crud\CrudController;
|
||||
use App\Core\Crud\CrudConfiguration;
|
||||
use App\Core\Crud\Field;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Conference as Entity;
|
||||
use App\Factory\ConferenceFactory as Factory;
|
||||
use App\Form\ConferenceType as Type;
|
||||
use App\Repository\ConferenceRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ConferenceAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/conference/{page}", name="admin_conference_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/conference/new", name="admin_conference_new", methods={"GET", "POST"})
|
||||
*/
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/conference/show/{entity}", name="admin_conference_show", methods={"GET"})
|
||||
*/
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/conference/filter", name="admin_conference_filter", methods={"GET"})
|
||||
*/
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/conference/edit/{entity}", name="admin_conference_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/conference/sort/{page}", name="admin_conference_sort", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/conference/batch/{page}", name="admin_conference_batch", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/conference/delete/{entity}", name="admin_conference_delete", methods={"DELETE"})
|
||||
*/
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
->setPageTitle('index', 'Conférences')
|
||||
->setPageTitle('edit', 'Conférence {id}')
|
||||
->setPageTitle('new', 'Nouvelle conférence')
|
||||
->setPageTitle('show', 'Conférence {id}')
|
||||
|
||||
->setPageRoute('index', 'admin_conference_index')
|
||||
->setPageRoute('new', 'admin_conference_new')
|
||||
->setPageRoute('edit', 'admin_conference_edit')
|
||||
->setPageRoute('show', 'admin_conference_show')
|
||||
->setPageRoute('sort', 'admin_conference_sort')
|
||||
->setPageRoute('batch', 'admin_conference_batch')
|
||||
->setPageRoute('delete', 'admin_conference_delete')
|
||||
->setPageRoute('filter', 'admin_conference_filter')
|
||||
|
||||
->setForm('edit', Type::class, [])
|
||||
->setForm('new', Type::class)
|
||||
// ->setForm('filter', Type::class)
|
||||
|
||||
->setView('form', 'admin/conference/_form.html.twig')
|
||||
|
||||
// ->setMaxPerPage('index', 20)
|
||||
|
||||
// ->setIsSortableCollection('index', false)
|
||||
// ->setSortableCollectionProperty('sortOrder')
|
||||
|
||||
// ->setAction('index', 'new', true)
|
||||
->setAction('index', 'show', false)
|
||||
// ->setAction('index', 'edit', true)
|
||||
// ->setAction('index', 'delete', true)
|
||||
|
||||
// ->setAction('edit', 'back', true)
|
||||
->setAction('edit', 'show', false)
|
||||
// ->setAction('edit', 'delete', true)
|
||||
|
||||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
->setField('index', 'Label', Field\TextField::class, [
|
||||
'property' => 'label',
|
||||
])
|
||||
->setField('index', 'Date', Field\DateField::class, [
|
||||
'property' => 'date',
|
||||
'format' => 'd/m/Y',
|
||||
'sort' => ['date', '.date'],
|
||||
'attr' => ['class' => 'col-3'],
|
||||
])
|
||||
|
||||
// ->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
// $manager->delete($entity);
|
||||
// })
|
||||
;
|
||||
}
|
||||
|
||||
protected function getSection(): string
|
||||
{
|
||||
return 'conference';
|
||||
}
|
||||
}
|
148
src/Controller/DebriefingAdminController.php
Normal file
148
src/Controller/DebriefingAdminController.php
Normal file
|
@ -0,0 +1,148 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller\Admin\Crud\CrudController;
|
||||
use App\Core\Crud\CrudConfiguration;
|
||||
use App\Core\Crud\Field;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Debriefing as Entity;
|
||||
use App\Factory\DebriefingFactory as Factory;
|
||||
use App\Form\DebriefingType as Type;
|
||||
use App\Repository\DebriefingRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class DebriefingAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/debriefing/{page}", name="admin_debriefing_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/debriefing/new", name="admin_debriefing_new", methods={"GET", "POST"})
|
||||
*/
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/debriefing/show/{entity}", name="admin_debriefing_show", methods={"GET"})
|
||||
*/
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/debriefing/filter", name="admin_debriefing_filter", methods={"GET"})
|
||||
*/
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/debriefing/edit/{entity}", name="admin_debriefing_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/debriefing/sort/{page}", name="admin_debriefing_sort", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/debriefing/batch/{page}", name="admin_debriefing_batch", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/debriefing/delete/{entity}", name="admin_debriefing_delete", methods={"DELETE"})
|
||||
*/
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
->setPageTitle('index', 'Comptes-rendus')
|
||||
->setPageTitle('edit', 'Compte-rendu {id}')
|
||||
->setPageTitle('new', 'Nouveau compte-rendu')
|
||||
->setPageTitle('show', 'Compte-rendu {id}')
|
||||
|
||||
->setPageRoute('index', 'admin_debriefing_index')
|
||||
->setPageRoute('new', 'admin_debriefing_new')
|
||||
->setPageRoute('edit', 'admin_debriefing_edit')
|
||||
->setPageRoute('show', 'admin_debriefing_show')
|
||||
->setPageRoute('sort', 'admin_debriefing_sort')
|
||||
->setPageRoute('batch', 'admin_debriefing_batch')
|
||||
->setPageRoute('delete', 'admin_debriefing_delete')
|
||||
->setPageRoute('filter', 'admin_debriefing_filter')
|
||||
|
||||
->setForm('edit', Type::class, [])
|
||||
->setForm('new', Type::class)
|
||||
// ->setForm('filter', Type::class)
|
||||
|
||||
->setView('form', 'admin/debriefing/_form.html.twig')
|
||||
|
||||
// ->setMaxPerPage('index', 20)
|
||||
|
||||
// ->setIsSortableCollection('index', false)
|
||||
// ->setSortableCollectionProperty('sortOrder')
|
||||
|
||||
// ->setAction('index', 'new', true)
|
||||
// ->setAction('index', 'show', true)
|
||||
// ->setAction('index', 'edit', true)
|
||||
// ->setAction('index', 'delete', true)
|
||||
|
||||
// ->setAction('edit', 'back', true)
|
||||
// ->setAction('edit', 'show', true)
|
||||
// ->setAction('edit', 'delete', true)
|
||||
|
||||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
->setField('index', 'Topic', Field\TextField::class, [
|
||||
'property' => 'topic',
|
||||
'sort' => ['topic', '.topic'],
|
||||
'attr' => ['class' => 'col-8'],
|
||||
])
|
||||
->setField('index', 'Date', Field\DateField::class, [
|
||||
'property' => 'date',
|
||||
'format' => 'd/m/Y',
|
||||
'sort' => ['date', '.date'],
|
||||
'attr' => ['class' => 'col-2'],
|
||||
])
|
||||
->setDefaultSort('index', 'date', 'desc')
|
||||
|
||||
// ->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
// $manager->delete($entity);
|
||||
// })
|
||||
;
|
||||
}
|
||||
|
||||
protected function getSection(): string
|
||||
{
|
||||
return 'debriefing';
|
||||
}
|
||||
}
|
137
src/Controller/EstablishmentGroupAdminController.php
Normal file
137
src/Controller/EstablishmentGroupAdminController.php
Normal file
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller\Admin\Crud\CrudController;
|
||||
use App\Core\Crud\CrudConfiguration;
|
||||
use App\Core\Crud\Field;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\EstablishmentGroup as Entity;
|
||||
use App\Factory\EstablishmentGroupFactory as Factory;
|
||||
use App\Form\EstablishmentGroupType as Type;
|
||||
use App\Repository\EstablishmentGroupRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class EstablishmentGroupAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/establishment_group/{page}", name="admin_establishment_group_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/establishment_group/new", name="admin_establishment_group_new", methods={"GET", "POST"})
|
||||
*/
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/establishment_group/show/{entity}", name="admin_establishment_group_show", methods={"GET"})
|
||||
*/
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/establishment_group/filter", name="admin_establishment_group_filter", methods={"GET"})
|
||||
*/
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/establishment_group/edit/{entity}", name="admin_establishment_group_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/establishment_group/sort/{page}", name="admin_establishment_group_sort", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/establishment_group/batch/{page}", name="admin_establishment_group_batch", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/establishment_group/delete/{entity}", name="admin_establishment_group_delete", methods={"DELETE"})
|
||||
*/
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
->setPageTitle('index', 'List of App\Entity\EstablishmentGroup')
|
||||
->setPageTitle('edit', 'Edition of {id}')
|
||||
->setPageTitle('new', 'New App\Entity\EstablishmentGroup')
|
||||
->setPageTitle('show', 'View of {id}')
|
||||
|
||||
->setPageRoute('index', 'admin_establishment_group_index')
|
||||
->setPageRoute('new', 'admin_establishment_group_new')
|
||||
->setPageRoute('edit', 'admin_establishment_group_edit')
|
||||
->setPageRoute('show', 'admin_establishment_group_show')
|
||||
->setPageRoute('sort', 'admin_establishment_group_sort')
|
||||
->setPageRoute('batch', 'admin_establishment_group_batch')
|
||||
->setPageRoute('delete', 'admin_establishment_group_delete')
|
||||
->setPageRoute('filter', 'admin_establishment_group_filter')
|
||||
|
||||
->setForm('edit', Type::class, [])
|
||||
->setForm('new', Type::class)
|
||||
// ->setForm('filter', Type::class)
|
||||
|
||||
// ->setMaxPerPage('index', 20)
|
||||
|
||||
// ->setIsSortableCollection('index', false)
|
||||
// ->setSortableCollectionProperty('sortOrder')
|
||||
|
||||
// ->setAction('index', 'new', true)
|
||||
// ->setAction('index', 'show', true)
|
||||
// ->setAction('index', 'edit', true)
|
||||
// ->setAction('index', 'delete', true)
|
||||
|
||||
// ->setAction('edit', 'back', true)
|
||||
// ->setAction('edit', 'show', true)
|
||||
// ->setAction('edit', 'delete', true)
|
||||
|
||||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
// ->setField('index', 'Label', Field\TextField::class, [
|
||||
// 'property' => 'label',
|
||||
// ])
|
||||
|
||||
// ->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
// $manager->delete($entity);
|
||||
// })
|
||||
;
|
||||
}
|
||||
|
||||
protected function getSection(): string
|
||||
{
|
||||
return 'establishment_group';
|
||||
}
|
||||
}
|
139
src/Controller/ProjectAdminController.php
Normal file
139
src/Controller/ProjectAdminController.php
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller\Admin\Crud\CrudController;
|
||||
use App\Core\Crud\CrudConfiguration;
|
||||
use App\Core\Crud\Field;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Project as Entity;
|
||||
use App\Factory\ProjectFactory as Factory;
|
||||
use App\Form\ProjectType as Type;
|
||||
use App\Repository\ProjectRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ProjectAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/project/{page}", name="admin_project_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/project/new", name="admin_project_new", methods={"GET", "POST"})
|
||||
*/
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/project/show/{entity}", name="admin_project_show", methods={"GET"})
|
||||
*/
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/project/filter", name="admin_project_filter", methods={"GET"})
|
||||
*/
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/project/edit/{entity}", name="admin_project_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/project/sort/{page}", name="admin_project_sort", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/project/batch/{page}", name="admin_project_batch", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/project/delete/{entity}", name="admin_project_delete", methods={"DELETE"})
|
||||
*/
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
->setPageTitle('index', 'Projets')
|
||||
->setPageTitle('edit', 'Projet {id}')
|
||||
->setPageTitle('new', 'Nouveau projet')
|
||||
->setPageTitle('show', 'Projet {id}')
|
||||
|
||||
->setPageRoute('index', 'admin_project_index')
|
||||
->setPageRoute('new', 'admin_project_new')
|
||||
->setPageRoute('edit', 'admin_project_edit')
|
||||
->setPageRoute('show', 'admin_project_show')
|
||||
->setPageRoute('sort', 'admin_project_sort')
|
||||
->setPageRoute('batch', 'admin_project_batch')
|
||||
->setPageRoute('delete', 'admin_project_delete')
|
||||
->setPageRoute('filter', 'admin_project_filter')
|
||||
|
||||
->setForm('edit', Type::class, [])
|
||||
->setForm('new', Type::class)
|
||||
// ->setForm('filter', Type::class)
|
||||
|
||||
// ->setMaxPerPage('index', 20)
|
||||
|
||||
// ->setIsSortableCollection('index', false)
|
||||
// ->setSortableCollectionProperty('sortOrder')
|
||||
|
||||
// ->setAction('index', 'new', true)
|
||||
// ->setAction('index', 'show', true)
|
||||
// ->setAction('index', 'edit', true)
|
||||
// ->setAction('index', 'delete', true)
|
||||
|
||||
// ->setAction('edit', 'back', true)
|
||||
// ->setAction('edit', 'show', true)
|
||||
// ->setAction('edit', 'delete', true)
|
||||
|
||||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
->setField('index', 'Label', Field\TextField::class, [
|
||||
'property' => 'label',
|
||||
'sort' => ['label', '.label'],
|
||||
])
|
||||
->setDefaultSort('index', 'label', 'asc')
|
||||
|
||||
// ->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
// $manager->delete($entity);
|
||||
// })
|
||||
;
|
||||
}
|
||||
|
||||
protected function getSection(): string
|
||||
{
|
||||
return 'project';
|
||||
}
|
||||
}
|
139
src/Controller/ThemeTypeAdminController.php
Normal file
139
src/Controller/ThemeTypeAdminController.php
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller\Admin\Crud\CrudController;
|
||||
use App\Core\Crud\CrudConfiguration;
|
||||
use App\Core\Crud\Field;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\ThemeType as Entity;
|
||||
use App\Factory\ThemeTypeFactory as Factory;
|
||||
use App\Form\ThemeTypeType as Type;
|
||||
use App\Repository\ThemeTypeRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ThemeTypeAdminController extends CrudController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin/theme_type/{page}", name="admin_theme_type_index", methods={"GET"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/theme_type/new", name="admin_theme_type_new", methods={"GET", "POST"})
|
||||
*/
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/theme_type/show/{entity}", name="admin_theme_type_show", methods={"GET"})
|
||||
*/
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/theme_type/filter", name="admin_theme_type_filter", methods={"GET"})
|
||||
*/
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/theme_type/edit/{entity}", name="admin_theme_type_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/theme_type/sort/{page}", name="admin_theme_type_sort", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/theme_type/batch/{page}", name="admin_theme_type_batch", methods={"POST"}, requirements={"page":"\d+"})
|
||||
*/
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/admin/theme_type/delete/{entity}", name="admin_theme_type_delete", methods={"DELETE"})
|
||||
*/
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
->setPageTitle('index', 'Types de thématiques')
|
||||
->setPageTitle('edit', 'Type de thématique {id}')
|
||||
->setPageTitle('new', 'Nouveau type de thématique')
|
||||
->setPageTitle('show', 'Type de thématique {id}')
|
||||
|
||||
->setPageRoute('index', 'admin_theme_type_index')
|
||||
->setPageRoute('new', 'admin_theme_type_new')
|
||||
->setPageRoute('edit', 'admin_theme_type_edit')
|
||||
->setPageRoute('show', 'admin_theme_type_show')
|
||||
->setPageRoute('sort', 'admin_theme_type_sort')
|
||||
->setPageRoute('batch', 'admin_theme_type_batch')
|
||||
->setPageRoute('delete', 'admin_theme_type_delete')
|
||||
->setPageRoute('filter', 'admin_theme_type_filter')
|
||||
|
||||
->setForm('edit', Type::class, [])
|
||||
->setForm('new', Type::class)
|
||||
// ->setForm('filter', Type::class)
|
||||
|
||||
// ->setMaxPerPage('index', 20)
|
||||
|
||||
// ->setIsSortableCollection('index', false)
|
||||
// ->setSortableCollectionProperty('sortOrder')
|
||||
|
||||
// ->setAction('index', 'new', true)
|
||||
->setAction('index', 'show', false)
|
||||
// ->setAction('index', 'edit', true)
|
||||
// ->setAction('index', 'delete', true)
|
||||
|
||||
// ->setAction('edit', 'back', true)
|
||||
->setAction('edit', 'show', false)
|
||||
// ->setAction('edit', 'delete', true)
|
||||
|
||||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
->setField('index', 'Label', Field\TextField::class, [
|
||||
'property' => 'label',
|
||||
'sort' => ['label', '.label'],
|
||||
])
|
||||
->setDefaultSort('index', 'label', 'asc')
|
||||
|
||||
// ->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
// $manager->delete($entity);
|
||||
// })
|
||||
;
|
||||
}
|
||||
|
||||
protected function getSection(): string
|
||||
{
|
||||
return 'theme_type';
|
||||
}
|
||||
}
|
145
src/Entity/Conference.php
Normal file
145
src/Entity/Conference.php
Normal file
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\ConferenceRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=ConferenceRepository::class)
|
||||
*/
|
||||
class Conference implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $persons;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=ThemeType::class, inversedBy="conferences")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
protected $themeType;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $content;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $comment;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $feedback;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date", nullable=true)
|
||||
*/
|
||||
private $date;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): self
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPersons(): ?int
|
||||
{
|
||||
return $this->persons;
|
||||
}
|
||||
|
||||
public function setPersons(int $persons): self
|
||||
{
|
||||
$this->persons = abs($persons);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getThemeType(): ?ThemeType
|
||||
{
|
||||
return $this->themeType;
|
||||
}
|
||||
|
||||
public function setThemeType(?ThemeType $themeType): self
|
||||
{
|
||||
$this->themeType = $themeType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getContent(): ?string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function setContent(?string $content): self
|
||||
{
|
||||
$this->content = $content;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getComment(): ?string
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function setComment(?string $comment): self
|
||||
{
|
||||
$this->comment = $comment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFeedback(): ?string
|
||||
{
|
||||
return $this->feedback;
|
||||
}
|
||||
|
||||
public function setFeedback(?string $feedback): self
|
||||
{
|
||||
$this->feedback = $feedback;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(?\DateTimeInterface $date): self
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
163
src/Entity/Debriefing.php
Normal file
163
src/Entity/Debriefing.php
Normal file
|
@ -0,0 +1,163 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\DebriefingRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=DebriefingRepository::class)
|
||||
*/
|
||||
class Debriefing implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
protected $topic;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date")
|
||||
*/
|
||||
protected $date;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=Project::class, inversedBy="debriefings")
|
||||
*/
|
||||
protected $project;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $internalContributors;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $externalContributors;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $content;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="array")
|
||||
*/
|
||||
protected $files = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->project = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTopic(): ?string
|
||||
{
|
||||
return $this->topic;
|
||||
}
|
||||
|
||||
public function setTopic(string $topic): self
|
||||
{
|
||||
$this->topic = $topic;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(\DateTimeInterface $date): self
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Project>
|
||||
*/
|
||||
public function getProject(): Collection
|
||||
{
|
||||
return $this->project;
|
||||
}
|
||||
|
||||
public function addProject(Project $project): self
|
||||
{
|
||||
if (!$this->project->contains($project)) {
|
||||
$this->project[] = $project;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeProject(Project $project): self
|
||||
{
|
||||
$this->project->removeElement($project);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getInternalContributors(): ?string
|
||||
{
|
||||
return $this->internalContributors;
|
||||
}
|
||||
|
||||
public function setInternalContributors(?string $internalContributors): self
|
||||
{
|
||||
$this->internalContributors = $internalContributors;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getExternalContributors(): ?string
|
||||
{
|
||||
return $this->externalContributors;
|
||||
}
|
||||
|
||||
public function setExternalContributors(?string $externalContributors): self
|
||||
{
|
||||
$this->externalContributors = $externalContributors;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getContent(): ?string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function setContent(?string $content): self
|
||||
{
|
||||
$this->content = $content;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFiles(): ?array
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
public function setFiles(array $files): self
|
||||
{
|
||||
$this->files = $files;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
104
src/Entity/EstablishmentGroup.php
Normal file
104
src/Entity/EstablishmentGroup.php
Normal file
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\EstablishmentGroupRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=EstablishmentGroupRepository::class)
|
||||
*/
|
||||
class EstablishmentGroup implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="establishmentGroups")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
protected $establishment;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=Intervention::class, mappedBy="establishmentGroups")
|
||||
*/
|
||||
protected $interventions;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->interventions = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->getLabel();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): self
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEstablishment(): ?Establishment
|
||||
{
|
||||
return $this->establishment;
|
||||
}
|
||||
|
||||
public function setEstablishment(?Establishment $establishment): self
|
||||
{
|
||||
$this->establishment = $establishment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Intervention>
|
||||
*/
|
||||
public function getInterventions(): Collection
|
||||
{
|
||||
return $this->interventions;
|
||||
}
|
||||
|
||||
public function addIntervention(Intervention $intervention): self
|
||||
{
|
||||
if (!$this->interventions->contains($intervention)) {
|
||||
$this->interventions[] = $intervention;
|
||||
$intervention->addEstablishmentGroup($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeIntervention(Intervention $intervention): self
|
||||
{
|
||||
if ($this->interventions->removeElement($intervention)) {
|
||||
$intervention->removeEstablishmentGroup($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
171
src/Entity/Project.php
Normal file
171
src/Entity/Project.php
Normal file
|
@ -0,0 +1,171 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\ProjectRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=ProjectRepository::class)
|
||||
*/
|
||||
class Project implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=Establishment::class, inversedBy="projects")
|
||||
*/
|
||||
protected $establishments;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="array")
|
||||
*/
|
||||
protected $files = [];
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=Debriefing::class, mappedBy="project")
|
||||
*/
|
||||
protected $debriefings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->establishments = new ArrayCollection();
|
||||
$this->debriefings = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->getLabel();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): self
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Establishment>
|
||||
*/
|
||||
public function getEstablishments(): Collection
|
||||
{
|
||||
return $this->establishments;
|
||||
}
|
||||
|
||||
public function addEstablishment(Establishment $establishment): self
|
||||
{
|
||||
if (!$this->establishments->contains($establishment)) {
|
||||
$this->establishments[] = $establishment;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeEstablishment(Establishment $establishment): self
|
||||
{
|
||||
$this->establishments->removeElement($establishment);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): self
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getClient(): ?string
|
||||
{
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
public function setClient(?string $client): self
|
||||
{
|
||||
$this->client = $client;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFiles(): ?array
|
||||
{
|
||||
usort($this->files, function($a, $b) {
|
||||
return $a['position'] <=> $b['position'];
|
||||
});
|
||||
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
public function setFiles(array $files): self
|
||||
{
|
||||
$this->files = $files;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Debriefing>
|
||||
*/
|
||||
public function getDebriefings(): Collection
|
||||
{
|
||||
return $this->debriefings;
|
||||
}
|
||||
|
||||
public function addDebriefing(Debriefing $debriefing): self
|
||||
{
|
||||
if (!$this->debriefings->contains($debriefing)) {
|
||||
$this->debriefings[] = $debriefing;
|
||||
$debriefing->addProject($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeDebriefing(Debriefing $debriefing): self
|
||||
{
|
||||
if ($this->debriefings->removeElement($debriefing)) {
|
||||
$debriefing->removeProject($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
125
src/Entity/ThemeType.php
Normal file
125
src/Entity/ThemeType.php
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\ThemeTypeRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=ThemeTypeRepository::class)
|
||||
*/
|
||||
class ThemeType implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Conference::class, mappedBy="themeType", orphanRemoval=true)
|
||||
*/
|
||||
protected $conferences;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Intervention::class, mappedBy="themeType", orphanRemoval=true)
|
||||
*/
|
||||
protected $interventions;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->conferences = new ArrayCollection();
|
||||
$this->interventions = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->getLabel();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): self
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Conference>
|
||||
*/
|
||||
public function getConferences(): Collection
|
||||
{
|
||||
return $this->conferences;
|
||||
}
|
||||
|
||||
public function addConference(Conference $conference): self
|
||||
{
|
||||
if (!$this->conferences->contains($conference)) {
|
||||
$this->conferences[] = $conference;
|
||||
$conference->setThemeType($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeConference(Conference $conference): self
|
||||
{
|
||||
if ($this->conferences->removeElement($conference)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($conference->getThemeType() === $this) {
|
||||
$conference->setThemeType(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Intervention>
|
||||
*/
|
||||
public function getInterventions(): Collection
|
||||
{
|
||||
return $this->interventions;
|
||||
}
|
||||
|
||||
public function addIntervention(Intervention $intervention): self
|
||||
{
|
||||
if (!$this->interventions->contains($intervention)) {
|
||||
$this->interventions[] = $intervention;
|
||||
$intervention->setThemeType($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeIntervention(Intervention $intervention): self
|
||||
{
|
||||
if ($this->interventions->removeElement($intervention)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($intervention->getThemeType() === $this) {
|
||||
$intervention->setThemeType(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
14
src/Factory/ConferenceFactory.php
Normal file
14
src/Factory/ConferenceFactory.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Factory;
|
||||
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
use App\Entity\Conference as Entity;
|
||||
|
||||
class ConferenceFactory implements FactoryInterface
|
||||
{
|
||||
public function create(): Entity
|
||||
{
|
||||
return new Entity();
|
||||
}
|
||||
}
|
14
src/Factory/DebriefingFactory.php
Normal file
14
src/Factory/DebriefingFactory.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Factory;
|
||||
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
use App\Entity\Debriefing as Entity;
|
||||
|
||||
class DebriefingFactory implements FactoryInterface
|
||||
{
|
||||
public function create(): Entity
|
||||
{
|
||||
return new Entity();
|
||||
}
|
||||
}
|
14
src/Factory/EstablishmentGroupFactory.php
Normal file
14
src/Factory/EstablishmentGroupFactory.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Factory;
|
||||
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
use App\Entity\EstablishmentGroup as Entity;
|
||||
|
||||
class EstablishmentGroupFactory implements FactoryInterface
|
||||
{
|
||||
public function create(): Entity
|
||||
{
|
||||
return new Entity();
|
||||
}
|
||||
}
|
14
src/Factory/ProjectFactory.php
Normal file
14
src/Factory/ProjectFactory.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Factory;
|
||||
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
use App\Entity\Project as Entity;
|
||||
|
||||
class ProjectFactory implements FactoryInterface
|
||||
{
|
||||
public function create(): Entity
|
||||
{
|
||||
return new Entity();
|
||||
}
|
||||
}
|
14
src/Factory/ThemeTypeFactory.php
Normal file
14
src/Factory/ThemeTypeFactory.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Factory;
|
||||
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
use App\Entity\ThemeType as Entity;
|
||||
|
||||
class ThemeTypeFactory implements FactoryInterface
|
||||
{
|
||||
public function create(): Entity
|
||||
{
|
||||
return new Entity();
|
||||
}
|
||||
}
|
40
src/Form/ConferenceType.php
Normal file
40
src/Form/ConferenceType.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Conference;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ConferenceType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('label')
|
||||
->add('themeType')
|
||||
->add('date', null, [
|
||||
'html5' => true,
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
->add('persons')
|
||||
->add('content', null, [
|
||||
'attr' => ['rows' => 7],
|
||||
])
|
||||
->add('comment', null, [
|
||||
'attr' => ['rows' => 7],
|
||||
])
|
||||
->add('feedback', null, [
|
||||
'attr' => ['rows' => 7],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Conference::class,
|
||||
]);
|
||||
}
|
||||
}
|
68
src/Form/DebriefingType.php
Normal file
68
src/Form/DebriefingType.php
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Debriefing;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Core\Form\Type\TinymceTextareaType;
|
||||
|
||||
class DebriefingType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('topic')
|
||||
->add('date', null, [
|
||||
'html5' => true,
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
->add('project', null, [
|
||||
'attr' => [
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
])
|
||||
->add('internalContributors', null, [
|
||||
'attr' => [
|
||||
'rows' => 7,
|
||||
],
|
||||
])
|
||||
->add('externalContributors', null, [
|
||||
'attr' => [
|
||||
'rows' => 7,
|
||||
],
|
||||
])
|
||||
->add('content', TinymceTextareaType::class, [
|
||||
'attr' => [
|
||||
'rows' => 15,
|
||||
],
|
||||
])
|
||||
->add('files',
|
||||
CollectionType::class,
|
||||
[
|
||||
'entry_type' => FileType::class,
|
||||
'by_reference' => false,
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
'prototype' => true,
|
||||
'collection_name' => 'files',
|
||||
'row_attr' => [
|
||||
'class' => 'mb-3',
|
||||
],
|
||||
'attr' => [
|
||||
'class' => 'd-ib col-4 pr-2 pl-2',
|
||||
],
|
||||
]
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Debriefing::class,
|
||||
]);
|
||||
}
|
||||
}
|
25
src/Form/EstablishmentGroupType.php
Normal file
25
src/Form/EstablishmentGroupType.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\EstablishmentGroup;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class EstablishmentGroupType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('label')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => EstablishmentGroup::class,
|
||||
]);
|
||||
}
|
||||
}
|
57
src/Form/FileType.php
Normal file
57
src/Form/FileType.php
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Core\Form\FileManager\FilePickerType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class FileType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('position', HiddenType::class);
|
||||
|
||||
$builder->add(
|
||||
'name',
|
||||
TextType::class,
|
||||
[
|
||||
'label' => 'Nom',
|
||||
'required' => true,
|
||||
'attr' => [
|
||||
],
|
||||
'attr' => [
|
||||
'class' => 'col-md-8',
|
||||
],
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$builder->add(
|
||||
'file',
|
||||
FilePickerType::class,
|
||||
[
|
||||
'label' => 'Fichier',
|
||||
'required' => true,
|
||||
'attr' => [
|
||||
'class' => 'col-md-6',
|
||||
],
|
||||
'constraints' => [
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
// Configure your form options here
|
||||
]);
|
||||
}
|
||||
}
|
54
src/Form/ProjectType.php
Normal file
54
src/Form/ProjectType.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Project;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class ProjectType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('label')
|
||||
->add('establishments', null, [
|
||||
'multiple' => true,
|
||||
'attr' => [
|
||||
'size' => 15,
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('e')
|
||||
->addOrderBy('e.name', 'ASC');
|
||||
},
|
||||
])
|
||||
->add('description')
|
||||
->add('client')
|
||||
->add('files',
|
||||
CollectionType::class,
|
||||
[
|
||||
'entry_type' => FileType::class,
|
||||
'by_reference' => false,
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
'prototype' => true,
|
||||
'collection_name' => 'files',
|
||||
'attr' => [
|
||||
'class' => 'd-ib col-4 pr-2 pl-2',
|
||||
],
|
||||
]
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Project::class,
|
||||
]);
|
||||
}
|
||||
}
|
25
src/Form/ThemeTypeType.php
Normal file
25
src/Form/ThemeTypeType.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\ThemeType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ThemeTypeType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('label')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => ThemeType::class,
|
||||
]);
|
||||
}
|
||||
}
|
76
src/Repository/ConferenceRepository.php
Normal file
76
src/Repository/ConferenceRepository.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Conference;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Conference|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Conference|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Conference[] findAll()
|
||||
* @method Conference[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class ConferenceRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Conference::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function add(Conference $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->persist($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function remove(Conference $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->remove($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Conference[] Returns an array of Conference objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('c')
|
||||
->andWhere('c.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('c.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?Conference
|
||||
{
|
||||
return $this->createQueryBuilder('c')
|
||||
->andWhere('c.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
15
src/Repository/ConferenceRepositoryQuery.php
Normal file
15
src/Repository/ConferenceRepositoryQuery.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\ConferenceRepository as Repository;
|
||||
|
||||
class ConferenceRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 'c', $paginator);
|
||||
}
|
||||
}
|
76
src/Repository/DebriefingRepository.php
Normal file
76
src/Repository/DebriefingRepository.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Debriefing;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Debriefing|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Debriefing|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Debriefing[] findAll()
|
||||
* @method Debriefing[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class DebriefingRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Debriefing::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function add(Debriefing $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->persist($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function remove(Debriefing $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->remove($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Debriefing[] Returns an array of Debriefing objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('d')
|
||||
->andWhere('d.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('d.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?Debriefing
|
||||
{
|
||||
return $this->createQueryBuilder('d')
|
||||
->andWhere('d.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
15
src/Repository/DebriefingRepositoryQuery.php
Normal file
15
src/Repository/DebriefingRepositoryQuery.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\DebriefingRepository as Repository;
|
||||
|
||||
class DebriefingRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 'd', $paginator);
|
||||
}
|
||||
}
|
76
src/Repository/EstablishmentGroupRepository.php
Normal file
76
src/Repository/EstablishmentGroupRepository.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\EstablishmentGroup;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method EstablishmentGroup|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method EstablishmentGroup|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method EstablishmentGroup[] findAll()
|
||||
* @method EstablishmentGroup[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class EstablishmentGroupRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, EstablishmentGroup::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function add(EstablishmentGroup $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->persist($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function remove(EstablishmentGroup $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->remove($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return EstablishmentGroup[] Returns an array of EstablishmentGroup objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('e')
|
||||
->andWhere('e.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('e.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?EstablishmentGroup
|
||||
{
|
||||
return $this->createQueryBuilder('e')
|
||||
->andWhere('e.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
15
src/Repository/EstablishmentGroupRepositoryQuery.php
Normal file
15
src/Repository/EstablishmentGroupRepositoryQuery.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\EstablishmentGroupRepository as Repository;
|
||||
|
||||
class EstablishmentGroupRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 'e', $paginator);
|
||||
}
|
||||
}
|
76
src/Repository/ProjectRepository.php
Normal file
76
src/Repository/ProjectRepository.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Project;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Project|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Project|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Project[] findAll()
|
||||
* @method Project[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class ProjectRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Project::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function add(Project $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->persist($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function remove(Project $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->remove($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Project[] Returns an array of Project objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('p')
|
||||
->andWhere('p.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('p.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?Project
|
||||
{
|
||||
return $this->createQueryBuilder('p')
|
||||
->andWhere('p.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
15
src/Repository/ProjectRepositoryQuery.php
Normal file
15
src/Repository/ProjectRepositoryQuery.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\ProjectRepository as Repository;
|
||||
|
||||
class ProjectRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 'p', $paginator);
|
||||
}
|
||||
}
|
76
src/Repository/ThemeTypeRepository.php
Normal file
76
src/Repository/ThemeTypeRepository.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\ThemeType;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method ThemeType|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method ThemeType|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method ThemeType[] findAll()
|
||||
* @method ThemeType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class ThemeTypeRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, ThemeType::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function add(ThemeType $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->persist($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ORMException
|
||||
* @throws OptimisticLockException
|
||||
*/
|
||||
public function remove(ThemeType $entity, bool $flush = true): void
|
||||
{
|
||||
$this->_em->remove($entity);
|
||||
if ($flush) {
|
||||
$this->_em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return ThemeType[] Returns an array of ThemeType objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?ThemeType
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
15
src/Repository/ThemeTypeRepositoryQuery.php
Normal file
15
src/Repository/ThemeTypeRepositoryQuery.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\ThemeTypeRepository as Repository;
|
||||
|
||||
class ThemeTypeRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 't', $paginator);
|
||||
}
|
||||
}
|
13
templates/admin/conference/_form.html.twig
Normal file
13
templates/admin/conference/_form.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
<div class="row">
|
||||
<div class="col-md-3 order-1 pr-md-3">
|
||||
{% for item in ['themeType', 'date', 'persons'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-md-9 order-2 pl-md-3">
|
||||
{% for item in ['label', 'content', 'comment', 'feedback'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
13
templates/admin/debriefing/_form.html.twig
Normal file
13
templates/admin/debriefing/_form.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
<div class="row">
|
||||
<div class="col-md-3 order-1 pr-md-3">
|
||||
{% for item in ['date', 'project', 'internalContributors', 'externalContributors'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-md-9 order-2 pl-md-3">
|
||||
{% for item in ['topic', 'content'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
13
templates/admin/establishment/_form.html.twig
Normal file
13
templates/admin/establishment/_form.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
<div class="row">
|
||||
<div class="col-md-3 order-2 pl-md-3">
|
||||
{% for item in ['establishmentGroups'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-md-9 order-1 pr-md-3">
|
||||
{% for item in ['name', 'address', 'zipCode', 'city'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in a new issue