Passed
Push — master ( be8d41...df0ed3 )
by Alxarafe
23:14
created
dolibarr/htdocs/main.inc.php 1 patch
Spacing   +293 added lines, -293 removed lines patch added patch discarded remove patch
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
         $inj += preg_match('/insert\s+into/i', $val);
102 102
         $inj += preg_match('/select\s+from/i', $val);
103 103
         $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val);
104
-        $inj += preg_match('/user\s*\(/i', $val);      // avoid to use function user() that return current database login
105
-        $inj += preg_match('/information_schema/i', $val);    // avoid to use request that read information_schema database
104
+        $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login
105
+        $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database
106 106
     }
107 107
     if ($type == 3) {
108 108
         $inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val);
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
         $inj += preg_match('/<style/i', $val);
127 127
     }
128 128
     $inj += preg_match('/base[\s]+href/si', $val);
129
-    $inj += preg_match('/<.*onmouse/si', $val);       // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)>
130
-    $inj += preg_match('/onerror\s*=/i', $val);       // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)>
131
-    $inj += preg_match('/onfocus\s*=/i', $val);       // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)>
132
-    $inj += preg_match('/onload\s*=/i', $val);        // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)>
133
-    $inj += preg_match('/onloadstart\s*=/i', $val);   // onload can be set on audio tag <audio onloadstart=alert(1)>
134
-    $inj += preg_match('/onclick\s*=/i', $val);       // onclick can be set on img text html tag like <img onclick = alert(1)>
135
-    $inj += preg_match('/onscroll\s*=/i', $val);      // onscroll can be on textarea
129
+    $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)>
130
+    $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)>
131
+    $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)>
132
+    $inj += preg_match('/onload\s*=/i', $val); // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)>
133
+    $inj += preg_match('/onloadstart\s*=/i', $val); // onload can be set on audio tag <audio onloadstart=alert(1)>
134
+    $inj += preg_match('/onclick\s*=/i', $val); // onclick can be set on img text html tag like <img onclick = alert(1)>
135
+    $inj += preg_match('/onscroll\s*=/i', $val); // onscroll can be on textarea
136 136
     //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val);   // To lock event handlers onAbort(), ...
137
-    $inj += preg_match('/&#58;|&#0000058|&#x3A/i', $val);  // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...'
137
+    $inj += preg_match('/&#58;|&#0000058|&#x3A/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...'
138 138
     //if ($type == 1)
139 139
     //{
140 140
     $inj += preg_match('/javascript:/i', $val);
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
     //}
143 143
     // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param)
144 144
     if ($type == 1) {
145
-        $inj += preg_match('/"/i', $val);  // We refused " in GET parameters value
145
+        $inj += preg_match('/"/i', $val); // We refused " in GET parameters value
146 146
     }
147 147
     if ($type == 2) {
148
-        $inj += preg_match('/[;"]/', $val);  // PHP_SELF is a file system path. It can contains spaces.
148
+        $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces.
149 149
     }
150 150
     return $inj;
151 151
 }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             if (analyseVarsForSqlAndScriptsInjection($key, $type) && analyseVarsForSqlAndScriptsInjection($value, $type)) {
165 165
                 //$var[$key] = $value;	// This is useless
166 166
             } else {
167
-                print 'Access refused by SQL/Script injection protection in main.inc.php (type=' . htmlentities($type) . ' key=' . htmlentities($key) . ' value=' . htmlentities($value) . ' page=' . htmlentities($_SERVER["REQUEST_URI"]) . ')';
167
+                print 'Access refused by SQL/Script injection protection in main.inc.php (type='.htmlentities($type).' key='.htmlentities($key).' value='.htmlentities($value).' page='.htmlentities($_SERVER["REQUEST_URI"]).')';
168 168
                 exit;
169 169
             }
170 170
         }
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 
199 199
 // This is to make Dolibarr working with Plesk
200 200
 if (!empty($_SERVER['DOCUMENT_ROOT']) && substr($_SERVER['DOCUMENT_ROOT'], -6) !== 'htdocs') {
201
-    set_include_path($_SERVER['DOCUMENT_ROOT'] . '/htdocs');
201
+    set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
202 202
 }
203 203
 
204 204
 // Include the conf.php and functions.lib.php
205
-require_once DOL_BASE_PATH . '/filefunc.inc.php';
205
+require_once DOL_BASE_PATH.'/filefunc.inc.php';
206 206
 
207 207
 // If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it.
208 208
 // This is used for example by form of boxes to save personalization of some options.
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     $tmplist = explode(',', $tmpautoset[1]);
213 213
     $cookiearrayvalue = array();
214 214
     foreach ($tmplist as $tmpkey) {
215
-        $postkey = $tmpautoset[0] . '_' . $tmpkey;
215
+        $postkey = $tmpautoset[0].'_'.$tmpkey;
216 216
         //var_dump('tmpkey='.$tmpkey.' postkey='.$postkey.' value='.$_POST[$postkey]);
217 217
         if (!empty($_POST[$postkey]))
218 218
             $cookiearrayvalue[$tmpkey] = $_POST[$postkey];
@@ -230,12 +230,12 @@  discard block
 block discarded – undo
230 230
 // Note: the function dol_getprefix may have been redefined to return a different key to manage another area to protect.
231 231
 $prefix = dol_getprefix('');
232 232
 
233
-$sessionname = 'DOLSESSID_' . $prefix;
234
-$sessiontimeout = 'DOLSESSTIMEOUT_' . $prefix;
233
+$sessionname = 'DOLSESSID_'.$prefix;
234
+$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
235 235
 if (!empty($_COOKIE[$sessiontimeout]))
236 236
     ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]);
237 237
 session_name($sessionname);
238
-session_set_cookie_params(0, '/', null, false, true);   // Add tag httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
238
+session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
239 239
 // This create lock, released when session_write_close() or end of page.
240 240
 // We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished.
241 241
 if (!defined('NOSESSION')) {
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     $conf->browser->name = $tmp['browsername'];
262 262
     $conf->browser->os = $tmp['browseros'];
263 263
     $conf->browser->version = $tmp['browserversion'];
264
-    $conf->browser->layout = $tmp['layout'];     // 'classic', 'phone', 'tablet'
264
+    $conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet'
265 265
     //var_dump($conf->browser);
266 266
 
267 267
     if ($conf->browser->layout == 'phone')
@@ -280,16 +280,16 @@  discard block
 block discarded – undo
280 280
                 $newurl = preg_replace('/^http:/i', 'https:', $_SERVER["SCRIPT_URI"]);
281 281
             }
282 282
         } else { // Check HTTPS environment variable (Apache/mod_ssl only)
283
-            $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT) . $_SERVER["REQUEST_URI"];
283
+            $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"];
284 284
         }
285 285
     } else {
286 286
         // Check HTTPS environment variable (Apache/mod_ssl only)
287
-        $newurl = $conf->file->main_force_https . $_SERVER["REQUEST_URI"];
287
+        $newurl = $conf->file->main_force_https.$_SERVER["REQUEST_URI"];
288 288
     }
289 289
     // Start redirect
290 290
     if ($newurl) {
291
-        dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to " . $newurl);
292
-        header("Location: " . $newurl);
291
+        dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl);
292
+        header("Location: ".$newurl);
293 293
         exit;
294 294
     } else {
295 295
         dol_syslog("main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING);
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 
315 315
 // Loading of additional presentation includes
316 316
 if (!defined('NOREQUIREHTML'))
317
-    require_once DOL_BASE_PATH . '/core/class/html.form.class.php';     // Need 660ko memory (800ko in 2.2)
317
+    require_once DOL_BASE_PATH.'/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2)
318 318
 if (!defined('NOREQUIREAJAX') && $conf->use_javascript_ajax)
319
-    require_once DOL_BASE_PATH . '/core/lib/ajax.lib.php'; // Need 22ko memory
319
+    require_once DOL_BASE_PATH.'/core/lib/ajax.lib.php'; // Need 22ko memory
320 320
 
321 321
 
322 322
 
@@ -333,19 +333,19 @@  discard block
 block discarded – undo
333 333
 // If install or upgrade process not done or not completely finished, we call the install page.
334 334
 if (!empty($conf->global->MAIN_NOT_INSTALLED) || !empty($conf->global->MAIN_NOT_UPGRADED)) {
335 335
     dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING);
336
-    header("Location: " . DOL_BASE_URI . "/install/index.php");
336
+    header("Location: ".DOL_BASE_URI."/install/index.php");
337 337
     exit;
338 338
 }
339 339
 // If an upgrade process is required, we call the install page.
340 340
 if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION)) || (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && !empty($conf->global->MAIN_VERSION_LAST_INSTALL) && ($conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) {
341 341
     $versiontocompare = empty($conf->global->MAIN_VERSION_LAST_UPGRADE) ? $conf->global->MAIN_VERSION_LAST_INSTALL : $conf->global->MAIN_VERSION_LAST_UPGRADE;
342
-    require_once DOL_BASE_PATH . '/core/lib/admin.lib.php';
342
+    require_once DOL_BASE_PATH.'/core/lib/admin.lib.php';
343 343
     $dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare);
344 344
     $dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION);
345 345
     $rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade);
346 346
     if ($rescomp > 0) {   // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades
347
-        dol_syslog("main.inc: database version " . $versiontocompare . " is lower than programs version " . DOL_VERSION . ". Redirect to install page.", LOG_WARNING);
348
-        header("Location: " . DOL_BASE_URI . "/install/index.php");
347
+        dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING);
348
+        header("Location: ".DOL_BASE_URI."/install/index.php");
349 349
         exit;
350 350
     }
351 351
 }
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     }
369 369
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {  // This test must be after loading $_SESSION['token'].
370 370
         if (GETPOST('token', 'alpha') != $_SESSION['token']) {
371
-            dol_syslog("Invalid token in " . $_SERVER['HTTP_REFERER'] . ", action=" . GETPOST('action', 'aZ09') . ", _POST['token']=" . GETPOST('token', 'alpha') . ", _SESSION['token']=" . $_SESSION['token'], LOG_WARNING);
371
+            dol_syslog("Invalid token in ".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING);
372 372
             //print 'Unset POST by CSRF protection in main.inc.php.';	// Do not output anything because this create problems when using the BACK button on browsers.
373 373
             unset($_POST);
374 374
         }
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
     $test = true;
429 429
     if (!isset($_SESSION["dol_login"])) {
430 430
         // It is not already authenticated and it requests the login / password
431
-        include_once DOL_BASE_PATH . '/core/lib/security2.lib.php';
431
+        include_once DOL_BASE_PATH.'/core/lib/security2.lib.php';
432 432
 
433 433
         $dol_dst_observed = GETPOST("dst_observed", 'int', 3);
434 434
         $dol_dst_first = GETPOST("dst_first", 'int', 3);
@@ -442,17 +442,17 @@  discard block
 block discarded – undo
442 442
         $dol_use_jmobile = GETPOST('dol_use_jmobile', 'int', 3);
443 443
         //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,','));
444 444
         // If in demo mode, we check we go to home page through the public/demo/index.php page
445
-        if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI . '/index.php') {  // We ask index page
445
+        if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI.'/index.php') {  // We ask index page
446 446
             if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/public/', $_SERVER['HTTP_REFERER'])) {
447
-                dol_syslog("Call index page from another url than demo page (call is done from page " . $_SERVER['HTTP_REFERER'] . ")");
447
+                dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")");
448 448
                 $url = '';
449
-                $url .= ($url ? '&' : '') . ($dol_hide_topmenu ? 'dol_hide_topmenu=' . $dol_hide_topmenu : '');
450
-                $url .= ($url ? '&' : '') . ($dol_hide_leftmenu ? 'dol_hide_leftmenu=' . $dol_hide_leftmenu : '');
451
-                $url .= ($url ? '&' : '') . ($dol_optimize_smallscreen ? 'dol_optimize_smallscreen=' . $dol_optimize_smallscreen : '');
452
-                $url .= ($url ? '&' : '') . ($dol_no_mouse_hover ? 'dol_no_mouse_hover=' . $dol_no_mouse_hover : '');
453
-                $url .= ($url ? '&' : '') . ($dol_use_jmobile ? 'dol_use_jmobile=' . $dol_use_jmobile : '');
454
-                $url = DOL_BASE_URI . '/public/demo/index.php' . ($url ? '?' . $url : '');
455
-                header("Location: " . $url);
449
+                $url .= ($url ? '&' : '').($dol_hide_topmenu ? 'dol_hide_topmenu='.$dol_hide_topmenu : '');
450
+                $url .= ($url ? '&' : '').($dol_hide_leftmenu ? 'dol_hide_leftmenu='.$dol_hide_leftmenu : '');
451
+                $url .= ($url ? '&' : '').($dol_optimize_smallscreen ? 'dol_optimize_smallscreen='.$dol_optimize_smallscreen : '');
452
+                $url .= ($url ? '&' : '').($dol_no_mouse_hover ? 'dol_no_mouse_hover='.$dol_no_mouse_hover : '');
453
+                $url .= ($url ? '&' : '').($dol_use_jmobile ? 'dol_use_jmobile='.$dol_use_jmobile : '');
454
+                $url = DOL_BASE_URI.'/public/demo/index.php'.($url ? '?'.$url : '');
455
+                header("Location: ".$url);
456 456
                 exit;
457 457
             }
458 458
         }
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
                 $test = false;
473 473
 
474 474
                 // Call trigger for the "security events" log
475
-                $user->trigger_mesg = 'ErrorBadValueForCode - login=' . GETPOST("username", "alpha", 2);
475
+                $user->trigger_mesg = 'ErrorBadValueForCode - login='.GETPOST("username", "alpha", 2);
476 476
                 // Call of triggers
477
-                include_once DOL_BASE_PATH . '/core/class/interfaces.class.php';
477
+                include_once DOL_BASE_PATH.'/core/class/interfaces.class.php';
478 478
                 $interface = new Interfaces($db);
479 479
                 $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf);
480 480
                 if ($result < 0) {
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
                 $action = '';
486 486
                 $hookmanager->initHooks(array('login'));
487 487
                 $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
488
-                $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action);    // Note that $action and $object may have been modified by some hooks
488
+                $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
489 489
                 if ($reshook < 0)
490 490
                     $error++;
491 491
 
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
             $goontestloop = true;
511 511
 
512 512
         if (!is_object($langs)) { // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages.
513
-            include_once DOL_BASE_PATH . '/core/class/translate.class.php';
513
+            include_once DOL_BASE_PATH.'/core/class/translate.class.php';
514 514
             $langs = new Translate("", $conf);
515 515
             $langcode = (GETPOST('lang', 'aZ09', 1) ? GETPOST('lang', 'aZ09', 1) : (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT));
516 516
             if (defined('MAIN_LANG_DEFAULT'))
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
                 $dol_tz_string = preg_replace('/\s/', '_', $dol_tz_string);
533 533
                 $dol_dst = 0;
534 534
                 if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) {
535
-                    include_once DOL_BASE_PATH . '/core/lib/date.lib.php';
535
+                    include_once DOL_BASE_PATH.'/core/lib/date.lib.php';
536 536
                     $datenow = dol_now();
537 537
                     $datefirst = dol_stringtotime($_POST["dst_first"]);
538 538
                     $datesecond = dol_stringtotime($_POST["dst_second"]);
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
                     $_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword");
554 554
 
555 555
                 // Call trigger for the "security events" log
556
-                $user->trigger_mesg = $langs->trans("ErrorBadLoginPassword") . ' - login=' . GETPOST("username", "alpha", 2);
556
+                $user->trigger_mesg = $langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username", "alpha", 2);
557 557
                 // Call of triggers
558
-                include_once DOL_BASE_PATH . '/core/class/interfaces.class.php';
558
+                include_once DOL_BASE_PATH.'/core/class/interfaces.class.php';
559 559
                 $interface = new Interfaces($db);
560 560
                 $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf, GETPOST("username", "alpha", 2));
561 561
                 if ($result < 0) {
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
                 $action = '';
567 567
                 $hookmanager->initHooks(array('login'));
568 568
                 $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
569
-                $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action);    // Note that $action and $object may have been modified by some hooks
569
+                $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
570 570
                 if ($reshook < 0)
571 571
                     $error++;
572 572
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         // End test login / passwords
578 578
         if (!$login || (in_array('ldap', $authmode) && empty($passwordtotest))) { // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success.
579 579
             // No data to test login, so we show the login page
580
-            dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . " showing the login form and exit");
580
+            dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." showing the login form and exit");
581 581
             if (defined('NOREDIRECTBYMAINTOLOGIN'))
582 582
                 return 'ERROR_NOT_LOGGED';
583 583
             else
@@ -590,8 +590,8 @@  discard block
 block discarded – undo
590 590
             dol_syslog('User not found, connexion refused');
591 591
             session_destroy();
592 592
             session_name($sessionname);
593
-            session_set_cookie_params(0, '/', null, false, true);   // Add tag httponly on session cookie
594
-            session_start();    // Fixing the bug of register_globals here is useless since session is empty
593
+            session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
594
+            session_start(); // Fixing the bug of register_globals here is useless since session is empty
595 595
 
596 596
             if ($resultFetchUser == 0) {
597 597
                 // Load translation files required by page
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
                 $_SESSION["dol_loginmesg"] = $langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login);
601 601
 
602
-                $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login;
602
+                $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
603 603
             }
604 604
             if ($resultFetchUser < 0) {
605 605
                 $_SESSION["dol_loginmesg"] = $user->error;
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
             }
609 609
 
610 610
             // Call triggers for the "security events" log
611
-            include_once DOL_BASE_PATH . '/core/class/interfaces.class.php';
611
+            include_once DOL_BASE_PATH.'/core/class/interfaces.class.php';
612 612
             $interface = new Interfaces($db);
613 613
             $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf);
614 614
             if ($result < 0) {
@@ -619,18 +619,18 @@  discard block
 block discarded – undo
619 619
             $action = '';
620 620
             $hookmanager->initHooks(array('login'));
621 621
             $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
622
-            $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action);    // Note that $action and $object may have been modified by some hooks
622
+            $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
623 623
             if ($reshook < 0)
624 624
                 $error++;
625 625
 
626 626
             $paramsurl = array();
627 627
             if (GETPOST('textbrowser', 'int'))
628
-                $paramsurl[] = 'textbrowser=' . GETPOST('textbrowser', 'int');
628
+                $paramsurl[] = 'textbrowser='.GETPOST('textbrowser', 'int');
629 629
             if (GETPOST('nojs', 'int'))
630
-                $paramsurl[] = 'nojs=' . GETPOST('nojs', 'int');
630
+                $paramsurl[] = 'nojs='.GETPOST('nojs', 'int');
631 631
             if (GETPOST('lang', 'aZ09'))
632
-                $paramsurl[] = 'lang=' . GETPOST('lang', 'aZ09');
633
-            header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : ''));
632
+                $paramsurl[] = 'lang='.GETPOST('lang', 'aZ09');
633
+            header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
634 634
             exit;
635 635
         }
636 636
     }
@@ -638,16 +638,16 @@  discard block
 block discarded – undo
638 638
         // We are already into an authenticated session
639 639
         $login = $_SESSION["dol_login"];
640 640
         $entity = $_SESSION["dol_entity"];
641
-        dol_syslog("- This is an already logged session. _SESSION['dol_login']=" . $login . " _SESSION['dol_entity']=" . $entity, LOG_DEBUG);
641
+        dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);
642 642
 
643 643
         $resultFetchUser = $user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1));
644 644
         if ($resultFetchUser <= 0) {
645 645
             // Account has been removed after login
646
-            dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=" . $login, LOG_WARNING);
646
+            dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING);
647 647
             session_destroy();
648 648
             session_name($sessionname);
649
-            session_set_cookie_params(0, '/', null, false, true);   // Add tag httponly on session cookie
650
-            session_start();    // Fixing the bug of register_globals here is useless since session is empty
649
+            session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
650
+            session_start(); // Fixing the bug of register_globals here is useless since session is empty
651 651
 
652 652
             if ($resultFetchUser == 0) {
653 653
                 // Load translation files required by page
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 
656 656
                 $_SESSION["dol_loginmesg"] = $langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login);
657 657
 
658
-                $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login;
658
+                $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
659 659
             }
660 660
             if ($resultFetchUser < 0) {
661 661
                 $_SESSION["dol_loginmesg"] = $user->error;
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
             }
665 665
 
666 666
             // Call triggers for the "security events" log
667
-            include_once DOL_BASE_PATH . '/core/class/interfaces.class.php';
667
+            include_once DOL_BASE_PATH.'/core/class/interfaces.class.php';
668 668
             $interface = new Interfaces($db);
669 669
             $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf);
670 670
             if ($result < 0) {
@@ -675,18 +675,18 @@  discard block
 block discarded – undo
675 675
             $action = '';
676 676
             $hookmanager->initHooks(array('login'));
677 677
             $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
678
-            $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action);    // Note that $action and $object may have been modified by some hooks
678
+            $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
679 679
             if ($reshook < 0)
680 680
                 $error++;
681 681
 
682 682
             $paramsurl = array();
683 683
             if (GETPOST('textbrowser', 'int'))
684
-                $paramsurl[] = 'textbrowser=' . GETPOST('textbrowser', 'int');
684
+                $paramsurl[] = 'textbrowser='.GETPOST('textbrowser', 'int');
685 685
             if (GETPOST('nojs', 'int'))
686
-                $paramsurl[] = 'nojs=' . GETPOST('nojs', 'int');
686
+                $paramsurl[] = 'nojs='.GETPOST('nojs', 'int');
687 687
             if (GETPOST('lang', 'aZ09'))
688
-                $paramsurl[] = 'lang=' . GETPOST('lang', 'aZ09');
689
-            header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : ''));
688
+                $paramsurl[] = 'lang='.GETPOST('lang', 'aZ09');
689
+            header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
690 690
             exit;
691 691
         }
692 692
         else {
@@ -696,29 +696,29 @@  discard block
 block discarded – undo
696 696
             // Code for search criteria persistence.
697 697
             if (!empty($_GET['save_lastsearch_values'])) {    // We must use $_GET here
698 698
                 $relativepathstring = preg_replace('/\?.*$/', '', $_SERVER["HTTP_REFERER"]);
699
-                $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring);     // Get full path except host server
699
+                $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring); // Get full path except host server
700 700
                 // Clean $relativepathstring
701 701
                 if (constant('DOL_BASE_URI'))
702
-                    $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring);
702
+                    $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring);
703 703
                 $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
704 704
                 $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
705 705
                 //var_dump($relativepathstring);
706 706
                 // We click on a link that leave a page we have to save search criteria, contextpage, limit and page. We save them from tmp to no tmp
707
-                if (!empty($_SESSION['lastsearch_values_tmp_' . $relativepathstring])) {
708
-                    $_SESSION['lastsearch_values_' . $relativepathstring] = $_SESSION['lastsearch_values_tmp_' . $relativepathstring];
709
-                    unset($_SESSION['lastsearch_values_tmp_' . $relativepathstring]);
707
+                if (!empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring])) {
708
+                    $_SESSION['lastsearch_values_'.$relativepathstring] = $_SESSION['lastsearch_values_tmp_'.$relativepathstring];
709
+                    unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]);
710 710
                 }
711
-                if (!empty($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring])) {
712
-                    $_SESSION['lastsearch_contextpage_' . $relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring];
713
-                    unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]);
711
+                if (!empty($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring])) {
712
+                    $_SESSION['lastsearch_contextpage_'.$relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring];
713
+                    unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
714 714
                 }
715
-                if (!empty($_SESSION['lastsearch_page_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_page_tmp_' . $relativepathstring] > 1) {
716
-                    $_SESSION['lastsearch_page_' . $relativepathstring] = $_SESSION['lastsearch_page_tmp_' . $relativepathstring];
717
-                    unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]);
715
+                if (!empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 1) {
716
+                    $_SESSION['lastsearch_page_'.$relativepathstring] = $_SESSION['lastsearch_page_tmp_'.$relativepathstring];
717
+                    unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]);
718 718
                 }
719
-                if (!empty($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] != $conf->liste_limit) {
720
-                    $_SESSION['lastsearch_limit_' . $relativepathstring] = $_SESSION['lastsearch_limit_tmp_' . $relativepathstring];
721
-                    unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]);
719
+                if (!empty($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] != $conf->liste_limit) {
720
+                    $_SESSION['lastsearch_limit_'.$relativepathstring] = $_SESSION['lastsearch_limit_tmp_'.$relativepathstring];
721
+                    unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]);
722 722
                 }
723 723
             }
724 724
 
@@ -761,18 +761,18 @@  discard block
 block discarded – undo
761 761
         if (!empty($dol_use_jmobile))
762 762
             $_SESSION['dol_use_jmobile'] = $dol_use_jmobile;
763 763
 
764
-        dol_syslog("This is a new started user session. _SESSION['dol_login']=" . $_SESSION["dol_login"] . " Session id=" . session_id());
764
+        dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id());
765 765
 
766 766
         $db->begin();
767 767
 
768 768
         $user->update_last_login_date();
769 769
 
770
-        $loginfo = 'TZ=' . $_SESSION["dol_tz"] . ';TZString=' . $_SESSION["dol_tz_string"] . ';Screen=' . $_SESSION["dol_screenwidth"] . 'x' . $_SESSION["dol_screenheight"];
770
+        $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"];
771 771
 
772 772
         // Call triggers for the "security events" log
773 773
         $user->trigger_mesg = $loginfo;
774 774
         // Call triggers
775
-        include_once DOL_BASE_PATH . '/core/class/interfaces.class.php';
775
+        include_once DOL_BASE_PATH.'/core/class/interfaces.class.php';
776 776
         $interface = new Interfaces($db);
777 777
         $result = $interface->run_triggers('USER_LOGIN', $user, $user, $langs, $conf);
778 778
         if ($result < 0) {
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
         $action = '';
784 784
         $hookmanager->initHooks(array('login'));
785 785
         $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginfo' => $loginfo);
786
-        $reshook = $hookmanager->executeHooks('afterLogin', $parameters, $user, $action);    // Note that $action and $object may have been modified by some hooks
786
+        $reshook = $hookmanager->executeHooks('afterLogin', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
787 787
         if ($reshook < 0)
788 788
             $error++;
789 789
 
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
         if (!empty($landingpage)) {    // Example: /index.php
802 802
             $newpath = dol_buildpath($landingpage, 1);
803 803
             if ($_SERVER["PHP_SELF"] != $newpath) {   // not already on landing page (avoid infinite loop)
804
-                header('Location: ' . $newpath);
804
+                header('Location: '.$newpath);
805 805
                 exit;
806 806
             }
807 807
         }
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
     if (empty($conf->global->MAIN_FORCETHEME) && !empty($user->conf->MAIN_THEME)) {
845 845
         $conf->theme = $user->conf->MAIN_THEME;
846 846
         // $conf->css = "/theme/" . $conf->theme . "/style.css.php";
847
-        $conf->css = '?controller=theme/' . $conf->theme . '&method=style.css';
847
+        $conf->css = '?controller=theme/'.$conf->theme.'&method=style.css';
848 848
     }
849 849
 }
850 850
 
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 if (GETPOST('theme', 'alpha')) {
853 853
     $conf->theme = GETPOST('theme', 'alpha', 1);
854 854
     // $conf->css = "/theme/" . $conf->theme . "/style.css.php";
855
-    $conf->css = '?controller=theme/' . $conf->theme . '&method=style.css';
855
+    $conf->css = '?controller=theme/'.$conf->theme.'&method=style.css';
856 856
 }
857 857
 
858 858
 
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 if (!empty($conf->dol_use_jmobile) && in_array($conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) {
895 895
     $conf->theme = 'eldy';
896 896
     // $conf->css = "/theme/" . $conf->theme . "/style.css.php";
897
-    $conf->css = '?controller=theme/' . $conf->theme . '&method=style.css';
897
+    $conf->css = '?controller=theme/'.$conf->theme.'&method=style.css';
898 898
 }
899 899
 
900 900
 if (!defined('NOREQUIRETRAN')) {
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
 }
931 931
 
932 932
 
933
-dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . ' - action=' . GETPOST('action', 'az09') . ', massaction=' . GETPOST('massaction', 'az09'));
933
+dol_syslog("--- Access to ".$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'az09').', massaction='.GETPOST('massaction', 'az09'));
934 934
 //Another call for easy debugg
935 935
 //dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));
936 936
 // Load main languages files
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 // Define some constants used for style of arrays
943 943
 $bc = array(0 => 'class="impair"', 1 => 'class="pair"');
944 944
 $bcdd = array(0 => 'class="drag drop oddeven"', 1 => 'class="drag drop oddeven"');
945
-$bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"');  // Used for tr to add new lines
945
+$bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines
946 946
 $bctag = array(0 => 'class="impair tagtr"', 1 => 'class="pair tagtr"');
947 947
 
948 948
 // Define messages variables
@@ -990,19 +990,19 @@  discard block
 block discarded – undo
990 990
     // Load the menu manager (only if not already done)
991 991
     $file_menu = $conf->standard_menu;
992 992
     if (GETPOST('menu', 'alpha'))
993
-        $file_menu = GETPOST('menu', 'alpha');     // example: menu=eldy_menu.php
993
+        $file_menu = GETPOST('menu', 'alpha'); // example: menu=eldy_menu.php
994 994
     if (!class_exists('MenuManager')) {
995 995
         $menufound = 0;
996 996
         $dirmenus = array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']);
997 997
         foreach ($dirmenus as $dirmenu) {
998
-            $menufound = dol_include_once($dirmenu . "standard/" . $file_menu);
998
+            $menufound = dol_include_once($dirmenu."standard/".$file_menu);
999 999
             if (class_exists('MenuManager'))
1000 1000
                 break;
1001 1001
         }
1002 1002
         if (!class_exists('MenuManager')) { // If failed to include, we try with standard eldy_menu.php
1003
-            dol_syslog("You define a menu manager '" . $file_menu . "' that can not be loaded.", LOG_WARNING);
1003
+            dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
1004 1004
             $file_menu = 'eldy_menu.php';
1005
-            include_once DOL_DOCUMENT_ROOT . "/core/menus/standard/" . $file_menu;
1005
+            include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
1006 1006
         }
1007 1007
     }
1008 1008
     $menumanager = new MenuManager($db, empty($user->societe_id) ? 0 : 1);
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
         // html header
1041 1041
         top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
1042 1042
 
1043
-        print '<body id="mainbody"' . ($morecssonbody ? ' class="' . $morecssonbody . '"' : '') . '>' . "\n";
1043
+        print '<body id="mainbody"'.($morecssonbody ? ' class="'.$morecssonbody.'"' : '').'>'."\n";
1044 1044
 
1045 1045
         // top menu and left menu area
1046 1046
         if (empty($conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) {
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
         }
1049 1049
 
1050 1050
         if (empty($conf->dol_hide_leftmenu)) {
1051
-            left_menu('', $help_url, '', '', 1, $title, 1);  // $menumanager is retreived with a global $menumanager inside this function
1051
+            left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function
1052 1052
         }
1053 1053
 
1054 1054
         // main area
@@ -1072,13 +1072,13 @@  discard block
 block discarded – undo
1072 1072
     global $db, $conf, $hookmanager;
1073 1073
 
1074 1074
     if ($contenttype == 'text/html') {
1075
-        header("Content-Type: text/html; charset=" . $conf->file->character_set_client);
1075
+        header("Content-Type: text/html; charset=".$conf->file->character_set_client);
1076 1076
     } else {
1077
-        header("Content-Type: " . $contenttype);
1077
+        header("Content-Type: ".$contenttype);
1078 1078
     }
1079 1079
     // Security options
1080
-    header("X-Content-Type-Options: nosniff");  // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on)
1081
-    header("X-Frame-Options: SAMEORIGIN");      // Frames allowed only if on same domain (stop some XSS attacks)
1080
+    header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on)
1081
+    header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks)
1082 1082
     //header("X-XSS-Protection: 1");      		// XSS protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated.
1083 1083
     if (!defined('FORCECSP')) {
1084 1084
         //if (! isset($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY))
@@ -1095,11 +1095,11 @@  discard block
 block discarded – undo
1095 1095
         $hookmanager->initHooks("main");
1096 1096
 
1097 1097
         $parameters = array('contentsecuritypolicy' => $contentsecuritypolicy);
1098
-        $result = $hookmanager->executeHooks('setContentSecurityPolicy', $parameters);    // Note that $action and $object may have been modified by some hooks
1098
+        $result = $hookmanager->executeHooks('setContentSecurityPolicy', $parameters); // Note that $action and $object may have been modified by some hooks
1099 1099
         if ($result > 0) {
1100 1100
             $contentsecuritypolicy = $hookmanager->resPrint; // Replace CSP
1101 1101
         } else {
1102
-            $contentsecuritypolicy .= $hookmanager->resPrint;    // Concat CSP
1102
+            $contentsecuritypolicy .= $hookmanager->resPrint; // Concat CSP
1103 1103
         }
1104 1104
 
1105 1105
         if (!empty($contentsecuritypolicy)) {
@@ -1111,10 +1111,10 @@  discard block
 block discarded – undo
1111 1111
             // default-src 'self'; img-src *;
1112 1112
             // Pre-existing site that uses too much inline code to fix but wants to ensure resources are loaded only over https and disable plugins:
1113 1113
             // default-src http: https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'
1114
-            header("Content-Security-Policy: " . $contentsecuritypolicy);
1114
+            header("Content-Security-Policy: ".$contentsecuritypolicy);
1115 1115
         }
1116 1116
     } elseif (constant('FORCECSP')) {
1117
-        header("Content-Security-Policy: " . constant('FORCECSP'));
1117
+        header("Content-Security-Policy: ".constant('FORCECSP'));
1118 1118
     }
1119 1119
     if ($forcenocache) {
1120 1120
         header("Cache-Control: no-cache, no-store, must-revalidate, max-age=0");
@@ -1145,33 +1145,33 @@  discard block
 block discarded – undo
1145 1145
         // $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default
1146 1146
         $conf->css = '?controller=theme/eldy&method=style.css';
1147 1147
     }
1148
-    print '<!doctype html>' . "\n";
1148
+    print '<!doctype html>'."\n";
1149 1149
 
1150 1150
     if (!empty($conf->global->MAIN_USE_CACHE_MANIFEST))
1151
-        print '<html lang="' . substr($langs->defaultlang, 0, 2) . '" manifest="' . DOL_BASE_URI . '/cache.manifest">' . "\n";
1151
+        print '<html lang="'.substr($langs->defaultlang, 0, 2).'" manifest="'.DOL_BASE_URI.'/cache.manifest">'."\n";
1152 1152
     else
1153
-        print '<html lang="' . substr($langs->defaultlang, 0, 2) . '">' . "\n";
1153
+        print '<html lang="'.substr($langs->defaultlang, 0, 2).'">'."\n";
1154 1154
     //print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n";
1155 1155
     if (empty($disablehead)) {
1156
-        $ext = 'layout=' . $conf->browser->layout . '&version=' . urlencode(DOL_VERSION);
1156
+        $ext = 'layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION);
1157 1157
 
1158 1158
         print "<head>\n";
1159 1159
 
1160 1160
         if (GETPOST('dol_basehref', 'alpha'))
1161
-            print '<base href="' . dol_escape_htmltag(GETPOST('dol_basehref', 'alpha')) . '">' . "\n";
1161
+            print '<base href="'.dol_escape_htmltag(GETPOST('dol_basehref', 'alpha')).'">'."\n";
1162 1162
 
1163 1163
         // Displays meta
1164
-        print '<meta charset="UTF-8">' . "\n";
1165
-        print '<meta name="robots" content="noindex' . ($disablenofollow ? '' : ',nofollow') . '">' . "\n"; // Do not index
1166
-        print '<meta name="viewport" content="width=device-width, initial-scale=1.0">' . "\n";  // Scale for mobile device
1167
-        print '<meta name="author" content="Dolibarr Development Team">' . "\n";
1164
+        print '<meta charset="UTF-8">'."\n";
1165
+        print '<meta name="robots" content="noindex'.($disablenofollow ? '' : ',nofollow').'">'."\n"; // Do not index
1166
+        print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n"; // Scale for mobile device
1167
+        print '<meta name="author" content="Dolibarr Development Team">'."\n";
1168 1168
 
1169 1169
         // Favicon
1170
-        $favicon = dol_buildpath('/theme/' . $conf->theme . '/img/favicon.ico', 1);
1170
+        $favicon = dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1);
1171 1171
         if (!empty($conf->global->MAIN_FAVICON_URL))
1172 1172
             $favicon = $conf->global->MAIN_FAVICON_URL;
1173 1173
         if (empty($conf->dol_use_jmobile))
1174
-            print '<link rel="shortcut icon" type="image/x-icon" href="' . $favicon . '"/>' . "\n"; // Not required into an Android webview
1174
+            print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview
1175 1175
 
1176 1176
 
1177 1177
 
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
         //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n";
1191 1191
         // Auto refresh page
1192 1192
         if (GETPOST('autorefresh', 'int') > 0)
1193
-            print '<meta http-equiv="refresh" content="' . GETPOST('autorefresh', 'int') . '">';
1193
+            print '<meta http-equiv="refresh" content="'.GETPOST('autorefresh', 'int').'">';
1194 1194
 
1195 1195
         // Displays title
1196 1196
         $appli = constant('DOL_APPLICATION_TITLE');
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
         if ($title && !empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/', $conf->global->MAIN_HTML_TITLE))
1203 1203
             $titletoshow = dol_htmlentities($title);
1204 1204
         else if ($title)
1205
-            $titletoshow = dol_htmlentities($appli . ' - ' . $title);
1205
+            $titletoshow = dol_htmlentities($appli.' - '.$title);
1206 1206
         else
1207 1207
             $titletoshow = dol_htmlentities($appli);
1208 1208
 
@@ -1210,11 +1210,11 @@  discard block
 block discarded – undo
1210 1210
             $hookmanager = new HookManager($db);
1211 1211
         $hookmanager->initHooks("main");
1212 1212
         $parameters = array('title' => $titletoshow);
1213
-        $result = $hookmanager->executeHooks('setHtmlTitle', $parameters);  // Note that $action and $object may have been modified by some hooks
1213
+        $result = $hookmanager->executeHooks('setHtmlTitle', $parameters); // Note that $action and $object may have been modified by some hooks
1214 1214
         if ($result > 0)
1215
-            $titletoshow = $hookmanager->resPrint;    // Replace Title to show
1215
+            $titletoshow = $hookmanager->resPrint; // Replace Title to show
1216 1216
         else
1217
-            $titletoshow .= $hookmanager->resPrint;      // Concat to Title to show
1217
+            $titletoshow .= $hookmanager->resPrint; // Concat to Title to show
1218 1218
 
1219 1219
         print $titletoshow;
1220 1220
         print '</title>';
@@ -1222,64 +1222,64 @@  discard block
 block discarded – undo
1222 1222
         print "\n";
1223 1223
 
1224 1224
         if (GETPOST('version', 'int'))
1225
-            $ext = 'version=' . GETPOST('version', 'int'); // usefull to force no cache on css/js
1225
+            $ext = 'version='.GETPOST('version', 'int'); // usefull to force no cache on css/js
1226 1226
         if (GETPOST('testmenuhider', 'int') || !empty($conf->global->MAIN_TESTMENUHIDER))
1227
-            $ext .= '&testmenuhider=' . (GETPOST('testmenuhider', 'int') ? GETPOST('testmenuhider', 'int') : $conf->global->MAIN_TESTMENUHIDER);
1227
+            $ext .= '&testmenuhider='.(GETPOST('testmenuhider', 'int') ? GETPOST('testmenuhider', 'int') : $conf->global->MAIN_TESTMENUHIDER);
1228 1228
 
1229
-        $themeparam = '&lang=' . $langs->defaultlang . '&amp;theme=' . $conf->theme . (GETPOST('optioncss', 'aZ09') ? '&amp;optioncss=' . GETPOST('optioncss', 'aZ09', 1) : '') . '&amp;userid=' . $user->id . '&amp;entity=' . $conf->entity;
1230
-        $themeparam .= ($ext ? '&amp;' . $ext : '');
1229
+        $themeparam = '&lang='.$langs->defaultlang.'&amp;theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&amp;optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&amp;userid='.$user->id.'&amp;entity='.$conf->entity;
1230
+        $themeparam .= ($ext ? '&amp;'.$ext : '');
1231 1231
         if (!empty($_SESSION['dol_resetcache']))
1232
-            $themeparam .= '&amp;dol_resetcache=' . $_SESSION['dol_resetcache'];
1232
+            $themeparam .= '&amp;dol_resetcache='.$_SESSION['dol_resetcache'];
1233 1233
         if (GETPOST('dol_hide_topmenu', 'int')) {
1234
-            $themeparam .= '&amp;dol_hide_topmenu=' . GETPOST('dol_hide_topmenu', 'int');
1234
+            $themeparam .= '&amp;dol_hide_topmenu='.GETPOST('dol_hide_topmenu', 'int');
1235 1235
         }
1236 1236
         if (GETPOST('dol_hide_leftmenu', 'int')) {
1237
-            $themeparam .= '&amp;dol_hide_leftmenu=' . GETPOST('dol_hide_leftmenu', 'int');
1237
+            $themeparam .= '&amp;dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu', 'int');
1238 1238
         }
1239 1239
         if (GETPOST('dol_optimize_smallscreen', 'int')) {
1240
-            $themeparam .= '&amp;dol_optimize_smallscreen=' . GETPOST('dol_optimize_smallscreen', 'int');
1240
+            $themeparam .= '&amp;dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen', 'int');
1241 1241
         }
1242 1242
         if (GETPOST('dol_no_mouse_hover', 'int')) {
1243
-            $themeparam .= '&amp;dol_no_mouse_hover=' . GETPOST('dol_no_mouse_hover', 'int');
1243
+            $themeparam .= '&amp;dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover', 'int');
1244 1244
         }
1245 1245
         if (GETPOST('dol_use_jmobile', 'int')) {
1246
-            $themeparam .= '&amp;dol_use_jmobile=' . GETPOST('dol_use_jmobile', 'int');
1246
+            $themeparam .= '&amp;dol_use_jmobile='.GETPOST('dol_use_jmobile', 'int');
1247 1247
             $conf->dol_use_jmobile = GETPOST('dol_use_jmobile', 'int');
1248 1248
         }
1249 1249
 
1250 1250
         if (!defined('DISABLE_JQUERY') && !$disablejs && $conf->use_javascript_ajax) {
1251
-            print '<!-- Includes CSS for JQuery (Ajax library) -->' . "\n";
1251
+            print '<!-- Includes CSS for JQuery (Ajax library) -->'."\n";
1252 1252
             $jquerytheme = 'base';
1253 1253
             if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) {
1254 1254
                 $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
1255 1255
             }
1256 1256
             if (constant('JS_JQUERY_UI')) {
1257
-                print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n";  // JQuery
1257
+                print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery
1258 1258
             } else {
1259
-                print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n";    // JQuery
1259
+                print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery
1260 1260
             }
1261 1261
             if (!defined('DISABLE_JQUERY_JNOTIFY')) {
1262
-                print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n";          // JNotify
1262
+                print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // JNotify
1263 1263
             }
1264 1264
             if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) {     // jQuery plugin "mutiselect", "multiple-select", "select2"...
1265 1265
                 $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
1266
-                print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/includes/jquery/plugins/' . $tmpplugin . '/dist/css/' . $tmpplugin . '.css' . ($ext ? '?' . $ext : '') . '">' . "\n";
1266
+                print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css'.($ext ? '?'.$ext : '').'">'."\n";
1267 1267
             }
1268 1268
         }
1269 1269
 
1270 1270
         if (!defined('DISABLE_FONT_AWSOME')) {
1271
-            print '<!-- Includes CSS for font awesome -->' . "\n";
1272
-            print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/theme/common/fontawesome/css/font-awesome.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n";
1271
+            print '<!-- Includes CSS for font awesome -->'."\n";
1272
+            print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/theme/common/fontawesome/css/font-awesome.min.css'.($ext ? '?'.$ext : '').'">'."\n";
1273 1273
         }
1274 1274
 
1275
-        print '<!-- Includes CSS for Dolibarr theme -->' . "\n";
1275
+        print '<!-- Includes CSS for Dolibarr theme -->'."\n";
1276 1276
         // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php'
1277 1277
         $themepath = dol_buildpath($conf->css, 3);
1278 1278
         $themesubdir = '';
1279 1279
         if (!empty($conf->modules_parts['theme'])) { // This slow down
1280 1280
             foreach ($conf->modules_parts['theme'] as $reldir) {
1281
-                if (file_exists(dol_buildpath($reldir . $conf->css, 0))) {
1282
-                    $themepath = dol_buildpath($reldir . $conf->css, 1);
1281
+                if (file_exists(dol_buildpath($reldir.$conf->css, 0))) {
1282
+                    $themepath = dol_buildpath($reldir.$conf->css, 1);
1283 1283
                     $themesubdir = $reldir;
1284 1284
                     break;
1285 1285
                 }
@@ -1287,9 +1287,9 @@  discard block
 block discarded – undo
1287 1287
         }
1288 1288
 
1289 1289
         //print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
1290
-        print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n";
1290
+        print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n";
1291 1291
         if (!empty($conf->global->MAIN_FIX_FLASH_ON_CHROME))
1292
-            print '<!-- Includes CSS that does not exists as a workaround of flash bug of chrome -->' . "\n" . '<link rel="stylesheet" type="text/css" href="filethatdoesnotexiststosolvechromeflashbug">' . "\n";
1292
+            print '<!-- Includes CSS that does not exists as a workaround of flash bug of chrome -->'."\n".'<link rel="stylesheet" type="text/css" href="filethatdoesnotexiststosolvechromeflashbug">'."\n";
1293 1293
 
1294 1294
         // CSS forced by modules (relative url starting with /)
1295 1295
         if (!empty($conf->modules_parts['css'])) {
@@ -1298,121 +1298,121 @@  discard block
 block discarded – undo
1298 1298
                 $filescss = (array) $filescss; // To be sure filecss is an array
1299 1299
                 foreach ($filescss as $cssfile) {
1300 1300
                     if (empty($cssfile))
1301
-                        dol_syslog("Warning: module " . $modcss . " declared a css path file into its descriptor that is empty.", LOG_WARNING);
1301
+                        dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING);
1302 1302
                     // cssfile is a relative path
1303
-                    print '<!-- Includes CSS added by module ' . $modcss . ' -->' . "\n" . '<link rel="stylesheet" type="text/css" href="' . dol_buildpath($cssfile, 1);
1303
+                    print '<!-- Includes CSS added by module '.$modcss.' -->'."\n".'<link rel="stylesheet" type="text/css" href="'.dol_buildpath($cssfile, 1);
1304 1304
                     // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
1305 1305
                     if (!preg_match('/\.css$/i', $cssfile))
1306 1306
                         print $themeparam;
1307
-                    print '">' . "\n";
1307
+                    print '">'."\n";
1308 1308
                 }
1309 1309
             }
1310 1310
         }
1311 1311
         // CSS forced by page in top_htmlhead call (relative url starting with /)
1312 1312
         if (is_array($arrayofcss)) {
1313 1313
             foreach ($arrayofcss as $cssfile) {
1314
-                print '<!-- Includes CSS added by page -->' . "\n" . '<link rel="stylesheet" type="text/css" title="default" href="' . dol_buildpath($cssfile, 1);
1314
+                print '<!-- Includes CSS added by page -->'."\n".'<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile, 1);
1315 1315
                 // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters and browser cache is not used.
1316 1316
                 if (!preg_match('/\.css$/i', $cssfile))
1317 1317
                     print $themeparam;
1318
-                print '">' . "\n";
1318
+                print '">'."\n";
1319 1319
             }
1320 1320
         }
1321 1321
 
1322 1322
         // Output standard javascript links
1323 1323
         if (!defined('DISABLE_JQUERY') && !$disablejs && !empty($conf->use_javascript_ajax)) {
1324 1324
             // JQuery. Must be before other includes
1325
-            print '<!-- Includes JS for JQuery -->' . "\n";
1325
+            print '<!-- Includes JS for JQuery -->'."\n";
1326 1326
             if (defined('JS_JQUERY') && constant('JS_JQUERY')) {
1327
-                print '<script type="text/javascript" src="' . JS_JQUERY . 'jquery.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1327
+                print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1328 1328
             } else {
1329 1329
                 // print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1330
-                print '<script type="text/javascript" src="' . BASE_URI . '/vendor/components/jquery/jquery.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1330
+                print '<script type="text/javascript" src="'.BASE_URI.'/vendor/components/jquery/jquery.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1331 1331
             }
1332 1332
             if (!empty($conf->global->MAIN_FEATURES_LEVEL) && !defined('JS_JQUERY_MIGRATE_DISABLED')) {
1333 1333
                 if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) {
1334
-                    print '<script type="text/javascript" src="' . JS_JQUERY_MIGRATE . 'jquery-migrate.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1334
+                    print '<script type="text/javascript" src="'.JS_JQUERY_MIGRATE.'jquery-migrate.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1335 1335
                 } else {
1336 1336
                     // print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery-migrate.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1337
-                    print '<script type="text/javascript" src="' . BASE_URI . '/vendor/components/jquery/jquery-migrate.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1337
+                    print '<script type="text/javascript" src="'.BASE_URI.'/vendor/components/jquery/jquery-migrate.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1338 1338
                 }
1339 1339
             }
1340 1340
             if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) {
1341
-                print '<script type="text/javascript" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1341
+                print '<script type="text/javascript" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1342 1342
             } else {
1343 1343
                 // print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1344
-                print '<script type="text/javascript" src="' . BASE_URI . '/vendor/components/jqueryui/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1344
+                print '<script type="text/javascript" src="'.BASE_URI.'/vendor/components/jqueryui/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1345 1345
             }
1346 1346
             if (!defined('DISABLE_JQUERY_TABLEDND')) {
1347
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/tablednd/jquery.tablednd.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1347
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1348 1348
             }
1349 1349
             // jQuery jnotify
1350 1350
             if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) {
1351
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jnotify/jquery.jnotify.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1351
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1352 1352
             }
1353 1353
             // Flot
1354 1354
             if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT')) {
1355 1355
                 if (constant('JS_JQUERY_FLOT')) {
1356
-                    print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1357
-                    print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.pie.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1358
-                    print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.stack.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1356
+                    print '<script type="text/javascript" src="'.JS_JQUERY_FLOT.'jquery.flot.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1357
+                    print '<script type="text/javascript" src="'.JS_JQUERY_FLOT.'jquery.flot.pie.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1358
+                    print '<script type="text/javascript" src="'.JS_JQUERY_FLOT.'jquery.flot.stack.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1359 1359
                 } else {
1360
-                    print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/flot/jquery.flot.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1361
-                    print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/flot/jquery.flot.pie.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1362
-                    print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/flot/jquery.flot.stack.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1360
+                    print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/flot/jquery.flot.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1361
+                    print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/flot/jquery.flot.pie.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1362
+                    print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/flot/jquery.flot.stack.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1363 1363
                 }
1364 1364
             }
1365 1365
             // jQuery jeditable
1366 1366
             if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE')) {
1367
-                print '<!-- JS to manage editInPlace feature -->' . "\n";
1368
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1369
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1370
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1371
-                print '<script type="text/javascript">' . "\n";
1372
-                print 'var urlSaveInPlace = \'' . DOL_BASE_URI . '/core/ajax/saveinplace.php\';' . "\n";
1373
-                print 'var urlLoadInPlace = \'' . DOL_BASE_URI . '/core/ajax/loadinplace.php\';' . "\n";
1374
-                print 'var tooltipInPlace = \'' . $langs->transnoentities('ClickToEdit') . '\';' . "\n"; // Added in title attribute of span
1375
-                print 'var placeholderInPlace = \'&nbsp;\';' . "\n"; // If we put another string than $langs->trans("ClickToEdit") here, nothing is shown. If we put empty string, there is error, Why ?
1376
-                print 'var cancelInPlace = \'' . $langs->trans('Cancel') . '\';' . "\n";
1377
-                print 'var submitInPlace = \'' . $langs->trans('Ok') . '\';' . "\n";
1378
-                print 'var indicatorInPlace = \'<img src="' . DOL_BASE_URI . "/theme/" . $conf->theme . "/img/working.gif" . '">\';' . "\n";
1379
-                print 'var withInPlace = 300;';  // width in pixel for default string edit
1380
-                print '</script>' . "\n";
1381
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/core/js/editinplace.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1382
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1367
+                print '<!-- JS to manage editInPlace feature -->'."\n";
1368
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1369
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1370
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1371
+                print '<script type="text/javascript">'."\n";
1372
+                print 'var urlSaveInPlace = \''.DOL_BASE_URI.'/core/ajax/saveinplace.php\';'."\n";
1373
+                print 'var urlLoadInPlace = \''.DOL_BASE_URI.'/core/ajax/loadinplace.php\';'."\n";
1374
+                print 'var tooltipInPlace = \''.$langs->transnoentities('ClickToEdit').'\';'."\n"; // Added in title attribute of span
1375
+                print 'var placeholderInPlace = \'&nbsp;\';'."\n"; // If we put another string than $langs->trans("ClickToEdit") here, nothing is shown. If we put empty string, there is error, Why ?
1376
+                print 'var cancelInPlace = \''.$langs->trans('Cancel').'\';'."\n";
1377
+                print 'var submitInPlace = \''.$langs->trans('Ok').'\';'."\n";
1378
+                print 'var indicatorInPlace = \'<img src="'.DOL_BASE_URI."/theme/".$conf->theme."/img/working.gif".'">\';'."\n";
1379
+                print 'var withInPlace = 300;'; // width in pixel for default string edit
1380
+                print '</script>'."\n";
1381
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/core/js/editinplace.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1382
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1383 1383
             }
1384 1384
             // jQuery Timepicker
1385 1385
             if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) {
1386 1386
                 // print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1387
-                print '<script type="text/javascript" src="' . BASE_URI . '/vendor/components/jqueryui/ui/widgets/timepicker.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1388
-                print '<script type="text/javascript" src="' . BASE_PATH . '?controller=core/js/&method=timepicker.js&lang=' . $langs->defaultlang . ($ext ? '&amp;' . $ext : '') . '"></script>' . "\n";
1387
+                print '<script type="text/javascript" src="'.BASE_URI.'/vendor/components/jqueryui/ui/widgets/timepicker.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1388
+                print '<script type="text/javascript" src="'.BASE_PATH.'?controller=core/js/&method=timepicker.js&lang='.$langs->defaultlang.($ext ? '&amp;'.$ext : '').'"></script>'."\n";
1389 1389
             }
1390 1390
             if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) {     // jQuery plugin "mutiselect", "multiple-select", "select2", ...
1391 1391
                 $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
1392
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/' . $tmpplugin . '/dist/js/' . $tmpplugin . '.full.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; // We include full because we need the support of containerCssClass
1392
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; // We include full because we need the support of containerCssClass
1393 1393
             }
1394 1394
             if (!defined('DISABLE_MULTISELECT')) {     // jQuery plugin "mutiselect" to select with checkboxes
1395
-                print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/multiselect/jquery.multi-select.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1395
+                print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/multiselect/jquery.multi-select.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1396 1396
             }
1397 1397
         }
1398 1398
 
1399 1399
         if (!$disablejs && !empty($conf->use_javascript_ajax)) {
1400 1400
             // CKEditor
1401 1401
             if (!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) {
1402
-                print '<!-- Includes JS for CKEditor -->' . "\n";
1402
+                print '<!-- Includes JS for CKEditor -->'."\n";
1403 1403
                 // $pathckeditor = DOL_BASE_URI . '/includes/ckeditor/ckeditor/';
1404
-                $pathckeditor = BASE_URI . '/vendor/ckeditor/ckeditor/';
1404
+                $pathckeditor = BASE_URI.'/vendor/ckeditor/ckeditor/';
1405 1405
                 $jsckeditor = 'ckeditor.js';
1406 1406
                 if (constant('JS_CKEDITOR')) { // To use external ckeditor 4 js lib
1407 1407
                     $pathckeditor = constant('JS_CKEDITOR');
1408 1408
                 }
1409 1409
                 print '<script type="text/javascript">';
1410
-                print 'var CKEDITOR_BASEPATH = \'' . $pathckeditor . '\';' . "\n";
1411
-                print 'var ckeditorConfig = \'' . dol_buildpath($themesubdir . '/theme/' . $conf->theme . '/ckeditor/config.js' . ($ext ? '?' . $ext : ''), 1) . '\';' . "\n";  // $themesubdir='' in standard usage
1412
-                print 'var ckeditorFilebrowserBrowseUrl = \'' . DOL_BASE_URI . '/core/filemanagerdol/browser/default/browser.php?Connector=' . DOL_BASE_URI . '/core/filemanagerdol/connectors/php/connector.php\';' . "\n";
1413
-                print 'var ckeditorFilebrowserImageBrowseUrl = \'' . DOL_BASE_URI . '/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector=' . DOL_BASE_URI . '/core/filemanagerdol/connectors/php/connector.php\';' . "\n";
1414
-                print '</script>' . "\n";
1415
-                print '<script type="text/javascript" src="' . $pathckeditor . $jsckeditor . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1410
+                print 'var CKEDITOR_BASEPATH = \''.$pathckeditor.'\';'."\n";
1411
+                print 'var ckeditorConfig = \''.dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js'.($ext ? '?'.$ext : ''), 1).'\';'."\n"; // $themesubdir='' in standard usage
1412
+                print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_BASE_URI.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_BASE_URI.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
1413
+                print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_BASE_URI.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_BASE_URI.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
1414
+                print '</script>'."\n";
1415
+                print '<script type="text/javascript" src="'.$pathckeditor.$jsckeditor.($ext ? '?'.$ext : '').'"></script>'."\n";
1416 1416
             }
1417 1417
 
1418 1418
             // Browser notifications
@@ -1423,16 +1423,16 @@  discard block
 block discarded – undo
1423 1423
                 if ($conf->browser->layout == 'phone')
1424 1424
                     $enablebrowsernotif = false;
1425 1425
                 if ($enablebrowsernotif) {
1426
-                    print '<!-- Includes JS of Dolibarr (brwoser layout = ' . $conf->browser->layout . ')-->' . "\n";
1426
+                    print '<!-- Includes JS of Dolibarr (brwoser layout = '.$conf->browser->layout.')-->'."\n";
1427 1427
                     //print '<script type="text/javascript" src="' . DOL_BASE_URI . '/core/js/lib_notification.js.php' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1428
-                    print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_notification.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n";
1428
+                    print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_notification.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
1429 1429
                 }
1430 1430
             }
1431 1431
 
1432 1432
             // Global js function
1433
-            print '<!-- Includes JS of Dolibarr -->' . "\n";
1433
+            print '<!-- Includes JS of Dolibarr -->'."\n";
1434 1434
             //print '<script type="text/javascript" src="' . DOL_BASE_URI . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n";
1435
-            print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_head.js&lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n";
1435
+            print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_head.js&lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n";
1436 1436
 
1437 1437
             // JS forced by modules (relative url starting with /)
1438 1438
             if (!empty($conf->modules_parts['js'])) {  // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))
@@ -1441,27 +1441,27 @@  discard block
 block discarded – undo
1441 1441
                     $filesjs = (array) $filesjs; // To be sure filejs is an array
1442 1442
                     foreach ($filesjs as $jsfile) {
1443 1443
                         // jsfile is a relative path
1444
-                        print '<!-- Include JS added by module ' . $modjs . '-->' . "\n" . '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n";
1444
+                        print '<!-- Include JS added by module '.$modjs.'-->'."\n".'<script type="text/javascript" src="'.dol_buildpath($jsfile, 1).'"></script>'."\n";
1445 1445
                     }
1446 1446
                 }
1447 1447
             }
1448 1448
             // JS forced by page in top_htmlhead (relative url starting with /)
1449 1449
             if (is_array($arrayofjs)) {
1450
-                print '<!-- Includes JS added by page -->' . "\n";
1450
+                print '<!-- Includes JS added by page -->'."\n";
1451 1451
                 foreach ($arrayofjs as $jsfile) {
1452 1452
                     if (preg_match('/^http/i', $jsfile)) {
1453
-                        print '<script type="text/javascript" src="' . $jsfile . '"></script>' . "\n";
1453
+                        print '<script type="text/javascript" src="'.$jsfile.'"></script>'."\n";
1454 1454
                     } else {
1455
-                        print '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n";
1455
+                        print '<script type="text/javascript" src="'.dol_buildpath($jsfile, 1).'"></script>'."\n";
1456 1456
                     }
1457 1457
                 }
1458 1458
             }
1459 1459
         }
1460 1460
 
1461 1461
         if (!empty($head))
1462
-            print $head . "\n";
1462
+            print $head."\n";
1463 1463
         if (!empty($conf->global->MAIN_HTML_HEADER))
1464
-            print $conf->global->MAIN_HTML_HEADER . "\n";
1464
+            print $conf->global->MAIN_HTML_HEADER."\n";
1465 1465
 
1466 1466
         print "<!-- Alixar debugBar header -->";
1467 1467
         print Debug::getRenderHeader(); // Includes Alixar debugBar header
@@ -1512,13 +1512,13 @@  discard block
 block discarded – undo
1512 1512
      * Top menu
1513 1513
      */
1514 1514
     if ((empty($conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) && (!defined('NOREQUIREMENU') || !constant('NOREQUIREMENU'))) {
1515
-        print "\n" . '<!-- Start top horizontal -->' . "\n";
1515
+        print "\n".'<!-- Start top horizontal -->'."\n";
1516 1516
 
1517
-        print '<div class="side-nav-vert' . (GETPOST('dol_invisible_topmenu', 'int') ? ' hidden' : '') . '"><div id="id-top">';  // dol_invisible_topmenu differs from dol_hide_topmenu: dol_invisible_topmenu means we output menu but we make it invisible.
1517
+        print '<div class="side-nav-vert'.(GETPOST('dol_invisible_topmenu', 'int') ? ' hidden' : '').'"><div id="id-top">'; // dol_invisible_topmenu differs from dol_hide_topmenu: dol_invisible_topmenu means we output menu but we make it invisible.
1518 1518
         // Show menu entries
1519
-        print '<div id="tmenu_tooltip' . (empty($conf->global->MAIN_MENU_INVERT) ? '' : 'invert') . '" class="tmenu">' . "\n";
1519
+        print '<div id="tmenu_tooltip'.(empty($conf->global->MAIN_MENU_INVERT) ? '' : 'invert').'" class="tmenu">'."\n";
1520 1520
         $menumanager->atarget = $target;
1521
-        $menumanager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks));      // This contains a \n
1521
+        $menumanager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks)); // This contains a \n
1522 1522
         print "</div>\n";
1523 1523
 
1524 1524
         // Define link to login card
@@ -1526,34 +1526,34 @@  discard block
 block discarded – undo
1526 1526
         if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
1527 1527
             $appli = $conf->global->MAIN_APPLICATION_TITLE;
1528 1528
             if (preg_match('/\d\.\d/', $appli)) {
1529
-                if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli))
1530
-                    $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core
1529
+                if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli))
1530
+                    $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
1531 1531
             } else
1532
-                $appli .= " " . DOL_VERSION;
1532
+                $appli .= " ".DOL_VERSION;
1533 1533
         } else
1534
-            $appli .= " " . DOL_VERSION;
1534
+            $appli .= " ".DOL_VERSION;
1535 1535
 
1536 1536
         if (!empty($conf->global->MAIN_FEATURES_LEVEL))
1537
-            $appli .= "<br>" . $langs->trans("LevelOfFeature") . ': ' . $conf->global->MAIN_FEATURES_LEVEL;
1537
+            $appli .= "<br>".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL;
1538 1538
 
1539 1539
         $logouttext = '';
1540 1540
         if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
1541 1541
             //$logouthtmltext=$appli.'<br>';
1542 1542
             if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') {
1543
-                $logouthtmltext .= $langs->trans("Logout") . '<br>';
1543
+                $logouthtmltext .= $langs->trans("Logout").'<br>';
1544 1544
 
1545 1545
                 //$logouttext .='<a accesskey="l" href="'.DOL_BASE_URI.'/user/logout.php">';
1546
-                $logouttext .= '<a accesskey="l" href="' . BASE_URI . '?controller=user&method=logout">';
1546
+                $logouttext .= '<a accesskey="l" href="'.BASE_URI.'?controller=user&method=logout">';
1547 1547
                 //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
1548 1548
                 $logouttext .= '<span class="fa fa-sign-out atoplogin"></span>';
1549 1549
                 $logouttext .= '</a>';
1550 1550
             } else {
1551 1551
                 $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]);
1552
-                $logouttext .= img_picto($langs->trans('Logout') . ":" . $langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
1552
+                $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
1553 1553
             }
1554 1554
         }
1555 1555
 
1556
-        print '<div class="login_block">' . "\n";
1556
+        print '<div class="login_block">'."\n";
1557 1557
 
1558 1558
         // Add login user link
1559 1559
         $toprightmenu .= '<div class="login_block_user">';
@@ -1564,18 +1564,18 @@  discard block
 block discarded – undo
1564 1564
         $toprightmenu .= $user->getNomUrl($mode, '', 1, 0, 11, 0, ($user->firstname ? 'firstname' : -1), 'atoplogin');
1565 1565
         $toprightmenu .= '</div></div>';
1566 1566
 
1567
-        $toprightmenu .= '</div>' . "\n";
1567
+        $toprightmenu .= '</div>'."\n";
1568 1568
 
1569 1569
         $toprightmenu .= '<div class="login_block_other">';
1570 1570
 
1571 1571
         // Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>')
1572 1572
         $parameters = array();
1573
-        $result = $hookmanager->executeHooks('printTopRightMenu', $parameters);    // Note that $action and $object may have been modified by some hooks
1573
+        $result = $hookmanager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks
1574 1574
         if (is_numeric($result)) {
1575 1575
             if ($result == 0)
1576
-                $toprightmenu .= $hookmanager->resPrint;  // add
1576
+                $toprightmenu .= $hookmanager->resPrint; // add
1577 1577
             else
1578
-                $toprightmenu = $hookmanager->resPrint;      // replace
1578
+                $toprightmenu = $hookmanager->resPrint; // replace
1579 1579
         }
1580 1580
         else {
1581 1581
             $toprightmenu .= $result; // For backward compatibility
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
         // Link to module builder
1585 1585
         if (!empty($conf->modulebuilder->enabled)) {
1586 1586
             //$text = '<a href="' . DOL_BASE_URI . '/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
1587
-            $text = '<a href="' . BASE_URI . '?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
1587
+            $text = '<a href="'.BASE_URI.'?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
1588 1588
             //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
1589 1589
             $text .= '<span class="fa fa-bug atoplogin"></span>';
1590 1590
             $text .= '</a>';
@@ -1598,11 +1598,11 @@  discard block
 block discarded – undo
1598 1598
             if (is_array($_POST)) {
1599 1599
                 foreach ($_POST as $key => $value) {
1600 1600
                     if ($key !== 'action' && $key !== 'password' && !is_array($value))
1601
-                        $qs .= '&' . $key . '=' . urlencode($value);
1601
+                        $qs .= '&'.$key.'='.urlencode($value);
1602 1602
                 }
1603 1603
             }
1604
-            $qs .= (($qs && $morequerystring) ? '&' : '') . $morequerystring;
1605
-            $text = '<a href="' . dol_escape_htmltag($_SERVER["PHP_SELF"]) . '?' . $qs . ($qs ? '&' : '') . 'optioncss=print" target="_blank">';
1604
+            $qs .= (($qs && $morequerystring) ? '&' : '').$morequerystring;
1605
+            $text = '<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs ? '&' : '').'optioncss=print" target="_blank">';
1606 1606
             //$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
1607 1607
             $text .= '<span class="fa fa-print atoplogin"></span>';
1608 1608
             $text .= '</a>';
@@ -1631,12 +1631,12 @@  discard block
 block discarded – undo
1631 1631
                 $text = '';
1632 1632
                 if (!empty($conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) {
1633 1633
                     $langs->load('admin');
1634
-                    $appli .= '<br>' . $langs->trans("Database") . ': ' . $db->database_name;
1634
+                    $appli .= '<br>'.$langs->trans("Database").': '.$db->database_name;
1635 1635
                 }
1636
-                $title = $appli . '<br>';
1636
+                $title = $appli.'<br>';
1637 1637
                 $title .= $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage');
1638 1638
                 if ($mode == 'wiki')
1639
-                    $title .= ' - ' . $langs->trans("PageWiki") . ' &quot;' . dol_escape_htmltag(strtr($helppage, '_', ' ')) . '&quot;';
1639
+                    $title .= ' - '.$langs->trans("PageWiki").' &quot;'.dol_escape_htmltag(strtr($helppage, '_', ' ')).'&quot;';
1640 1640
                 $text .= '<a class="help" target="_blank" rel="noopener" href="';
1641 1641
                 if ($mode == 'wiki')
1642 1642
                     $text .= sprintf($helpbaseurl, urlencode(html_entity_decode($helppage)));
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 
1661 1661
         print $toprightmenu;
1662 1662
 
1663
-        print "</div>\n";  // end div class="login_block"
1663
+        print "</div>\n"; // end div class="login_block"
1664 1664
 
1665 1665
         print '</div></div>';
1666 1666
 
@@ -1669,7 +1669,7 @@  discard block
 block discarded – undo
1669 1669
     }
1670 1670
 
1671 1671
     if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile))
1672
-        print '<!-- Begin div id-container --><div id="id-container" class="id-container' . ($morecss ? ' ' . $morecss : '') . '">';
1672
+        print '<!-- Begin div id-container --><div id="id-container" class="id-container'.($morecss ? ' '.$morecss : '').'">';
1673 1673
 }
1674 1674
 
1675 1675
 /**
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
         // Instantiate hooks of thirdparty module
1702 1702
         $hookmanager->initHooks(array('searchform', 'leftblock'));
1703 1703
 
1704
-        print "\n" . '<!-- Begin side-nav id-left -->' . "\n" . '<div class="side-nav"><div id="id-left">' . "\n";
1704
+        print "\n".'<!-- Begin side-nav id-left -->'."\n".'<div class="side-nav"><div id="id-left">'."\n";
1705 1705
 
1706 1706
         if ($conf->browser->layout == 'phone')
1707 1707
             $conf->global->MAIN_USE_OLD_SEARCH_FORM = 1; // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ?
@@ -1713,7 +1713,7 @@  discard block
 block discarded – undo
1713 1713
         }
1714 1714
         $selected = -1;
1715 1715
         $usedbyinclude = 1;
1716
-        include_once DOL_BASE_PATH . '/core/ajax/selectsearchbox.php'; // This set $arrayresult
1716
+        include_once DOL_BASE_PATH.'/core/ajax/selectsearchbox.php'; // This set $arrayresult
1717 1717
 
1718 1718
         if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
1719 1719
             //$searchform.=$form->selectArrayAjax('searchselectcombo', DOL_BASE_URI.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1);
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
         // Execute hook printSearchForm
1729 1729
         $parameters = array('searchform' => $searchform);
1730 1730
 
1731
-        $reshook = $hookmanager->executeHooks('printSearchForm', $parameters);    // Note that $action and $object may have been modified by some hooks
1731
+        $reshook = $hookmanager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks
1732 1732
         if (empty($reshook)) {
1733 1733
             $searchform .= $hookmanager->resPrint;
1734 1734
         } else
@@ -1736,10 +1736,10 @@  discard block
 block discarded – undo
1736 1736
 
1737 1737
         // Force special value for $searchform
1738 1738
         if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax)) {
1739
-            $urltosearch = DOL_BASE_URI . '/core/search_page.php?showtitlebefore=1';
1740
-            $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="' . $urltosearch . '" alt="' . dol_escape_htmltag($langs->trans("ShowSearchFields")) . '">' . $langs->trans("Search") . '...</a></div></div>';
1739
+            $urltosearch = DOL_BASE_URI.'/core/search_page.php?showtitlebefore=1';
1740
+            $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div></div>';
1741 1741
         } elseif ($conf->use_javascript_ajax && !empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
1742
-            $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="' . dol_escape_htmltag($langs->trans("ShowSearchFields")) . '">' . $langs->trans("Search") . '...</a></div><div id="divsearchforms2" style="display: none">' . $searchform . '</div>';
1742
+            $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div><div id="divsearchforms2" style="display: none">'.$searchform.'</div>';
1743 1743
             $searchform .= '<script type="text/javascript">
1744 1744
             	jQuery(document).ready(function () {
1745 1745
             		jQuery("#divsearchforms1").click(function(){
@@ -1752,16 +1752,16 @@  discard block
 block discarded – undo
1752 1752
 
1753 1753
         // Define $bookmarks
1754 1754
         if (!empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) {
1755
-            include_once DOL_BASE_PATH . '/bookmarks/bookmarks.lib.php';
1755
+            include_once DOL_BASE_PATH.'/bookmarks/bookmarks.lib.php';
1756 1756
             $langs->load("bookmarks");
1757 1757
 
1758 1758
             $bookmarks = printBookmarksList($db, $langs);
1759 1759
         }
1760 1760
 
1761 1761
         // Left column
1762
-        print '<!-- Begin left menu -->' . "\n";
1762
+        print '<!-- Begin left menu -->'."\n";
1763 1763
 
1764
-        print '<div class="vmenu"' . (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"') . '>' . "\n\n";
1764
+        print '<div class="vmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"').'>'."\n\n";
1765 1765
 
1766 1766
         // Show left menu with other forms
1767 1767
         $menumanager->menu_array = $menu_array_before;
@@ -1770,7 +1770,7 @@  discard block
 block discarded – undo
1770 1770
         // Dolibarr version + help + bug report link
1771 1771
         print "\n";
1772 1772
         print "<!-- Begin Help Block-->\n";
1773
-        print '<div id="blockvmenuhelp" class="blockvmenuhelp">' . "\n";
1773
+        print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n";
1774 1774
 
1775 1775
         // Version
1776 1776
         if (empty($conf->global->MAIN_HIDE_VERSION)) {    // Version is already on help picto and on login page.
@@ -1792,15 +1792,15 @@  discard block
 block discarded – undo
1792 1792
                 $appli = $conf->global->MAIN_APPLICATION_TITLE;
1793 1793
                 $doliurl = '';
1794 1794
                 if (preg_match('/\d\.\d/', $appli)) {
1795
-                    if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli))
1796
-                        $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core
1795
+                    if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli))
1796
+                        $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
1797 1797
                 } else
1798
-                    $appli .= " " . DOL_VERSION;
1798
+                    $appli .= " ".DOL_VERSION;
1799 1799
             } else
1800
-                $appli .= " " . DOL_VERSION;
1800
+                $appli .= " ".DOL_VERSION;
1801 1801
             print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">';
1802 1802
             if ($doliurl)
1803
-                print '<a class="help" target="_blank" rel="noopener" href="' . $doliurl . '">';
1803
+                print '<a class="help" target="_blank" rel="noopener" href="'.$doliurl.'">';
1804 1804
             else
1805 1805
                 print '<span class="help">';
1806 1806
             print $appli;
@@ -1808,12 +1808,12 @@  discard block
 block discarded – undo
1808 1808
                 print '</a>';
1809 1809
             else
1810 1810
                 print '</span>';
1811
-            print '</div>' . "\n";
1811
+            print '</div>'."\n";
1812 1812
         }
1813 1813
 
1814 1814
         // Link to bugtrack
1815 1815
         if (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) {
1816
-            require_once DOL_BASE_PATH . '/core/lib/functions2.lib.php';
1816
+            require_once DOL_BASE_PATH.'/core/lib/functions2.lib.php';
1817 1817
 
1818 1818
             $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new';
1819 1819
             $bugbaseurl .= '?title=';
@@ -1822,16 +1822,16 @@  discard block
 block discarded – undo
1822 1822
             $bugbaseurl .= urlencode("# Bug\n");
1823 1823
             $bugbaseurl .= urlencode("\n");
1824 1824
             $bugbaseurl .= urlencode("## Environment\n");
1825
-            $bugbaseurl .= urlencode("- **Version**: " . DOL_VERSION . "\n");
1826
-            $bugbaseurl .= urlencode("- **OS**: " . php_uname('s') . "\n");
1827
-            $bugbaseurl .= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n");
1828
-            $bugbaseurl .= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n");
1829
-            $bugbaseurl .= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n");
1830
-            $bugbaseurl .= urlencode("- **URL**: " . $_SERVER["REQUEST_URI"] . "\n");
1825
+            $bugbaseurl .= urlencode("- **Version**: ".DOL_VERSION."\n");
1826
+            $bugbaseurl .= urlencode("- **OS**: ".php_uname('s')."\n");
1827
+            $bugbaseurl .= urlencode("- **Web server**: ".$_SERVER["SERVER_SOFTWARE"]."\n");
1828
+            $bugbaseurl .= urlencode("- **PHP**: ".php_sapi_name().' '.phpversion()."\n");
1829
+            $bugbaseurl .= urlencode("- **Database**: ".$db::LABEL.' '.$db->getVersion()."\n");
1830
+            $bugbaseurl .= urlencode("- **URL**: ".$_SERVER["REQUEST_URI"]."\n");
1831 1831
             $bugbaseurl .= urlencode("\n");
1832 1832
             $bugbaseurl .= urlencode("## Report\n");
1833 1833
             print '<div id="blockvmenuhelpbugreport" class="blockvmenuhelp">';
1834
-            print '<a class="help" target="_blank" rel="noopener" href="' . $bugbaseurl . '">' . $langs->trans("FindBug") . '</a>';
1834
+            print '<a class="help" target="_blank" rel="noopener" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a>';
1835 1835
             print '</div>';
1836 1836
         }
1837 1837
 
@@ -1845,14 +1845,14 @@  discard block
 block discarded – undo
1845 1845
 
1846 1846
         // Execute hook printLeftBlock
1847 1847
         $parameters = array();
1848
-        $reshook = $hookmanager->executeHooks('printLeftBlock', $parameters);    // Note that $action and $object may have been modified by some hooks
1848
+        $reshook = $hookmanager->executeHooks('printLeftBlock', $parameters); // Note that $action and $object may have been modified by some hooks
1849 1849
         print $hookmanager->resPrint;
1850 1850
 
1851 1851
         print '</div></div> <!-- End side-nav id-left -->'; // End div id="side-nav" div id="id-left"
1852 1852
     }
1853 1853
 
1854 1854
     print "\n";
1855
-    print '<!-- Begin right area -->' . "\n";
1855
+    print '<!-- Begin right area -->'."\n";
1856 1856
 
1857 1857
     if (empty($leftmenuwithoutmainarea))
1858 1858
         main_area($title);
@@ -1873,7 +1873,7 @@  discard block
 block discarded – undo
1873 1873
 
1874 1874
     print "\n";
1875 1875
 
1876
-    print '<!-- Begin div class="fiche" -->' . "\n" . '<div class="fiche">' . "\n";
1876
+    print '<!-- Begin div class="fiche" -->'."\n".'<div class="fiche">'."\n";
1877 1877
 
1878 1878
     if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
1879 1879
         print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED));
@@ -1939,17 +1939,17 @@  discard block
 block discarded – undo
1939 1939
     global $conf, $langs, $user;
1940 1940
 
1941 1941
     $ret = '';
1942
-    $ret .= '<form action="' . $urlaction . '" method="post" class="searchform">';
1943
-    $ret .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
1942
+    $ret .= '<form action="'.$urlaction.'" method="post" class="searchform">';
1943
+    $ret .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
1944 1944
     $ret .= '<input type="hidden" name="mode" value="search">';
1945
-    $ret .= '<input type="hidden" name="savelogin" value="' . dol_escape_htmltag($user->login) . '">';
1945
+    $ret .= '<input type="hidden" name="savelogin" value="'.dol_escape_htmltag($user->login).'">';
1946 1946
     if ($showtitlebefore)
1947
-        $ret .= $title . ' ';
1948
-    $ret .= '<input type="text" class="flat ' . $htmlmorecss . '"';
1949
-    $ret .= ' style="text-indent: 22px; background-image: url(\'' . $img . '\'); background-repeat: no-repeat; background-position: 3px;"';
1950
-    $ret .= ($accesskey ? ' accesskey="' . $accesskey . '"' : '');
1951
-    $ret .= ' placeholder="' . strip_tags($title) . '"';
1952
-    $ret .= ' name="' . $htmlinputname . '" id="' . $prefhtmlinputname . $htmlinputname . '" />';
1947
+        $ret .= $title.' ';
1948
+    $ret .= '<input type="text" class="flat '.$htmlmorecss.'"';
1949
+    $ret .= ' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"';
1950
+    $ret .= ($accesskey ? ' accesskey="'.$accesskey.'"' : '');
1951
+    $ret .= ' placeholder="'.strip_tags($title).'"';
1952
+    $ret .= ' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />';
1953 1953
     //$ret.='<input type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px" value="'.$langs->trans("Go").'">';
1954 1954
     $ret .= '<button type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">';
1955 1955
     $ret .= '<span class="fa fa-search"></span>';
@@ -1975,7 +1975,7 @@  discard block
 block discarded – undo
1975 1975
         global $delayedhtmlcontent;
1976 1976
         global $contextpage, $page, $limit;
1977 1977
 
1978
-        $ext = 'layout=' . $conf->browser->layout . '&version=' . urlencode(DOL_VERSION);
1978
+        $ext = 'layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION);
1979 1979
 
1980 1980
         // Global html output events ($mesgs, $errors, $warnings)
1981 1981
         dol_htmloutput_events($disabledoutputofmessages);
@@ -1985,15 +1985,15 @@  discard block
 block discarded – undo
1985 1985
         if (is_object($user) && !empty($user->lastsearch_values_tmp) && is_array($user->lastsearch_values_tmp)) {
1986 1986
             // Clean and save data
1987 1987
             foreach ($user->lastsearch_values_tmp as $key => $val) {
1988
-                unset($_SESSION['lastsearch_values_tmp_' . $key]);   // Clean array to rebuild it just after
1988
+                unset($_SESSION['lastsearch_values_tmp_'.$key]); // Clean array to rebuild it just after
1989 1989
                 if (count($val) && empty($_POST['button_removefilter'])) { // If there is search criteria to save and we did not click on 'Clear filter' button
1990 1990
                     if (empty($val['sortfield']))
1991 1991
                         unset($val['sortfield']);
1992 1992
                     if (empty($val['sortorder']))
1993 1993
                         unset($val['sortorder']);
1994
-                    dol_syslog('Save lastsearch_values_tmp_' . $key . '=' . json_encode($val, 0) . " (systematic recording of last search criterias)");
1995
-                    $_SESSION['lastsearch_values_tmp_' . $key] = json_encode($val);
1996
-                    unset($_SESSION['lastsearch_values_' . $key]);
1994
+                    dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criterias)");
1995
+                    $_SESSION['lastsearch_values_tmp_'.$key] = json_encode($val);
1996
+                    unset($_SESSION['lastsearch_values_'.$key]);
1997 1997
                 }
1998 1998
             }
1999 1999
         }
@@ -2002,37 +2002,37 @@  discard block
 block discarded – undo
2002 2002
         $relativepathstring = $_SERVER["PHP_SELF"];
2003 2003
         // Clean $relativepathstring
2004 2004
         if (constant('DOL_BASE_URI'))
2005
-            $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring);
2005
+            $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring);
2006 2006
         $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
2007 2007
         $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
2008 2008
         if (preg_match('/list\.php$/', $relativepathstring)) {
2009
-            unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]);
2010
-            unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]);
2011
-            unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]);
2009
+            unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
2010
+            unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]);
2011
+            unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]);
2012 2012
 
2013 2013
             if (!empty($contextpage))
2014
-                $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring] = $contextpage;
2014
+                $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring] = $contextpage;
2015 2015
             if (!empty($page) && $page > 1)
2016
-                $_SESSION['lastsearch_page_tmp_' . $relativepathstring] = $page;
2016
+                $_SESSION['lastsearch_page_tmp_'.$relativepathstring] = $page;
2017 2017
             if (!empty($limit) && $limit != $conf->limit)
2018
-                $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] = $limit;
2018
+                $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] = $limit;
2019 2019
 
2020
-            unset($_SESSION['lastsearch_contextpage_' . $relativepathstring]);
2021
-            unset($_SESSION['lastsearch_page_' . $relativepathstring]);
2022
-            unset($_SESSION['lastsearch_limit_' . $relativepathstring]);
2020
+            unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]);
2021
+            unset($_SESSION['lastsearch_page_'.$relativepathstring]);
2022
+            unset($_SESSION['lastsearch_limit_'.$relativepathstring]);
2023 2023
         }
2024 2024
 
2025 2025
         // Core error message
2026 2026
         if (!empty($conf->global->MAIN_CORE_ERROR)) {
2027 2027
             // Ajax version
2028 2028
             if ($conf->use_javascript_ajax) {
2029
-                $title = img_warning() . ' ' . $langs->trans('CoreErrorTitle');
2029
+                $title = img_warning().' '.$langs->trans('CoreErrorTitle');
2030 2030
                 print ajax_dialog($title, $langs->trans('CoreErrorMessage'));
2031 2031
             }
2032 2032
             // html version
2033 2033
             else {
2034
-                $msg = img_warning() . ' ' . $langs->trans('CoreErrorMessage');
2035
-                print '<div class="error">' . $msg . '</div>';
2034
+                $msg = img_warning().' '.$langs->trans('CoreErrorMessage');
2035
+                print '<div class="error">'.$msg.'</div>';
2036 2036
             }
2037 2037
 
2038 2038
             //define("MAIN_CORE_ERROR",0);      // Constant was defined and we can't change value of a constant
@@ -2040,17 +2040,17 @@  discard block
 block discarded – undo
2040 2040
 
2041 2041
         print "\n\n";
2042 2042
 
2043
-        print '</div> <!-- End div class="fiche" -->' . "\n"; // End div fiche
2043
+        print '</div> <!-- End div class="fiche" -->'."\n"; // End div fiche
2044 2044
 
2045 2045
         if (empty($conf->dol_hide_leftmenu))
2046
-            print '</div> <!-- End div id-right -->' . "\n"; // End div id-right
2046
+            print '</div> <!-- End div id-right -->'."\n"; // End div id-right
2047 2047
 
2048 2048
         if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile))
2049
-            print '</div> <!-- End div id-container -->' . "\n"; // End div container
2049
+            print '</div> <!-- End div id-container -->'."\n"; // End div container
2050 2050
 
2051 2051
         print "\n";
2052 2052
         if ($comment)
2053
-            print '<!-- ' . $comment . ' -->' . "\n";
2053
+            print '<!-- '.$comment.' -->'."\n";
2054 2054
 
2055 2055
         printCommonFooter($zone);
2056 2056
 
@@ -2058,8 +2058,8 @@  discard block
 block discarded – undo
2058 2058
             print $delayedhtmlcontent;
2059 2059
 
2060 2060
         if (!empty($conf->use_javascript_ajax)) {
2061
-            print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n";
2062
-            print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_foot.js&lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n";
2061
+            print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n";
2062
+            print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_foot.js&lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n";
2063 2063
         }
2064 2064
 
2065 2065
         // Wrapper to add log when clicking on download or preview
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
                 <script type="text/javascript">
2072 2072
                     jQuery(document).ready(function () {
2073 2073
                         $('a.documentpreview').click(function () {
2074
-                            $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>'
2074
+                            $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>'
2075 2075
                                     , {
2076 2076
                                         id:<?php echo $object->id; ?>
2077 2077
                                         , element: '<?php echo $object->element ?>'
@@ -2080,7 +2080,7 @@  discard block
 block discarded – undo
2080 2080
                             );
2081 2081
                         });
2082 2082
                         $('a.documentdownload').click(function () {
2083
-                            $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>'
2083
+                            $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>'
2084 2084
                                     , {
2085 2085
                                         id:<?php echo $object->id; ?>
2086 2086
                                         , element: '<?php echo $object->element ?>'
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
 
2097 2097
         // A div for the address popup
2098 2098
         print "\n<!-- A div to allow dialog popup -->\n";
2099
-        print '<div id="dialogforpopup" style="display: none;"></div>' . "\n";
2099
+        print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
2100 2100
 
2101 2101
         print "</body>\n";
2102 2102
 
Please login to merge, or discard this patch.
dolibarr/htdocs/public/test/test_arrays.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 //define("NOLOGIN",1);		// This means this output page does not require to be logged.
3
-define("NOCSRFCHECK",1);	// We accept to go on this page from external web site.
3
+define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
4 4
 
5 5
 
6 6
 // Copyright (C) 2018 Alxarafe/Alixar  <[email protected]>
7 7
 defined('BASE_PATH') or die('Single entry point through the index.php of the main folder');
8
-require DOL_BASE_PATH . '/main.inc.php';
8
+require DOL_BASE_PATH.'/main.inc.php';
9 9
 
10 10
 if ($dolibarr_main_prod) {
11 11
 	accessforbidden();
12 12
 }
13 13
 
14
-$usedolheader=1;	// 1 = Test inside a dolibarr page, 0 = Use hard coded header
14
+$usedolheader = 1; // 1 = Test inside a dolibarr page, 0 = Use hard coded header
15 15
 
16
-$form=new Form($db);
16
+$form = new Form($db);
17 17
 
18 18
 
19 19
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	<!-- Includes for JQuery (Ajax library) -->
36 36
 	<link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/css/base/jquery-ui.css" />
37 37
 	<!-- <link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css" /> -->
38
-	<link rel="stylesheet" type="text/css" title="default" href="<?php echo DOL_URL_ROOT ?>/theme/eldy/style.css.php<?php echo ($_GET["dol_use_jmobile"] == 1)?'?dol_use_jmobile=1&dol_optimize_smallscreen=1':''; ?>" />
38
+	<link rel="stylesheet" type="text/css" title="default" href="<?php echo DOL_URL_ROOT ?>/theme/eldy/style.css.php<?php echo ($_GET["dol_use_jmobile"] == 1) ? '?dol_use_jmobile=1&dol_optimize_smallscreen=1' : ''; ?>" />
39 39
 	<!-- Includes JS for JQuery -->
40 40
     <!-- <script type="text/javascript" src="<?php echo DOL_URL_ROOT ?>/includes/jquery/js/jquery.min.js"></script> -->
41 41
     <script type="text/javascript" src="<?php echo BASE_URI ?>/vendor/components/jquery/jquery.min.js"></script>
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 }
55 55
 else
56 56
 {
57
-    $arraycss=array();
58
-    $arrayjs=array();
57
+    $arraycss = array();
58
+    $arrayjs = array();
59 59
     /*
60 60
 	$arraycss=array('/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css',
61 61
 			'/includes/jquery/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css',
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	);
75 75
     */
76 76
 
77
-	llxHeader('','','','',0,0,$arrayjs,$arraycss);
77
+	llxHeader('', '', '', '', 0, 0, $arrayjs, $arraycss);
78 78
 }
79 79
 
80 80
 
@@ -159,76 +159,76 @@  discard block
 block discarded – undo
159 159
 
160 160
 <?php
161 161
 include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
162
-$productspecimen=new Product($db);
162
+$productspecimen = new Product($db);
163 163
 $productspecimen->initAsSpecimen();
164 164
 
165
-$sortfield='aaa';
166
-$sortorder='ASC';
167
-$tasksarray=array(1,2,3);	// To force having several lines
168
-$tagidfortablednd='tablelines3';
169
-if (! empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
170
-
171
-$nav='';
172
-$nav.='<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
173
-if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
174
-if ($status || isset($_GET['status']) || isset($_POST['status']))  $nav.='<input type="hidden" name="status" value="'.$status.'">';
175
-if ($filter)  $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
176
-if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
177
-if ($socid)   $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
178
-if ($showbirthday)  $nav.='<input type="hidden" name="showbirthday" value="1">';
179
-if ($pid)    $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
180
-if ($type)   $nav.='<input type="hidden" name="type" value="'.$type.'">';
181
-if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
182
-$nav.= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
183
-$nav.= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
184
-$nav.= '</form>';
185
-
186
-$limit=10;
165
+$sortfield = 'aaa';
166
+$sortorder = 'ASC';
167
+$tasksarray = array(1, 2, 3); // To force having several lines
168
+$tagidfortablednd = 'tablelines3';
169
+if (!empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
170
+
171
+$nav = '';
172
+$nav .= '<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
173
+if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav .= '<input type="hidden" name="actioncode" value="'.$actioncode.'">';
174
+if ($status || isset($_GET['status']) || isset($_POST['status']))  $nav .= '<input type="hidden" name="status" value="'.$status.'">';
175
+if ($filter)  $nav .= '<input type="hidden" name="filter" value="'.$filter.'">';
176
+if ($filtert) $nav .= '<input type="hidden" name="filtert" value="'.$filtert.'">';
177
+if ($socid)   $nav .= '<input type="hidden" name="socid" value="'.$socid.'">';
178
+if ($showbirthday)  $nav .= '<input type="hidden" name="showbirthday" value="1">';
179
+if ($pid)    $nav .= '<input type="hidden" name="projectid" value="'.$pid.'">';
180
+if ($type)   $nav .= '<input type="hidden" name="type" value="'.$type.'">';
181
+if ($usergroup) $nav .= '<input type="hidden" name="usergroup" value="'.$usergroup.'">';
182
+$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
183
+$nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
184
+$nav .= '</form>';
185
+
186
+$limit = 10;
187 187
 print_barre_liste('Title of my list', 12, $_SERVER["PHP_SELF"], '', '', '', 'Text in middle', 20, 500, '', 0, $nav, '', $limit);
188 188
 
189 189
 
190
-$moreforfilter.='<div class="divsearchfield">';
191
-$moreforfilter.=$langs->trans('This is a select list for a filter A'). ': ';
192
-$cate_arbo = array('field1'=>'value1a into the select list A','field2'=>'value2a');
193
-$moreforfilter.=$form->selectarray('search_aaa', $cate_arbo, '', 1);		// List without js combo
194
-$moreforfilter.='</div>';
190
+$moreforfilter .= '<div class="divsearchfield">';
191
+$moreforfilter .= $langs->trans('This is a select list for a filter A').': ';
192
+$cate_arbo = array('field1'=>'value1a into the select list A', 'field2'=>'value2a');
193
+$moreforfilter .= $form->selectarray('search_aaa', $cate_arbo, '', 1); // List without js combo
194
+$moreforfilter .= '</div>';
195 195
 
196
-$moreforfilter.='<div class="divsearchfield">';
197
-$moreforfilter.=$langs->trans('This is a select list for a filter B'). ': ';
198
-$cate_arbo = array('field1'=>'value1b into the select list B','field2'=>'value2b');
199
-$moreforfilter.=$form->selectarray('search_bbb', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, 0, '', 1);		// List with js combo
200
-$moreforfilter.='</div>';
196
+$moreforfilter .= '<div class="divsearchfield">';
197
+$moreforfilter .= $langs->trans('This is a select list for a filter B').': ';
198
+$cate_arbo = array('field1'=>'value1b into the select list B', 'field2'=>'value2b');
199
+$moreforfilter .= $form->selectarray('search_bbb', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, 0, '', 1); // List with js combo
200
+$moreforfilter .= '</div>';
201 201
 
202
-$moreforfilter.='<div class="divsearchfield">';
203
-$moreforfilter.=$langs->trans('This is a select list for a filter C'). ': ';
204
-$cate_arbo = array('field1'=>'value1c into the select list C','field2'=>'value2c');
205
-$moreforfilter.=$form->selectarray('search_ccc', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, 0, '', 1);		// List with js combo
206
-$moreforfilter.='</div>';
202
+$moreforfilter .= '<div class="divsearchfield">';
203
+$moreforfilter .= $langs->trans('This is a select list for a filter C').': ';
204
+$cate_arbo = array('field1'=>'value1c into the select list C', 'field2'=>'value2c');
205
+$moreforfilter .= $form->selectarray('search_ccc', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, 0, '', 1); // List with js combo
206
+$moreforfilter .= '</div>';
207 207
 
208
-$moreforfilter.='<div class="divsearchfield">';
209
-$moreforfilter.=$langs->trans('This is a select list for a filter D'). ': ';
210
-$cate_arbo = array('field1'=>'value1d into the select list D','field2'=>'value2d');
211
-$moreforfilter.=$form->selectarray('search_ddd', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, 0, '', 1);		// List with js combo
212
-$moreforfilter.='</div>';
208
+$moreforfilter .= '<div class="divsearchfield">';
209
+$moreforfilter .= $langs->trans('This is a select list for a filter D').': ';
210
+$cate_arbo = array('field1'=>'value1d into the select list D', 'field2'=>'value2d');
211
+$moreforfilter .= $form->selectarray('search_ddd', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, 0, '', 1); // List with js combo
212
+$moreforfilter .= '</div>';
213 213
 
214
-if (! empty($moreforfilter))
214
+if (!empty($moreforfilter))
215 215
 {
216 216
     print '<div class="liste_titre liste_titre_bydiv centpercent">';
217 217
     print $moreforfilter;
218
-    $parameters=array();
219
-    $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters);    // Note that $action and $object may have been modified by hook
218
+    $parameters = array();
219
+    $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
220 220
     print $hookmanager->resPrint;
221 221
     print '</div>';
222 222
 }
223 223
 
224 224
 ?>
225 225
 
226
-<table class="stripe row-border order-column centpercent tagtable liste<?php echo $moreforfilter?" listwithfilterbefore":""; ?>" id="tablelines3">
226
+<table class="stripe row-border order-column centpercent tagtable liste<?php echo $moreforfilter ? " listwithfilterbefore" : ""; ?>" id="tablelines3">
227 227
 <thead>
228 228
 <tr class="liste_titre">
229
-<?php print getTitleFieldOfList($langs->trans('title1'),0,$_SERVER["PHP_SELF"],'aaa','','','align="left"',$sortfield,$sortorder); ?>
230
-<?php print getTitleFieldOfList($langs->trans('title2'),0,$_SERVER["PHP_SELF"],'bbb','','','align="right"',$sortfield,$sortorder); ?>
231
-<?php print getTitleFieldOfList($langs->trans('title3'),0,$_SERVER["PHP_SELF"],'ccc','','','align="center"',$sortfield,$sortorder); ?>
229
+<?php print getTitleFieldOfList($langs->trans('title1'), 0, $_SERVER["PHP_SELF"], 'aaa', '', '', 'align="left"', $sortfield, $sortorder); ?>
230
+<?php print getTitleFieldOfList($langs->trans('title2'), 0, $_SERVER["PHP_SELF"], 'bbb', '', '', 'align="right"', $sortfield, $sortorder); ?>
231
+<?php print getTitleFieldOfList($langs->trans('title3'), 0, $_SERVER["PHP_SELF"], 'ccc', '', '', 'align="center"', $sortfield, $sortorder); ?>
232 232
 </tr>
233 233
 </thead>
234 234
 <tbody>
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 $(document).ready(function(){
252 252
     $('#idtableexample2').dataTable( {
253 253
     	<?php
254
-    	if ($optioncss=='print') {
254
+    	if ($optioncss == 'print') {
255 255
     	 	print '\'dom\': \'lfrtip\',';
256 256
     	} else {
257 257
     		print '\'dom\': \'Blfrtip\',';
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
 
299 299
 
300 300
 <?php
301
-	$tasksarray=array(1,2,3);	// To force having several lines
302
-	$tagidfortablednd='tablelines';
303
-	if (! empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
301
+	$tasksarray = array(1, 2, 3); // To force having several lines
302
+	$tagidfortablednd = 'tablelines';
303
+	if (!empty($conf->use_javascript_ajax)) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
304 304
 ?>
305 305
 <div class="tagtable centpercent liste_titre_bydiv" id="tablelines">
306 306
     <div class="tagtr liste_titre">
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 
347 347
 
348 348
 <?php
349
-if (! empty($usedolheader))
349
+if (!empty($usedolheader))
350 350
 {
351 351
 	llxFooter();
352 352
 } else { ?>
Please login to merge, or discard this patch.
dolibarr/htdocs/install/inc.php 1 patch
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 // Just to define version DOL_VERSION
34 34
 if (!defined('DOL_INC_FOR_VERSION_ERROR'))
35 35
     define('DOL_INC_FOR_VERSION_ERROR', '1');
36
-require_once DOL_BASE_PATH . '/filefunc.inc.php';
36
+require_once DOL_BASE_PATH.'/filefunc.inc.php';
37 37
 
38
-require_once DOL_BASE_PATH . '/core/class/translate.class.php';
39
-require_once DOL_BASE_PATH . '/core/lib/functions.lib.php';
40
-require_once DOL_BASE_PATH . '/core/lib/admin.lib.php';
41
-require_once DOL_BASE_PATH . '/core/lib/files.lib.php';
38
+require_once DOL_BASE_PATH.'/core/class/translate.class.php';
39
+require_once DOL_BASE_PATH.'/core/lib/functions.lib.php';
40
+require_once DOL_BASE_PATH.'/core/lib/admin.lib.php';
41
+require_once DOL_BASE_PATH.'/core/lib/files.lib.php';
42 42
 
43 43
 /*
44 44
  * adobdbtime package
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 // Define vars
79 79
 $conffiletoshowshort = "conf.php";
80 80
 // Define localization of conf file
81
-$conffile = DOL_BASE_PATH . "/conf/conf.php";
81
+$conffile = DOL_BASE_PATH."/conf/conf.php";
82 82
 $conffiletoshow = "htdocs/conf/conf.php";
83 83
 // For debian/redhat like systems
84 84
 //$conffile = "/etc/dolibarr/conf.php";
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $dolibarr_main_db_port = '3306'; // For backward compatibility
101 101
         }
102 102
         // Clean parameters
103
-        $dolibarr_main_data_root = isset($dolibarr_main_data_root) ? trim($dolibarr_main_data_root) : DOL_BASE_PATH . '../documents';
103
+        $dolibarr_main_data_root = isset($dolibarr_main_data_root) ? trim($dolibarr_main_data_root) : DOL_BASE_PATH.'../documents';
104 104
         $dolibarr_main_url_root = isset($dolibarr_main_url_root) ? trim($dolibarr_main_url_root) : '';
105 105
         $dolibarr_main_url_root_alt = isset($dolibarr_main_url_root_alt) ? trim($dolibarr_main_url_root_alt) : '';
106 106
         $dolibarr_main_document_root = isset($dolibarr_main_document_root) ? trim($dolibarr_main_document_root) : '';
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         // Load database driver
127 127
         if ($result) {
128 128
             if (!empty($dolibarr_main_document_root) && !empty($dolibarr_main_db_type)) {
129
-                $result = include_once $dolibarr_main_document_root . "/core/db/" . $dolibarr_main_db_type . '.class.php';
129
+                $result = include_once $dolibarr_main_document_root."/core/db/".$dolibarr_main_db_type.'.class.php';
130 130
                 if (!$result) {
131 131
                     $includeconferror = 'ErrorBadValueForDolibarrMainDBType';
132 132
                 }
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
     $dolibarr_main_db_prefix = 'llx_';
146 146
 define('MAIN_DB_PREFIX', (isset($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : ''));
147 147
 
148
-define('DOL_CLASS_PATH', 'class/');                             // Filsystem path to class dir
149
-define('DOL_DATA_ROOT', (isset($dolibarr_main_data_root) ? $dolibarr_main_data_root : DOL_BASE_PATH . '../documents'));
150
-define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root) ? $dolibarr_main_url_root : ''));           // URL relative root
151
-$uri = preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT'));  // $uri contains url without http*
152
-$suburi = strstr($uri, '/');       // $suburi contains url without domain
148
+define('DOL_CLASS_PATH', 'class/'); // Filsystem path to class dir
149
+define('DOL_DATA_ROOT', (isset($dolibarr_main_data_root) ? $dolibarr_main_data_root : DOL_BASE_PATH.'../documents'));
150
+define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root) ? $dolibarr_main_url_root : '')); // URL relative root
151
+$uri = preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http*
152
+$suburi = strstr($uri, '/'); // $suburi contains url without domain
153 153
 if ($suburi == '/')
154
-    $suburi = '';   // If $suburi is /, it is now ''
155
-define('DOL_URL_ROOT', $suburi);    // URL relative root ('', '/dolibarr', ...)
154
+    $suburi = ''; // If $suburi is /, it is now ''
155
+define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
156 156
 
157 157
 
158 158
 if (empty($conf->file->character_set_client))
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
     $langs->load("install");
189 189
     print $langs->trans("YouTryInstallDisabledByDirLock");
190 190
     if (!empty($dolibarr_main_url_root)) {
191
-        print 'Click on following link, <a href="' . $dolibarr_main_url_root . '/admin/index.php?mainmenu=home&leftmenu=setup' . (isset($_POST["login"]) ? '&username=' . urlencode($_POST["login"]) : '') . '">';
191
+        print 'Click on following link, <a href="'.$dolibarr_main_url_root.'/admin/index.php?mainmenu=home&leftmenu=setup'.(isset($_POST["login"]) ? '&username='.urlencode($_POST["login"]) : '').'">';
192 192
         print $langs->trans("ClickHereToGoToApp");
193 193
         print '</a>';
194 194
     }
195 195
     exit;
196 196
 }
197 197
 
198
-$lockfile = DOL_DATA_ROOT . '/install.lock';
198
+$lockfile = DOL_DATA_ROOT.'/install.lock';
199 199
 if (constant('DOL_DATA_ROOT') === null) {
200 200
     // We don't have a configuration file yet
201 201
     // Try to detect any lockfile in the default documents path
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
     $langs->load("install");
210 210
     print $langs->trans("YouTryInstallDisabledByFileLock");
211 211
     if (!empty($dolibarr_main_url_root)) {
212
-        print $langs->trans("ClickOnLinkOrRemoveManualy") . '<br>';
213
-        print '<a href="' . $dolibarr_main_url_root . '/admin/index.php?mainmenu=home&leftmenu=setup' . (isset($_POST["login"]) ? '&username=' . urlencode($_POST["login"]) : '') . '">';
212
+        print $langs->trans("ClickOnLinkOrRemoveManualy").'<br>';
213
+        print '<a href="'.$dolibarr_main_url_root.'/admin/index.php?mainmenu=home&leftmenu=setup'.(isset($_POST["login"]) ? '&username='.urlencode($_POST["login"]) : '').'">';
214 214
         print $langs->trans("ClickHereToGoToApp");
215 215
         print '</a>';
216 216
     } else {
@@ -229,13 +229,13 @@  discard block
 block discarded – undo
229 229
     if (@is_writable('/tmp'))
230 230
         define('SYSLOG_FILE', '/tmp/dolibarr_install.log');
231 231
     else if (!empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"]))
232
-        define('SYSLOG_FILE', $_ENV["TMP"] . '/dolibarr_install.log');
232
+        define('SYSLOG_FILE', $_ENV["TMP"].'/dolibarr_install.log');
233 233
     else if (!empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"]))
234
-        define('SYSLOG_FILE', $_ENV["TEMP"] . '/dolibarr_install.log');
234
+        define('SYSLOG_FILE', $_ENV["TEMP"].'/dolibarr_install.log');
235 235
     else if (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat'))
236 236
         define('SYSLOG_FILE', '../../../../dolibarr_install.log'); // For DoliWamp
237 237
     else if (@is_writable('../../'))
238
-        define('SYSLOG_FILE', '../../dolibarr_install.log');    // For others
238
+        define('SYSLOG_FILE', '../../dolibarr_install.log'); // For others
239 239
 
240 240
 
241 241
 
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
 // We init log handler for install
256 256
 $handlers = array('mod_syslog_file');
257 257
 foreach ($handlers as $handler) {
258
-    $file = DOL_BASE_PATH . '/core/modules/syslog/' . $handler . '.php';
258
+    $file = DOL_BASE_PATH.'/core/modules/syslog/'.$handler.'.php';
259 259
     if (!file_exists($file)) {
260
-        throw new Exception('Missing log handler file ' . $handler . '.php');
260
+        throw new Exception('Missing log handler file '.$handler.'.php');
261 261
     }
262 262
 
263 263
     require_once $file;
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
     global $dolibarr_main_db_pass;
318 318
     global $character_set_client;
319 319
 
320
-    $return = include_once $dolibarr_main_document_root . '/core/class/conf.class.php';
320
+    $return = include_once $dolibarr_main_document_root.'/core/class/conf.class.php';
321 321
     if (!$return)
322 322
         return -1;
323 323
 
@@ -357,13 +357,13 @@  discard block
 block discarded – undo
357 357
         if (@is_writable('/tmp'))
358 358
             define('SYSLOG_FILE', '/tmp/dolibarr_install.log');
359 359
         else if (!empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"]))
360
-            define('SYSLOG_FILE', $_ENV["TMP"] . '/dolibarr_install.log');
360
+            define('SYSLOG_FILE', $_ENV["TMP"].'/dolibarr_install.log');
361 361
         else if (!empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"]))
362
-            define('SYSLOG_FILE', $_ENV["TEMP"] . '/dolibarr_install.log');
362
+            define('SYSLOG_FILE', $_ENV["TEMP"].'/dolibarr_install.log');
363 363
         else if (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat'))
364 364
             define('SYSLOG_FILE', '../../../../dolibarr_install.log'); // For DoliWamp
365 365
         else if (@is_writable('../../'))
366
-            define('SYSLOG_FILE', '../../dolibarr_install.log');    // For others
366
+            define('SYSLOG_FILE', '../../dolibarr_install.log'); // For others
367 367
 
368 368
 
369 369
 
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
     // We init log handler for install
384 384
     $handlers = array('mod_syslog_file');
385 385
     foreach ($handlers as $handler) {
386
-        $file = DOL_BASE_PATH . '/core/modules/syslog/' . $handler . '.php';
386
+        $file = DOL_BASE_PATH.'/core/modules/syslog/'.$handler.'.php';
387 387
         if (!file_exists($file)) {
388
-            throw new Exception('Missing log handler file ' . $handler . '.php');
388
+            throw new Exception('Missing log handler file '.$handler.'.php');
389 389
         }
390 390
 
391 391
         require_once $file;
@@ -431,63 +431,63 @@  discard block
 block discarded – undo
431 431
     }
432 432
 
433 433
     // We force the content charset
434
-    header("Content-type: text/html; charset=" . $conf->file->character_set_client);
434
+    header("Content-type: text/html; charset=".$conf->file->character_set_client);
435 435
     header("X-Content-Type-Options: nosniff");
436 436
 
437
-    print '<!DOCTYPE HTML>' . "\n";
438
-    print '<html>' . "\n";
439
-    print '<head>' . "\n";
440
-    print '<meta charset="' . $conf->file->character_set_client . '">' . "\n";
441
-    print '<meta name="viewport" content="width=device-width, initial-scale=1.0">' . "\n";
442
-    print '<meta name="generator" content="Dolibarr installer">' . "\n";
443
-    print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/install/default.css">' . "\n";
437
+    print '<!DOCTYPE HTML>'."\n";
438
+    print '<html>'."\n";
439
+    print '<head>'."\n";
440
+    print '<meta charset="'.$conf->file->character_set_client.'">'."\n";
441
+    print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
442
+    print '<meta name="generator" content="Dolibarr installer">'."\n";
443
+    print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/install/default.css">'."\n";
444 444
 
445
-    print '<!-- Includes CSS for JQuery -->' . "\n";
445
+    print '<!-- Includes CSS for JQuery -->'."\n";
446 446
     if ($jQueryUiCustomPath) {
447
-        print '<link rel="stylesheet" type="text/css" href="' . $jQueryUiCustomPath . 'css/' . $jquerytheme . '/jquery-ui.min.css" />' . "\n";  // JQuery
447
+        print '<link rel="stylesheet" type="text/css" href="'.$jQueryUiCustomPath.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
448 448
     } else {
449 449
         //print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.min.css" />' . "\n";    // JQuery
450
-        print '<link rel="stylesheet" type="text/css" href="' . BASE_URI . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.min.css" />' . "\n";    // JQuery
450
+        print '<link rel="stylesheet" type="text/css" href="'.BASE_URI.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
451 451
     }
452
-    print '<!-- Includes JS for JQuery -->' . "\n";
452
+    print '<!-- Includes JS for JQuery -->'."\n";
453 453
     if ($jQueryCustomPath) {
454
-        print '<script type="text/javascript" src="' . $jQueryCustomPath . 'jquery.min.js"></script>' . "\n";
454
+        print '<script type="text/javascript" src="'.$jQueryCustomPath.'jquery.min.js"></script>'."\n";
455 455
     } else {
456 456
         // print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery.min.js"></script>' . "\n";
457
-        print '<script type="text/javascript" src="' . BASE_URI . '/vendor/components/jquery/jquery.min.js"></script>' . "\n";
457
+        print '<script type="text/javascript" src="'.BASE_URI.'/vendor/components/jquery/jquery.min.js"></script>'."\n";
458 458
     }
459 459
     if ($jQueryUiCustomPath) {
460
-        print '<script type="text/javascript" src="' . $jQueryUiCustomPath . 'jquery-ui.min.js"></script>' . "\n";
460
+        print '<script type="text/javascript" src="'.$jQueryUiCustomPath.'jquery-ui.min.js"></script>'."\n";
461 461
     } else {
462 462
         // print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery-ui.min.js"></script>' . "\n";
463
-        print '<script type="text/javascript" src="' . BASE_URI . '/vendor/components/jqueryui/jquery-ui.min.js"></script>' . "\n";
463
+        print '<script type="text/javascript" src="'.BASE_URI.'/vendor/components/jqueryui/jquery-ui.min.js"></script>'."\n";
464 464
     }
465
-    print '<title>' . $langs->trans("DolibarrSetup") . '</title>' . "\n";
465
+    print '<title>'.$langs->trans("DolibarrSetup").'</title>'."\n";
466 466
     print "<!-- Alixar debugBar header -->";
467 467
     print Debug::getRenderHeader(); // Includes Alixar debugBar header
468
-    print '</head>' . "\n";
468
+    print '</head>'."\n";
469 469
 
470
-    print '<body>' . "\n";
470
+    print '<body>'."\n";
471 471
 
472 472
     print '<div class="divlogoinstall" style="text-align:center">';
473
-    print '<img class="imglogoinstall" src="' . DOL_BASE_URI . '/theme/dolibarr_logo.png" alt="Dolibarr logo"><br>';
473
+    print '<img class="imglogoinstall" src="'.DOL_BASE_URI.'/theme/dolibarr_logo.png" alt="Dolibarr logo"><br>';
474 474
     print DOL_VERSION;
475 475
     print '</div><br>';
476 476
 
477
-    print '<span class="titre">' . $langs->trans("DolibarrSetup");
477
+    print '<span class="titre">'.$langs->trans("DolibarrSetup");
478 478
     if ($subtitle) {
479
-        print ' - ' . $subtitle;
479
+        print ' - '.$subtitle;
480 480
     }
481
-    print '</span>' . "\n";
481
+    print '</span>'."\n";
482 482
 
483 483
     //print '<form name="forminstall" style="width: 100%" action="' . $next . '.php' . ($param ? '?' . $param : '') . '" method="POST">' . "\n";
484
-    print '<form name="forminstall" style="width: 100%" action="' . BASE_URI . '?controller=install&method=' . $next . ($param ? '&' . $param : '') . '" method="POST">' . "\n";
485
-    print '<input type="hidden" name="testpost" value="ok">' . "\n";
486
-    print '<input type="hidden" name="action" value="' . $action . '">' . "\n";
484
+    print '<form name="forminstall" style="width: 100%" action="'.BASE_URI.'?controller=install&method='.$next.($param ? '&'.$param : '').'" method="POST">'."\n";
485
+    print '<input type="hidden" name="testpost" value="ok">'."\n";
486
+    print '<input type="hidden" name="action" value="'.$action.'">'."\n";
487 487
 
488
-    print '<table class="main" width="100%"><tr><td>' . "\n";
488
+    print '<table class="main" width="100%"><tr><td>'."\n";
489 489
 
490
-    print '<table class="' . $csstable . '" width="100%"><tr><td>' . "\n";
490
+    print '<table class="'.$csstable.'" width="100%"><tr><td>'."\n";
491 491
 }
492 492
 
493 493
 /**
@@ -507,27 +507,27 @@  discard block
 block discarded – undo
507 507
     $langs->load("other");
508 508
     $langs->load("admin");
509 509
 
510
-    print '</td></tr></table>' . "\n";
511
-    print '</td></tr></table>' . "\n";
510
+    print '</td></tr></table>'."\n";
511
+    print '</td></tr></table>'."\n";
512 512
 
513 513
     if (!$nonext || ($nonext == '2')) {
514 514
         print '<div class="nextbutton" id="nextbutton">';
515 515
         if ($nonext == '2') {
516
-            print $langs->trans("ErrorFoundDuringMigration", isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] . '&ignoreerrors=1' : '') . '<br><br>';
516
+            print $langs->trans("ErrorFoundDuringMigration", isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"].'&ignoreerrors=1' : '').'<br><br>';
517 517
         }
518 518
 
519
-        print '<input type="submit" ' . ($nonext == '2' ? 'disabled="disabled" ' : '') . 'value="' . $langs->trans("NextStep") . ' ->"';
519
+        print '<input type="submit" '.($nonext == '2' ? 'disabled="disabled" ' : '').'value="'.$langs->trans("NextStep").' ->"';
520 520
         if ($jscheckfunction)
521
-            print ' onClick="return ' . $jscheckfunction . '();"';
521
+            print ' onClick="return '.$jscheckfunction.'();"';
522 522
         print '></div>';
523 523
         if ($withpleasewait)
524
-            print '<div style="visibility: hidden;" class="pleasewait" id="pleasewait"><br>' . $langs->trans("NextStepMightLastALongTime") . '<br><br><div class="blinkwait">' . $langs->trans("PleaseBePatient") . '</div></div>';
524
+            print '<div style="visibility: hidden;" class="pleasewait" id="pleasewait"><br>'.$langs->trans("NextStepMightLastALongTime").'<br><br><div class="blinkwait">'.$langs->trans("PleaseBePatient").'</div></div>';
525 525
     }
526 526
     if ($setuplang) {
527
-        print '<input type="hidden" name="selectlang" value="' . $setuplang . '">';
527
+        print '<input type="hidden" name="selectlang" value="'.$setuplang.'">';
528 528
     }
529 529
 
530
-    print '</form>' . "\n";
530
+    print '</form>'."\n";
531 531
 
532 532
     // If there is some logs in buffer to show
533 533
     if (isset($conf->logbuffer) && count($conf->logbuffer)) {
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
         print "<!-- Start of log output\n";
536 536
         //print '<div class="hidden">'."\n";
537 537
         foreach ($conf->logbuffer as $logline) {
538
-            print $logline . "<br>\n";
538
+            print $logline."<br>\n";
539 539
         }
540 540
         //print '</div>'."\n";
541 541
         print "End of log output -->\n";
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
 
545 545
     print "<!-- Alixar debugBar footer -->";
546 546
     print Debug::getRenderFooter(); // Includes Alixar debugBar footer
547
-    print '</body>' . "\n";
548
-    print '</html>' . "\n";
547
+    print '</body>'."\n";
548
+    print '</html>'."\n";
549 549
 }
550 550
 
551 551
 /**
@@ -610,16 +610,16 @@  discard block
 block discarded – undo
610 610
         $dolibarr_main_url_root = $_SERVER["SCRIPT_URI"];
611 611
     } // If defined (Ie: Apache with Caudium)
612 612
     elseif (isset($_SERVER["SERVER_URL"]) && isset($_SERVER["DOCUMENT_URI"])) {
613
-        $dolibarr_main_url_root = $_SERVER["SERVER_URL"] . $_SERVER["DOCUMENT_URI"];
613
+        $dolibarr_main_url_root = $_SERVER["SERVER_URL"].$_SERVER["DOCUMENT_URI"];
614 614
     } // If SCRIPT_URI, SERVER_URL, DOCUMENT_URI not defined (Ie: Apache 2.0.44 for Windows)
615 615
     else {
616
-        $proto = ( (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';
616
+        $proto = ((!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';
617 617
         if (!empty($_SERVER["HTTP_HOST"])) {
618 618
             $serverport = $_SERVER["HTTP_HOST"];
619 619
         } else {
620 620
             $serverport = $_SERVER["SERVER_NAME"];
621 621
         }
622
-        $dolibarr_main_url_root = $proto . "://" . $serverport . $_SERVER["SCRIPT_NAME"];
622
+        $dolibarr_main_url_root = $proto."://".$serverport.$_SERVER["SCRIPT_NAME"];
623 623
     }
624 624
     // Clean proposed URL
625 625
     // We assume /install to be under /htdocs, so we get the parent path of the current URL
Please login to merge, or discard this patch.