"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "inc/devicenetworkcard.class.php" between
glpi-9.3.3.tgz and glpi-9.4.0.tgz

About: GLPI is an IT and asset management software (Information Resource Manager).

devicenetworkcard.class.php  (glpi-9.3.3.tgz):devicenetworkcard.class.php  (glpi-9.4.0.tgz)
skipping to change at line 124 skipping to change at line 124
* *
* @return integer ID of existing or new Device * @return integer ID of existing or new Device
**/ **/
function import(array $input) { function import(array $input) {
global $DB; global $DB;
if (!isset($input['designation']) || empty($input['designation'])) { if (!isset($input['designation']) || empty($input['designation'])) {
return 0; return 0;
} }
$query = "SELECT `id` $criteria = [
FROM `".$this->getTable()."` 'SELECT' => 'id',
WHERE `designation` = '" . $input['designation'] . "'"; 'FROM' => $this->getTable(),
'WHERE' => ['designation' => $input['designation']]
];
if (isset($input["bandwidth"])) { if (isset($input["bandwidth"])) {
$query .= " AND `bandwidth` = '".$input["bandwidth"]."'"; $criteria['WHERE']['bandwidth'] = $input['bandwidth'];
} }
$result = $DB->query($query); $iterator = $DB->request($criteria);
if ($DB->numrows($result) > 0) {
$line = $DB->fetch_assoc($result); if (count($iterator) > 0) {
$line = $iterator->next();
return $line['id']; return $line['id'];
} }
return $this->add($input); return $this->add($input);
} }
/** /**
* @since 0.84 * @since 0.84
* *
* @see CommonDevice::getHTMLTableHeader() * @see CommonDevice::getHTMLTableHeader()
**/ **/
skipping to change at line 219 skipping to change at line 222
case 'Computer' : case 'Computer' :
Manufacturer::getHTMLTableCellsForItem($row, $this, null, $options); Manufacturer::getHTMLTableCellsForItem($row, $this, null, $options);
if ($this->fields["bandwidth"]) { if ($this->fields["bandwidth"]) {
$row->addCell($row->getHeaderByName('devicenetworkcard_bandwidth' ), $row->addCell($row->getHeaderByName('devicenetworkcard_bandwidth' ),
$this->fields["bandwidth"], $father); $this->fields["bandwidth"], $father);
} }
break; break;
} }
} }
public static function rawSearchOptionsToAdd($itemtype, $main_joinparams) {
$tab = [];
$tab[] = [
'id' => '112',
'table' => 'glpi_devicenetworkcards',
'field' => 'designation',
'name' => __('Network interface'),
'forcegroupby' => true,
'massiveaction' => false,
'datatype' => 'string',
'joinparams' => [
'beforejoin' => [
'table' => 'glpi_items_devicenetworkcards',
'joinparams' => $main_joinparams
]
]
];
$tab[] = [
'id' => '113',
'table' => 'glpi_items_devicenetworkcards',
'field' => 'mac',
'name' => __('MAC address'),
'forcegroupby' => true,
'massiveaction' => false,
'datatype' => 'string',
'joinparams' => $main_joinparams
];
return $tab;
}
} }
 End of changes. 4 change blocks. 
7 lines changed or deleted 42 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)