Qual: Better error management
This commit is contained in:
parent
27300fe898
commit
f198d8bd8e
@ -212,7 +212,15 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
|||||||
if (! $datecotisation)
|
if (! $datecotisation)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg=$langs->trans("BadDateFormat");
|
$langs->load("errors");
|
||||||
|
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
|
||||||
|
$action='addsubscription';
|
||||||
|
}
|
||||||
|
if (GETPOST('end') && ! $datesubend)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$langs->load("errors");
|
||||||
|
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
if (! $datesubend)
|
if (! $datesubend)
|
||||||
|
|||||||
@ -391,11 +391,12 @@ class Translate {
|
|||||||
*/
|
*/
|
||||||
function trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0)
|
function trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0)
|
||||||
{
|
{
|
||||||
if (! empty($this->tab_translate[$key])) // Translation is available
|
if (! empty($this->tab_translate[$key])) // Translation is available
|
||||||
{
|
{
|
||||||
$str=$this->tab_translate[$key];
|
$str=$this->tab_translate[$key];
|
||||||
|
|
||||||
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
||||||
|
|
||||||
if ($maxsize) $str=dol_trunc($str,$maxsize);
|
if ($maxsize) $str=dol_trunc($str,$maxsize);
|
||||||
|
|
||||||
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities
|
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user