Пример #1
0
 static function getListSection($formID)
 {
     global $LANG, $CFG_GLPI;
     $section = new self();
     $listSection = $section->find("plugin_formcreator_forms_id = '{$formID}' ORDER BY position");
     if (!empty($listSection)) {
         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']["section"][3];
         echo '</th>';
         echo '<th>';
         echo $LANG['plugin_formcreator']["target"][2];
         echo '</th>';
         echo '<th>';
         echo $LANG['plugin_formcreator']["question"][11];
         echo '</th>';
         foreach ($listSection as $section_id => $values) {
             echo '<tr>';
             echo '<td class="center">';
             echo $section_id;
             echo '</td>';
             echo '<td>';
             echo '<a id="section' . $section_id . '">' . $values['name'] . '</a>';
             echo '</td>';
             echo '<td>';
             echo PluginFormcreatorTarget::getTargetName($values['plugin_formcreator_targets_id']);
             echo '</td>';
             echo '<td class="center">';
             echo $values['position'];
             echo '</td>';
             echo '</tr>';
         }
         echo '</table>';
         echo '</div>';
         foreach ($listSection as $section_id => $values) {
             Ajax::updateItemOnEvent('section' . $section_id, 'editSection', $CFG_GLPI["root_doc"] . '/plugins/formcreator/ajax/vieweditobject.php', array('id' => $section_id, 'type' => __CLASS__), array('click'));
         }
         echo '<br /><div id="editSection"></div>';
     }
 }