@@ -341,7 +341,7 @@ |
||
341 | 341 | */ |
342 | 342 | private function initPermissions() |
343 | 343 | { |
344 | - $this->rights = array(); // Permission array used by this module |
|
344 | + $this->rights = array(); // Permission array used by this module |
|
345 | 345 | $r = 0; |
346 | 346 | |
347 | 347 | $this->rights[$r][0] = 9993; |
@@ -25,15 +25,15 @@ discard block |
||
25 | 25 | * Actions |
26 | 26 | */ |
27 | 27 | // Save |
28 | -if($action === ACTION_SAVE){ |
|
29 | - foreach($services as $flightTypeId => $serviceId){ |
|
28 | +if ($action === ACTION_SAVE) { |
|
29 | + foreach ($services as $flightTypeId => $serviceId) { |
|
30 | 30 | $res = $flightType->fetch($flightTypeId); |
31 | - if($res > 0 ){ |
|
31 | + if ($res > 0) { |
|
32 | 32 | $flightType->fkService = $serviceId; |
33 | 33 | $flightType->update($user); |
34 | 34 | } |
35 | 35 | |
36 | - dolibarr_set_const($db, 'BBC_POINTS_BONUS_'.$flightTypeId, GETPOST('points_bonus_'.$flightTypeId), 'chaine', 0, 'Points pour le vol T'.$flightTypeId, $conf->entity); |
|
36 | + dolibarr_set_const($db, 'BBC_POINTS_BONUS_' . $flightTypeId, GETPOST('points_bonus_' . $flightTypeId), 'chaine', 0, 'Points pour le vol T' . $flightTypeId, $conf->entity); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | dolibarr_set_const($db, 'BBC_FLIGHT_TYPE_CUSTOMER', GETPOST('customer_product'), 'chaine', 0, '', $conf->entity); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | <tr class="<?= $flightTypeLine->id % 2 == 0 ? "pair" : "impair" ?>"> |
72 | 72 | <td>(T<?= $flightTypeLine->numero ?>) - <?= $flightTypeLine->nom ?></td> |
73 | 73 | <td> |
74 | - <?php $form->select_produits($flightTypeLine->fkService, 'idprod['.$flightTypeLine->id.']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?> |
|
74 | + <?php $form->select_produits($flightTypeLine->fkService, 'idprod[' . $flightTypeLine->id . ']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?> |
|
75 | 75 | </td> |
76 | 76 | </tr> |
77 | 77 | <?php endforeach; ?> |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | </td> |
84 | 84 | <td> |
85 | 85 | <?php $form->select_produits($conf->global->BBC_FLIGHT_TYPE_CUSTOMER, 'customer_product', |
86 | - $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?> |
|
86 | + $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?> |
|
87 | 87 | </td> |
88 | 88 | </tr> |
89 | 89 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <label for="points_bonus_<?php echo $flightTypeLine->numero; ?>"> |
107 | 107 | (T<?php echo $flightTypeLine->numero ?>) - <?php echo $flightTypeLine->nom ?> |
108 | 108 | </label> |
109 | - <?php $prop = 'BBC_POINTS_BONUS_'.$flightTypeLine->numero; ?> |
|
109 | + <?php $prop = 'BBC_POINTS_BONUS_' . $flightTypeLine->numero; ?> |
|
110 | 110 | <input type="number" id="points_bonus_<?php echo $flightTypeLine->numero; ?>" name="points_bonus_<?php echo $flightTypeLine->numero; ?>" value="<?php echo $conf->global->$prop?>" /> |
111 | 111 | <br/> |
112 | 112 | <?php endforeach; ?> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__.'/CreateFlightBillCommandHandler.php'; |
|
4 | -require_once __DIR__.'/CreateFlightBillTransactionalCommandHandler.php'; |
|
3 | +require_once __DIR__ . '/CreateFlightBillCommandHandler.php'; |
|
4 | +require_once __DIR__ . '/CreateFlightBillTransactionalCommandHandler.php'; |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * @author Laurent De Coninck <[email protected]> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | /** |
12 | 12 | * @return CreateFlightBillCommandHandler |
13 | 13 | */ |
14 | - public static function factory($db, $conf, $user, $langs){ |
|
14 | + public static function factory($db, $conf, $user, $langs) { |
|
15 | 15 | return new CreateFlightBillTransactionalCommandHandler($db, $conf, $user, $langs); |
16 | 16 | } |
17 | 17 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
96 | 96 | try { |
97 | 97 | |
98 | - $command = new CreateMonthBillCommand( $type, $publicNote, $privateNote, $year, $month); |
|
98 | + $command = new CreateMonthBillCommand($type, $publicNote, $privateNote, $year, $month); |
|
99 | 99 | $handler->handle($command); |
100 | 100 | dol_htmloutput_mesg('Génération : OK'); |
101 | 101 | } catch (Exception $e) { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | try { |
55 | 55 | |
56 | - if(date('d')>=15){ |
|
56 | + if (date('d') >= 15) { |
|
57 | 57 | dol_syslog('Monthly bill generation : date over'); |
58 | 58 | return -2; |
59 | 59 | } |
@@ -232,7 +232,7 @@ |
||
232 | 232 | <?php echo !empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
233 | 233 | $flight->linkedObjectsIds[$currentTask->table_element]) ? 'checked' : '' ?> |
234 | 234 | /> |
235 | - <?php else: ?> |
|
235 | + <?php else : ?> |
|
236 | 236 | |
237 | 237 | <?php if (!empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
238 | 238 | $flight->linkedObjectsIds[$currentTask->table_element])): ?> |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | try { |
88 | 88 | $command = new CreateExpenseNoteCommand($year, $quarter, $userValidatorId, $privateNote, $publicNote); |
89 | 89 | $commandHandler->__invoke($command); |
90 | - } catch(PeriodNotFinishedException $e){ |
|
90 | + } catch (PeriodNotFinishedException $e) { |
|
91 | 91 | dol_htmloutput_errors("Le quadri n'est pas encore fini !"); |
92 | - } catch(\Exception $e){ |
|
92 | + } catch (\Exception $e) { |
|
93 | 93 | dol_syslog($e->getMessage(), LOG_ERR); |
94 | 94 | dol_htmloutput_errors('Error : ' . $e->getMessage()); |
95 | 95 | } |
@@ -105,15 +105,15 @@ discard block |
||
105 | 105 | $form = new Form($db); |
106 | 106 | |
107 | 107 | $tabLinks = []; |
108 | -foreach($flightYears as $currentFlightYear){ |
|
108 | +foreach ($flightYears as $currentFlightYear) { |
|
109 | 109 | $tabLinks[] = [ |
110 | - DOL_URL_ROOT."/flightlog/generateExpenseNote.php?year=".$currentFlightYear, |
|
110 | + DOL_URL_ROOT . "/flightlog/generateExpenseNote.php?year=" . $currentFlightYear, |
|
111 | 111 | $currentFlightYear, |
112 | - "tab_".$currentFlightYear |
|
112 | + "tab_" . $currentFlightYear |
|
113 | 113 | ]; |
114 | 114 | } |
115 | 115 | |
116 | -dol_fiche_head($tabLinks, "tab_".$year); |
|
116 | +dol_fiche_head($tabLinks, "tab_" . $year); |
|
117 | 117 | |
118 | 118 | ?> |
119 | 119 | <form method="POST"> |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | <select name="quarter" id="field_quarter"> |
135 | 135 | <option value="1" <?= ($year == $currentYear && $currentQuarter <= 1) ? 'disabled="disabled"' : "" ?>>1</option> |
136 | 136 | <option value="2" <?= ($year == $currentYear && $currentQuarter <= 2) ? 'disabled="disabled"' : "" ?>>2</option> |
137 | - <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"': "" ?>>3</option> |
|
137 | + <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"' : "" ?>>3</option> |
|
138 | 138 | <option value="4" <?= ($year == $currentYear && $currentQuarter <= 4) ? 'disabled="disabled"' : "" ?>>4</option> |
139 | 139 | </select> |
140 | 140 | <br/> |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | <label><?= $langs->trans("Validateur de la note de frais")?></label><br/> |
144 | 144 | <?php |
145 | 145 | $include_users = $object->fetch_users_approver_expensereport(); |
146 | - print $form->select_dolusers($user->id,"fk_user_validator",1,"",0,$include_users); |
|
146 | + print $form->select_dolusers($user->id, "fk_user_validator", 1, "", 0, $include_users); |
|
147 | 147 | ?> |
148 | 148 | <br/> |
149 | 149 |
@@ -91,7 +91,7 @@ |
||
91 | 91 | throw new \InvalidArgumentException('Model document is missing'); |
92 | 92 | } |
93 | 93 | |
94 | - if(!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax){ |
|
94 | + if (!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax) { |
|
95 | 95 | throw new \InvalidArgumentException('The number of pax is not correct, an integer is expected'); |
96 | 96 | } |
97 | 97 |
@@ -733,7 +733,7 @@ |
||
733 | 733 | */ |
734 | 734 | public function getActive() |
735 | 735 | { |
736 | - return (boolean)$this->active; |
|
736 | + return (boolean) $this->active; |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | /** |