/** * Form to add a solution to an ITIL object * * @since version 0.84 * * @param $entities_id **/ static function showMassiveSolutionForm($entities_id) { global $CFG_GLPI; echo "<table class='tab_cadre_fixe'>"; echo '<tr><th colspan=4>' . __('Solve tickets') . '</th></tr>'; $rand_template = mt_rand(); $rand_text = mt_rand(); $rand_type = mt_rand(); echo "<tr class='tab_bg_2'>"; echo "<td>" . _n('Solution template', 'Solution templates', 1) . "</td><td>"; SolutionTemplate::dropdown(array('value' => 0, 'entity' => $entities_id, 'rand' => $rand_template, 'toupdate' => array('value_fieldname' => 'value', 'to_update' => 'solution' . $rand_text, 'url' => $CFG_GLPI["root_doc"] . "/ajax/solution.php", 'moreparams' => array('type_id' => 'dropdown_solutiontypes_id' . $rand_type)))); echo "</td><td colspan='2'> </td></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . __('Solution type') . "</td><td>"; SolutionType::dropdown(array('value' => 0, 'rand' => $rand_type, 'entity' => $entities_id)); echo "</td><td colspan='2'> </td></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . __('Description') . "</td><td colspan='3'>"; $rand = mt_rand(); Html::initEditorSystem("solution{$rand}"); echo "<div id='solution{$rand_text}'>"; echo "<textarea id='solution{$rand}' name='solution' rows='12' cols='80' class='form-control'></textarea></div>"; echo "</td></tr>"; echo '</table>'; }
/** * Print the wainting ticket form * * @param $ID integer ID of the item * @param $options array * - target filename : where to go when done. * - withtemplate boolean : template or basic item * * @return Nothing (display) * */ function showForm($ID, $options = array()) { global $CFG_GLPI; // validation des droits if (!$this->canview()) { return false; } $ticket = new Ticket(); if ($ID > 0) { if (!$ticket->getFromDB($ID)) { $ticket->getEmpty(); } } else { // Create item $ticket->getEmpty(); } // If values are saved in session we retrieve it if (isset($_SESSION['glpi_plugin_moreticket_close'])) { foreach ($_SESSION['glpi_plugin_moreticket_close'] as $key => $value) { $ticket->fields[$key] = str_replace(array('\\r\\n', '\\r', '\\n'), '', $value); } } unset($_SESSION['glpi_plugin_moreticket_close']); echo "<div class='spaced' id='moreticket_close_ticket'>"; echo "</br>"; echo "<table class='moreticket_close_ticket' id='cl_menu'>"; echo "<tr><td>"; echo _n('Solution template', 'Solution templates', 1) . " : "; $rand_template = mt_rand(); $rand_type = 0; $rand_text = mt_rand(); $rand_type = mt_rand(); SolutionTemplate::dropdown(array('value' => 0, 'entity' => $ticket->getEntityID(), 'rand' => $rand_template, 'toupdate' => array('value_fieldname' => 'value', 'to_update' => 'solution' . $rand_text, 'url' => $CFG_GLPI["root_doc"] . "/ajax/solution.php", 'moreparams' => array('type_id' => 'dropdown_solutiontypes_id' . $rand_type)))); echo "</td></tr>"; echo "<tr><td>"; echo _n('Solution type', 'Solution types', 1); $config = new PluginMoreticketConfig(); if ($config->mandatorySolutionType() == true) { echo " : <span class='red'>*</span> "; } Dropdown::show('SolutionType', array('value' => $ticket->getField('solutiontypes_id'), 'rand' => $rand_type, 'entity' => $ticket->getEntityID())); echo "</td></tr>"; echo "<tr><td>"; echo __('Solution description', 'moreticket') . " : <span class='red'>*</span> "; $rand = mt_rand(); Html::initEditorSystem("solution" . $rand); echo "<div id='solution{$rand_text}'>"; echo "<textarea id='solution{$rand}' name='solution' rows='3'>" . stripslashes($ticket->fields['solution']) . "</textarea></div>"; echo "</td></tr>"; echo "</table>"; echo "</div>"; }