New: add constante MAIN_CORE_ERROR if "$dolibarr_main_prod" is defined, better error message with an ajax dialog
This commit is contained in:
parent
fa526a9509
commit
705c675933
@ -551,6 +551,8 @@ Merge=Merge
|
|||||||
PrintContentArea=Show page to print main content area
|
PrintContentArea=Show page to print main content area
|
||||||
NoMenu=No sub-menu
|
NoMenu=No sub-menu
|
||||||
WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only login <b>%s</b> is allowed to use application at the moment.
|
WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only login <b>%s</b> is allowed to use application at the moment.
|
||||||
|
CoreErrorTitle=System error
|
||||||
|
CoreErrorMessage=Sorry, an error occurred. Check the logs or contact your system administrator.
|
||||||
CreditCard=Credit card
|
CreditCard=Credit card
|
||||||
FieldsWithAreMandatory=Fields with <b>%s</b> are mandatory
|
FieldsWithAreMandatory=Fields with <b>%s</b> are mandatory
|
||||||
FieldsWithIsForPublic=Fields with <b>%s</b> are shown on public list of members. If you don't want this, check the "public" box.
|
FieldsWithIsForPublic=Fields with <b>%s</b> are shown on public list of members. If you don't want this, check the "public" box.
|
||||||
|
|||||||
@ -550,6 +550,8 @@ Merge=Fusion
|
|||||||
PrintContentArea=Afficher page d'impression de la zone centrale
|
PrintContentArea=Afficher page d'impression de la zone centrale
|
||||||
NoMenu=Aucun sous-menu
|
NoMenu=Aucun sous-menu
|
||||||
WarningYouAreInMaintenanceMode=Attention, vous êtes en mode maintenance, aussi seul le login <b>%s</b> est autorisé à utiliser l'application en ce moment.
|
WarningYouAreInMaintenanceMode=Attention, vous êtes en mode maintenance, aussi seul le login <b>%s</b> est autorisé à utiliser l'application en ce moment.
|
||||||
|
CoreErrorTitle=Erreur système
|
||||||
|
CoreErrorMessage=Désolé, une erreur s'est produite. Vérifier les logs ou contacter l'administrateur du système.
|
||||||
CreditCard=Carte de crédit
|
CreditCard=Carte de crédit
|
||||||
FieldsWithAreMandatory=Les champs marqués par un <b>%s</b> sont obligatoires
|
FieldsWithAreMandatory=Les champs marqués par un <b>%s</b> sont obligatoires
|
||||||
FieldsWithIsForPublic=Les champs marqués par <b>%s</b> seront affichés sur la liste publique des membres. Si vous ne le souhaitez pas, décochez la case "public".
|
FieldsWithIsForPublic=Les champs marqués par <b>%s</b> seront affichés sur la liste publique des membres. Si vous ne le souhaitez pas, décochez la case "public".
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2007-2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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;
|
return $script;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show an ajax dialog
|
||||||
|
*/
|
||||||
|
function ajax_dialog($title,$message,$w=350,$h=150)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$msg.= '<div id="dialog-info" title="'.dol_escape_htmltag($title).'">';
|
||||||
|
$msg.= $message;
|
||||||
|
$msg.= '</div>'."\n";
|
||||||
|
$msg.= '<script type="text/javascript">
|
||||||
|
jQuery(function() {
|
||||||
|
jQuery("#dialog-info").dialog({
|
||||||
|
resizable: false,
|
||||||
|
height:'.$h.',
|
||||||
|
width:'.$w.',
|
||||||
|
modal: true,
|
||||||
|
buttons: {
|
||||||
|
Ok: function() {
|
||||||
|
jQuery( this ).dialog(\'close\');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
|
||||||
|
$msg.= "\n";
|
||||||
|
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -1880,6 +1880,8 @@ function dolibarr_print_error($db='',$error='')
|
|||||||
function dol_print_error($db='',$error='')
|
function dol_print_error($db='',$error='')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$argv;
|
global $conf,$langs,$argv;
|
||||||
|
global $dolibarr_main_prod;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
$syslog = '';
|
$syslog = '';
|
||||||
|
|
||||||
@ -1967,7 +1969,8 @@ function dol_print_error($db='',$error='')
|
|||||||
$syslog.=", msg=".$msg;
|
$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();
|
xdebug_print_function_stack();
|
||||||
$out.='<b>XDebug informations:</b>'."<br>\n";
|
$out.='<b>XDebug informations:</b>'."<br>\n";
|
||||||
@ -1977,9 +1980,9 @@ function dol_print_error($db='',$error='')
|
|||||||
$out.="<br>\n";
|
$out.="<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
global $dolibarr_main_prod;
|
|
||||||
if (empty($dolibarr_main_prod)) print $out;
|
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);
|
dol_syslog("Error ".$syslog, LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -732,8 +732,6 @@ else
|
|||||||
$heightforframes=48;
|
$heightforframes=48;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|
||||||
|
|
||||||
@ -1329,7 +1327,26 @@ if (! function_exists("llxFooter"))
|
|||||||
{
|
{
|
||||||
function llxFooter($foot='')
|
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 '<div class="error">'.$msg.'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
define("MAIN_CORE_ERROR",0);
|
||||||
|
}
|
||||||
|
|
||||||
print "\n\n".'</div> <!-- end div class="fiche" -->'."\n";
|
print "\n\n".'</div> <!-- end div class="fiche" -->'."\n";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user