Fix: use current entity if not defined
This commit is contained in:
parent
e8c7a37772
commit
f117c64551
@ -46,17 +46,21 @@ top_httphead();
|
|||||||
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
|
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
|
||||||
|
|
||||||
// Registering the location of boxes
|
// 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 ($user->admin)
|
||||||
{
|
{
|
||||||
if ($_GET['action'] == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, $_GET['name'], 1, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, $name, 1, 'chaine', 0, '', $entity);
|
||||||
}
|
}
|
||||||
else if ($_GET['action'] == 'del')
|
else if ($action == 'del')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, $_GET['name'], $conf->entity);
|
dolibarr_del_const($db, $name, $entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user