mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
layout task list
This commit is contained in:
@@ -6,6 +6,7 @@ use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverInterface;
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
@@ -51,9 +52,13 @@ final class SingleTaskController extends AbstractController
|
||||
private LoggerInterface $logger;
|
||||
private CenterResolverDispatcher $centerResolverDispatcher;
|
||||
private TranslatorInterface $translator;
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository;
|
||||
|
||||
public function __construct(
|
||||
CenterResolverDispatcher $centerResolverDispatcher,
|
||||
PaginatorFactory $paginatorFactory,
|
||||
SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository,
|
||||
TranslatorInterface $translator,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
TimelineBuilder $timelineBuilder,
|
||||
@@ -64,6 +69,8 @@ final class SingleTaskController extends AbstractController
|
||||
$this->logger = $logger;
|
||||
$this->translator = $translator;
|
||||
$this->centerResolverDispatcher = $centerResolverDispatcher;
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
$this->singleTaskAclAwareRepository = $singleTaskAclAwareRepository;
|
||||
}
|
||||
|
||||
private function getEntityContext(Request $request)
|
||||
@@ -517,10 +524,18 @@ final class SingleTaskController extends AbstractController
|
||||
*/
|
||||
public function myTasksAction()
|
||||
{
|
||||
return $this->redirectToRoute('chill_task_singletask_list', [
|
||||
'user_id' => $this->getUser()->getId(),
|
||||
'hide_form' => true,
|
||||
'title' => $this->translator->trans('My tasks')
|
||||
$this->denyAccessUnlessGranted('ROLE_USER');
|
||||
|
||||
$nb = $this->singleTaskAclAwareRepository->countByCurrentUsersTasks();
|
||||
$paginator = $this->paginatorFactory->create($nb);
|
||||
$tasks = $this->singleTaskAclAwareRepository->findByCurrentUsersTasks(
|
||||
null, [], $paginator->getCurrentPageFirstItemNumber(),
|
||||
$paginator->getItemsPerPage()
|
||||
);
|
||||
|
||||
return $this->render('@ChillTask/SingleTask/List/index.html.twig', [
|
||||
'tasks' => $tasks,
|
||||
'paginator' => $paginator,
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user