本文整理汇总了PHP中Manufacturer::dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP Manufacturer::dropdown方法的具体用法?PHP Manufacturer::dropdown怎么用?PHP Manufacturer::dropdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manufacturer
的用法示例。
在下文中一共展示了Manufacturer::dropdown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: warningBeforeReplayRulesOnExistingDB
/**
* @see RuleCollection::warningBeforeReplayRulesOnExistingDB()
**/
function warningBeforeReplayRulesOnExistingDB($target)
{
global $CFG_GLPI;
echo "<form name='testrule_form' id='softdictionnary_confirmation' method='post' action=\"" . $target . "\">\n";
echo "<div class='center'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2' class='b'>" . __('Warning before running rename based on the dictionary rules') . "</th</tr>\n";
echo "<tr><td class='tab_bg_2 center'>";
echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\"></td>";
echo "<td class='tab_bg_2 center'>" . __('Warning! This operation can put merged software in the dustbin.<br>Sure to notify your users.') . "</td></tr>\n";
echo "<tr><th colspan='2' class='b'>" . __('Manufacturer choice') . "</th</tr>\n";
echo "<tr><td class='tab_bg_2 center'>" . __('Replay dictionary rules for manufacturers (----- = All)') . "</td>";
echo "<td class='tab_bg_2 center'>";
Manufacturer::dropdown(array('name' => 'manufacturer'));
echo "</td></tr>\n";
echo "<tr><td class='tab_bg_2 center' colspan='2'>";
echo "<input type='submit' name='replay_rule' value=\"" . _sx('button', 'Post') . "\"\n class='submit'>";
echo "<input type='hidden' name='replay_confirm' value='replay_confirm'";
echo "</td></tr>";
echo "</table>\n";
echo "</div>\n";
Html::closeForm();
return true;
}
示例2: showForm
/**
* Print the phone 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())
{
global $CFG_GLPI;
$target = $this->getFormURL();
$withtemplate = $this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<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>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_phone`='1'"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
PhoneType::dropdown(array('value' => $this->fields["phonetypes_id"]));
echo "</td></tr>\n";
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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>";
echo "<td>";
PhoneModel::dropdown(array('value' => $this->fields["phonemodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td><td>";
Html::autocompletionTextField($this, "contact");
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Management type') . "</td>";
echo "<td>";
Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["phones_management_restrict"], 'target' => $target));
echo "</td></tr>\n";
// Display auto inventory informations
$rowspan = 7;
$inventory_show = false;
if (!empty($ID) && $this->fields["is_dynamic"]) {
$inventory_show = true;
$rowspan -= 2;
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}'>\n <textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' class='form-control' >" . $this->fields["comment"];
echo "</textarea></td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Brand') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "brand");
//.........这里部分代码省略.........
示例3: showForm
/**
* Print the Software / license form
*
* @param $ID integer Id of the version or the template to print
* @param $options array of possible options:
* - target form target
* - softwares_id ID of the software for add process
*
* @return true if displayed false if item not found or not right to display
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$softwares_id = -1;
if (isset($options['softwares_id'])) {
$softwares_id = $options['softwares_id'];
}
if ($ID < 0) {
// Create item
$this->fields['softwares_id'] = $softwares_id;
$this->fields['number'] = 1;
$soft = new Software();
if ($soft->getFromDB($softwares_id) && in_array($_SESSION['glpiactive_entity'], getAncestorsOf('glpi_entities', $soft->getEntityID()))) {
$options['entities_id'] = $soft->getEntityID();
}
}
$this->initForm($ID, $options);
$this->showFormHeader($options);
// Restore saved value or override with page parameter
if (!isset($options['template_preview'])) {
if (isset($_REQUEST)) {
$saved = Html::cleanPostForTextArea($_REQUEST);
}
}
foreach ($this->fields as $name => $value) {
if (isset($saved[$name]) && empty($this->fields[$name])) {
$this->fields[$name] = $saved[$name];
}
}
echo "<input type='hidden' name='withtemplate' value='" . $options['withtemplate'] . "'>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . Software::getTypeName(1) . "</td>";
echo "<td>";
if ($ID > 0) {
$softwares_id = $this->fields["softwares_id"];
echo "<input type='hidden' name='softwares_id' value='{$softwares_id}'>";
echo "<a href='software.form.php?id=" . $softwares_id . "'>" . Dropdown::getDropdownName("glpi_softwares", $softwares_id) . "</a>";
} else {
Dropdown::show('Software', array('condition' => "`is_template`='0' AND `is_deleted`='0'", 'entity' => $_SESSION['glpiactive_entity'], 'entity_sons' => $_SESSION['glpiactive_entity_recursive'], 'on_change' => 'this.form.submit()', 'value' => $softwares_id));
}
echo "</td>";
echo "<td colspan='2'>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<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>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_softwarelicense`"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td><td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
SoftwareLicenseType::dropdown(array('value' => $this->fields["softwarelicensetypes_id"]));
echo "</td></tr>\n";
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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Publisher') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Serial number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('User') . "</td>";
echo "<td >";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "");
echo "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
//.........这里部分代码省略.........
示例4: showForm
/**
* Print the computer form
*
* @param $ID integer ID of the item
* @param $options array
* - target for the Form
* - withtemplate template or basic computer
*
*@return Nothing (display)
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI, $DB;
$this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<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>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_computer`"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
ComputerType::dropdown(array('value' => $this->fields["computertypes_id"]));
echo "</td></tr>\n";
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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>";
echo "<td>";
ComputerModel::dropdown(array('value' => $this->fields["computermodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
//TRANS: Number of the alternate username
echo "<td>" . __('Alternate username number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'contact_num');
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'serial');
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, 'contact');
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Network') . "</td>";
echo "<td>";
Network::dropdown(array('value' => $this->fields["networks_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
// Display auto inventory informations
$rowspan = 10;
$inventory_show = false;
if (!empty($ID) && Plugin::haveImport() && $this->fields["is_dynamic"]) {
$inventory_show = true;
$rowspan -= 4;
}
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}' class='middle'>";
echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Domain') . "</td>";
//.........这里部分代码省略.........
示例5: 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'>";
//.........这里部分代码省略.........
示例6: showForm
/**
* Print the Software form
*
* @param $ID integer ID of the item
* @param $options array of possible options:
* - 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);
$this->showTabs($options);
$this->showFormHeader($options);
$canedit = $this->can($ID, 'w');
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td>" . __('Publisher') . "</td><td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td><td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Category') . "</td><td>";
SoftwareCategory::dropdown(array('value' => $this->fields["softwarecategories_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td><td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Associable to a ticket') . "</td><td>";
Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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 rowspan='5' class='middle'>" . __('Comments') . "</td>";
echo "<td class='center middle' rowspan='5'>";
echo "<textarea cols='45' rows='8' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('User') . "</td>";
echo "<td >";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td><td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>";
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>";
if (isset($options['withtemplate']) && $options['withtemplate']) {
//TRANS: %s is the datetime of insertion
printf(__('Created on %s'), Html::convDateTime($_SESSION["glpi_currenttime"]));
} else {
//TRANS: %s is the datetime of insertion
printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"]));
}
echo "</td></tr>\n";
// UPDATE
echo "<tr class='tab_bg_1'>";
//TRANS: a noun, (ex : this software is an upgrade of..)
echo "<td>" . __('Upgrade') . "</td><td>";
Dropdown::showYesNo("is_update", $this->fields['is_update']);
echo " " . __('from') . " ";
Software::dropdown(array('value' => $this->fields["softwares_id"]));
echo "</td></tr>\n";
$this->showFormButtons($options);
$this->addDivForTabs();
return true;
}
示例7: showForm
/**
* Print the monitor 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())
{
global $CFG_GLPI;
$target = $this->getFormURL();
$withtemplate = $this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "");
echo "</td>";
echo "<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>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_monitor`"));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
MonitorType::dropdown(array('value' => $this->fields["monitortypes_id"]));
echo "</td></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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>";
echo "<td>";
MonitorModel::dropdown(array('value' => $this->fields["monitormodels_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "contact");
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "otherserial", array('value' => $objectName));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Management type') . "</td>";
echo "<td>";
Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["monitors_management_restrict"], 'target' => $target));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
echo "<td rowspan='4'>" . __('Comments') . "</td>";
echo "<td rowspan='4'>\n <textarea cols='45' rows='10' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Size') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "size");
echo "\"</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . 'Flags' . "</td>";
echo "<td><table>";
//.........这里部分代码省略.........
示例8: showForm
/**
* Print the printer form
*
* @param $ID integer ID of the item
* @param $options array of possible options:
* - target filename : where to go when done.
* - withtemplate boolean : template or basic item
*
*@return boolean item found
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$target = $this->getFormURL();
$withtemplate = $this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>\n";
echo "<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>\n";
echo "<td>" . __('Status') . "</td>\n";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_printer`"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>\n";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>\n";
echo "<td>" . __('Type') . "</td>\n";
echo "<td>";
PrinterType::dropdown(array('value' => $this->fields["printertypes_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td>\n";
echo "<td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>\n";
echo "<td>" . __('Manufacturer') . "</td>\n";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>\n";
echo "<td>";
PrinterModel::dropdown(array('value' => $this->fields["printermodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username number') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo "</td>\n";
echo "<td>" . __('Serial number') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact");
echo "</td>\n";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>\n";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>\n";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>\n";
echo "<td>" . __('Management type') . "</td>";
echo "<td>";
$globalitem = array();
$globalitem['withtemplate'] = $withtemplate;
$globalitem['value'] = $this->fields["is_global"];
$globalitem['target'] = $target;
if ($this->can($ID, UPDATE)) {
$globalitem['management_restrict'] = $CFG_GLPI["printers_management_restrict"];
}
Dropdown::showGlobalSwitch($this->fields["id"], $globalitem);
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>\n";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>\n";
echo "<td>" . __('Network') . "</td>\n";
echo "<td>";
Network::dropdown(array('value' => $this->fields["networks_id"]));
echo "</td></tr>\n";
// Display auto inventory informations
$rowspan = 6;
//.........这里部分代码省略.........
示例9: showForm
function showForm($ID, $options = array())
{
$this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td>" . __('Technician in charge of the hardware') . "</td>";
echo "<td>";
User::dropdown(array('name' => "users_id_tech", 'value' => $this->fields["users_id_tech"], 'entity' => $this->fields["entities_id"], 'right' => 'interface'));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Type') . "</td><td>";
Dropdown::show('PluginCertificatesCertificateType', array('name' => "plugin_certificates_certificatetypes_id", 'value' => $this->fields["plugin_certificates_certificatetypes_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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 "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . _n('Manufacturer', 'Manufacturers', 1) . " (" . __('Root CA', 'certificates') . ")</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('DNS name', 'certificates') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "dns_name");
echo "</td>";
echo "<td>" . __('Creation date') . "</td>";
echo "<td>";
Html::showDateFormItem("date_query", $this->fields["date_query"], true, true);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('DNS suffix', 'certificates') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "dns_suffix");
echo "</td>";
echo "<td>" . __('Expiration date');
echo " ";
Html::showToolTip(nl2br(__('Empty for infinite', 'certificates')));
echo " </td>";
echo "<td>";
Html::showDateFormItem("date_expiration", $this->fields["date_expiration"], true, true);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . PluginCertificatesCertificateState::getTypeName(1) . "</td>";
echo "<td>";
Dropdown::show('PluginCertificatesCertificateState', array('name' => "plugin_certificates_certificatestates_id", 'value' => $this->fields["plugin_certificates_certificatestates_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Notification email', 'certificates') . "</td>";
echo "<td>";
Dropdown::showYesNo('mailing', $this->fields["mailing"]);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Self-signed', 'certificates') . "</td>";
echo "<td>";
Dropdown::showYesNo('auto_sign', $this->fields["auto_sign"]);
echo "</td>";
echo "<td>" . __('Associable to a ticket') . "</td><td>";
Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>";
echo __('Command used', 'certificates') . "</td><td>";
echo "<textarea cols='35' rows='4' name='command' >";
echo $this->fields["command"] . "</textarea>";
echo "</td>";
echo "<td>";
echo __('Certificate request (CSR)', 'certificates') . "</td><td>";
echo "<textarea cols='35' rows='4' name='certificate_request' >";
echo $this->fields["certificate_request"] . "</textarea>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td class='center' colspan='2'>";
printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"]));
echo "</td>";
echo "<td>";
echo self::getTypeName(1) . "</td><td>";
echo "<textarea cols='35' rows='4' name='certificate_item' >";
echo $this->fields["certificate_item"] . "</textarea>";
echo "</td>";
echo "</tr>";
$this->showFormButtons($options);
return true;
}
示例10: showForm
/**
* Print the consumable type form
*
* @param $ID integer ID of the item
* @param $options array
* - target filename : where to go when done.
* - withtemplate boolean : template or basic item
*
* @return Nothing (display)
*
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$this->initForm($ID, $options);
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
ConsumableItemType::dropdown(array('value' => $this->fields["consumableitemtypes_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Reference') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "ref");
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td rowspan='4' class='middle'>" . __('Comments') . "</td>";
echo "<td class='middle' rowspan='4'>\n <textarea cols='45' rows='9' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<td>";
Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Stock location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alert threshold') . "</td>";
echo "<td>";
Dropdown::showInteger('alarm_threshold', $this->fields["alarm_threshold"], 0, 100, 1, array('-1' => __('Never')));
Alert::displayLastAlert('ConsumableItem', $ID);
echo "</td></tr>";
$this->showFormButtons($options);
$this->addDivForTabs();
return true;
}
示例11: showForm
/**
* Print the Software form
*
* @param $ID integer ID of the item
* @param $options array of possible options:
* - 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);
$this->showFormHeader($options);
$canedit = $this->canEdit($ID);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td>" . __('Publisher') . "</td><td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td><td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Category') . "</td><td>";
SoftwareCategory::dropdown(array('value' => $this->fields["softwarecategories_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td><td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Associable to a ticket') . "</td><td>";
Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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 rowspan='4' class='middle'>" . __('Comments') . "</td>";
echo "<td class='center middle' rowspan='4'>";
echo "<textarea cols='45' rows='8' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('User') . "</td>";
echo "<td >";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td><td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td></tr>\n";
// UPDATE
echo "<tr class='tab_bg_1'>";
//TRANS: a noun, (ex : this software is an upgrade of..)
echo "<td>" . __('Upgrade') . "</td><td>";
Dropdown::showYesNo("is_update", $this->fields['is_update']);
echo " " . __('from') . " ";
Software::dropdown(array('value' => $this->fields["softwares_id"]));
echo "</td></tr>\n";
$this->showFormButtons($options);
return true;
}
示例12: showForm
/**
* Print the peripheral 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())
{
global $CFG_GLPI;
$target = $this->getFormURL();
$withtemplate = $this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "");
echo "</td>";
echo "<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>\n";
echo "<td>" . __('Status') . "</td>\n";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_peripheral`"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>\n";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>\n";
echo "<td>" . __('Type') . "</td>\n";
echo "<td>";
PeripheralType::dropdown(array('value' => $this->fields["peripheraltypes_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td>\n";
echo "<td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>\n";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>\n";
echo "<td>";
PeripheralModel::dropdown(array('value' => $this->fields["peripheralmodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username number') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo "</td>";
echo "<td>" . __('Serial number') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact");
echo "</td>\n";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>\n";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "otherserial", array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>\n";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>\n";
echo "<td>" . __('Management type') . "</td>\n";
echo "<td>";
Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["peripherals_management_restrict"], 'target' => $target));
echo "</td></tr>\n";
// Display auto inventory informations
$rowspan = 2;
$inventory_show = false;
if (!empty($ID) && $this->fields["is_dynamic"]) {
$inventory_show = true;
$rowspan -= 1;
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>\n";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>\n";
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>\n";
echo "<td rowspan='{$rowspan}'>\n <textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Brand') . "</td>\n";
//.........这里部分代码省略.........
示例13: showForm
/**
* Print the computer form
*
* @param $ID integer ID of the item
* @param $options array
* - target for the Form
* - withtemplate template or basic computer
*
*@return Nothing (display)
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI, $DB;
$this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<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>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_computer`"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
ComputerType::dropdown(array('value' => $this->fields["computertypes_id"]));
echo "</td></tr>\n";
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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>";
echo "<td>";
ComputerModel::dropdown(array('value' => $this->fields["computermodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
//TRANS: Number of the alternate username
echo "<td>" . __('Alternate username number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'contact_num');
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'serial');
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, 'contact');
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Network') . "</td>";
echo "<td>";
Network::dropdown(array('value' => $this->fields["networks_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
// Display auto inventory informations
$rowspan = 4;
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}' class='middle'>";
echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Domain') . "</td>";
echo "<td >";
Domain::dropdown(array('value' => $this->fields["domains_id"], 'entity' => $this->fields["entities_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('UUID') . "</td>";
//.........这里部分代码省略.........
示例14: showForm
/**
* Print the networking 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);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<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>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_networkequipment`"));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
NetworkEquipmentType::dropdown(array('value' => $this->fields["networkequipmenttypes_id"]));
echo "</td></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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>";
echo "<td>";
NetworkEquipmentModel::dropdown(array('value' => $this->fields["networkequipmentmodels_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "contact");
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "otherserial", array('value' => $objectName));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Network') . "</td>";
echo "<td>";
Network::dropdown(array('value' => $this->fields["networks_id"]));
echo "</td></tr>";
$rowspan = 5;
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}'>\n <textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Domain') . "</td>";
echo "<td>";
Domain::dropdown(array('value' => $this->fields["domains_id"], 'entity' => $this->fields["entities_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td colspan=2>" . __('The MAC address and the IP of the equipment are included in an aggregated network port') . "</td>";
echo "</tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . _n('Firmware', 'Firmwares', 1) . "</td>";
echo "<td>";
//.........这里部分代码省略.........
示例15: showForm
/**
* Print the computer form
*
* @param $ID integer ID of the item
* @param $options array
* - target for the Form
* - withtemplate template or basic computer
*
*@return Nothing (display)
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI, $DB;
$this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<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>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_computer`"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
ComputerType::dropdown(array('value' => $this->fields["computertypes_id"]));
echo "</td></tr>\n";
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' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<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>" . __('Model') . "</td>";
echo "<td>";
ComputerModel::dropdown(array('value' => $this->fields["computermodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
//TRANS: Number of the alternate username
echo "<td>" . __('Alternate username number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'contact_num');
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'serial');
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, 'contact');
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Network') . "</td>";
echo "<td>";
Network::dropdown(array('value' => $this->fields["networks_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
// Display auto inventory informations
$rowspan = 7;
$inventory_show = false;
if (!empty($ID) && Plugin::haveImport() && $this->fields["is_dynamic"]) {
$inventory_show = true;
$rowspan -= 5;
}
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}' class='middle'>";
echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Domain') . "</td>";
//.........这里部分代码省略.........