diff --git a/admin/setup.php b/admin/setup.php index 2ab3fc4..e38775f 100644 --- a/admin/setup.php +++ b/admin/setup.php @@ -67,7 +67,7 @@ ); } $selected = !empty($module) ? $module : '%'; -$sql = 'SELECT rowid, name, value FROM ' . MAIN_DB_PREFIX . 'const WHERE name LIKE "EASYTOOLTIP_' . $selected . '_' . $conf->entity . '%" ORDER by name'; +$sql = 'SELECT rowid, name, value FROM ' . MAIN_DB_PREFIX . 'const WHERE name LIKE "EASYTOOLTIP_' . $selected . '_' . $conf->entity . '_%" ORDER by name'; $resql = $db->query($sql); $modules = []; diff --git a/class/actions_easytooltip.class.php b/class/actions_easytooltip.class.php index 228c105..4c6f369 100644 --- a/class/actions_easytooltip.class.php +++ b/class/actions_easytooltip.class.php @@ -227,6 +227,18 @@ public function getTooltipContent($parameters, &$object, &$action, $hookmanager) } elseif (in_array('userdao', $contexts)) { /** @var User $object */ $found = true; + } elseif (in_array('bank_accountdao', $contexts)) { + /** @var Account $object */ + $found = true; + } elseif (in_array('memberdao', $contexts)) { + /** @var Adherent $object */ + $found = true; + } elseif (in_array('adherent_typedao', $contexts)) { + /** @var AdherentType $object */ + $found = true; + } elseif (in_array('ticketdao', $contexts)) { + /** @var Ticket $object */ + $found = true; } elseif (in_array('projectdao', $contexts)) { /** @var Project $object */ $found = true; diff --git a/lib/easytooltip.lib.php b/lib/easytooltip.lib.php index d8b30d5..f33708d 100644 --- a/lib/easytooltip.lib.php +++ b/lib/easytooltip.lib.php @@ -39,16 +39,17 @@ function easytooltipAdminPrepareHead() $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; - $sql = 'SELECT rowid, name, value FROM ' . MAIN_DB_PREFIX . 'const WHERE name LIKE "EASYTOOLTIP_%_' . $conf->entity . '%" ORDER by name'; + $sql = 'SELECT rowid, name, value FROM ' . MAIN_DB_PREFIX . 'const WHERE name LIKE "EASYTOOLTIP_%_' . $conf->entity . '_%" ORDER by name'; $resql = $db->query($sql); $modules = []; while ($resql && $obj = $db->fetch_object($resql)) { - $names = explode('_', $obj->name); - if (!isset($modules[$names[1]])) { - $modules[$names[1]] = 0; + $names = explode('_' . $conf->entity . '_', $obj->name); + $name = str_replace('EASYTOOLTIP_', '', $names[0]); + if (!isset($modules[$name])) { + $modules[$name] = 0; } - $modules[$names[1]]++; + $modules[$name]++; } foreach ($modules as $key => $value) { $head[$h][0] = dol_buildpath("/easytooltip/admin/setup.php?module=" . $key, 1);