Skip to content

Commit

Permalink
fix(glpiobject): make items more easily searchable
Browse files Browse the repository at this point in the history
and iso fucntinal with assignation to tickets in GLPI

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 19, 2019
1 parent 98a76f2 commit 0fd617b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions inc/fields/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,23 @@ public function displayField($canEdit = true) {
if (isset($emptyItem->fields['otherserial'])) {
$dparams['displaywith'][] = 'otherserial';
}

$itemtype::dropdown($dparams);
if (count($dparams['displaywith']) > 0) {
$dparams['itemtype'] = $itemtype;
$dparams['table'] = $itemtype::getTable();
$dparams['multiple'] = false;
$dparams['valuename'] = Dropdown::EMPTY_VALUE;
if ($dparams['value'] != 0) {
$dparams['valuename'] = $dparams['value'];
}
echo Html::jsAjaxDropdown(
$fieldName,
$domId,
$CFG_GLPI['root_doc']."/ajax/getDropdownFindNum.php",
$dparams
);
} else {
$itemtype::dropdown($dparams);
}
}
echo PHP_EOL;
echo Html::scriptBlock("$(function() {
Expand Down

0 comments on commit 0fd617b

Please sign in to comment.