Passed
Push — dev ( 162356...096618 )
by Rafael
70:47 queued 05:12
created
public/htdocs/core/ajax/fileupload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Load Dolibarr environment
40 40
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
41
-require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php';  // Class to upload common files
41
+require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php'; // Class to upload common files
42 42
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/geturl.lib.php';
43 43
 
44 44
 $id = GETPOSTINT('fk_element');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 if (!empty($user->socid)) {
63 63
     $socid = $user->socid;
64 64
     if (!empty($object->socid) && $socid != $object->socid) {
65
-        httponly_accessforbidden("Access on object not allowed for this external user.");   // This includes the exit.
65
+        httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit.
66 66
     }
67 67
 }
68 68
 
Please login to merge, or discard this patch.
public/htdocs/categories/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@
 block discarded – undo
57 57
 $urlfrom = GETPOST('urlfrom', 'alpha');
58 58
 $backtopage = GETPOST('backtopage', 'alpha');
59 59
 
60
-$label = (string)GETPOST('label', 'alphanohtml');
61
-$description = (string)GETPOST('description', 'restricthtml');
62
-$color = preg_replace('/[^0-9a-f#]/i', '', (string)GETPOST('color', 'alphanohtml'));
60
+$label = (string) GETPOST('label', 'alphanohtml');
61
+$description = (string) GETPOST('description', 'restricthtml');
62
+$color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('color', 'alphanohtml'));
63 63
 $position = GETPOSTINT('position');
64 64
 $visible = GETPOSTINT('visible');
65 65
 $parent = GETPOSTINT('parent');
Please login to merge, or discard this patch.
public/htdocs/bookmarks/lib/bookmarks.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
     $langs->load("bookmarks");
40 40
 
41
-    $authorized_var = array('limit','optioncss','contextpage');
41
+    $authorized_var = array('limit', 'optioncss', 'contextpage');
42 42
     $url = $_SERVER["PHP_SELF"];
43 43
     $url_param = array();
44 44
     if (!empty($_SERVER["QUERY_STRING"])) {
Please login to merge, or discard this patch.
Dolibarr/Code/Core/Classes/FormFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $maxphptoshow = $maxfilesizearray['maxphptoshow'];
210 210
             $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam'];
211 211
             if ($maxmin > 0) {
212
-                $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';  // MAX_FILE_SIZE must precede the field type=file
212
+                $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file
213 213
             }
214 214
             $out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
215 215
             $out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple');
@@ -2231,7 +2231,7 @@  discard block
 block discarded – undo
2231 2231
                 print '<td class="right">';
2232 2232
                 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '&token=' . newToken() . '" class="editfilelink editfielda reposition" >' . img_edit() . '</a>'; // id= is included into $param
2233 2233
                 if ($permissiontodelete) {
2234
-                    print ' &nbsp; <a class="deletefilelink reposition" href="' . $_SERVER['PHP_SELF'] . '?action=deletelink&token=' . newToken() . '&linkid=' . ((int)$link->id) . $param . '">' . img_delete() . '</a>'; // id= is included into $param
2234
+                    print ' &nbsp; <a class="deletefilelink reposition" href="' . $_SERVER['PHP_SELF'] . '?action=deletelink&token=' . newToken() . '&linkid=' . ((int) $link->id) . $param . '">' . img_delete() . '</a>'; // id= is included into $param
2235 2235
                 } else {
2236 2236
                     print '&nbsp;';
2237 2237
                 }
Please login to merge, or discard this patch.
public/htdocs/contact/list.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 foreach ($object->fields as $key => $val) {
235 235
     // If $val['visible']==0, then we never show the field
236 236
     if (!empty($val['visible'])) {
237
-        $visible = (int)dol_eval($val['visible'], 1);
237
+        $visible = (int) dol_eval($val['visible'], 1);
238 238
         $arrayfields['p.' . $key] = array(
239 239
             'label' => $val['label'],
240 240
             'checked' => (($visible < 0) ? 0 : 1),
241
-            'enabled' => (abs($visible) != 3 && (int)dol_eval($val['enabled'], 1)),
241
+            'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)),
242 242
             'position' => $val['position'],
243 243
             'help' => isset($val['help']) ? $val['help'] : ''
244 244
         );
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 $object->fields = dol_sort_array($object->fields, 'position');
277 277
 //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
278 278
 $arrayfields = dol_sort_array($arrayfields, 'position');
279
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
279
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
280 280
 
281 281
 
282 282
 if (($id > 0 || !empty($ref)) && $action != 'add') {
@@ -315,11 +315,11 @@  discard block
 block discarded – undo
315 315
         $invoice->module_source = 'takepos';
316 316
         $invoice->pos_source = $_SESSION["takeposterminal"];
317 317
         $placeid = $invoice->create($user);
318
-        $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")' where rowid = " . ((int)$placeid);
318
+        $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")' where rowid = " . ((int) $placeid);
319 319
         $db->query($sql);
320 320
     }
321 321
 
322
-    $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set fk_soc=" . ((int)$idcustomer) . " where ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")'";
322
+    $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set fk_soc=" . ((int) $idcustomer) . " where ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")'";
323 323
     $resql = $db->query($sql);
324 324
 
325 325
     // set contact on invoice
@@ -515,11 +515,11 @@  discard block
 block discarded – undo
515 515
 
516 516
 // Add fields from hooks - ListFrom
517 517
 $parameters = array();
518
-$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action);    // Note that $action and $object may have been modified by hook
518
+$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
519 519
 $sql .= $hookmanager->resPrint;
520 520
 $sql .= ' WHERE p.entity IN (' . getEntity('contact') . ')';
521 521
 if (!empty($userid)) {    // propre au commercial
522
-    $sql .= " AND p.fk_user_creat=" . ((int)$userid);
522
+    $sql .= " AND p.fk_user_creat=" . ((int) $userid);
523 523
 }
524 524
 if ($search_level) {
525 525
     $sql .= natural_search("p.fk_prospectlevel", implode(',', $search_level), 3);
@@ -530,13 +530,13 @@  discard block
 block discarded – undo
530 530
 
531 531
 // Filter to exclude not owned private contacts
532 532
 if ($search_priv != '0' && $search_priv != '1') {
533
-    $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=" . ((int)$user->id) . "))";
533
+    $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=" . ((int) $user->id) . "))";
534 534
 } else {
535 535
     if ($search_priv == '0') {
536 536
         $sql .= " AND p.priv='0'";
537 537
     }
538 538
     if ($search_priv == '1') {
539
-        $sql .= " AND (p.priv='1' AND p.fk_user_creat=" . ((int)$user->id) . ")";
539
+        $sql .= " AND (p.priv='1' AND p.fk_user_creat=" . ((int) $user->id) . ")";
540 540
     }
541 541
 }
542 542
 // Search on sale representative
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
     if ($search_sale == -2) {
545 545
         $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . $db->prefix() . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
546 546
     } elseif ($search_sale > 0) {
547
-        $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . $db->prefix() . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")";
547
+        $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . $db->prefix() . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
548 548
     }
549 549
 }
550 550
 
@@ -560,9 +560,9 @@  discard block
 block discarded – undo
560 560
             $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_socpeople FROM " . MAIN_DB_PREFIX . "categorie_contact as ck WHERE p.rowid = ck.fk_socpeople)";
561 561
         } elseif (intval($searchCategoryContact) > 0) {
562 562
             if ($searchCategoryContactOperator == 0) {
563
-                $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM " . MAIN_DB_PREFIX . "categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie = " . ((int)$searchCategoryContact) . ")";
563
+                $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM " . MAIN_DB_PREFIX . "categorie_contact as ck WHERE p.rowid = ck.fk_socpeople AND ck.fk_categorie = " . ((int) $searchCategoryContact) . ")";
564 564
             } else {
565
-                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryContact);
565
+                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryContact);
566 566
             }
567 567
         }
568 568
     }
@@ -592,9 +592,9 @@  discard block
 block discarded – undo
592 592
             $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as ck WHERE s.rowid = ck.fk_soc)";
593 593
         } elseif (intval($searchCategoryCustomer) > 0) {
594 594
             if ($searchCategoryCustomerOperator == 0) {
595
-                $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int)$searchCategoryCustomer) . ")";
595
+                $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int) $searchCategoryCustomer) . ")";
596 596
             } else {
597
-                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryCustomer);
597
+                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryCustomer);
598 598
             }
599 599
         }
600 600
     }
@@ -624,9 +624,9 @@  discard block
 block discarded – undo
624 624
             $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
625 625
         } elseif (intval($searchCategorySupplier) > 0) {
626 626
             if ($searchCategorySupplierOperator == 0) {
627
-                $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int)$searchCategorySupplier) . ")";
627
+                $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = " . ((int) $searchCategorySupplier) . ")";
628 628
             } else {
629
-                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategorySupplier);
629
+                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategorySupplier);
630 630
             }
631 631
         }
632 632
     }
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
     $sql .= " AND (SELECT count(*) FROM " . MAIN_DB_PREFIX . "mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL  AND p.email <> ''";
734 734
 }
735 735
 if ($search_status != '' && $search_status >= 0) {
736
-    $sql .= " AND p.statut = " . ((int)$search_status);
736
+    $sql .= " AND p.statut = " . ((int) $search_status);
737 737
 }
738 738
 if ($search_import_key) {
739 739
     $sql .= natural_search("p.import_key", $search_import_key);
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
     $sql .= " AND s.client IN (2, 3)";
749 749
 }
750 750
 if (!empty($socid)) {
751
-    $sql .= " AND s.rowid = " . ((int)$socid);
751
+    $sql .= " AND s.rowid = " . ((int) $socid);
752 752
 }
753 753
 if ($search_birthday_start) {
754 754
     $sql .= " AND p.birthday >= '" . $db->idate($search_birthday_start) . "'";
@@ -835,30 +835,30 @@  discard block
 block discarded – undo
835 835
     $param .= '&contextpage=' . urlencode($contextpage);
836 836
 }
837 837
 if ($limit > 0 && $limit != $conf->liste_limit) {
838
-    $param .= '&limit=' . ((int)$limit);
838
+    $param .= '&limit=' . ((int) $limit);
839 839
 }
840 840
 if ($optioncss != '') {
841 841
     $param .= '&optioncss=' . urlencode($optioncss);
842 842
 }
843
-$param .= '&begin=' . urlencode((string)($begin)) . '&userid=' . urlencode((string)($userid)) . '&contactname=' . urlencode((string)($search_all));
843
+$param .= '&begin=' . urlencode((string) ($begin)) . '&userid=' . urlencode((string) ($userid)) . '&contactname=' . urlencode((string) ($search_all));
844 844
 $param .= '&type=' . urlencode($type) . '&view=' . urlencode($view);
845 845
 if (!empty($search_sale) && $search_sale != '-1') {
846 846
     $param .= '&search_sale=' . urlencode($search_sale);
847 847
 }
848 848
 if (!empty($search_categ) && $search_categ != '-1') {
849
-    $param .= '&search_categ=' . urlencode((string)($search_categ));
849
+    $param .= '&search_categ=' . urlencode((string) ($search_categ));
850 850
 }
851 851
 if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') {
852
-    $param .= '&search_categ_thirdparty=' . urlencode((string)($search_categ_thirdparty));
852
+    $param .= '&search_categ_thirdparty=' . urlencode((string) ($search_categ_thirdparty));
853 853
 }
854 854
 if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') {
855
-    $param .= '&search_categ_supplier=' . urlencode((string)($search_categ_supplier));
855
+    $param .= '&search_categ_supplier=' . urlencode((string) ($search_categ_supplier));
856 856
 }
857 857
 if ($search_all != '') {
858 858
     $param .= '&search_all=' . urlencode($search_all);
859 859
 }
860 860
 if ($search_id > 0) {
861
-    $param .= "&search_id=" . urlencode((string)($search_id));
861
+    $param .= "&search_id=" . urlencode((string) ($search_id));
862 862
 }
863 863
 if ($search_lastname != '') {
864 864
     $param .= '&search_lastname=' . urlencode($search_lastname);
@@ -903,16 +903,16 @@  discard block
 block discarded – undo
903 903
     $param .= '&search_email=' . urlencode($search_email);
904 904
 }
905 905
 if ($search_no_email != '') {
906
-    $param .= '&search_no_email=' . urlencode((string)($search_no_email));
906
+    $param .= '&search_no_email=' . urlencode((string) ($search_no_email));
907 907
 }
908 908
 if ($search_status != '') {
909
-    $param .= '&search_status=' . urlencode((string)($search_status));
909
+    $param .= '&search_status=' . urlencode((string) ($search_status));
910 910
 }
911 911
 if ($search_priv == '0' || $search_priv == '1') {
912 912
     $param .= "&search_priv=" . urlencode($search_priv);
913 913
 }
914 914
 if ($search_stcomm != '') {
915
-    $param .= '&search_stcomm=' . urlencode((string)($search_stcomm));
915
+    $param .= '&search_stcomm=' . urlencode((string) ($search_stcomm));
916 916
 }
917 917
 if (is_array($search_level) && count($search_level)) {
918 918
     foreach ($search_level as $slevel) {
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
         break; // Should not happen
1403 1403
     }
1404 1404
 
1405
-    $arraysocialnetworks = (array)json_decode($obj->socialnetworks, true);
1405
+    $arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
1406 1406
     $contactstatic->lastname = $obj->lastname;
1407 1407
     $contactstatic->firstname = '';
1408 1408
     $contactstatic->id = $obj->rowid;
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
                     $titlealt = $val['label'];
1698 1698
                 }
1699 1699
                 if ($obj->stcomm_id != $val['id']) {
1700
-                    print '<a class="pictosubstatus" href="' . $_SERVER["PHP_SELF"] . '?stcommcontactid=' . $obj->rowid . '&stcomm=' . urlencode((string)($val['code'])) . '&action=setstcomm&token=' . newToken() . $param . ($page ? '&page=' . urlencode((string)($page)) : '') . '">' . img_action($titlealt, $val['code'], $val['picto']) . '</a>';
1700
+                    print '<a class="pictosubstatus" href="' . $_SERVER["PHP_SELF"] . '?stcommcontactid=' . $obj->rowid . '&stcomm=' . urlencode((string) ($val['code'])) . '&action=setstcomm&token=' . newToken() . $param . ($page ? '&page=' . urlencode((string) ($page)) : '') . '">' . img_action($titlealt, $val['code'], $val['picto']) . '</a>';
1701 1701
                 }
1702 1702
             }
1703 1703
             print '</div></div></td>';
Please login to merge, or discard this patch.
public/htdocs/compta/sociales/card.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
             if ($permissiontoadd) {
561 561
                 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
562 562
                 if ($action != 'classify') {
563
-                    $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . ((int)$object->id) . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
563
+                    $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . ((int) $object->id) . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
564 564
                 }
565 565
                 $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' ? 'fk_project' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
566 566
             } else {
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
         $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
687 687
         $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as c ON p.fk_typepaiement = c.id";
688 688
         $sql .= ", " . MAIN_DB_PREFIX . "chargesociales as cs";
689
-        $sql .= " WHERE p.fk_charge = " . ((int)$id);
689
+        $sql .= " WHERE p.fk_charge = " . ((int) $id);
690 690
         $sql .= " AND p.fk_charge = cs.rowid";
691 691
         $sql .= " AND cs.entity IN (" . getEntity('sc') . ")";
692 692
         $sql .= " ORDER BY dp DESC";
Please login to merge, or discard this patch.
public/htdocs/compta/bank/various_payment/document.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 $upload_dir = $conf->bank->dir_output . '/' . dol_sanitizeFileName($object->id);
74 74
 $modulepart = 'banque';
75 75
 
76
-$permissiontoadd = $user->hasRight('banque', 'modifier');   // Used by the include of actions_dellink.inc.php
76
+$permissiontoadd = $user->hasRight('banque', 'modifier'); // Used by the include of actions_dellink.inc.php
77 77
 
78 78
 /*
79 79
  * Actions
Please login to merge, or discard this patch.
public/htdocs/compta/bank/releve.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
128 128
 $sql .= " WHERE b.num_releve < '" . $db->escape($numref) . "'";
129 129
 $sql .= " AND b.num_releve <> ''";
130
-$sql .= " AND b.fk_account = " . ((int)$object->id);
130
+$sql .= " AND b.fk_account = " . ((int) $object->id);
131 131
 $sql .= " ORDER BY b.num_releve DESC";
132 132
 $sql .= $db->plimit(1);
133 133
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 $sql = "SELECT b.num_releve as num";
150 150
 $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
151 151
 $sql .= " WHERE b.num_releve > '" . $db->escape($numref) . "'";
152
-$sql .= " AND b.fk_account = " . ((int)$object->id);
152
+$sql .= " AND b.fk_account = " . ((int) $object->id);
153 153
 $sql .= " ORDER BY b.num_releve ASC";
154 154
 $sql .= $db->plimit(1);
155 155
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 if (empty($numref)) {
181 181
     $sql .= " OR b.num_releve is null";
182 182
 }
183
-$sql .= " AND b.fk_account = " . ((int)$object->id);
183
+$sql .= " AND b.fk_account = " . ((int) $object->id);
184 184
 $sql .= " AND b.fk_account = ba.rowid";
185 185
 $sql .= " AND ba.entity IN (" . getEntity($object->element) . ")";
186 186
 $sql .= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 if ($action == 'confirm_editbankreceipt' && !empty($oldbankreceipt) && !empty($newbankreceipt)) {
196 196
     // Test to check newbankreceipt does not exists yet
197 197
     $sqltest = "SELECT b.rowid FROM " . MAIN_DB_PREFIX . "bank as b, " . MAIN_DB_PREFIX . "bank_account as ba";
198
-    $sqltest .= " WHERE b.fk_account = ba.rowid AND ba.entity = " . ((int)$conf->entity);
198
+    $sqltest .= " WHERE b.fk_account = ba.rowid AND ba.entity = " . ((int) $conf->entity);
199 199
     $sqltest .= " AND num_releve = '" . $db->escape($newbankreceipt) . "'";
200 200
     $sqltest .= $db->plimit(1); // Need the first one only
201 201
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     // Update bank receipt name
214 214
     if (!$error) {
215 215
         $sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "bank SET num_releve = '" . $db->escape($newbankreceipt) . "'";
216
-        $sqlupdate .= " WHERE num_releve = '" . $db->escape($oldbankreceipt) . "' AND fk_account = " . ((int)$id);
216
+        $sqlupdate .= " WHERE num_releve = '" . $db->escape($oldbankreceipt) . "' AND fk_account = " . ((int) $id);
217 217
 
218 218
         $resql = $db->query($sqlupdate);
219 219
         if (!$resql) {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     $param .= '&limit=' . $limit;
252 252
 }
253 253
 if ($id > 0) {
254
-    $param .= '&id=' . urlencode((string)($id));
254
+    $param .= '&id=' . urlencode((string) ($id));
255 255
 }
256 256
 
257 257
 if (empty($numref)) {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     // List of all standing receipts
274 274
     $sql = "SELECT DISTINCT(b.num_releve) as numr";
275 275
     $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
276
-    $sql .= " WHERE b.fk_account = " . ((int)$object->id);
276
+    $sql .= " WHERE b.fk_account = " . ((int) $object->id);
277 277
     $sql .= " AND b.num_releve IS NOT NULL AND b.num_releve <> '' AND b.num_releve <> '0'";
278 278
     $sql .= $db->order($sortfield, $sortorder);
279 279
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
             $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
391 391
             $sql .= " WHERE b.num_releve < '" . $db->escape($objp->numr) . "'";
392 392
             $sql .= " AND b.num_releve <> ''";
393
-            $sql .= " AND b.fk_account = " . ((int)$object->id);
393
+            $sql .= " AND b.fk_account = " . ((int) $object->id);
394 394
             $resqlstart = $db->query($sql);
395 395
             if ($resqlstart) {
396 396
                 $obj = $db->fetch_object($resqlstart);
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             $sql = "SELECT sum(b.amount) as amount";
404 404
             $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
405 405
             $sql .= " WHERE b.num_releve = '" . $db->escape($objp->numr) . "'";
406
-            $sql .= " AND b.fk_account = " . ((int)$object->id);
406
+            $sql .= " AND b.fk_account = " . ((int) $object->id);
407 407
             $resqlend = $db->query($sql);
408 408
             if ($resqlend) {
409 409
                 $obj = $db->fetch_object($resqlend);
@@ -448,11 +448,11 @@  discard block
 block discarded – undo
448 448
     $morehtmlright = '';
449 449
     $morehtmlright .= '<div class="pagination"><ul>';
450 450
     if ($foundprevious) {
451
-        $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundprevious) . '&amp;ve=' . urlencode($ve) . '&amp;account=' . ((int)$object->id) . '"><i class="fa fa-chevron-left" title="' . dol_escape_htmltag($langs->trans("Previous")) . '"></i></a></li>';
451
+        $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundprevious) . '&amp;ve=' . urlencode($ve) . '&amp;account=' . ((int) $object->id) . '"><i class="fa fa-chevron-left" title="' . dol_escape_htmltag($langs->trans("Previous")) . '"></i></a></li>';
452 452
     }
453 453
     $morehtmlright .= '<li class="pagination"><span class="active">' . $langs->trans("AccountStatement") . " " . $numref . '</span></li>';
454 454
     if ($foundnext) {
455
-        $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundnext) . '&amp;ve=' . urlencode($ve) . '&amp;account=' . ((int)$object->id) . '"><i class="fa fa-chevron-right" title="' . dol_escape_htmltag($langs->trans("Next")) . '"></i></a></li>';
455
+        $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundnext) . '&amp;ve=' . urlencode($ve) . '&amp;account=' . ((int) $object->id) . '"><i class="fa fa-chevron-right" title="' . dol_escape_htmltag($langs->trans("Next")) . '"></i></a></li>';
456 456
     }
457 457
     $morehtmlright .= '</ul></div>';
458 458
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
     $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
482 482
     $sql .= " WHERE b.num_releve < '" . $db->escape($numref) . "'";
483 483
     $sql .= " AND b.num_releve <> ''";
484
-    $sql .= " AND b.fk_account = " . ((int)$object->id);
484
+    $sql .= " AND b.fk_account = " . ((int) $object->id);
485 485
 
486 486
     $resql = $db->query($sql);
487 487
     if ($resql) {
@@ -668,8 +668,8 @@  discard block
 block discarded – undo
668 668
                 $sql .= " FROM " . MAIN_DB_PREFIX . "bank_categ as ct";
669 669
                 $sql .= ", " . MAIN_DB_PREFIX . "bank_class as cl";
670 670
                 $sql .= " WHERE ct.rowid = cl.fk_categ";
671
-                $sql .= " AND ct.entity = " . ((int)$conf->entity);
672
-                $sql .= " AND cl.lineid = " . ((int)$objp->rowid);
671
+                $sql .= " AND ct.entity = " . ((int) $conf->entity);
672
+                $sql .= " AND cl.lineid = " . ((int) $objp->rowid);
673 673
 
674 674
                 $resc = $db->query($sql);
675 675
                 if ($resc) {
Please login to merge, or discard this patch.
public/htdocs/compta/bank/document.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 
80 80
 $result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', '');
81 81
 
82
-$permissiontoadd = $user->hasRight('banque', 'modifier');   // Used by the include of actions_dellink.inc.php
82
+$permissiontoadd = $user->hasRight('banque', 'modifier'); // Used by the include of actions_dellink.inc.php
83 83
 
84 84
 /*
85 85
  * Actions
Please login to merge, or discard this patch.