diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index e8b0a9c3fe8..af988c0dfa6 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1586,7 +1586,8 @@ class ActionComm extends CommonObject */ public function getTooltipContentArray($params) { - global $langs; + global $langs, $form; + $langs->load('agenda'); $datas = array(); @@ -1646,8 +1647,14 @@ class ActionComm extends CommonObject // show categories for this record only in ajax to not overload lists if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $form = new Form($this->db); - $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); + if (empty($form)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + $form = new Form($this->db); + } + $tmpcategstring = $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); + if ($tmpcategstring) { + $datas['categories'] = '
'.$tmpcategstring; + } } return $datas; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f32c0f4119f..3b3816446e9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9265,7 +9265,11 @@ class Form $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; } } - return '
    '; + if (empty($toprint)) { + return ''; + } else { + return '
    '; + } } if ($rendermode == 0) {