Create a close form part including CSRF token
static public closeForm ( $display = true ) : String | ||
$display | boolean Display or return string (default true) | |
return | String |
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { echo "<form name='notificationtargets_form' id='notificationtargets_form'\n method='post' action=' "; echo Toolbox::getItemTypeFormURL(__CLASS__) . "'>"; echo "<table class ='tab_cadre_fixe'>"; echo '<tr><th colspan="2">' . __('Access type', 'formcreator') . '</th></tr>'; echo '<td>' . __('Access', 'formcreator') . '</td>'; echo '<td>'; Dropdown::showFromArray('access_rights', array(PluginFormcreatorForm::ACCESS_PUBLIC => __('Public access', 'formcreator'), PluginFormcreatorForm::ACCESS_PRIVATE => __('Private access', 'formcreator'), PluginFormcreatorForm::ACCESS_RESTRICTED => __('Restricted access', 'formcreator')), array('value' => isset($item->fields["access_rights"]) ? $item->fields["access_rights"] : 1)); echo '</td>'; if ($item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_RESTRICTED) { echo '<tr><th colspan="2">' . self::getTypeName(2) . '</th></tr>'; $table = getTableForItemType(__CLASS__); $table_profile = getTableForItemType('Profile'); $query = "SELECT p.`id`, p.`name`, IF(f.`plugin_formcreator_profiles_id` IS NOT NULL, 1, 0) AS `profile`\n FROM {$table_profile} p\n LEFT JOIN {$table} f\n ON p.`id` = f.`plugin_formcreator_profiles_id`\n AND f.`plugin_formcreator_forms_id` = " . (int) $item->fields['id']; $result = $GLOBALS['DB']->query($query); while (list($id, $name, $profile) = $GLOBALS['DB']->fetch_array($result)) { $checked = $profile ? ' checked' : ''; echo '<tr><td colspan="2"><label>'; echo '<input type="checkbox" name="profiles_id[]" value="' . $id . '" ' . $checked . '> '; echo $name; echo '</label></td></tr>'; } } echo '<tr>'; echo '<td class="center" colspan="2">'; echo '<input type="hidden" name="profiles_id[]" value="0" />'; echo '<input type="hidden" name="form_id" value="' . (int) $item->fields['id'] . '" />'; echo '<input type="submit" name="update" value="' . __('Save') . '" class="submit" />'; echo "</td>"; echo "</tr>"; echo "</table>"; Html::closeForm(); }
/** * Show form * * @global type $CFG_GLPI * @param type $ID * @param type $options */ function showForm($ID = 0, $options = array()) { global $CFG_GLPI; echo "<div class='center first-bloc'>"; echo "<form name='field_form' method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'>"; echo "<th>" . self::getTypeName() . "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='tab_bg_2 center'>"; echo PluginShellcommandsCommandGroup::getTypeName(1) . " "; Dropdown::show('PluginShellcommandsCommandGroup', array('entity' => $_SESSION['glpiactive_entity'], 'width' => 200)); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='tab_bg_2 center'>"; $this->getEditValue(); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='tab_bg_2 center'>"; echo "<input type='button' class='submit' onclick='shellcommand_advanced_execution(\"" . $CFG_GLPI['root_doc'] . "\",\"field_form\", \"advanced_execution_result\");' name='advanced_execution' value='" . __('Execute') . "'/>"; echo "</td>"; echo "</tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; echo "<div class='spaced' id='advanced_execution_result'></div>"; }
function showForm() { $this->getfromDB(1); $target = self::getFormURL(); echo "<div align='center'><form method='post' action=\"{$target}\">"; echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>"; echo self::getTypeName(0) . "</th></tr>"; echo "<tr class='tab_bg_1'><td>"; echo "<select name=\"unit\" size=\"1\"> "; echo "<option "; if ($this->isMetricUnit()) { echo "selected "; } echo "value='" . self::METRIC_UNIT . "'>" . __('metric', 'racks') . "</option>"; echo "<option "; if (!$this->isMetricUnit()) { echo "selected "; } echo "value='" . self::NON_METRIC_UNIT . "'>" . __('English', 'racks') . "</option>"; echo "</select> "; echo "</td>"; echo "<td>"; echo Html::hidden('id', array('value' => 1)); echo Html::submit(_sx('button', 'Post'), array('name' => 'update')); echo "</table>"; Html::closeForm(); echo "</div>"; }
static function showFormAlerts($target) { $self = new self(); $self->getFromDB(1); echo "<form action='{$target}' method='post'>"; echo "<input type='hidden' name='id' value='1'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . __('Reminders frequency', 'additionalalerts') . " " . PluginAdditionalalertsInfocomAlert::getTypeName(2) . "</td><td>"; Alert::dropdownYesNo(array('name' => "use_infocom_alert", 'value' => $self->fields["use_infocom_alert"])); echo "</td></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td >" . __('Reminders frequency', 'additionalalerts') . " " . __('New imported computers from OCS-NG', 'additionalalerts') . "</td><td>"; Alert::dropdownYesNo(array('name' => "use_newocs_alert", 'value' => $self->fields["use_newocs_alert"])); echo "</td></tr>"; echo "<tr class='tab_bg_2'><td >" . __('OCS-NG Synchronization alerts', 'additionalalerts') . "</td><td>"; Alert::dropdownIntegerNever('delay_ocs', $self->fields["delay_ocs"], array('max' => 99)); echo " " . _n('Day', 'Days', 2) . "</td></tr>"; echo "</td></tr>"; echo "<tr class='tab_bg_2'><td class='center' colspan='2'>"; echo "<input type='hidden' name='id' value='1'>"; echo "<input class='submit' type='submit' name='update' value='" . _sx('button', 'Save') . "'>"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); }
function showDetails($perfdatas_id) { global $CFG_GLPI; $a_details = $this->find("`plugin_monitoring_perfdatas_id`='".$perfdatas_id."'", "position"); echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'>"; echo "<th>"; echo __('Name'); echo "</th>"; echo "<th>"; echo __('Is name dynamic', 'monitoring'); echo "</th>"; echo "<th>"; echo __('Position', 'monitoring'); echo "</th>"; for ($i=1; $i<9; $i++) { echo "<th>"; echo __('Value', 'monitoring').' '.$i; echo "</th>"; } echo "<th>"; echo "</th>"; echo "</tr>"; foreach ($a_details as $a_detail) { echo "<form name='form' method='post' action='".$CFG_GLPI['root_doc']."/plugins/monitoring/front/perfdatadetail.form.php'>"; $this->showDetail($a_detail['id']); Html::closeForm(); } echo "</table>"; }
static function showForDocumentCategory($item) { $documentCategory = new self(); if (!$documentCategory->getFromDBByQuery(" WHERE `documentcategories_id` = " . $item->fields['id'])) { $documentCategory->getEmpty(); } echo "<form name='form' method='post' action='" . Toolbox::getItemTypeFormURL($documentCategory->getType()) . "'>"; echo "<div align='center'><table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2'>" . __('Document category prefix', 'order') . "</th></tr>"; echo "<tr class='tab_bg_1'>"; // Dropdown group echo "<td>"; echo __('Document category prefix', 'order'); echo "</td>"; echo "<td>"; echo "<input type='text' name='documentcategories_prefix' value='" . $documentCategory->fields['documentcategories_prefix'] . "'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='tab_bg_2 center' colspan='6'>"; echo "<input type='submit' name='update' class='submit' value='" . _sx('button', 'Save') . "' >"; echo "<input type='hidden' name='documentcategories_id' class='submit' value='" . $item->fields['id'] . "' >"; echo "</td>"; echo "</tr>"; echo "</table></div>"; Html::closeForm(); }
function showForm($ID, $options = array()) { global $LANG; if (!Profile::canView()) { return false; } $canedit = self::canUpdate(); $profile = new Profile(); if ($ID) { //$this->getFromDBByProfile($ID); $profile->getFromDB($ID); } if ($canedit) { echo "<form action='" . $profile->getFormURL() . "' method='post'>"; } $rights = $this->getAllRights(); $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2')); if ($canedit) { echo "<div class='center'>"; echo "<input type='hidden' name='id' value=" . $ID . ">"; echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>"; echo "</div>"; } Html::closeForm(); $this->showLegend(); }
/** * Show profile form * * @param $items_id integer id of the profile * @param $target value url of target * * @return nothing **/ function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE) { echo "<div class='firstbloc'>"; if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) { $profile = new Profile(); echo "<form method='post' action='" . $profile->getFormURL() . "'>"; } $profile = new Profile(); $profile->getFromDB($profiles_id); $rights = array(array('itemtype' => 'PluginAddressingAddressing', 'label' => __('Generate reports', 'addressing'), 'field' => 'plugin_addressing')); $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General'))); echo "<table class='tab_cadre_fixehov'>"; $effective_rights = ProfileRight::getProfileRights($profiles_id, array('plugin_addressing_use_ping_in_equipment')); echo "<tr class='tab_bg_2'>"; echo "<td width='20%'>" . __('Use ping on equipment form', 'addressing') . "</td>"; echo "<td colspan='5'>"; Html::showCheckbox(array('name' => '_plugin_addressing_use_ping_in_equipment[1_0]', 'checked' => $effective_rights['plugin_addressing_use_ping_in_equipment'])); echo "</td></tr>\n"; echo "</table>"; if ($canedit && $closeform) { echo "<div class='center'>"; echo Html::hidden('id', array('value' => $profiles_id)); echo Html::submit(_sx('button', 'Save'), array('name' => 'update')); echo "</div>\n"; Html::closeForm(); } echo "</div>"; }
function showForm($target) { $this->GetfromDB(1); echo "<div align='center'><form method='post' action=\"{$target}\">"; echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>"; echo self::getTypeName(0) . "</th></tr>"; echo "<tr class='tab_bg_1'><td>"; echo "<select name=\"unit\" size=\"1\"> "; echo "<option "; if ($this->fields["unit"] == '1') { echo "selected "; } echo "value=\"1\">" . __('metric', 'racks') . "</option>"; echo "<option "; if ($this->fields["unit"] == '2') { echo "selected "; } echo "value=\"2\">" . __('English', 'racks') . "</option>"; echo "</select> "; echo "</td>"; echo "<td>"; echo "<div align='center'><input type='hidden' name='id' value='1'>"; echo "<input type='submit' name='update' value=\"" . _sx('button', 'Post') . "\" class='submit'></div></td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { $profile = new Profile(); $found_profiles = $profile->find(); $fields_profile = new self(); echo "<form name='form' method='post' action='" . $fields_profile->getFormURL() . "'>"; echo "<div class='spaced' id='tabsbody'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2'>" . _n("Profile", "Profiles", 2) . "</th></tr>"; foreach ($found_profiles as $profile_item) { //get right for current profile $found = $fields_profile->find("`profiles_id` = '" . $profile_item['id'] . "'\n AND `plugin_fields_containers_id` = '" . $item->fields['id'] . "'"); $first_found = array_shift($found); //display right echo "<tr>"; echo "<td>" . $profile_item['name'] . "</td>"; echo "<td>"; Profile::dropdownNoneReadWrite("rights[" . $profile_item['id'] . "]", $first_found['right']); echo "</td>"; echo "<tr>"; } echo "<ul>"; echo "<tr><td class='tab_bg_2 center' colspan='2'>"; echo "<input type='hidden' name='plugin_fields_containers_id' value='" . $item->fields['id'] . "' />"; echo "<input type='submit' name='update' value=\"" . _sx("button", "Save") . "\" class='submit'>"; echo "</td>"; echo "</tr>"; echo "</table></div>"; Html::closeForm(); }
function showForm($target) { global $DB; $rand = mt_rand(); $query = "SELECT *\n FROM `" . $this->getTable() . "`\n ORDER BY `states_id` ASC "; if ($result = $DB->query($query)) { $number = $DB->numrows($result); if ($number != 0) { echo "<div align='center'><form method='post' name='massiveaction_form{$rand}' id='massiveaction_form{$rand}' action=\"{$target}\">"; echo "<table class='tab_cadre_fixe' cellpadding='5'>"; echo "<tr>"; echo "<th></th><th>" . _n('Status', 'Statuses', 2) . "</th>"; echo "</tr>"; while ($ligne = $DB->fetch_array($result)) { $ID = $ligne["id"]; echo "<tr class='tab_bg_1'>"; echo "<td width='10' class='center'>"; echo "<input type='hidden' name='id' value='{$ID}'>"; echo "<input type='checkbox' name='item[{$ID}]' value='1'>"; echo "</td>"; echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>"; echo "</tr>"; } Html::openArrowMassives("massiveaction_form{$rand}", true); Html::closeArrowMassives(array('delete_state' => __('Delete permanently'))); echo "</table>"; Html::closeForm(); echo "</div>"; } } }
/** * Display form for import XML * * @return bool TRUE if form is ok * **/ function showForm() { global $CFG_GLPI; $target = $CFG_GLPI['root_doc'] . '/plugins/fusioninventory/front/inventorycomputerimportxml.php'; echo "<form action='" . $target . "' method='post' enctype='multipart/form-data'>"; echo "<br>"; echo "<table class='tab_cadre' cellpadding='1' width='600'>"; echo "<tr>"; echo "<th>"; echo __('Import XML file from an Agent', 'fusioninventory') . " :"; echo "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>"; echo __('You can use this menu to upload XML generated by an agent. ' . 'The file must have .xml or .ocs extension. ' . 'It\'s also possible to upload <b>ZIP</b> archive directly with a ' . 'collection of XML files. ' . 'Read you agent documentation to see how to generate such XML ' . 'file', 'fusioninventory'); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>"; echo "<input type='file' name='importfile' value=''/>"; echo " <input type='submit' value='" . __('Import') . "' class='submit'/>"; echo "</td>"; echo "</tr>"; echo "</table>"; Html::closeForm(); return TRUE; }
static function showForGroup(Group $group) { global $DB; $ID = $group->getField('id'); if (!$group->can($ID, READ)) { return false; } $canedit = $group->can($ID, UPDATE); if ($canedit) { // Get data $item = new self(); if (!$item->getFromDB($ID)) { $item->getEmpty(); } $rand = mt_rand(); echo "<form name='group_level_form{$rand}' id='group_level_form{$rand}' method='post'\n action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>"; echo "<input type='hidden' name='" . self::$items_id . "' value='{$ID}' />"; echo "<div class='spaced'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'><th>" . __('Level attribution', 'itilcategorygroups') . "</th></tr>"; echo "<tr class='tab_bg_2'><td class='center'>"; Dropdown::showFromArray('lvl', array(NULL => "---", 1 => __('Level 1', 'itilcategorygroups'), 2 => __('Level 2', 'itilcategorygroups'), 3 => __('Level 3', 'itilcategorygroups'), 4 => __('Level 4', 'itilcategorygroups')), array('value' => $item->fields['lvl'])); echo "</td></tr>"; echo "</td><td class='center'>"; if ($item->fields["id"]) { echo "<input type='hidden' name='id' value='" . $item->fields["id"] . "'>"; echo "<input type='submit' name='update' value=\"" . __('Save') . "\"\n class='submit'>"; } else { echo "<input type='submit' name='add' value=\"" . __('Save') . "\" class='submit'>"; } echo "</td></tr>"; echo "</table></div>"; Html::closeForm(); } }
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { return; $profile = new Profile(); $found_profiles = $profile->find("`interface` = 'central'"); $tab_profile = new self(); $found_tab_profiles = $tab_profile->find("`plugin_custom_tabs_id` = " . $item->getID()); echo "<form method='POST' action='tabprofile.form.php' />"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='4'>" . __("Visibility") . "</th></tr>"; $odd = 0; foreach ($found_profiles as $profiles_id => $profile_fields) { if ($odd % 2 === 0) { echo "<tr>"; } echo "<td>" . $profile_fields['name'] . "</td>"; echo "<td>"; Dropdown::showYesNo("tab_profile[{$profiles_id}]", 0); echo "</td>"; if ($odd % 2 === 1) { echo "</tr>"; } $odd++; } if ($odd % 2 === 0) { echo "</tr>"; } echo "<tr><td colspan='4'><div class='center'>"; echo "<input type='submit' name='update' value=\"" . _sx('button', 'Post') . "\" class='submit'>"; echo "</div></td></tr>"; echo "</table>"; Html::closeForm(); return true; }
function showForm($target, $ID) { $this->getFromDB($ID); $delay_expired = $this->fields["delay_expired"]; $delay_whichexpire = $this->fields["delay_whichexpire"]; echo "<div align='center'>"; echo "<form method='post' action=\"{$target}\">"; echo "<table class='tab_cadre_fixe' cellpadding='5'><tr><th>"; echo __('Time of checking of validity of domains', 'domains') . "</th></tr>"; echo "<tr class='tab_bg_1'><td><div align='center'>"; $delay_stamp_first = mktime(0, 0, 0, date("m"), date("d") - $delay_expired, date("y")); $delay_stamp_next = mktime(0, 0, 0, date("m"), date("d") + $delay_whichexpire, date("y")); $date_first = date("Y-m-d", $delay_stamp_first); $date_next = date("Y-m-d", $delay_stamp_next); echo "<tr class='tab_bg_1'><td><div align='left'>"; _e('Domains expired since more', 'domains'); echo " <input type='text' size='5' name='delay_expired' value=\"{$delay_expired}\">"; echo " " . _n('Day', 'Days', 2); echo " ( >" . Html::convdate($date_first) . ")<br>"; _e('Domains expiring in less than', 'domains'); echo " <input type='text' size='5' name='delay_whichexpire' value=\"{$delay_whichexpire}\">"; echo " " . _n('Day', 'Days', 2); echo " ( <" . Html::convdate($date_next) . ")"; echo "</td>"; echo "</tr>"; echo "<tr><th>"; echo "<input type='hidden' name='id' value='" . $ID . "'>"; echo "<div align='center'>"; echo "<input type='submit' name='update' value=\"" . __s('Post') . "\" class='submit' >"; echo "</div></th></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }
/** * Configuration form **/ function showForm($id, $options = array()) { $target = $this->getFormURL(); if (isset($options['target'])) { $target = $options['target']; } if (!Session::haveRight("profile", "r")) { return false; } $canedit = Session::haveRight("profile", "w"); $prof = new Profile(); if ($id) { $this->getFromDB($id); $prof->getFromDB($id); } echo "<form action='" . $target . "' method='post'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2' class='center b'>" . sprintf(_('%1$s %2$s'), 'gestion Vip :', Dropdown::getDropdownName("glpi_groups", $this->fields["id"])); echo "</th></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>Groupe Vip</td><td>"; Dropdown::showYesNo("isvip", $this->fields["isvip"]); echo "</td></tr>"; if ($canedit) { echo "<tr class='tab_bg_2'>"; echo "<td class='center' colspan='2'>"; echo "<input type='hidden' name='id' value={$id}>"; echo "<input type='submit' name='update_vip_group' value='Mettre à jour' class='submit'>"; echo "</td></tr>"; } echo "</table>"; Html::closeForm(); }
function showconfigForm() { global $CFG_GLPI; echo "<form name='form' method='post' action='" . $CFG_GLPI["root_doc"] . "/plugins/immobilizationsheets/front/config.form.php'>"; echo "<div align=\"center\">"; echo "<table class=\"tab_cadre_fixe\" cellspacing=\"2\" cellpadding=\"2\">"; echo "<tr><th colspan=\"2\">" . __('Options', 'immobilizationsheets') . "</th></tr>"; echo "<tr class='tab_bg_1 top'>"; echo "<td>" . __('Save sheets in GLPI', 'immobilizationsheets') . ": </td>"; echo "<td>"; Dropdown::showYesNo("use_backup", $this->fields["use_backup"]); echo "</td>"; echo "<tr class='tab_bg_1 top'><td>"; echo __('Default Heading for sheets', 'immobilizationsheets') . ": </td>"; echo "<td>"; Dropdown::show('DocumentCategory', array('name' => "documentcategories_id", 'value' => $this->fields["documentcategories_id"])); echo "</td>"; echo "<tr><th colspan='2'>"; echo "<input type='hidden' name='id' value='1'>"; echo "<input type=\"submit\" name=\"update_config\" class=\"submit\" value=\"" . __s('Post') . "\" >"; echo "</th></tr>"; echo "</table></div>"; Html::closeForm(); echo "<br>"; }
public static function show($ID, $from_followup) { global $LANG, $CFG_GLPI, $DB, $content; if (!Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) { return false; } $is_private = 0; $requesttypes_id = "1"; $content = ""; if (isset($_SESSION["helpdeskSaved"]["content"])) { $content = cleanPostForTextArea($_SESSION["helpdeskSaved"]["content"]); } if (isset($_SESSION["helpdeskSaved"]["requesttypes_id"])) { $requesttypes_id = stripslashes($_SESSION["helpdeskSaved"]["requesttypes_id"]); } if (isset($_SESSION["helpdeskSaved"]["is_private"])) { $is_private = stripslashes($_SESSION["helpdeskSaved"]["is_private"]); } unset($_SESSION["helpdeskSaved"]); //} if (isset($_REQUEST['new'])) { echo "<div style='text-align:center; margin-top:20px;'> <b> " . $LANG['plugin_mobile']['common'][13] . " </b></div>"; } echo "<form method='post' name='followupform' action=" . $CFG_GLPI["root_doc"] . "/plugins/mobile/front/followup.php?id=" . $_REQUEST['id'] . "&new=1 >"; echo "<table>"; echo "<tr class='tab_bg_1'>"; echo "<td> </td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . $LANG['joblist'][6] . " :</td>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='right' colspan='2'><textarea name='content' cols='78' rows='14' >{$content}</textarea>"; echo "</td></tr>"; echo "<input type='hidden' name='_from_followup' value='{$from_followup}'>"; echo "<input type='hidden' name='requesttypes_id' value='1'"; echo "<input type='hidden' name='is_private' value='0'"; echo "<input type='hidden' name='new' value='1'"; echo "<tr class='tab_bg_2'>"; echo "<td colspan='1' class='center'>"; echo "<input type='submit' value=\"" . $LANG['plugin_mobile']['common'][7] . "\" class='submit' onClick=\"'history.go(-1)'\">"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); if (Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) { global $key, $new; $new = $_REQUEST['new']; if (isset($new) && $_POST['content'] != "") { $id = $_REQUEST['id']; $content = $_POST['content']; $query = "INSERT INTO glpi_ticketfollowups (tickets_id, date, users_id, content, is_private, requesttypes_id) \nVALUES (" . $id . ", NOW(), " . $ID . ", '" . $content . "', '" . $is_private . "', '" . $requesttypes_id . "') \n"; $result = $DB->query($query); } elseif (isset($new) && $_POST['content'] == "") { echo $LANG['plugin_mobile']['common'][8]; } } }
function showForm() { $this->getFromDB('1'); echo "<div align='center'>"; echo "<form method='post' action=\"./config.form.php\">"; echo "<table class='tab_cadre' cellpadding='5'>"; echo "<tr>"; echo "<th colspan='2'>" . __('Identification parameters of inventory number', 'financialreports') . "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Computer', 'Computers', 2) . "</td>"; echo "<td><input type='text' name='computers_otherserial' value='" . $this->fields["computers_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Notebook', 'Notebooks', 2, 'financialreports') . "</td>"; echo "<td><input type='text' name='notebooks_otherserial' value='" . $this->fields["notebooks_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Server', 'Servers', 2, 'financialreports') . "</td>"; echo "<td><input type='text' name='servers_otherserial' value='" . $this->fields["servers_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Monitor', 'Monitors', 2) . "</td>"; echo "<td><input type='text' name='monitors_otherserial' value='" . $this->fields["monitors_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Printer', 'Printers', 2) . "</td>"; echo "<td><input type='text' name='printers_otherserial' value='" . $this->fields["printers_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Device', 'Devices', 2) . "</td>"; echo "<td><input type='text' name='peripherals_otherserial' value='" . $this->fields["peripherals_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Network device', 'Network devices', 2) . "</td>"; echo "<td><input type='text' name='networkequipments_otherserial' value='" . $this->fields["networkequipments_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _n('Phone', 'Phones', 2) . "</td>"; echo "<td><input type='text' name='phones_otherserial' value='" . $this->fields["phones_otherserial"] . "'>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td colspan='2' class='center'>"; echo "<input type='hidden' name='id' value='" . $this->fields["id"] . "'>"; echo "<input type='submit' name='update_parameters' value='" . _sx('button', 'Post') . "' class='submit' >"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }
public static function showSelectionForm($date, $type = 'week', $usertype, $uID = 0, $gID = 0) { global $LANG, $CFG_GLPI; saveCFG(); $CFG_GLPI["use_ajax"] = false; echo "<form method='get' id='planning-form'>"; echo "<div data-role='collapsible' data-collapsed='true'>"; echo "<h3>" . $LANG['plugin_mobile']['common'][5] . "</h3>"; echo "<div>"; echo "<div class='ui-body ui-body-c'>"; echo "<h4>" . $LANG['common'][34] . "</h4>"; echo "<div data-role='fieldcontain'>"; echo "<fieldset data-role='controlgroup'>"; echo "<input type='radio' id='radio_user' name='usertype' value='user' " . ($usertype == "user" ? "checked" : "") . ">"; echo "<label for='radio_user'>"; $rand_user = User::dropdown(array('name' => 'uID', 'value' => $uID, 'comments' => false, 'right' => 'interface', 'all' => 1, 'entity' => $_SESSION["glpiactive_entity"])); echo "</label>"; echo "<input type='radio' id='radio_group' name='usertype' value='group' " . ($usertype == "group" ? "checked" : "") . ">"; echo "<label for='radio_group'>"; $rand_group = Dropdown::show('Group', array('value' => $gID, 'comments' => false, 'name' => 'gID', 'entity' => $_SESSION["glpiactive_entity"])); echo "</label>"; echo "<input type='radio' id='radio_user_group' name='usertype' value='user_group' " . ($usertype == "user_group" ? "checked" : "") . ">"; echo "<label for='radio_user_group'>"; echo $LANG['joblist'][3]; echo "</label>"; echo "</fieldset>"; echo "</div>"; echo "</div><br /><div class='ui-body ui-body-c'>"; echo "<h4>" . $LANG['common'][27] . "</h4>"; echo "<input type='date' name='date' id='date' value='" . $date . "' />"; echo "<select name='type'>"; echo "<option value='day' " . ($type == "day" ? " selected " : "") . ">" . $LANG['planning'][5] . "</option>"; echo "<option value='week' " . ($type == "week" ? " selected " : "") . ">" . $LANG['planning'][6] . "</option>"; echo "<option value='month' " . ($type == "month" ? " selected " : "") . ">" . $LANG['planning'][14] . "</option>"; echo "</select>"; echo "<hr />"; echo "<input type='submit' class='button' name='submit' Value='" . $LANG['buttons'][7] . "' data-theme='a' data-inline='true' />"; echo "</div>"; echo "</div>"; echo "</div><!-- /collapsible -->"; //echo "</form>"; Html::closeForm(); /*echo "<script type='text/javascript'>"; echo "$('.datepickerinput').each(function(){"; echo "$(this).after( $( '<div />' ).datepicker({ altField: '#' + $(this).attr( 'id' ), showOtherMonths: true, dateFormat: 'yy-mm-dd' }) );"; echo "});"; echo "</script>\n";*/ restoreCFG(); }
function manageGroup($groups_id) { global $CFG_GLPI; $group = new Group(); if (Session::haveRight('group', 'w')) { echo "<form method='post' name='' id='manageGroup' action=\"" . $CFG_GLPI['root_doc'] . "/plugins/escalade/front/group_group.form.php\">"; } echo "<table width='950' class='tab_cadre_fixe'>"; echo "<tr>"; echo "<th colspan='2'>"; echo "Escalade"; echo "</th>"; echo "</tr>"; $gg_found = $this->find("groups_id_source='{$groups_id}'"); if (Session::haveRight('group', 'w')) { $groups_id_used = array(); foreach ($gg_found as $gg) { $groups_id_used[] = $gg['groups_id_destination']; } echo "<tr>"; echo "<td colspan='2' align='center'>"; Dropdown::show('Group', array('name' => 'groups_id_destination', 'condition' => "is_assign=1", 'used' => $groups_id_used)); echo "<input type='hidden' name='groups_id_source' value='" . $groups_id . "' />"; echo " <input type='submit' class='submit' name='addgroup' value='" . _sx('button', 'Add') . "'/>"; echo "</td>"; echo "</tr>"; } foreach ($gg_found as $gg_id => $gg) { $group->getFromDB($gg['groups_id_destination']); echo "<tr class='tab_bg_1'>"; echo "<td width='30'>"; if (Session::haveRight('group', 'w')) { echo "<input type='checkbox' name='delgroup[]' value='{$gg_id}' />"; } echo "</td>"; echo "<td>"; echo $group->getLink(true); echo "</td>"; echo "</tr>"; } echo "</table>"; if (Session::haveRight('group', 'w')) { Html::openArrowMassives("manageGroup", true); Html::closeArrowMassives(array('deleteitem' => _sx('button', 'Delete permanently'))); } Html::closeForm(); }
function showForm() { $this->getFromDB('1'); $system = $this->fields["used_system"]; echo "<div class='center'>"; echo "<form method='post' action='" . $this->getFormURL() . "'>"; echo "<table class='tab_cadre_fixe' cellpadding='5'>"; echo "<tr><th colspan='4'>" . __('System for ping', 'addressing') . "</th></tr>"; echo "<tr class='tab_bg_1'><td colspan='4'><div class='center'><select name='used_system'>"; echo "<option value='0' " . ($system == 0 ? " selected " : "") . ">" . __('Linux ping', 'addressing') . "</option>"; echo "<option value='2' " . ($system == 2 ? " selected " : "") . ">" . __('Linux fping', 'addressing') . "</option>"; echo "<option value='1' " . ($system == 1 ? " selected " : "") . ">" . __('Windows', 'addressing') . "</option>"; echo "<option value='3' " . ($system == 3 ? " selected " : "") . ">" . __('BSD ping', 'addressing') . "</option>"; echo "<option value='4' " . ($system == 4 ? " selected " : "") . ">" . __('MacOSX ping', 'addressing') . "</option>"; echo "</select>"; echo "</div></td></tr>"; echo "<tr><th colspan='4'>" . __('Display', 'addressing') . "</th></tr>"; echo "<tr class='tab_bg_1'><td>" . __('Assigned IP', 'addressing') . "</td>"; echo "<td>"; Dropdown::showYesNo("alloted_ip", $this->fields["alloted_ip"]); echo "</td>"; echo "<td>" . __('Free IP', 'addressing') . "</td>"; echo "<td>"; Dropdown::showYesNo("free_ip", $this->fields["free_ip"]); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'><td>" . __('Same IP', 'addressing') . "</td>"; echo "<td>"; Dropdown::showYesNo("double_ip", $this->fields["double_ip"]); echo "</td>"; echo "<td>" . __('Reserved IP', 'addressing') . "</td>"; echo "<td>"; Dropdown::showYesNo("reserved_ip", $this->fields["reserved_ip"]); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'><td colspan='2'>" . __('Use Ping', 'addressing') . "</td>"; echo "<td colspan='2'>"; Dropdown::showYesNo("use_ping", $this->fields["use_ping"]); echo "</td>"; echo "</tr>"; echo "<tr><th colspan='4'>"; echo "<input type='hidden' name='id' value='1'>"; echo "<div class='center'>" . "<input type='submit' name='update' value='" . _sx('button', 'Post') . "' class='submit'>" . "</div></th></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }
function showForm() { echo "<form method='POST' action=\"" . $this->getFormURL() . "\">"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2'>"; _e('Flags'); echo "</th></tr>"; echo "<tr class='tab_bg_1 top'><td>" . __('Input time on groups / users when ticket is waiting', 'timelineticket') . "</td>"; echo "<td>"; Dropdown::showYesNo("add_waiting", $this->fields["add_waiting"]); echo "</td></tr>"; echo "<tr><th colspan='2'>"; echo "<input type='hidden' name='id' value='1'>"; echo "<input type=\"submit\" name=\"update\" class=\"submit\"\n value=\"" . _sx('button', 'Save') . "\" ></th></tr>"; echo "</table>"; Html::closeForm(); }
/** * Print the config form for display * */ function showFormDisplay() { $options = self::getConfigValues(array('group_by_users')); echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>"; echo "<div class='center' id='tabsbody'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='4'>" . __('FP Software config') . "</th></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td width='30%'> " . __('Calculate licenses number per user instead of per computer') . "</td><td width='20%'>"; Dropdown::showYesNo('group_by_users', $options['group_by_users']); echo "</td></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td colspan='4' class='center'>"; echo "<input type='submit' name='update' class='submit' value=\"" . _sx('button', 'Save') . "\">"; echo "</td></tr>"; echo "</table></div>"; Html::closeForm(); }
/** * Show the optional values for a item / applicatif * * @param $itemtype type of the item * @param $items_id ID of the item * @param $appliances_id, ID of the applicatif * @param $canedit, if user is allowed to edit the values * - canedit the device if called from the device form * - must be false if called from the applicatif form */ static function showList($itemtype, $items_id, $appliances_id, $canedit) { global $DB, $CFG_GLPI; $query_app_opt = "SELECT *\n FROM `glpi_plugin_appliances_optvalues`\n WHERE `plugin_appliances_appliances_id` = '" . $appliances_id . "'\n ORDER BY `vvalues`"; $result_app_opt = $DB->query($query_app_opt); $number_champs = $DB->numrows($result_app_opt); if ($canedit) { echo "<form method='post' action='" . $CFG_GLPI["root_doc"] . "/plugins/appliances/front/appliance.form.php'>"; echo "<input type='hidden' name='number_champs' value='" . $number_champs . "'>"; } echo "<table>"; for ($i = 1; $i <= $number_champs; $i++) { if ($data_opt = $DB->fetch_array($result_app_opt)) { $query_val = "SELECT `vvalue`\n FROM `glpi_plugin_appliances_optvalues_items`\n WHERE `plugin_appliances_optvalues_id` = '" . $data_opt["id"] . "'\n AND `items_id` = '" . $items_id . "'"; $result_val = $DB->query($query_val); $data_val = $DB->fetch_array($result_val); $vvalue = $data_val ? $data_val['vvalue'] : ""; if (empty($vvalue) && !empty($data_opt['ddefault'])) { $vvalue = $data_opt['ddefault']; } echo "<tr><td>" . $data_opt['champ'] . " </td><td>"; if ($canedit) { echo "<input type='hidden' name='opt_id{$i}' value='" . $data_opt["id"] . "'>"; echo "<input type='hidden' name='ddefault{$i}' value='" . $data_opt["ddefault"] . "'>"; echo "<input type='text' name='vvalue{$i}' value='" . $vvalue . "'>"; } else { echo $vvalue; } echo "</td></tr>"; } else { echo "<input type='hidden' name='opt_id{$i}' value='-1'>"; } } // For echo "</table>"; if ($canedit) { echo "<input type='hidden' name='itemtype' value='" . $itemtype . "'>"; echo "<input type='hidden' name='items_id' value='" . $items_id . "'>"; echo "<input type='hidden' name='plugin_appliances_appliances_id' value='" . $appliances_id . "'>"; echo "<input type='hidden' name='number_champs' value='" . $number_champs . "'>"; echo "<input type='submit' name='add_opt_val' value='" . _sx('button', 'Update') . "'\n class='submit'>"; Html::closeForm(); } }
/** * Show profile form * * @param $items_id integer id of the profile * @param $target value url of target * * @return nothing **/ function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE) { $profile = new Profile(); echo "<div class='firstbloc'>"; if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) { echo "<form method='post' action='" . $profile->getFormURL() . "'>"; } $profile->getFromDB($profiles_id); $rights = $this->getAllRights(); $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Reforme', 'reforme'))); if ($canedit && $closeform) { echo "<div class='center'>"; echo Html::hidden('id', array('value' => $profiles_id)); echo Html::submit(_sx('button', 'Save'), array('name' => 'update')); echo "</div>\n"; echo Html::closeForm(false); } echo "</div>"; }
function showForm($id, $options = array()) { if (!defined('GLPI_ROOT')) { define('GLPI_ROOT', '../../..'); } include_once GLPI_ROOT . "/inc/includes.php"; $target = $this->getFormURL(); if (isset($options['target'])) { $target = $options['target']; } global $DB; echo "<form action=\"{$target}\" method='post'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2' class='center b'Autoriser l'authentification via le module Apache : "; echo "</th></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>Authentification autorisée</td><td>"; $result = $data = array(); $query = "SELECT auth FROM glpi_plugin_apacheauthdbd_users WHERE users_id = " . $id; $result = $DB->query($query) or die("Erreur lors de la lecture de la table <strong>profiles</strong> pour Dixinfor : " . $DB->error()); $data = $DB->fetch_assoc($result); echo "<select name='auth' id='auth'>"; echo "<option value='0'"; if ($data['auth'] == '0') { echo ' selected="selected"'; } echo ">Refusé</option>"; echo "<option value='1'"; if ($data['auth'] == '1') { echo ' selected="selected"'; } echo ">Autorisé</option>"; echo "</select>"; echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='center' colspan='2'>"; echo "<input type='hidden' name='id' value={$id}>"; echo "<input type='submit' value='Envoyer' class='submit' name='à jour' >"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); }
/** * Display group form **/ function displaySearchForm() { global $_SERVER, $_GET, $CFG_GLPI; echo "<form action='" . $_SERVER["PHP_SELF"] . "' method='post'>"; echo "<table class='tab_cadre' cellpadding='5'>"; echo "<tr class='tab_bg_1 center'>"; echo "<td>"; echo __('Group') . " "; Group::dropdown(array('name =>' => "group", 'value' => $_GET["group"], 'entity' => $_SESSION["glpiactive_entity"], 'condition' => "is_itemgroup")); echo "</td>"; // Display Reset search echo "<td>"; echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/reports/report/equipmentbygroups/equipmentbygroups.php?reset_search=reset_search'>" . "<img title='" . __s('Blank') . "' alt='" . __s('Blank') . "' src='" . $CFG_GLPI["root_doc"] . "/pics/reset.png' class='calendrier'></a>"; echo "</td>"; echo "<td>"; echo "<input type='submit' value='Valider' class='submit' />"; echo "</td>"; echo "</tr></table>"; Html::closeForm(); }
static function showForm() { global $CFG_GLPI; $config = new self(); $config->getFromDB(1); echo "<div class='center'>"; echo "<form method='post' action='" . Toolbox::getItemTypeFormURL('PluginPositionsConfig') . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'><th colspan='2'>" . __('General setup') . "</th></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>"; echo __('Add sub-places on the map objects', 'positions'); echo "</td>"; echo "<td>"; Dropdown::showYesNo('use_view_all_object', $config->fields['use_view_all_object']); echo "</td></tr>"; echo "<tr><th colspan='2'>"; echo "<input type='hidden' name='id' value='1'>"; echo "<div align='center'>"; echo "<input type='submit' name='update_config' value=\"" . _x('button', 'Post') . "\" class='submit' >"; echo "</div></th></tr>"; echo "</table></div>"; Html::closeForm(); echo "<div class='center'><table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'>"; echo "<th>"; _e('Setup'); echo "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='center'>"; echo "<a href='./imageitem.form.php'>" . __('Association : picture / types of equipment', 'positions') . "</a>"; echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='center'>"; echo "<a href='./info.php'>" . __('Configuring the display materials', 'positions') . "</a>"; echo "</td>"; echo "</tr>"; echo "</table></div>"; }
function showForm($user_id, $options = array()) { global $LANG; $target = $this->getFormURL(); if (isset($options['target'])) { $target = $options['target']; } $tzID = $this->getIDFromUserID($user_id); if ($user_id) { if (!$tzID) { $tz = ini_get('date.timezone'); if (empty($tz)) { $tz = @date_default_timezone_get(); } $this->add(array('users_id' => $user_id, 'timezone' => $tz)); $tzID = $this->getID(); } else { $this->getFromDB($tzID); } } else { return; } echo "<form action='" . $target . "' method='post'>"; echo "<input type=hidden name=users_id value='{$user_id}'/>"; echo "<input type=hidden name=id value='{$tzID}'/>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2'>" . $LANG['timezones']['item']['header'] . "</th></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . $LANG['timezones']['item']['dropdown'] . " :</td><td>"; $timezones = self::getTimezones(); Dropdown::showFromArray('timezone', $timezones, array('value' => $this->fields["timezone"])); echo "</td></tr>"; echo "<tr class='tab_bg_2'>"; echo "<td colspan='4' class='center'>"; echo "<input type='submit' name='update' class='submit' value=\"" . $LANG['timezones']['item']['submit'] . "\">"; echo "</td></tr>"; echo "</table>"; Html::closeForm(); }