Fix unbeautiful error message on intervention
This commit is contained in:
parent
85fc471d3d
commit
3c879ddd34
@ -173,7 +173,7 @@ if (empty($reshook))
|
|||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
$mesg = $object->error;
|
||||||
}
|
}
|
||||||
} elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer)
|
} elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer)
|
||||||
{
|
{
|
||||||
@ -198,7 +198,7 @@ if (empty($reshook))
|
|||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
$mesg = $object->error;
|
||||||
}
|
}
|
||||||
} elseif ($action == 'add' && $user->rights->ficheinter->creer)
|
} elseif ($action == 'add' && $user->rights->ficheinter->creer)
|
||||||
{
|
{
|
||||||
@ -406,7 +406,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$mesg = '<div class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")).'</div>';
|
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty"));
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
}
|
||||||
} elseif ($action == 'update' && $user->rights->ficheinter->creer)
|
} elseif ($action == 'update' && $user->rights->ficheinter->creer)
|
||||||
@ -456,17 +456,17 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if (!GETPOST('np_desc', 'restricthtml') && empty($conf->global->FICHINTER_EMPTY_LINE_DESC))
|
if (!GETPOST('np_desc', 'restricthtml') && empty($conf->global->FICHINTER_EMPTY_LINE_DESC))
|
||||||
{
|
{
|
||||||
$mesg = '<div class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")).'</div>';
|
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description"));
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($conf->global->FICHINTER_WITHOUT_DURATION) && !GETPOST('durationhour', 'int') && !GETPOST('durationmin', 'int'))
|
if (empty($conf->global->FICHINTER_WITHOUT_DURATION) && !GETPOST('durationhour', 'int') && !GETPOST('durationmin', 'int'))
|
||||||
{
|
{
|
||||||
$mesg = '<div class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Duration")).'</div>';
|
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Duration"));
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($conf->global->FICHINTER_WITHOUT_DURATION) && GETPOST('durationhour', 'int') >= 24 && GETPOST('durationmin', 'int') > 0)
|
if (empty($conf->global->FICHINTER_WITHOUT_DURATION) && GETPOST('durationhour', 'int') >= 24 && GETPOST('durationmin', 'int') > 0)
|
||||||
{
|
{
|
||||||
$mesg = '<div class="error">'.$langs->trans("ErrorValueTooHigh").'</div>';
|
$mesg = $langs->trans("ErrorValueTooHigh");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (!$error)
|
if (!$error)
|
||||||
@ -538,7 +538,7 @@ if (empty($reshook))
|
|||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
$mesg = $object->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -735,9 +735,9 @@ if (empty($reshook))
|
|||||||
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
|
$mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
|
||||||
} else {
|
} else {
|
||||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
$mesg = $object->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user