Skip to content

Commit bb92244

Browse files
committed
feat(dropdown): show serial and inventory number when available
Signed-off-by: Thierry Bugier <[email protected]>
1 parent f3235ad commit bb92244

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

inc/fields/dropdownfield.class.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@ public function displayField($canEdit = true) {
158158
$dparams['condition'] = $dparams_cond_crit;
159159
}
160160

161+
$emptyItem = new $itemtype();
162+
$emptyItem->getEmpty();
163+
$dparams['displaywith'] = [];
164+
if (isset($emptyItem->fields['serial'])) {
165+
$dparams['displaywith'][] = 'serial';
166+
}
167+
if (isset($emptyItem->fields['otherserial'])) {
168+
$dparams['displaywith'][] = 'otherserial';
169+
}
170+
161171
$itemtype::dropdown($dparams);
162172
}
163173
echo PHP_EOL;

0 commit comments

Comments
 (0)