@@ -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); |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | |
| 116 | 116 | $orders = new Orders(); |
| 117 | 117 | $form = $this->createForm(OrdersType::class, $orders); |
| 118 | - $return = ['orders' => $orders, 'form' => $form->createView(),]; |
|
| 118 | + $return = ['orders' => $orders, 'form' => $form->createView(), ]; |
|
| 119 | 119 | $form->handleRequest($request); |
| 120 | 120 | $supplier = $orders->getSupplier(); |
| 121 | 121 | $articles = $etm->getRepository('AppBundle:Article')->getArticleFromSupplier($supplier->getId()); |
@@ -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 | /** |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 37 | 37 | { |
| 38 | - $builder ->add('username', null, ['label' => "Nom d'utilisateur", 'attr' => ['class' => 'form-control'],]) |
|
| 38 | + $builder ->add('username', null, ['label' => "Nom d'utilisateur", 'attr' => ['class' => 'form-control'], ]) |
|
| 39 | 39 | ->add('email', EmailType::class, array( |
| 40 | 40 | 'required' => false, |
| 41 | 41 | 'label' => 'E-mail', |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function configureOptions(OptionsResolver $resolver) |
| 43 | 43 | { |
| 44 | - $resolver->setDefaults(['data_class' => 'AppBundle\Entity\Stocks\InventoryArticles',]); |
|
| 44 | + $resolver->setDefaults(['data_class' => 'AppBundle\Entity\Stocks\InventoryArticles', ]); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $builder |
| 37 | 37 | ->add('date', DateType::class, ['label' => 'gestock.date', 'widget' => 'single_text', |
| 38 | 38 | 'format' => 'dd MMM yyyy', 'html5' => false, 'input' => 'datetime', |
| 39 | - 'attr' => ['class' => 'form-control',],]) |
|
| 39 | + 'attr' => ['class' => 'form-control', ], ]) |
|
| 40 | 40 | ->add('status', HiddenType::class) |
| 41 | 41 | ->add('amount', HiddenType::class) |
| 42 | 42 | ; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function configureOptions(OptionsResolver $resolver) |
| 49 | 49 | { |
| 50 | - $resolver->setDefaults(['data_class' => 'AppBundle\Entity\Stocks\Inventory',]); |
|
| 50 | + $resolver->setDefaults(['data_class' => 'AppBundle\Entity\Stocks\Inventory', ]); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |