Skip to content
Snippets Groups Projects
Commit 86ee4b25 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Correction page des formateurs

parent 54a8806e
Branches
Tags
No related merge requests found
......@@ -126,12 +126,12 @@ class FormateurService
public function getFormateursWithFiltre(array $params): array
{
$type = $params['type']??null;
$formateurId = isset($params['formateur'])?$params['formateur']['id']:null;
// $formateurId = isset($params['formateur'])?$params['formateur']['id']:null;
$rattachement = isset($params['rattachement'])?$params['rattachement']['label']:null;
$qb = $this->createQueryBuilder();
if ($type) $qb = $qb->andWhere('formateur.type = :type')->setParameter('type', $type);
if ($formateurId) $qb = $qb->andWhere('formateur.id = :formateurId')->setParameter('formateurId', $formateurId);
// if ($formateurId) $qb = $qb->andWhere('formateur.id = :formateurId')->setParameter('formateurId', $formateurId);
if ($rattachement) $qb = $qb->andWhere('formateur.attachement = :rattachement')->setParameter('rattachement', $rattachement);
$result = $qb->getQuery()->getResult();
......@@ -144,7 +144,7 @@ class FormateurService
public function getFormateursByTerm(?string $term): array
{
$qb = $this->getObjectManager()->getRepository(Formateur::class)->createQueryBuilder('formateur')
->andWhere("LOWER(CONCAT(formateur.nom, ' ', formateur.prenom)) like :search OR LOWER(CONCAT(formateur.prenom, ' ', formateur.nom)) like :search OR LOWER(formateur.organisme) like :search")
->andWhere("LOWER(CONCAT(formateur.nom, ' ', formateur.prenom)) like :search OR LOWER(CONCAT(formateur.prenom, ' ', formateur.nom)) like :search OR LOWER(formateur.organisme) like :search OR lower(formateur.email) like :search")
->setParameter('search', '%'.strtolower($term).'%')
// ->orderBy("coalesce(formateur.organisme, concat(formateur.nom, ' ', formateur.prenom))", 'ASC')
->orderBy("concat(formateur.nom, ' ', formateur.prenom)", 'ASC')
......
......@@ -36,7 +36,7 @@ $canCreerCompte = $this->isAllowed(UtilisateurPrivileges::getResourceId(Utilisat
</a>
<?php endif; ?>
<table class="table table-condensed datatable" id="formateur">
<table class="table table-condensed datatable" id="formateurs">
<thead>
<tr>
<th class="col-md-3"> Identification </th>
......@@ -172,5 +172,16 @@ $canCreerCompte = $this->isAllowed(UtilisateurPrivileges::getResourceId(Utilisat
event.div.modal('hide');
window.location.reload();
});
$('table#formateurs').dataTable({
paging: true,
autoWidth: false,
columnDefs: [{
"targets": 4,
"orderable": false
}],
"language": {
"url": "/js/datatables_fr.json",
},
});
});
</script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment