@@ -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 | /** |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function setValue($value) |
| 30 | 30 | { |
| 31 | - if($value instanceof \DateTime){ |
|
| 31 | + if ($value instanceof \DateTime) { |
|
| 32 | 32 | return parent::setValue($value->format('Y-m-d')); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param array $options |
| 28 | 28 | * @param \User $user |
| 29 | 29 | */ |
| 30 | - public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options,\User $user) |
|
| 30 | + public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options, \User $user) |
|
| 31 | 31 | { |
| 32 | 32 | |
| 33 | 33 | parent::__construct('flight_form', FormInterface::METHOD_POST, $this->buildOptionsfromConfiguration($options)); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $flight = $object; |
| 84 | 84 | |
| 85 | 85 | // Quick fix - Fixme by a factory on this form. |
| 86 | - if($this->user->rights->flightlog->vol->advanced){ |
|
| 86 | + if ($this->user->rights->flightlog->vol->advanced) { |
|
| 87 | 87 | return parent::bind($object); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -272,7 +272,7 @@ |
||
| 272 | 272 | $expenseNoteUser = new User($this->db); |
| 273 | 273 | $expenseNoteUser->id = $currentMissionUserId; |
| 274 | 274 | $id = $expenseNote->create($expenseNoteUser); |
| 275 | - if($id < 0){ |
|
| 275 | + if ($id < 0) { |
|
| 276 | 276 | return null; |
| 277 | 277 | } |
| 278 | 278 | |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | $pilotLastname = $obj->lastname; |
| 53 | 53 | $pilotFirstname = $obj->firstname; |
| 54 | 54 | |
| 55 | - if($query->isPilotsOnly()){ |
|
| 55 | + if ($query->isPilotsOnly()) { |
|
| 56 | 56 | $result->addPilot($pilotId, $pilotFirstname, $pilotLastname); |
| 57 | - }else{ |
|
| 57 | + } else { |
|
| 58 | 58 | $result->addMission($obj->quartil, $pilotId, $pilotFirstname, $pilotLastname, |
| 59 | 59 | $obj->number_flights, $obj->total_kilometers); |
| 60 | 60 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $sql .= " , SUM(VOL.kilometers) as total_kilometers "; |
| 80 | 80 | $sql .= " , COUNT(VOL.idBBC_vols) as number_flights"; |
| 81 | 81 | |
| 82 | - if(!$query->isPilotsOnly()){ |
|
| 82 | + if (!$query->isPilotsOnly()) { |
|
| 83 | 83 | $sql .= " , QUARTER(VOL.date) as quartil "; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | |
| 55 | 55 | if($query->isPilotsOnly()){ |
| 56 | 56 | $result->addPilot($pilotId, $pilotFirstname, $pilotLastname); |
| 57 | - }else{ |
|
| 57 | + } else{ |
|
| 58 | 58 | $result->addMission($obj->quartil, $pilotId, $pilotFirstname, $pilotLastname, |
| 59 | 59 | $obj->number_flights, $obj->total_kilometers); |
| 60 | 60 | } |
@@ -397,7 +397,7 @@ |
||
| 397 | 397 | /** |
| 398 | 398 | * @return bool |
| 399 | 399 | */ |
| 400 | - public function hasOrderId(){ |
|
| 400 | + public function hasOrderId() { |
|
| 401 | 401 | return count($this->orderIds) > 0; |
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | \ No newline at end of file |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | |
| 71 | 71 | $msg = '<div class="ok">L\'ajout du vol du : ' . $_POST["reday"] . '/' . $_POST["remonth"] . '/' . $_POST["reyear"] . ' s\'est correctement effectue ! </div>'; |
| 72 | 72 | Header("Location: card.php?id=" . $vol->id); |
| 73 | - }catch (\Exception $e){ |
|
| 73 | + } catch (\Exception $e){ |
|
| 74 | 74 | $msg = '<div class="error">Erreur lors de l\'ajout du vol : ' . ($vol->error?:$e->getMessage()) . '! </div>'; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | ->setDate(new DateTimeImmutable($_POST['flight_date'])) |
| 44 | 44 | ->setLieuD($_POST['lieuD']) |
| 45 | 45 | ->setLieuA($_POST['lieuA']) |
| 46 | - ->setHeureD(new DateTimeImmutable($_POST['flight_date'].' '.$_POST['heureD'])) |
|
| 47 | - ->setHeureA(new DateTimeImmutable($_POST['flight_date'].' '.$_POST['heureA'])) |
|
| 46 | + ->setHeureD(new DateTimeImmutable($_POST['flight_date'] . ' ' . $_POST['heureD'])) |
|
| 47 | + ->setHeureA(new DateTimeImmutable($_POST['flight_date'] . ' ' . $_POST['heureA'])) |
|
| 48 | 48 | ->setBBCBallonsIdBBCBallons($_POST['ballon']) |
| 49 | 49 | ->setNbrPax($_POST['nbrPax']) |
| 50 | 50 | ->setRemarque($_POST['comm']) |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $msg = '<div class="ok">L\'ajout du vol du : ' . $_POST["reday"] . '/' . $_POST["remonth"] . '/' . $_POST["reyear"] . ' s\'est correctement effectue ! </div>'; |
| 70 | 70 | Header("Location: card.php?id=" . $vol->id); |
| 71 | - }catch (\Exception $e){ |
|
| 72 | - $msg = '<div class="error">Erreur lors de l\'ajout du vol : ' . ($vol->error?:$e->getMessage()) . '! </div>'; |
|
| 71 | + } catch (\Exception $e) { |
|
| 72 | + $msg = '<div class="error">Erreur lors de l\'ajout du vol : ' . ($vol->error ?: $e->getMessage()) . '! </div>'; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | <section class="bbc-style"> |
| 105 | 105 | |
| 106 | - <?php if(!empty($takeOffPlaces)): ?> |
|
| 106 | + <?php if (!empty($takeOffPlaces)): ?> |
|
| 107 | 107 | <datalist id="take_off_places_id"> |
| 108 | 108 | <?php foreach ($takeOffPlaces as $takeOffPlace): ?> |
| 109 | 109 | <option value="<?php echo $takeOffPlace->getPlace(); ?>"></option> |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | <form class="flight-form js-form" name='add' action="addFlight.php" method="post"> |
| 122 | 122 | <input type="hidden" name="action" value="add"/> |
| 123 | 123 | <input type="hidden" name="user_id" value="<?php echo $user->id; ?>"/> |
| 124 | - <input type="hidden" name="token" value="<?php echo newToken();?>"/> |
|
| 124 | + <input type="hidden" name="token" value="<?php echo newToken(); ?>"/> |
|
| 125 | 125 | |
| 126 | 126 | <!-- Date et heures --> |
| 127 | 127 | <section class="form-section"> |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | <div > |
| 183 | 183 | <div class="form-group"> |
| 184 | 184 | <label class="fieldrequired"> Pilote</label> |
| 185 | - <?php print $html->select_dolusers($_POST["pilot"] ? $_POST["pilot"] : $user->id, 'pilot', 0, null, 0, '', '', 0,0,0,'',0,'','', true); ?> |
|
| 185 | + <?php print $html->select_dolusers($_POST["pilot"] ? $_POST["pilot"] : $user->id, 'pilot', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); ?> |
|
| 186 | 186 | </div> |
| 187 | 187 | |
| 188 | 188 | <div class="form-group "> |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | </label> |
| 193 | 193 | <?php |
| 194 | 194 | //organisateur |
| 195 | - print $html->select_dolusers($_POST["orga"] ? $_POST["orga"] : $user->id, 'orga', 0, null, 0, '', '', 0,0,0,'',0,'','', true); |
|
| 195 | + print $html->select_dolusers($_POST["orga"] ? $_POST["orga"] : $user->id, 'orga', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); |
|
| 196 | 196 | ?> |
| 197 | 197 | </div> |
| 198 | 198 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | <div class="form-group"> |
| 210 | 210 | <label class="fieldrequired">Ballon</label> |
| 211 | - <?php select_balloons($_POST['ballon']?: ($mostUsedBalloon ? $mostUsedBalloon->getId() : ''), 'ballon', 0, false, true); ?> |
|
| 211 | + <?php select_balloons($_POST['ballon'] ?: ($mostUsedBalloon ? $mostUsedBalloon->getId() : ''), 'ballon', 0, false, true); ?> |
|
| 212 | 212 | </div> |
| 213 | 213 | |
| 214 | 214 | <div class="form-group"> |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | min="0" |
| 249 | 249 | max="5" |
| 250 | 250 | class="flat <?php echo $validator->hasError('nbrPax') ? 'error' : '' ?>" |
| 251 | - value="<?php echo $_POST['nbrPax']?: 0 ?>"/> |
|
| 251 | + value="<?php echo $_POST['nbrPax'] ?: 0 ?>"/> |
|
| 252 | 252 | </div> |
| 253 | 253 | |
| 254 | 254 | <!-- passenger names --> |
@@ -285,16 +285,16 @@ discard block |
||
| 285 | 285 | </tr> |
| 286 | 286 | |
| 287 | 287 | <tr> |
| 288 | - <td class="js-receiver" data-user-id="<?php echo $user->id;?>"> |
|
| 288 | + <td class="js-receiver" data-user-id="<?php echo $user->id; ?>"> |
|
| 289 | 289 | <label class=""><?php echo $langs->trans('Membre ayant perçu l\'argent')?>?</label> |
| 290 | 290 | <?php print $html->select_dolusers( |
| 291 | 291 | $_POST["fk_receiver"] ? $_POST["fk_receiver"] : -1, |
| 292 | - 'fk_receiver', true, null, 0, '', '', 0,0,0,'',0,'','', true); ?> |
|
| 292 | + 'fk_receiver', true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); ?> |
|
| 293 | 293 | </td> |
| 294 | 294 | <td> |
| 295 | 295 | <label> </label> |
| 296 | 296 | <div class="input-group"> |
| 297 | - <input type="number" name="cost" step="1" min="0" class="flat js-cost" disabled value="<?php echo $_POST['cost']?:0 ?>"/> |
|
| 297 | + <input type="number" name="cost" step="1" min="0" class="flat js-cost" disabled value="<?php echo $_POST['cost'] ?: 0 ?>"/> |
|
| 298 | 298 | <span class="input-symbol">€</span> |
| 299 | 299 | </div> |
| 300 | 300 | </td> |
@@ -305,8 +305,8 @@ discard block |
||
| 305 | 305 | <th>B. Commande(s)</th> |
| 306 | 306 | <th>Nombre de passagers.</th> |
| 307 | 307 | </tr> |
| 308 | - <?php if(is_array($_POST['order_passengers_count']) && !empty($_POST['order_passengers_count'])): ?> |
|
| 309 | - <?php foreach($_POST['order_passengers_count'] as $order => $orderQuantity): ?> |
|
| 308 | + <?php if (is_array($_POST['order_passengers_count']) && !empty($_POST['order_passengers_count'])): ?> |
|
| 309 | + <?php foreach ($_POST['order_passengers_count'] as $order => $orderQuantity): ?> |
|
| 310 | 310 | <tr class="order-row"> |
| 311 | 311 | <td> |
| 312 | 312 | <span class="fa fa-trash remove js-remove" data-order-id="<?php echo $order; ?>"></span> |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct($flightId, $projectId) |
| 28 | 28 | { |
| 29 | - $this->flightId = (int)$flightId; |
|
| 30 | - $this->projectId = (int)$projectId; |
|
| 29 | + $this->flightId = (int) $flightId; |
|
| 30 | + $this->projectId = (int) $projectId; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |