Merge pull request #21036 from OPEN-DSI/14.0_fix_show_category_on_sellist_extrafields
FIX: Show sellist type of extrafield when none category selected
This commit is contained in:
commit
f5da6ebfe2
@ -1766,15 +1766,18 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
$toprint = array();
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$c = new Categorie($this->db);
|
||||
$c->fetch($obj->rowid);
|
||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
|
||||
if ($obj->rowid) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$c = new Categorie($this->db);
|
||||
$result = $c->fetch($obj->rowid);
|
||||
if ($result > 0) {
|
||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user