本文整理汇总了PHP中Dropdown::showInteger方法的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown::showInteger方法的具体用法?PHP Dropdown::showInteger怎么用?PHP Dropdown::showInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dropdown
的用法示例。
在下文中一共展示了Dropdown::showInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayCriteria
function displayCriteria()
{
$this->getReport()->startColumn();
echo $this->getCriteriaLabel() . ' :';
$this->getReport()->endColumn();
$this->getReport()->startColumn();
if (empty($this->signe)) {
Dropdown::showFromArray($this->getName() . "_sign", array('<=' => '<=', '>=' => '>='), array('value' => Toolbox::unclean_cross_side_scripting_deep($this->getParameter($this->getName() . "_sign"))));
echo " ";
}
Dropdown::showInteger($this->getName(), $this->getParameterValue(), $this->min, $this->max, 1);
echo ' ' . $this->unit;
$this->getReport()->endColumn();
}
示例2: showForm
function showForm($ID, $options = array())
{
global $CFG_GLPI;
if (!$this->canView()) {
return false;
}
if ($ID > 0) {
$this->check($ID, READ);
} else {
$this->check(-1, UPDATE);
$this->getEmpty();
if (isset($_GET['preconfig'])) {
$this->preconfig($_GET['preconfig']);
} else {
$_GET['preconfig'] = -1;
}
}
$input = array("name" => $this->fields["name"], "supplier_url" => $this->fields["supplier_url"]);
$canedit = $this->can($ID, UPDATE, $input);
$canrecu = $this->can($ID, 'recursive', $input);
echo "<table class='tab_cadre_fixe'>";
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('Preconfiguration') . " ";
$opt = array('value' => $_GET['preconfig']);
$rand = self::dropdownSupplier('supplier', $opt);
$params = array('supplier' => '__VALUE__');
Ajax::updateItemOnSelectEvent("dropdown_supplier{$rand}", "show_preconfig", "../ajax/dropdownSuppliers.php", $params);
echo "<span id='show_preconfig'>";
echo "</span>";
echo "</td>";
echo "</tr>";
echo "</table>";
if ($_GET['preconfig'] == -1 && $ID <= 0) {
$style = "style='display:none;'";
} else {
$style = "style='display:block;'";
}
echo "<div id='show_form' {$style}>";
$this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr>";
echo "<td class='tab_bg_2 center'>" . __('Name') . "</td>";
echo "<td class='tab_bg_2 left'>";
echo $this->fields["name"];
echo "<input type='hidden' name='name' value=\"" . $this->fields["name"] . "\">\n";
echo "</td>";
echo "<td class='tab_bg_2 center'>" . __('Manufacturer') . "</td>";
echo "<td class='tab_bg_2 left'>";
Dropdown::show('Manufacturer', array('name' => "manufacturers_id", 'value' => $this->fields["manufacturers_id"]));
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('Manufacturer web address', 'manufacturersimports') . "</td>";
echo "<td class='tab_bg_2 left' colspan='2'>";
echo "<input type='text' name='supplier_url' size='100' value='" . $this->fields["supplier_url"] . "'>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('Default supplier attached', 'manufacturersimports') . "</td>";
echo "<td class='tab_bg_2 left' colspan='2'>";
Dropdown::show('Supplier', array('name' => "suppliers_id", 'value' => $this->fields["suppliers_id"]));
echo "</td>";
echo "</tr>";
if ($this->fields["name"] == self::FUJITSU) {
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('New warranty affected by default (Replace if 0)', 'manufacturersimports') . "</td>";
echo "<td class='tab_bg_2 left' colspan='2'>";
Dropdown::showInteger("warranty_duration", $this->fields["warranty_duration"], 0, 120);
echo "</td>";
echo "</tr>";
} else {
echo "<input type='hidden' name='warranty_duration' value='0'>\n";
}
if ($this->fields["name"] != self::DELL) {
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('Auto add of document', 'manufacturersimports') . "</td>";
echo "<td class='tab_bg_2 left' colspan='2'>";
Dropdown::showYesNo("document_adding", $this->fields["document_adding"]);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('Section for document records', 'manufacturersimports') . "</td>";
echo "<td class='tab_bg_2 left' colspan='2'>";
Dropdown::show('DocumentCategory', array('name' => "documentcategories_id", 'value' => $this->fields["documentcategories_id"]));
echo "</td>";
echo "</tr>";
} else {
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('Manufacturer API key', 'manufacturersimports') . "</td>";
echo "<td class='tab_bg_2 left' colspan='2'>";
echo "<input type='text' name='supplier_key' size='32' value='" . $this->fields["supplier_key"] . "'>";
echo "</td>";
echo "</tr>";
}
echo "<tr>";
echo "<td class='tab_bg_2 center' colspan='2'>" . __('Add a comment line', 'manufacturersimports') . "</td>";
echo "<td class='tab_bg_2 left' colspan='2'>";
Dropdown::showYesNo("comment_adding", $this->fields["comment_adding"]);
echo "</td>";
echo "</tr>";
//.........这里部分代码省略.........
示例3: showForm
function showForm($ID, $options = array())
{
$PluginRacksConfig = new PluginRacksConfig();
$this->initForm($ID, $options);
$this->showFormHeader($options);
//ligne 1
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td><td>";
$objectName = autoName($this->fields["name"], "name", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'name', array('value' => $objectName));
echo "</td>";
echo "<td>" . __('Size') . "</td><td>";
Dropdown::showInteger("rack_size", $this->fields["rack_size"], 1, 100, 1);
echo " " . __('U', 'racks') . "</td>";
echo "</tr>";
//ligne 2
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Manufacturer') . "</td><td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td>";
echo "<td >" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('Technician in charge of the hardware') . "</td>";
echo "<td >";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'interface', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Place', 'racks');
echo "</td><td>";
$PluginRacksRoomLocation = new PluginRacksRoomLocation();
$PluginRacksRoomLocation->dropdownRoomLocations("plugin_racks_roomlocations_id", $this->fields["plugin_racks_roomlocations_id"], $this->fields["entities_id"]);
echo "</td>";
echo "</tr>";
//ligne 4
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td><td>";
Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
echo "</td>";
echo "<td>" . __('Width', 'racks') . "</td><td>";
echo "<input type='text' name='width' \n value=\"" . Html::formatNumber($this->fields["width"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("size");
echo "</td>";
echo "</tr>";
//ligne 5
echo "<tr class='tab_bg_1'>";
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'serial');
echo "</td>";
echo "<td>" . __('Height', 'racks') . "</td><td>";
echo "<input type='text' name='height' \n value=\"" . Html::formatNumber($this->fields["height"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("size");
echo "</td>";
echo "</tr>";
//ligne 6
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Inventory number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, 'otherserial');
echo "</td>";
echo "<td>" . __('Weight', 'racks') . "</td><td>";
echo "<input type='text' name='weight' \n value=\"" . Html::formatNumber($this->fields["weight"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("weight");
echo "</td>";
echo "</tr>";
//ligne 7
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Model') . "</td>";
echo "<td>";
Dropdown::show('PluginRacksRackModel', array('name' => "plugin_racks_rackmodels_id", 'value' => $this->fields["plugin_racks_rackmodels_id"]));
echo "</td>";
echo "<td>" . __('Depth', 'racks') . "</td><td>";
echo "<input type='text' name='depth' \n value=\"" . Html::formatNumber($this->fields["depth"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("size");
echo "</td>";
echo "</tr>";
//ligne 8
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('Type') . "</td><td>";
Dropdown::show('PluginRacksRackType', array('value' => $this->fields["plugin_racks_racktypes_id"]));
echo "</td>";
echo "<td >" . __('Status') . "</td><td>";
Dropdown::show('PluginRacksRackState', array('value' => $this->fields["plugin_racks_rackstates_id"]));
echo "</td>";
echo "</tr>";
//ligne 9
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2'>";
if ((!isset($options['withtemplate']) || $options['withtemplate'] == 0) && !empty($this->fields['template_name'])) {
echo "<span class='small_space'>";
printf(__('Created from the template %s'), $this->fields['template_name']);
echo "</span>";
} else {
echo " ";
}
echo "</td><td colspan='2'>";
//.........这里部分代码省略.........
示例4: showForm
//.........这里部分代码省略.........
echo "<tr class='tab_bg_1'>";
echo "<th class='left'>" . $LANG['job'][44] . " : </th>";
echo "<td>";
if ($canupdate) {
Dropdown::show('RequestType', array('value' => $this->fields["requesttypes_id"]));
} else {
echo Dropdown::getDropdownName('glpi_requesttypes', $this->fields["requesttypes_id"]);
}
echo "</td>";
// Display validation state
echo "<th>";
if (!$ID) {
echo $LANG['validation'][26] . " : ";
} else {
echo $LANG['validation'][0] . " : ";
}
echo "</th>";
echo "<td>";
if (!$ID) {
User::dropdown(array('name' => "_add_validation", 'entity' => $this->fields['entities_id'], 'right' => 'validate_ticket'));
} else {
if ($canupdate) {
TicketValidation::dropdownStatus('global_validation', array('global' => true, 'value' => $this->fields['global_validation']));
} else {
echo TicketValidation::getStatus($this->fields['global_validation']);
}
}
echo "</td></tr>";
// Need comment right to add a followup with the actiontime
if (!$ID && haveRight("global_add_followups", "1")) {
echo "<tr class='tab_bg_1'>";
echo "<th>" . $LANG['job'][20] . " : </th>";
echo "<td class='left' colspan='3'>";
Dropdown::showInteger('hour', $options['hour'], 0, 100);
echo " " . $LANG['job'][21] . " ";
Dropdown::showInteger('minute', $options['minute'], 0, 59);
echo " " . $LANG['job'][22] . " ";
echo "</td>";
echo "</tr>";
}
echo '</table>';
if ($ID) {
$this->showActorsPartForm($ID, $options);
}
echo "<table class='tab_cadre_fixe'>";
$view_linked_tickets = $ID || $canupdate;
echo "<tr class='tab_bg_1'>";
echo "<th width='10%'>" . $LANG['common'][57] . " :</th>";
echo "<td width='50%'>";
if (!$ID || $canupdate_descr) {
$rand = mt_rand();
echo "<script type='text/javascript' >\n";
echo "function showName{$rand}() {\n";
echo "Ext.get('name{$rand}').setDisplayed('none');";
$params = array('maxlength' => 250, 'size' => 60, 'name' => 'name', 'data' => rawurlencode($this->fields["name"]));
ajaxUpdateItemJsCode("viewname{$rand}", $CFG_GLPI["root_doc"] . "/ajax/inputtext.php", $params, false);
echo "}";
echo "</script>\n";
echo "<div id='name{$rand}' class='tracking left' onClick='showName{$rand}()'>\n";
if (empty($this->fields["name"])) {
echo $LANG['reminder'][15];
} else {
echo $this->fields["name"];
}
echo "</div>\n";
echo "<div id='viewname{$rand}'>\n";
示例5: showForm
/**
* Print the contract 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 boolean item found
**/
function showForm($ID, $options = array())
{
$this->initForm($ID, $options);
$can_edit = $this->can($ID, 'w');
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td><td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td>" . __('Contract type') . "</td><td >";
ContractType::dropdown(array('value' => $this->fields["contracttypes_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . _x('phone', 'Number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "num");
echo "</td>";
echo "<td colspan='2'></td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Start date') . "</td>";
echo "<td>";
Html::showDateFormItem("begin_date", $this->fields["begin_date"]);
echo "</td>";
echo "<td>" . __('Initial contract period') . "</td><td>";
Dropdown::showInteger("duration", $this->fields["duration"], 1, 120, 1, array(0 => Dropdown::EMPTY_VALUE), array('unit' => 'month'));
if (!empty($this->fields["begin_date"])) {
echo " -> " . Infocom::getWarrantyExpir($this->fields["begin_date"], $this->fields["duration"], 0, true);
}
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Notice') . "</td><td>";
Dropdown::showInteger("notice", $this->fields["notice"], 0, 120, 1, array(), array('unit' => 'month'));
if (!empty($this->fields["begin_date"]) && $this->fields["notice"] > 0) {
echo " -> " . Infocom::getWarrantyExpir($this->fields["begin_date"], $this->fields["duration"], $this->fields["notice"], true);
}
echo "</td>";
echo "<td>" . __('Account number') . "</td><td>";
Html::autocompletionTextField($this, "accounting_number");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Contract renewal period') . "</td><td>";
Dropdown::showInteger("periodicity", $this->fields["periodicity"], 12, 60, 12, array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)), array('unit' => 'month'));
echo "</td>";
echo "<td>" . __('Invoice period') . "</td>";
echo "<td>";
Dropdown::showInteger("billing", $this->fields["billing"], 12, 60, 12, array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6)), array('unit' => 'month'));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'><td>" . __('Renewal') . "</td><td>";
self::dropdownContractRenewal("renewal", $this->fields["renewal"]);
echo "</td>";
echo "<td>" . __('Max number of items') . "</td><td>";
Dropdown::showInteger("max_links_allowed", $this->fields["max_links_allowed"], 1, 200, 1, array(0 => __('Unlimited')));
echo "</td>";
echo "</tr>";
if (Entity::getUsedConfig("use_contracts_alert", $this->fields["entities_id"])) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Email alarms') . "</td>";
echo "<td>";
self::dropdownAlert(array('name' => "alert", 'value' => $this->fields["alert"]));
Alert::displayLastAlert(__CLASS__, $ID);
echo "</td>";
echo "<td colspan='2'> </td>";
echo "</tr>";
}
echo "<tr class='tab_bg_1'><td class='top'>" . __('Comments') . "</td>";
echo "<td class='center' colspan='3'>";
echo "<textarea cols='50' rows='4' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Support hours') . "</td>";
echo "<td colspan='3'> </td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('on week') . "</td>";
echo "<td colspan='3'>" . __('Start') . " ";
Dropdown::showHours("week_begin_hour", $this->fields["week_begin_hour"]);
echo "<span class='small_space'>" . __('End') . "</span> ";
Dropdown::showHours("week_end_hour", $this->fields["week_end_hour"]);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('on Saturday') . "</td>";
echo "<td colspan='3'>";
Dropdown::showYesNo("use_saturday", $this->fields["use_saturday"]);
echo "<span class='small_space'>" . __('Start') . "</span> ";
Dropdown::showHours("saturday_begin_hour", $this->fields["saturday_begin_hour"]);
echo "<span class='small_space'>" . __('End') . "</span> ";
Dropdown::showHours("saturday_end_hour", $this->fields["saturday_end_hour"]);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
//.........这里部分代码省略.........
示例6: define
define('GLPI_ROOT', '../../..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
checkLoginUser();
switch ($_POST['itemtype']) {
case 'PluginMonitoringServicescatalog':
Dropdown::show('PluginMonitoringServicescatalog', array('name' => 'items_id'));
break;
case 'PluginMonitoringComponentscatalog':
Dropdown::show('PluginMonitoringComponentscatalog', array('name' => 'items_id'));
break;
case 'PluginMonitoringService':
$rand = mt_rand();
echo "<select name='itemtype' id='itemtype{$rand}'>";
echo "<option value='0'>" . DROPDOWN_EMPTY_VALUE . "</option>";
// $a_types =array();
echo "<option value='Computer'>" . Computer::getTypeName() . "</option>";
echo "<option value='NetworkEquipment'>" . NetworkEquipment::getTypeName() . "</option>";
echo "</select>";
$params = array('itemtype' => '__VALUE__', 'entity_restrict' => $_POST['a_entities'], 'selectgraph' => '1', 'rand' => $rand);
ajaxUpdateItemOnSelectEvent("itemtype{$rand}", "show_itemtype{$rand}", $CFG_GLPI["root_doc"] . "/plugins/monitoring/ajax/dropdownServiceHostType.php", $params);
echo "<span id='show_itemtype{$rand}'><input type='hidden' name='services_id[]' value='0'/></span>\n";
break;
case 'PluginMonitoringWeathermap':
Dropdown::show('PluginMonitoringWeathermap', array('name' => 'items_id'));
echo " " . $LANG['plugin_monitoring']['displayview'][5] . " : " . Dropdown::showInteger("extra_infos", 100, 0, 100, 5);
break;
default:
break;
}
示例7: showWarrantyItem
function showWarrantyItem($ID, $supplierWarranty)
{
echo "<td>";
Dropdown::showInteger("to_warranty_duration" . $ID, $supplierWarranty, 0, 120, 1, array(-1 => __('Lifelong')));
echo "</td>";
}
示例8: displaySpecificTypeField
function displaySpecificTypeField($ID, $field = array())
{
switch ($field['type']) {
case 'notificationinterval':
if ($ID > 0) {
// $this->fields['notification_interval'];
} else {
$this->fields['notification_interval'] = 30;
}
Dropdown::showInteger('notification_interval', $this->fields['notification_interval'], 1, 1000);
break;
}
}
示例9: showForm
/**
* Print the cartridge type form
*
* @param $ID integer ID of the item
* @param $options array
* - target for the Form
* - withtemplate : 1 for newtemplate, 2 for newobject from template
*
* @return Nothing (display)
*
**/
function showForm($ID, $options = array())
{
global $LANG;
// Show CartridgeItem or blank form
if (!haveRight("cartridge", "r")) {
return false;
}
if ($ID > 0) {
$this->check($ID, 'r');
} else {
// Create item
$this->check(-1, 'w');
}
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][16] . " : </td>";
echo "<td>";
autocompletionTextField($this, "name");
echo "</td>";
echo "<td rowspan='7' class='middle right'>" . $LANG['common'][25] . " : </td>";
echo "<td class='center middle' rowspan='7'>";
echo "<textarea cols='45' rows='9' name='comment'>" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['consumables'][2] . " : </td>";
echo "<td>";
autocompletionTextField($this, "ref");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][17] . " : </td>";
echo "<td>";
Dropdown::show('CartridgeItemType', array('value' => $this->fields["cartridgeitemtypes_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][5] . " : </td>";
echo "<td>";
Dropdown::show('Manufacturer', array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][10] . " : </td>";
echo "<td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'interface', 'entity' => $this->fields["entities_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['consumables'][36] . " : </td>";
echo "<td>";
Dropdown::show('Location', array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['consumables'][38] . " : </td>";
echo "<td>";
Dropdown::showInteger('alarm_threshold', $this->fields["alarm_threshold"], -1, 100);
Alert::displayLastAlert('CartridgeItem', $ID);
echo "</td></tr>";
$this->showFormButtons($options);
$this->addDivForTabs();
return true;
}
示例10: refreshPage
function refreshPage()
{
global $LANG;
echo "<form name='form' method='post' action='" . $_SERVER["PHP_SELF"] . "' >";
echo "<table width='100%'>";
echo "<tr>";
echo "<td align='right'>";
echo $LANG['plugin_monitoring']['display'][1] . " : ";
echo " ";
Dropdown::showInteger("_refresh", $_SESSION['glpi_plugin_monitoring']['_refresh'], 30, 1000, 10);
echo " ";
echo "<input type='submit' name='sessionupdate' class='submit' value=\"" . $LANG['buttons'][2] . "\">";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</form>";
}
示例11: showFormAdvancedConfig
function showFormAdvancedConfig()
{
$ID = $this->getField('id');
echo "<form method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<div class='center'><table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_2'><th colspan='4'>";
echo "<input type='hidden' name='id' value='{$ID}'>" . __('Advanced information') . "</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Use TLS') . "</td><td>";
if (function_exists("ldap_start_tls")) {
Dropdown::showYesNo('use_tls', $this->fields["use_tls"]);
} else {
echo "<input type='hidden' name='use_tls' value='0'>" . __('ldap_start_tls does not exist');
}
echo "</td>";
echo "<td>" . __('LDAP directory time zone') . "</td><td>";
Dropdown::showGMT("time_offset", $this->fields["time_offset"]);
echo "</td></tr>";
if (self::isLdapPageSizeAvailable(false, false)) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Use paged results') . "</td><td>";
Dropdown::showYesNo('can_support_pagesize', $this->fields["can_support_pagesize"]);
echo "</td>";
echo "<td>" . __('Page size') . "</td><td>";
Dropdown::showInteger("pagesize", $this->fields['pagesize'], 100, 100000, 100);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Maximum number of results') . "</td><td>";
Dropdown::showInteger('ldap_maxlimit', $this->fields['ldap_maxlimit'], 100, 999999, 100, array(0 => __('Unlimited')));
echo "</td><td colspan='2'></td></tr>";
} else {
echo "<input type='hidden' name='can_support_pagesize' value='0'>";
echo "<input type='hidden' name='pagesize' value='0'>";
echo "<input type='hidden' name='ldap_maxlimit' value='0'>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('How LDAP aliases should be handled') . "</td><td colspan='4'>";
$alias_options[LDAP_DEREF_NEVER] = __('Never dereferenced (default)');
$alias_options[LDAP_DEREF_ALWAYS] = __('Always dereferenced');
$alias_options[LDAP_DEREF_SEARCHING] = __('Dereferenced during the search (but not when locating)');
$alias_options[LDAP_DEREF_FINDING] = __('Dereferenced when locating (not during the search)');
Dropdown::showFromArray("deref_option", $alias_options, array('value' => $this->fields["deref_option"]));
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td class='center' colspan='4'>";
echo "<input type='submit' name='update' class='submit' value=\"" . __s('Save') . "\">";
echo "</td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
示例12: showForComputer
/**
* Print the form for devices linked to a computer or a template
*
* @param $computer Computer object
* @param $withtemplate='' boolean : template or basic computer
*
* @return Nothing (display)
**/
static function showForComputer(Computer $computer, $withtemplate = '')
{
global $DB, $LANG;
$devtypes = self::getDeviceTypes();
$ID = $computer->getField('id');
if (!$computer->can($ID, 'r')) {
return false;
}
$canedit = $withtemplate != 2 && $computer->can($ID, 'w');
echo "<div class='spaced'>";
if ($canedit) {
echo "<form name='form_device_action' action='" . getItemTypeFormURL(__CLASS__) . "' method='post'>";
echo "<input type='hidden' name='computers_id' value='{$ID}'>";
}
echo "<table class='tab_cadre_fixe' >";
echo "<tr><th colspan='63'>" . $LANG['title'][30] . "</th></tr>";
$nb = 0;
$specificity_units = array('DeviceProcessor' => $LANG['setup'][35], 'DeviceMemory' => $LANG['common'][82], 'DeviceHardDrive' => $LANG['common'][82], 'DeviceGraphicCard' => $LANG['common'][82]);
foreach ($devtypes as $itemtype) {
initNavigateListItems($itemtype, $computer->getTypeName() . " = " . $computer->getName());
$device = new $itemtype();
$specificities = $device->getSpecifityLabel();
$specif_fields = array_keys($specificities);
$specif_text = implode(',', $specif_fields);
if (!empty($specif_text)) {
$specif_text = " ," . $specif_text . " ";
}
$linktable = getTableForItemType('Computer_' . $itemtype);
$fk = getForeignKeyFieldForTable(getTableForItemType($itemtype));
$query = "SELECT COUNT(*) AS NB,\n `id`,\n `{$fk}`\n {$specif_text}\n FROM `{$linktable}`\n WHERE `computers_id` = '{$ID}'\n GROUP BY `{$fk}` {$specif_text}";
$prev = '';
foreach ($DB->request($query) as $data) {
addToNavigateListItems($itemtype, $data[$fk]);
if ($device->getFromDB($data[$fk])) {
echo "<tr class='tab_bg_2'>";
echo "<td class='center'>";
Dropdown::showInteger("quantity_" . $itemtype . "_" . $data['id'], $data['NB']);
echo "</td><td>";
if ($device->canCreate()) {
echo "<a href='" . $device->getSearchURL() . "'>" . $device->getTypeName() . "</a>";
} else {
echo $device->getTypeName();
}
echo "</td><td>" . $device->getLink() . "</td>";
$spec = $device->getFormData();
if (isset($spec['label']) && count($spec['label'])) {
$colspan = 60 / count($spec['label']);
foreach ($spec['label'] as $i => $label) {
if (isset($spec['value'][$i])) {
echo "<td colspan='{$colspan}'>" . $spec['label'][$i] . " : ";
echo $spec['value'][$i] . "</td>";
} else {
if ($canedit) {
// Specificity
echo "<td class='right' colspan='{$colspan}'>" . $spec['label'][$i] . " : ";
echo "<input type='text' name='value_" . $itemtype . "_" . $data['id'] . "' value='" . $data['specificity'] . "' size='" . $spec['size'] . "'>";
if (isset($specificity_units[$device->getType()])) {
echo ' ' . $specificity_units[$device->getType()];
}
echo "</td>";
} else {
echo "<td colspan='{$colspan}'>" . $spec['label'][$i] . " : ";
echo $data['specificity'];
if (isset($specificity_units[$device->getType()])) {
echo ' ' . $specificity_units[$device->getType()];
}
echo "</td>";
}
}
}
} else {
echo "<td colspan='60'> </td>";
}
echo "</tr>";
$nb++;
}
}
}
if ($canedit) {
if ($nb > 0) {
echo "<tr><td colspan='63' class='tab_bg_1 center'>";
echo "<input type='submit' class='submit' name='updateall' value='" . $LANG['buttons'][7] . "'></td></tr>";
}
echo "<tr><td colspan='63' class='tab_bg_1 center'>";
echo $LANG['devices'][0] . " : ";
Dropdown::showAllItems('items_id', '', 0, -1, $devtypes);
echo "<input type='submit' name='add' value=\"" . $LANG['buttons'][8] . "\" class='submit'>";
echo "</tr></table></form>";
} else {
echo "</table>";
}
echo "</div>";
//.........这里部分代码省略.........
示例13: showFormAdvancedOptions
function showFormAdvancedOptions($target, $ID = '')
{
global $DB, $CFG_GLPI, $LANG;
echo "<div align='center'><form method='post' name='' id='' action=\"" . $target . "\">";
echo "<table class='tab_cadre' cellpadding='5' width='950'>";
echo "<tr>";
echo "<th colspan='4'>";
echo $LANG['plugin_fusioninventory']["agents"][9];
echo " :</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center' width='200'>" . $LANG['plugin_fusioninventory']["agents"][11] . "</td>";
echo "<td align='center' width='200'>";
Dropdown::showInteger("core_discovery", $this->fields["core_discovery"], 1, 32);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['plugin_fusioninventory']["agents"][3] . "</td>";
echo "<td align='center'>";
Dropdown::showInteger("threads_discovery", $this->fields["threads_discovery"], 1, 400);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['plugin_fusioninventory']["agents"][10] . "</td>";
echo "<td align='center'>";
Dropdown::showInteger("core_query", $this->fields["core_query"], 1, 32);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['plugin_fusioninventory']["agents"][2] . "</td>";
echo "<td align='center'>";
Dropdown::showInteger("threads_query", $this->fields["threads_query"], 1, 200);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_2'>";
echo "<td align='center' colspan='4'>";
echo "<input type='hidden' name='ID' value='" . $ID . "'/>";
echo "<div align='center'><input type='submit' name='update' value=\"" . $LANG["buttons"][7] . "\" class='submit' >";
echo "</td>";
echo "</tr>";
echo "</table></form></div>";
}
示例14: showForItem
//.........这里部分代码省略.........
showDateFormItem("use_date", $ic->fields["use_date"], true, $editcalendar);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][21] . " :</td>";
echo "<td><input type='text' name='value' {$option} value='" . formatNumber($ic->fields["value"], true) . "' size='14'></td>";
echo "</td>";
echo "<td>" . $LANG['financial'][114] . " :</td><td>";
showDateFormItem("inventory_date", $ic->fields["inventory_date"], true, $editcalendar);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][78] . " :</td>";
echo "<td><input type='text' {$option} name='warranty_value' value='" . formatNumber($ic->fields["warranty_value"], true) . "' size='14'></td>";
echo "<td rowspan='5'>" . $LANG['common'][25] . " :</td>";
echo "<td rowspan='5' class='middle'>";
echo "<textarea cols='45' rows='9' name='comment' >" . $ic->fields["comment"];
echo "</textarea></td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][81] . " :</td><td>";
echo formatNumber(self::Amort($ic->fields["sink_type"], $ic->fields["value"], $ic->fields["sink_time"], $ic->fields["sink_coeff"], $ic->fields["warranty_date"], $ic->fields["use_date"], $date_tax, "n"));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][22] . " :</td><td >";
if ($withtemplate == 2) {
echo self::getAmortTypeName($ic->fields["sink_type"]);
} else {
self::dropdownAmortType("sink_type", $ic->fields["sink_type"]);
}
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][23] . " :</td><td>";
if ($withtemplate == 2) {
echo $ic->fields["sink_time"];
} else {
Dropdown::showInteger("sink_time", $ic->fields["sink_time"], 0, 15);
}
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][77] . " :</td>";
echo "<td>";
autocompletionTextField($ic, "sink_coeff", array('size' => 14, 'option' => $option));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
if (!in_array($item->getType(), array('Cartridge', 'CartridgeItem', 'Consumable', 'ConsumableItem', 'Software', 'SoftwareLicense'))) {
echo "<td>" . $LANG['financial'][89] . " :</td><td>";
echo self::showTco($item->getField('ticket_tco'), $ic->fields["value"]);
} else {
echo "<td colspan='2'>";
}
echo "</td>";
if (!in_array($item->getType(), array('Cartridge', 'CartridgeItem', 'Consumable', 'ConsumableItem', 'Software', 'SoftwareLicense'))) {
echo "<td>" . $LANG['financial'][90] . " :</td><td>";
echo self::showTco($item->getField('ticket_tco'), $ic->fields["value"], $ic->fields["warranty_date"]);
} else {
echo "<td colspan='2'>";
}
echo "</td></tr>";
echo "<tr><th colspan='4'>" . $LANG['financial'][7] . "</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][29] . " :</td><td>";
showDateFormItem("warranty_date", $ic->fields["warranty_date"], true, $editcalendar);
echo "</td>";
echo "<td>" . $LANG['financial'][15] . " :</td><td>";
if ($withtemplate == 2) {
// -1 = life
if ($ic->fields["warranty_duration"] == -1) {
echo $LANG['financial'][2];
示例15: showForm
/**
* Display form for configuration
*
* @param $items_id integer ID
* @param $options array
*
*@return bool true if form is ok
*
**/
function showForm($items_id, $options = array())
{
global $DB, $CFG_GLPI, $LANG;
$options['candel'] = false;
if ($this->getFromDB("1")) {
} else {
$input = array();
$input['phppath'] = "/usr/bin/php";
$this->add($input);
$this->getFromDB("1");
}
$this->showFormHeader($options);
$this->getFromDB($items_id);
echo "<tr class='tab_bg_1'>";
echo "<td></td>";
echo "<td align='center'>";
echo "</td>";
echo "<td rowspan='3'>";
echo $LANG['plugin_monitoring']['config'][0] . " :";
echo "</td>";
echo "<td rowspan='3'>";
$a_timezones = $this->getTimezones();
$a_timezones_selected = importArrayFromDB($this->fields['timezones']);
$a_timezones_selected2 = array();
foreach ($a_timezones_selected as $timezone) {
$a_timezones_selected2[$timezone] = $a_timezones[$timezone];
unset($a_timezones[$timezone]);
}
ksort($a_timezones_selected2);
echo "<table>";
echo "<tr>";
echo "<td class='right'>";
if (count($a_timezones)) {
echo "<select name='timezones_to_add[]' multiple size='5'>";
foreach ($a_timezones as $key => $val) {
echo "<option value='{$key}'>" . $val . "</option>";
}
echo "</select>";
}
echo "</td><td class='center'>";
if (count($a_timezones)) {
echo "<input type='submit' class='submit' name='timezones_add' value='" . $LANG['buttons'][8] . " >>'>";
}
echo "<br><br>";
if (count($a_timezones_selected2)) {
echo "<input type='submit' class='submit' name='timezones_delete' value='<< " . $LANG['buttons'][6] . "'>";
}
echo "</td><td>";
if (count($a_timezones_selected2)) {
echo "<select name='timezones_to_delete[]' multiple size='5'>";
foreach ($a_timezones_selected2 as $key => $val) {
echo "<option value='{$key}'>" . $val . "</option>";
}
echo "</select>";
} else {
echo " ";
}
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['plugin_monitoring']['config'][6] . " :</td>";
echo "<td align='center'>";
echo "<input name='phppath' type='text' value='" . $this->fields['phppath'] . "' size='40'/>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['plugin_monitoring']['config'][3] . " :</td>";
echo "<td align='center'>";
Dropdown::showInteger("logretention", $this->fields['logretention'], 0, 1000);
echo "</td>";
echo "</tr>";
$this->showFormButtons($options);
return true;
}