some finalisation for admin user

This commit is contained in:
2021-09-23 14:09:51 +02:00
parent 72b1916da8
commit 430177f0c7
8 changed files with 19 additions and 71 deletions

View File

@@ -4,6 +4,7 @@ namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\AbstractCRUDController;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Form\FormInterface;
@@ -84,26 +85,13 @@ class UserController extends CRUDController
parent::onPrePersist($action, $entity, $form, $request);
}
/**
* Finds and displays a User entity.
*
*/
public function showAction($id)
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$em = $this->getDoctrine()->getManager();
$query->addOrderBy('e.usernameCanonical', 'ASC');
$user = $em->getRepository('ChillMainBundle:User')->find($id);
if (!$user) {
throw $this->createNotFoundException('Unable to find User entity.');
}
return $this->render('@ChillMain/User/show.html.twig', array(
'entity' => $user,
));
return parent::orderQuery($action, $query, $request, $paginator);
}
protected function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = [])
{
// add mini-forms for edit action