Completed
Push — feature/multiple_order_one_fli... ( 4a4e05 )
by Laurent
02:16
created
readFlights.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
 print '<td>' . $totalT3 . '</td>';
275 275
 print '<td></td>';
276 276
 
277
-print '<td>' . $totalT4. '</td>';
277
+print '<td>' . $totalT4 . '</td>';
278 278
 print '<td></td>';
279 279
 
280 280
 print '<td>' . $totalT5 . '</td>';
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.
command/CreateOrderCommandHandler.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
 
112 112
     /**
113 113
      * @param Product   $flightProduct
114
-     * @param float|int $pricePerPax
114
+     * @param integer $pricePerPax
115 115
      *
116 116
      * @return float|int
117 117
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
         $name = $command->getName() . ' ' . $command->getFirstname();
133 133
 
134 134
         $existingCustomers = $this->societe->searchByName($name);
135
-        if(count($existingCustomers) > 0){
135
+        if (count($existingCustomers) > 0) {
136 136
             $this->societe = $existingCustomers[0];
137 137
             return $this->societe;
138 138
         }
Please login to merge, or discard this patch.
addFlight.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 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
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@
 block discarded – undo
262 262
                 <td class="fieldrequired"><?php echo $langs->trans('Commande du vol')?></td>
263 263
                 <td class="js-order">
264 264
                     <?php
265
-                     echo $html->selectarray('order_id',$commande->liste_array(2),$_POST['order_id'], 1,0,0,'multiple style="width:100%"',0,0,0,'','',1);
265
+                        echo $html->selectarray('order_id',$commande->liste_array(2),$_POST['order_id'], 1,0,0,'multiple style="width:100%"',0,0,0,'','',1);
266 266
                     ?>
267 267
                 </td>
268 268
             </tr>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             ->setGroupedFlight($isGroupedFlight)
61 61
             ->setOrderIds($orderIds);
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
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                     <input type="number"
239 239
                            name="nbrPax"
240 240
                            class="flat <?php echo $validator->hasError('nbrPax') ? 'error' : '' ?>"
241
-                           value="<?php echo $_POST['nbrPax']?: 0 ?>"/>
241
+                           value="<?php echo $_POST['nbrPax'] ?: 0 ?>"/>
242 242
                 </td>
243 243
             </tr>
244 244
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 <td class="fieldrequired"><?php echo $langs->trans('Commande du vol')?></td>
263 263
                 <td class="js-order">
264 264
                     <?php
265
-                     echo $html->selectarray('order_id',$commande->liste_array(2),$_POST['order_id'], 1,0,0,'multiple style="width:100%"',0,0,0,'','',1);
265
+                     echo $html->selectarray('order_id', $commande->liste_array(2), $_POST['order_id'], 1, 0, 0, 'multiple style="width:100%"', 0, 0, 0, '', '', 1);
266 266
                     ?>
267 267
                 </td>
268 268
             </tr>
Please login to merge, or discard this patch.
addOrder.php 2 patches
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,8 +25,10 @@  discard block
 block discarded – undo
25 25
 foreach ($dirsociete as $dirroot)
26 26
 {
27 27
     $res=dol_include_once($dirroot.$module.'.php');
28
-    if ($res) break;
29
-}
28
+    if ($res) {
29
+        break;
30
+    }
31
+    }
30 32
 $modCodeClient = new $module;
31 33
 // Load object modCodeFournisseur
32 34
 $module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
@@ -38,8 +40,10 @@  discard block
 block discarded – undo
38 40
 foreach ($dirsociete as $dirroot)
39 41
 {
40 42
     $res=dol_include_once($dirroot.$module.'.php');
41
-    if ($res) break;
42
-}
43
+    if ($res) {
44
+        break;
45
+    }
46
+    }
43 47
 $modCodeFournisseur = new $module;
44 48
 
45 49
 // Load translation files required by the page
@@ -302,8 +306,11 @@  discard block
 block discarded – undo
302 306
                             </script>
303 307
                             <a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT(document.add.tva_intra.value);"><?php echo $langs->trans("VATIntraCheck"); ?></a>
304 308
                             <?php echo $html->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); ?>
305
-                        <?php else: ?>
306
-                            <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a>
309
+                        <?php else {
310
+    : ?>
311
+                            <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id);
312
+}
313
+?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a>
307 314
                         <?php endif; ?>
308 315
                    <?php endif; ?>
309 316
                 </td>
Please login to merge, or discard this 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.
validators/FlightValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
      */
96 96
     private function checkBillingInformation($vol, $context)
97 97
     {
98
-        if($vol->isLinkedToOrder()){
98
+        if ($vol->isLinkedToOrder()) {
99 99
             return $this;
100 100
         }
101 101
 
Please login to merge, or discard this patch.
command/CreateOrderCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     /**
229 229
      * @return boolean
230 230
      */
231
-    public function hasTVA(){
231
+    public function hasTVA() {
232 232
         return !empty($this->tva);
233 233
     }
234 234
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     /**
260 260
      * @return bool
261 261
      */
262
-    public function isCommentPublic(){
262
+    public function isCommentPublic() {
263 263
         return $this->publicComment;
264 264
     }
265 265
 
Please login to merge, or discard this patch.
card.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 $isAllowedEdit = ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id));
71 71
 $isAllowedDelete = ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->is_facture));
72
-$permissiondellink=$user->rights->flightlog->vol->financial;
72
+$permissiondellink = $user->rights->flightlog->vol->financial;
73 73
 
74 74
 $search_idBBC_vols = GETPOST('search_idBBC_vols', 'int');
75 75
 $search_lieuD = GETPOST('search_lieuD', 'alpha');
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
117 117
 
118 118
 // Load object
119
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
120
-include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
119
+include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
120
+include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
121 121
 
122 122
 // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
123 123
 $hookmanager->initHooks(array('bbcvols'));
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
 $parameters = array();
144 144
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object,
145
-    $action);    // Note that $action and $object may have been modified by some hooks
145
+    $action); // Note that $action and $object may have been modified by some hooks
146 146
 if ($reshook < 0) {
147 147
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
148 148
 }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
     print '<div class="tabsAction">' . "\n";
377 377
     $parameters = array();
378 378
     $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object,
379
-        $action);    // Note that $action and $object may have been modified by hook
379
+        $action); // Note that $action and $object may have been modified by hook
380 380
     if ($reshook < 0) {
381 381
         setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
382 382
     }
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
         print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=delete">' . $langs->trans('Delete') . '</a></div>' . "\n";
390 390
     }
391 391
 
392
-    if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){
393
-        print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id.'">' . $langs->trans("Facturer") . '</a></div>' . "\n";
392
+    if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) {
393
+        print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id . '">' . $langs->trans("Facturer") . '</a></div>' . "\n";
394 394
     }
395 395
     ?>
396 396
 
397
-    <?php if($user->rights->flightlog->vol->financial && !$object->isBilled() ): ?>
397
+    <?php if ($user->rights->flightlog->vol->financial && !$object->isBilled()): ?>
398 398
         <div class="inline-block divButAction">
399
-               <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s' , $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED);?>">
399
+               <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id, ACTION_FLAG_BILLED); ?>">
400 400
                    <?php echo $langs->trans("Marqué comme facturé ") ?>
401 401
                </a>
402 402
         </div>
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
     </div>
406 406
 <?php
407
-    if($user->rights->flightlog->vol->financial){
407
+    if ($user->rights->flightlog->vol->financial) {
408 408
         print '<div class="fichecenter"><div class="fichehalfleft">';
409 409
         $form->showLinkedObjectBlock($object);
410 410
         print '</div></div>';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'),
348 348
             $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1);
349 349
         print $formconfirm;
350
-    }elseif ($user->rights->flightlog->vol->financial && !$object->isBilled() && $action == ACTION_FLAG_BILLED) {
350
+    } elseif ($user->rights->flightlog->vol->financial && !$object->isBilled() && $action == ACTION_FLAG_BILLED) {
351 351
         $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Marque comme facturé'),
352 352
             $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '', 0, 1);
353 353
         print $formconfirm;
Please login to merge, or discard this patch.
command/CreateFlightCommandHandler.php 1 patch
Spacing   +10 added lines, -10 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,28 +111,28 @@  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
 
118
-        foreach($this->getOrderFromFlight($flight) as $order){
118
+        foreach ($this->getOrderFromFlight($flight) as $order) {
119 119
 
120 120
             $order->add_object_linked('flightlog_bbcvols', $flight->getId());
121 121
             $order->fetch_lines();
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.