本文整理汇总了PHP中CommonDevice类的典型用法代码示例。如果您正苦于以下问题:PHP CommonDevice类的具体用法?PHP CommonDevice怎么用?PHP CommonDevice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommonDevice类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getHTMLTableCellForItem
/**
* @since version 0.84
*
* @see CommonDevice::getHTMLTableCellForItem()
**/
function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
{
$column = parent::getHTMLTableCellForItem($row, $item, $father, $options);
if ($column == $father) {
return $father;
}
switch ($item->getType()) {
case 'Computer':
Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options);
}
}
开发者ID:gaforeror,项目名称:glpi,代码行数:16,代码来源:devicepowersupply.class.php
示例2: getHTMLTableCellForItem
/**
* @since version 0.84
*
* @see CommonDevice::getHTMLTableCellForItem()
**/
function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
{
$column = parent::getHTMLTableCellForItem($row, $item, $father, $options);
if ($column == $father) {
return $father;
}
switch ($item->getType()) {
case 'Computer':
Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options);
if ($this->fields["type"]) {
$row->addCell($row->getHeaderByName('devicesoundcard_type'), $this->fields["type"], $father);
}
}
}
开发者ID:geldarr,项目名称:hack-space,代码行数:19,代码来源:devicesoundcard.class.php
示例3: getHTMLTableCellForItem
/**
* @since version 0.84
*
* @see CommonDevice::getHTMLTableCellForItem()
**/
function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
{
$column = parent::getHTMLTableCellForItem($row, $item, $father, $options);
if ($column == $father) {
return $father;
}
switch ($item->getType()) {
case 'Computer':
Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options);
if ($this->fields["assettag"]) {
$row->addCell($row->getHeaderByName('devicebiosdata_tag'), Dropdown::getYesNo($this->fields["assettag"]), $father);
}
if ($this->fields["date"]) {
$row->addCell($row->getHeaderByName('devicebiosdata_date'), $this->fields["date"], $father);
}
}
}
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:22,代码来源:devicebiosdata.class.php
示例4: getAdditionalFields
/**
* @see CommonDevice::getAdditionalFields()
* @since version 0.85
*/
function getAdditionalFields()
{
return array_merge(parent::getAdditionalFields(), array(array('name' => 'none', 'label' => RegisteredID::getTypeName(Session::getPluralNumber()) . RegisteredID::showAddChildButtonForItemForm($this, '_registeredID', NULL, false), 'type' => 'registeredIDChooser')));
}
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:8,代码来源:devicepci.class.php
示例5: getDeviceTypes
/**
* Get all the kind of devices available inside the system.
* This method is equivalent to getItemAffinities('')
*
* @return array of the types of Item_Device* available
**/
static function getDeviceTypes()
{
global $CFG_GLPI;
// If the size of $CFG_GLPI['item_device_types'] and $CFG_GLPI['device_types'] then,
// there is new device_types and we must update item_device_types !
if (!isset($CFG_GLPI['item_device_types']) || count($CFG_GLPI['item_device_types']) != count($CFG_GLPI['device_types'])) {
$CFG_GLPI['item_device_types'] = array();
foreach (CommonDevice::getDeviceTypes() as $deviceType) {
$CFG_GLPI['item_device_types'][] = $deviceType::getItem_DeviceType();
}
}
return $CFG_GLPI['item_device_types'];
}
开发者ID:pvasener,项目名称:glpi,代码行数:19,代码来源:item_devices.class.php
示例6: update084to085
//.........这里部分代码省略.........
$DB->queryOrDie($query, "0.85 fix tags usage for storestatus");
}
}
}
// Upgrade ticket bookmarks
$query = "SELECT *\n FROM `glpi_bookmarks`";
if ($result = $DB->query($query)) {
if ($DB->numrows($result) > 0) {
while ($data = $DB->fetch_assoc($result)) {
$num = 0;
$num2 = 0;
$options = array();
parse_str($data["query"], $options);
if (isset($options['field'])) {
// update ticket statuses
if (($data['itemtype'] = 'Ticket') && $data['type'] == Bookmark::SEARCH) {
foreach ($options['field'] as $key => $val) {
if (($val == 55 || $val == 52) && isset($options['contains'][$key])) {
if (isset($status[$options['contains'][$key]])) {
$options['contains'][$key] = $status[$options['contains'][$key]];
}
}
}
}
}
$query2 = "UPDATE `glpi_bookmarks`\n SET `query` = '" . addslashes(Toolbox::append_params($options)) . "'\n WHERE `id` = '" . $data['id'] . "'";
$DB->queryOrDie($query2, "0.85 update bookmarks");
}
}
}
//////////////////////////////////////////////////
// Device update
$migration->displayMessage(sprintf(__('Data migration - %s'), 'Devices'));
foreach (array_merge(CommonDevice::getDeviceTypes(), Item_Devices::getDeviceTypes()) as $itemtype) {
$table = $itemtype::getTable();
if (!FieldExists($table, 'entities_id')) {
$migration->addField($table, 'entities_id', 'integer');
$migration->addKey($table, array('entities_id'), 'entities_id');
}
if (!FieldExists($table, 'is_recursive')) {
$migration->addField($table, 'is_recursive', 'bool', array('update' => '1', 'after' => 'entities_id'));
$migration->addKey($table, array('is_recursive'), 'is_recursive');
}
}
// Adding the Registered ID class that contains PCI IDs and USB IDs for vendors
// as well devices
if (!TableExists('glpi_registeredids')) {
$query = "CREATE TABLE `glpi_registeredids` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(255) DEFAULT NULL,\n `items_id` int(11) NOT NULL DEFAULT '0',\n `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL,\n `device_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT 'USB, PCI ...',\n PRIMARY KEY (`id`),\n KEY `name` (`name`),\n KEY `item` (`items_id`, `itemtype`),\n KEY `device_type` (`device_type`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
$DB->queryOrDie($query, "0.85 add table glpi_registeredids");
}
// Complete the item_devices
foreach (array('glpi_items_devicecases', 'glpi_items_devicecontrols', 'glpi_items_devicedrives', 'glpi_items_devicegraphiccards', 'glpi_items_devicemotherboards', 'glpi_items_devicenetworkcards', 'glpi_items_devicepcis', 'glpi_items_devicepowersupplies', 'glpi_items_devicesoundcards') as $table) {
if (!FieldExists($table, 'serial')) {
$migration->addField($table, 'serial', 'string');
$migration->addKey($table, 'serial');
}
}
foreach (array('glpi_items_devicecontrols', 'glpi_items_devicedrives', 'glpi_items_devicegraphiccards', 'glpi_items_deviceharddrives', 'glpi_items_devicememories', 'glpi_items_devicenetworkcards', 'glpi_items_devicepcis', 'glpi_items_deviceprocessors', 'glpi_items_devicesoundcards') as $table) {
if (!FieldExists($table, 'busID')) {
$migration->addField($table, 'busID', 'string');
$migration->addKey($table, 'busID');
}
}
// Add key
foreach (array('glpi_items_devicecases', 'glpi_items_devicecontrols', 'glpi_items_devicedrives', 'glpi_items_devicegraphiccards', 'glpi_items_deviceharddrives', 'glpi_items_devicememories', 'glpi_items_devicemotherboards', 'glpi_items_devicenetworkcards', 'glpi_items_devicepcis', 'glpi_items_devicepowersupplies', 'glpi_items_deviceprocessors', 'glpi_items_devicesoundcards') as $table) {
$migration->dropKey($table, 'item');
开发者ID:remicollet,项目名称:glpi,代码行数:67,代码来源:update_084_085.php
示例7: getHTMLTableCellForItem
/**
* @since version 0.84
*
* @see CommonDevice::getHTMLTableCellForItem()
**/
function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
{
$column = parent::getHTMLTableCellForItem($row, $item, $father, $options);
if ($column == $father) {
return $father;
}
switch ($item->getType()) {
case 'Computer':
Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options);
if ($this->fields["is_writer"]) {
$row->addCell($row->getHeaderByName('devicedrive_writer'), Dropdown::getYesNo($this->fields["is_writer"]), $father);
}
if ($this->fields["speed"]) {
$row->addCell($row->getHeaderByName('devicedrive_speed'), $this->fields["speed"], $father);
}
InterfaceType::getHTMLTableCellsForItem($row, $this, NULL, $options);
}
}
开发者ID:kipman,项目名称:glpi,代码行数:23,代码来源:devicedrive.class.php
示例8: getHTMLTableCellForItem
/**
* @since version 0.84
*
* @see CommonDevice::getHTMLTableCellForItem()
**/
function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
{
$column = parent::getHTMLTableCellForItem($row, $item, $father, $options);
if ($column == $father) {
return $father;
}
switch ($item->getType()) {
case 'Computer':
Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options);
InterfaceType::getHTMLTableCellsForItem($row, $this, NULL, $options);
if (!empty($this->fields["chipset"])) {
$row->addCell($row->getHeaderByName('devicegraphiccard_chipset'), $this->fields["chipset"], $father);
}
break;
}
}
开发者ID:stweil,项目名称:glpi,代码行数:21,代码来源:devicegraphiccard.class.php
示例9: getItemtypesThatCanHave
/**
* Get all the types that can have a document
*
* @since version 0.85
*
* @return array of the itemtypes
**/
static function getItemtypesThatCanHave()
{
global $CFG_GLPI;
return array_merge($CFG_GLPI['document_types'], CommonDevice::getDeviceTypes(), Item_Devices::getDeviceTypes());
}
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:12,代码来源:document.class.php
示例10: getHTMLTableCellForItem
/**
* @since version 0.84
*
* @see CommonDevice::getHTMLTableCellForItem()
**/
function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
{
$column = parent::getHTMLTableCellForItem($row, $item, $father, $options);
if ($column == $father) {
return $father;
}
switch ($item->getType()) {
case 'Computer':
Manufacturer::getHTMLTableCellsForItem($row, $this, NULL, $options);
if ($this->fields["devicememorytypes_id"]) {
$row->addCell($row->getHeaderByName('devicememory_type'), Dropdown::getDropdownName("glpi_devicememorytypes", $this->fields["devicememorytypes_id"]), $father);
}
if (!empty($this->fields["frequence"])) {
$row->addCell($row->getHeaderByName('devicememory_frequency'), $this->fields["frequence"], $father);
}
break;
}
}
开发者ID:stweil,项目名称:glpi,代码行数:23,代码来源:devicememory.class.php
示例11: getDeviceItemTypes
/**
* Get the Device list name the user is allowed to edit
*
* @return array (group of dropdown) of array (itemtype => localized name)
**/
static function getDeviceItemTypes()
{
global $CFG_GLPI;
static $optgroup = NULL;
if (!Session::haveRightsOr('device', array(CREATE, UPDATE, PURGE))) {
return array();
}
if (is_null($optgroup)) {
$devices = array();
foreach (CommonDevice::getDeviceTypes() as $device_type) {
$devices[$device_type] = $device_type::getTypeName(Session::getPluralNumber());
}
asort($devices);
$optgroup = array(_n('Component', 'Components', Session::getPluralNumber()) => $devices);
}
return $optgroup;
}
开发者ID:glpi-project,项目名称:glpi,代码行数:22,代码来源:dropdown.class.php
示例12: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[12]['table'] = 'glpi_devicecasetypes';
$tab[12]['field'] = 'name';
$tab[12]['name'] = $LANG['device_case'][0];
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:9,代码来源:devicecase.class.php
示例13: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'chipset';
$tab[11]['name'] = $LANG['device_moboard'][0];
$tab[11]['datatype'] = 'text';
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:10,代码来源:devicemotherboard.class.php
示例14: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'type';
$tab[12]['name'] = $LANG['common'][17];
$tab[12]['datatype'] = 'text';
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:10,代码来源:devicesoundcard.class.php
示例15: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'specif_default';
$tab[12]['name'] = $LANG['devices'][6] . " " . $LANG['devices'][24];
$tab[12]['datatype'] = 'text';
$tab[14]['table'] = 'glpi_interfacetypes';
$tab[14]['field'] = 'name';
$tab[14]['name'] = $LANG['common'][65];
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:13,代码来源:devicegraphiccard.class.php
示例16: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'is_raid';
$tab[12]['name'] = $LANG['device_control'][0];
$tab[12]['datatype'] = 'bool';
$tab[14]['table'] = 'glpi_interfacetypes';
$tab[14]['field'] = 'name';
$tab[14]['name'] = $LANG['common'][65];
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:13,代码来源:devicecontrol.class.php
示例17: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'is_atx';
$tab[11]['name'] = $LANG['device_power'][1];
$tab[11]['datatype'] = 'bool';
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'power';
$tab[12]['name'] = $LANG['device_power'][0];
$tab[12]['datatype'] = 'text';
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:14,代码来源:devicepowersupply.class.php
示例18: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'specif_default';
$tab[11]['name'] = $LANG['device_iface'][2] . " " . $LANG['devices'][24];
$tab[11]['datatype'] = 'text';
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'bandwidth';
$tab[12]['name'] = $LANG['device_iface'][0];
$tab[12]['datatype'] = 'text';
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:14,代码来源:devicenetworkcard.class.php
示例19: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'specif_default';
$tab[11]['name'] = $LANG['device_ram'][2] . " " . $LANG['devices'][24];
$tab[11]['datatype'] = 'text';
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'frequence';
$tab[12]['name'] = $LANG['device_ram'][1];
$tab[12]['datatype'] = 'text';
$tab[13]['table'] = 'glpi_devicememorytypes';
$tab[13]['field'] = 'name';
$tab[13]['name'] = $LANG['common'][17];
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:17,代码来源:devicememory.class.php
示例20: getSearchOptions
function getSearchOptions()
{
global $LANG;
$tab = parent::getSearchOptions();
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'is_writer';
$tab[12]['name'] = $LANG['device_drive'][0];
$tab[12]['datatype'] = 'bool';
$tab[13]['table'] = $this->getTable();
$tab[13]['field'] = 'speed';
$tab[13]['name'] = $LANG['device_drive'][1];
$tab[13]['datatype'] = 'text';
$tab[14]['table'] = 'glpi_interfacetypes';
$tab[14]['field'] = 'name';
$tab[14]['name'] = $LANG['common'][65];
return $tab;
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:17,代码来源:devicedrive.class.php
注:本文中的CommonDevice类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论