Qual: Better error management

This commit is contained in:
Laurent Destailleur 2011-08-27 16:41:30 +00:00
parent 27300fe898
commit f198d8bd8e
2 changed files with 12 additions and 3 deletions

View File

@ -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)

View File

@ -396,6 +396,7 @@ class Translate {
$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