Passed
Push — master ( fc4753...fa5a21 )
by Alxarafe
23:57
created
dolibarr/htdocs/stripe/config.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 *  \brief      Page to move config in api
28 28
 */
29 29
 
30
-require_once BASE_PATH . '/vendor/stripe/stripe-php/init.php';
31
-require_once BASE_PATH . '/vendor/stripe/stripe-php/lib/Stripe.php';
30
+require_once BASE_PATH.'/vendor/stripe/stripe-php/init.php';
31
+require_once BASE_PATH.'/vendor/stripe/stripe-php/lib/Stripe.php';
32 32
 
33 33
 global $stripe;
34 34
 global $conf;
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 );
47 47
 
48 48
 $stripearrayofkeys = array();
49
-if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))
49
+if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))
50 50
 {
51
-	$stripearrayofkeys = $stripearrayofkeysbyenv[0];	// Test
51
+	$stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test
52 52
 }
53 53
 else
54 54
 {
55
-	$stripearrayofkeys = $stripearrayofkeysbyenv[1];	// Live
55
+	$stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live
56 56
 }
57 57
 
58 58
 \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/functions.lib.php 1 patch
Spacing   +547 added lines, -547 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
  * 	\brief			A set of functions for Dolibarr
38 38
  * 					This file contains all frequently used functions.
39 39
  */
40
-include_once DOL_BASE_PATH . '/core/lib/json.lib.php';
40
+include_once DOL_BASE_PATH.'/core/lib/json.lib.php';
41 41
 
42 42
 /**
43 43
  * Function to return value of a static property when class
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
  */
53 53
 function getStaticMember($class, $member)
54 54
 {
55
-    dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
55
+    dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING);
56 56
 
57 57
     // This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member
58 58
     /* if (version_compare(phpversion(), '5.3.0', '<'))
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     if (isset($class::$member))
79 79
         return $class::$member;
80
-    dol_print_error('', 'Try to get a static member "' . $member . '" in class "' . $class . '" that does not exists or is not static.');
80
+    dol_print_error('', 'Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
81 81
     return null;
82 82
 }
83 83
 
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
  */
95 95
 function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
96 96
 {
97
-    require_once DOL_BASE_PATH . "/core/db/" . $type . '.class.php';
97
+    require_once DOL_BASE_PATH."/core/db/".$type.'.class.php';
98 98
 
99
-    $class = 'DoliDB' . ucfirst($type);
99
+    $class = 'DoliDB'.ucfirst($type);
100 100
     $dolidb = new $class($type, $host, $user, $pass, $name, $port);
101 101
     return $dolidb;
102 102
 }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
  */
153 153
 function getBrowserInfo($user_agent)
154 154
 {
155
-    include_once BASE_PATH . '/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php';
155
+    include_once BASE_PATH.'/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php';
156 156
 
157 157
     $name = 'unknown';
158 158
     $version = '';
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         $depth = $db->transaction_opened;
266 266
         $disconnectdone = $db->close();
267 267
     }
268
-    dol_syslog("--- End access to " . $_SERVER["PHP_SELF"] . (($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was ' . $depth . ')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO));
268
+    dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO));
269 269
 }
270 270
 
271 271
 /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
     if (empty($paramname))
311 311
         return 'BadFirstParameterForGETPOST';
312 312
     if (empty($check)) {
313
-        dol_syslog("Deprecated use of GETPOST, called with 1st param = " . $paramname . " and 2nd param is '', when calling page " . $_SERVER["PHP_SELF"], LOG_WARNING);
313
+        dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
314 314
         // Enable this line to know who call the GETPOST with '' $check parameter.
315 315
         //var_dump(debug_backtrace()[0]);
316 316
     }
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         $relativepathstring = $_SERVER["PHP_SELF"];
333 333
         // Clean $relativepathstring
334 334
         if (constant('DOL_URL_ROOT'))
335
-            $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_URL_ROOT'), '/') . '/', '', $relativepathstring);
335
+            $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'), '/').'/', '', $relativepathstring);
336 336
         $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
337 337
         $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
338 338
         //var_dump($relativepathstring);
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
         // Code for search criteria persistence.
341 341
         // Retrieve values if restore_lastsearch_values
342 342
         if (!empty($_GET['restore_lastsearch_values'])) {        // Use $_GET here and not GETPOST
343
-            if (!empty($_SESSION['lastsearch_values_' . $relativepathstring])) { // If there is saved values
344
-                $tmp = json_decode($_SESSION['lastsearch_values_' . $relativepathstring], true);
343
+            if (!empty($_SESSION['lastsearch_values_'.$relativepathstring])) { // If there is saved values
344
+                $tmp = json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true);
345 345
                 if (is_array($tmp)) {
346 346
                     foreach ($tmp as $key => $val) {
347 347
                         if ($key == $paramname) { // We are on the requested parameter
@@ -352,12 +352,12 @@  discard block
 block discarded – undo
352 352
                 }
353 353
             }
354 354
             // If there is saved contextpage, page or limit
355
-            if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_' . $relativepathstring])) {
356
-                $out = $_SESSION['lastsearch_contextpage_' . $relativepathstring];
357
-            } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_' . $relativepathstring])) {
358
-                $out = $_SESSION['lastsearch_page_' . $relativepathstring];
359
-            } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_' . $relativepathstring])) {
360
-                $out = $_SESSION['lastsearch_limit_' . $relativepathstring];
355
+            if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_'.$relativepathstring])) {
356
+                $out = $_SESSION['lastsearch_contextpage_'.$relativepathstring];
357
+            } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_'.$relativepathstring])) {
358
+                $out = $_SESSION['lastsearch_page_'.$relativepathstring];
359
+            } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_'.$relativepathstring])) {
360
+                $out = $_SESSION['lastsearch_limit_'.$relativepathstring];
361 361
             }
362 362
         }
363 363
         // Else, retreive default values if we are not doing a sort
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
                                         $qualified = 1;
426 426
 
427 427
                                     if ($qualified) {
428
-                                        $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "=");  // we accept _, -, . and ,
428
+                                        $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
429 429
                                         foreach ($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val) {
430 430
                                             if ($out)
431 431
                                                 $out .= ', ';
@@ -461,11 +461,11 @@  discard block
 block discarded – undo
461 461
                                     if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) {
462 462
                                         // We made a search from quick search menu, do we still use default filter ?
463 463
                                         if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) {
464
-                                            $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "=");  // we accept _, -, . and ,
464
+                                            $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
465 465
                                             $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
466 466
                                         }
467 467
                                     } else {
468
-                                        $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "=");  // we accept _, -, . and ,
468
+                                        $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
469 469
                                         $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
470 470
                                     }
471 471
                                     break;
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
     // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
484 484
     if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
485 485
         $maxloop = 20;
486
-        $loopnb = 0;    // Protection against infinite loop
486
+        $loopnb = 0; // Protection against infinite loop
487 487
         while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) {    // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
488 488
             $loopnb++;
489 489
             $newout = '';
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
             } elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID') {
529 529
                 $newout = $conf->entity;
530 530
             } else
531
-                $newout = '';     // Key not found, we replace with empty string
531
+                $newout = ''; // Key not found, we replace with empty string
532 532
 
533 533
 
534 534
 
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 
551 551
                 
552 552
 //var_dump('__'.$reg[1].'__ -> '.$newout);
553
-            $out = preg_replace('/__' . preg_quote($reg[1], '/') . '__/', $newout, $out);
553
+            $out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out);
554 554
         }
555 555
     }
556 556
 
@@ -668,15 +668,15 @@  discard block
 block discarded – undo
668 668
                 else if (isset($_SERVER["SERVER_NAME"]))
669 669
                     return $_SERVER["SERVER_NAME"];
670 670
             }
671
-            return dol_hash(DOL_DOCUMENT_ROOT . DOL_URL_ROOT);
671
+            return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
672 672
         }
673 673
 
674 674
         if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) {
675
-            return dol_hash($_SERVER["SERVER_NAME"] . $_SERVER["DOCUMENT_ROOT"] . DOL_DOCUMENT_ROOT . DOL_URL_ROOT);
675
+            return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
676 676
             // Use this for a "readable" cookie name
677 677
             //return dol_sanitizeFileName($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
678 678
         }
679
-        return dol_hash(DOL_DOCUMENT_ROOT . DOL_URL_ROOT);
679
+        return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
680 680
     }
681 681
 }
682 682
 
@@ -692,12 +692,12 @@  discard block
 block discarded – undo
692 692
  */
693 693
 function dol_include_once($relpath, $classname = '')
694 694
 {
695
-    global $conf, $langs, $user, $mysoc;   // Do not remove this. They must be defined for files we include. Other globals var must be retreived with $GLOBALS['var']
695
+    global $conf, $langs, $user, $mysoc; // Do not remove this. They must be defined for files we include. Other globals var must be retreived with $GLOBALS['var']
696 696
 
697 697
     $fullpath = dol_buildpath($relpath);
698 698
 
699 699
     if (!file_exists($fullpath)) {
700
-        dol_syslog('functions::dol_include_once Tried to load unexisting file: ' . $relpath, LOG_ERR);
700
+        dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR);
701 701
         return false;
702 702
     }
703 703
 
@@ -726,14 +726,14 @@  discard block
 block discarded – undo
726 726
 
727 727
     if ($type == 0 /* empty($type) */) { // For a filesystem path
728 728
         //$res = DOL_BASE_PATH . '' . $path;  // Standard default path
729
-        $res = DOL_BASE_PATH . '/' . $path;  // Standard default path
729
+        $res = DOL_BASE_PATH.'/'.$path; // Standard default path
730 730
         if (isset($conf->file->dol_document_root)) {
731 731
             foreach ($conf->file->dol_document_root as $key => $dirroot) { // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
732 732
                 if ($key == 'main') {
733 733
                     continue;
734 734
                 }
735
-                if (file_exists($dirroot . '/' . $path)) {
736
-                    $res = $dirroot . '/' . $path;
735
+                if (file_exists($dirroot.'/'.$path)) {
736
+                    $res = $dirroot.'/'.$path;
737 737
                     return $res;
738 738
                 }
739 739
             }
@@ -750,11 +750,11 @@  discard block
 block discarded – undo
750 750
         // using proxy, rewriting, virtual path, etc...
751 751
         $res = '';
752 752
         if ($type == 1)
753
-            $res = /* DOL_URL_ROOT */ DOL_BASE_URI . '/' . $path;   // Standard value
753
+            $res = /* DOL_URL_ROOT */ DOL_BASE_URI.'/'.$path; // Standard value
754 754
         if ($type == 2)
755
-            $res = /* DOL_MAIN_URL_ROOT */ DOL_BASE_PATH . '/' . $path;  // Standard value
755
+            $res = /* DOL_MAIN_URL_ROOT */ DOL_BASE_PATH.'/'.$path; // Standard value
756 756
         if ($type == 3)
757
-            $res = DOL_URL_ROOT . '/' . $path;
757
+            $res = DOL_URL_ROOT.'/'.$path;
758 758
 
759 759
         foreach ($conf->file->dol_document_root as $key => $dirroot) { // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
760 760
             if ($key == 'main') {
@@ -762,33 +762,33 @@  discard block
 block discarded – undo
762 762
                     global $dolibarr_main_url_root;
763 763
 
764 764
                     // Define $urlwithroot
765
-                    $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
766
-                    $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;  // This is to use external domain name found into config file
765
+                    $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
766
+                    $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
767 767
                     //$urlwithroot=DOL_MAIN_URL_ROOT;					// This is to use same domain name than current
768 768
 
769
-                    $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot) . '/' . $path;     // Test on start with http is for old conf syntax
769
+                    $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot).'/'.$path; // Test on start with http is for old conf syntax
770 770
                 }
771 771
                 continue;
772 772
             }
773
-            preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs);    // Take part before '?'
773
+            preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
774 774
             if (!empty($regs[1])) {
775 775
                 //print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n";
776
-                if (file_exists($dirroot . '/' . $regs[1])) {
776
+                if (file_exists($dirroot.'/'.$regs[1])) {
777 777
                     if ($type == 1) {
778
-                        $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_URL_ROOT) . $conf->file->dol_url_root[$key] . '/' . $path;
778
+                        $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
779 779
                     }
780 780
                     if ($type == 2) {
781
-                        $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_MAIN_URL_ROOT) . $conf->file->dol_url_root[$key] . '/' . $path;
781
+                        $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
782 782
                     }
783 783
                     if ($type == 3) {
784 784
                         global $dolibarr_main_url_root;
785 785
 
786 786
                         // Define $urlwithroot
787
-                        $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
788
-                        $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;  // This is to use external domain name found into config file
787
+                        $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
788
+                        $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
789 789
                         //$urlwithroot=DOL_MAIN_URL_ROOT;					// This is to use same domain name than current
790 790
 
791
-                        $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot) . $conf->file->dol_url_root[$key] . '/' . $path;     // Test on start with http is for old conf syntax
791
+                        $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax
792 792
                     }
793 793
                     break;
794 794
                 }
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
     if (empty($native)) {
817 817
         $myclone = unserialize(serialize($object));
818 818
     } else {
819
-        $myclone = clone $object;     // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable)
819
+        $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable)
820 820
     }
821 821
 
822 822
     return $myclone;
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
  */
938 938
 function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '')
939 939
 {
940
-    $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°');  // more complete than dol_sanitizeFileName
940
+    $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName
941 941
     $forbidden_chars_to_remove = array();
942 942
     if (is_array($badcharstoreplace))
943 943
         $forbidden_chars_to_replace = $badcharstoreplace;
@@ -1000,12 +1000,12 @@  discard block
 block discarded – undo
1000 1000
 function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0)
1001 1001
 {
1002 1002
     // escape quotes and backslashes, newlines, etc.
1003
-    $tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8');  // TODO Use htmlspecialchars_decode instead, that make only required change for html tags
1003
+    $tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars_decode instead, that make only required change for html tags
1004 1004
     if (!$keepb)
1005 1005
         $tmp = strtr($tmp, array("<b>" => '', '</b>' => ''));
1006 1006
     if (!$keepn)
1007 1007
         $tmp = strtr($tmp, array("\r" => '\\r', "\n" => '\\n'));
1008
-    return htmlentities($tmp, ENT_COMPAT, 'UTF-8');      // TODO Use htmlspecialchars instead, that make only required change for html tags
1008
+    return htmlentities($tmp, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars instead, that make only required change for html tags
1009 1009
 }
1010 1010
 
1011 1011
 /**
@@ -1076,14 +1076,14 @@  discard block
 block discarded – undo
1076 1076
         $message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
1077 1077
         // If adding log inside HTML page is required
1078 1078
         if (!empty($_REQUEST['logtohtml']) && (!empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || !empty($conf->global->MAIN_LOGTOHTML))) {   // MAIN_LOGTOHTML kept for backward compatibility
1079
-            $conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S") . " " . $message;
1079
+            $conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$message;
1080 1080
         }
1081 1081
 
1082 1082
         //TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output
1083 1083
         // If html log tag enabled and url parameter log defined, we show output log on HTML comments
1084 1084
         if (!empty($conf->global->MAIN_ENABLE_LOG_INLINE_HTML) && !empty($_GET["log"])) {
1085 1085
             print "\n\n<!-- Log start\n";
1086
-            print $message . "\n";
1086
+            print $message."\n";
1087 1087
             print "Log end -->\n";
1088 1088
         }
1089 1089
 
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 
1098 1098
         // This is when server run behind a reverse proxy
1099 1099
         if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
1100
-            $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'] . (empty($_SERVER["REMOTE_ADDR"]) ? '' : '->' . $_SERVER['REMOTE_ADDR']);
1100
+            $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'].(empty($_SERVER["REMOTE_ADDR"]) ? '' : '->'.$_SERVER['REMOTE_ADDR']);
1101 1101
         // This is when server run normally on a server
1102 1102
         else if (!empty($_SERVER["REMOTE_ADDR"]))
1103 1103
             $data['ip'] = $_SERVER['REMOTE_ADDR'];
@@ -1106,10 +1106,10 @@  discard block
 block discarded – undo
1106 1106
             $data['ip'] = $_SERVER['SERVER_ADDR'];
1107 1107
         // This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it).
1108 1108
         else if (!empty($_SERVER['COMPUTERNAME']))
1109
-            $data['ip'] = $_SERVER['COMPUTERNAME'] . (empty($_SERVER['USERNAME']) ? '' : '@' . $_SERVER['USERNAME']);
1109
+            $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME']) ? '' : '@'.$_SERVER['USERNAME']);
1110 1110
         // This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it).
1111 1111
         else if (!empty($_SERVER['LOGNAME']))
1112
-            $data['ip'] = '???@' . $_SERVER['LOGNAME'];
1112
+            $data['ip'] = '???@'.$_SERVER['LOGNAME'];
1113 1113
         // Loop on each log handler and send output
1114 1114
         foreach ($conf->loghandlers as $loghandlerinstance) {
1115 1115
             if ($restricttologhandler && $loghandlerinstance->code != $restricttologhandler)
@@ -1161,10 +1161,10 @@  discard block
 block discarded – undo
1161 1161
 {
1162 1162
     global $conf, $langs, $hookmanager;
1163 1163
 
1164
-    $out = "\n" . '<div class="tabs" data-role="controlgroup" data-type="horizontal">' . "\n";
1164
+    $out = "\n".'<div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n";
1165 1165
 
1166 1166
     if ($morehtmlright) {
1167
-        $out .= '<div class="inline-block floatright tabsElem">' . $morehtmlright . '</div>'; // Output right area first so when space is missing, text is in front of tabs and not under.
1167
+        $out .= '<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under.
1168 1168
     }
1169 1169
 
1170 1170
     // Show title
@@ -1175,8 +1175,8 @@  discard block
 block discarded – undo
1175 1175
         $limittitle = 30;
1176 1176
         $out .= '<a class="tabTitle">';
1177 1177
         if ($picto)
1178
-            $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_') . $picto, '', $pictoisfullpath) . ' ';
1179
-        $out .= '<span class="tabTitleText">' . dol_trunc($title, $limittitle) . '</span>';
1178
+            $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath).' ';
1179
+        $out .= '<span class="tabTitleText">'.dol_trunc($title, $limittitle).'</span>';
1180 1180
         $out .= '</a>';
1181 1181
     }
1182 1182
 
@@ -1216,23 +1216,23 @@  discard block
 block discarded – undo
1216 1216
         }
1217 1217
 
1218 1218
         if ($i < $limittoshow || $isactive) {
1219
-            $out .= '<div class="inline-block tabsElem' . ($isactive ? ' tabsElemActive' : '') . ((!$isactive && !empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '') . '"><!-- id tab = ' . (empty($links[$i][2]) ? '' : $links[$i][2]) . ' -->';
1219
+            $out .= '<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((!$isactive && !empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '').'"><!-- id tab = '.(empty($links[$i][2]) ? '' : $links[$i][2]).' -->';
1220 1220
             if (isset($links[$i][2]) && $links[$i][2] == 'image') {
1221 1221
                 if (!empty($links[$i][0])) {
1222
-                    $out .= '<a class="tabimage' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">' . $links[$i][1] . '</a>' . "\n";
1222
+                    $out .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
1223 1223
                 } else {
1224
-                    $out .= '<span class="tabspan">' . $links[$i][1] . '</span>' . "\n";
1224
+                    $out .= '<span class="tabspan">'.$links[$i][1].'</span>'."\n";
1225 1225
                 }
1226 1226
             } else if (!empty($links[$i][1])) {
1227 1227
                 //print "x $i $active ".$links[$i][2]." z";
1228 1228
                 if ($isactive) {
1229
-                    $out .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="tabactive tab inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">';
1229
+                    $out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">';
1230 1230
                     $out .= $links[$i][1];
1231
-                    $out .= '</a>' . "\n";
1231
+                    $out .= '</a>'."\n";
1232 1232
                 } else {
1233
-                    $out .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="tabunactive tab inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">';
1233
+                    $out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabunactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">';
1234 1234
                     $out .= $links[$i][1];
1235
-                    $out .= '</a>' . "\n";
1235
+                    $out .= '</a>'."\n";
1236 1236
                 }
1237 1237
             }
1238 1238
             $out .= '</div>';
@@ -1245,14 +1245,14 @@  discard block
 block discarded – undo
1245 1245
             $outmore .= '<div class="popuptab wordwrap" style="display:inherit;">';
1246 1246
             if (isset($links[$i][2]) && $links[$i][2] == 'image') {
1247 1247
                 if (!empty($links[$i][0]))
1248
-                    $outmore .= '<a class="tabimage' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">' . $links[$i][1] . '</a>' . "\n";
1248
+                    $outmore .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
1249 1249
                 else
1250
-                    $outmore .= '<span class="tabspan">' . $links[$i][1] . '</span>' . "\n";
1250
+                    $outmore .= '<span class="tabspan">'.$links[$i][1].'</span>'."\n";
1251 1251
             }
1252 1252
             else if (!empty($links[$i][1])) {
1253
-                $outmore .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="wordwrap inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">';
1253
+                $outmore .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="wordwrap inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">';
1254 1254
                 $outmore .= preg_replace('/([a-z])\/([a-z])/i', '\\1 / \\2', $links[$i][1]); // Replace x/y with x / y to allow wrap on long composed texts.
1255
-                $outmore .= '</a>' . "\n";
1255
+                $outmore .= '</a>'."\n";
1256 1256
             }
1257 1257
             $outmore .= '</div>';
1258 1258
 
@@ -1268,24 +1268,24 @@  discard block
 block discarded – undo
1268 1268
         $right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
1269 1269
 
1270 1270
         $tabsname = str_replace("@", "", $picto);
1271
-        $out .= '<div id="moretabs' . $tabsname . '" class="inline-block tabsElem">';
1272
-        $out .= '<a href="#" class="tab moretab inline-block tabunactive reposition">' . $langs->trans("More") . '... (' . $nbintab . ')</a>';
1273
-        $out .= '<div id="moretabsList' . $tabsname . '" style="position: absolute; ' . $left . ': -999em; text-align: ' . $left . '; margin:0px; padding:2px">';
1271
+        $out .= '<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
1272
+        $out .= '<a href="#" class="tab moretab inline-block tabunactive reposition">'.$langs->trans("More").'... ('.$nbintab.')</a>';
1273
+        $out .= '<div id="moretabsList'.$tabsname.'" style="position: absolute; '.$left.': -999em; text-align: '.$left.'; margin:0px; padding:2px">';
1274 1274
         $out .= $outmore;
1275 1275
         $out .= '</div>';
1276 1276
         $out .= '<div></div>';
1277 1277
         $out .= "</div>\n";
1278 1278
 
1279 1279
         $out .= "<script>";
1280
-        $out .= "$('#moretabs" . $tabsname . "').mouseenter( function() { console.log('mouseenter " . $left . "'); $('#moretabsList" . $tabsname . "').css('" . $left . "','auto');});";
1281
-        $out .= "$('#moretabs" . $tabsname . "').mouseleave( function() { console.log('mouseleave " . $left . "'); $('#moretabsList" . $tabsname . "').css('" . $left . "','-999em');});";
1280
+        $out .= "$('#moretabs".$tabsname."').mouseenter( function() { console.log('mouseenter ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','auto');});";
1281
+        $out .= "$('#moretabs".$tabsname."').mouseleave( function() { console.log('mouseleave ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','-999em');});";
1282 1282
         $out .= "</script>";
1283 1283
     }
1284 1284
 
1285 1285
     $out .= "</div>\n";
1286 1286
 
1287 1287
     if (!$notab || $notab == -1)
1288
-        $out .= "\n" . '<div class="tabBar' . ($notab == -1 ? '' : ' tabBarWithBottom') . '">' . "\n";
1288
+        $out .= "\n".'<div class="tabBar'.($notab == -1 ? '' : ' tabBarWithBottom').'">'."\n";
1289 1289
 
1290 1290
     $parameters = array('tabname' => $active, 'out' => $out);
1291 1291
     $reshook = $hookmanager->executeHooks('printTabsHead', $parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead"
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
         if ($conf->browser->layout == 'phone')
1395 1395
             $maxvisiblephotos = 1;
1396 1396
         if ($showimage)
1397
-            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $object->show_photos('product', $conf->product->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0) . '</div>';
1397
+            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('product', $conf->product->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0).'</div>';
1398 1398
         else {
1399 1399
             if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
1400 1400
                 $nophoto = '';
@@ -1403,18 +1403,18 @@  discard block
 block discarded – undo
1403 1403
             //elseif ($conf->browser->layout != 'phone') {    // Show no photo link
1404 1404
             $nophoto = '/public/theme/common/nophoto.png';
1405 1405
             // $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '"></div>';
1406
-            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>';
1406
+            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.DOL_BASE_URI.$nophoto.'"></div>';
1407 1407
             //}
1408 1408
         }
1409 1409
     } elseif ($object->element == 'ticket') {
1410 1410
         $width = 80;
1411 1411
         $cssclass = 'photoref';
1412
-        $showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity] . '/' . $object->track_id);
1412
+        $showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity].'/'.$object->track_id);
1413 1413
         $maxvisiblephotos = (isset($conf->global->TICKETSUP_MAX_VISIBLE_PHOTO) ? $conf->global->TICKETSUP_MAX_VISIBLE_PHOTO : 2);
1414 1414
         if ($conf->browser->layout == 'phone')
1415 1415
             $maxvisiblephotos = 1;
1416 1416
         if ($showimage)
1417
-            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $object->show_photos('ticket', $conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0) . '</div>';
1417
+            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('ticket', $conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0).'</div>';
1418 1418
         else {
1419 1419
             if (!empty($conf->global->TICKETSUP_NODISPLAYIFNOPHOTO)) {
1420 1420
                 $nophoto = '';
@@ -1423,7 +1423,7 @@  discard block
 block discarded – undo
1423 1423
             //elseif ($conf->browser->layout != 'phone') {    // Show no photo link
1424 1424
             $nophoto = '/public/theme/common/nophoto.png';
1425 1425
             //$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '"></div>';
1426
-            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>';
1426
+            $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.DOL_BASE_URI.$nophoto.'"></div>';
1427 1427
             //}
1428 1428
         }
1429 1429
     } else {
@@ -1433,25 +1433,25 @@  discard block
 block discarded – undo
1433 1433
                 // Check if a preview file is available
1434 1434
                 if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice', 'expensereport')) && class_exists("Imagick")) {
1435 1435
                     $objectref = dol_sanitizeFileName($object->ref);
1436
-                    $dir_output = (empty($conf->$modulepart->multidir_output[$entity]) ? $conf->$modulepart->dir_output : $conf->$modulepart->multidir_output[$entity]) . "/";
1436
+                    $dir_output = (empty($conf->$modulepart->multidir_output[$entity]) ? $conf->$modulepart->dir_output : $conf->$modulepart->multidir_output[$entity])."/";
1437 1437
                     if (in_array($modulepart, array('invoice_supplier', 'supplier_invoice'))) {
1438 1438
                         $subdir = get_exdir($object->id, 2, 0, 1, $object, $modulepart);
1439
-                        $subdir .= ((!empty($subdir) && !preg_match('/\/$/', $subdir)) ? '/' : '') . $objectref;  // the objectref dir is not included into get_exdir when used with level=2, so we add it at end
1439
+                        $subdir .= ((!empty($subdir) && !preg_match('/\/$/', $subdir)) ? '/' : '').$objectref; // the objectref dir is not included into get_exdir when used with level=2, so we add it at end
1440 1440
                     } else {
1441 1441
                         $subdir = get_exdir($object->id, 0, 0, 1, $object, $modulepart);
1442 1442
                     }
1443 1443
                     if (empty($subdir))
1444 1444
                         $subdir = 'errorgettingsubdirofobject'; // Protection to avoid to return empty path
1445 1445
 
1446
-                    $filepath = $dir_output . $subdir . "/";
1446
+                    $filepath = $dir_output.$subdir."/";
1447 1447
 
1448
-                    $file = $filepath . $objectref . ".pdf";
1449
-                    $relativepath = $subdir . '/' . $objectref . '.pdf';
1448
+                    $file = $filepath.$objectref.".pdf";
1449
+                    $relativepath = $subdir.'/'.$objectref.'.pdf';
1450 1450
 
1451 1451
                     // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
1452
-                    $fileimage = $file . '_preview.png';              // If PDF has 1 page
1453
-                    $fileimagebis = $file . '_preview-0.png';         // If PDF has more than one page
1454
-                    $relativepathimage = $relativepath . '_preview.png';
1452
+                    $fileimage = $file.'_preview.png'; // If PDF has 1 page
1453
+                    $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page
1454
+                    $relativepathimage = $relativepath.'_preview.png';
1455 1455
 
1456 1456
                     // Si fichier PDF existe
1457 1457
                     if (file_exists($file)) {
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
                         if ((!file_exists($fileimage) || (filemtime($fileimage) < filemtime($file))) && (!file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file)))
1461 1461
                         ) {
1462 1462
                             if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) {  // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
1463
-                                include_once DOL_BASE_PATH . '/core/lib/files.lib.php';
1463
+                                include_once DOL_BASE_PATH.'/core/lib/files.lib.php';
1464 1464
                                 $ret = dol_convert_file($file, 'png', $fileimage);
1465 1465
                                 if ($ret < 0)
1466 1466
                                     $error++;
@@ -1473,14 +1473,14 @@  discard block
 block discarded – undo
1473 1473
                         // Si fichier png PDF d'1 page trouve
1474 1474
                         if (file_exists($fileimage)) {
1475 1475
                             $phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
1476
-                            $phototoshow .= '<img height="' . $heightforphotref . '" class="photo photowithmargin photowithborder" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=apercu' . $modulepart . '&amp;file=' . urlencode($relativepathimage) . '">';
1476
+                            $phototoshow .= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=apercu'.$modulepart.'&amp;file='.urlencode($relativepathimage).'">';
1477 1477
                             $phototoshow .= '</div></div>';
1478 1478
                         }
1479 1479
                         // Si fichier png PDF de plus d'1 page trouve
1480 1480
                         elseif (file_exists($fileimagebis)) {
1481
-                            $preview = preg_replace('/\.png/', '', $relativepathimage) . "-0.png";
1481
+                            $preview = preg_replace('/\.png/', '', $relativepathimage)."-0.png";
1482 1482
                             $phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
1483
-                            $phototoshow .= '<img height="' . $heightforphotref . '" class="photo photowithmargin photowithborder" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=apercu' . $modulepart . '&amp;file=' . urlencode($preview) . '"><p>';
1483
+                            $phototoshow .= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=apercu'.$modulepart.'&amp;file='.urlencode($preview).'"><p>';
1484 1484
                             $phototoshow .= '</div></div>';
1485 1485
                         }
1486 1486
                     }
@@ -1507,10 +1507,10 @@  discard block
 block discarded – undo
1507 1507
                     $picto = $object->picto;
1508 1508
                     if ($object->element == 'project' && !$object->public)
1509 1509
                         $picto = 'project'; // instead of projectpub
1510
-                    $nophoto = img_picto('', 'object_' . $picto, '', false, 1);
1510
+                    $nophoto = img_picto('', 'object_'.$picto, '', false, 1);
1511 1511
                 }
1512 1512
                 $morehtmlleft .= '<!-- No photo to show -->';
1513
-                $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . $nophoto . '"></div></div>';
1513
+                $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.$nophoto.'"></div></div>';
1514 1514
 
1515 1515
                 $morehtmlleft .= '</div>';
1516 1516
             }
@@ -1518,7 +1518,7 @@  discard block
 block discarded – undo
1518 1518
     }
1519 1519
 
1520 1520
     if ($showbarcode)
1521
-        $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $form->showbarcode($object) . '</div>';
1521
+        $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
1522 1522
 
1523 1523
     if ($object->element == 'societe') {
1524 1524
         if (!empty($conf->use_javascript_ajax) && $user->rights->societe->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
@@ -1531,14 +1531,14 @@  discard block
 block discarded – undo
1531 1531
         if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
1532 1532
             $morehtmlstatus .= ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
1533 1533
         } else {
1534
-            $morehtmlstatus .= '<span class="statusrefsell">' . $object->getLibStatut(5, 0) . '</span>';
1534
+            $morehtmlstatus .= '<span class="statusrefsell">'.$object->getLibStatut(5, 0).'</span>';
1535 1535
         }
1536 1536
         $morehtmlstatus .= ' &nbsp; ';
1537 1537
         //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') ';
1538 1538
         if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
1539 1539
             $morehtmlstatus .= ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
1540 1540
         } else {
1541
-            $morehtmlstatus .= '<span class="statusrefbuy">' . $object->getLibStatut(5, 1) . '</span>';
1541
+            $morehtmlstatus .= '<span class="statusrefbuy">'.$object->getLibStatut(5, 1).'</span>';
1542 1542
         }
1543 1543
     } elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan'))) {
1544 1544
         $tmptxt = $object->getLibStatut(6, $object->totalpaye);
@@ -1565,7 +1565,7 @@  discard block
 block discarded – undo
1565 1565
         if ($object->progress >= 100)
1566 1566
             $object->fk_statut = 3;
1567 1567
         $tmptxt = $object->getLibStatut(5);
1568
-        $morehtmlstatus .= $tmptxt;  // No status on task
1568
+        $morehtmlstatus .= $tmptxt; // No status on task
1569 1569
     }
1570 1570
     else { // Generic case
1571 1571
         $tmptxt = $object->getLibStatut(6);
@@ -1579,18 +1579,18 @@  discard block
 block discarded – undo
1579 1579
         if (method_exists($object, 'getVentilExportCompta')) {
1580 1580
             $accounted = $object->getVentilExportCompta();
1581 1581
             $langs->load("accountancy");
1582
-            $morehtmlstatus .= '</div><div class="statusref statusrefbis">' . ($accounted > 0 ? $langs->trans("Accounted") : $langs->trans("NotYetAccounted"));
1582
+            $morehtmlstatus .= '</div><div class="statusref statusrefbis">'.($accounted > 0 ? $langs->trans("Accounted") : $langs->trans("NotYetAccounted"));
1583 1583
         }
1584 1584
     }
1585 1585
 
1586 1586
     // Add alias for thirdparty
1587 1587
     if (!empty($object->name_alias))
1588
-        $morehtmlref .= '<div class="refidno">' . $object->name_alias . '</div>';
1588
+        $morehtmlref .= '<div class="refidno">'.$object->name_alias.'</div>';
1589 1589
 
1590 1590
     // Add label
1591 1591
     if ($object->element == 'product' || $object->element == 'bank_account' || $object->element == 'project_task') {
1592 1592
         if (!empty($object->label))
1593
-            $morehtmlref .= '<div class="refidno">' . $object->label . '</div>';
1593
+            $morehtmlref .= '<div class="refidno">'.$object->label.'</div>';
1594 1594
     }
1595 1595
 
1596 1596
     if (method_exists($object, 'getBannerAddress') && $object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories' && $object->element != 'ecm_files') {
@@ -1600,11 +1600,11 @@  discard block
 block discarded – undo
1600 1600
     }
1601 1601
     if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member', 'product'))) {
1602 1602
         $morehtmlref .= '<div style="clear: both;"></div><div class="refidno">';
1603
-        $morehtmlref .= $langs->trans("TechnicalID") . ': ' . $object->id;
1603
+        $morehtmlref .= $langs->trans("TechnicalID").': '.$object->id;
1604 1604
         $morehtmlref .= '</div>';
1605 1605
     }
1606 1606
 
1607
-    print '<div class="' . ($onlybanner ? 'arearefnobottom ' : 'arearef ') . 'heightref valignmiddle" width="100%">';
1607
+    print '<div class="'.($onlybanner ? 'arearefnobottom ' : 'arearef ').'heightref valignmiddle" width="100%">';
1608 1608
     print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
1609 1609
     print '</div>';
1610 1610
     print '<div class="underrefbanner clearboth"></div>';
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
     if ($fieldrequired)
1627 1627
         $ret .= '<span class="fieldrequired">';
1628 1628
     if (($conf->dol_use_jmobile != 4))
1629
-        $ret .= '<label for="' . $fieldkey . '">';
1629
+        $ret .= '<label for="'.$fieldkey.'">';
1630 1630
     $ret .= $langs->trans($langkey);
1631 1631
     if (($conf->dol_use_jmobile != 4))
1632 1632
         $ret .= '</label>';
@@ -1645,9 +1645,9 @@  discard block
 block discarded – undo
1645 1645
 function dol_bc($var, $moreclass = '')
1646 1646
 {
1647 1647
     global $bc;
1648
-    $ret = ' ' . $bc[$var];
1648
+    $ret = ' '.$bc[$var];
1649 1649
     if ($moreclass)
1650
-        $ret = preg_replace('/class=\"/', 'class="' . $moreclass . ' ', $ret);
1650
+        $ret = preg_replace('/class=\"/', 'class="'.$moreclass.' ', $ret);
1651 1651
     return $ret;
1652 1652
 }
1653 1653
 
@@ -1667,50 +1667,50 @@  discard block
 block discarded – undo
1667 1667
     global $conf, $langs;
1668 1668
 
1669 1669
     $ret = '';
1670
-    $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR');    // See also MAIN_FORCE_STATE_INTO_ADDRESS
1670
+    $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
1671 1671
     // Address
1672 1672
     if (empty($mode)) {
1673 1673
         $ret .= $object->address;
1674 1674
     }
1675 1675
     // Zip/Town/State
1676 1676
     if (in_array($object->country_code, array('AU', 'CA', 'US')) || !empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) {    // US: title firstname name \n address lines \n town, state, zip \n country
1677
-        $ret .= ($ret ? $sep : '' ) . $object->town;
1677
+        $ret .= ($ret ? $sep : '').$object->town;
1678 1678
         if ($object->state) {
1679
-            $ret .= ($ret ? ", " : '') . $object->state;
1679
+            $ret .= ($ret ? ", " : '').$object->state;
1680 1680
         }
1681 1681
         if ($object->zip)
1682
-            $ret .= ($ret ? ", " : '') . $object->zip;
1682
+            $ret .= ($ret ? ", " : '').$object->zip;
1683 1683
     }
1684 1684
     else if (in_array($object->country_code, array('GB', 'UK'))) { // UK: title firstname name \n address lines \n town state \n zip \n country
1685
-        $ret .= ($ret ? $sep : '' ) . $object->town;
1685
+        $ret .= ($ret ? $sep : '').$object->town;
1686 1686
         if ($object->state) {
1687
-            $ret .= ($ret ? ", " : '') . $object->state;
1687
+            $ret .= ($ret ? ", " : '').$object->state;
1688 1688
         }
1689 1689
         if ($object->zip)
1690
-            $ret .= ($ret ? $sep : '' ) . $object->zip;
1690
+            $ret .= ($ret ? $sep : '').$object->zip;
1691 1691
     }
1692 1692
     else if (in_array($object->country_code, array('ES', 'TR'))) { // ES: title firstname name \n address lines \n zip town \n state \n country
1693
-        $ret .= ($ret ? $sep : '' ) . $object->zip;
1694
-        $ret .= ($object->town ? (($object->zip ? ' ' : '') . $object->town) : '');
1693
+        $ret .= ($ret ? $sep : '').$object->zip;
1694
+        $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : '');
1695 1695
         if ($object->state) {
1696
-            $ret .= "\n" . $object->state;
1696
+            $ret .= "\n".$object->state;
1697 1697
         }
1698 1698
     } else if (in_array($object->country_code, array('IT'))) { // IT: tile firstname name\n address lines \n zip (Code Departement) \n country
1699
-        $ret .= ($ret ? $sep : '' ) . $object->zip;
1700
-        $ret .= ($object->town ? (($object->zip ? ' ' : '') . $object->town) : '');
1701
-        $ret .= ($object->departement_id ? (' (' . ($object->departement_id) . ')') : '');
1699
+        $ret .= ($ret ? $sep : '').$object->zip;
1700
+        $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : '');
1701
+        $ret .= ($object->departement_id ? (' ('.($object->departement_id).')') : '');
1702 1702
     } else {                                          // Other: title firstname name \n address lines \n zip town \n country
1703
-        $ret .= $object->zip ? (($ret ? $sep : '' ) . $object->zip) : '';
1704
-        $ret .= ($object->town ? (($object->zip ? ' ' : ($ret ? $sep : '' )) . $object->town) : '');
1703
+        $ret .= $object->zip ? (($ret ? $sep : '').$object->zip) : '';
1704
+        $ret .= ($object->town ? (($object->zip ? ' ' : ($ret ? $sep : '')).$object->town) : '');
1705 1705
         if ($object->state && in_array($object->country_code, $countriesusingstate)) {
1706
-            $ret .= ($ret ? ", " : '') . $object->state;
1706
+            $ret .= ($ret ? ", " : '').$object->state;
1707 1707
         }
1708 1708
     }
1709 1709
     if (!is_object($outputlangs))
1710 1710
         $outputlangs = $langs;
1711 1711
     if ($withcountry) {
1712 1712
         $langs->load("dict");
1713
-        $ret .= ($object->country_code ? ($ret ? $sep : '') . $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $object->country_code)) : '');
1713
+        $ret .= ($object->country_code ? ($ret ? $sep : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)) : '');
1714 1714
     }
1715 1715
 
1716 1716
     return $ret;
@@ -1765,13 +1765,13 @@  discard block
 block discarded – undo
1765 1765
         if (is_string($tzoutput)) {
1766 1766
             if ($tzoutput == 'tzserver') {
1767 1767
                 $to_gmt = false;
1768
-                $offsettzstring = @date_default_timezone_get();  // Example 'Europe/Berlin' or 'Indian/Reunion'
1768
+                $offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion'
1769 1769
                 $offsettz = 0;
1770 1770
                 $offsetdst = 0;
1771 1771
             } elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
1772 1772
                 $to_gmt = true;
1773 1773
                 $offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion'
1774
-                $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60;  // Will not be used anymore
1774
+                $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore
1775 1775
                 $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore
1776 1776
             }
1777 1777
         }
@@ -1817,9 +1817,9 @@  discard block
 block discarded – undo
1817 1817
     else if ($format == 'dayxcard')
1818 1818
         $format = '%Y%m%d';
1819 1819
     else if ($format == 'dayrfc')
1820
-        $format = '%Y-%m-%d';             // DATE_RFC3339
1820
+        $format = '%Y-%m-%d'; // DATE_RFC3339
1821 1821
     else if ($format == 'dayhourrfc')
1822
-        $format = '%Y-%m-%dT%H:%M:%SZ';   // DATETIME RFC3339
1822
+        $format = '%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339
1823 1823
     else if ($format == 'standard')
1824 1824
         $format = '%Y-%m-%d %H:%M:%S';
1825 1825
 
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
 
1831 1831
     // If date undefined or "", we return ""
1832 1832
     if (dol_strlen($time) == 0)
1833
-        return '';  // $time=0 allowed (it means 01/01/1970 00:00:00)
1833
+        return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)
1834 1834
 
1835 1835
 
1836 1836
 
@@ -1868,7 +1868,7 @@  discard block
 block discarded – undo
1868 1868
     if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg) || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) { // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
1869 1869
         // TODO Remove this.
1870 1870
         // This part of code should not be used.
1871
-        dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page " . $_SERVER["PHP_SELF"], LOG_ERR);
1871
+        dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR);
1872 1872
         // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS'
1873 1873
         $syear = (!empty($reg[1]) ? $reg[1] : '');
1874 1874
         $smonth = (!empty($reg[2]) ? $reg[2] : '');
@@ -1886,7 +1886,7 @@  discard block
 block discarded – undo
1886 1886
 
1887 1887
             $ret = adodb_strftime($format, $timetouse, $to_gmt);
1888 1888
         } else
1889
-            $ret = 'Bad value ' . $time . ' for date';
1889
+            $ret = 'Bad value '.$time.' for date';
1890 1890
     }
1891 1891
 
1892 1892
     if (preg_match('/__b__/i', $format)) {
@@ -1895,11 +1895,11 @@  discard block
 block discarded – undo
1895 1895
         $month = adodb_strftime('%m', $timetouse);
1896 1896
         $month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
1897 1897
         if ($encodetooutput) {
1898
-            $monthtext = $outputlangs->transnoentities('Month' . $month);
1899
-            $monthtextshort = $outputlangs->transnoentities('MonthShort' . $month);
1898
+            $monthtext = $outputlangs->transnoentities('Month'.$month);
1899
+            $monthtextshort = $outputlangs->transnoentities('MonthShort'.$month);
1900 1900
         } else {
1901
-            $monthtext = $outputlangs->transnoentitiesnoconv('Month' . $month);
1902
-            $monthtextshort = $outputlangs->transnoentitiesnoconv('MonthShort' . $month);
1901
+            $monthtext = $outputlangs->transnoentitiesnoconv('Month'.$month);
1902
+            $monthtextshort = $outputlangs->transnoentitiesnoconv('MonthShort'.$month);
1903 1903
         }
1904 1904
         //print 'monthtext='.$monthtext.' monthtextshort='.$monthtextshort;
1905 1905
         $ret = str_replace('__b__', $monthtextshort, $ret);
@@ -1910,8 +1910,8 @@  discard block
 block discarded – undo
1910 1910
     if (preg_match('/__a__/i', $format)) {
1911 1911
         $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
1912 1912
 
1913
-        $w = adodb_strftime('%w', $timetouse);      // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
1914
-        $dayweek = $outputlangs->transnoentitiesnoconv('Day' . $w);
1913
+        $w = adodb_strftime('%w', $timetouse); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
1914
+        $dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w);
1915 1915
         $ret = str_replace('__A__', $dayweek, $ret);
1916 1916
         $ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret);
1917 1917
     }
@@ -1958,9 +1958,9 @@  discard block
 block discarded – undo
1958 1958
 
1959 1959
     $usealternatemethod = false;
1960 1960
     if ($timestamp <= 0)
1961
-        $usealternatemethod = true;    // <= 1970
1961
+        $usealternatemethod = true; // <= 1970
1962 1962
     if ($timestamp >= 2145913200)
1963
-        $usealternatemethod = true;  // >= 2038
1963
+        $usealternatemethod = true; // >= 2038
1964 1964
 
1965 1965
     if ($usealternatemethod) {
1966 1966
         $arrayinfo = adodb_getdate($timestamp, $fast);
@@ -2020,23 +2020,23 @@  discard block
 block discarded – undo
2020 2020
 
2021 2021
     if (method_exists('DateTime', 'getTimestamp')) {
2022 2022
         if (empty($gm) || $gm === 'server') {
2023
-            $default_timezone = @date_default_timezone_get();  // Example 'Europe/Berlin'
2023
+            $default_timezone = @date_default_timezone_get(); // Example 'Europe/Berlin'
2024 2024
             $localtz = new DateTimeZone($default_timezone);
2025 2025
         } else if ($gm === 'user') {
2026 2026
             // We use dol_tz_string first because it is more reliable.
2027
-            $default_timezone = (empty($_SESSION["dol_tz_string"]) ? @date_default_timezone_get() : $_SESSION["dol_tz_string"]);  // Example 'Europe/Berlin'
2027
+            $default_timezone = (empty($_SESSION["dol_tz_string"]) ? @date_default_timezone_get() : $_SESSION["dol_tz_string"]); // Example 'Europe/Berlin'
2028 2028
             try {
2029 2029
                 $localtz = new DateTimeZone($default_timezone);
2030 2030
             } catch (Exception $e) {
2031
-                dol_syslog("Warning dol_tz_string contains an invalid value " . $_SESSION["dol_tz_string"], LOG_WARNING);
2031
+                dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING);
2032 2032
                 $default_timezone = @date_default_timezone_get();
2033 2033
             }
2034 2034
         } else if (strrpos($gm, "tz,") !== false) {
2035
-            $timezone = str_replace("tz,", "", $gm);  // Example 'tz,Europe/Berlin'
2035
+            $timezone = str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin'
2036 2036
             try {
2037 2037
                 $localtz = new DateTimeZone($timezone);
2038 2038
             } catch (Exception $e) {
2039
-                dol_syslog("Warning passed timezone contains an invalid value " . $timezone, LOG_WARNING);
2039
+                dol_syslog("Warning passed timezone contains an invalid value ".$timezone, LOG_WARNING);
2040 2040
             }
2041 2041
         }
2042 2042
 
@@ -2075,8 +2075,8 @@  discard block
 block discarded – undo
2075 2075
     if ($mode == 'gmt')
2076 2076
         $ret = time(); // Time for now at greenwich.
2077 2077
     else if ($mode == 'tzserver') {  // Time for now with PHP server timezone added
2078
-        require_once DOL_BASE_PATH . '/core/lib/date.lib.php';
2079
-        $tzsecond = getServerTimeZoneInt('now');    // Contains tz+dayling saving time
2078
+        require_once DOL_BASE_PATH.'/core/lib/date.lib.php';
2079
+        $tzsecond = getServerTimeZoneInt('now'); // Contains tz+dayling saving time
2080 2080
         $ret = (int) (dol_now('gmt') + ($tzsecond * 3600));
2081 2081
     }
2082 2082
     /* else if ($mode == 'tzref')				// Time for now with parent company timezone is added
@@ -2122,9 +2122,9 @@  discard block
 block discarded – undo
2122 2122
     }
2123 2123
     // Use long or short text unit
2124 2124
     if (empty($shortunit)) {
2125
-        $ret .= ' ' . $textunitlong;
2125
+        $ret .= ' '.$textunitlong;
2126 2126
     } else {
2127
-        $ret .= ' ' . $textunitshort;
2127
+        $ret .= ' '.$textunitshort;
2128 2128
     }
2129 2129
 
2130 2130
     return $ret;
@@ -2152,13 +2152,13 @@  discard block
 block discarded – undo
2152 2152
     $link .= $url;
2153 2153
     $link .= '"';
2154 2154
     if ($target)
2155
-        $link .= ' target="' . $target . '"';
2155
+        $link .= ' target="'.$target.'"';
2156 2156
     $link .= '>';
2157 2157
     if (!preg_match('/^http/i', $url))
2158 2158
         $link .= 'http://';
2159 2159
     $link .= dol_trunc($url, $max);
2160 2160
     $link .= '</a>';
2161
-    return '<div class="nospan float" style="margin-right: 10px">' . ($withpicto ? img_picto($langs->trans("Url"), 'object_globe.png') . ' ' : '') . $link . '</div>';
2161
+    return '<div class="nospan float" style="margin-right: 10px">'.($withpicto ? img_picto($langs->trans("Url"), 'object_globe.png').' ' : '').$link.'</div>';
2162 2162
 }
2163 2163
 
2164 2164
 /**
@@ -2199,9 +2199,9 @@  discard block
 block discarded – undo
2199 2199
             $type = 'AC_EMAIL';
2200 2200
             $link = '';
2201 2201
             if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL))
2202
-                $link = '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&amp;backtopage=1&amp;actioncode=' . $type . '&amp;contactid=' . $cid . '&amp;socid=' . $socid . '">' . img_object($langs->trans("AddAction"), "calendar") . '</a>';
2202
+                $link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;backtopage=1&amp;actioncode='.$type.'&amp;contactid='.$cid.'&amp;socid='.$socid.'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
2203 2203
             if ($link)
2204
-                $newemail = '<div>' . $newemail . ' ' . $link . '</div>';
2204
+                $newemail = '<div>'.$newemail.' '.$link.'</div>';
2205 2205
         }
2206 2206
     }
2207 2207
     else {
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
         }
2212 2212
     }
2213 2213
 
2214
-    $rep = '<div class="nospan float" style="margin-right: 10px">' . ($withpicto ? img_picto($langs->trans("EMail"), 'object_email.png') . ' ' : '') . $newemail . '</div>';
2214
+    $rep = '<div class="nospan float" style="margin-right: 10px">'.($withpicto ? img_picto($langs->trans("EMail"), 'object_email.png').' ' : '').$newemail.'</div>';
2215 2215
     if ($hookmanager) {
2216 2216
         $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);
2217 2217
         $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email);
@@ -2241,26 +2241,26 @@  discard block
 block discarded – undo
2241 2241
 
2242 2242
     if (!empty($type)) {
2243 2243
         $newskype = '<div class="divsocialnetwork inline-block valignmiddle">';
2244
-        $newskype .= img_picto($langs->trans(strtoupper($type)), $type . '.png', '', false, 0, 0, '', 'paddingright');
2244
+        $newskype .= img_picto($langs->trans(strtoupper($type)), $type.'.png', '', false, 0, 0, '', 'paddingright');
2245 2245
         $newskype .= $value;
2246 2246
         if ($type == 'skype') {
2247 2247
             $newskype .= '&nbsp;';
2248 2248
             $newskype .= '<a href="skype:';
2249 2249
             $newskype .= $value;
2250
-            $newskype .= '?call" alt="' . $langs->trans("Call") . '&nbsp;' . $value . '" title="' . $langs->trans("Call") . '&nbsp;' . $value . '">';
2251
-            $newskype .= '<img src="' . DOL_URL_ROOT . '/theme/common/skype_callbutton.png" border="0">';
2250
+            $newskype .= '?call" alt="'.$langs->trans("Call").'&nbsp;'.$value.'" title="'.$langs->trans("Call").'&nbsp;'.$value.'">';
2251
+            $newskype .= '<img src="'.DOL_URL_ROOT.'/theme/common/skype_callbutton.png" border="0">';
2252 2252
             $newskype .= '</a><a href="skype:';
2253 2253
             $newskype .= $value;
2254
-            $newskype .= '?chat" alt="' . $langs->trans("Chat") . '&nbsp;' . $value . '" title="' . $langs->trans("Chat") . '&nbsp;' . $value . '">';
2255
-            $newskype .= '<img class="paddingleft" src="' . DOL_URL_ROOT . '/theme/common/skype_chatbutton.png" border="0">';
2254
+            $newskype .= '?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$value.'" title="'.$langs->trans("Chat").'&nbsp;'.$value.'">';
2255
+            $newskype .= '<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">';
2256 2256
             $newskype .= '</a>';
2257 2257
         }
2258 2258
         if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create && $type == 'skype') {
2259 2259
             $addlink = 'AC_SKYPE';
2260 2260
             $link = '';
2261 2261
             if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE))
2262
-                $link = '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&amp;backtopage=1&amp;actioncode=' . $addlink . '&amp;contactid=' . $cid . '&amp;socid=' . $socid . '">' . img_object($langs->trans("AddAction"), "calendar") . '</a>';
2263
-            $newskype .= ($link ? ' ' . $link : '');
2262
+                $link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;backtopage=1&amp;actioncode='.$addlink.'&amp;contactid='.$cid.'&amp;socid='.$socid.'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
2263
+            $newskype .= ($link ? ' '.$link : '');
2264 2264
         }
2265 2265
         $newskype .= '</div>';
2266 2266
     }
@@ -2305,165 +2305,165 @@  discard block
 block discarded – undo
2305 2305
     if (strtoupper($countrycode) == "FR") {
2306 2306
         // France
2307 2307
         if (dol_strlen($phone) == 10) {
2308
-            $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 2) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2);
2308
+            $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 2).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2);
2309 2309
         } elseif (dol_strlen($phone) == 7) {
2310
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2);
2310
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2);
2311 2311
         } elseif (dol_strlen($phone) == 9) {
2312
-            $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 3) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2);
2312
+            $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2);
2313 2313
         } elseif (dol_strlen($phone) == 11) {
2314
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2);
2314
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
2315 2315
         } elseif (dol_strlen($phone) == 12) {
2316
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2316
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2317 2317
         }
2318 2318
     } elseif (strtoupper($countrycode) == "CA") {
2319 2319
         if (dol_strlen($phone) == 10) {
2320
-            $newphone = ($separ != '' ? '(' : '') . substr($newphone, 0, 3) . ($separ != '' ? ')' : '') . $separ . substr($newphone, 3, 3) . ($separ != '' ? '-' : '') . substr($newphone, 6, 4);
2320
+            $newphone = ($separ != '' ? '(' : '').substr($newphone, 0, 3).($separ != '' ? ')' : '').$separ.substr($newphone, 3, 3).($separ != '' ? '-' : '').substr($newphone, 6, 4);
2321 2321
         }
2322 2322
     } elseif (strtoupper($countrycode) == "PT") {//Portugal
2323 2323
         if (dol_strlen($phone) == 13) {//ex: +351_ABC_DEF_GHI
2324
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3);
2324
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
2325 2325
         }
2326 2326
     } elseif (strtoupper($countrycode) == "SR") {//Suriname
2327 2327
         if (dol_strlen($phone) == 10) {//ex: +597_ABC_DEF
2328
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3);
2328
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3);
2329 2329
         } elseif (dol_strlen($phone) == 11) {//ex: +597_ABC_DEFG
2330
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 4);
2330
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 4);
2331 2331
         }
2332 2332
     } elseif (strtoupper($countrycode) == "DE") {//Allemagne
2333 2333
         if (dol_strlen($phone) == 14) {//ex:  +49_ABCD_EFGH_IJK
2334
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 4) . $separ . substr($newphone, 11, 3);
2334
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 4).$separ.substr($newphone, 11, 3);
2335 2335
         } elseif (dol_strlen($phone) == 13) {//ex: +49_ABC_DEFG_HIJ
2336
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 4) . $separ . substr($newphone, 10, 3);
2336
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 4).$separ.substr($newphone, 10, 3);
2337 2337
         }
2338 2338
     } elseif (strtoupper($countrycode) == "ES") {//Espagne
2339 2339
         if (dol_strlen($phone) == 12) {//ex:  +34_ABC_DEF_GHI
2340
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3);
2340
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
2341 2341
         }
2342 2342
     } elseif (strtoupper($countrycode) == "BF") {// Burkina Faso
2343 2343
         if (dol_strlen($phone) == 12) {//ex :  +22 A BC_DE_FG_HI
2344
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2344
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2345 2345
         }
2346 2346
     } elseif (strtoupper($countrycode) == "RO") {// Roumanie
2347 2347
         if (dol_strlen($phone) == 12) {//ex :  +40 AB_CDE_FG_HI
2348
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2348
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2349 2349
         }
2350 2350
     } elseif (strtoupper($countrycode) == "TR") {//Turquie
2351 2351
         if (dol_strlen($phone) == 13) {//ex :  +90 ABC_DEF_GHIJ
2352
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 4);
2352
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
2353 2353
         }
2354 2354
     } elseif (strtoupper($countrycode) == "US") {//Etat-Unis
2355 2355
         if (dol_strlen($phone) == 12) {//ex: +1 ABC_DEF_GHIJ
2356
-            $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 3) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 4);
2356
+            $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
2357 2357
         }
2358 2358
     } elseif (strtoupper($countrycode) == "MX") {//Mexique
2359 2359
         if (dol_strlen($phone) == 12) {//ex: +52 ABCD_EFG_HI
2360
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 2);
2360
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
2361 2361
         } elseif (dol_strlen($phone) == 11) {//ex: +52 AB_CD_EF_GH
2362
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2);
2362
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
2363 2363
         } elseif (dol_strlen($phone) == 13) {//ex: +52 ABC_DEF_GHIJ
2364
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 4);
2364
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
2365 2365
         }
2366 2366
     } elseif (strtoupper($countrycode) == "ML") {//Mali
2367 2367
         if (dol_strlen($phone) == 12) {//ex: +223 AB_CD_EF_GH
2368
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2368
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2369 2369
         }
2370 2370
     } elseif (strtoupper($countrycode) == "TH") {//Thaïlande
2371 2371
         if (dol_strlen($phone) == 11) {//ex: +66_ABC_DE_FGH
2372
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 3);
2372
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
2373 2373
         } elseif (dol_strlen($phone) == 12) {//ex: +66_A_BCD_EF_GHI
2374
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 3);
2374
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 3);
2375 2375
         }
2376 2376
     } elseif (strtoupper($countrycode) == "MU") {//Maurice
2377 2377
         if (dol_strlen($phone) == 11) {//ex: +230_ABC_DE_FG
2378
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2);
2378
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
2379 2379
         } elseif (dol_strlen($phone) == 12) {//ex: +230_ABCD_EF_GH
2380
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 4) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2380
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2381 2381
         }
2382 2382
     } elseif (strtoupper($countrycode) == "ZA") {//Afrique du sud
2383 2383
         if (dol_strlen($phone) == 12) {//ex: +27_AB_CDE_FG_HI
2384
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2384
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2385 2385
         }
2386 2386
     } elseif (strtoupper($countrycode) == "SY") {//Syrie
2387 2387
         if (dol_strlen($phone) == 12) {//ex: +963_AB_CD_EF_GH
2388
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2388
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2389 2389
         } elseif (dol_strlen($phone) == 13) {//ex: +963_AB_CD_EF_GHI
2390
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 3);
2390
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3);
2391 2391
         }
2392 2392
     } elseif (strtoupper($countrycode) == "AE") {//Emirats Arabes Unis
2393 2393
         if (dol_strlen($phone) == 12) {//ex: +971_ABC_DEF_GH
2394
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 2);
2394
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
2395 2395
         } elseif (dol_strlen($phone) == 13) {//ex: +971_ABC_DEF_GHI
2396
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3);
2396
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
2397 2397
         } elseif (dol_strlen($phone) == 14) {//ex: +971_ABC_DEF_GHIK
2398
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 4);
2398
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 4);
2399 2399
         }
2400 2400
     } elseif (strtoupper($countrycode) == "DZ") {//Algérie
2401 2401
         if (dol_strlen($phone) == 13) {//ex: +213_ABC_DEF_GHI
2402
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3);
2402
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
2403 2403
         }
2404 2404
     } elseif (strtoupper($countrycode) == "BE") {//Belgique
2405 2405
         if (dol_strlen($phone) == 11) {//ex: +32_ABC_DE_FGH
2406
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 3);
2406
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
2407 2407
         } elseif (dol_strlen($phone) == 12) {//ex: +32_ABC_DEF_GHI
2408
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3);
2408
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
2409 2409
         }
2410 2410
     } elseif (strtoupper($countrycode) == "PF") {//Polynésie française
2411 2411
         if (dol_strlen($phone) == 12) {//ex: +689_AB_CD_EF_GH
2412
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2412
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2413 2413
         }
2414 2414
     } elseif (strtoupper($countrycode) == "CO") {//Colombie
2415 2415
         if (dol_strlen($phone) == 13) {//ex: +57_ABC_DEF_GH_IJ
2416
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2);
2416
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
2417 2417
         }
2418 2418
     } elseif (strtoupper($countrycode) == "JO") {//Jordanie
2419 2419
         if (dol_strlen($phone) == 12) {//ex: +962_A_BCD_EF_GH
2420
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 1) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2);
2420
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 1).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
2421 2421
         }
2422 2422
     } elseif (strtoupper($countrycode) == "MG") {//Madagascar
2423 2423
         if (dol_strlen($phone) == 13) {//ex: +261_AB_CD_EF_GHI
2424
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 3);
2424
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3);
2425 2425
         }
2426 2426
     } elseif (strtoupper($countrycode) == "GB") {//Royaume uni
2427 2427
         if (dol_strlen($phone) == 13) {//ex: +44_ABCD_EFG_HIJ
2428
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3);
2428
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
2429 2429
         }
2430 2430
     } elseif (strtoupper($countrycode) == "CH") {//Suisse
2431 2431
         if (dol_strlen($phone) == 12) {//ex: +41_AB_CDE_FG_HI
2432
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2);
2432
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
2433 2433
         } elseif (dol_strlen($phone) == 15) {// +41_AB_CDE_FGH_IJKL
2434
-            $newphone = $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 3) . $separ . substr($newphone, 11, 4);
2434
+            $newphone = $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 4);
2435 2435
         }
2436 2436
     } elseif (strtoupper($countrycode) == "TN") {//Tunisie
2437 2437
         if (dol_strlen($phone) == 12) {//ex: +216_AB_CDE_FGH
2438
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3);
2438
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
2439 2439
         }
2440 2440
     } elseif (strtoupper($countrycode) == "GF") {//Guyane francaise
2441 2441
         if (dol_strlen($phone) == 13) {//ex: +594_ABC_DE_FG_HI  (ABC=594 de nouveau)
2442
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2);
2442
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
2443 2443
         }
2444 2444
     } elseif (strtoupper($countrycode) == "GP") {//Guadeloupe
2445 2445
         if (dol_strlen($phone) == 13) {//ex: +590_ABC_DE_FG_HI  (ABC=590 de nouveau)
2446
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2);
2446
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
2447 2447
         }
2448 2448
     } elseif (strtoupper($countrycode) == "MQ") {//Martinique
2449 2449
         if (dol_strlen($phone) == 13) {//ex: +596_ABC_DE_FG_HI  (ABC=596 de nouveau)
2450
-            $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2);
2450
+            $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
2451 2451
         }
2452 2452
     } elseif (strtoupper($countrycode) == "IT") {//Italie
2453 2453
         if (dol_strlen($phone) == 12) {//ex: +39_ABC_DEF_GHI
2454
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3);
2454
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
2455 2455
         } elseif (dol_strlen($phone) == 13) {//ex: +39_ABC_DEF_GH_IJ
2456
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2);
2456
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
2457 2457
         }
2458 2458
     } elseif (strtoupper($countrycode) == "AU") {//Australie
2459 2459
         if (dol_strlen($phone) == 12) {//ex: +61_A_BCDE_FGHI
2460
-            $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 4) . $separ . substr($newphone, 8, 4);
2460
+            $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4);
2461 2461
         }
2462 2462
     }
2463 2463
     if (!empty($addlink)) { // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set)
2464 2464
         if ($conf->browser->layout == 'phone' || (!empty($conf->clicktodial->enabled) && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone
2465
-            $newphone = '<a href="tel:' . $phone . '"';
2466
-            $newphone .= '>' . $phone . '</a>';
2465
+            $newphone = '<a href="tel:'.$phone.'"';
2466
+            $newphone .= '>'.$phone.'</a>';
2467 2467
         } else if (!empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') {  // If click to dial, we use click to dial url
2468 2468
             if (empty($user->clicktodial_loaded))
2469 2469
                 $user->fetch_clicktodial();
@@ -2487,10 +2487,10 @@  discard block
 block discarded – undo
2487 2487
                 '__PASS__' => $clicktodial_password);
2488 2488
             $url = make_substitutions($url, $substitarray);
2489 2489
             $newphonesav = $newphone;
2490
-            $newphone = '<a href="' . $url . '"';
2490
+            $newphone = '<a href="'.$url.'"';
2491 2491
             if (!empty($conf->global->CLICKTODIAL_FORCENEWTARGET))
2492 2492
                 $newphone .= ' target="_blank"';
2493
-            $newphone .= '>' . $newphonesav . '</a>';
2493
+            $newphone .= '>'.$newphonesav.'</a>';
2494 2494
         }
2495 2495
 
2496 2496
         //if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
@@ -2500,9 +2500,9 @@  discard block
 block discarded – undo
2500 2500
             if ($addlink == 'AC_FAX')
2501 2501
                 $type = 'AC_FAX';
2502 2502
             if (!empty($conf->global->AGENDA_ADDACTIONFORPHONE))
2503
-                $link = '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&amp;backtopage=1&amp;actioncode=' . $type . ($cid ? '&amp;contactid=' . $cid : '') . ($socid ? '&amp;socid=' . $socid : '') . '">' . img_object($langs->trans("AddAction"), "calendar") . '</a>';
2503
+                $link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;backtopage=1&amp;actioncode='.$type.($cid ? '&amp;contactid='.$cid : '').($socid ? '&amp;socid='.$socid : '').'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
2504 2504
             if ($link)
2505
-                $newphone = '<div>' . $newphone . ' ' . $link . '</div>';
2505
+                $newphone = '<div>'.$newphone.' '.$link.'</div>';
2506 2506
         }
2507 2507
     }
2508 2508
 
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
             $rep .= '<div class="nospan float" style="margin-right: 10px">';
2534 2534
         else
2535 2535
             $rep .= '<span style="margin-right: 10px;">';
2536
-        $rep .= ($withpicto ? img_picto($titlealt, 'object_' . $picto . '.png') . ' ' : '') . $newphone;
2536
+        $rep .= ($withpicto ? img_picto($titlealt, 'object_'.$picto.'.png').' ' : '').$newphone;
2537 2537
         if ($adddivfloat)
2538 2538
             $rep .= '</div>';
2539 2539
         else
@@ -2561,15 +2561,15 @@  discard block
 block discarded – undo
2561 2561
         $ret .= $ip;
2562 2562
     }
2563 2563
 
2564
-    echo ('<p>DOL_BASE_PATH: ' . DOL_BASE_PATH . '/DOL_BASE_URI: ' . DOL_BASE_URI . '</p>');
2564
+    echo ('<p>DOL_BASE_PATH: '.DOL_BASE_PATH.'/DOL_BASE_URI: '.DOL_BASE_URI.'</p>');
2565 2565
 
2566 2566
     if ($mode != 2) {
2567 2567
         $countrycode = dolGetCountryCodeFromIp($ip);
2568 2568
         if ($countrycode) { // If success, countrycode is us, fr, ...
2569
-            if (file_exists(DOL_BASE_PATH . '/theme/common/flags/' . $countrycode . '.png')) {
2570
-                $ret .= ' ' . img_picto($countrycode . ' ' . $langs->trans("AccordingToGeoIPDatabase"), DOL_BASE_URI . '/theme/common/flags/' . $countrycode . '.png', '', 1);
2569
+            if (file_exists(DOL_BASE_PATH.'/theme/common/flags/'.$countrycode.'.png')) {
2570
+                $ret .= ' '.img_picto($countrycode.' '.$langs->trans("AccordingToGeoIPDatabase"), DOL_BASE_URI.'/theme/common/flags/'.$countrycode.'.png', '', 1);
2571 2571
             } else
2572
-                $ret .= ' (' . $countrycode . ')';
2572
+                $ret .= ' ('.$countrycode.')';
2573 2573
         }
2574 2574
     }
2575 2575
 
@@ -2607,7 +2607,7 @@  discard block
 block discarded – undo
2607 2607
         //$ip='24.24.24.24';
2608 2608
         //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat';    Note that this must be downloaded datafile (not same than datafile provided with ubuntu packages)
2609 2609
 
2610
-        include_once DOL_BASE_PATH . '/core/class/dolgeoip.class.php';
2610
+        include_once DOL_BASE_PATH.'/core/class/dolgeoip.class.php';
2611 2611
         $geoip = new DolGeoIP('country', $datafile);
2612 2612
         //print 'ip='.$ip.' databaseType='.$geoip->gi->databaseType." GEOIP_CITY_EDITION_REV1=".GEOIP_CITY_EDITION_REV1."\n";
2613 2613
         //print "geoip_country_id_by_addr=".geoip_country_id_by_addr($geoip->gi,$ip)."\n";
@@ -2634,7 +2634,7 @@  discard block
 block discarded – undo
2634 2634
         $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE;
2635 2635
         //$ip='24.24.24.24';
2636 2636
         //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat';
2637
-        include_once DOL_BASE_PATH . '/core/class/dolgeoip.class.php';
2637
+        include_once DOL_BASE_PATH.'/core/class/dolgeoip.class.php';
2638 2638
         $geoip = new DolGeoIP('country', $datafile);
2639 2639
         $countrycode = $geoip->getCountryCodeFromIP($ip);
2640 2640
         $ret = $countrycode;
@@ -2689,12 +2689,12 @@  discard block
 block discarded – undo
2689 2689
                 $showomap = 1;
2690 2690
 
2691 2691
             if ($showgmap) {
2692
-                $url = dol_buildpath('/google/gmaps.php?mode=' . $mode . '&id=' . $id, 1);
2693
-                $out .= ' <a href="' . $url . '" target="_gmaps"><img id="' . $htmlid . '" class="valigntextbottom" src="' . DOL_URL_ROOT . '/theme/common/gmap.png"></a>';
2692
+                $url = dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id, 1);
2693
+                $out .= ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'" class="valigntextbottom" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>';
2694 2694
             }
2695 2695
             if ($showomap) {
2696
-                $url = dol_buildpath('/openstreetmap/maps.php?mode=' . $mode . '&id=' . $id, 1);
2697
-                $out .= ' <a href="' . $url . '" target="_gmaps"><img id="' . $htmlid . '_openstreetmap" class="valigntextbottom" src="' . DOL_URL_ROOT . '/theme/common/gmap.png"></a>';
2696
+                $url = dol_buildpath('/openstreetmap/maps.php?mode='.$mode.'&id='.$id, 1);
2697
+                $out .= ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'_openstreetmap" class="valigntextbottom" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>';
2698 2698
             }
2699 2699
         }
2700 2700
     }
@@ -2840,7 +2840,7 @@  discard block
 block discarded – undo
2840 2840
     if ($trunc == 'right') {
2841 2841
         $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string;
2842 2842
         if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3)))    // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ...
2843
-            return dol_substr($newstring, 0, $size, $stringencoding) . ($nodot ? '' : '...');
2843
+            return dol_substr($newstring, 0, $size, $stringencoding).($nodot ? '' : '...');
2844 2844
         else
2845 2845
         //return 'u'.$size.'-'.$newstring.'-'.dol_strlen($newstring,$stringencoding).'-'.$string;
2846 2846
             return $string;
@@ -2850,21 +2850,21 @@  discard block
 block discarded – undo
2850 2850
         if (dol_strlen($newstring, $stringencoding) > 2 && dol_strlen($newstring, $stringencoding) > ($size + 1)) {
2851 2851
             $size1 = round($size / 2);
2852 2852
             $size2 = round($size / 2);
2853
-            return dol_substr($newstring, 0, $size1, $stringencoding) . '...' . dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding);
2853
+            return dol_substr($newstring, 0, $size1, $stringencoding).'...'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding);
2854 2854
         } else
2855 2855
             return $string;
2856 2856
     }
2857 2857
     elseif ($trunc == 'left') {
2858 2858
         $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string;
2859 2859
         if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3)))    // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ...
2860
-            return '...' . dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding);
2860
+            return '...'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding);
2861 2861
         else
2862 2862
             return $string;
2863 2863
     }
2864 2864
     elseif ($trunc == 'wrap') {
2865 2865
         $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string;
2866 2866
         if (dol_strlen($newstring, $stringencoding) > ($size + 1))
2867
-            return dol_substr($newstring, 0, $size, $stringencoding) . "\n" . dol_trunc(dol_substr($newstring, $size, dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc);
2867
+            return dol_substr($newstring, 0, $size, $stringencoding)."\n".dol_trunc(dol_substr($newstring, $size, dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc);
2868 2868
         else
2869 2869
             return $string;
2870 2870
     } else
@@ -2898,7 +2898,7 @@  discard block
 block discarded – undo
2898 2898
     $url = DOL_BASE_URI;
2899 2899
 
2900 2900
     $theme = $conf->theme;
2901
-    $path = 'theme/' . $theme;
2901
+    $path = 'theme/'.$theme;
2902 2902
 
2903 2903
     // Define fullpathpicto to use into src
2904 2904
     if ($pictoisfullpath) {
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
                 $fakey = 'fa-pencil';
2948 2948
                 $facolor = '#444';
2949 2949
             } elseif ($pictowithoutext == 'filter') {
2950
-                $fakey = 'fa-' . $pictowithoutext;
2950
+                $fakey = 'fa-'.$pictowithoutext;
2951 2951
             } elseif ($pictowithoutext == 'grip_title' || $pictowithoutext == 'grip') {
2952 2952
                 $fakey = 'fa-arrows';
2953 2953
             } elseif ($pictowithoutext == 'listlight') {
@@ -2986,15 +2986,15 @@  discard block
 block discarded – undo
2986 2986
             } elseif ($pictowithoutext == 'jabber') {
2987 2987
                 $fakey = 'fa-comment-o';
2988 2988
             } else {
2989
-                $fakey = 'fa-' . $pictowithoutext;
2989
+                $fakey = 'fa-'.$pictowithoutext;
2990 2990
                 $facolor = '#444';
2991 2991
                 $marginleftonlyshort = 0;
2992 2992
             }
2993 2993
 
2994 2994
             if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
2995
-                $morecss .= ($morecss ? ' ' : '') . $reg[1];
2995
+                $morecss .= ($morecss ? ' ' : '').$reg[1];
2996 2996
             }
2997
-            $enabledisablehtml = '<span class="fa ' . $fakey . ' ' . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '') . ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . '" alt="' . dol_escape_htmltag($titlealt) . '"' . (($notitle || empty($title)) ? '' : ' title="' . dol_escape_htmltag($title) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>';
2997
+            $enabledisablehtml = '<span class="fa '.$fakey.' '.($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '').' valignmiddle'.($morecss ? ' '.$morecss : '').'" style="'.($fasize ? ('font-size: '.$fasize.';') : '').($facolor ? (' color: '.$facolor.';') : '').'" alt="'.dol_escape_htmltag($titlealt).'"'.(($notitle || empty($title)) ? '' : ' title="'.dol_escape_htmltag($title).'"').($moreatt ? ' '.$moreatt : '').'>';
2998 2998
             if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
2999 2999
                 $enabledisablehtml .= $titlealt;
3000 3000
             }
@@ -3004,11 +3004,11 @@  discard block
 block discarded – undo
3004 3004
         }
3005 3005
 
3006 3006
         if (!empty($conf->global->MAIN_OVERWRITE_THEME_PATH)) {
3007
-            $path = $conf->global->MAIN_OVERWRITE_THEME_PATH . '/theme/' . $theme; // If the theme does not have the same name as the module
3007
+            $path = $conf->global->MAIN_OVERWRITE_THEME_PATH.'/theme/'.$theme; // If the theme does not have the same name as the module
3008 3008
         } else if (!empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
3009
-            $path = $conf->global->MAIN_OVERWRITE_THEME_RES . '/theme/' . $conf->global->MAIN_OVERWRITE_THEME_RES;  // To allow an external module to overwrite image resources whatever is activated theme
3009
+            $path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme
3010 3010
         } else if (!empty($conf->modules_parts['theme']) && array_key_exists($theme, $conf->modules_parts['theme'])) {
3011
-            $path = $theme . '/theme/' . $theme; // If the theme have the same name as the module
3011
+            $path = $theme.'/theme/'.$theme; // If the theme have the same name as the module
3012 3012
         }
3013 3013
 
3014 3014
         // If we ask an image into $url/$mymodule/img (instead of default path)
@@ -3028,15 +3028,15 @@  discard block
 block discarded – undo
3028 3028
                 continue;
3029 3029
             }
3030 3030
             // This need a lot of time, that's why enabling alternative dir like "custom" dir is not recommanded
3031
-            if (file_exists($dirroot . '/' . $path . '/img/' . $picto)) {
3031
+            if (file_exists($dirroot.'/'.$path.'/img/'.$picto)) {
3032 3032
                 //$url = DOL_URL_ROOT . $conf->file->dol_url_root[$type];
3033
-                $url = DOL_BASE_URI . $conf->file->dol_url_root[$type];
3033
+                $url = DOL_BASE_URI.$conf->file->dol_url_root[$type];
3034 3034
                 break;
3035 3035
             }
3036 3036
         }
3037 3037
 
3038 3038
         // $url is '' or '/custom', $path is current theme or
3039
-        $fullpathpicto = $url . '/' . $path . '/img/' . $picto;
3039
+        $fullpathpicto = $url.'/'.$path.'/img/'.$picto;
3040 3040
     }
3041 3041
 
3042 3042
     if ($srconly) {
@@ -3044,7 +3044,7 @@  discard block
 block discarded – undo
3044 3044
     }
3045 3045
 
3046 3046
     // tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for bind people
3047
-    return '<img src="' . $fullpathpicto . '" alt="' . dol_escape_htmltag($alt) . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : ' class="inline-block' . ($morecss ? ' ' . $morecss : '') . '"') . '>'; // Alt is used for accessibility, title for popup
3047
+    return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt)) ? '' : ' title="'.dol_escape_htmltag($titlealt).'"').($moreatt ? ' '.$moreatt : ' class="inline-block'.($morecss ? ' '.$morecss : '').'"').'>'; // Alt is used for accessibility, title for popup
3048 3048
 }
3049 3049
 
3050 3050
 /**
@@ -3062,7 +3062,7 @@  discard block
 block discarded – undo
3062 3062
  */
3063 3063
 function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0)
3064 3064
 {
3065
-    return img_picto($titlealt, 'object_' . $picto, $moreatt, $pictoisfullpath, $srconly, $notitle);
3065
+    return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle);
3066 3066
 }
3067 3067
 
3068 3068
 /**
@@ -3083,7 +3083,7 @@  discard block
 block discarded – undo
3083 3083
         $picto .= '.png';
3084 3084
 
3085 3085
     //$path = DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/weather/' . $picto;
3086
-    $path = DOL_BASE_URI . '/theme/' . $conf->theme . '/img/weather/' . $picto;
3086
+    $path = DOL_BASE_URI.'/theme/'.$conf->theme.'/img/weather/'.$picto;
3087 3087
 
3088 3088
     return img_picto($titlealt, $path, $moreatt, 1);
3089 3089
 }
@@ -3109,10 +3109,10 @@  discard block
 block discarded – undo
3109 3109
         $path = $picto;
3110 3110
     else {
3111 3111
         //$path = DOL_URL_ROOT . '/theme/common/' . $picto;
3112
-        $path = DOL_BASE_URI . '/theme/common/' . $picto;
3112
+        $path = DOL_BASE_URI.'/theme/common/'.$picto;
3113 3113
 
3114 3114
         if (!empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS)) {
3115
-            $themepath = DOL_BASE_PATH . 'theme/' . $conf->theme . '/img/' . $picto;
3115
+            $themepath = DOL_BASE_PATH.'theme/'.$conf->theme.'/img/'.$picto;
3116 3116
 
3117 3117
             if (file_exists($themepath))
3118 3118
                 $path = $themepath;
@@ -3150,14 +3150,14 @@  discard block
 block discarded – undo
3150 3150
             $numaction = 3;
3151 3151
             $titlealt = $langs->transnoentitiesnoconv('ChangeContactDone');
3152 3152
         } else {
3153
-            $titlealt = $langs->transnoentitiesnoconv('ChangeStatus ' . $numaction);
3153
+            $titlealt = $langs->transnoentitiesnoconv('ChangeStatus '.$numaction);
3154 3154
             $numaction = 0;
3155 3155
         }
3156 3156
     }
3157 3157
     if (!is_numeric($numaction))
3158 3158
         $numaction = 0;
3159 3159
 
3160
-    return img_picto($titlealt, 'stcomm' . $numaction . '.png');
3160
+    return img_picto($titlealt, 'stcomm'.$numaction.'.png');
3161 3161
 }
3162 3162
 
3163 3163
 /**
@@ -3174,7 +3174,7 @@  discard block
 block discarded – undo
3174 3174
     if ($titlealt == 'default')
3175 3175
         $titlealt = $langs->trans('Show');
3176 3176
 
3177
-    return img_picto($titlealt, 'pdf' . $size . '.png');
3177
+    return img_picto($titlealt, 'pdf'.$size.'.png');
3178 3178
 }
3179 3179
 
3180 3180
 /**
@@ -3226,7 +3226,7 @@  discard block
 block discarded – undo
3226 3226
     if ($titlealt == 'default')
3227 3227
         $titlealt = $langs->trans('Modify');
3228 3228
 
3229
-    return img_picto($titlealt, 'edit.png', ($float ? 'style="float: ' . ($langs->tab_translate["DIRECTION"] == 'rtl' ? 'left' : 'right') . '"' : "") . ($other ? ' ' . $other : ''));
3229
+    return img_picto($titlealt, 'edit.png', ($float ? 'style="float: '.($langs->tab_translate["DIRECTION"] == 'rtl' ? 'left' : 'right').'"' : "").($other ? ' '.$other : ''));
3230 3230
 }
3231 3231
 
3232 3232
 /**
@@ -3244,7 +3244,7 @@  discard block
 block discarded – undo
3244 3244
     if ($titlealt == 'default')
3245 3245
         $titlealt = $langs->trans('View');
3246 3246
 
3247
-    $moreatt = ($float ? 'style="float: right" ' : '') . $other;
3247
+    $moreatt = ($float ? 'style="float: right" ' : '').$other;
3248 3248
 
3249 3249
     return img_picto($titlealt, 'view.png', $moreatt);
3250 3250
 }
@@ -3317,7 +3317,7 @@  discard block
 block discarded – undo
3317 3317
             $usealttitle = $langs->trans('Info');
3318 3318
     }
3319 3319
 
3320
-    return img_picto($usealttitle, 'info.png', 'style="vertical-align: middle;' . ($usehelpcursor == 1 ? ' cursor: help' : ($usehelpcursor == 2 ? ' cursor: pointer' : '')) . '"');
3320
+    return img_picto($usealttitle, 'info.png', 'style="vertical-align: middle;'.($usehelpcursor == 1 ? ' cursor: help' : ($usehelpcursor == 2 ? ' cursor: pointer' : '')).'"');
3321 3321
 }
3322 3322
 
3323 3323
 /**
@@ -3351,7 +3351,7 @@  discard block
 block discarded – undo
3351 3351
         $titlealt = $langs->trans('Warning');
3352 3352
 
3353 3353
     //return '<div class="imglatecoin">'.img_picto($titlealt, 'warning_white.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): '')).'</div>';
3354
-    return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"' . ($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' ' . $moreatt) : ''));
3354
+    return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt) : ''));
3355 3355
 }
3356 3356
 
3357 3357
 /**
@@ -3385,7 +3385,7 @@  discard block
 block discarded – undo
3385 3385
         $titlealt = $langs->trans('Next');
3386 3386
 
3387 3387
     //return img_picto($titlealt, 'next.png', $moreatt);
3388
-    return '<span class="fa fa-chevron-right paddingright paddingleft" title="' . dol_escape_htmltag($titlealt) . '"></span>';
3388
+    return '<span class="fa fa-chevron-right paddingright paddingleft" title="'.dol_escape_htmltag($titlealt).'"></span>';
3389 3389
 }
3390 3390
 
3391 3391
 /**
@@ -3403,7 +3403,7 @@  discard block
 block discarded – undo
3403 3403
         $titlealt = $langs->trans('Previous');
3404 3404
 
3405 3405
     //return img_picto($titlealt, 'previous.png', $moreatt);
3406
-    return '<span class="fa fa-chevron-left paddingright paddingleft" title="' . dol_escape_htmltag($titlealt) . '"></span>';
3406
+    return '<span class="fa fa-chevron-left paddingright paddingleft" title="'.dol_escape_htmltag($titlealt).'"></span>';
3407 3407
 }
3408 3408
 
3409 3409
 /**
@@ -3421,7 +3421,7 @@  discard block
 block discarded – undo
3421 3421
     if ($titlealt == 'default')
3422 3422
         $titlealt = $langs->trans('Down');
3423 3423
 
3424
-    return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown' . ($moreclass ? " " . $moreclass : "") . '"');
3424
+    return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown'.($moreclass ? " ".$moreclass : "").'"');
3425 3425
 }
3426 3426
 
3427 3427
 /**
@@ -3439,7 +3439,7 @@  discard block
 block discarded – undo
3439 3439
     if ($titlealt == 'default')
3440 3440
         $titlealt = $langs->trans('Up');
3441 3441
 
3442
-    return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup' . ($moreclass ? " " . $moreclass : "") . '"');
3442
+    return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup'.($moreclass ? " ".$moreclass : "").'"');
3443 3443
 }
3444 3444
 
3445 3445
 /**
@@ -3522,7 +3522,7 @@  discard block
 block discarded – undo
3522 3522
         $brand = 'credit-card';
3523 3523
     }
3524 3524
 
3525
-    return '<span class="fa fa-' . $brand . ' fa-2x fa-fw"></span>';
3525
+    return '<span class="fa fa-'.$brand.' fa-2x fa-fw"></span>';
3526 3526
 }
3527 3527
 
3528 3528
 /**
@@ -3535,17 +3535,17 @@  discard block
 block discarded – undo
3535 3535
  */
3536 3536
 function img_mime($file, $titlealt = '', $morecss = '')
3537 3537
 {
3538
-    require_once DOL_BASE_PATH . '/core/lib/files.lib.php';
3538
+    require_once DOL_BASE_PATH.'/core/lib/files.lib.php';
3539 3539
 
3540 3540
     $mimetype = dol_mimetype($file, '', 1);
3541 3541
     $mimeimg = dol_mimetype($file, '', 2);
3542 3542
     $mimefa = dol_mimetype($file, '', 4);
3543 3543
 
3544 3544
     if (empty($titlealt))
3545
-        $titlealt = 'Mime type: ' . $mimetype;
3545
+        $titlealt = 'Mime type: '.$mimetype;
3546 3546
 
3547 3547
     //return img_picto_common($titlealt, 'mime/'.$mimeimg, 'class="'.$morecss.'"');
3548
-    return '<i class="fa fa-' . $mimefa . ' paddingright"></i>';
3548
+    return '<i class="fa fa-'.$mimefa.' paddingright"></i>';
3549 3549
 }
3550 3550
 
3551 3551
 /**
@@ -3560,7 +3560,7 @@  discard block
 block discarded – undo
3560 3560
  */
3561 3561
 function img_phone($titlealt = 'default', $option = 0)
3562 3562
 {
3563
-    dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
3563
+    dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING);
3564 3564
 
3565 3565
     global $conf, $langs;
3566 3566
 
@@ -3591,8 +3591,8 @@  discard block
 block discarded – undo
3591 3591
 
3592 3592
     $img = img_picto($titlealt, 'search.png', $other, false, 1);
3593 3593
 
3594
-    $input = '<input type="image" class="liste_titre" name="button_search" src="' . $img . '" ';
3595
-    $input .= 'value="' . dol_escape_htmltag($titlealt) . '" title="' . dol_escape_htmltag($titlealt) . '" >';
3594
+    $input = '<input type="image" class="liste_titre" name="button_search" src="'.$img.'" ';
3595
+    $input .= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >';
3596 3596
 
3597 3597
     return $input;
3598 3598
 }
@@ -3613,8 +3613,8 @@  discard block
 block discarded – undo
3613 3613
 
3614 3614
     $img = img_picto($titlealt, 'searchclear.png', $other, false, 1);
3615 3615
 
3616
-    $input = '<input type="image" class="liste_titre" name="button_removefilter" src="' . $img . '" ';
3617
-    $input .= 'value="' . dol_escape_htmltag($titlealt) . '" title="' . dol_escape_htmltag($titlealt) . '" >';
3616
+    $input = '<input type="image" class="liste_titre" name="button_removefilter" src="'.$img.'" ';
3617
+    $input .= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >';
3618 3618
 
3619 3619
     return $input;
3620 3620
 }
@@ -3634,10 +3634,10 @@  discard block
 block discarded – undo
3634 3634
     global $conf, $langs;
3635 3635
 
3636 3636
     if ($infoonimgalt) {
3637
-        return img_picto($text, 'info', 'class="hideonsmartphone' . ($morecss ? ' ' . $morecss : '') . '"');
3637
+        return img_picto($text, 'info', 'class="hideonsmartphone'.($morecss ? ' '.$morecss : '').'"');
3638 3638
     }
3639 3639
 
3640
-    return ($nodiv ? '' : '<div class="' . (empty($admin) ? '' : ($admin == '1' ? 'info' : $admin)) . ' hideonsmartphone' . ($morecss ? ' ' . $morecss : '') . '">') . '<span class="fa fa-info-circle" title="' . dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')) . '"></span> ' . $text . ($nodiv ? '' : '</div>');
3640
+    return ($nodiv ? '' : '<div class="'.(empty($admin) ? '' : ($admin == '1' ? 'info' : $admin)).' hideonsmartphone'.($morecss ? ' '.$morecss : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>');
3641 3641
 }
3642 3642
 
3643 3643
 /**
@@ -3662,7 +3662,7 @@  discard block
 block discarded – undo
3662 3662
 
3663 3663
     // Si erreur intervenue avant chargement langue
3664 3664
     if (!$langs) {
3665
-        require_once DOL_BASE_PATH . '/core/class/translate.class.php';
3665
+        require_once DOL_BASE_PATH.'/core/class/translate.class.php';
3666 3666
         $langs = new Translate('', $conf);
3667 3667
         $langs->load("main");
3668 3668
     }
@@ -3670,51 +3670,51 @@  discard block
 block discarded – undo
3670 3670
     $langs->loadLangs(array('main', 'errors'));
3671 3671
 
3672 3672
     if ($_SERVER['DOCUMENT_ROOT']) {    // Mode web
3673
-        $out .= $langs->trans("DolibarrHasDetectedError") . ".<br>\n";
3673
+        $out .= $langs->trans("DolibarrHasDetectedError").".<br>\n";
3674 3674
         if (!empty($conf->global->MAIN_FEATURES_LEVEL))
3675 3675
             $out .= "You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
3676
-        $out .= $langs->trans("InformationToHelpDiagnose") . ":<br>\n";
3676
+        $out .= $langs->trans("InformationToHelpDiagnose").":<br>\n";
3677 3677
 
3678
-        $out .= "<b>" . $langs->trans("Date") . ":</b> " . dol_print_date(time(), 'dayhourlog') . "<br>\n";
3679
-        $out .= "<b>" . $langs->trans("Dolibarr") . ":</b> " . DOL_VERSION . "<br>\n";
3678
+        $out .= "<b>".$langs->trans("Date").":</b> ".dol_print_date(time(), 'dayhourlog')."<br>\n";
3679
+        $out .= "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";
3680 3680
         if (isset($conf->global->MAIN_FEATURES_LEVEL))
3681
-            $out .= "<b>" . $langs->trans("LevelOfFeature") . ":</b> " . $conf->global->MAIN_FEATURES_LEVEL . "<br>\n";
3681
+            $out .= "<b>".$langs->trans("LevelOfFeature").":</b> ".$conf->global->MAIN_FEATURES_LEVEL."<br>\n";
3682 3682
         if (function_exists("phpversion")) {
3683
-            $out .= "<b>" . $langs->trans("PHP") . ":</b> " . phpversion() . "<br>\n";
3683
+            $out .= "<b>".$langs->trans("PHP").":</b> ".phpversion()."<br>\n";
3684 3684
         }
3685
-        $out .= "<b>" . $langs->trans("Server") . ":</b> " . $_SERVER["SERVER_SOFTWARE"] . "<br>\n";
3685
+        $out .= "<b>".$langs->trans("Server").":</b> ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
3686 3686
         if (function_exists("php_uname")) {
3687
-            $out .= "<b>" . $langs->trans("OS") . ":</b> " . php_uname() . "<br>\n";
3687
+            $out .= "<b>".$langs->trans("OS").":</b> ".php_uname()."<br>\n";
3688 3688
         }
3689
-        $out .= "<b>" . $langs->trans("UserAgent") . ":</b> " . $_SERVER["HTTP_USER_AGENT"] . "<br>\n";
3689
+        $out .= "<b>".$langs->trans("UserAgent").":</b> ".$_SERVER["HTTP_USER_AGENT"]."<br>\n";
3690 3690
         $out .= "<br>\n";
3691
-        $out .= "<b>" . $langs->trans("RequestedUrl") . ":</b> " . dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8') . "<br>\n";
3692
-        $out .= "<b>" . $langs->trans("Referer") . ":</b> " . (isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '') . "<br>\n";
3693
-        $out .= "<b>" . $langs->trans("MenuManager") . ":</b> " . (isset($conf->standard_menu) ? $conf->standard_menu : '') . "<br>\n";
3691
+        $out .= "<b>".$langs->trans("RequestedUrl").":</b> ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."<br>\n";
3692
+        $out .= "<b>".$langs->trans("Referer").":</b> ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."<br>\n";
3693
+        $out .= "<b>".$langs->trans("MenuManager").":</b> ".(isset($conf->standard_menu) ? $conf->standard_menu : '')."<br>\n";
3694 3694
         $out .= "<br>\n";
3695
-        $syslog .= "url=" . dol_escape_htmltag($_SERVER["REQUEST_URI"]);
3696
-        $syslog .= ", query_string=" . dol_escape_htmltag($_SERVER["QUERY_STRING"]);
3695
+        $syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]);
3696
+        $syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]);
3697 3697
     } else {                              // Mode CLI
3698
-        $out .= '> ' . $langs->transnoentities("ErrorInternalErrorDetected") . ":\n" . $argv[0] . "\n";
3699
-        $syslog .= "pid=" . dol_getmypid();
3698
+        $out .= '> '.$langs->transnoentities("ErrorInternalErrorDetected").":\n".$argv[0]."\n";
3699
+        $syslog .= "pid=".dol_getmypid();
3700 3700
     }
3701 3701
 
3702 3702
     if (is_object($db)) {
3703 3703
         if ($_SERVER['DOCUMENT_ROOT']) {  // Mode web
3704
-            $out .= "<b>" . $langs->trans("DatabaseTypeManager") . ":</b> " . $db->type . "<br>\n";
3705
-            $out .= "<b>" . $langs->trans("RequestLastAccessInError") . ":</b> " . ($db->lastqueryerror() ? dol_escape_htmltag($db->lastqueryerror()) : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
3706
-            $out .= "<b>" . $langs->trans("ReturnCodeLastAccessInError") . ":</b> " . ($db->lasterrno() ? dol_escape_htmltag($db->lasterrno()) : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
3707
-            $out .= "<b>" . $langs->trans("InformationLastAccessInError") . ":</b> " . ($db->lasterror() ? dol_escape_htmltag($db->lasterror()) : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
3704
+            $out .= "<b>".$langs->trans("DatabaseTypeManager").":</b> ".$db->type."<br>\n";
3705
+            $out .= "<b>".$langs->trans("RequestLastAccessInError").":</b> ".($db->lastqueryerror() ? dol_escape_htmltag($db->lastqueryerror()) : $langs->trans("ErrorNoRequestInError"))."<br>\n";
3706
+            $out .= "<b>".$langs->trans("ReturnCodeLastAccessInError").":</b> ".($db->lasterrno() ? dol_escape_htmltag($db->lasterrno()) : $langs->trans("ErrorNoRequestInError"))."<br>\n";
3707
+            $out .= "<b>".$langs->trans("InformationLastAccessInError").":</b> ".($db->lasterror() ? dol_escape_htmltag($db->lasterror()) : $langs->trans("ErrorNoRequestInError"))."<br>\n";
3708 3708
             $out .= "<br>\n";
3709 3709
         } else {                            // Mode CLI
3710 3710
             // No dol_escape_htmltag for output, we are in CLI mode
3711
-            $out .= '> ' . $langs->transnoentities("DatabaseTypeManager") . ":\n" . $db->type . "\n";
3712
-            $out .= '> ' . $langs->transnoentities("RequestLastAccessInError") . ":\n" . ($db->lastqueryerror() ? $db->lastqueryerror() : $langs->transnoentities("ErrorNoRequestInError")) . "\n";
3713
-            $out .= '> ' . $langs->transnoentities("ReturnCodeLastAccessInError") . ":\n" . ($db->lasterrno() ? $db->lasterrno() : $langs->transnoentities("ErrorNoRequestInError")) . "\n";
3714
-            $out .= '> ' . $langs->transnoentities("InformationLastAccessInError") . ":\n" . ($db->lasterror() ? $db->lasterror() : $langs->transnoentities("ErrorNoRequestInError")) . "\n";
3711
+            $out .= '> '.$langs->transnoentities("DatabaseTypeManager").":\n".$db->type."\n";
3712
+            $out .= '> '.$langs->transnoentities("RequestLastAccessInError").":\n".($db->lastqueryerror() ? $db->lastqueryerror() : $langs->transnoentities("ErrorNoRequestInError"))."\n";
3713
+            $out .= '> '.$langs->transnoentities("ReturnCodeLastAccessInError").":\n".($db->lasterrno() ? $db->lasterrno() : $langs->transnoentities("ErrorNoRequestInError"))."\n";
3714
+            $out .= '> '.$langs->transnoentities("InformationLastAccessInError").":\n".($db->lasterror() ? $db->lasterror() : $langs->transnoentities("ErrorNoRequestInError"))."\n";
3715 3715
         }
3716
-        $syslog .= ", sql=" . $db->lastquery();
3717
-        $syslog .= ", db_error=" . $db->lasterror();
3716
+        $syslog .= ", sql=".$db->lastquery();
3717
+        $syslog .= ", db_error=".$db->lasterror();
3718 3718
     }
3719 3719
 
3720 3720
     if ($error || $errors) {
@@ -3734,31 +3734,31 @@  discard block
 block discarded – undo
3734 3734
             if (empty($msg))
3735 3735
                 continue;
3736 3736
             if ($_SERVER['DOCUMENT_ROOT']) {  // Mode web
3737
-                $out .= "<b>" . $langs->trans("Message") . ":</b> " . dol_escape_htmltag($msg) . "<br>\n";
3737
+                $out .= "<b>".$langs->trans("Message").":</b> ".dol_escape_htmltag($msg)."<br>\n";
3738 3738
             } else {                        // Mode CLI
3739
-                $out .= '> ' . $langs->transnoentities("Message") . ":\n" . $msg . "\n";
3739
+                $out .= '> '.$langs->transnoentities("Message").":\n".$msg."\n";
3740 3740
             }
3741
-            $syslog .= ", msg=" . $msg;
3741
+            $syslog .= ", msg=".$msg;
3742 3742
         }
3743 3743
     }
3744 3744
     if (empty($dolibarr_main_prod) && $_SERVER['DOCUMENT_ROOT'] && function_exists('xdebug_print_function_stack') && function_exists('xdebug_call_file')) {
3745 3745
         xdebug_print_function_stack();
3746
-        $out .= '<b>XDebug informations:</b>' . "<br>\n";
3747
-        $out .= 'File: ' . xdebug_call_file() . "<br>\n";
3748
-        $out .= 'Line: ' . xdebug_call_line() . "<br>\n";
3749
-        $out .= 'Function: ' . xdebug_call_function() . "<br>\n";
3746
+        $out .= '<b>XDebug informations:</b>'."<br>\n";
3747
+        $out .= 'File: '.xdebug_call_file()."<br>\n";
3748
+        $out .= 'Line: '.xdebug_call_line()."<br>\n";
3749
+        $out .= 'Function: '.xdebug_call_function()."<br>\n";
3750 3750
         $out .= "<br>\n";
3751 3751
     }
3752 3752
 
3753 3753
     if (empty($dolibarr_main_prod))
3754 3754
         print $out;
3755 3755
     else {
3756
-        print $langs->trans("DolibarrHasDetectedError") . '. ';
3756
+        print $langs->trans("DolibarrHasDetectedError").'. ';
3757 3757
         print $langs->trans("YouCanSetOptionDolibarrMainProdToZero");
3758 3758
         define("MAIN_CORE_ERROR", 1);
3759 3759
     }
3760 3760
     //else print 'Sorry, an error occured but the parameter $dolibarr_main_prod is defined in conf file so no message is reported to your browser. Please read the log file for error message.';
3761
-    dol_syslog("Error " . $syslog, LOG_ERR);
3761
+    dol_syslog("Error ".$syslog, LOG_ERR);
3762 3762
 }
3763 3763
 
3764 3764
 /**
@@ -3781,13 +3781,13 @@  discard block
 block discarded – undo
3781 3781
     $langs->load("errors");
3782 3782
     $now = dol_now();
3783 3783
 
3784
-    print '<br><div class="center login_main_message"><div class="' . $morecss . '">';
3785
-    print $langs->trans("ErrorContactEMail", $email, $prefixcode . dol_print_date($now, '%Y%m%d'));
3784
+    print '<br><div class="center login_main_message"><div class="'.$morecss.'">';
3785
+    print $langs->trans("ErrorContactEMail", $email, $prefixcode.dol_print_date($now, '%Y%m%d'));
3786 3786
     if ($errormessage)
3787
-        print '<br><br>' . $errormessage;
3787
+        print '<br><br>'.$errormessage;
3788 3788
     if (is_array($errormessages) && count($errormessages)) {
3789 3789
         foreach ($errormessages as $mesgtoshow) {
3790
-            print '<br><br>' . $mesgtoshow;
3790
+            print '<br><br>'.$mesgtoshow;
3791 3791
         }
3792 3792
     }
3793 3793
     print '</div></div>';
@@ -3845,16 +3845,16 @@  discard block
 block discarded – undo
3845 3845
     }
3846 3846
 
3847 3847
     $tmpsortfield = explode(',', $sortfield);
3848
-    $sortfield1 = trim($tmpsortfield[0]);    // If $sortfield is 'd.datep,d.id', it becomes 'd.datep'
3848
+    $sortfield1 = trim($tmpsortfield[0]); // If $sortfield is 'd.datep,d.id', it becomes 'd.datep'
3849 3849
     $tmpfield = explode(',', $field);
3850
-    $field1 = trim($tmpfield[0]);            // If $field is 'd.datep,d.id', it becomes 'd.datep'
3850
+    $field1 = trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep'
3851 3851
     //var_dump('field='.$field.' field1='.$field1.' sortfield='.$sortfield.' sortfield1='.$sortfield1);
3852 3852
     // If field is used as sort criteria we use a specific css class liste_titre_sel
3853 3853
     // Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
3854 3854
     if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./", "", $field1))) {
3855
-        $out .= '<' . $tag . ' class="' . $prefix . 'liste_titre_sel" ' . $moreattrib . '>';
3855
+        $out .= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '.$moreattrib.'>';
3856 3856
     } else {
3857
-        $out .= '<' . $tag . ' class="' . $prefix . 'liste_titre" ' . $moreattrib . '>';
3857
+        $out .= '<'.$tag.' class="'.$prefix.'liste_titre" '.$moreattrib.'>';
3858 3858
     }
3859 3859
 
3860 3860
     if (empty($thead) && $field && empty($disablesortlink)) {    // If this is a sort field
@@ -3862,7 +3862,7 @@  discard block
 block discarded – undo
3862 3862
         $options = preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i', '', $options);
3863 3863
         $options = preg_replace('/&+/i', '&', $options);
3864 3864
         if (!preg_match('/^&/', $options)) {
3865
-            $options = '&' . $options;
3865
+            $options = '&'.$options;
3866 3866
         }
3867 3867
 
3868 3868
         $sortordertouseinlink = '';
@@ -3880,7 +3880,7 @@  discard block
 block discarded – undo
3880 3880
             }
3881 3881
         }
3882 3882
         $sortordertouseinlink = preg_replace('/,$/', '', $sortordertouseinlink);
3883
-        $out .= '<a class="reposition" href="' . $file . '?sortfield=' . $field . '&sortorder=' . $sortordertouseinlink . '&begin=' . $begin . $options . '">';
3883
+        $out .= '<a class="reposition" href="'.$file.'?sortfield='.$field.'&sortorder='.$sortordertouseinlink.'&begin='.$begin.$options.'">';
3884 3884
     }
3885 3885
 
3886 3886
     if ($tooltip) {
@@ -3898,7 +3898,7 @@  discard block
 block discarded – undo
3898 3898
         $options = preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i', '', $options);
3899 3899
         $options = preg_replace('/&+/i', '&', $options);
3900 3900
         if (!preg_match('/^&/', $options)) {
3901
-            $options = '&' . $options;
3901
+            $options = '&'.$options;
3902 3902
         }
3903 3903
 
3904 3904
         if (!$sortorder || $field1 != $sortfield1) {
@@ -3908,19 +3908,19 @@  discard block
 block discarded – undo
3908 3908
             if (preg_match('/^DESC/', $sortorder)) {
3909 3909
                 //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
3910 3910
                 //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",1).'</a>';
3911
-                $sortimg .= '<span class="nowrap">' . img_up("Z-A", 0) . '</span>';
3911
+                $sortimg .= '<span class="nowrap">'.img_up("Z-A", 0).'</span>';
3912 3912
             }
3913 3913
             if (preg_match('/^ASC/', $sortorder)) {
3914 3914
                 //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",1).'</a>';
3915 3915
                 //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
3916
-                $sortimg .= '<span class="nowrap">' . img_down("A-Z", 0) . '</span>';
3916
+                $sortimg .= '<span class="nowrap">'.img_down("A-Z", 0).'</span>';
3917 3917
             }
3918 3918
         }
3919 3919
     }
3920 3920
 
3921 3921
     $out .= $sortimg;
3922 3922
 
3923
-    $out .= '</' . $tag . '>';
3923
+    $out .= '</'.$tag.'>';
3924 3924
 
3925 3925
     return $out;
3926 3926
 }
@@ -3935,9 +3935,9 @@  discard block
 block discarded – undo
3935 3935
  */
3936 3936
 function print_titre($title)
3937 3937
 {
3938
-    dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
3938
+    dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING);
3939 3939
 
3940
-    print '<div class="titre">' . $title . '</div>';
3940
+    print '<div class="titre">'.$title.'</div>';
3941 3941
 }
3942 3942
 
3943 3943
 /**
@@ -3980,20 +3980,20 @@  discard block
 block discarded – undo
3980 3980
     }
3981 3981
 
3982 3982
     $return .= "\n";
3983
-    $return .= '<table ' . ($id ? 'id="' . $id . '" ' : '') . 'summary="" class="centpercent notopnoleftnoright' . ($morecssontable ? ' ' . $morecssontable : '') . '" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into print_barre_list
3983
+    $return .= '<table '.($id ? 'id="'.$id.'" ' : '').'summary="" class="centpercent notopnoleftnoright'.($morecssontable ? ' '.$morecssontable : '').'" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into print_barre_list
3984 3984
     if ($picto) {
3985
-        $return .= '<td class="nobordernopadding widthpictotitle opacityhigh" valign="middle">' . img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath) . '</td>';
3985
+        $return .= '<td class="nobordernopadding widthpictotitle opacityhigh" valign="middle">'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).'</td>';
3986 3986
     }
3987 3987
     $return .= '<td class="nobordernopadding valignmiddle">';
3988
-    $return .= '<div class="titre inline-block">' . $titre . '</div>';
3988
+    $return .= '<div class="titre inline-block">'.$titre.'</div>';
3989 3989
     $return .= '</td>';
3990 3990
     if (dol_strlen($morehtmlcenter)) {
3991
-        $return .= '<td class="nobordernopadding" align="center" valign="middle">' . $morehtmlcenter . '</td>';
3991
+        $return .= '<td class="nobordernopadding" align="center" valign="middle">'.$morehtmlcenter.'</td>';
3992 3992
     }
3993 3993
     if (dol_strlen($morehtmlright)) {
3994
-        $return .= '<td class="nobordernopadding titre_right wordbreak" align="right" valign="middle">' . $morehtmlright . '</td>';
3994
+        $return .= '<td class="nobordernopadding titre_right wordbreak" align="right" valign="middle">'.$morehtmlright.'</td>';
3995 3995
     }
3996
-    $return .= '</tr></table>' . "\n";
3996
+    $return .= '</tr></table>'."\n";
3997 3997
 
3998 3998
     return $return;
3999 3999
 }
@@ -4041,29 +4041,29 @@  discard block
 block discarded – undo
4041 4041
     //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage;
4042 4042
 
4043 4043
     print "\n";
4044
-    print "<!-- Begin title '" . $titre . "' -->\n";
4045
-    print '<table border="0" class="centpercent notopnoleftnoright' . ($morecss ? ' ' . $morecss : '') . '" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into load_fiche_tire
4044
+    print "<!-- Begin title '".$titre."' -->\n";
4045
+    print '<table border="0" class="centpercent notopnoleftnoright'.($morecss ? ' '.$morecss : '').'" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into load_fiche_tire
4046 4046
     // Left
4047 4047
     //if ($picto && $titre) print '<td class="nobordernopadding hideonsmartphone" width="40" align="left" valign="middle">'.img_picto('', $picto, 'id="pictotitle"', $pictoisfullpath).'</td>';
4048 4048
     print '<td class="nobordernopadding valignmiddle">';
4049 4049
     if ($picto && $titre)
4050 4050
         print img_picto('', $picto, 'class="hideonsmartphone valignmiddle opacityhigh pictotitle widthpictotitle"', $pictoisfullpath);
4051
-    print '<div class="titre inline-block">' . $titre;
4051
+    print '<div class="titre inline-block">'.$titre;
4052 4052
     if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '')
4053
-        print ' (' . $totalnboflines . ')';
4053
+        print ' ('.$totalnboflines.')';
4054 4054
     print '</div></td>';
4055 4055
 
4056 4056
     // Center
4057 4057
     if ($morehtmlcenter) {
4058
-        print '<td class="nobordernopadding center valignmiddle">' . $morehtmlcenter . '</td>';
4058
+        print '<td class="nobordernopadding center valignmiddle">'.$morehtmlcenter.'</td>';
4059 4059
     }
4060 4060
 
4061 4061
     // Right
4062 4062
     print '<td class="nobordernopadding valignmiddle" align="right">';
4063 4063
     if ($sortfield)
4064
-        $options .= "&sortfield=" . urlencode($sortfield);
4064
+        $options .= "&sortfield=".urlencode($sortfield);
4065 4065
     if ($sortorder)
4066
-        $options .= "&sortorder=" . urlencode($sortorder);
4066
+        $options .= "&sortorder=".urlencode($sortorder);
4067 4067
     // Show navigation bar
4068 4068
     $pagelist = '';
4069 4069
     if ($savlimit != 0 && ($page > 0 || $num > $limit)) {
@@ -4081,40 +4081,40 @@  discard block
 block discarded – undo
4081 4081
             }
4082 4082
 
4083 4083
             if ($cpt >= 1) {
4084
-                $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=0' . $options . '">1</a></li>';
4084
+                $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page=0'.$options.'">1</a></li>';
4085 4085
                 if ($cpt > 2)
4086
-                    $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '') . '>...</span></li>';
4086
+                    $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '').'>...</span></li>';
4087 4087
                 else if ($cpt == 2)
4088
-                    $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=1' . $options . '">2</a></li>';
4088
+                    $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page=1'.$options.'">2</a></li>';
4089 4089
             }
4090 4090
 
4091 4091
             do {
4092 4092
                 if ($cpt == $page) {
4093
-                    $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="active"' : '') . '>' . ($page + 1) . '</span></li>';
4093
+                    $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="active"' : '').'>'.($page + 1).'</span></li>';
4094 4094
                 } else {
4095
-                    $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . $cpt . $options . '">' . ($cpt + 1) . '</a></li>';
4095
+                    $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.$cpt.$options.'">'.($cpt + 1).'</a></li>';
4096 4096
                 }
4097 4097
                 $cpt++;
4098 4098
             } while ($cpt < $nbpages && $cpt <= $page + $maxnbofpage);
4099 4099
 
4100 4100
             if ($cpt < $nbpages) {
4101 4101
                 if ($cpt < $nbpages - 2)
4102
-                    $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '') . '>...</span></li>';
4102
+                    $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '').'>...</span></li>';
4103 4103
                 else if ($cpt == $nbpages - 2)
4104
-                    $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . ($nbpages - 2) . $options . '">' . ($nbpages - 1) . '</a></li>';
4105
-                $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . ($nbpages - 1) . $options . '">' . $nbpages . '</a></li>';
4104
+                    $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.($nbpages - 2).$options.'">'.($nbpages - 1).'</a></li>';
4105
+                $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.($nbpages - 1).$options.'">'.$nbpages.'</a></li>';
4106 4106
             }
4107 4107
         }
4108 4108
         else {
4109
-            $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="active"' : '') . '>' . ($page + 1) . "</li>";
4109
+            $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="active"' : '').'>'.($page + 1)."</li>";
4110 4110
         }
4111 4111
     }
4112 4112
 
4113
-    print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit);  // output the div and ul for previous/last completed with page numbers into $pagelist
4113
+    print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist
4114 4114
 
4115 4115
     print '</td>';
4116 4116
 
4117
-    print '</tr></table>' . "\n";
4117
+    print '</tr></table>'."\n";
4118 4118
     print "<!-- End title -->\n\n";
4119 4119
 }
4120 4120
 
@@ -4145,12 +4145,12 @@  discard block
 block discarded – undo
4145 4145
             $pagesizechoices = $conf->global->MAIN_PAGESIZE_CHOICES;
4146 4146
 
4147 4147
         print '<li class="pagination">';
4148
-        print '<select class="flat selectlimit" name="limit" title="' . dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")) . '">';
4148
+        print '<select class="flat selectlimit" name="limit" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
4149 4149
         $tmpchoice = explode(',', $pagesizechoices);
4150
-        $tmpkey = $limit . ':' . $limit;
4150
+        $tmpkey = $limit.':'.$limit;
4151 4151
         if (!in_array($tmpkey, $tmpchoice))
4152 4152
             $tmpchoice[] = $tmpkey;
4153
-        $tmpkey = $conf->liste_limit . ':' . $conf->liste_limit;
4153
+        $tmpkey = $conf->liste_limit.':'.$conf->liste_limit;
4154 4154
         if (!in_array($tmpkey, $tmpchoice))
4155 4155
             $tmpchoice[] = $tmpkey;
4156 4156
         asort($tmpchoice, SORT_NUMERIC);
@@ -4165,7 +4165,7 @@  discard block
 block discarded – undo
4165 4165
                     $selected = ' selected="selected"';
4166 4166
                     $found = true;
4167 4167
                 }
4168
-                print '<option name="' . $key . '"' . $selected . '>' . dol_escape_htmltag($val) . '</option>' . "\n";
4168
+                print '<option name="'.$key.'"'.$selected.'>'.dol_escape_htmltag($val).'</option>'."\n";
4169 4169
             }
4170 4170
         }
4171 4171
         print '</select>';
@@ -4184,20 +4184,20 @@  discard block
 block discarded – undo
4184 4184
         print '</li>';
4185 4185
     }
4186 4186
     if ($page > 0) {
4187
-        print '<li class="pagination"><a class="paginationprevious" href="' . $file . '?page=' . ($page - 1) . $options . '"><i class="fa fa-chevron-left" title="' . dol_escape_htmltag($langs->trans("Previous")) . '"></i></a></li>';
4187
+        print '<li class="pagination"><a class="paginationprevious" href="'.$file.'?page='.($page - 1).$options.'"><i class="fa fa-chevron-left" title="'.dol_escape_htmltag($langs->trans("Previous")).'"></i></a></li>';
4188 4188
     }
4189 4189
     if ($betweenarrows) {
4190 4190
         print $betweenarrows;
4191 4191
     }
4192 4192
     if ($nextpage > 0) {
4193
-        print '<li class="pagination"><a class="paginationnext" href="' . $file . '?page=' . ($page + 1) . $options . '"><i class="fa fa-chevron-right" title="' . dol_escape_htmltag($langs->trans("Next")) . '"></i></a></li>';
4193
+        print '<li class="pagination"><a class="paginationnext" href="'.$file.'?page='.($page + 1).$options.'"><i class="fa fa-chevron-right" title="'.dol_escape_htmltag($langs->trans("Next")).'"></i></a></li>';
4194 4194
     }
4195 4195
     if ($afterarrows) {
4196 4196
         print '<li class="paginationafterarrows">';
4197 4197
         print $afterarrows;
4198 4198
         print '</li>';
4199 4199
     }
4200
-    print '</ul></div>' . "\n";
4200
+    print '</ul></div>'."\n";
4201 4201
 }
4202 4202
 
4203 4203
 /**
@@ -4219,8 +4219,8 @@  discard block
 block discarded – undo
4219 4219
         $addpercent = true;
4220 4220
     }
4221 4221
     if (preg_match('/\((.*)\)/', $rate, $reg)) {
4222
-        $morelabel = ' (' . $reg[1] . ')';
4223
-        $rate = preg_replace('/\s*' . preg_quote($morelabel, '/') . '/', '', $rate);
4222
+        $morelabel = ' ('.$reg[1].')';
4223
+        $rate = preg_replace('/\s*'.preg_quote($morelabel, '/').'/', '', $rate);
4224 4224
     }
4225 4225
     if (preg_match('/\*/', $rate)) {
4226 4226
         $rate = str_replace('*', '', $rate);
@@ -4229,10 +4229,10 @@  discard block
 block discarded – undo
4229 4229
 
4230 4230
     // If rate is '9/9/9' we don't change it.  If rate is '9.000' we apply price()
4231 4231
     if (!preg_match('/\//', $rate))
4232
-        $ret = price($rate, 0, '', 0, 0) . ($addpercent ? '%' : '');
4232
+        $ret = price($rate, 0, '', 0, 0).($addpercent ? '%' : '');
4233 4233
     else {
4234 4234
         // TODO Split on / and output with a price2num to have clean numbers without ton of 000.
4235
-        $ret = $rate . ($addpercent ? '%' : '');
4235
+        $ret = $rate.($addpercent ? '%' : '');
4236 4236
     }
4237 4237
     if (($info_bits & 1) && $usestarfornpr >= 0)
4238 4238
         $ret .= ' *';
@@ -4326,10 +4326,10 @@  discard block
 block discarded – undo
4326 4326
             $cursymbolbefore .= $outlangs->getCurrencySymbol($currency_code);
4327 4327
         else {
4328 4328
             $tmpcur = $outlangs->getCurrencySymbol($currency_code);
4329
-            $cursymbolafter .= ($tmpcur == $currency_code ? ' ' . $tmpcur : $tmpcur);
4329
+            $cursymbolafter .= ($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur);
4330 4330
         }
4331 4331
     }
4332
-    $output = $cursymbolbefore . $output . $end . ($cursymbolafter ? ' ' : '') . $cursymbolafter;
4332
+    $output = $cursymbolbefore.$output.$end.($cursymbolafter ? ' ' : '').$cursymbolafter;
4333 4333
 
4334 4334
     return $output;
4335 4335
 }
@@ -4383,7 +4383,7 @@  discard block
 block discarded – undo
4383 4383
         // Now make replace (the main goal of function)
4384 4384
         if ($thousand != ',' && $thousand != '.')
4385 4385
             $amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
4386
-        $amount = str_replace(' ', '', $amount);  // To avoid spaces
4386
+        $amount = str_replace(' ', '', $amount); // To avoid spaces
4387 4387
         $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
4388 4388
         $amount = str_replace($dec, '.', $amount);
4389 4389
     }
@@ -4412,14 +4412,14 @@  discard block
 block discarded – undo
4412 4412
             $temps = sprintf("%0.10F", $amount - intval($amount)); // temps=0.0000000000 or 0.0000200000 or 9999.1000000000
4413 4413
             $temps = preg_replace('/([\.1-9])0+$/', '\\1', $temps); // temps=0. or 0.00002 or 9999.1
4414 4414
             $nbofdec = max(0, dol_strlen($temps) - 2); // -2 to remove "0."
4415
-            $amount = number_format($amount, min($nbofdec, $nbofdectoround), $dec, $thousand);  // Convert amount to format with dolibarr dec and thousand
4415
+            $amount = number_format($amount, min($nbofdec, $nbofdectoround), $dec, $thousand); // Convert amount to format with dolibarr dec and thousand
4416 4416
         }
4417 4417
         //print "TT".$amount.'<br>';
4418 4418
         // Always make replace because each math function (like round) replace
4419 4419
         // with local values and we want a number that has a SQL string format x.y
4420 4420
         if ($thousand != ',' && $thousand != '.')
4421 4421
             $amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
4422
-        $amount = str_replace(' ', '', $amount);  // To avoid spaces
4422
+        $amount = str_replace(' ', '', $amount); // To avoid spaces
4423 4423
         $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
4424 4424
         $amount = str_replace($dec, '.', $amount);
4425 4425
     }
@@ -4440,7 +4440,7 @@  discard block
 block discarded – undo
4440 4440
  */
4441 4441
 function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no')
4442 4442
 {
4443
-    require_once DOL_BASE_PATH . '/core/lib/product.lib.php';
4443
+    require_once DOL_BASE_PATH.'/core/lib/product.lib.php';
4444 4444
 
4445 4445
     if (($forceunitoutput == 'no' && $dimension < 1 / 10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6)) {
4446 4446
         $dimension = $dimension * 1000000;
@@ -4456,7 +4456,7 @@  discard block
 block discarded – undo
4456 4456
         $unit = $unit + 3;
4457 4457
     }
4458 4458
 
4459
-    $ret = price($dimension, 0, $outputlangs, 0, 0, $round) . ' ' . measuring_units_string($unit, $type);
4459
+    $ret = price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type);
4460 4460
 
4461 4461
     return $ret;
4462 4462
 }
@@ -4480,7 +4480,7 @@  discard block
 block discarded – undo
4480 4480
     if (empty($thirdparty_seller) || !is_object($thirdparty_seller))
4481 4481
         $thirdparty_seller = $mysoc;
4482 4482
 
4483
-    dol_syslog("get_localtax tva=" . $vatrate . " local=" . $local . " thirdparty_buyer id=" . (is_object($thirdparty_buyer) ? $thirdparty_buyer->id : '') . "/country_code=" . (is_object($thirdparty_buyer) ? $thirdparty_buyer->country_code : '') . " thirdparty_seller id=" . $thirdparty_seller->id . "/country_code=" . $thirdparty_seller->country_code . " thirdparty_seller localtax1_assuj=" . $thirdparty_seller->localtax1_assuj . "  thirdparty_seller localtax2_assuj=" . $thirdparty_seller->localtax2_assuj);
4483
+    dol_syslog("get_localtax tva=".$vatrate." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer) ? $thirdparty_buyer->id : '')."/country_code=".(is_object($thirdparty_buyer) ? $thirdparty_buyer->country_code : '')." thirdparty_seller id=".$thirdparty_seller->id."/country_code=".$thirdparty_seller->country_code." thirdparty_seller localtax1_assuj=".$thirdparty_seller->localtax1_assuj."  thirdparty_seller localtax2_assuj=".$thirdparty_seller->localtax2_assuj);
4484 4484
 
4485 4485
     $vatratecleaned = $vatrate;
4486 4486
     if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) {      // If vat is "xx (yy)"
@@ -4511,7 +4511,7 @@  discard block
 block discarded – undo
4511 4511
         if ($local == 2) {
4512 4512
             //if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0;
4513 4513
             if (!$mysoc->localtax2_assuj)
4514
-                return 0;  // If main vat is 0, IRPF may be different than 0.
4514
+                return 0; // If main vat is 0, IRPF may be different than 0.
4515 4515
             if ($thirdparty_seller->id == $mysoc->id) {
4516 4516
                 if (!$thirdparty_buyer->localtax2_assuj)
4517 4517
                     return 0;
@@ -4565,13 +4565,13 @@  discard block
 block discarded – undo
4565 4565
 
4566 4566
     // By default, search value of local tax on line of common tax
4567 4567
     $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
4568
-    $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c";
4569
-    $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $thirdparty_seller->country_code . "'";
4570
-    $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1";
4568
+    $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
4569
+    $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
4570
+    $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
4571 4571
     if ($vatratecode)
4572
-        $sql .= " AND t.code ='" . $vatratecode . "'";  // If we have the code, we use it in priority
4572
+        $sql .= " AND t.code ='".$vatratecode."'"; // If we have the code, we use it in priority
4573 4573
     else
4574
-        $sql .= " AND t.recuperableonly ='" . $vatnpr . "'";
4574
+        $sql .= " AND t.recuperableonly ='".$vatnpr."'";
4575 4575
     dol_syslog("get_localtax", LOG_DEBUG);
4576 4576
     $resql = $db->query($sql);
4577 4577
 
@@ -4617,10 +4617,10 @@  discard block
 block discarded – undo
4617 4617
 {
4618 4618
     global $db, $mysoc;
4619 4619
     $sql = "SELECT t.localtax1, t.localtax2 ";
4620
-    $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t inner join " . MAIN_DB_PREFIX . "c_country as c ON c.rowid=t.fk_pays";
4621
-    $sql .= " WHERE c.code = '" . $mysoc->country_code . "' AND t.active = 1 AND t.taux=(";
4622
-    $sql .= "  SELECT max(tt.taux) FROM " . MAIN_DB_PREFIX . "c_tva as tt inner join " . MAIN_DB_PREFIX . "c_country as c ON c.rowid=tt.fk_pays";
4623
-    $sql .= "  WHERE c.code = '" . $mysoc->country_code . "' AND tt.active = 1";
4620
+    $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=t.fk_pays";
4621
+    $sql .= " WHERE c.code = '".$mysoc->country_code."' AND t.active = 1 AND t.taux=(";
4622
+    $sql .= "  SELECT max(tt.taux) FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=tt.fk_pays";
4623
+    $sql .= "  WHERE c.code = '".$mysoc->country_code."' AND tt.active = 1";
4624 4624
     $sql .= "  )";
4625 4625
 
4626 4626
     $resql = $db->query($sql);
@@ -4650,13 +4650,13 @@  discard block
 block discarded – undo
4650 4650
 {
4651 4651
     global $db, $mysoc;
4652 4652
 
4653
-    dol_syslog("getTaxesFromId vat id or rate = " . $vatrate);
4653
+    dol_syslog("getTaxesFromId vat id or rate = ".$vatrate);
4654 4654
 
4655 4655
     // Search local taxes
4656 4656
     $sql = "SELECT t.rowid, t.code, t.taux as rate, t.recuperableonly as npr, t.accountancy_code_sell, t.accountancy_code_buy";
4657
-    $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t";
4657
+    $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t";
4658 4658
     if ($firstparamisid)
4659
-        $sql .= " WHERE t.rowid = " . (int) $vatrate;
4659
+        $sql .= " WHERE t.rowid = ".(int) $vatrate;
4660 4660
     else {
4661 4661
         $vatratecleaned = $vatrate;
4662 4662
         $vatratecode = '';
@@ -4665,13 +4665,13 @@  discard block
 block discarded – undo
4665 4665
             $vatratecode = $reg[2];
4666 4666
         }
4667 4667
 
4668
-        $sql .= ", " . MAIN_DB_PREFIX . "c_country as c";
4668
+        $sql .= ", ".MAIN_DB_PREFIX."c_country as c";
4669 4669
         /* if ($mysoc->country_code == 'ES') $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'";    // vat in spain use the buyer country ??
4670 4670
           else $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; */
4671
-        $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $seller->country_code . "'";
4672
-        $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1";
4671
+        $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'";
4672
+        $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
4673 4673
         if ($vatratecode)
4674
-            $sql .= " AND t.code = '" . $vatratecode . "'";
4674
+            $sql .= " AND t.code = '".$vatratecode."'";
4675 4675
     }
4676 4676
 
4677 4677
     $resql = $db->query($sql);
@@ -4707,13 +4707,13 @@  discard block
 block discarded – undo
4707 4707
 {
4708 4708
     global $db, $mysoc;
4709 4709
 
4710
-    dol_syslog("getLocalTaxesFromRate vatrate=" . $vatrate . " local=" . $local);
4710
+    dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local);
4711 4711
 
4712 4712
     // Search local taxes
4713 4713
     $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy";
4714
-    $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t";
4714
+    $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t";
4715 4715
     if ($firstparamisid)
4716
-        $sql .= " WHERE t.rowid = " . (int) $vatrate;
4716
+        $sql .= " WHERE t.rowid = ".(int) $vatrate;
4717 4717
     else {
4718 4718
         $vatratecleaned = $vatrate;
4719 4719
         $vatratecode = '';
@@ -4722,14 +4722,14 @@  discard block
 block discarded – undo
4722 4722
             $vatratecode = $reg[2];
4723 4723
         }
4724 4724
 
4725
-        $sql .= ", " . MAIN_DB_PREFIX . "c_country as c";
4725
+        $sql .= ", ".MAIN_DB_PREFIX."c_country as c";
4726 4726
         if ($mysoc->country_code == 'ES')
4727
-            $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $buyer->country_code . "'";    // local tax in spain use the buyer country ??
4727
+            $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; // local tax in spain use the buyer country ??
4728 4728
         else
4729
-            $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $seller->country_code . "'";
4730
-        $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1";
4729
+            $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'";
4730
+        $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
4731 4731
         if ($vatratecode)
4732
-            $sql .= " AND t.code = '" . $vatratecode . "'";
4732
+            $sql .= " AND t.code = '".$vatratecode."'";
4733 4733
     }
4734 4734
 
4735 4735
     $resql = $db->query($sql);
@@ -4761,7 +4761,7 @@  discard block
 block discarded – undo
4761 4761
 {
4762 4762
     global $db, $conf, $mysoc;
4763 4763
 
4764
-    require_once DOL_BASE_PATH . '/product/class/product.class.php';
4764
+    require_once DOL_BASE_PATH.'/product/class/product.class.php';
4765 4765
 
4766 4766
     $ret = 0;
4767 4767
     $found = 0;
@@ -4776,12 +4776,12 @@  discard block
 block discarded – undo
4776 4776
                 $product->get_buyprice($idprodfournprice, 0, 0, 0);
4777 4777
                 $ret = $product->vatrate_supplier;
4778 4778
                 if ($product->default_vat_code)
4779
-                    $ret .= ' (' . $product->default_vat_code . ')';
4779
+                    $ret .= ' ('.$product->default_vat_code.')';
4780 4780
             }
4781 4781
             else {
4782
-                $ret = $product->tva_tx;    // Default vat of product we defined
4782
+                $ret = $product->tva_tx; // Default vat of product we defined
4783 4783
                 if ($product->default_vat_code)
4784
-                    $ret .= ' (' . $product->default_vat_code . ')';
4784
+                    $ret .= ' ('.$product->default_vat_code.')';
4785 4785
             }
4786 4786
             $found = 1;
4787 4787
         }
@@ -4795,8 +4795,8 @@  discard block
 block discarded – undo
4795 4795
         if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) {
4796 4796
             // If vat of product for the country not found or not defined, we return the first higher vat of country.
4797 4797
             $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code";
4798
-            $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c";
4799
-            $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='" . $thirdparty_seller->country_code . "'";
4798
+            $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
4799
+            $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
4800 4800
             $sql .= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC";
4801 4801
             $sql .= $db->plimit(1);
4802 4802
 
@@ -4806,16 +4806,16 @@  discard block
 block discarded – undo
4806 4806
                 if ($obj) {
4807 4807
                     $ret = $obj->vat_rate;
4808 4808
                     if ($obj->default_vat_code)
4809
-                        $ret .= ' (' . $obj->default_vat_code . ')';
4809
+                        $ret .= ' ('.$obj->default_vat_code.')';
4810 4810
                 }
4811 4811
                 $db->free($sql);
4812 4812
             } else
4813 4813
                 dol_print_error($db);
4814 4814
         } else
4815
-            $ret = $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS;    // Forced value if autodetect fails
4815
+            $ret = $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS; // Forced value if autodetect fails
4816 4816
     }
4817 4817
 
4818
-    dol_syslog("get_product_vat_for_country: ret=" . $ret);
4818
+    dol_syslog("get_product_vat_for_country: ret=".$ret);
4819 4819
     return $ret;
4820 4820
 }
4821 4821
 
@@ -4833,7 +4833,7 @@  discard block
 block discarded – undo
4833 4833
     global $db, $mysoc;
4834 4834
 
4835 4835
     if (!class_exists('Product')) {
4836
-        require_once DOL_BASE_PATH . 'product/class/product.class.php';
4836
+        require_once DOL_BASE_PATH.'product/class/product.class.php';
4837 4837
     }
4838 4838
 
4839 4839
     $ret = 0;
@@ -4858,8 +4858,8 @@  discard block
 block discarded – undo
4858 4858
     if (!$found) {
4859 4859
         // If vat of product for the country not found or not defined, we return higher vat of country.
4860 4860
         $sql = "SELECT taux as vat_rate, localtax1, localtax2";
4861
-        $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c";
4862
-        $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='" . $thirdparty_seller->country_code . "'";
4861
+        $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
4862
+        $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
4863 4863
         $sql .= " ORDER BY t.taux DESC, t.recuperableonly ASC";
4864 4864
         $sql .= $db->plimit(1);
4865 4865
 
@@ -4876,7 +4876,7 @@  discard block
 block discarded – undo
4876 4876
             dol_print_error($db);
4877 4877
     }
4878 4878
 
4879
-    dol_syslog("get_product_localtax_for_country: ret=" . $ret);
4879
+    dol_syslog("get_product_localtax_for_country: ret=".$ret);
4880 4880
     return $ret;
4881 4881
 }
4882 4882
 
@@ -4900,7 +4900,7 @@  discard block
 block discarded – undo
4900 4900
 {
4901 4901
     global $conf;
4902 4902
 
4903
-    require_once DOL_BASE_PATH . '/core/lib/company.lib.php';
4903
+    require_once DOL_BASE_PATH.'/core/lib/company.lib.php';
4904 4904
 
4905 4905
     // Note: possible values for tva_assuj are 0/1 or franchise/reel
4906 4906
     $seller_use_vat = ((is_numeric($thirdparty_seller->tva_assuj) && !$thirdparty_seller->tva_assuj) || (!is_numeric($thirdparty_seller->tva_assuj) && $thirdparty_seller->tva_assuj == 'franchise')) ? 0 : 1;
@@ -4911,7 +4911,7 @@  discard block
 block discarded – undo
4911 4911
     $buyer_country_code = $thirdparty_buyer->country_code;
4912 4912
     $buyer_in_cee = isInEEC($thirdparty_buyer);
4913 4913
 
4914
-    dol_syslog("get_default_tva: seller use vat=" . $seller_use_vat . ", seller country=" . $seller_country_code . ", seller in cee=" . $seller_in_cee . ", buyer vat number=" . $thirdparty_buyer->tva_intra . " buyer country=" . $buyer_country_code . ", buyer in cee=" . $buyer_in_cee . ", idprod=" . $idprod . ", idprodfournprice=" . $idprodfournprice . ", SERVICE_ARE_ECOMMERCE_200238EC=" . (!empty($conf->global->SERVICES_ARE_ECOMMERCE_200238EC) ? $conf->global->SERVICES_ARE_ECOMMERCE_200238EC : ''));
4914
+    dol_syslog("get_default_tva: seller use vat=".$seller_use_vat.", seller country=".$seller_country_code.", seller in cee=".$seller_in_cee.", buyer vat number=".$thirdparty_buyer->tva_intra." buyer country=".$buyer_country_code.", buyer in cee=".$buyer_in_cee.", idprod=".$idprod.", idprodfournprice=".$idprodfournprice.", SERVICE_ARE_ECOMMERCE_200238EC=".(!empty($conf->global->SERVICES_ARE_ECOMMERCE_200238EC) ? $conf->global->SERVICES_ARE_ECOMMERCE_200238EC : ''));
4915 4915
 
4916 4916
     // If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm)
4917 4917
     // we use the buyer VAT.
@@ -4977,14 +4977,14 @@  discard block
 block discarded – undo
4977 4977
 
4978 4978
     if ($idprodfournprice > 0) {
4979 4979
         if (!class_exists('ProductFournisseur'))
4980
-            require_once DOL_BASE_PATH . '/fourn/class/fournisseur.product.class.php';
4980
+            require_once DOL_BASE_PATH.'/fourn/class/fournisseur.product.class.php';
4981 4981
         $prodprice = new ProductFournisseur($db);
4982 4982
         $prodprice->fetch_product_fournisseur_price($idprodfournprice);
4983 4983
         return $prodprice->fourn_tva_npr;
4984 4984
     }
4985 4985
     elseif ($idprod > 0) {
4986 4986
         if (!class_exists('Product'))
4987
-            require_once DOL_BASE_PATH . 'product/class/product.class.php';
4987
+            require_once DOL_BASE_PATH.'product/class/product.class.php';
4988 4988
         $prod = new Product($db);
4989 4989
         $prod->fetch($idprod);
4990 4990
         return $prod->tva_npr;
@@ -5063,7 +5063,7 @@  discard block
 block discarded – undo
5063 5063
         if ($case == 2)
5064 5064
             $result = '<input type="checkbox" value="1" checked disabled>';
5065 5065
         if ($case == 3)
5066
-            $result = '<input type="checkbox" value="1" checked disabled> ' . $result;
5066
+            $result = '<input type="checkbox" value="1" checked disabled> '.$result;
5067 5067
 
5068 5068
         $classname = 'ok';
5069 5069
     }
@@ -5074,7 +5074,7 @@  discard block
 block discarded – undo
5074 5074
         if ($case == 2)
5075 5075
             $result = '<input type="checkbox" value="0" disabled>';
5076 5076
         if ($case == 3)
5077
-            $result = '<input type="checkbox" value="0" disabled> ' . $result;
5077
+            $result = '<input type="checkbox" value="0" disabled> '.$result;
5078 5078
 
5079 5079
         if ($color == 2)
5080 5080
             $classname = 'ok';
@@ -5082,7 +5082,7 @@  discard block
 block discarded – undo
5082 5082
             $classname = 'error';
5083 5083
     }
5084 5084
     if ($color)
5085
-        return '<font class="' . $classname . '">' . $result . '</font>';
5085
+        return '<font class="'.$classname.'">'.$result.'</font>';
5086 5086
     return $result;
5087 5087
 }
5088 5088
 
@@ -5116,13 +5116,13 @@  discard block
 block discarded – undo
5116 5116
             $num = preg_replace('/([^0-9])/i', '', $num);
5117 5117
         else
5118 5118
             $num = preg_replace('/^.*\-/i', '', $num);
5119
-        $num = substr("000" . $num, -$level);
5119
+        $num = substr("000".$num, -$level);
5120 5120
         if ($level == 1)
5121 5121
             $path = substr($num, 0, 1);
5122 5122
         if ($level == 2)
5123
-            $path = substr($num, 1, 1) . '/' . substr($num, 0, 1);
5123
+            $path = substr($num, 1, 1).'/'.substr($num, 0, 1);
5124 5124
         if ($level == 3)
5125
-            $path = substr($num, 2, 1) . '/' . substr($num, 1, 1) . '/' . substr($num, 0, 1);
5125
+            $path = substr($num, 2, 1).'/'.substr($num, 1, 1).'/'.substr($num, 0, 1);
5126 5126
     }
5127 5127
     else {
5128 5128
         // TODO
@@ -5153,7 +5153,7 @@  discard block
 block discarded – undo
5153 5153
 {
5154 5154
     global $conf;
5155 5155
 
5156
-    dol_syslog("functions.lib::dol_mkdir: dir=" . $dir, LOG_INFO);
5156
+    dol_syslog("functions.lib::dol_mkdir: dir=".$dir, LOG_INFO);
5157 5157
 
5158 5158
     $dir_osencoded = dol_osencode($dir);
5159 5159
     if (@is_dir($dir_osencoded))
@@ -5165,15 +5165,15 @@  discard block
 block discarded – undo
5165 5165
     $ccdir = '';
5166 5166
     if (!empty($dataroot)) {
5167 5167
         // Remove data root from loop
5168
-        $dir = str_replace($dataroot . '/', '', $dir);
5169
-        $ccdir = $dataroot . '/';
5168
+        $dir = str_replace($dataroot.'/', '', $dir);
5169
+        $ccdir = $dataroot.'/';
5170 5170
     }
5171 5171
 
5172 5172
     $cdir = explode("/", $dir);
5173 5173
     $num = count($cdir);
5174 5174
     for ($i = 0; $i < $num; $i++) {
5175 5175
         if ($i > 0)
5176
-            $ccdir .= '/' . $cdir[$i];
5176
+            $ccdir .= '/'.$cdir[$i];
5177 5177
         else
5178 5178
             $ccdir .= $cdir[$i];
5179 5179
         if (preg_match("/^.:$/", $ccdir, $regs))
@@ -5204,20 +5204,20 @@  discard block
 block discarded – undo
5204 5204
         if ($ccdir) {
5205 5205
             $ccdir_osencoded = dol_osencode($ccdir);
5206 5206
             if (!@is_dir($ccdir_osencoded)) {
5207
-                dol_syslog("functions.lib::dol_mkdir: Directory '" . $ccdir . "' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
5207
+                dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
5208 5208
 
5209 5209
                 umask(0);
5210 5210
                 $dirmaskdec = octdec($newmask);
5211 5211
                 if (empty($newmask)) {
5212 5212
                     $dirmaskdec = empty($conf->global->MAIN_UMASK) ? octdec('0755') : octdec($conf->global->MAIN_UMASK);
5213 5213
                 }
5214
-                $dirmaskdec |= octdec('0111');  // Set x bit required for directories
5214
+                $dirmaskdec |= octdec('0111'); // Set x bit required for directories
5215 5215
                 if (!@mkdir($ccdir_osencoded, $dirmaskdec)) {
5216 5216
                     // Si le is_dir a renvoye une fausse info, alors on passe ici.
5217
-                    dol_syslog("functions.lib::dol_mkdir: Fails to create directory '" . $ccdir . "' or directory already exists.", LOG_WARNING);
5217
+                    dol_syslog("functions.lib::dol_mkdir: Fails to create directory '".$ccdir."' or directory already exists.", LOG_WARNING);
5218 5218
                     $nberr++;
5219 5219
                 } else {
5220
-                    dol_syslog("functions.lib::dol_mkdir: Directory '" . $ccdir . "' created", LOG_DEBUG);
5220
+                    dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' created", LOG_DEBUG);
5221 5221
                     $nberr = 0; // On remet a zero car si on arrive ici, cela veut dire que les echecs precedents peuvent etre ignore
5222 5222
                     $nbcreated++;
5223 5223
                 }
@@ -5265,9 +5265,9 @@  discard block
 block discarded – undo
5265 5265
     } else {
5266 5266
         $pattern = "/<[^<>]+>/";
5267 5267
         // Exemple of $temp: <a href="/myurl" title="<u>A title</u>">0000-021</a>
5268
-        $temp = preg_replace($pattern, "", $temp);    // pass 1
5268
+        $temp = preg_replace($pattern, "", $temp); // pass 1
5269 5269
         // $temp after pass 1: <a href="/myurl" title="A title">0000-021
5270
-        $temp = preg_replace($pattern, "", $temp);    // pass 2
5270
+        $temp = preg_replace($pattern, "", $temp); // pass 2
5271 5271
         // $temp after pass 2: 0000-021
5272 5272
     }
5273 5273
 
@@ -5323,8 +5323,8 @@  discard block
 block discarded – undo
5323 5323
 {
5324 5324
     $temp = $stringtoclean;
5325 5325
     foreach ($disallowed_tags as $tagtoremove) {
5326
-        $temp = preg_replace('/<\/?' . $tagtoremove . '>/', '', $temp);
5327
-        $temp = preg_replace('/<\/?' . $tagtoremove . '\s+[^>]*>/', '', $temp);
5326
+        $temp = preg_replace('/<\/?'.$tagtoremove.'>/', '', $temp);
5327
+        $temp = preg_replace('/<\/?'.$tagtoremove.'\s+[^>]*>/', '', $temp);
5328 5328
     }
5329 5329
     return $temp;
5330 5330
 }
@@ -5341,12 +5341,12 @@  discard block
 block discarded – undo
5341 5341
 {
5342 5342
     if ($nboflines == 1) {
5343 5343
         if (dol_textishtml($text)) {
5344
-            $firstline = preg_replace('/<br[^>]*>.*$/s', '', $text);  // The s pattern modifier means the . can match newline characters
5344
+            $firstline = preg_replace('/<br[^>]*>.*$/s', '', $text); // The s pattern modifier means the . can match newline characters
5345 5345
             $firstline = preg_replace('/<div[^>]*>.*$/s', '', $firstline); // The s pattern modifier means the . can match newline characters
5346 5346
         } else {
5347 5347
             $firstline = preg_replace('/[\n\r].*/', '', $text);
5348 5348
         }
5349
-        return $firstline . ((strlen($firstline) != strlen($text)) ? '...' : '');
5349
+        return $firstline.((strlen($firstline) != strlen($text)) ? '...' : '');
5350 5350
     } else {
5351 5351
         $ishtml = 0;
5352 5352
         if (dol_textishtml($text)) {
@@ -5362,7 +5362,7 @@  discard block
 block discarded – undo
5362 5362
             $pattern = '/(<br[^>]*>)/Uu';
5363 5363
         } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support
5364 5364
         else
5365
-            $pattern = '/(<br[^>]*>)/U';       // /U is to have UNGREEDY regex to limit to one html tag.
5365
+            $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
5366 5366
         $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
5367 5367
 
5368 5368
         $firstline = '';
@@ -5376,7 +5376,7 @@  discard block
 block discarded – undo
5376 5376
             $i++;
5377 5377
         }
5378 5378
         unset($a);
5379
-        return $firstline . (($i < $nba) ? '...' : '');
5379
+        return $firstline.(($i < $nba) ? '...' : '');
5380 5380
     }
5381 5381
 }
5382 5382
 
@@ -5447,9 +5447,9 @@  discard block
 block discarded – undo
5447 5447
 function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8')
5448 5448
 {
5449 5449
     $ret = dol_html_entity_decode($stringtodecode, ENT_COMPAT, $pagecodeto);
5450
-    $ret = preg_replace('/' . "\r\n" . '<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret);
5451
-    $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>' . "\r\n" . '/i', "\r\n", $ret);
5452
-    $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>' . "\n" . '/i', "\n", $ret);
5450
+    $ret = preg_replace('/'."\r\n".'<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret);
5451
+    $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\r\n".'/i', "\r\n", $ret);
5452
+    $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\n".'/i', "\n", $ret);
5453 5453
     $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', "\n", $ret);
5454 5454
     return $ret;
5455 5455
 }
@@ -5462,7 +5462,7 @@  discard block
 block discarded – undo
5462 5462
  */
5463 5463
 function dol_htmlcleanlastbr($stringtodecode)
5464 5464
 {
5465
-    $ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|' . "\n" . '|' . "\r" . ')+$/i', "", $stringtodecode);
5465
+    $ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|'."\n".'|'."\r".')+$/i', "", $stringtodecode);
5466 5466
     return $ret;
5467 5467
 }
5468 5468
 
@@ -5559,7 +5559,7 @@  discard block
 block discarded – undo
5559 5559
         $pattern = '/(<br[^>]*>)/Uu';
5560 5560
     } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support
5561 5561
     else
5562
-        $pattern = '/(<br[^>]*>)/U';       // /U is to have UNGREEDY regex to limit to one html tag.
5562
+        $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
5563 5563
     $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
5564 5564
 
5565 5565
     $nblines = (int) floor((count($a) + 1) / 2);
@@ -5590,7 +5590,7 @@  discard block
 block discarded – undo
5590 5590
  */
5591 5591
 function dol_microtime_float()
5592 5592
 {
5593
-    dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
5593
+    dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING);
5594 5594
 
5595 5595
     return microtime(true);
5596 5596
 }
@@ -5636,9 +5636,9 @@  discard block
 block discarded – undo
5636 5636
         elseif (preg_match('/<h[0-9]>/i', $msg))
5637 5637
             return true;
5638 5638
         elseif (preg_match('/&[A-Z0-9]{1,6};/i', $msg))
5639
-            return true;    // Html entities names (http://www.w3schools.com/tags/ref_entities.asp)
5639
+            return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp)
5640 5640
         elseif (preg_match('/&#[0-9]{2,3};/i', $msg))
5641
-            return true;    // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp)
5641
+            return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp)
5642 5642
 
5643 5643
         return false;
5644 5644
     }
@@ -5863,7 +5863,7 @@  discard block
 block discarded – undo
5863 5863
                 if ($object->fetch_optionals() > 0) {
5864 5864
                     if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) {
5865 5865
                         foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) {
5866
-                            $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key];
5866
+                            $substitutionarray['__EXTRAFIELD_'.strtoupper($key).'__'] = $object->array_options['options_'.$key];
5867 5867
                         }
5868 5868
                     }
5869 5869
                 }
@@ -5875,7 +5875,7 @@  discard block
 block discarded – undo
5875 5875
                 $paymenturl = '';
5876 5876
             } else {
5877 5877
                 // Set the online payment url link into __ONLINE_PAYMENT_URL__ key
5878
-                require_once DOL_BASE_PATH . '/core/lib/payments.lib.php';
5878
+                require_once DOL_BASE_PATH.'/core/lib/payments.lib.php';
5879 5879
                 $outputlangs->loadLangs(array('paypal', 'other'));
5880 5880
                 $typeforonlinepayment = 'free';
5881 5881
                 if (is_object($object) && $object->element == 'commande')
@@ -5936,7 +5936,7 @@  discard block
 block discarded – undo
5936 5936
 
5937 5937
     //var_dump($substitutionarray['__AMOUNT_FORMATED__']);
5938 5938
     if (empty($exclude) || !in_array('date', $exclude)) {
5939
-        include_once DOL_BASE_PATH . '/core/lib/date.lib.php';
5939
+        include_once DOL_BASE_PATH.'/core/lib/date.lib.php';
5940 5940
 
5941 5941
         $tmp = dol_getdate(dol_now(), true);
5942 5942
         $tmp2 = dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']);
@@ -5946,13 +5946,13 @@  discard block
 block discarded – undo
5946 5946
 
5947 5947
         $substitutionarray = array_merge($substitutionarray, array(
5948 5948
             '__DAY__' => (string) $tmp['mday'],
5949
-            '__DAY_TEXT__' => $outputlangs->trans('Day' . $tmp['wday']), // Monday
5950
-            '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'] . 'Min'), // Mon
5951
-            '__DAY_TEXT_MIN__' => $outputlangs->trans('Short' . $tmp['weekday']), // M
5949
+            '__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), // Monday
5950
+            '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'].'Min'), // Mon
5951
+            '__DAY_TEXT_MIN__' => $outputlangs->trans('Short'.$tmp['weekday']), // M
5952 5952
             '__MONTH__' => (string) $tmp['mon'],
5953
-            '__MONTH_TEXT__' => $outputlangs->trans('Month' . sprintf("%02d", $tmp['mon'])),
5954
-            '__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort' . sprintf("%02d", $tmp['mon'])),
5955
-            '__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort' . sprintf("%02d", $tmp['mon'])),
5953
+            '__MONTH_TEXT__' => $outputlangs->trans('Month'.sprintf("%02d", $tmp['mon'])),
5954
+            '__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort'.sprintf("%02d", $tmp['mon'])),
5955
+            '__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort'.sprintf("%02d", $tmp['mon'])),
5956 5956
             '__YEAR__' => (string) $tmp['year'],
5957 5957
             '__PREVIOUS_DAY__' => (string) $tmp2['day'],
5958 5958
             '__PREVIOUS_MONTH__' => (string) $tmp3['month'],
@@ -6011,7 +6011,7 @@  discard block
 block discarded – undo
6011 6011
             if (!empty($tmp[1]))
6012 6012
                 $outputlangs->load($tmp[1]);
6013 6013
 
6014
-            $text = preg_replace('/__\(' . preg_quote($reg[1], '/') . '\)__/', $msgishtml ? dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])) : $outputlangs->transnoentitiesnoconv($reg[1]), $text);
6014
+            $text = preg_replace('/__\('.preg_quote($reg[1], '/').'\)__/', $msgishtml ? dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])) : $outputlangs->transnoentitiesnoconv($reg[1]), $text);
6015 6015
         }
6016 6016
     }
6017 6017
 
@@ -6027,13 +6027,13 @@  discard block
 block discarded – undo
6027 6027
             $newval = '*****forbidden*****';
6028 6028
         else
6029 6029
             $newval = empty($conf->global->$keyfound) ? '' : $conf->global->$keyfound;
6030
-        $text = preg_replace('/__\[' . preg_quote($keyfound, '/') . '\]__/', $msgishtml ? dol_htmlentitiesbr($newval) : $newval, $text);
6030
+        $text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml ? dol_htmlentitiesbr($newval) : $newval, $text);
6031 6031
     }
6032 6032
 
6033 6033
     // Make substitition for array $substitutionarray
6034 6034
     foreach ($substitutionarray as $key => $value) {
6035 6035
         if ($key == '__SIGNATURE__' && (!empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)))
6036
-            $value = '';  // Protection
6036
+            $value = ''; // Protection
6037 6037
         if ($key == '__USER_SIGNATURE__' && (!empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)))
6038 6038
             $value = ''; // Protection
6039 6039
 
@@ -6059,7 +6059,7 @@  discard block
 block discarded – undo
6059 6059
 {
6060 6060
     global $conf, $user;
6061 6061
 
6062
-    require_once DOL_BASE_PATH . '/core/lib/files.lib.php';
6062
+    require_once DOL_BASE_PATH.'/core/lib/files.lib.php';
6063 6063
 
6064 6064
     // Add a substitution key for each extrafields, using key __EXTRA_XXX__
6065 6065
     // TODO Remove this. Already available into the getCommonSubstitutionArray used to build the substitution array.
@@ -6089,11 +6089,11 @@  discard block
 block discarded – undo
6089 6089
             if (preg_match('/functions_(.*)\.lib\.php/i', $substitfile['name'], $reg)) {
6090 6090
                 $module = $reg[1];
6091 6091
 
6092
-                dol_syslog("Library " . $substitfile['name'] . " found into " . $dir);
6092
+                dol_syslog("Library ".$substitfile['name']." found into ".$dir);
6093 6093
                 // Include the user's functions file
6094
-                require_once $dir . $substitfile['name'];
6094
+                require_once $dir.$substitfile['name'];
6095 6095
                 // Call the user's function, and only if it is defined
6096
-                $function_name = $module . "_" . $callfunc;
6096
+                $function_name = $module."_".$callfunc;
6097 6097
                 if (function_exists($function_name))
6098 6098
                     $function_name($substitutionarray, $outputlangs, $object, $parameters);
6099 6099
             }
@@ -6135,13 +6135,13 @@  discard block
 block discarded – undo
6135 6135
         $outputlangs = $langs;
6136 6136
 
6137 6137
     if ($date_start && $date_end) {
6138
-        $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
6138
+        $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
6139 6139
     }
6140 6140
     if ($date_start && !$date_end) {
6141
-        $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
6141
+        $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
6142 6142
     }
6143 6143
     if (!$date_start && $date_end) {
6144
-        $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
6144
+        $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
6145 6145
     }
6146 6146
 
6147 6147
     return $out;
@@ -6221,7 +6221,7 @@  discard block
 block discarded – undo
6221 6221
         dol_syslog("Try to add a message in stack with empty message", LOG_WARNING);
6222 6222
     } else {
6223 6223
         if (!in_array((string) $style, array('mesgs', 'warnings', 'errors')))
6224
-            dol_print_error('', 'Bad parameter style=' . $style . ' for setEventMessages');
6224
+            dol_print_error('', 'Bad parameter style='.$style.' for setEventMessages');
6225 6225
         if (empty($mesgs))
6226 6226
             setEventMessage($mesg, $style);
6227 6227
         else {
@@ -6290,7 +6290,7 @@  discard block
 block discarded – undo
6290 6290
 
6291 6291
     // If inline message with no format, we add it.
6292 6292
     if ((empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) || $keepembedded) && !preg_match('/<div class=".*">/i', $out)) {
6293
-        $divstart = '<div class="' . $style . ' clearboth">';
6293
+        $divstart = '<div class="'.$style.' clearboth">';
6294 6294
         $divend = '</div>';
6295 6295
     }
6296 6296
 
@@ -6317,14 +6317,14 @@  discard block
 block discarded – undo
6317 6317
         if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && empty($keepembedded)) {
6318 6318
             $return = '<script type="text/javascript">
6319 6319
 					$(document).ready(function() {
6320
-						var block = ' . (!empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) ? "true" : "false") . '
6320
+						var block = ' . (!empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) ? "true" : "false").'
6321 6321
 						if (block) {
6322
-							$.dolEventValid("","' . dol_escape_js($out) . '");
6322
+							$.dolEventValid("","' . dol_escape_js($out).'");
6323 6323
 						} else {
6324 6324
 							/* jnotify(message, preset of message type, keepmessage) */
6325
-							$.jnotify("' . dol_escape_js($out) . '",
6326
-							"' . ($style == "ok" ? 3000 : $style) . '",
6327
-							' . ($style == "ok" ? "false" : "true") . ',
6325
+							$.jnotify("' . dol_escape_js($out).'",
6326
+							"' . ($style == "ok" ? 3000 : $style).'",
6327
+							' . ($style == "ok" ? "false" : "true").',
6328 6328
 							{ remove: function (){} } );
6329 6329
 						}
6330 6330
 					});
@@ -6519,11 +6519,11 @@  discard block
 block discarded – undo
6519 6519
 {
6520 6520
     global $conf;
6521 6521
 
6522
-    $tmp = ini_get("unicode.filesystem_encoding");      // Disponible avec PHP 6.0
6522
+    $tmp = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
6523 6523
     if (empty($tmp) && !empty($_SERVER["WINDIR"]))
6524 6524
         $tmp = 'iso-8859-1'; // By default for windows
6525 6525
     if (empty($tmp))
6526
-        $tmp = 'utf-8';          // By default for other
6526
+        $tmp = 'utf-8'; // By default for other
6527 6527
     if (!empty($conf->global->MAIN_FILESYSTEM_ENCODING))
6528 6528
         $tmp = $conf->global->MAIN_FILESYSTEM_ENCODING;
6529 6529
 
@@ -6555,16 +6555,16 @@  discard block
 block discarded – undo
6555 6555
 
6556 6556
     // Check in cache
6557 6557
     if (isset($cache_codes[$tablename][$key][$fieldid])) { // Can be defined to 0 or ''
6558
-        return $cache_codes[$tablename][$key][$fieldid];   // Found in cache
6558
+        return $cache_codes[$tablename][$key][$fieldid]; // Found in cache
6559 6559
     }
6560 6560
 
6561 6561
     dol_syslog('dol_getIdFromCode (value not found into cache)', LOG_DEBUG);
6562 6562
 
6563
-    $sql = "SELECT " . $fieldid . " as valuetoget";
6564
-    $sql .= " FROM " . MAIN_DB_PREFIX . $tablename;
6565
-    $sql .= " WHERE " . $fieldkey . " = '" . $db->escape($key) . "'";
6563
+    $sql = "SELECT ".$fieldid." as valuetoget";
6564
+    $sql .= " FROM ".MAIN_DB_PREFIX.$tablename;
6565
+    $sql .= " WHERE ".$fieldkey." = '".$db->escape($key)."'";
6566 6566
     if (!empty($entityfilter))
6567
-        $sql .= " AND entity IN (" . getEntity($tablename) . ")";
6567
+        $sql .= " AND entity IN (".getEntity($tablename).")";
6568 6568
 
6569 6569
     $resql = $db->query($sql);
6570 6570
     if ($resql) {
@@ -6591,12 +6591,12 @@  discard block
 block discarded – undo
6591 6591
 {
6592 6592
     global $user, $conf, $langs;
6593 6593
     global $leftmenu;
6594
-    global $rights;    // To export to dol_eval function
6594
+    global $rights; // To export to dol_eval function
6595 6595
     //print $strRights."<br>\n";
6596 6596
     $rights = true;
6597 6597
     if ($strRights != '') {
6598
-        $str = 'if(!(' . $strRights . ')) { $rights = false; }';
6599
-        dol_eval($str);  // The dol_eval must contains all the global $xxx used into a condition
6598
+        $str = 'if(!('.$strRights.')) { $rights = false; }';
6599
+        dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition
6600 6600
     }
6601 6601
     return $rights;
6602 6602
 }
@@ -6619,14 +6619,14 @@  discard block
 block discarded – undo
6619 6619
     global $object;
6620 6620
     global $mysoc;
6621 6621
 
6622
-    global $obj;       // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object
6623
-    global $soc;       // For backward compatibility
6622
+    global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object
6623
+    global $soc; // For backward compatibility
6624 6624
     //print $s."<br>\n";
6625 6625
     if ($returnvalue) {
6626 6626
         if ($hideerrors)
6627
-            return @eval('return ' . $s . ';');
6627
+            return @eval('return '.$s.';');
6628 6628
         else
6629
-            return eval('return ' . $s . ';');
6629
+            return eval('return '.$s.';');
6630 6630
     }
6631 6631
     else {
6632 6632
         if ($hideerrors)
@@ -6680,7 +6680,7 @@  discard block
 block discarded – undo
6680 6680
         $flagImage = empty($tmparray[1]) ? $tmparray[0] : $tmparray[1];
6681 6681
     }
6682 6682
 
6683
-    return img_picto_common($codelang, 'flags/' . strtolower($flagImage) . '.png', $moreatt);
6683
+    return img_picto_common($codelang, 'flags/'.strtolower($flagImage).'.png', $moreatt);
6684 6684
 }
6685 6685
 
6686 6686
 /**
@@ -6878,16 +6878,16 @@  discard block
 block discarded – undo
6878 6878
         'zu-ZA',
6879 6879
     );
6880 6880
 
6881
-    $buildprimarykeytotest = strtolower($countrycode) . '-' . strtoupper($countrycode);
6881
+    $buildprimarykeytotest = strtolower($countrycode).'-'.strtoupper($countrycode);
6882 6882
     if (in_array($buildprimarykeytotest, $locales))
6883
-        return strtolower($countrycode) . '_' . strtoupper($countrycode);
6883
+        return strtolower($countrycode).'_'.strtoupper($countrycode);
6884 6884
 
6885 6885
     foreach ($locales as $locale) {
6886 6886
         $locale_language = locale_get_primary_language($locale);
6887 6887
         $locale_region = locale_get_region($locale);
6888 6888
         if (strtoupper($countrycode) == $locale_region) {
6889 6889
             //var_dump($locale.'-'.$locale_language.'-'.$locale_region);
6890
-            return strtolower($locale_language) . '_' . strtoupper($locale_region);
6890
+            return strtolower($locale_language).'_'.strtoupper($locale_region);
6891 6891
         }
6892 6892
     }
6893 6893
 
@@ -6948,7 +6948,7 @@  discard block
 block discarded – undo
6948 6948
                             $label = $langs->trans($values[2]);
6949 6949
 
6950 6950
                         //$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]), 1);
6951
-                        $head[$h][0] = BASE_URI . preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]);
6951
+                        $head[$h][0] = BASE_URI.preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]);
6952 6952
                         $head[$h][1] = $label;
6953 6953
                         $head[$h][2] = str_replace('+', '', $values[1]);
6954 6954
                         $h++;
@@ -7019,43 +7019,43 @@  discard block
 block discarded – undo
7019 7019
     global $micro_start_time;
7020 7020
 
7021 7021
     if ($zone == 'private')
7022
-        print "\n" . '<!-- Common footer for private page -->' . "\n";
7022
+        print "\n".'<!-- Common footer for private page -->'."\n";
7023 7023
     else
7024
-        print "\n" . '<!-- Common footer for public page -->' . "\n";
7024
+        print "\n".'<!-- Common footer for public page -->'."\n";
7025 7025
 
7026 7026
     // A div to store page_y POST parameter so we can read it using javascript
7027 7027
     print "\n<!-- A div to store page_y POST paramater -->\n";
7028
-    print '<div id="page_y" style="display: none;">' . $_POST['page_y'] . '</div>' . "\n";
7028
+    print '<div id="page_y" style="display: none;">'.$_POST['page_y'].'</div>'."\n";
7029 7029
 
7030 7030
     $parameters = array();
7031
-    $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters);    // Note that $action and $object may have been modified by some hooks
7031
+    $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
7032 7032
     if (empty($reshook)) {
7033 7033
         if (!empty($conf->global->MAIN_HTML_FOOTER))
7034
-            print $conf->global->MAIN_HTML_FOOTER . "\n";
7034
+            print $conf->global->MAIN_HTML_FOOTER."\n";
7035 7035
 
7036 7036
         print "\n";
7037 7037
         if (!empty($conf->use_javascript_ajax)) {
7038
-            print '<script type="text/javascript" language="javascript">' . "\n";
7039
-            print 'jQuery(document).ready(function() {' . "\n";
7038
+            print '<script type="text/javascript" language="javascript">'."\n";
7039
+            print 'jQuery(document).ready(function() {'."\n";
7040 7040
 
7041 7041
             if ($zone == 'private' && empty($conf->dol_use_jmobile)) {
7042 7042
                 print "\n";
7043
-                print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */' . "\n";
7043
+                print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n";
7044 7044
                 print 'jQuery(".menuhider").click(function() {';
7045
-                print '  console.log("We click on .menuhider");' . "\n";
7045
+                print '  console.log("We click on .menuhider");'."\n";
7046 7046
                 //print "  $('.side-nav').animate({width:'toggle'},200);\n";     // OK with eldy theme but not with md
7047 7047
                 print "  $('.side-nav').toggle()\n";
7048 7048
                 print "  $('.login_block').toggle()\n";
7049
-                print '});' . "\n";
7049
+                print '});'."\n";
7050 7050
             }
7051 7051
 
7052 7052
             // Management of focus and mandatory for fields
7053 7053
             if ($action == 'create' || $action == 'edit' || (empty($action) && (preg_match('/new\.php/', $_SERVER["PHP_SELF"])))) {
7054
-                print '/* JS CODE TO ENABLE to manage focus and mandatory form fields */' . "\n";
7054
+                print '/* JS CODE TO ENABLE to manage focus and mandatory form fields */'."\n";
7055 7055
                 $relativepathstring = $_SERVER["PHP_SELF"];
7056 7056
                 // Clean $relativepathstring
7057 7057
                 if (constant('DOL_URL_ROOT'))
7058
-                    $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_URL_ROOT'), '/') . '/', '', $relativepathstring);
7058
+                    $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'), '/').'/', '', $relativepathstring);
7059 7059
                 $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
7060 7060
                 $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
7061 7061
                 $tmpqueryarraywehave = explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
@@ -7078,9 +7078,9 @@  discard block
 block discarded – undo
7078 7078
                         if ($qualified) {
7079 7079
                             foreach ($defval as $paramkey => $paramval) {
7080 7080
                                 // Set focus on field
7081
-                                print 'jQuery("input[name=\'' . $paramkey . '\']").focus();' . "\n";
7082
-                                print 'jQuery("textarea[name=\'' . $paramkey . '\']").focus();' . "\n";
7083
-                                print 'jQuery("select[name=\'' . $paramkey . '\']").focus();' . "\n";  // Not really usefull, but we keep it in case of.
7081
+                                print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
7082
+                                print 'jQuery("textarea[name=\''.$paramkey.'\']").focus();'."\n";
7083
+                                print 'jQuery("select[name=\''.$paramkey.'\']").focus();'."\n"; // Not really usefull, but we keep it in case of.
7084 7084
                             }
7085 7085
                         }
7086 7086
                     }
@@ -7104,16 +7104,16 @@  discard block
 block discarded – undo
7104 7104
                         if ($qualified) {
7105 7105
                             foreach ($defval as $paramkey => $paramval) {
7106 7106
                                 // Add property 'required' on input
7107
-                                print 'jQuery("input[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n";
7108
-                                print 'jQuery("textarea[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n";
7109
-                                print 'jQuery("select[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n";  // required on a select works only if key is "", this does not happen in Dolibarr
7107
+                                print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
7108
+                                print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
7109
+                                print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
7110 7110
                             }
7111 7111
                         }
7112 7112
                     }
7113 7113
                 }
7114 7114
             }
7115 7115
 
7116
-            print '});' . "\n";
7116
+            print '});'."\n";
7117 7117
 
7118 7118
             // Google Analytics
7119 7119
             // TODO Add a hook here
@@ -7121,15 +7121,15 @@  discard block
 block discarded – undo
7121 7121
                 if (($conf->dol_use_jmobile != 4)) {
7122 7122
                     print "\n";
7123 7123
                     print "/* JS CODE TO ENABLE for google analtics tag */\n";
7124
-                    print '  var _gaq = _gaq || [];' . "\n";
7125
-                    print '  _gaq.push([\'_setAccount\', \'' . $conf->global->MAIN_GOOGLE_AN_ID . '\']);' . "\n";
7126
-                    print '  _gaq.push([\'_trackPageview\']);' . "\n";
7127
-                    print '' . "\n";
7128
-                    print '  (function() {' . "\n";
7129
-                    print '    var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;' . "\n";
7130
-                    print '    ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';' . "\n";
7131
-                    print '    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);' . "\n";
7132
-                    print '  })();' . "\n";
7124
+                    print '  var _gaq = _gaq || [];'."\n";
7125
+                    print '  _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n";
7126
+                    print '  _gaq.push([\'_trackPageview\']);'."\n";
7127
+                    print ''."\n";
7128
+                    print '  (function() {'."\n";
7129
+                    print '    var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n";
7130
+                    print '    ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n";
7131
+                    print '    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n";
7132
+                    print '  })();'."\n";
7133 7133
                 }
7134 7134
             }
7135 7135
 
@@ -7139,27 +7139,27 @@  discard block
 block discarded – undo
7139 7139
                 print "/* JS CODE TO ENABLE to add memory info */\n";
7140 7140
                 print 'window.console && console.log("';
7141 7141
                 if (!empty($conf->global->MEMCACHED_SERVER))
7142
-                    print 'MEMCACHED_SERVER=' . $conf->global->MEMCACHED_SERVER . ' - ';
7143
-                print 'MAIN_OPTIMIZE_SPEED=' . (isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off');
7142
+                    print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - ';
7143
+                print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off');
7144 7144
                 if (!empty($micro_start_time)) {   // Works only if MAIN_SHOW_TUNING_INFO is defined at $_SERVER level. Not in global variable.
7145 7145
                     $micro_end_time = microtime(true);
7146
-                    print ' - Build time: ' . ceil(1000 * ($micro_end_time - $micro_start_time)) . ' ms';
7146
+                    print ' - Build time: '.ceil(1000 * ($micro_end_time - $micro_start_time)).' ms';
7147 7147
                 }
7148 7148
                 if (function_exists("memory_get_usage")) {
7149
-                    print ' - Mem: ' . memory_get_usage();
7149
+                    print ' - Mem: '.memory_get_usage();
7150 7150
                 }
7151 7151
                 if (function_exists("xdebug_memory_usage")) {
7152
-                    print ' - XDebug time: ' . ceil(1000 * xdebug_time_index()) . ' ms';
7153
-                    print ' - XDebug mem: ' . xdebug_memory_usage();
7154
-                    print ' - XDebug mem peak: ' . xdebug_peak_memory_usage();
7152
+                    print ' - XDebug time: '.ceil(1000 * xdebug_time_index()).' ms';
7153
+                    print ' - XDebug mem: '.xdebug_memory_usage();
7154
+                    print ' - XDebug mem peak: '.xdebug_peak_memory_usage();
7155 7155
                 }
7156 7156
                 if (function_exists("zend_loader_file_encoded")) {
7157
-                    print ' - Zend encoded file: ' . (zend_loader_file_encoded() ? 'yes' : 'no');
7157
+                    print ' - Zend encoded file: '.(zend_loader_file_encoded() ? 'yes' : 'no');
7158 7158
                 }
7159
-                print '");' . "\n";
7159
+                print '");'."\n";
7160 7160
             }
7161 7161
 
7162
-            print "\n" . '</script>' . "\n";
7162
+            print "\n".'</script>'."\n";
7163 7163
         }
7164 7164
 
7165 7165
         // Add Xdebug coverage of code
@@ -7173,7 +7173,7 @@  discard block
 block discarded – undo
7173 7173
             print "<!-- Start of log output\n";
7174 7174
             //print '<div class="hidden">'."\n";
7175 7175
             foreach ($conf->logbuffer as $logline) {
7176
-                print $logline . "<br>\n";
7176
+                print $logline."<br>\n";
7177 7177
             }
7178 7178
             //print '</div>'."\n";
7179 7179
             print "End of log output -->\n";
@@ -7216,8 +7216,8 @@  discard block
 block discarded – undo
7216 7216
  */
7217 7217
 function dol_set_focus($selector)
7218 7218
 {
7219
-    print "\n" . '<!-- Set focus onto a specific field -->' . "\n";
7220
-    print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() { jQuery("' . dol_escape_js($selector) . '").focus(); });</script>' . "\n";
7219
+    print "\n".'<!-- Set focus onto a specific field -->'."\n";
7220
+    print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() { jQuery("'.dol_escape_js($selector).'").focus(); });</script>'."\n";
7221 7221
 }
7222 7222
 
7223 7223
 /**
@@ -7262,7 +7262,7 @@  discard block
 block discarded – undo
7262 7262
         $value = preg_replace('/\*/', '%', $value); // Replace * with %
7263 7263
     }
7264 7264
     if ($mode == 1) {
7265
-        $value = preg_replace('/([<>=]+)\s+([0-9' . preg_quote($langs->trans("DecimalSeparator"), '/') . '\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
7265
+        $value = preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
7266 7266
     }
7267 7267
 
7268 7268
     $value = preg_replace('/\s*\|\s*/', '|', $value);
@@ -7291,14 +7291,14 @@  discard block
 block discarded – undo
7291 7291
                 if ($newcrit != '') {
7292 7292
                     $numnewcrit = price2num($newcrit);
7293 7293
                     if (is_numeric($numnewcrit)) {
7294
-                        $newres .= ($i2 > 0 ? ' OR ' : '') . $field . ' ' . $operator . ' ' . $numnewcrit;
7294
+                        $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.$numnewcrit;
7295 7295
                     } else {
7296
-                        $newres .= ($i2 > 0 ? ' OR ' : '') . '1 = 2'; // force false
7296
+                        $newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false
7297 7297
                     }
7298 7298
                     $i2++; // a criteria was added to string
7299 7299
                 }
7300 7300
             } else if ($mode == 2) {
7301
-                $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
7301
+                $newres .= ($i2 > 0 ? ' OR ' : '').$field." IN (".$db->escape(trim($crit)).")";
7302 7302
                 $i2++; // a criteria was added to string
7303 7303
             } else if ($mode == 3) {
7304 7304
                 $tmparray = explode(',', trim($crit));
@@ -7307,10 +7307,10 @@  discard block
 block discarded – undo
7307 7307
                     foreach ($tmparray as $val) {
7308 7308
                         if ($val) {
7309 7309
                             $listofcodes .= ($listofcodes ? ',' : '');
7310
-                            $listofcodes .= "'" . $db->escape(trim($val)) . "'";
7310
+                            $listofcodes .= "'".$db->escape(trim($val))."'";
7311 7311
                         }
7312 7312
                     }
7313
-                    $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $listofcodes . ")";
7313
+                    $newres .= ($i2 > 0 ? ' OR ' : '').$field." IN (".$listofcodes.")";
7314 7314
                     $i2++; // a criteria was added to string
7315 7315
                 }
7316 7316
             } else if ($mode == 4) {
@@ -7319,10 +7319,10 @@  discard block
 block discarded – undo
7319 7319
                     $listofcodes = '';
7320 7320
                     foreach ($tmparray as $val) {
7321 7321
                         if ($val) {
7322
-                            $newres .= ($i2 > 0 ? ' OR (' : '(') . $field . ' LIKE \'' . $db->escape(trim($val)) . ',%\'';
7323
-                            $newres .= ' OR ' . $field . ' = \'' . $db->escape(trim($val)) . '\'';
7324
-                            $newres .= ' OR ' . $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\'';
7325
-                            $newres .= ' OR ' . $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\'';
7322
+                            $newres .= ($i2 > 0 ? ' OR (' : '(').$field.' LIKE \''.$db->escape(trim($val)).',%\'';
7323
+                            $newres .= ' OR '.$field.' = \''.$db->escape(trim($val)).'\'';
7324
+                            $newres .= ' OR '.$field.' LIKE \'%,'.$db->escape(trim($val)).'\'';
7325
+                            $newres .= ' OR '.$field.' LIKE \'%,'.$db->escape(trim($val)).',%\'';
7326 7326
                             $newres .= ')';
7327 7327
                             $i2++;
7328 7328
                         }
@@ -7339,9 +7339,9 @@  discard block
 block discarded – undo
7339 7339
                     $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
7340 7340
 
7341 7341
                     if (preg_match('/\.(id|rowid)$/', $field)) { // Special case for rowid that is sometimes a ref so used as a search field
7342
-                        $newres .= $field . " = " . (is_numeric(trim($tmpcrit)) ? trim($tmpcrit) : '0');
7342
+                        $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ? trim($tmpcrit) : '0');
7343 7343
                     } else {
7344
-                        $newres .= $field . " LIKE '";
7344
+                        $newres .= $field." LIKE '";
7345 7345
 
7346 7346
                         $tmpcrit = trim($tmpcrit);
7347 7347
                         $tmpcrit2 = $tmpcrit;
@@ -7360,7 +7360,7 @@  discard block
 block discarded – undo
7360 7360
                         $newres .= $tmpafter;
7361 7361
                         $newres .= "'";
7362 7362
                         if ($tmpcrit2 == '') {
7363
-                            $newres .= ' OR ' . $field . " IS NULL";
7363
+                            $newres .= ' OR '.$field." IS NULL";
7364 7364
                         }
7365 7365
                     }
7366 7366
 
@@ -7371,10 +7371,10 @@  discard block
 block discarded – undo
7371 7371
             $i++;
7372 7372
         }
7373 7373
         if ($newres)
7374
-            $res = $res . ($res ? ' AND ' : '') . ($i2 > 1 ? '(' : '') . $newres . ($i2 > 1 ? ')' : '');
7374
+            $res = $res.($res ? ' AND ' : '').($i2 > 1 ? '(' : '').$newres.($i2 > 1 ? ')' : '');
7375 7375
         $j++;
7376 7376
     }
7377
-    $res = ($nofirstand ? "" : " AND ") . "(" . $res . ")";
7377
+    $res = ($nofirstand ? "" : " AND ")."(".$res.")";
7378 7378
     //print 'xx'.$res.'yy';
7379 7379
     return $res;
7380 7380
 }
@@ -7393,8 +7393,8 @@  discard block
 block discarded – undo
7393 7393
     $url = $object->getLastMainDocLink($object->element);
7394 7394
 
7395 7395
     if ($url) {
7396
-        $out .= img_picto('', 'object_globe.png') . ' ' . $langs->trans("DirectDownloadLink") . '<br>';
7397
-        $out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="' . $url . '">';
7396
+        $out .= img_picto('', 'object_globe.png').' '.$langs->trans("DirectDownloadLink").'<br>';
7397
+        $out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'">';
7398 7398
         $out .= ajax_autoselect("directdownloadlink", 0);
7399 7399
     }
7400 7400
     return $out;
@@ -7435,7 +7435,7 @@  discard block
 block discarded – undo
7435 7435
     if ($extName)
7436 7436
         $subdir = 'thumbs/';
7437 7437
 
7438
-    return ($dirName ? $dirName . '/' : '') . $subdir . $fileName . $extName . $extImgTarget; // New filename for thumb
7438
+    return ($dirName ? $dirName.'/' : '').$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb
7439 7439
 }
7440 7440
 
7441 7441
 /**
@@ -7461,14 +7461,14 @@  discard block
 block discarded – undo
7461 7461
 
7462 7462
     if ($alldata == 1) {
7463 7463
         if ($num_mime !== false)
7464
-            return array('target' => '_blank', 'css' => 'documentpreview', 'url' => DOL_URL_ROOT . '/document.php?modulepart=' . $modulepart . '&attachment=0&file=' . urlencode($relativepath) . ($param ? '&' . $param : ''), 'mime' => dol_mimetype($relativepath),);
7464
+            return array('target' => '_blank', 'css' => 'documentpreview', 'url' => DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''), 'mime' => dol_mimetype($relativepath),);
7465 7465
         else
7466 7466
             return array();
7467 7467
     }
7468 7468
 
7469 7469
     // old behavior
7470 7470
     if ($num_mime !== false)
7471
-        return 'javascript:document_preview(\'' . dol_escape_js(DOL_URL_ROOT . '/document.php?modulepart=' . $modulepart . '&attachment=0&file=' . urlencode($relativepath) . ($param ? '&' . $param : '')) . '\', \'' . dol_mimetype($relativepath) . '\', \'' . dol_escape_js($langs->trans('Preview')) . '\')';
7471
+        return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : '')).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')';
7472 7472
     else
7473 7473
         return '';
7474 7474
 }
@@ -7485,11 +7485,11 @@  discard block
 block discarded – undo
7485 7485
     global $langs;
7486 7486
     $out = '<script type="text/javascript">
7487 7487
                jQuery(document).ready(function () {
7488
-				    jQuery("#' . $htmlname . '").click(function() { jQuery(this).select(); } );
7488
+				    jQuery("#' . $htmlname.'").click(function() { jQuery(this).select(); } );
7489 7489
 				});
7490 7490
 		    </script>';
7491 7491
     if ($addlink)
7492
-        $out .= ' <a href="' . $addlink . '" target="_blank">' . $langs->trans("Link") . '</a>';
7492
+        $out .= ' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
7493 7493
     return $out;
7494 7494
 }
7495 7495
 
@@ -7870,9 +7870,9 @@  discard block
 block discarded – undo
7870 7870
 
7871 7871
     if (!isset($dictvalues[$tablename])) {
7872 7872
         $dictvalues[$tablename] = array();
7873
-        $sql = 'SELECT * FROM ' . $tablename . ' WHERE 1';
7873
+        $sql = 'SELECT * FROM '.$tablename.' WHERE 1';
7874 7874
         if ($checkentity)
7875
-            $sql .= ' AND entity IN (0,' . getEntity($tablename) . ')';
7875
+            $sql .= ' AND entity IN (0,'.getEntity($tablename).')';
7876 7876
 
7877 7877
         $resql = $db->query($sql);
7878 7878
         if ($resql) {
@@ -7910,14 +7910,14 @@  discard block
 block discarded – undo
7910 7910
             $g = $tmp[1];
7911 7911
             $b = $tmp[2];
7912 7912
         } else {
7913
-            $hexr = $stringcolor[0] . $stringcolor[1];
7914
-            $hexg = $stringcolor[2] . $stringcolor[3];
7915
-            $hexb = $stringcolor[4] . $stringcolor[5];
7913
+            $hexr = $stringcolor[0].$stringcolor[1];
7914
+            $hexg = $stringcolor[2].$stringcolor[3];
7915
+            $hexb = $stringcolor[4].$stringcolor[5];
7916 7916
             $r = hexdec($hexr);
7917 7917
             $g = hexdec($hexg);
7918 7918
             $b = hexdec($hexb);
7919 7919
         }
7920
-        $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0;    // HSL algorithm
7920
+        $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm
7921 7921
         if ($bright > 0.6)
7922 7922
             $res = 1;
7923 7923
     }
@@ -7953,11 +7953,11 @@  discard block
 block discarded – undo
7953 7953
             return 0; // Entry is for menus all excluded to external users
7954 7954
     }
7955 7955
     if (!$menuentry['perms'] && $type_user)
7956
-        return 0;            // No permissions and user is external
7956
+        return 0; // No permissions and user is external
7957 7957
     if (!$menuentry['perms'] && !empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
7958 7958
         return 0; // No permissions and option to hide when not allowed, even for internal user, is on
7959 7959
     if (!$menuentry['perms'])
7960
-        return 2;               // No permissions and user is external
7960
+        return 2; // No permissions and user is external
7961 7961
     return 1;
7962 7962
 }
7963 7963
 
Please login to merge, or discard this patch.
dolibarr/htdocs/core/modules/modWebsite.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  *  \ingroup    websites
23 23
  *  \brief      Description and activation file for module Website
24 24
  */
25
-include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
25
+include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
26 26
 
27 27
 
28 28
 /**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     function __construct($db)
40 40
     {
41
-    	global $langs,$conf;
41
+    	global $langs, $conf;
42 42
 
43 43
         $this->db = $db;
44 44
         $this->numero = 10000;
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
         $this->family = "portal";
49 49
         $this->module_position = '50';
50 50
         // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
51
-        $this->name = preg_replace('/^mod/i','',get_class($this));
51
+        $this->name = preg_replace('/^mod/i', '', get_class($this));
52 52
         $this->description = "Enable to build and serve public web sites with CMS features";
53 53
 		// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
54 54
         $this->version = 'dolibarr';
55 55
         // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
56 56
         $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
57 57
         // Name of image file used for this module.
58
-        $this->picto='globe';
58
+        $this->picto = 'globe';
59 59
 
60 60
 		// Data directories to create when module is enabled
61 61
 		$this->dirs = array("/website/temp");
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
         $this->config_page_url = array('website.php');
65 65
 
66 66
         // Dependencies
67
-		$this->hidden = ! empty($conf->global->MODULE_WEBSITE_DISABLED);	// A condition to disable module
68
-		$this->depends = array('modFckeditor');		// List of modules id that must be enabled if this module is enabled
69
-        $this->requiredby = array();	// List of modules id to disable if this one is disabled
70
-		$this->conflictwith = array();	// List of modules id this module is in conflict with
71
-		$this->phpmin = array(5,4);		// Minimum version of PHP required by module
67
+		$this->hidden = !empty($conf->global->MODULE_WEBSITE_DISABLED); // A condition to disable module
68
+		$this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled
69
+        $this->requiredby = array(); // List of modules id to disable if this one is disabled
70
+		$this->conflictwith = array(); // List of modules id this module is in conflict with
71
+		$this->phpmin = array(5, 4); // Minimum version of PHP required by module
72 72
         $this->langfiles = array("website");
73 73
 
74 74
         // Constants
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
         $this->boxes = array();
82 82
 
83 83
 		// Permissions
84
-		$this->rights = array();		// Permission array used by this module
84
+		$this->rights = array(); // Permission array used by this module
85 85
 		$this->rights_class = 'website';
86
-		$r=0;
86
+		$r = 0;
87 87
 
88 88
 		$this->rights[$r][0] = 10001;
89 89
 		$this->rights[$r][1] = 'Read website content';
@@ -104,35 +104,35 @@  discard block
 block discarded – undo
104 104
 		$r++;
105 105
 
106 106
         // Main menu entries
107
-        $r=0;
108
-        $this->menu[$r]=array(	'fk_menu'=>'0',		    // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
109
-						        'type'=>'top',			                // This is a Left menu entry
107
+        $r = 0;
108
+        $this->menu[$r] = array('fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
109
+						        'type'=>'top', // This is a Left menu entry
110 110
 						        'titre'=>'WebSites',
111 111
                                 'mainmenu'=>'website',
112 112
 						        'url'=>'/website/index.php',
113
-						        'langs'=>'website',	        // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
113
+						        'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
114 114
 						        'position'=>100,
115
-						        'enabled'=>'$conf->website->enabled',  		// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
116
-						        'perms'=>'$user->rights->website->read',	// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
115
+						        'enabled'=>'$conf->website->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
116
+						        'perms'=>'$user->rights->website->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
117 117
 						        'target'=>'',
118
-						        'user'=>2);				                // 0=Menu for internal users, 1=external users, 2=both
118
+						        'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
119 119
         $r++;
120 120
 
121 121
         // Exports
122
-        $r=1;
122
+        $r = 1;
123 123
 
124
-        $this->export_code[$r]=$this->rights_class.'_'.$r;
125
-        $this->export_label[$r]='MyWebsitePages';	// Translation key (used only if key ExportDataset_xxx_z not found)
126
-        $this->export_icon[$r]='globe';
127
-        $keyforclass = 'WebsitePage'; $keyforclassfile='/website/class/websitepage.class.php'; $keyforelement='Website';
124
+        $this->export_code[$r] = $this->rights_class.'_'.$r;
125
+        $this->export_label[$r] = 'MyWebsitePages'; // Translation key (used only if key ExportDataset_xxx_z not found)
126
+        $this->export_icon[$r] = 'globe';
127
+        $keyforclass = 'WebsitePage'; $keyforclassfile = '/website/class/websitepage.class.php'; $keyforelement = 'Website';
128 128
         include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
129 129
         //$keyforselect='myobject'; $keyforelement='myobject'; $keyforaliasextra='extra';
130 130
         //include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
131 131
         //$this->export_dependencies_array[$r]=array('mysubobject'=>'ts.rowid', 't.myfield'=>array('t.myfield2','t.myfield3')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields)
132
-        $this->export_sql_start[$r]='SELECT DISTINCT ';
133
-        $this->export_sql_end[$r]  =' FROM '.MAIN_DB_PREFIX.'website_page as t, '.MAIN_DB_PREFIX.'website as p';
134
-        $this->export_sql_end[$r] .=' WHERE t.fk_website = p.rowid';
135
-        $this->export_sql_end[$r] .=' AND p.entity IN ('.getEntity('website').')';
132
+        $this->export_sql_start[$r] = 'SELECT DISTINCT ';
133
+        $this->export_sql_end[$r]  = ' FROM '.MAIN_DB_PREFIX.'website_page as t, '.MAIN_DB_PREFIX.'website as p';
134
+        $this->export_sql_end[$r] .= ' WHERE t.fk_website = p.rowid';
135
+        $this->export_sql_end[$r] .= ' AND p.entity IN ('.getEntity('website').')';
136 136
         $r++;
137 137
     }
138 138
 
@@ -145,29 +145,29 @@  discard block
 block discarded – undo
145 145
      *      @param      string	$options    Options when enabling module ('', 'noboxes')
146 146
      *      @return     int             	1 if OK, 0 if KO
147 147
      */
148
-    function init($options='')
148
+    function init($options = '')
149 149
     {
150
-    	global $conf,$langs;
150
+    	global $conf, $langs;
151 151
 
152 152
     	// Remove permissions and default values
153 153
     	$this->remove($options);
154 154
 
155 155
     	// Copy flags and octicons directoru
156
-    	$dirarray=array('common/flags', 'common/octicons');
157
-    	foreach($dirarray as $dir)
156
+    	$dirarray = array('common/flags', 'common/octicons');
157
+    	foreach ($dirarray as $dir)
158 158
     	{
159
-	    	$src = DOL_DOCUMENT_ROOT . '/theme/' . $dir;
160
-            $dest = DOL_DATA_ROOT . '/medias/image/' . $dir;
159
+	    	$src = DOL_DOCUMENT_ROOT.'/theme/'.$dir;
160
+            $dest = DOL_DATA_ROOT.'/medias/image/'.$dir;
161 161
 
162 162
             if (is_dir($src))
163 163
 	    	{
164 164
 	    		require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
165 165
 	    		dol_mkdir($dest);
166
-	    		$result=dolCopyDir($src,$dest,0,0);
166
+	    		$result = dolCopyDir($src, $dest, 0, 0);
167 167
 	    		if ($result < 0)
168 168
 	    		{
169 169
 	    			$langs->load("errors");
170
-	    			$this->error=$langs->trans('ErrorFailToCopyDir',$src,$dest);
170
+	    			$this->error = $langs->trans('ErrorFailToCopyDir', $src, $dest);
171 171
 	    			return 0;
172 172
 	    		}
173 173
 	    	}
Please login to merge, or discard this patch.