@@ -9,7 +9,7 @@ |
||
| 9 | 9 | define('BASE_PATH', __DIR__); |
| 10 | 10 | define('DEBUG', true); |
| 11 | 11 | |
| 12 | -require_once BASE_PATH . '/vendor/autoload.php'; |
|
| 12 | +require_once BASE_PATH.'/vendor/autoload.php'; |
|
| 13 | 13 | |
| 14 | 14 | use Alixar\Helpers\AlixarDispatcher; |
| 15 | 15 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if (!defined('DOL_VERSION')) { |
| 38 | - define('DOL_VERSION', '10.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c |
|
| 38 | + define('DOL_VERSION', '10.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | if (!defined('EURO')) { |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | $result = @include_once $conffile; // Keep @ because with some error reporting this break the redirect done when file not found |
| 79 | 79 | |
| 80 | 80 | if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) { // If install not done and we are in a web session |
| 81 | - header('Location: ' . BASE_URI . '?controller=install&method=index'); // Changed for Alixar |
|
| 81 | + header('Location: '.BASE_URI.'?controller=install&method=index'); // Changed for Alixar |
|
| 82 | 82 | exit; |
| 83 | 83 | |
| 84 | 84 | if (!empty($_SERVER["CONTEXT_PREFIX"])) { // CONTEXT_PREFIX and CONTEXT_DOCUMENT_ROOT are not defined on all apache versions |
| 85 | - $path = $_SERVER["CONTEXT_PREFIX"]; // example '/dolibarr/' when using an apache alias. |
|
| 85 | + $path = $_SERVER["CONTEXT_PREFIX"]; // example '/dolibarr/' when using an apache alias. |
|
| 86 | 86 | if (!preg_match('/\/$/', $path)) |
| 87 | 87 | $path .= '/'; |
| 88 | 88 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - header("Location: " . $path . "install/index.php"); |
|
| 114 | + header("Location: ".$path."install/index.php"); |
|
| 115 | 115 | exit; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $dolibarr_main_document_root_alt = (empty($dolibarr_main_document_root_alt) ? '' : trim($dolibarr_main_document_root_alt)); |
| 136 | 136 | |
| 137 | 137 | if (empty($dolibarr_main_db_port)) { |
| 138 | - $dolibarr_main_db_port = 3306; // For compatibility with old configs, if not defined, we take 'mysql' type |
|
| 138 | + $dolibarr_main_db_port = 3306; // For compatibility with old configs, if not defined, we take 'mysql' type |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if (empty($dolibarr_main_db_type)) { |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $dolibarr_main_db_prefix = 'llx_'; |
| 151 | 151 | } |
| 152 | 152 | if (empty($dolibarr_main_db_character_set)) { |
| 153 | - $dolibarr_main_db_character_set = ($dolibarr_main_db_type == 'mysqli' ? 'utf8' : ''); // Old installation |
|
| 153 | + $dolibarr_main_db_character_set = ($dolibarr_main_db_type == 'mysqli' ? 'utf8' : ''); // Old installation |
|
| 154 | 154 | } |
| 155 | 155 | if (empty($dolibarr_main_db_collation)) { |
| 156 | 156 | $dolibarr_main_db_collation = ($dolibarr_main_db_type == 'mysqli' ? 'utf8_unicode_ci' : ''); // Old installation |
@@ -199,13 +199,13 @@ discard block |
||
| 199 | 199 | // Another test is done later on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on. |
| 200 | 200 | } |
| 201 | 201 | if (empty($dolibarr_main_db_host)) { |
| 202 | - print '<div align="center">Dolibarr setup is not yet complete.<br><br>' . "\n"; |
|
| 203 | - print '<a href="install/index.php">Click here to finish Dolibarr install process</a> ...</div>' . "\n"; |
|
| 202 | + print '<div align="center">Dolibarr setup is not yet complete.<br><br>'."\n"; |
|
| 203 | + print '<a href="install/index.php">Click here to finish Dolibarr install process</a> ...</div>'."\n"; |
|
| 204 | 204 | die; |
| 205 | 205 | } |
| 206 | 206 | if (empty($dolibarr_main_url_root)) { |
| 207 | - print 'Value for parameter \'dolibarr_main_url_root\' is not defined in your \'htdocs\conf\conf.php\' file.<br>' . "\n"; |
|
| 208 | - print 'You must add this parameter with your full Dolibarr root Url (Example: http://myvirtualdomain/ or http://mydomain/mydolibarrurl/)' . "\n"; |
|
| 207 | + print 'Value for parameter \'dolibarr_main_url_root\' is not defined in your \'htdocs\conf\conf.php\' file.<br>'."\n"; |
|
| 208 | + print 'You must add this parameter with your full Dolibarr root Url (Example: http://myvirtualdomain/ or http://mydomain/mydolibarrurl/)'."\n"; |
|
| 209 | 209 | die; |
| 210 | 210 | } |
| 211 | 211 | if (empty($dolibarr_main_data_root)) { |
@@ -215,30 +215,30 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | // Define some constants |
| 218 | -define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter) |
|
| 219 | -define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents) |
|
| 220 | -define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs) |
|
| 218 | +define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter) |
|
| 219 | +define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents) |
|
| 220 | +define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs) |
|
| 221 | 221 | // Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT. |
| 222 | 222 | // Note: autodetect works only in case 1, 2, 3 and 4 of phpunit test CoreTest.php. For case 5, 6, only setting value into conf.php will works. |
| 223 | 223 | $tmp = ''; |
| 224 | 224 | $found = 0; |
| 225 | 225 | $real_dolibarr_main_document_root = str_replace('\\', '/', realpath($dolibarr_main_document_root)); // A) Value found into config file, to say where are store htdocs files. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs |
| 226 | 226 | if (!empty($_SERVER["DOCUMENT_ROOT"])) { |
| 227 | - $pathroot = $_SERVER["DOCUMENT_ROOT"]; // B) Value reported by web server setup (not defined on CLI mode), to say where is root of web server instance. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs |
|
| 227 | + $pathroot = $_SERVER["DOCUMENT_ROOT"]; // B) Value reported by web server setup (not defined on CLI mode), to say where is root of web server instance. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs |
|
| 228 | 228 | } else { |
| 229 | 229 | $pathroot = 'NOTDEFINED'; |
| 230 | 230 | } |
| 231 | -$paths = explode('/', str_replace('\\', '/', $_SERVER["SCRIPT_NAME"])); // C) Value reported by web server, to say full path on filesystem of a file. Ex: /dolibarr/htdocs/admin/system/phpinfo.php |
|
| 231 | +$paths = explode('/', str_replace('\\', '/', $_SERVER["SCRIPT_NAME"])); // C) Value reported by web server, to say full path on filesystem of a file. Ex: /dolibarr/htdocs/admin/system/phpinfo.php |
|
| 232 | 232 | // Try to detect if $_SERVER["DOCUMENT_ROOT"]+start of $_SERVER["SCRIPT_NAME"] is $dolibarr_main_document_root. If yes, relative url to add before dol files is this start part. |
| 233 | 233 | $concatpath = ''; |
| 234 | 234 | foreach ($paths as $tmppath) { // We check to find (B+start of C)=A |
| 235 | 235 | if (empty($tmppath)) { |
| 236 | 236 | continue; |
| 237 | 237 | } |
| 238 | - $concatpath .= '/' . $tmppath; |
|
| 238 | + $concatpath .= '/'.$tmppath; |
|
| 239 | 239 | //if ($tmppath) $concatpath.='/'.$tmppath; |
| 240 | 240 | //print $_SERVER["SCRIPT_NAME"].'-'.$pathroot.'-'.$concatpath.'-'.$real_dolibarr_main_document_root.'-'.realpath($pathroot.$concatpath).'<br>'; |
| 241 | - if ($real_dolibarr_main_document_root == @realpath($pathroot . $concatpath)) { // @ avoid warning when safe_mode is on. |
|
| 241 | + if ($real_dolibarr_main_document_root == @realpath($pathroot.$concatpath)) { // @ avoid warning when safe_mode is on. |
|
| 242 | 242 | //print "Found relative url = ".$concatpath; |
| 243 | 243 | $tmp3 = $concatpath; |
| 244 | 244 | $found = 1; |
@@ -250,19 +250,19 @@ discard block |
||
| 250 | 250 | if (!$found) { |
| 251 | 251 | $tmp = $dolibarr_main_url_root; // If autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT). |
| 252 | 252 | } else { |
| 253 | - $tmp = 'http' . (((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's') . '://' . $_SERVER["SERVER_NAME"] . ((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':' . $_SERVER["SERVER_PORT"]) . ($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/') . $tmp3 : ''); |
|
| 253 | + $tmp = 'http'.(((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':'.$_SERVER["SERVER_PORT"]).($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/').$tmp3 : ''); |
|
| 254 | 254 | } |
| 255 | 255 | //print "tmp1=".$tmp1." tmp2=".$tmp2." tmp3=".$tmp3." tmp=".$tmp."\n"; |
| 256 | 256 | if (!empty($dolibarr_main_force_https)) { |
| 257 | 257 | $tmp = preg_replace('/^http:/i', 'https:', $tmp); |
| 258 | 258 | } |
| 259 | -define('DOL_MAIN_URL_ROOT', $tmp); // URL absolute root (https://sss/dolibarr, ...) |
|
| 259 | +define('DOL_MAIN_URL_ROOT', $tmp); // URL absolute root (https://sss/dolibarr, ...) |
|
| 260 | 260 | $uri = preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http* |
| 261 | -$suburi = strstr($uri, '/'); // $suburi contains url without domain:port |
|
| 261 | +$suburi = strstr($uri, '/'); // $suburi contains url without domain:port |
|
| 262 | 262 | if ($suburi == '/') { |
| 263 | - $suburi = ''; // If $suburi is /, it is now '' |
|
| 263 | + $suburi = ''; // If $suburi is /, it is now '' |
|
| 264 | 264 | } |
| 265 | -define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) |
|
| 265 | +define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) |
|
| 266 | 266 | //print DOL_MAIN_URL_ROOT.'-'.DOL_URL_ROOT."\n"; |
| 267 | 267 | // Define prefix MAIN_DB_PREFIX |
| 268 | 268 | define('MAIN_DB_PREFIX', $dolibarr_main_db_prefix); |
@@ -274,46 +274,46 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | // Path to root libraries |
| 276 | 276 | if (!defined('ADODB_PATH')) { |
| 277 | - define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH)) ? DOL_BASE_PATH . '/includes/adodbtime/' : (empty($dolibarr_lib_ADODB_PATH) ? '' : $dolibarr_lib_ADODB_PATH . '/')); |
|
| 277 | + define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH)) ? DOL_BASE_PATH . '/includes/adodbtime/' : (empty($dolibarr_lib_ADODB_PATH) ? '' : $dolibarr_lib_ADODB_PATH.'/')); |
|
| 278 | 278 | } |
| 279 | 279 | if (!defined('FPDF_PATH')) { |
| 280 | - define('FPDF_PATH', (empty($dolibarr_lib_FPDF_PATH)) ? DOL_BASE_PATH . '/includes/fpdf/' : $dolibarr_lib_FPDF_PATH . '/'); |
|
| 280 | + define('FPDF_PATH', (empty($dolibarr_lib_FPDF_PATH)) ? DOL_BASE_PATH . '/includes/fpdf/' : $dolibarr_lib_FPDF_PATH.'/'); |
|
| 281 | 281 | } // Used only for package that can't include tcpdf |
| 282 | 282 | if (!defined('TCPDF_PATH')) { |
| 283 | - define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH)) ? DOL_BASE_PATH . '/includes/tecnickcom/tcpdf/' : $dolibarr_lib_TCPDF_PATH . '/'); |
|
| 283 | + define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH)) ? DOL_BASE_PATH . '/includes/tecnickcom/tcpdf/' : $dolibarr_lib_TCPDF_PATH.'/'); |
|
| 284 | 284 | } |
| 285 | 285 | if (!defined('FPDI_PATH')) { |
| 286 | - define('FPDI_PATH', (empty($dolibarr_lib_FPDI_PATH)) ? DOL_BASE_PATH . '/includes/fpdfi/' : $dolibarr_lib_FPDI_PATH . '/'); |
|
| 286 | + define('FPDI_PATH', (empty($dolibarr_lib_FPDI_PATH)) ? DOL_BASE_PATH . '/includes/fpdfi/' : $dolibarr_lib_FPDI_PATH.'/'); |
|
| 287 | 287 | } |
| 288 | 288 | if (!defined('TCPDI_PATH')) { |
| 289 | - define('TCPDI_PATH', (empty($dolibarr_lib_TCPDI_PATH)) ? DOL_BASE_PATH . '/includes/tcpdi/' : $dolibarr_lib_TCPDI_PATH . '/'); |
|
| 289 | + define('TCPDI_PATH', (empty($dolibarr_lib_TCPDI_PATH)) ? DOL_BASE_PATH . '/includes/tcpdi/' : $dolibarr_lib_TCPDI_PATH.'/'); |
|
| 290 | 290 | } |
| 291 | 291 | if (!defined('NUSOAP_PATH')) { |
| 292 | - define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH)) ? DOL_BASE_PATH . '/includes/nusoap/lib/' : (empty($dolibarr_lib_NUSOAP_PATH) ? '' : $dolibarr_lib_NUSOAP_PATH . '/')); |
|
| 292 | + define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH)) ? DOL_BASE_PATH . '/includes/nusoap/lib/' : (empty($dolibarr_lib_NUSOAP_PATH) ? '' : $dolibarr_lib_NUSOAP_PATH.'/')); |
|
| 293 | 293 | } |
| 294 | 294 | if (!defined('PHPEXCEL_PATH')) { |
| 295 | - define('PHPEXCEL_PATH', (!isset($dolibarr_lib_PHPEXCEL_PATH)) ? DOL_BASE_PATH . '/includes/phpoffice/phpexcel/Classes/' : (empty($dolibarr_lib_PHPEXCEL_PATH) ? '' : $dolibarr_lib_PHPEXCEL_PATH . '/')); |
|
| 295 | + define('PHPEXCEL_PATH', (!isset($dolibarr_lib_PHPEXCEL_PATH)) ? DOL_BASE_PATH . '/includes/phpoffice/phpexcel/Classes/' : (empty($dolibarr_lib_PHPEXCEL_PATH) ? '' : $dolibarr_lib_PHPEXCEL_PATH.'/')); |
|
| 296 | 296 | } |
| 297 | 297 | if (!defined('GEOIP_PATH')) { |
| 298 | - define('GEOIP_PATH', (!isset($dolibarr_lib_GEOIP_PATH)) ? DOL_BASE_PATH . '/includes/geoip/' : (empty($dolibarr_lib_GEOIP_PATH) ? '' : $dolibarr_lib_GEOIP_PATH . '/')); |
|
| 298 | + define('GEOIP_PATH', (!isset($dolibarr_lib_GEOIP_PATH)) ? DOL_BASE_PATH . '/includes/geoip/' : (empty($dolibarr_lib_GEOIP_PATH) ? '' : $dolibarr_lib_GEOIP_PATH.'/')); |
|
| 299 | 299 | } |
| 300 | 300 | if (!defined('ODTPHP_PATH')) { |
| 301 | - define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH)) ? DOL_BASE_PATH . '/includes/odtphp/' : (empty($dolibarr_lib_ODTPHP_PATH) ? '' : $dolibarr_lib_ODTPHP_PATH . '/')); |
|
| 301 | + define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH)) ? DOL_BASE_PATH . '/includes/odtphp/' : (empty($dolibarr_lib_ODTPHP_PATH) ? '' : $dolibarr_lib_ODTPHP_PATH.'/')); |
|
| 302 | 302 | } |
| 303 | 303 | if (!defined('ODTPHP_PATHTOPCLZIP')) { |
| 304 | - define('ODTPHP_PATHTOPCLZIP', (!isset($dolibarr_lib_ODTPHP_PATHTOPCLZIP)) ? DOL_BASE_PATH . '/includes/odtphp/zip/pclzip/' : (empty($dolibarr_lib_ODTPHP_PATHTOPCLZIP) ? '' : $dolibarr_lib_ODTPHP_PATHTOPCLZIP . '/')); |
|
| 304 | + define('ODTPHP_PATHTOPCLZIP', (!isset($dolibarr_lib_ODTPHP_PATHTOPCLZIP)) ? DOL_BASE_PATH . '/includes/odtphp/zip/pclzip/' : (empty($dolibarr_lib_ODTPHP_PATHTOPCLZIP) ? '' : $dolibarr_lib_ODTPHP_PATHTOPCLZIP.'/')); |
|
| 305 | 305 | } |
| 306 | 306 | if (!defined('JS_CKEDITOR')) { |
| 307 | - define('JS_CKEDITOR', (!isset($dolibarr_js_CKEDITOR)) ? '' : (empty($dolibarr_js_CKEDITOR) ? '' : $dolibarr_js_CKEDITOR . '/')); |
|
| 307 | + define('JS_CKEDITOR', (!isset($dolibarr_js_CKEDITOR)) ? '' : (empty($dolibarr_js_CKEDITOR) ? '' : $dolibarr_js_CKEDITOR.'/')); |
|
| 308 | 308 | } |
| 309 | 309 | if (!defined('JS_JQUERY')) { |
| 310 | - define('JS_JQUERY', (!isset($dolibarr_js_JQUERY)) ? '' : (empty($dolibarr_js_JQUERY) ? '' : $dolibarr_js_JQUERY . '/')); |
|
| 310 | + define('JS_JQUERY', (!isset($dolibarr_js_JQUERY)) ? '' : (empty($dolibarr_js_JQUERY) ? '' : $dolibarr_js_JQUERY.'/')); |
|
| 311 | 311 | } |
| 312 | 312 | if (!defined('JS_JQUERY_UI')) { |
| 313 | - define('JS_JQUERY_UI', (!isset($dolibarr_js_JQUERY_UI)) ? '' : (empty($dolibarr_js_JQUERY_UI) ? '' : $dolibarr_js_JQUERY_UI . '/')); |
|
| 313 | + define('JS_JQUERY_UI', (!isset($dolibarr_js_JQUERY_UI)) ? '' : (empty($dolibarr_js_JQUERY_UI) ? '' : $dolibarr_js_JQUERY_UI.'/')); |
|
| 314 | 314 | } |
| 315 | 315 | if (!defined('JS_JQUERY_FLOT')) { |
| 316 | - define('JS_JQUERY_FLOT', (!isset($dolibarr_js_JQUERY_FLOT)) ? '' : (empty($dolibarr_js_JQUERY_FLOT) ? '' : $dolibarr_js_JQUERY_FLOT . '/')); |
|
| 316 | + define('JS_JQUERY_FLOT', (!isset($dolibarr_js_JQUERY_FLOT)) ? '' : (empty($dolibarr_js_JQUERY_FLOT) ? '' : $dolibarr_js_JQUERY_FLOT.'/')); |
|
| 317 | 317 | } |
| 318 | 318 | // Other required path |
| 319 | 319 | if (!defined('DOL_DEFAULT_TTF')) { |
@@ -329,10 +329,10 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | |
| 331 | 331 | if (!defined('ADODB_DATE_VERSION')) { |
| 332 | - include_once ADODB_PATH . 'adodb-time.inc.php'; |
|
| 332 | + include_once ADODB_PATH.'adodb-time.inc.php'; |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | -if (!file_exists(DOL_BASE_PATH . "/core/lib/functions.lib.php")) { |
|
| 335 | +if (!file_exists(DOL_BASE_PATH."/core/lib/functions.lib.php")) { |
|
| 336 | 336 | print "Error: Dolibarr config file content seems to be not correctly defined.<br>\n"; |
| 337 | 337 | print "Please run dolibarr setup by calling page <b>/install</b>.<br>\n"; |
| 338 | 338 | exit; |
@@ -340,8 +340,8 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | |
| 342 | 342 | // Included by default |
| 343 | -include_once DOL_BASE_PATH . '/core/lib/functions.lib.php'; |
|
| 344 | -include_once DOL_BASE_PATH . '/core/lib/security.lib.php'; |
|
| 343 | +include_once DOL_BASE_PATH.'/core/lib/functions.lib.php'; |
|
| 344 | +include_once DOL_BASE_PATH.'/core/lib/security.lib.php'; |
|
| 345 | 345 | //print memory_get_usage(); |
| 346 | 346 | // If password is encoded, we decode it |
| 347 | 347 | if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | // Copyright (C) 2018 Alxarafe/Alixar <[email protected]> |
| 34 | -require DOL_BASE_PATH . '/main.inc.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
| 34 | +require DOL_BASE_PATH.'/main.inc.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
| 36 | 36 | |
| 37 | 37 | // If not defined, we select menu "home" |
| 38 | 38 | $_GET['mainmenu'] = GETPOST('mainmenu', 'aZ09') ? GETPOST('mainmenu', 'aZ09') : 'home'; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | // Check if company name is defined (first install) |
| 48 | 48 | if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_NOM)) { |
| 49 | 49 | //header("Location: " . DOL_URL_ROOT . "/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete"); |
| 50 | - header('Location: ' . BASE_URI . '?controller=admin&method=index&mainmenu=home&leftmenu=setup&mesg=setupnotcomplete'); |
|
| 50 | + header('Location: '.BASE_URI.'?controller=admin&method=index&mainmenu=home&leftmenu=setup&mesg=setupnotcomplete'); |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | /* |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | */ |
| 63 | 63 | if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) |
| 64 | - require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; |
|
| 64 | + require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; |
|
| 65 | 65 | $zone = GETPOST('areacode', 'aZ09'); |
| 66 | 66 | $userid = GETPOST('userid', 'int'); |
| 67 | 67 | $boxorder = GETPOST('boxorder', 'aZ09'); |
@@ -81,14 +81,14 @@ discard block |
||
| 81 | 81 | $form = new Form($db); |
| 82 | 82 | |
| 83 | 83 | // Title |
| 84 | -$title = $langs->trans("HomeArea") . ' - Dolibarr ' . DOL_VERSION; |
|
| 84 | +$title = $langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION; |
|
| 85 | 85 | if (!empty($conf->global->MAIN_APPLICATION_TITLE)) |
| 86 | - $title = $langs->trans("HomeArea") . ' - ' . $conf->global->MAIN_APPLICATION_TITLE; |
|
| 86 | + $title = $langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE; |
|
| 87 | 87 | |
| 88 | 88 | llxHeader('', $title); |
| 89 | 89 | |
| 90 | 90 | |
| 91 | -$resultboxes = FormOther::getBoxesArea($user, "0"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) |
|
| 91 | +$resultboxes = FormOther::getBoxesArea($user, "0"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) |
|
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | print load_fiche_titre($langs->trans("HomeArea"), $resultboxes['selectboxlist'], 'title_home'); |
@@ -123,16 +123,16 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | if (empty($user->societe_id)) { |
| 125 | 125 | $boxstat .= '<div class="box">'; |
| 126 | - $boxstat .= '<table summary="' . dol_escape_htmltag($langs->trans("DolibarrStateBoard")) . '" class="noborder boxtable boxtablenobottom nohover" width="100%">'; |
|
| 126 | + $boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover" width="100%">'; |
|
| 127 | 127 | $boxstat .= '<tr class="liste_titre">'; |
| 128 | - $boxstat .= '<th class="liste_titre">' . $langs->trans("DolibarrStateBoard") . '</th>'; |
|
| 128 | + $boxstat .= '<th class="liste_titre">'.$langs->trans("DolibarrStateBoard").'</th>'; |
|
| 129 | 129 | $boxstat .= '</tr>'; |
| 130 | 130 | $boxstat .= '<tr class="impair"><td class="tdboxstats nohover flexcontainer">'; |
| 131 | 131 | |
| 132 | 132 | $object = new stdClass(); |
| 133 | 133 | $parameters = array(); |
| 134 | 134 | $action = ''; |
| 135 | - $reshook = $hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 135 | + $reshook = $hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 136 | 136 | $boxstat .= $hookmanager->resPrint; |
| 137 | 137 | |
| 138 | 138 | if (empty($reshook)) { |
@@ -160,25 +160,25 @@ discard block |
||
| 160 | 160 | ); |
| 161 | 161 | // Class file containing the method load_state_board for each line |
| 162 | 162 | $includes = array( |
| 163 | - DOL_DOCUMENT_ROOT . "/user/class/user.class.php", |
|
| 164 | - DOL_DOCUMENT_ROOT . "/societe/class/client.class.php", |
|
| 165 | - DOL_DOCUMENT_ROOT . "/societe/class/client.class.php", |
|
| 166 | - DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.class.php", |
|
| 167 | - DOL_DOCUMENT_ROOT . "/contact/class/contact.class.php", |
|
| 168 | - DOL_DOCUMENT_ROOT . "/adherents/class/adherent.class.php", |
|
| 169 | - DOL_DOCUMENT_ROOT . "/product/class/product.class.php", |
|
| 170 | - DOL_DOCUMENT_ROOT . "/product/class/product.class.php", |
|
| 171 | - DOL_DOCUMENT_ROOT . "/comm/propal/class/propal.class.php", |
|
| 172 | - DOL_DOCUMENT_ROOT . "/commande/class/commande.class.php", |
|
| 173 | - DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php", |
|
| 174 | - DOL_DOCUMENT_ROOT . "/contrat/class/contrat.class.php", |
|
| 175 | - DOL_DOCUMENT_ROOT . "/fichinter/class/fichinter.class.php", |
|
| 176 | - DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.commande.class.php", |
|
| 177 | - DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.facture.class.php", |
|
| 178 | - DOL_DOCUMENT_ROOT . "/supplier_proposal/class/supplier_proposal.class.php", |
|
| 179 | - DOL_DOCUMENT_ROOT . "/projet/class/project.class.php", |
|
| 180 | - DOL_DOCUMENT_ROOT . "/expensereport/class/expensereport.class.php", |
|
| 181 | - DOL_DOCUMENT_ROOT . "/don/class/don.class.php" |
|
| 163 | + DOL_DOCUMENT_ROOT."/user/class/user.class.php", |
|
| 164 | + DOL_DOCUMENT_ROOT."/societe/class/client.class.php", |
|
| 165 | + DOL_DOCUMENT_ROOT."/societe/class/client.class.php", |
|
| 166 | + DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php", |
|
| 167 | + DOL_DOCUMENT_ROOT."/contact/class/contact.class.php", |
|
| 168 | + DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php", |
|
| 169 | + DOL_DOCUMENT_ROOT."/product/class/product.class.php", |
|
| 170 | + DOL_DOCUMENT_ROOT."/product/class/product.class.php", |
|
| 171 | + DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php", |
|
| 172 | + DOL_DOCUMENT_ROOT."/commande/class/commande.class.php", |
|
| 173 | + DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php", |
|
| 174 | + DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php", |
|
| 175 | + DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php", |
|
| 176 | + DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php", |
|
| 177 | + DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php", |
|
| 178 | + DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php", |
|
| 179 | + DOL_DOCUMENT_ROOT."/projet/class/project.class.php", |
|
| 180 | + DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", |
|
| 181 | + DOL_DOCUMENT_ROOT."/don/class/don.class.php" |
|
| 182 | 182 | ); |
| 183 | 183 | // Name class containing the method load_state_board for each line |
| 184 | 184 | $classes = array('User', |
@@ -289,25 +289,25 @@ discard block |
||
| 289 | 289 | ); |
| 290 | 290 | */ |
| 291 | 291 | $links = array( |
| 292 | - BASE_URI . '/?controller=user&method=list', |
|
| 293 | - BASE_URI . '/?controller=societe&method=list&type=c&mainmenu=companies', |
|
| 294 | - BASE_URI . '/?controller=societe&method=list&type=p&mainmenu=companies', |
|
| 295 | - BASE_URI . '/?controller=societe&method=list&type=f&mainmenu=companies', |
|
| 296 | - BASE_URI . '/?controller=contact&method=list&mainmenu=companies', |
|
| 297 | - BASE_URI . '/?controller=adherents&method=list&statut=1&mainmenu=members', |
|
| 298 | - BASE_URI . '/?controller=product&method=list&type=0&mainmenu=products', |
|
| 299 | - BASE_URI . '/?controller=product&method=list&type=1&mainmenu=products', |
|
| 300 | - BASE_URI . '/?controller=comm/propal&method=list&mainmenu=commercial&leftmenu=propals', |
|
| 301 | - BASE_URI . '/?controller=commande&method=list&mainmenu=commercial&leftmenu=orders', |
|
| 302 | - BASE_URI . '/?controller=compta/facture&method=list&mainmenu=billing&leftmenu=customers_bills', |
|
| 303 | - BASE_URI . '/?controller=contrat&method=list&mainmenu=commercial&leftmenu=contracts', |
|
| 304 | - BASE_URI . '/?controller=fichinter&method=list&mainmenu=commercial&leftmenu=ficheinter', |
|
| 305 | - BASE_URI . '/?controller=fourn/commande&method=list&mainmenu=commercial&leftmenu=orders_suppliers', |
|
| 306 | - BASE_URI . '/?controller=fourn/facture&method=list&mainmenu=billing&leftmenu=suppliers_bills', |
|
| 307 | - BASE_URI . '/?controller=supplier_proposal&method=list&mainmenu=commercial&leftmenu=', |
|
| 308 | - BASE_URI . '/?controller=projet&method=list&mainmenu=project', |
|
| 309 | - BASE_URI . '/?controller=expensereport&method=list&mainmenu=hrm&leftmenu=expensereport', |
|
| 310 | - BASE_URI . '/?controller=don&method=list&leftmenu=donations' |
|
| 292 | + BASE_URI.'/?controller=user&method=list', |
|
| 293 | + BASE_URI.'/?controller=societe&method=list&type=c&mainmenu=companies', |
|
| 294 | + BASE_URI.'/?controller=societe&method=list&type=p&mainmenu=companies', |
|
| 295 | + BASE_URI.'/?controller=societe&method=list&type=f&mainmenu=companies', |
|
| 296 | + BASE_URI.'/?controller=contact&method=list&mainmenu=companies', |
|
| 297 | + BASE_URI.'/?controller=adherents&method=list&statut=1&mainmenu=members', |
|
| 298 | + BASE_URI.'/?controller=product&method=list&type=0&mainmenu=products', |
|
| 299 | + BASE_URI.'/?controller=product&method=list&type=1&mainmenu=products', |
|
| 300 | + BASE_URI.'/?controller=comm/propal&method=list&mainmenu=commercial&leftmenu=propals', |
|
| 301 | + BASE_URI.'/?controller=commande&method=list&mainmenu=commercial&leftmenu=orders', |
|
| 302 | + BASE_URI.'/?controller=compta/facture&method=list&mainmenu=billing&leftmenu=customers_bills', |
|
| 303 | + BASE_URI.'/?controller=contrat&method=list&mainmenu=commercial&leftmenu=contracts', |
|
| 304 | + BASE_URI.'/?controller=fichinter&method=list&mainmenu=commercial&leftmenu=ficheinter', |
|
| 305 | + BASE_URI.'/?controller=fourn/commande&method=list&mainmenu=commercial&leftmenu=orders_suppliers', |
|
| 306 | + BASE_URI.'/?controller=fourn/facture&method=list&mainmenu=billing&leftmenu=suppliers_bills', |
|
| 307 | + BASE_URI.'/?controller=supplier_proposal&method=list&mainmenu=commercial&leftmenu=', |
|
| 308 | + BASE_URI.'/?controller=projet&method=list&mainmenu=project', |
|
| 309 | + BASE_URI.'/?controller=expensereport&method=list&mainmenu=hrm&leftmenu=expensereport', |
|
| 310 | + BASE_URI.'/?controller=don&method=list&leftmenu=donations' |
|
| 311 | 311 | ); |
| 312 | 312 | // Translation lang files |
| 313 | 313 | $langfile = array("users", |
@@ -352,10 +352,10 @@ discard block |
||
| 352 | 352 | $langs->load($langfile[$key]); |
| 353 | 353 | $text = $langs->trans($titres[$key]); |
| 354 | 354 | //$sep=($conf->dol_use_jmobile?'<br>':' '); |
| 355 | - $boxstat .= '<a href="' . $links[$key] . '" class="boxstatsindicator thumbstat nobold nounderline">'; |
|
| 355 | + $boxstat .= '<a href="'.$links[$key].'" class="boxstatsindicator thumbstat nobold nounderline">'; |
|
| 356 | 356 | $boxstat .= '<div class="boxstats">'; |
| 357 | - $boxstat .= '<span class="boxstatstext" title="' . dol_escape_htmltag($text) . '">' . $text . '</span><br>'; |
|
| 358 | - $boxstat .= '<span class="boxstatsindicator">' . img_object("", $icons[$key], 'class="inline-block"') . ' ' . ($board->nb[$val] ? $board->nb[$val] : 0) . '</span>'; |
|
| 357 | + $boxstat .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>'; |
|
| 358 | + $boxstat .= '<span class="boxstatsindicator">'.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val] ? $board->nb[$val] : 0).'</span>'; |
|
| 359 | 359 | $boxstat .= '</div>'; |
| 360 | 360 | $boxstat .= '</a>'; |
| 361 | 361 | } |
@@ -389,11 +389,11 @@ discard block |
||
| 389 | 389 | $dashboardlines = array(); |
| 390 | 390 | |
| 391 | 391 | // Do not include sections without management permission |
| 392 | -require_once DOL_DOCUMENT_ROOT . '/core/class/workboardresponse.class.php'; |
|
| 392 | +require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php'; |
|
| 393 | 393 | |
| 394 | 394 | // Number of actions to do (late) |
| 395 | 395 | if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read) { |
| 396 | - include_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; |
|
| 396 | + include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
| 397 | 397 | $board = new ActionComm($db); |
| 398 | 398 | |
| 399 | 399 | $dashboardlines[] = $board->load_board($user); |
@@ -401,21 +401,21 @@ discard block |
||
| 401 | 401 | |
| 402 | 402 | // Number of project opened |
| 403 | 403 | if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { |
| 404 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 404 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 405 | 405 | $board = new Project($db); |
| 406 | 406 | $dashboardlines[] = $board->load_board($user); |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | // Number of tasks to do (late) |
| 410 | 410 | if (!empty($conf->projet->enabled) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { |
| 411 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
| 411 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
| 412 | 412 | $board = new Task($db); |
| 413 | 413 | $dashboardlines[] = $board->load_board($user); |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | // Number of commercial proposals opened (expired) |
| 417 | 417 | if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { |
| 418 | - include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; |
|
| 418 | + include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; |
|
| 419 | 419 | $board = new Propal($db); |
| 420 | 420 | $dashboardlines[] = $board->load_board($user, "opened"); |
| 421 | 421 | // Number of commercial proposals CLOSED signed (billed) |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | |
| 425 | 425 | // Number of commercial proposals opened (expired) |
| 426 | 426 | if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { |
| 427 | - include_once DOL_DOCUMENT_ROOT . '/supplier_proposal/class/supplier_proposal.class.php'; |
|
| 427 | + include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; |
|
| 428 | 428 | $board = new SupplierProposal($db); |
| 429 | 429 | $dashboardlines[] = $board->load_board($user, "opened"); |
| 430 | 430 | // Number of commercial proposals CLOSED signed (billed) |
@@ -433,21 +433,21 @@ discard block |
||
| 433 | 433 | |
| 434 | 434 | // Number of customer orders a deal |
| 435 | 435 | if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { |
| 436 | - include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; |
|
| 436 | + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; |
|
| 437 | 437 | $board = new Commande($db); |
| 438 | 438 | $dashboardlines[] = $board->load_board($user); |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | // Number of suppliers orders a deal |
| 442 | 442 | if (!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire) { |
| 443 | - include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; |
|
| 443 | + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; |
|
| 444 | 444 | $board = new CommandeFournisseur($db); |
| 445 | 445 | $dashboardlines[] = $board->load_board($user); |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | // Number of services enabled (delayed) |
| 449 | 449 | if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { |
| 450 | - include_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; |
|
| 450 | + include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; |
|
| 451 | 451 | $board = new Contrat($db); |
| 452 | 452 | $dashboardlines[] = $board->load_board($user, "inactives"); |
| 453 | 453 | // Number of active services (expired) |
@@ -455,23 +455,23 @@ discard block |
||
| 455 | 455 | } |
| 456 | 456 | // Number of invoices customers (has paid) |
| 457 | 457 | if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { |
| 458 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 458 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 459 | 459 | $board = new Facture($db); |
| 460 | 460 | $dashboardlines[] = $board->load_board($user); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | // Number of supplier invoices (has paid) |
| 464 | 464 | if (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->fournisseur->facture->lire)) { |
| 465 | - include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
| 465 | + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
| 466 | 466 | $board = new FactureFournisseur($db); |
| 467 | 467 | $dashboardlines[] = $board->load_board($user); |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | // Number of transactions to conciliate |
| 471 | 471 | if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->societe_id) { |
| 472 | - include_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 472 | + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 473 | 473 | $board = new Account($db); |
| 474 | - $nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate |
|
| 474 | + $nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate |
|
| 475 | 475 | if ($nb > 0) { |
| 476 | 476 | $dashboardlines[] = $board->load_board($user); |
| 477 | 477 | } |
@@ -479,28 +479,28 @@ discard block |
||
| 479 | 479 | |
| 480 | 480 | // Number of cheque to send |
| 481 | 481 | if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->societe_id && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) { |
| 482 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php'; |
|
| 482 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; |
|
| 483 | 483 | $board = new RemiseCheque($db); |
| 484 | 484 | $dashboardlines[] = $board->load_board($user); |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | // Number of foundation members |
| 488 | 488 | if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire && !$user->societe_id) { |
| 489 | - include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 489 | + include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 490 | 490 | $board = new Adherent($db); |
| 491 | 491 | $dashboardlines[] = $board->load_board($user); |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | // Number of expense reports to approve |
| 495 | 495 | if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) { |
| 496 | - include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; |
|
| 496 | + include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; |
|
| 497 | 497 | $board = new ExpenseReport($db); |
| 498 | 498 | $dashboardlines[] = $board->load_board($user, 'toapprove'); |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | // Number of expense reports to pay |
| 502 | 502 | if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) { |
| 503 | - include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; |
|
| 503 | + include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; |
|
| 504 | 504 | $board = new ExpenseReport($db); |
| 505 | 505 | $dashboardlines[] = $board->load_board($user, 'topay'); |
| 506 | 506 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | $object = new stdClass(); |
| 509 | 509 | $parameters = array(); |
| 510 | 510 | $action = ''; |
| 511 | -$reshook = $hookmanager->executeHooks('addOpenElementsDashboardLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 511 | +$reshook = $hookmanager->executeHooks('addOpenElementsDashboardLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 512 | 512 | if ($reshook == 0) { |
| 513 | 513 | $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray); |
| 514 | 514 | } |
@@ -538,20 +538,20 @@ discard block |
||
| 538 | 538 | //var_dump($totallate); |
| 539 | 539 | $boxwork = ''; |
| 540 | 540 | $boxwork .= '<div class="box">'; |
| 541 | -$boxwork .= '<table summary="' . dol_escape_htmltag($langs->trans("WorkingBoard")) . '" class="noborder boxtable boxtablenobottom boxworkingboard" width="100%">' . "\n"; |
|
| 541 | +$boxwork .= '<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable boxtablenobottom boxworkingboard" width="100%">'."\n"; |
|
| 542 | 542 | $boxwork .= '<tr class="liste_titre">'; |
| 543 | -$boxwork .= '<th class="liste_titre">' . $langs->trans("DolibarrWorkBoard") . '</th>'; |
|
| 544 | -$boxwork .= '</tr>' . "\n"; |
|
| 543 | +$boxwork .= '<th class="liste_titre">'.$langs->trans("DolibarrWorkBoard").'</th>'; |
|
| 544 | +$boxwork .= '</tr>'."\n"; |
|
| 545 | 545 | |
| 546 | 546 | if ($showweather) { |
| 547 | 547 | $boxwork .= '<tr class="nohover">'; |
| 548 | - $boxwork .= '<td class="nohover' . ($conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : '') . ' center valignmiddle">'; |
|
| 548 | + $boxwork .= '<td class="nohover'.($conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : '').' center valignmiddle">'; |
|
| 549 | 549 | $text = ''; |
| 550 | 550 | if ($totallate > 0) |
| 551 | - $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate") . ' (' . $langs->transnoentitiesnoconv("NActionsLate", $totallate . (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')) . ')'; |
|
| 551 | + $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate", $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; |
|
| 552 | 552 | else |
| 553 | 553 | $text = $langs->transnoentitiesnoconv("NoItemLate"); |
| 554 | - $text .= '. ' . $langs->transnoentitiesnoconv("LateDesc"); |
|
| 554 | + $text .= '. '.$langs->transnoentitiesnoconv("LateDesc"); |
|
| 555 | 555 | //$text.=$form->textwithpicto('',$langs->trans("LateDesc")); |
| 556 | 556 | $options = 'height="64px"'; |
| 557 | 557 | $boxwork .= showWeather($totallate, $text, $options); |
@@ -569,23 +569,23 @@ discard block |
||
| 569 | 569 | $nbworkboardempty++; |
| 570 | 570 | |
| 571 | 571 | $textlate = $langs->trans("NActionsLate", $board->nbtodolate); |
| 572 | - $textlate .= ' (' . $langs->trans("Late") . ' = ' . $langs->trans("DateReference") . ' > ' . $langs->trans("DateToday") . ' ' . (ceil($board->warning_delay) >= 0 ? '+' : '') . ceil($board->warning_delay) . ' ' . $langs->trans("days") . ')'; |
|
| 572 | + $textlate .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')'; |
|
| 573 | 573 | |
| 574 | 574 | $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">'; |
| 575 | 575 | $boxwork .= '<div class="boxstatscontent">'; |
| 576 | 576 | $sep = ($conf->dol_use_jmobile ? '<br>' : ' '); |
| 577 | - $boxwork .= '<span class="boxstatstext" title="' . dol_escape_htmltag($board->label) . '">' . $board->img . ' ' . $board->label . '</span><br>'; |
|
| 578 | - $boxwork .= '<a class="valignmiddle dashboardlineindicator" href="' . $board->url . '"><span class="dashboardlineindicator' . (($board->nbtodo == 0) ? ' dashboardlineok' : '') . '">' . $board->nbtodo . '</span></a>'; |
|
| 577 | + $boxwork .= '<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).'">'.$board->img.' '.$board->label.'</span><br>'; |
|
| 578 | + $boxwork .= '<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.$board->nbtodo.'</span></a>'; |
|
| 579 | 579 | if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { |
| 580 | - $boxwork .= ' / <a class="valignmiddle dashboardlineindicator" href="' . $board->url . '"><span class="dashboardlineindicator' . (($board->nbtodo == 0) ? ' dashboardlineok' : '') . '">' . price($board->total) . '</span></a>'; |
|
| 580 | + $boxwork .= ' / <a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.price($board->total).'</span></a>'; |
|
| 581 | 581 | } |
| 582 | 582 | $boxwork .= '</div>'; |
| 583 | 583 | if ($board->nbtodolate > 0) { |
| 584 | 584 | $boxwork .= '<div class="dashboardlinelatecoin nowrap">'; |
| 585 | - $boxwork .= '<a title="' . dol_escape_htmltag($textlate) . '" class="valignmiddle dashboardlineindicatorlate' . ($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok') . '" href="' . ((!$board->url_late) ? $board->url : $board->url_late ) . '">'; |
|
| 585 | + $boxwork .= '<a title="'.dol_escape_htmltag($textlate).'" class="valignmiddle dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'" href="'.((!$board->url_late) ? $board->url : $board->url_late).'">'; |
|
| 586 | 586 | //$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').''; |
| 587 | - $boxwork .= img_picto($textlate, "warning_white", 'class="inline-block hideonsmartphone valigntextbottom"') . ''; |
|
| 588 | - $boxwork .= '<span class="dashboardlineindicatorlate' . ($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok') . '">'; |
|
| 587 | + $boxwork .= img_picto($textlate, "warning_white", 'class="inline-block hideonsmartphone valigntextbottom"').''; |
|
| 588 | + $boxwork .= '<span class="dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'">'; |
|
| 589 | 589 | $boxwork .= $board->nbtodolate; |
| 590 | 590 | $boxwork .= '</span>'; |
| 591 | 591 | $boxwork .= '</a>'; |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | |
| 615 | 615 | $boxwork .= '</td></tr>'; |
| 616 | 616 | |
| 617 | -$boxwork .= '</table>'; // End table array of working board |
|
| 617 | +$boxwork .= '</table>'; // End table array of working board |
|
| 618 | 618 | $boxwork .= '</div>'; |
| 619 | 619 | |
| 620 | 620 | print '</div></div></div><div class="clearboth"></div>'; |
@@ -660,11 +660,11 @@ discard block |
||
| 660 | 660 | $message = ''; |
| 661 | 661 | |
| 662 | 662 | // Check if install lock file is present |
| 663 | - $lockfile = DOL_DATA_ROOT . '/install.lock'; |
|
| 664 | - if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT . "/install")) { |
|
| 663 | + $lockfile = DOL_DATA_ROOT.'/install.lock'; |
|
| 664 | + if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { |
|
| 665 | 665 | $langs->load("errors"); |
| 666 | 666 | //if (! empty($message)) $message.='<br>'; |
| 667 | - $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT) . ' ' . $langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT . "/install"), 0, 0, '1', 'clearboth'); |
|
| 667 | + $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); |
|
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | // Conf files must be in read only mode |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | $langs->load("errors"); |
| 673 | 673 | //$langs->load("other"); |
| 674 | 674 | //if (! empty($message)) $message.='<br>'; |
| 675 | - $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly") . ' ' . $langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT . "/install"), 0, 0, '1', 'clearboth'); |
|
| 675 | + $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); |
|
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | if ($message) { |
@@ -707,20 +707,20 @@ discard block |
||
| 707 | 707 | $used_conf = !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL'; |
| 708 | 708 | |
| 709 | 709 | $level0 = $offset; |
| 710 | - if (!empty($conf->global->{$used_conf . '0'})) { |
|
| 711 | - $level0 = $conf->global->{$used_conf . '0'}; |
|
| 710 | + if (!empty($conf->global->{$used_conf.'0'})) { |
|
| 711 | + $level0 = $conf->global->{$used_conf.'0'}; |
|
| 712 | 712 | } |
| 713 | 713 | $level1 = $offset + 1 * $factor; |
| 714 | - if (!empty($conf->global->{$used_conf . '1'})) { |
|
| 715 | - $level1 = $conf->global->{$used_conf . '1'}; |
|
| 714 | + if (!empty($conf->global->{$used_conf.'1'})) { |
|
| 715 | + $level1 = $conf->global->{$used_conf.'1'}; |
|
| 716 | 716 | } |
| 717 | 717 | $level2 = $offset + 2 * $factor; |
| 718 | - if (!empty($conf->global->{$used_conf . '2'})) { |
|
| 719 | - $level2 = $conf->global->{$used_conf . '2'}; |
|
| 718 | + if (!empty($conf->global->{$used_conf.'2'})) { |
|
| 719 | + $level2 = $conf->global->{$used_conf.'2'}; |
|
| 720 | 720 | } |
| 721 | 721 | $level3 = $offset + 3 * $factor; |
| 722 | - if (!empty($conf->global->{$used_conf . '3'})) { |
|
| 723 | - $level3 = $conf->global->{$used_conf . '3'}; |
|
| 722 | + if (!empty($conf->global->{$used_conf.'3'})) { |
|
| 723 | + $level3 = $conf->global->{$used_conf.'3'}; |
|
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | if ($totallate <= $level0) |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * \brief A set of functions for Dolibarr |
| 37 | 37 | * This file contains all frequently used functions. |
| 38 | 38 | */ |
| 39 | -include_once DOL_BASE_PATH . '/core/lib/json.lib.php'; |
|
| 39 | +include_once DOL_BASE_PATH.'/core/lib/json.lib.php'; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Function to return value of a static property when class |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | function getStaticMember($class, $member) |
| 53 | 53 | {
|
| 54 | - dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 54 | + dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 55 | 55 | |
| 56 | 56 | // This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member |
| 57 | 57 | /* if (version_compare(phpversion(), '5.3.0', '<')) |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | if (isset($class::$member)) |
| 78 | 78 | return $class::$member; |
| 79 | - dol_print_error('', 'Try to get a static member "' . $member . '" in class "' . $class . '" that does not exists or is not static.');
|
|
| 79 | + dol_print_error('', 'Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
|
|
| 80 | 80 | return null; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | function getDoliDBInstance($type, $host, $user, $pass, $name, $port) |
| 95 | 95 | {
|
| 96 | - require_once DOL_BASE_PATH . "/core/db/" . $type . '.class.php'; |
|
| 96 | + require_once DOL_BASE_PATH."/core/db/".$type.'.class.php'; |
|
| 97 | 97 | |
| 98 | - $class = 'DoliDB' . ucfirst($type); |
|
| 98 | + $class = 'DoliDB'.ucfirst($type); |
|
| 99 | 99 | $dolidb = new $class($type, $host, $user, $pass, $name, $port); |
| 100 | 100 | return $dolidb; |
| 101 | 101 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | function getBrowserInfo($user_agent) |
| 153 | 153 | {
|
| 154 | - include_once DOL_BASE_PATH . '/includes/mobiledetect/mobiledetectlib/Mobile_Detect.php'; |
|
| 154 | + include_once DOL_BASE_PATH.'/includes/mobiledetect/mobiledetectlib/Mobile_Detect.php'; |
|
| 155 | 155 | |
| 156 | 156 | $name = 'unknown'; |
| 157 | 157 | $version = ''; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $depth = $db->transaction_opened; |
| 265 | 265 | $disconnectdone = $db->close(); |
| 266 | 266 | } |
| 267 | - dol_syslog("--- End access to " . $_SERVER["PHP_SELF"] . (($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was ' . $depth . ')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO));
|
|
| 267 | + dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO));
|
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | if (empty($paramname)) |
| 310 | 310 | return 'BadFirstParameterForGETPOST'; |
| 311 | 311 | if (empty($check)) {
|
| 312 | - dol_syslog("Deprecated use of GETPOST, called with 1st param = " . $paramname . " and 2nd param is '', when calling page " . $_SERVER["PHP_SELF"], LOG_WARNING);
|
|
| 312 | + dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
|
| 313 | 313 | // Enable this line to know who call the GETPOST with '' $check parameter. |
| 314 | 314 | //var_dump(debug_backtrace()[0]); |
| 315 | 315 | } |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | $relativepathstring = $_SERVER["PHP_SELF"]; |
| 332 | 332 | // Clean $relativepathstring |
| 333 | 333 | if (constant('DOL_URL_ROOT'))
|
| 334 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_URL_ROOT'), '/') . '/', '', $relativepathstring);
|
|
| 334 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'), '/').'/', '', $relativepathstring);
|
|
| 335 | 335 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
|
| 336 | 336 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
|
| 337 | 337 | //var_dump($relativepathstring); |
@@ -339,8 +339,8 @@ discard block |
||
| 339 | 339 | // Code for search criteria persistence. |
| 340 | 340 | // Retrieve values if restore_lastsearch_values |
| 341 | 341 | if (!empty($_GET['restore_lastsearch_values'])) { // Use $_GET here and not GETPOST
|
| 342 | - if (!empty($_SESSION['lastsearch_values_' . $relativepathstring])) { // If there is saved values
|
|
| 343 | - $tmp = json_decode($_SESSION['lastsearch_values_' . $relativepathstring], true); |
|
| 342 | + if (!empty($_SESSION['lastsearch_values_'.$relativepathstring])) { // If there is saved values
|
|
| 343 | + $tmp = json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true); |
|
| 344 | 344 | if (is_array($tmp)) {
|
| 345 | 345 | foreach ($tmp as $key => $val) {
|
| 346 | 346 | if ($key == $paramname) { // We are on the requested parameter
|
@@ -351,12 +351,12 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | } |
| 353 | 353 | // If there is saved contextpage, page or limit |
| 354 | - if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_' . $relativepathstring])) {
|
|
| 355 | - $out = $_SESSION['lastsearch_contextpage_' . $relativepathstring]; |
|
| 356 | - } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_' . $relativepathstring])) {
|
|
| 357 | - $out = $_SESSION['lastsearch_page_' . $relativepathstring]; |
|
| 358 | - } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_' . $relativepathstring])) {
|
|
| 359 | - $out = $_SESSION['lastsearch_limit_' . $relativepathstring]; |
|
| 354 | + if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_'.$relativepathstring])) {
|
|
| 355 | + $out = $_SESSION['lastsearch_contextpage_'.$relativepathstring]; |
|
| 356 | + } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_'.$relativepathstring])) {
|
|
| 357 | + $out = $_SESSION['lastsearch_page_'.$relativepathstring]; |
|
| 358 | + } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_'.$relativepathstring])) {
|
|
| 359 | + $out = $_SESSION['lastsearch_limit_'.$relativepathstring]; |
|
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | // Else, retreive default values if we are not doing a sort |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | $qualified = 1; |
| 425 | 425 | |
| 426 | 426 | if ($qualified) {
|
| 427 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 427 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 428 | 428 | foreach ($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val) {
|
| 429 | 429 | if ($out) |
| 430 | 430 | $out .= ', '; |
@@ -460,11 +460,11 @@ discard block |
||
| 460 | 460 | if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) {
|
| 461 | 461 | // We made a search from quick search menu, do we still use default filter ? |
| 462 | 462 | if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) {
|
| 463 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 463 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 464 | 464 | $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); |
| 465 | 465 | } |
| 466 | 466 | } else {
|
| 467 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 467 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
|
|
| 468 | 468 | $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); |
| 469 | 469 | } |
| 470 | 470 | break; |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. |
| 483 | 483 | if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
|
| 484 | 484 | $maxloop = 20; |
| 485 | - $loopnb = 0; // Protection against infinite loop |
|
| 485 | + $loopnb = 0; // Protection against infinite loop |
|
| 486 | 486 | while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) { // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
|
| 487 | 487 | $loopnb++; |
| 488 | 488 | $newout = ''; |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | } elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID') {
|
| 528 | 528 | $newout = $conf->entity; |
| 529 | 529 | } else |
| 530 | - $newout = ''; // Key not found, we replace with empty string |
|
| 530 | + $newout = ''; // Key not found, we replace with empty string |
|
| 531 | 531 | |
| 532 | 532 | |
| 533 | 533 | |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | |
| 546 | 546 | |
| 547 | 547 | //var_dump('__'.$reg[1].'__ -> '.$newout);
|
| 548 | - $out = preg_replace('/__' . preg_quote($reg[1], '/') . '__/', $newout, $out);
|
|
| 548 | + $out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out);
|
|
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | |
@@ -663,15 +663,15 @@ discard block |
||
| 663 | 663 | else if (isset($_SERVER["SERVER_NAME"])) |
| 664 | 664 | return $_SERVER["SERVER_NAME"]; |
| 665 | 665 | } |
| 666 | - return dol_hash(DOL_DOCUMENT_ROOT . DOL_URL_ROOT); |
|
| 666 | + return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT); |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) {
|
| 670 | - return dol_hash($_SERVER["SERVER_NAME"] . $_SERVER["DOCUMENT_ROOT"] . DOL_DOCUMENT_ROOT . DOL_URL_ROOT); |
|
| 670 | + return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); |
|
| 671 | 671 | // Use this for a "readable" cookie name |
| 672 | 672 | //return dol_sanitizeFileName($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); |
| 673 | 673 | } |
| 674 | - return dol_hash(DOL_DOCUMENT_ROOT . DOL_URL_ROOT); |
|
| 674 | + return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT); |
|
| 675 | 675 | } |
| 676 | 676 | } |
| 677 | 677 | |
@@ -687,12 +687,12 @@ discard block |
||
| 687 | 687 | */ |
| 688 | 688 | function dol_include_once($relpath, $classname = '') |
| 689 | 689 | {
|
| 690 | - global $conf, $langs, $user, $mysoc; // Do not remove this. They must be defined for files we include. Other globals var must be retreived with $GLOBALS['var'] |
|
| 690 | + global $conf, $langs, $user, $mysoc; // Do not remove this. They must be defined for files we include. Other globals var must be retreived with $GLOBALS['var'] |
|
| 691 | 691 | |
| 692 | 692 | $fullpath = dol_buildpath($relpath); |
| 693 | 693 | |
| 694 | 694 | if (!file_exists($fullpath)) {
|
| 695 | - dol_syslog('functions::dol_include_once Tried to load unexisting file: ' . $relpath, LOG_ERR);
|
|
| 695 | + dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR);
|
|
| 696 | 696 | return false; |
| 697 | 697 | } |
| 698 | 698 | |
@@ -721,14 +721,14 @@ discard block |
||
| 721 | 721 | |
| 722 | 722 | if ($type == 0 /* empty($type) */) { // For a filesystem path
|
| 723 | 723 | //$res = DOL_BASE_PATH . '' . $path; // Standard default path |
| 724 | - $res = DOL_BASE_PATH . '/' . $path; // Standard default path |
|
| 724 | + $res = DOL_BASE_PATH.'/'.$path; // Standard default path |
|
| 725 | 725 | if (isset($conf->file->dol_document_root)) {
|
| 726 | 726 | foreach ($conf->file->dol_document_root as $key => $dirroot) { // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
| 727 | 727 | if ($key == 'main') {
|
| 728 | 728 | continue; |
| 729 | 729 | } |
| 730 | - if (file_exists($dirroot . '/' . $path)) {
|
|
| 731 | - $res = $dirroot . '/' . $path; |
|
| 730 | + if (file_exists($dirroot.'/'.$path)) {
|
|
| 731 | + $res = $dirroot.'/'.$path; |
|
| 732 | 732 | return $res; |
| 733 | 733 | } |
| 734 | 734 | } |
@@ -745,11 +745,11 @@ discard block |
||
| 745 | 745 | // using proxy, rewriting, virtual path, etc... |
| 746 | 746 | $res = ''; |
| 747 | 747 | if ($type == 1) |
| 748 | - $res = /* DOL_URL_ROOT */ DOL_BASE_URI . '/' . $path; // Standard value |
|
| 748 | + $res = /* DOL_URL_ROOT */ DOL_BASE_URI.'/'.$path; // Standard value |
|
| 749 | 749 | if ($type == 2) |
| 750 | - $res = /* DOL_MAIN_URL_ROOT */ DOL_BASE_PATH . '/' . $path; // Standard value |
|
| 750 | + $res = /* DOL_MAIN_URL_ROOT */ DOL_BASE_PATH.'/'.$path; // Standard value |
|
| 751 | 751 | if ($type == 3) |
| 752 | - $res = DOL_URL_ROOT . '/' . $path; |
|
| 752 | + $res = DOL_URL_ROOT.'/'.$path; |
|
| 753 | 753 | |
| 754 | 754 | foreach ($conf->file->dol_document_root as $key => $dirroot) { // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
| 755 | 755 | if ($key == 'main') {
|
@@ -757,33 +757,33 @@ discard block |
||
| 757 | 757 | global $dolibarr_main_url_root; |
| 758 | 758 | |
| 759 | 759 | // Define $urlwithroot |
| 760 | - $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
|
|
| 761 | - $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; // This is to use external domain name found into config file |
|
| 760 | + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
|
| 761 | + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
| 762 | 762 | //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
| 763 | 763 | |
| 764 | - $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot) . '/' . $path; // Test on start with http is for old conf syntax
|
|
| 764 | + $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot).'/'.$path; // Test on start with http is for old conf syntax
|
|
| 765 | 765 | } |
| 766 | 766 | continue; |
| 767 | 767 | } |
| 768 | - preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
|
|
| 768 | + preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
|
|
| 769 | 769 | if (!empty($regs[1])) {
|
| 770 | 770 | //print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n"; |
| 771 | - if (file_exists($dirroot . '/' . $regs[1])) {
|
|
| 771 | + if (file_exists($dirroot.'/'.$regs[1])) {
|
|
| 772 | 772 | if ($type == 1) {
|
| 773 | - $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_URL_ROOT) . $conf->file->dol_url_root[$key] . '/' . $path;
|
|
| 773 | + $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
|
|
| 774 | 774 | } |
| 775 | 775 | if ($type == 2) {
|
| 776 | - $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_MAIN_URL_ROOT) . $conf->file->dol_url_root[$key] . '/' . $path;
|
|
| 776 | + $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
|
|
| 777 | 777 | } |
| 778 | 778 | if ($type == 3) {
|
| 779 | 779 | global $dolibarr_main_url_root; |
| 780 | 780 | |
| 781 | 781 | // Define $urlwithroot |
| 782 | - $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
|
|
| 783 | - $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; // This is to use external domain name found into config file |
|
| 782 | + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
|
| 783 | + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
| 784 | 784 | //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
| 785 | 785 | |
| 786 | - $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot) . $conf->file->dol_url_root[$key] . '/' . $path; // Test on start with http is for old conf syntax
|
|
| 786 | + $res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : $urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax
|
|
| 787 | 787 | } |
| 788 | 788 | break; |
| 789 | 789 | } |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | if (empty($native)) {
|
| 812 | 812 | $myclone = unserialize(serialize($object)); |
| 813 | 813 | } else {
|
| 814 | - $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable) |
|
| 814 | + $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable) |
|
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | return $myclone; |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | */ |
| 933 | 933 | function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '') |
| 934 | 934 | {
|
| 935 | - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName
|
|
| 935 | + $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName
|
|
| 936 | 936 | $forbidden_chars_to_remove = array(); |
| 937 | 937 | if (is_array($badcharstoreplace)) |
| 938 | 938 | $forbidden_chars_to_replace = $badcharstoreplace; |
@@ -995,12 +995,12 @@ discard block |
||
| 995 | 995 | function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0) |
| 996 | 996 | {
|
| 997 | 997 | // escape quotes and backslashes, newlines, etc. |
| 998 | - $tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars_decode instead, that make only required change for html tags |
|
| 998 | + $tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars_decode instead, that make only required change for html tags |
|
| 999 | 999 | if (!$keepb) |
| 1000 | 1000 | $tmp = strtr($tmp, array("<b>" => '', '</b>' => ''));
|
| 1001 | 1001 | if (!$keepn) |
| 1002 | 1002 | $tmp = strtr($tmp, array("\r" => '\\r', "\n" => '\\n'));
|
| 1003 | - return htmlentities($tmp, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars instead, that make only required change for html tags |
|
| 1003 | + return htmlentities($tmp, ENT_COMPAT, 'UTF-8'); // TODO Use htmlspecialchars instead, that make only required change for html tags |
|
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | /** |
@@ -1071,14 +1071,14 @@ discard block |
||
| 1071 | 1071 | $message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
| 1072 | 1072 | // If adding log inside HTML page is required |
| 1073 | 1073 | if (!empty($_REQUEST['logtohtml']) && (!empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || !empty($conf->global->MAIN_LOGTOHTML))) { // MAIN_LOGTOHTML kept for backward compatibility
|
| 1074 | - $conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S") . " " . $message; |
|
| 1074 | + $conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$message; |
|
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | 1077 | //TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output |
| 1078 | 1078 | // If html log tag enabled and url parameter log defined, we show output log on HTML comments |
| 1079 | 1079 | if (!empty($conf->global->MAIN_ENABLE_LOG_INLINE_HTML) && !empty($_GET["log"])) {
|
| 1080 | 1080 | print "\n\n<!-- Log start\n"; |
| 1081 | - print $message . "\n"; |
|
| 1081 | + print $message."\n"; |
|
| 1082 | 1082 | print "Log end -->\n"; |
| 1083 | 1083 | } |
| 1084 | 1084 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | |
| 1093 | 1093 | // This is when server run behind a reverse proxy |
| 1094 | 1094 | if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) |
| 1095 | - $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'] . (empty($_SERVER["REMOTE_ADDR"]) ? '' : '->' . $_SERVER['REMOTE_ADDR']); |
|
| 1095 | + $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'].(empty($_SERVER["REMOTE_ADDR"]) ? '' : '->'.$_SERVER['REMOTE_ADDR']); |
|
| 1096 | 1096 | // This is when server run normally on a server |
| 1097 | 1097 | else if (!empty($_SERVER["REMOTE_ADDR"])) |
| 1098 | 1098 | $data['ip'] = $_SERVER['REMOTE_ADDR']; |
@@ -1101,10 +1101,10 @@ discard block |
||
| 1101 | 1101 | $data['ip'] = $_SERVER['SERVER_ADDR']; |
| 1102 | 1102 | // This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it). |
| 1103 | 1103 | else if (!empty($_SERVER['COMPUTERNAME'])) |
| 1104 | - $data['ip'] = $_SERVER['COMPUTERNAME'] . (empty($_SERVER['USERNAME']) ? '' : '@' . $_SERVER['USERNAME']); |
|
| 1104 | + $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME']) ? '' : '@'.$_SERVER['USERNAME']); |
|
| 1105 | 1105 | // This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it). |
| 1106 | 1106 | else if (!empty($_SERVER['LOGNAME'])) |
| 1107 | - $data['ip'] = '???@' . $_SERVER['LOGNAME']; |
|
| 1107 | + $data['ip'] = '???@'.$_SERVER['LOGNAME']; |
|
| 1108 | 1108 | // Loop on each log handler and send output |
| 1109 | 1109 | foreach ($conf->loghandlers as $loghandlerinstance) {
|
| 1110 | 1110 | if ($restricttologhandler && $loghandlerinstance->code != $restricttologhandler) |
@@ -1156,10 +1156,10 @@ discard block |
||
| 1156 | 1156 | {
|
| 1157 | 1157 | global $conf, $langs, $hookmanager; |
| 1158 | 1158 | |
| 1159 | - $out = "\n" . '<div class="tabs" data-role="controlgroup" data-type="horizontal">' . "\n"; |
|
| 1159 | + $out = "\n".'<div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n"; |
|
| 1160 | 1160 | |
| 1161 | 1161 | if ($morehtmlright) {
|
| 1162 | - $out .= '<div class="inline-block floatright tabsElem">' . $morehtmlright . '</div>'; // Output right area first so when space is missing, text is in front of tabs and not under. |
|
| 1162 | + $out .= '<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under. |
|
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | 1165 | // Show title |
@@ -1170,8 +1170,8 @@ discard block |
||
| 1170 | 1170 | $limittitle = 30; |
| 1171 | 1171 | $out .= '<a class="tabTitle">'; |
| 1172 | 1172 | if ($picto) |
| 1173 | - $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_') . $picto, '', $pictoisfullpath) . ' '; |
|
| 1174 | - $out .= '<span class="tabTitleText">' . dol_trunc($title, $limittitle) . '</span>'; |
|
| 1173 | + $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath).' '; |
|
| 1174 | + $out .= '<span class="tabTitleText">'.dol_trunc($title, $limittitle).'</span>'; |
|
| 1175 | 1175 | $out .= '</a>'; |
| 1176 | 1176 | } |
| 1177 | 1177 | |
@@ -1211,23 +1211,23 @@ discard block |
||
| 1211 | 1211 | } |
| 1212 | 1212 | |
| 1213 | 1213 | if ($i < $limittoshow || $isactive) {
|
| 1214 | - $out .= '<div class="inline-block tabsElem' . ($isactive ? ' tabsElemActive' : '') . ((!$isactive && !empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '') . '"><!-- id tab = ' . (empty($links[$i][2]) ? '' : $links[$i][2]) . ' -->'; |
|
| 1214 | + $out .= '<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((!$isactive && !empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT)) ? ' hideonprint' : '').'"><!-- id tab = '.(empty($links[$i][2]) ? '' : $links[$i][2]).' -->'; |
|
| 1215 | 1215 | if (isset($links[$i][2]) && $links[$i][2] == 'image') {
|
| 1216 | 1216 | if (!empty($links[$i][0])) {
|
| 1217 | - $out .= '<a class="tabimage' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">' . $links[$i][1] . '</a>' . "\n"; |
|
| 1217 | + $out .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; |
|
| 1218 | 1218 | } else {
|
| 1219 | - $out .= '<span class="tabspan">' . $links[$i][1] . '</span>' . "\n"; |
|
| 1219 | + $out .= '<span class="tabspan">'.$links[$i][1].'</span>'."\n"; |
|
| 1220 | 1220 | } |
| 1221 | 1221 | } else if (!empty($links[$i][1])) {
|
| 1222 | 1222 | //print "x $i $active ".$links[$i][2]." z"; |
| 1223 | 1223 | if ($isactive) {
|
| 1224 | - $out .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="tabactive tab inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">'; |
|
| 1224 | + $out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; |
|
| 1225 | 1225 | $out .= $links[$i][1]; |
| 1226 | - $out .= '</a>' . "\n"; |
|
| 1226 | + $out .= '</a>'."\n"; |
|
| 1227 | 1227 | } else {
|
| 1228 | - $out .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="tabunactive tab inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">'; |
|
| 1228 | + $out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tabunactive tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; |
|
| 1229 | 1229 | $out .= $links[$i][1]; |
| 1230 | - $out .= '</a>' . "\n"; |
|
| 1230 | + $out .= '</a>'."\n"; |
|
| 1231 | 1231 | } |
| 1232 | 1232 | } |
| 1233 | 1233 | $out .= '</div>'; |
@@ -1240,14 +1240,14 @@ discard block |
||
| 1240 | 1240 | $outmore .= '<div class="popuptab wordwrap" style="display:inherit;">'; |
| 1241 | 1241 | if (isset($links[$i][2]) && $links[$i][2] == 'image') {
|
| 1242 | 1242 | if (!empty($links[$i][0])) |
| 1243 | - $outmore .= '<a class="tabimage' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">' . $links[$i][1] . '</a>' . "\n"; |
|
| 1243 | + $outmore .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; |
|
| 1244 | 1244 | else |
| 1245 | - $outmore .= '<span class="tabspan">' . $links[$i][1] . '</span>' . "\n"; |
|
| 1245 | + $outmore .= '<span class="tabspan">'.$links[$i][1].'</span>'."\n"; |
|
| 1246 | 1246 | } |
| 1247 | 1247 | else if (!empty($links[$i][1])) {
|
| 1248 | - $outmore .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="wordwrap inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">'; |
|
| 1248 | + $outmore .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="wordwrap inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'; |
|
| 1249 | 1249 | $outmore .= preg_replace('/([a-z])\/([a-z])/i', '\\1 / \\2', $links[$i][1]); // Replace x/y with x / y to allow wrap on long composed texts.
|
| 1250 | - $outmore .= '</a>' . "\n"; |
|
| 1250 | + $outmore .= '</a>'."\n"; |
|
| 1251 | 1251 | } |
| 1252 | 1252 | $outmore .= '</div>'; |
| 1253 | 1253 | |
@@ -1263,24 +1263,24 @@ discard block |
||
| 1263 | 1263 | $right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
| 1264 | 1264 | |
| 1265 | 1265 | $tabsname = str_replace("@", "", $picto);
|
| 1266 | - $out .= '<div id="moretabs' . $tabsname . '" class="inline-block tabsElem">'; |
|
| 1267 | - $out .= '<a href="#" class="tab moretab inline-block tabunactive reposition">' . $langs->trans("More") . '... (' . $nbintab . ')</a>';
|
|
| 1268 | - $out .= '<div id="moretabsList' . $tabsname . '" style="position: absolute; ' . $left . ': -999em; text-align: ' . $left . '; margin:0px; padding:2px">'; |
|
| 1266 | + $out .= '<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">'; |
|
| 1267 | + $out .= '<a href="#" class="tab moretab inline-block tabunactive reposition">'.$langs->trans("More").'... ('.$nbintab.')</a>';
|
|
| 1268 | + $out .= '<div id="moretabsList'.$tabsname.'" style="position: absolute; '.$left.': -999em; text-align: '.$left.'; margin:0px; padding:2px">'; |
|
| 1269 | 1269 | $out .= $outmore; |
| 1270 | 1270 | $out .= '</div>'; |
| 1271 | 1271 | $out .= '<div></div>'; |
| 1272 | 1272 | $out .= "</div>\n"; |
| 1273 | 1273 | |
| 1274 | 1274 | $out .= "<script>"; |
| 1275 | - $out .= "$('#moretabs" . $tabsname . "').mouseenter( function() { console.log('mouseenter " . $left . "'); $('#moretabsList" . $tabsname . "').css('" . $left . "','auto');});";
|
|
| 1276 | - $out .= "$('#moretabs" . $tabsname . "').mouseleave( function() { console.log('mouseleave " . $left . "'); $('#moretabsList" . $tabsname . "').css('" . $left . "','-999em');});";
|
|
| 1275 | + $out .= "$('#moretabs".$tabsname."').mouseenter( function() { console.log('mouseenter ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','auto');});";
|
|
| 1276 | + $out .= "$('#moretabs".$tabsname."').mouseleave( function() { console.log('mouseleave ".$left."'); $('#moretabsList".$tabsname."').css('".$left."','-999em');});";
|
|
| 1277 | 1277 | $out .= "</script>"; |
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | 1280 | $out .= "</div>\n"; |
| 1281 | 1281 | |
| 1282 | 1282 | if (!$notab || $notab == -1) |
| 1283 | - $out .= "\n" . '<div class="tabBar' . ($notab == -1 ? '' : ' tabBarWithBottom') . '">' . "\n"; |
|
| 1283 | + $out .= "\n".'<div class="tabBar'.($notab == -1 ? '' : ' tabBarWithBottom').'">'."\n"; |
|
| 1284 | 1284 | |
| 1285 | 1285 | $parameters = array('tabname' => $active, 'out' => $out);
|
| 1286 | 1286 | $reshook = $hookmanager->executeHooks('printTabsHead', $parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead"
|
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | if ($conf->browser->layout == 'phone') |
| 1390 | 1390 | $maxvisiblephotos = 1; |
| 1391 | 1391 | if ($showimage) |
| 1392 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $object->show_photos('product', $conf->product->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0) . '</div>';
|
|
| 1392 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('product', $conf->product->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0).'</div>';
|
|
| 1393 | 1393 | else {
|
| 1394 | 1394 | if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
|
| 1395 | 1395 | $nophoto = ''; |
@@ -1398,18 +1398,18 @@ discard block |
||
| 1398 | 1398 | //elseif ($conf->browser->layout != 'phone') { // Show no photo link
|
| 1399 | 1399 | $nophoto = '/public/theme/common/nophoto.png'; |
| 1400 | 1400 | // $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '"></div>'; |
| 1401 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>'; |
|
| 1401 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.DOL_BASE_URI.$nophoto.'"></div>'; |
|
| 1402 | 1402 | //} |
| 1403 | 1403 | } |
| 1404 | 1404 | } elseif ($object->element == 'ticket') {
|
| 1405 | 1405 | $width = 80; |
| 1406 | 1406 | $cssclass = 'photoref'; |
| 1407 | - $showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity] . '/' . $object->track_id); |
|
| 1407 | + $showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity].'/'.$object->track_id); |
|
| 1408 | 1408 | $maxvisiblephotos = (isset($conf->global->TICKETSUP_MAX_VISIBLE_PHOTO) ? $conf->global->TICKETSUP_MAX_VISIBLE_PHOTO : 2); |
| 1409 | 1409 | if ($conf->browser->layout == 'phone') |
| 1410 | 1410 | $maxvisiblephotos = 1; |
| 1411 | 1411 | if ($showimage) |
| 1412 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $object->show_photos('ticket', $conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0) . '</div>';
|
|
| 1412 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('ticket', $conf->ticket->multidir_output[$entity], 'small', $maxvisiblephotos, 0, 0, 0, $width, 0).'</div>';
|
|
| 1413 | 1413 | else {
|
| 1414 | 1414 | if (!empty($conf->global->TICKETSUP_NODISPLAYIFNOPHOTO)) {
|
| 1415 | 1415 | $nophoto = ''; |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | //elseif ($conf->browser->layout != 'phone') { // Show no photo link
|
| 1419 | 1419 | $nophoto = '/public/theme/common/nophoto.png'; |
| 1420 | 1420 | //$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '"></div>'; |
| 1421 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . DOL_BASE_URI . $nophoto . '"></div>'; |
|
| 1421 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.DOL_BASE_URI.$nophoto.'"></div>'; |
|
| 1422 | 1422 | //} |
| 1423 | 1423 | } |
| 1424 | 1424 | } else {
|
@@ -1428,25 +1428,25 @@ discard block |
||
| 1428 | 1428 | // Check if a preview file is available |
| 1429 | 1429 | if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice', 'expensereport')) && class_exists("Imagick")) {
|
| 1430 | 1430 | $objectref = dol_sanitizeFileName($object->ref); |
| 1431 | - $dir_output = (empty($conf->$modulepart->multidir_output[$entity]) ? $conf->$modulepart->dir_output : $conf->$modulepart->multidir_output[$entity]) . "/"; |
|
| 1431 | + $dir_output = (empty($conf->$modulepart->multidir_output[$entity]) ? $conf->$modulepart->dir_output : $conf->$modulepart->multidir_output[$entity])."/"; |
|
| 1432 | 1432 | if (in_array($modulepart, array('invoice_supplier', 'supplier_invoice'))) {
|
| 1433 | 1433 | $subdir = get_exdir($object->id, 2, 0, 1, $object, $modulepart); |
| 1434 | - $subdir .= ((!empty($subdir) && !preg_match('/\/$/', $subdir)) ? '/' : '') . $objectref; // the objectref dir is not included into get_exdir when used with level=2, so we add it at end
|
|
| 1434 | + $subdir .= ((!empty($subdir) && !preg_match('/\/$/', $subdir)) ? '/' : '').$objectref; // the objectref dir is not included into get_exdir when used with level=2, so we add it at end
|
|
| 1435 | 1435 | } else {
|
| 1436 | 1436 | $subdir = get_exdir($object->id, 0, 0, 1, $object, $modulepart); |
| 1437 | 1437 | } |
| 1438 | 1438 | if (empty($subdir)) |
| 1439 | 1439 | $subdir = 'errorgettingsubdirofobject'; // Protection to avoid to return empty path |
| 1440 | 1440 | |
| 1441 | - $filepath = $dir_output . $subdir . "/"; |
|
| 1441 | + $filepath = $dir_output.$subdir."/"; |
|
| 1442 | 1442 | |
| 1443 | - $file = $filepath . $objectref . ".pdf"; |
|
| 1444 | - $relativepath = $subdir . '/' . $objectref . '.pdf'; |
|
| 1443 | + $file = $filepath.$objectref.".pdf"; |
|
| 1444 | + $relativepath = $subdir.'/'.$objectref.'.pdf'; |
|
| 1445 | 1445 | |
| 1446 | 1446 | // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") |
| 1447 | - $fileimage = $file . '_preview.png'; // If PDF has 1 page |
|
| 1448 | - $fileimagebis = $file . '_preview-0.png'; // If PDF has more than one page |
|
| 1449 | - $relativepathimage = $relativepath . '_preview.png'; |
|
| 1447 | + $fileimage = $file.'_preview.png'; // If PDF has 1 page |
|
| 1448 | + $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page |
|
| 1449 | + $relativepathimage = $relativepath.'_preview.png'; |
|
| 1450 | 1450 | |
| 1451 | 1451 | // Si fichier PDF existe |
| 1452 | 1452 | if (file_exists($file)) {
|
@@ -1455,7 +1455,7 @@ discard block |
||
| 1455 | 1455 | if ((!file_exists($fileimage) || (filemtime($fileimage) < filemtime($file))) && (!file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) |
| 1456 | 1456 | ) {
|
| 1457 | 1457 | if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) { // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
|
| 1458 | - include_once DOL_BASE_PATH . '/core/lib/files.lib.php'; |
|
| 1458 | + include_once DOL_BASE_PATH.'/core/lib/files.lib.php'; |
|
| 1459 | 1459 | $ret = dol_convert_file($file, 'png', $fileimage); |
| 1460 | 1460 | if ($ret < 0) |
| 1461 | 1461 | $error++; |
@@ -1468,14 +1468,14 @@ discard block |
||
| 1468 | 1468 | // Si fichier png PDF d'1 page trouve |
| 1469 | 1469 | if (file_exists($fileimage)) {
|
| 1470 | 1470 | $phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">'; |
| 1471 | - $phototoshow .= '<img height="' . $heightforphotref . '" class="photo photowithmargin photowithborder" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=apercu' . $modulepart . '&file=' . urlencode($relativepathimage) . '">'; |
|
| 1471 | + $phototoshow .= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($relativepathimage).'">'; |
|
| 1472 | 1472 | $phototoshow .= '</div></div>'; |
| 1473 | 1473 | } |
| 1474 | 1474 | // Si fichier png PDF de plus d'1 page trouve |
| 1475 | 1475 | elseif (file_exists($fileimagebis)) {
|
| 1476 | - $preview = preg_replace('/\.png/', '', $relativepathimage) . "-0.png";
|
|
| 1476 | + $preview = preg_replace('/\.png/', '', $relativepathimage)."-0.png";
|
|
| 1477 | 1477 | $phototoshow = '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">'; |
| 1478 | - $phototoshow .= '<img height="' . $heightforphotref . '" class="photo photowithmargin photowithborder" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=apercu' . $modulepart . '&file=' . urlencode($preview) . '"><p>'; |
|
| 1478 | + $phototoshow .= '<img height="'.$heightforphotref.'" class="photo photowithmargin photowithborder" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=apercu'.$modulepart.'&file='.urlencode($preview).'"><p>'; |
|
| 1479 | 1479 | $phototoshow .= '</div></div>'; |
| 1480 | 1480 | } |
| 1481 | 1481 | } |
@@ -1502,10 +1502,10 @@ discard block |
||
| 1502 | 1502 | $picto = $object->picto; |
| 1503 | 1503 | if ($object->element == 'project' && !$object->public) |
| 1504 | 1504 | $picto = 'project'; // instead of projectpub |
| 1505 | - $nophoto = img_picto('', 'object_' . $picto, '', false, 1);
|
|
| 1505 | + $nophoto = img_picto('', 'object_'.$picto, '', false, 1);
|
|
| 1506 | 1506 | } |
| 1507 | 1507 | $morehtmlleft .= '<!-- No photo to show -->'; |
| 1508 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="No photo" border="0"' . ($width ? ' width="' . $width . '"' : '') . ' src="' . $nophoto . '"></div></div>'; |
|
| 1508 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" border="0"'.($width ? ' width="'.$width.'"' : '').' src="'.$nophoto.'"></div></div>'; |
|
| 1509 | 1509 | |
| 1510 | 1510 | $morehtmlleft .= '</div>'; |
| 1511 | 1511 | } |
@@ -1513,7 +1513,7 @@ discard block |
||
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | if ($showbarcode) |
| 1516 | - $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">' . $form->showbarcode($object) . '</div>'; |
|
| 1516 | + $morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>'; |
|
| 1517 | 1517 | |
| 1518 | 1518 | if ($object->element == 'societe') {
|
| 1519 | 1519 | if (!empty($conf->use_javascript_ajax) && $user->rights->societe->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
@@ -1526,14 +1526,14 @@ discard block |
||
| 1526 | 1526 | if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
| 1527 | 1527 | $morehtmlstatus .= ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); |
| 1528 | 1528 | } else {
|
| 1529 | - $morehtmlstatus .= '<span class="statusrefsell">' . $object->getLibStatut(5, 0) . '</span>'; |
|
| 1529 | + $morehtmlstatus .= '<span class="statusrefsell">'.$object->getLibStatut(5, 0).'</span>'; |
|
| 1530 | 1530 | } |
| 1531 | 1531 | $morehtmlstatus .= ' '; |
| 1532 | 1532 | //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') ';
|
| 1533 | 1533 | if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
| 1534 | 1534 | $morehtmlstatus .= ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); |
| 1535 | 1535 | } else {
|
| 1536 | - $morehtmlstatus .= '<span class="statusrefbuy">' . $object->getLibStatut(5, 1) . '</span>'; |
|
| 1536 | + $morehtmlstatus .= '<span class="statusrefbuy">'.$object->getLibStatut(5, 1).'</span>'; |
|
| 1537 | 1537 | } |
| 1538 | 1538 | } elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan'))) {
|
| 1539 | 1539 | $tmptxt = $object->getLibStatut(6, $object->totalpaye); |
@@ -1560,7 +1560,7 @@ discard block |
||
| 1560 | 1560 | if ($object->progress >= 100) |
| 1561 | 1561 | $object->fk_statut = 3; |
| 1562 | 1562 | $tmptxt = $object->getLibStatut(5); |
| 1563 | - $morehtmlstatus .= $tmptxt; // No status on task |
|
| 1563 | + $morehtmlstatus .= $tmptxt; // No status on task |
|
| 1564 | 1564 | } |
| 1565 | 1565 | else { // Generic case
|
| 1566 | 1566 | $tmptxt = $object->getLibStatut(6); |
@@ -1574,18 +1574,18 @@ discard block |
||
| 1574 | 1574 | if (method_exists($object, 'getVentilExportCompta')) {
|
| 1575 | 1575 | $accounted = $object->getVentilExportCompta(); |
| 1576 | 1576 | $langs->load("accountancy");
|
| 1577 | - $morehtmlstatus .= '</div><div class="statusref statusrefbis">' . ($accounted > 0 ? $langs->trans("Accounted") : $langs->trans("NotYetAccounted"));
|
|
| 1577 | + $morehtmlstatus .= '</div><div class="statusref statusrefbis">'.($accounted > 0 ? $langs->trans("Accounted") : $langs->trans("NotYetAccounted"));
|
|
| 1578 | 1578 | } |
| 1579 | 1579 | } |
| 1580 | 1580 | |
| 1581 | 1581 | // Add alias for thirdparty |
| 1582 | 1582 | if (!empty($object->name_alias)) |
| 1583 | - $morehtmlref .= '<div class="refidno">' . $object->name_alias . '</div>'; |
|
| 1583 | + $morehtmlref .= '<div class="refidno">'.$object->name_alias.'</div>'; |
|
| 1584 | 1584 | |
| 1585 | 1585 | // Add label |
| 1586 | 1586 | if ($object->element == 'product' || $object->element == 'bank_account' || $object->element == 'project_task') {
|
| 1587 | 1587 | if (!empty($object->label)) |
| 1588 | - $morehtmlref .= '<div class="refidno">' . $object->label . '</div>'; |
|
| 1588 | + $morehtmlref .= '<div class="refidno">'.$object->label.'</div>'; |
|
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 1591 | 1591 | if (method_exists($object, 'getBannerAddress') && $object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories' && $object->element != 'ecm_files') {
|
@@ -1595,11 +1595,11 @@ discard block |
||
| 1595 | 1595 | } |
| 1596 | 1596 | if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member', 'product'))) {
|
| 1597 | 1597 | $morehtmlref .= '<div style="clear: both;"></div><div class="refidno">'; |
| 1598 | - $morehtmlref .= $langs->trans("TechnicalID") . ': ' . $object->id;
|
|
| 1598 | + $morehtmlref .= $langs->trans("TechnicalID").': '.$object->id;
|
|
| 1599 | 1599 | $morehtmlref .= '</div>'; |
| 1600 | 1600 | } |
| 1601 | 1601 | |
| 1602 | - print '<div class="' . ($onlybanner ? 'arearefnobottom ' : 'arearef ') . 'heightref valignmiddle" width="100%">'; |
|
| 1602 | + print '<div class="'.($onlybanner ? 'arearefnobottom ' : 'arearef ').'heightref valignmiddle" width="100%">'; |
|
| 1603 | 1603 | print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); |
| 1604 | 1604 | print '</div>'; |
| 1605 | 1605 | print '<div class="underrefbanner clearboth"></div>'; |
@@ -1621,7 +1621,7 @@ discard block |
||
| 1621 | 1621 | if ($fieldrequired) |
| 1622 | 1622 | $ret .= '<span class="fieldrequired">'; |
| 1623 | 1623 | if (($conf->dol_use_jmobile != 4)) |
| 1624 | - $ret .= '<label for="' . $fieldkey . '">'; |
|
| 1624 | + $ret .= '<label for="'.$fieldkey.'">'; |
|
| 1625 | 1625 | $ret .= $langs->trans($langkey); |
| 1626 | 1626 | if (($conf->dol_use_jmobile != 4)) |
| 1627 | 1627 | $ret .= '</label>'; |
@@ -1640,9 +1640,9 @@ discard block |
||
| 1640 | 1640 | function dol_bc($var, $moreclass = '') |
| 1641 | 1641 | {
|
| 1642 | 1642 | global $bc; |
| 1643 | - $ret = ' ' . $bc[$var]; |
|
| 1643 | + $ret = ' '.$bc[$var]; |
|
| 1644 | 1644 | if ($moreclass) |
| 1645 | - $ret = preg_replace('/class=\"/', 'class="' . $moreclass . ' ', $ret);
|
|
| 1645 | + $ret = preg_replace('/class=\"/', 'class="'.$moreclass.' ', $ret);
|
|
| 1646 | 1646 | return $ret; |
| 1647 | 1647 | } |
| 1648 | 1648 | |
@@ -1662,50 +1662,50 @@ discard block |
||
| 1662 | 1662 | global $conf, $langs; |
| 1663 | 1663 | |
| 1664 | 1664 | $ret = ''; |
| 1665 | - $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
|
| 1665 | + $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
|
| 1666 | 1666 | // Address |
| 1667 | 1667 | if (empty($mode)) {
|
| 1668 | 1668 | $ret .= $object->address; |
| 1669 | 1669 | } |
| 1670 | 1670 | // Zip/Town/State |
| 1671 | 1671 | if (in_array($object->country_code, array('AU', 'CA', 'US')) || !empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) { // US: title firstname name \n address lines \n town, state, zip \n country
|
| 1672 | - $ret .= ($ret ? $sep : '' ) . $object->town; |
|
| 1672 | + $ret .= ($ret ? $sep : '').$object->town; |
|
| 1673 | 1673 | if ($object->state) {
|
| 1674 | - $ret .= ($ret ? ", " : '') . $object->state; |
|
| 1674 | + $ret .= ($ret ? ", " : '').$object->state; |
|
| 1675 | 1675 | } |
| 1676 | 1676 | if ($object->zip) |
| 1677 | - $ret .= ($ret ? ", " : '') . $object->zip; |
|
| 1677 | + $ret .= ($ret ? ", " : '').$object->zip; |
|
| 1678 | 1678 | } |
| 1679 | 1679 | else if (in_array($object->country_code, array('GB', 'UK'))) { // UK: title firstname name \n address lines \n town state \n zip \n country
|
| 1680 | - $ret .= ($ret ? $sep : '' ) . $object->town; |
|
| 1680 | + $ret .= ($ret ? $sep : '').$object->town; |
|
| 1681 | 1681 | if ($object->state) {
|
| 1682 | - $ret .= ($ret ? ", " : '') . $object->state; |
|
| 1682 | + $ret .= ($ret ? ", " : '').$object->state; |
|
| 1683 | 1683 | } |
| 1684 | 1684 | if ($object->zip) |
| 1685 | - $ret .= ($ret ? $sep : '' ) . $object->zip; |
|
| 1685 | + $ret .= ($ret ? $sep : '').$object->zip; |
|
| 1686 | 1686 | } |
| 1687 | 1687 | else if (in_array($object->country_code, array('ES', 'TR'))) { // ES: title firstname name \n address lines \n zip town \n state \n country
|
| 1688 | - $ret .= ($ret ? $sep : '' ) . $object->zip; |
|
| 1689 | - $ret .= ($object->town ? (($object->zip ? ' ' : '') . $object->town) : ''); |
|
| 1688 | + $ret .= ($ret ? $sep : '').$object->zip; |
|
| 1689 | + $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : ''); |
|
| 1690 | 1690 | if ($object->state) {
|
| 1691 | - $ret .= "\n" . $object->state; |
|
| 1691 | + $ret .= "\n".$object->state; |
|
| 1692 | 1692 | } |
| 1693 | 1693 | } else if (in_array($object->country_code, array('IT'))) { // IT: tile firstname name\n address lines \n zip (Code Departement) \n country
|
| 1694 | - $ret .= ($ret ? $sep : '' ) . $object->zip; |
|
| 1695 | - $ret .= ($object->town ? (($object->zip ? ' ' : '') . $object->town) : ''); |
|
| 1696 | - $ret .= ($object->departement_id ? (' (' . ($object->departement_id) . ')') : '');
|
|
| 1694 | + $ret .= ($ret ? $sep : '').$object->zip; |
|
| 1695 | + $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : ''); |
|
| 1696 | + $ret .= ($object->departement_id ? (' ('.($object->departement_id).')') : '');
|
|
| 1697 | 1697 | } else { // Other: title firstname name \n address lines \n zip town \n country
|
| 1698 | - $ret .= $object->zip ? (($ret ? $sep : '' ) . $object->zip) : ''; |
|
| 1699 | - $ret .= ($object->town ? (($object->zip ? ' ' : ($ret ? $sep : '' )) . $object->town) : ''); |
|
| 1698 | + $ret .= $object->zip ? (($ret ? $sep : '').$object->zip) : ''; |
|
| 1699 | + $ret .= ($object->town ? (($object->zip ? ' ' : ($ret ? $sep : '')).$object->town) : ''); |
|
| 1700 | 1700 | if ($object->state && in_array($object->country_code, $countriesusingstate)) {
|
| 1701 | - $ret .= ($ret ? ", " : '') . $object->state; |
|
| 1701 | + $ret .= ($ret ? ", " : '').$object->state; |
|
| 1702 | 1702 | } |
| 1703 | 1703 | } |
| 1704 | 1704 | if (!is_object($outputlangs)) |
| 1705 | 1705 | $outputlangs = $langs; |
| 1706 | 1706 | if ($withcountry) {
|
| 1707 | 1707 | $langs->load("dict");
|
| 1708 | - $ret .= ($object->country_code ? ($ret ? $sep : '') . $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $object->country_code)) : '');
|
|
| 1708 | + $ret .= ($object->country_code ? ($ret ? $sep : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)) : '');
|
|
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | 1711 | return $ret; |
@@ -1760,13 +1760,13 @@ discard block |
||
| 1760 | 1760 | if (is_string($tzoutput)) {
|
| 1761 | 1761 | if ($tzoutput == 'tzserver') {
|
| 1762 | 1762 | $to_gmt = false; |
| 1763 | - $offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion' |
|
| 1763 | + $offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion' |
|
| 1764 | 1764 | $offsettz = 0; |
| 1765 | 1765 | $offsetdst = 0; |
| 1766 | 1766 | } elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
|
| 1767 | 1767 | $to_gmt = true; |
| 1768 | 1768 | $offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion' |
| 1769 | - $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore |
|
| 1769 | + $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore |
|
| 1770 | 1770 | $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore |
| 1771 | 1771 | } |
| 1772 | 1772 | } |
@@ -1812,9 +1812,9 @@ discard block |
||
| 1812 | 1812 | else if ($format == 'dayxcard') |
| 1813 | 1813 | $format = '%Y%m%d'; |
| 1814 | 1814 | else if ($format == 'dayrfc') |
| 1815 | - $format = '%Y-%m-%d'; // DATE_RFC3339 |
|
| 1815 | + $format = '%Y-%m-%d'; // DATE_RFC3339 |
|
| 1816 | 1816 | else if ($format == 'dayhourrfc') |
| 1817 | - $format = '%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339 |
|
| 1817 | + $format = '%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339 |
|
| 1818 | 1818 | else if ($format == 'standard') |
| 1819 | 1819 | $format = '%Y-%m-%d %H:%M:%S'; |
| 1820 | 1820 | |
@@ -1825,7 +1825,7 @@ discard block |
||
| 1825 | 1825 | |
| 1826 | 1826 | // If date undefined or "", we return "" |
| 1827 | 1827 | if (dol_strlen($time) == 0) |
| 1828 | - return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) |
|
| 1828 | + return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) |
|
| 1829 | 1829 | |
| 1830 | 1830 | |
| 1831 | 1831 | |
@@ -1859,7 +1859,7 @@ discard block |
||
| 1859 | 1859 | if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg) || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) { // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
|
| 1860 | 1860 | // TODO Remove this. |
| 1861 | 1861 | // This part of code should not be used. |
| 1862 | - dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page " . $_SERVER["PHP_SELF"], LOG_ERR);
|
|
| 1862 | + dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR);
|
|
| 1863 | 1863 | // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' |
| 1864 | 1864 | $syear = (!empty($reg[1]) ? $reg[1] : ''); |
| 1865 | 1865 | $smonth = (!empty($reg[2]) ? $reg[2] : ''); |
@@ -1877,7 +1877,7 @@ discard block |
||
| 1877 | 1877 | |
| 1878 | 1878 | $ret = adodb_strftime($format, $timetouse, $to_gmt); |
| 1879 | 1879 | } else |
| 1880 | - $ret = 'Bad value ' . $time . ' for date'; |
|
| 1880 | + $ret = 'Bad value '.$time.' for date'; |
|
| 1881 | 1881 | } |
| 1882 | 1882 | |
| 1883 | 1883 | if (preg_match('/__b__/i', $format)) {
|
@@ -1886,11 +1886,11 @@ discard block |
||
| 1886 | 1886 | $month = adodb_strftime('%m', $timetouse);
|
| 1887 | 1887 | $month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
|
| 1888 | 1888 | if ($encodetooutput) {
|
| 1889 | - $monthtext = $outputlangs->transnoentities('Month' . $month);
|
|
| 1890 | - $monthtextshort = $outputlangs->transnoentities('MonthShort' . $month);
|
|
| 1889 | + $monthtext = $outputlangs->transnoentities('Month'.$month);
|
|
| 1890 | + $monthtextshort = $outputlangs->transnoentities('MonthShort'.$month);
|
|
| 1891 | 1891 | } else {
|
| 1892 | - $monthtext = $outputlangs->transnoentitiesnoconv('Month' . $month);
|
|
| 1893 | - $monthtextshort = $outputlangs->transnoentitiesnoconv('MonthShort' . $month);
|
|
| 1892 | + $monthtext = $outputlangs->transnoentitiesnoconv('Month'.$month);
|
|
| 1893 | + $monthtextshort = $outputlangs->transnoentitiesnoconv('MonthShort'.$month);
|
|
| 1894 | 1894 | } |
| 1895 | 1895 | //print 'monthtext='.$monthtext.' monthtextshort='.$monthtextshort; |
| 1896 | 1896 | $ret = str_replace('__b__', $monthtextshort, $ret);
|
@@ -1901,8 +1901,8 @@ discard block |
||
| 1901 | 1901 | if (preg_match('/__a__/i', $format)) {
|
| 1902 | 1902 | $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. |
| 1903 | 1903 | |
| 1904 | - $w = adodb_strftime('%w', $timetouse); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
|
| 1905 | - $dayweek = $outputlangs->transnoentitiesnoconv('Day' . $w);
|
|
| 1904 | + $w = adodb_strftime('%w', $timetouse); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
|
| 1905 | + $dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w);
|
|
| 1906 | 1906 | $ret = str_replace('__A__', $dayweek, $ret);
|
| 1907 | 1907 | $ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret);
|
| 1908 | 1908 | } |
@@ -1949,9 +1949,9 @@ discard block |
||
| 1949 | 1949 | |
| 1950 | 1950 | $usealternatemethod = false; |
| 1951 | 1951 | if ($timestamp <= 0) |
| 1952 | - $usealternatemethod = true; // <= 1970 |
|
| 1952 | + $usealternatemethod = true; // <= 1970 |
|
| 1953 | 1953 | if ($timestamp >= 2145913200) |
| 1954 | - $usealternatemethod = true; // >= 2038 |
|
| 1954 | + $usealternatemethod = true; // >= 2038 |
|
| 1955 | 1955 | |
| 1956 | 1956 | if ($usealternatemethod) {
|
| 1957 | 1957 | $arrayinfo = adodb_getdate($timestamp, $fast); |
@@ -2011,23 +2011,23 @@ discard block |
||
| 2011 | 2011 | |
| 2012 | 2012 | if (method_exists('DateTime', 'getTimestamp')) {
|
| 2013 | 2013 | if (empty($gm) || $gm === 'server') {
|
| 2014 | - $default_timezone = @date_default_timezone_get(); // Example 'Europe/Berlin' |
|
| 2014 | + $default_timezone = @date_default_timezone_get(); // Example 'Europe/Berlin' |
|
| 2015 | 2015 | $localtz = new DateTimeZone($default_timezone); |
| 2016 | 2016 | } else if ($gm === 'user') {
|
| 2017 | 2017 | // We use dol_tz_string first because it is more reliable. |
| 2018 | - $default_timezone = (empty($_SESSION["dol_tz_string"]) ? @date_default_timezone_get() : $_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' |
|
| 2018 | + $default_timezone = (empty($_SESSION["dol_tz_string"]) ? @date_default_timezone_get() : $_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' |
|
| 2019 | 2019 | try {
|
| 2020 | 2020 | $localtz = new DateTimeZone($default_timezone); |
| 2021 | 2021 | } catch (Exception $e) {
|
| 2022 | - dol_syslog("Warning dol_tz_string contains an invalid value " . $_SESSION["dol_tz_string"], LOG_WARNING);
|
|
| 2022 | + dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING);
|
|
| 2023 | 2023 | $default_timezone = @date_default_timezone_get(); |
| 2024 | 2024 | } |
| 2025 | 2025 | } else if (strrpos($gm, "tz,") !== false) {
|
| 2026 | - $timezone = str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin'
|
|
| 2026 | + $timezone = str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin'
|
|
| 2027 | 2027 | try {
|
| 2028 | 2028 | $localtz = new DateTimeZone($timezone); |
| 2029 | 2029 | } catch (Exception $e) {
|
| 2030 | - dol_syslog("Warning passed timezone contains an invalid value " . $timezone, LOG_WARNING);
|
|
| 2030 | + dol_syslog("Warning passed timezone contains an invalid value ".$timezone, LOG_WARNING);
|
|
| 2031 | 2031 | } |
| 2032 | 2032 | } |
| 2033 | 2033 | |
@@ -2066,8 +2066,8 @@ discard block |
||
| 2066 | 2066 | if ($mode == 'gmt') |
| 2067 | 2067 | $ret = time(); // Time for now at greenwich. |
| 2068 | 2068 | else if ($mode == 'tzserver') { // Time for now with PHP server timezone added
|
| 2069 | - require_once DOL_BASE_PATH . '/core/lib/date.lib.php'; |
|
| 2070 | - $tzsecond = getServerTimeZoneInt('now'); // Contains tz+dayling saving time
|
|
| 2069 | + require_once DOL_BASE_PATH.'/core/lib/date.lib.php'; |
|
| 2070 | + $tzsecond = getServerTimeZoneInt('now'); // Contains tz+dayling saving time
|
|
| 2071 | 2071 | $ret = (int) (dol_now('gmt') + ($tzsecond * 3600));
|
| 2072 | 2072 | } |
| 2073 | 2073 | /* else if ($mode == 'tzref') // Time for now with parent company timezone is added |
@@ -2113,9 +2113,9 @@ discard block |
||
| 2113 | 2113 | } |
| 2114 | 2114 | // Use long or short text unit |
| 2115 | 2115 | if (empty($shortunit)) {
|
| 2116 | - $ret .= ' ' . $textunitlong; |
|
| 2116 | + $ret .= ' '.$textunitlong; |
|
| 2117 | 2117 | } else {
|
| 2118 | - $ret .= ' ' . $textunitshort; |
|
| 2118 | + $ret .= ' '.$textunitshort; |
|
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | 2121 | return $ret; |
@@ -2143,13 +2143,13 @@ discard block |
||
| 2143 | 2143 | $link .= $url; |
| 2144 | 2144 | $link .= '"'; |
| 2145 | 2145 | if ($target) |
| 2146 | - $link .= ' target="' . $target . '"'; |
|
| 2146 | + $link .= ' target="'.$target.'"'; |
|
| 2147 | 2147 | $link .= '>'; |
| 2148 | 2148 | if (!preg_match('/^http/i', $url))
|
| 2149 | 2149 | $link .= 'http://'; |
| 2150 | 2150 | $link .= dol_trunc($url, $max); |
| 2151 | 2151 | $link .= '</a>'; |
| 2152 | - return '<div class="nospan float" style="margin-right: 10px">' . ($withpicto ? img_picto($langs->trans("Url"), 'object_globe.png') . ' ' : '') . $link . '</div>';
|
|
| 2152 | + return '<div class="nospan float" style="margin-right: 10px">'.($withpicto ? img_picto($langs->trans("Url"), 'object_globe.png').' ' : '').$link.'</div>';
|
|
| 2153 | 2153 | } |
| 2154 | 2154 | |
| 2155 | 2155 | /** |
@@ -2190,9 +2190,9 @@ discard block |
||
| 2190 | 2190 | $type = 'AC_EMAIL'; |
| 2191 | 2191 | $link = ''; |
| 2192 | 2192 | if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) |
| 2193 | - $link = '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&backtopage=1&actioncode=' . $type . '&contactid=' . $cid . '&socid=' . $socid . '">' . img_object($langs->trans("AddAction"), "calendar") . '</a>';
|
|
| 2193 | + $link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$type.'&contactid='.$cid.'&socid='.$socid.'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
|
|
| 2194 | 2194 | if ($link) |
| 2195 | - $newemail = '<div>' . $newemail . ' ' . $link . '</div>'; |
|
| 2195 | + $newemail = '<div>'.$newemail.' '.$link.'</div>'; |
|
| 2196 | 2196 | } |
| 2197 | 2197 | } |
| 2198 | 2198 | else {
|
@@ -2202,7 +2202,7 @@ discard block |
||
| 2202 | 2202 | } |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | - $rep = '<div class="nospan float" style="margin-right: 10px">' . ($withpicto ? img_picto($langs->trans("EMail"), 'object_email.png') . ' ' : '') . $newemail . '</div>';
|
|
| 2205 | + $rep = '<div class="nospan float" style="margin-right: 10px">'.($withpicto ? img_picto($langs->trans("EMail"), 'object_email.png').' ' : '').$newemail.'</div>';
|
|
| 2206 | 2206 | if ($hookmanager) {
|
| 2207 | 2207 | $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);
|
| 2208 | 2208 | $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email);
|
@@ -2232,26 +2232,26 @@ discard block |
||
| 2232 | 2232 | |
| 2233 | 2233 | if (!empty($type)) {
|
| 2234 | 2234 | $newskype = '<div class="divsocialnetwork inline-block valignmiddle">'; |
| 2235 | - $newskype .= img_picto($langs->trans(strtoupper($type)), $type . '.png', '', false, 0, 0, '', 'paddingright'); |
|
| 2235 | + $newskype .= img_picto($langs->trans(strtoupper($type)), $type.'.png', '', false, 0, 0, '', 'paddingright'); |
|
| 2236 | 2236 | $newskype .= $value; |
| 2237 | 2237 | if ($type == 'skype') {
|
| 2238 | 2238 | $newskype .= ' '; |
| 2239 | 2239 | $newskype .= '<a href="skype:'; |
| 2240 | 2240 | $newskype .= $value; |
| 2241 | - $newskype .= '?call" alt="' . $langs->trans("Call") . ' ' . $value . '" title="' . $langs->trans("Call") . ' ' . $value . '">';
|
|
| 2242 | - $newskype .= '<img src="' . DOL_URL_ROOT . '/theme/common/skype_callbutton.png" border="0">'; |
|
| 2241 | + $newskype .= '?call" alt="'.$langs->trans("Call").' '.$value.'" title="'.$langs->trans("Call").' '.$value.'">';
|
|
| 2242 | + $newskype .= '<img src="'.DOL_URL_ROOT.'/theme/common/skype_callbutton.png" border="0">'; |
|
| 2243 | 2243 | $newskype .= '</a><a href="skype:'; |
| 2244 | 2244 | $newskype .= $value; |
| 2245 | - $newskype .= '?chat" alt="' . $langs->trans("Chat") . ' ' . $value . '" title="' . $langs->trans("Chat") . ' ' . $value . '">';
|
|
| 2246 | - $newskype .= '<img class="paddingleft" src="' . DOL_URL_ROOT . '/theme/common/skype_chatbutton.png" border="0">'; |
|
| 2245 | + $newskype .= '?chat" alt="'.$langs->trans("Chat").' '.$value.'" title="'.$langs->trans("Chat").' '.$value.'">';
|
|
| 2246 | + $newskype .= '<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">'; |
|
| 2247 | 2247 | $newskype .= '</a>'; |
| 2248 | 2248 | } |
| 2249 | 2249 | if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create && $type == 'skype') {
|
| 2250 | 2250 | $addlink = 'AC_SKYPE'; |
| 2251 | 2251 | $link = ''; |
| 2252 | 2252 | if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) |
| 2253 | - $link = '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&backtopage=1&actioncode=' . $addlink . '&contactid=' . $cid . '&socid=' . $socid . '">' . img_object($langs->trans("AddAction"), "calendar") . '</a>';
|
|
| 2254 | - $newskype .= ($link ? ' ' . $link : ''); |
|
| 2253 | + $link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$addlink.'&contactid='.$cid.'&socid='.$socid.'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
|
|
| 2254 | + $newskype .= ($link ? ' '.$link : ''); |
|
| 2255 | 2255 | } |
| 2256 | 2256 | $newskype .= '</div>'; |
| 2257 | 2257 | } |
@@ -2296,165 +2296,165 @@ discard block |
||
| 2296 | 2296 | if (strtoupper($countrycode) == "FR") {
|
| 2297 | 2297 | // France |
| 2298 | 2298 | if (dol_strlen($phone) == 10) {
|
| 2299 | - $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 2) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2); |
|
| 2299 | + $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 2).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2); |
|
| 2300 | 2300 | } elseif (dol_strlen($phone) == 7) {
|
| 2301 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2); |
|
| 2301 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2); |
|
| 2302 | 2302 | } elseif (dol_strlen($phone) == 9) {
|
| 2303 | - $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 3) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2); |
|
| 2303 | + $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2); |
|
| 2304 | 2304 | } elseif (dol_strlen($phone) == 11) {
|
| 2305 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2305 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2306 | 2306 | } elseif (dol_strlen($phone) == 12) {
|
| 2307 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2307 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2308 | 2308 | } |
| 2309 | 2309 | } elseif (strtoupper($countrycode) == "CA") {
|
| 2310 | 2310 | if (dol_strlen($phone) == 10) {
|
| 2311 | - $newphone = ($separ != '' ? '(' : '') . substr($newphone, 0, 3) . ($separ != '' ? ')' : '') . $separ . substr($newphone, 3, 3) . ($separ != '' ? '-' : '') . substr($newphone, 6, 4);
|
|
| 2311 | + $newphone = ($separ != '' ? '(' : '').substr($newphone, 0, 3).($separ != '' ? ')' : '').$separ.substr($newphone, 3, 3).($separ != '' ? '-' : '').substr($newphone, 6, 4);
|
|
| 2312 | 2312 | } |
| 2313 | 2313 | } elseif (strtoupper($countrycode) == "PT") {//Portugal
|
| 2314 | 2314 | if (dol_strlen($phone) == 13) {//ex: +351_ABC_DEF_GHI
|
| 2315 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2315 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2316 | 2316 | } |
| 2317 | 2317 | } elseif (strtoupper($countrycode) == "SR") {//Suriname
|
| 2318 | 2318 | if (dol_strlen($phone) == 10) {//ex: +597_ABC_DEF
|
| 2319 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3); |
|
| 2319 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3); |
|
| 2320 | 2320 | } elseif (dol_strlen($phone) == 11) {//ex: +597_ABC_DEFG
|
| 2321 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 4); |
|
| 2321 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 4); |
|
| 2322 | 2322 | } |
| 2323 | 2323 | } elseif (strtoupper($countrycode) == "DE") {//Allemagne
|
| 2324 | 2324 | if (dol_strlen($phone) == 14) {//ex: +49_ABCD_EFGH_IJK
|
| 2325 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 4) . $separ . substr($newphone, 11, 3); |
|
| 2325 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 4).$separ.substr($newphone, 11, 3); |
|
| 2326 | 2326 | } elseif (dol_strlen($phone) == 13) {//ex: +49_ABC_DEFG_HIJ
|
| 2327 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 4) . $separ . substr($newphone, 10, 3); |
|
| 2327 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 4).$separ.substr($newphone, 10, 3); |
|
| 2328 | 2328 | } |
| 2329 | 2329 | } elseif (strtoupper($countrycode) == "ES") {//Espagne
|
| 2330 | 2330 | if (dol_strlen($phone) == 12) {//ex: +34_ABC_DEF_GHI
|
| 2331 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2331 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2332 | 2332 | } |
| 2333 | 2333 | } elseif (strtoupper($countrycode) == "BF") {// Burkina Faso
|
| 2334 | 2334 | if (dol_strlen($phone) == 12) {//ex : +22 A BC_DE_FG_HI
|
| 2335 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2335 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2336 | 2336 | } |
| 2337 | 2337 | } elseif (strtoupper($countrycode) == "RO") {// Roumanie
|
| 2338 | 2338 | if (dol_strlen($phone) == 12) {//ex : +40 AB_CDE_FG_HI
|
| 2339 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2339 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2340 | 2340 | } |
| 2341 | 2341 | } elseif (strtoupper($countrycode) == "TR") {//Turquie
|
| 2342 | 2342 | if (dol_strlen($phone) == 13) {//ex : +90 ABC_DEF_GHIJ
|
| 2343 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 4); |
|
| 2343 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4); |
|
| 2344 | 2344 | } |
| 2345 | 2345 | } elseif (strtoupper($countrycode) == "US") {//Etat-Unis
|
| 2346 | 2346 | if (dol_strlen($phone) == 12) {//ex: +1 ABC_DEF_GHIJ
|
| 2347 | - $newphone = substr($newphone, 0, 2) . $separ . substr($newphone, 2, 3) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 4); |
|
| 2347 | + $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4); |
|
| 2348 | 2348 | } |
| 2349 | 2349 | } elseif (strtoupper($countrycode) == "MX") {//Mexique
|
| 2350 | 2350 | if (dol_strlen($phone) == 12) {//ex: +52 ABCD_EFG_HI
|
| 2351 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 2); |
|
| 2351 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2); |
|
| 2352 | 2352 | } elseif (dol_strlen($phone) == 11) {//ex: +52 AB_CD_EF_GH
|
| 2353 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 2) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2353 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2354 | 2354 | } elseif (dol_strlen($phone) == 13) {//ex: +52 ABC_DEF_GHIJ
|
| 2355 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 4); |
|
| 2355 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4); |
|
| 2356 | 2356 | } |
| 2357 | 2357 | } elseif (strtoupper($countrycode) == "ML") {//Mali
|
| 2358 | 2358 | if (dol_strlen($phone) == 12) {//ex: +223 AB_CD_EF_GH
|
| 2359 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2359 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2360 | 2360 | } |
| 2361 | 2361 | } elseif (strtoupper($countrycode) == "TH") {//Thaïlande
|
| 2362 | 2362 | if (dol_strlen($phone) == 11) {//ex: +66_ABC_DE_FGH
|
| 2363 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 3); |
|
| 2363 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3); |
|
| 2364 | 2364 | } elseif (dol_strlen($phone) == 12) {//ex: +66_A_BCD_EF_GHI
|
| 2365 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 3); |
|
| 2365 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 3); |
|
| 2366 | 2366 | } |
| 2367 | 2367 | } elseif (strtoupper($countrycode) == "MU") {//Maurice
|
| 2368 | 2368 | if (dol_strlen($phone) == 11) {//ex: +230_ABC_DE_FG
|
| 2369 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2369 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2370 | 2370 | } elseif (dol_strlen($phone) == 12) {//ex: +230_ABCD_EF_GH
|
| 2371 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 4) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2371 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2372 | 2372 | } |
| 2373 | 2373 | } elseif (strtoupper($countrycode) == "ZA") {//Afrique du sud
|
| 2374 | 2374 | if (dol_strlen($phone) == 12) {//ex: +27_AB_CDE_FG_HI
|
| 2375 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2375 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2376 | 2376 | } |
| 2377 | 2377 | } elseif (strtoupper($countrycode) == "SY") {//Syrie
|
| 2378 | 2378 | if (dol_strlen($phone) == 12) {//ex: +963_AB_CD_EF_GH
|
| 2379 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2379 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2380 | 2380 | } elseif (dol_strlen($phone) == 13) {//ex: +963_AB_CD_EF_GHI
|
| 2381 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 3); |
|
| 2381 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3); |
|
| 2382 | 2382 | } |
| 2383 | 2383 | } elseif (strtoupper($countrycode) == "AE") {//Emirats Arabes Unis
|
| 2384 | 2384 | if (dol_strlen($phone) == 12) {//ex: +971_ABC_DEF_GH
|
| 2385 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 2); |
|
| 2385 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2); |
|
| 2386 | 2386 | } elseif (dol_strlen($phone) == 13) {//ex: +971_ABC_DEF_GHI
|
| 2387 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2387 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2388 | 2388 | } elseif (dol_strlen($phone) == 14) {//ex: +971_ABC_DEF_GHIK
|
| 2389 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 4); |
|
| 2389 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 4); |
|
| 2390 | 2390 | } |
| 2391 | 2391 | } elseif (strtoupper($countrycode) == "DZ") {//Algérie
|
| 2392 | 2392 | if (dol_strlen($phone) == 13) {//ex: +213_ABC_DEF_GHI
|
| 2393 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2393 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2394 | 2394 | } |
| 2395 | 2395 | } elseif (strtoupper($countrycode) == "BE") {//Belgique
|
| 2396 | 2396 | if (dol_strlen($phone) == 11) {//ex: +32_ABC_DE_FGH
|
| 2397 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 3); |
|
| 2397 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3); |
|
| 2398 | 2398 | } elseif (dol_strlen($phone) == 12) {//ex: +32_ABC_DEF_GHI
|
| 2399 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2399 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2400 | 2400 | } |
| 2401 | 2401 | } elseif (strtoupper($countrycode) == "PF") {//Polynésie française
|
| 2402 | 2402 | if (dol_strlen($phone) == 12) {//ex: +689_AB_CD_EF_GH
|
| 2403 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2403 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2404 | 2404 | } |
| 2405 | 2405 | } elseif (strtoupper($countrycode) == "CO") {//Colombie
|
| 2406 | 2406 | if (dol_strlen($phone) == 13) {//ex: +57_ABC_DEF_GH_IJ
|
| 2407 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2407 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2408 | 2408 | } |
| 2409 | 2409 | } elseif (strtoupper($countrycode) == "JO") {//Jordanie
|
| 2410 | 2410 | if (dol_strlen($phone) == 12) {//ex: +962_A_BCD_EF_GH
|
| 2411 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 1) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2); |
|
| 2411 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 1).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); |
|
| 2412 | 2412 | } |
| 2413 | 2413 | } elseif (strtoupper($countrycode) == "MG") {//Madagascar
|
| 2414 | 2414 | if (dol_strlen($phone) == 13) {//ex: +261_AB_CD_EF_GHI
|
| 2415 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 2) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 3); |
|
| 2415 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3); |
|
| 2416 | 2416 | } |
| 2417 | 2417 | } elseif (strtoupper($countrycode) == "GB") {//Royaume uni
|
| 2418 | 2418 | if (dol_strlen($phone) == 13) {//ex: +44_ABCD_EFG_HIJ
|
| 2419 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 4) . $separ . substr($newphone, 7, 3) . $separ . substr($newphone, 10, 3); |
|
| 2419 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3); |
|
| 2420 | 2420 | } |
| 2421 | 2421 | } elseif (strtoupper($countrycode) == "CH") {//Suisse
|
| 2422 | 2422 | if (dol_strlen($phone) == 12) {//ex: +41_AB_CDE_FG_HI
|
| 2423 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 2) . $separ . substr($newphone, 10, 2); |
|
| 2423 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); |
|
| 2424 | 2424 | } elseif (dol_strlen($phone) == 15) {// +41_AB_CDE_FGH_IJKL
|
| 2425 | - $newphone = $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 2) . $separ . substr($newphone, 5, 3) . $separ . substr($newphone, 8, 3) . $separ . substr($newphone, 11, 4); |
|
| 2425 | + $newphone = $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 4); |
|
| 2426 | 2426 | } |
| 2427 | 2427 | } elseif (strtoupper($countrycode) == "TN") {//Tunisie
|
| 2428 | 2428 | if (dol_strlen($phone) == 12) {//ex: +216_AB_CDE_FGH
|
| 2429 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 2) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2429 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2430 | 2430 | } |
| 2431 | 2431 | } elseif (strtoupper($countrycode) == "GF") {//Guyane francaise
|
| 2432 | 2432 | if (dol_strlen($phone) == 13) {//ex: +594_ABC_DE_FG_HI (ABC=594 de nouveau)
|
| 2433 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2433 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2434 | 2434 | } |
| 2435 | 2435 | } elseif (strtoupper($countrycode) == "GP") {//Guadeloupe
|
| 2436 | 2436 | if (dol_strlen($phone) == 13) {//ex: +590_ABC_DE_FG_HI (ABC=590 de nouveau)
|
| 2437 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2437 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2438 | 2438 | } |
| 2439 | 2439 | } elseif (strtoupper($countrycode) == "MQ") {//Martinique
|
| 2440 | 2440 | if (dol_strlen($phone) == 13) {//ex: +596_ABC_DE_FG_HI (ABC=596 de nouveau)
|
| 2441 | - $newphone = substr($newphone, 0, 4) . $separ . substr($newphone, 4, 3) . $separ . substr($newphone, 7, 2) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2441 | + $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2442 | 2442 | } |
| 2443 | 2443 | } elseif (strtoupper($countrycode) == "IT") {//Italie
|
| 2444 | 2444 | if (dol_strlen($phone) == 12) {//ex: +39_ABC_DEF_GHI
|
| 2445 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 3); |
|
| 2445 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3); |
|
| 2446 | 2446 | } elseif (dol_strlen($phone) == 13) {//ex: +39_ABC_DEF_GH_IJ
|
| 2447 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 3) . $separ . substr($newphone, 6, 3) . $separ . substr($newphone, 9, 2) . $separ . substr($newphone, 11, 2); |
|
| 2447 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2); |
|
| 2448 | 2448 | } |
| 2449 | 2449 | } elseif (strtoupper($countrycode) == "AU") {//Australie
|
| 2450 | 2450 | if (dol_strlen($phone) == 12) {//ex: +61_A_BCDE_FGHI
|
| 2451 | - $newphone = substr($newphone, 0, 3) . $separ . substr($newphone, 3, 1) . $separ . substr($newphone, 4, 4) . $separ . substr($newphone, 8, 4); |
|
| 2451 | + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4); |
|
| 2452 | 2452 | } |
| 2453 | 2453 | } |
| 2454 | 2454 | if (!empty($addlink)) { // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set)
|
| 2455 | 2455 | if ($conf->browser->layout == 'phone' || (!empty($conf->clicktodial->enabled) && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone
|
| 2456 | - $newphone = '<a href="tel:' . $phone . '"'; |
|
| 2457 | - $newphone .= '>' . $phone . '</a>'; |
|
| 2456 | + $newphone = '<a href="tel:'.$phone.'"'; |
|
| 2457 | + $newphone .= '>'.$phone.'</a>'; |
|
| 2458 | 2458 | } else if (!empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') { // If click to dial, we use click to dial url
|
| 2459 | 2459 | if (empty($user->clicktodial_loaded)) |
| 2460 | 2460 | $user->fetch_clicktodial(); |
@@ -2478,10 +2478,10 @@ discard block |
||
| 2478 | 2478 | '__PASS__' => $clicktodial_password); |
| 2479 | 2479 | $url = make_substitutions($url, $substitarray); |
| 2480 | 2480 | $newphonesav = $newphone; |
| 2481 | - $newphone = '<a href="' . $url . '"'; |
|
| 2481 | + $newphone = '<a href="'.$url.'"'; |
|
| 2482 | 2482 | if (!empty($conf->global->CLICKTODIAL_FORCENEWTARGET)) |
| 2483 | 2483 | $newphone .= ' target="_blank"'; |
| 2484 | - $newphone .= '>' . $newphonesav . '</a>'; |
|
| 2484 | + $newphone .= '>'.$newphonesav.'</a>'; |
|
| 2485 | 2485 | } |
| 2486 | 2486 | |
| 2487 | 2487 | //if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) |
@@ -2491,9 +2491,9 @@ discard block |
||
| 2491 | 2491 | if ($addlink == 'AC_FAX') |
| 2492 | 2492 | $type = 'AC_FAX'; |
| 2493 | 2493 | if (!empty($conf->global->AGENDA_ADDACTIONFORPHONE)) |
| 2494 | - $link = '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&backtopage=1&actioncode=' . $type . ($cid ? '&contactid=' . $cid : '') . ($socid ? '&socid=' . $socid : '') . '">' . img_object($langs->trans("AddAction"), "calendar") . '</a>';
|
|
| 2494 | + $link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$type.($cid ? '&contactid='.$cid : '').($socid ? '&socid='.$socid : '').'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
|
|
| 2495 | 2495 | if ($link) |
| 2496 | - $newphone = '<div>' . $newphone . ' ' . $link . '</div>'; |
|
| 2496 | + $newphone = '<div>'.$newphone.' '.$link.'</div>'; |
|
| 2497 | 2497 | } |
| 2498 | 2498 | } |
| 2499 | 2499 | |
@@ -2524,7 +2524,7 @@ discard block |
||
| 2524 | 2524 | $rep .= '<div class="nospan float" style="margin-right: 10px">'; |
| 2525 | 2525 | else |
| 2526 | 2526 | $rep .= '<span style="margin-right: 10px;">'; |
| 2527 | - $rep .= ($withpicto ? img_picto($titlealt, 'object_' . $picto . '.png') . ' ' : '') . $newphone; |
|
| 2527 | + $rep .= ($withpicto ? img_picto($titlealt, 'object_'.$picto.'.png').' ' : '').$newphone; |
|
| 2528 | 2528 | if ($adddivfloat) |
| 2529 | 2529 | $rep .= '</div>'; |
| 2530 | 2530 | else |
@@ -2553,10 +2553,10 @@ discard block |
||
| 2553 | 2553 | if ($mode != 2) {
|
| 2554 | 2554 | $countrycode = dolGetCountryCodeFromIp($ip); |
| 2555 | 2555 | if ($countrycode) { // If success, countrycode is us, fr, ...
|
| 2556 | - if (file_exists(DOL_BASE_PATH . 'theme/common/flags/' . $countrycode . '.png')) {
|
|
| 2557 | - $ret .= ' ' . img_picto($countrycode . ' ' . $langs->trans("AccordingToGeoIPDatabase"), /* DOL_URL_ROOT */ DOL_BASE_URI . '/theme/common/flags/' . $countrycode . '.png', '', 1);
|
|
| 2556 | + if (file_exists(DOL_BASE_PATH.'theme/common/flags/'.$countrycode.'.png')) {
|
|
| 2557 | + $ret .= ' '.img_picto($countrycode.' '.$langs->trans("AccordingToGeoIPDatabase"), /* DOL_URL_ROOT */ DOL_BASE_URI.'/theme/common/flags/'.$countrycode.'.png', '', 1);
|
|
| 2558 | 2558 | } else |
| 2559 | - $ret .= ' (' . $countrycode . ')';
|
|
| 2559 | + $ret .= ' ('.$countrycode.')';
|
|
| 2560 | 2560 | } |
| 2561 | 2561 | } |
| 2562 | 2562 | |
@@ -2594,7 +2594,7 @@ discard block |
||
| 2594 | 2594 | //$ip='24.24.24.24'; |
| 2595 | 2595 | //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; Note that this must be downloaded datafile (not same than datafile provided with ubuntu packages) |
| 2596 | 2596 | |
| 2597 | - include_once DOL_BASE_PATH . '/core/class/dolgeoip.class.php'; |
|
| 2597 | + include_once DOL_BASE_PATH.'/core/class/dolgeoip.class.php'; |
|
| 2598 | 2598 | $geoip = new DolGeoIP('country', $datafile);
|
| 2599 | 2599 | //print 'ip='.$ip.' databaseType='.$geoip->gi->databaseType." GEOIP_CITY_EDITION_REV1=".GEOIP_CITY_EDITION_REV1."\n"; |
| 2600 | 2600 | //print "geoip_country_id_by_addr=".geoip_country_id_by_addr($geoip->gi,$ip)."\n"; |
@@ -2621,7 +2621,7 @@ discard block |
||
| 2621 | 2621 | $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; |
| 2622 | 2622 | //$ip='24.24.24.24'; |
| 2623 | 2623 | //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; |
| 2624 | - include_once DOL_BASE_PATH . '/core/class/dolgeoip.class.php'; |
|
| 2624 | + include_once DOL_BASE_PATH.'/core/class/dolgeoip.class.php'; |
|
| 2625 | 2625 | $geoip = new DolGeoIP('country', $datafile);
|
| 2626 | 2626 | $countrycode = $geoip->getCountryCodeFromIP($ip); |
| 2627 | 2627 | $ret = $countrycode; |
@@ -2676,12 +2676,12 @@ discard block |
||
| 2676 | 2676 | $showomap = 1; |
| 2677 | 2677 | |
| 2678 | 2678 | if ($showgmap) {
|
| 2679 | - $url = dol_buildpath('/google/gmaps.php?mode=' . $mode . '&id=' . $id, 1);
|
|
| 2680 | - $out .= ' <a href="' . $url . '" target="_gmaps"><img id="' . $htmlid . '" class="valigntextbottom" src="' . DOL_URL_ROOT . '/theme/common/gmap.png"></a>'; |
|
| 2679 | + $url = dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id, 1);
|
|
| 2680 | + $out .= ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'" class="valigntextbottom" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>'; |
|
| 2681 | 2681 | } |
| 2682 | 2682 | if ($showomap) {
|
| 2683 | - $url = dol_buildpath('/openstreetmap/maps.php?mode=' . $mode . '&id=' . $id, 1);
|
|
| 2684 | - $out .= ' <a href="' . $url . '" target="_gmaps"><img id="' . $htmlid . '_openstreetmap" class="valigntextbottom" src="' . DOL_URL_ROOT . '/theme/common/gmap.png"></a>'; |
|
| 2683 | + $url = dol_buildpath('/openstreetmap/maps.php?mode='.$mode.'&id='.$id, 1);
|
|
| 2684 | + $out .= ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'_openstreetmap" class="valigntextbottom" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>'; |
|
| 2685 | 2685 | } |
| 2686 | 2686 | } |
| 2687 | 2687 | } |
@@ -2827,7 +2827,7 @@ discard block |
||
| 2827 | 2827 | if ($trunc == 'right') {
|
| 2828 | 2828 | $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; |
| 2829 | 2829 | if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ... |
| 2830 | - return dol_substr($newstring, 0, $size, $stringencoding) . ($nodot ? '' : '...'); |
|
| 2830 | + return dol_substr($newstring, 0, $size, $stringencoding).($nodot ? '' : '...'); |
|
| 2831 | 2831 | else |
| 2832 | 2832 | //return 'u'.$size.'-'.$newstring.'-'.dol_strlen($newstring,$stringencoding).'-'.$string; |
| 2833 | 2833 | return $string; |
@@ -2837,21 +2837,21 @@ discard block |
||
| 2837 | 2837 | if (dol_strlen($newstring, $stringencoding) > 2 && dol_strlen($newstring, $stringencoding) > ($size + 1)) {
|
| 2838 | 2838 | $size1 = round($size / 2); |
| 2839 | 2839 | $size2 = round($size / 2); |
| 2840 | - return dol_substr($newstring, 0, $size1, $stringencoding) . '...' . dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding); |
|
| 2840 | + return dol_substr($newstring, 0, $size1, $stringencoding).'...'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size2, $size2, $stringencoding); |
|
| 2841 | 2841 | } else |
| 2842 | 2842 | return $string; |
| 2843 | 2843 | } |
| 2844 | 2844 | elseif ($trunc == 'left') {
|
| 2845 | 2845 | $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; |
| 2846 | 2846 | if (dol_strlen($newstring, $stringencoding) > ($size + ($nodot ? 0 : 3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ... |
| 2847 | - return '...' . dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding); |
|
| 2847 | + return '...'.dol_substr($newstring, dol_strlen($newstring, $stringencoding) - $size, $size, $stringencoding); |
|
| 2848 | 2848 | else |
| 2849 | 2849 | return $string; |
| 2850 | 2850 | } |
| 2851 | 2851 | elseif ($trunc == 'wrap') {
|
| 2852 | 2852 | $newstring = dol_textishtml($string) ? dol_string_nohtmltag($string, 1) : $string; |
| 2853 | 2853 | if (dol_strlen($newstring, $stringencoding) > ($size + 1)) |
| 2854 | - return dol_substr($newstring, 0, $size, $stringencoding) . "\n" . dol_trunc(dol_substr($newstring, $size, dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc); |
|
| 2854 | + return dol_substr($newstring, 0, $size, $stringencoding)."\n".dol_trunc(dol_substr($newstring, $size, dol_strlen($newstring, $stringencoding) - $size, $stringencoding), $size, $trunc); |
|
| 2855 | 2855 | else |
| 2856 | 2856 | return $string; |
| 2857 | 2857 | } else |
@@ -2885,7 +2885,7 @@ discard block |
||
| 2885 | 2885 | $url = DOL_BASE_URI; |
| 2886 | 2886 | |
| 2887 | 2887 | $theme = $conf->theme; |
| 2888 | - $path = 'theme/' . $theme; |
|
| 2888 | + $path = 'theme/'.$theme; |
|
| 2889 | 2889 | |
| 2890 | 2890 | // Define fullpathpicto to use into src |
| 2891 | 2891 | if ($pictoisfullpath) {
|
@@ -2934,7 +2934,7 @@ discard block |
||
| 2934 | 2934 | $fakey = 'fa-pencil'; |
| 2935 | 2935 | $facolor = '#444'; |
| 2936 | 2936 | } elseif ($pictowithoutext == 'filter') {
|
| 2937 | - $fakey = 'fa-' . $pictowithoutext; |
|
| 2937 | + $fakey = 'fa-'.$pictowithoutext; |
|
| 2938 | 2938 | } elseif ($pictowithoutext == 'grip_title' || $pictowithoutext == 'grip') {
|
| 2939 | 2939 | $fakey = 'fa-arrows'; |
| 2940 | 2940 | } elseif ($pictowithoutext == 'listlight') {
|
@@ -2973,15 +2973,15 @@ discard block |
||
| 2973 | 2973 | } elseif ($pictowithoutext == 'jabber') {
|
| 2974 | 2974 | $fakey = 'fa-comment-o'; |
| 2975 | 2975 | } else {
|
| 2976 | - $fakey = 'fa-' . $pictowithoutext; |
|
| 2976 | + $fakey = 'fa-'.$pictowithoutext; |
|
| 2977 | 2977 | $facolor = '#444'; |
| 2978 | 2978 | $marginleftonlyshort = 0; |
| 2979 | 2979 | } |
| 2980 | 2980 | |
| 2981 | 2981 | if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
|
| 2982 | - $morecss .= ($morecss ? ' ' : '') . $reg[1]; |
|
| 2982 | + $morecss .= ($morecss ? ' ' : '').$reg[1]; |
|
| 2983 | 2983 | } |
| 2984 | - $enabledisablehtml = '<span class="fa ' . $fakey . ' ' . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '') . ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . '" alt="' . dol_escape_htmltag($titlealt) . '"' . (($notitle || empty($title)) ? '' : ' title="' . dol_escape_htmltag($title) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>';
|
|
| 2984 | + $enabledisablehtml = '<span class="fa '.$fakey.' '.($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '').' valignmiddle'.($morecss ? ' '.$morecss : '').'" style="'.($fasize ? ('font-size: '.$fasize.';') : '').($facolor ? (' color: '.$facolor.';') : '').'" alt="'.dol_escape_htmltag($titlealt).'"'.(($notitle || empty($title)) ? '' : ' title="'.dol_escape_htmltag($title).'"').($moreatt ? ' '.$moreatt : '').'>';
|
|
| 2985 | 2985 | if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
| 2986 | 2986 | $enabledisablehtml .= $titlealt; |
| 2987 | 2987 | } |
@@ -2991,11 +2991,11 @@ discard block |
||
| 2991 | 2991 | } |
| 2992 | 2992 | |
| 2993 | 2993 | if (!empty($conf->global->MAIN_OVERWRITE_THEME_PATH)) {
|
| 2994 | - $path = $conf->global->MAIN_OVERWRITE_THEME_PATH . '/theme/' . $theme; // If the theme does not have the same name as the module |
|
| 2994 | + $path = $conf->global->MAIN_OVERWRITE_THEME_PATH.'/theme/'.$theme; // If the theme does not have the same name as the module |
|
| 2995 | 2995 | } else if (!empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
|
| 2996 | - $path = $conf->global->MAIN_OVERWRITE_THEME_RES . '/theme/' . $conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme |
|
| 2996 | + $path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme |
|
| 2997 | 2997 | } else if (!empty($conf->modules_parts['theme']) && array_key_exists($theme, $conf->modules_parts['theme'])) {
|
| 2998 | - $path = $theme . '/theme/' . $theme; // If the theme have the same name as the module |
|
| 2998 | + $path = $theme.'/theme/'.$theme; // If the theme have the same name as the module |
|
| 2999 | 2999 | } |
| 3000 | 3000 | |
| 3001 | 3001 | // If we ask an image into $url/$mymodule/img (instead of default path) |
@@ -3015,22 +3015,22 @@ discard block |
||
| 3015 | 3015 | continue; |
| 3016 | 3016 | } |
| 3017 | 3017 | // This need a lot of time, that's why enabling alternative dir like "custom" dir is not recommanded |
| 3018 | - if (file_exists($dirroot . '/' . $path . '/img/' . $picto)) {
|
|
| 3018 | + if (file_exists($dirroot.'/'.$path.'/img/'.$picto)) {
|
|
| 3019 | 3019 | //$url = DOL_URL_ROOT . $conf->file->dol_url_root[$type]; |
| 3020 | - $url = DOL_BASE_URI . $conf->file->dol_url_root[$type]; |
|
| 3020 | + $url = DOL_BASE_URI.$conf->file->dol_url_root[$type]; |
|
| 3021 | 3021 | break; |
| 3022 | 3022 | } |
| 3023 | 3023 | } |
| 3024 | 3024 | |
| 3025 | 3025 | // $url is '' or '/custom', $path is current theme or |
| 3026 | - $fullpathpicto = $url . '/' . $path . '/img/' . $picto; |
|
| 3026 | + $fullpathpicto = $url.'/'.$path.'/img/'.$picto; |
|
| 3027 | 3027 | } |
| 3028 | 3028 | |
| 3029 | 3029 | if ($srconly) {
|
| 3030 | 3030 | return $fullpathpicto; |
| 3031 | 3031 | } |
| 3032 | 3032 | // tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for bind people |
| 3033 | - return '<img src="' . $fullpathpicto . '" alt="' . dol_escape_htmltag($alt) . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : ' class="inline-block' . ($morecss ? ' ' . $morecss : '') . '"') . '>'; // Alt is used for accessibility, title for popup |
|
| 3033 | + return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt)) ? '' : ' title="'.dol_escape_htmltag($titlealt).'"').($moreatt ? ' '.$moreatt : ' class="inline-block'.($morecss ? ' '.$morecss : '').'"').'>'; // Alt is used for accessibility, title for popup |
|
| 3034 | 3034 | } |
| 3035 | 3035 | |
| 3036 | 3036 | /** |
@@ -3048,7 +3048,7 @@ discard block |
||
| 3048 | 3048 | */ |
| 3049 | 3049 | function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0) |
| 3050 | 3050 | {
|
| 3051 | - return img_picto($titlealt, 'object_' . $picto, $moreatt, $pictoisfullpath, $srconly, $notitle); |
|
| 3051 | + return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle); |
|
| 3052 | 3052 | } |
| 3053 | 3053 | |
| 3054 | 3054 | /** |
@@ -3069,7 +3069,7 @@ discard block |
||
| 3069 | 3069 | $picto .= '.png'; |
| 3070 | 3070 | |
| 3071 | 3071 | //$path = DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/weather/' . $picto; |
| 3072 | - $path = DOL_BASE_URI . '/theme/' . $conf->theme . '/img/weather/' . $picto; |
|
| 3072 | + $path = DOL_BASE_URI.'/theme/'.$conf->theme.'/img/weather/'.$picto; |
|
| 3073 | 3073 | |
| 3074 | 3074 | return img_picto($titlealt, $path, $moreatt, 1); |
| 3075 | 3075 | } |
@@ -3094,10 +3094,10 @@ discard block |
||
| 3094 | 3094 | if ($pictoisfullpath) |
| 3095 | 3095 | $path = $picto; |
| 3096 | 3096 | else {
|
| 3097 | - $path = DOL_URL_ROOT . '/theme/common/' . $picto; |
|
| 3097 | + $path = DOL_URL_ROOT.'/theme/common/'.$picto; |
|
| 3098 | 3098 | |
| 3099 | 3099 | if (!empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS)) {
|
| 3100 | - $themepath = DOL_BASE_PATH . 'theme/' . $conf->theme . '/img/' . $picto; |
|
| 3100 | + $themepath = DOL_BASE_PATH.'theme/'.$conf->theme.'/img/'.$picto; |
|
| 3101 | 3101 | |
| 3102 | 3102 | if (file_exists($themepath)) |
| 3103 | 3103 | $path = $themepath; |
@@ -3135,14 +3135,14 @@ discard block |
||
| 3135 | 3135 | $numaction = 3; |
| 3136 | 3136 | $titlealt = $langs->transnoentitiesnoconv('ChangeContactDone');
|
| 3137 | 3137 | } else {
|
| 3138 | - $titlealt = $langs->transnoentitiesnoconv('ChangeStatus ' . $numaction);
|
|
| 3138 | + $titlealt = $langs->transnoentitiesnoconv('ChangeStatus '.$numaction);
|
|
| 3139 | 3139 | $numaction = 0; |
| 3140 | 3140 | } |
| 3141 | 3141 | } |
| 3142 | 3142 | if (!is_numeric($numaction)) |
| 3143 | 3143 | $numaction = 0; |
| 3144 | 3144 | |
| 3145 | - return img_picto($titlealt, 'stcomm' . $numaction . '.png'); |
|
| 3145 | + return img_picto($titlealt, 'stcomm'.$numaction.'.png'); |
|
| 3146 | 3146 | } |
| 3147 | 3147 | |
| 3148 | 3148 | /** |
@@ -3159,7 +3159,7 @@ discard block |
||
| 3159 | 3159 | if ($titlealt == 'default') |
| 3160 | 3160 | $titlealt = $langs->trans('Show');
|
| 3161 | 3161 | |
| 3162 | - return img_picto($titlealt, 'pdf' . $size . '.png'); |
|
| 3162 | + return img_picto($titlealt, 'pdf'.$size.'.png'); |
|
| 3163 | 3163 | } |
| 3164 | 3164 | |
| 3165 | 3165 | /** |
@@ -3211,7 +3211,7 @@ discard block |
||
| 3211 | 3211 | if ($titlealt == 'default') |
| 3212 | 3212 | $titlealt = $langs->trans('Modify');
|
| 3213 | 3213 | |
| 3214 | - return img_picto($titlealt, 'edit.png', ($float ? 'style="float: ' . ($langs->tab_translate["DIRECTION"] == 'rtl' ? 'left' : 'right') . '"' : "") . ($other ? ' ' . $other : '')); |
|
| 3214 | + return img_picto($titlealt, 'edit.png', ($float ? 'style="float: '.($langs->tab_translate["DIRECTION"] == 'rtl' ? 'left' : 'right').'"' : "").($other ? ' '.$other : '')); |
|
| 3215 | 3215 | } |
| 3216 | 3216 | |
| 3217 | 3217 | /** |
@@ -3229,7 +3229,7 @@ discard block |
||
| 3229 | 3229 | if ($titlealt == 'default') |
| 3230 | 3230 | $titlealt = $langs->trans('View');
|
| 3231 | 3231 | |
| 3232 | - $moreatt = ($float ? 'style="float: right" ' : '') . $other; |
|
| 3232 | + $moreatt = ($float ? 'style="float: right" ' : '').$other; |
|
| 3233 | 3233 | |
| 3234 | 3234 | return img_picto($titlealt, 'view.png', $moreatt); |
| 3235 | 3235 | } |
@@ -3302,7 +3302,7 @@ discard block |
||
| 3302 | 3302 | $usealttitle = $langs->trans('Info');
|
| 3303 | 3303 | } |
| 3304 | 3304 | |
| 3305 | - return img_picto($usealttitle, 'info.png', 'style="vertical-align: middle;' . ($usehelpcursor == 1 ? ' cursor: help' : ($usehelpcursor == 2 ? ' cursor: pointer' : '')) . '"'); |
|
| 3305 | + return img_picto($usealttitle, 'info.png', 'style="vertical-align: middle;'.($usehelpcursor == 1 ? ' cursor: help' : ($usehelpcursor == 2 ? ' cursor: pointer' : '')).'"'); |
|
| 3306 | 3306 | } |
| 3307 | 3307 | |
| 3308 | 3308 | /** |
@@ -3336,7 +3336,7 @@ discard block |
||
| 3336 | 3336 | $titlealt = $langs->trans('Warning');
|
| 3337 | 3337 | |
| 3338 | 3338 | //return '<div class="imglatecoin">'.img_picto($titlealt, 'warning_white.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): '')).'</div>'; |
| 3339 | - return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"' . ($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' ' . $moreatt) : '')); |
|
| 3339 | + return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt) : '')); |
|
| 3340 | 3340 | } |
| 3341 | 3341 | |
| 3342 | 3342 | /** |
@@ -3370,7 +3370,7 @@ discard block |
||
| 3370 | 3370 | $titlealt = $langs->trans('Next');
|
| 3371 | 3371 | |
| 3372 | 3372 | //return img_picto($titlealt, 'next.png', $moreatt); |
| 3373 | - return '<span class="fa fa-chevron-right paddingright paddingleft" title="' . dol_escape_htmltag($titlealt) . '"></span>'; |
|
| 3373 | + return '<span class="fa fa-chevron-right paddingright paddingleft" title="'.dol_escape_htmltag($titlealt).'"></span>'; |
|
| 3374 | 3374 | } |
| 3375 | 3375 | |
| 3376 | 3376 | /** |
@@ -3388,7 +3388,7 @@ discard block |
||
| 3388 | 3388 | $titlealt = $langs->trans('Previous');
|
| 3389 | 3389 | |
| 3390 | 3390 | //return img_picto($titlealt, 'previous.png', $moreatt); |
| 3391 | - return '<span class="fa fa-chevron-left paddingright paddingleft" title="' . dol_escape_htmltag($titlealt) . '"></span>'; |
|
| 3391 | + return '<span class="fa fa-chevron-left paddingright paddingleft" title="'.dol_escape_htmltag($titlealt).'"></span>'; |
|
| 3392 | 3392 | } |
| 3393 | 3393 | |
| 3394 | 3394 | /** |
@@ -3406,7 +3406,7 @@ discard block |
||
| 3406 | 3406 | if ($titlealt == 'default') |
| 3407 | 3407 | $titlealt = $langs->trans('Down');
|
| 3408 | 3408 | |
| 3409 | - return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown' . ($moreclass ? " " . $moreclass : "") . '"'); |
|
| 3409 | + return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown'.($moreclass ? " ".$moreclass : "").'"'); |
|
| 3410 | 3410 | } |
| 3411 | 3411 | |
| 3412 | 3412 | /** |
@@ -3424,7 +3424,7 @@ discard block |
||
| 3424 | 3424 | if ($titlealt == 'default') |
| 3425 | 3425 | $titlealt = $langs->trans('Up');
|
| 3426 | 3426 | |
| 3427 | - return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup' . ($moreclass ? " " . $moreclass : "") . '"'); |
|
| 3427 | + return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup'.($moreclass ? " ".$moreclass : "").'"'); |
|
| 3428 | 3428 | } |
| 3429 | 3429 | |
| 3430 | 3430 | /** |
@@ -3507,7 +3507,7 @@ discard block |
||
| 3507 | 3507 | $brand = 'credit-card'; |
| 3508 | 3508 | } |
| 3509 | 3509 | |
| 3510 | - return '<span class="fa fa-' . $brand . ' fa-2x fa-fw"></span>'; |
|
| 3510 | + return '<span class="fa fa-'.$brand.' fa-2x fa-fw"></span>'; |
|
| 3511 | 3511 | } |
| 3512 | 3512 | |
| 3513 | 3513 | /** |
@@ -3520,17 +3520,17 @@ discard block |
||
| 3520 | 3520 | */ |
| 3521 | 3521 | function img_mime($file, $titlealt = '', $morecss = '') |
| 3522 | 3522 | {
|
| 3523 | - require_once DOL_BASE_PATH . '/core/lib/files.lib.php'; |
|
| 3523 | + require_once DOL_BASE_PATH.'/core/lib/files.lib.php'; |
|
| 3524 | 3524 | |
| 3525 | 3525 | $mimetype = dol_mimetype($file, '', 1); |
| 3526 | 3526 | $mimeimg = dol_mimetype($file, '', 2); |
| 3527 | 3527 | $mimefa = dol_mimetype($file, '', 4); |
| 3528 | 3528 | |
| 3529 | 3529 | if (empty($titlealt)) |
| 3530 | - $titlealt = 'Mime type: ' . $mimetype; |
|
| 3530 | + $titlealt = 'Mime type: '.$mimetype; |
|
| 3531 | 3531 | |
| 3532 | 3532 | //return img_picto_common($titlealt, 'mime/'.$mimeimg, 'class="'.$morecss.'"'); |
| 3533 | - return '<i class="fa fa-' . $mimefa . ' paddingright"></i>'; |
|
| 3533 | + return '<i class="fa fa-'.$mimefa.' paddingright"></i>'; |
|
| 3534 | 3534 | } |
| 3535 | 3535 | |
| 3536 | 3536 | /** |
@@ -3545,7 +3545,7 @@ discard block |
||
| 3545 | 3545 | */ |
| 3546 | 3546 | function img_phone($titlealt = 'default', $option = 0) |
| 3547 | 3547 | {
|
| 3548 | - dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 3548 | + dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 3549 | 3549 | |
| 3550 | 3550 | global $conf, $langs; |
| 3551 | 3551 | |
@@ -3576,8 +3576,8 @@ discard block |
||
| 3576 | 3576 | |
| 3577 | 3577 | $img = img_picto($titlealt, 'search.png', $other, false, 1); |
| 3578 | 3578 | |
| 3579 | - $input = '<input type="image" class="liste_titre" name="button_search" src="' . $img . '" '; |
|
| 3580 | - $input .= 'value="' . dol_escape_htmltag($titlealt) . '" title="' . dol_escape_htmltag($titlealt) . '" >'; |
|
| 3579 | + $input = '<input type="image" class="liste_titre" name="button_search" src="'.$img.'" '; |
|
| 3580 | + $input .= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >'; |
|
| 3581 | 3581 | |
| 3582 | 3582 | return $input; |
| 3583 | 3583 | } |
@@ -3598,8 +3598,8 @@ discard block |
||
| 3598 | 3598 | |
| 3599 | 3599 | $img = img_picto($titlealt, 'searchclear.png', $other, false, 1); |
| 3600 | 3600 | |
| 3601 | - $input = '<input type="image" class="liste_titre" name="button_removefilter" src="' . $img . '" '; |
|
| 3602 | - $input .= 'value="' . dol_escape_htmltag($titlealt) . '" title="' . dol_escape_htmltag($titlealt) . '" >'; |
|
| 3601 | + $input = '<input type="image" class="liste_titre" name="button_removefilter" src="'.$img.'" '; |
|
| 3602 | + $input .= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >'; |
|
| 3603 | 3603 | |
| 3604 | 3604 | return $input; |
| 3605 | 3605 | } |
@@ -3619,10 +3619,10 @@ discard block |
||
| 3619 | 3619 | global $conf, $langs; |
| 3620 | 3620 | |
| 3621 | 3621 | if ($infoonimgalt) {
|
| 3622 | - return img_picto($text, 'info', 'class="hideonsmartphone' . ($morecss ? ' ' . $morecss : '') . '"'); |
|
| 3622 | + return img_picto($text, 'info', 'class="hideonsmartphone'.($morecss ? ' '.$morecss : '').'"'); |
|
| 3623 | 3623 | } |
| 3624 | 3624 | |
| 3625 | - return ($nodiv ? '' : '<div class="' . (empty($admin) ? '' : ($admin == '1' ? 'info' : $admin)) . ' hideonsmartphone' . ($morecss ? ' ' . $morecss : '') . '">') . '<span class="fa fa-info-circle" title="' . dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')) . '"></span> ' . $text . ($nodiv ? '' : '</div>');
|
|
| 3625 | + return ($nodiv ? '' : '<div class="'.(empty($admin) ? '' : ($admin == '1' ? 'info' : $admin)).' hideonsmartphone'.($morecss ? ' '.$morecss : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>');
|
|
| 3626 | 3626 | } |
| 3627 | 3627 | |
| 3628 | 3628 | /** |
@@ -3647,7 +3647,7 @@ discard block |
||
| 3647 | 3647 | |
| 3648 | 3648 | // Si erreur intervenue avant chargement langue |
| 3649 | 3649 | if (!$langs) {
|
| 3650 | - require_once DOL_BASE_PATH . '/core/class/translate.class.php'; |
|
| 3650 | + require_once DOL_BASE_PATH.'/core/class/translate.class.php'; |
|
| 3651 | 3651 | $langs = new Translate('', $conf);
|
| 3652 | 3652 | $langs->load("main");
|
| 3653 | 3653 | } |
@@ -3655,51 +3655,51 @@ discard block |
||
| 3655 | 3655 | $langs->loadLangs(array('main', 'errors'));
|
| 3656 | 3656 | |
| 3657 | 3657 | if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
| 3658 | - $out .= $langs->trans("DolibarrHasDetectedError") . ".<br>\n";
|
|
| 3658 | + $out .= $langs->trans("DolibarrHasDetectedError").".<br>\n";
|
|
| 3659 | 3659 | if (!empty($conf->global->MAIN_FEATURES_LEVEL)) |
| 3660 | 3660 | $out .= "You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n"; |
| 3661 | - $out .= $langs->trans("InformationToHelpDiagnose") . ":<br>\n";
|
|
| 3661 | + $out .= $langs->trans("InformationToHelpDiagnose").":<br>\n";
|
|
| 3662 | 3662 | |
| 3663 | - $out .= "<b>" . $langs->trans("Date") . ":</b> " . dol_print_date(time(), 'dayhourlog') . "<br>\n";
|
|
| 3664 | - $out .= "<b>" . $langs->trans("Dolibarr") . ":</b> " . DOL_VERSION . "<br>\n";
|
|
| 3663 | + $out .= "<b>".$langs->trans("Date").":</b> ".dol_print_date(time(), 'dayhourlog')."<br>\n";
|
|
| 3664 | + $out .= "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";
|
|
| 3665 | 3665 | if (isset($conf->global->MAIN_FEATURES_LEVEL)) |
| 3666 | - $out .= "<b>" . $langs->trans("LevelOfFeature") . ":</b> " . $conf->global->MAIN_FEATURES_LEVEL . "<br>\n";
|
|
| 3666 | + $out .= "<b>".$langs->trans("LevelOfFeature").":</b> ".$conf->global->MAIN_FEATURES_LEVEL."<br>\n";
|
|
| 3667 | 3667 | if (function_exists("phpversion")) {
|
| 3668 | - $out .= "<b>" . $langs->trans("PHP") . ":</b> " . phpversion() . "<br>\n";
|
|
| 3668 | + $out .= "<b>".$langs->trans("PHP").":</b> ".phpversion()."<br>\n";
|
|
| 3669 | 3669 | } |
| 3670 | - $out .= "<b>" . $langs->trans("Server") . ":</b> " . $_SERVER["SERVER_SOFTWARE"] . "<br>\n";
|
|
| 3670 | + $out .= "<b>".$langs->trans("Server").":</b> ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
|
|
| 3671 | 3671 | if (function_exists("php_uname")) {
|
| 3672 | - $out .= "<b>" . $langs->trans("OS") . ":</b> " . php_uname() . "<br>\n";
|
|
| 3672 | + $out .= "<b>".$langs->trans("OS").":</b> ".php_uname()."<br>\n";
|
|
| 3673 | 3673 | } |
| 3674 | - $out .= "<b>" . $langs->trans("UserAgent") . ":</b> " . $_SERVER["HTTP_USER_AGENT"] . "<br>\n";
|
|
| 3674 | + $out .= "<b>".$langs->trans("UserAgent").":</b> ".$_SERVER["HTTP_USER_AGENT"]."<br>\n";
|
|
| 3675 | 3675 | $out .= "<br>\n"; |
| 3676 | - $out .= "<b>" . $langs->trans("RequestedUrl") . ":</b> " . dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8') . "<br>\n";
|
|
| 3677 | - $out .= "<b>" . $langs->trans("Referer") . ":</b> " . (isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '') . "<br>\n";
|
|
| 3678 | - $out .= "<b>" . $langs->trans("MenuManager") . ":</b> " . (isset($conf->standard_menu) ? $conf->standard_menu : '') . "<br>\n";
|
|
| 3676 | + $out .= "<b>".$langs->trans("RequestedUrl").":</b> ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."<br>\n";
|
|
| 3677 | + $out .= "<b>".$langs->trans("Referer").":</b> ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."<br>\n";
|
|
| 3678 | + $out .= "<b>".$langs->trans("MenuManager").":</b> ".(isset($conf->standard_menu) ? $conf->standard_menu : '')."<br>\n";
|
|
| 3679 | 3679 | $out .= "<br>\n"; |
| 3680 | - $syslog .= "url=" . dol_escape_htmltag($_SERVER["REQUEST_URI"]); |
|
| 3681 | - $syslog .= ", query_string=" . dol_escape_htmltag($_SERVER["QUERY_STRING"]); |
|
| 3680 | + $syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]); |
|
| 3681 | + $syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]); |
|
| 3682 | 3682 | } else { // Mode CLI
|
| 3683 | - $out .= '> ' . $langs->transnoentities("ErrorInternalErrorDetected") . ":\n" . $argv[0] . "\n";
|
|
| 3684 | - $syslog .= "pid=" . dol_getmypid(); |
|
| 3683 | + $out .= '> '.$langs->transnoentities("ErrorInternalErrorDetected").":\n".$argv[0]."\n";
|
|
| 3684 | + $syslog .= "pid=".dol_getmypid(); |
|
| 3685 | 3685 | } |
| 3686 | 3686 | |
| 3687 | 3687 | if (is_object($db)) {
|
| 3688 | 3688 | if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
| 3689 | - $out .= "<b>" . $langs->trans("DatabaseTypeManager") . ":</b> " . $db->type . "<br>\n";
|
|
| 3690 | - $out .= "<b>" . $langs->trans("RequestLastAccessInError") . ":</b> " . ($db->lastqueryerror() ? dol_escape_htmltag($db->lastqueryerror()) : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
|
|
| 3691 | - $out .= "<b>" . $langs->trans("ReturnCodeLastAccessInError") . ":</b> " . ($db->lasterrno() ? dol_escape_htmltag($db->lasterrno()) : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
|
|
| 3692 | - $out .= "<b>" . $langs->trans("InformationLastAccessInError") . ":</b> " . ($db->lasterror() ? dol_escape_htmltag($db->lasterror()) : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
|
|
| 3689 | + $out .= "<b>".$langs->trans("DatabaseTypeManager").":</b> ".$db->type."<br>\n";
|
|
| 3690 | + $out .= "<b>".$langs->trans("RequestLastAccessInError").":</b> ".($db->lastqueryerror() ? dol_escape_htmltag($db->lastqueryerror()) : $langs->trans("ErrorNoRequestInError"))."<br>\n";
|
|
| 3691 | + $out .= "<b>".$langs->trans("ReturnCodeLastAccessInError").":</b> ".($db->lasterrno() ? dol_escape_htmltag($db->lasterrno()) : $langs->trans("ErrorNoRequestInError"))."<br>\n";
|
|
| 3692 | + $out .= "<b>".$langs->trans("InformationLastAccessInError").":</b> ".($db->lasterror() ? dol_escape_htmltag($db->lasterror()) : $langs->trans("ErrorNoRequestInError"))."<br>\n";
|
|
| 3693 | 3693 | $out .= "<br>\n"; |
| 3694 | 3694 | } else { // Mode CLI
|
| 3695 | 3695 | // No dol_escape_htmltag for output, we are in CLI mode |
| 3696 | - $out .= '> ' . $langs->transnoentities("DatabaseTypeManager") . ":\n" . $db->type . "\n";
|
|
| 3697 | - $out .= '> ' . $langs->transnoentities("RequestLastAccessInError") . ":\n" . ($db->lastqueryerror() ? $db->lastqueryerror() : $langs->transnoentities("ErrorNoRequestInError")) . "\n";
|
|
| 3698 | - $out .= '> ' . $langs->transnoentities("ReturnCodeLastAccessInError") . ":\n" . ($db->lasterrno() ? $db->lasterrno() : $langs->transnoentities("ErrorNoRequestInError")) . "\n";
|
|
| 3699 | - $out .= '> ' . $langs->transnoentities("InformationLastAccessInError") . ":\n" . ($db->lasterror() ? $db->lasterror() : $langs->transnoentities("ErrorNoRequestInError")) . "\n";
|
|
| 3696 | + $out .= '> '.$langs->transnoentities("DatabaseTypeManager").":\n".$db->type."\n";
|
|
| 3697 | + $out .= '> '.$langs->transnoentities("RequestLastAccessInError").":\n".($db->lastqueryerror() ? $db->lastqueryerror() : $langs->transnoentities("ErrorNoRequestInError"))."\n";
|
|
| 3698 | + $out .= '> '.$langs->transnoentities("ReturnCodeLastAccessInError").":\n".($db->lasterrno() ? $db->lasterrno() : $langs->transnoentities("ErrorNoRequestInError"))."\n";
|
|
| 3699 | + $out .= '> '.$langs->transnoentities("InformationLastAccessInError").":\n".($db->lasterror() ? $db->lasterror() : $langs->transnoentities("ErrorNoRequestInError"))."\n";
|
|
| 3700 | 3700 | } |
| 3701 | - $syslog .= ", sql=" . $db->lastquery(); |
|
| 3702 | - $syslog .= ", db_error=" . $db->lasterror(); |
|
| 3701 | + $syslog .= ", sql=".$db->lastquery(); |
|
| 3702 | + $syslog .= ", db_error=".$db->lasterror(); |
|
| 3703 | 3703 | } |
| 3704 | 3704 | |
| 3705 | 3705 | if ($error || $errors) {
|
@@ -3719,31 +3719,31 @@ discard block |
||
| 3719 | 3719 | if (empty($msg)) |
| 3720 | 3720 | continue; |
| 3721 | 3721 | if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
| 3722 | - $out .= "<b>" . $langs->trans("Message") . ":</b> " . dol_escape_htmltag($msg) . "<br>\n";
|
|
| 3722 | + $out .= "<b>".$langs->trans("Message").":</b> ".dol_escape_htmltag($msg)."<br>\n";
|
|
| 3723 | 3723 | } else { // Mode CLI
|
| 3724 | - $out .= '> ' . $langs->transnoentities("Message") . ":\n" . $msg . "\n";
|
|
| 3724 | + $out .= '> '.$langs->transnoentities("Message").":\n".$msg."\n";
|
|
| 3725 | 3725 | } |
| 3726 | - $syslog .= ", msg=" . $msg; |
|
| 3726 | + $syslog .= ", msg=".$msg; |
|
| 3727 | 3727 | } |
| 3728 | 3728 | } |
| 3729 | 3729 | if (empty($dolibarr_main_prod) && $_SERVER['DOCUMENT_ROOT'] && function_exists('xdebug_print_function_stack') && function_exists('xdebug_call_file')) {
|
| 3730 | 3730 | xdebug_print_function_stack(); |
| 3731 | - $out .= '<b>XDebug informations:</b>' . "<br>\n"; |
|
| 3732 | - $out .= 'File: ' . xdebug_call_file() . "<br>\n"; |
|
| 3733 | - $out .= 'Line: ' . xdebug_call_line() . "<br>\n"; |
|
| 3734 | - $out .= 'Function: ' . xdebug_call_function() . "<br>\n"; |
|
| 3731 | + $out .= '<b>XDebug informations:</b>'."<br>\n"; |
|
| 3732 | + $out .= 'File: '.xdebug_call_file()."<br>\n"; |
|
| 3733 | + $out .= 'Line: '.xdebug_call_line()."<br>\n"; |
|
| 3734 | + $out .= 'Function: '.xdebug_call_function()."<br>\n"; |
|
| 3735 | 3735 | $out .= "<br>\n"; |
| 3736 | 3736 | } |
| 3737 | 3737 | |
| 3738 | 3738 | if (empty($dolibarr_main_prod)) |
| 3739 | 3739 | print $out; |
| 3740 | 3740 | else {
|
| 3741 | - print $langs->trans("DolibarrHasDetectedError") . '. ';
|
|
| 3741 | + print $langs->trans("DolibarrHasDetectedError").'. ';
|
|
| 3742 | 3742 | print $langs->trans("YouCanSetOptionDolibarrMainProdToZero");
|
| 3743 | 3743 | define("MAIN_CORE_ERROR", 1);
|
| 3744 | 3744 | } |
| 3745 | 3745 | //else print 'Sorry, an error occured but the parameter $dolibarr_main_prod is defined in conf file so no message is reported to your browser. Please read the log file for error message.'; |
| 3746 | - dol_syslog("Error " . $syslog, LOG_ERR);
|
|
| 3746 | + dol_syslog("Error ".$syslog, LOG_ERR);
|
|
| 3747 | 3747 | } |
| 3748 | 3748 | |
| 3749 | 3749 | /** |
@@ -3766,13 +3766,13 @@ discard block |
||
| 3766 | 3766 | $langs->load("errors");
|
| 3767 | 3767 | $now = dol_now(); |
| 3768 | 3768 | |
| 3769 | - print '<br><div class="center login_main_message"><div class="' . $morecss . '">'; |
|
| 3770 | - print $langs->trans("ErrorContactEMail", $email, $prefixcode . dol_print_date($now, '%Y%m%d'));
|
|
| 3769 | + print '<br><div class="center login_main_message"><div class="'.$morecss.'">'; |
|
| 3770 | + print $langs->trans("ErrorContactEMail", $email, $prefixcode.dol_print_date($now, '%Y%m%d'));
|
|
| 3771 | 3771 | if ($errormessage) |
| 3772 | - print '<br><br>' . $errormessage; |
|
| 3772 | + print '<br><br>'.$errormessage; |
|
| 3773 | 3773 | if (is_array($errormessages) && count($errormessages)) {
|
| 3774 | 3774 | foreach ($errormessages as $mesgtoshow) {
|
| 3775 | - print '<br><br>' . $mesgtoshow; |
|
| 3775 | + print '<br><br>'.$mesgtoshow; |
|
| 3776 | 3776 | } |
| 3777 | 3777 | } |
| 3778 | 3778 | print '</div></div>'; |
@@ -3830,16 +3830,16 @@ discard block |
||
| 3830 | 3830 | } |
| 3831 | 3831 | |
| 3832 | 3832 | $tmpsortfield = explode(',', $sortfield);
|
| 3833 | - $sortfield1 = trim($tmpsortfield[0]); // If $sortfield is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3833 | + $sortfield1 = trim($tmpsortfield[0]); // If $sortfield is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3834 | 3834 | $tmpfield = explode(',', $field);
|
| 3835 | - $field1 = trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3835 | + $field1 = trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep' |
|
| 3836 | 3836 | //var_dump('field='.$field.' field1='.$field1.' sortfield='.$sortfield.' sortfield1='.$sortfield1);
|
| 3837 | 3837 | // If field is used as sort criteria we use a specific css class liste_titre_sel |
| 3838 | 3838 | // Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
|
| 3839 | 3839 | if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./", "", $field1))) {
|
| 3840 | - $out .= '<' . $tag . ' class="' . $prefix . 'liste_titre_sel" ' . $moreattrib . '>'; |
|
| 3840 | + $out .= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '.$moreattrib.'>'; |
|
| 3841 | 3841 | } else {
|
| 3842 | - $out .= '<' . $tag . ' class="' . $prefix . 'liste_titre" ' . $moreattrib . '>'; |
|
| 3842 | + $out .= '<'.$tag.' class="'.$prefix.'liste_titre" '.$moreattrib.'>'; |
|
| 3843 | 3843 | } |
| 3844 | 3844 | |
| 3845 | 3845 | if (empty($thead) && $field && empty($disablesortlink)) { // If this is a sort field
|
@@ -3847,7 +3847,7 @@ discard block |
||
| 3847 | 3847 | $options = preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i', '', $options);
|
| 3848 | 3848 | $options = preg_replace('/&+/i', '&', $options);
|
| 3849 | 3849 | if (!preg_match('/^&/', $options)) {
|
| 3850 | - $options = '&' . $options; |
|
| 3850 | + $options = '&'.$options; |
|
| 3851 | 3851 | } |
| 3852 | 3852 | |
| 3853 | 3853 | $sortordertouseinlink = ''; |
@@ -3865,7 +3865,7 @@ discard block |
||
| 3865 | 3865 | } |
| 3866 | 3866 | } |
| 3867 | 3867 | $sortordertouseinlink = preg_replace('/,$/', '', $sortordertouseinlink);
|
| 3868 | - $out .= '<a class="reposition" href="' . $file . '?sortfield=' . $field . '&sortorder=' . $sortordertouseinlink . '&begin=' . $begin . $options . '">'; |
|
| 3868 | + $out .= '<a class="reposition" href="'.$file.'?sortfield='.$field.'&sortorder='.$sortordertouseinlink.'&begin='.$begin.$options.'">'; |
|
| 3869 | 3869 | } |
| 3870 | 3870 | |
| 3871 | 3871 | if ($tooltip) {
|
@@ -3883,7 +3883,7 @@ discard block |
||
| 3883 | 3883 | $options = preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i', '', $options);
|
| 3884 | 3884 | $options = preg_replace('/&+/i', '&', $options);
|
| 3885 | 3885 | if (!preg_match('/^&/', $options)) {
|
| 3886 | - $options = '&' . $options; |
|
| 3886 | + $options = '&'.$options; |
|
| 3887 | 3887 | } |
| 3888 | 3888 | |
| 3889 | 3889 | if (!$sortorder || $field1 != $sortfield1) {
|
@@ -3893,19 +3893,19 @@ discard block |
||
| 3893 | 3893 | if (preg_match('/^DESC/', $sortorder)) {
|
| 3894 | 3894 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
|
| 3895 | 3895 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",1).'</a>';
|
| 3896 | - $sortimg .= '<span class="nowrap">' . img_up("Z-A", 0) . '</span>';
|
|
| 3896 | + $sortimg .= '<span class="nowrap">'.img_up("Z-A", 0).'</span>';
|
|
| 3897 | 3897 | } |
| 3898 | 3898 | if (preg_match('/^ASC/', $sortorder)) {
|
| 3899 | 3899 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",1).'</a>';
|
| 3900 | 3900 | //$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
|
| 3901 | - $sortimg .= '<span class="nowrap">' . img_down("A-Z", 0) . '</span>';
|
|
| 3901 | + $sortimg .= '<span class="nowrap">'.img_down("A-Z", 0).'</span>';
|
|
| 3902 | 3902 | } |
| 3903 | 3903 | } |
| 3904 | 3904 | } |
| 3905 | 3905 | |
| 3906 | 3906 | $out .= $sortimg; |
| 3907 | 3907 | |
| 3908 | - $out .= '</' . $tag . '>'; |
|
| 3908 | + $out .= '</'.$tag.'>'; |
|
| 3909 | 3909 | |
| 3910 | 3910 | return $out; |
| 3911 | 3911 | } |
@@ -3920,9 +3920,9 @@ discard block |
||
| 3920 | 3920 | */ |
| 3921 | 3921 | function print_titre($title) |
| 3922 | 3922 | {
|
| 3923 | - dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 3923 | + dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 3924 | 3924 | |
| 3925 | - print '<div class="titre">' . $title . '</div>'; |
|
| 3925 | + print '<div class="titre">'.$title.'</div>'; |
|
| 3926 | 3926 | } |
| 3927 | 3927 | |
| 3928 | 3928 | /** |
@@ -3965,20 +3965,20 @@ discard block |
||
| 3965 | 3965 | } |
| 3966 | 3966 | |
| 3967 | 3967 | $return .= "\n"; |
| 3968 | - $return .= '<table ' . ($id ? 'id="' . $id . '" ' : '') . 'summary="" class="centpercent notopnoleftnoright' . ($morecssontable ? ' ' . $morecssontable : '') . '" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into print_barre_list |
|
| 3968 | + $return .= '<table '.($id ? 'id="'.$id.'" ' : '').'summary="" class="centpercent notopnoleftnoright'.($morecssontable ? ' '.$morecssontable : '').'" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into print_barre_list |
|
| 3969 | 3969 | if ($picto) {
|
| 3970 | - $return .= '<td class="nobordernopadding widthpictotitle opacityhigh" valign="middle">' . img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath) . '</td>';
|
|
| 3970 | + $return .= '<td class="nobordernopadding widthpictotitle opacityhigh" valign="middle">'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).'</td>';
|
|
| 3971 | 3971 | } |
| 3972 | 3972 | $return .= '<td class="nobordernopadding valignmiddle">'; |
| 3973 | - $return .= '<div class="titre inline-block">' . $titre . '</div>'; |
|
| 3973 | + $return .= '<div class="titre inline-block">'.$titre.'</div>'; |
|
| 3974 | 3974 | $return .= '</td>'; |
| 3975 | 3975 | if (dol_strlen($morehtmlcenter)) {
|
| 3976 | - $return .= '<td class="nobordernopadding" align="center" valign="middle">' . $morehtmlcenter . '</td>'; |
|
| 3976 | + $return .= '<td class="nobordernopadding" align="center" valign="middle">'.$morehtmlcenter.'</td>'; |
|
| 3977 | 3977 | } |
| 3978 | 3978 | if (dol_strlen($morehtmlright)) {
|
| 3979 | - $return .= '<td class="nobordernopadding titre_right wordbreak" align="right" valign="middle">' . $morehtmlright . '</td>'; |
|
| 3979 | + $return .= '<td class="nobordernopadding titre_right wordbreak" align="right" valign="middle">'.$morehtmlright.'</td>'; |
|
| 3980 | 3980 | } |
| 3981 | - $return .= '</tr></table>' . "\n"; |
|
| 3981 | + $return .= '</tr></table>'."\n"; |
|
| 3982 | 3982 | |
| 3983 | 3983 | return $return; |
| 3984 | 3984 | } |
@@ -4026,29 +4026,29 @@ discard block |
||
| 4026 | 4026 | //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage; |
| 4027 | 4027 | |
| 4028 | 4028 | print "\n"; |
| 4029 | - print "<!-- Begin title '" . $titre . "' -->\n"; |
|
| 4030 | - print '<table border="0" class="centpercent notopnoleftnoright' . ($morecss ? ' ' . $morecss : '') . '" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into load_fiche_tire |
|
| 4029 | + print "<!-- Begin title '".$titre."' -->\n"; |
|
| 4030 | + print '<table border="0" class="centpercent notopnoleftnoright'.($morecss ? ' '.$morecss : '').'" style="margin-bottom: 6px;"><tr>'; // maring bottom must be same than into load_fiche_tire |
|
| 4031 | 4031 | // Left |
| 4032 | 4032 | //if ($picto && $titre) print '<td class="nobordernopadding hideonsmartphone" width="40" align="left" valign="middle">'.img_picto('', $picto, 'id="pictotitle"', $pictoisfullpath).'</td>';
|
| 4033 | 4033 | print '<td class="nobordernopadding valignmiddle">'; |
| 4034 | 4034 | if ($picto && $titre) |
| 4035 | 4035 | print img_picto('', $picto, 'class="hideonsmartphone valignmiddle opacityhigh pictotitle widthpictotitle"', $pictoisfullpath);
|
| 4036 | - print '<div class="titre inline-block">' . $titre; |
|
| 4036 | + print '<div class="titre inline-block">'.$titre; |
|
| 4037 | 4037 | if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') |
| 4038 | - print ' (' . $totalnboflines . ')';
|
|
| 4038 | + print ' ('.$totalnboflines.')';
|
|
| 4039 | 4039 | print '</div></td>'; |
| 4040 | 4040 | |
| 4041 | 4041 | // Center |
| 4042 | 4042 | if ($morehtmlcenter) {
|
| 4043 | - print '<td class="nobordernopadding center valignmiddle">' . $morehtmlcenter . '</td>'; |
|
| 4043 | + print '<td class="nobordernopadding center valignmiddle">'.$morehtmlcenter.'</td>'; |
|
| 4044 | 4044 | } |
| 4045 | 4045 | |
| 4046 | 4046 | // Right |
| 4047 | 4047 | print '<td class="nobordernopadding valignmiddle" align="right">'; |
| 4048 | 4048 | if ($sortfield) |
| 4049 | - $options .= "&sortfield=" . urlencode($sortfield); |
|
| 4049 | + $options .= "&sortfield=".urlencode($sortfield); |
|
| 4050 | 4050 | if ($sortorder) |
| 4051 | - $options .= "&sortorder=" . urlencode($sortorder); |
|
| 4051 | + $options .= "&sortorder=".urlencode($sortorder); |
|
| 4052 | 4052 | // Show navigation bar |
| 4053 | 4053 | $pagelist = ''; |
| 4054 | 4054 | if ($savlimit != 0 && ($page > 0 || $num > $limit)) {
|
@@ -4066,40 +4066,40 @@ discard block |
||
| 4066 | 4066 | } |
| 4067 | 4067 | |
| 4068 | 4068 | if ($cpt >= 1) {
|
| 4069 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=0' . $options . '">1</a></li>'; |
|
| 4069 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page=0'.$options.'">1</a></li>'; |
|
| 4070 | 4070 | if ($cpt > 2) |
| 4071 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '') . '>...</span></li>'; |
|
| 4071 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '').'>...</span></li>'; |
|
| 4072 | 4072 | else if ($cpt == 2) |
| 4073 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=1' . $options . '">2</a></li>'; |
|
| 4073 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page=1'.$options.'">2</a></li>'; |
|
| 4074 | 4074 | } |
| 4075 | 4075 | |
| 4076 | 4076 | do {
|
| 4077 | 4077 | if ($cpt == $page) {
|
| 4078 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="active"' : '') . '>' . ($page + 1) . '</span></li>'; |
|
| 4078 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="active"' : '').'>'.($page + 1).'</span></li>'; |
|
| 4079 | 4079 | } else {
|
| 4080 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . $cpt . $options . '">' . ($cpt + 1) . '</a></li>'; |
|
| 4080 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.$cpt.$options.'">'.($cpt + 1).'</a></li>'; |
|
| 4081 | 4081 | } |
| 4082 | 4082 | $cpt++; |
| 4083 | 4083 | } while ($cpt < $nbpages && $cpt <= $page + $maxnbofpage); |
| 4084 | 4084 | |
| 4085 | 4085 | if ($cpt < $nbpages) {
|
| 4086 | 4086 | if ($cpt < $nbpages - 2) |
| 4087 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '') . '>...</span></li>'; |
|
| 4087 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="inactive"' : '').'>...</span></li>'; |
|
| 4088 | 4088 | else if ($cpt == $nbpages - 2) |
| 4089 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . ($nbpages - 2) . $options . '">' . ($nbpages - 1) . '</a></li>'; |
|
| 4090 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><a href="' . $file . '?page=' . ($nbpages - 1) . $options . '">' . $nbpages . '</a></li>'; |
|
| 4089 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.($nbpages - 2).$options.'">'.($nbpages - 1).'</a></li>'; |
|
| 4090 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><a href="'.$file.'?page='.($nbpages - 1).$options.'">'.$nbpages.'</a></li>'; |
|
| 4091 | 4091 | } |
| 4092 | 4092 | } |
| 4093 | 4093 | else {
|
| 4094 | - $pagelist .= '<li' . (($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '') . '><span ' . (($conf->dol_use_jmobile != 4) ? 'class="active"' : '') . '>' . ($page + 1) . "</li>"; |
|
| 4094 | + $pagelist .= '<li'.(($conf->dol_use_jmobile != 4) ? ' class="pagination"' : '').'><span '.(($conf->dol_use_jmobile != 4) ? 'class="active"' : '').'>'.($page + 1)."</li>"; |
|
| 4095 | 4095 | } |
| 4096 | 4096 | } |
| 4097 | 4097 | |
| 4098 | - print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist |
|
| 4098 | + print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist |
|
| 4099 | 4099 | |
| 4100 | 4100 | print '</td>'; |
| 4101 | 4101 | |
| 4102 | - print '</tr></table>' . "\n"; |
|
| 4102 | + print '</tr></table>'."\n"; |
|
| 4103 | 4103 | print "<!-- End title -->\n\n"; |
| 4104 | 4104 | } |
| 4105 | 4105 | |
@@ -4130,12 +4130,12 @@ discard block |
||
| 4130 | 4130 | $pagesizechoices = $conf->global->MAIN_PAGESIZE_CHOICES; |
| 4131 | 4131 | |
| 4132 | 4132 | print '<li class="pagination">'; |
| 4133 | - print '<select class="flat selectlimit" name="limit" title="' . dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")) . '">';
|
|
| 4133 | + print '<select class="flat selectlimit" name="limit" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
|
|
| 4134 | 4134 | $tmpchoice = explode(',', $pagesizechoices);
|
| 4135 | - $tmpkey = $limit . ':' . $limit; |
|
| 4135 | + $tmpkey = $limit.':'.$limit; |
|
| 4136 | 4136 | if (!in_array($tmpkey, $tmpchoice)) |
| 4137 | 4137 | $tmpchoice[] = $tmpkey; |
| 4138 | - $tmpkey = $conf->liste_limit . ':' . $conf->liste_limit; |
|
| 4138 | + $tmpkey = $conf->liste_limit.':'.$conf->liste_limit; |
|
| 4139 | 4139 | if (!in_array($tmpkey, $tmpchoice)) |
| 4140 | 4140 | $tmpchoice[] = $tmpkey; |
| 4141 | 4141 | asort($tmpchoice, SORT_NUMERIC); |
@@ -4150,7 +4150,7 @@ discard block |
||
| 4150 | 4150 | $selected = ' selected="selected"'; |
| 4151 | 4151 | $found = true; |
| 4152 | 4152 | } |
| 4153 | - print '<option name="' . $key . '"' . $selected . '>' . dol_escape_htmltag($val) . '</option>' . "\n"; |
|
| 4153 | + print '<option name="'.$key.'"'.$selected.'>'.dol_escape_htmltag($val).'</option>'."\n"; |
|
| 4154 | 4154 | } |
| 4155 | 4155 | } |
| 4156 | 4156 | print '</select>'; |
@@ -4169,20 +4169,20 @@ discard block |
||
| 4169 | 4169 | print '</li>'; |
| 4170 | 4170 | } |
| 4171 | 4171 | if ($page > 0) {
|
| 4172 | - print '<li class="pagination"><a class="paginationprevious" href="' . $file . '?page=' . ($page - 1) . $options . '"><i class="fa fa-chevron-left" title="' . dol_escape_htmltag($langs->trans("Previous")) . '"></i></a></li>';
|
|
| 4172 | + print '<li class="pagination"><a class="paginationprevious" href="'.$file.'?page='.($page - 1).$options.'"><i class="fa fa-chevron-left" title="'.dol_escape_htmltag($langs->trans("Previous")).'"></i></a></li>';
|
|
| 4173 | 4173 | } |
| 4174 | 4174 | if ($betweenarrows) {
|
| 4175 | 4175 | print $betweenarrows; |
| 4176 | 4176 | } |
| 4177 | 4177 | if ($nextpage > 0) {
|
| 4178 | - print '<li class="pagination"><a class="paginationnext" href="' . $file . '?page=' . ($page + 1) . $options . '"><i class="fa fa-chevron-right" title="' . dol_escape_htmltag($langs->trans("Next")) . '"></i></a></li>';
|
|
| 4178 | + print '<li class="pagination"><a class="paginationnext" href="'.$file.'?page='.($page + 1).$options.'"><i class="fa fa-chevron-right" title="'.dol_escape_htmltag($langs->trans("Next")).'"></i></a></li>';
|
|
| 4179 | 4179 | } |
| 4180 | 4180 | if ($afterarrows) {
|
| 4181 | 4181 | print '<li class="paginationafterarrows">'; |
| 4182 | 4182 | print $afterarrows; |
| 4183 | 4183 | print '</li>'; |
| 4184 | 4184 | } |
| 4185 | - print '</ul></div>' . "\n"; |
|
| 4185 | + print '</ul></div>'."\n"; |
|
| 4186 | 4186 | } |
| 4187 | 4187 | |
| 4188 | 4188 | /** |
@@ -4204,8 +4204,8 @@ discard block |
||
| 4204 | 4204 | $addpercent = true; |
| 4205 | 4205 | } |
| 4206 | 4206 | if (preg_match('/\((.*)\)/', $rate, $reg)) {
|
| 4207 | - $morelabel = ' (' . $reg[1] . ')';
|
|
| 4208 | - $rate = preg_replace('/\s*' . preg_quote($morelabel, '/') . '/', '', $rate);
|
|
| 4207 | + $morelabel = ' ('.$reg[1].')';
|
|
| 4208 | + $rate = preg_replace('/\s*'.preg_quote($morelabel, '/').'/', '', $rate);
|
|
| 4209 | 4209 | } |
| 4210 | 4210 | if (preg_match('/\*/', $rate)) {
|
| 4211 | 4211 | $rate = str_replace('*', '', $rate);
|
@@ -4214,10 +4214,10 @@ discard block |
||
| 4214 | 4214 | |
| 4215 | 4215 | // If rate is '9/9/9' we don't change it. If rate is '9.000' we apply price() |
| 4216 | 4216 | if (!preg_match('/\//', $rate))
|
| 4217 | - $ret = price($rate, 0, '', 0, 0) . ($addpercent ? '%' : ''); |
|
| 4217 | + $ret = price($rate, 0, '', 0, 0).($addpercent ? '%' : ''); |
|
| 4218 | 4218 | else {
|
| 4219 | 4219 | // TODO Split on / and output with a price2num to have clean numbers without ton of 000. |
| 4220 | - $ret = $rate . ($addpercent ? '%' : ''); |
|
| 4220 | + $ret = $rate.($addpercent ? '%' : ''); |
|
| 4221 | 4221 | } |
| 4222 | 4222 | if (($info_bits & 1) && $usestarfornpr >= 0) |
| 4223 | 4223 | $ret .= ' *'; |
@@ -4311,10 +4311,10 @@ discard block |
||
| 4311 | 4311 | $cursymbolbefore .= $outlangs->getCurrencySymbol($currency_code); |
| 4312 | 4312 | else {
|
| 4313 | 4313 | $tmpcur = $outlangs->getCurrencySymbol($currency_code); |
| 4314 | - $cursymbolafter .= ($tmpcur == $currency_code ? ' ' . $tmpcur : $tmpcur); |
|
| 4314 | + $cursymbolafter .= ($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur); |
|
| 4315 | 4315 | } |
| 4316 | 4316 | } |
| 4317 | - $output = $cursymbolbefore . $output . $end . ($cursymbolafter ? ' ' : '') . $cursymbolafter; |
|
| 4317 | + $output = $cursymbolbefore.$output.$end.($cursymbolafter ? ' ' : '').$cursymbolafter; |
|
| 4318 | 4318 | |
| 4319 | 4319 | return $output; |
| 4320 | 4320 | } |
@@ -4368,7 +4368,7 @@ discard block |
||
| 4368 | 4368 | // Now make replace (the main goal of function) |
| 4369 | 4369 | if ($thousand != ',' && $thousand != '.') |
| 4370 | 4370 | $amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
| 4371 | - $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4371 | + $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4372 | 4372 | $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is . |
| 4373 | 4373 | $amount = str_replace($dec, '.', $amount); |
| 4374 | 4374 | } |
@@ -4397,14 +4397,14 @@ discard block |
||
| 4397 | 4397 | $temps = sprintf("%0.10F", $amount - intval($amount)); // temps=0.0000000000 or 0.0000200000 or 9999.1000000000
|
| 4398 | 4398 | $temps = preg_replace('/([\.1-9])0+$/', '\\1', $temps); // temps=0. or 0.00002 or 9999.1
|
| 4399 | 4399 | $nbofdec = max(0, dol_strlen($temps) - 2); // -2 to remove "0." |
| 4400 | - $amount = number_format($amount, min($nbofdec, $nbofdectoround), $dec, $thousand); // Convert amount to format with dolibarr dec and thousand |
|
| 4400 | + $amount = number_format($amount, min($nbofdec, $nbofdectoround), $dec, $thousand); // Convert amount to format with dolibarr dec and thousand |
|
| 4401 | 4401 | } |
| 4402 | 4402 | //print "TT".$amount.'<br>'; |
| 4403 | 4403 | // Always make replace because each math function (like round) replace |
| 4404 | 4404 | // with local values and we want a number that has a SQL string format x.y |
| 4405 | 4405 | if ($thousand != ',' && $thousand != '.') |
| 4406 | 4406 | $amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
| 4407 | - $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4407 | + $amount = str_replace(' ', '', $amount); // To avoid spaces
|
|
| 4408 | 4408 | $amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is . |
| 4409 | 4409 | $amount = str_replace($dec, '.', $amount); |
| 4410 | 4410 | } |
@@ -4425,7 +4425,7 @@ discard block |
||
| 4425 | 4425 | */ |
| 4426 | 4426 | function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no') |
| 4427 | 4427 | {
|
| 4428 | - require_once DOL_BASE_PATH . '/core/lib/product.lib.php'; |
|
| 4428 | + require_once DOL_BASE_PATH.'/core/lib/product.lib.php'; |
|
| 4429 | 4429 | |
| 4430 | 4430 | if (($forceunitoutput == 'no' && $dimension < 1 / 10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6)) {
|
| 4431 | 4431 | $dimension = $dimension * 1000000; |
@@ -4441,7 +4441,7 @@ discard block |
||
| 4441 | 4441 | $unit = $unit + 3; |
| 4442 | 4442 | } |
| 4443 | 4443 | |
| 4444 | - $ret = price($dimension, 0, $outputlangs, 0, 0, $round) . ' ' . measuring_units_string($unit, $type); |
|
| 4444 | + $ret = price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type); |
|
| 4445 | 4445 | |
| 4446 | 4446 | return $ret; |
| 4447 | 4447 | } |
@@ -4465,7 +4465,7 @@ discard block |
||
| 4465 | 4465 | if (empty($thirdparty_seller) || !is_object($thirdparty_seller)) |
| 4466 | 4466 | $thirdparty_seller = $mysoc; |
| 4467 | 4467 | |
| 4468 | - dol_syslog("get_localtax tva=" . $vatrate . " local=" . $local . " thirdparty_buyer id=" . (is_object($thirdparty_buyer) ? $thirdparty_buyer->id : '') . "/country_code=" . (is_object($thirdparty_buyer) ? $thirdparty_buyer->country_code : '') . " thirdparty_seller id=" . $thirdparty_seller->id . "/country_code=" . $thirdparty_seller->country_code . " thirdparty_seller localtax1_assuj=" . $thirdparty_seller->localtax1_assuj . " thirdparty_seller localtax2_assuj=" . $thirdparty_seller->localtax2_assuj);
|
|
| 4468 | + dol_syslog("get_localtax tva=".$vatrate." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer) ? $thirdparty_buyer->id : '')."/country_code=".(is_object($thirdparty_buyer) ? $thirdparty_buyer->country_code : '')." thirdparty_seller id=".$thirdparty_seller->id."/country_code=".$thirdparty_seller->country_code." thirdparty_seller localtax1_assuj=".$thirdparty_seller->localtax1_assuj." thirdparty_seller localtax2_assuj=".$thirdparty_seller->localtax2_assuj);
|
|
| 4469 | 4469 | |
| 4470 | 4470 | $vatratecleaned = $vatrate; |
| 4471 | 4471 | if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) { // If vat is "xx (yy)"
|
@@ -4496,7 +4496,7 @@ discard block |
||
| 4496 | 4496 | if ($local == 2) {
|
| 4497 | 4497 | //if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; |
| 4498 | 4498 | if (!$mysoc->localtax2_assuj) |
| 4499 | - return 0; // If main vat is 0, IRPF may be different than 0. |
|
| 4499 | + return 0; // If main vat is 0, IRPF may be different than 0. |
|
| 4500 | 4500 | if ($thirdparty_seller->id == $mysoc->id) {
|
| 4501 | 4501 | if (!$thirdparty_buyer->localtax2_assuj) |
| 4502 | 4502 | return 0; |
@@ -4550,13 +4550,13 @@ discard block |
||
| 4550 | 4550 | |
| 4551 | 4551 | // By default, search value of local tax on line of common tax |
| 4552 | 4552 | $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; |
| 4553 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4554 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $thirdparty_seller->country_code . "'"; |
|
| 4555 | - $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1"; |
|
| 4553 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4554 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'"; |
|
| 4555 | + $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; |
|
| 4556 | 4556 | if ($vatratecode) |
| 4557 | - $sql .= " AND t.code ='" . $vatratecode . "'"; // If we have the code, we use it in priority |
|
| 4557 | + $sql .= " AND t.code ='".$vatratecode."'"; // If we have the code, we use it in priority |
|
| 4558 | 4558 | else |
| 4559 | - $sql .= " AND t.recuperableonly ='" . $vatnpr . "'"; |
|
| 4559 | + $sql .= " AND t.recuperableonly ='".$vatnpr."'"; |
|
| 4560 | 4560 | dol_syslog("get_localtax", LOG_DEBUG);
|
| 4561 | 4561 | $resql = $db->query($sql); |
| 4562 | 4562 | |
@@ -4602,10 +4602,10 @@ discard block |
||
| 4602 | 4602 | {
|
| 4603 | 4603 | global $db, $mysoc; |
| 4604 | 4604 | $sql = "SELECT t.localtax1, t.localtax2 "; |
| 4605 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t inner join " . MAIN_DB_PREFIX . "c_country as c ON c.rowid=t.fk_pays"; |
|
| 4606 | - $sql .= " WHERE c.code = '" . $mysoc->country_code . "' AND t.active = 1 AND t.taux=(";
|
|
| 4607 | - $sql .= " SELECT max(tt.taux) FROM " . MAIN_DB_PREFIX . "c_tva as tt inner join " . MAIN_DB_PREFIX . "c_country as c ON c.rowid=tt.fk_pays"; |
|
| 4608 | - $sql .= " WHERE c.code = '" . $mysoc->country_code . "' AND tt.active = 1"; |
|
| 4605 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=t.fk_pays"; |
|
| 4606 | + $sql .= " WHERE c.code = '".$mysoc->country_code."' AND t.active = 1 AND t.taux=(";
|
|
| 4607 | + $sql .= " SELECT max(tt.taux) FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=tt.fk_pays"; |
|
| 4608 | + $sql .= " WHERE c.code = '".$mysoc->country_code."' AND tt.active = 1"; |
|
| 4609 | 4609 | $sql .= " )"; |
| 4610 | 4610 | |
| 4611 | 4611 | $resql = $db->query($sql); |
@@ -4635,13 +4635,13 @@ discard block |
||
| 4635 | 4635 | {
|
| 4636 | 4636 | global $db, $mysoc; |
| 4637 | 4637 | |
| 4638 | - dol_syslog("getTaxesFromId vat id or rate = " . $vatrate);
|
|
| 4638 | + dol_syslog("getTaxesFromId vat id or rate = ".$vatrate);
|
|
| 4639 | 4639 | |
| 4640 | 4640 | // Search local taxes |
| 4641 | 4641 | $sql = "SELECT t.rowid, t.code, t.taux as rate, t.recuperableonly as npr, t.accountancy_code_sell, t.accountancy_code_buy"; |
| 4642 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t"; |
|
| 4642 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t"; |
|
| 4643 | 4643 | if ($firstparamisid) |
| 4644 | - $sql .= " WHERE t.rowid = " . (int) $vatrate; |
|
| 4644 | + $sql .= " WHERE t.rowid = ".(int) $vatrate; |
|
| 4645 | 4645 | else {
|
| 4646 | 4646 | $vatratecleaned = $vatrate; |
| 4647 | 4647 | $vatratecode = ''; |
@@ -4650,13 +4650,13 @@ discard block |
||
| 4650 | 4650 | $vatratecode = $reg[2]; |
| 4651 | 4651 | } |
| 4652 | 4652 | |
| 4653 | - $sql .= ", " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4653 | + $sql .= ", ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4654 | 4654 | /* if ($mysoc->country_code == 'ES') $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; // vat in spain use the buyer country ?? |
| 4655 | 4655 | else $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; */ |
| 4656 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $seller->country_code . "'"; |
|
| 4657 | - $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1"; |
|
| 4656 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; |
|
| 4657 | + $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; |
|
| 4658 | 4658 | if ($vatratecode) |
| 4659 | - $sql .= " AND t.code = '" . $vatratecode . "'"; |
|
| 4659 | + $sql .= " AND t.code = '".$vatratecode."'"; |
|
| 4660 | 4660 | } |
| 4661 | 4661 | |
| 4662 | 4662 | $resql = $db->query($sql); |
@@ -4692,13 +4692,13 @@ discard block |
||
| 4692 | 4692 | {
|
| 4693 | 4693 | global $db, $mysoc; |
| 4694 | 4694 | |
| 4695 | - dol_syslog("getLocalTaxesFromRate vatrate=" . $vatrate . " local=" . $local);
|
|
| 4695 | + dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local);
|
|
| 4696 | 4696 | |
| 4697 | 4697 | // Search local taxes |
| 4698 | 4698 | $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; |
| 4699 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t"; |
|
| 4699 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t"; |
|
| 4700 | 4700 | if ($firstparamisid) |
| 4701 | - $sql .= " WHERE t.rowid = " . (int) $vatrate; |
|
| 4701 | + $sql .= " WHERE t.rowid = ".(int) $vatrate; |
|
| 4702 | 4702 | else {
|
| 4703 | 4703 | $vatratecleaned = $vatrate; |
| 4704 | 4704 | $vatratecode = ''; |
@@ -4707,14 +4707,14 @@ discard block |
||
| 4707 | 4707 | $vatratecode = $reg[2]; |
| 4708 | 4708 | } |
| 4709 | 4709 | |
| 4710 | - $sql .= ", " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4710 | + $sql .= ", ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4711 | 4711 | if ($mysoc->country_code == 'ES') |
| 4712 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $buyer->country_code . "'"; // local tax in spain use the buyer country ?? |
|
| 4712 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; // local tax in spain use the buyer country ?? |
|
| 4713 | 4713 | else |
| 4714 | - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '" . $seller->country_code . "'"; |
|
| 4715 | - $sql .= " AND t.taux = " . ((float) $vatratecleaned) . " AND t.active = 1"; |
|
| 4714 | + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; |
|
| 4715 | + $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; |
|
| 4716 | 4716 | if ($vatratecode) |
| 4717 | - $sql .= " AND t.code = '" . $vatratecode . "'"; |
|
| 4717 | + $sql .= " AND t.code = '".$vatratecode."'"; |
|
| 4718 | 4718 | } |
| 4719 | 4719 | |
| 4720 | 4720 | $resql = $db->query($sql); |
@@ -4746,7 +4746,7 @@ discard block |
||
| 4746 | 4746 | {
|
| 4747 | 4747 | global $db, $conf, $mysoc; |
| 4748 | 4748 | |
| 4749 | - require_once DOL_BASE_PATH . '/product/class/product.class.php'; |
|
| 4749 | + require_once DOL_BASE_PATH.'/product/class/product.class.php'; |
|
| 4750 | 4750 | |
| 4751 | 4751 | $ret = 0; |
| 4752 | 4752 | $found = 0; |
@@ -4761,12 +4761,12 @@ discard block |
||
| 4761 | 4761 | $product->get_buyprice($idprodfournprice, 0, 0, 0); |
| 4762 | 4762 | $ret = $product->vatrate_supplier; |
| 4763 | 4763 | if ($product->default_vat_code) |
| 4764 | - $ret .= ' (' . $product->default_vat_code . ')';
|
|
| 4764 | + $ret .= ' ('.$product->default_vat_code.')';
|
|
| 4765 | 4765 | } |
| 4766 | 4766 | else {
|
| 4767 | - $ret = $product->tva_tx; // Default vat of product we defined |
|
| 4767 | + $ret = $product->tva_tx; // Default vat of product we defined |
|
| 4768 | 4768 | if ($product->default_vat_code) |
| 4769 | - $ret .= ' (' . $product->default_vat_code . ')';
|
|
| 4769 | + $ret .= ' ('.$product->default_vat_code.')';
|
|
| 4770 | 4770 | } |
| 4771 | 4771 | $found = 1; |
| 4772 | 4772 | } |
@@ -4780,8 +4780,8 @@ discard block |
||
| 4780 | 4780 | if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) {
|
| 4781 | 4781 | // If vat of product for the country not found or not defined, we return the first higher vat of country. |
| 4782 | 4782 | $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code"; |
| 4783 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4784 | - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='" . $thirdparty_seller->country_code . "'"; |
|
| 4783 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4784 | + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; |
|
| 4785 | 4785 | $sql .= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC"; |
| 4786 | 4786 | $sql .= $db->plimit(1); |
| 4787 | 4787 | |
@@ -4791,16 +4791,16 @@ discard block |
||
| 4791 | 4791 | if ($obj) {
|
| 4792 | 4792 | $ret = $obj->vat_rate; |
| 4793 | 4793 | if ($obj->default_vat_code) |
| 4794 | - $ret .= ' (' . $obj->default_vat_code . ')';
|
|
| 4794 | + $ret .= ' ('.$obj->default_vat_code.')';
|
|
| 4795 | 4795 | } |
| 4796 | 4796 | $db->free($sql); |
| 4797 | 4797 | } else |
| 4798 | 4798 | dol_print_error($db); |
| 4799 | 4799 | } else |
| 4800 | - $ret = $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS; // Forced value if autodetect fails |
|
| 4800 | + $ret = $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS; // Forced value if autodetect fails |
|
| 4801 | 4801 | } |
| 4802 | 4802 | |
| 4803 | - dol_syslog("get_product_vat_for_country: ret=" . $ret);
|
|
| 4803 | + dol_syslog("get_product_vat_for_country: ret=".$ret);
|
|
| 4804 | 4804 | return $ret; |
| 4805 | 4805 | } |
| 4806 | 4806 | |
@@ -4818,7 +4818,7 @@ discard block |
||
| 4818 | 4818 | global $db, $mysoc; |
| 4819 | 4819 | |
| 4820 | 4820 | if (!class_exists('Product')) {
|
| 4821 | - require_once DOL_BASE_PATH . 'product/class/product.class.php'; |
|
| 4821 | + require_once DOL_BASE_PATH.'product/class/product.class.php'; |
|
| 4822 | 4822 | } |
| 4823 | 4823 | |
| 4824 | 4824 | $ret = 0; |
@@ -4843,8 +4843,8 @@ discard block |
||
| 4843 | 4843 | if (!$found) {
|
| 4844 | 4844 | // If vat of product for the country not found or not defined, we return higher vat of country. |
| 4845 | 4845 | $sql = "SELECT taux as vat_rate, localtax1, localtax2"; |
| 4846 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c"; |
|
| 4847 | - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='" . $thirdparty_seller->country_code . "'"; |
|
| 4846 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; |
|
| 4847 | + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; |
|
| 4848 | 4848 | $sql .= " ORDER BY t.taux DESC, t.recuperableonly ASC"; |
| 4849 | 4849 | $sql .= $db->plimit(1); |
| 4850 | 4850 | |
@@ -4861,7 +4861,7 @@ discard block |
||
| 4861 | 4861 | dol_print_error($db); |
| 4862 | 4862 | } |
| 4863 | 4863 | |
| 4864 | - dol_syslog("get_product_localtax_for_country: ret=" . $ret);
|
|
| 4864 | + dol_syslog("get_product_localtax_for_country: ret=".$ret);
|
|
| 4865 | 4865 | return $ret; |
| 4866 | 4866 | } |
| 4867 | 4867 | |
@@ -4885,7 +4885,7 @@ discard block |
||
| 4885 | 4885 | {
|
| 4886 | 4886 | global $conf; |
| 4887 | 4887 | |
| 4888 | - require_once DOL_BASE_PATH . '/core/lib/company.lib.php'; |
|
| 4888 | + require_once DOL_BASE_PATH.'/core/lib/company.lib.php'; |
|
| 4889 | 4889 | |
| 4890 | 4890 | // Note: possible values for tva_assuj are 0/1 or franchise/reel |
| 4891 | 4891 | $seller_use_vat = ((is_numeric($thirdparty_seller->tva_assuj) && !$thirdparty_seller->tva_assuj) || (!is_numeric($thirdparty_seller->tva_assuj) && $thirdparty_seller->tva_assuj == 'franchise')) ? 0 : 1; |
@@ -4896,7 +4896,7 @@ discard block |
||
| 4896 | 4896 | $buyer_country_code = $thirdparty_buyer->country_code; |
| 4897 | 4897 | $buyer_in_cee = isInEEC($thirdparty_buyer); |
| 4898 | 4898 | |
| 4899 | - dol_syslog("get_default_tva: seller use vat=" . $seller_use_vat . ", seller country=" . $seller_country_code . ", seller in cee=" . $seller_in_cee . ", buyer vat number=" . $thirdparty_buyer->tva_intra . " buyer country=" . $buyer_country_code . ", buyer in cee=" . $buyer_in_cee . ", idprod=" . $idprod . ", idprodfournprice=" . $idprodfournprice . ", SERVICE_ARE_ECOMMERCE_200238EC=" . (!empty($conf->global->SERVICES_ARE_ECOMMERCE_200238EC) ? $conf->global->SERVICES_ARE_ECOMMERCE_200238EC : ''));
|
|
| 4899 | + dol_syslog("get_default_tva: seller use vat=".$seller_use_vat.", seller country=".$seller_country_code.", seller in cee=".$seller_in_cee.", buyer vat number=".$thirdparty_buyer->tva_intra." buyer country=".$buyer_country_code.", buyer in cee=".$buyer_in_cee.", idprod=".$idprod.", idprodfournprice=".$idprodfournprice.", SERVICE_ARE_ECOMMERCE_200238EC=".(!empty($conf->global->SERVICES_ARE_ECOMMERCE_200238EC) ? $conf->global->SERVICES_ARE_ECOMMERCE_200238EC : ''));
|
|
| 4900 | 4900 | |
| 4901 | 4901 | // If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm) |
| 4902 | 4902 | // we use the buyer VAT. |
@@ -4962,14 +4962,14 @@ discard block |
||
| 4962 | 4962 | |
| 4963 | 4963 | if ($idprodfournprice > 0) {
|
| 4964 | 4964 | if (!class_exists('ProductFournisseur'))
|
| 4965 | - require_once DOL_BASE_PATH . '/fourn/class/fournisseur.product.class.php'; |
|
| 4965 | + require_once DOL_BASE_PATH.'/fourn/class/fournisseur.product.class.php'; |
|
| 4966 | 4966 | $prodprice = new ProductFournisseur($db); |
| 4967 | 4967 | $prodprice->fetch_product_fournisseur_price($idprodfournprice); |
| 4968 | 4968 | return $prodprice->fourn_tva_npr; |
| 4969 | 4969 | } |
| 4970 | 4970 | elseif ($idprod > 0) {
|
| 4971 | 4971 | if (!class_exists('Product'))
|
| 4972 | - require_once DOL_BASE_PATH . 'product/class/product.class.php'; |
|
| 4972 | + require_once DOL_BASE_PATH.'product/class/product.class.php'; |
|
| 4973 | 4973 | $prod = new Product($db); |
| 4974 | 4974 | $prod->fetch($idprod); |
| 4975 | 4975 | return $prod->tva_npr; |
@@ -5048,7 +5048,7 @@ discard block |
||
| 5048 | 5048 | if ($case == 2) |
| 5049 | 5049 | $result = '<input type="checkbox" value="1" checked disabled>'; |
| 5050 | 5050 | if ($case == 3) |
| 5051 | - $result = '<input type="checkbox" value="1" checked disabled> ' . $result; |
|
| 5051 | + $result = '<input type="checkbox" value="1" checked disabled> '.$result; |
|
| 5052 | 5052 | |
| 5053 | 5053 | $classname = 'ok'; |
| 5054 | 5054 | } |
@@ -5059,7 +5059,7 @@ discard block |
||
| 5059 | 5059 | if ($case == 2) |
| 5060 | 5060 | $result = '<input type="checkbox" value="0" disabled>'; |
| 5061 | 5061 | if ($case == 3) |
| 5062 | - $result = '<input type="checkbox" value="0" disabled> ' . $result; |
|
| 5062 | + $result = '<input type="checkbox" value="0" disabled> '.$result; |
|
| 5063 | 5063 | |
| 5064 | 5064 | if ($color == 2) |
| 5065 | 5065 | $classname = 'ok'; |
@@ -5067,7 +5067,7 @@ discard block |
||
| 5067 | 5067 | $classname = 'error'; |
| 5068 | 5068 | } |
| 5069 | 5069 | if ($color) |
| 5070 | - return '<font class="' . $classname . '">' . $result . '</font>'; |
|
| 5070 | + return '<font class="'.$classname.'">'.$result.'</font>'; |
|
| 5071 | 5071 | return $result; |
| 5072 | 5072 | } |
| 5073 | 5073 | |
@@ -5101,13 +5101,13 @@ discard block |
||
| 5101 | 5101 | $num = preg_replace('/([^0-9])/i', '', $num);
|
| 5102 | 5102 | else |
| 5103 | 5103 | $num = preg_replace('/^.*\-/i', '', $num);
|
| 5104 | - $num = substr("000" . $num, -$level);
|
|
| 5104 | + $num = substr("000".$num, -$level);
|
|
| 5105 | 5105 | if ($level == 1) |
| 5106 | 5106 | $path = substr($num, 0, 1); |
| 5107 | 5107 | if ($level == 2) |
| 5108 | - $path = substr($num, 1, 1) . '/' . substr($num, 0, 1); |
|
| 5108 | + $path = substr($num, 1, 1).'/'.substr($num, 0, 1); |
|
| 5109 | 5109 | if ($level == 3) |
| 5110 | - $path = substr($num, 2, 1) . '/' . substr($num, 1, 1) . '/' . substr($num, 0, 1); |
|
| 5110 | + $path = substr($num, 2, 1).'/'.substr($num, 1, 1).'/'.substr($num, 0, 1); |
|
| 5111 | 5111 | } |
| 5112 | 5112 | else {
|
| 5113 | 5113 | // TODO |
@@ -5138,7 +5138,7 @@ discard block |
||
| 5138 | 5138 | {
|
| 5139 | 5139 | global $conf; |
| 5140 | 5140 | |
| 5141 | - dol_syslog("functions.lib::dol_mkdir: dir=" . $dir, LOG_INFO);
|
|
| 5141 | + dol_syslog("functions.lib::dol_mkdir: dir=".$dir, LOG_INFO);
|
|
| 5142 | 5142 | |
| 5143 | 5143 | $dir_osencoded = dol_osencode($dir); |
| 5144 | 5144 | if (@is_dir($dir_osencoded)) |
@@ -5150,15 +5150,15 @@ discard block |
||
| 5150 | 5150 | $ccdir = ''; |
| 5151 | 5151 | if (!empty($dataroot)) {
|
| 5152 | 5152 | // Remove data root from loop |
| 5153 | - $dir = str_replace($dataroot . '/', '', $dir); |
|
| 5154 | - $ccdir = $dataroot . '/'; |
|
| 5153 | + $dir = str_replace($dataroot.'/', '', $dir); |
|
| 5154 | + $ccdir = $dataroot.'/'; |
|
| 5155 | 5155 | } |
| 5156 | 5156 | |
| 5157 | 5157 | $cdir = explode("/", $dir);
|
| 5158 | 5158 | $num = count($cdir); |
| 5159 | 5159 | for ($i = 0; $i < $num; $i++) {
|
| 5160 | 5160 | if ($i > 0) |
| 5161 | - $ccdir .= '/' . $cdir[$i]; |
|
| 5161 | + $ccdir .= '/'.$cdir[$i]; |
|
| 5162 | 5162 | else |
| 5163 | 5163 | $ccdir .= $cdir[$i]; |
| 5164 | 5164 | if (preg_match("/^.:$/", $ccdir, $regs))
|
@@ -5185,20 +5185,20 @@ discard block |
||
| 5185 | 5185 | if ($ccdir) {
|
| 5186 | 5186 | $ccdir_osencoded = dol_osencode($ccdir); |
| 5187 | 5187 | if (!@is_dir($ccdir_osencoded)) {
|
| 5188 | - dol_syslog("functions.lib::dol_mkdir: Directory '" . $ccdir . "' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
|
|
| 5188 | + dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
|
|
| 5189 | 5189 | |
| 5190 | 5190 | umask(0); |
| 5191 | 5191 | $dirmaskdec = octdec($newmask); |
| 5192 | 5192 | if (empty($newmask)) {
|
| 5193 | 5193 | $dirmaskdec = empty($conf->global->MAIN_UMASK) ? octdec('0755') : octdec($conf->global->MAIN_UMASK);
|
| 5194 | 5194 | } |
| 5195 | - $dirmaskdec |= octdec('0111'); // Set x bit required for directories
|
|
| 5195 | + $dirmaskdec |= octdec('0111'); // Set x bit required for directories
|
|
| 5196 | 5196 | if (!@mkdir($ccdir_osencoded, $dirmaskdec)) {
|
| 5197 | 5197 | // Si le is_dir a renvoye une fausse info, alors on passe ici. |
| 5198 | - dol_syslog("functions.lib::dol_mkdir: Fails to create directory '" . $ccdir . "' or directory already exists.", LOG_WARNING);
|
|
| 5198 | + dol_syslog("functions.lib::dol_mkdir: Fails to create directory '".$ccdir."' or directory already exists.", LOG_WARNING);
|
|
| 5199 | 5199 | $nberr++; |
| 5200 | 5200 | } else {
|
| 5201 | - dol_syslog("functions.lib::dol_mkdir: Directory '" . $ccdir . "' created", LOG_DEBUG);
|
|
| 5201 | + dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' created", LOG_DEBUG);
|
|
| 5202 | 5202 | $nberr = 0; // On remet a zero car si on arrive ici, cela veut dire que les echecs precedents peuvent etre ignore |
| 5203 | 5203 | $nbcreated++; |
| 5204 | 5204 | } |
@@ -5246,9 +5246,9 @@ discard block |
||
| 5246 | 5246 | } else {
|
| 5247 | 5247 | $pattern = "/<[^<>]+>/"; |
| 5248 | 5248 | // Exemple of $temp: <a href="/myurl" title="<u>A title</u>">0000-021</a> |
| 5249 | - $temp = preg_replace($pattern, "", $temp); // pass 1 |
|
| 5249 | + $temp = preg_replace($pattern, "", $temp); // pass 1 |
|
| 5250 | 5250 | // $temp after pass 1: <a href="/myurl" title="A title">0000-021 |
| 5251 | - $temp = preg_replace($pattern, "", $temp); // pass 2 |
|
| 5251 | + $temp = preg_replace($pattern, "", $temp); // pass 2 |
|
| 5252 | 5252 | // $temp after pass 2: 0000-021 |
| 5253 | 5253 | } |
| 5254 | 5254 | |
@@ -5304,8 +5304,8 @@ discard block |
||
| 5304 | 5304 | {
|
| 5305 | 5305 | $temp = $stringtoclean; |
| 5306 | 5306 | foreach ($disallowed_tags as $tagtoremove) {
|
| 5307 | - $temp = preg_replace('/<\/?' . $tagtoremove . '>/', '', $temp);
|
|
| 5308 | - $temp = preg_replace('/<\/?' . $tagtoremove . '\s+[^>]*>/', '', $temp);
|
|
| 5307 | + $temp = preg_replace('/<\/?'.$tagtoremove.'>/', '', $temp);
|
|
| 5308 | + $temp = preg_replace('/<\/?'.$tagtoremove.'\s+[^>]*>/', '', $temp);
|
|
| 5309 | 5309 | } |
| 5310 | 5310 | return $temp; |
| 5311 | 5311 | } |
@@ -5322,12 +5322,12 @@ discard block |
||
| 5322 | 5322 | {
|
| 5323 | 5323 | if ($nboflines == 1) {
|
| 5324 | 5324 | if (dol_textishtml($text)) {
|
| 5325 | - $firstline = preg_replace('/<br[^>]*>.*$/s', '', $text); // The s pattern modifier means the . can match newline characters
|
|
| 5325 | + $firstline = preg_replace('/<br[^>]*>.*$/s', '', $text); // The s pattern modifier means the . can match newline characters
|
|
| 5326 | 5326 | $firstline = preg_replace('/<div[^>]*>.*$/s', '', $firstline); // The s pattern modifier means the . can match newline characters
|
| 5327 | 5327 | } else {
|
| 5328 | 5328 | $firstline = preg_replace('/[\n\r].*/', '', $text);
|
| 5329 | 5329 | } |
| 5330 | - return $firstline . ((strlen($firstline) != strlen($text)) ? '...' : ''); |
|
| 5330 | + return $firstline.((strlen($firstline) != strlen($text)) ? '...' : ''); |
|
| 5331 | 5331 | } else {
|
| 5332 | 5332 | $ishtml = 0; |
| 5333 | 5333 | if (dol_textishtml($text)) {
|
@@ -5343,7 +5343,7 @@ discard block |
||
| 5343 | 5343 | $pattern = '/(<br[^>]*>)/Uu'; |
| 5344 | 5344 | } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support |
| 5345 | 5345 | else |
| 5346 | - $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5346 | + $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5347 | 5347 | $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
| 5348 | 5348 | |
| 5349 | 5349 | $firstline = ''; |
@@ -5357,7 +5357,7 @@ discard block |
||
| 5357 | 5357 | $i++; |
| 5358 | 5358 | } |
| 5359 | 5359 | unset($a); |
| 5360 | - return $firstline . (($i < $nba) ? '...' : ''); |
|
| 5360 | + return $firstline.(($i < $nba) ? '...' : ''); |
|
| 5361 | 5361 | } |
| 5362 | 5362 | } |
| 5363 | 5363 | |
@@ -5428,9 +5428,9 @@ discard block |
||
| 5428 | 5428 | function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8') |
| 5429 | 5429 | {
|
| 5430 | 5430 | $ret = dol_html_entity_decode($stringtodecode, ENT_COMPAT, $pagecodeto); |
| 5431 | - $ret = preg_replace('/' . "\r\n" . '<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret);
|
|
| 5432 | - $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>' . "\r\n" . '/i', "\r\n", $ret);
|
|
| 5433 | - $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>' . "\n" . '/i', "\n", $ret);
|
|
| 5431 | + $ret = preg_replace('/'."\r\n".'<br(\s[\sa-zA-Z_="]*)?\/?>/i', "<br>", $ret);
|
|
| 5432 | + $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\r\n".'/i', "\r\n", $ret);
|
|
| 5433 | + $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>'."\n".'/i', "\n", $ret);
|
|
| 5434 | 5434 | $ret = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', "\n", $ret);
|
| 5435 | 5435 | return $ret; |
| 5436 | 5436 | } |
@@ -5443,7 +5443,7 @@ discard block |
||
| 5443 | 5443 | */ |
| 5444 | 5444 | function dol_htmlcleanlastbr($stringtodecode) |
| 5445 | 5445 | {
|
| 5446 | - $ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|' . "\n" . '|' . "\r" . ')+$/i', "", $stringtodecode);
|
|
| 5446 | + $ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|'."\n".'|'."\r".')+$/i', "", $stringtodecode);
|
|
| 5447 | 5447 | return $ret; |
| 5448 | 5448 | } |
| 5449 | 5449 | |
@@ -5540,7 +5540,7 @@ discard block |
||
| 5540 | 5540 | $pattern = '/(<br[^>]*>)/Uu'; |
| 5541 | 5541 | } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support |
| 5542 | 5542 | else |
| 5543 | - $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5543 | + $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. |
|
| 5544 | 5544 | $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
| 5545 | 5545 | |
| 5546 | 5546 | $nblines = (int) floor((count($a) + 1) / 2); |
@@ -5571,7 +5571,7 @@ discard block |
||
| 5571 | 5571 | */ |
| 5572 | 5572 | function dol_microtime_float() |
| 5573 | 5573 | {
|
| 5574 | - dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); |
|
| 5574 | + dol_syslog(__FUNCTION__." is deprecated", LOG_WARNING); |
|
| 5575 | 5575 | |
| 5576 | 5576 | return microtime(true); |
| 5577 | 5577 | } |
@@ -5617,9 +5617,9 @@ discard block |
||
| 5617 | 5617 | elseif (preg_match('/<h[0-9]>/i', $msg))
|
| 5618 | 5618 | return true; |
| 5619 | 5619 | elseif (preg_match('/&[A-Z0-9]{1,6};/i', $msg))
|
| 5620 | - return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5620 | + return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5621 | 5621 | elseif (preg_match('/&#[0-9]{2,3};/i', $msg))
|
| 5622 | - return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5622 | + return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp) |
|
| 5623 | 5623 | |
| 5624 | 5624 | return false; |
| 5625 | 5625 | } |
@@ -5844,7 +5844,7 @@ discard block |
||
| 5844 | 5844 | if ($object->fetch_optionals() > 0) {
|
| 5845 | 5845 | if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) {
|
| 5846 | 5846 | foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) {
|
| 5847 | - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key]; |
|
| 5847 | + $substitutionarray['__EXTRAFIELD_'.strtoupper($key).'__'] = $object->array_options['options_'.$key]; |
|
| 5848 | 5848 | } |
| 5849 | 5849 | } |
| 5850 | 5850 | } |
@@ -5856,7 +5856,7 @@ discard block |
||
| 5856 | 5856 | $paymenturl = ''; |
| 5857 | 5857 | } else {
|
| 5858 | 5858 | // Set the online payment url link into __ONLINE_PAYMENT_URL__ key |
| 5859 | - require_once DOL_BASE_PATH . '/core/lib/payments.lib.php'; |
|
| 5859 | + require_once DOL_BASE_PATH.'/core/lib/payments.lib.php'; |
|
| 5860 | 5860 | $outputlangs->loadLangs(array('paypal', 'other'));
|
| 5861 | 5861 | $typeforonlinepayment = 'free'; |
| 5862 | 5862 | if (is_object($object) && $object->element == 'commande') |
@@ -5917,7 +5917,7 @@ discard block |
||
| 5917 | 5917 | |
| 5918 | 5918 | //var_dump($substitutionarray['__AMOUNT_FORMATED__']); |
| 5919 | 5919 | if (empty($exclude) || !in_array('date', $exclude)) {
|
| 5920 | - include_once DOL_BASE_PATH . '/core/lib/date.lib.php'; |
|
| 5920 | + include_once DOL_BASE_PATH.'/core/lib/date.lib.php'; |
|
| 5921 | 5921 | |
| 5922 | 5922 | $tmp = dol_getdate(dol_now(), true); |
| 5923 | 5923 | $tmp2 = dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); |
@@ -5927,13 +5927,13 @@ discard block |
||
| 5927 | 5927 | |
| 5928 | 5928 | $substitutionarray = array_merge($substitutionarray, array( |
| 5929 | 5929 | '__DAY__' => (string) $tmp['mday'], |
| 5930 | - '__DAY_TEXT__' => $outputlangs->trans('Day' . $tmp['wday']), // Monday
|
|
| 5931 | - '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'] . 'Min'), // Mon |
|
| 5932 | - '__DAY_TEXT_MIN__' => $outputlangs->trans('Short' . $tmp['weekday']), // M
|
|
| 5930 | + '__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), // Monday
|
|
| 5931 | + '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'].'Min'), // Mon |
|
| 5932 | + '__DAY_TEXT_MIN__' => $outputlangs->trans('Short'.$tmp['weekday']), // M
|
|
| 5933 | 5933 | '__MONTH__' => (string) $tmp['mon'], |
| 5934 | - '__MONTH_TEXT__' => $outputlangs->trans('Month' . sprintf("%02d", $tmp['mon'])),
|
|
| 5935 | - '__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort' . sprintf("%02d", $tmp['mon'])),
|
|
| 5936 | - '__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort' . sprintf("%02d", $tmp['mon'])),
|
|
| 5934 | + '__MONTH_TEXT__' => $outputlangs->trans('Month'.sprintf("%02d", $tmp['mon'])),
|
|
| 5935 | + '__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort'.sprintf("%02d", $tmp['mon'])),
|
|
| 5936 | + '__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort'.sprintf("%02d", $tmp['mon'])),
|
|
| 5937 | 5937 | '__YEAR__' => (string) $tmp['year'], |
| 5938 | 5938 | '__PREVIOUS_DAY__' => (string) $tmp2['day'], |
| 5939 | 5939 | '__PREVIOUS_MONTH__' => (string) $tmp3['month'], |
@@ -5992,7 +5992,7 @@ discard block |
||
| 5992 | 5992 | if (!empty($tmp[1])) |
| 5993 | 5993 | $outputlangs->load($tmp[1]); |
| 5994 | 5994 | |
| 5995 | - $text = preg_replace('/__\(' . preg_quote($reg[1], '/') . '\)__/', $msgishtml ? dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])) : $outputlangs->transnoentitiesnoconv($reg[1]), $text);
|
|
| 5995 | + $text = preg_replace('/__\('.preg_quote($reg[1], '/').'\)__/', $msgishtml ? dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])) : $outputlangs->transnoentitiesnoconv($reg[1]), $text);
|
|
| 5996 | 5996 | } |
| 5997 | 5997 | } |
| 5998 | 5998 | |
@@ -6008,13 +6008,13 @@ discard block |
||
| 6008 | 6008 | $newval = '*****forbidden*****'; |
| 6009 | 6009 | else |
| 6010 | 6010 | $newval = empty($conf->global->$keyfound) ? '' : $conf->global->$keyfound; |
| 6011 | - $text = preg_replace('/__\[' . preg_quote($keyfound, '/') . '\]__/', $msgishtml ? dol_htmlentitiesbr($newval) : $newval, $text);
|
|
| 6011 | + $text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml ? dol_htmlentitiesbr($newval) : $newval, $text);
|
|
| 6012 | 6012 | } |
| 6013 | 6013 | |
| 6014 | 6014 | // Make substitition for array $substitutionarray |
| 6015 | 6015 | foreach ($substitutionarray as $key => $value) {
|
| 6016 | 6016 | if ($key == '__SIGNATURE__' && (!empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) |
| 6017 | - $value = ''; // Protection |
|
| 6017 | + $value = ''; // Protection |
|
| 6018 | 6018 | if ($key == '__USER_SIGNATURE__' && (!empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) |
| 6019 | 6019 | $value = ''; // Protection |
| 6020 | 6020 | |
@@ -6040,7 +6040,7 @@ discard block |
||
| 6040 | 6040 | {
|
| 6041 | 6041 | global $conf, $user; |
| 6042 | 6042 | |
| 6043 | - require_once DOL_BASE_PATH . '/core/lib/files.lib.php'; |
|
| 6043 | + require_once DOL_BASE_PATH.'/core/lib/files.lib.php'; |
|
| 6044 | 6044 | |
| 6045 | 6045 | // Add a substitution key for each extrafields, using key __EXTRA_XXX__ |
| 6046 | 6046 | // TODO Remove this. Already available into the getCommonSubstitutionArray used to build the substitution array. |
@@ -6070,11 +6070,11 @@ discard block |
||
| 6070 | 6070 | if (preg_match('/functions_(.*)\.lib\.php/i', $substitfile['name'], $reg)) {
|
| 6071 | 6071 | $module = $reg[1]; |
| 6072 | 6072 | |
| 6073 | - dol_syslog("Library " . $substitfile['name'] . " found into " . $dir);
|
|
| 6073 | + dol_syslog("Library ".$substitfile['name']." found into ".$dir);
|
|
| 6074 | 6074 | // Include the user's functions file |
| 6075 | - require_once $dir . $substitfile['name']; |
|
| 6075 | + require_once $dir.$substitfile['name']; |
|
| 6076 | 6076 | // Call the user's function, and only if it is defined |
| 6077 | - $function_name = $module . "_" . $callfunc; |
|
| 6077 | + $function_name = $module."_".$callfunc; |
|
| 6078 | 6078 | if (function_exists($function_name)) |
| 6079 | 6079 | $function_name($substitutionarray, $outputlangs, $object, $parameters); |
| 6080 | 6080 | } |
@@ -6116,13 +6116,13 @@ discard block |
||
| 6116 | 6116 | $outputlangs = $langs; |
| 6117 | 6117 | |
| 6118 | 6118 | if ($date_start && $date_end) {
|
| 6119 | - $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
|
|
| 6119 | + $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($date_start, $format, false, $outputlangs), dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
|
|
| 6120 | 6120 | } |
| 6121 | 6121 | if ($date_start && !$date_end) {
|
| 6122 | - $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
|
|
| 6122 | + $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($date_start, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
|
|
| 6123 | 6123 | } |
| 6124 | 6124 | if (!$date_start && $date_end) {
|
| 6125 | - $out .= ($withparenthesis ? ' (' : '') . $outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)) . ($withparenthesis ? ')' : '');
|
|
| 6125 | + $out .= ($withparenthesis ? ' (' : '').$outputlangs->transnoentitiesnoconv('DateUntil', dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis ? ')' : '');
|
|
| 6126 | 6126 | } |
| 6127 | 6127 | |
| 6128 | 6128 | return $out; |
@@ -6202,7 +6202,7 @@ discard block |
||
| 6202 | 6202 | dol_syslog("Try to add a message in stack with empty message", LOG_WARNING);
|
| 6203 | 6203 | } else {
|
| 6204 | 6204 | if (!in_array((string) $style, array('mesgs', 'warnings', 'errors')))
|
| 6205 | - dol_print_error('', 'Bad parameter style=' . $style . ' for setEventMessages');
|
|
| 6205 | + dol_print_error('', 'Bad parameter style='.$style.' for setEventMessages');
|
|
| 6206 | 6206 | if (empty($mesgs)) |
| 6207 | 6207 | setEventMessage($mesg, $style); |
| 6208 | 6208 | else {
|
@@ -6271,7 +6271,7 @@ discard block |
||
| 6271 | 6271 | |
| 6272 | 6272 | // If inline message with no format, we add it. |
| 6273 | 6273 | if ((empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) || $keepembedded) && !preg_match('/<div class=".*">/i', $out)) {
|
| 6274 | - $divstart = '<div class="' . $style . ' clearboth">'; |
|
| 6274 | + $divstart = '<div class="'.$style.' clearboth">'; |
|
| 6275 | 6275 | $divend = '</div>'; |
| 6276 | 6276 | } |
| 6277 | 6277 | |
@@ -6298,14 +6298,14 @@ discard block |
||
| 6298 | 6298 | if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && empty($keepembedded)) {
|
| 6299 | 6299 | $return = '<script type="text/javascript"> |
| 6300 | 6300 | $(document).ready(function() {
|
| 6301 | - var block = ' . (!empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) ? "true" : "false") . ' |
|
| 6301 | + var block = ' . (!empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) ? "true" : "false").' |
|
| 6302 | 6302 | if (block) {
|
| 6303 | - $.dolEventValid("","' . dol_escape_js($out) . '");
|
|
| 6303 | + $.dolEventValid("","' . dol_escape_js($out).'");
|
|
| 6304 | 6304 | } else {
|
| 6305 | 6305 | /* jnotify(message, preset of message type, keepmessage) */ |
| 6306 | - $.jnotify("' . dol_escape_js($out) . '",
|
|
| 6307 | - "' . ($style == "ok" ? 3000 : $style) . '", |
|
| 6308 | - ' . ($style == "ok" ? "false" : "true") . ', |
|
| 6306 | + $.jnotify("' . dol_escape_js($out).'",
|
|
| 6307 | + "' . ($style == "ok" ? 3000 : $style).'", |
|
| 6308 | + ' . ($style == "ok" ? "false" : "true").', |
|
| 6309 | 6309 | { remove: function (){} } );
|
| 6310 | 6310 | } |
| 6311 | 6311 | }); |
@@ -6500,11 +6500,11 @@ discard block |
||
| 6500 | 6500 | {
|
| 6501 | 6501 | global $conf; |
| 6502 | 6502 | |
| 6503 | - $tmp = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
|
|
| 6503 | + $tmp = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
|
|
| 6504 | 6504 | if (empty($tmp) && !empty($_SERVER["WINDIR"])) |
| 6505 | 6505 | $tmp = 'iso-8859-1'; // By default for windows |
| 6506 | 6506 | if (empty($tmp)) |
| 6507 | - $tmp = 'utf-8'; // By default for other |
|
| 6507 | + $tmp = 'utf-8'; // By default for other |
|
| 6508 | 6508 | if (!empty($conf->global->MAIN_FILESYSTEM_ENCODING)) |
| 6509 | 6509 | $tmp = $conf->global->MAIN_FILESYSTEM_ENCODING; |
| 6510 | 6510 | |
@@ -6536,16 +6536,16 @@ discard block |
||
| 6536 | 6536 | |
| 6537 | 6537 | // Check in cache |
| 6538 | 6538 | if (isset($cache_codes[$tablename][$key][$fieldid])) { // Can be defined to 0 or ''
|
| 6539 | - return $cache_codes[$tablename][$key][$fieldid]; // Found in cache |
|
| 6539 | + return $cache_codes[$tablename][$key][$fieldid]; // Found in cache |
|
| 6540 | 6540 | } |
| 6541 | 6541 | |
| 6542 | 6542 | dol_syslog('dol_getIdFromCode (value not found into cache)', LOG_DEBUG);
|
| 6543 | 6543 | |
| 6544 | - $sql = "SELECT " . $fieldid . " as valuetoget"; |
|
| 6545 | - $sql .= " FROM " . MAIN_DB_PREFIX . $tablename; |
|
| 6546 | - $sql .= " WHERE " . $fieldkey . " = '" . $db->escape($key) . "'"; |
|
| 6544 | + $sql = "SELECT ".$fieldid." as valuetoget"; |
|
| 6545 | + $sql .= " FROM ".MAIN_DB_PREFIX.$tablename; |
|
| 6546 | + $sql .= " WHERE ".$fieldkey." = '".$db->escape($key)."'"; |
|
| 6547 | 6547 | if (!empty($entityfilter)) |
| 6548 | - $sql .= " AND entity IN (" . getEntity($tablename) . ")";
|
|
| 6548 | + $sql .= " AND entity IN (".getEntity($tablename).")";
|
|
| 6549 | 6549 | |
| 6550 | 6550 | $resql = $db->query($sql); |
| 6551 | 6551 | if ($resql) {
|
@@ -6572,12 +6572,12 @@ discard block |
||
| 6572 | 6572 | {
|
| 6573 | 6573 | global $user, $conf, $langs; |
| 6574 | 6574 | global $leftmenu; |
| 6575 | - global $rights; // To export to dol_eval function |
|
| 6575 | + global $rights; // To export to dol_eval function |
|
| 6576 | 6576 | //print $strRights."<br>\n"; |
| 6577 | 6577 | $rights = true; |
| 6578 | 6578 | if ($strRights != '') {
|
| 6579 | - $str = 'if(!(' . $strRights . ')) { $rights = false; }';
|
|
| 6580 | - dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition |
|
| 6579 | + $str = 'if(!('.$strRights.')) { $rights = false; }';
|
|
| 6580 | + dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition |
|
| 6581 | 6581 | } |
| 6582 | 6582 | return $rights; |
| 6583 | 6583 | } |
@@ -6600,14 +6600,14 @@ discard block |
||
| 6600 | 6600 | global $object; |
| 6601 | 6601 | global $mysoc; |
| 6602 | 6602 | |
| 6603 | - global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object |
|
| 6604 | - global $soc; // For backward compatibility |
|
| 6603 | + global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object |
|
| 6604 | + global $soc; // For backward compatibility |
|
| 6605 | 6605 | //print $s."<br>\n"; |
| 6606 | 6606 | if ($returnvalue) {
|
| 6607 | 6607 | if ($hideerrors) |
| 6608 | - return @eval('return ' . $s . ';');
|
|
| 6608 | + return @eval('return '.$s.';');
|
|
| 6609 | 6609 | else |
| 6610 | - return eval('return ' . $s . ';');
|
|
| 6610 | + return eval('return '.$s.';');
|
|
| 6611 | 6611 | } |
| 6612 | 6612 | else {
|
| 6613 | 6613 | if ($hideerrors) |
@@ -6661,7 +6661,7 @@ discard block |
||
| 6661 | 6661 | $flagImage = empty($tmparray[1]) ? $tmparray[0] : $tmparray[1]; |
| 6662 | 6662 | } |
| 6663 | 6663 | |
| 6664 | - return img_picto_common($codelang, 'flags/' . strtolower($flagImage) . '.png', $moreatt); |
|
| 6664 | + return img_picto_common($codelang, 'flags/'.strtolower($flagImage).'.png', $moreatt); |
|
| 6665 | 6665 | } |
| 6666 | 6666 | |
| 6667 | 6667 | /** |
@@ -6859,16 +6859,16 @@ discard block |
||
| 6859 | 6859 | 'zu-ZA', |
| 6860 | 6860 | ); |
| 6861 | 6861 | |
| 6862 | - $buildprimarykeytotest = strtolower($countrycode) . '-' . strtoupper($countrycode); |
|
| 6862 | + $buildprimarykeytotest = strtolower($countrycode).'-'.strtoupper($countrycode); |
|
| 6863 | 6863 | if (in_array($buildprimarykeytotest, $locales)) |
| 6864 | - return strtolower($countrycode) . '_' . strtoupper($countrycode); |
|
| 6864 | + return strtolower($countrycode).'_'.strtoupper($countrycode); |
|
| 6865 | 6865 | |
| 6866 | 6866 | foreach ($locales as $locale) {
|
| 6867 | 6867 | $locale_language = locale_get_primary_language($locale); |
| 6868 | 6868 | $locale_region = locale_get_region($locale); |
| 6869 | 6869 | if (strtoupper($countrycode) == $locale_region) {
|
| 6870 | 6870 | //var_dump($locale.'-'.$locale_language.'-'.$locale_region); |
| 6871 | - return strtolower($locale_language) . '_' . strtoupper($locale_region); |
|
| 6871 | + return strtolower($locale_language).'_'.strtoupper($locale_region); |
|
| 6872 | 6872 | } |
| 6873 | 6873 | } |
| 6874 | 6874 | |
@@ -6929,7 +6929,7 @@ discard block |
||
| 6929 | 6929 | $label = $langs->trans($values[2]); |
| 6930 | 6930 | |
| 6931 | 6931 | //$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]), 1);
|
| 6932 | - $head[$h][0] = BASE_URI . preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]);
|
|
| 6932 | + $head[$h][0] = BASE_URI.preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]);
|
|
| 6933 | 6933 | $head[$h][1] = $label; |
| 6934 | 6934 | $head[$h][2] = str_replace('+', '', $values[1]);
|
| 6935 | 6935 | $h++; |
@@ -7000,43 +7000,43 @@ discard block |
||
| 7000 | 7000 | global $micro_start_time; |
| 7001 | 7001 | |
| 7002 | 7002 | if ($zone == 'private') |
| 7003 | - print "\n" . '<!-- Common footer for private page -->' . "\n"; |
|
| 7003 | + print "\n".'<!-- Common footer for private page -->'."\n"; |
|
| 7004 | 7004 | else |
| 7005 | - print "\n" . '<!-- Common footer for public page -->' . "\n"; |
|
| 7005 | + print "\n".'<!-- Common footer for public page -->'."\n"; |
|
| 7006 | 7006 | |
| 7007 | 7007 | // A div to store page_y POST parameter so we can read it using javascript |
| 7008 | 7008 | print "\n<!-- A div to store page_y POST paramater -->\n"; |
| 7009 | - print '<div id="page_y" style="display: none;">' . $_POST['page_y'] . '</div>' . "\n"; |
|
| 7009 | + print '<div id="page_y" style="display: none;">'.$_POST['page_y'].'</div>'."\n"; |
|
| 7010 | 7010 | |
| 7011 | 7011 | $parameters = array(); |
| 7012 | - $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
|
|
| 7012 | + $reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
|
|
| 7013 | 7013 | if (empty($reshook)) {
|
| 7014 | 7014 | if (!empty($conf->global->MAIN_HTML_FOOTER)) |
| 7015 | - print $conf->global->MAIN_HTML_FOOTER . "\n"; |
|
| 7015 | + print $conf->global->MAIN_HTML_FOOTER."\n"; |
|
| 7016 | 7016 | |
| 7017 | 7017 | print "\n"; |
| 7018 | 7018 | if (!empty($conf->use_javascript_ajax)) {
|
| 7019 | - print '<script type="text/javascript" language="javascript">' . "\n"; |
|
| 7020 | - print 'jQuery(document).ready(function() {' . "\n";
|
|
| 7019 | + print '<script type="text/javascript" language="javascript">'."\n"; |
|
| 7020 | + print 'jQuery(document).ready(function() {'."\n";
|
|
| 7021 | 7021 | |
| 7022 | 7022 | if ($zone == 'private' && empty($conf->dol_use_jmobile)) {
|
| 7023 | 7023 | print "\n"; |
| 7024 | - print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */' . "\n"; |
|
| 7024 | + print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n"; |
|
| 7025 | 7025 | print 'jQuery(".menuhider").click(function() {';
|
| 7026 | - print ' console.log("We click on .menuhider");' . "\n";
|
|
| 7026 | + print ' console.log("We click on .menuhider");'."\n";
|
|
| 7027 | 7027 | //print " $('.side-nav').animate({width:'toggle'},200);\n"; // OK with eldy theme but not with md
|
| 7028 | 7028 | print " $('.side-nav').toggle()\n";
|
| 7029 | 7029 | print " $('.login_block').toggle()\n";
|
| 7030 | - print '});' . "\n"; |
|
| 7030 | + print '});'."\n"; |
|
| 7031 | 7031 | } |
| 7032 | 7032 | |
| 7033 | 7033 | // Management of focus and mandatory for fields |
| 7034 | 7034 | if ($action == 'create' || $action == 'edit' || (empty($action) && (preg_match('/new\.php/', $_SERVER["PHP_SELF"])))) {
|
| 7035 | - print '/* JS CODE TO ENABLE to manage focus and mandatory form fields */' . "\n"; |
|
| 7035 | + print '/* JS CODE TO ENABLE to manage focus and mandatory form fields */'."\n"; |
|
| 7036 | 7036 | $relativepathstring = $_SERVER["PHP_SELF"]; |
| 7037 | 7037 | // Clean $relativepathstring |
| 7038 | 7038 | if (constant('DOL_URL_ROOT'))
|
| 7039 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_URL_ROOT'), '/') . '/', '', $relativepathstring);
|
|
| 7039 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'), '/').'/', '', $relativepathstring);
|
|
| 7040 | 7040 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
|
| 7041 | 7041 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
|
| 7042 | 7042 | $tmpqueryarraywehave = explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
@@ -7059,9 +7059,9 @@ discard block |
||
| 7059 | 7059 | if ($qualified) {
|
| 7060 | 7060 | foreach ($defval as $paramkey => $paramval) {
|
| 7061 | 7061 | // Set focus on field |
| 7062 | - print 'jQuery("input[name=\'' . $paramkey . '\']").focus();' . "\n";
|
|
| 7063 | - print 'jQuery("textarea[name=\'' . $paramkey . '\']").focus();' . "\n";
|
|
| 7064 | - print 'jQuery("select[name=\'' . $paramkey . '\']").focus();' . "\n"; // Not really usefull, but we keep it in case of.
|
|
| 7062 | + print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
|
|
| 7063 | + print 'jQuery("textarea[name=\''.$paramkey.'\']").focus();'."\n";
|
|
| 7064 | + print 'jQuery("select[name=\''.$paramkey.'\']").focus();'."\n"; // Not really usefull, but we keep it in case of.
|
|
| 7065 | 7065 | } |
| 7066 | 7066 | } |
| 7067 | 7067 | } |
@@ -7085,16 +7085,16 @@ discard block |
||
| 7085 | 7085 | if ($qualified) {
|
| 7086 | 7086 | foreach ($defval as $paramkey => $paramval) {
|
| 7087 | 7087 | // Add property 'required' on input |
| 7088 | - print 'jQuery("input[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n";
|
|
| 7089 | - print 'jQuery("textarea[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n";
|
|
| 7090 | - print 'jQuery("select[name=\'' . $paramkey . '\']").prop(\'required\',true);' . "\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
|
| 7088 | + print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
|
| 7089 | + print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
|
| 7090 | + print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
|
| 7091 | 7091 | } |
| 7092 | 7092 | } |
| 7093 | 7093 | } |
| 7094 | 7094 | } |
| 7095 | 7095 | } |
| 7096 | 7096 | |
| 7097 | - print '});' . "\n"; |
|
| 7097 | + print '});'."\n"; |
|
| 7098 | 7098 | |
| 7099 | 7099 | // Google Analytics |
| 7100 | 7100 | // TODO Add a hook here |
@@ -7102,15 +7102,15 @@ discard block |
||
| 7102 | 7102 | if (($conf->dol_use_jmobile != 4)) {
|
| 7103 | 7103 | print "\n"; |
| 7104 | 7104 | print "/* JS CODE TO ENABLE for google analtics tag */\n"; |
| 7105 | - print ' var _gaq = _gaq || [];' . "\n"; |
|
| 7106 | - print ' _gaq.push([\'_setAccount\', \'' . $conf->global->MAIN_GOOGLE_AN_ID . '\']);' . "\n"; |
|
| 7107 | - print ' _gaq.push([\'_trackPageview\']);' . "\n"; |
|
| 7108 | - print '' . "\n"; |
|
| 7109 | - print ' (function() {' . "\n";
|
|
| 7110 | - print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;' . "\n"; |
|
| 7111 | - print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';' . "\n"; |
|
| 7112 | - print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);' . "\n"; |
|
| 7113 | - print ' })();' . "\n"; |
|
| 7105 | + print ' var _gaq = _gaq || [];'."\n"; |
|
| 7106 | + print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n"; |
|
| 7107 | + print ' _gaq.push([\'_trackPageview\']);'."\n"; |
|
| 7108 | + print ''."\n"; |
|
| 7109 | + print ' (function() {'."\n";
|
|
| 7110 | + print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n"; |
|
| 7111 | + print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n"; |
|
| 7112 | + print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n"; |
|
| 7113 | + print ' })();'."\n"; |
|
| 7114 | 7114 | } |
| 7115 | 7115 | } |
| 7116 | 7116 | |
@@ -7120,27 +7120,27 @@ discard block |
||
| 7120 | 7120 | print "/* JS CODE TO ENABLE to add memory info */\n"; |
| 7121 | 7121 | print 'window.console && console.log("';
|
| 7122 | 7122 | if (!empty($conf->global->MEMCACHED_SERVER)) |
| 7123 | - print 'MEMCACHED_SERVER=' . $conf->global->MEMCACHED_SERVER . ' - '; |
|
| 7124 | - print 'MAIN_OPTIMIZE_SPEED=' . (isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off'); |
|
| 7123 | + print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - '; |
|
| 7124 | + print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off'); |
|
| 7125 | 7125 | if (!empty($micro_start_time)) { // Works only if MAIN_SHOW_TUNING_INFO is defined at $_SERVER level. Not in global variable.
|
| 7126 | 7126 | $micro_end_time = microtime(true); |
| 7127 | - print ' - Build time: ' . ceil(1000 * ($micro_end_time - $micro_start_time)) . ' ms'; |
|
| 7127 | + print ' - Build time: '.ceil(1000 * ($micro_end_time - $micro_start_time)).' ms'; |
|
| 7128 | 7128 | } |
| 7129 | 7129 | if (function_exists("memory_get_usage")) {
|
| 7130 | - print ' - Mem: ' . memory_get_usage(); |
|
| 7130 | + print ' - Mem: '.memory_get_usage(); |
|
| 7131 | 7131 | } |
| 7132 | 7132 | if (function_exists("xdebug_memory_usage")) {
|
| 7133 | - print ' - XDebug time: ' . ceil(1000 * xdebug_time_index()) . ' ms'; |
|
| 7134 | - print ' - XDebug mem: ' . xdebug_memory_usage(); |
|
| 7135 | - print ' - XDebug mem peak: ' . xdebug_peak_memory_usage(); |
|
| 7133 | + print ' - XDebug time: '.ceil(1000 * xdebug_time_index()).' ms'; |
|
| 7134 | + print ' - XDebug mem: '.xdebug_memory_usage(); |
|
| 7135 | + print ' - XDebug mem peak: '.xdebug_peak_memory_usage(); |
|
| 7136 | 7136 | } |
| 7137 | 7137 | if (function_exists("zend_loader_file_encoded")) {
|
| 7138 | - print ' - Zend encoded file: ' . (zend_loader_file_encoded() ? 'yes' : 'no'); |
|
| 7138 | + print ' - Zend encoded file: '.(zend_loader_file_encoded() ? 'yes' : 'no'); |
|
| 7139 | 7139 | } |
| 7140 | - print '");' . "\n"; |
|
| 7140 | + print '");'."\n"; |
|
| 7141 | 7141 | } |
| 7142 | 7142 | |
| 7143 | - print "\n" . '</script>' . "\n"; |
|
| 7143 | + print "\n".'</script>'."\n"; |
|
| 7144 | 7144 | } |
| 7145 | 7145 | |
| 7146 | 7146 | // Add Xdebug coverage of code |
@@ -7154,7 +7154,7 @@ discard block |
||
| 7154 | 7154 | print "<!-- Start of log output\n"; |
| 7155 | 7155 | //print '<div class="hidden">'."\n"; |
| 7156 | 7156 | foreach ($conf->logbuffer as $logline) {
|
| 7157 | - print $logline . "<br>\n"; |
|
| 7157 | + print $logline."<br>\n"; |
|
| 7158 | 7158 | } |
| 7159 | 7159 | //print '</div>'."\n"; |
| 7160 | 7160 | print "End of log output -->\n"; |
@@ -7197,8 +7197,8 @@ discard block |
||
| 7197 | 7197 | */ |
| 7198 | 7198 | function dol_set_focus($selector) |
| 7199 | 7199 | {
|
| 7200 | - print "\n" . '<!-- Set focus onto a specific field -->' . "\n"; |
|
| 7201 | - print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() { jQuery("' . dol_escape_js($selector) . '").focus(); });</script>' . "\n";
|
|
| 7200 | + print "\n".'<!-- Set focus onto a specific field -->'."\n"; |
|
| 7201 | + print '<script type="text/javascript" language="javascript">jQuery(document).ready(function() { jQuery("'.dol_escape_js($selector).'").focus(); });</script>'."\n";
|
|
| 7202 | 7202 | } |
| 7203 | 7203 | |
| 7204 | 7204 | /** |
@@ -7243,7 +7243,7 @@ discard block |
||
| 7243 | 7243 | $value = preg_replace('/\*/', '%', $value); // Replace * with %
|
| 7244 | 7244 | } |
| 7245 | 7245 | if ($mode == 1) {
|
| 7246 | - $value = preg_replace('/([<>=]+)\s+([0-9' . preg_quote($langs->trans("DecimalSeparator"), '/') . '\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
|
| 7246 | + $value = preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
|
|
| 7247 | 7247 | } |
| 7248 | 7248 | |
| 7249 | 7249 | $value = preg_replace('/\s*\|\s*/', '|', $value);
|
@@ -7272,14 +7272,14 @@ discard block |
||
| 7272 | 7272 | if ($newcrit != '') {
|
| 7273 | 7273 | $numnewcrit = price2num($newcrit); |
| 7274 | 7274 | if (is_numeric($numnewcrit)) {
|
| 7275 | - $newres .= ($i2 > 0 ? ' OR ' : '') . $field . ' ' . $operator . ' ' . $numnewcrit; |
|
| 7275 | + $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.$numnewcrit; |
|
| 7276 | 7276 | } else {
|
| 7277 | - $newres .= ($i2 > 0 ? ' OR ' : '') . '1 = 2'; // force false |
|
| 7277 | + $newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false |
|
| 7278 | 7278 | } |
| 7279 | 7279 | $i2++; // a criteria was added to string |
| 7280 | 7280 | } |
| 7281 | 7281 | } else if ($mode == 2) {
|
| 7282 | - $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
|
|
| 7282 | + $newres .= ($i2 > 0 ? ' OR ' : '').$field." IN (".$db->escape(trim($crit)).")";
|
|
| 7283 | 7283 | $i2++; // a criteria was added to string |
| 7284 | 7284 | } else if ($mode == 3) {
|
| 7285 | 7285 | $tmparray = explode(',', trim($crit));
|
@@ -7288,10 +7288,10 @@ discard block |
||
| 7288 | 7288 | foreach ($tmparray as $val) {
|
| 7289 | 7289 | if ($val) {
|
| 7290 | 7290 | $listofcodes .= ($listofcodes ? ',' : ''); |
| 7291 | - $listofcodes .= "'" . $db->escape(trim($val)) . "'"; |
|
| 7291 | + $listofcodes .= "'".$db->escape(trim($val))."'"; |
|
| 7292 | 7292 | } |
| 7293 | 7293 | } |
| 7294 | - $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $listofcodes . ")";
|
|
| 7294 | + $newres .= ($i2 > 0 ? ' OR ' : '').$field." IN (".$listofcodes.")";
|
|
| 7295 | 7295 | $i2++; // a criteria was added to string |
| 7296 | 7296 | } |
| 7297 | 7297 | } else if ($mode == 4) {
|
@@ -7300,10 +7300,10 @@ discard block |
||
| 7300 | 7300 | $listofcodes = ''; |
| 7301 | 7301 | foreach ($tmparray as $val) {
|
| 7302 | 7302 | if ($val) {
|
| 7303 | - $newres .= ($i2 > 0 ? ' OR (' : '(') . $field . ' LIKE \'' . $db->escape(trim($val)) . ',%\'';
|
|
| 7304 | - $newres .= ' OR ' . $field . ' = \'' . $db->escape(trim($val)) . '\''; |
|
| 7305 | - $newres .= ' OR ' . $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\''; |
|
| 7306 | - $newres .= ' OR ' . $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\''; |
|
| 7303 | + $newres .= ($i2 > 0 ? ' OR (' : '(').$field.' LIKE \''.$db->escape(trim($val)).',%\'';
|
|
| 7304 | + $newres .= ' OR '.$field.' = \''.$db->escape(trim($val)).'\''; |
|
| 7305 | + $newres .= ' OR '.$field.' LIKE \'%,'.$db->escape(trim($val)).'\''; |
|
| 7306 | + $newres .= ' OR '.$field.' LIKE \'%,'.$db->escape(trim($val)).',%\''; |
|
| 7307 | 7307 | $newres .= ')'; |
| 7308 | 7308 | $i2++; |
| 7309 | 7309 | } |
@@ -7320,9 +7320,9 @@ discard block |
||
| 7320 | 7320 | $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); |
| 7321 | 7321 | |
| 7322 | 7322 | if (preg_match('/\.(id|rowid)$/', $field)) { // Special case for rowid that is sometimes a ref so used as a search field
|
| 7323 | - $newres .= $field . " = " . (is_numeric(trim($tmpcrit)) ? trim($tmpcrit) : '0'); |
|
| 7323 | + $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ? trim($tmpcrit) : '0'); |
|
| 7324 | 7324 | } else {
|
| 7325 | - $newres .= $field . " LIKE '"; |
|
| 7325 | + $newres .= $field." LIKE '"; |
|
| 7326 | 7326 | |
| 7327 | 7327 | $tmpcrit = trim($tmpcrit); |
| 7328 | 7328 | $tmpcrit2 = $tmpcrit; |
@@ -7341,7 +7341,7 @@ discard block |
||
| 7341 | 7341 | $newres .= $tmpafter; |
| 7342 | 7342 | $newres .= "'"; |
| 7343 | 7343 | if ($tmpcrit2 == '') {
|
| 7344 | - $newres .= ' OR ' . $field . " IS NULL"; |
|
| 7344 | + $newres .= ' OR '.$field." IS NULL"; |
|
| 7345 | 7345 | } |
| 7346 | 7346 | } |
| 7347 | 7347 | |
@@ -7352,10 +7352,10 @@ discard block |
||
| 7352 | 7352 | $i++; |
| 7353 | 7353 | } |
| 7354 | 7354 | if ($newres) |
| 7355 | - $res = $res . ($res ? ' AND ' : '') . ($i2 > 1 ? '(' : '') . $newres . ($i2 > 1 ? ')' : '');
|
|
| 7355 | + $res = $res.($res ? ' AND ' : '').($i2 > 1 ? '(' : '').$newres.($i2 > 1 ? ')' : '');
|
|
| 7356 | 7356 | $j++; |
| 7357 | 7357 | } |
| 7358 | - $res = ($nofirstand ? "" : " AND ") . "(" . $res . ")";
|
|
| 7358 | + $res = ($nofirstand ? "" : " AND ")."(".$res.")";
|
|
| 7359 | 7359 | //print 'xx'.$res.'yy'; |
| 7360 | 7360 | return $res; |
| 7361 | 7361 | } |
@@ -7374,8 +7374,8 @@ discard block |
||
| 7374 | 7374 | $url = $object->getLastMainDocLink($object->element); |
| 7375 | 7375 | |
| 7376 | 7376 | if ($url) {
|
| 7377 | - $out .= img_picto('', 'object_globe.png') . ' ' . $langs->trans("DirectDownloadLink") . '<br>';
|
|
| 7378 | - $out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="' . $url . '">'; |
|
| 7377 | + $out .= img_picto('', 'object_globe.png').' '.$langs->trans("DirectDownloadLink").'<br>';
|
|
| 7378 | + $out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'">'; |
|
| 7379 | 7379 | $out .= ajax_autoselect("directdownloadlink", 0);
|
| 7380 | 7380 | } |
| 7381 | 7381 | return $out; |
@@ -7416,7 +7416,7 @@ discard block |
||
| 7416 | 7416 | if ($extName) |
| 7417 | 7417 | $subdir = 'thumbs/'; |
| 7418 | 7418 | |
| 7419 | - return ($dirName ? $dirName . '/' : '') . $subdir . $fileName . $extName . $extImgTarget; // New filename for thumb |
|
| 7419 | + return ($dirName ? $dirName.'/' : '').$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb |
|
| 7420 | 7420 | } |
| 7421 | 7421 | |
| 7422 | 7422 | /** |
@@ -7442,14 +7442,14 @@ discard block |
||
| 7442 | 7442 | |
| 7443 | 7443 | if ($alldata == 1) {
|
| 7444 | 7444 | if ($num_mime !== false) |
| 7445 | - return array('target' => '_blank', 'css' => 'documentpreview', 'url' => DOL_URL_ROOT . '/document.php?modulepart=' . $modulepart . '&attachment=0&file=' . urlencode($relativepath) . ($param ? '&' . $param : ''), 'mime' => dol_mimetype($relativepath),);
|
|
| 7445 | + return array('target' => '_blank', 'css' => 'documentpreview', 'url' => DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''), 'mime' => dol_mimetype($relativepath),);
|
|
| 7446 | 7446 | else |
| 7447 | 7447 | return array(); |
| 7448 | 7448 | } |
| 7449 | 7449 | |
| 7450 | 7450 | // old behavior |
| 7451 | 7451 | if ($num_mime !== false) |
| 7452 | - return 'javascript:document_preview(\'' . dol_escape_js(DOL_URL_ROOT . '/document.php?modulepart=' . $modulepart . '&attachment=0&file=' . urlencode($relativepath) . ($param ? '&' . $param : '')) . '\', \'' . dol_mimetype($relativepath) . '\', \'' . dol_escape_js($langs->trans('Preview')) . '\')';
|
|
| 7452 | + return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : '')).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')';
|
|
| 7453 | 7453 | else |
| 7454 | 7454 | return ''; |
| 7455 | 7455 | } |
@@ -7466,11 +7466,11 @@ discard block |
||
| 7466 | 7466 | global $langs; |
| 7467 | 7467 | $out = '<script type="text/javascript"> |
| 7468 | 7468 | jQuery(document).ready(function () {
|
| 7469 | - jQuery("#' . $htmlname . '").click(function() { jQuery(this).select(); } );
|
|
| 7469 | + jQuery("#' . $htmlname.'").click(function() { jQuery(this).select(); } );
|
|
| 7470 | 7470 | }); |
| 7471 | 7471 | </script>'; |
| 7472 | 7472 | if ($addlink) |
| 7473 | - $out .= ' <a href="' . $addlink . '" target="_blank">' . $langs->trans("Link") . '</a>';
|
|
| 7473 | + $out .= ' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
|
|
| 7474 | 7474 | return $out; |
| 7475 | 7475 | } |
| 7476 | 7476 | |
@@ -7851,9 +7851,9 @@ discard block |
||
| 7851 | 7851 | |
| 7852 | 7852 | if (!isset($dictvalues[$tablename])) {
|
| 7853 | 7853 | $dictvalues[$tablename] = array(); |
| 7854 | - $sql = 'SELECT * FROM ' . $tablename . ' WHERE 1'; |
|
| 7854 | + $sql = 'SELECT * FROM '.$tablename.' WHERE 1'; |
|
| 7855 | 7855 | if ($checkentity) |
| 7856 | - $sql .= ' AND entity IN (0,' . getEntity($tablename) . ')'; |
|
| 7856 | + $sql .= ' AND entity IN (0,'.getEntity($tablename).')'; |
|
| 7857 | 7857 | |
| 7858 | 7858 | $resql = $db->query($sql); |
| 7859 | 7859 | if ($resql) {
|
@@ -7891,14 +7891,14 @@ discard block |
||
| 7891 | 7891 | $g = $tmp[1]; |
| 7892 | 7892 | $b = $tmp[2]; |
| 7893 | 7893 | } else {
|
| 7894 | - $hexr = $stringcolor[0] . $stringcolor[1]; |
|
| 7895 | - $hexg = $stringcolor[2] . $stringcolor[3]; |
|
| 7896 | - $hexb = $stringcolor[4] . $stringcolor[5]; |
|
| 7894 | + $hexr = $stringcolor[0].$stringcolor[1]; |
|
| 7895 | + $hexg = $stringcolor[2].$stringcolor[3]; |
|
| 7896 | + $hexb = $stringcolor[4].$stringcolor[5]; |
|
| 7897 | 7897 | $r = hexdec($hexr); |
| 7898 | 7898 | $g = hexdec($hexg); |
| 7899 | 7899 | $b = hexdec($hexb); |
| 7900 | 7900 | } |
| 7901 | - $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm |
|
| 7901 | + $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm |
|
| 7902 | 7902 | if ($bright > 0.6) |
| 7903 | 7903 | $res = 1; |
| 7904 | 7904 | } |
@@ -7934,11 +7934,11 @@ discard block |
||
| 7934 | 7934 | return 0; // Entry is for menus all excluded to external users |
| 7935 | 7935 | } |
| 7936 | 7936 | if (!$menuentry['perms'] && $type_user) |
| 7937 | - return 0; // No permissions and user is external |
|
| 7937 | + return 0; // No permissions and user is external |
|
| 7938 | 7938 | if (!$menuentry['perms'] && !empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) |
| 7939 | 7939 | return 0; // No permissions and option to hide when not allowed, even for internal user, is on |
| 7940 | 7940 | if (!$menuentry['perms']) |
| 7941 | - return 2; // No permissions and user is external |
|
| 7941 | + return 2; // No permissions and user is external |
|
| 7942 | 7942 | return 1; |
| 7943 | 7943 | } |
| 7944 | 7944 | |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function dol_getwebuser($mode) |
| 36 | 36 | { |
| 37 | - $t='?'; |
|
| 38 | - if ($mode=='user') $t=getenv('APACHE_RUN_USER'); // $_ENV['APACHE_RUN_USER'] is empty |
|
| 39 | - if ($mode=='group') $t=getenv('APACHE_RUN_GROUP'); |
|
| 37 | + $t = '?'; |
|
| 38 | + if ($mode == 'user') $t = getenv('APACHE_RUN_USER'); // $_ENV['APACHE_RUN_USER'] is empty |
|
| 39 | + if ($mode == 'group') $t = getenv('APACHE_RUN_GROUP'); |
|
| 40 | 40 | return $t; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -49,56 +49,56 @@ discard block |
||
| 49 | 49 | * @param array $authmode Array list of selected authentication mode array('http', 'dolibarr', 'xxx'...) |
| 50 | 50 | * @return string Login or '' |
| 51 | 51 | */ |
| 52 | -function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmode) |
|
| 52 | +function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode) |
|
| 53 | 53 | { |
| 54 | - global $conf,$langs; |
|
| 54 | + global $conf, $langs; |
|
| 55 | 55 | //global $dolauthmode; // To return authentication finally used |
| 56 | 56 | |
| 57 | 57 | // Check parameters |
| 58 | - if ($entitytotest == '') $entitytotest=1; |
|
| 58 | + if ($entitytotest == '') $entitytotest = 1; |
|
| 59 | 59 | |
| 60 | - dol_syslog("checkLoginPassEntity usertotest=".$usertotest." entitytotest=".$entitytotest." authmode=".join(',',$authmode)); |
|
| 60 | + dol_syslog("checkLoginPassEntity usertotest=".$usertotest." entitytotest=".$entitytotest." authmode=".join(',', $authmode)); |
|
| 61 | 61 | $login = ''; |
| 62 | 62 | |
| 63 | 63 | // Validation of login/pass/entity with standard modules |
| 64 | 64 | if (empty($login)) |
| 65 | 65 | { |
| 66 | - $test=true; |
|
| 67 | - foreach($authmode as $mode) |
|
| 66 | + $test = true; |
|
| 67 | + foreach ($authmode as $mode) |
|
| 68 | 68 | { |
| 69 | - if ($test && $mode && ! $login) |
|
| 69 | + if ($test && $mode && !$login) |
|
| 70 | 70 | { |
| 71 | 71 | // Validation of login/pass/entity for mode $mode |
| 72 | - $mode=trim($mode); |
|
| 73 | - $authfile='functions_'.$mode.'.php'; |
|
| 74 | - $fullauthfile=''; |
|
| 72 | + $mode = trim($mode); |
|
| 73 | + $authfile = 'functions_'.$mode.'.php'; |
|
| 74 | + $fullauthfile = ''; |
|
| 75 | 75 | |
| 76 | - $dirlogin=array_merge(array("/core/login"),(array) $conf->modules_parts['login']); |
|
| 77 | - foreach($dirlogin as $reldir) |
|
| 76 | + $dirlogin = array_merge(array("/core/login"), (array) $conf->modules_parts['login']); |
|
| 77 | + foreach ($dirlogin as $reldir) |
|
| 78 | 78 | { |
| 79 | - $dir=dol_buildpath($reldir,0); |
|
| 80 | - $newdir=dol_osencode($dir); |
|
| 79 | + $dir = dol_buildpath($reldir, 0); |
|
| 80 | + $newdir = dol_osencode($dir); |
|
| 81 | 81 | |
| 82 | 82 | // Check if file found (do not use dol_is_file to avoid loading files.lib.php) |
| 83 | - $tmpnewauthfile = $newdir.(preg_match('/\/$/',$newdir)?'':'/').$authfile; |
|
| 84 | - if (is_file($tmpnewauthfile)) $fullauthfile=$tmpnewauthfile; |
|
| 83 | + $tmpnewauthfile = $newdir.(preg_match('/\/$/', $newdir) ? '' : '/').$authfile; |
|
| 84 | + if (is_file($tmpnewauthfile)) $fullauthfile = $tmpnewauthfile; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $result=false; |
|
| 88 | - if ($fullauthfile) $result=include_once $fullauthfile; |
|
| 87 | + $result = false; |
|
| 88 | + if ($fullauthfile) $result = include_once $fullauthfile; |
|
| 89 | 89 | if ($fullauthfile && $result) |
| 90 | 90 | { |
| 91 | 91 | // Call function to check user/password |
| 92 | - $function='check_user_password_'.$mode; |
|
| 93 | - $login=call_user_func($function, $usertotest, $passwordtotest, $entitytotest); |
|
| 92 | + $function = 'check_user_password_'.$mode; |
|
| 93 | + $login = call_user_func($function, $usertotest, $passwordtotest, $entitytotest); |
|
| 94 | 94 | if ($login) // Login is successfull |
| 95 | 95 | { |
| 96 | - $test=false; // To stop once at first login success |
|
| 97 | - $conf->authmode=$mode; // This properties is defined only when logged to say what mode was successfully used |
|
| 98 | - $dol_tz=GETPOST('tz'); |
|
| 99 | - $dol_dst=GETPOST('dst'); |
|
| 100 | - $dol_screenwidth=GETPOST('screenwidth'); |
|
| 101 | - $dol_screenheight=GETPOST('screenheight'); |
|
| 96 | + $test = false; // To stop once at first login success |
|
| 97 | + $conf->authmode = $mode; // This properties is defined only when logged to say what mode was successfully used |
|
| 98 | + $dol_tz = GETPOST('tz'); |
|
| 99 | + $dol_dst = GETPOST('dst'); |
|
| 100 | + $dol_screenwidth = GETPOST('screenwidth'); |
|
| 101 | + $dol_screenheight = GETPOST('screenheight'); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | else |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // Load translation files required by the page |
| 109 | 109 | $langs->loadLangs(array('other', 'main', 'errors')); |
| 110 | 110 | |
| 111 | - $_SESSION["dol_loginmesg"]=$langs->trans("ErrorFailedToLoadLoginFileForMode", $mode); |
|
| 111 | + $_SESSION["dol_loginmesg"] = $langs->trans("ErrorFailedToLoadLoginFileForMode", $mode); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| 121 | -if (! function_exists('dol_loginfunction')) |
|
| 121 | +if (!function_exists('dol_loginfunction')) |
|
| 122 | 122 | { |
| 123 | 123 | /** |
| 124 | 124 | * Show Dolibarr default login page. |
@@ -129,27 +129,27 @@ discard block |
||
| 129 | 129 | * @param Societe $mysoc Company object |
| 130 | 130 | * @return void |
| 131 | 131 | */ |
| 132 | - function dol_loginfunction($langs,$conf,$mysoc) |
|
| 132 | + function dol_loginfunction($langs, $conf, $mysoc) |
|
| 133 | 133 | { |
| 134 | - global $dolibarr_main_demo,$db; |
|
| 135 | - global $smartphone,$hookmanager; |
|
| 134 | + global $dolibarr_main_demo, $db; |
|
| 135 | + global $smartphone, $hookmanager; |
|
| 136 | 136 | |
| 137 | - $langs->loadLangs(array("main","other","help","admin")); |
|
| 137 | + $langs->loadLangs(array("main", "other", "help", "admin")); |
|
| 138 | 138 | |
| 139 | 139 | // Instantiate hooks of thirdparty module only if not already define |
| 140 | 140 | $hookmanager->initHooks(array('mainloginpage')); |
| 141 | 141 | |
| 142 | 142 | $main_authentication = $conf->file->main_authentication; |
| 143 | 143 | |
| 144 | - $session_name=session_name(); // Get current session name |
|
| 144 | + $session_name = session_name(); // Get current session name |
|
| 145 | 145 | |
| 146 | 146 | $dol_url_root = DOL_URL_ROOT; |
| 147 | 147 | |
| 148 | 148 | // Title |
| 149 | - $appli=constant('DOL_APPLICATION_TITLE'); |
|
| 150 | - $title=$appli.' '.constant('DOL_VERSION'); |
|
| 151 | - if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$conf->global->MAIN_APPLICATION_TITLE; |
|
| 152 | - $titletruedolibarrversion=constant('DOL_VERSION'); // $title used by login template after the @ to inform of true Dolibarr version |
|
| 149 | + $appli = constant('DOL_APPLICATION_TITLE'); |
|
| 150 | + $title = $appli.' '.constant('DOL_VERSION'); |
|
| 151 | + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = $conf->global->MAIN_APPLICATION_TITLE; |
|
| 152 | + $titletruedolibarrversion = constant('DOL_VERSION'); // $title used by login template after the @ to inform of true Dolibarr version |
|
| 153 | 153 | |
| 154 | 154 | // Note: $conf->css looks like '/theme/eldy/style.css.php' |
| 155 | 155 | /* |
@@ -170,13 +170,13 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | |
| 172 | 172 | // Select templates dir |
| 173 | - if (! empty($conf->modules_parts['tpl'])) // Using this feature slow down application |
|
| 173 | + if (!empty($conf->modules_parts['tpl'])) // Using this feature slow down application |
|
| 174 | 174 | { |
| 175 | - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/')); |
|
| 176 | - foreach($dirtpls as $reldir) |
|
| 175 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl/')); |
|
| 176 | + foreach ($dirtpls as $reldir) |
|
| 177 | 177 | { |
| 178 | - $tmp=dol_buildpath($reldir.'login.tpl.php'); |
|
| 179 | - if (file_exists($tmp)) { $template_dir=preg_replace('/login\.tpl\.php$/','',$tmp); break; } |
|
| 178 | + $tmp = dol_buildpath($reldir.'login.tpl.php'); |
|
| 179 | + if (file_exists($tmp)) { $template_dir = preg_replace('/login\.tpl\.php$/', '', $tmp); break; } |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | else |
@@ -185,115 +185,115 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | // Set cookie for timeout management |
| 188 | - $prefix=dol_getprefix(''); |
|
| 189 | - $sessiontimeout='DOLSESSTIMEOUT_'.$prefix; |
|
| 190 | - if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, false, true); |
|
| 188 | + $prefix = dol_getprefix(''); |
|
| 189 | + $sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix; |
|
| 190 | + if (!empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, false, true); |
|
| 191 | 191 | |
| 192 | - if (GETPOST('urlfrom','alpha')) $_SESSION["urlfrom"]=GETPOST('urlfrom','alpha'); |
|
| 192 | + if (GETPOST('urlfrom', 'alpha')) $_SESSION["urlfrom"] = GETPOST('urlfrom', 'alpha'); |
|
| 193 | 193 | else unset($_SESSION["urlfrom"]); |
| 194 | 194 | |
| 195 | - if (! GETPOST("username",'alpha')) $focus_element='username'; |
|
| 196 | - else $focus_element='password'; |
|
| 195 | + if (!GETPOST("username", 'alpha')) $focus_element = 'username'; |
|
| 196 | + else $focus_element = 'password'; |
|
| 197 | 197 | |
| 198 | - $demologin=''; |
|
| 199 | - $demopassword=''; |
|
| 200 | - if (! empty($dolibarr_main_demo)) |
|
| 198 | + $demologin = ''; |
|
| 199 | + $demopassword = ''; |
|
| 200 | + if (!empty($dolibarr_main_demo)) |
|
| 201 | 201 | { |
| 202 | - $tab=explode(',',$dolibarr_main_demo); |
|
| 203 | - $demologin=$tab[0]; |
|
| 204 | - $demopassword=$tab[1]; |
|
| 202 | + $tab = explode(',', $dolibarr_main_demo); |
|
| 203 | + $demologin = $tab[0]; |
|
| 204 | + $demopassword = $tab[1]; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // Execute hook getLoginPageOptions (for table) |
| 208 | - $parameters=array('entity' => GETPOST('entity','int')); |
|
| 209 | - $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. |
|
| 210 | - if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) { |
|
| 208 | + $parameters = array('entity' => GETPOST('entity', 'int')); |
|
| 209 | + $reshook = $hookmanager->executeHooks('getLoginPageOptions', $parameters); // Note that $action and $object may have been modified by some hooks. |
|
| 210 | + if (is_array($hookmanager->resArray) && !empty($hookmanager->resArray)) { |
|
| 211 | 211 | $morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility |
| 212 | 212 | } else { |
| 213 | 213 | $morelogincontent = $hookmanager->resPrint; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // Execute hook getLoginPageExtraOptions (eg for js) |
| 217 | - $parameters=array('entity' => GETPOST('entity','int')); |
|
| 218 | - $reshook = $hookmanager->executeHooks('getLoginPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks. |
|
| 217 | + $parameters = array('entity' => GETPOST('entity', 'int')); |
|
| 218 | + $reshook = $hookmanager->executeHooks('getLoginPageExtraOptions', $parameters); // Note that $action and $object may have been modified by some hooks. |
|
| 219 | 219 | $moreloginextracontent = $hookmanager->resPrint; |
| 220 | 220 | |
| 221 | 221 | // Login |
| 222 | - $login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin)); |
|
| 222 | + $login = (!empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username", "alpha") ? GETPOST("username", "alpha") : $demologin)); |
|
| 223 | 223 | $password = $demopassword; |
| 224 | 224 | |
| 225 | 225 | // Show logo (search in order: small company logo, large company logo, theme logo, common logo) |
| 226 | - $width=0; |
|
| 227 | - $urllogo = DOL_BASE_URI . '/theme/login_logo.png'; |
|
| 226 | + $width = 0; |
|
| 227 | + $urllogo = DOL_BASE_URI.'/theme/login_logo.png'; |
|
| 228 | 228 | |
| 229 | - if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) |
|
| 229 | + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) |
|
| 230 | 230 | { |
| 231 | - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); |
|
| 231 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); |
|
| 232 | 232 | } |
| 233 | - elseif (! empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) |
|
| 233 | + elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) |
|
| 234 | 234 | { |
| 235 | - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); |
|
| 236 | - $width=128; |
|
| 235 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); |
|
| 236 | + $width = 128; |
|
| 237 | 237 | } |
| 238 | - elseif (is_readable(DOL_BASE_URI . '/theme/' . $conf->theme . '/img/dolibarr_logo.png')) { |
|
| 239 | - $urllogo = DOL_BASE_URI . '/theme/' . $conf->theme . '/img/dolibarr_logo.png'; |
|
| 238 | + elseif (is_readable(DOL_BASE_URI.'/theme/'.$conf->theme.'/img/dolibarr_logo.png')) { |
|
| 239 | + $urllogo = DOL_BASE_URI.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'; |
|
| 240 | 240 | } |
| 241 | - elseif (is_readable(DOL_BASE_URI . '/theme/dolibarr_logo.png')) { |
|
| 242 | - $urllogo = DOL_BASE_URI . '/theme/dolibarr_logo.png'; |
|
| 241 | + elseif (is_readable(DOL_BASE_URI.'/theme/dolibarr_logo.png')) { |
|
| 242 | + $urllogo = DOL_BASE_URI.'/theme/dolibarr_logo.png'; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | // Security graphical code |
| 246 | - $captcha=0; |
|
| 247 | - $captcha_refresh=''; |
|
| 248 | - if (function_exists("imagecreatefrompng") && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) |
|
| 246 | + $captcha = 0; |
|
| 247 | + $captcha_refresh = ''; |
|
| 248 | + if (function_exists("imagecreatefrompng") && !empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) |
|
| 249 | 249 | { |
| 250 | - $captcha=1; |
|
| 251 | - $captcha_refresh=img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"'); |
|
| 250 | + $captcha = 1; |
|
| 251 | + $captcha_refresh = img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"'); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | // Extra link |
| 255 | - $forgetpasslink=0; |
|
| 256 | - $helpcenterlink=0; |
|
| 255 | + $forgetpasslink = 0; |
|
| 256 | + $helpcenterlink = 0; |
|
| 257 | 257 | if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK) || empty($conf->global->MAIN_HELPCENTER_DISABLELINK)) |
| 258 | 258 | { |
| 259 | 259 | if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) |
| 260 | 260 | { |
| 261 | - $forgetpasslink=1; |
|
| 261 | + $forgetpasslink = 1; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | if (empty($conf->global->MAIN_HELPCENTER_DISABLELINK)) |
| 265 | 265 | { |
| 266 | - $helpcenterlink=1; |
|
| 266 | + $helpcenterlink = 1; |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | // Home message |
| 271 | - $main_home=''; |
|
| 272 | - if (! empty($conf->global->MAIN_HOME)) |
|
| 271 | + $main_home = ''; |
|
| 272 | + if (!empty($conf->global->MAIN_HOME)) |
|
| 273 | 273 | { |
| 274 | - $substitutionarray=getCommonSubstitutionArray($langs); |
|
| 274 | + $substitutionarray = getCommonSubstitutionArray($langs); |
|
| 275 | 275 | complete_substitutions_array($substitutionarray, $langs); |
| 276 | 276 | $texttoshow = make_substitutions($conf->global->MAIN_HOME, $substitutionarray, $langs); |
| 277 | 277 | |
| 278 | - $main_home=dol_htmlcleanlastbr($texttoshow); |
|
| 278 | + $main_home = dol_htmlcleanlastbr($texttoshow); |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // Google AD |
| 282 | - $main_google_ad_client = ((! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))?1:0); |
|
| 282 | + $main_google_ad_client = ((!empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) ? 1 : 0); |
|
| 283 | 283 | |
| 284 | 284 | // Set jquery theme |
| 285 | - $dol_loginmesg = (! empty($_SESSION["dol_loginmesg"])?$_SESSION["dol_loginmesg"]:''); |
|
| 286 | - $favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1); |
|
| 287 | - if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; |
|
| 285 | + $dol_loginmesg = (!empty($_SESSION["dol_loginmesg"]) ? $_SESSION["dol_loginmesg"] : ''); |
|
| 286 | + $favicon = dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1); |
|
| 287 | + if (!empty($conf->global->MAIN_FAVICON_URL)) $favicon = $conf->global->MAIN_FAVICON_URL; |
|
| 288 | 288 | $jquerytheme = 'base'; |
| 289 | - if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; |
|
| 289 | + if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; |
|
| 290 | 290 | |
| 291 | 291 | // Set dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen, dol_no_mouse_hover |
| 292 | - $dol_hide_topmenu=GETPOST('dol_hide_topmenu','int'); |
|
| 293 | - $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu','int'); |
|
| 294 | - $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen','int'); |
|
| 295 | - $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover','int'); |
|
| 296 | - $dol_use_jmobile=GETPOST('dol_use_jmobile','int'); |
|
| 292 | + $dol_hide_topmenu = GETPOST('dol_hide_topmenu', 'int'); |
|
| 293 | + $dol_hide_leftmenu = GETPOST('dol_hide_leftmenu', 'int'); |
|
| 294 | + $dol_optimize_smallscreen = GETPOST('dol_optimize_smallscreen', 'int'); |
|
| 295 | + $dol_no_mouse_hover = GETPOST('dol_no_mouse_hover', 'int'); |
|
| 296 | + $dol_use_jmobile = GETPOST('dol_use_jmobile', 'int'); |
|
| 297 | 297 | |
| 298 | 298 | // Include login page template |
| 299 | 299 | include $template_dir.'login.tpl.php'; |
@@ -311,23 +311,23 @@ discard block |
||
| 311 | 311 | * non defini=>renvoi un salt pour cryptage par defaut |
| 312 | 312 | * @return string Salt string |
| 313 | 313 | */ |
| 314 | -function makesalt($type=CRYPT_SALT_LENGTH) |
|
| 314 | +function makesalt($type = CRYPT_SALT_LENGTH) |
|
| 315 | 315 | { |
| 316 | 316 | dol_syslog("makesalt type=".$type); |
| 317 | - switch($type) |
|
| 317 | + switch ($type) |
|
| 318 | 318 | { |
| 319 | 319 | case 12: // 8 + 4 |
| 320 | - $saltlen=8; $saltprefix='$1$'; $saltsuffix='$'; break; |
|
| 320 | + $saltlen = 8; $saltprefix = '$1$'; $saltsuffix = '$'; break; |
|
| 321 | 321 | case 8: // 8 (Pour compatibilite, ne devrait pas etre utilise) |
| 322 | - $saltlen=8; $saltprefix='$1$'; $saltsuffix='$'; break; |
|
| 322 | + $saltlen = 8; $saltprefix = '$1$'; $saltsuffix = '$'; break; |
|
| 323 | 323 | case 2: // 2 |
| 324 | 324 | default: // by default, fall back on Standard DES (should work everywhere) |
| 325 | - $saltlen=2; $saltprefix=''; $saltsuffix=''; break; |
|
| 325 | + $saltlen = 2; $saltprefix = ''; $saltsuffix = ''; break; |
|
| 326 | 326 | } |
| 327 | - $salt=''; |
|
| 328 | - while(dol_strlen($salt) < $saltlen) $salt.=chr(mt_rand(64,126)); |
|
| 327 | + $salt = ''; |
|
| 328 | + while (dol_strlen($salt) < $saltlen) $salt .= chr(mt_rand(64, 126)); |
|
| 329 | 329 | |
| 330 | - $result=$saltprefix.$salt.$saltsuffix; |
|
| 330 | + $result = $saltprefix.$salt.$saltsuffix; |
|
| 331 | 331 | dol_syslog("makesalt return=".$result); |
| 332 | 332 | return $result; |
| 333 | 333 | } |
@@ -338,42 +338,42 @@ discard block |
||
| 338 | 338 | * @param int $level Encode level: 0 no encoding, 1 encoding |
| 339 | 339 | * @return int <0 if KO, >0 if OK |
| 340 | 340 | */ |
| 341 | -function encodedecode_dbpassconf($level=0) |
|
| 341 | +function encodedecode_dbpassconf($level = 0) |
|
| 342 | 342 | { |
| 343 | 343 | dol_syslog("encodedecode_dbpassconf level=".$level, LOG_DEBUG); |
| 344 | 344 | $config = ''; |
| 345 | - $passwd=''; |
|
| 346 | - $passwd_crypted=''; |
|
| 345 | + $passwd = ''; |
|
| 346 | + $passwd_crypted = ''; |
|
| 347 | 347 | |
| 348 | - if ($fp = fopen(DOL_DOCUMENT_ROOT.'/conf/conf.php','r')) |
|
| 348 | + if ($fp = fopen(DOL_DOCUMENT_ROOT.'/conf/conf.php', 'r')) |
|
| 349 | 349 | { |
| 350 | - while(!feof($fp)) |
|
| 350 | + while (!feof($fp)) |
|
| 351 | 351 | { |
| 352 | - $buffer = fgets($fp,4096); |
|
| 352 | + $buffer = fgets($fp, 4096); |
|
| 353 | 353 | |
| 354 | - $lineofpass=0; |
|
| 354 | + $lineofpass = 0; |
|
| 355 | 355 | |
| 356 | - if (preg_match('/^[^#]*dolibarr_main_db_encrypted_pass[\s]*=[\s]*(.*)/i',$buffer,$reg)) // Old way to save crypted value |
|
| 356 | + if (preg_match('/^[^#]*dolibarr_main_db_encrypted_pass[\s]*=[\s]*(.*)/i', $buffer, $reg)) // Old way to save crypted value |
|
| 357 | 357 | { |
| 358 | - $val = trim($reg[1]); // This also remove CR/LF |
|
| 359 | - $val=preg_replace('/^["\']/','',$val); |
|
| 360 | - $val=preg_replace('/["\'][\s;]*$/','',$val); |
|
| 361 | - if (! empty($val)) |
|
| 358 | + $val = trim($reg[1]); // This also remove CR/LF |
|
| 359 | + $val = preg_replace('/^["\']/', '', $val); |
|
| 360 | + $val = preg_replace('/["\'][\s;]*$/', '', $val); |
|
| 361 | + if (!empty($val)) |
|
| 362 | 362 | { |
| 363 | 363 | $passwd_crypted = $val; |
| 364 | 364 | $val = dol_decode($val); |
| 365 | 365 | $passwd = $val; |
| 366 | - $lineofpass=1; |
|
| 366 | + $lineofpass = 1; |
|
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | - elseif (preg_match('/^[^#]*dolibarr_main_db_pass[\s]*=[\s]*(.*)/i',$buffer,$reg)) |
|
| 369 | + elseif (preg_match('/^[^#]*dolibarr_main_db_pass[\s]*=[\s]*(.*)/i', $buffer, $reg)) |
|
| 370 | 370 | { |
| 371 | - $val = trim($reg[1]); // This also remove CR/LF |
|
| 372 | - $val=preg_replace('/^["\']/','',$val); |
|
| 373 | - $val=preg_replace('/["\'][\s;]*$/','',$val); |
|
| 374 | - if (preg_match('/crypted:/i',$buffer)) |
|
| 371 | + $val = trim($reg[1]); // This also remove CR/LF |
|
| 372 | + $val = preg_replace('/^["\']/', '', $val); |
|
| 373 | + $val = preg_replace('/["\'][\s;]*$/', '', $val); |
|
| 374 | + if (preg_match('/crypted:/i', $buffer)) |
|
| 375 | 375 | { |
| 376 | - $val = preg_replace('/crypted:/i','',$val); |
|
| 376 | + $val = preg_replace('/crypted:/i', '', $val); |
|
| 377 | 377 | $passwd_crypted = $val; |
| 378 | 378 | $val = dol_decode($val); |
| 379 | 379 | $passwd = $val; |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $val = dol_encode($val); |
| 385 | 385 | $passwd_crypted = $val; |
| 386 | 386 | } |
| 387 | - $lineofpass=1; |
|
| 387 | + $lineofpass = 1; |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | // Output line |
@@ -411,8 +411,8 @@ discard block |
||
| 411 | 411 | fclose($fp); |
| 412 | 412 | |
| 413 | 413 | // Write new conf file |
| 414 | - $file=DOL_DOCUMENT_ROOT.'/conf/conf.php'; |
|
| 415 | - if ($fp = @fopen($file,'w')) |
|
| 414 | + $file = DOL_DOCUMENT_ROOT.'/conf/conf.php'; |
|
| 415 | + if ($fp = @fopen($file, 'w')) |
|
| 416 | 416 | { |
| 417 | 417 | fputs($fp, $config); |
| 418 | 418 | fflush($fp); |
@@ -446,11 +446,11 @@ discard block |
||
| 446 | 446 | * @return string New value for password |
| 447 | 447 | * @see dol_hash |
| 448 | 448 | */ |
| 449 | -function getRandomPassword($generic=false, $replaceambiguouschars=null) |
|
| 449 | +function getRandomPassword($generic = false, $replaceambiguouschars = null) |
|
| 450 | 450 | { |
| 451 | - global $db,$conf,$langs,$user; |
|
| 451 | + global $db, $conf, $langs, $user; |
|
| 452 | 452 | |
| 453 | - $generated_password=''; |
|
| 453 | + $generated_password = ''; |
|
| 454 | 454 | if ($generic) |
| 455 | 455 | { |
| 456 | 456 | $length = 32; |
@@ -458,8 +458,8 @@ discard block |
||
| 458 | 458 | $uppercase = "ASDFGHJKLZXCVBNMQWERTYUIOP"; |
| 459 | 459 | $numbers = "1234567890"; |
| 460 | 460 | $randomCode = ""; |
| 461 | - $nbofchar = round($length/3); |
|
| 462 | - $nbofcharlast = ($length - 2*$nbofchar); |
|
| 461 | + $nbofchar = round($length / 3); |
|
| 462 | + $nbofcharlast = ($length - 2 * $nbofchar); |
|
| 463 | 463 | //var_dump($nbofchar.'-'.$nbofcharlast); |
| 464 | 464 | if (function_exists('random_int')) // Cryptographic random |
| 465 | 465 | { |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $randomCode .= $numbers{random_int(0, $max)}; |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | - $generated_password=str_shuffle($randomCode); |
|
| 479 | + $generated_password = str_shuffle($randomCode); |
|
| 480 | 480 | } |
| 481 | 481 | else // Old platform, non cryptographic random |
| 482 | 482 | { |
@@ -493,17 +493,17 @@ discard block |
||
| 493 | 493 | $randomCode .= $numbers{mt_rand(0, $max)}; |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | - $generated_password=str_shuffle($randomCode); |
|
| 496 | + $generated_password = str_shuffle($randomCode); |
|
| 497 | 497 | } |
| 498 | 498 | } |
| 499 | - else if (! empty($conf->global->USER_PASSWORD_GENERATED)) |
|
| 499 | + else if (!empty($conf->global->USER_PASSWORD_GENERATED)) |
|
| 500 | 500 | { |
| 501 | - $nomclass="modGeneratePass".ucfirst($conf->global->USER_PASSWORD_GENERATED); |
|
| 502 | - $nomfichier=$nomclass.".class.php"; |
|
| 501 | + $nomclass = "modGeneratePass".ucfirst($conf->global->USER_PASSWORD_GENERATED); |
|
| 502 | + $nomfichier = $nomclass.".class.php"; |
|
| 503 | 503 | //print DOL_DOCUMENT_ROOT."/core/modules/security/generate/".$nomclass; |
| 504 | 504 | require_once DOL_DOCUMENT_ROOT."/core/modules/security/generate/".$nomfichier; |
| 505 | - $genhandler=new $nomclass($db,$conf,$langs,$user); |
|
| 506 | - $generated_password=$genhandler->getNewGeneratedPassword(); |
|
| 505 | + $genhandler = new $nomclass($db, $conf, $langs, $user); |
|
| 506 | + $generated_password = $genhandler->getNewGeneratedPassword(); |
|
| 507 | 507 | unset($genhandler); |
| 508 | 508 | } |
| 509 | 509 | |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | { |
| 513 | 513 | $numbers = "ABCDEF"; |
| 514 | 514 | $max = strlen($numbers) - 1; |
| 515 | - $generated_password=str_replace($replaceambiguouschars, $numbers{random_int(0, $max)}, $generated_password); |
|
| 515 | + $generated_password = str_replace($replaceambiguouschars, $numbers{random_int(0, $max)}, $generated_password); |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | return $generated_password; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $arraycontext = array($arraycontext); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $this->contextarray = array_unique(array_merge($arraycontext, $this->contextarray)); // All contexts are concatenated |
|
| 93 | + $this->contextarray = array_unique(array_merge($arraycontext, $this->contextarray)); // All contexts are concatenated |
|
| 94 | 94 | |
| 95 | 95 | foreach ($conf->modules_parts['hooks'] as $module => $hooks) { // Loop on each module that brings hooks |
| 96 | 96 | if (empty($conf->$module->enabled)) { |
@@ -100,20 +100,20 @@ discard block |
||
| 100 | 100 | //dol_syslog(get_class($this).'::initHooks module='.$module.' arraycontext='.join(',',$arraycontext)); |
| 101 | 101 | foreach ($arraycontext as $context) { |
| 102 | 102 | if (is_array($hooks)) { |
| 103 | - $arrayhooks = $hooks; // New system |
|
| 103 | + $arrayhooks = $hooks; // New system |
|
| 104 | 104 | } else { |
| 105 | - $arrayhooks = explode(':', $hooks); // Old system (for backward compatibility) |
|
| 105 | + $arrayhooks = explode(':', $hooks); // Old system (for backward compatibility) |
|
| 106 | 106 | } |
| 107 | 107 | if (in_array($context, $arrayhooks) || in_array('all', $arrayhooks)) { // We instantiate action class only if initialized hook is handled by module |
| 108 | 108 | // Include actions class overwriting hooks |
| 109 | 109 | if (!is_object($this->hooks[$context][$module])) { // If set, class was already loaded |
| 110 | - $path = '/' . $module . '/class/'; |
|
| 111 | - $actionfile = 'actions_' . $module . '.class.php'; |
|
| 110 | + $path = '/'.$module.'/class/'; |
|
| 111 | + $actionfile = 'actions_'.$module.'.class.php'; |
|
| 112 | 112 | |
| 113 | - dol_syslog(get_class($this) . '::initHooks Loading hook class for context ' . $context . ": " . $actionfile, LOG_INFO); |
|
| 114 | - $resaction = dol_include_once($path . $actionfile); |
|
| 113 | + dol_syslog(get_class($this).'::initHooks Loading hook class for context '.$context.": ".$actionfile, LOG_INFO); |
|
| 114 | + $resaction = dol_include_once($path.$actionfile); |
|
| 115 | 115 | if ($resaction) { |
| 116 | - $controlclassname = 'Actions' . ucfirst($module); |
|
| 116 | + $controlclassname = 'Actions'.ucfirst($module); |
|
| 117 | 117 | $actionInstance = new $controlclassname($this->db); |
| 118 | 118 | $this->hooks[$context][$module] = $actionInstance; |
| 119 | 119 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $actionclassinstance->error = 0; |
| 237 | 237 | $actionclassinstance->errors = array(); |
| 238 | 238 | |
| 239 | - dol_syslog(get_class($this) . "::executeHooks Qualified hook found (hooktype=" . $hooktype . "). We call method " . $method . " of class " . get_class($actionclassinstance) . ", module=" . $module . ", action=" . $action . " context=" . $context, LOG_DEBUG); |
|
| 239 | + dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", action=".$action." context=".$context, LOG_DEBUG); |
|
| 240 | 240 | |
| 241 | 241 | // Add current context to avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; |
| 242 | 242 | $parameters['currentcontext'] = $context; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $error++; |
| 248 | 248 | $this->error = $actionclassinstance->error; |
| 249 | 249 | $this->errors = array_merge($this->errors, (array) $actionclassinstance->errors); |
| 250 | - dol_syslog("Error on hook module=" . $module . ", method " . $method . ", class " . get_class($actionclassinstance) . ", hooktype=" . $hooktype . (empty($this->error) ? '' : " " . $this->error) . (empty($this->errors) ? '' : " " . join(",", $this->errors)), LOG_ERR); |
|
| 250 | + dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error) ? '' : " ".$this->error).(empty($this->errors) ? '' : " ".join(",", $this->errors)), LOG_ERR); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | if (isset($actionclassinstance->results) && is_array($actionclassinstance->results)) |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $this->resPrint .= $actionclassinstance->resprints; |
| 271 | 271 | // TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string but an int. you must use $actionclassinstance->resprints to return a string |
| 272 | 272 | if (!is_array($resaction) && !is_numeric($resaction)) { |
| 273 | - dol_syslog('Error: Bug into hook ' . $method . ' of module class ' . get_class($actionclassinstance) . '. Method must not return a string but an int (0=OK, 1=Replace, -1=KO) and set string into ->resprints', LOG_ERR); |
|
| 273 | + dol_syslog('Error: Bug into hook '.$method.' of module class '.get_class($actionclassinstance).'. Method must not return a string but an int (0=OK, 1=Replace, -1=KO) and set string into ->resprints', LOG_ERR); |
|
| 274 | 274 | if (empty($actionclassinstance->resprints)) { |
| 275 | 275 | $this->resPrint .= $resaction; |
| 276 | 276 | $resaction = 0; |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | $inj += preg_match('/insert\s+into/i', $val); |
| 101 | 101 | $inj += preg_match('/select\s+from/i', $val); |
| 102 | 102 | $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); |
| 103 | - $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login |
|
| 104 | - $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
|
| 103 | + $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login |
|
| 104 | + $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
|
| 105 | 105 | } |
| 106 | 106 | if ($type == 3) { |
| 107 | 107 | $inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val); |
@@ -125,15 +125,15 @@ discard block |
||
| 125 | 125 | $inj += preg_match('/<style/i', $val); |
| 126 | 126 | } |
| 127 | 127 | $inj += preg_match('/base[\s]+href/si', $val); |
| 128 | - $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)> |
|
| 129 | - $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)> |
|
| 130 | - $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)> |
|
| 131 | - $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)> |
|
| 132 | - $inj += preg_match('/onloadstart\s*=/i', $val); // onload can be set on audio tag <audio onloadstart=alert(1)> |
|
| 133 | - $inj += preg_match('/onclick\s*=/i', $val); // onclick can be set on img text html tag like <img onclick = alert(1)> |
|
| 134 | - $inj += preg_match('/onscroll\s*=/i', $val); // onscroll can be on textarea |
|
| 128 | + $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)> |
|
| 129 | + $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)> |
|
| 130 | + $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)> |
|
| 131 | + $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)> |
|
| 132 | + $inj += preg_match('/onloadstart\s*=/i', $val); // onload can be set on audio tag <audio onloadstart=alert(1)> |
|
| 133 | + $inj += preg_match('/onclick\s*=/i', $val); // onclick can be set on img text html tag like <img onclick = alert(1)> |
|
| 134 | + $inj += preg_match('/onscroll\s*=/i', $val); // onscroll can be on textarea |
|
| 135 | 135 | //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val); // To lock event handlers onAbort(), ... |
| 136 | - $inj += preg_match('/:|:|:/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...' |
|
| 136 | + $inj += preg_match('/:|:|:/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...' |
|
| 137 | 137 | //if ($type == 1) |
| 138 | 138 | //{ |
| 139 | 139 | $inj += preg_match('/javascript:/i', $val); |
@@ -141,10 +141,10 @@ discard block |
||
| 141 | 141 | //} |
| 142 | 142 | // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param) |
| 143 | 143 | if ($type == 1) { |
| 144 | - $inj += preg_match('/"/i', $val); // We refused " in GET parameters value |
|
| 144 | + $inj += preg_match('/"/i', $val); // We refused " in GET parameters value |
|
| 145 | 145 | } |
| 146 | 146 | if ($type == 2) { |
| 147 | - $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. |
|
| 147 | + $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. |
|
| 148 | 148 | } |
| 149 | 149 | return $inj; |
| 150 | 150 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | if (analyseVarsForSqlAndScriptsInjection($key, $type) && analyseVarsForSqlAndScriptsInjection($value, $type)) { |
| 164 | 164 | //$var[$key] = $value; // This is useless |
| 165 | 165 | } else { |
| 166 | - 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"]) . ')'; |
|
| 166 | + 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 | 167 | exit; |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -197,11 +197,11 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | // This is to make Dolibarr working with Plesk |
| 199 | 199 | if (!empty($_SERVER['DOCUMENT_ROOT']) && substr($_SERVER['DOCUMENT_ROOT'], -6) !== 'htdocs') { |
| 200 | - set_include_path($_SERVER['DOCUMENT_ROOT'] . '/htdocs'); |
|
| 200 | + set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | // Include the conf.php and functions.lib.php |
| 204 | -require_once DOL_BASE_PATH . '/filefunc.inc.php'; |
|
| 204 | +require_once DOL_BASE_PATH.'/filefunc.inc.php'; |
|
| 205 | 205 | |
| 206 | 206 | // If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it. |
| 207 | 207 | // This is used for example by form of boxes to save personalization of some options. |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $tmplist = explode(',', $tmpautoset[1]); |
| 212 | 212 | $cookiearrayvalue = array(); |
| 213 | 213 | foreach ($tmplist as $tmpkey) { |
| 214 | - $postkey = $tmpautoset[0] . '_' . $tmpkey; |
|
| 214 | + $postkey = $tmpautoset[0].'_'.$tmpkey; |
|
| 215 | 215 | //var_dump('tmpkey='.$tmpkey.' postkey='.$postkey.' value='.$_POST[$postkey]); |
| 216 | 216 | if (!empty($_POST[$postkey])) |
| 217 | 217 | $cookiearrayvalue[$tmpkey] = $_POST[$postkey]; |
@@ -229,12 +229,12 @@ discard block |
||
| 229 | 229 | // Note: the function dol_getprefix may have been redefined to return a different key to manage another area to protect. |
| 230 | 230 | $prefix = dol_getprefix(''); |
| 231 | 231 | |
| 232 | -$sessionname = 'DOLSESSID_' . $prefix; |
|
| 233 | -$sessiontimeout = 'DOLSESSTIMEOUT_' . $prefix; |
|
| 232 | +$sessionname = 'DOLSESSID_'.$prefix; |
|
| 233 | +$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix; |
|
| 234 | 234 | if (!empty($_COOKIE[$sessiontimeout])) |
| 235 | 235 | ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]); |
| 236 | 236 | session_name($sessionname); |
| 237 | -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. |
|
| 237 | +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 | 238 | // This create lock, released when session_write_close() or end of page. |
| 239 | 239 | // We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished. |
| 240 | 240 | if (!defined('NOSESSION')) { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $conf->browser->name = $tmp['browsername']; |
| 261 | 261 | $conf->browser->os = $tmp['browseros']; |
| 262 | 262 | $conf->browser->version = $tmp['browserversion']; |
| 263 | - $conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet' |
|
| 263 | + $conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet' |
|
| 264 | 264 | //var_dump($conf->browser); |
| 265 | 265 | |
| 266 | 266 | if ($conf->browser->layout == 'phone') |
@@ -279,16 +279,16 @@ discard block |
||
| 279 | 279 | $newurl = preg_replace('/^http:/i', 'https:', $_SERVER["SCRIPT_URI"]); |
| 280 | 280 | } |
| 281 | 281 | } else { // Check HTTPS environment variable (Apache/mod_ssl only) |
| 282 | - $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT) . $_SERVER["REQUEST_URI"]; |
|
| 282 | + $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"]; |
|
| 283 | 283 | } |
| 284 | 284 | } else { |
| 285 | 285 | // Check HTTPS environment variable (Apache/mod_ssl only) |
| 286 | - $newurl = $conf->file->main_force_https . $_SERVER["REQUEST_URI"]; |
|
| 286 | + $newurl = $conf->file->main_force_https.$_SERVER["REQUEST_URI"]; |
|
| 287 | 287 | } |
| 288 | 288 | // Start redirect |
| 289 | 289 | if ($newurl) { |
| 290 | - dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to " . $newurl); |
|
| 291 | - header("Location: " . $newurl); |
|
| 290 | + dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl); |
|
| 291 | + header("Location: ".$newurl); |
|
| 292 | 292 | exit; |
| 293 | 293 | } else { |
| 294 | 294 | 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); |
@@ -313,9 +313,9 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | // Loading of additional presentation includes |
| 315 | 315 | if (!defined('NOREQUIREHTML')) |
| 316 | - require_once DOL_BASE_PATH . '/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2) |
|
| 316 | + require_once DOL_BASE_PATH.'/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2) |
|
| 317 | 317 | if (!defined('NOREQUIREAJAX') && $conf->use_javascript_ajax) |
| 318 | - require_once DOL_BASE_PATH . '/core/lib/ajax.lib.php'; // Need 22ko memory |
|
| 318 | + require_once DOL_BASE_PATH.'/core/lib/ajax.lib.php'; // Need 22ko memory |
|
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | |
@@ -324,19 +324,19 @@ discard block |
||
| 324 | 324 | // If install or upgrade process not done or not completely finished, we call the install page. |
| 325 | 325 | if (!empty($conf->global->MAIN_NOT_INSTALLED) || !empty($conf->global->MAIN_NOT_UPGRADED)) { |
| 326 | 326 | dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING); |
| 327 | - header("Location: " . DOL_BASE_URI . "/install/index.php"); |
|
| 327 | + header("Location: ".DOL_BASE_URI."/install/index.php"); |
|
| 328 | 328 | exit; |
| 329 | 329 | } |
| 330 | 330 | // If an upgrade process is required, we call the install page. |
| 331 | 331 | 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))) { |
| 332 | 332 | $versiontocompare = empty($conf->global->MAIN_VERSION_LAST_UPGRADE) ? $conf->global->MAIN_VERSION_LAST_INSTALL : $conf->global->MAIN_VERSION_LAST_UPGRADE; |
| 333 | - require_once DOL_BASE_PATH . '/core/lib/admin.lib.php'; |
|
| 333 | + require_once DOL_BASE_PATH.'/core/lib/admin.lib.php'; |
|
| 334 | 334 | $dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare); |
| 335 | 335 | $dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION); |
| 336 | 336 | $rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade); |
| 337 | 337 | if ($rescomp > 0) { // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades |
| 338 | - dol_syslog("main.inc: database version " . $versiontocompare . " is lower than programs version " . DOL_VERSION . ". Redirect to install page.", LOG_WARNING); |
|
| 339 | - header("Location: " . DOL_BASE_URI . "/install/index.php"); |
|
| 338 | + dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING); |
|
| 339 | + header("Location: ".DOL_BASE_URI."/install/index.php"); |
|
| 340 | 340 | exit; |
| 341 | 341 | } |
| 342 | 342 | } |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | } |
| 360 | 360 | if ($_SERVER['REQUEST_METHOD'] === 'POST') { // This test must be after loading $_SESSION['token']. |
| 361 | 361 | if (GETPOST('token', 'alpha') != $_SESSION['token']) { |
| 362 | - dol_syslog("Invalid token in " . $_SERVER['HTTP_REFERER'] . ", action=" . GETPOST('action', 'aZ09') . ", _POST['token']=" . GETPOST('token', 'alpha') . ", _SESSION['token']=" . $_SESSION['token'], LOG_WARNING); |
|
| 362 | + dol_syslog("Invalid token in ".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); |
|
| 363 | 363 | //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. |
| 364 | 364 | unset($_POST); |
| 365 | 365 | } |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | $test = true; |
| 420 | 420 | if (!isset($_SESSION["dol_login"])) { |
| 421 | 421 | // It is not already authenticated and it requests the login / password |
| 422 | - include_once DOL_BASE_PATH . '/core/lib/security2.lib.php'; |
|
| 422 | + include_once DOL_BASE_PATH.'/core/lib/security2.lib.php'; |
|
| 423 | 423 | |
| 424 | 424 | $dol_dst_observed = GETPOST("dst_observed", 'int', 3); |
| 425 | 425 | $dol_dst_first = GETPOST("dst_first", 'int', 3); |
@@ -433,17 +433,17 @@ discard block |
||
| 433 | 433 | $dol_use_jmobile = GETPOST('dol_use_jmobile', 'int', 3); |
| 434 | 434 | //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); |
| 435 | 435 | // If in demo mode, we check we go to home page through the public/demo/index.php page |
| 436 | - if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI . '/index.php') { // We ask index page |
|
| 436 | + if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_BASE_URI.'/index.php') { // We ask index page |
|
| 437 | 437 | if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/public/', $_SERVER['HTTP_REFERER'])) { |
| 438 | - dol_syslog("Call index page from another url than demo page (call is done from page " . $_SERVER['HTTP_REFERER'] . ")"); |
|
| 438 | + dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")"); |
|
| 439 | 439 | $url = ''; |
| 440 | - $url .= ($url ? '&' : '') . ($dol_hide_topmenu ? 'dol_hide_topmenu=' . $dol_hide_topmenu : ''); |
|
| 441 | - $url .= ($url ? '&' : '') . ($dol_hide_leftmenu ? 'dol_hide_leftmenu=' . $dol_hide_leftmenu : ''); |
|
| 442 | - $url .= ($url ? '&' : '') . ($dol_optimize_smallscreen ? 'dol_optimize_smallscreen=' . $dol_optimize_smallscreen : ''); |
|
| 443 | - $url .= ($url ? '&' : '') . ($dol_no_mouse_hover ? 'dol_no_mouse_hover=' . $dol_no_mouse_hover : ''); |
|
| 444 | - $url .= ($url ? '&' : '') . ($dol_use_jmobile ? 'dol_use_jmobile=' . $dol_use_jmobile : ''); |
|
| 445 | - $url = DOL_BASE_URI . '/public/demo/index.php' . ($url ? '?' . $url : ''); |
|
| 446 | - header("Location: " . $url); |
|
| 440 | + $url .= ($url ? '&' : '').($dol_hide_topmenu ? 'dol_hide_topmenu='.$dol_hide_topmenu : ''); |
|
| 441 | + $url .= ($url ? '&' : '').($dol_hide_leftmenu ? 'dol_hide_leftmenu='.$dol_hide_leftmenu : ''); |
|
| 442 | + $url .= ($url ? '&' : '').($dol_optimize_smallscreen ? 'dol_optimize_smallscreen='.$dol_optimize_smallscreen : ''); |
|
| 443 | + $url .= ($url ? '&' : '').($dol_no_mouse_hover ? 'dol_no_mouse_hover='.$dol_no_mouse_hover : ''); |
|
| 444 | + $url .= ($url ? '&' : '').($dol_use_jmobile ? 'dol_use_jmobile='.$dol_use_jmobile : ''); |
|
| 445 | + $url = DOL_BASE_URI.'/public/demo/index.php'.($url ? '?'.$url : ''); |
|
| 446 | + header("Location: ".$url); |
|
| 447 | 447 | exit; |
| 448 | 448 | } |
| 449 | 449 | } |
@@ -463,9 +463,9 @@ discard block |
||
| 463 | 463 | $test = false; |
| 464 | 464 | |
| 465 | 465 | // Call trigger for the "security events" log |
| 466 | - $user->trigger_mesg = 'ErrorBadValueForCode - login=' . GETPOST("username", "alpha", 2); |
|
| 466 | + $user->trigger_mesg = 'ErrorBadValueForCode - login='.GETPOST("username", "alpha", 2); |
|
| 467 | 467 | // Call of triggers |
| 468 | - include_once DOL_BASE_PATH . '/core/class/interfaces.class.php'; |
|
| 468 | + include_once DOL_BASE_PATH.'/core/class/interfaces.class.php'; |
|
| 469 | 469 | $interface = new Interfaces($db); |
| 470 | 470 | $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf); |
| 471 | 471 | if ($result < 0) { |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $action = ''; |
| 477 | 477 | $hookmanager->initHooks(array('login')); |
| 478 | 478 | $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 479 | - $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 479 | + $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 480 | 480 | if ($reshook < 0) |
| 481 | 481 | $error++; |
| 482 | 482 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | $goontestloop = true; |
| 502 | 502 | |
| 503 | 503 | if (!is_object($langs)) { // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages. |
| 504 | - include_once DOL_BASE_PATH . '/core/class/translate.class.php'; |
|
| 504 | + include_once DOL_BASE_PATH.'/core/class/translate.class.php'; |
|
| 505 | 505 | $langs = new Translate("", $conf); |
| 506 | 506 | $langcode = (GETPOST('lang', 'aZ09', 1) ? GETPOST('lang', 'aZ09', 1) : (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT)); |
| 507 | 507 | if (defined('MAIN_LANG_DEFAULT')) |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | $dol_tz_string = preg_replace('/\s/', '_', $dol_tz_string); |
| 524 | 524 | $dol_dst = 0; |
| 525 | 525 | if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) { |
| 526 | - include_once DOL_BASE_PATH . '/core/lib/date.lib.php'; |
|
| 526 | + include_once DOL_BASE_PATH.'/core/lib/date.lib.php'; |
|
| 527 | 527 | $datenow = dol_now(); |
| 528 | 528 | $datefirst = dol_stringtotime($_POST["dst_first"]); |
| 529 | 529 | $datesecond = dol_stringtotime($_POST["dst_second"]); |
@@ -544,9 +544,9 @@ discard block |
||
| 544 | 544 | $_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword"); |
| 545 | 545 | |
| 546 | 546 | // Call trigger for the "security events" log |
| 547 | - $user->trigger_mesg = $langs->trans("ErrorBadLoginPassword") . ' - login=' . GETPOST("username", "alpha", 2); |
|
| 547 | + $user->trigger_mesg = $langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username", "alpha", 2); |
|
| 548 | 548 | // Call of triggers |
| 549 | - include_once DOL_BASE_PATH . '/core/class/interfaces.class.php'; |
|
| 549 | + include_once DOL_BASE_PATH.'/core/class/interfaces.class.php'; |
|
| 550 | 550 | $interface = new Interfaces($db); |
| 551 | 551 | $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf, GETPOST("username", "alpha", 2)); |
| 552 | 552 | if ($result < 0) { |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $action = ''; |
| 558 | 558 | $hookmanager->initHooks(array('login')); |
| 559 | 559 | $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 560 | - $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 560 | + $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 561 | 561 | if ($reshook < 0) |
| 562 | 562 | $error++; |
| 563 | 563 | |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | // End test login / passwords |
| 569 | 569 | 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. |
| 570 | 570 | // No data to test login, so we show the login page |
| 571 | - dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . " showing the login form and exit"); |
|
| 571 | + dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." showing the login form and exit"); |
|
| 572 | 572 | if (defined('NOREDIRECTBYMAINTOLOGIN')) |
| 573 | 573 | return 'ERROR_NOT_LOGGED'; |
| 574 | 574 | else |
@@ -581,8 +581,8 @@ discard block |
||
| 581 | 581 | dol_syslog('User not found, connexion refused'); |
| 582 | 582 | session_destroy(); |
| 583 | 583 | session_name($sessionname); |
| 584 | - session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 585 | - session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 584 | + session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 585 | + session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 586 | 586 | |
| 587 | 587 | if ($resultFetchUser == 0) { |
| 588 | 588 | // Load translation files required by page |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | $_SESSION["dol_loginmesg"] = $langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login); |
| 592 | 592 | |
| 593 | - $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login; |
|
| 593 | + $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login; |
|
| 594 | 594 | } |
| 595 | 595 | if ($resultFetchUser < 0) { |
| 596 | 596 | $_SESSION["dol_loginmesg"] = $user->error; |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | // Call triggers for the "security events" log |
| 602 | - include_once DOL_BASE_PATH . '/core/class/interfaces.class.php'; |
|
| 602 | + include_once DOL_BASE_PATH.'/core/class/interfaces.class.php'; |
|
| 603 | 603 | $interface = new Interfaces($db); |
| 604 | 604 | $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf); |
| 605 | 605 | if ($result < 0) { |
@@ -610,18 +610,18 @@ discard block |
||
| 610 | 610 | $action = ''; |
| 611 | 611 | $hookmanager->initHooks(array('login')); |
| 612 | 612 | $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 613 | - $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 613 | + $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 614 | 614 | if ($reshook < 0) |
| 615 | 615 | $error++; |
| 616 | 616 | |
| 617 | 617 | $paramsurl = array(); |
| 618 | 618 | if (GETPOST('textbrowser', 'int')) |
| 619 | - $paramsurl[] = 'textbrowser=' . GETPOST('textbrowser', 'int'); |
|
| 619 | + $paramsurl[] = 'textbrowser='.GETPOST('textbrowser', 'int'); |
|
| 620 | 620 | if (GETPOST('nojs', 'int')) |
| 621 | - $paramsurl[] = 'nojs=' . GETPOST('nojs', 'int'); |
|
| 621 | + $paramsurl[] = 'nojs='.GETPOST('nojs', 'int'); |
|
| 622 | 622 | if (GETPOST('lang', 'aZ09')) |
| 623 | - $paramsurl[] = 'lang=' . GETPOST('lang', 'aZ09'); |
|
| 624 | - header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : '')); |
|
| 623 | + $paramsurl[] = 'lang='.GETPOST('lang', 'aZ09'); |
|
| 624 | + header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); |
|
| 625 | 625 | exit; |
| 626 | 626 | } |
| 627 | 627 | } |
@@ -629,16 +629,16 @@ discard block |
||
| 629 | 629 | // We are already into an authenticated session |
| 630 | 630 | $login = $_SESSION["dol_login"]; |
| 631 | 631 | $entity = $_SESSION["dol_entity"]; |
| 632 | - dol_syslog("- This is an already logged session. _SESSION['dol_login']=" . $login . " _SESSION['dol_entity']=" . $entity, LOG_DEBUG); |
|
| 632 | + dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG); |
|
| 633 | 633 | |
| 634 | 634 | $resultFetchUser = $user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1)); |
| 635 | 635 | if ($resultFetchUser <= 0) { |
| 636 | 636 | // Account has been removed after login |
| 637 | - dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=" . $login, LOG_WARNING); |
|
| 637 | + dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING); |
|
| 638 | 638 | session_destroy(); |
| 639 | 639 | session_name($sessionname); |
| 640 | - session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 641 | - session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 640 | + session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie |
|
| 641 | + session_start(); // Fixing the bug of register_globals here is useless since session is empty |
|
| 642 | 642 | |
| 643 | 643 | if ($resultFetchUser == 0) { |
| 644 | 644 | // Load translation files required by page |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | |
| 647 | 647 | $_SESSION["dol_loginmesg"] = $langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login); |
| 648 | 648 | |
| 649 | - $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login=' . $login; |
|
| 649 | + $user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login; |
|
| 650 | 650 | } |
| 651 | 651 | if ($resultFetchUser < 0) { |
| 652 | 652 | $_SESSION["dol_loginmesg"] = $user->error; |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | // Call triggers for the "security events" log |
| 658 | - include_once DOL_BASE_PATH . '/core/class/interfaces.class.php'; |
|
| 658 | + include_once DOL_BASE_PATH.'/core/class/interfaces.class.php'; |
|
| 659 | 659 | $interface = new Interfaces($db); |
| 660 | 660 | $result = $interface->run_triggers('USER_LOGIN_FAILED', $user, $user, $langs, $conf); |
| 661 | 661 | if ($result < 0) { |
@@ -666,18 +666,18 @@ discard block |
||
| 666 | 666 | $action = ''; |
| 667 | 667 | $hookmanager->initHooks(array('login')); |
| 668 | 668 | $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]); |
| 669 | - $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 669 | + $reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 670 | 670 | if ($reshook < 0) |
| 671 | 671 | $error++; |
| 672 | 672 | |
| 673 | 673 | $paramsurl = array(); |
| 674 | 674 | if (GETPOST('textbrowser', 'int')) |
| 675 | - $paramsurl[] = 'textbrowser=' . GETPOST('textbrowser', 'int'); |
|
| 675 | + $paramsurl[] = 'textbrowser='.GETPOST('textbrowser', 'int'); |
|
| 676 | 676 | if (GETPOST('nojs', 'int')) |
| 677 | - $paramsurl[] = 'nojs=' . GETPOST('nojs', 'int'); |
|
| 677 | + $paramsurl[] = 'nojs='.GETPOST('nojs', 'int'); |
|
| 678 | 678 | if (GETPOST('lang', 'aZ09')) |
| 679 | - $paramsurl[] = 'lang=' . GETPOST('lang', 'aZ09'); |
|
| 680 | - header('Location: ' . DOL_BASE_URI . '/index.php' . (count($paramsurl) ? '?' . implode('&', $paramsurl) : '')); |
|
| 679 | + $paramsurl[] = 'lang='.GETPOST('lang', 'aZ09'); |
|
| 680 | + header('Location: '.DOL_BASE_URI.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); |
|
| 681 | 681 | exit; |
| 682 | 682 | } |
| 683 | 683 | else { |
@@ -687,29 +687,29 @@ discard block |
||
| 687 | 687 | // Code for search criteria persistence. |
| 688 | 688 | if (!empty($_GET['save_lastsearch_values'])) { // We must use $_GET here |
| 689 | 689 | $relativepathstring = preg_replace('/\?.*$/', '', $_SERVER["HTTP_REFERER"]); |
| 690 | - $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring); // Get full path except host server |
|
| 690 | + $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring); // Get full path except host server |
|
| 691 | 691 | // Clean $relativepathstring |
| 692 | 692 | if (constant('DOL_BASE_URI')) |
| 693 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring); |
|
| 693 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring); |
|
| 694 | 694 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring); |
| 695 | 695 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); |
| 696 | 696 | //var_dump($relativepathstring); |
| 697 | 697 | // 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 |
| 698 | - if (!empty($_SESSION['lastsearch_values_tmp_' . $relativepathstring])) { |
|
| 699 | - $_SESSION['lastsearch_values_' . $relativepathstring] = $_SESSION['lastsearch_values_tmp_' . $relativepathstring]; |
|
| 700 | - unset($_SESSION['lastsearch_values_tmp_' . $relativepathstring]); |
|
| 698 | + if (!empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring])) { |
|
| 699 | + $_SESSION['lastsearch_values_'.$relativepathstring] = $_SESSION['lastsearch_values_tmp_'.$relativepathstring]; |
|
| 700 | + unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]); |
|
| 701 | 701 | } |
| 702 | - if (!empty($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring])) { |
|
| 703 | - $_SESSION['lastsearch_contextpage_' . $relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]; |
|
| 704 | - unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]); |
|
| 702 | + if (!empty($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring])) { |
|
| 703 | + $_SESSION['lastsearch_contextpage_'.$relativepathstring] = $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]; |
|
| 704 | + unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]); |
|
| 705 | 705 | } |
| 706 | - if (!empty($_SESSION['lastsearch_page_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_page_tmp_' . $relativepathstring] > 1) { |
|
| 707 | - $_SESSION['lastsearch_page_' . $relativepathstring] = $_SESSION['lastsearch_page_tmp_' . $relativepathstring]; |
|
| 708 | - unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]); |
|
| 706 | + if (!empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 1) { |
|
| 707 | + $_SESSION['lastsearch_page_'.$relativepathstring] = $_SESSION['lastsearch_page_tmp_'.$relativepathstring]; |
|
| 708 | + unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]); |
|
| 709 | 709 | } |
| 710 | - if (!empty($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]) && $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] != $conf->liste_limit) { |
|
| 711 | - $_SESSION['lastsearch_limit_' . $relativepathstring] = $_SESSION['lastsearch_limit_tmp_' . $relativepathstring]; |
|
| 712 | - unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]); |
|
| 710 | + if (!empty($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] != $conf->liste_limit) { |
|
| 711 | + $_SESSION['lastsearch_limit_'.$relativepathstring] = $_SESSION['lastsearch_limit_tmp_'.$relativepathstring]; |
|
| 712 | + unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]); |
|
| 713 | 713 | } |
| 714 | 714 | } |
| 715 | 715 | |
@@ -752,18 +752,18 @@ discard block |
||
| 752 | 752 | if (!empty($dol_use_jmobile)) |
| 753 | 753 | $_SESSION['dol_use_jmobile'] = $dol_use_jmobile; |
| 754 | 754 | |
| 755 | - dol_syslog("This is a new started user session. _SESSION['dol_login']=" . $_SESSION["dol_login"] . " Session id=" . session_id()); |
|
| 755 | + dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id()); |
|
| 756 | 756 | |
| 757 | 757 | $db->begin(); |
| 758 | 758 | |
| 759 | 759 | $user->update_last_login_date(); |
| 760 | 760 | |
| 761 | - $loginfo = 'TZ=' . $_SESSION["dol_tz"] . ';TZString=' . $_SESSION["dol_tz_string"] . ';Screen=' . $_SESSION["dol_screenwidth"] . 'x' . $_SESSION["dol_screenheight"]; |
|
| 761 | + $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; |
|
| 762 | 762 | |
| 763 | 763 | // Call triggers for the "security events" log |
| 764 | 764 | $user->trigger_mesg = $loginfo; |
| 765 | 765 | // Call triggers |
| 766 | - include_once DOL_BASE_PATH . '/core/class/interfaces.class.php'; |
|
| 766 | + include_once DOL_BASE_PATH.'/core/class/interfaces.class.php'; |
|
| 767 | 767 | $interface = new Interfaces($db); |
| 768 | 768 | $result = $interface->run_triggers('USER_LOGIN', $user, $user, $langs, $conf); |
| 769 | 769 | if ($result < 0) { |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | $action = ''; |
| 775 | 775 | $hookmanager->initHooks(array('login')); |
| 776 | 776 | $parameters = array('dol_authmode' => $dol_authmode, 'dol_loginfo' => $loginfo); |
| 777 | - $reshook = $hookmanager->executeHooks('afterLogin', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 777 | + $reshook = $hookmanager->executeHooks('afterLogin', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks |
|
| 778 | 778 | if ($reshook < 0) |
| 779 | 779 | $error++; |
| 780 | 780 | |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | if (!empty($landingpage)) { // Example: /index.php |
| 793 | 793 | $newpath = dol_buildpath($landingpage, 1); |
| 794 | 794 | if ($_SERVER["PHP_SELF"] != $newpath) { // not already on landing page (avoid infinite loop) |
| 795 | - header('Location: ' . $newpath); |
|
| 795 | + header('Location: '.$newpath); |
|
| 796 | 796 | exit; |
| 797 | 797 | } |
| 798 | 798 | } |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | if (empty($conf->global->MAIN_FORCETHEME) && !empty($user->conf->MAIN_THEME)) { |
| 828 | 828 | $conf->theme = $user->conf->MAIN_THEME; |
| 829 | 829 | // $conf->css = "/theme/" . $conf->theme . "/style.css.php"; |
| 830 | - $conf->css = '?controller=theme/' . $conf->theme . '&method=style.css'; |
|
| 830 | + $conf->css = '?controller=theme/'.$conf->theme.'&method=style.css'; |
|
| 831 | 831 | } |
| 832 | 832 | } |
| 833 | 833 | |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | if (GETPOST('theme', 'alpha')) { |
| 836 | 836 | $conf->theme = GETPOST('theme', 'alpha', 1); |
| 837 | 837 | // $conf->css = "/theme/" . $conf->theme . "/style.css.php"; |
| 838 | - $conf->css = '?controller=theme/' . $conf->theme . '&method=style.css'; |
|
| 838 | + $conf->css = '?controller=theme/'.$conf->theme.'&method=style.css'; |
|
| 839 | 839 | } |
| 840 | 840 | |
| 841 | 841 | |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | if (!empty($conf->dol_use_jmobile) && in_array($conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) { |
| 878 | 878 | $conf->theme = 'eldy'; |
| 879 | 879 | // $conf->css = "/theme/" . $conf->theme . "/style.css.php"; |
| 880 | - $conf->css = '?controller=theme/' . $conf->theme . '&method=style.css'; |
|
| 880 | + $conf->css = '?controller=theme/'.$conf->theme.'&method=style.css'; |
|
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | if (!defined('NOREQUIRETRAN')) { |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | |
| 916 | -dol_syslog("--- Access to " . $_SERVER["PHP_SELF"] . ' - action=' . GETPOST('action', 'az09') . ', massaction=' . GETPOST('massaction', 'az09')); |
|
| 916 | +dol_syslog("--- Access to ".$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'az09').', massaction='.GETPOST('massaction', 'az09')); |
|
| 917 | 917 | //Another call for easy debugg |
| 918 | 918 | //dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST)); |
| 919 | 919 | // Load main languages files |
@@ -925,7 +925,7 @@ discard block |
||
| 925 | 925 | // Define some constants used for style of arrays |
| 926 | 926 | $bc = array(0 => 'class="impair"', 1 => 'class="pair"'); |
| 927 | 927 | $bcdd = array(0 => 'class="drag drop oddeven"', 1 => 'class="drag drop oddeven"'); |
| 928 | -$bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines |
|
| 928 | +$bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines |
|
| 929 | 929 | $bctag = array(0 => 'class="impair tagtr"', 1 => 'class="pair tagtr"'); |
| 930 | 930 | |
| 931 | 931 | // Define messages variables |
@@ -973,19 +973,19 @@ discard block |
||
| 973 | 973 | // Load the menu manager (only if not already done) |
| 974 | 974 | $file_menu = $conf->standard_menu; |
| 975 | 975 | if (GETPOST('menu', 'alpha')) |
| 976 | - $file_menu = GETPOST('menu', 'alpha'); // example: menu=eldy_menu.php |
|
| 976 | + $file_menu = GETPOST('menu', 'alpha'); // example: menu=eldy_menu.php |
|
| 977 | 977 | if (!class_exists('MenuManager')) { |
| 978 | 978 | $menufound = 0; |
| 979 | 979 | $dirmenus = array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); |
| 980 | 980 | foreach ($dirmenus as $dirmenu) { |
| 981 | - $menufound = dol_include_once($dirmenu . "standard/" . $file_menu); |
|
| 981 | + $menufound = dol_include_once($dirmenu."standard/".$file_menu); |
|
| 982 | 982 | if (class_exists('MenuManager')) |
| 983 | 983 | break; |
| 984 | 984 | } |
| 985 | 985 | if (!class_exists('MenuManager')) { // If failed to include, we try with standard eldy_menu.php |
| 986 | - dol_syslog("You define a menu manager '" . $file_menu . "' that can not be loaded.", LOG_WARNING); |
|
| 986 | + dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING); |
|
| 987 | 987 | $file_menu = 'eldy_menu.php'; |
| 988 | - include_once DOL_DOCUMENT_ROOT . "/core/menus/standard/" . $file_menu; |
|
| 988 | + include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu; |
|
| 989 | 989 | } |
| 990 | 990 | } |
| 991 | 991 | $menumanager = new MenuManager($db, empty($user->societe_id) ? 0 : 1); |
@@ -1023,7 +1023,7 @@ discard block |
||
| 1023 | 1023 | // html header |
| 1024 | 1024 | top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); |
| 1025 | 1025 | |
| 1026 | - print '<body id="mainbody"' . ($morecssonbody ? ' class="' . $morecssonbody . '"' : '') . '>' . "\n"; |
|
| 1026 | + print '<body id="mainbody"'.($morecssonbody ? ' class="'.$morecssonbody.'"' : '').'>'."\n"; |
|
| 1027 | 1027 | |
| 1028 | 1028 | // top menu and left menu area |
| 1029 | 1029 | if (empty($conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) { |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | if (empty($conf->dol_hide_leftmenu)) { |
| 1034 | - left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function |
|
| 1034 | + left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function |
|
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | // main area |
@@ -1055,12 +1055,12 @@ discard block |
||
| 1055 | 1055 | global $db, $conf, $hookmanager; |
| 1056 | 1056 | |
| 1057 | 1057 | if ($contenttype == 'text/html') |
| 1058 | - header("Content-Type: text/html; charset=" . $conf->file->character_set_client); |
|
| 1058 | + header("Content-Type: text/html; charset=".$conf->file->character_set_client); |
|
| 1059 | 1059 | else |
| 1060 | - header("Content-Type: " . $contenttype); |
|
| 1060 | + header("Content-Type: ".$contenttype); |
|
| 1061 | 1061 | // Security options |
| 1062 | - 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) |
|
| 1063 | - header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) |
|
| 1062 | + 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) |
|
| 1063 | + header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) |
|
| 1064 | 1064 | //header("X-XSS-Protection: 1"); // XSS protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. |
| 1065 | 1065 | if (!defined('FORCECSP')) { |
| 1066 | 1066 | //if (! isset($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY)) |
@@ -1076,11 +1076,11 @@ discard block |
||
| 1076 | 1076 | $hookmanager->initHooks("main"); |
| 1077 | 1077 | |
| 1078 | 1078 | $parameters = array('contentsecuritypolicy' => $contentsecuritypolicy); |
| 1079 | - $result = $hookmanager->executeHooks('setContentSecurityPolicy', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1079 | + $result = $hookmanager->executeHooks('setContentSecurityPolicy', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1080 | 1080 | if ($result > 0) |
| 1081 | 1081 | $contentsecuritypolicy = $hookmanager->resPrint; // Replace CSP |
| 1082 | 1082 | else |
| 1083 | - $contentsecuritypolicy .= $hookmanager->resPrint; // Concat CSP |
|
| 1083 | + $contentsecuritypolicy .= $hookmanager->resPrint; // Concat CSP |
|
| 1084 | 1084 | |
| 1085 | 1085 | if (!empty($contentsecuritypolicy)) { |
| 1086 | 1086 | // For example, to restrict 'script', 'object', 'frames' or 'img' to some domains: |
@@ -1091,10 +1091,10 @@ discard block |
||
| 1091 | 1091 | // default-src 'self'; img-src *; |
| 1092 | 1092 | // Pre-existing site that uses too much inline code to fix but wants to ensure resources are loaded only over https and disable plugins: |
| 1093 | 1093 | // default-src http: https: 'unsafe-eval' 'unsafe-inline'; object-src 'none' |
| 1094 | - header("Content-Security-Policy: " . $contentsecuritypolicy); |
|
| 1094 | + header("Content-Security-Policy: ".$contentsecuritypolicy); |
|
| 1095 | 1095 | } |
| 1096 | 1096 | } elseif (constant('FORCECSP')) { |
| 1097 | - header("Content-Security-Policy: " . constant('FORCECSP')); |
|
| 1097 | + header("Content-Security-Policy: ".constant('FORCECSP')); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | if ($forcenocache) { |
| 1100 | 1100 | header("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"); |
@@ -1125,33 +1125,33 @@ discard block |
||
| 1125 | 1125 | // $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default |
| 1126 | 1126 | $conf->css = '?controller=theme/eldy&method=style.css'; |
| 1127 | 1127 | } |
| 1128 | - print '<!doctype html>' . "\n"; |
|
| 1128 | + print '<!doctype html>'."\n"; |
|
| 1129 | 1129 | |
| 1130 | 1130 | if (!empty($conf->global->MAIN_USE_CACHE_MANIFEST)) |
| 1131 | - print '<html lang="' . substr($langs->defaultlang, 0, 2) . '" manifest="' . DOL_BASE_URI . '/cache.manifest">' . "\n"; |
|
| 1131 | + print '<html lang="'.substr($langs->defaultlang, 0, 2).'" manifest="'.DOL_BASE_URI.'/cache.manifest">'."\n"; |
|
| 1132 | 1132 | else |
| 1133 | - print '<html lang="' . substr($langs->defaultlang, 0, 2) . '">' . "\n"; |
|
| 1133 | + print '<html lang="'.substr($langs->defaultlang, 0, 2).'">'."\n"; |
|
| 1134 | 1134 | //print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n"; |
| 1135 | 1135 | if (empty($disablehead)) { |
| 1136 | - $ext = 'layout=' . $conf->browser->layout . '&version=' . urlencode(DOL_VERSION); |
|
| 1136 | + $ext = 'layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION); |
|
| 1137 | 1137 | |
| 1138 | 1138 | print "<head>\n"; |
| 1139 | 1139 | |
| 1140 | 1140 | if (GETPOST('dol_basehref', 'alpha')) |
| 1141 | - print '<base href="' . dol_escape_htmltag(GETPOST('dol_basehref', 'alpha')) . '">' . "\n"; |
|
| 1141 | + print '<base href="'.dol_escape_htmltag(GETPOST('dol_basehref', 'alpha')).'">'."\n"; |
|
| 1142 | 1142 | |
| 1143 | 1143 | // Displays meta |
| 1144 | - print '<meta charset="UTF-8">' . "\n"; |
|
| 1145 | - print '<meta name="robots" content="noindex' . ($disablenofollow ? '' : ',nofollow') . '">' . "\n"; // Do not index |
|
| 1146 | - print '<meta name="viewport" content="width=device-width, initial-scale=1.0">' . "\n"; // Scale for mobile device |
|
| 1147 | - print '<meta name="author" content="Dolibarr Development Team">' . "\n"; |
|
| 1144 | + print '<meta charset="UTF-8">'."\n"; |
|
| 1145 | + print '<meta name="robots" content="noindex'.($disablenofollow ? '' : ',nofollow').'">'."\n"; // Do not index |
|
| 1146 | + print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n"; // Scale for mobile device |
|
| 1147 | + print '<meta name="author" content="Dolibarr Development Team">'."\n"; |
|
| 1148 | 1148 | |
| 1149 | 1149 | // Favicon |
| 1150 | - $favicon = dol_buildpath('/theme/' . $conf->theme . '/img/favicon.ico', 1); |
|
| 1150 | + $favicon = dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1); |
|
| 1151 | 1151 | if (!empty($conf->global->MAIN_FAVICON_URL)) |
| 1152 | 1152 | $favicon = $conf->global->MAIN_FAVICON_URL; |
| 1153 | 1153 | if (empty($conf->dol_use_jmobile)) |
| 1154 | - print '<link rel="shortcut icon" type="image/x-icon" href="' . $favicon . '"/>' . "\n"; // Not required into an Android webview |
|
| 1154 | + print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview |
|
| 1155 | 1155 | |
| 1156 | 1156 | |
| 1157 | 1157 | |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n"; |
| 1163 | 1163 | // Auto refresh page |
| 1164 | 1164 | if (GETPOST('autorefresh', 'int') > 0) |
| 1165 | - print '<meta http-equiv="refresh" content="' . GETPOST('autorefresh', 'int') . '">'; |
|
| 1165 | + print '<meta http-equiv="refresh" content="'.GETPOST('autorefresh', 'int').'">'; |
|
| 1166 | 1166 | |
| 1167 | 1167 | // Displays title |
| 1168 | 1168 | $appli = constant('DOL_APPLICATION_TITLE'); |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | if ($title && !empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/', $conf->global->MAIN_HTML_TITLE)) |
| 1175 | 1175 | $titletoshow = dol_htmlentities($title); |
| 1176 | 1176 | else if ($title) |
| 1177 | - $titletoshow = dol_htmlentities($appli . ' - ' . $title); |
|
| 1177 | + $titletoshow = dol_htmlentities($appli.' - '.$title); |
|
| 1178 | 1178 | else |
| 1179 | 1179 | $titletoshow = dol_htmlentities($appli); |
| 1180 | 1180 | |
@@ -1182,11 +1182,11 @@ discard block |
||
| 1182 | 1182 | $hookmanager = new HookManager($db); |
| 1183 | 1183 | $hookmanager->initHooks("main"); |
| 1184 | 1184 | $parameters = array('title' => $titletoshow); |
| 1185 | - $result = $hookmanager->executeHooks('setHtmlTitle', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1185 | + $result = $hookmanager->executeHooks('setHtmlTitle', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1186 | 1186 | if ($result > 0) |
| 1187 | - $titletoshow = $hookmanager->resPrint; // Replace Title to show |
|
| 1187 | + $titletoshow = $hookmanager->resPrint; // Replace Title to show |
|
| 1188 | 1188 | else |
| 1189 | - $titletoshow .= $hookmanager->resPrint; // Concat to Title to show |
|
| 1189 | + $titletoshow .= $hookmanager->resPrint; // Concat to Title to show |
|
| 1190 | 1190 | |
| 1191 | 1191 | print $titletoshow; |
| 1192 | 1192 | print '</title>'; |
@@ -1194,61 +1194,61 @@ discard block |
||
| 1194 | 1194 | print "\n"; |
| 1195 | 1195 | |
| 1196 | 1196 | if (GETPOST('version', 'int')) |
| 1197 | - $ext = 'version=' . GETPOST('version', 'int'); // usefull to force no cache on css/js |
|
| 1197 | + $ext = 'version='.GETPOST('version', 'int'); // usefull to force no cache on css/js |
|
| 1198 | 1198 | if (GETPOST('testmenuhider', 'int') || !empty($conf->global->MAIN_TESTMENUHIDER)) |
| 1199 | - $ext .= '&testmenuhider=' . (GETPOST('testmenuhider', 'int') ? GETPOST('testmenuhider', 'int') : $conf->global->MAIN_TESTMENUHIDER); |
|
| 1199 | + $ext .= '&testmenuhider='.(GETPOST('testmenuhider', 'int') ? GETPOST('testmenuhider', 'int') : $conf->global->MAIN_TESTMENUHIDER); |
|
| 1200 | 1200 | |
| 1201 | - $themeparam = '&lang=' . $langs->defaultlang . '&theme=' . $conf->theme . (GETPOST('optioncss', 'aZ09') ? '&optioncss=' . GETPOST('optioncss', 'aZ09', 1) : '') . '&userid=' . $user->id . '&entity=' . $conf->entity; |
|
| 1202 | - $themeparam .= ($ext ? '&' . $ext : ''); |
|
| 1201 | + $themeparam = '&lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&userid='.$user->id.'&entity='.$conf->entity; |
|
| 1202 | + $themeparam .= ($ext ? '&'.$ext : ''); |
|
| 1203 | 1203 | if (!empty($_SESSION['dol_resetcache'])) |
| 1204 | - $themeparam .= '&dol_resetcache=' . $_SESSION['dol_resetcache']; |
|
| 1204 | + $themeparam .= '&dol_resetcache='.$_SESSION['dol_resetcache']; |
|
| 1205 | 1205 | if (GETPOST('dol_hide_topmenu', 'int')) { |
| 1206 | - $themeparam .= '&dol_hide_topmenu=' . GETPOST('dol_hide_topmenu', 'int'); |
|
| 1206 | + $themeparam .= '&dol_hide_topmenu='.GETPOST('dol_hide_topmenu', 'int'); |
|
| 1207 | 1207 | } |
| 1208 | 1208 | if (GETPOST('dol_hide_leftmenu', 'int')) { |
| 1209 | - $themeparam .= '&dol_hide_leftmenu=' . GETPOST('dol_hide_leftmenu', 'int'); |
|
| 1209 | + $themeparam .= '&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu', 'int'); |
|
| 1210 | 1210 | } |
| 1211 | 1211 | if (GETPOST('dol_optimize_smallscreen', 'int')) { |
| 1212 | - $themeparam .= '&dol_optimize_smallscreen=' . GETPOST('dol_optimize_smallscreen', 'int'); |
|
| 1212 | + $themeparam .= '&dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen', 'int'); |
|
| 1213 | 1213 | } |
| 1214 | 1214 | if (GETPOST('dol_no_mouse_hover', 'int')) { |
| 1215 | - $themeparam .= '&dol_no_mouse_hover=' . GETPOST('dol_no_mouse_hover', 'int'); |
|
| 1215 | + $themeparam .= '&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover', 'int'); |
|
| 1216 | 1216 | } |
| 1217 | 1217 | if (GETPOST('dol_use_jmobile', 'int')) { |
| 1218 | - $themeparam .= '&dol_use_jmobile=' . GETPOST('dol_use_jmobile', 'int'); |
|
| 1218 | + $themeparam .= '&dol_use_jmobile='.GETPOST('dol_use_jmobile', 'int'); |
|
| 1219 | 1219 | $conf->dol_use_jmobile = GETPOST('dol_use_jmobile', 'int'); |
| 1220 | 1220 | } |
| 1221 | 1221 | |
| 1222 | 1222 | if (!defined('DISABLE_JQUERY') && !$disablejs && $conf->use_javascript_ajax) { |
| 1223 | - print '<!-- Includes CSS for JQuery (Ajax library) -->' . "\n"; |
|
| 1223 | + print '<!-- Includes CSS for JQuery (Ajax library) -->'."\n"; |
|
| 1224 | 1224 | $jquerytheme = 'base'; |
| 1225 | 1225 | if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) |
| 1226 | 1226 | $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; |
| 1227 | 1227 | if (constant('JS_JQUERY_UI')) |
| 1228 | - print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JQuery |
|
| 1228 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery |
|
| 1229 | 1229 | else |
| 1230 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JQuery |
|
| 1230 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery |
|
| 1231 | 1231 | if (!defined('DISABLE_JQUERY_JNOTIFY')) |
| 1232 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JNotify |
|
| 1232 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // JNotify |
|
| 1233 | 1233 | if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) { // jQuery plugin "mutiselect", "multiple-select", "select2"... |
| 1234 | 1234 | $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 1235 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/includes/jquery/plugins/' . $tmpplugin . '/dist/css/' . $tmpplugin . '.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; |
|
| 1235 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css'.($ext ? '?'.$ext : '').'">'."\n"; |
|
| 1236 | 1236 | } |
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | 1239 | if (!defined('DISABLE_FONT_AWSOME')) { |
| 1240 | - print '<!-- Includes CSS for font awesome -->' . "\n"; |
|
| 1241 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_BASE_URI . '/theme/common/fontawesome/css/font-awesome.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; |
|
| 1240 | + print '<!-- Includes CSS for font awesome -->'."\n"; |
|
| 1241 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_BASE_URI.'/theme/common/fontawesome/css/font-awesome.min.css'.($ext ? '?'.$ext : '').'">'."\n"; |
|
| 1242 | 1242 | } |
| 1243 | 1243 | |
| 1244 | - print '<!-- Includes CSS for Dolibarr theme -->' . "\n"; |
|
| 1244 | + print '<!-- Includes CSS for Dolibarr theme -->'."\n"; |
|
| 1245 | 1245 | // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' |
| 1246 | 1246 | $themepath = dol_buildpath($conf->css, 3); |
| 1247 | 1247 | $themesubdir = ''; |
| 1248 | 1248 | if (!empty($conf->modules_parts['theme'])) { // This slow down |
| 1249 | 1249 | foreach ($conf->modules_parts['theme'] as $reldir) { |
| 1250 | - if (file_exists(dol_buildpath($reldir . $conf->css, 0))) { |
|
| 1251 | - $themepath = dol_buildpath($reldir . $conf->css, 1); |
|
| 1250 | + if (file_exists(dol_buildpath($reldir.$conf->css, 0))) { |
|
| 1251 | + $themepath = dol_buildpath($reldir.$conf->css, 1); |
|
| 1252 | 1252 | $themesubdir = $reldir; |
| 1253 | 1253 | break; |
| 1254 | 1254 | } |
@@ -1256,9 +1256,9 @@ discard block |
||
| 1256 | 1256 | } |
| 1257 | 1257 | |
| 1258 | 1258 | //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; |
| 1259 | - print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; |
|
| 1259 | + print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n"; |
|
| 1260 | 1260 | if (!empty($conf->global->MAIN_FIX_FLASH_ON_CHROME)) |
| 1261 | - 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"; |
|
| 1261 | + 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"; |
|
| 1262 | 1262 | |
| 1263 | 1263 | // CSS forced by modules (relative url starting with /) |
| 1264 | 1264 | if (!empty($conf->modules_parts['css'])) { |
@@ -1267,112 +1267,112 @@ discard block |
||
| 1267 | 1267 | $filescss = (array) $filescss; // To be sure filecss is an array |
| 1268 | 1268 | foreach ($filescss as $cssfile) { |
| 1269 | 1269 | if (empty($cssfile)) |
| 1270 | - dol_syslog("Warning: module " . $modcss . " declared a css path file into its descriptor that is empty.", LOG_WARNING); |
|
| 1270 | + dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); |
|
| 1271 | 1271 | // cssfile is a relative path |
| 1272 | - print '<!-- Includes CSS added by module ' . $modcss . ' -->' . "\n" . '<link rel="stylesheet" type="text/css" href="' . dol_buildpath($cssfile, 1); |
|
| 1272 | + print '<!-- Includes CSS added by module '.$modcss.' -->'."\n".'<link rel="stylesheet" type="text/css" href="'.dol_buildpath($cssfile, 1); |
|
| 1273 | 1273 | // 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. |
| 1274 | 1274 | if (!preg_match('/\.css$/i', $cssfile)) |
| 1275 | 1275 | print $themeparam; |
| 1276 | - print '">' . "\n"; |
|
| 1276 | + print '">'."\n"; |
|
| 1277 | 1277 | } |
| 1278 | 1278 | } |
| 1279 | 1279 | } |
| 1280 | 1280 | // CSS forced by page in top_htmlhead call (relative url starting with /) |
| 1281 | 1281 | if (is_array($arrayofcss)) { |
| 1282 | 1282 | foreach ($arrayofcss as $cssfile) { |
| 1283 | - print '<!-- Includes CSS added by page -->' . "\n" . '<link rel="stylesheet" type="text/css" title="default" href="' . dol_buildpath($cssfile, 1); |
|
| 1283 | + print '<!-- Includes CSS added by page -->'."\n".'<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile, 1); |
|
| 1284 | 1284 | // 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. |
| 1285 | 1285 | if (!preg_match('/\.css$/i', $cssfile)) |
| 1286 | 1286 | print $themeparam; |
| 1287 | - print '">' . "\n"; |
|
| 1287 | + print '">'."\n"; |
|
| 1288 | 1288 | } |
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | // Output standard javascript links |
| 1292 | 1292 | if (!defined('DISABLE_JQUERY') && !$disablejs && !empty($conf->use_javascript_ajax)) { |
| 1293 | 1293 | // JQuery. Must be before other includes |
| 1294 | - print '<!-- Includes JS for JQuery -->' . "\n"; |
|
| 1294 | + print '<!-- Includes JS for JQuery -->'."\n"; |
|
| 1295 | 1295 | if (defined('JS_JQUERY') && constant('JS_JQUERY')) |
| 1296 | - print '<script type="text/javascript" src="' . JS_JQUERY . 'jquery.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1296 | + print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1297 | 1297 | else |
| 1298 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1298 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/js/jquery.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1299 | 1299 | if (!empty($conf->global->MAIN_FEATURES_LEVEL) && !defined('JS_JQUERY_MIGRATE_DISABLED')) { |
| 1300 | 1300 | if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) |
| 1301 | - print '<script type="text/javascript" src="' . JS_JQUERY_MIGRATE . 'jquery-migrate.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1301 | + print '<script type="text/javascript" src="'.JS_JQUERY_MIGRATE.'jquery-migrate.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1302 | 1302 | else |
| 1303 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery-migrate.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1303 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/js/jquery-migrate.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1304 | 1304 | } |
| 1305 | 1305 | if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) |
| 1306 | - print '<script type="text/javascript" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1306 | + print '<script type="text/javascript" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1307 | 1307 | else |
| 1308 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1308 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1309 | 1309 | if (!defined('DISABLE_JQUERY_TABLEDND')) |
| 1310 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/tablednd/jquery.tablednd.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1310 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1311 | 1311 | // jQuery jnotify |
| 1312 | 1312 | if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) { |
| 1313 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jnotify/jquery.jnotify.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1313 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1314 | 1314 | } |
| 1315 | 1315 | // Flot |
| 1316 | 1316 | if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT')) { |
| 1317 | 1317 | if (constant('JS_JQUERY_FLOT')) { |
| 1318 | - print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1319 | - print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.pie.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1320 | - print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.stack.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1318 | + print '<script type="text/javascript" src="'.JS_JQUERY_FLOT.'jquery.flot.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1319 | + print '<script type="text/javascript" src="'.JS_JQUERY_FLOT.'jquery.flot.pie.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1320 | + print '<script type="text/javascript" src="'.JS_JQUERY_FLOT.'jquery.flot.stack.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1321 | 1321 | } else { |
| 1322 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/flot/jquery.flot.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1323 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/flot/jquery.flot.pie.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1324 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/flot/jquery.flot.stack.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1322 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/flot/jquery.flot.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1323 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/flot/jquery.flot.pie.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1324 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/flot/jquery.flot.stack.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1325 | 1325 | } |
| 1326 | 1326 | } |
| 1327 | 1327 | // jQuery jeditable |
| 1328 | 1328 | if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE')) { |
| 1329 | - print '<!-- JS to manage editInPlace feature -->' . "\n"; |
|
| 1330 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1331 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1332 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1333 | - print '<script type="text/javascript">' . "\n"; |
|
| 1334 | - print 'var urlSaveInPlace = \'' . DOL_BASE_URI . '/core/ajax/saveinplace.php\';' . "\n"; |
|
| 1335 | - print 'var urlLoadInPlace = \'' . DOL_BASE_URI . '/core/ajax/loadinplace.php\';' . "\n"; |
|
| 1336 | - print 'var tooltipInPlace = \'' . $langs->transnoentities('ClickToEdit') . '\';' . "\n"; // Added in title attribute of span |
|
| 1337 | - print 'var placeholderInPlace = \' \';' . "\n"; // If we put another string than $langs->trans("ClickToEdit") here, nothing is shown. If we put empty string, there is error, Why ? |
|
| 1338 | - print 'var cancelInPlace = \'' . $langs->trans('Cancel') . '\';' . "\n"; |
|
| 1339 | - print 'var submitInPlace = \'' . $langs->trans('Ok') . '\';' . "\n"; |
|
| 1340 | - print 'var indicatorInPlace = \'<img src="' . DOL_BASE_URI . "/theme/" . $conf->theme . "/img/working.gif" . '">\';' . "\n"; |
|
| 1341 | - print 'var withInPlace = 300;'; // width in pixel for default string edit |
|
| 1342 | - print '</script>' . "\n"; |
|
| 1343 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/core/js/editinplace.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1344 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1329 | + print '<!-- JS to manage editInPlace feature -->'."\n"; |
|
| 1330 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1331 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1332 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1333 | + print '<script type="text/javascript">'."\n"; |
|
| 1334 | + print 'var urlSaveInPlace = \''.DOL_BASE_URI.'/core/ajax/saveinplace.php\';'."\n"; |
|
| 1335 | + print 'var urlLoadInPlace = \''.DOL_BASE_URI.'/core/ajax/loadinplace.php\';'."\n"; |
|
| 1336 | + print 'var tooltipInPlace = \''.$langs->transnoentities('ClickToEdit').'\';'."\n"; // Added in title attribute of span |
|
| 1337 | + print 'var placeholderInPlace = \' \';'."\n"; // If we put another string than $langs->trans("ClickToEdit") here, nothing is shown. If we put empty string, there is error, Why ? |
|
| 1338 | + print 'var cancelInPlace = \''.$langs->trans('Cancel').'\';'."\n"; |
|
| 1339 | + print 'var submitInPlace = \''.$langs->trans('Ok').'\';'."\n"; |
|
| 1340 | + print 'var indicatorInPlace = \'<img src="'.DOL_BASE_URI."/theme/".$conf->theme."/img/working.gif".'">\';'."\n"; |
|
| 1341 | + print 'var withInPlace = 300;'; // width in pixel for default string edit |
|
| 1342 | + print '</script>'."\n"; |
|
| 1343 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/core/js/editinplace.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1344 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1345 | 1345 | } |
| 1346 | 1346 | // jQuery Timepicker |
| 1347 | 1347 | if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { |
| 1348 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1349 | - print '<script type="text/javascript" src="' . BASE_PATH . '?controller=core/js/&method=timepicker.js&lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
| 1348 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1349 | + print '<script type="text/javascript" src="'.BASE_PATH.'?controller=core/js/&method=timepicker.js&lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
| 1350 | 1350 | } |
| 1351 | 1351 | if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) { // jQuery plugin "mutiselect", "multiple-select", "select2", ... |
| 1352 | 1352 | $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 1353 | - 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 |
|
| 1353 | + 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 |
|
| 1354 | 1354 | } |
| 1355 | 1355 | if (!defined('DISABLE_MULTISELECT')) { // jQuery plugin "mutiselect" to select with checkboxes |
| 1356 | - print '<script type="text/javascript" src="' . DOL_BASE_URI . '/includes/jquery/plugins/multiselect/jquery.multi-select.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1356 | + print '<script type="text/javascript" src="'.DOL_BASE_URI.'/includes/jquery/plugins/multiselect/jquery.multi-select.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1357 | 1357 | } |
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | 1360 | if (!$disablejs && !empty($conf->use_javascript_ajax)) { |
| 1361 | 1361 | // CKEditor |
| 1362 | 1362 | if (!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) { |
| 1363 | - print '<!-- Includes JS for CKEditor -->' . "\n"; |
|
| 1364 | - $pathckeditor = DOL_BASE_URI . '/includes/ckeditor/ckeditor/'; |
|
| 1363 | + print '<!-- Includes JS for CKEditor -->'."\n"; |
|
| 1364 | + $pathckeditor = DOL_BASE_URI.'/includes/ckeditor/ckeditor/'; |
|
| 1365 | 1365 | $jsckeditor = 'ckeditor.js'; |
| 1366 | 1366 | if (constant('JS_CKEDITOR')) { // To use external ckeditor 4 js lib |
| 1367 | 1367 | $pathckeditor = constant('JS_CKEDITOR'); |
| 1368 | 1368 | } |
| 1369 | 1369 | print '<script type="text/javascript">'; |
| 1370 | - print 'var CKEDITOR_BASEPATH = \'' . $pathckeditor . '\';' . "\n"; |
|
| 1371 | - print 'var ckeditorConfig = \'' . dol_buildpath($themesubdir . '/theme/' . $conf->theme . '/ckeditor/config.js' . ($ext ? '?' . $ext : ''), 1) . '\';' . "\n"; // $themesubdir='' in standard usage |
|
| 1372 | - print 'var ckeditorFilebrowserBrowseUrl = \'' . DOL_BASE_URI . '/core/filemanagerdol/browser/default/browser.php?Connector=' . DOL_BASE_URI . '/core/filemanagerdol/connectors/php/connector.php\';' . "\n"; |
|
| 1373 | - 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"; |
|
| 1374 | - print '</script>' . "\n"; |
|
| 1375 | - print '<script type="text/javascript" src="' . $pathckeditor . $jsckeditor . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1370 | + print 'var CKEDITOR_BASEPATH = \''.$pathckeditor.'\';'."\n"; |
|
| 1371 | + print 'var ckeditorConfig = \''.dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js'.($ext ? '?'.$ext : ''), 1).'\';'."\n"; // $themesubdir='' in standard usage |
|
| 1372 | + print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_BASE_URI.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_BASE_URI.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; |
|
| 1373 | + 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"; |
|
| 1374 | + print '</script>'."\n"; |
|
| 1375 | + print '<script type="text/javascript" src="'.$pathckeditor.$jsckeditor.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | // Browser notifications |
@@ -1383,16 +1383,16 @@ discard block |
||
| 1383 | 1383 | if ($conf->browser->layout == 'phone') |
| 1384 | 1384 | $enablebrowsernotif = false; |
| 1385 | 1385 | if ($enablebrowsernotif) { |
| 1386 | - print '<!-- Includes JS of Dolibarr (brwoser layout = ' . $conf->browser->layout . ')-->' . "\n"; |
|
| 1386 | + print '<!-- Includes JS of Dolibarr (brwoser layout = '.$conf->browser->layout.')-->'."\n"; |
|
| 1387 | 1387 | //print '<script type="text/javascript" src="' . DOL_BASE_URI . '/core/js/lib_notification.js.php' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
| 1388 | - print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_notification.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1388 | + print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_notification.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1389 | 1389 | } |
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | // Global js function |
| 1393 | - print '<!-- Includes JS of Dolibarr -->' . "\n"; |
|
| 1393 | + print '<!-- Includes JS of Dolibarr -->'."\n"; |
|
| 1394 | 1394 | //print '<script type="text/javascript" src="' . DOL_BASE_URI . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
| 1395 | - print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_head.js&lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
| 1395 | + print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_head.js&lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
| 1396 | 1396 | |
| 1397 | 1397 | // JS forced by modules (relative url starting with /) |
| 1398 | 1398 | if (!empty($conf->modules_parts['js'])) { // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) |
@@ -1401,27 +1401,27 @@ discard block |
||
| 1401 | 1401 | $filesjs = (array) $filesjs; // To be sure filejs is an array |
| 1402 | 1402 | foreach ($filesjs as $jsfile) { |
| 1403 | 1403 | // jsfile is a relative path |
| 1404 | - print '<!-- Include JS added by module ' . $modjs . '-->' . "\n" . '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n"; |
|
| 1404 | + print '<!-- Include JS added by module '.$modjs.'-->'."\n".'<script type="text/javascript" src="'.dol_buildpath($jsfile, 1).'"></script>'."\n"; |
|
| 1405 | 1405 | } |
| 1406 | 1406 | } |
| 1407 | 1407 | } |
| 1408 | 1408 | // JS forced by page in top_htmlhead (relative url starting with /) |
| 1409 | 1409 | if (is_array($arrayofjs)) { |
| 1410 | - print '<!-- Includes JS added by page -->' . "\n"; |
|
| 1410 | + print '<!-- Includes JS added by page -->'."\n"; |
|
| 1411 | 1411 | foreach ($arrayofjs as $jsfile) { |
| 1412 | 1412 | if (preg_match('/^http/i', $jsfile)) { |
| 1413 | - print '<script type="text/javascript" src="' . $jsfile . '"></script>' . "\n"; |
|
| 1413 | + print '<script type="text/javascript" src="'.$jsfile.'"></script>'."\n"; |
|
| 1414 | 1414 | } else { |
| 1415 | - print '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n"; |
|
| 1415 | + print '<script type="text/javascript" src="'.dol_buildpath($jsfile, 1).'"></script>'."\n"; |
|
| 1416 | 1416 | } |
| 1417 | 1417 | } |
| 1418 | 1418 | } |
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | if (!empty($head)) |
| 1422 | - print $head . "\n"; |
|
| 1422 | + print $head."\n"; |
|
| 1423 | 1423 | if (!empty($conf->global->MAIN_HTML_HEADER)) |
| 1424 | - print $conf->global->MAIN_HTML_HEADER . "\n"; |
|
| 1424 | + print $conf->global->MAIN_HTML_HEADER."\n"; |
|
| 1425 | 1425 | |
| 1426 | 1426 | print "<!-- Alixar debugBar header -->"; |
| 1427 | 1427 | print Debug::getRenderHeader(); // Includes Alixar debugBar header |
@@ -1472,13 +1472,13 @@ discard block |
||
| 1472 | 1472 | * Top menu |
| 1473 | 1473 | */ |
| 1474 | 1474 | if ((empty($conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) && (!defined('NOREQUIREMENU') || !constant('NOREQUIREMENU'))) { |
| 1475 | - print "\n" . '<!-- Start top horizontal -->' . "\n"; |
|
| 1475 | + print "\n".'<!-- Start top horizontal -->'."\n"; |
|
| 1476 | 1476 | |
| 1477 | - 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. |
|
| 1477 | + 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. |
|
| 1478 | 1478 | // Show menu entries |
| 1479 | - print '<div id="tmenu_tooltip' . (empty($conf->global->MAIN_MENU_INVERT) ? '' : 'invert') . '" class="tmenu">' . "\n"; |
|
| 1479 | + print '<div id="tmenu_tooltip'.(empty($conf->global->MAIN_MENU_INVERT) ? '' : 'invert').'" class="tmenu">'."\n"; |
|
| 1480 | 1480 | $menumanager->atarget = $target; |
| 1481 | - $menumanager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks)); // This contains a \n |
|
| 1481 | + $menumanager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks)); // This contains a \n |
|
| 1482 | 1482 | print "</div>\n"; |
| 1483 | 1483 | |
| 1484 | 1484 | // Define link to login card |
@@ -1486,34 +1486,34 @@ discard block |
||
| 1486 | 1486 | if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { |
| 1487 | 1487 | $appli = $conf->global->MAIN_APPLICATION_TITLE; |
| 1488 | 1488 | if (preg_match('/\d\.\d/', $appli)) { |
| 1489 | - if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli)) |
|
| 1490 | - $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core |
|
| 1489 | + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) |
|
| 1490 | + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core |
|
| 1491 | 1491 | } else |
| 1492 | - $appli .= " " . DOL_VERSION; |
|
| 1492 | + $appli .= " ".DOL_VERSION; |
|
| 1493 | 1493 | } else |
| 1494 | - $appli .= " " . DOL_VERSION; |
|
| 1494 | + $appli .= " ".DOL_VERSION; |
|
| 1495 | 1495 | |
| 1496 | 1496 | if (!empty($conf->global->MAIN_FEATURES_LEVEL)) |
| 1497 | - $appli .= "<br>" . $langs->trans("LevelOfFeature") . ': ' . $conf->global->MAIN_FEATURES_LEVEL; |
|
| 1497 | + $appli .= "<br>".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL; |
|
| 1498 | 1498 | |
| 1499 | 1499 | $logouttext = ''; |
| 1500 | 1500 | if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { |
| 1501 | 1501 | //$logouthtmltext=$appli.'<br>'; |
| 1502 | 1502 | if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { |
| 1503 | - $logouthtmltext .= $langs->trans("Logout") . '<br>'; |
|
| 1503 | + $logouthtmltext .= $langs->trans("Logout").'<br>'; |
|
| 1504 | 1504 | |
| 1505 | 1505 | //$logouttext .='<a accesskey="l" href="'.DOL_BASE_URI.'/user/logout.php">'; |
| 1506 | - $logouttext .= '<a accesskey="l" href="' . BASE_URI . '?controller=user&method=logout">'; |
|
| 1506 | + $logouttext .= '<a accesskey="l" href="'.BASE_URI.'?controller=user&method=logout">'; |
|
| 1507 | 1507 | //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); |
| 1508 | 1508 | $logouttext .= '<span class="fa fa-sign-out atoplogin"></span>'; |
| 1509 | 1509 | $logouttext .= '</a>'; |
| 1510 | 1510 | } else { |
| 1511 | 1511 | $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); |
| 1512 | - $logouttext .= img_picto($langs->trans('Logout') . ":" . $langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); |
|
| 1512 | + $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); |
|
| 1513 | 1513 | } |
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | - print '<div class="login_block">' . "\n"; |
|
| 1516 | + print '<div class="login_block">'."\n"; |
|
| 1517 | 1517 | |
| 1518 | 1518 | // Add login user link |
| 1519 | 1519 | $toprightmenu .= '<div class="login_block_user">'; |
@@ -1524,18 +1524,18 @@ discard block |
||
| 1524 | 1524 | $toprightmenu .= $user->getNomUrl($mode, '', 1, 0, 11, 0, ($user->firstname ? 'firstname' : -1), 'atoplogin'); |
| 1525 | 1525 | $toprightmenu .= '</div></div>'; |
| 1526 | 1526 | |
| 1527 | - $toprightmenu .= '</div>' . "\n"; |
|
| 1527 | + $toprightmenu .= '</div>'."\n"; |
|
| 1528 | 1528 | |
| 1529 | 1529 | $toprightmenu .= '<div class="login_block_other">'; |
| 1530 | 1530 | |
| 1531 | 1531 | // Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>') |
| 1532 | 1532 | $parameters = array(); |
| 1533 | - $result = $hookmanager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1533 | + $result = $hookmanager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1534 | 1534 | if (is_numeric($result)) { |
| 1535 | 1535 | if ($result == 0) |
| 1536 | - $toprightmenu .= $hookmanager->resPrint; // add |
|
| 1536 | + $toprightmenu .= $hookmanager->resPrint; // add |
|
| 1537 | 1537 | else |
| 1538 | - $toprightmenu = $hookmanager->resPrint; // replace |
|
| 1538 | + $toprightmenu = $hookmanager->resPrint; // replace |
|
| 1539 | 1539 | } |
| 1540 | 1540 | else { |
| 1541 | 1541 | $toprightmenu .= $result; // For backward compatibility |
@@ -1544,7 +1544,7 @@ discard block |
||
| 1544 | 1544 | // Link to module builder |
| 1545 | 1545 | if (!empty($conf->modulebuilder->enabled)) { |
| 1546 | 1546 | //$text = '<a href="' . DOL_BASE_URI . '/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; |
| 1547 | - $text = '<a href="' . BASE_URI . '?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; |
|
| 1547 | + $text = '<a href="'.BASE_URI.'?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; |
|
| 1548 | 1548 | //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); |
| 1549 | 1549 | $text .= '<span class="fa fa-bug atoplogin"></span>'; |
| 1550 | 1550 | $text .= '</a>'; |
@@ -1558,11 +1558,11 @@ discard block |
||
| 1558 | 1558 | if (is_array($_POST)) { |
| 1559 | 1559 | foreach ($_POST as $key => $value) { |
| 1560 | 1560 | if ($key !== 'action' && $key !== 'password' && !is_array($value)) |
| 1561 | - $qs .= '&' . $key . '=' . urlencode($value); |
|
| 1561 | + $qs .= '&'.$key.'='.urlencode($value); |
|
| 1562 | 1562 | } |
| 1563 | 1563 | } |
| 1564 | - $qs .= (($qs && $morequerystring) ? '&' : '') . $morequerystring; |
|
| 1565 | - $text = '<a href="' . dol_escape_htmltag($_SERVER["PHP_SELF"]) . '?' . $qs . ($qs ? '&' : '') . 'optioncss=print" target="_blank">'; |
|
| 1564 | + $qs .= (($qs && $morequerystring) ? '&' : '').$morequerystring; |
|
| 1565 | + $text = '<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs ? '&' : '').'optioncss=print" target="_blank">'; |
|
| 1566 | 1566 | //$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"'); |
| 1567 | 1567 | $text .= '<span class="fa fa-print atoplogin"></span>'; |
| 1568 | 1568 | $text .= '</a>'; |
@@ -1591,12 +1591,12 @@ discard block |
||
| 1591 | 1591 | $text = ''; |
| 1592 | 1592 | if (!empty($conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) { |
| 1593 | 1593 | $langs->load('admin'); |
| 1594 | - $appli .= '<br>' . $langs->trans("Database") . ': ' . $db->database_name; |
|
| 1594 | + $appli .= '<br>'.$langs->trans("Database").': '.$db->database_name; |
|
| 1595 | 1595 | } |
| 1596 | - $title = $appli . '<br>'; |
|
| 1596 | + $title = $appli.'<br>'; |
|
| 1597 | 1597 | $title .= $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage'); |
| 1598 | 1598 | if ($mode == 'wiki') |
| 1599 | - $title .= ' - ' . $langs->trans("PageWiki") . ' "' . dol_escape_htmltag(strtr($helppage, '_', ' ')) . '"'; |
|
| 1599 | + $title .= ' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage, '_', ' ')).'"'; |
|
| 1600 | 1600 | $text .= '<a class="help" target="_blank" rel="noopener" href="'; |
| 1601 | 1601 | if ($mode == 'wiki') |
| 1602 | 1602 | $text .= sprintf($helpbaseurl, urlencode(html_entity_decode($helppage))); |
@@ -1620,7 +1620,7 @@ discard block |
||
| 1620 | 1620 | |
| 1621 | 1621 | print $toprightmenu; |
| 1622 | 1622 | |
| 1623 | - print "</div>\n"; // end div class="login_block" |
|
| 1623 | + print "</div>\n"; // end div class="login_block" |
|
| 1624 | 1624 | |
| 1625 | 1625 | print '</div></div>'; |
| 1626 | 1626 | |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | 1631 | if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) |
| 1632 | - print '<!-- Begin div id-container --><div id="id-container" class="id-container' . ($morecss ? ' ' . $morecss : '') . '">'; |
|
| 1632 | + print '<!-- Begin div id-container --><div id="id-container" class="id-container'.($morecss ? ' '.$morecss : '').'">'; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | |
| 1635 | 1635 | /** |
@@ -1661,7 +1661,7 @@ discard block |
||
| 1661 | 1661 | // Instantiate hooks of thirdparty module |
| 1662 | 1662 | $hookmanager->initHooks(array('searchform', 'leftblock')); |
| 1663 | 1663 | |
| 1664 | - print "\n" . '<!-- Begin side-nav id-left -->' . "\n" . '<div class="side-nav"><div id="id-left">' . "\n"; |
|
| 1664 | + print "\n".'<!-- Begin side-nav id-left -->'."\n".'<div class="side-nav"><div id="id-left">'."\n"; |
|
| 1665 | 1665 | |
| 1666 | 1666 | if ($conf->browser->layout == 'phone') |
| 1667 | 1667 | $conf->global->MAIN_USE_OLD_SEARCH_FORM = 1; // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ? |
@@ -1673,7 +1673,7 @@ discard block |
||
| 1673 | 1673 | } |
| 1674 | 1674 | $selected = -1; |
| 1675 | 1675 | $usedbyinclude = 1; |
| 1676 | - include_once DOL_BASE_PATH . '/core/ajax/selectsearchbox.php'; // This set $arrayresult |
|
| 1676 | + include_once DOL_BASE_PATH.'/core/ajax/selectsearchbox.php'; // This set $arrayresult |
|
| 1677 | 1677 | |
| 1678 | 1678 | if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) { |
| 1679 | 1679 | //$searchform.=$form->selectArrayAjax('searchselectcombo', DOL_BASE_URI.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1); |
@@ -1688,7 +1688,7 @@ discard block |
||
| 1688 | 1688 | // Execute hook printSearchForm |
| 1689 | 1689 | $parameters = array('searchform' => $searchform); |
| 1690 | 1690 | |
| 1691 | - $reshook = $hookmanager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1691 | + $reshook = $hookmanager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1692 | 1692 | if (empty($reshook)) { |
| 1693 | 1693 | $searchform .= $hookmanager->resPrint; |
| 1694 | 1694 | } else |
@@ -1696,10 +1696,10 @@ discard block |
||
| 1696 | 1696 | |
| 1697 | 1697 | // Force special value for $searchform |
| 1698 | 1698 | if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax)) { |
| 1699 | - $urltosearch = DOL_BASE_URI . '/core/search_page.php?showtitlebefore=1'; |
|
| 1700 | - $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="' . $urltosearch . '" alt="' . dol_escape_htmltag($langs->trans("ShowSearchFields")) . '">' . $langs->trans("Search") . '...</a></div></div>'; |
|
| 1699 | + $urltosearch = DOL_BASE_URI.'/core/search_page.php?showtitlebefore=1'; |
|
| 1700 | + $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div></div>'; |
|
| 1701 | 1701 | } elseif ($conf->use_javascript_ajax && !empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) { |
| 1702 | - $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>'; |
|
| 1702 | + $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>'; |
|
| 1703 | 1703 | $searchform .= '<script type="text/javascript"> |
| 1704 | 1704 | jQuery(document).ready(function () { |
| 1705 | 1705 | jQuery("#divsearchforms1").click(function(){ |
@@ -1712,16 +1712,16 @@ discard block |
||
| 1712 | 1712 | |
| 1713 | 1713 | // Define $bookmarks |
| 1714 | 1714 | if (!empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) { |
| 1715 | - include_once DOL_BASE_PATH . '/bookmarks/bookmarks.lib.php'; |
|
| 1715 | + include_once DOL_BASE_PATH.'/bookmarks/bookmarks.lib.php'; |
|
| 1716 | 1716 | $langs->load("bookmarks"); |
| 1717 | 1717 | |
| 1718 | 1718 | $bookmarks = printBookmarksList($db, $langs); |
| 1719 | 1719 | } |
| 1720 | 1720 | |
| 1721 | 1721 | // Left column |
| 1722 | - print '<!-- Begin left menu -->' . "\n"; |
|
| 1722 | + print '<!-- Begin left menu -->'."\n"; |
|
| 1723 | 1723 | |
| 1724 | - print '<div class="vmenu"' . (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"') . '>' . "\n\n"; |
|
| 1724 | + print '<div class="vmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"').'>'."\n\n"; |
|
| 1725 | 1725 | |
| 1726 | 1726 | // Show left menu with other forms |
| 1727 | 1727 | $menumanager->menu_array = $menu_array_before; |
@@ -1730,7 +1730,7 @@ discard block |
||
| 1730 | 1730 | // Dolibarr version + help + bug report link |
| 1731 | 1731 | print "\n"; |
| 1732 | 1732 | print "<!-- Begin Help Block-->\n"; |
| 1733 | - print '<div id="blockvmenuhelp" class="blockvmenuhelp">' . "\n"; |
|
| 1733 | + print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n"; |
|
| 1734 | 1734 | |
| 1735 | 1735 | // Version |
| 1736 | 1736 | if (empty($conf->global->MAIN_HIDE_VERSION)) { // Version is already on help picto and on login page. |
@@ -1752,15 +1752,15 @@ discard block |
||
| 1752 | 1752 | $appli = $conf->global->MAIN_APPLICATION_TITLE; |
| 1753 | 1753 | $doliurl = ''; |
| 1754 | 1754 | if (preg_match('/\d\.\d/', $appli)) { |
| 1755 | - if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli)) |
|
| 1756 | - $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core |
|
| 1755 | + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) |
|
| 1756 | + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core |
|
| 1757 | 1757 | } else |
| 1758 | - $appli .= " " . DOL_VERSION; |
|
| 1758 | + $appli .= " ".DOL_VERSION; |
|
| 1759 | 1759 | } else |
| 1760 | - $appli .= " " . DOL_VERSION; |
|
| 1760 | + $appli .= " ".DOL_VERSION; |
|
| 1761 | 1761 | print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">'; |
| 1762 | 1762 | if ($doliurl) |
| 1763 | - print '<a class="help" target="_blank" rel="noopener" href="' . $doliurl . '">'; |
|
| 1763 | + print '<a class="help" target="_blank" rel="noopener" href="'.$doliurl.'">'; |
|
| 1764 | 1764 | else |
| 1765 | 1765 | print '<span class="help">'; |
| 1766 | 1766 | print $appli; |
@@ -1768,12 +1768,12 @@ discard block |
||
| 1768 | 1768 | print '</a>'; |
| 1769 | 1769 | else |
| 1770 | 1770 | print '</span>'; |
| 1771 | - print '</div>' . "\n"; |
|
| 1771 | + print '</div>'."\n"; |
|
| 1772 | 1772 | } |
| 1773 | 1773 | |
| 1774 | 1774 | // Link to bugtrack |
| 1775 | 1775 | if (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) { |
| 1776 | - require_once DOL_BASE_PATH . '/core/lib/functions2.lib.php'; |
|
| 1776 | + require_once DOL_BASE_PATH.'/core/lib/functions2.lib.php'; |
|
| 1777 | 1777 | |
| 1778 | 1778 | $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new'; |
| 1779 | 1779 | $bugbaseurl .= '?title='; |
@@ -1782,16 +1782,16 @@ discard block |
||
| 1782 | 1782 | $bugbaseurl .= urlencode("# Bug\n"); |
| 1783 | 1783 | $bugbaseurl .= urlencode("\n"); |
| 1784 | 1784 | $bugbaseurl .= urlencode("## Environment\n"); |
| 1785 | - $bugbaseurl .= urlencode("- **Version**: " . DOL_VERSION . "\n"); |
|
| 1786 | - $bugbaseurl .= urlencode("- **OS**: " . php_uname('s') . "\n"); |
|
| 1787 | - $bugbaseurl .= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n"); |
|
| 1788 | - $bugbaseurl .= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n"); |
|
| 1789 | - $bugbaseurl .= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n"); |
|
| 1790 | - $bugbaseurl .= urlencode("- **URL**: " . $_SERVER["REQUEST_URI"] . "\n"); |
|
| 1785 | + $bugbaseurl .= urlencode("- **Version**: ".DOL_VERSION."\n"); |
|
| 1786 | + $bugbaseurl .= urlencode("- **OS**: ".php_uname('s')."\n"); |
|
| 1787 | + $bugbaseurl .= urlencode("- **Web server**: ".$_SERVER["SERVER_SOFTWARE"]."\n"); |
|
| 1788 | + $bugbaseurl .= urlencode("- **PHP**: ".php_sapi_name().' '.phpversion()."\n"); |
|
| 1789 | + $bugbaseurl .= urlencode("- **Database**: ".$db::LABEL.' '.$db->getVersion()."\n"); |
|
| 1790 | + $bugbaseurl .= urlencode("- **URL**: ".$_SERVER["REQUEST_URI"]."\n"); |
|
| 1791 | 1791 | $bugbaseurl .= urlencode("\n"); |
| 1792 | 1792 | $bugbaseurl .= urlencode("## Report\n"); |
| 1793 | 1793 | print '<div id="blockvmenuhelpbugreport" class="blockvmenuhelp">'; |
| 1794 | - print '<a class="help" target="_blank" rel="noopener" href="' . $bugbaseurl . '">' . $langs->trans("FindBug") . '</a>'; |
|
| 1794 | + print '<a class="help" target="_blank" rel="noopener" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a>'; |
|
| 1795 | 1795 | print '</div>'; |
| 1796 | 1796 | } |
| 1797 | 1797 | |
@@ -1805,14 +1805,14 @@ discard block |
||
| 1805 | 1805 | |
| 1806 | 1806 | // Execute hook printLeftBlock |
| 1807 | 1807 | $parameters = array(); |
| 1808 | - $reshook = $hookmanager->executeHooks('printLeftBlock', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1808 | + $reshook = $hookmanager->executeHooks('printLeftBlock', $parameters); // Note that $action and $object may have been modified by some hooks |
|
| 1809 | 1809 | print $hookmanager->resPrint; |
| 1810 | 1810 | |
| 1811 | 1811 | print '</div></div> <!-- End side-nav id-left -->'; // End div id="side-nav" div id="id-left" |
| 1812 | 1812 | } |
| 1813 | 1813 | |
| 1814 | 1814 | print "\n"; |
| 1815 | - print '<!-- Begin right area -->' . "\n"; |
|
| 1815 | + print '<!-- Begin right area -->'."\n"; |
|
| 1816 | 1816 | |
| 1817 | 1817 | if (empty($leftmenuwithoutmainarea)) |
| 1818 | 1818 | main_area($title); |
@@ -1833,7 +1833,7 @@ discard block |
||
| 1833 | 1833 | |
| 1834 | 1834 | print "\n"; |
| 1835 | 1835 | |
| 1836 | - print '<!-- Begin div class="fiche" -->' . "\n" . '<div class="fiche">' . "\n"; |
|
| 1836 | + print '<!-- Begin div class="fiche" -->'."\n".'<div class="fiche">'."\n"; |
|
| 1837 | 1837 | |
| 1838 | 1838 | if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) |
| 1839 | 1839 | print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); |
@@ -1899,17 +1899,17 @@ discard block |
||
| 1899 | 1899 | global $conf, $langs, $user; |
| 1900 | 1900 | |
| 1901 | 1901 | $ret = ''; |
| 1902 | - $ret .= '<form action="' . $urlaction . '" method="post" class="searchform">'; |
|
| 1903 | - $ret .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
| 1902 | + $ret .= '<form action="'.$urlaction.'" method="post" class="searchform">'; |
|
| 1903 | + $ret .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
| 1904 | 1904 | $ret .= '<input type="hidden" name="mode" value="search">'; |
| 1905 | - $ret .= '<input type="hidden" name="savelogin" value="' . dol_escape_htmltag($user->login) . '">'; |
|
| 1905 | + $ret .= '<input type="hidden" name="savelogin" value="'.dol_escape_htmltag($user->login).'">'; |
|
| 1906 | 1906 | if ($showtitlebefore) |
| 1907 | - $ret .= $title . ' '; |
|
| 1908 | - $ret .= '<input type="text" class="flat ' . $htmlmorecss . '"'; |
|
| 1909 | - $ret .= ' style="text-indent: 22px; background-image: url(\'' . $img . '\'); background-repeat: no-repeat; background-position: 3px;"'; |
|
| 1910 | - $ret .= ($accesskey ? ' accesskey="' . $accesskey . '"' : ''); |
|
| 1911 | - $ret .= ' placeholder="' . strip_tags($title) . '"'; |
|
| 1912 | - $ret .= ' name="' . $htmlinputname . '" id="' . $prefhtmlinputname . $htmlinputname . '" />'; |
|
| 1907 | + $ret .= $title.' '; |
|
| 1908 | + $ret .= '<input type="text" class="flat '.$htmlmorecss.'"'; |
|
| 1909 | + $ret .= ' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"'; |
|
| 1910 | + $ret .= ($accesskey ? ' accesskey="'.$accesskey.'"' : ''); |
|
| 1911 | + $ret .= ' placeholder="'.strip_tags($title).'"'; |
|
| 1912 | + $ret .= ' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />'; |
|
| 1913 | 1913 | //$ret.='<input type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px" value="'.$langs->trans("Go").'">'; |
| 1914 | 1914 | $ret .= '<button type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">'; |
| 1915 | 1915 | $ret .= '<span class="fa fa-search"></span>'; |
@@ -1935,7 +1935,7 @@ discard block |
||
| 1935 | 1935 | global $delayedhtmlcontent; |
| 1936 | 1936 | global $contextpage, $page, $limit; |
| 1937 | 1937 | |
| 1938 | - $ext = 'layout=' . $conf->browser->layout . '&version=' . urlencode(DOL_VERSION); |
|
| 1938 | + $ext = 'layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION); |
|
| 1939 | 1939 | |
| 1940 | 1940 | // Global html output events ($mesgs, $errors, $warnings) |
| 1941 | 1941 | dol_htmloutput_events($disabledoutputofmessages); |
@@ -1945,15 +1945,15 @@ discard block |
||
| 1945 | 1945 | if (is_object($user) && !empty($user->lastsearch_values_tmp) && is_array($user->lastsearch_values_tmp)) { |
| 1946 | 1946 | // Clean and save data |
| 1947 | 1947 | foreach ($user->lastsearch_values_tmp as $key => $val) { |
| 1948 | - unset($_SESSION['lastsearch_values_tmp_' . $key]); // Clean array to rebuild it just after |
|
| 1948 | + unset($_SESSION['lastsearch_values_tmp_'.$key]); // Clean array to rebuild it just after |
|
| 1949 | 1949 | if (count($val) && empty($_POST['button_removefilter'])) { // If there is search criteria to save and we did not click on 'Clear filter' button |
| 1950 | 1950 | if (empty($val['sortfield'])) |
| 1951 | 1951 | unset($val['sortfield']); |
| 1952 | 1952 | if (empty($val['sortorder'])) |
| 1953 | 1953 | unset($val['sortorder']); |
| 1954 | - dol_syslog('Save lastsearch_values_tmp_' . $key . '=' . json_encode($val, 0) . " (systematic recording of last search criterias)"); |
|
| 1955 | - $_SESSION['lastsearch_values_tmp_' . $key] = json_encode($val); |
|
| 1956 | - unset($_SESSION['lastsearch_values_' . $key]); |
|
| 1954 | + dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criterias)"); |
|
| 1955 | + $_SESSION['lastsearch_values_tmp_'.$key] = json_encode($val); |
|
| 1956 | + unset($_SESSION['lastsearch_values_'.$key]); |
|
| 1957 | 1957 | } |
| 1958 | 1958 | } |
| 1959 | 1959 | } |
@@ -1962,37 +1962,37 @@ discard block |
||
| 1962 | 1962 | $relativepathstring = $_SERVER["PHP_SELF"]; |
| 1963 | 1963 | // Clean $relativepathstring |
| 1964 | 1964 | if (constant('DOL_BASE_URI')) |
| 1965 | - $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring); |
|
| 1965 | + $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring); |
|
| 1966 | 1966 | $relativepathstring = preg_replace('/^\//', '', $relativepathstring); |
| 1967 | 1967 | $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); |
| 1968 | 1968 | if (preg_match('/list\.php$/', $relativepathstring)) { |
| 1969 | - unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]); |
|
| 1970 | - unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]); |
|
| 1971 | - unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]); |
|
| 1969 | + unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]); |
|
| 1970 | + unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]); |
|
| 1971 | + unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]); |
|
| 1972 | 1972 | |
| 1973 | 1973 | if (!empty($contextpage)) |
| 1974 | - $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring] = $contextpage; |
|
| 1974 | + $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring] = $contextpage; |
|
| 1975 | 1975 | if (!empty($page) && $page > 1) |
| 1976 | - $_SESSION['lastsearch_page_tmp_' . $relativepathstring] = $page; |
|
| 1976 | + $_SESSION['lastsearch_page_tmp_'.$relativepathstring] = $page; |
|
| 1977 | 1977 | if (!empty($limit) && $limit != $conf->limit) |
| 1978 | - $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] = $limit; |
|
| 1978 | + $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] = $limit; |
|
| 1979 | 1979 | |
| 1980 | - unset($_SESSION['lastsearch_contextpage_' . $relativepathstring]); |
|
| 1981 | - unset($_SESSION['lastsearch_page_' . $relativepathstring]); |
|
| 1982 | - unset($_SESSION['lastsearch_limit_' . $relativepathstring]); |
|
| 1980 | + unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]); |
|
| 1981 | + unset($_SESSION['lastsearch_page_'.$relativepathstring]); |
|
| 1982 | + unset($_SESSION['lastsearch_limit_'.$relativepathstring]); |
|
| 1983 | 1983 | } |
| 1984 | 1984 | |
| 1985 | 1985 | // Core error message |
| 1986 | 1986 | if (!empty($conf->global->MAIN_CORE_ERROR)) { |
| 1987 | 1987 | // Ajax version |
| 1988 | 1988 | if ($conf->use_javascript_ajax) { |
| 1989 | - $title = img_warning() . ' ' . $langs->trans('CoreErrorTitle'); |
|
| 1989 | + $title = img_warning().' '.$langs->trans('CoreErrorTitle'); |
|
| 1990 | 1990 | print ajax_dialog($title, $langs->trans('CoreErrorMessage')); |
| 1991 | 1991 | } |
| 1992 | 1992 | // html version |
| 1993 | 1993 | else { |
| 1994 | - $msg = img_warning() . ' ' . $langs->trans('CoreErrorMessage'); |
|
| 1995 | - print '<div class="error">' . $msg . '</div>'; |
|
| 1994 | + $msg = img_warning().' '.$langs->trans('CoreErrorMessage'); |
|
| 1995 | + print '<div class="error">'.$msg.'</div>'; |
|
| 1996 | 1996 | } |
| 1997 | 1997 | |
| 1998 | 1998 | //define("MAIN_CORE_ERROR",0); // Constant was defined and we can't change value of a constant |
@@ -2000,17 +2000,17 @@ discard block |
||
| 2000 | 2000 | |
| 2001 | 2001 | print "\n\n"; |
| 2002 | 2002 | |
| 2003 | - print '</div> <!-- End div class="fiche" -->' . "\n"; // End div fiche |
|
| 2003 | + print '</div> <!-- End div class="fiche" -->'."\n"; // End div fiche |
|
| 2004 | 2004 | |
| 2005 | 2005 | if (empty($conf->dol_hide_leftmenu)) |
| 2006 | - print '</div> <!-- End div id-right -->' . "\n"; // End div id-right |
|
| 2006 | + print '</div> <!-- End div id-right -->'."\n"; // End div id-right |
|
| 2007 | 2007 | |
| 2008 | 2008 | if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) |
| 2009 | - print '</div> <!-- End div id-container -->' . "\n"; // End div container |
|
| 2009 | + print '</div> <!-- End div id-container -->'."\n"; // End div container |
|
| 2010 | 2010 | |
| 2011 | 2011 | print "\n"; |
| 2012 | 2012 | if ($comment) |
| 2013 | - print '<!-- ' . $comment . ' -->' . "\n"; |
|
| 2013 | + print '<!-- '.$comment.' -->'."\n"; |
|
| 2014 | 2014 | |
| 2015 | 2015 | printCommonFooter($zone); |
| 2016 | 2016 | |
@@ -2018,8 +2018,8 @@ discard block |
||
| 2018 | 2018 | print $delayedhtmlcontent; |
| 2019 | 2019 | |
| 2020 | 2020 | if (!empty($conf->use_javascript_ajax)) { |
| 2021 | - print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n"; |
|
| 2022 | - print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_foot.js&lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
| 2021 | + print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n"; |
|
| 2022 | + print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_foot.js&lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
| 2023 | 2023 | } |
| 2024 | 2024 | |
| 2025 | 2025 | // Wrapper to add log when clicking on download or preview |
@@ -2031,7 +2031,7 @@ discard block |
||
| 2031 | 2031 | <script type="text/javascript"> |
| 2032 | 2032 | jQuery(document).ready(function () { |
| 2033 | 2033 | $('a.documentpreview').click(function () { |
| 2034 | - $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>' |
|
| 2034 | + $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>' |
|
| 2035 | 2035 | , { |
| 2036 | 2036 | id:<?php echo $object->id; ?> |
| 2037 | 2037 | , element: '<?php echo $object->element ?>' |
@@ -2040,7 +2040,7 @@ discard block |
||
| 2040 | 2040 | ); |
| 2041 | 2041 | }); |
| 2042 | 2042 | $('a.documentdownload').click(function () { |
| 2043 | - $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>' |
|
| 2043 | + $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>' |
|
| 2044 | 2044 | , { |
| 2045 | 2045 | id:<?php echo $object->id; ?> |
| 2046 | 2046 | , element: '<?php echo $object->element ?>' |
@@ -2056,7 +2056,7 @@ discard block |
||
| 2056 | 2056 | |
| 2057 | 2057 | // A div for the address popup |
| 2058 | 2058 | print "\n<!-- A div to allow dialog popup -->\n"; |
| 2059 | - print '<div id="dialogforpopup" style="display: none;"></div>' . "\n"; |
|
| 2059 | + print '<div id="dialogforpopup" style="display: none;"></div>'."\n"; |
|
| 2060 | 2060 | |
| 2061 | 2061 | print "</body>\n"; |
| 2062 | 2062 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | {
|
| 15 | 15 | parent::__construct(); |
| 16 | 16 | |
| 17 | - $this->searchDir[] = BASE_PATH . '/plugins'; |
|
| 17 | + $this->searchDir[] = BASE_PATH.'/plugins'; |
|
| 18 | 18 | $path = null; |
| 19 | 19 | } |
| 20 | 20 | |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | define('SITE_URL', APP_PROTOCOL . '://' . SERVER_NAME);
|
| 40 | 40 | define('BASE_URI', SITE_URL . APP_URI);
|
| 41 | 41 | */ |
| 42 | - define('DOL_BASE_PATH', BASE_PATH . '/dolibarr/htdocs');
|
|
| 43 | - define('DOL_BASE_URI', BASE_URI . '/dolibarr/htdocs');
|
|
| 42 | + define('DOL_BASE_PATH', BASE_PATH.'/dolibarr/htdocs');
|
|
| 43 | + define('DOL_BASE_URI', BASE_URI.'/dolibarr/htdocs');
|
|
| 44 | 44 | //define('DOL_DOCUMENT_ROOT', DOL_BASE_PATH);
|
| 45 | 45 | |
| 46 | 46 | define('CORE_FOLDER', '/core');
|
@@ -54,15 +54,15 @@ discard block |
||
| 54 | 54 | define('CACHE_FOLDER', '/../cache');
|
| 55 | 55 | //define('VENDOR_FOLDER', BASE_URI . '/vendor');
|
| 56 | 56 | |
| 57 | - define('CORE_PATH', BASE_PATH . CORE_FOLDER);
|
|
| 58 | - define('CONFIG_PATH', BASE_PATH . CONFIG_FOLDER);
|
|
| 59 | - define('CONTROLLERS_PATH', BASE_PATH . CONTROLLERS_FOLDER);
|
|
| 60 | - define('HELPERS_PATH', BASE_PATH . HELPERS_FOLDER);
|
|
| 61 | - define('MODELS_PATH', BASE_PATH . MODELS_FOLDER);
|
|
| 62 | - define('SKINS_PATH', BASE_PATH . SKINS_FOLDER);
|
|
| 63 | - define('TEMPLATES_PATH', BASE_PATH . TEMPLATES_FOLDER);
|
|
| 64 | - define('PLUGINS_PATH', BASE_PATH . PLUGINS_FOLDER);
|
|
| 65 | - define('CACHE_PATH', BASE_PATH . CACHE_FOLDER);
|
|
| 57 | + define('CORE_PATH', BASE_PATH.CORE_FOLDER);
|
|
| 58 | + define('CONFIG_PATH', BASE_PATH.CONFIG_FOLDER);
|
|
| 59 | + define('CONTROLLERS_PATH', BASE_PATH.CONTROLLERS_FOLDER);
|
|
| 60 | + define('HELPERS_PATH', BASE_PATH.HELPERS_FOLDER);
|
|
| 61 | + define('MODELS_PATH', BASE_PATH.MODELS_FOLDER);
|
|
| 62 | + define('SKINS_PATH', BASE_PATH.SKINS_FOLDER);
|
|
| 63 | + define('TEMPLATES_PATH', BASE_PATH.TEMPLATES_FOLDER);
|
|
| 64 | + define('PLUGINS_PATH', BASE_PATH.PLUGINS_FOLDER);
|
|
| 65 | + define('CACHE_PATH', BASE_PATH.CACHE_FOLDER);
|
|
| 66 | 66 | //define('VENDOR_PATH', BASE_PATH . VENDOR_FOLDER);
|
| 67 | 67 | } |
| 68 | 68 | |