*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -135,4 +135,35 @@ function ajax_autocompleter2($selected='', $htmlname, $url, $option='')
return $script;
}
+/**
+ * Show an ajax dialog
+ */
+function ajax_dialog($title,$message,$w=350,$h=150)
+{
+ global $langs;
+
+ $msg.= '';
+ $msg.= $message;
+ $msg.= '
'."\n";
+ $msg.= '';
+
+ $msg.= "\n";
+
+ return $msg;
+}
+
?>
\ No newline at end of file
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index daa87800824..7bea9085f9a 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -1880,6 +1880,8 @@ function dolibarr_print_error($db='',$error='')
function dol_print_error($db='',$error='')
{
global $conf,$langs,$argv;
+ global $dolibarr_main_prod;
+
$out = '';
$syslog = '';
@@ -1967,7 +1969,8 @@ function dol_print_error($db='',$error='')
$syslog.=", msg=".$msg;
}
}
- if ($_SERVER['DOCUMENT_ROOT'] && function_exists('xdebug_call_file'))
+
+ if (empty($dolibarr_main_prod) && $_SERVER['DOCUMENT_ROOT'] && function_exists('xdebug_call_file'))
{
xdebug_print_function_stack();
$out.='XDebug informations:'."
\n";
@@ -1977,9 +1980,9 @@ function dol_print_error($db='',$error='')
$out.="
\n";
}
- global $dolibarr_main_prod;
if (empty($dolibarr_main_prod)) print $out;
- 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.';
+ else define("MAIN_CORE_ERROR", 1);
+ //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.';
dol_syslog("Error ".$syslog, LOG_ERR);
}
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 04adf1c684d..0ac5e4d3875 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -732,8 +732,6 @@ else
$heightforframes=48;
-
-
// Functions
@@ -1329,7 +1327,26 @@ if (! function_exists("llxFooter"))
{
function llxFooter($foot='')
{
- global $conf, $dolibarr_auto_user, $micro_start_time;
+ global $conf, $langs, $dolibarr_auto_user, $micro_start_time;
+
+ // Core error message
+ if (defined("MAIN_CORE_ERROR") && constant("MAIN_CORE_ERROR") == 1)
+ {
+ // Ajax version
+ if ($conf->use_javascript_ajax)
+ {
+ $title = img_warning().' '.$langs->trans('CoreErrorTitle');
+ print ajax_dialog($title, $langs->trans('CoreErrorMessage'));
+ }
+ // html version
+ else
+ {
+ $msg = img_warning().' '.$langs->trans('CoreErrorMessage');
+ print ''.$msg.'
';
+ }
+
+ define("MAIN_CORE_ERROR",0);
+ }
print "\n\n".' '."\n";