Skip to content

Commit b64fc10

Browse files
committed
fix(glpiselectfield): restore palceholder DOM elements
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 406d28f commit b64fc10

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

inc/question.class.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,11 @@ public function showForm($ID, $options = []) {
730730
]);
731731
echo '</td>';
732732

733-
echo '<td>';
733+
// Dynamically filled for questions with a itemtype parameter (glpi select field)
734+
echo '<td id="plugin_formcreator_subtype_label">';
734735
echo '</td>';
735736

736-
echo '<td>';
737+
echo '<td id="plugin_formcreator_subtype_value">';
737738
echo '</td>';
738739
echo '</tr>';
739740

@@ -774,7 +775,7 @@ public function showForm($ID, $options = []) {
774775
echo '</tr>';
775776

776777
// Empty row for question-specific settings
777-
// To be replaced bydynamically
778+
// To be replaced dynamically
778779
echo '<tr class="plugin_formcreator_question_specific">';
779780
echo '<td></td><td></td><td></td><td></td>';
780781
echo '</tr>';

js/scripts.js.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,12 +1401,14 @@ function plugin_formcreator_changeQuestionType(rand) {
14011401

14021402
$('.plugin_formcreator_required').toggle(response.may_be_required);
14031403
$('.plugin_formcreator_mayBeEmpty').toggle(response.may_be_empty);
1404+
$('#plugin_formcreator_subtype_label').html(response.label);
1405+
$('#plugin_formcreator_subtype_value').html(response.field);
14041406
plugin_formcreator_updateQuestionSpecific(response.additions);
14051407
});
14061408
}
14071409

14081410
function plugin_formcreator_updateQuestionSpecific(html) {
1409-
$('.plugin_formcreator_question_specific:gt(0)').remove();
1411+
$('.plugin_formcreator_question_specific').slice(1).remove();
14101412
if (html == '') {
14111413
$('.plugin_formcreator_question_specific').hide();
14121414
return;

0 commit comments

Comments
 (0)