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 {
|
} else {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
|
||||||
|
|
||||||
$toprint = array();
|
$toprint = array();
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
if ($obj->rowid) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||||
$c = new Categorie($this->db);
|
$c = new Categorie($this->db);
|
||||||
$c->fetch($obj->rowid);
|
$result = $c->fetch($obj->rowid);
|
||||||
|
if ($result > 0) {
|
||||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
||||||
foreach ($ways as $way) {
|
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>';
|
$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>';
|
$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