mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
admin: order user job by id
This commit is contained in:
parent
8d62ce46c6
commit
2263e7be73
26
src/Bundle/ChillMainBundle/Controller/UserJobController.php
Normal file
26
src/Bundle/ChillMainBundle/Controller/UserJobController.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
class UserJobController extends CRUDController
|
||||||
|
{
|
||||||
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
|
{
|
||||||
|
$query->addOrderBy('e.id', 'ASC');
|
||||||
|
|
||||||
|
return parent::orderQuery($action, $query, $request, $paginator);
|
||||||
|
}
|
||||||
|
}
|
@ -16,6 +16,7 @@ use Chill\MainBundle\Controller\CivilityApiController;
|
|||||||
use Chill\MainBundle\Controller\LocationController;
|
use Chill\MainBundle\Controller\LocationController;
|
||||||
use Chill\MainBundle\Controller\LocationTypeController;
|
use Chill\MainBundle\Controller\LocationTypeController;
|
||||||
use Chill\MainBundle\Controller\UserController;
|
use Chill\MainBundle\Controller\UserController;
|
||||||
|
use Chill\MainBundle\Controller\UserJobController;
|
||||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
||||||
use Chill\MainBundle\Doctrine\DQL\GetJsonFieldByKey;
|
use Chill\MainBundle\Doctrine\DQL\GetJsonFieldByKey;
|
||||||
use Chill\MainBundle\Doctrine\DQL\JsonAggregate;
|
use Chill\MainBundle\Doctrine\DQL\JsonAggregate;
|
||||||
@ -299,6 +300,7 @@ class ChillMainExtension extends Extension implements
|
|||||||
'cruds' => [
|
'cruds' => [
|
||||||
[
|
[
|
||||||
'class' => UserJob::class,
|
'class' => UserJob::class,
|
||||||
|
'controller' => UserJobController::class,
|
||||||
'name' => 'admin_user_job',
|
'name' => 'admin_user_job',
|
||||||
'base_path' => '/admin/main/user-job',
|
'base_path' => '/admin/main/user-job',
|
||||||
'base_role' => 'ROLE_ADMIN',
|
'base_role' => 'ROLE_ADMIN',
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<th> </th>
|
<th> </th>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block table_entities_tbody %}
|
{% block table_entities_tbody %}
|
||||||
{% for entity in entities|sort((a, b) => a.label|localize_translatable_string <=> b.label|localize_translatable_string) %}
|
{% for entity in entities %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ entity.id }}</td>
|
<td>{{ entity.id }}</td>
|
||||||
<td>{{ entity.label|localize_translatable_string }}</td>
|
<td>{{ entity.label|localize_translatable_string }}</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user