Passed
Push — GENERAL_BUG_REVIEW_240911 ( 3362b2...8cbbee )
by Rafael
49:13
created
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.
Dolibarr/Code/Cron/Classes/Cronjob.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             if (count($filter) > 0) {
252 252
                 foreach ($filter as $key => $value) {
253 253
                     if ($key == 't.rowid') {
254
-                        $sql .= " AND " . $this->db->sanitize($key) . " = " . ((int)$value);
254
+                        $sql .= " AND " . $this->db->sanitize($key) . " = " . ((int) $value);
255 255
                     } else {
256 256
                         $sql .= " AND " . $this->db->sanitize($key) . " LIKE '%" . $this->db->escape($this->db->escapeforlike($value)) . "%'";
257 257
                     }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         $this->db->begin();
351 351
 
352 352
         $sql = "DELETE FROM " . MAIN_DB_PREFIX . "cronjob";
353
-        $sql .= " WHERE rowid=" . ((int)$this->id);
353
+        $sql .= " WHERE rowid=" . ((int) $this->id);
354 354
 
355 355
         dol_syslog(get_class($this) . "::delete", LOG_DEBUG);
356 356
         $resql = $this->db->query($sql);
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
         $sql .= " t.test";
474 474
         $sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as t";
475 475
         if ($id > 0) {
476
-            $sql .= " WHERE t.rowid = " . ((int)$id);
476
+            $sql .= " WHERE t.rowid = " . ((int) $id);
477 477
         } else {
478 478
             $sql .= " WHERE t.entity IN(0, " . getEntity('cron') . ")";
479 479
             $sql .= " AND t.objectname = '" . $this->db->escape($objectname) . "'";
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                 $this->datenextrun = $this->db->jdate($obj->datenextrun);
506 506
                 $this->dateend = $this->db->jdate($obj->dateend);
507 507
                 $this->datestart = $this->db->jdate($obj->datestart);
508
-                $this->lastresult = (string)$obj->lastresult;
508
+                $this->lastresult = (string) $obj->lastresult;
509 509
                 $this->lastoutput = $obj->lastoutput;
510 510
                 $this->datelastresult = $this->db->jdate($obj->datelastresult);
511 511
                 $this->unitfrequency = $obj->unitfrequency;
@@ -586,19 +586,19 @@  discard block
 block discarded – undo
586 586
             $this->unitfrequency = trim($this->unitfrequency);
587 587
         }
588 588
         if (isset($this->frequency)) {
589
-            $this->frequency = (int)$this->frequency;
589
+            $this->frequency = (int) $this->frequency;
590 590
         }
591 591
         if (isset($this->status)) {
592
-            $this->status = (int)$this->status;
592
+            $this->status = (int) $this->status;
593 593
         }
594 594
         if (isset($this->note_private)) {
595 595
             $this->note_private = trim($this->note_private);
596 596
         }
597 597
         if (isset($this->nbrun)) {
598
-            $this->nbrun = (int)$this->nbrun;
598
+            $this->nbrun = (int) $this->nbrun;
599 599
         }
600 600
         if (isset($this->maxrun)) {
601
-            $this->maxrun = (int)$this->maxrun;
601
+            $this->maxrun = (int) $this->maxrun;
602 602
         }
603 603
         if (isset($this->libname)) {
604 604
             $this->libname = trim($this->libname);
@@ -698,13 +698,13 @@  discard block
 block discarded – undo
698 698
         $sql .= " " . (!isset($this->datelastresult) || dol_strlen($this->datelastresult) == 0 ? 'NULL' : "'" . $this->db->idate($this->datelastresult) . "'") . ",";
699 699
         $sql .= " " . (!isset($this->lastoutput) ? 'NULL' : "'" . $this->db->escape($this->lastoutput) . "'") . ",";
700 700
         $sql .= " " . (!isset($this->unitfrequency) ? 'NULL' : "'" . $this->db->escape($this->unitfrequency) . "'") . ",";
701
-        $sql .= " " . (!isset($this->frequency) ? '0' : ((int)$this->frequency)) . ",";
702
-        $sql .= " " . (!isset($this->status) ? '0' : ((int)$this->status)) . ",";
703
-        $sql .= " " . ($user->id ? (int)$user->id : "NULL") . ",";
704
-        $sql .= " " . ($user->id ? (int)$user->id : "NULL") . ",";
701
+        $sql .= " " . (!isset($this->frequency) ? '0' : ((int) $this->frequency)) . ",";
702
+        $sql .= " " . (!isset($this->status) ? '0' : ((int) $this->status)) . ",";
703
+        $sql .= " " . ($user->id ? (int) $user->id : "NULL") . ",";
704
+        $sql .= " " . ($user->id ? (int) $user->id : "NULL") . ",";
705 705
         $sql .= " " . (!isset($this->note_private) ? 'NULL' : "'" . $this->db->escape($this->note_private) . "'") . ",";
706
-        $sql .= " " . (!isset($this->nbrun) ? '0' : ((int)$this->nbrun)) . ",";
707
-        $sql .= " " . (empty($this->maxrun) ? '0' : ((int)$this->maxrun)) . ",";
706
+        $sql .= " " . (!isset($this->nbrun) ? '0' : ((int) $this->nbrun)) . ",";
707
+        $sql .= " " . (empty($this->maxrun) ? '0' : ((int) $this->maxrun)) . ",";
708 708
         $sql .= " " . (!isset($this->libname) ? 'NULL' : "'" . $this->db->escape($this->libname) . "'") . ",";
709 709
         $sql .= " " . (!isset($this->test) ? 'NULL' : "'" . $this->db->escape($this->test) . "'");
710 710
         $sql .= ")";
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
         $sql = "SELECT";
970 970
         $sql .= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author";
971 971
         $sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as f";
972
-        $sql .= " WHERE f.rowid = " . ((int)$id);
972
+        $sql .= " WHERE f.rowid = " . ((int) $id);
973 973
 
974 974
         dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
975 975
         $resql = $this->db->query($sql);
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
                 dol_syslog(get_class($this) . "::run_jobs START " . $this->objectname . "->" . $this->methodename . "(" . $this->params . "); (Note: Log for cron jobs may be into a different log file)", LOG_DEBUG);
1145 1145
 
1146 1146
                 // Create Object for the called module
1147
-                $nameofclass = (string)$this->objectname;
1147
+                $nameofclass = (string) $this->objectname;
1148 1148
                 $object = Misc::getCodeLibClass($this->objectname, $this->db);
1149 1149
                 // $object = new $nameofclass($this->db);
1150 1150
                 if ($this->entity > 0) {
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
             $msg = $langs->trans("ErrorInBatch", $this->label);
1281 1281
             $from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
1282 1282
             $cmailfile = new CMailFile($subject, $this->email_alert, $from, $msg);
1283
-            $result = $cmailfile->sendfile();   // Do not test result
1283
+            $result = $cmailfile->sendfile(); // Do not test result
1284 1284
         }
1285 1285
 
1286 1286
         return $error ? -1 : 1;
@@ -1342,16 +1342,16 @@  discard block
 block discarded – undo
1342 1342
             $this->unitfrequency = trim($this->unitfrequency);
1343 1343
         }
1344 1344
         if (isset($this->frequency)) {
1345
-            $this->frequency = (int)$this->frequency;
1345
+            $this->frequency = (int) $this->frequency;
1346 1346
         }
1347 1347
         if (isset($this->status)) {
1348
-            $this->status = (int)$this->status;
1348
+            $this->status = (int) $this->status;
1349 1349
         }
1350 1350
         if (isset($this->note_private)) {
1351 1351
             $this->note_private = trim($this->note_private);
1352 1352
         }
1353 1353
         if (isset($this->nbrun)) {
1354
-            $this->nbrun = (is_numeric($this->nbrun)) ? (int)trim((string)$this->nbrun) : 0;
1354
+            $this->nbrun = (is_numeric($this->nbrun)) ? (int) trim((string) $this->nbrun) : 0;
1355 1355
         }
1356 1356
         if (isset($this->libname)) {
1357 1357
             $this->libname = trim($this->libname);
@@ -1419,7 +1419,7 @@  discard block
 block discarded – undo
1419 1419
 
1420 1420
         // Update request
1421 1421
         $sql = "UPDATE " . MAIN_DB_PREFIX . "cronjob SET";
1422
-        $sql .= " entity=" . (isset($this->entity) ? ((int)$this->entity) : $conf->entity) . ",";
1422
+        $sql .= " entity=" . (isset($this->entity) ? ((int) $this->entity) : $conf->entity) . ",";
1423 1423
         $sql .= " label=" . (isset($this->label) ? "'" . $this->db->escape($this->label) . "'" : "null") . ",";
1424 1424
         $sql .= " jobtype=" . (isset($this->jobtype) ? "'" . $this->db->escape($this->jobtype) . "'" : "null") . ",";
1425 1425
         $sql .= " command=" . (isset($this->command) ? "'" . $this->db->escape($this->command) . "'" : "null") . ",";
@@ -1429,7 +1429,7 @@  discard block
 block discarded – undo
1429 1429
         $sql .= " params=" . (isset($this->params) ? "'" . $this->db->escape($this->params) . "'" : "null") . ",";
1430 1430
         $sql .= " md5params=" . (isset($this->md5params) ? "'" . $this->db->escape($this->md5params) . "'" : "null") . ",";
1431 1431
         $sql .= " module_name=" . (isset($this->module_name) ? "'" . $this->db->escape($this->module_name) . "'" : "null") . ",";
1432
-        $sql .= " priority=" . (isset($this->priority) ? ((int)$this->priority) : "null") . ",";
1432
+        $sql .= " priority=" . (isset($this->priority) ? ((int) $this->priority) : "null") . ",";
1433 1433
         $sql .= " datelastrun=" . (dol_strlen($this->datelastrun) != 0 ? "'" . $this->db->idate($this->datelastrun) . "'" : 'null') . ",";
1434 1434
         $sql .= " datenextrun=" . (dol_strlen($this->datenextrun) != 0 ? "'" . $this->db->idate($this->datenextrun) . "'" : 'null') . ",";
1435 1435
         $sql .= " dateend=" . (dol_strlen($this->dateend) != 0 ? "'" . $this->db->idate($this->dateend) . "'" : 'null') . ",";
@@ -1438,18 +1438,18 @@  discard block
 block discarded – undo
1438 1438
         $sql .= " lastresult=" . (isset($this->lastresult) ? "'" . $this->db->escape($this->lastresult) . "'" : "null") . ",";
1439 1439
         $sql .= " lastoutput=" . (isset($this->lastoutput) ? "'" . $this->db->escape($this->lastoutput) . "'" : "null") . ",";
1440 1440
         $sql .= " unitfrequency=" . (isset($this->unitfrequency) ? "'" . $this->db->escape($this->unitfrequency) . "'" : "null") . ",";
1441
-        $sql .= " frequency=" . (isset($this->frequency) ? ((int)$this->frequency) : "null") . ",";
1442
-        $sql .= " status=" . (isset($this->status) ? ((int)$this->status) : "null") . ",";
1441
+        $sql .= " frequency=" . (isset($this->frequency) ? ((int) $this->frequency) : "null") . ",";
1442
+        $sql .= " status=" . (isset($this->status) ? ((int) $this->status) : "null") . ",";
1443 1443
         $sql .= " processing=" . ((isset($this->processing) && $this->processing > 0) ? $this->processing : "0") . ",";
1444
-        $sql .= " pid=" . (isset($this->pid) ? ((int)$this->pid) : "null") . ",";
1444
+        $sql .= " pid=" . (isset($this->pid) ? ((int) $this->pid) : "null") . ",";
1445 1445
         $sql .= " email_alert = " . (isset($this->email_alert) ? "'" . $this->db->escape($this->email_alert) . "'" : "null") . ",";
1446
-        $sql .= " fk_user_mod = " . ((int)$user->id) . ",";
1446
+        $sql .= " fk_user_mod = " . ((int) $user->id) . ",";
1447 1447
         $sql .= " note=" . (isset($this->note_private) ? "'" . $this->db->escape($this->note_private) . "'" : "null") . ",";
1448 1448
         $sql .= " nbrun=" . ((isset($this->nbrun) && $this->nbrun > 0) ? $this->nbrun : "null") . ",";
1449 1449
         $sql .= " maxrun=" . ((isset($this->maxrun) && $this->maxrun > 0) ? $this->maxrun : "0") . ",";
1450 1450
         $sql .= " libname=" . (isset($this->libname) ? "'" . $this->db->escape($this->libname) . "'" : "null") . ",";
1451 1451
         $sql .= " test=" . (isset($this->test) ? "'" . $this->db->escape($this->test) . "'" : "null");
1452
-        $sql .= " WHERE rowid=" . ((int)$this->id);
1452
+        $sql .= " WHERE rowid=" . ((int) $this->id);
1453 1453
 
1454 1454
         $this->db->begin();
1455 1455
 
@@ -1506,16 +1506,16 @@  discard block
 block discarded – undo
1506 1506
 
1507 1507
         if (empty($this->datenextrun)) {
1508 1508
             if (empty($this->datestart)) {
1509
-                if (!is_numeric($this->frequency) || (int)$this->unitfrequency == 2678400) {
1509
+                if (!is_numeric($this->frequency) || (int) $this->unitfrequency == 2678400) {
1510 1510
                     $this->datenextrun = dol_time_plus_duree($now, $this->frequency, 'm');
1511 1511
                 } else {
1512
-                    $this->datenextrun = $now + ($this->frequency * (int)$this->unitfrequency);
1512
+                    $this->datenextrun = $now + ($this->frequency * (int) $this->unitfrequency);
1513 1513
                 }
1514 1514
             } else {
1515
-                if (!is_numeric($this->frequency) || (int)$this->unitfrequency == 2678400) {
1515
+                if (!is_numeric($this->frequency) || (int) $this->unitfrequency == 2678400) {
1516 1516
                     $this->datenextrun = dol_time_plus_duree($this->datestart, $this->frequency, 'm');
1517 1517
                 } else {
1518
-                    $this->datenextrun = $this->datestart + ($this->frequency * (int)$this->unitfrequency);
1518
+                    $this->datenextrun = $this->datestart + ($this->frequency * (int) $this->unitfrequency);
1519 1519
                 }
1520 1520
             }
1521 1521
         }
@@ -1523,10 +1523,10 @@  discard block
 block discarded – undo
1523 1523
         if ($this->datenextrun < $now && $this->frequency > 0 && !empty($this->unitfrequency)) {
1524 1524
             // Loop until date is after future
1525 1525
             while ($this->datenextrun < $now) {
1526
-                if (!is_numeric($this->unitfrequency) || (int)$this->unitfrequency == 2678400 || (int)$this->unitfrequency <= 0) {
1526
+                if (!is_numeric($this->unitfrequency) || (int) $this->unitfrequency == 2678400 || (int) $this->unitfrequency <= 0) {
1527 1527
                     $this->datenextrun = dol_time_plus_duree($this->datenextrun, $this->frequency, 'm');
1528 1528
                 } else {
1529
-                    $this->datenextrun += ($this->frequency * (int)$this->unitfrequency);
1529
+                    $this->datenextrun += ($this->frequency * (int) $this->unitfrequency);
1530 1530
                 }
1531 1531
             }
1532 1532
         } else {
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.
public/htdocs/debugbar/class/autoloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      * @param string    $class  Class to load
29 29
      * @return bool             If class could be loaded
30 30
      */
31
-    static function ($class) {
31
+    static function($class) {
32 32
         if (str_starts_with($class, 'DebugBar')) {
33 33
             $file = DOL_DOCUMENT_ROOT . '/includes/maximebf/debugbar/src/' . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
34 34
             //var_dump($class.' - '.file_exists($file).' - '.$file);
Please login to merge, or discard this patch.
public/htdocs/comm/propal/list.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 $search_date_endday = GETPOSTINT('search_date_endday');
117 117
 $search_date_endmonth = GETPOSTINT('search_date_endmonth');
118 118
 $search_date_endyear = GETPOSTINT('search_date_endyear');
119
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);   // Use tzserver
119
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
120 120
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
121 121
 $search_date_end_startday = GETPOSTINT('search_date_end_startday');
122 122
 $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth');
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 $search_date_end_endday = GETPOSTINT('search_date_end_endday');
125 125
 $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth');
126 126
 $search_date_end_endyear = GETPOSTINT('search_date_end_endyear');
127
-$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);   // Use tzserver
127
+$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
128 128
 $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
129 129
 $search_date_delivery_startday = GETPOSTINT('search_date_delivery_startday');
130 130
 $search_date_delivery_startmonth = GETPOSTINT('search_date_delivery_startmonth');
@@ -682,19 +682,19 @@  discard block
 block discarded – undo
682 682
     $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
683 683
 }
684 684
 if ($search_fk_cond_reglement > 0) {
685
-    $sql .= " AND p.fk_cond_reglement = " . ((int)$search_fk_cond_reglement);
685
+    $sql .= " AND p.fk_cond_reglement = " . ((int) $search_fk_cond_reglement);
686 686
 }
687 687
 if ($search_fk_shipping_method > 0) {
688
-    $sql .= " AND p.fk_shipping_method = " . ((int)$search_fk_shipping_method);
688
+    $sql .= " AND p.fk_shipping_method = " . ((int) $search_fk_shipping_method);
689 689
 }
690 690
 if ($search_fk_input_reason > 0) {
691
-    $sql .= " AND p.fk_input_reason = " . ((int)$search_fk_input_reason);
691
+    $sql .= " AND p.fk_input_reason = " . ((int) $search_fk_input_reason);
692 692
 }
693 693
 if ($search_fk_mode_reglement > 0) {
694
-    $sql .= " AND p.fk_mode_reglement = " . ((int)$search_fk_mode_reglement);
694
+    $sql .= " AND p.fk_mode_reglement = " . ((int) $search_fk_mode_reglement);
695 695
 }
696 696
 if ($socid > 0) {
697
-    $sql .= ' AND s.rowid = ' . ((int)$socid);
697
+    $sql .= ' AND s.rowid = ' . ((int) $socid);
698 698
 }
699 699
 if ($search_status != '' && $search_status != '-1') {
700 700
     $sql .= ' AND p.fk_statut IN (' . $db->sanitize($search_status) . ')';
@@ -733,14 +733,14 @@  discard block
 block discarded – undo
733 733
     $sql .= " FROM llx_element_contact as ec";
734 734
     $sql .= " INNER JOIN  llx_c_type_contact as tc";
735 735
     $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'";
736
-    $sql .= " WHERE ec.element_id = p.rowid AND ec.fk_socpeople = " . ((int)$search_user) . ")";
736
+    $sql .= " WHERE ec.element_id = p.rowid AND ec.fk_socpeople = " . ((int) $search_user) . ")";
737 737
 }
738 738
 // Search on sale representative
739 739
 if ($search_sale && $search_sale != '-1') {
740 740
     if ($search_sale == -2) {
741 741
         $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
742 742
     } elseif ($search_sale > 0) {
743
-        $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")";
743
+        $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
744 744
     }
745 745
 }
746 746
 // Search for tag/category ($searchCategoryCustomerList is an array of ID)
@@ -754,9 +754,9 @@  discard block
 block discarded – undo
754 754
             $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT cs.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
755 755
         } elseif (intval($searchCategoryCustomer) > 0) {
756 756
             if ($searchCategoryCustomerOperator == 0) {
757
-                $searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = " . ((int)$searchCategoryCustomer) . ")";
757
+                $searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = " . ((int) $searchCategoryCustomer) . ")";
758 758
             } else {
759
-                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryCustomer);
759
+                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryCustomer);
760 760
             }
761 761
         }
762 762
     }
@@ -784,9 +784,9 @@  discard block
 block discarded – undo
784 784
             $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck, " . MAIN_DB_PREFIX . "propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product)";
785 785
         } elseif (intval($searchCategoryProduct) > 0) {
786 786
             if ($searchCategoryProductOperator == 0) {
787
-                $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck, " . MAIN_DB_PREFIX . "propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = " . ((int)$searchCategoryProduct) . ")";
787
+                $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck, " . MAIN_DB_PREFIX . "propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = " . ((int) $searchCategoryProduct) . ")";
788 788
             } else {
789
-                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryProduct);
789
+                $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryProduct);
790 790
             }
791 791
         }
792 792
     }
@@ -889,64 +889,64 @@  discard block
 block discarded – undo
889 889
     $param .= '&contextpage=' . urlencode($contextpage);
890 890
 }
891 891
 if ($limit > 0 && $limit != $conf->liste_limit) {
892
-    $param .= '&limit=' . ((int)$limit);
892
+    $param .= '&limit=' . ((int) $limit);
893 893
 }
894 894
 if ($search_all) {
895 895
     $param .= '&search_all=' . urlencode($search_all);
896 896
 }
897 897
 if ($search_date_startday) {
898
-    $param .= '&search_date_startday=' . urlencode((string)($search_date_startday));
898
+    $param .= '&search_date_startday=' . urlencode((string) ($search_date_startday));
899 899
 }
900 900
 if ($search_date_startmonth) {
901
-    $param .= '&search_date_startmonth=' . urlencode((string)($search_date_startmonth));
901
+    $param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth));
902 902
 }
903 903
 if ($search_date_startyear) {
904
-    $param .= '&search_date_startyear=' . urlencode((string)($search_date_startyear));
904
+    $param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear));
905 905
 }
906 906
 if ($search_date_endday) {
907
-    $param .= '&search_date_endday=' . urlencode((string)($search_date_endday));
907
+    $param .= '&search_date_endday=' . urlencode((string) ($search_date_endday));
908 908
 }
909 909
 if ($search_date_endmonth) {
910
-    $param .= '&search_date_endmonth=' . urlencode((string)($search_date_endmonth));
910
+    $param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth));
911 911
 }
912 912
 if ($search_date_endyear) {
913
-    $param .= '&search_date_endyear=' . urlencode((string)($search_date_endyear));
913
+    $param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear));
914 914
 }
915 915
 if ($search_date_end_startday) {
916
-    $param .= '&search_date_end_startday=' . urlencode((string)($search_date_end_startday));
916
+    $param .= '&search_date_end_startday=' . urlencode((string) ($search_date_end_startday));
917 917
 }
918 918
 if ($search_date_end_startmonth) {
919
-    $param .= '&search_date_end_startmonth=' . urlencode((string)($search_date_end_startmonth));
919
+    $param .= '&search_date_end_startmonth=' . urlencode((string) ($search_date_end_startmonth));
920 920
 }
921 921
 if ($search_date_end_startyear) {
922
-    $param .= '&search_date_end_startyear=' . urlencode((string)($search_date_end_startyear));
922
+    $param .= '&search_date_end_startyear=' . urlencode((string) ($search_date_end_startyear));
923 923
 }
924 924
 if ($search_date_end_endday) {
925
-    $param .= '&search_date_end_endday=' . urlencode((string)($search_date_end_endday));
925
+    $param .= '&search_date_end_endday=' . urlencode((string) ($search_date_end_endday));
926 926
 }
927 927
 if ($search_date_end_endmonth) {
928
-    $param .= '&search_date_end_endmonth=' . urlencode((string)($search_date_end_endmonth));
928
+    $param .= '&search_date_end_endmonth=' . urlencode((string) ($search_date_end_endmonth));
929 929
 }
930 930
 if ($search_date_end_endyear) {
931
-    $param .= '&search_date_end_endyear=' . urlencode((string)($search_date_end_endyear));
931
+    $param .= '&search_date_end_endyear=' . urlencode((string) ($search_date_end_endyear));
932 932
 }
933 933
 if ($search_date_delivery_startday) {
934
-    $param .= '&search_date_delivery_startday=' . urlencode((string)($search_date_delivery_startday));
934
+    $param .= '&search_date_delivery_startday=' . urlencode((string) ($search_date_delivery_startday));
935 935
 }
936 936
 if ($search_date_delivery_startmonth) {
937
-    $param .= '&search_date_delivery_startmonth=' . urlencode((string)($search_date_delivery_startmonth));
937
+    $param .= '&search_date_delivery_startmonth=' . urlencode((string) ($search_date_delivery_startmonth));
938 938
 }
939 939
 if ($search_date_delivery_startyear) {
940
-    $param .= '&search_date_delivery_startyear=' . urlencode((string)($search_date_delivery_startyear));
940
+    $param .= '&search_date_delivery_startyear=' . urlencode((string) ($search_date_delivery_startyear));
941 941
 }
942 942
 if ($search_date_delivery_endday) {
943
-    $param .= '&search_date_delivery_endday=' . urlencode((string)($search_date_delivery_endday));
943
+    $param .= '&search_date_delivery_endday=' . urlencode((string) ($search_date_delivery_endday));
944 944
 }
945 945
 if ($search_date_delivery_endmonth) {
946
-    $param .= '&search_date_delivery_endmonth=' . urlencode((string)($search_date_delivery_endmonth));
946
+    $param .= '&search_date_delivery_endmonth=' . urlencode((string) ($search_date_delivery_endmonth));
947 947
 }
948 948
 if ($search_date_delivery_endyear) {
949
-    $param .= '&search_date_delivery_endyear=' . urlencode((string)($search_date_delivery_endyear));
949
+    $param .= '&search_date_delivery_endyear=' . urlencode((string) ($search_date_delivery_endyear));
950 950
 }
951 951
 if ($search_ref) {
952 952
     $param .= '&search_ref=' . urlencode($search_ref);
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
     $param .= '&search_societe_alias=' . urlencode($search_societe_alias);
965 965
 }
966 966
 if ($search_user > 0) {
967
-    $param .= '&search_user=' . urlencode((string)($search_user));
967
+    $param .= '&search_user=' . urlencode((string) ($search_user));
968 968
 }
969 969
 if ($search_sale > 0) {
970 970
     $param .= '&search_sale=' . urlencode($search_sale);
@@ -997,31 +997,31 @@  discard block
 block discarded – undo
997 997
     $param .= '&search_zip=' . urlencode($search_zip);
998 998
 }
999 999
 if ($socid > 0) {
1000
-    $param .= '&socid=' . urlencode((string)($socid));
1000
+    $param .= '&socid=' . urlencode((string) ($socid));
1001 1001
 }
1002 1002
 if ($optioncss != '') {
1003 1003
     $param .= '&optioncss=' . urlencode($optioncss);
1004 1004
 }
1005 1005
 if ($search_categ_cus > 0) {
1006
-    $param .= '&search_categ_cus=' . urlencode((string)($search_categ_cus));
1006
+    $param .= '&search_categ_cus=' . urlencode((string) ($search_categ_cus));
1007 1007
 }
1008 1008
 if ($search_product_category != '') {
1009
-    $param .= '&search_product_category=' . urlencode((string)($search_product_category));
1009
+    $param .= '&search_product_category=' . urlencode((string) ($search_product_category));
1010 1010
 }
1011 1011
 if ($search_fk_cond_reglement > 0) {
1012
-    $param .= '&search_fk_cond_reglement=' . urlencode((string)($search_fk_cond_reglement));
1012
+    $param .= '&search_fk_cond_reglement=' . urlencode((string) ($search_fk_cond_reglement));
1013 1013
 }
1014 1014
 if ($search_fk_shipping_method > 0) {
1015
-    $param .= '&search_fk_shipping_method=' . urlencode((string)($search_fk_shipping_method));
1015
+    $param .= '&search_fk_shipping_method=' . urlencode((string) ($search_fk_shipping_method));
1016 1016
 }
1017 1017
 if ($search_fk_input_reason > 0) {
1018
-    $param .= '&search_fk_input_reason=' . urlencode((string)($search_fk_input_reason));
1018
+    $param .= '&search_fk_input_reason=' . urlencode((string) ($search_fk_input_reason));
1019 1019
 }
1020 1020
 if ($search_fk_mode_reglement > 0) {
1021
-    $param .= '&search_fk_mode_reglement=' . urlencode((string)($search_fk_mode_reglement));
1021
+    $param .= '&search_fk_mode_reglement=' . urlencode((string) ($search_fk_mode_reglement));
1022 1022
 }
1023 1023
 if ($search_type_thirdparty > 0) {
1024
-    $param .= '&search_type_thirdparty=' . urlencode((string)($search_type_thirdparty));
1024
+    $param .= '&search_type_thirdparty=' . urlencode((string) ($search_type_thirdparty));
1025 1025
 }
1026 1026
 if ($search_town) {
1027 1027
     $param .= '&search_town=' . urlencode($search_town);
@@ -1036,25 +1036,25 @@  discard block
 block discarded – undo
1036 1036
     $param .= '&search_town=' . urlencode($search_town);
1037 1037
 }
1038 1038
 if ($search_country) {
1039
-    $param .= '&search_country=' . urlencode((string)($search_country));
1039
+    $param .= '&search_country=' . urlencode((string) ($search_country));
1040 1040
 }
1041 1041
 if ($search_date_signature_startday) {
1042
-    $param .= '&search_date_signature_startday=' . urlencode((string)($search_date_signature_startday));
1042
+    $param .= '&search_date_signature_startday=' . urlencode((string) ($search_date_signature_startday));
1043 1043
 }
1044 1044
 if ($search_date_signature_startmonth) {
1045
-    $param .= '&search_date_signature_startmonth=' . urlencode((string)($search_date_signature_startmonth));
1045
+    $param .= '&search_date_signature_startmonth=' . urlencode((string) ($search_date_signature_startmonth));
1046 1046
 }
1047 1047
 if ($search_date_signature_startyear) {
1048
-    $param .= '&search_date_signature_startyear=' . urlencode((string)($search_date_signature_startyear));
1048
+    $param .= '&search_date_signature_startyear=' . urlencode((string) ($search_date_signature_startyear));
1049 1049
 }
1050 1050
 if ($search_date_signature_endday) {
1051
-    $param .= '&search_date_signature_endday=' . urlencode((string)($search_date_signature_endday));
1051
+    $param .= '&search_date_signature_endday=' . urlencode((string) ($search_date_signature_endday));
1052 1052
 }
1053 1053
 if ($search_date_signature_endmonth) {
1054
-    $param .= '&search_date_signature_endmonth=' . urlencode((string)($search_date_signature_endmonth));
1054
+    $param .= '&search_date_signature_endmonth=' . urlencode((string) ($search_date_signature_endmonth));
1055 1055
 }
1056 1056
 if ($search_date_signature_endyear) {
1057
-    $param .= '&search_date_signature_endyear=' . urlencode((string)($search_date_signature_endyear));
1057
+    $param .= '&search_date_signature_endyear=' . urlencode((string) ($search_date_signature_endyear));
1058 1058
 }
1059 1059
 
1060 1060
 // Add $param from extra fields
Please login to merge, or discard this patch.