@@ -22,7 +22,7 @@ |
||
22 | 22 | if ($item->getUri() === $request->getRequestUri()) { |
23 | 23 | // URL's completely match |
24 | 24 | return true; |
25 | - } elseif ($item->getUri() !== $request->getBaseUrl() . '/' && |
|
25 | + } elseif ($item->getUri() !== $request->getBaseUrl().'/' && |
|
26 | 26 | substr($request->getRequestUri(), 0, strlen($item->getUri())) |
27 | 27 | === $item->getUri()) { |
28 | 28 | // URL isn't just "/" and the first part of the URL match |
@@ -30,19 +30,19 @@ discard block |
||
30 | 30 | private function getEaster($pYear = null) |
31 | 31 | { |
32 | 32 | if (is_null($pYear)) { |
33 | - $pYear = (int)date('Y'); |
|
33 | + $pYear = (int) date('Y'); |
|
34 | 34 | } |
35 | 35 | $nDate = $pYear - 1900; |
36 | - $pAa = $nDate%19; |
|
37 | - $pBb = floor(((7*$pAa)+1)/19); |
|
38 | - $pCc = ((11*$pAa)-$pBb+4)%29; |
|
39 | - $pDd = floor($nDate/4); |
|
40 | - $pEe = ($nDate-$pCc+$pDd+31)%7; |
|
41 | - $pResult = 25-$pCc-$pEe; |
|
36 | + $pAa = $nDate % 19; |
|
37 | + $pBb = floor(((7 * $pAa) + 1) / 19); |
|
38 | + $pCc = ((11 * $pAa) - $pBb + 4) % 29; |
|
39 | + $pDd = floor($nDate / 4); |
|
40 | + $pEe = ($nDate - $pCc + $pDd + 31) % 7; |
|
41 | + $pResult = 25 - $pCc - $pEe; |
|
42 | 42 | if ($pResult > 0) { |
43 | 43 | $pEaster = strtotime($pYear.'/04/'.$pResult); |
44 | 44 | } else { |
45 | - $pEaster = strtotime($pYear.'/03/'.(31+$pResult)); |
|
45 | + $pEaster = strtotime($pYear.'/03/'.(31 + $pResult)); |
|
46 | 46 | } |
47 | 47 | return $pEaster; |
48 | 48 | } |
@@ -61,20 +61,20 @@ discard block |
||
61 | 61 | { |
62 | 62 | $aBankHolidays = ['1_1', '1_5', '8_5', '14_7', '15_8', '1_11', '11_11', '25_12', ]; |
63 | 63 | if (function_exists('easter_date')) { |
64 | - $pEaster = easter_date((int)date('Y', $pDate)); |
|
64 | + $pEaster = easter_date((int) date('Y', $pDate)); |
|
65 | 65 | } else { |
66 | - $pEaster = $this->getEaster((int)date('Y', $pDate)); |
|
66 | + $pEaster = $this->getEaster((int) date('Y', $pDate)); |
|
67 | 67 | } |
68 | 68 | $aBankHolidays[] = date('j_n', $pEaster); |
69 | - $aBankHolidays[] = date('j_n', $pEaster + (86400*39)); |
|
70 | - $aBankHolidays[] = date('j_n', $pEaster + (86400*49)); |
|
69 | + $aBankHolidays[] = date('j_n', $pEaster + (86400 * 39)); |
|
70 | + $aBankHolidays[] = date('j_n', $pEaster + (86400 * 49)); |
|
71 | 71 | |
72 | - $pEnd = strtotime('+' . $pDays . ' day', $pDate); |
|
72 | + $pEnd = strtotime('+'.$pDays.' day', $pDate); |
|
73 | 73 | $idn = 0; |
74 | 74 | while ($idn < $pEnd) { |
75 | 75 | if (in_array(date('w', $pEnd), array(0, 6)) || in_array(date('j_n', $pEnd), $aBankHolidays)) { |
76 | 76 | $pEnd = strtotime('+1 day', $pEnd); |
77 | - $pDays ++; |
|
77 | + $pDays++; |
|
78 | 78 | } |
79 | 79 | $idn = strtotime('+1 day', $idn); |
80 | 80 | } |
@@ -114,6 +114,6 @@ |
||
114 | 114 | { |
115 | 115 | $session = new Session(); |
116 | 116 | |
117 | - return $session->has('sort.' . $name) ? $session->get('sort.' . $name) : null; |
|
117 | + return $session->has('sort.'.$name) ? $session->get('sort.'.$name) : null; |
|
118 | 118 | } |
119 | 119 | } |
@@ -46,11 +46,11 @@ |
||
46 | 46 | if ($ctEntity > 0 && $request->getMethod() == 'GET' && is_int($number)) { |
47 | 47 | $message = 'gestock.install.st'.$number.'.yet_exist'; |
48 | 48 | } |
49 | - $form = $this->createForm($typePath, $entityNew, ['action' => $this->generateUrl('gs_install_st'.$number),]); |
|
49 | + $form = $this->createForm($typePath, $entityNew, ['action' => $this->generateUrl('gs_install_st'.$number), ]); |
|
50 | 50 | if (is_int($number)) { |
51 | - $return = ['message' => $message, 'form' => $form->createView(),]; |
|
51 | + $return = ['message' => $message, 'form' => $form->createView(), ]; |
|
52 | 52 | } else { |
53 | - $return = [strtolower($entity) => $entityNew, 'form' => $form->createView(),]; |
|
53 | + $return = [strtolower($entity) => $entityNew, 'form' => $form->createView(), ]; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($form->handleRequest($request)->isValid()) { |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | $form->add( |
44 | 44 | 'save', |
45 | 45 | SubmitType::class, |
46 | - ['attr' => ['class' => 'btn btn-default btn-primary btn-create',], 'label' => 'Create', |
|
47 | - 'translation_domain' => 'admin',] |
|
46 | + ['attr' => ['class' => 'btn btn-default btn-primary btn-create', ], 'label' => 'Create', |
|
47 | + 'translation_domain' => 'admin', ] |
|
48 | 48 | ) |
49 | 49 | ->add( |
50 | 50 | 'addmore', |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | $form->add( |
57 | 57 | 'save', |
58 | 58 | SubmitType::class, |
59 | - ['attr' => ['class' => 'btn btn-default btn-primary btn-edit',], 'label' => 'Edit', |
|
60 | - 'translation_domain' => 'admin',] |
|
59 | + ['attr' => ['class' => 'btn btn-default btn-primary btn-edit', ], 'label' => 'Edit', |
|
60 | + 'translation_domain' => 'admin', ] |
|
61 | 61 | ); |
62 | 62 | } |
63 | 63 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | $form = $this->createForm(GroupType::class, $group); |
101 | 101 | AbstractController::addRolesAction($form, $group); |
102 | 102 | $form->handleRequest($request); |
103 | - $return = ['group' => $group, 'form' => $form->createView(),]; |
|
103 | + $return = ['group' => $group, 'form' => $form->createView(), ]; |
|
104 | 104 | |
105 | 105 | if ($form->isValid()) { |
106 | 106 | $etm = $this->getDoctrine()->getManager(); |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | public function createAction(Request $request) |
100 | 100 | { |
101 | 101 | $user = new User(); |
102 | - $form = $this->createForm(UserType::class, $user, ['action' => $this->generateUrl('user_create'),]); |
|
102 | + $form = $this->createForm(UserType::class, $user, ['action' => $this->generateUrl('user_create'), ]); |
|
103 | 103 | $form->handleRequest($request); |
104 | - $return = ['user' => $user, 'form' => $form->createView(),]; |
|
104 | + $return = ['user' => $user, 'form' => $form->createView(), ]; |
|
105 | 105 | |
106 | 106 | if ($form->isValid()) { |
107 | 107 | $return = $this->validUser($user, 'create'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $editForm->handleRequest($request); |
162 | 162 | $return = ['user' => $user, |
163 | 163 | 'edit_form' => $editForm->createView(), |
164 | - 'delete_form' => $deleteForm->createView(),]; |
|
164 | + 'delete_form' => $deleteForm->createView(), ]; |
|
165 | 165 | |
166 | 166 | if ($editForm->isValid()) { |
167 | 167 | $return = $this->validUser($user, 'edit'); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | $userManager = $this->get('fos_user.user_manager'); |
242 | 242 | $userManager->updateUser($user); |
243 | - $this->addFlash('info', 'gestock.' . $action . '.ok'); |
|
243 | + $this->addFlash('info', 'gestock.'.$action.'.ok'); |
|
244 | 244 | |
245 | 245 | if ($action === 'create') { |
246 | 246 | $return = $this->redirectToRoute('user_show', ['id' => $user->getId()]); |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | $typeClass, |
51 | 51 | $inventory, |
52 | 52 | ['action' => $this->generateUrl('inventory_update', ['id' => $inventory->getId()]), |
53 | - 'method' => 'PUT',] |
|
53 | + 'method' => 'PUT', ] |
|
54 | 54 | ); |
55 | 55 | $deleteForm = $this->createDeleteForm($inventory->getId(), 'inventory_delete'); |
56 | 56 | |
57 | 57 | $return = ['editForm' => $editForm, 'inventory' => $inventory, 'zoneStorages' => $zoneStorages, |
58 | 58 | 'edit_form' => $editForm->createView(), |
59 | - 'delete_form' => $deleteForm->createView(),]; |
|
59 | + 'delete_form' => $deleteForm->createView(), ]; |
|
60 | 60 | return $return; |
61 | 61 | } |
62 | 62 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | return $this->createForm( |
73 | 73 | InventoryType::class, |
74 | 74 | $inventory, |
75 | - ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'PUT',] |
|
75 | + ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'PUT', ] |
|
76 | 76 | ); |
77 | 77 | } |
78 | 78 |
@@ -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; |