*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,7 +29,7 @@
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
-if (!empty($conf->ldap->enabled)) {
+if (isModEnabled('ldap')) {
require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
}
@@ -706,6 +707,33 @@ class UserGroup extends CommonObject
return '';
}
+ /**
+ * getTooltipContentArray
+ *
+ * @param array $params ex option, infologin
+ * @since v18
+ * @return array
+ */
+ public function getTooltipContentArray($params)
+ {
+ global $conf, $langs, $menumanager;
+
+ $option = $params['option'] ?? '';
+
+ $datas = [];
+ if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ $langs->load("users");
+ return ['optimize' => $langs->trans("ShowGroup")];
+ }
+ $datas['divopen'] = '';
+ $datas['picto'] = img_picto('', 'group').' '.$langs->trans("Group").'
';
+ $datas['name'] = ''.$langs->trans('Name').': '.$this->name;
+ $datas['description'] = '
'.$langs->trans("Description").': '.$this->note;
+ $datas['divclose'] = '
';
+
+ return $datas;
+ }
+
/**
* Return a link to the user card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
@@ -759,8 +787,18 @@ class UserGroup extends CommonObject
$label = $langs->trans("ShowGroup");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"';
- $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
+ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ ];
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' class="classforajaxtooltip'.($morecss ? ' '.$morecss : '').'"';
+ } else {
+ $linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"';
+ $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
+ }
}
$linkstart = 'ldap->enabled)) {
+if (isModEnabled('ldap')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
}
diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php
index 1d57db17ffc..ec419ad9987 100644
--- a/test/phpunit/AllTests.php
+++ b/test/phpunit/AllTests.php
@@ -41,7 +41,7 @@ if (empty($conf->adherent->enabled)) {
print "Error: Module member must be enabled to have significant results.\n";
exit(1);
}
-if (!empty($conf->ldap->enabled)) {
+if (isModEnabled('ldap')) {
print "Error: LDAP module should not be enabled.\n";
exit(1);
}