diff --git a/maarch_entreprise/trunk/index.php b/maarch_entreprise/trunk/index.php index b8fdd4e84708075c3513855e87cd34845269c5fb..7c4d9336457e27aa8c5a867390eda52125f829d8 100644 --- a/maarch_entreprise/trunk/index.php +++ b/maarch_entreprise/trunk/index.php @@ -37,33 +37,6 @@ if ($_SESSION['config']['usePHPIDS'] == 'true') { include 'apps/maarch_entreprise/phpids_control.php'; } -include 'apps/maarch_entreprise/tools/maarchIVS/MaarchIVS.php'; -$started = MaarchIVS::start(__DIR__ . '/xml/IVS/requests_definitions.xml', 'xml'); -$valid = MaarchIVS::run('silent'); -if (!$valid) { - $validOutpout = MaarchIVS::debug(); - $cptValid = count($validOutpout['validationErrors']); - $error = ''; - for ($cptV=0;$cptV<=count($cptValid);$cptV++) { - $error .= $validOutpout['validationErrors'][$cptV]->message . PHP_EOL; - $error .= $validOutpout['validationErrors'][$cptV]->parameter . PHP_EOL; - $error .= $validOutpout['validationErrors'][$cptV]->value . PHP_EOL; - } - //process error for ajax request - if ( - array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) - && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' - ) { - echo $error; - exit; - } else { - //process error for standard request - $_SESSION['error'] = $error; - } -} else { - //Request is valid -} - if (isset($_SESSION['config']['corepath'])) { require_once 'core/class/class_functions.php'; require_once 'core/class/class_db.php'; @@ -97,6 +70,55 @@ if (isset($_SESSION['config']['corepath'])) { } } +$core->load_lang(); + +include 'apps/maarch_entreprise/tools/maarchIVS/MaarchIVS.php'; +$started = MaarchIVS::start(__DIR__ . '/xml/IVS/requests_definitions.xml', 'xml'); +$valid = MaarchIVS::run('silent'); +if (!$valid) { + $validOutpout = MaarchIVS::debug(); + $cptValid = count($validOutpout['validationErrors']); + $error = ''; + for ($cptV=0;$cptV<=count($cptValid);$cptV++) { + $message = $validOutpout['validationErrors'][$cptV]->message; + if ($message == "Length id below the minimal length") { + $message = _IVS_LENGTH_ID_BELOW_MIN_LENGTH; + } elseif ($message == "Length exceeds the maximal length") { + $message = _IVS_LENGTH_EXCEEDS_MAX_LENGTH; + } elseif ($message == "Length is not allowed") { + $message = _IVS_LENGTH_NOT_ALLOWED; + } elseif ($message == "Value is not allowed") { + $message = _IVS_VALUE_NOT_ALLOWED; + } elseif ($message == "Format is not allowed") { + $message = _IVS_FORMAT_NOT_ALLOWED; + } elseif ($message == "Value is below the minimal value") { + $message = _IVS_VALUE_BELOW_MIN_VALUE; + } elseif ($message == "Value exceeds the maximal value") { + $message = _IVS_LENGTH_EXCEEDS_MAX_LENGTH; + } elseif ($message == "Too many digits") { + $message = _IVS_TOO_MANY_DIGITS; + } elseif ($message == "Too many decimal digits") { + $message = _IVS_TOO_MANY_DECIMAL_DIGITS; + } + $error .= $message . PHP_EOL; + $error .= $validOutpout['validationErrors'][$cptV]->parameter . PHP_EOL; + $error .= $validOutpout['validationErrors'][$cptV]->value . PHP_EOL; + } + //process error for ajax request + if ( + array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) + && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' + ) { + echo $error; + exit; + } else { + //process error for standard request + $_SESSION['error'] = $error; + } +} else { + //Request is valid +} + if ( isset($_SESSION['user']['UserId']) && isset($_GET['page']) @@ -149,7 +171,7 @@ if (isset($_SESSION['HTTP_REFERER'])) { unset($_SESSION['HTTP_REFERER']); header('location: '.$url); } -$core->load_lang(); + $core->load_html(); $core->load_header(); $time = $core->get_session_time_expire(); diff --git a/maarch_entreprise/trunk/lang/en.php b/maarch_entreprise/trunk/lang/en.php index 9e303f73a674b346770a956cc178e4a31417207f..0716483e442211de0df294be62cb0bc949efb2b5 100644 --- a/maarch_entreprise/trunk/lang/en.php +++ b/maarch_entreprise/trunk/lang/en.php @@ -1358,3 +1358,14 @@ if (!defined('_SIGNATORY_GROUP')) define( '_SIGNATORY_GROUP', 'Signatory group') if (!defined('_SIGNATURE')) define( '_SIGNATURE','Signature'); + +//maarchIVS translate +define("_IVS_LENGTH_ID_BELOW_MIN_LENGTH", "Length id below the minimal length"); +define("_IVS_LENGTH_EXCEEDS_MAX_LENGTH", "Length exceeds the maximal length"); +define("_IVS_LENGTH_NOT_ALLOWED", "Length is not allowed"); +define("_IVS_VALUE_NOT_ALLOWED", "Value is not allowed"); +define("_IVS_FORMAT_NOT_ALLOWED", "Format is not allowed"); +define("_IVS_VALUE_BELOW_MIN_VALUE", "Value is below the minimal value"); +define("_IVS_VALUE_EXCEEDS_MAX_VALUE", "Value exceeds the maximal value"); +define("_IVS_TOO_MANY_DIGITS", "Too many digits"); +define("_IVS_TOO_MANY_DECIMAL_DIGITS", "Too many decimal digits"); diff --git a/maarch_entreprise/trunk/lang/fr.php b/maarch_entreprise/trunk/lang/fr.php index 12797f37483271f3e8993148931bd88472476dae..835c76a99065c2471d42f41fb7f61286473c44b8 100644 --- a/maarch_entreprise/trunk/lang/fr.php +++ b/maarch_entreprise/trunk/lang/fr.php @@ -1700,3 +1700,12 @@ if (!defined('_SEND_TO_VISA')) define( '_SEND_TO_VISA', 'Envoi pour visa'); if (!defined("_MAIL_WILL_DISAPPEAR")) define("_MAIL_WILL_DISAPPEAR", "Ce courrier sort de votre périmètre. Vous ne pourrez plus y accéder ensuite."); +//maarchIVS translate + +define("_IVS_LENGTH_ID_BELOW_MIN_LENGTH", "La longueur est infèrieure à la longueur minimale"); +define("_IVS_LENGTH_EXCEEDS_MAX_LENGTH", "La longueur est supérieure à la longueur maximale"); +define("_IVS_LENGTH_NOT_ALLOWED", "La longueur n'est pas autorisée"); +define("_IVS_VALUE_NOT_ALLOWED", "La valeur n'est pas autorisée"); +define("_IVS_FORMAT_NOT_ALLOWED", "Le format n'est pas autorisé"); +define("_IVS_TOO_MANY_DIGITS", "Trop de caractères"); +define("_IVS_TOO_MANY_DECIMAL_DIGITS", "Trop de caractères décimaux");