New: Add test on mandatory field
This commit is contained in:
parent
bd22581687
commit
0ee08418cc
@ -264,6 +264,7 @@ else if ($action == 'add' && $user->rights->propale->creer)
|
|||||||
|
|
||||||
$datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
$datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||||
$date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
|
$date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
|
||||||
|
$duration=GETPOST('duree_validite');
|
||||||
|
|
||||||
if (empty($datep))
|
if (empty($datep))
|
||||||
{
|
{
|
||||||
@ -271,6 +272,12 @@ else if ($action == 'add' && $user->rights->propale->creer)
|
|||||||
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create');
|
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
if (empty($duration))
|
||||||
|
{
|
||||||
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors');
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -287,7 +294,7 @@ else if ($action == 'add' && $user->rights->propale->creer)
|
|||||||
$object->availability_id = GETPOST('availability_id');
|
$object->availability_id = GETPOST('availability_id');
|
||||||
$object->demand_reason_id = GETPOST('demand_reason_id');
|
$object->demand_reason_id = GETPOST('demand_reason_id');
|
||||||
$object->fk_delivery_address = GETPOST('fk_address');
|
$object->fk_delivery_address = GETPOST('fk_address');
|
||||||
$object->duree_validite = GETPOST('duree_validite');
|
$object->duree_validite = $duration;
|
||||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||||
$object->remise_percent = GETPOST('remise_percent');
|
$object->remise_percent = GETPOST('remise_percent');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user