@@ -103,7 +103,7 @@ |
||
103 | 103 | * @Method("GET") |
104 | 104 | * @Template() |
105 | 105 | * |
106 | - * @param \AppBundle\Entity\Orders $orders Order item to print |
|
106 | + * @param Orders $orders Order item to print |
|
107 | 107 | * @return \Symfony\Component\HttpFoundation\Response |
108 | 108 | */ |
109 | 109 | public function printAction(Orders $orders) |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @Method("GET") |
58 | 58 | * @Template() |
59 | 59 | * |
60 | - * @param \AppBundle\Entity\Article $article Article item to display |
|
60 | + * @param Article $article Article item to display |
|
61 | 61 | * @return array |
62 | 62 | */ |
63 | 63 | public function showAction(Article $article) |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @Method("GET") |
119 | 119 | * @Template() |
120 | 120 | * |
121 | - * @param \AppBundle\Entity\Article $article Article item to edit |
|
121 | + * @param Article $article Article item to edit |
|
122 | 122 | * @return array |
123 | 123 | */ |
124 | 124 | public function editAction(Article $article) |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @Method("PUT") |
136 | 136 | * @Template("AppBundle:Article:edit.html.twig") |
137 | 137 | * |
138 | - * @param \AppBundle\Entity\Article $article Article item to update |
|
138 | + * @param Article $article Article item to update |
|
139 | 139 | * @param \Symfony\Component\HttpFoundation\Request $request Form request |
140 | 140 | * @return array |
141 | 141 | */ |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | * @Template("AppBundle:Article:reassign.html.twig") |
191 | 191 | * |
192 | 192 | * @param \Symfony\Component\HttpFoundation\Request $request Form request |
193 | - * @param \AppBundle\Entity\Supplier $supplier Supplier to desactivate |
|
194 | - * @return array |
|
193 | + * @param Supplier $supplier Supplier to desactivate |
|
194 | + * @return \Symfony\Component\HttpFoundation\RedirectResponse |
|
195 | 195 | */ |
196 | 196 | public function changeAction(Request $request, Supplier $supplier) |
197 | 197 | { |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @Route("/admin/{id}/delete", name="article_delete", requirements={"id"="\d+"}) |
246 | 246 | * @Method("DELETE") |
247 | 247 | * |
248 | - * @param \AppBundle\Entity\Article $article Article item to delete |
|
248 | + * @param Article $article Article item to delete |
|
249 | 249 | * @param \Symfony\Component\HttpFoundation\Request $request Form request |
250 | 250 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
251 | 251 | */ |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $deleteForm = $this->createDeleteForm($inventory->getId(), 'inventory_delete'); |
82 | 82 | |
83 | 83 | return ['inventory' => $inventory, 'zoneStorages' => $zoneStorages, 'inventoryArticles' => $inventoryArticles, |
84 | - 'delete_form' => $deleteForm->createView(),]; |
|
84 | + 'delete_form' => $deleteForm->createView(), ]; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $this->getDoctrine()->getManager()->flush(); |
159 | 159 | |
160 | 160 | $return = $this->redirectToRoute('inventory_edit', ['id' => $inventory->getId(), |
161 | - 'zoneStorages' => $return['zoneStorages'],]); |
|
161 | + 'zoneStorages' => $return['zoneStorages'], ]); |
|
162 | 162 | } |
163 | 163 | return $return; |
164 | 164 | } |
@@ -176,13 +176,13 @@ discard block |
||
176 | 176 | public function validAction(Inventory $inventory) |
177 | 177 | { |
178 | 178 | $validForm = $this->createForm(InventoryValidType::class, $inventory, array( |
179 | - 'action' => $this->generateUrl('inventory_close', ['id' => $inventory->getId(),]), |
|
179 | + 'action' => $this->generateUrl('inventory_close', ['id' => $inventory->getId(), ]), |
|
180 | 180 | 'method' => 'PUT', |
181 | 181 | )); |
182 | 182 | $deleteForm = $this->createDeleteForm($inventory->getId(), 'inventory_delete'); |
183 | 183 | |
184 | 184 | return ['inventory' => $inventory, 'valid_form' => $validForm->createView(), |
185 | - 'delete_form' => $deleteForm->createView(),]; |
|
185 | + 'delete_form' => $deleteForm->createView(), ]; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $deleteForm = $this->createDeleteForm($inventory->getId(), 'inventory_delete'); |
209 | 209 | |
210 | 210 | $return = ['inventory' => $inventory, 'valid_form' => $validForm->createView(), |
211 | - 'delete_form' => $deleteForm->createView(),]; |
|
211 | + 'delete_form' => $deleteForm->createView(), ]; |
|
212 | 212 | |
213 | 213 | if ($validForm->handleRequest($request)->isValid()) { |
214 | 214 | $inventory->setStatus(3); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function printAction(Inventory $inventory) |
253 | 253 | { |
254 | - $file = $inventory->getDate()->format('Ymd') . '-inventory.pdf'; |
|
254 | + $file = $inventory->getDate()->format('Ymd').'-inventory.pdf'; |
|
255 | 255 | // Create and save the PDF file to print |
256 | 256 | $html = $this->renderView( |
257 | 257 | 'AppBundle:Stocks/Inventory:print.pdf.twig', |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | ->getArray((string) $inventory->getDate()->format('d/m/Y'), '- Inventaire -') |
265 | 265 | ), |
266 | 266 | 200, |
267 | - ['Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="' . $file . '"',] |
|
267 | + ['Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="'.$file.'"', ] |
|
268 | 268 | ); |
269 | 269 | } |
270 | 270 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | ->getArray((string) $inventory->getDate()->format('d/m/Y'), '- Inventaire -') |
291 | 291 | ), |
292 | 292 | 200, |
293 | - ['Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="prepare.pdf"',] |
|
293 | + ['Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="prepare.pdf"', ] |
|
294 | 294 | ); |
295 | 295 | } |
296 | 296 | |
@@ -310,12 +310,12 @@ discard block |
||
310 | 310 | if ($inventoryStyle == 'global') { |
311 | 311 | $html = $this->renderView( |
312 | 312 | 'AppBundle:Stocks/Inventory:list-global.pdf.twig', |
313 | - ['articles' => $articles, 'daydate' => $inventory->getDate(),] |
|
313 | + ['articles' => $articles, 'daydate' => $inventory->getDate(), ] |
|
314 | 314 | ); |
315 | 315 | } else { |
316 | 316 | $html = $this->renderView( |
317 | 317 | 'AppBundle:Stocks/Inventory:list-ordered.pdf.twig', |
318 | - ['articles' => $articles, 'zonestorage' => $zoneStorages, 'daydate' => $inventory->getDate(),] |
|
318 | + ['articles' => $articles, 'zonestorage' => $zoneStorages, 'daydate' => $inventory->getDate(), ] |
|
319 | 319 | ); |
320 | 320 | } |
321 | 321 | return $html; |
@@ -66,7 +66,7 @@ |
||
66 | 66 | |
67 | 67 | // Récupérer les articles du fournisseur. |
68 | 68 | $articles = $etm->getRepository('AppBundle:Settings\Article')->getArticleFromSupplier($supplier); |
69 | - return ['supplier' => $supplier, 'articles' => $articles, 'delete_form' => $deleteForm->createView(),]; |
|
69 | + return ['supplier' => $supplier, 'articles' => $articles, 'delete_form' => $deleteForm->createView(), ]; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return $this->createForm( |
41 | 41 | OrdersType::class, |
42 | 42 | $orders, |
43 | - ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'POST',] |
|
43 | + ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'POST', ] |
|
44 | 44 | ); |
45 | 45 | } |
46 | 46 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $this->addRolesAction($editForm, $entity); |
64 | 64 | } |
65 | 65 | |
66 | - return [$prefixRoute => $entity, 'edit_form' => $editForm->createView(),]; |
|
66 | + return [$prefixRoute => $entity, 'edit_form' => $editForm->createView(), ]; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -117,22 +117,22 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function abstractPrintAction(Orders $orders, $from) |
119 | 119 | { |
120 | - $file = $from . '-' . $orders->getId() . '.pdf'; |
|
120 | + $file = $from.'-'.$orders->getId().'.pdf'; |
|
121 | 121 | $company = $this->getDoctrine()->getManager()->getRepository('AppBundle:Company')->find(1); |
122 | 122 | // Create and save the PDF file to print |
123 | 123 | $html = $this->renderView( |
124 | - 'AppBundle:Orders/' . $from . ':print.pdf.twig', |
|
124 | + 'AppBundle:Orders/'.$from.':print.pdf.twig', |
|
125 | 125 | ['articles' => $orders->getArticles(), 'orders' => $orders, 'company' => $company, ] |
126 | 126 | ); |
127 | 127 | return new Response( |
128 | 128 | $this->get('knp_snappy.pdf')->getOutputFromHtml( |
129 | 129 | $html, |
130 | - $this->get('app.helper.controller')->getArray((string)date('d/m/y - H:i:s'), '') |
|
130 | + $this->get('app.helper.controller')->getArray((string) date('d/m/y - H:i:s'), '') |
|
131 | 131 | ), |
132 | 132 | 200, |
133 | 133 | array( |
134 | 134 | 'Content-Type' => 'application/pdf', |
135 | - 'Content-Disposition' => 'attachment; filename="' . $file . '"' |
|
135 | + 'Content-Disposition' => 'attachment; filename="'.$file.'"' |
|
136 | 136 | ) |
137 | 137 | ); |
138 | 138 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $etm = $this->getDoctrine()->getManager(); |
43 | 43 | $item = $this->container->getParameter('knp_paginator.page_range'); |
44 | 44 | $qbd = $etm->getRepository('AppBundle:Orders\Orders')->createQueryBuilder('o'); |
45 | - $qbd->where('o.delivdate <= ' . date('Y-m-d')); |
|
45 | + $qbd->where('o.delivdate <= '.date('Y-m-d')); |
|
46 | 46 | $qbd->andWhere('o.status = 1'); |
47 | 47 | |
48 | 48 | $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), $item); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $paginator = $this->get('knp_paginator')->paginate($entities, $request->query->get('page', 1), $item); |
49 | 49 | } |
50 | 50 | |
51 | - return ['entities' => $entities, 'ctEntity' => count($entities), 'paginator' => $paginator,]; |
|
51 | + return ['entities' => $entities, 'ctEntity' => count($entities), 'paginator' => $paginator, ]; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $deleteForm = $this->createDeleteForm($entity->getId(), $prefixRoute.'_delete'); |
64 | 64 | |
65 | - return [$prefixRoute => $entity, 'delete_form' => $deleteForm->createView(),]; |
|
65 | + return [$prefixRoute => $entity, 'delete_form' => $deleteForm->createView(), ]; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | $entityNew = $etm->getClassMetadata($entityPath)->newInstance(); |
88 | - $form = $this->createForm($typePath, $entityNew, ['action' => $this->generateUrl($prefixRoute.'_create'),]); |
|
88 | + $form = $this->createForm($typePath, $entityNew, ['action' => $this->generateUrl($prefixRoute.'_create'), ]); |
|
89 | 89 | |
90 | 90 | if ($entityName === 'Group') { |
91 | 91 | $this->addRolesAction($form, $entityNew); |
92 | 92 | } |
93 | - $return = [strtolower($entityName) => $entityNew, 'form' => $form->createView(),]; |
|
93 | + $return = [strtolower($entityName) => $entityNew, 'form' => $form->createView(), ]; |
|
94 | 94 | |
95 | 95 | return $return; |
96 | 96 | } |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | $param = []; |
111 | 111 | $etm = $this->getDoctrine()->getManager(); |
112 | 112 | $entityNew = $etm->getClassMetadata($entityPath)->newInstance(); |
113 | - $form = $this->createForm($typePath, $entityNew, ['action' => $this->generateUrl($prefixRoute.'_create'),]); |
|
113 | + $form = $this->createForm($typePath, $entityNew, ['action' => $this->generateUrl($prefixRoute.'_create'), ]); |
|
114 | 114 | if ($entityName === 'Staff\Group') { |
115 | 115 | $this->addRolesAction($form, $entityNew); |
116 | 116 | } |
117 | 117 | $form->handleRequest($request); |
118 | - $return = [$entityName => $entityNew, 'form' => $form->createView(),]; |
|
118 | + $return = [$entityName => $entityNew, 'form' => $form->createView(), ]; |
|
119 | 119 | |
120 | 120 | if ($form->isValid()) { |
121 | 121 | $etm = $this->getDoctrine()->getManager(); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $deleteForm = $this->createDeleteForm($entity->getId(), $prefixRoute.'_delete'); |
153 | 153 | |
154 | 154 | return [$prefixRoute => $entity, 'edit_form' => $editForm->createView(), |
155 | - 'delete_form' => $deleteForm->createView(),]; |
|
155 | + 'delete_form' => $deleteForm->createView(), ]; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $deleteForm = $this->createDeleteForm($entity->getId(), $prefixRoute.'_delete'); |
179 | 179 | |
180 | 180 | $return = [$prefixRoute => $entity, 'edit_form' => $editForm->createView(), |
181 | - 'delete_form' => $deleteForm->createView(),]; |
|
181 | + 'delete_form' => $deleteForm->createView(), ]; |
|
182 | 182 | |
183 | 183 | if ($editForm->isValid()) { |
184 | 184 | $this->getDoctrine()->getManager()->flush(); |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | public function abstractDeleteWithArticlesAction($entity, Request $request, $entityName, $prefixRoute) |
221 | 221 | { |
222 | 222 | $etm = $this->getDoctrine()->getManager(); |
223 | - $form = $this->createDeleteForm($entity->getId(), $prefixRoute . '_delete'); |
|
223 | + $form = $this->createDeleteForm($entity->getId(), $prefixRoute.'_delete'); |
|
224 | 224 | $entityArticles = $etm |
225 | - ->getRepository('AppBundle:' . $entityName . 'Articles') |
|
225 | + ->getRepository('AppBundle:'.$entityName.'Articles') |
|
226 | 226 | ->findBy([$prefixRoute => $entity->getId()]); |
227 | 227 | |
228 | 228 | if ($form->handleRequest($request)->isValid()) { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | } else { |
258 | 258 | $alias = current($qbd->getDQLPart('from'))->getAlias(); |
259 | 259 | } |
260 | - $qbd->orderBy($alias . '.' . $order['field'], $order['type']); |
|
260 | + $qbd->orderBy($alias.'.'.$order['field'], $order['type']); |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | protected function testReturnParam($entity, $prefixRoute) |
289 | 289 | { |
290 | - $entityArray = ['article', 'supplier', 'familylog', 'zonestorage', 'unitstorage', 'material',]; |
|
290 | + $entityArray = ['article', 'supplier', 'familylog', 'zonestorage', 'unitstorage', 'material', ]; |
|
291 | 291 | if (in_array($prefixRoute, $entityArray, true)) { |
292 | 292 | $param = ['slug' => $entity->getSlug()]; |
293 | 293 | } else { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | public function buildForm(FormBuilderInterface $builder, array $options) |
32 | 32 | { |
33 | 33 | $builder |
34 | - ->add('name', null, ['label' => 'form.group_name', 'translation_domain' => 'FOSUserBundle',]); |
|
34 | + ->add('name', null, ['label' => 'form.group_name', 'translation_domain' => 'FOSUserBundle', ]); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -33,15 +33,15 @@ discard block |
||
33 | 33 | { |
34 | 34 | $builder |
35 | 35 | ->add('username', 'filter_text', ['label' => 'form.username', 'translation_domain' => 'FOSUserBundle', |
36 | - 'attr' => ['class' => 'pull-right',],]) |
|
36 | + 'attr' => ['class' => 'pull-right', ], ]) |
|
37 | 37 | ->add('email', 'filter_text', ['label' => 'form.email', 'translation_domain' => 'FOSUserBundle', |
38 | - 'attr' => ['class' => 'pull-right',],]) |
|
39 | - ->add('enabled', 'filter_boolean', ['label' => 'Autorisé',]) |
|
38 | + 'attr' => ['class' => 'pull-right', ], ]) |
|
39 | + ->add('enabled', 'filter_boolean', ['label' => 'Autorisé', ]) |
|
40 | 40 | ->add( |
41 | 41 | 'groups', |
42 | 42 | 'filter_entity', |
43 | 43 | ['label' => 'Groupes', 'class' => 'AppBundle\Entity\Staff\Group', 'expanded' => true, |
44 | - 'multiple' => true, 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { |
|
44 | + 'multiple' => true, 'apply_filter' => function(QueryInterface $filterQuery, $field, $values) { |
|
45 | 45 | $query = $filterQuery->getQueryBuilder(); |
46 | 46 | $query->leftJoin($field, 'm'); |
47 | 47 | // Filter results using orWhere matching ID |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function configureOptions(OptionsResolver $resolver) |
60 | 60 | { |
61 | 61 | $resolver->setDefaults(['data_class' => 'AppBundle\Entity\Staff\User', 'csrf_protection' => false, |
62 | - 'validation_groups' => ['filter'], 'method' => 'GET',]); |
|
62 | + 'validation_groups' => ['filter'], 'method' => 'GET', ]); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |