@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | private function checkPassengersInformation($vol) |
153 | 153 | { |
154 | - if (!is_numeric($vol->nbrPax) || (int)$vol->nbrPax < 0) { |
|
154 | + if (!is_numeric($vol->nbrPax) || (int) $vol->nbrPax < 0) { |
|
155 | 155 | $this->addError('nbrPax', 'Erreur le nombre de passager est un nombre négatif.'); |
156 | 156 | } |
157 | 157 | |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | */ |
204 | 204 | private function checkFlightInformation($vol) |
205 | 205 | { |
206 | - if(empty($vol->getHeureD()) || $vol->getHeureD() === '0000'){ |
|
206 | + if (empty($vol->getHeureD()) || $vol->getHeureD() === '0000') { |
|
207 | 207 | $this->addError('heureD', "L'heure depart est vide"); |
208 | 208 | } |
209 | 209 | if (!$this->isHourValid($vol->heureD)) { |
210 | 210 | $this->addError('heureD', "L'heure depart n'est pas correcte"); |
211 | 211 | } |
212 | - if(empty($vol->getHeureA()) || $vol->getHeureA() === '0000'){ |
|
212 | + if (empty($vol->getHeureA()) || $vol->getHeureA() === '0000') { |
|
213 | 213 | $this->addError('heureD', "L'heure d'arrivée est vide"); |
214 | 214 | } |
215 | 215 | |
@@ -249,10 +249,10 @@ discard block |
||
249 | 249 | $this->addError('order_id', 'Le nombre de passager par commande doit être >= 0.'); |
250 | 250 | } |
251 | 251 | |
252 | - $totalPassenegrs += (int)$nbrPassengers; |
|
252 | + $totalPassenegrs += (int) $nbrPassengers; |
|
253 | 253 | } |
254 | 254 | |
255 | - if (!$vol->hasReceiver() && $totalPassenegrs !== (int)$vol->getNumberOfPassengers()) { |
|
255 | + if (!$vol->hasReceiver() && $totalPassenegrs !== (int) $vol->getNumberOfPassengers()) { |
|
256 | 256 | $this->addError('nbrPax', 'Le nombre de passagers ne correspond pas au nombre entré sur les commandes'); |
257 | 257 | } |
258 | 258 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | private function checkBalloon(Bbcvols $flight) |
280 | 280 | { |
281 | - if($flight->getBBCBallonsIdBBCBallons() > 0){ |
|
281 | + if ($flight->getBBCBallonsIdBBCBallons() > 0) { |
|
282 | 282 | return $this; |
283 | 283 | } |
284 | 284 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | 'Vol', |
34 | 34 | 'Finances', |
35 | 35 | 'Dégâts', |
36 | - 'Remarques '.($flight->hasComment() ? ' - <span class="fa fa-comment" title="'.$flight->getComment().'"></span>' : '').($flight->hasIncidents() ? ' - <span class="fa fa-exclamation" title="'.$flight->getIncident().'"></span>' : ''), |
|
36 | + 'Remarques ' . ($flight->hasComment() ? ' - <span class="fa fa-comment" title="' . $flight->getComment() . '"></span>' : '') . ($flight->hasIncidents() ? ' - <span class="fa fa-exclamation" title="' . $flight->getIncident() . '"></span>' : ''), |
|
37 | 37 | 'Suivis', |
38 | 38 | ]; |
39 | 39 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | WHERE |
36 | 36 | fk_type IN (1,2) |
37 | 37 | AND YEAR(NOW())-1 <= YEAR(llx_bbc_vols.date) |
38 | - AND llx_bbc_vols.fk_pilot = '.$pilot.' |
|
38 | + AND llx_bbc_vols.fk_pilot = '.$pilot . ' |
|
39 | 39 | |
40 | 40 | GROUP BY |
41 | 41 | llx_bbc_vols.lieuD |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | $places = []; |
59 | 59 | |
60 | - for($i = 0; $i < $num ; $i++) { |
|
60 | + for ($i = 0; $i < $num; $i++) { |
|
61 | 61 | $properties = $this->db->fetch_array($resql); |
62 | 62 | $stat = new TakeOffPlace($properties['place']); |
63 | 63 | $places[] = $stat; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $this->db = $db; |
21 | 21 | } |
22 | 22 | |
23 | - public function query($params = []){ |
|
23 | + public function query($params = []) { |
|
24 | 24 | $sql = ' |
25 | 25 | SELECT |
26 | 26 | balloon.rowid as id, |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | WHERE |
35 | 35 | balloon.is_disable = false |
36 | - AND llx_bbc_vols.fk_pilot = '.$params['pilot'].' |
|
36 | + AND llx_bbc_vols.fk_pilot = '.$params['pilot'] . ' |
|
37 | 37 | |
38 | 38 | GROUP BY balloon.rowid |
39 | 39 | ORDER BY counter DESC |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return new Balloon(0); |
51 | 51 | } |
52 | 52 | |
53 | - for($i = 0; $i < $num ; $i++) { |
|
53 | + for ($i = 0; $i < $num; $i++) { |
|
54 | 54 | $properties = $this->db->fetch_array($resql); |
55 | 55 | return Balloon::fromArray($properties); |
56 | 56 | } |
@@ -147,22 +147,22 @@ discard block |
||
147 | 147 | |
148 | 148 | $remainingPoints = $command->getPilot()->getFlightBonus()->addPoints(FlightPoints::create($command->getAdditionalBonus())); |
149 | 149 | |
150 | - foreach ($amountPerRate as $rate => $cost){ |
|
151 | - if($cost->getValue() <= 0){ |
|
150 | + foreach ($amountPerRate as $rate => $cost) { |
|
151 | + if ($cost->getValue() <= 0) { |
|
152 | 152 | continue; |
153 | 153 | } |
154 | 154 | |
155 | - if($cost->getValue() <= $remainingPoints->getValue()){ |
|
155 | + if ($cost->getValue() <= $remainingPoints->getValue()) { |
|
156 | 156 | $remainingPoints = $remainingPoints->minCosts($cost); |
157 | 157 | continue; |
158 | 158 | } |
159 | 159 | |
160 | 160 | $subject = 'vols'; |
161 | - if((int)$rate === 21){ |
|
161 | + if ((int) $rate === 21) { |
|
162 | 162 | $subject = 'réparations'; |
163 | 163 | } |
164 | 164 | |
165 | - $this->addOrderLine($object, 'Cloture d\'année concernant les ' . $subject, $cost->minBonus($remainingPoints)->getValue(), (int)$rate, 1, $startYearTimestamp, $endYearTimestamp ); |
|
165 | + $this->addOrderLine($object, 'Cloture d\'année concernant les ' . $subject, $cost->minBonus($remainingPoints)->getValue(), (int) $rate, 1, $startYearTimestamp, $endYearTimestamp); |
|
166 | 166 | $remainingPoints = FlightBonus::zero(); |
167 | 167 | |
168 | 168 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | private function addOrderLine($object, $title, $priceTtc, $rate, $qty, $startDate, $endDate) |
210 | 210 | { |
211 | - if($qty <= 0){ |
|
211 | + if ($qty <= 0) { |
|
212 | 212 | return; |
213 | 213 | } |
214 | 214 | |
@@ -264,35 +264,35 @@ discard block |
||
264 | 264 | |
265 | 265 | //T3 |
266 | 266 | $rate = $this->t3->getService()->tva_tx; |
267 | - if(!isset($costs[$rate])){ |
|
267 | + if (!isset($costs[$rate])) { |
|
268 | 268 | $costs[$rate] = FlightCost::zero(); |
269 | 269 | } |
270 | 270 | $costs[$rate] = $costs[$rate]->addCost($pilot->getCountForType('3')->getCost()); |
271 | 271 | |
272 | 272 | //T4 |
273 | 273 | $rate = $this->t4->getService()->tva_tx; |
274 | - if(!isset($costs[$rate])){ |
|
274 | + if (!isset($costs[$rate])) { |
|
275 | 275 | $costs[$rate] = FlightCost::zero(); |
276 | 276 | } |
277 | 277 | $costs[$rate] = $costs[$rate]->addCost($pilot->getCountForType('4')->getCost()); |
278 | 278 | |
279 | 279 | //T6 |
280 | 280 | $rate = $this->t6->getService()->tva_tx; |
281 | - if(!isset($costs[$rate])){ |
|
281 | + if (!isset($costs[$rate])) { |
|
282 | 282 | $costs[$rate] = FlightCost::zero(); |
283 | 283 | } |
284 | 284 | $costs[$rate] = $costs[$rate]->addCost($pilot->getCountForType('6')->getCost()); |
285 | 285 | |
286 | 286 | //T7 |
287 | 287 | $rate = $this->t7->getService()->tva_tx; |
288 | - if(!isset($costs[$rate])){ |
|
288 | + if (!isset($costs[$rate])) { |
|
289 | 289 | $costs[$rate] = FlightCost::zero(); |
290 | 290 | } |
291 | 291 | $costs[$rate] = $costs[$rate]->addCost($pilot->getCountForType('7')->getCost()); |
292 | 292 | |
293 | 293 | //Damages |
294 | 294 | $rate = 21; |
295 | - if(!isset($costs[$rate])){ |
|
295 | + if (!isset($costs[$rate])) { |
|
296 | 296 | $costs[$rate] = FlightCost::zero(); |
297 | 297 | } |
298 | 298 | $costs[$rate] = $costs[$rate]->addCost($pilot->damageCost()->minCost($pilot->invoicedDamageCost()->multiply(-1))); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | public function minCosts(FlightCost $cost) |
49 | 49 | { |
50 | 50 | $bonusAmount = $this->bonusAmount - $cost->getValue(); |
51 | - if($bonusAmount < 0){ |
|
51 | + if ($bonusAmount < 0) { |
|
52 | 52 | return FlightBonus::zero(); |
53 | 53 | } |
54 | 54 |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
138 | 138 | |
139 | 139 | // Load object |
140 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
140 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
141 | 141 | include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
142 | 142 | |
143 | 143 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | $parameters = array(); |
168 | 168 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
169 | - $action); // Note that $action and $object may have been modified by some hooks |
|
169 | + $action); // Note that $action and $object may have been modified by some hooks |
|
170 | 170 | if ($reshook < 0) { |
171 | 171 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
172 | 172 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | // toggle is static flight |
246 | - if(($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_STATIC){ |
|
246 | + if (($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_STATIC) { |
|
247 | 247 | $result = $object |
248 | 248 | ->toggleStaticFlight() |
249 | 249 | ->update($user); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | } |
262 | 262 | // toggle is night flight |
263 | - if(($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_NIGHT){ |
|
263 | + if (($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_NIGHT) { |
|
264 | 264 | $result = $object |
265 | 265 | ->toggleNightFlight() |
266 | 266 | ->update($user); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | } |
279 | 279 | // toggle is exams |
280 | - if(($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_EXAM){ |
|
280 | + if (($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_EXAM) { |
|
281 | 281 | $result = $object |
282 | 282 | ->toggleExamFlight() |
283 | 283 | ->update($user); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | // toggle is refresh |
297 | - if(($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_REFRESH){ |
|
297 | + if (($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == ACTION_CONFIRM_TOGGLE_REFRESH) { |
|
298 | 298 | $result = $object |
299 | 299 | ->toggleRefreshFlight() |
300 | 300 | ->update($user); |
@@ -313,12 +313,12 @@ discard block |
||
313 | 313 | |
314 | 314 | // Action to classify in a project |
315 | 315 | if (!empty($conf->projet->enabled) && $user->rights->projet->creer && $action === ACTION_CLASSIN) { |
316 | - try{ |
|
316 | + try { |
|
317 | 317 | $handler = new \flightlog\command\ClassifyFlightHandler($db, $conf, $langs, $user); |
318 | 318 | $handler->handle(new \flightlog\command\ClassifyFlight($id, GETPOST('projectid'))); |
319 | 319 | $object->fetch($id); |
320 | 320 | $action = 'show'; |
321 | - }catch(Exception $e){ |
|
321 | + } catch (Exception $e) { |
|
322 | 322 | setEventMessages($e->getMessage(), null, 'errors'); |
323 | 323 | } |
324 | 324 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | |
352 | 352 | |
353 | 353 | // Part to edit record |
354 | -if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id )) && ($id || $ref) && $action == 'edit'): ?> |
|
354 | +if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && ($id || $ref) && $action == 'edit'): ?> |
|
355 | 355 | |
356 | 356 | <?php $renderer = new \flightlog\form\SimpleFormRenderer(); ?> |
357 | 357 | |
@@ -365,11 +365,11 @@ discard block |
||
365 | 365 | |
366 | 366 | <form class="flight-form js-form" name='add' action="card.php?rowid=<?php echo $object->getId(); ?>" method="POST"> |
367 | 367 | <input type="hidden" name="action" value="update"/> |
368 | - <input type="hidden" name="token" value="<?php echo newToken();?>"/> |
|
368 | + <input type="hidden" name="token" value="<?php echo newToken(); ?>"/> |
|
369 | 369 | |
370 | 370 | <?php echo $renderer->render($formFlight->getElement('idBBC_vols')); ?> |
371 | 371 | |
372 | - <?php if($formFlight->has('fk_type')): ?> |
|
372 | + <?php if ($formFlight->has('fk_type')): ?> |
|
373 | 373 | <section class="form-section"> |
374 | 374 | <h1 class="form-section-title"><?php echo $langs->trans('Type de vol'); ?></h1> |
375 | 375 | <table class="border" width="50%"> |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | <?php endif; ?> |
384 | 384 | |
385 | 385 | <!-- Date et heures --> |
386 | - <?php if($formFlight->has('date')): ?> |
|
386 | + <?php if ($formFlight->has('date')): ?> |
|
387 | 387 | <section class="form-section"> |
388 | 388 | <h1 class="form-section-title"><?php echo $langs->trans('Date'); ?></h1> |
389 | 389 | <table class="border" width="50%"> |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | </section> |
396 | 396 | <?php endif; ?> |
397 | 397 | |
398 | - <?php if($formFlight->has('heureD') && $formFlight->has('heureA')): ?> |
|
398 | + <?php if ($formFlight->has('heureD') && $formFlight->has('heureA')): ?> |
|
399 | 399 | <section class="form-section"> |
400 | 400 | <h1 class="form-section-title"><?php echo $langs->trans('Heures'); ?></h1> |
401 | 401 | <table class="border" width="50%"> |
@@ -415,14 +415,14 @@ discard block |
||
415 | 415 | <h1 class="form-section-title"><?php echo $langs->trans('Pilote & ballon') ?></h1> |
416 | 416 | <table class="border" width="50%"> |
417 | 417 | |
418 | - <?php if($formFlight->has('fk_pilot')): ?> |
|
418 | + <?php if ($formFlight->has('fk_pilot')): ?> |
|
419 | 419 | <tr> |
420 | 420 | <td class="fieldrequired"> Pilote </td> |
421 | - <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'),['ajax' => true]); ?></td> |
|
421 | + <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'), ['ajax' => true]); ?></td> |
|
422 | 422 | </tr> |
423 | 423 | <?php endif; ?> |
424 | 424 | |
425 | - <?php if($formFlight->has('BBC_ballons_idBBC_ballons')): ?> |
|
425 | + <?php if ($formFlight->has('BBC_ballons_idBBC_ballons')): ?> |
|
426 | 426 | <tr> |
427 | 427 | <td width="25%" class="fieldrequired">Ballon</td> |
428 | 428 | <td><?php echo $renderer->render($formFlight->getElement('BBC_ballons_idBBC_ballons')); ?></td> |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | </table> |
458 | 458 | </section> |
459 | 459 | |
460 | - <?php if($formFlight->has('fk_organisateur')): ?> |
|
460 | + <?php if ($formFlight->has('fk_organisateur')): ?> |
|
461 | 461 | <section class="form-section"> |
462 | 462 | <h1 class="form-section-title"><span class="js-organisator-field">Organisateur</span></h1> |
463 | 463 | <table class="border" width="50%"> |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | <td> |
467 | 467 | <?php |
468 | 468 | //organisateur |
469 | - print $renderer->render($formFlight->getElement('fk_organisateur'),['ajax' => true]); |
|
469 | + print $renderer->render($formFlight->getElement('fk_organisateur'), ['ajax' => true]); |
|
470 | 470 | ?> |
471 | 471 | </td> |
472 | 472 | </tr> |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | <section class="form-section js-expensable-field"> |
479 | 479 | <h1 class="form-section-title"><?php echo $langs->trans('Déplacements') ?></h1> |
480 | 480 | <table class="border" width="50%"> |
481 | - <?php if($formFlight->has('kilometers')): ?> |
|
481 | + <?php if ($formFlight->has('kilometers')): ?> |
|
482 | 482 | <!-- number of kilometers done for the flight --> |
483 | 483 | <tr> |
484 | 484 | <td class="fieldrequired">Nombre de kilometres effectués pour le vol</td> |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | </tr> |
489 | 489 | <?php endif; ?> |
490 | 490 | |
491 | - <?php if($formFlight->has('justif_kilometers')): ?> |
|
491 | + <?php if ($formFlight->has('justif_kilometers')): ?> |
|
492 | 492 | <!-- Justif Kilometers --> |
493 | 493 | <tr> |
494 | 494 | |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | <section class="form-section"> |
507 | 507 | <h1 class="form-section-title"><?php echo $langs->trans('Passager') ?></h1> |
508 | 508 | <table class="border" width="50%"> |
509 | - <?php if($formFlight->has('nbrPax')): ?> |
|
509 | + <?php if ($formFlight->has('nbrPax')): ?> |
|
510 | 510 | <tr> |
511 | 511 | <td class="fieldrequired"><?php echo $langs->trans('Nombre de passagers'); ?></td> |
512 | 512 | <td> |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | </tr> |
516 | 516 | <?php endif; ?> |
517 | 517 | |
518 | - <?php if($formFlight->has('passengerNames')): ?> |
|
518 | + <?php if ($formFlight->has('passengerNames')): ?> |
|
519 | 519 | <!-- passenger names --> |
520 | 520 | <tr> |
521 | 521 | <td width="25%" class="fieldrequired"><?php echo $langs->trans('Noms des passagers'); ?><br/>(Séparé |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | <?php print $renderer->render($formFlight->getElement('passengerNames')); ?> |
526 | 526 | </td> |
527 | 527 | </tr> |
528 | - <?php endif;?> |
|
528 | + <?php endif; ?> |
|
529 | 529 | </table> |
530 | 530 | </section> |
531 | 531 | |
@@ -534,17 +534,17 @@ discard block |
||
534 | 534 | <h1 class="form-section-title js-billable-field"><?php echo $langs->trans('Facturation') ?></h1> |
535 | 535 | <table class="border" width="50%"> |
536 | 536 | |
537 | - <?php if($formFlight->has('fk_receiver')): ?> |
|
537 | + <?php if ($formFlight->has('fk_receiver')): ?> |
|
538 | 538 | <!-- Money receiver --> |
539 | 539 | <tr class="js-hide-order js-billable-field"> |
540 | 540 | <td class="fieldrequired"><?php echo $langs->trans('Qui a perçu l\'argent') ?></td> |
541 | 541 | <td> |
542 | - <?php print $renderer->render($formFlight->getElement('fk_receiver'),['ajax' => true]); ?> |
|
542 | + <?php print $renderer->render($formFlight->getElement('fk_receiver'), ['ajax' => true]); ?> |
|
543 | 543 | </td> |
544 | 544 | </tr> |
545 | 545 | <?php endif; ?> |
546 | 546 | |
547 | - <?php if($formFlight->has('cost')): ?> |
|
547 | + <?php if ($formFlight->has('cost')): ?> |
|
548 | 548 | <!-- Flight cost --> |
549 | 549 | <tr class="js-hide-order js-billable-field"> |
550 | 550 | <td class="fieldrequired">Montant perçu</td> |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | <h1 class="form-section-title"><?php echo $langs->trans('Commentaires') ?></h1> |
566 | 566 | <table class="border" width="50%"> |
567 | 567 | |
568 | - <?php if($formFlight->has('remarque')): ?> |
|
568 | + <?php if ($formFlight->has('remarque')): ?> |
|
569 | 569 | <!-- commentaires --> |
570 | 570 | <tr class=""> |
571 | 571 | <td class="fieldrequired"> Commentaire</td> |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | </tr> |
576 | 576 | <?php endif; ?> |
577 | 577 | |
578 | - <?php if($formFlight->has('incidents')): ?> |
|
578 | + <?php if ($formFlight->has('incidents')): ?> |
|
579 | 579 | <!-- incidents --> |
580 | 580 | <tr class=""> |
581 | 581 | <td class="fieldrequired"> incidents</td> |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), |
610 | 610 | $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1); |
611 | 611 | print $formconfirm; |
612 | - } elseif ($user->rights->flightlog->vol->financial && $action == ACTION_FLAG_BILLED) { |
|
612 | + } elseif ($user->rights->flightlog->vol->financial && $action == ACTION_FLAG_BILLED) { |
|
613 | 613 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, |
614 | 614 | $langs->trans('Marque comme facturé'), |
615 | 615 | $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '', |
@@ -657,29 +657,29 @@ discard block |
||
657 | 657 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_pilot") . '</td><td>' . $pilot->getNomUrl(1) . '</td></tr>'; |
658 | 658 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_organisateur") . '</td><td>' . $organisator->getNomUrl(1) . '</td></tr>'; |
659 | 659 | |
660 | - if (! empty($conf->projet->enabled)) |
|
660 | + if (!empty($conf->projet->enabled)) |
|
661 | 661 | { |
662 | 662 | print '<tr><td class="fieldrequired">' . $langs->trans("Project") . '</td><td>'; |
663 | 663 | $morehtmlref = ''; |
664 | 664 | if ($user->rights->projet->creer) |
665 | 665 | { |
666 | 666 | if ($action !== ACTION_CLASSIFY) { |
667 | - $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action='.ACTION_CLASSIFY.'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; |
|
667 | + $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=' . ACTION_CLASSIFY . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; |
|
668 | 668 | } |
669 | 669 | if ($action === ACTION_CLASSIFY) { |
670 | - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
671 | - $morehtmlref.='<input type="hidden" name="action" value="'.ACTION_CLASSIN.'">'; |
|
672 | - $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
673 | - $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', 80, 0, 1, 0, 1, 0, 0, '', 1); |
|
674 | - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
675 | - $morehtmlref.='</form>'; |
|
670 | + $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">'; |
|
671 | + $morehtmlref .= '<input type="hidden" name="action" value="' . ACTION_CLASSIN . '">'; |
|
672 | + $morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
673 | + $morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', 80, 0, 1, 0, 1, 0, 0, '', 1); |
|
674 | + $morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
675 | + $morehtmlref .= '</form>'; |
|
676 | 676 | } |
677 | 677 | } |
678 | 678 | |
679 | 679 | if ($object->hasProject()) { |
680 | 680 | $proj = new Project($db); |
681 | 681 | $proj->fetch($object->fk_project); |
682 | - $morehtmlref.=$proj->getNomUrl(1); |
|
682 | + $morehtmlref .= $proj->getNomUrl(1); |
|
683 | 683 | } |
684 | 684 | print $morehtmlref . '</td>'; |
685 | 685 | } |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | print '<div class="tabsAction">' . "\n"; |
695 | 695 | $parameters = array(); |
696 | 696 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
697 | - $action); // Note that $action and $object may have been modified by hook |
|
697 | + $action); // Note that $action and $object may have been modified by hook |
|
698 | 698 | if ($reshook < 0) { |
699 | 699 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
700 | 700 | } |
@@ -723,10 +723,10 @@ discard block |
||
723 | 723 | <?php endif; ?> |
724 | 724 | |
725 | 725 | <!-- Toggle static flight --> |
726 | - <?php if($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)): ?> |
|
726 | + <?php if ($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)): ?> |
|
727 | 727 | <div class="inline-block divButAction"> |
728 | 728 | <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_TOGGLE_STATIC); ?>"> |
729 | - <?php if(!$object->isStaticFlight()): ?> |
|
729 | + <?php if (!$object->isStaticFlight()): ?> |
|
730 | 730 | <?php echo $langs->trans("Vol static") ?> |
731 | 731 | <?php else: ?> |
732 | 732 | <?php echo $langs->trans("Non static") ?> |
@@ -736,10 +736,10 @@ discard block |
||
736 | 736 | <?php endif; ?> |
737 | 737 | |
738 | 738 | <!-- Toggle night flight --> |
739 | - <?php if($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)): ?> |
|
739 | + <?php if ($user->rights->flightlog->vol->advanced || $user->rights->flightlog->pilot->edit || $user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)): ?> |
|
740 | 740 | <div class="inline-block divButAction"> |
741 | 741 | <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_TOGGLE_NIGHT); ?>"> |
742 | - <?php if(!$object->isNightFlight()): ?> |
|
742 | + <?php if (!$object->isNightFlight()): ?> |
|
743 | 743 | <?php echo $langs->trans("Vol de nuit") ?> |
744 | 744 | <?php else: ?> |
745 | 745 | <?php echo $langs->trans("Non nuit") ?> |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $handler->handle(new \flightlog\command\ClassifyFlight($id, GETPOST('projectid'))); |
319 | 319 | $object->fetch($id); |
320 | 320 | $action = 'show'; |
321 | - }catch(Exception $e){ |
|
321 | + } catch(Exception $e){ |
|
322 | 322 | setEventMessages($e->getMessage(), null, 'errors'); |
323 | 323 | } |
324 | 324 | } |
@@ -728,9 +728,12 @@ discard block |
||
728 | 728 | <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_TOGGLE_STATIC); ?>"> |
729 | 729 | <?php if(!$object->isStaticFlight()): ?> |
730 | 730 | <?php echo $langs->trans("Vol static") ?> |
731 | - <?php else: ?> |
|
731 | + <?php else { |
|
732 | + : ?> |
|
732 | 733 | <?php echo $langs->trans("Non static") ?> |
733 | - <?php endif; ?> |
|
734 | + <?php endif; |
|
735 | +} |
|
736 | +?> |
|
734 | 737 | </a> |
735 | 738 | </div> |
736 | 739 | <?php endif; ?> |
@@ -741,9 +744,12 @@ discard block |
||
741 | 744 | <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_TOGGLE_NIGHT); ?>"> |
742 | 745 | <?php if(!$object->isNightFlight()): ?> |
743 | 746 | <?php echo $langs->trans("Vol de nuit") ?> |
744 | - <?php else: ?> |
|
747 | + <?php else { |
|
748 | + : ?> |
|
745 | 749 | <?php echo $langs->trans("Non nuit") ?> |
746 | - <?php endif; ?> |
|
750 | + <?php endif; |
|
751 | +} |
|
752 | +?> |
|
747 | 753 | </a> |
748 | 754 | </div> |
749 | 755 | <?php endif; ?> |
@@ -14,7 +14,7 @@ |
||
14 | 14 | final class PilotListController extends WebController |
15 | 15 | { |
16 | 16 | |
17 | - public function index(){ |
|
17 | + public function index() { |
|
18 | 18 | |
19 | 19 | $members = $this->getPilotRepository()->query(); |
20 | 20 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @return Id|static |
26 | 26 | */ |
27 | - public static function create($id){ |
|
27 | + public static function create($id) { |
|
28 | 28 | return new self($id); |
29 | 29 | } |
30 | 30 |