Skip to content
Snippets Groups Projects
Commit f82bec55 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Check id field are mandatory

parent d6e907b6
No related branches found
No related tags found
No related merge requests found
......@@ -224,19 +224,20 @@ if (empty($reshook))
{
$langs->load("errors");
$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';
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
{
$langs->load("errors");
$error++;
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
$action = ($action=='add'?'create':'edit');
$action = (($action=='add'||$action=='create')?'create':'edit');
}
}
}
}
if (! $error)
......@@ -714,8 +715,7 @@ else
print "<br>\n";
}
dol_htmloutput_errors($error,$errors);
dol_htmloutput_mesg(is_numeric($error)?'':$error, $errors, 'error');
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment