/** * Display a list of all forms on the configuration page * * @param CommonGLPI $item Instance of a CommonGLPI Item (The Config Item) * @param integer $tabnum Number of the current tab * @param integer $withtemplate * * @see CommonDBTM::displayTabContentForItem * * @return null Nothing, just display the list */ public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { $uri = strrchr($_SERVER['HTTP_REFERER'], '/'); if (strpos($uri, '?')) { $uri = substr($uri, 0, strpos($uri, '?')); } $uri = trim($uri, '/'); switch ($uri) { case "form.form.php": echo '<div style="text-align: left">'; $item->displayUserForm($item); echo '</div>'; break; } }
/** * Display a list of all forms on the configuration page * * @param CommonGLPI $item Instance of a CommonGLPI Item (The Config Item) * @param integer $tabnum Number of the current tab * @param integer $withtemplate * * @see CommonDBTM::displayTabContentForItem * * @return null Nothing, just display the list */ public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { global $DB; //[CRI] if ($item->getType() == 'PluginFormcreatorForm') { $uri = strrchr($_SERVER['HTTP_REFERER'], '/'); if (strpos($uri, '?')) { $uri = substr($uri, 0, strpos($uri, '?')); } $uri = trim($uri, '/'); switch ($uri) { case "form.form.php": echo '<div style="text-align: left">'; $item->displayUserForm($item); echo '</div>'; break; } } //[CRI] if ($item->getType() == 'Ticket') { $ticketid = $item->getID(); $formid = 0; $query = "SELECT * FROM glpi_plugin_formcreator_forms_items where itemtype='" . $item->getType() . "' and items_id = " . $ticketid . ""; //echo $query; $result = $DB->query($query); if ($data = $DB->fetch_assoc($result)) { $formid = $data['plugin_formcreator_forms_id']; } PluginFormcreatorInstruccion::showInstrucciontecnica($item, $formid, "PluginFormcreatorForm"); } return true; }