Completed
Push — feature/pilot_information ( 13ff1e )
by Laurent
02:49 queued 53s
created
validators/FlightValidator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/card.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Infrastructure/Flight/Query/Repository/TakeOffQueryRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Infrastructure/Flight/Query/Repository/BalloonQueryRepository.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 
6 6
 
7 7
 use FlightLog\Application\Flight\ViewModel\Balloon;
8
-use FlightLog\Application\Flight\ViewModel\TakeOffPlace;
9 8
 
10 9
 final class BalloonQueryRepository
11 10
 {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
command/CreatePilotYearBillCommandHandler.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -147,22 +147,22 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)));
Please login to merge, or discard this patch.
class/flight/FlightBonus.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
class/bbcvols.class.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function getIdBBCVols()
126 126
     {
127
-        return (int)$this->idBBC_vols;
127
+        return (int) $this->idBBC_vols;
128 128
     }
129 129
 
130 130
     /**
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function getId()
134 134
     {
135
-        return (int)$this->getIdBBCVols();
135
+        return (int) $this->getIdBBCVols();
136 136
     }
137 137
 
138 138
     /**
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
         $sql .= ' ' . (!isset($this->nbrPax) ? 'NULL' : "'" . $this->db->escape($this->nbrPax) . "'") . ',';
270 270
         $sql .= ' ' . (!isset($this->remarque) ? 'NULL' : "'" . $this->db->escape($this->remarque) . "'") . ',';
271 271
         $sql .= ' ' . (!isset($this->incidents) ? 'NULL' : "'" . $this->db->escape($this->incidents) . "'") . ',';
272
-        $sql .= ' ' . (!isset($this->fk_type) || (int)$this->fk_type === -1 ? 'NULL' : $this->fk_type) . ',';
273
-        $sql .= ' ' . (!isset($this->fk_pilot) || (int)$this->fk_pilot === -1 ? 'NULL' : $this->fk_pilot) . ',';
274
-        $sql .= ' ' . (!isset($this->fk_organisateur) || (int)$this->fk_organisateur === -1 ? 'NULL' : $this->fk_organisateur) . ',';
272
+        $sql .= ' ' . (!isset($this->fk_type) || (int) $this->fk_type === -1 ? 'NULL' : $this->fk_type) . ',';
273
+        $sql .= ' ' . (!isset($this->fk_pilot) || (int) $this->fk_pilot === -1 ? 'NULL' : $this->fk_pilot) . ',';
274
+        $sql .= ' ' . (!isset($this->fk_organisateur) || (int) $this->fk_organisateur === -1 ? 'NULL' : $this->fk_organisateur) . ',';
275 275
         $sql .= ' ' . (!isset($this->is_facture) ? '0' : $this->is_facture) . ',';
276 276
         $sql .= ' ' . (!isset($this->kilometers) || empty($this->kilometers) ? '0' : $this->kilometers) . ',';
277 277
         $sql .= ' ' . (!isset($this->cost) ? 'NULL' : "'" . $this->db->escape($this->cost) . "'") . ',';
278
-        $sql .= ' ' . (!isset($this->fk_receiver) || (int)$this->fk_receiver === -1 ? 'NULL' : $this->fk_receiver) . ',';
278
+        $sql .= ' ' . (!isset($this->fk_receiver) || (int) $this->fk_receiver === -1 ? 'NULL' : $this->fk_receiver) . ',';
279 279
         $sql .= ' ' . (!isset($this->justif_kilometers) ? 'NULL' : "'" . $this->db->escape($this->justif_kilometers) . "'") . ',';
280 280
         $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ',';
281 281
         $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ',';
@@ -450,23 +450,23 @@  discard block
 block discarded – undo
450 450
 
451 451
                 $this->id = $obj->idBBC_vols;
452 452
 
453
-                $this->idBBC_vols = (int)$obj->idBBC_vols;
453
+                $this->idBBC_vols = (int) $obj->idBBC_vols;
454 454
                 $this->date = $this->db->jdate($obj->date);
455 455
                 $this->lieuD = $obj->lieuD;
456 456
                 $this->lieuA = $obj->lieuA;
457 457
                 $this->heureD = $obj->heureD;
458 458
                 $this->heureA = $obj->heureA;
459
-                $this->BBC_ballons_idBBC_ballons = (int)$obj->BBC_ballons_idBBC_ballons;
459
+                $this->BBC_ballons_idBBC_ballons = (int) $obj->BBC_ballons_idBBC_ballons;
460 460
                 $this->nbrPax = $obj->nbrPax;
461 461
                 $this->remarque = $obj->remarque;
462 462
                 $this->incidents = $obj->incidents;
463
-                $this->fk_type = (int)$obj->fk_type;
464
-                $this->fk_pilot = (int)$obj->fk_pilot;
465
-                $this->fk_organisateur = (int)$obj->fk_organisateur;
466
-                $this->statut = $this->is_facture = (int)$obj->is_facture;
463
+                $this->fk_type = (int) $obj->fk_type;
464
+                $this->fk_pilot = (int) $obj->fk_pilot;
465
+                $this->fk_organisateur = (int) $obj->fk_organisateur;
466
+                $this->statut = $this->is_facture = (int) $obj->is_facture;
467 467
                 $this->kilometers = $obj->kilometers;
468 468
                 $this->total_ttc = $this->cost = $obj->cost;
469
-                $this->fk_receiver = (int)$obj->fk_receiver;
469
+                $this->fk_receiver = (int) $obj->fk_receiver;
470 470
                 $this->justif_kilometers = $obj->justif_kilometers;
471 471
                 $this->date_creation = $obj->date_creation;
472 472
                 $this->date_update = $obj->date_update;
@@ -582,13 +582,13 @@  discard block
 block discarded – undo
582 582
         $sql .= ' nbrPax = ' . (isset($this->nbrPax) ? "'" . $this->db->escape($this->nbrPax) . "'" : "null") . ',';
583 583
         $sql .= ' remarque = ' . (isset($this->remarque) ? "'" . $this->db->escape($this->remarque) . "'" : "null") . ',';
584 584
         $sql .= ' incidents = ' . (isset($this->incidents) ? "'" . $this->db->escape($this->incidents) . "'" : "null") . ',';
585
-        $sql .= ' fk_type = ' . (isset($this->fk_type) && (int)$this->fk_type > 0 ? $this->fk_type : "null") . ',';
586
-        $sql .= ' fk_pilot = ' . (isset($this->fk_pilot) && (int)$this->fk_pilot > 0 ? $this->fk_pilot : "null") . ',';
587
-        $sql .= ' fk_organisateur = ' . (isset($this->fk_organisateur) && (int)$this->fk_organisateur > 0 ? $this->fk_organisateur : "null") . ',';
585
+        $sql .= ' fk_type = ' . (isset($this->fk_type) && (int) $this->fk_type > 0 ? $this->fk_type : "null") . ',';
586
+        $sql .= ' fk_pilot = ' . (isset($this->fk_pilot) && (int) $this->fk_pilot > 0 ? $this->fk_pilot : "null") . ',';
587
+        $sql .= ' fk_organisateur = ' . (isset($this->fk_organisateur) && (int) $this->fk_organisateur > 0 ? $this->fk_organisateur : "null") . ',';
588 588
         $sql .= ' is_facture = ' . (isset($this->is_facture) ? $this->is_facture : "0") . ',';
589 589
         $sql .= ' kilometers = ' . (!empty($this->kilometers) ? $this->kilometers : "0") . ',';
590 590
         $sql .= ' cost = ' . (isset($this->cost) ? "'" . $this->db->escape($this->cost) . "'" : "''") . ',';
591
-        $sql .= ' fk_receiver = ' . (isset($this->fk_receiver) && (int)$this->fk_receiver > 0 ? $this->fk_receiver : "null") . ',';
591
+        $sql .= ' fk_receiver = ' . (isset($this->fk_receiver) && (int) $this->fk_receiver > 0 ? $this->fk_receiver : "null") . ',';
592 592
         $sql .= ' justif_kilometers = ' . (isset($this->justif_kilometers) ? "'" . $this->db->escape($this->justif_kilometers) . "'," : "'',");
593 593
         $sql .= ' date_update = ' . "'" . date('Y-m-d H:i:s') . "',";
594 594
         $sql .= ' is_night = ' . ($this->nightFlight ? 1 : 0) . ',';
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
      */
887 887
     public function getPilotId()
888 888
     {
889
-        return (int)$this->fk_pilot;
889
+        return (int) $this->fk_pilot;
890 890
     }
891 891
 
892 892
     /**
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
      */
895 895
     public function getOrganisatorId()
896 896
     {
897
-        return (int)$this->fk_organisateur;
897
+        return (int) $this->fk_organisateur;
898 898
     }
899 899
 
900 900
     /**
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
      */
932 932
     public function hasPax()
933 933
     {
934
-        return (int)$this->nbrPax > 0;
934
+        return (int) $this->nbrPax > 0;
935 935
     }
936 936
 
937 937
     /**
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
      */
1001 1001
     public function getKilometers()
1002 1002
     {
1003
-        return (int)$this->kilometers;
1003
+        return (int) $this->kilometers;
1004 1004
     }
1005 1005
 
1006 1006
     /**
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
      */
1044 1044
     public function getNumberOfPassengers()
1045 1045
     {
1046
-        return (int)$this->nbrPax;
1046
+        return (int) $this->nbrPax;
1047 1047
     }
1048 1048
 
1049 1049
     /**
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
      */
1247 1247
     public function getBBCBallonsIdBBCBallons()
1248 1248
     {
1249
-        return (int)$this->BBC_ballons_idBBC_ballons;
1249
+        return (int) $this->BBC_ballons_idBBC_ballons;
1250 1250
     }
1251 1251
 
1252 1252
     /**
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
      */
1323 1323
     public function getFkType()
1324 1324
     {
1325
-        return (int)$this->fk_type;
1325
+        return (int) $this->fk_type;
1326 1326
     }
1327 1327
 
1328 1328
     /**
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
      */
1418 1418
     public function getFkReceiver()
1419 1419
     {
1420
-        return (int)$this->fk_receiver;
1420
+        return (int) $this->fk_receiver;
1421 1421
     }
1422 1422
 
1423 1423
     /**
Please login to merge, or discard this patch.
card.php 2 patches
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.'&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
667
+                $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=' . ACTION_CLASSIFY . '&amp;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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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") ?>
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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; ?>
Please login to merge, or discard this patch.