diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 286ab5f63d1..3ee4206258a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -245,6 +245,8 @@ function dol_getprefix() */ function dol_include_once($relpath, $classname='') { + 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'] + $fullpath = dol_buildpath($relpath); if (!file_exists($fullpath)) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d2dc0d4ce00..1be7d8a9a7a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -717,8 +717,10 @@ if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_small if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1; if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1; if (! empty($conf->browser->phone)) $conf->dol_no_mouse_hover=1; -if ((! empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400) - || (! empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400)) +if (! empty($conf->browser->phone) + || (! empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400) + || (! empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400) +) { $conf->dol_optimize_smallscreen=1; } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 6dbb6bccca4..b447be4574b 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -2,6 +2,7 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. + require '../../main.inc.php'; if (!empty($conf->global->MAIN_FEATURES_LEVEL)) @@ -9,11 +10,18 @@ if (!empty($conf->global->MAIN_FEATURES_LEVEL)) print "Page available onto dev environment only"; exit; } -?> +$usedolheader=0; // 1 = Test inside a dolibarr page, 0 = Use hard coded header + +// HEADER +//-------- + +if (empty($usedolheader)) +{ + header("Content-type: text/html; charset=UTF8"); +?> -
@@ -31,20 +39,33 @@ if (!empty($conf->global->MAIN_FEATURES_LEVEL)) - -