Completed
Push — feature/number_enhancement ( b65f30 )
by Laurent
01:38
created
Form/InputDate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function setValue($value)
30 30
     {
31
-        if($value instanceof \DateTime){
31
+        if ($value instanceof \DateTime) {
32 32
             return parent::setValue($value->format('Y-m-d'));
33 33
         }
34 34
 
Please login to merge, or discard this patch.
Form/FlightForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @param array $options
28 28
      * @param \User $user
29 29
      */
30
-    public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options,\User $user)
30
+    public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options, \User $user)
31 31
     {
32 32
 
33 33
         parent::__construct('flight_form', FormInterface::METHOD_POST, $this->buildOptionsfromConfiguration($options));
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $flight = $object;
84 84
 
85 85
         // Quick fix - Fixme by a factory on this form.
86
-        if($this->user->rights->flightlog->vol->advanced){
86
+        if ($this->user->rights->flightlog->vol->advanced) {
87 87
             return parent::bind($object);
88 88
         }
89 89
 
Please login to merge, or discard this patch.
command/CreateExpenseNoteCommandHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@
 block discarded – undo
272 272
         $expenseNoteUser = new User($this->db);
273 273
         $expenseNoteUser->id = $currentMissionUserId;
274 274
         $id = $expenseNote->create($expenseNoteUser);
275
-        if($id < 0){
275
+        if ($id < 0) {
276 276
             return null;
277 277
         }
278 278
 
Please login to merge, or discard this patch.
query/GetPilotsWithMissionsQueryHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
                         $pilotLastname = $obj->lastname;
53 53
                         $pilotFirstname = $obj->firstname;
54 54
 
55
-                        if($query->isPilotsOnly()){
55
+                        if ($query->isPilotsOnly()) {
56 56
                             $result->addPilot($pilotId, $pilotFirstname, $pilotLastname);
57
-                        }else{
57
+                        } else {
58 58
                             $result->addMission($obj->quartil, $pilotId, $pilotFirstname, $pilotLastname,
59 59
                                 $obj->number_flights, $obj->total_kilometers);
60 60
                         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $sql .= " , SUM(VOL.kilometers) as total_kilometers ";
80 80
         $sql .= " , COUNT(VOL.idBBC_vols) as number_flights";
81 81
 
82
-        if(!$query->isPilotsOnly()){
82
+        if (!$query->isPilotsOnly()) {
83 83
             $sql .= " , QUARTER(VOL.date) as quartil ";
84 84
         }
85 85
 
Please login to merge, or discard this patch.
command/CreateFlightCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -397,7 +397,7 @@
 block discarded – undo
397 397
     /**
398 398
      * @return bool
399 399
      */
400
-    public function hasOrderId(){
400
+    public function hasOrderId() {
401 401
         return count($this->orderIds) > 0;
402 402
     }
403 403
 }
404 404
\ No newline at end of file
Please login to merge, or discard this patch.
command/ClassifyFlight.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
      */
27 27
     public function __construct($flightId, $projectId)
28 28
     {
29
-        $this->flightId = (int)$flightId;
30
-        $this->projectId = (int)$projectId;
29
+        $this->flightId = (int) $flightId;
30
+        $this->projectId = (int) $projectId;
31 31
     }
32 32
 
33 33
     /**
Please login to merge, or discard this patch.
command/CreateOrderCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
         $this->language = $form->language;
125 125
         $this->userId = $userId;
126 126
         $this->publicComment = $form->isCommentPublic == 1;
127
-        $this->socid = (int)$form->socid;
127
+        $this->socid = (int) $form->socid;
128 128
     }
129 129
 
130 130
     /**
Please login to merge, or discard this patch.
validators/SimpleOrderValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@
 block discarded – undo
52 52
         if (!isset($value->socid) && empty($value->email) && empty($value->phone)) {
53 53
             $this->addWarning('Soit l\'e-mail soit le téléphone n\'a pas été complété');
54 54
         }
55
-        if (empty($value->nbrPax) || (int)$value->nbrPax <= 0) {
55
+        if (empty($value->nbrPax) || (int) $value->nbrPax <= 0) {
56 56
             $this->addError('nbrPax', 'Le nombre de passagers doit être plus grand que 0.');
57 57
         }
58 58
 
59
-        if ((int)$value->nbrPax > 0) {
60
-            $costPerPax = $value->cost / (int)$value->nbrPax;
59
+        if ((int) $value->nbrPax > 0) {
60
+            $costPerPax = $value->cost / (int) $value->nbrPax;
61 61
             if ($costPerPax < $this->getMinPrice()) {
62 62
                 $this->addError('cost',
63 63
                     sprintf('Le prix demandé par passagé est trop peu élevé. Un minimum de %s est demandé',
Please login to merge, or discard this patch.
addOrder.php 1 patch
Spacing   +34 added lines, -34 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;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 $msg = '';
60 60
 $socid = null;
61 61
 
62
-if (GETPOST('socid', 'int') > 0){
62
+if (GETPOST('socid', 'int') > 0) {
63 63
     $socid = GETPOST('socid', 'int');
64 64
     $customer->fetch($socid);
65 65
 }
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 
71 71
         $formObject = new stdClass();
72 72
         $formObject->socid = $socid;
73
-        $formObject->name = GETPOST('name','alpha');
74
-        $formObject->firstname = GETPOST('firstname','alpha');
75
-        $formObject->zip = GETPOST('zipcode','alpha');
73
+        $formObject->name = GETPOST('name', 'alpha');
74
+        $formObject->firstname = GETPOST('firstname', 'alpha');
75
+        $formObject->zip = GETPOST('zipcode', 'alpha');
76 76
         $formObject->town = GETPOST('town', 'alpha');
77 77
         $formObject->state = GETPOST('state_id', 'int');
78 78
         $formObject->phone = GETPOST('phone', 'alpha');
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 
90 90
         if ($validator->isValid($formObject, $_REQUEST)) {
91 91
             $createOrderCommand = new CreateOrderCommand($formObject, $user->id);
92
-            try{
93
-                $handler = new CreateOrderCommandHandler($db, $conf,$user,$langs,$modCodeClient, $modCodeFournisseur);
92
+            try {
93
+                $handler = new CreateOrderCommandHandler($db, $conf, $user, $langs, $modCodeClient, $modCodeFournisseur);
94 94
                 $handler->handle($createOrderCommand);
95 95
 
96 96
                 $msg = '<div class="success ok">Commande et tiers créés. </div>';
@@ -125,18 +125,18 @@  discard block
 block discarded – undo
125 125
 ?>
126 126
 
127 127
     <!-- Success message with reference -->
128
-    <?php if($successMessage): ?>
128
+    <?php if ($successMessage): ?>
129 129
         <div class="bbc-style">
130 130
             <p class="cadre_msg1">
131 131
                 Vous avez généré la facture et créé un tiers.<br/>
132 132
                 Merci,
133 133
             </p>
134 134
 
135
-            <?php if(count($validator->getWarningMessages()) > 0):?>
135
+            <?php if (count($validator->getWarningMessages()) > 0):?>
136 136
                 <div class="box box-warning">
137 137
                     <p>Ceci sont des messages d'attention mais qui ne bloquent pas la création de la commande</p>
138 138
                     <ul>
139
-                        <?php foreach($validator->getWarningMessages() as $warningMessage): ?>
139
+                        <?php foreach ($validator->getWarningMessages() as $warningMessage): ?>
140 140
                             <li class="warning"><?php echo $warningMessage; ?></li>
141 141
                         <?php endforeach; ?>
142 142
                     </ul>
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         <p>
196 196
             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>
197 197
             Si vous avez un doute sur la manière d'encoder la commande, veuillez me contacter AVANT de soumettre le dit formulaire.<br/>
198
-            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>
198
+            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>
199 199
         </p>
200 200
     </div>
201 201
     <form class="flight-form" name='add' method="post">
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                         $(document).ready(function() {
218 218
                             $("#socid").change(function() {
219 219
                                 var socid = $(this).val();
220
-                                window.location.href = "<?php echo $_SERVER["PHP_SELF"].'?socid="+socid' ?>
220
+                                window.location.href = "<?php echo $_SERVER["PHP_SELF"] . '?socid="+socid' ?>
221 221
                             });
222 222
                         });
223 223
                     </script>
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             </tr>
227 227
 
228 228
 
229
-            <?php if($socid === null): ?>
229
+            <?php if ($socid === null): ?>
230 230
                 <!-- Nom -->
231 231
                 <tr>
232 232
                     <td class="fieldrequired">
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                         <?php echo $langs->trans('DefaultLang'); ?>
296 296
                     </td>
297 297
                     <td>
298
-                        <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT,'default_lang',0,0,1,0,0,'maxwidth200onsmartphone'); ?>
298
+                        <?php echo $formAdmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); ?>
299 299
                     </td>
300 300
                 </tr>
301 301
 
@@ -305,16 +305,16 @@  discard block
 block discarded – undo
305 305
                         <?php echo $langs->trans('Region'); ?>
306 306
                     </td>
307 307
                     <td>
308
-                        <?php print $formcompany->select_state($formObject->state,'BE'); ?>
308
+                        <?php print $formcompany->select_state($formObject->state, 'BE'); ?>
309 309
                     </td>
310 310
                 </tr>
311 311
 
312 312
                 <?php
313 313
                 // Zip / Town
314
-                print '<tr><td>'.fieldLabel('Zip','zipcode').'</td><td>';
315
-                        print $formcompany->select_ziptown($formObject->town,'zipcode',array('town','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
316
-                        print '</td><td>'.fieldLabel('Town','town').'</td><td>';
317
-                        print $formcompany->select_ziptown($formObject->zip,'town',array('zipcode','selectcountry_id','state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
314
+                print '<tr><td>' . fieldLabel('Zip', 'zipcode') . '</td><td>';
315
+                        print $formcompany->select_ziptown($formObject->town, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
316
+                        print '</td><td>' . fieldLabel('Town', 'town') . '</td><td>';
317
+                        print $formcompany->select_ziptown($formObject->zip, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent');
318 318
                         print '</td></tr>';
319 319
                 ?>
320 320
 
@@ -338,16 +338,16 @@  discard block
 block discarded – undo
338 338
                         <?php
339 339
                         if (empty($conf->global->MAIN_DISABLEVATCHECK)): ?>
340 340
 
341
-                            <?php if (! empty($conf->use_javascript_ajax)): ?>
341
+                            <?php if (!empty($conf->use_javascript_ajax)): ?>
342 342
                                 <script language="JavaScript" type="text/javascript">
343 343
                                 function CheckVAT(a) {
344
-                                    <?php print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,300);"; ?>
344
+                                    <?php print "newpopup('" . DOL_URL_ROOT . "/societe/checkvat/checkVatPopup.php?vatNumber='+a,'" . dol_escape_js($langs->trans("VATIntraCheckableOnEUSite")) . "',500,300);"; ?>
345 345
                                 }
346 346
                                 </script>
347 347
                                 <a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT(document.add.tva_intra.value);"><?php echo $langs->trans("VATIntraCheck"); ?></a>
348
-                                <?php echo $html->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); ?>
348
+                                <?php echo $html->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->trans("VATIntraCheck")), 1); ?>
349 349
                             <?php else: ?>
350
-                                <a href="<?php echo $langs->transcountry("VATIntraCheckURL",$object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help'); ?></a>
350
+                                <a href="<?php echo $langs->transcountry("VATIntraCheckURL", $object->country_id); ?>" target="_blank"><?php echo img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help'); ?></a>
351 351
                             <?php endif; ?>
352 352
                        <?php endif; ?>
353 353
                     </td>
@@ -402,10 +402,10 @@  discard block
 block discarded – undo
402 402
             <tr>
403 403
                 <td><?php echo $langs->trans('Le commentaire doit-il figurer sur la commande') ?></td>
404 404
                 <td>
405
-                    <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1)?'checked="checked"' : ''; ?>/>
405
+                    <input type="radio" id="public_comment" name="public_comment" value="1" <?php echo ($formObject->isCommentPublic == 1) ? 'checked="checked"' : ''; ?>/>
406 406
                     <label for="public_comment">Oui</label>
407 407
                     -
408
-                    <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0)?'checked="checked"' : ''; ?>/>
408
+                    <input type="radio" id="private_comment" name="public_comment" value="0" <?php echo ($formObject == null || $formObject->isCommentPublic === null || $formObject->isCommentPublic === 0) ? 'checked="checked"' : ''; ?>/>
409 409
                     <label for="private_comment">Non</label>
410 410
                 </td>
411 411
             </tr>
Please login to merge, or discard this patch.