Skip to content

Commit

Permalink
Fix: Check id field are mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 18, 2013
1 parent d6e907b commit f82bec5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions htdocs/societe/soc.php
Expand Up @@ -224,19 +224,20 @@
{
$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)
Expand Down Expand Up @@ -714,8 +715,7 @@
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">';

Expand Down

0 comments on commit f82bec5

Please sign in to comment.