Completed
Push — feature/pilot_information ( cc067b...4835e7 )
by Laurent
01:49
created
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 1 patch
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.
Http/Web/Controller/PilotListController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
class/Common/ValueObject/Id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
class/Pilot/Pilot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -526,7 +526,7 @@
 block discarded – undo
526 526
 
527 527
     public function attributeRadioLicenceDate(RadioLicenceDate $value)
528 528
     {
529
-        $this->radioLicenceDate =  $value;
529
+        $this->radioLicenceDate = $value;
530 530
     }
531 531
 
532 532
     public function attributeLastTrainingFirstHelpDate(LastTrainingDate $value)
Please login to merge, or discard this patch.
class/Pilot/ValueObject/IsOwner.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             return self::no();
24 24
         }
25 25
 
26
-        if (is_numeric($value) || is_int($value) || (int)$value == $value) {
26
+        if (is_numeric($value) || is_int($value) || (int) $value == $value) {
27 27
             return new self($value == 1);
28 28
         }
29 29
 
Please login to merge, or discard this patch.
flightlog.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -172,13 +172,13 @@
 block discarded – undo
172 172
                 continue;
173 173
             }
174 174
 
175
-            if($match == ".." || $match == "." || substr($match, 0,1) === '.'){
175
+            if ($match == ".." || $match == "." || substr($match, 0, 1) === '.') {
176 176
                 continue;
177 177
             }
178 178
 
179 179
             $element = $root . DIRECTORY_SEPARATOR . $match;
180 180
 
181
-            if(substr_count($element, '/', 3) >= 1){
181
+            if (substr_count($element, '/', 3) >= 1) {
182 182
                 scan($element);
183 183
             }
184 184
 
Please login to merge, or discard this patch.
Form/InputCheckBox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         parent::__construct($name, FormElementInterface::TYPE_CHECKBOX, $options);
17 17
     }
18 18
 
19
-    public function checkedValue(){
19
+    public function checkedValue() {
20 20
         return 1;
21 21
     }
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
Infrastructure/Common/Repository/AbstractDomainRepository.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public function __construct(\DoliDB $db, $tableName)
24 24
     {
25 25
         $this->db = $db;
26
-        $this->tableName = strpos($tableName, MAIN_DB_PREFIX) === 0 ? $tableName : MAIN_DB_PREFIX.$tableName;
26
+        $this->tableName = strpos($tableName, MAIN_DB_PREFIX) === 0 ? $tableName : MAIN_DB_PREFIX . $tableName;
27 27
     }
28 28
 
29 29
     /**
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      *
34 34
      * @throws \Exception
35 35
      */
36
-    protected function write(array $elements){
36
+    protected function write(array $elements) {
37 37
         $columns = join(',', array_keys($elements));
38 38
         $values = join(',', array_map([$this, 'escape'], array_values($elements)));
39 39
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             $lasterror = $this->db->lasterror();
45 45
             dol_syslog(__METHOD__ . ' ' . $lasterror, LOG_ERR);
46 46
             $this->db->rollback();
47
-            throw new \Exception("Repository error - ".$lasterror);
47
+            throw new \Exception("Repository error - " . $lasterror);
48 48
         }
49 49
 
50 50
         $id = $this->db->last_insert_id($this->tableName);
@@ -57,16 +57,16 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * @return int|string|null
59 59
      */
60
-    private function escape($value){
61
-        if(is_null($value)){
60
+    private function escape($value) {
61
+        if (is_null($value)) {
62 62
             return 'NULL';
63 63
         }
64 64
 
65
-        if(is_bool($value)){
66
-            return (int)$value;
65
+        if (is_bool($value)) {
66
+            return (int) $value;
67 67
         }
68 68
 
69
-        return is_string($value) ? "'".$this->db->escape($value)."'" : $value ;
69
+        return is_string($value) ? "'" . $this->db->escape($value) . "'" : $value;
70 70
     }
71 71
 
72 72
     /**
@@ -79,18 +79,18 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $sqlModifications = [];
81 81
 
82
-        foreach($elements as $field => $value){
82
+        foreach ($elements as $field => $value) {
83 83
             $sqlModifications[] = sprintf('%s=%s', $field, $this->escape($value));
84 84
         }
85 85
 
86 86
         $this->db->begin();
87
-        $resql = $this->db->query(sprintf('UPDATE %s SET %s WHERE '.$idCol.' = %s ', $this->tableName, join(',',$sqlModifications), $id));
87
+        $resql = $this->db->query(sprintf('UPDATE %s SET %s WHERE ' . $idCol . ' = %s ', $this->tableName, join(',', $sqlModifications), $id));
88 88
 
89 89
         if (!$resql) {
90 90
             $lasterror = $this->db->lasterror();
91 91
             dol_syslog(__METHOD__ . ' ' . $lasterror, LOG_ERR);
92 92
             $this->db->rollback();
93
-            throw new \Exception("Repository error - ".$lasterror);
93
+            throw new \Exception("Repository error - " . $lasterror);
94 94
         }
95 95
 
96 96
         $this->db->commit();
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
      *
105 105
      * @return array|null
106 106
      */
107
-    protected function get($id, $idCol = 'rowid'){
108
-        $sql = sprintf('SELECT * FROM %s WHERE '.$idCol.' = %s', $this->tableName, $id );
107
+    protected function get($id, $idCol = 'rowid') {
108
+        $sql = sprintf('SELECT * FROM %s WHERE ' . $idCol . ' = %s', $this->tableName, $id);
109 109
 
110 110
         $resql = $this->db->query($sql);
111 111
         if (!$resql) {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             return null;
118 118
         }
119 119
 
120
-        for($i = 0; $i < $num ; $i++) {
120
+        for ($i = 0; $i < $num; $i++) {
121 121
             return $this->db->fetch_array($resql);
122 122
         }
123 123
 
Please login to merge, or discard this patch.