Skip to content

Commit

Permalink
fix(glpiselectfield): restore palceholder DOM elements
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 29, 2020
1 parent 406d28f commit b64fc10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions inc/question.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,11 @@ public function showForm($ID, $options = []) {
]);
echo '</td>';

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

echo '<td>';
echo '<td id="plugin_formcreator_subtype_value">';
echo '</td>';
echo '</tr>';

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

// Empty row for question-specific settings
// To be replaced bydynamically
// To be replaced dynamically
echo '<tr class="plugin_formcreator_question_specific">';
echo '<td></td><td></td><td></td><td></td>';
echo '</tr>';
Expand Down
4 changes: 3 additions & 1 deletion js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -1401,12 +1401,14 @@ function plugin_formcreator_changeQuestionType(rand) {

$('.plugin_formcreator_required').toggle(response.may_be_required);
$('.plugin_formcreator_mayBeEmpty').toggle(response.may_be_empty);
$('#plugin_formcreator_subtype_label').html(response.label);
$('#plugin_formcreator_subtype_value').html(response.field);
plugin_formcreator_updateQuestionSpecific(response.additions);
});
}

function plugin_formcreator_updateQuestionSpecific(html) {
$('.plugin_formcreator_question_specific:gt(0)').remove();
$('.plugin_formcreator_question_specific').slice(1).remove();
if (html == '') {
$('.plugin_formcreator_question_specific').hide();
return;
Expand Down

0 comments on commit b64fc10

Please sign in to comment.