Completed
Push — feature/multi_order ( 3f8ee1...ce6e8c )
by Laurent
01:34
created
core/triggers/interface_50001_modFlightLog_mailOnIncident.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  */
17 17
 
18 18
 
19
-require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
19
+require_once DOL_DOCUMENT_ROOT . '/core/triggers/dolibarrtriggers.class.php';
20 20
 dol_include_once('/flightlog/class/bbcvols.class.php');
21 21
 dol_include_once('/core/class/CMailFile.class.php');
22 22
 
@@ -78,23 +78,23 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
80 80
 	{
81
-        if (empty($conf->flightlog->enabled) || empty($conf->workflow->enabled)){
81
+        if (empty($conf->flightlog->enabled) || empty($conf->workflow->enabled)) {
82 82
             return 0;
83 83
         }
84 84
 
85
-        if(empty($conf->global->WORKFLOW_BBC_FLIGHTLOG_SEND_MAIL_ON_INCIDENT)){
85
+        if (empty($conf->global->WORKFLOW_BBC_FLIGHTLOG_SEND_MAIL_ON_INCIDENT)) {
86 86
             return 0;
87 87
         }
88 88
 
89
-        if($action !== 'BBC_FLIGHT_LOG_ADD_FLIGHT'){
89
+        if ($action !== 'BBC_FLIGHT_LOG_ADD_FLIGHT') {
90 90
             return 0;
91 91
         }
92 92
 
93
-        if(empty(trim($object->incidents)) && empty(trim($object->remarque))){
93
+        if (empty(trim($object->incidents)) && empty(trim($object->remarque))) {
94 94
             return 0;
95 95
         }
96 96
 
97
-        if(!empty($conf->global->MAIN_DISABLE_ALL_MAILS)){
97
+        if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
98 98
             return 0;
99 99
         }
100 100
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         );
128 128
 
129 129
 
130
-        if (! $mailfile->sendfile())
130
+        if (!$mailfile->sendfile())
131 131
         {
132 132
             dol_syslog("Error while sending mail in flight log module : incident", LOG_ERR);
133 133
         }
Please login to merge, or discard this patch.
core/modules/modFlightLog.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -341,7 +341,7 @@
 block discarded – undo
341 341
      */
342 342
     private function initPermissions()
343 343
     {
344
-        $this->rights = array();        // Permission array used by this module
344
+        $this->rights = array(); // Permission array used by this module
345 345
         $r = 0;
346 346
 
347 347
         $this->rights[$r][0] = 9993;
Please login to merge, or discard this patch.
admin/vol.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
  * Actions
26 26
  */
27 27
 // Save
28
-if($action === ACTION_SAVE){
29
-    foreach($services as $flightTypeId => $serviceId){
28
+if ($action === ACTION_SAVE) {
29
+    foreach ($services as $flightTypeId => $serviceId) {
30 30
         $res = $flightType->fetch($flightTypeId);
31
-        if($res > 0 ){
31
+        if ($res > 0) {
32 32
             $flightType->fkService = $serviceId;
33 33
             $flightType->update($user);
34 34
         }
35 35
 
36
-        dolibarr_set_const($db, 'BBC_POINTS_BONUS_'.$flightTypeId, GETPOST('points_bonus_'.$flightTypeId), 'chaine', 0, 'Points pour le vol T'.$flightTypeId, $conf->entity);
36
+        dolibarr_set_const($db, 'BBC_POINTS_BONUS_' . $flightTypeId, GETPOST('points_bonus_' . $flightTypeId), 'chaine', 0, 'Points pour le vol T' . $flightTypeId, $conf->entity);
37 37
     }
38 38
 
39 39
     dolibarr_set_const($db, 'BBC_FLIGHT_TYPE_CUSTOMER', GETPOST('customer_product'), 'chaine', 0, '', $conf->entity);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 <tr class="<?= $flightTypeLine->id % 2 == 0 ? "pair" : "impair" ?>">
72 72
                     <td>(T<?= $flightTypeLine->numero ?>) - <?= $flightTypeLine->nom ?></td>
73 73
                     <td>
74
-                        <?php $form->select_produits($flightTypeLine->fkService, 'idprod['.$flightTypeLine->id.']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?>
74
+                        <?php $form->select_produits($flightTypeLine->fkService, 'idprod[' . $flightTypeLine->id . ']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?>
75 75
                     </td>
76 76
                 </tr>
77 77
             <?php endforeach; ?>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                 </td>
84 84
                 <td>
85 85
                     <?php $form->select_produits($conf->global->BBC_FLIGHT_TYPE_CUSTOMER, 'customer_product',
86
-                        $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?>
86
+                        $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?>
87 87
                 </td>
88 88
             </tr>
89 89
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                     <label for="points_bonus_<?php echo $flightTypeLine->numero; ?>">
107 107
                         (T<?php echo $flightTypeLine->numero ?>) - <?php echo $flightTypeLine->nom ?>
108 108
                     </label>
109
-                    <?php $prop = 'BBC_POINTS_BONUS_'.$flightTypeLine->numero; ?>
109
+                    <?php $prop = 'BBC_POINTS_BONUS_' . $flightTypeLine->numero; ?>
110 110
                     <input type="number" id="points_bonus_<?php echo $flightTypeLine->numero; ?>" name="points_bonus_<?php echo $flightTypeLine->numero; ?>" value="<?php echo $conf->global->$prop?>" />
111 111
                     <br/>
112 112
                 <?php endforeach; ?>
Please login to merge, or discard this patch.
command/CreateFlightBillCommandHandlerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__.'/CreateFlightBillCommandHandler.php';
4
-require_once __DIR__.'/CreateFlightBillTransactionalCommandHandler.php';
3
+require_once __DIR__ . '/CreateFlightBillCommandHandler.php';
4
+require_once __DIR__ . '/CreateFlightBillTransactionalCommandHandler.php';
5 5
 
6 6
 /**
7 7
  * @author Laurent De Coninck <[email protected]>
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @return CreateFlightBillCommandHandler
13 13
      */
14
-    public static function factory($db, $conf, $user, $langs){
14
+    public static function factory($db, $conf, $user, $langs) {
15 15
         return new CreateFlightBillTransactionalCommandHandler($db, $conf, $user, $langs);
16 16
     }
17 17
 
Please login to merge, or discard this patch.
generateMonthlyBilling.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
 if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
96 96
     try {
97 97
 
98
-        $command = new CreateMonthBillCommand( $type, $publicNote, $privateNote, $year, $month);
98
+        $command = new CreateMonthBillCommand($type, $publicNote, $privateNote, $year, $month);
99 99
         $handler->handle($command);
100 100
         dol_htmloutput_mesg('Génération : OK');
101 101
     } catch (Exception $e) {
Please login to merge, or discard this patch.
core/cron/BbcMonthlyFlightsBillCron.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 
54 54
         try {
55 55
 
56
-            if(date('d')>=15){
56
+            if (date('d') >= 15) {
57 57
                 dol_syslog('Monthly bill generation : date over');
58 58
                 return -2;
59 59
             }
Please login to merge, or discard this patch.
tabs/project/instructions.php 1 patch
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.
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.
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.