mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
ajout compteurs
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Chill\TaskBundle\Controller;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
|
||||
use Chill\MainBundle\Serializer\Model\Collection;
|
||||
use Chill\MainBundle\Serializer\Model\Counter;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
||||
use Chill\MainBundle\Timeline\TimelineBuilder;
|
||||
@@ -442,7 +443,7 @@ final class SingleTaskController extends AbstractController
|
||||
* defaults={"_format": "json"}
|
||||
* )
|
||||
*/
|
||||
public function myTasksAction(string $_format)
|
||||
public function myTasksAction(string $_format, Request $request)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_USER');
|
||||
|
||||
@@ -455,6 +456,13 @@ final class SingleTaskController extends AbstractController
|
||||
$filterOrder->getQueryString(),
|
||||
$flags
|
||||
);
|
||||
|
||||
if ('json' === $_format && $request->query->getBoolean('countOnly')) {
|
||||
return $this->json(
|
||||
new Counter($nb),
|
||||
);
|
||||
}
|
||||
|
||||
$paginator = $this->paginatorFactory->create($nb);
|
||||
$tasks = $this->singleTaskAclAwareRepository->findByCurrentUsersTasks(
|
||||
$filterOrder->getQueryString(),
|
||||
|
Reference in New Issue
Block a user