Completed
Push — master ( da5e92...3bfafa )
by Laurent
02:26
created
command/CreateFlightCommandHandler.php 1 patch
Spacing   +8 added lines, -8 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();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         }
88 88
 
89 89
         $result = $vol->create($this->user);
90
-        if($result <= 0){
90
+        if ($result <= 0) {
91 91
             throw new Exception();
92 92
         }
93 93
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $flight->fetch($flight->id);
109 109
 
110
-        if(!$flight->isLinkedToOrder()){
110
+        if (!$flight->isLinkedToOrder()) {
111 111
             return;
112 112
         }
113 113
 
@@ -118,17 +118,17 @@  discard block
 block discarded – undo
118 118
 
119 119
         $qtyOrder = 0;
120 120
         /** @var OrderLine $currentOrderLine */
121
-        foreach($order->lines as $currentOrderLine){
122
-            $qtyOrder += (int)$currentOrderLine->qty;
121
+        foreach ($order->lines as $currentOrderLine) {
122
+            $qtyOrder += (int) $currentOrderLine->qty;
123 123
         }
124 124
 
125 125
         $passangersCount = $this->numberOfPassengersLinkedToOrder($order->id);
126 126
 
127
-        if($passangersCount != $qtyOrder){
127
+        if ($passangersCount != $qtyOrder) {
128 128
             return;
129 129
         }
130 130
 
131
-        if($order->statut == Commande::STATUS_VALIDATED){
131
+        if ($order->statut == Commande::STATUS_VALIDATED) {
132 132
             $order->cloture($this->user);
133 133
         }
134 134
     }
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.