File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff 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() {
You can’t perform that action at this time.
0 commit comments