Fix: Badd error message

This commit is contained in:
Laurent Destailleur 2014-03-02 15:58:02 +01:00
parent 748d769140
commit d9dc8de4e6

View File

@ -88,17 +88,24 @@ if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->
else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer)
{
$object->fetch($id);
$result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
if ($result > 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
$mesg=$object->error;
}
if (! GETPOST('dateend'))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),'errors');
}
if (! $error)
{
$object->fetch($id);
$result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
if ($result > 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
$mesg=$object->error;
}
}
}
// Si ajout champ produit predefini
@ -1514,7 +1521,7 @@ else
if ($objp->statut == 4)
{
print $langs->trans("DateEndReal").' ';
$form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline");
$form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",1,1);
}
}
print '</td>';