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

Fix pb with entity

parent 2dda506f
No related branches found
No related tags found
No related merge requests found
...@@ -288,7 +288,7 @@ function form_constantes($tableau) ...@@ -288,7 +288,7 @@ function form_constantes($tableau)
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; 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 '<input type="hidden" name="constnote" value="'.nl2br($obj->note).'">';
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
......
...@@ -381,13 +381,14 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not ...@@ -381,13 +381,14 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
// Check parameters // Check parameters
if (empty($name)) 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; exit;
} }
//dol_syslog("dolibarr_set_const name=$name, value=$value type=$type, visible=$visible, note=$note entity=$entity");
$db->begin(); $db->begin();
//dol_syslog("dolibarr_set_const name=$name, value=$value");
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE ".$db->decrypt('name')." = '".addslashes($name)."'"; $sql.= " WHERE ".$db->decrypt('name')." = '".addslashes($name)."'";
$sql.= " AND entity = ".$entity; $sql.= " AND entity = ".$entity;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment