Debug v20

This commit is contained in:
Laurent Destailleur 2024-07-30 12:06:59 +02:00
parent 4223c6241c
commit d24631de7e
2 changed files with 15 additions and 4 deletions

View file

@ -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'] = '<br>' . $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'] = '<br>'.$tmpcategstring;
}
}
return $datas;

View file

@ -9265,7 +9265,11 @@ class Form
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
}
}
return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
if (empty($toprint)) {
return '';
} else {
return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
}
}
if ($rendermode == 0) {