Fix somes issues
This commit is contained in:
@@ -98,9 +98,12 @@ class AdminController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route('/user/view/{id}', name: 'user_view')]
|
||||
public function userView(PaginatorInterface $paginator, User $User): Response
|
||||
public function userView(PaginatorInterface $paginator, User $User, Request $request): Response
|
||||
{
|
||||
$pagination = $paginator->paginate($User->getDocuments());
|
||||
$pagination = $paginator->paginate(
|
||||
$User->getDocuments(),
|
||||
$request->query->getInt('page', 1)
|
||||
);
|
||||
return $this->render('admin/user_view.html.twig', [
|
||||
'controller_name' => 'AdminController',
|
||||
'user' => $User,
|
||||
|
||||
@@ -54,7 +54,8 @@ class DirectoryController extends AbstractController
|
||||
}
|
||||
|
||||
$pagination = $paginator->paginate(
|
||||
$req->getResult()
|
||||
$req->getResult(),
|
||||
$request->query->getInt('page', 1)
|
||||
);
|
||||
|
||||
return $this->render('directory/list.html.twig', [
|
||||
|
||||
@@ -50,7 +50,8 @@ class FolderController extends AbstractController
|
||||
}
|
||||
|
||||
$pagination = $paginator->paginate(
|
||||
$req->getResult()
|
||||
$req->getResult(),
|
||||
$request->query->getInt('page', 1)
|
||||
);
|
||||
|
||||
|
||||
@@ -141,7 +142,8 @@ class FolderController extends AbstractController
|
||||
}
|
||||
|
||||
$pagination = $paginator->paginate(
|
||||
$req->getResult()
|
||||
$req->getResult(),
|
||||
$request->query->getInt('page', 1)
|
||||
);
|
||||
|
||||
return $this->render('folder/document.html.twig', [
|
||||
|
||||
@@ -55,7 +55,10 @@ class MeController extends AbstractController
|
||||
return $this->render('me/index.html.twig', [
|
||||
'controller_name' => 'MeController',
|
||||
'form' => $form->createView(),
|
||||
'pagination' => $paginator->paginate($user->getDocuments())
|
||||
'pagination' => $paginator->paginate(
|
||||
$user->getDocuments(),
|
||||
$request->query->getInt('page', 1)
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,13 +52,22 @@ class UserController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route('/view/{id}/sanctions', name: 'view_sanctions')]
|
||||
public function viewSanctions(PaginatorInterface $paginator, User $User): Response
|
||||
public function viewSanctions(PaginatorInterface $paginator, User $User, Request $request): Response
|
||||
{
|
||||
$group = $this->getUser()->getMainGroup();
|
||||
/**
|
||||
* @var User $user
|
||||
*/
|
||||
$user = $this->getUser();
|
||||
|
||||
$group = $user->getMainGroup();
|
||||
|
||||
if (!$this->IsGranted('sanction', $group)) {
|
||||
throw new AccessDeniedHttpException("granted_not_allowed_to_view_sanctions");
|
||||
}
|
||||
$pagination = $paginator->paginate($User->getSanctions());
|
||||
$pagination = $paginator->paginate(
|
||||
$User->getSanctions(),
|
||||
$request->query->getInt('page', 1)
|
||||
);
|
||||
return $this->render('user/sanctions.html.twig', [
|
||||
'controller_name' => 'UserController',
|
||||
'user' => $User,
|
||||
@@ -67,9 +76,12 @@ class UserController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route('/view/{id}/documents', name: 'view_documents')]
|
||||
public function viewDocuments(PaginatorInterface $paginator, User $User): Response
|
||||
public function viewDocuments(PaginatorInterface $paginator, User $User, Request $request): Response
|
||||
{
|
||||
$pagination = $paginator->paginate($User->getDocuments());
|
||||
$pagination = $paginator->paginate(
|
||||
$User->getDocuments(),
|
||||
$request->query->getInt('page', 1)
|
||||
);
|
||||
return $this->render('user/documents.html.twig', [
|
||||
'controller_name' => 'UserController',
|
||||
'user' => $User,
|
||||
|
||||
Reference in New Issue
Block a user