"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "inc/item_operatingsystem.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).

item_operatingsystem.class.php  (glpi-9.3.3.tgz):item_operatingsystem.class.php  (glpi-9.4.0.tgz)
skipping to change at line 105 skipping to change at line 105
&& isset($columns[$_GET["sort"]])) { && isset($columns[$_GET["sort"]])) {
$sort = "`".$_GET["sort"]."`"; $sort = "`".$_GET["sort"]."`";
} else { } else {
$sort = "`glpi_items_operatingsystems`.`id`"; $sort = "`glpi_items_operatingsystems`.`id`";
} }
if (empty($withtemplate)) { if (empty($withtemplate)) {
$withtemplate = 0; $withtemplate = 0;
} }
$query = "SELECT `glpi_items_operatingsystems`.`id` AS assocID, $iterator = $DB->request([
`glpi_operatingsystems`.`name`, 'SELECT' => [
`glpi_operatingsystemversions`.`name` AS version, 'glpi_items_operatingsystems.id AS assocID',
`glpi_operatingsystemarchitectures`.`name` AS architectur 'glpi_operatingsystems.name',
e, 'glpi_operatingsystemversions.name AS version',
`glpi_operatingsystemservicepacks`.`name` AS servicepack 'glpi_operatingsystemarchitectures.name AS architecture',
FROM `glpi_items_operatingsystems` 'glpi_operatingsystemservicepacks.name AS servicepack'
LEFT JOIN `glpi_operatingsystems` ],
ON (`glpi_items_operatingsystems`.`operatingsystems_i 'FROM' => 'glpi_items_operatingsystems',
d`=`glpi_operatingsystems`.`id`) 'LEFT JOIN' => [
LEFT JOIN `glpi_operatingsystemservicepacks` 'glpi_operatingsystems' => [
ON (`glpi_items_operatingsystems`.`operatingsystemser 'ON' => [
vicepacks_id`=`glpi_operatingsystemservicepacks`.`id`) 'glpi_items_operatingsystems' => 'operatingsystems_id',
LEFT JOIN `glpi_operatingsystemarchitectures` 'glpi_operatingsystems' => 'id'
ON (`glpi_items_operatingsystems`.`operatingsystemarchit ]
ectures_id`=`glpi_operatingsystemarchitectures`.`id`) ],
LEFT JOIN `glpi_operatingsystemversions` 'glpi_operatingsystemservicepacks' => [
ON (`glpi_items_operatingsystems`.`operatingsystemversio 'ON' => [
ns_id` = `glpi_operatingsystemversions`.`id`) 'glpi_items_operatingsystems' => 'operatingsystemservice
WHERE `glpi_items_operatingsystems`.`items_id` = '".$item->getID packs_id',
()."' 'glpi_operatingsystemservicepacks' => 'id'
AND `glpi_items_operatingsystems`.`itemtype` = '".$item->g ]
etType()."' "; ],
'glpi_operatingsystemarchitectures' => [
$query .= " ORDER BY $sort $order"; 'ON' => [
'glpi_items_operatingsystems' => 'operatingsystemarchite
ctures_id',
'glpi_operatingsystemarchitectures' => 'id'
]
],
'glpi_operatingsystemversions' => [
'ON' => [
'glpi_items_operatingsystems' => 'operatingsystemversions_i
d',
'glpi_operatingsystemversions' => 'id'
]
]
],
'WHERE' => [
'glpi_items_operatingsystems.itemtype' => $item->getType(),
'glpi_items_operatingsystems.items_id' => $item->getID()
],
'ORDERBY' => "$sort $order"
]);
$result = $DB->query($query); $number = count($iterator);
$number = $DB->numrows($result);
$i = 0; $i = 0;
$os = []; $os = [];
$used = []; $used = [];
if ($numrows = $DB->numrows($result)) { while ($data = $iterator->next()) {
while ($data = $DB->fetch_assoc($result)) { $os[$data['assocID']] = $data;
$os[$data['assocID']] = $data;
}
} }
$canedit = $item->canEdit($item->getID()); $canedit = $item->canEdit($item->getID());
//multi OS for an item is not an existing feature right now. //multi OS for an item is not an existing feature right now.
/*if ($canedit && $numrows >= 1 /*if ($canedit && $number >= 1
&& !(!empty($withtemplate) && ($withtemplate == 2))) { && !(!empty($withtemplate) && ($withtemplate == 2))) {
echo "<div class='center firstbloc'>". echo "<div class='center firstbloc'>".
"<a class='vsubmit' href='" . Toolbox::getItemTypeFormURL(self::getT ype()) . "?items_id=" . $item->getID() . "<a class='vsubmit' href='" . Toolbox::getItemTypeFormURL(self::getT ype()) . "?items_id=" . $item->getID() .
"&amp;itemtype=" . $item->getType() . "&amp;withtemplate=" . $withte mplate."'>"; "&amp;itemtype=" . $item->getType() . "&amp;withtemplate=" . $withte mplate."'>";
echo __('Add an operating system'); echo __('Add an operating system');
echo "</a></div>\n"; echo "</a></div>\n";
}*/ }*/
if ($numrows <= 1) { if ($number <= 1) {
$id = -1; $id = -1;
$instance = new self(); $instance = new self();
if ($numrows > 0) { if ($number > 0) {
$id = array_keys($os)[0]; $id = array_keys($os)[0];
} else { } else {
//set itemtype and items_id //set itemtype and items_id
$instance->fields['itemtype'] = $item->getType(); $instance->fields['itemtype'] = $item->getType();
$instance->fields['items_id'] = $item->getID(); $instance->fields['items_id'] = $item->getID();
$instance->fields['entities_id'] = $item->fields['entities_id']; $instance->fields['entities_id'] = $item->fields['entities_id'];
} }
$instance->showForm($id, ['canedit' => $canedit]); $instance->showForm($id, ['canedit' => $canedit]);
return; return;
} }
skipping to change at line 312 skipping to change at line 332
echo "<td><label for='dropdown_operatingsystemeditions_id$rand'>" . __('Ed ition') . "</label></td>"; echo "<td><label for='dropdown_operatingsystemeditions_id$rand'>" . __('Ed ition') . "</label></td>";
echo "<td >"; echo "<td >";
OperatingSystemEdition::dropdown([ OperatingSystemEdition::dropdown([
'value' => $this->fields['operatingsystemeditions_id'], 'value' => $this->fields['operatingsystemeditions_id'],
'rand' => $rand 'rand' => $rand
]); ]);
echo "</td></tr>"; echo "</td></tr>";
echo "<tr class='tab_bg_1'>"; echo "<tr class='tab_bg_1'>";
echo "<td><label for='textfield_license_id$rand'>".__('Product ID')."</lab el></td>"; echo "<td><label for='textfield_licenseid$rand'>".__('Product ID')."</labe l></td>";
echo "<td >"; echo "<td >";
Html::autocompletionTextField($this, 'license_id', ['rand' => $rand]); Html::autocompletionTextField($this, 'licenseid', ['rand' => $rand]);
echo "</td>"; echo "</td>";
echo "<td><label for='textfield_license_number$rand'>".__('Serial number') ."</label></td>"; echo "<td><label for='textfield_license_number$rand'>".__('Serial number') ."</label></td>";
echo "<td >"; echo "<td >";
Html::autocompletionTextField($this, 'license_number', ['rand' => $rand]); Html::autocompletionTextField($this, 'license_number', ['rand' => $rand]);
echo "</td><td colspan='2'></td></tr>"; echo "</td><td colspan='2'></td></tr>";
$options['formfooter'] = false; $options['formfooter'] = false;
$this->showFormButtons($options); $this->showFormButtons($options);
} }
skipping to change at line 445 skipping to change at line 465
'massiveaction' => false, 'massiveaction' => false,
'joinparams' => [ 'joinparams' => [
'jointype' => 'itemtype_item', 'jointype' => 'itemtype_item',
'specific_itemtype' => $itemtype 'specific_itemtype' => $itemtype
] ]
]; ];
$tab[] = [ $tab[] = [
'id' => '44', 'id' => '44',
'table' => 'glpi_items_operatingsystems', 'table' => 'glpi_items_operatingsystems',
'field' => 'license_id', 'field' => 'licenseid',
'name' => __('Product ID'), 'name' => __('Product ID'),
'datatype' => 'string', 'datatype' => 'string',
'massiveaction' => false, 'massiveaction' => false,
'joinparams' => [ 'joinparams' => [
'jointype' => 'itemtype_item', 'jointype' => 'itemtype_item',
'specific_itemtype' => $itemtype 'specific_itemtype' => $itemtype
] ]
]; ];
$tab[] = [ $tab[] = [
 End of changes. 9 change blocks. 
37 lines changed or deleted 53 lines changed or added

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