From bb92244063a6f4993218465b13d0f5bee2f2b461 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Sat, 8 Jun 2019 10:26:58 +0200 Subject: [PATCH] feat(dropdown): show serial and inventory number when available Signed-off-by: Thierry Bugier --- inc/fields/dropdownfield.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/fields/dropdownfield.class.php b/inc/fields/dropdownfield.class.php index 9b166d5b5..81c74e061 100644 --- a/inc/fields/dropdownfield.class.php +++ b/inc/fields/dropdownfield.class.php @@ -158,6 +158,16 @@ public function displayField($canEdit = true) { $dparams['condition'] = $dparams_cond_crit; } + $emptyItem = new $itemtype(); + $emptyItem->getEmpty(); + $dparams['displaywith'] = []; + if (isset($emptyItem->fields['serial'])) { + $dparams['displaywith'][] = 'serial'; + } + if (isset($emptyItem->fields['otherserial'])) { + $dparams['displaywith'][] = 'otherserial'; + } + $itemtype::dropdown($dparams); } echo PHP_EOL;