Completed
Push — feature/link_expense_note ( dad966...3db735 )
by Laurent
02:03
created
command/CreateFlightCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -393,7 +393,7 @@
 block discarded – undo
393 393
     /**
394 394
      * @return bool
395 395
      */
396
-    public function hasOrderId(){
396
+    public function hasOrderId() {
397 397
         return $this->orderId !== null;
398 398
     }
399 399
 }
400 400
\ No newline at end of file
Please login to merge, or discard this patch.
addOrder.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@  discard block
 block discarded – undo
12 12
 dol_include_once("/flightlog/lib/flightLog.lib.php");
13 13
 dol_include_once("/flightlog/validators/SimpleOrderValidator.php");
14 14
 dol_include_once("/flightlog/command/CreateOrderCommandHandler.php");
15
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
16
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
15
+require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
16
+require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php';
17 17
 
18 18
 // Load object modCodeTiers
19
-$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
19
+$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
20 20
 if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
21 21
 {
22
-    $module = substr($module, 0, dol_strlen($module)-4);
22
+    $module = substr($module, 0, dol_strlen($module) - 4);
23 23
 }
24
-$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);
24
+$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
25 25
 foreach ($dirsociete as $dirroot)
26 26
 {
27
-    $res=dol_include_once($dirroot.$module.'.php');
27
+    $res = dol_include_once($dirroot . $module . '.php');
28 28
     if ($res) break;
29 29
 }
30 30
 $modCodeClient = new $module;
31 31
 // Load object modCodeFournisseur
32
-$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
32
+$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
33 33
 if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
34 34
 {
35
-    $module = substr($module, 0, dol_strlen($module)-4);
35
+    $module = substr($module, 0, dol_strlen($module) - 4);
36 36
 }
37
-$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);
37
+$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
38 38
 foreach ($dirsociete as $dirroot)
39 39
 {
40
-    $res=dol_include_once($dirroot.$module.'.php');
40
+    $res = dol_include_once($dirroot . $module . '.php');
41 41
     if ($res) break;
42 42
 }
43 43
 $modCodeFournisseur = new $module;
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
     if (!$_POST["cancel"]) {
59 59
 
60 60
         $formObject = new stdClass();
61
-        $formObject->name = GETPOST('name','alpha');
62
-        $formObject->firstname = GETPOST('firstname','alpha');
63
-        $formObject->zip = GETPOST('zipcode','alpha');
61
+        $formObject->name = GETPOST('name', 'alpha');
62
+        $formObject->firstname = GETPOST('firstname', 'alpha');
63
+        $formObject->zip = GETPOST('zipcode', 'alpha');
64 64
         $formObject->town = GETPOST('town', 'alpha');
65 65
         $formObject->state = GETPOST('state_id', 'int');
66 66
         $formObject->phone = GETPOST('phone', 'alpha');
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 
78 78
         if ($validator->isValid($formObject, $_REQUEST)) {
79 79
             $createOrderCommand = new CreateOrderCommand($formObject, $user->id);
80
-            try{
81
-                $handler = new CreateOrderCommandHandler($db, $conf,$user,$langs,$modCodeClient, $modCodeFournisseur);
80
+            try {
81
+                $handler = new CreateOrderCommandHandler($db, $conf, $user, $langs, $modCodeClient, $modCodeFournisseur);
82 82
                 $handler->handle($createOrderCommand);
83 83
 
84 84
                 $msg = '<div class="success ok">Commande et tiers créés. </div>';
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
 ?>
114 114
 
115 115
     <!-- Success message with reference -->
116
-    <?php if($successMessage): ?>
116
+    <?php if ($successMessage): ?>
117 117
         <div class="bbc-style">
118 118
             <p class="cadre_msg1">
119 119
                 Vous avez généré la facture et créé un tiers.<br/>
120 120
                 Merci,
121 121
             </p>
122 122
 
123
-            <?php if(count($validator->getWarningMessages()) > 0):?>
123
+            <?php if (count($validator->getWarningMessages()) > 0):?>
124 124
                 <div class="box box-warning">
125 125
                     <p>Ceci sont des messages d'attention mais qui ne bloquent pas la création de la commande</p>
126 126
                     <ul>
127
-                        <?php foreach($validator->getWarningMessages() as $warningMessage): ?>
127
+                        <?php foreach ($validator->getWarningMessages() as $warningMessage): ?>
128 128
                             <li class="warning"><?php echo $warningMessage; ?></li>
129 129
                         <?php endforeach; ?>
130 130
                     </ul>
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         <p>
184 184
             Cette page vous permettra de créer une commande. La commande est <b>obligatoire</b> si vous désirez faire payer les passagers directement sur le compte du club.<br>
185 185
             Si vous avre un doute sur la manière d'encoder la commande, veuillez me contacter.<br/>
186
-            Si vous avez <b>déjà</b> encodé une commande, et que vous voulez la retrouver veuillez vous rendre sur : <a href="<?php echo sprintf(DOL_URL_ROOT.'/commande/list.php?search_sale=%s', $user->id); ?>">mes commandes.</a>
186
+            Si vous avez <b>déjà</b> encodé une commande, et que vous voulez la retrouver veuillez vous rendre sur : <a href="<?php echo sprintf(DOL_URL_ROOT . '/commande/list.php?search_sale=%s', $user->id); ?>">mes commandes.</a>
187 187
         </p>
188 188
     </div>
189 189
     <form class="flight-form" name='add' method="post">
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     <?php echo $langs->trans('DefaultLang'); ?>
263 263
                 </td>
264 264
                 <td>
265
-                    <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT,'default_lang',0,0,1,0,0,'maxwidth200onsmartphone'); ?>
265
+                    <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); ?>
266 266
                 </td>
267 267
             </tr>
268 268
 
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
                     <?php echo $langs->trans('Region'); ?>
273 273
                 </td>
274 274
                 <td>
275
-                    <?php print $formcompany->select_state($formObject->state,'BE'); ?>
275
+                    <?php print $formcompany->select_state($formObject->state, 'BE'); ?>
276 276
                 </td>
277 277
             </tr>
278 278
 
279 279
             <?php
280 280
             // Zip / Town
281
-            print '<tr><td>'.fieldLabel('Zip','zipcode').'</td><td>';
282
-                    print $formcompany->select_ziptown($formObject->town,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
283
-                    print '</td><td>'.fieldLabel('Town','town').'</td><td>';
284
-                    print $formcompany->select_ziptown($formObject->zip,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
281
+            print '<tr><td>' . fieldLabel('Zip', 'zipcode') . '</td><td>';
282
+                    print $formcompany->select_ziptown($formObject->town, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
283
+                    print '</td><td>' . fieldLabel('Town', 'town') . '</td><td>';
284
+                    print $formcompany->select_ziptown($formObject->zip, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
285 285
                     print '</td></tr>';
286 286
             ?>
287 287
 
@@ -305,16 +305,16 @@  discard block
 block discarded – undo
305 305
                     <?php
306 306
                     if (empty($conf->global->MAIN_DISABLEVATCHECK)): ?>
307 307
 
308
-                        <?php if (! empty($conf->use_javascript_ajax)): ?>
308
+                        <?php if (!empty($conf->use_javascript_ajax)): ?>
309 309
                             <script language="JavaScript" type="text/javascript">
310 310
                             function CheckVAT(a) {
311
-                                <?php print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,300);"; ?>
311
+                                <?php print "newpopup('" . DOL_URL_ROOT . "/societe/checkvat/checkVatPopup.php?vatNumber='+a,'" . dol_escape_js($langs->trans("VATIntraCheckableOnEUSite")) . "',500,300);"; ?>
312 312
                             }
313 313
                             </script>
314 314
                             <a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT(document.add.tva_intra.value);"><?php echo $langs->trans("VATIntraCheck"); ?></a>
315
-                            <?php echo $html->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); ?>
315
+                            <?php echo $html->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->trans("VATIntraCheck")), 1); ?>
316 316
                         <?php else: ?>
317
-                            <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a>
317
+                            <a href="<?php echo $langs->transcountry("VATIntraCheckURL", $object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help'); ?></a>
318 318
                         <?php endif; ?>
319 319
                    <?php endif; ?>
320 320
                 </td>
@@ -367,10 +367,10 @@  discard block
 block discarded – undo
367 367
             <tr>
368 368
                 <td><?php echo $langs->trans('Le commentaire doit-il figurer sur la commande') ?></td>
369 369
                 <td>
370
-                    <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1)?'checked="checked"' : ''; ?>/>
370
+                    <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1) ? 'checked="checked"' : ''; ?>/>
371 371
                     <label for="public_comment">Oui</label>
372 372
                     -
373
-                    <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0)?'checked="checked"' : ''; ?>/>
373
+                    <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0) ? 'checked="checked"' : ''; ?>/>
374 374
                     <label for="private_comment">Non</label>
375 375
                 </td>
376 376
             </tr>
Please login to merge, or discard this patch.
command/CreateFlightCommandHandler.php 1 patch
Spacing   +9 added lines, -9 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,7 +73,7 @@  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();
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
             throw new Exception();
87 87
         }
88 88
 
89
-        if(!$vol->getFlightType()->isBillingRequired() || $vol->isLinkedToOrder()){
89
+        if (!$vol->getFlightType()->isBillingRequired() || $vol->isLinkedToOrder()) {
90 90
             $vol->is_facture = true;
91 91
         }
92 92
 
93 93
         $result = $vol->create($this->user);
94
-        if($result <= 0){
94
+        if ($result <= 0) {
95 95
             throw new Exception();
96 96
         }
97 97
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $flight->fetch($flight->id);
113 113
 
114
-        if(!$flight->isLinkedToOrder()){
114
+        if (!$flight->isLinkedToOrder()) {
115 115
             return;
116 116
         }
117 117
 
@@ -122,17 +122,17 @@  discard block
 block discarded – undo
122 122
 
123 123
         $qtyOrder = 0;
124 124
         /** @var OrderLine $currentOrderLine */
125
-        foreach($order->lines as $currentOrderLine){
126
-            $qtyOrder += (int)$currentOrderLine->qty;
125
+        foreach ($order->lines as $currentOrderLine) {
126
+            $qtyOrder += (int) $currentOrderLine->qty;
127 127
         }
128 128
 
129 129
         $passangersCount = $this->numberOfPassengersLinkedToOrder($order->id);
130 130
 
131
-        if($passangersCount != $qtyOrder){
131
+        if ($passangersCount != $qtyOrder) {
132 132
             return;
133 133
         }
134 134
 
135
-        if($order->statut == Commande::STATUS_VALIDATED){
135
+        if ($order->statut == Commande::STATUS_VALIDATED) {
136 136
             $order->cloture($this->user);
137 137
         }
138 138
     }
Please login to merge, or discard this patch.
addFlight.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             ->setGroupedFlight($isGroupedFlight)
61 61
             ->setOrderId($orderId);
62 62
 
63
-        try{
63
+        try {
64 64
             $vol = $createFlightHandler->handle($volCommand);
65 65
 
66 66
             include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
             $msg = '<div class="ok">L\'ajout du vol du : ' . $_POST["reday"] . '/' . $_POST["remonth"] . '/' . $_POST["reyear"] . ' s\'est correctement effectue ! </div>';
71 71
             Header("Location: card.php?id=" . $vol->id);
72
-        }catch (\Exception $e){
72
+        } catch (\Exception $e) {
73 73
             $msg = '<div class="error">Erreur lors de l\'ajout du vol : ' . $vol->error . '! </div>';
74 74
         }
75 75
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             //Pilote
150 150
             print "<tr>";
151 151
             print '<td class="fieldrequired"> Pilote </td><td >';
152
-            print $html->select_dolusers($_POST["pilot"] ? $_POST["pilot"] : $user->id, 'pilot', 0, null, 0, '', '', 0,0,0,'',0,'','', true);
152
+            print $html->select_dolusers($_POST["pilot"] ? $_POST["pilot"] : $user->id, 'pilot', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
153 153
             print '</td></tr>';
154 154
 
155 155
             //Ballon
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                 <td>
196 196
                 <?php
197 197
                     //organisateur
198
-                    print $html->select_dolusers($_POST["orga"] ? $_POST["orga"] : $user->id, 'orga', 0, null, 0, '', '', 0,0,0,'',0,'','', true);
198
+                    print $html->select_dolusers($_POST["orga"] ? $_POST["orga"] : $user->id, 'orga', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
199 199
                 ?>
200 200
                 </td>
201 201
             </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
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 <td class="fieldrequired"><?php echo $langs->trans('Commande du vol')?></td>
261 261
                 <td class="js-order">
262 262
                     <?php
263
-                     echo $html->selectarray('order_id',$commande->liste_array(2),$_POST['order_id'], 1,0,0,'',0,0,0,'','minwidth200',1);
263
+                     echo $html->selectarray('order_id', $commande->liste_array(2), $_POST['order_id'], 1, 0, 0, '', 0, 0, 0, '', 'minwidth200', 1);
264 264
                     ?>
265 265
                 </td>
266 266
             </tr>
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             <tr class="js-hide-order js-billable-field">
270 270
                 <td class="fieldrequired"><?php echo $langs->trans('Qui a perçu l\'argent')?></td><td>
271 271
                     <?php print $html->select_dolusers($_POST["fk_receiver"] ? $_POST["fk_receiver"] : $user->id,
272
-                        'fk_receiver', true, null, 0, '', '', 0,0,0,'',0,'','', true); ?>
272
+                        'fk_receiver', true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); ?>
273 273
                 </td>
274 274
             </tr>
275 275
 
Please login to merge, or discard this patch.
list.php 1 patch
Spacing   +93 added lines, -93 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');
@@ -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
 }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 // Add fields from hooks
277 277
 $parameters = array();
278 278
 $reshook = $hookmanager->executeHooks('printFieldListSelect',
279
-    $parameters);    // Note that $action and $object may have been modified by hook
279
+    $parameters); // Note that $action and $object may have been modified by hook
280 280
 $sql .= $hookmanager->resPrint;
281 281
 $sql .= " FROM " . MAIN_DB_PREFIX . "bbc_vols as t";
282 282
 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) {
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
 
291 291
 $sql .= " WHERE 1 = 1";
292 292
 
293
-if($search_all){
294
-    $sql .= natural_search(["idBBC_vols",  "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all);
293
+if ($search_all) {
294
+    $sql .= natural_search(["idBBC_vols", "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all);
295 295
 }
296 296
 
297 297
 if ($search_idBBC_vols) {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 }
336 336
 
337 337
 if ($search_is_facture != -1) {
338
-    $sql .= natural_search("is_facture", $search_is_facture,1);
338
+    $sql .= natural_search("is_facture", $search_is_facture, 1);
339 339
 }
340 340
 if ($search_kilometers) {
341 341
     $sql .= natural_search("kilometers", $search_kilometers, 1);
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 // Add where from hooks
371 371
 $parameters = array();
372 372
 $reshook = $hookmanager->executeHooks('printFieldListWhere',
373
-    $parameters);    // Note that $action and $object may have been modified by hook
373
+    $parameters); // Note that $action and $object may have been modified by hook
374 374
 $sql .= $hookmanager->resPrint;
375 375
 $sql .= $db->order($sortfield, $sortorder);
376 376
 //$sql.= $db->plimit($conf->liste_limit+1, $offset);
@@ -412,58 +412,58 @@  discard block
 block discarded – undo
412 412
 if ($limit > 0 && $limit != $conf->liste_limit) {
413 413
     $param .= '&limit=' . $limit;
414 414
 }
415
-if ($search_idBBC_vols  != '') {
415
+if ($search_idBBC_vols != '') {
416 416
     $param .= '&amp;search_idBBC_vols=' . urlencode($search_idBBC_vols);
417 417
 }
418
-if ($search_date  != '') {
418
+if ($search_date != '') {
419 419
     $param .= '&amp;search_date=' . urlencode($search_date);
420 420
 }
421
-if ($search_lieuD  != '') {
421
+if ($search_lieuD != '') {
422 422
     $param .= '&amp;search_lieuD=' . urlencode($search_lieuD);
423 423
 }
424
-if ($search_lieuA  != '') {
424
+if ($search_lieuA != '') {
425 425
     $param .= '&amp;search_lieuA=' . urlencode($search_lieuA);
426 426
 }
427
-if ($search_heureD  != '') {
427
+if ($search_heureD != '') {
428 428
     $param .= '&amp;search_heureD=' . urlencode($search_heureD);
429 429
 }
430
-if ($search_heureA  != '') {
430
+if ($search_heureA != '') {
431 431
     $param .= '&amp;search_heureA=' . urlencode($search_heureA);
432 432
 }
433
-if ($search_BBC_ballons_idBBC_ballons  != '') {
433
+if ($search_BBC_ballons_idBBC_ballons != '') {
434 434
     $param .= '&amp;search_BBC_ballons_idBBC_ballons=' . urlencode($search_BBC_ballons_idBBC_ballons);
435 435
 }
436
-if ($search_nbrPax  != '') {
436
+if ($search_nbrPax != '') {
437 437
     $param .= '&amp;search_nbrPax=' . urlencode($search_nbrPax);
438 438
 }
439
-if ($search_remarque  != '') {
439
+if ($search_remarque != '') {
440 440
     $param .= '&amp;search_remarque=' . urlencode($search_remarque);
441 441
 }
442
-if ($search_incidents  != '') {
442
+if ($search_incidents != '') {
443 443
     $param .= '&amp;search_incidents=' . urlencode($search_incidents);
444 444
 }
445
-if ($search_fk_type  != '') {
445
+if ($search_fk_type != '') {
446 446
     $param .= '&amp;search_fk_type=' . urlencode($search_fk_type);
447 447
 }
448 448
 if ($search_fk_pilot != '') {
449 449
     $param .= '&amp;search_fk_pilot=' . urlencode($search_fk_pilot);
450 450
 }
451
-if ($search_fk_organisateur  != '') {
451
+if ($search_fk_organisateur != '') {
452 452
     $param .= '&amp;search_fk_organisateur=' . urlencode($search_fk_organisateur);
453 453
 }
454
-if ($search_is_facture  != -1) {
454
+if ($search_is_facture != -1) {
455 455
     $param .= '&amp;search_is_facture=' . urlencode($search_is_facture);
456 456
 }
457
-if ($search_kilometers  != '') {
457
+if ($search_kilometers != '') {
458 458
     $param .= '&amp;search_kilometers=' . urlencode($search_kilometers);
459 459
 }
460
-if ($search_cost  != '') {
460
+if ($search_cost != '') {
461 461
     $param .= '&amp;search_cost=' . urlencode($search_cost);
462 462
 }
463
-if ($search_fk_receiver  != '') {
463
+if ($search_fk_receiver != '') {
464 464
     $param .= '&amp;search_fk_receiver=' . urlencode($search_fk_receiver);
465 465
 }
466
-if ($search_justif_kilometers  != '') {
466
+if ($search_justif_kilometers != '') {
467 467
     $param .= '&amp;search_justif_kilometers=' . urlencode($search_justif_kilometers);
468 468
 }
469 469
 if ($search_all != '') {
@@ -507,8 +507,8 @@  discard block
 block discarded – undo
507 507
 
508 508
 
509 509
 $moreHtml = "";
510
-if($search_all !== ""){
511
-    $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>";
510
+if ($search_all !== "") {
511
+    $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 512
 }
513 513
 
514 514
 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 
529 529
 $parameters = array();
530 530
 $reshook = $hookmanager->executeHooks('printFieldPreListTitle',
531
-    $parameters);    // Note that $action and $object may have been modified by hook
531
+    $parameters); // Note that $action and $object may have been modified by hook
532 532
 if (empty($reshook)) {
533 533
     $moreforfilter .= $hookmanager->resPrint;
534 534
 } else {
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 
544 544
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
545 545
 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields,
546
-    $varpage);    // This also change content of $arrayfields
546
+    $varpage); // This also change content of $arrayfields
547 547
 
548 548
 print '<div class="div-table-responsive">';
549 549
 print '<table class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 // Hook fields
640 640
 $parameters = array('arrayfields' => $arrayfields);
641 641
 $reshook = $hookmanager->executeHooks('printFieldListTitle',
642
-    $parameters);    // Note that $action and $object may have been modified by hook
642
+    $parameters); // Note that $action and $object may have been modified by hook
643 643
 print $hookmanager->resPrint;
644 644
 if (!empty($arrayfields['t.datec']['checked'])) {
645 645
     print_liste_field_titre($arrayfields['t.datec']['label'], $_SERVER["PHP_SELF"], "t.datec", "", $param,
@@ -697,18 +697,18 @@  discard block
 block discarded – undo
697 697
 }
698 698
 if (!empty($arrayfields['t.fk_pilot']['checked'])) {
699 699
     print '<td class="liste_titre">';
700
-        print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0,0,0,'',0,'','', true);
700
+        print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
701 701
     print '</td>';
702 702
 }
703 703
 if (!empty($arrayfields['t.fk_organisateur']['checked'])) {
704 704
     print '<td class="liste_titre">';
705
-        print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0,0,0,'',0,'','', true);
705
+        print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true);
706 706
     print '</td>';
707 707
 }
708 708
 
709 709
 if (!empty($arrayfields['t.is_facture']['checked'])) {
710 710
     print '<td class="liste_titre">';
711
-    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>';
711
+    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>';
712 712
     print '</td>';
713 713
 }
714 714
 
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 // Fields from hook
754 754
 $parameters = array('arrayfields' => $arrayfields);
755 755
 $reshook = $hookmanager->executeHooks('printFieldListOption',
756
-    $parameters);    // Note that $action and $object may have been modified by hook
756
+    $parameters); // Note that $action and $object may have been modified by hook
757 757
 print $hookmanager->resPrint;
758 758
 if (!empty($arrayfields['t.datec']['checked'])) {
759 759
     // Date creation
@@ -795,125 +795,125 @@  discard block
 block discarded – undo
795 795
         // Show here line of result
796 796
         print '<tr ' . $bc[$var] . '>';
797 797
 
798
-        if (! empty($arrayfields['t.idBBC_vols']['checked']))
798
+        if (!empty($arrayfields['t.idBBC_vols']['checked']))
799 799
         {
800
-            print '<td>'.$flight->getNomUrl(0).'</td>';
800
+            print '<td>' . $flight->getNomUrl(0) . '</td>';
801 801
 
802
-            if (! $i) $totalarray['nbfield']++;
802
+            if (!$i) $totalarray['nbfield']++;
803 803
         }
804
-        if (! empty($arrayfields['t.date']['checked']))
804
+        if (!empty($arrayfields['t.date']['checked']))
805 805
         {
806 806
             print '<td>';
807 807
                 print dol_print_date($db->jdate($obj->date), '%d-%m-%y');
808 808
             print '</td>';
809 809
 
810
-            if (! $i) $totalarray['nbfield']++;
810
+            if (!$i) $totalarray['nbfield']++;
811 811
         }
812
-        if (! empty($arrayfields['t.lieuD']['checked']))
812
+        if (!empty($arrayfields['t.lieuD']['checked']))
813 813
         {
814
-            print '<td>'.$obj->lieuD.'</td>';
814
+            print '<td>' . $obj->lieuD . '</td>';
815 815
 
816
-            if (! $i) $totalarray['nbfield']++;
816
+            if (!$i) $totalarray['nbfield']++;
817 817
         }
818
-        if (! empty($arrayfields['t.lieuA']['checked']))
818
+        if (!empty($arrayfields['t.lieuA']['checked']))
819 819
         {
820
-            print '<td>'.$obj->lieuA.'</td>';
820
+            print '<td>' . $obj->lieuA . '</td>';
821 821
 
822
-            if (! $i) $totalarray['nbfield']++;
822
+            if (!$i) $totalarray['nbfield']++;
823 823
         }
824
-        if (! empty($arrayfields['t.heureD']['checked']))
824
+        if (!empty($arrayfields['t.heureD']['checked']))
825 825
         {
826
-            print '<td>'.$obj->heureD.'</td>';
826
+            print '<td>' . $obj->heureD . '</td>';
827 827
 
828
-            if (! $i) $totalarray['nbfield']++;
828
+            if (!$i) $totalarray['nbfield']++;
829 829
         }
830
-        if (! empty($arrayfields['t.heureA']['checked']))
830
+        if (!empty($arrayfields['t.heureA']['checked']))
831 831
         {
832
-            print '<td>'.$obj->heureA.'</td>';
832
+            print '<td>' . $obj->heureA . '</td>';
833 833
 
834
-            if (! $i) $totalarray['nbfield']++;
834
+            if (!$i) $totalarray['nbfield']++;
835 835
         }
836
-        if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked']))
836
+        if (!empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked']))
837 837
         {
838
-            print '<td>'.$obj->bal.'</td>';
838
+            print '<td>' . $obj->bal . '</td>';
839 839
 
840
-            if (! $i) $totalarray['nbfield']++;
840
+            if (!$i) $totalarray['nbfield']++;
841 841
         }
842
-        if (! empty($arrayfields['t.nbrPax']['checked']))
842
+        if (!empty($arrayfields['t.nbrPax']['checked']))
843 843
         {
844
-            print '<td>'.$obj->nbrPax.'</td>';
844
+            print '<td>' . $obj->nbrPax . '</td>';
845 845
 
846
-            if (! $i) $totalarray['nbfield']++;
846
+            if (!$i) $totalarray['nbfield']++;
847 847
         }
848
-        if (! empty($arrayfields['t.remarque']['checked']))
848
+        if (!empty($arrayfields['t.remarque']['checked']))
849 849
         {
850
-            print '<td>'.$obj->remarque.'</td>';
850
+            print '<td>' . $obj->remarque . '</td>';
851 851
 
852
-            if (! $i) $totalarray['nbfield']++;
852
+            if (!$i) $totalarray['nbfield']++;
853 853
         }
854
-        if (! empty($arrayfields['t.incidents']['checked']))
854
+        if (!empty($arrayfields['t.incidents']['checked']))
855 855
         {
856
-            print '<td>'.$obj->incidents.'</td>';
856
+            print '<td>' . $obj->incidents . '</td>';
857 857
 
858
-            if (! $i) $totalarray['nbfield']++;
858
+            if (!$i) $totalarray['nbfield']++;
859 859
         }
860
-        if (! empty($arrayfields['t.fk_type']['checked']))
860
+        if (!empty($arrayfields['t.fk_type']['checked']))
861 861
         {
862
-            print '<td>'.$obj->flight_type.'</td>';
862
+            print '<td>' . $obj->flight_type . '</td>';
863 863
 
864
-            if (! $i) $totalarray['nbfield']++;
864
+            if (!$i) $totalarray['nbfield']++;
865 865
         }
866
-        if (! empty($arrayfields['t.fk_pilot']['checked']))
866
+        if (!empty($arrayfields['t.fk_pilot']['checked']))
867 867
         {
868
-            print '<td>'.$obj->pilot.'</td>';
868
+            print '<td>' . $obj->pilot . '</td>';
869 869
 
870
-            if (! $i) $totalarray['nbfield']++;
870
+            if (!$i) $totalarray['nbfield']++;
871 871
         }
872
-        if (! empty($arrayfields['t.fk_organisateur']['checked']))
872
+        if (!empty($arrayfields['t.fk_organisateur']['checked']))
873 873
         {
874
-            print '<td>'.$obj->organisator.'</td>';
874
+            print '<td>' . $obj->organisator . '</td>';
875 875
 
876
-            if (! $i) $totalarray['nbfield']++;
876
+            if (!$i) $totalarray['nbfield']++;
877 877
         }
878
-        if (! empty($arrayfields['t.is_facture']['checked']))
878
+        if (!empty($arrayfields['t.is_facture']['checked']))
879 879
         {
880 880
             $flight->is_facture = $obj->is_facture;
881
-            print '<td>'.$flight->getLibStatut(3).'</td>';
881
+            print '<td>' . $flight->getLibStatut(3) . '</td>';
882 882
 
883
-            if (! $i) $totalarray['nbfield']++;
883
+            if (!$i) $totalarray['nbfield']++;
884 884
         }
885
-        if (! empty($arrayfields['t.kilometers']['checked']))
885
+        if (!empty($arrayfields['t.kilometers']['checked']))
886 886
         {
887
-            if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){
888
-                print '<td>'.$obj->kilometers.' KM</td>';
889
-            }else{
887
+            if ($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) {
888
+                print '<td>' . $obj->kilometers . ' KM</td>';
889
+            } else {
890 890
                 print '<td> - Km</td>';
891 891
             }
892 892
 
893
-            if (! $i) $totalarray['nbfield']++;
893
+            if (!$i) $totalarray['nbfield']++;
894 894
         }
895
-        if (! empty($arrayfields['t.cost']['checked']))
895
+        if (!empty($arrayfields['t.cost']['checked']))
896 896
         {
897
-            if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){
897
+            if (($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0) {
898 898
                 $nbrPax = $obj->nbrPax > 0 ? $obj->nbrPax : 1;
899
-                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{
899
+                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 {
901 901
                 print '<td> - €</td>';
902 902
             }
903 903
 
904
-            if (! $i) $totalarray['nbfield']++;
904
+            if (!$i) $totalarray['nbfield']++;
905 905
         }
906
-        if (! empty($arrayfields['t.fk_receiver']['checked']))
906
+        if (!empty($arrayfields['t.fk_receiver']['checked']))
907 907
         {
908
-            print '<td>'.$obj->receiver.'</td>';
908
+            print '<td>' . $obj->receiver . '</td>';
909 909
 
910
-            if (! $i) $totalarray['nbfield']++;
910
+            if (!$i) $totalarray['nbfield']++;
911 911
         }
912
-        if (! empty($arrayfields['t.justif_kilometers']['checked']))
912
+        if (!empty($arrayfields['t.justif_kilometers']['checked']))
913 913
         {
914
-            print '<td>'.$obj->justif_kilometers.'</td>';
914
+            print '<td>' . $obj->justif_kilometers . '</td>';
915 915
 
916
-            if (! $i) $totalarray['nbfield']++;
916
+            if (!$i) $totalarray['nbfield']++;
917 917
         }
918 918
 
919 919
         // Extra fields
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
         // Fields from hook
939 939
         $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj);
940 940
         $reshook = $hookmanager->executeHooks('printFieldListValue',
941
-            $parameters);    // Note that $action and $object may have been modified by hook
941
+            $parameters); // Note that $action and $object may have been modified by hook
942 942
         print $hookmanager->resPrint;
943 943
         // Date creation
944 944
         if (!empty($arrayfields['t.datec']['checked'])) {
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
 
1009 1009
 $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
1010 1010
 $reshook = $hookmanager->executeHooks('printFieldListFooter',
1011
-    $parameters);    // Note that $action and $object may have been modified by hook
1011
+    $parameters); // Note that $action and $object may have been modified by hook
1012 1012
 print $hookmanager->resPrint;
1013 1013
 
1014 1014
 print '</table>' . "\n";
Please login to merge, or discard this patch.
command/CreateFlightBillCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
             throw new \InvalidArgumentException('Model document is missing');
92 92
         }
93 93
 
94
-        if(!isset($nbrPax) || !is_numeric($nbrPax) || !is_integer($nbrPax)){
94
+        if (!isset($nbrPax) || !is_numeric($nbrPax) || !is_integer($nbrPax)) {
95 95
             throw new \InvalidArgumentException('The number of pax is not correct, an integer is expected');
96 96
         }
97 97
 
Please login to merge, or discard this patch.
class/bbcvols.class.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -247,18 +247,18 @@  discard block
 block discarded – undo
247 247
         $sql .= ' ' . (!isset($this->nbrPax) ? 'NULL' : "'" . $this->db->escape($this->nbrPax) . "'") . ',';
248 248
         $sql .= ' ' . (!isset($this->remarque) ? 'NULL' : "'" . $this->db->escape($this->remarque) . "'") . ',';
249 249
         $sql .= ' ' . (!isset($this->incidents) ? 'NULL' : "'" . $this->db->escape($this->incidents) . "'") . ',';
250
-        $sql .= ' ' . (!isset($this->fk_type) || (int)$this->fk_type === -1 ? 'NULL' : $this->fk_type) . ',';
251
-        $sql .= ' ' . (!isset($this->fk_pilot) || (int)$this->fk_pilot === -1 ? 'NULL' : $this->fk_pilot) . ',';
252
-        $sql .= ' ' . (!isset($this->fk_organisateur) || (int)$this->fk_organisateur === -1 ? 'NULL' : $this->fk_organisateur) . ',';
250
+        $sql .= ' ' . (!isset($this->fk_type) || (int) $this->fk_type === -1 ? 'NULL' : $this->fk_type) . ',';
251
+        $sql .= ' ' . (!isset($this->fk_pilot) || (int) $this->fk_pilot === -1 ? 'NULL' : $this->fk_pilot) . ',';
252
+        $sql .= ' ' . (!isset($this->fk_organisateur) || (int) $this->fk_organisateur === -1 ? 'NULL' : $this->fk_organisateur) . ',';
253 253
         $sql .= ' ' . (!isset($this->is_facture) ? '0' : $this->is_facture) . ',';
254 254
         $sql .= ' ' . (!isset($this->kilometers) || empty($this->kilometers) ? '0' : $this->kilometers) . ',';
255 255
         $sql .= ' ' . (!isset($this->cost) ? 'NULL' : "'" . $this->db->escape($this->cost) . "'") . ',';
256
-        $sql .= ' ' . (!isset($this->fk_receiver) || (int)$this->fk_receiver === -1 ? 'NULL' : $this->fk_receiver) . ',';
256
+        $sql .= ' ' . (!isset($this->fk_receiver) || (int) $this->fk_receiver === -1 ? 'NULL' : $this->fk_receiver) . ',';
257 257
         $sql .= ' ' . (!isset($this->justif_kilometers) ? 'NULL' : "'" . $this->db->escape($this->justif_kilometers) . "'") . ',';
258 258
         $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ',';
259 259
         $sql .= ' ' . "'" . date('Y-m-d H:i:s') . "'" . ',';
260 260
         $sql .= ' ' . "'" . $this->passengerNames . "'" . ',';
261
-        $sql .= ' ' . (!isset($this->orderId) || (int)$this->orderId === -1 ? 'NULL' : $this->orderId) . '';
261
+        $sql .= ' ' . (!isset($this->orderId) || (int) $this->orderId === -1 ? 'NULL' : $this->orderId) . '';
262 262
 
263 263
         $sql .= ')';
264 264
 
@@ -346,28 +346,28 @@  discard block
 block discarded – undo
346 346
 
347 347
                 $this->id = $obj->idBBC_vols;
348 348
 
349
-                $this->idBBC_vols = (int)$obj->idBBC_vols;
349
+                $this->idBBC_vols = (int) $obj->idBBC_vols;
350 350
                 $this->date = $this->db->jdate($obj->date);
351 351
                 $this->lieuD = $obj->lieuD;
352 352
                 $this->lieuA = $obj->lieuA;
353 353
                 $this->heureD = $obj->heureD;
354 354
                 $this->heureA = $obj->heureA;
355
-                $this->BBC_ballons_idBBC_ballons = (int)$obj->BBC_ballons_idBBC_ballons;
355
+                $this->BBC_ballons_idBBC_ballons = (int) $obj->BBC_ballons_idBBC_ballons;
356 356
                 $this->nbrPax = $obj->nbrPax;
357 357
                 $this->remarque = $obj->remarque;
358 358
                 $this->incidents = $obj->incidents;
359
-                $this->fk_type = (int)$obj->fk_type;
360
-                $this->fk_pilot = (int)$obj->fk_pilot;
361
-                $this->fk_organisateur = (int)$obj->fk_organisateur;
362
-                $this->is_facture = (int)$obj->is_facture;
359
+                $this->fk_type = (int) $obj->fk_type;
360
+                $this->fk_pilot = (int) $obj->fk_pilot;
361
+                $this->fk_organisateur = (int) $obj->fk_organisateur;
362
+                $this->is_facture = (int) $obj->is_facture;
363 363
                 $this->kilometers = $obj->kilometers;
364 364
                 $this->cost = $obj->cost;
365
-                $this->fk_receiver = (int)$obj->fk_receiver;
365
+                $this->fk_receiver = (int) $obj->fk_receiver;
366 366
                 $this->justif_kilometers = $obj->justif_kilometers;
367 367
                 $this->date_creation = $obj->date_creation;
368 368
                 $this->date_update = $obj->date_update;
369 369
                 $this->passengerNames = $obj->passenger_names;
370
-                $this->orderId = (int)$obj->order_id;
370
+                $this->orderId = (int) $obj->order_id;
371 371
 
372 372
                 $this->balloon = $this->fetchBalloon();
373 373
                 $this->pilot = $this->fetchUser($this->fk_pilot);
@@ -476,17 +476,17 @@  discard block
 block discarded – undo
476 476
         $sql .= ' nbrPax = ' . (isset($this->nbrPax) ? "'" . $this->db->escape($this->nbrPax) . "'" : "null") . ',';
477 477
         $sql .= ' remarque = ' . (isset($this->remarque) ? "'" . $this->db->escape($this->remarque) . "'" : "null") . ',';
478 478
         $sql .= ' incidents = ' . (isset($this->incidents) ? "'" . $this->db->escape($this->incidents) . "'" : "null") . ',';
479
-        $sql .= ' fk_type = ' . (isset($this->fk_type) && (int)$this->fk_type > 0 ? $this->fk_type : "null") . ',';
480
-        $sql .= ' fk_pilot = ' . (isset($this->fk_pilot) && (int)$this->fk_pilot > 0 ? $this->fk_pilot : "null") . ',';
481
-        $sql .= ' fk_organisateur = ' . (isset($this->fk_organisateur) && (int)$this->fk_organisateur > 0 ? $this->fk_organisateur : "null") . ',';
479
+        $sql .= ' fk_type = ' . (isset($this->fk_type) && (int) $this->fk_type > 0 ? $this->fk_type : "null") . ',';
480
+        $sql .= ' fk_pilot = ' . (isset($this->fk_pilot) && (int) $this->fk_pilot > 0 ? $this->fk_pilot : "null") . ',';
481
+        $sql .= ' fk_organisateur = ' . (isset($this->fk_organisateur) && (int) $this->fk_organisateur > 0 ? $this->fk_organisateur : "null") . ',';
482 482
         $sql .= ' is_facture = ' . (isset($this->is_facture) ? $this->is_facture : "0") . ',';
483 483
         $sql .= ' kilometers = ' . (!empty($this->kilometers) ? $this->kilometers : "0") . ',';
484 484
         $sql .= ' cost = ' . (isset($this->cost) ? "'" . $this->db->escape($this->cost) . "'" : "''") . ',';
485
-        $sql .= ' fk_receiver = ' . (isset($this->fk_receiver) && (int)$this->fk_receiver > 0 ? $this->fk_receiver : "null") . ',';
485
+        $sql .= ' fk_receiver = ' . (isset($this->fk_receiver) && (int) $this->fk_receiver > 0 ? $this->fk_receiver : "null") . ',';
486 486
         $sql .= ' justif_kilometers = ' . (isset($this->justif_kilometers) ? "'" . $this->db->escape($this->justif_kilometers) . "'," : "'',");
487 487
         $sql .= ' date_update = ' . "'" . date('Y-m-d H:i:s') . "',";
488 488
         $sql .= ' passenger_names = ' . "'" . trim($this->passengerNames) . "',";
489
-        $sql .= ' order_id = ' .  (!isset($this->orderId) || (int)$this->orderId === -1 ? 'null' : $this->orderId);
489
+        $sql .= ' order_id = ' . (!isset($this->orderId) || (int) $this->orderId === -1 ? 'null' : $this->orderId);
490 490
 
491 491
         $sql .= ' WHERE idBBC_vols=' . $this->idBBC_vols;
492 492
 
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
      */
854 854
     public function getAmountPerPassenger()
855 855
     {
856
-        $nbrPax = $this->nbrPax > 0 ? $this->nbrPax : 1 ;
856
+        $nbrPax = $this->nbrPax > 0 ? $this->nbrPax : 1;
857 857
         return $this->cost / $nbrPax;
858 858
     }
859 859
 
Please login to merge, or discard this patch.
facture.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -124,12 +124,12 @@
 block discarded – undo
124 124
  * Put here all code to do according to value of "action" parameter
125 125
  */
126 126
 if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
127
-    try{
128
-        $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax);
127
+    try {
128
+        $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount, $nbrPax);
129 129
         $handler->handle($command);
130 130
         Header("Location: card.php?id=" . $flight->getId());
131
-    }catch (\Exception $e){
132
-        dol_syslog($e->getMessage(),LOG_ERR);
131
+    } catch (\Exception $e) {
132
+        dol_syslog($e->getMessage(), LOG_ERR);
133 133
         dol_htmloutput_mesg("Facture non créée", '', 'error');
134 134
     }
135 135
 }
Please login to merge, or discard this patch.
card.php 1 patch
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
 }
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     print '<div class="tabsAction">' . "\n";
378 378
     $parameters = array();
379 379
     $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object,
380
-        $action);    // Note that $action and $object may have been modified by hook
380
+        $action); // Note that $action and $object may have been modified by hook
381 381
     if ($reshook < 0) {
382 382
         setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
383 383
     }
@@ -390,14 +390,14 @@  discard block
 block discarded – undo
390 390
         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";
391 391
     }
392 392
 
393
-    if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture() && $object->hasReceiver()){
394
-        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";
393
+    if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture() && $object->hasReceiver()) {
394
+        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";
395 395
     }
396 396
     ?>
397 397
 
398
-    <?php if($user->rights->flightlog->vol->financial && !$object->isBilled() ): ?>
398
+    <?php if ($user->rights->flightlog->vol->financial && !$object->isBilled()): ?>
399 399
         <div class="inline-block divButAction">
400
-               <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s' , $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED);?>">
400
+               <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED); ?>">
401 401
                    <?php echo $langs->trans("Marqué comme facturé ") ?>
402 402
                </a>
403 403
         </div>
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
     </div>
407 407
 <?php
408
-    if($user->rights->flightlog->vol->financial){
408
+    if ($user->rights->flightlog->vol->financial) {
409 409
         print '<div class="fichecenter"><div class="fichehalfleft">';
410 410
         $form->showLinkedObjectBlock($object);
411 411
         print '</div></div>';
Please login to merge, or discard this patch.