Skip to content

Commit 0fd617b

Browse files
committed
fix(glpiobject): make items more easily searchable
and iso fucntinal with assignation to tickets in GLPI Signed-off-by: Thierry Bugier <[email protected]>
1 parent 98a76f2 commit 0fd617b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

inc/fields/dropdownfield.class.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,23 @@ public function displayField($canEdit = true) {
172172
if (isset($emptyItem->fields['otherserial'])) {
173173
$dparams['displaywith'][] = 'otherserial';
174174
}
175-
176-
$itemtype::dropdown($dparams);
175+
if (count($dparams['displaywith']) > 0) {
176+
$dparams['itemtype'] = $itemtype;
177+
$dparams['table'] = $itemtype::getTable();
178+
$dparams['multiple'] = false;
179+
$dparams['valuename'] = Dropdown::EMPTY_VALUE;
180+
if ($dparams['value'] != 0) {
181+
$dparams['valuename'] = $dparams['value'];
182+
}
183+
echo Html::jsAjaxDropdown(
184+
$fieldName,
185+
$domId,
186+
$CFG_GLPI['root_doc']."/ajax/getDropdownFindNum.php",
187+
$dparams
188+
);
189+
} else {
190+
$itemtype::dropdown($dparams);
191+
}
177192
}
178193
echo PHP_EOL;
179194
echo Html::scriptBlock("$(function() {

0 commit comments

Comments
 (0)