Passed
Push — dev ( f7d146...05f415 )
by Rafael
60:50
created
public/htdocs/fichinter/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                                                     $mult = 3600 * 24 * 7;
388 388
                                                     break;
389 389
                                                 case 'm':
390
-                                                    $mult = (int)3600 * 24 * (365 / 12); // Average month duration
390
+                                                    $mult = (int) 3600 * 24 * (365 / 12); // Average month duration
391 391
                                                     break;
392 392
                                                 case 'y':
393 393
                                                     $mult = 3600 * 24 * 365;
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
     } else {
1077 1077
         print '<form name="fichinter" action="' . $_SERVER['PHP_SELF'] . '" method="POST">';
1078 1078
         print '<input type="hidden" name="token" value="' . newToken() . '">';
1079
-        print '<input type="hidden" name="action" value="create">';     // We go back to create action
1079
+        print '<input type="hidden" name="action" value="create">'; // We go back to create action
1080 1080
         print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
1081 1081
 
1082 1082
         print dol_get_fiche_head('');
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
         $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
1366 1366
         $sql .= ' ft.date as date_intervention';
1367 1367
         $sql .= ' FROM ' . MAIN_DB_PREFIX . 'fichinterdet as ft';
1368
-        $sql .= ' WHERE ft.fk_fichinter = ' . ((int)$object->id);
1368
+        $sql .= ' WHERE ft.fk_fichinter = ' . ((int) $object->id);
1369 1369
         if (getDolGlobalString('FICHINTER_HIDE_EMPTY_DURATION')) {
1370 1370
             $sql .= ' AND ft.duree <> 0';
1371 1371
         }
Please login to merge, or discard this patch.
public/htdocs/mrp/mo_card.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $objectbomchildline = new BOMLine($db);
163 163
 
164 164
         foreach ($TBomLineId as $id_bom_line) {
165
-            $object = new Mo($db);  // modified by the actions_addupdatedelete.inc.php
165
+            $object = new Mo($db); // modified by the actions_addupdatedelete.inc.php
166 166
 
167 167
             $objectbomchildline->fetch($id_bom_line);
168 168
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             $res = $object->add_object_linked('mo', $mo_parent->id);
181 181
         }
182 182
 
183
-        header("Location: " . dol_buildpath('/mrp/mo_card.php?id=' . ((int)$mo_parent->id), 1));
183
+        header("Location: " . dol_buildpath('/mrp/mo_card.php?id=' . ((int) $mo_parent->id), 1));
184 184
         exit;
185 185
     } elseif ($action == 'confirm_cancel' && $confirm == 'yes' && !empty($permissiontoadd)) {
186 186
         $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0);
Please login to merge, or discard this patch.
public/htdocs/core/lib/loan.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,8 +114,8 @@
 block discarded – undo
114 114
     $mens = price2num($mens);
115 115
     $capital = price2num($capital);
116 116
     $rate = price2num($rate);
117
-    $numactualloadterm = ((int)$numactualloadterm);
118
-    $nbterm = ((int)$nbterm);
117
+    $numactualloadterm = ((int) $numactualloadterm);
118
+    $nbterm = ((int) $nbterm);
119 119
 
120 120
     // If mensuality is 0 we don't pay interests and remaining capital not modified
121 121
     if ($mens == 0) {
Please login to merge, or discard this patch.
public/htdocs/fourn/facture/card.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     // Action clone object
198 198
     if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
199 199
         $objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid.
200
-        '@phan-var-force FactureFournisseur $objectutil';  // Same object type for cloned object
200
+        '@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object
201 201
 
202 202
         if (GETPOST('newsupplierref', 'alphanohtml')) {
203 203
             $objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml');
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
                 $sql = 'SELECT SUM(pf.amount) as total_paiements';
673 673
                 $sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiementfourn_facturefourn as pf, ' . MAIN_DB_PREFIX . 'paiementfourn as p';
674 674
                 $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_paiement as c ON p.fk_paiement = c.id AND c.entity IN (' . getEntity('c_paiement') . ')';
675
-                $sql .= ' WHERE pf.fk_facturefourn = ' . ((int)$object->id);
675
+                $sql .= ' WHERE pf.fk_facturefourn = ' . ((int) $object->id);
676 676
                 $sql .= ' AND pf.fk_paiementfourn = p.rowid';
677 677
                 $sql .= ' AND p.entity IN (' . getEntity('invoice') . ')';
678 678
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
                 $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
690 690
                 $sql .= " re.description, re.fk_invoice_supplier_source";
691 691
                 $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
692
-                $sql .= " WHERE fk_invoice_supplier = " . ((int)$object->id);
692
+                $sql .= " WHERE fk_invoice_supplier = " . ((int) $object->id);
693 693
                 $resql = $db->query($sql);
694 694
                 if (!empty($resql)) {
695 695
                     while ($obj = $db->fetch_object($resql)) {
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
             }
712 712
             if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) {
713 713
                 foreach ($amount_ht as $tva_tx => $xxx) {
714
-                    $discount->amount_ht = abs((float)$amount_ht[$tva_tx]);
715
-                    $discount->amount_tva = abs((float)$amount_tva[$tva_tx]);
716
-                    $discount->amount_ttc = abs((float)$amount_ttc[$tva_tx]);
717
-                    $discount->multicurrency_amount_ht = abs((float)$multicurrency_amount_ht[$tva_tx]);
718
-                    $discount->multicurrency_amount_tva = abs((float)$multicurrency_amount_tva[$tva_tx]);
719
-                    $discount->multicurrency_amount_ttc = abs((float)$multicurrency_amount_ttc[$tva_tx]);
714
+                    $discount->amount_ht = abs((float) $amount_ht[$tva_tx]);
715
+                    $discount->amount_tva = abs((float) $amount_tva[$tva_tx]);
716
+                    $discount->amount_ttc = abs((float) $amount_ttc[$tva_tx]);
717
+                    $discount->multicurrency_amount_ht = abs((float) $multicurrency_amount_ht[$tva_tx]);
718
+                    $discount->multicurrency_amount_tva = abs((float) $multicurrency_amount_tva[$tva_tx]);
719
+                    $discount->multicurrency_amount_ttc = abs((float) $multicurrency_amount_ttc[$tva_tx]);
720 720
 
721 721
                     // Clean vat code
722 722
                     $reg = array();
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
                         $tva_tx = preg_replace('/\s*\(.*\)/', '', $tva_tx); // Remove code into vatrate.
727 727
                     }
728 728
 
729
-                    $discount->tva_tx = abs((float)$tva_tx);
729
+                    $discount->tva_tx = abs((float) $tva_tx);
730 730
                     $discount->vat_src_code = $vat_src_code;
731 731
 
732 732
                     $result = $discount->create($user);
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         $db->begin();
783 783
 
784 784
         $error = 0;
785
-        $tmpproject = 0;  // Ensure a value
785
+        $tmpproject = 0; // Ensure a value
786 786
 
787 787
         // Fill array 'array_options' with data from add form
788 788
         $ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
             $error++;
791 791
         }
792 792
 
793
-        $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');   // If we enter the 02 january, we need to save the 02 january for server
793
+        $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
794 794
         $datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver');
795 795
         //var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
796 796
         //var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour'));
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
                 $object->ref_supplier = GETPOST('ref_supplier', 'alpha');
830 830
                 $object->socid = GETPOSTINT('socid');
831 831
                 $object->label = GETPOST('label', 'alphanohtml');
832
-                $object->libelle = $object->label;  // deprecated
832
+                $object->libelle = $object->label; // deprecated
833 833
                 $object->date = $dateinvoice;
834 834
                 $object->date_echeance = $datedue;
835 835
                 $object->note_public = GETPOST('note_public', 'restricthtml');
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
                 $object->subtype = GETPOST('subtype', 'alphanohtml');
904 904
                 $object->socid = GETPOSTINT('socid');
905 905
                 $object->label = GETPOST('label', 'alphanohtml');
906
-                $object->libelle = $object->label;  // Deprecated
906
+                $object->libelle = $object->label; // Deprecated
907 907
                 $object->date = $dateinvoice;
908 908
                 $object->date_echeance = $datedue;
909 909
                 $object->note_public = GETPOST('note_public', 'restricthtml');
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
                 $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
1014 1014
                 $object->mode_reglement_id = GETPOSTINT('mode_reglement_id');
1015 1015
                 $object->fk_account = GETPOSTINT('fk_account');
1016
-                $object->amount = (float)price2num(GETPOST('amount'));  // FIXME: FactureFournisseur::$amount is deprecated and not used?
1016
+                $object->amount = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used?
1017 1017
                 //$object->remise_absolue       = price2num(GETPOST('remise_absolue'), 'MU');
1018 1018
                 //$object->remise_percent       = price2num(GETPOST('remise_percent'), '', 2);
1019 1019
                 $object->fk_incoterms = GETPOSTINT('incoterm_id');
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
                 $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1074 1074
                 $object->socid = GETPOSTINT('socid');
1075 1075
                 $object->label = GETPOST('label', 'alphanohtml');
1076
-                $object->libelle = $object->label;   // deprecated
1076
+                $object->libelle = $object->label; // deprecated
1077 1077
                 $object->date = $dateinvoice;
1078 1078
                 $object->date_echeance = $datedue;
1079 1079
                 $object->note_public = GETPOST('note_public', 'restricthtml');
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
                                 if ($typeamount == 'amount') {
1177 1177
                                     $amount = $valuedeposit;
1178 1178
                                 } else {
1179
-                                    $amount = $srcobject->total_ttc * ((float)$valuedeposit / 100);
1179
+                                    $amount = $srcobject->total_ttc * ((float) $valuedeposit / 100);
1180 1180
                                 }
1181 1181
 
1182 1182
                                 $TTotalByTva = array();
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
                                             if ($qualified) {
1215 1215
                                                 $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
1216 1216
                                                 $tva_tx = $lines[$i]->tva_tx;
1217
-                                                $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * (float)$valuedeposit) / 100;
1217
+                                                $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * (float) $valuedeposit) / 100;
1218 1218
                                             }
1219 1219
                                         }
1220 1220
 
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
                                     0,
1300 1300
                                     $object->lines[0]->date_start,
1301 1301
                                     $object->lines[0]->date_end,
1302
-                                    array(),  // array_options
1302
+                                    array(), // array_options
1303 1303
                                     0,
1304 1304
                                     0,
1305 1305
                                     '',
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
             $idprod = GETPOSTINT('idprod');
1585 1585
         }
1586 1586
 
1587
-        $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);      // Can be '1.2' or '1.2 (CODE)'
1587
+        $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1588 1588
 
1589 1589
         $price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
1590 1590
         $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2);
@@ -1808,7 +1808,7 @@  discard block
 block discarded – undo
1808 1808
                 $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings
1809 1809
             } else {
1810 1810
                 $pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
1811
-                $pu_ht = price2num((float)$pu_ttc / (1 + ((float)$tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings
1811
+                $pu_ht = price2num((float) $pu_ttc / (1 + ((float) $tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings
1812 1812
             }
1813 1813
             $price_base_type = 'HT';
1814 1814
             $pu_devise = price2num($price_ht_devise, 'CU');
@@ -2082,7 +2082,7 @@  discard block
 block discarded – undo
2082 2082
 // Mode creation
2083 2083
 if ($action == 'create') {
2084 2084
     $facturestatic = new FactureFournisseur($db);
2085
-    $selectedLines = array();  // Ensure initialised
2085
+    $selectedLines = array(); // Ensure initialised
2086 2086
 
2087 2087
     print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice');
2088 2088
 
@@ -2277,7 +2277,7 @@  discard block
 block discarded – undo
2277 2277
     print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
2278 2278
     print '<input type="hidden" name="token" value="' . newToken() . '">';
2279 2279
     print '<input type="hidden" name="action" value="add">';
2280
-    print '<input type="hidden" name="changecompany" value="0">';   // will be set to 1 by javascript so we know post is done after a company change
2280
+    print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2281 2281
 
2282 2282
     if (!empty($societe->id) && $societe->id > 0) {
2283 2283
         print '<input type="hidden" name="socid" value="' . $societe->id . '">' . "\n";
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
 
2362 2362
             $sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2363 2363
             $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_fourn_rec as r';
2364
-            $sql .= ' WHERE r.fk_soc = ' . (int)$invoice_predefined->socid;
2364
+            $sql .= ' WHERE r.fk_soc = ' . (int) $invoice_predefined->socid;
2365 2365
 
2366 2366
             $resql = $db->query($sql);
2367 2367
             if ($resql) {
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
             // TODO We should not need this. Also data comes from not reliable value of $object->multicurrency_total_ttc that may be wrong if it was
2942 2942
             // calculated by summing lines that were in a currency for some of them and into another for others (lines from discount/down payment into another currency for example)
2943 2943
             if ($resteapayer == 0 && $multicurrency_resteapayer != 0 && $object->multicurrency_code != $conf->currency) {
2944
-                $resteapayer = price2num((float)$multicurrency_resteapayer / $object->multicurrency_tx, 'MT');
2944
+                $resteapayer = price2num((float) $multicurrency_resteapayer / $object->multicurrency_tx, 'MT');
2945 2945
             }
2946 2946
         }
2947 2947
 
@@ -3229,7 +3229,7 @@  discard block
 block discarded – undo
3229 3229
         // Thirdparty
3230 3230
         $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'supplier');
3231 3231
         if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
3232
-            $morehtmlref .= ' <div class="inline-block valignmiddle">(<a class="valignmiddle" href="' . constant('BASE_URL') . '/fourn/facture/list.php?socid=' . ((int)$object->thirdparty->id) . '&search_company=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherBills") . '</a>)</div>';
3232
+            $morehtmlref .= ' <div class="inline-block valignmiddle">(<a class="valignmiddle" href="' . constant('BASE_URL') . '/fourn/facture/list.php?socid=' . ((int) $object->thirdparty->id) . '&search_company=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherBills") . '</a>)</div>';
3233 3233
         }
3234 3234
         // Project
3235 3235
         if (isModEnabled('project')) {
@@ -3238,7 +3238,7 @@  discard block
 block discarded – undo
3238 3238
             if ($permissiontoadd) {
3239 3239
                 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
3240 3240
                 if ($action != 'classify') {
3241
-                    $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . ((int)$object->id) . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3241
+                    $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . ((int) $object->id) . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3242 3242
                 }
3243 3243
                 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
3244 3244
             } else {
@@ -3672,7 +3672,7 @@  discard block
 block discarded – undo
3672 3672
             $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
3673 3673
             $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_paiement as c ON p.fk_paiement = c.id';
3674 3674
             $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid';
3675
-            $sql .= ' WHERE pf.fk_facturefourn = ' . ((int)$object->id);
3675
+            $sql .= ' WHERE pf.fk_facturefourn = ' . ((int) $object->id);
3676 3676
             $sql .= ' ORDER BY p.datep, p.tms';
3677 3677
 
3678 3678
             $result = $db->query($sql);
@@ -3793,7 +3793,7 @@  discard block
 block discarded – undo
3793 3793
                 $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
3794 3794
                 $sql .= " re.description, re.fk_invoice_supplier_source";
3795 3795
                 $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
3796
-                $sql .= " WHERE fk_invoice_supplier = " . ((int)$object->id);
3796
+                $sql .= " WHERE fk_invoice_supplier = " . ((int) $object->id);
3797 3797
                 $resql = $db->query($sql);
3798 3798
                 if ($resql) {
3799 3799
                     $num = $db->num_rows($resql);
Please login to merge, or discard this patch.
Dolibarr/Code/Core/Classes/FormOther.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
         $sql .= " FROM " . $this->db->prefix() . "export_model";
415 415
         $sql .= " WHERE type = '" . $this->db->escape($type) . "'";
416 416
         if (!getDolGlobalString('EXPORTS_SHARE_MODELS')) {  // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner.
417
-            $sql .= " AND fk_user IN (0, " . ((int)$fk_user) . ")";
417
+            $sql .= " AND fk_user IN (0, " . ((int) $fk_user) . ")";
418 418
         }
419 419
         $sql .= " ORDER BY label";
420 420
         $result = $this->db->query($sql);
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         $sql .= " FROM " . $this->db->prefix() . "import_model";
478 478
         $sql .= " WHERE type = '" . $this->db->escape($type) . "'";
479 479
         if (!getDolGlobalString('EXPORTS_SHARE_MODELS')) {  // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner.
480
-            $sql .= " AND fk_user IN (0, " . ((int)$fk_user) . ")";
480
+            $sql .= " AND fk_user IN (0, " . ((int) $fk_user) . ")";
481 481
         }
482 482
         $sql .= " ORDER BY label";
483 483
         $result = $this->db->query($sql);
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
         }
644 644
 
645 645
         for ($i = $start; $i <= $end; $i += $increment) {
646
-            if ($selected != '' && (int)$selected == $i) {
646
+            if ($selected != '' && (int) $selected == $i) {
647 647
                 $return .= '<option value="' . $i . '" selected>';
648 648
             } else {
649 649
                 $return .= '<option value="' . $i . '">';
@@ -779,10 +779,10 @@  discard block
 block discarded – undo
779 779
         }
780 780
 
781 781
         if (!$user->hasRight('user', 'user', 'lire')) {
782
-            $sql_usr .= " AND u.rowid = " . ((int)$user->id);
782
+            $sql_usr .= " AND u.rowid = " . ((int) $user->id);
783 783
         }
784 784
         if (!empty($user->socid)) {
785
-            $sql_usr .= " AND u.fk_soc = " . ((int)$user->socid);
785
+            $sql_usr .= " AND u.fk_soc = " . ((int) $user->socid);
786 786
         }
787 787
         if (getDolGlobalString('USER_HIDE_NONEMPLOYEE_IN_COMBOBOX')) {
788 788
             $sql_usr .= " AND u.employee <> 0";
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
                 $sql_usr .= " WHERE u2.entity IN (" . getEntity('user') . ")";
816 816
             }
817 817
 
818
-            $sql_usr .= " AND u2.rowid = sc.fk_user AND sc.fk_soc = " . ((int)$user->socid);
818
+            $sql_usr .= " AND u2.rowid = sc.fk_user AND sc.fk_soc = " . ((int) $user->socid);
819 819
 
820 820
             //Add hook to filter on user (for example on usergroup define in custom modules)
821 821
             if (!empty($reshook)) {
@@ -1254,9 +1254,9 @@  discard block
 block discarded – undo
1254 1254
 
1255 1255
         $color = substr($color, 1, 6);
1256 1256
 
1257
-        $red = hexdec(substr($color, 0, 2));    // Red channel conversion
1257
+        $red = hexdec(substr($color, 0, 2)); // Red channel conversion
1258 1258
         $green = hexdec(substr($color, 2, 2)); // Green channel conversion
1259
-        $blue = hexdec(substr($color, 4, 2));  // Blue channel conversion
1259
+        $blue = hexdec(substr($color, 4, 2)); // Blue channel conversion
1260 1260
 
1261 1261
         $couleur = imagecolorallocate($image, $red, $green, $blue);
1262 1262
         //print $red.$green.$blue;
Please login to merge, or discard this patch.
public/htdocs/contact/consumption.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, tc.libelle as type_contact_label, ';
220 220
     $tables_from = MAIN_DB_PREFIX . 'fichinterdet d';
221 221
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'fichinter as f ON d.fk_fichinter=f.rowid';
222
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
222
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
223 223
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='fichinter' and tc.source='external' and tc.active=1)";
224 224
     $where = ' WHERE f.entity IN (' . getEntity('intervention') . ')';
225 225
     $dateprint = 'f.datec';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     $tables_from = MAIN_DB_PREFIX . 'facturedet d';
231 231
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facture as f ON d.fk_facture=f.rowid';
232 232
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
233
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
233
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
234 234
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='facture' and tc.source='external' and tc.active=1)";
235 235
     $where = " WHERE f.entity IN (" . getEntity('invoice') . ")";
236 236
     $dateprint = 'f.datef';
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     $tables_from = MAIN_DB_PREFIX . 'propaldet d';
243 243
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'propal as c ON d.fk_propal=c.rowid';
244 244
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
245
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
245
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
246 246
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='propal' and tc.source='external' and tc.active=1)";
247 247
     $where = ' WHERE c.entity IN (' . getEntity('propal') . ')';
248 248
     $dateprint = 'c.datep';
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     $tables_from = MAIN_DB_PREFIX . 'commandedet d';
255 255
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'commande as c ON d.fk_commande=c.rowid';
256 256
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
257
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
257
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
258 258
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='commande' and tc.source='external' and tc.active=1)";
259 259
     $where = ' WHERE c.entity IN (' . getEntity('order') . ')';
260 260
     $dateprint = 'c.date_commande';
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     $tables_from = MAIN_DB_PREFIX . 'facture_fourn_det d';
267 267
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facture_fourn as f ON d.fk_facture_fourn=f.rowid';
268 268
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
269
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
269
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
270 270
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='invoice_supplier' and tc.source='external' and tc.active=1)";
271 271
     $where = ' WHERE f.entity IN (' . getEntity($documentstatic->element) . ')';
272 272
     $dateprint = 'f.datef';
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     $tables_from = MAIN_DB_PREFIX . 'commande_fournisseurdet d';
291 291
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'commande_fournisseur as c ON d.fk_commande=c.rowid';
292 292
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
293
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
293
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
294 294
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='order_supplier' and tc.source='external' and tc.active=1)";
295 295
     $where = ' WHERE c.entity IN (' . getEntity($documentstatic->element) . ')';
296 296
     $dateprint = 'c.date_valid';
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     $tables_from = MAIN_DB_PREFIX . 'contratdet d';
304 304
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'contrat as c ON d.fk_contrat=c.rowid';
305 305
     $tables_from .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product p ON d.fk_product=p.rowid';
306
-    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int)$object->id);
306
+    $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = ' . ((int) $object->id);
307 307
     $tables_from .= ' INNER JOIN ' . MAIN_DB_PREFIX . "c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='contrat' and tc.source='external' and tc.active=1)";
308 308
     $where = ' WHERE c.entity IN (' . getEntity('contrat') . ')';
309 309
     $dateprint = 'c.date_valid';
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 $param .= "&year=" . urlencode($year);
375 375
 $param .= "&sprod_fulldescr=" . urlencode($sprod_fulldescr);
376 376
 if (!empty($socid)) {
377
-    $param .= "&socid=" . urlencode((string)($socid));
377
+    $param .= "&socid=" . urlencode((string) ($socid));
378 378
 }
379 379
 $param .= "&type_element=" . urlencode($type_element);
380 380
 
@@ -388,12 +388,12 @@  discard block
 block discarded – undo
388 388
 
389 389
     $num = $db->num_rows($resql);
390 390
 
391
-    $param = (!empty($socid) ? "&socid=" . urlencode((string)($socid)) : "") . "&type_element=" . urlencode((string)($type_element)) . "&id=" . urlencode((string)($id));
391
+    $param = (!empty($socid) ? "&socid=" . urlencode((string) ($socid)) : "") . "&type_element=" . urlencode((string) ($type_element)) . "&id=" . urlencode((string) ($id));
392 392
     if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
393 393
         $param .= '&contextpage=' . urlencode($contextpage);
394 394
     }
395 395
     if ($limit > 0 && $limit != $conf->liste_limit) {
396
-        $param .= '&limit=' . ((int)$limit);
396
+        $param .= '&limit=' . ((int) $limit);
397 397
     }
398 398
     if ($sprod_fulldescr) {
399 399
         $param .= "&sprod_fulldescr=" . urlencode($sprod_fulldescr);
@@ -402,10 +402,10 @@  discard block
 block discarded – undo
402 402
         $param .= "&sref=" . urlencode($sref);
403 403
     }
404 404
     if ($month) {
405
-        $param .= "&month=" . urlencode((string)($month));
405
+        $param .= "&month=" . urlencode((string) ($month));
406 406
     }
407 407
     if ($year) {
408
-        $param .= "&year=" . urlencode((string)($year));
408
+        $param .= "&year=" . urlencode((string) ($year));
409 409
     }
410 410
     if ($optioncss != '') {
411 411
         $param .= '&optioncss=' . urlencode($optioncss);
Please login to merge, or discard this patch.
public/htdocs/contact/canvas/actions_contactcard_common.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             // Town
165 165
             $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
166 166
 
167
-            if (dol_strlen(trim((string)$this->object->country_id)) == 0) {
167
+            if (dol_strlen(trim((string) $this->object->country_id)) == 0) {
168 168
                 $this->object->country_id = $objsoc->country_id;
169 169
             }
170 170
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
         // We set country_id, and country_code label of the chosen country
317 317
         if ($this->object->country_id) {
318
-            $sql = "SELECT code, label FROM " . MAIN_DB_PREFIX . "c_country WHERE rowid = " . ((int)$this->object->country_id);
318
+            $sql = "SELECT code, label FROM " . MAIN_DB_PREFIX . "c_country WHERE rowid = " . ((int) $this->object->country_id);
319 319
             $resql = $this->db->query($sql);
320 320
             if ($resql) {
321 321
                 $obj = $this->db->fetch_object($resql);
Please login to merge, or discard this patch.
public/htdocs/contact/perso.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $maxfilesizearray = getMaxFileSizeArray();
204 204
         $maxmin = $maxfilesizearray['maxmin'];
205 205
         if ($maxmin > 0) {
206
-            print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
206
+            print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file
207 207
         }
208 208
         print '<input type="file" class="flat" name="photo" id="photoinput">';
209 209
         print '</td></tr>';
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
 
301 301
         print ' &nbsp; ';
302 302
         //var_dump($birthdatearray);
303
-        $ageyear = (int)convertSecondToTime($now - $object->birthday, 'year') - 1970;
304
-        $agemonth = (int)convertSecondToTime($now - $object->birthday, 'month') - 1;
303
+        $ageyear = (int) convertSecondToTime($now - $object->birthday, 'year') - 1970;
304
+        $agemonth = (int) convertSecondToTime($now - $object->birthday, 'month') - 1;
305 305
         if ($ageyear >= 2) {
306 306
             print '(' . $ageyear . ' ' . $langs->trans("DurationYears") . ')';
307 307
         } elseif ($agemonth >= 2) {
Please login to merge, or discard this patch.
public/htdocs/contact/card.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -215,32 +215,32 @@  discard block
 block discarded – undo
215 215
 
216 216
         $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity);
217 217
         $object->socid = $socid;
218
-        $object->lastname = (string)GETPOST("lastname", 'alpha');
219
-        $object->firstname = (string)GETPOST("firstname", 'alpha');
220
-        $object->civility_code = (string)GETPOST("civility_code", 'alpha');
221
-        $object->poste = (string)GETPOST("poste", 'alpha');
222
-        $object->address = (string)GETPOST("address", 'alpha');
223
-        $object->zip = (string)GETPOST("zipcode", 'alpha');
224
-        $object->town = (string)GETPOST("town", 'alpha');
218
+        $object->lastname = (string) GETPOST("lastname", 'alpha');
219
+        $object->firstname = (string) GETPOST("firstname", 'alpha');
220
+        $object->civility_code = (string) GETPOST("civility_code", 'alpha');
221
+        $object->poste = (string) GETPOST("poste", 'alpha');
222
+        $object->address = (string) GETPOST("address", 'alpha');
223
+        $object->zip = (string) GETPOST("zipcode", 'alpha');
224
+        $object->town = (string) GETPOST("town", 'alpha');
225 225
         $object->country_id = GETPOSTINT("country_id");
226 226
         $object->state_id = GETPOSTINT("state_id");
227 227
         $object->socialnetworks = array();
228 228
         if (isModEnabled('socialnetworks')) {
229 229
             foreach ($socialnetworks as $key => $value) {
230 230
                 if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
231
-                    $object->socialnetworks[$key] = (string)GETPOST($key, 'alphanohtml');
231
+                    $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml');
232 232
                 }
233 233
             }
234 234
         }
235
-        $object->email = (string)GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
235
+        $object->email = (string) GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
236 236
         $object->no_email = GETPOSTINT("no_email");
237
-        $object->phone_pro = (string)GETPOST("phone_pro", 'alpha');
238
-        $object->phone_perso = (string)GETPOST("phone_perso", 'alpha');
239
-        $object->phone_mobile = (string)GETPOST("phone_mobile", 'alpha');
240
-        $object->fax = (string)GETPOST("fax", 'alpha');
237
+        $object->phone_pro = (string) GETPOST("phone_pro", 'alpha');
238
+        $object->phone_perso = (string) GETPOST("phone_perso", 'alpha');
239
+        $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
240
+        $object->fax = (string) GETPOST("fax", 'alpha');
241 241
         $object->priv = GETPOSTINT("priv");
242
-        $object->note_public = (string)GETPOST("note_public", 'restricthtml');
243
-        $object->note_private = (string)GETPOST("note_private", 'restricthtml');
242
+        $object->note_public = (string) GETPOST("note_public", 'restricthtml');
243
+        $object->note_private = (string) GETPOST("note_private", 'restricthtml');
244 244
         $object->roles = GETPOST("roles", 'array');
245 245
 
246 246
         $object->statut = 1; //Default status to Actif
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         if (empty($error) && $id > 0) {
314 314
             $db->commit();
315 315
             if (!empty($backtopage)) {
316
-                $url = str_replace('__ID__', (string)$id, $backtopage);
316
+                $url = str_replace('__ID__', (string) $id, $backtopage);
317 317
             } else {
318 318
                 $url = 'card.php?id=' . $id;
319 319
             }
@@ -413,34 +413,34 @@  discard block
 block discarded – undo
413 413
             $object->oldcopy = clone $object;
414 414
 
415 415
             $object->socid = $socid;
416
-            $object->lastname = (string)GETPOST("lastname", 'alpha');
417
-            $object->firstname = (string)GETPOST("firstname", 'alpha');
418
-            $object->civility_code = (string)GETPOST("civility_code", 'alpha');
419
-            $object->poste = (string)GETPOST("poste", 'alpha');
420
-
421
-            $object->address = (string)GETPOST("address", 'alpha');
422
-            $object->zip = (string)GETPOST("zipcode", 'alpha');
423
-            $object->town = (string)GETPOST("town", 'alpha');
416
+            $object->lastname = (string) GETPOST("lastname", 'alpha');
417
+            $object->firstname = (string) GETPOST("firstname", 'alpha');
418
+            $object->civility_code = (string) GETPOST("civility_code", 'alpha');
419
+            $object->poste = (string) GETPOST("poste", 'alpha');
420
+
421
+            $object->address = (string) GETPOST("address", 'alpha');
422
+            $object->zip = (string) GETPOST("zipcode", 'alpha');
423
+            $object->town = (string) GETPOST("town", 'alpha');
424 424
             $object->state_id = GETPOSTINT("state_id");
425 425
             $object->country_id = GETPOSTINT("country_id");
426 426
 
427
-            $object->email = (string)GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
427
+            $object->email = (string) GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
428 428
             $object->no_email = GETPOSTINT("no_email");
429 429
             $object->socialnetworks = array();
430 430
             if (isModEnabled('socialnetworks')) {
431 431
                 foreach ($socialnetworks as $key => $value) {
432 432
                     if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
433
-                        $object->socialnetworks[$key] = (string)GETPOST($key, 'alphanohtml');
433
+                        $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml');
434 434
                     }
435 435
                 }
436 436
             }
437
-            $object->phone_pro = (string)GETPOST("phone_pro", 'alpha');
438
-            $object->phone_perso = (string)GETPOST("phone_perso", 'alpha');
439
-            $object->phone_mobile = (string)GETPOST("phone_mobile", 'alpha');
440
-            $object->fax = (string)GETPOST("fax", 'alpha');
441
-            $object->priv = (string)GETPOSTINT("priv");
442
-            $object->note_public = (string)GETPOST("note_public", 'restricthtml');
443
-            $object->note_private = (string)GETPOST("note_private", 'restricthtml');
437
+            $object->phone_pro = (string) GETPOST("phone_pro", 'alpha');
438
+            $object->phone_perso = (string) GETPOST("phone_perso", 'alpha');
439
+            $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
440
+            $object->fax = (string) GETPOST("fax", 'alpha');
441
+            $object->priv = (string) GETPOSTINT("priv");
442
+            $object->note_public = (string) GETPOST("note_public", 'restricthtml');
443
+            $object->note_private = (string) GETPOST("note_private", 'restricthtml');
444 444
 
445 445
             $object->roles = GETPOST("roles", 'array'); // Note GETPOSTISSET("role") is null when combo is empty
446 446
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
             $maxfilesizearray = getMaxFileSizeArray();
1263 1263
             $maxmin = $maxfilesizearray['maxmin'];
1264 1264
             if ($maxmin > 0) {
1265
-                print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';    // MAX_FILE_SIZE must precede the field type=file
1265
+                print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file
1266 1266
             }
1267 1267
             print '<input type="file" class="flat maxwidth200" name="photo" id="photoinput">';
1268 1268
             print '</td></tr>';
Please login to merge, or discard this patch.