@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | Assert::nullOrString($pilotLastname); |
47 | 47 | Assert::nullOrString($pilotFirstname); |
48 | 48 | |
49 | - $this->pilotId = (int)$pilotId; |
|
49 | + $this->pilotId = (int) $pilotId; |
|
50 | 50 | $this->pilotFirstname = $pilotFirstname; |
51 | 51 | $this->pilotLastname = $pilotLastname; |
52 | 52 | |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | * @param int $numberOfFlights |
60 | 60 | * @param int $numberOfKilometers |
61 | 61 | */ |
62 | - public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers){ |
|
62 | + public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers) { |
|
63 | 63 | Assert::integerish($quarter); |
64 | - $quarter = (int)$quarter; |
|
64 | + $quarter = (int) $quarter; |
|
65 | 65 | |
66 | 66 | Assert::keyNotExists($this->quarterMissions, $quarter); |
67 | 67 | |
@@ -119,13 +119,13 @@ discard block |
||
119 | 119 | * |
120 | 120 | * @return QuarterMission |
121 | 121 | */ |
122 | - private function getQuarterMission($quarter){ |
|
122 | + private function getQuarterMission($quarter) { |
|
123 | 123 | Assert::integer($quarter); |
124 | 124 | Assert::greaterThan($quarter, 0); |
125 | 125 | Assert::lessThanEq($quarter, 4); |
126 | 126 | |
127 | - if(!isset($this->quarterMissions[$quarter])){ |
|
128 | - return new QuarterMission($quarter,0,0); |
|
127 | + if (!isset($this->quarterMissions[$quarter])) { |
|
128 | + return new QuarterMission($quarter, 0, 0); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | return $this->quarterMissions[$quarter]; |
@@ -136,6 +136,6 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getPilotName() |
138 | 138 | { |
139 | - return $this->pilotFirstname.' '.$this->pilotLastname; |
|
139 | + return $this->pilotFirstname . ' ' . $this->pilotLastname; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | \ No newline at end of file |
@@ -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 |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | print '<td>' . $totalT3 . '</td>'; |
267 | 267 | print '<td></td>'; |
268 | 268 | |
269 | -print '<td>' . $totalT4. '</td>'; |
|
269 | +print '<td>' . $totalT4 . '</td>'; |
|
270 | 270 | print '<td></td>'; |
271 | 271 | |
272 | 272 | print '<td>' . $totalT5 . '</td>'; |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | //table km |
293 | 293 | $tauxRemb = isset($conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM) ? $conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM : 0; |
294 | 294 | $year = GETPOST("year", 'int'); |
295 | -if(empty($year)){ |
|
295 | +if (empty($year)) { |
|
296 | 296 | $year = date('Y'); |
297 | 297 | } |
298 | 298 |
@@ -108,7 +108,7 @@ |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | - * @param null $year |
|
111 | + * @param integer $year |
|
112 | 112 | * @param null $pilotId |
113 | 113 | * @param null $quarter |
114 | 114 | * @param bool $groupBy |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
117 | 117 | |
118 | 118 | // Load object |
119 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
119 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
120 | 120 | include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
121 | 121 | |
122 | 122 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | $parameters = array(); |
144 | 144 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
145 | - $action); // Note that $action and $object may have been modified by some hooks |
|
145 | + $action); // Note that $action and $object may have been modified by some hooks |
|
146 | 146 | if ($reshook < 0) { |
147 | 147 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
148 | 148 | } |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | print '<div class="tabsAction">' . "\n"; |
527 | 527 | $parameters = array(); |
528 | 528 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
529 | - $action); // Note that $action and $object may have been modified by hook |
|
529 | + $action); // Note that $action and $object may have been modified by hook |
|
530 | 530 | if ($reshook < 0) { |
531 | 531 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
532 | 532 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | private function renderElement(FormElementInterface $element) |
53 | 53 | { |
54 | - switch($element->getType()){ |
|
54 | + switch ($element->getType()) { |
|
55 | 55 | case FormElementInterface::TYPE_TEXTAREA: |
56 | 56 | return sprintf('<textarea name="%s" %s>%s</textarea>', $element->getName(), $this->formatOptions($element->getOptions()), $element->getValue()); |
57 | 57 | |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | { |
98 | 98 | $selectElement = sprintf('<select name="%s" >', $element->getName()); |
99 | 99 | |
100 | - if($element->getValueOptions()){ |
|
101 | - foreach($element->getValueOptions() as $optionValue => $optionLabel){ |
|
100 | + if ($element->getValueOptions()) { |
|
101 | + foreach ($element->getValueOptions() as $optionValue => $optionLabel) { |
|
102 | 102 | $selectedAttribute = $optionValue === $element->getValue() ? 'selected' : ''; |
103 | 103 | $selectElement .= sprintf('<option value="%s" %s >%s</option>', $optionValue, $selectedAttribute, $optionLabel); |
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
107 | - $selectElement.='</select>'; |
|
107 | + $selectElement .= '</select>'; |
|
108 | 108 | |
109 | 109 | return $selectElement; |
110 | 110 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * @return $this |
104 | 104 | */ |
105 | - public function required(){ |
|
105 | + public function required() { |
|
106 | 106 | $this->options['attr']['required'] = 'required'; |
107 | 107 | |
108 | 108 | return $this; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * @return $this |
113 | 113 | */ |
114 | - public function disable(){ |
|
114 | + public function disable() { |
|
115 | 115 | $this->options['attr']['disabled'] = 'disabled'; |
116 | 116 | return $this; |
117 | 117 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * @inheritDoc |
80 | 80 | */ |
81 | - public function getOptions(){ |
|
81 | + public function getOptions() { |
|
82 | 82 | return $this->options; |
83 | 83 | } |
84 | 84 | |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function validate() |
100 | 100 | { |
101 | - if(!$this->validator){ |
|
101 | + if (!$this->validator) { |
|
102 | 102 | return true; |
103 | 103 | } |
104 | 104 | |
105 | - if(null === $this->object){ |
|
105 | + if (null === $this->object) { |
|
106 | 106 | throw new \InvalidArgumentException('Object not bind'); |
107 | 107 | } |
108 | 108 | |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function bind($object) |
128 | 128 | { |
129 | - foreach($this->elements as $element){ |
|
129 | + foreach ($this->elements as $element) { |
|
130 | 130 | $name = $this->camelCase($element->getName()); |
131 | - $methodName = 'get'.$name; |
|
132 | - if(!method_exists($object, $methodName)){ |
|
131 | + $methodName = 'get' . $name; |
|
132 | + if (!method_exists($object, $methodName)) { |
|
133 | 133 | continue; |
134 | 134 | } |
135 | 135 | |
@@ -146,15 +146,15 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function setData(array $data) |
148 | 148 | { |
149 | - foreach($data as $fieldName => $currentData){ |
|
150 | - if(!key_exists($fieldName, $this->elements)){ |
|
149 | + foreach ($data as $fieldName => $currentData) { |
|
150 | + if (!key_exists($fieldName, $this->elements)) { |
|
151 | 151 | continue; |
152 | 152 | } |
153 | 153 | |
154 | 154 | $this->elements[$fieldName]->setValue($currentData); |
155 | 155 | |
156 | - $methodName = 'set'.$this->camelCase($fieldName); |
|
157 | - if(null === $this->object || !method_exists($this->object, $methodName)){ |
|
156 | + $methodName = 'set' . $this->camelCase($fieldName); |
|
157 | + if (null === $this->object || !method_exists($this->object, $methodName)) { |
|
158 | 158 | continue; |
159 | 159 | } |
160 | 160 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function getElement($elementName) |
179 | 179 | { |
180 | - if(!key_exists($elementName, $this->elements)){ |
|
180 | + if (!key_exists($elementName, $this->elements)) { |
|
181 | 181 | throw new \InvalidArgumentException(sprintf('Element %s not found ', $elementName)); |
182 | 182 | } |
183 | 183 |