feat: sort documents by status 'new' on initial render
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@
|
||||
"ext-ctype": "*",
|
||||
"ext-iconv": "*",
|
||||
"ext-simplexml": "*",
|
||||
"beberlei/doctrineextensions": "^1.3",
|
||||
"beberlei/doctrineextensions": "^1.5",
|
||||
"doctrine/doctrine-bundle": "^2.10",
|
||||
"doctrine/doctrine-migrations-bundle": "^3.2",
|
||||
"doctrine/orm": "^2.15",
|
||||
|
||||
Generated
+1
-1
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "18ff369a6df51ed294b3946625466f92",
|
||||
"content-hash": "1e48d4a4ffe643c14cf370b7083adddb",
|
||||
"packages": [
|
||||
{
|
||||
"name": "beberlei/doctrineextensions",
|
||||
|
||||
@@ -22,6 +22,7 @@ doctrine:
|
||||
dql:
|
||||
string_functions:
|
||||
DATE_FORMAT: DoctrineExtensions\Query\Mysql\DateFormat
|
||||
FIELD: DoctrineExtensions\Query\Mysql\Field
|
||||
datetime_functions:
|
||||
DATEDIFF: DoctrineExtensions\Query\Mysql\DateDiff
|
||||
when@test:
|
||||
|
||||
@@ -30,11 +30,7 @@ class IndexController extends AbstractController
|
||||
$pagination = $this->paginator->paginate(
|
||||
$query,
|
||||
$request->query->getInt('page', 1),
|
||||
10,
|
||||
[
|
||||
'defaultSortFieldName' => 'upload.createdAt',
|
||||
'defaultSortDirection' => 'asc',
|
||||
]
|
||||
10
|
||||
);
|
||||
|
||||
return $this->render('administrative/document/index.html.twig', [
|
||||
|
||||
@@ -89,6 +89,9 @@ class UploadRepository extends ServiceEntityRepository
|
||||
->innerJoin('assignment.jobProfile', 'job_profile')
|
||||
->innerJoin('assignment.destination', 'destination')
|
||||
->innerJoin('disposition.teamer', 'teamer')
|
||||
->addOrderBy('FIELD(upload.status, :new, :checked)', 'ASC')
|
||||
->setParameter('new', Upload::STATUS_NEW)
|
||||
->setParameter('checked', Upload::STATUS_CHECKED)
|
||||
->getQuery()
|
||||
;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
{{ knp_pagination_sortable(pagination, 'Teamer:in', 'teamer.lastName') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Status', 'disposition.status') }}
|
||||
{{ knp_pagination_sortable(pagination, 'Status', 'upload.status') }}
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user