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

FIX Error management during bank account creation

parent 0f8a8869
No related branches found
No related tags found
No related merge requests found
......@@ -60,9 +60,11 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($account->table_element);
/*
* Actions
*/
if ($_POST["action"] == 'add')
{
$error=0;
......@@ -129,6 +131,8 @@ if ($_POST["action"] == 'add')
if (! $error)
{
$db->begin();
$id = $account->create($user);
if ($id > 0)
{
......@@ -137,8 +141,13 @@ if ($_POST["action"] == 'add')
$account->setCategories($categories);
$_GET["id"]=$id; // Force chargement page en mode visu
$action='';
$db->commit();
}
else {
$db->rollback();
setEventMessages($account->error, $account->errors, 'errors');
$action='create'; // Force chargement page en mode creation
}
......
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