function showForm() { global $DB; $query = "SELECT * FROM\n `" . $this->getTable() . "`\n ORDER BY `states_id` ASC"; if ($result = $DB->query($query)) { $number = $DB->numrows($result); if ($number != 0) { echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action='" . $this->getFormURL() . "'>"; echo "<div align='center'>"; echo "<table class='tab_cadre_fixe' cellpadding='5'>"; echo "<tr>"; echo "<th>" . __('Status') . "</th><th></th>"; echo "</tr>"; while ($ligne = $DB->fetch_array($result)) { $ID = $ligne["id"]; echo "<tr class='tab_bg_1'>"; echo "<td width='10'>"; echo "<input type='checkbox' name='item[{$ID}]'"; if (isset($_POST['check']) && $_POST['check'] == 'all') { echo " checked "; } echo ">"; echo "</td>"; echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>"; echo "</tr>"; } echo "</table></div>"; Html::openArrowMassives("massiveaction_form", true); Html::closeArrowMassives(array('delete_state' => _sx('button', 'Delete permanently'))); Html::closeForm(); echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>"; echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>"; echo __('Disposal status', 'financialreports') . " : </th></tr>"; echo "<tr class='tab_bg_1'><td>"; Dropdown::show('State', array('name' => "states_id", 'value' => $ligne["states_id"])); echo "</td>"; echo "<td>"; echo "<div align='center'>"; echo "<input type='submit' name='add_state' value='" . __s('Post') . "' class='submit' >"; echo "</div></td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; } else { echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>"; echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>"; echo __('Disposal status', 'financialreports') . " : </th></tr>"; echo "<tr class='tab_bg_1'><td>"; Dropdown::show('State', array('name' => "states_id")); echo "</td>"; echo "<td>"; echo "<div align='center'>"; echo "<input type='submit' name='add_state' value='" . __s('Post') . "' class='submit' >"; echo "</div></td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; } } }
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() { $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>"; }
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>"; }
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); if ($profile->getField('interface') == 'central') { $rights = $this->getAllRights(); $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General'))); } echo "<table class='tab_cadre_fixehov'>"; echo "<tr class='tab_bg_1'><th colspan='4'>" . __('Helpdesk') . "</th></tr>\n"; $effective_rights = ProfileRight::getProfileRights($profiles_id, array('plugin_racks_open_ticket')); echo "<tr class='tab_bg_2'>"; echo "<td width='20%'>" . __('Associable items to a ticket') . "</td>"; echo "<td colspan='5'>"; Html::showCheckbox(array('name' => '_plugin_racks_open_ticket', 'checked' => $effective_rights['plugin_racks_open_ticket'])); 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>"; }
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(); }
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(); }
/** * 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>"; }
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; }
/** * @see Rule::showNewRuleForm() **/ function showNewRuleForm($ID) { echo "<form method='post' action='" . Toolbox::getItemTypeFormURL('Entity') . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='7'>" . __('Authorizations assignment rules') . "</th></tr>\n"; echo "<tr class='tab_bg_1'>"; echo "<td>" . __('Name') . "</td><td>"; Html::autocompletionTextField($this, "name", array('value' => '', 'size' => 33)); echo '</td><td>' . __('Description') . "</td><td>"; Html::autocompletionTextField($this, "description", array('value' => '', 'size' => 33)); echo "</td><td>" . __('Logical operator') . "</td><td>"; $this->dropdownRulesMatch(); echo "</td><td rowspan='2' class='tab_bg_2 center middle'>"; echo "<input type=hidden name='sub_type' value='" . get_class($this) . "'>"; echo "<input type=hidden name='entities_id' value='-1'>"; echo "<input type=hidden name='affectentity' value='{$ID}'>"; echo "<input type=hidden name='_method' value='AddRule'>"; echo "<input type='submit' name='execute' value=\"" . _sx('button', 'Add') . "\" class='submit'>"; echo "</td></tr>\n"; echo "<tr class='tab_bg_1'>"; echo "<td class='center'>" . _n('Profile', 'Profiles', 1) . "</td><td>"; Profile::dropdown(); echo "</td><td><span class='small_space'>" . __('Recursive') . "</span></td><td colspan='3'>"; Dropdown::showYesNo("is_recursive", 0); echo "</td></tr>\n"; echo "</table>"; Html::closeForm(); }
public 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>"; _e('Time of checking of validity of the badges', 'badges'); echo "</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('Badges expired for more than ', 'badges'); echo " <input type='text' size='5' name='delay_expired' value=\"{$delay_expired}\">"; echo " " . _n('Day', 'Days', 2) . " ( >" . Html::convdate($date_first) . ")<br>"; _e('Badges expiring in less than ', 'badges'); echo " <input type='text' size='5' name='delay_whichexpire' value=\"{$delay_whichexpire}\">"; echo " " . _n('Day', 'Days', 2) . " ( <" . 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=\"" . _sx('button', 'Save') . "\" class='submit' >"; echo "</div></th></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }
/** * Show a date selector * @param datetime $date1 date of start * @param datetime $date2 date of ending * @param string $randname random string (to prevent conflict in js selection) * @return nothing */ static function showSelector($date1, $date2, $randname) { $request_string = self::getRequestString($_GET); echo "<div class='center'><form method='POST' action='?{$request_string}' name='form'" . " id='mreporting_date_selector'>\n"; echo "<table class='tab_cadre'><tr class='tab_bg_1'>"; echo '<td><table><tr class="tab_bg_1">'; echo "<td>"; Html::showDateFormItem("date1" . $randname, $date1, false); echo "</td>\n"; echo "<td>"; Html::showDateFormItem("date2" . $randname, $date2, false); echo "</td>\n"; self::getReportSelectors(); echo "</tr></table></td>"; echo "<td rowspan='2' class='center'>"; echo "<input type='submit' class='button' name='submit' Value=\"" . _sx('button', 'Post') . "\">"; echo "</td>\n"; echo "<td class='center'>"; $_SERVER['REQUEST_URI'] .= "&date1" . $randname . "=" . $date1; $_SERVER['REQUEST_URI'] .= "&date2" . $randname . "=" . $date2; Bookmark::showSaveButton(Bookmark::URI); echo "</td>\n"; echo "</tr>"; echo "</table>"; Html::closeForm(); echo "</div>\n"; }
/** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input = array()) { switch ($input['action']) { case "import_email": Entity::dropdown(); echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Import') . "'>"; return true; default: return parent::showSpecificMassiveActionsParameters($input); } return false; }
/** * @since version 0.85 * * @see CommonDBTM::showMassiveActionsSubForm() **/ static function showMassiveActionsSubForm(MassiveAction $ma) { switch ($ma->getAction()) { case 'add': $rand = Ticket_Ticket::dropdownLinks('link'); printf(__('%1$s: %2$s'), __('Ticket'), __('ID')); echo " <input type='text' name='tickets_id_1' value='' size='10'>\n"; echo "<br><br>"; echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Post') . "'>"; return true; } return parent::showMassiveActionsSubForm($ma); }
function showAddForm($target) { echo "<div align='center'><form method='post' action=\"{$target}\">"; echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>"; echo __('add not-used status in expiration mail', 'certificates') . "</th></tr>"; echo "<tr class='tab_bg_1'><td>"; Dropdown::show('PluginCertificatesCertificateState', array('name' => "plugin_certificates_certificatestates_id")); echo "</td>"; echo "<td>"; echo "<div align='center'><input type='submit' name='add' value=\"" . _sx('button', 'Post') . "\" class='submit' ></div></td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }
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>"; }
function manageContacts($items_id) { $pmContact = new PluginMonitoringContact(); $user = new User(); $a_list = $this->find("`plugin_monitoring_hosts_id`='" . $items_id . "'"); echo "<form name='contacts_form' id='contacts_form'\n method='post' action=' "; echo Toolbox::getItemTypeFormURL(__CLASS__) . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'>"; echo "<th colspan='3'>"; echo __('Contacts', 'monitoring'); echo "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='right'>"; $a_contacts = $pmContact->find(); $a_elements = array(); foreach ($a_contacts as $data) { $user->getFromDB($data['users_id']); $a_elements[$data['id']] = $user->getName(); } asort($a_elements); Dropdown::showFromArray('plugin_monitoring_contacts_id', $a_elements); echo "</td>"; echo "<td class='center'>"; echo "<input type='submit' class='submit' name='parent_add' value='" . __('Add') . " >>'>"; echo "<br><br>"; if ($a_list) { echo "<input type='submit' class='submit' name='parent_delete' value='<< " . _sx('button', 'Delete permanently') . "'>"; } echo "</td>"; echo "<td>"; if ($a_list) { echo "<select name='parent_to_delete[]' multiple size='5'>"; foreach ($a_list as $data) { $pmContact->getFromDB($data['plugin_monitoring_contacts_id']); $user->getFromDB($pmContact->fields['users_id']); echo "<option value='" . $data['plugin_monitoring_contacts_id'] . "'>" . $user->getName() . "</option>"; } echo "</select>"; } else { echo " "; } echo "</td>"; echo "</tr>"; echo "</table>"; echo "<input type='hidden' name='id' value='" . $items_id . "' />"; Html::closeForm(); }
function plugin_talk_MassiveActionsDisplay($options = array()) { switch ($options['itemtype']) { case 'Profile': switch ($options['action']) { case "plugin_talk_edit_profile": echo _sx('button', 'Enable') . " : "; Dropdown::showYesNo("is_active", 1); echo " <input type='submit' name='massiveaction' class='submit' value='" . __s('Post') . "'>"; break; } break; } return ""; }
public function showAddForm($target) { echo "<div align='center'><form method='post' action=\"{$target}\">"; echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>"; echo __('Add a unused status for expiration mailing', 'accounts') . "</th></tr>"; echo "<tr class='tab_bg_1'><td>"; Dropdown::show('PluginAccountsAccountState', array('name' => "plugin_accounts_accountstates_id")); echo "</td>"; echo "<td>"; echo "<div align='center'>"; echo "<input type='submit' name='add' value=\"" . _sx('button', 'Add') . "\" class='submit' >"; echo "</div></td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; }
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 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(); }
/** * Display list of Optvalues for an appliance * * @param $appli PluginAppliancesAppliance instance * * @return nothing (display form) */ static function showForAppliance(PluginAppliancesAppliance $appli) { global $DB, $CFG_GLPI; if (!$appli->can($appli->fields['id'], 'r')) { return false; } $canedit = $appli->can($appli->fields['id'], 'w'); $rand = mt_rand(); if ($canedit) { echo "<form method='post' name='optvalues_form{$rand}' id='optvalues_form{$rand}' action=\"" . $CFG_GLPI["root_doc"] . "/plugins/appliances/front/appliance.form.php\">"; } echo "<div class='center'><table class='tab_cadre_fixe'>"; echo "<tr><th colspan='4'>" . __('User fields', 'appliances') . "</th></tr>\n"; $query_app = "SELECT *\n FROM `glpi_plugin_appliances_optvalues`\n WHERE `plugin_appliances_appliances_id` = '" . $appli->fields['id'] . "'\n ORDER BY `vvalues`"; $result_app = $DB->query($query_app); $number_champs = $DB->numrows($result_app); $number_champs++; for ($i = 1; $i <= $number_champs; $i++) { if ($data = $DB->fetch_array($result_app)) { $champ = $data["champ"]; $ddefault = $data["ddefault"]; } else { $champ = ''; $ddefault = ''; } echo "<tr class='top tab_bg_1'>"; if ($i == 1) { echo "<td rowspan='" . $number_champs . "'>" . _n('Field', 'Fields', 1) . "</td>"; } echo "<td><input type='text' name='champ{$i}' value=\"" . $champ . "\" size='35'></td>\n"; if ($i == 1) { echo "<td rowspan='" . $number_champs . "'>" . __('Default', 'appliances') . "</td>"; } echo "<td><input type='text' name='ddefault{$i}' value=\"" . $ddefault . "\" size='35'></td></tr>\n"; } if ($canedit) { echo "<tr class='tab_bg_2'><td colspan='4' class='center'>"; echo "<input type='hidden' name='plugin_appliances_appliances_id' value='" . $appli->fields['id'] . "'>\n"; echo "<input type='hidden' name='number_champs' value='" . $number_champs . "'>\n"; echo "<input type='submit' name='update_optvalues' value=\"" . _sx('button', 'Update') . "\"\n class='submit'>"; echo "</td></tr>\n</table></div>"; Html::closeForm(); } else { echo "</table></div>"; } return true; }
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(); }
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>" . __('Configuration of units', 'racks') . "</td><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 "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>"; echo __("Copy rack's location when adding a new asset in the rack", "racks"); echo "</td>"; echo "<td style='width: 150px;'>"; Dropdown::showYesNo('add_location_on_new_item', $this->fields['add_location_on_new_item']); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>"; echo __("Forward rack's location to linked assets on change", "racks"); echo "</td>"; echo "<td style='width: 150px;'>"; Dropdown::showYesNo('forward_location_on_change', $this->fields['forward_location_on_change']); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td colspan='2' align='center'>"; echo Html::hidden('id', array('value' => 1)); echo Html::submit(_sx('button', 'Post'), array('name' => 'update')); echo "</table>"; Html::closeForm(); echo "</div>"; }
/** * 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(); } }
function plugin_pdf_MassiveActionsDisplay($options = array()) { global $PLUGIN_HOOKS; switch ($options['itemtype']) { case 'Profile': switch ($options['action']) { case "plugin_pdf_allow": Dropdown::showYesNo('use'); echo "<input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Post') . "'>"; break; } break; default: if (isset($PLUGIN_HOOKS['plugin_pdf'][$options['itemtype']]) && $options['action'] == 'plugin_pdf_DoIt') { echo "<input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Post') . "'>"; } } return ""; }
/** * 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 showFormUserPreference($target, $id) { $data = plugin_version_treeview(); $this->getFromDB($id); echo "<form action='" . $target . "' method='post'>"; echo "<table class='tab_cadre_fixe' cellpadding='5'>"; echo "<tr><th colspan='2'>" . sprintf(__('%1$s - %2$s'), $data['name'], $data['version']); echo "</th></tr>"; echo "<tr class='tab_bg_1 center'>"; echo "<td>" . __('Launch the plugin Treeview with GLPI launching', 'treeview') . "</td>"; echo "<td>"; Dropdown::showYesNo("show_on_load", $this->fields["show_on_load"]); echo "</td></tr>"; echo "<tr class='tab_bg_1 center'><td colspan='2'>"; echo "<input type='submit' name='plugin_treeview_user_preferences_save' value='" . _sx('button', 'Post') . "' class='submit'>"; echo "<input type='hidden' name='id' value='{$id}'></td></tr>"; echo "<tr class='tab_bg_1 center'>"; echo "<td colspan='2'>" . __('Warning: If there are more than one plugin which be loaded at startup, then only the first will be used', 'treeview'); echo "</td></tr>"; echo "</table>"; Html::closeForm(); }