Passed
Push — MINOR_OPTIMIZATIONS_241106 ( 63568c )
by Rafael
57:48
created
public/htdocs/public/website/javascript.js.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@
 block discarded – undo
28 28
  *      \brief      Page to output style page. Called with <script async src="/javascript.js.php?websiteid=123"></script>
29 29
  */
30 30
 
31
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
32
-Functions::defineIfNotDefined('NOLOGIN', 1);  // No login needed
31
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
32
+Functions::defineIfNotDefined('NOLOGIN', 1); // No login needed
33 33
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
34
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
34
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
35 35
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
36 36
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
37 37
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
38
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
38
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
39 39
 
40 40
 require '../../master.inc.php';
41 41
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/files.lib.php';
Please login to merge, or discard this patch.
public/htdocs/public/website/styles.css.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 19
  */
20 20
 
21
- use Alxarafe\Lib\Functions;use Dolibarr\Code\Website\Classes\Website;use Dolibarr\Code\Website\Classes\WebsitePage;
21
+ use Alxarafe\Lib\Functions; use Dolibarr\Code\Website\Classes\Website; use Dolibarr\Code\Website\Classes\WebsitePage;
22 22
 
23 23
  /**
24 24
  *      \file       htdocs/public/website/styles.css.php
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
  *      \brief      Page to output style page. Called with <link rel="stylesheet" href="styles.css.php?websiteid=123" type="text/css" />
27 27
  */
28 28
 
29
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
30
-Functions::defineIfNotDefined('NOLOGIN', 1);   // No login needed
29
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
30
+Functions::defineIfNotDefined('NOLOGIN', 1); // No login needed
31 31
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
32
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
32
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
33 33
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
34 34
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
35 35
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
36
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
36
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
37 37
 
38 38
 require '../../master.inc.php';
39 39
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/files.lib.php';
Please login to merge, or discard this patch.
public/htdocs/public/company/new.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@
 block discarded – undo
43 43
  *
44 44
  */
45 45
 
46
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
46
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
47 47
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
48
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
48
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
49 49
 
50 50
 
51 51
 // For MultiCompany module.
52 52
 // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
53 53
 // Because 2 entities can have the same ref
54
-$entity = (!empty($_GET['entity']) ? (int)$_GET['entity'] : (!empty($_POST['entity']) ? (int)$_POST['entity'] : 1));
54
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
55 55
 if (is_numeric($entity)) {
56 56
     define("DOLENTITY", $entity);
57 57
 }
Please login to merge, or discard this patch.
public/htdocs/public/recruitment/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
  *       \brief      Public file to show on job
29 29
  */
30 30
 
31
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
31
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
32 32
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
33 33
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
34
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
34
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
35 35
 
36 36
 // Load Dolibarr environment
37 37
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
Please login to merge, or discard this patch.
public/htdocs/public/bookcal/bookcalAjax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
  *  \brief      File to make Ajax action on Book cal
25 25
  */
26 26
 
27
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
27
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
28 28
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
29 29
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
30
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
30
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
31 31
 // If there is no need to load and show top and left menu
32
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
33
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
34
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
32
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
33
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
34
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
35 35
 
36 36
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
37 37
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/date.lib.php';
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $availabilitytab = array();
82 82
         $sql = "SELECT ba.rowid as id, ba.duration, ba.startHour, ba.endHour, ba.start, ba.end";
83 83
         $sql .= " FROM " . MAIN_DB_PREFIX . "bookcal_availabilities as ba";
84
-        $sql .= " WHERE ba.fk_bookcal_calendar = " . ((int)$id);
84
+        $sql .= " WHERE ba.fk_bookcal_calendar = " . ((int) $id);
85 85
         $sql .= " AND ba.status = 1";
86 86
         $resql = $db->query($sql);
87 87
         if ($resql) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             $sql .= " AND b.datep < '" . $db->idate($datetocheckbooking_end) . "'";
141 141
             $sql .= " AND b.code = 'AC_RDV'";
142 142
             $sql .= " AND b.status = 0";
143
-            $sql .= " AND b.fk_bookcal_calendar = " . ((int)$id);
143
+            $sql .= " AND b.fk_bookcal_calendar = " . ((int) $id);
144 144
             $resql = $db->query($sql);
145 145
             if ($resql) {
146 146
                 $num = $db->num_rows($resql);
Please login to merge, or discard this patch.
public/htdocs/public/bookcal/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
  *                  Example of URL: https://localhost/public/bookcal/index.php?id=...
40 40
  */
41 41
 
42
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
42
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
43 43
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
44
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
44
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
45 45
 
46 46
 // Load Dolibarr environment
47 47
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
             $sql = "INSERT INTO " . MAIN_DB_PREFIX . "actioncomm_resources";
269 269
             $sql .= "(fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
270 270
             $sql .= ") VALUES (";
271
-            $sql .= (int)$actioncomm->id;
271
+            $sql .= (int) $actioncomm->id;
272 272
             $sql .= ", 'socpeople'";
273
-            $sql .= ", " . (int)$contact->id;
273
+            $sql .= ", " . (int) $contact->id;
274 274
             $sql .= ", 0, 0, 0)";
275 275
             $resql = $db->query($sql);
276 276
             if (!$resql) {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         // Load into an array all days with availabilities of the calendar for the current month $todayarray['mon'] and $todayarray['year']
423 423
         $arrayofavailabledays = array();
424 424
 
425
-        $arrayofavailabilities = $availability->fetchAll('', '', 0, 0, '(status:=:1) AND (fk_bookcal_calendar:=:' . ((int)$id) . ')');
425
+        $arrayofavailabilities = $availability->fetchAll('', '', 0, 0, '(status:=:1) AND (fk_bookcal_calendar:=:' . ((int) $id) . ')');
426 426
         if ($arrayofavailabilities < 0) {
427 427
             setEventMessages($availability->error, $availability->errors, 'errors');
428 428
         } else {
Please login to merge, or discard this patch.
public/htdocs/public/opensurvey/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
  *       \brief      Public file to show onpen surveys
29 29
  */
30 30
 
31
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
31
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
32 32
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
33 33
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
34
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
34
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
35 35
 
36 36
 // Load Dolibarr environment
37 37
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
Please login to merge, or discard this patch.
public/htdocs/public/opensurvey/studs.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
  *  \brief      Page to list surveys
31 31
  */
32 32
 
33
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
33
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
34 34
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
35
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
35
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
36 36
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
37 37
 
38 38
 // Load Dolibarr environment
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
             //print 'xx'.$i."-".$car.'-'.$listofanswers[$i]['format'].'zz';
508 508
 
509 509
             if (empty($listofanswers[$i]['format']) || !in_array($listofanswers[$i]['format'], array('yesno', 'foragainst'))) {
510
-                if (((string)$car) == "1") {
510
+                if (((string) $car) == "1") {
511 511
                     print '<td class="ok">OK</td>' . "\n";
512 512
                 } else {
513 513
                     print '<td class="non">KO</td>' . "\n";
@@ -516,14 +516,14 @@  discard block
 block discarded – undo
516 516
                 if (!isset($sumfor[$i])) {
517 517
                     $sumfor[$i] = 0;
518 518
                 }
519
-                if (((string)$car) == "1") {
519
+                if (((string) $car) == "1") {
520 520
                     $sumfor[$i]++;
521 521
                 }
522 522
             }
523 523
             if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') {
524
-                if (((string)$car) == "1") {
524
+                if (((string) $car) == "1") {
525 525
                     print '<td class="ok">' . $langs->trans("Yes") . '</td>' . "\n";
526
-                } elseif (((string)$car) == "0") {
526
+                } elseif (((string) $car) == "0") {
527 527
                     print '<td class="non">' . $langs->trans("No") . '</td>' . "\n";
528 528
                 } else {
529 529
                     print '<td class="vide">&nbsp;</td>' . "\n";
@@ -535,17 +535,17 @@  discard block
 block discarded – undo
535 535
                 if (!isset($sumagainst[$i])) {
536 536
                     $sumagainst[$i] = 0;
537 537
                 }
538
-                if (((string)$car) == "1") {
538
+                if (((string) $car) == "1") {
539 539
                     $sumfor[$i]++;
540 540
                 }
541
-                if (((string)$car) == "0") {
541
+                if (((string) $car) == "0") {
542 542
                     $sumagainst[$i]++;
543 543
                 }
544 544
             }
545 545
             if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') {
546
-                if (((string)$car) == "1") {
546
+                if (((string) $car) == "1") {
547 547
                     print '<td class="ok">' . $langs->trans("For") . '</td>' . "\n";
548
-                } elseif (((string)$car) == "0") {
548
+                } elseif (((string) $car) == "0") {
549 549
                     print '<td class="non">' . $langs->trans("Against") . '</td>' . "\n";
550 550
                 } else {
551 551
                     print '<td class="vide">&nbsp;</td>' . "\n";
@@ -557,10 +557,10 @@  discard block
 block discarded – undo
557 557
                 if (!isset($sumagainst[$i])) {
558 558
                     $sumagainst[$i] = 0;
559 559
                 }
560
-                if (((string)$car) == "1") {
560
+                if (((string) $car) == "1") {
561 561
                     $sumfor[$i]++;
562 562
                 }
563
-                if (((string)$car) == "0") {
563
+                if (((string) $car) == "0") {
564 564
                     $sumagainst[$i]++;
565 565
                 }
566 566
             }
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
             for ($i = 0; $i < $nbcolonnes; $i++) {
593 593
                 $car = substr($ensemblereponses, $i, 1);
594 594
                 if (empty($listofanswers[$i]['format']) || !in_array($listofanswers[$i]['format'], array('yesno', 'foragainst'))) {
595
-                    if (((string)$car) == "1") {
595
+                    if (((string) $car) == "1") {
596 596
                         print '<td class="ok">OK</td>' . "\n";
597 597
                     } else {
598 598
                         print '<td class="non">KO</td>' . "\n";
@@ -601,14 +601,14 @@  discard block
 block discarded – undo
601 601
                     if (!isset($sumfor[$i])) {
602 602
                         $sumfor[$i] = 0;
603 603
                     }
604
-                    if (((string)$car) == "1") {
604
+                    if (((string) $car) == "1") {
605 605
                         $sumfor[$i]++;
606 606
                     }
607 607
                 }
608 608
                 if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') {
609
-                    if (((string)$car) == "1") {
609
+                    if (((string) $car) == "1") {
610 610
                         print '<td class="ok">' . $langs->trans("For") . '</td>' . "\n";
611
-                    } elseif (((string)$car) == "0") {
611
+                    } elseif (((string) $car) == "0") {
612 612
                         print '<td class="non">' . $langs->trans("Against") . '</td>' . "\n";
613 613
                     } else {
614 614
                         print '<td class="vide">&nbsp;</td>' . "\n";
@@ -620,17 +620,17 @@  discard block
 block discarded – undo
620 620
                     if (!isset($sumagainst[$i])) {
621 621
                         $sumagainst[$i] = 0;
622 622
                     }
623
-                    if (((string)$car) == "1") {
623
+                    if (((string) $car) == "1") {
624 624
                         $sumfor[$i]++;
625 625
                     }
626
-                    if (((string)$car) == "0") {
626
+                    if (((string) $car) == "0") {
627 627
                         $sumagainst[$i]++;
628 628
                     }
629 629
                 }
630 630
                 if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') {
631
-                    if (((string)$car) == "1") {
631
+                    if (((string) $car) == "1") {
632 632
                         print '<td class="ok">' . $langs->trans("For") . '</td>' . "\n";
633
-                    } elseif (((string)$car) == "0") {
633
+                    } elseif (((string) $car) == "0") {
634 634
                         print '<td class="non">' . $langs->trans("Against") . '</td>' . "\n";
635 635
                     } else {
636 636
                         print '<td class="vide">&nbsp;</td>' . "\n";
@@ -642,10 +642,10 @@  discard block
 block discarded – undo
642 642
                     if (!isset($sumagainst[$i])) {
643 643
                         $sumagainst[$i] = 0;
644 644
                     }
645
-                    if (((string)$car) == "1") {
645
+                    if (((string) $car) == "1") {
646 646
                         $sumfor[$i]++;
647 647
                     }
648
-                    if (((string)$car) == "0") {
648
+                    if (((string) $car) == "0") {
649 649
                         $sumagainst[$i]++;
650 650
                     }
651 651
                 }
Please login to merge, or discard this patch.
public/htdocs/public/demo/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@
 block discarded – undo
31 31
  *      \brief      Entry page to access demo
32 32
  */
33 33
 
34
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
35
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
34
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
35
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
36 36
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
37 37
 
38 38
 // Load Dolibarr environment
Please login to merge, or discard this patch.