@@ -9,22 +9,22 @@ |
||
9 | 9 | |
10 | 10 | class RenderPageController extends AbstractController |
11 | 11 | { |
12 | - /** |
|
13 | - * @Route("/page/{url}", name="page", requirements={"url" = "[a-zA-Z0-9\-\_\/]*"}) |
|
14 | - * @param string $url |
|
15 | - * @return Response |
|
16 | - */ |
|
17 | - public function renderPage(string $url): Response |
|
18 | - { |
|
19 | - $em = $this->getDoctrine()->getManager(); |
|
12 | + /** |
|
13 | + * @Route("/page/{url}", name="page", requirements={"url" = "[a-zA-Z0-9\-\_\/]*"}) |
|
14 | + * @param string $url |
|
15 | + * @return Response |
|
16 | + */ |
|
17 | + public function renderPage(string $url): Response |
|
18 | + { |
|
19 | + $em = $this->getDoctrine()->getManager(); |
|
20 | 20 | |
21 | - $page = $em->getRepository("RibsAdminBundle:Page")->findOneBy(["url" => $url]); |
|
22 | - $navigation = $em->getRepository("RibsAdminBundle:Navigation")->findAllNavigation(); |
|
21 | + $page = $em->getRepository("RibsAdminBundle:Page")->findOneBy(["url" => $url]); |
|
22 | + $navigation = $em->getRepository("RibsAdminBundle:Navigation")->findAllNavigation(); |
|
23 | 23 | |
24 | - if ($page) { |
|
25 | - return $this->render("@RibsAdmin/page.html.twig", ["page" => $page, "navigation" => $navigation]); |
|
26 | - } |
|
24 | + if ($page) { |
|
25 | + return $this->render("@RibsAdmin/page.html.twig", ["page" => $page, "navigation" => $navigation]); |
|
26 | + } |
|
27 | 27 | |
28 | - throw new NotFoundHttpException("The required page does not exist"); |
|
29 | - } |
|
28 | + throw new NotFoundHttpException("The required page does not exist"); |
|
29 | + } |
|
30 | 30 | } |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | |
14 | 14 | class Account extends AbstractType |
15 | 15 | { |
16 | - /** |
|
17 | - * @param FormBuilderInterface $builder |
|
18 | - * @param array $options |
|
19 | - */ |
|
16 | + /** |
|
17 | + * @param FormBuilderInterface $builder |
|
18 | + * @param array $options |
|
19 | + */ |
|
20 | 20 | public function buildForm(FormBuilderInterface $builder, array $options) |
21 | 21 | { |
22 | 22 | $builder |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | $builder->add('user', User::class); |
50 | 50 | } |
51 | 51 | |
52 | - /** |
|
53 | - * @param OptionsResolver $resolver |
|
54 | - */ |
|
52 | + /** |
|
53 | + * @param OptionsResolver $resolver |
|
54 | + */ |
|
55 | 55 | public function configureOptions(OptionsResolver $resolver) |
56 | 56 | { |
57 | 57 | $resolver->setDefaults([ |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | |
13 | 13 | class Module extends AbstractType |
14 | 14 | { |
15 | - /** |
|
16 | - * @param FormBuilderInterface $builder |
|
17 | - * @param array $options |
|
18 | - */ |
|
15 | + /** |
|
16 | + * @param FormBuilderInterface $builder |
|
17 | + * @param array $options |
|
18 | + */ |
|
19 | 19 | public function buildForm(FormBuilderInterface $builder, array $options) |
20 | 20 | { |
21 | 21 | $builder |
@@ -27,22 +27,22 @@ discard block |
||
27 | 27 | "label" => "Package name", |
28 | 28 | "required" => true |
29 | 29 | ]) |
30 | - ->add("titleTag", TextType::class, [ |
|
31 | - "label" => "Title tag", |
|
32 | - "required" => true |
|
33 | - ]) |
|
34 | - ->add("descriptionTag", TextareaType::class, [ |
|
35 | - "label" => "Description tag", |
|
36 | - "required" => true, |
|
37 | - ]) |
|
38 | - ->add("url", TextType::class, [ |
|
39 | - "label" => "Url", |
|
40 | - "required" => true |
|
41 | - ]) |
|
42 | - ->add("urlAdmin", TextType::class, [ |
|
43 | - "label" => "Admin url", |
|
44 | - "required" => true |
|
45 | - ]) |
|
30 | + ->add("titleTag", TextType::class, [ |
|
31 | + "label" => "Title tag", |
|
32 | + "required" => true |
|
33 | + ]) |
|
34 | + ->add("descriptionTag", TextareaType::class, [ |
|
35 | + "label" => "Description tag", |
|
36 | + "required" => true, |
|
37 | + ]) |
|
38 | + ->add("url", TextType::class, [ |
|
39 | + "label" => "Url", |
|
40 | + "required" => true |
|
41 | + ]) |
|
42 | + ->add("urlAdmin", TextType::class, [ |
|
43 | + "label" => "Admin url", |
|
44 | + "required" => true |
|
45 | + ]) |
|
46 | 46 | ->add("active", CheckboxType::class, [ |
47 | 47 | "label" => "Enable module", |
48 | 48 | "attr" => [ |
@@ -50,22 +50,22 @@ discard block |
||
50 | 50 | ], |
51 | 51 | "required" => false |
52 | 52 | ]) |
53 | - ->add("displayed", CheckboxType::class, [ |
|
54 | - "label" => "Display module in navigation", |
|
55 | - "attr" => [ |
|
56 | - "class" => "ribs-checkbox switched cxs-2 no-pl" |
|
57 | - ], |
|
58 | - "required" => false |
|
59 | - ]) |
|
60 | - ->add('submit', SubmitType::class, [ |
|
61 | - 'label' => 'Validate', |
|
62 | - 'attr' => [] |
|
63 | - ]); |
|
53 | + ->add("displayed", CheckboxType::class, [ |
|
54 | + "label" => "Display module in navigation", |
|
55 | + "attr" => [ |
|
56 | + "class" => "ribs-checkbox switched cxs-2 no-pl" |
|
57 | + ], |
|
58 | + "required" => false |
|
59 | + ]) |
|
60 | + ->add('submit', SubmitType::class, [ |
|
61 | + 'label' => 'Validate', |
|
62 | + 'attr' => [] |
|
63 | + ]); |
|
64 | 64 | } |
65 | 65 | |
66 | - /** |
|
67 | - * @param OptionsResolver $resolver |
|
68 | - */ |
|
66 | + /** |
|
67 | + * @param OptionsResolver $resolver |
|
68 | + */ |
|
69 | 69 | public function configureOptions(OptionsResolver $resolver) |
70 | 70 | { |
71 | 71 | $resolver->setDefaults([ |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | |
14 | 14 | class Registration extends AbstractType |
15 | 15 | { |
16 | - /** |
|
17 | - * @param FormBuilderInterface $builder |
|
18 | - * @param array $options |
|
19 | - */ |
|
16 | + /** |
|
17 | + * @param FormBuilderInterface $builder |
|
18 | + * @param array $options |
|
19 | + */ |
|
20 | 20 | public function buildForm(FormBuilderInterface $builder, array $options) |
21 | 21 | { |
22 | 22 | $builder |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | ]); |
30 | 30 | } |
31 | 31 | |
32 | - /** |
|
33 | - * @param OptionsResolver $resolver |
|
34 | - */ |
|
32 | + /** |
|
33 | + * @param OptionsResolver $resolver |
|
34 | + */ |
|
35 | 35 | public function configureOptions(OptionsResolver $resolver) |
36 | 36 | { |
37 | 37 | $resolver->setDefaults([ |
@@ -10,35 +10,35 @@ |
||
10 | 10 | |
11 | 11 | class AutocompleteType extends AbstractType |
12 | 12 | { |
13 | - /** |
|
14 | - * @param FormBuilderInterface $builder |
|
15 | - * @param array $options |
|
16 | - */ |
|
17 | - public function buildForm(FormBuilderInterface $builder, array $options) |
|
18 | - { |
|
19 | - $builder |
|
20 | - ->add($options["autocomplete_name"], TextType::class, [ |
|
21 | - "label" => false, |
|
22 | - "attr" => [ |
|
23 | - "class" => "input-autocomplete", |
|
24 | - "data-url" => $options["data_url"], |
|
25 | - "autocomplete" => "off" |
|
26 | - ], |
|
27 | - "mapped" => false |
|
28 | - ]) |
|
29 | - ->add($options["autocomplete_name"] . "_id", HiddenType::class, [ |
|
30 | - "mapped" => false |
|
31 | - ]); |
|
32 | - } |
|
13 | + /** |
|
14 | + * @param FormBuilderInterface $builder |
|
15 | + * @param array $options |
|
16 | + */ |
|
17 | + public function buildForm(FormBuilderInterface $builder, array $options) |
|
18 | + { |
|
19 | + $builder |
|
20 | + ->add($options["autocomplete_name"], TextType::class, [ |
|
21 | + "label" => false, |
|
22 | + "attr" => [ |
|
23 | + "class" => "input-autocomplete", |
|
24 | + "data-url" => $options["data_url"], |
|
25 | + "autocomplete" => "off" |
|
26 | + ], |
|
27 | + "mapped" => false |
|
28 | + ]) |
|
29 | + ->add($options["autocomplete_name"] . "_id", HiddenType::class, [ |
|
30 | + "mapped" => false |
|
31 | + ]); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * @param OptionsResolver $resolver |
|
36 | - */ |
|
37 | - public function configureOptions(OptionsResolver $resolver) |
|
38 | - { |
|
39 | - $resolver->setDefaults([ |
|
40 | - "autocomplete_name" => null, |
|
41 | - "data_url" => null, |
|
42 | - ]); |
|
43 | - } |
|
34 | + /** |
|
35 | + * @param OptionsResolver $resolver |
|
36 | + */ |
|
37 | + public function configureOptions(OptionsResolver $resolver) |
|
38 | + { |
|
39 | + $resolver->setDefaults([ |
|
40 | + "autocomplete_name" => null, |
|
41 | + "data_url" => null, |
|
42 | + ]); |
|
43 | + } |
|
44 | 44 | } |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | $this->tokenStorage = $tokenStorage; |
35 | 35 | } |
36 | 36 | |
37 | - /** |
|
38 | - * @param FormBuilderInterface $builder |
|
39 | - * @param array $options |
|
40 | - */ |
|
37 | + /** |
|
38 | + * @param FormBuilderInterface $builder |
|
39 | + * @param array $options |
|
40 | + */ |
|
41 | 41 | public function buildForm(FormBuilderInterface $builder, array $options) |
42 | 42 | { |
43 | 43 | $access_rights_lists = $this->em->getRepository(\PiouPiou\RibsAdminBundle\Entity\AccessRight::class)->findAll(); |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | ]); |
71 | 71 | } |
72 | 72 | |
73 | - /** |
|
74 | - * @param OptionsResolver $resolver |
|
75 | - */ |
|
73 | + /** |
|
74 | + * @param OptionsResolver $resolver |
|
75 | + */ |
|
76 | 76 | public function configureOptions(OptionsResolver $resolver) |
77 | 77 | { |
78 | 78 | $resolver->setDefaults([ |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | class AccessRight extends AbstractType |
12 | 12 | { |
13 | - /** |
|
14 | - * @param FormBuilderInterface $builder |
|
15 | - * @param array $options |
|
16 | - */ |
|
13 | + /** |
|
14 | + * @param FormBuilderInterface $builder |
|
15 | + * @param array $options |
|
16 | + */ |
|
17 | 17 | public function buildForm(FormBuilderInterface $builder, array $options) |
18 | 18 | { |
19 | 19 | $builder |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | ]); |
29 | 29 | } |
30 | 30 | |
31 | - /** |
|
32 | - * @param OptionsResolver $resolver |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @param OptionsResolver $resolver |
|
33 | + */ |
|
34 | 34 | public function configureOptions(OptionsResolver $resolver) |
35 | 35 | { |
36 | 36 | $resolver->setDefaults([ |
@@ -7,21 +7,21 @@ |
||
7 | 7 | |
8 | 8 | class AccountRepository extends EntityRepository |
9 | 9 | { |
10 | - /** |
|
11 | - * function that return a list of all users that are not archived and different of current account |
|
12 | - * @param User $current_account |
|
13 | - * @param bool $archived |
|
14 | - * @return array |
|
15 | - */ |
|
16 | - public function findAllUserArchived(User $current_account, bool $archived = false): array |
|
17 | - { |
|
18 | - $query = $this->getEntityManager()->createQuery("SELECT fu FROM RibsAdminBundle:Account fu |
|
10 | + /** |
|
11 | + * function that return a list of all users that are not archived and different of current account |
|
12 | + * @param User $current_account |
|
13 | + * @param bool $archived |
|
14 | + * @return array |
|
15 | + */ |
|
16 | + public function findAllUserArchived(User $current_account, bool $archived = false): array |
|
17 | + { |
|
18 | + $query = $this->getEntityManager()->createQuery("SELECT fu FROM RibsAdminBundle:Account fu |
|
19 | 19 | JOIN RibsAdminBundle:User u WITH fu.user = u |
20 | 20 | WHERE u.archived = :archived and u != :current_account |
21 | 21 | ") |
22 | - ->setParameter("archived", $archived) |
|
23 | - ->setParameter("current_account", $current_account); |
|
22 | + ->setParameter("archived", $archived) |
|
23 | + ->setParameter("current_account", $current_account); |
|
24 | 24 | |
25 | - return $query->getResult(); |
|
26 | - } |
|
25 | + return $query->getResult(); |
|
26 | + } |
|
27 | 27 | } |
@@ -8,33 +8,33 @@ |
||
8 | 8 | |
9 | 9 | class AccessRightRepository extends EntityRepository |
10 | 10 | { |
11 | - /** |
|
12 | - * function that delete all user which are in a list of rights |
|
13 | - * @param AccessRight $access_right |
|
14 | - * @throws DBALException |
|
15 | - */ |
|
16 | - public function deleteAllUsersList(AccessRight $access_right) |
|
17 | - { |
|
18 | - $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = NULL WHERE |
|
11 | + /** |
|
12 | + * function that delete all user which are in a list of rights |
|
13 | + * @param AccessRight $access_right |
|
14 | + * @throws DBALException |
|
15 | + */ |
|
16 | + public function deleteAllUsersList(AccessRight $access_right) |
|
17 | + { |
|
18 | + $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = NULL WHERE |
|
19 | 19 | id_access_right = :id_access_right |
20 | 20 | "); |
21 | - $query->bindValue("id_access_right", $access_right->getId()); |
|
22 | - $query->execute(); |
|
23 | - } |
|
21 | + $query->bindValue("id_access_right", $access_right->getId()); |
|
22 | + $query->execute(); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * function that add a user in an access right list |
|
27 | - * @param int $access_right_id |
|
28 | - * @param string $guid_admin |
|
29 | - * @throws DBALException |
|
30 | - */ |
|
31 | - public function setAccessRightListUser(int $access_right_id, string $guid_admin) |
|
32 | - { |
|
33 | - $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = :id_access_right WHERE |
|
25 | + /** |
|
26 | + * function that add a user in an access right list |
|
27 | + * @param int $access_right_id |
|
28 | + * @param string $guid_admin |
|
29 | + * @throws DBALException |
|
30 | + */ |
|
31 | + public function setAccessRightListUser(int $access_right_id, string $guid_admin) |
|
32 | + { |
|
33 | + $query = $this->getEntityManager()->getConnection()->prepare("UPDATE user SET id_access_right = :id_access_right WHERE |
|
34 | 34 | guid = :guid_user |
35 | 35 | "); |
36 | - $query->bindValue("id_access_right", $access_right_id, \PDO::PARAM_INT); |
|
37 | - $query->bindValue("guid_user", $guid_admin, \PDO::PARAM_STR); |
|
38 | - $query->execute(); |
|
39 | - } |
|
36 | + $query->bindValue("id_access_right", $access_right_id, \PDO::PARAM_INT); |
|
37 | + $query->bindValue("guid_user", $guid_admin, \PDO::PARAM_STR); |
|
38 | + $query->execute(); |
|
39 | + } |
|
40 | 40 | } |