order by sur select niveau01 (ref #211)

This commit is contained in:
afornerot 2020-10-06 09:50:56 +02:00
parent 1ab804ee9b
commit 397f0242f6
2 changed files with 6 additions and 3 deletions

View File

@ -78,6 +78,9 @@ class RegistrationType extends AbstractType
"label" => $session->get('labelniveau01'),
'placeholder' => '== Choisir '.$session->get('labelniveau01').' ==',
"choice_label" => "label",
"query_builder"=> function (EntityRepository $er) {
return $er->createQueryBuilder('niveau01')->orderBy('niveau01.label','ASC');
},
"disabled" => ($options["mode"]=="delete"?true:false),
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px","readonly" => ($options["mode"]=="delete"?true:false))));

View File

@ -89,16 +89,16 @@ class UserType extends AbstractType
"query_builder"=> function (EntityRepository $er) use($access,$perm,$userid) {
if($access=="config") {
if($perm)
return $er->createQueryBuilder('niveau01');
return $er->createQueryBuilder('niveau01')->orderBy('niveau01.label','ASC');
else {
$result=$er->createQueryBuilder("table")->innerJoin("CadolesCoreBundle:UserModo", "usermodo", Join::WITH, "table.id = usermodo.niveau01");
$result=$er->createQueryBuilder("table")->innerJoin("CadolesCoreBundle:UserModo", "usermodo", Join::WITH, "table.id = usermodo.niveau01")->orderBy('table.label','ASC');
$result->andWhere("usermodo.user = :userid");
$result->setParameter('userid', $userid);
return $result;
}
}
else {
return $er->createQueryBuilder('niveau01');
return $er->createQueryBuilder('niveau01')->orderBy('niveau01.label','ASC');
}
},
"disabled" => ($options["mode"]=="delete"||$options["masteridentity"]!="SQL"?true:false),