Skip to content
Snippets Groups Projects
Commit f352f5cb authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: add current entity if not defined

parent 1f46bbda
No related branches found
No related tags found
No related merge requests found
......@@ -45,17 +45,21 @@ top_httphead();
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
// Registering the location of boxes
if((isset($_GET['action']) && ! empty($_GET['action'])) && (isset($_GET['name']) && ! empty($_GET['name'])) )
if ((isset($_GET['action']) && ! empty($_GET['action'])) && (isset($_GET['name']) && ! empty($_GET['name'])) )
{
$entity = (GETPOST('entity','int') ? GETPOST('entity','int') : $conf->entity);
$action = GETPOST('action', 'alpha');
$name = GETPOST('name', 'alpha');
if ($user->admin)
{
if ($_GET['action'] == 'set')
if ($action == 'set')
{
dolibarr_set_const($db, GETPOST('name','alpha'), 1, 'chaine', 0, '', GETPOST('entity','int'));
dolibarr_set_const($db, $name, 1, 'chaine', 0, '', $entity);
}
else if ($_GET['action'] == 'del')
else if ($action == 'del')
{
dolibarr_del_const($db, GETPOST('name','alpha'), GETPOST('entity','int'));
dolibarr_del_const($db, $name, $entity);
}
}
}
......
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