Fix pb with entity

This commit is contained in:
Laurent Destailleur 2010-01-21 22:44:57 +00:00
parent 2dda506f45
commit 04d17c45f7
2 changed files with 4 additions and 3 deletions

View File

@ -288,7 +288,7 @@ function form_constantes($tableau)
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="'.$obj->name.'">';
print '<input type="hidden" name="constname" value="'.$const.'">';
print '<input type="hidden" name="constnote" value="'.nl2br($obj->note).'">';
print "<tr $bc[$var]>";

View File

@ -381,13 +381,14 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
// Check parameters
if (empty($name))
{
dol_print_error("Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
dol_print_error($db,"Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
exit;
}
//dol_syslog("dolibarr_set_const name=$name, value=$value type=$type, visible=$visible, note=$note entity=$entity");
$db->begin();
//dol_syslog("dolibarr_set_const name=$name, value=$value");
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE ".$db->decrypt('name')." = '".addslashes($name)."'";
$sql.= " AND entity = ".$entity;