Fix: Check id field are mandatory
This commit is contained in:
parent
d6e907b69b
commit
f82bec552b
@ -224,17 +224,18 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel);
|
$error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel);
|
||||||
$action = ($action=='add'?'create':'edit');
|
$action = (($action=='add'||$action=='create')?'create':'edit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||||
|
|
||||||
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
|
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$error++;
|
$error++;
|
||||||
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
|
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
|
||||||
$action = ($action=='add'?'create':'edit');
|
$action = (($action=='add'||$action=='create')?'create':'edit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -714,8 +715,7 @@ else
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_htmloutput_mesg(is_numeric($error)?'':$error, $errors, 'error');
|
||||||
dol_htmloutput_errors($error,$errors);
|
|
||||||
|
|
||||||
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
|
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user