Completed
Push — feature/select_existing_custom... ( a1e51a )
by Laurent
01:57
created
query/GetPilotsWithMissionsQueryHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
                         $pilotLastname = $obj->lastname;
53 53
                         $pilotFirstname = $obj->firstname;
54 54
 
55
-                        if($query->isPilotsOnly()){
55
+                        if ($query->isPilotsOnly()) {
56 56
                             $result->addPilot($pilotId, $pilotFirstname, $pilotLastname);
57
-                        }else{
57
+                        } else {
58 58
                             $result->addMission($obj->quartil, $pilotId, $pilotFirstname, $pilotLastname,
59 59
                                 $obj->number_flights, $obj->total_kilometers);
60 60
                         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $sql .= " , SUM(VOL.kilometers) as total_kilometers ";
80 80
         $sql .= " , COUNT(VOL.idBBC_vols) as number_flights";
81 81
 
82
-        if(!$query->isPilotsOnly()){
82
+        if (!$query->isPilotsOnly()) {
83 83
             $sql .= " , QUARTER(VOL.date) as quartil ";
84 84
         }
85 85
 
Please login to merge, or discard this patch.
card_tab_financial.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 $id = GETPOST('id', 'int') ?: GETPOST('idBBC_vols', 'int');
45 45
 $action = GETPOST('action', 'alpha');
46
-$permissiondellink=$user->rights->flightlog->vol->financial;
46
+$permissiondellink = $user->rights->flightlog->vol->financial;
47 47
 
48 48
 $object = new Bbcvols($db);
49 49
 $extrafields = new ExtraFields($db);
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
63 63
 
64 64
 // Load object
65
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';  // Must be include, not include_once  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
66
-include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
65
+include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
66
+include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
67 67
 
68 68
 // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
69 69
 $hookmanager->initHooks(array('bbcvols'));
@@ -93,18 +93,18 @@  discard block
 block discarded – undo
93 93
 print '<tr><td class="fieldrequired">' . $langs->trans("Fielddate") . '</td><td>' . dol_print_date($object->date) . '</td></tr>';
94 94
 
95 95
 if ($user->rights->flightlog->vol->financial) {
96
-    print '<tr><td class="fieldrequired">' . $langs->trans("Fieldis_facture") . '</td><td>' . $object->getLibStatut(5). '</td></tr>';
96
+    print '<tr><td class="fieldrequired">' . $langs->trans("Fieldis_facture") . '</td><td>' . $object->getLibStatut(5) . '</td></tr>';
97 97
 }
98 98
 
99 99
 print '<tr><td class="fieldrequired">' . $langs->trans("Fieldkilometers") . '</td><td>' . $object->kilometers . ' KM</td></tr>';
100 100
 print '<tr><td class="fieldrequired">' . $langs->trans("Fieldjustif_kilometers") . '</td><td>' . $object->justif_kilometers . '</td></tr>';
101
-if(!$object->isLinkedToOrder()){
101
+if (!$object->isLinkedToOrder()) {
102 102
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldcost") . '</td><td>' . $object->cost . " " . $langs->getCurrencySymbol($conf->currency) . '</td></tr>';
103 103
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_receiver") . '</td><td>' . $receiver->getNomUrl(1) . '</td></tr>';
104
-}else{
104
+} else {
105 105
     print '<tr><td class="fieldrequired">' . $langs->trans("Order") . '</td><td><ul>';
106
-    foreach($object->getOrders() as $currentOrder){
107
-        print '<li>'.$currentOrder->getNomUrl(1).'</li>';
106
+    foreach ($object->getOrders() as $currentOrder) {
107
+        print '<li>' . $currentOrder->getNomUrl(1) . '</li>';
108 108
     }
109 109
     print '</ul></td></tr>';
110 110
 }
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 // Buttons
116 116
 print '<div class="tabsAction">' . "\n";
117 117
 
118
-if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){
119
-    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";
118
+if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) {
119
+    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";
120 120
 }
121 121
 
122 122
 print '</div>' . "\n";
123 123
 
124
-if($user->rights->flightlog->vol->financial){
124
+if ($user->rights->flightlog->vol->financial) {
125 125
     print '<div class="fichecenter"><div class="fichehalfleft">';
126 126
     $form->showLinkedObjectBlock($object);
127 127
     print '</div></div>';
Please login to merge, or discard this patch.
command/CreateFlightCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -397,7 +397,7 @@
 block discarded – undo
397 397
     /**
398 398
      * @return bool
399 399
      */
400
-    public function hasOrderId(){
400
+    public function hasOrderId() {
401 401
         return count($this->orderIds) > 0;
402 402
     }
403 403
 }
404 404
\ No newline at end of file
Please login to merge, or discard this patch.
command/CreateFlightCommandHandler.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $vol = new Bbcvols($this->db);
66 66
         $vol->date = $command->getDate();
67 67
         $vol->lieuD = $command->getLieuD();
68
-        $vol->lieuA =$command->getLieuA();
68
+        $vol->lieuA = $command->getLieuA();
69 69
         $vol->heureD = $command->getHeureD();
70 70
         $vol->heureA = $command->getHeureA();
71 71
         $vol->BBC_ballons_idBBC_ballons = $command->getBBCBallonsIdBBCBallons();
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
         $vol->remarque = $command->getRemarque();
74 74
         $vol->incidents = $command->getIncidents();
75 75
         $vol->fk_type = $command->getFkType();
76
-        $vol->fk_pilot =$command->getFkPilot();
76
+        $vol->fk_pilot = $command->getFkPilot();
77 77
         $vol->fk_organisateur = $command->getFkOrganisateur();
78 78
         $vol->kilometers = $command->getKilometers();
79 79
         $vol->cost = $command->getCost();
80 80
         $vol->fk_receiver = $command->getFkReceiver();
81 81
         $vol->justif_kilometers = $command->getJustifKilometers();
82 82
         $vol->setPassengerNames($command->getPassengerNames());
83
-        foreach($command->getOrderIds() as $orderId => $nbrPassengers){
83
+        foreach ($command->getOrderIds() as $orderId => $nbrPassengers) {
84 84
             $vol->addOrderId($orderId, $nbrPassengers);
85 85
         }
86 86
 
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
             throw new Exception();
89 89
         }
90 90
 
91
-        if(!$vol->getFlightType()->isBillingRequired() || $vol->isLinkedToOrder()){
91
+        if (!$vol->getFlightType()->isBillingRequired() || $vol->isLinkedToOrder()) {
92 92
             $vol->is_facture = true;
93 93
         }
94 94
 
95 95
         $result = $vol->create($this->user);
96
-        if($result <= 0){
96
+        if ($result <= 0) {
97 97
             throw new Exception();
98 98
         }
99 99
 
@@ -113,27 +113,27 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $flight->fetch($flight->id);
115 115
 
116
-        if(!$flight->isLinkedToOrder()){
116
+        if (!$flight->isLinkedToOrder()) {
117 117
             return;
118 118
         }
119 119
 
120
-        foreach($flight->getOrders() as $currentOrder){
120
+        foreach ($flight->getOrders() as $currentOrder) {
121 121
             $currentOrder->add_object_linked('flightlog_bbcvols', $flight->getId());
122 122
             $currentOrder->fetch_lines();
123 123
 
124 124
             $qtyOrder = 0;
125 125
             /** @var OrderLine $currentOrderLine */
126
-            foreach($currentOrder->lines as $currentOrderLine){
127
-                $qtyOrder += (int)$currentOrderLine->qty;
126
+            foreach ($currentOrder->lines as $currentOrderLine) {
127
+                $qtyOrder += (int) $currentOrderLine->qty;
128 128
             }
129 129
 
130 130
             $passangersCount = $this->numberOfPassengersLinkedToOrder($currentOrder->id);
131 131
 
132
-            if($passangersCount < $qtyOrder){
132
+            if ($passangersCount < $qtyOrder) {
133 133
                 continue;
134 134
             }
135 135
 
136
-            if($currentOrder->statut == Commande::STATUS_VALIDATED){
136
+            if ($currentOrder->statut == Commande::STATUS_VALIDATED) {
137 137
                 $currentOrder->cloture($this->user);
138 138
             }
139 139
         }
Please login to merge, or discard this patch.
addFlight.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             ->setGroupedFlight($isGroupedFlight)
62 62
             ->setOrderIds($orderPassengersCount);
63 63
 
64
-        try{
64
+        try {
65 65
             $vol = $createFlightHandler->handle($volCommand);
66 66
 
67 67
             include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 
71 71
             $msg = '<div class="ok">L\'ajout du vol du : ' . $_POST["reday"] . '/' . $_POST["remonth"] . '/' . $_POST["reyear"] . ' s\'est correctement effectue ! </div>';
72 72
             Header("Location: card.php?id=" . $vol->id);
73
-        }catch (\Exception $e){
74
-            $msg = '<div class="error">Erreur lors de l\'ajout du vol : ' . ($vol->error?:$e->getMessage()) . '! </div>';
73
+        } catch (\Exception $e) {
74
+            $msg = '<div class="error">Erreur lors de l\'ajout du vol : ' . ($vol->error ?: $e->getMessage()) . '! </div>';
75 75
         }
76 76
 
77 77
     }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             //Pilote
151 151
             print "<tr>";
152 152
             print '<td class="fieldrequired"> Pilote </td><td >';
153
-            print $html->select_dolusers($_POST["pilot"] ? $_POST["pilot"] : $user->id, 'pilot', 0, null, 0, '', '', 0,0,0,'',0,'','', true);
153
+            print $html->select_dolusers($_POST["pilot"] ? $_POST["pilot"] : $user->id, 'pilot', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
154 154
             print '</td></tr>';
155 155
 
156 156
             //Ballon
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 <td>
197 197
                 <?php
198 198
                     //organisateur
199
-                    print $html->select_dolusers($_POST["orga"] ? $_POST["orga"] : $user->id, 'orga', 0, null, 0, '', '', 0,0,0,'',0,'','', true);
199
+                    print $html->select_dolusers($_POST["orga"] ? $_POST["orga"] : $user->id, 'orga', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
200 200
                 ?>
201 201
                 </td>
202 202
             </tr>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                     <input type="number"
237 237
                            name="nbrPax"
238 238
                            class="flat <?php echo $validator->hasError('nbrPax') ? 'error' : '' ?>"
239
-                           value="<?php echo $_POST['nbrPax']?: 0 ?>"/>
239
+                           value="<?php echo $_POST['nbrPax'] ?: 0 ?>"/>
240 240
                 </td>
241 241
             </tr>
242 242
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 <td class="js-order">
262 262
                     <p class="text-muted">Pour retirer une commande merci de la retirer de la liste ci-dessous.</p>
263 263
                     <?php
264
-                        echo $html::multiselectarray('order_id', $commande->liste_array(2),$_POST['order_id'],0,0, $validator->hasError('order_id') ? 'error' : '',0,'100%');
264
+                        echo $html::multiselectarray('order_id', $commande->liste_array(2), $_POST['order_id'], 0, 0, $validator->hasError('order_id') ? 'error' : '', 0, '100%');
265 265
                     ?>
266 266
                 </td>
267 267
             </tr>
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
             <tr class="js-hide-order js-billable-field">
271 271
                 <td class="fieldrequired"><?php echo $langs->trans('Qui a perçu l\'argent')?></td><td>
272 272
                     <?php print $html->select_dolusers($_POST["fk_receiver"] ? $_POST["fk_receiver"] : $user->id,
273
-                        'fk_receiver', true, null, 0, '', '', 0,0,0,'',0,'','', true); ?>
273
+                        'fk_receiver', true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); ?>
274 274
                 </td>
275 275
             </tr>
276 276
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             <tr class="js-hide-order js-billable-field">
279 279
                 <td class="fieldrequired">Montant perçu</td>
280 280
                 <td>
281
-                    <input type="text" name="cost" class="flat  <?php echo $validator->hasError('cost') ? 'error' : '' ?>" value="<?php echo $_POST['cost']?:0 ?> "/>
281
+                    <input type="text" name="cost" class="flat  <?php echo $validator->hasError('cost') ? 'error' : '' ?>" value="<?php echo $_POST['cost'] ?: 0 ?> "/>
282 282
                     &euro;
283 283
                 </td>
284 284
             </tr>
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
 
326 326
 <script type="application/javascript">
327 327
 
328
-    <?php if(!empty(GETPOST('order_passengers_count', 'array', 2))): ?>
328
+    <?php if (!empty(GETPOST('order_passengers_count', 'array', 2))): ?>
329 329
         var orders = {};
330
-        <?php foreach( GETPOST('order_passengers_count', 'array', 2) as $currentOrderId=>$nbrPaxForOrder): ?>
330
+        <?php foreach (GETPOST('order_passengers_count', 'array', 2) as $currentOrderId=>$nbrPaxForOrder): ?>
331 331
         orders[<?php echo $currentOrderId; ?>] = <?php echo $nbrPaxForOrder; ?>;
332 332
         <?php endforeach; ?>
333 333
     <?php endif; ?>
Please login to merge, or discard this patch.
class/bbcvols.class.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         $sql .= ' ' . (!isset($this->justif_kilometers) ? 'NULL' : "'" . $this->db->escape($this->justif_kilometers) . "'") . ',';
256 256
         $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ',';
257 257
         $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ',';
258
-        $sql .= ' ' . "'" . $this->passengerNames . "'" ;
258
+        $sql .= ' ' . "'" . $this->passengerNames . "'";
259 259
         $sql .= ')';
260 260
 
261 261
         $this->db->begin();
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
         if (!$error) {
271 271
             $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
272
-            if(!$this->insertOrders()){
272
+            if (!$this->insertOrders()) {
273 273
                 $error++;
274 274
             }
275 275
 
@@ -295,9 +295,9 @@  discard block
 block discarded – undo
295 295
     /**
296 296
      * Inserts the order linked to the flight
297 297
      */
298
-    private function insertOrders(){
298
+    private function insertOrders() {
299 299
 
300
-        if(empty($this->orderIds)){
300
+        if (empty($this->orderIds)) {
301 301
             return true;
302 302
         }
303 303
 
@@ -312,12 +312,12 @@  discard block
 block discarded – undo
312 312
         
313 313
         $values = [];
314 314
 
315
-        foreach($this->orderIds as $orderId=>$nbrPassengers){
315
+        foreach ($this->orderIds as $orderId=>$nbrPassengers) {
316 316
             $values[] = sprintf(
317 317
                 $valueTemplate,
318 318
                 $orderId,
319 319
                 $this->db->escape($this->id),
320
-                (!isset($nbrPassengers) ? '0' :  $this->db->escape($nbrPassengers))
320
+                (!isset($nbrPassengers) ? '0' : $this->db->escape($nbrPassengers))
321 321
             );
322 322
         }
323 323
 
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
     /**
336 336
      * Inserts the order linked to the flight
337 337
      */
338
-    private function updateOrders(){
338
+    private function updateOrders() {
339 339
 
340
-        if(empty($this->orderIds)){
340
+        if (empty($this->orderIds)) {
341 341
             return true;
342 342
         }
343 343
 
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
     /**
349 349
      * Inserts the order linked to the flight
350 350
      */
351
-    private function deleteOrders(){
351
+    private function deleteOrders() {
352 352
 
353
-        if(empty($this->orderIds)){
353
+        if (empty($this->orderIds)) {
354 354
             return true;
355 355
         }
356 356
 
@@ -1015,8 +1015,8 @@  discard block
 block discarded – undo
1015 1015
      * @param int $orderId
1016 1016
      * @param int $nbrPassengers
1017 1017
      */
1018
-    public function addOrderId($orderId, $nbrPassengers){
1019
-        if(!isset($this->orderIds)){
1018
+    public function addOrderId($orderId, $nbrPassengers) {
1019
+        if (!isset($this->orderIds)) {
1020 1020
             $this->orderIds = [];
1021 1021
         }
1022 1022
 
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
         if ($resql) {
1057 1057
             $numrows = $this->db->num_rows($resql);
1058 1058
             if ($numrows) {
1059
-                for($i = 0 ; $i < $numrows ; $i++){
1059
+                for ($i = 0; $i < $numrows; $i++) {
1060 1060
                     $obj = $this->db->fetch_object($resql);
1061 1061
                     $this->orderIds[$obj->order_id] = $obj->nbr_passengers;
1062 1062
 
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
      */
1078 1078
     public function getOrders()
1079 1079
     {
1080
-        if(!isset($this->orders) || empty($this->orders)){
1080
+        if (!isset($this->orders) || empty($this->orders)) {
1081 1081
             $this->fetchOrder();
1082 1082
         }
1083 1083
         return $this->orders;
Please login to merge, or discard this patch.
validators/FlightValidator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -229,20 +229,20 @@
 block discarded – undo
229 229
      */
230 230
     private function checkOrderInformation(Bbcvols $vol)
231 231
     {
232
-        if(!$vol->isLinkedToOrder()){
232
+        if (!$vol->isLinkedToOrder()) {
233 233
             return $this;
234 234
         }
235 235
 
236 236
         $totalPassenegrs = 0;
237
-        foreach($vol->getOrderIds() as $orderId => $nbrPassengers){
238
-            if($nbrPassengers <= 0){
237
+        foreach ($vol->getOrderIds() as $orderId => $nbrPassengers) {
238
+            if ($nbrPassengers <= 0) {
239 239
                 $this->addError('order_id', 'Le nombre de passager par commande doit être >= 0.');
240 240
             }
241 241
 
242
-            $totalPassenegrs+=(int)$nbrPassengers;
242
+            $totalPassenegrs += (int) $nbrPassengers;
243 243
         }
244 244
 
245
-        if($totalPassenegrs !== (int)$vol->getNumberOfPassengers()){
245
+        if ($totalPassenegrs !== (int) $vol->getNumberOfPassengers()) {
246 246
             $this->addError('nbrPax', 'Le nombre de passagers ne correspond pas au nombre entré sur les commandes');
247 247
         }
248 248
 
Please login to merge, or discard this patch.
command/ClassifyFlight.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
      */
27 27
     public function __construct($flightId, $projectId)
28 28
     {
29
-        $this->flightId = (int)$flightId;
30
-        $this->projectId = (int)$projectId;
29
+        $this->flightId = (int) $flightId;
30
+        $this->projectId = (int) $projectId;
31 31
     }
32 32
 
33 33
     /**
Please login to merge, or discard this patch.
card.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
128 128
 
129 129
 // Load object
130
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
130
+include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
131 131
 include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
132 132
 
133 133
 // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 $parameters = array();
158 158
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object,
159
-    $action);    // Note that $action and $object may have been modified by some hooks
159
+    $action); // Note that $action and $object may have been modified by some hooks
160 160
 if ($reshook < 0) {
161 161
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
162 162
 }
@@ -234,12 +234,12 @@  discard block
 block discarded – undo
234 234
 
235 235
     // Action to classify in a project
236 236
     if (!empty($conf->projet->enabled) && $user->rights->projet->creer && $action === ACTION_CLASSIN) {
237
-        try{
237
+        try {
238 238
             $handler = new \flightlog\command\ClassifyFlightHandler($db, $conf, $langs, $user);
239 239
             $handler->handle(new \flightlog\command\ClassifyFlight($id, GETPOST('projectid')));
240 240
             $object->fetch($id);
241 241
             $action = 'show';
242
-        }catch(Exception $e){
242
+        } catch (Exception $e) {
243 243
             setEventMessages($e->getMessage(), null, 'errors');
244 244
         }
245 245
     }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
 
274 274
 // Part to edit record
275
-if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id )) && ($id || $ref) && $action == 'edit'): ?>
275
+if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && ($id || $ref) && $action == 'edit'): ?>
276 276
 
277 277
     <?php $renderer = new \flightlog\form\SimpleFormRenderer(); ?>
278 278
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         <?php echo $renderer->render($formFlight->getElement('idBBC_vols')); ?>
291 291
 
292
-        <?php if($formFlight->has('fk_type')): ?>
292
+        <?php if ($formFlight->has('fk_type')): ?>
293 293
         <section class="form-section">
294 294
             <h1 class="form-section-title"><?php echo $langs->trans('Type de vol'); ?></h1>
295 295
             <table class="border" width="50%">
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         <?php endif; ?>
304 304
 
305 305
         <!-- Date et heures -->
306
-        <?php if($formFlight->has('date')): ?>
306
+        <?php if ($formFlight->has('date')): ?>
307 307
             <section class="form-section">
308 308
                 <h1 class="form-section-title"><?php echo $langs->trans('Date'); ?></h1>
309 309
                 <table class="border" width="50%">
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             </section>
316 316
         <?php endif; ?>
317 317
 
318
-        <?php if($formFlight->has('heureD') && $formFlight->has('heureA')): ?>
318
+        <?php if ($formFlight->has('heureD') && $formFlight->has('heureA')): ?>
319 319
             <section class="form-section">
320 320
                 <h1 class="form-section-title"><?php echo $langs->trans('Heures'); ?></h1>
321 321
                 <table class="border" width="50%">
@@ -335,14 +335,14 @@  discard block
 block discarded – undo
335 335
             <h1 class="form-section-title"><?php echo $langs->trans('Pilote & ballon') ?></h1>
336 336
             <table class="border" width="50%">
337 337
 
338
-                <?php if($formFlight->has('fk_pilot')): ?>
338
+                <?php if ($formFlight->has('fk_pilot')): ?>
339 339
                 <tr>
340 340
                     <td class="fieldrequired"> Pilote </td>
341
-                    <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'),['ajax' => true]); ?></td>
341
+                    <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'), ['ajax' => true]); ?></td>
342 342
                 </tr>
343 343
                 <?php endif; ?>
344 344
 
345
-                <?php if($formFlight->has('BBC_ballons_idBBC_ballons')): ?>
345
+                <?php if ($formFlight->has('BBC_ballons_idBBC_ballons')): ?>
346 346
                 <tr>
347 347
                     <td width="25%" class="fieldrequired">Ballon</td>
348 348
                     <td><?php echo $renderer->render($formFlight->getElement('BBC_ballons_idBBC_ballons')); ?></td>
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
             </table>
378 378
         </section>
379 379
 
380
-        <?php if($formFlight->has('fk_organisateur')): ?>
380
+        <?php if ($formFlight->has('fk_organisateur')): ?>
381 381
             <section class="form-section">
382 382
                 <h1 class="form-section-title"><span class="js-organisator-field">Organisateur</span></h1>
383 383
                 <table class="border" width="50%">
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                         <td>
387 387
                             <?php
388 388
                             //organisateur
389
-                            print $renderer->render($formFlight->getElement('fk_organisateur'),['ajax' => true]);
389
+                            print $renderer->render($formFlight->getElement('fk_organisateur'), ['ajax' => true]);
390 390
                             ?>
391 391
                         </td>
392 392
                     </tr>
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
         <section class="form-section js-expensable-field">
399 399
             <h1 class="form-section-title"><?php echo $langs->trans('Déplacements') ?></h1>
400 400
             <table class="border" width="50%">
401
-                <?php if($formFlight->has('kilometers')): ?>
401
+                <?php if ($formFlight->has('kilometers')): ?>
402 402
                     <!-- number of kilometers done for the flight -->
403 403
                     <tr>
404 404
                         <td class="fieldrequired">Nombre de kilometres effectués pour le vol</td>
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
                     </tr>
409 409
                 <?php endif; ?>
410 410
 
411
-                <?php if($formFlight->has('justif_kilometers')): ?>
411
+                <?php if ($formFlight->has('justif_kilometers')): ?>
412 412
                     <!-- Justif Kilometers -->
413 413
                     <tr>
414 414
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         <section class="form-section">
427 427
             <h1 class="form-section-title"><?php echo $langs->trans('Passager') ?></h1>
428 428
             <table class="border" width="50%">
429
-                <?php if($formFlight->has('nbrPax')): ?>
429
+                <?php if ($formFlight->has('nbrPax')): ?>
430 430
                     <tr>
431 431
                         <td class="fieldrequired"><?php echo $langs->trans('Nombre de passagers'); ?></td>
432 432
                         <td>
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                     </tr>
436 436
                 <?php endif; ?>
437 437
 
438
-                <?php if($formFlight->has('passengerNames')): ?>
438
+                <?php if ($formFlight->has('passengerNames')): ?>
439 439
                     <!-- passenger names -->
440 440
                     <tr>
441 441
                         <td width="25%" class="fieldrequired"><?php echo $langs->trans('Noms des passagers'); ?><br/>(Séparé
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
                             <?php print $renderer->render($formFlight->getElement('passengerNames')); ?>
446 446
                         </td>
447 447
                     </tr>
448
-                <?php endif;?>
448
+                <?php endif; ?>
449 449
             </table>
450 450
         </section>
451 451
 
@@ -454,17 +454,17 @@  discard block
 block discarded – undo
454 454
             <h1 class="form-section-title js-billable-field"><?php echo $langs->trans('Facturation') ?></h1>
455 455
             <table class="border" width="50%">
456 456
 
457
-                <?php if($formFlight->has('fk_receiver')): ?>
457
+                <?php if ($formFlight->has('fk_receiver')): ?>
458 458
                     <!-- Money receiver -->
459 459
                     <tr class="js-hide-order js-billable-field">
460 460
                         <td class="fieldrequired"><?php echo $langs->trans('Qui a perçu l\'argent') ?></td>
461 461
                         <td>
462
-                            <?php print $renderer->render($formFlight->getElement('fk_receiver'),['ajax' => true]); ?>
462
+                            <?php print $renderer->render($formFlight->getElement('fk_receiver'), ['ajax' => true]); ?>
463 463
                         </td>
464 464
                     </tr>
465 465
                 <?php endif; ?>
466 466
 
467
-                <?php if($formFlight->has('cost')): ?>
467
+                <?php if ($formFlight->has('cost')): ?>
468 468
                     <!-- Flight cost -->
469 469
                     <tr class="js-hide-order js-billable-field">
470 470
                         <td class="fieldrequired">Montant perçu</td>
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
             <h1 class="form-section-title"><?php echo $langs->trans('Commentaires') ?></h1>
483 483
             <table class="border" width="50%">
484 484
 
485
-                <?php if($formFlight->has('remarque')): ?>
485
+                <?php if ($formFlight->has('remarque')): ?>
486 486
                     <!-- commentaires -->
487 487
                     <tr class="">
488 488
                         <td class="fieldrequired"> Commentaire</td>
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                     </tr>
493 493
                 <?php endif; ?>
494 494
 
495
-                <?php if($formFlight->has('incidents')): ?>
495
+                <?php if ($formFlight->has('incidents')): ?>
496 496
                     <!-- incidents -->
497 497
                     <tr class="">
498 498
                         <td class="fieldrequired"> incidents</td>
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'),
527 527
             $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1);
528 528
         print $formconfirm;
529
-    } elseif ($user->rights->flightlog->vol->financial  && $action == ACTION_FLAG_BILLED) {
529
+    } elseif ($user->rights->flightlog->vol->financial && $action == ACTION_FLAG_BILLED) {
530 530
         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id,
531 531
             $langs->trans('Marque comme facturé'),
532 532
             $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '',
@@ -550,29 +550,29 @@  discard block
 block discarded – undo
550 550
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_pilot") . '</td><td>' . $pilot->getNomUrl(1) . '</td></tr>';
551 551
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_organisateur") . '</td><td>' . $organisator->getNomUrl(1) . '</td></tr>';
552 552
 
553
-    if (! empty($conf->projet->enabled))
553
+    if (!empty($conf->projet->enabled))
554 554
     {
555 555
         print '<tr><td class="fieldrequired">' . $langs->trans("Project") . '</td><td>';
556 556
         $morehtmlref = '';
557 557
         if ($user->rights->projet->creer)
558 558
         {
559 559
             if ($action !== ACTION_CLASSIFY) {
560
-                $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action='.ACTION_CLASSIFY.'&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
560
+                $morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=' . ACTION_CLASSIFY . '&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
561 561
             }
562 562
             if ($action === ACTION_CLASSIFY) {
563
-                $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
564
-                $morehtmlref.='<input type="hidden" name="action" value="'.ACTION_CLASSIN.'">';
565
-                $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
566
-                $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);
567
-                $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
568
-                $morehtmlref.='</form>';
563
+                $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
564
+                $morehtmlref .= '<input type="hidden" name="action" value="' . ACTION_CLASSIN . '">';
565
+                $morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
566
+                $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);
567
+                $morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
568
+                $morehtmlref .= '</form>';
569 569
             }
570 570
         }
571 571
 
572 572
         if ($object->hasProject()) {
573 573
             $proj = new Project($db);
574 574
             $proj->fetch($object->fk_project);
575
-            $morehtmlref.=$proj->getNomUrl(1);
575
+            $morehtmlref .= $proj->getNomUrl(1);
576 576
         }
577 577
         print $morehtmlref . '</td>';
578 578
     }
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     print '<div class="tabsAction">' . "\n";
588 588
     $parameters = array();
589 589
     $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object,
590
-        $action);    // Note that $action and $object may have been modified by hook
590
+        $action); // Note that $action and $object may have been modified by hook
591 591
     if ($reshook < 0) {
592 592
         setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
593 593
     }
Please login to merge, or discard this patch.