static function getListQuestion($formID) { global $LANG, $CFG_GLPI; $question = new self(); $listQuestion = $question->find("plugin_formcreator_forms_id = '{$formID}' ORDER BY plugin_formcreator_sections_id, position"); if (!empty($listQuestion)) { echo '<div class="center">'; echo '<table class="tab_cadrehov" border="0" >'; echo '<th width="20">'; echo 'ID'; echo '</th>'; echo '<th>'; echo $LANG['plugin_formcreator']["question"][2]; echo '</th>'; echo '<th>'; echo __('Type'); echo '</th>'; echo '<th>'; echo $LANG['plugin_formcreator']["section"][3]; echo '</th>'; echo '<th>'; echo $LANG['plugin_formcreator']["question"][11]; echo '</th>'; foreach ($listQuestion as $question_id => $values) { echo '<tr>'; echo '<td class="center">'; echo $question_id; echo '</td>'; echo '<td>'; echo '<a id="question' . $question_id . '">' . $values['name'] . '</a>'; echo '</td>'; echo '<td>'; echo self::getNameType($values['type']); echo '</td>'; echo '<td>'; echo PluginFormcreatorSection::getSectionName($values['plugin_formcreator_sections_id']); echo '</td>'; echo '<td class="center">'; echo $values['position']; echo '</td>'; echo '</tr>'; } echo '</table>'; echo '</div>'; foreach ($listQuestion as $question_id => $values) { Ajax::updateItemOnEvent('question' . $question_id, 'editQuestion', $CFG_GLPI["root_doc"] . '/plugins/formcreator/ajax/vieweditobject.php', array('id' => $question_id, 'type' => __CLASS__), array('click')); } echo '<br /><div id="editQuestion"></div>'; } }
static function popupContent($formID) { global $LANG; echo "<h1>" . $LANG['plugin_formcreator']["headings"][5] . "</h1>"; //table code questions / réponses echo "<table class='tab_cadre_fixe fix_tab_height'>"; echo "<tr>"; echo "<th>" . $LANG['plugin_formcreator']["question"][2] . "</th>"; echo "<th>" . __('Heading') . "</th>"; echo "<th>" . $LANG['plugin_formcreator']["target"][6] . "</th>"; echo "<th>" . $LANG['plugin_formcreator']["section"][3] . "</th>"; echo "</tr>"; $question = new PluginFormcreatorQuestion(); $listQuestion = $question->find("plugin_formcreator_forms_id = '" . $formID . "' ORDER BY plugin_formcreator_sections_id, position"); if (!empty($listQuestion)) { foreach ($listQuestion as $question_id => $value) { if ($value['type'] != '5' && $value['type'] != 6) { echo "<tr>"; echo "<td>" . $value['name'] . "</td>"; echo "<td>##question_" . $value['id'] . "##</td>"; echo "<td>##answer_" . $value['id'] . "##</td>"; echo "<td>" . PluginFormcreatorSection::getSectionName($value['plugin_formcreator_sections_id']) . "</td>"; echo "</tr>"; } } } else { echo "<tr>"; echo "<td colspan='4' class='center'>" . $LANG['plugin_formcreator']["target"][7] . "</td>"; echo "</tr>"; } echo "</table><br/>"; }