Completed
Push — feature/damages ( 8f70f7...06d026 )
by Laurent
31s
created
generateBilling.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -613,9 +613,12 @@
 block discarded – undo
613 613
 
614 614
         <?php if ($year >= $currentYear || !$t1->service || !$t2->service || !$t3->service || !$t4->service || !$t5->service || !$t6->service || !$t7->service) : ?>
615 615
             <a class="butActionRefused" href="#">Générer</a>
616
-        <?php else: ?>
616
+        <?php else {
617
+    : ?>
617 618
             <button class="butAction" type="submit">Générer</button>
618
-        <?php endif; ?>
619
+        <?php endif;
620
+}
621
+?>
619 622
 
620 623
     </form>
621 624
 
Please login to merge, or discard this patch.
core/modules/modFlightLog.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -341,7 +341,7 @@
 block discarded – undo
341 341
      */
342 342
     private function initPermissions()
343 343
     {
344
-        $this->rights = array();        // Permission array used by this module
344
+        $this->rights = array(); // Permission array used by this module
345 345
         $r = 0;
346 346
 
347 347
         $this->rights[$r][0] = 9993;
Please login to merge, or discard this patch.
admin/vol.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
  * Actions
26 26
  */
27 27
 // Save
28
-if($action === ACTION_SAVE){
29
-    foreach($services as $flightTypeId => $serviceId){
28
+if ($action === ACTION_SAVE) {
29
+    foreach ($services as $flightTypeId => $serviceId) {
30 30
         $res = $flightType->fetch($flightTypeId);
31
-        if($res > 0 ){
31
+        if ($res > 0) {
32 32
             $flightType->fkService = $serviceId;
33 33
             $flightType->update($user);
34 34
         }
35 35
 
36
-        dolibarr_set_const($db, 'BBC_POINTS_BONUS_'.$flightTypeId, GETPOST('points_bonus_'.$flightTypeId), 'chaine', 0, 'Points pour le vol T'.$flightTypeId, $conf->entity);
36
+        dolibarr_set_const($db, 'BBC_POINTS_BONUS_' . $flightTypeId, GETPOST('points_bonus_' . $flightTypeId), 'chaine', 0, 'Points pour le vol T' . $flightTypeId, $conf->entity);
37 37
     }
38 38
 
39 39
     dolibarr_set_const($db, 'BBC_FLIGHT_TYPE_CUSTOMER', GETPOST('customer_product'), 'chaine', 0, '', $conf->entity);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 <tr class="<?= $flightTypeLine->id % 2 == 0 ? "pair" : "impair" ?>">
72 72
                     <td>(T<?= $flightTypeLine->numero ?>) - <?= $flightTypeLine->nom ?></td>
73 73
                     <td>
74
-                        <?php $form->select_produits($flightTypeLine->fkService, 'idprod['.$flightTypeLine->id.']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?>
74
+                        <?php $form->select_produits($flightTypeLine->fkService, 'idprod[' . $flightTypeLine->id . ']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?>
75 75
                     </td>
76 76
                 </tr>
77 77
             <?php endforeach; ?>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                 </td>
84 84
                 <td>
85 85
                     <?php $form->select_produits($conf->global->BBC_FLIGHT_TYPE_CUSTOMER, 'customer_product',
86
-                        $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?>
86
+                        $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?>
87 87
                 </td>
88 88
             </tr>
89 89
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                     <label for="points_bonus_<?php echo $flightTypeLine->numero; ?>">
107 107
                         (T<?php echo $flightTypeLine->numero ?>) - <?php echo $flightTypeLine->nom ?>
108 108
                     </label>
109
-                    <?php $prop = 'BBC_POINTS_BONUS_'.$flightTypeLine->numero; ?>
109
+                    <?php $prop = 'BBC_POINTS_BONUS_' . $flightTypeLine->numero; ?>
110 110
                     <input type="number" id="points_bonus_<?php echo $flightTypeLine->numero; ?>" name="points_bonus_<?php echo $flightTypeLine->numero; ?>" value="<?php echo $conf->global->$prop?>" />
111 111
                     <br/>
112 112
                 <?php endforeach; ?>
Please login to merge, or discard this patch.
command/CreateFlightBillCommandHandlerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__.'/CreateFlightBillCommandHandler.php';
4
-require_once __DIR__.'/CreateFlightBillTransactionalCommandHandler.php';
3
+require_once __DIR__ . '/CreateFlightBillCommandHandler.php';
4
+require_once __DIR__ . '/CreateFlightBillTransactionalCommandHandler.php';
5 5
 
6 6
 /**
7 7
  * @author Laurent De Coninck <[email protected]>
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @return CreateFlightBillCommandHandler
13 13
      */
14
-    public static function factory($db, $conf, $user, $langs){
14
+    public static function factory($db, $conf, $user, $langs) {
15 15
         return new CreateFlightBillTransactionalCommandHandler($db, $conf, $user, $langs);
16 16
     }
17 17
 
Please login to merge, or discard this patch.
generateMonthlyBilling.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -239,9 +239,12 @@
 block discarded – undo
239 239
                     <?php echo $langs->trans('La periode demandée n\'est pas cloturée.') ?>
240 240
                 </p>
241 241
                 <a class="butActionRefused" href="#">Générer</a>
242
-            <?php else: ?>
242
+            <?php else {
243
+    : ?>
243 244
                 <button class="butAction" type="submit">Générer</button>
244
-            <?php endif; ?>
245
+            <?php endif;
246
+}
247
+?>
245 248
 
246 249
         </form>
247 250
     </section>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
96 96
     try {
97 97
 
98
-        $command = new CreateMonthBillCommand( $type, $publicNote, $privateNote, $year, $month);
98
+        $command = new CreateMonthBillCommand($type, $publicNote, $privateNote, $year, $month);
99 99
         $handler->handle($command);
100 100
         dol_htmloutput_mesg('Génération : OK');
101 101
     } catch (Exception $e) {
Please login to merge, or discard this patch.
core/cron/BbcMonthlyFlightsBillCron.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 
54 54
         try {
55 55
 
56
-            if(date('d')>=15){
56
+            if (date('d') >= 15) {
57 57
                 dol_syslog('Monthly bill generation : date over');
58 58
                 return -2;
59 59
             }
Please login to merge, or discard this patch.
tabs/project/instructions.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
                                     <?php echo !empty($flight->linkedObjectsIds) && in_array($currentTask->id,
233 233
                                         $flight->linkedObjectsIds[$currentTask->table_element]) ? 'checked' : '' ?>
234 234
                                 />
235
-                            <?php else: ?>
235
+                            <?php else : ?>
236 236
 
237 237
                                 <?php if (!empty($flight->linkedObjectsIds) && in_array($currentTask->id,
238 238
                                         $flight->linkedObjectsIds[$currentTask->table_element])): ?>
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -211,8 +211,11 @@  discard block
 block discarded – undo
211 211
                         <?php if ($userWrite): ?>
212 212
                             <?php echo $formOther->select_percent($currentTask->progress,
213 213
                                 sprintf('progression[%s]', $currentTask->id, false, 10)); ?>
214
-                        <?php else: ?>
215
-                            <span><?php echo $currentTask->progress; ?> %</span>
214
+                        <?php else {
215
+    : ?>
216
+                            <span><?php echo $currentTask->progress;
217
+}
218
+?> %</span>
216 219
                         <?php endif; ?>
217 220
 
218 221
                     </td>
@@ -232,14 +235,17 @@  discard block
 block discarded – undo
232 235
                                     <?php echo !empty($flight->linkedObjectsIds) && in_array($currentTask->id,
233 236
                                         $flight->linkedObjectsIds[$currentTask->table_element]) ? 'checked' : '' ?>
234 237
                                 />
235
-                            <?php else: ?>
238
+                            <?php else {
239
+    : ?>
236 240
 
237 241
                                 <?php if (!empty($flight->linkedObjectsIds) && in_array($currentTask->id,
238 242
                                         $flight->linkedObjectsIds[$currentTask->table_element])): ?>
239 243
                                     <span class="fa fa-check"></span>
240 244
                                 <?php else: ?>
241 245
                                     <span class="fa fa-times"></span>
242
-                                <?php endif; ?>
246
+                                <?php endif;
247
+}
248
+?>
243 249
 
244 250
                             <?php endif; ?>
245 251
 
Please login to merge, or discard this patch.
list.php 2 patches
Braces   +62 added lines, -22 removed lines patch added patch discarded remove patch
@@ -189,10 +189,12 @@  discard block
 block discarded – undo
189 189
     include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
190 190
 
191 191
     // Purge search criteria
192
-    if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
192
+    if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) {
193
+        // All tests are required to be compatible with all browsers
193 194
     {
194 195
 
195 196
         $search_idBBC_vols = '';
197
+    }
196 198
         $search_date = '';
197 199
         $search_lieuD = '';
198 200
         $search_lieuA = '';
@@ -799,7 +801,9 @@  discard block
 block discarded – undo
799 801
         {
800 802
             print '<td>'.$flight->getNomUrl(0).'</td>';
801 803
 
802
-            if (! $i) $totalarray['nbfield']++;
804
+            if (! $i) {
805
+                $totalarray['nbfield']++;
806
+            }
803 807
         }
804 808
         if (! empty($arrayfields['t.date']['checked']))
805 809
         {
@@ -807,113 +811,147 @@  discard block
 block discarded – undo
807 811
                 print dol_print_date($db->jdate($obj->date), '%d-%m-%y');
808 812
             print '</td>';
809 813
 
810
-            if (! $i) $totalarray['nbfield']++;
814
+            if (! $i) {
815
+                $totalarray['nbfield']++;
816
+            }
811 817
         }
812 818
         if (! empty($arrayfields['t.lieuD']['checked']))
813 819
         {
814 820
             print '<td>'.$obj->lieuD.'</td>';
815 821
 
816
-            if (! $i) $totalarray['nbfield']++;
822
+            if (! $i) {
823
+                $totalarray['nbfield']++;
824
+            }
817 825
         }
818 826
         if (! empty($arrayfields['t.lieuA']['checked']))
819 827
         {
820 828
             print '<td>'.$obj->lieuA.'</td>';
821 829
 
822
-            if (! $i) $totalarray['nbfield']++;
830
+            if (! $i) {
831
+                $totalarray['nbfield']++;
832
+            }
823 833
         }
824 834
         if (! empty($arrayfields['t.heureD']['checked']))
825 835
         {
826 836
             print '<td>'.$obj->heureD.'</td>';
827 837
 
828
-            if (! $i) $totalarray['nbfield']++;
838
+            if (! $i) {
839
+                $totalarray['nbfield']++;
840
+            }
829 841
         }
830 842
         if (! empty($arrayfields['t.heureA']['checked']))
831 843
         {
832 844
             print '<td>'.$obj->heureA.'</td>';
833 845
 
834
-            if (! $i) $totalarray['nbfield']++;
846
+            if (! $i) {
847
+                $totalarray['nbfield']++;
848
+            }
835 849
         }
836 850
         if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked']))
837 851
         {
838 852
             print '<td>'.$obj->bal.'</td>';
839 853
 
840
-            if (! $i) $totalarray['nbfield']++;
854
+            if (! $i) {
855
+                $totalarray['nbfield']++;
856
+            }
841 857
         }
842 858
         if (! empty($arrayfields['t.nbrPax']['checked']))
843 859
         {
844 860
             print '<td>'.$obj->nbrPax.'</td>';
845 861
 
846
-            if (! $i) $totalarray['nbfield']++;
862
+            if (! $i) {
863
+                $totalarray['nbfield']++;
864
+            }
847 865
         }
848 866
         if (! empty($arrayfields['t.remarque']['checked']))
849 867
         {
850 868
             print '<td>'.$obj->remarque.'</td>';
851 869
 
852
-            if (! $i) $totalarray['nbfield']++;
870
+            if (! $i) {
871
+                $totalarray['nbfield']++;
872
+            }
853 873
         }
854 874
         if (! empty($arrayfields['t.incidents']['checked']))
855 875
         {
856 876
             print '<td>'.$obj->incidents.'</td>';
857 877
 
858
-            if (! $i) $totalarray['nbfield']++;
878
+            if (! $i) {
879
+                $totalarray['nbfield']++;
880
+            }
859 881
         }
860 882
         if (! empty($arrayfields['t.fk_type']['checked']))
861 883
         {
862 884
             print '<td>'.$obj->flight_type.'</td>';
863 885
 
864
-            if (! $i) $totalarray['nbfield']++;
886
+            if (! $i) {
887
+                $totalarray['nbfield']++;
888
+            }
865 889
         }
866 890
         if (! empty($arrayfields['t.fk_pilot']['checked']))
867 891
         {
868 892
             print '<td>'.$obj->pilot.'</td>';
869 893
 
870
-            if (! $i) $totalarray['nbfield']++;
894
+            if (! $i) {
895
+                $totalarray['nbfield']++;
896
+            }
871 897
         }
872 898
         if (! empty($arrayfields['t.fk_organisateur']['checked']))
873 899
         {
874 900
             print '<td>'.$obj->organisator.'</td>';
875 901
 
876
-            if (! $i) $totalarray['nbfield']++;
902
+            if (! $i) {
903
+                $totalarray['nbfield']++;
904
+            }
877 905
         }
878 906
         if (! empty($arrayfields['t.is_facture']['checked']))
879 907
         {
880 908
             $flight->is_facture = $obj->is_facture;
881 909
             print '<td>'.$flight->getLibStatut(3).'</td>';
882 910
 
883
-            if (! $i) $totalarray['nbfield']++;
911
+            if (! $i) {
912
+                $totalarray['nbfield']++;
913
+            }
884 914
         }
885 915
         if (! empty($arrayfields['t.kilometers']['checked']))
886 916
         {
887 917
             if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){
888 918
                 print '<td>'.$obj->kilometers.' KM</td>';
889
-            }else{
919
+            } else{
890 920
                 print '<td> - Km</td>';
891 921
             }
892 922
 
893
-            if (! $i) $totalarray['nbfield']++;
923
+            if (! $i) {
924
+                $totalarray['nbfield']++;
925
+            }
894 926
         }
895 927
         if (! empty($arrayfields['t.cost']['checked']))
896 928
         {
897 929
             if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){
898 930
                 $nbrPax = $obj->nbrPax > 0 ? $obj->nbrPax : 1;
899 931
                 print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$nbrPax, 0, $langs, -1, -1, -1, $conf->currency));
900
-            }else{
932
+            } else{
901 933
                 print '<td> - €</td>';
902 934
             }
903 935
 
904
-            if (! $i) $totalarray['nbfield']++;
936
+            if (! $i) {
937
+                $totalarray['nbfield']++;
938
+            }
905 939
         }
906 940
         if (! empty($arrayfields['t.fk_receiver']['checked']))
907 941
         {
908 942
             print '<td>'.$obj->receiver.'</td>';
909 943
 
910
-            if (! $i) $totalarray['nbfield']++;
944
+            if (! $i) {
945
+                $totalarray['nbfield']++;
946
+            }
911 947
         }
912 948
         if (! empty($arrayfields['t.justif_kilometers']['checked']))
913 949
         {
914 950
             print '<td>'.$obj->justif_kilometers.'</td>';
915 951
 
916
-            if (! $i) $totalarray['nbfield']++;
952
+            if (! $i) {
953
+                $totalarray['nbfield']++;
954
+            }
917 955
         }
918 956
 
919 957
         // Extra fields
@@ -961,9 +999,11 @@  discard block
 block discarded – undo
961 999
 
962 1000
         // Action column
963 1001
         print '<td class="nowrap" align="center">';
964
-        if ($massactionbutton || $massaction)   // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1002
+        if ($massactionbutton || $massaction) {
1003
+            // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
965 1004
         {
966 1005
             $selected = 0;
1006
+        }
967 1007
             if (in_array($obj->idBBC_vols, $arrayofselected)) {
968 1008
                 $selected = 1;
969 1009
             }
Please login to merge, or discard this patch.
Spacing   +96 added lines, -96 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');
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 if ($page == -1) {
73 73
     $page = 0;
74 74
 }
75
-$offset = $limit * (int)$page;
76
-$pageprev = (int)$page - 1;
77
-$pagenext = (int)$page + 1;
75
+$offset = $limit * (int) $page;
76
+$pageprev = (int) $page - 1;
77
+$pagenext = (int) $page + 1;
78 78
 if (!$sortfield) {
79 79
     $sortfield = "t.date, t.heureD";
80 80
 } // Set here default search field
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 
180 180
 $parameters = array();
181 181
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object,
182
-    $action);    // Note that $action and $object may have been modified by some hooks
182
+    $action); // Note that $action and $object may have been modified by some hooks
183 183
 if ($reshook < 0) {
184 184
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
185 185
 }
@@ -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,
@@ -699,18 +699,18 @@  discard block
 block discarded – undo
699 699
 }
700 700
 if (!empty($arrayfields['t.fk_pilot']['checked'])) {
701 701
     print '<td class="liste_titre">';
702
-        print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0,0,0,'',0,'','', true);
702
+        print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
703 703
     print '</td>';
704 704
 }
705 705
 if (!empty($arrayfields['t.fk_organisateur']['checked'])) {
706 706
     print '<td class="liste_titre">';
707
-        print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0,0,0,'',0,'','', true);
707
+        print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
708 708
     print '</td>';
709 709
 }
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,125 +797,125 @@  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){
899
+            if (($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0) {
900 900
                 $nbrPax = $obj->nbrPax > 0 ? $obj->nbrPax : 1;
901
-                print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$nbrPax, 0, $langs, -1, -1, -1, $conf->currency));
902
-            }else{
901
+                print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost / $nbrPax, 0, $langs, -1, -1, -1, $conf->currency));
902
+            } else {
903 903
                 print '<td> - €</td>';
904 904
             }
905 905
 
906
-            if (! $i) $totalarray['nbfield']++;
906
+            if (!$i) $totalarray['nbfield']++;
907 907
         }
908
-        if (! empty($arrayfields['t.fk_receiver']['checked']))
908
+        if (!empty($arrayfields['t.fk_receiver']['checked']))
909 909
         {
910
-            print '<td>'.$obj->receiver.'</td>';
910
+            print '<td>' . $obj->receiver . '</td>';
911 911
 
912
-            if (! $i) $totalarray['nbfield']++;
912
+            if (!$i) $totalarray['nbfield']++;
913 913
         }
914
-        if (! empty($arrayfields['t.justif_kilometers']['checked']))
914
+        if (!empty($arrayfields['t.justif_kilometers']['checked']))
915 915
         {
916
-            print '<td>'.$obj->justif_kilometers.'</td>';
916
+            print '<td>' . $obj->justif_kilometers . '</td>';
917 917
 
918
-            if (! $i) $totalarray['nbfield']++;
918
+            if (!$i) $totalarray['nbfield']++;
919 919
         }
920 920
 
921 921
         // Extra fields
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
         // Fields from hook
941 941
         $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj);
942 942
         $reshook = $hookmanager->executeHooks('printFieldListValue',
943
-            $parameters);    // Note that $action and $object may have been modified by hook
943
+            $parameters); // Note that $action and $object may have been modified by hook
944 944
         print $hookmanager->resPrint;
945 945
         // Date creation
946 946
         if (!empty($arrayfields['t.datec']['checked'])) {
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 
1011 1011
 $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
1012 1012
 $reshook = $hookmanager->executeHooks('printFieldListFooter',
1013
-    $parameters);    // Note that $action and $object may have been modified by hook
1013
+    $parameters); // Note that $action and $object may have been modified by hook
1014 1014
 print $hookmanager->resPrint;
1015 1015
 
1016 1016
 print '</table>' . "\n";
Please login to merge, or discard this patch.
generateExpenseNote.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
     try {
88 88
         $command = new CreateExpenseNoteCommand($year, $quarter, $userValidatorId, $privateNote, $publicNote);
89 89
         $commandHandler->__invoke($command);
90
-    } catch(PeriodNotFinishedException $e){
90
+    } catch (PeriodNotFinishedException $e) {
91 91
         dol_htmloutput_errors("Le quadri n'est pas encore fini !");
92
-    } catch(\Exception $e){
92
+    } catch (\Exception $e) {
93 93
         dol_syslog($e->getMessage(), LOG_ERR);
94 94
         dol_htmloutput_errors('Error : ' . $e->getMessage());
95 95
     }
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 $form = new Form($db);
106 106
 
107 107
 $tabLinks = [];
108
-foreach($flightYears as $currentFlightYear){
108
+foreach ($flightYears as $currentFlightYear) {
109 109
     $tabLinks[] = [
110
-        DOL_URL_ROOT."/flightlog/generateExpenseNote.php?year=".$currentFlightYear,
110
+        DOL_URL_ROOT . "/flightlog/generateExpenseNote.php?year=" . $currentFlightYear,
111 111
         $currentFlightYear,
112
-        "tab_".$currentFlightYear
112
+        "tab_" . $currentFlightYear
113 113
     ];
114 114
 }
115 115
 
116
-dol_fiche_head($tabLinks, "tab_".$year);
116
+dol_fiche_head($tabLinks, "tab_" . $year);
117 117
 
118 118
 ?>
119 119
     <form method="POST">
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         <select name="quarter" id="field_quarter">
135 135
             <option value="1" <?= ($year == $currentYear && $currentQuarter <= 1) ? 'disabled="disabled"' : "" ?>>1</option>
136 136
             <option value="2" <?= ($year == $currentYear && $currentQuarter <= 2) ? 'disabled="disabled"' : "" ?>>2</option>
137
-            <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"': "" ?>>3</option>
137
+            <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"' : "" ?>>3</option>
138 138
             <option value="4" <?= ($year == $currentYear && $currentQuarter <= 4) ? 'disabled="disabled"' : "" ?>>4</option>
139 139
         </select>
140 140
         <br/>
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         <label><?= $langs->trans("Validateur de la note de frais")?></label><br/>
144 144
         <?php
145 145
             $include_users = $object->fetch_users_approver_expensereport();
146
-            print $form->select_dolusers($user->id,"fk_user_validator",1,"",0,$include_users);
146
+            print $form->select_dolusers($user->id, "fk_user_validator", 1, "", 0, $include_users);
147 147
         ?>
148 148
         <br/>
149 149
 
Please login to merge, or discard this patch.