Completed
Push — master ( da5e92...3bfafa )
by Laurent
02:26
created
list.php 2 patches
Spacing   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 $search_fk_type = GETPOST('search_fk_type', 'int');
51 51
 $search_fk_pilot = GETPOST('search_fk_pilot', 'int') ?: ($user->admin ? '' : $user->id);
52 52
 $search_fk_organisateur = GETPOST('search_fk_organisateur', 'int');
53
-$search_is_facture = GETPOST('search_is_facture', 'int') === ''? -1 : (int)GETPOST('search_is_facture', 'int');
54
-if($search_is_facture === 0){
53
+$search_is_facture = GETPOST('search_is_facture', 'int') === '' ? -1 : (int) GETPOST('search_is_facture', 'int');
54
+if ($search_is_facture === 0) {
55 55
     $search_is_facture = '<=0';
56 56
 }
57 57
 $search_kilometers = GETPOST('search_kilometers', 'alpha');
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 $parameters = array();
183 183
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object,
184
-    $action);    // Note that $action and $object may have been modified by some hooks
184
+    $action); // Note that $action and $object may have been modified by some hooks
185 185
 if ($reshook < 0) {
186 186
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
187 187
 }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 // Add fields from hooks
279 279
 $parameters = array();
280 280
 $reshook = $hookmanager->executeHooks('printFieldListSelect',
281
-    $parameters);    // Note that $action and $object may have been modified by hook
281
+    $parameters); // Note that $action and $object may have been modified by hook
282 282
 $sql .= $hookmanager->resPrint;
283 283
 $sql .= " FROM " . MAIN_DB_PREFIX . "bbc_vols as t";
284 284
 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) {
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 
293 293
 $sql .= " WHERE 1 = 1";
294 294
 
295
-if($search_all){
296
-    $sql .= natural_search(["idBBC_vols",  "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all);
295
+if ($search_all) {
296
+    $sql .= natural_search(["idBBC_vols", "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all);
297 297
 }
298 298
 
299 299
 if ($search_idBBC_vols) {
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 }
338 338
 
339 339
 if ($search_is_facture != -1) {
340
-    $sql .= natural_search("is_facture", $search_is_facture,1);
340
+    $sql .= natural_search("is_facture", $search_is_facture, 1);
341 341
 }
342 342
 if ($search_kilometers) {
343 343
     $sql .= natural_search("kilometers", $search_kilometers, 1);
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 // Add where from hooks
373 373
 $parameters = array();
374 374
 $reshook = $hookmanager->executeHooks('printFieldListWhere',
375
-    $parameters);    // Note that $action and $object may have been modified by hook
375
+    $parameters); // Note that $action and $object may have been modified by hook
376 376
 $sql .= $hookmanager->resPrint;
377 377
 $sql .= $db->order($sortfield, $sortorder);
378 378
 //$sql.= $db->plimit($conf->liste_limit+1, $offset);
@@ -414,58 +414,58 @@  discard block
 block discarded – undo
414 414
 if ($limit > 0 && $limit != $conf->liste_limit) {
415 415
     $param .= '&limit=' . $limit;
416 416
 }
417
-if ($search_idBBC_vols  != '') {
417
+if ($search_idBBC_vols != '') {
418 418
     $param .= '&amp;search_idBBC_vols=' . urlencode($search_idBBC_vols);
419 419
 }
420
-if ($search_date  != '') {
420
+if ($search_date != '') {
421 421
     $param .= '&amp;search_date=' . urlencode($search_date);
422 422
 }
423
-if ($search_lieuD  != '') {
423
+if ($search_lieuD != '') {
424 424
     $param .= '&amp;search_lieuD=' . urlencode($search_lieuD);
425 425
 }
426
-if ($search_lieuA  != '') {
426
+if ($search_lieuA != '') {
427 427
     $param .= '&amp;search_lieuA=' . urlencode($search_lieuA);
428 428
 }
429
-if ($search_heureD  != '') {
429
+if ($search_heureD != '') {
430 430
     $param .= '&amp;search_heureD=' . urlencode($search_heureD);
431 431
 }
432
-if ($search_heureA  != '') {
432
+if ($search_heureA != '') {
433 433
     $param .= '&amp;search_heureA=' . urlencode($search_heureA);
434 434
 }
435
-if ($search_BBC_ballons_idBBC_ballons  != '') {
435
+if ($search_BBC_ballons_idBBC_ballons != '') {
436 436
     $param .= '&amp;search_BBC_ballons_idBBC_ballons=' . urlencode($search_BBC_ballons_idBBC_ballons);
437 437
 }
438
-if ($search_nbrPax  != '') {
438
+if ($search_nbrPax != '') {
439 439
     $param .= '&amp;search_nbrPax=' . urlencode($search_nbrPax);
440 440
 }
441
-if ($search_remarque  != '') {
441
+if ($search_remarque != '') {
442 442
     $param .= '&amp;search_remarque=' . urlencode($search_remarque);
443 443
 }
444
-if ($search_incidents  != '') {
444
+if ($search_incidents != '') {
445 445
     $param .= '&amp;search_incidents=' . urlencode($search_incidents);
446 446
 }
447
-if ($search_fk_type  != '') {
447
+if ($search_fk_type != '') {
448 448
     $param .= '&amp;search_fk_type=' . urlencode($search_fk_type);
449 449
 }
450 450
 if ($search_fk_pilot != '') {
451 451
     $param .= '&amp;search_fk_pilot=' . urlencode($search_fk_pilot);
452 452
 }
453
-if ($search_fk_organisateur  != '') {
453
+if ($search_fk_organisateur != '') {
454 454
     $param .= '&amp;search_fk_organisateur=' . urlencode($search_fk_organisateur);
455 455
 }
456
-if ($search_is_facture  != -1) {
456
+if ($search_is_facture != -1) {
457 457
     $param .= '&amp;search_is_facture=' . urlencode($search_is_facture);
458 458
 }
459
-if ($search_kilometers  != '') {
459
+if ($search_kilometers != '') {
460 460
     $param .= '&amp;search_kilometers=' . urlencode($search_kilometers);
461 461
 }
462
-if ($search_cost  != '') {
462
+if ($search_cost != '') {
463 463
     $param .= '&amp;search_cost=' . urlencode($search_cost);
464 464
 }
465
-if ($search_fk_receiver  != '') {
465
+if ($search_fk_receiver != '') {
466 466
     $param .= '&amp;search_fk_receiver=' . urlencode($search_fk_receiver);
467 467
 }
468
-if ($search_justif_kilometers  != '') {
468
+if ($search_justif_kilometers != '') {
469 469
     $param .= '&amp;search_justif_kilometers=' . urlencode($search_justif_kilometers);
470 470
 }
471 471
 if ($search_all != '') {
@@ -509,8 +509,8 @@  discard block
 block discarded – undo
509 509
 
510 510
 
511 511
 $moreHtml = "";
512
-if($search_all !== ""){
513
-    $moreHtml = "<p>".$langs->trans(sprintf("La liste est en recherche globale sur : l'identifiant du vol, le nom du pilote, l'immat du ballon, le lieu de Décollage et le lieu d'atterissage : %s", $search_all))."</p>";
512
+if ($search_all !== "") {
513
+    $moreHtml = "<p>" . $langs->trans(sprintf("La liste est en recherche globale sur : l'identifiant du vol, le nom du pilote, l'immat du ballon, le lieu de Décollage et le lieu d'atterissage : %s", $search_all)) . "</p>";
514 514
 }
515 515
 
516 516
 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 
531 531
 $parameters = array();
532 532
 $reshook = $hookmanager->executeHooks('printFieldPreListTitle',
533
-    $parameters);    // Note that $action and $object may have been modified by hook
533
+    $parameters); // Note that $action and $object may have been modified by hook
534 534
 if (empty($reshook)) {
535 535
     $moreforfilter .= $hookmanager->resPrint;
536 536
 } else {
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 
546 546
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
547 547
 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields,
548
-    $varpage);    // This also change content of $arrayfields
548
+    $varpage); // This also change content of $arrayfields
549 549
 
550 550
 print '<div class="div-table-responsive">';
551 551
 print '<table class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 // Hook fields
642 642
 $parameters = array('arrayfields' => $arrayfields);
643 643
 $reshook = $hookmanager->executeHooks('printFieldListTitle',
644
-    $parameters);    // Note that $action and $object may have been modified by hook
644
+    $parameters); // Note that $action and $object may have been modified by hook
645 645
 print $hookmanager->resPrint;
646 646
 if (!empty($arrayfields['t.datec']['checked'])) {
647 647
     print_liste_field_titre($arrayfields['t.datec']['label'], $_SERVER["PHP_SELF"], "t.datec", "", $param,
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 
711 711
 if (!empty($arrayfields['t.is_facture']['checked'])) {
712 712
     print '<td class="liste_titre">';
713
-    print '<select name="search_is_facture"><option value="-1" '.($search_is_facture != 1 && $search_is_facture != 0 && $search_is_facture != '<=0'? 'selected' : '' ).'></option><option value="1" '.($search_is_facture == 1 ? 'selected' : '' ).'>Facturé</option><option value="0" '.($search_is_facture == 0 || $search_is_facture == '<=0' ? 'selected' : '' ).'>Ouvert</option></select>';
713
+    print '<select name="search_is_facture"><option value="-1" ' . ($search_is_facture != 1 && $search_is_facture != 0 && $search_is_facture != '<=0' ? 'selected' : '') . '></option><option value="1" ' . ($search_is_facture == 1 ? 'selected' : '') . '>Facturé</option><option value="0" ' . ($search_is_facture == 0 || $search_is_facture == '<=0' ? 'selected' : '') . '>Ouvert</option></select>';
714 714
     print '</td>';
715 715
 }
716 716
 
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
 // Fields from hook
756 756
 $parameters = array('arrayfields' => $arrayfields);
757 757
 $reshook = $hookmanager->executeHooks('printFieldListOption',
758
-    $parameters);    // Note that $action and $object may have been modified by hook
758
+    $parameters); // Note that $action and $object may have been modified by hook
759 759
 print $hookmanager->resPrint;
760 760
 if (!empty($arrayfields['t.datec']['checked'])) {
761 761
     // Date creation
@@ -797,124 +797,124 @@  discard block
 block discarded – undo
797 797
         // Show here line of result
798 798
         print '<tr ' . $bc[$var] . '>';
799 799
 
800
-        if (! empty($arrayfields['t.idBBC_vols']['checked']))
800
+        if (!empty($arrayfields['t.idBBC_vols']['checked']))
801 801
         {
802
-            print '<td>'.$flight->getNomUrl(0).'</td>';
802
+            print '<td>' . $flight->getNomUrl(0) . '</td>';
803 803
 
804
-            if (! $i) $totalarray['nbfield']++;
804
+            if (!$i) $totalarray['nbfield']++;
805 805
         }
806
-        if (! empty($arrayfields['t.date']['checked']))
806
+        if (!empty($arrayfields['t.date']['checked']))
807 807
         {
808 808
             print '<td>';
809 809
                 print dol_print_date($db->jdate($obj->date), '%d-%m-%y');
810 810
             print '</td>';
811 811
 
812
-            if (! $i) $totalarray['nbfield']++;
812
+            if (!$i) $totalarray['nbfield']++;
813 813
         }
814
-        if (! empty($arrayfields['t.lieuD']['checked']))
814
+        if (!empty($arrayfields['t.lieuD']['checked']))
815 815
         {
816
-            print '<td>'.$obj->lieuD.'</td>';
816
+            print '<td>' . $obj->lieuD . '</td>';
817 817
 
818
-            if (! $i) $totalarray['nbfield']++;
818
+            if (!$i) $totalarray['nbfield']++;
819 819
         }
820
-        if (! empty($arrayfields['t.lieuA']['checked']))
820
+        if (!empty($arrayfields['t.lieuA']['checked']))
821 821
         {
822
-            print '<td>'.$obj->lieuA.'</td>';
822
+            print '<td>' . $obj->lieuA . '</td>';
823 823
 
824
-            if (! $i) $totalarray['nbfield']++;
824
+            if (!$i) $totalarray['nbfield']++;
825 825
         }
826
-        if (! empty($arrayfields['t.heureD']['checked']))
826
+        if (!empty($arrayfields['t.heureD']['checked']))
827 827
         {
828
-            print '<td>'.$obj->heureD.'</td>';
828
+            print '<td>' . $obj->heureD . '</td>';
829 829
 
830
-            if (! $i) $totalarray['nbfield']++;
830
+            if (!$i) $totalarray['nbfield']++;
831 831
         }
832
-        if (! empty($arrayfields['t.heureA']['checked']))
832
+        if (!empty($arrayfields['t.heureA']['checked']))
833 833
         {
834
-            print '<td>'.$obj->heureA.'</td>';
834
+            print '<td>' . $obj->heureA . '</td>';
835 835
 
836
-            if (! $i) $totalarray['nbfield']++;
836
+            if (!$i) $totalarray['nbfield']++;
837 837
         }
838
-        if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked']))
838
+        if (!empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked']))
839 839
         {
840
-            print '<td>'.$obj->bal.'</td>';
840
+            print '<td>' . $obj->bal . '</td>';
841 841
 
842
-            if (! $i) $totalarray['nbfield']++;
842
+            if (!$i) $totalarray['nbfield']++;
843 843
         }
844
-        if (! empty($arrayfields['t.nbrPax']['checked']))
844
+        if (!empty($arrayfields['t.nbrPax']['checked']))
845 845
         {
846
-            print '<td>'.$obj->nbrPax.'</td>';
846
+            print '<td>' . $obj->nbrPax . '</td>';
847 847
 
848
-            if (! $i) $totalarray['nbfield']++;
848
+            if (!$i) $totalarray['nbfield']++;
849 849
         }
850
-        if (! empty($arrayfields['t.remarque']['checked']))
850
+        if (!empty($arrayfields['t.remarque']['checked']))
851 851
         {
852
-            print '<td>'.$obj->remarque.'</td>';
852
+            print '<td>' . $obj->remarque . '</td>';
853 853
 
854
-            if (! $i) $totalarray['nbfield']++;
854
+            if (!$i) $totalarray['nbfield']++;
855 855
         }
856
-        if (! empty($arrayfields['t.incidents']['checked']))
856
+        if (!empty($arrayfields['t.incidents']['checked']))
857 857
         {
858
-            print '<td>'.$obj->incidents.'</td>';
858
+            print '<td>' . $obj->incidents . '</td>';
859 859
 
860
-            if (! $i) $totalarray['nbfield']++;
860
+            if (!$i) $totalarray['nbfield']++;
861 861
         }
862
-        if (! empty($arrayfields['t.fk_type']['checked']))
862
+        if (!empty($arrayfields['t.fk_type']['checked']))
863 863
         {
864
-            print '<td>'.$obj->flight_type.'</td>';
864
+            print '<td>' . $obj->flight_type . '</td>';
865 865
 
866
-            if (! $i) $totalarray['nbfield']++;
866
+            if (!$i) $totalarray['nbfield']++;
867 867
         }
868
-        if (! empty($arrayfields['t.fk_pilot']['checked']))
868
+        if (!empty($arrayfields['t.fk_pilot']['checked']))
869 869
         {
870
-            print '<td>'.$obj->pilot.'</td>';
870
+            print '<td>' . $obj->pilot . '</td>';
871 871
 
872
-            if (! $i) $totalarray['nbfield']++;
872
+            if (!$i) $totalarray['nbfield']++;
873 873
         }
874
-        if (! empty($arrayfields['t.fk_organisateur']['checked']))
874
+        if (!empty($arrayfields['t.fk_organisateur']['checked']))
875 875
         {
876
-            print '<td>'.$obj->organisator.'</td>';
876
+            print '<td>' . $obj->organisator . '</td>';
877 877
 
878
-            if (! $i) $totalarray['nbfield']++;
878
+            if (!$i) $totalarray['nbfield']++;
879 879
         }
880
-        if (! empty($arrayfields['t.is_facture']['checked']))
880
+        if (!empty($arrayfields['t.is_facture']['checked']))
881 881
         {
882 882
             $flight->is_facture = $obj->is_facture;
883
-            print '<td>'.$flight->getLibStatut(3).'</td>';
883
+            print '<td>' . $flight->getLibStatut(3) . '</td>';
884 884
 
885
-            if (! $i) $totalarray['nbfield']++;
885
+            if (!$i) $totalarray['nbfield']++;
886 886
         }
887
-        if (! empty($arrayfields['t.kilometers']['checked']))
887
+        if (!empty($arrayfields['t.kilometers']['checked']))
888 888
         {
889
-            if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){
890
-                print '<td>'.$obj->kilometers.' KM</td>';
891
-            }else{
889
+            if ($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) {
890
+                print '<td>' . $obj->kilometers . ' KM</td>';
891
+            } else {
892 892
                 print '<td> - Km</td>';
893 893
             }
894 894
 
895
-            if (! $i) $totalarray['nbfield']++;
895
+            if (!$i) $totalarray['nbfield']++;
896 896
         }
897
-        if (! empty($arrayfields['t.cost']['checked']))
897
+        if (!empty($arrayfields['t.cost']['checked']))
898 898
         {
899
-            if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){
900
-                print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$obj->nbrPax, 0, $langs, -1, -1, -1, $conf->currency));
901
-            }else{
899
+            if (($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0) {
900
+                print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost / $obj->nbrPax, 0, $langs, -1, -1, -1, $conf->currency));
901
+            } else {
902 902
                 print '<td> - €</td>';
903 903
             }
904 904
 
905
-            if (! $i) $totalarray['nbfield']++;
905
+            if (!$i) $totalarray['nbfield']++;
906 906
         }
907
-        if (! empty($arrayfields['t.fk_receiver']['checked']))
907
+        if (!empty($arrayfields['t.fk_receiver']['checked']))
908 908
         {
909
-            print '<td>'.$obj->receiver.'</td>';
909
+            print '<td>' . $obj->receiver . '</td>';
910 910
 
911
-            if (! $i) $totalarray['nbfield']++;
911
+            if (!$i) $totalarray['nbfield']++;
912 912
         }
913
-        if (! empty($arrayfields['t.justif_kilometers']['checked']))
913
+        if (!empty($arrayfields['t.justif_kilometers']['checked']))
914 914
         {
915
-            print '<td>'.$obj->justif_kilometers.'</td>';
915
+            print '<td>' . $obj->justif_kilometers . '</td>';
916 916
 
917
-            if (! $i) $totalarray['nbfield']++;
917
+            if (!$i) $totalarray['nbfield']++;
918 918
         }
919 919
 
920 920
         // Extra fields
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
         // Fields from hook
940 940
         $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj);
941 941
         $reshook = $hookmanager->executeHooks('printFieldListValue',
942
-            $parameters);    // Note that $action and $object may have been modified by hook
942
+            $parameters); // Note that $action and $object may have been modified by hook
943 943
         print $hookmanager->resPrint;
944 944
         // Date creation
945 945
         if (!empty($arrayfields['t.datec']['checked'])) {
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 
1010 1010
 $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
1011 1011
 $reshook = $hookmanager->executeHooks('printFieldListFooter',
1012
-    $parameters);    // Note that $action and $object may have been modified by hook
1012
+    $parameters); // Note that $action and $object may have been modified by hook
1013 1013
 print $hookmanager->resPrint;
1014 1014
 
1015 1015
 print '</table>' . "\n";
Please login to merge, or discard this patch.
Braces   +62 added lines, -22 removed lines patch added patch discarded remove patch
@@ -191,10 +191,12 @@  discard block
 block discarded – undo
191 191
     include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
192 192
 
193 193
     // Purge search criteria
194
-    if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
194
+    if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) {
195
+        // All tests are required to be compatible with all browsers
195 196
     {
196 197
 
197 198
         $search_idBBC_vols = '';
199
+    }
198 200
         $search_date = '';
199 201
         $search_lieuD = '';
200 202
         $search_lieuA = '';
@@ -801,7 +803,9 @@  discard block
 block discarded – undo
801 803
         {
802 804
             print '<td>'.$flight->getNomUrl(0).'</td>';
803 805
 
804
-            if (! $i) $totalarray['nbfield']++;
806
+            if (! $i) {
807
+                $totalarray['nbfield']++;
808
+            }
805 809
         }
806 810
         if (! empty($arrayfields['t.date']['checked']))
807 811
         {
@@ -809,112 +813,146 @@  discard block
 block discarded – undo
809 813
                 print dol_print_date($db->jdate($obj->date), '%d-%m-%y');
810 814
             print '</td>';
811 815
 
812
-            if (! $i) $totalarray['nbfield']++;
816
+            if (! $i) {
817
+                $totalarray['nbfield']++;
818
+            }
813 819
         }
814 820
         if (! empty($arrayfields['t.lieuD']['checked']))
815 821
         {
816 822
             print '<td>'.$obj->lieuD.'</td>';
817 823
 
818
-            if (! $i) $totalarray['nbfield']++;
824
+            if (! $i) {
825
+                $totalarray['nbfield']++;
826
+            }
819 827
         }
820 828
         if (! empty($arrayfields['t.lieuA']['checked']))
821 829
         {
822 830
             print '<td>'.$obj->lieuA.'</td>';
823 831
 
824
-            if (! $i) $totalarray['nbfield']++;
832
+            if (! $i) {
833
+                $totalarray['nbfield']++;
834
+            }
825 835
         }
826 836
         if (! empty($arrayfields['t.heureD']['checked']))
827 837
         {
828 838
             print '<td>'.$obj->heureD.'</td>';
829 839
 
830
-            if (! $i) $totalarray['nbfield']++;
840
+            if (! $i) {
841
+                $totalarray['nbfield']++;
842
+            }
831 843
         }
832 844
         if (! empty($arrayfields['t.heureA']['checked']))
833 845
         {
834 846
             print '<td>'.$obj->heureA.'</td>';
835 847
 
836
-            if (! $i) $totalarray['nbfield']++;
848
+            if (! $i) {
849
+                $totalarray['nbfield']++;
850
+            }
837 851
         }
838 852
         if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked']))
839 853
         {
840 854
             print '<td>'.$obj->bal.'</td>';
841 855
 
842
-            if (! $i) $totalarray['nbfield']++;
856
+            if (! $i) {
857
+                $totalarray['nbfield']++;
858
+            }
843 859
         }
844 860
         if (! empty($arrayfields['t.nbrPax']['checked']))
845 861
         {
846 862
             print '<td>'.$obj->nbrPax.'</td>';
847 863
 
848
-            if (! $i) $totalarray['nbfield']++;
864
+            if (! $i) {
865
+                $totalarray['nbfield']++;
866
+            }
849 867
         }
850 868
         if (! empty($arrayfields['t.remarque']['checked']))
851 869
         {
852 870
             print '<td>'.$obj->remarque.'</td>';
853 871
 
854
-            if (! $i) $totalarray['nbfield']++;
872
+            if (! $i) {
873
+                $totalarray['nbfield']++;
874
+            }
855 875
         }
856 876
         if (! empty($arrayfields['t.incidents']['checked']))
857 877
         {
858 878
             print '<td>'.$obj->incidents.'</td>';
859 879
 
860
-            if (! $i) $totalarray['nbfield']++;
880
+            if (! $i) {
881
+                $totalarray['nbfield']++;
882
+            }
861 883
         }
862 884
         if (! empty($arrayfields['t.fk_type']['checked']))
863 885
         {
864 886
             print '<td>'.$obj->flight_type.'</td>';
865 887
 
866
-            if (! $i) $totalarray['nbfield']++;
888
+            if (! $i) {
889
+                $totalarray['nbfield']++;
890
+            }
867 891
         }
868 892
         if (! empty($arrayfields['t.fk_pilot']['checked']))
869 893
         {
870 894
             print '<td>'.$obj->pilot.'</td>';
871 895
 
872
-            if (! $i) $totalarray['nbfield']++;
896
+            if (! $i) {
897
+                $totalarray['nbfield']++;
898
+            }
873 899
         }
874 900
         if (! empty($arrayfields['t.fk_organisateur']['checked']))
875 901
         {
876 902
             print '<td>'.$obj->organisator.'</td>';
877 903
 
878
-            if (! $i) $totalarray['nbfield']++;
904
+            if (! $i) {
905
+                $totalarray['nbfield']++;
906
+            }
879 907
         }
880 908
         if (! empty($arrayfields['t.is_facture']['checked']))
881 909
         {
882 910
             $flight->is_facture = $obj->is_facture;
883 911
             print '<td>'.$flight->getLibStatut(3).'</td>';
884 912
 
885
-            if (! $i) $totalarray['nbfield']++;
913
+            if (! $i) {
914
+                $totalarray['nbfield']++;
915
+            }
886 916
         }
887 917
         if (! empty($arrayfields['t.kilometers']['checked']))
888 918
         {
889 919
             if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){
890 920
                 print '<td>'.$obj->kilometers.' KM</td>';
891
-            }else{
921
+            } else{
892 922
                 print '<td> - Km</td>';
893 923
             }
894 924
 
895
-            if (! $i) $totalarray['nbfield']++;
925
+            if (! $i) {
926
+                $totalarray['nbfield']++;
927
+            }
896 928
         }
897 929
         if (! empty($arrayfields['t.cost']['checked']))
898 930
         {
899 931
             if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){
900 932
                 print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$obj->nbrPax, 0, $langs, -1, -1, -1, $conf->currency));
901
-            }else{
933
+            } else{
902 934
                 print '<td> - €</td>';
903 935
             }
904 936
 
905
-            if (! $i) $totalarray['nbfield']++;
937
+            if (! $i) {
938
+                $totalarray['nbfield']++;
939
+            }
906 940
         }
907 941
         if (! empty($arrayfields['t.fk_receiver']['checked']))
908 942
         {
909 943
             print '<td>'.$obj->receiver.'</td>';
910 944
 
911
-            if (! $i) $totalarray['nbfield']++;
945
+            if (! $i) {
946
+                $totalarray['nbfield']++;
947
+            }
912 948
         }
913 949
         if (! empty($arrayfields['t.justif_kilometers']['checked']))
914 950
         {
915 951
             print '<td>'.$obj->justif_kilometers.'</td>';
916 952
 
917
-            if (! $i) $totalarray['nbfield']++;
953
+            if (! $i) {
954
+                $totalarray['nbfield']++;
955
+            }
918 956
         }
919 957
 
920 958
         // Extra fields
@@ -962,9 +1000,11 @@  discard block
 block discarded – undo
962 1000
 
963 1001
         // Action column
964 1002
         print '<td class="nowrap" align="center">';
965
-        if ($massactionbutton || $massaction)   // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1003
+        if ($massactionbutton || $massaction) {
1004
+            // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
966 1005
         {
967 1006
             $selected = 0;
1007
+        }
968 1008
             if (in_array($obj->idBBC_vols, $arrayofselected)) {
969 1009
                 $selected = 1;
970 1010
             }
Please login to merge, or discard this patch.
card.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 $isAllowedEdit = ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id));
71 71
 $isAllowedDelete = ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->is_facture));
72
-$permissiondellink=$user->rights->flightlog->vol->financial;
72
+$permissiondellink = $user->rights->flightlog->vol->financial;
73 73
 
74 74
 $search_idBBC_vols = GETPOST('search_idBBC_vols', 'int');
75 75
 $search_lieuD = GETPOST('search_lieuD', 'alpha');
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
117 117
 
118 118
 // Load object
119
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
120
-include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
119
+include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
120
+include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
121 121
 
122 122
 // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
123 123
 $hookmanager->initHooks(array('bbcvols'));
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
 $parameters = array();
144 144
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object,
145
-    $action);    // Note that $action and $object may have been modified by some hooks
145
+    $action); // Note that $action and $object may have been modified by some hooks
146 146
 if ($reshook < 0) {
147 147
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
148 148
 }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
     print '<div class="tabsAction">' . "\n";
377 377
     $parameters = array();
378 378
     $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object,
379
-        $action);    // Note that $action and $object may have been modified by hook
379
+        $action); // Note that $action and $object may have been modified by hook
380 380
     if ($reshook < 0) {
381 381
         setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
382 382
     }
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
         print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=delete">' . $langs->trans('Delete') . '</a></div>' . "\n";
390 390
     }
391 391
 
392
-    if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){
393
-        print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id.'">' . $langs->trans("Facturer") . '</a></div>' . "\n";
392
+    if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) {
393
+        print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id . '">' . $langs->trans("Facturer") . '</a></div>' . "\n";
394 394
     }
395 395
     ?>
396 396
 
397
-    <?php if($user->rights->flightlog->vol->financial && !$object->isBilled() ): ?>
397
+    <?php if ($user->rights->flightlog->vol->financial && !$object->isBilled()): ?>
398 398
         <div class="inline-block divButAction">
399
-               <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s' , $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED);?>">
399
+               <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED); ?>">
400 400
                    <?php echo $langs->trans("Marqué comme facturé ") ?>
401 401
                </a>
402 402
         </div>
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
     </div>
406 406
 <?php
407
-    if($user->rights->flightlog->vol->financial){
407
+    if ($user->rights->flightlog->vol->financial) {
408 408
         print '<div class="fichecenter"><div class="fichehalfleft">';
409 409
         $form->showLinkedObjectBlock($object);
410 410
         print '</div></div>';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'),
348 348
             $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1);
349 349
         print $formconfirm;
350
-    }elseif ($user->rights->flightlog->vol->financial && !$object->isBilled() && $action == ACTION_FLAG_BILLED) {
350
+    } elseif ($user->rights->flightlog->vol->financial && !$object->isBilled() && $action == ACTION_FLAG_BILLED) {
351 351
         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Marque comme facturé'),
352 352
             $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '', 0, 1);
353 353
         print $formconfirm;
Please login to merge, or discard this patch.