Commit 70a49b7a authored by Johan Cwiklinski's avatar Johan Cwiklinski Committed by Johan Cwiklinski

Wrong typename, cleanup

parent 6262aa05
......@@ -199,11 +199,11 @@ $LANG = [];
$CFG_GLPI["unicity_types"] = ['Budget', 'Computer', 'Contact', 'Contract',
'Infocom', 'Monitor', 'NetworkEquipment',
'Peripheral', 'Phone', 'Printer', 'Software',
'SoftwareLicense', 'Supplier','User', 'Certicate', 'Rack', 'Enclosure', 'Pdu'];
'SoftwareLicense', 'Supplier','User', 'Certicate', 'Rack', 'Enclosure', 'PDU'];
$CFG_GLPI["state_types"] = ['Computer', 'Monitor', 'NetworkEquipment',
'Peripheral', 'Phone', 'Printer', 'SoftwareLicense',
'Certificate', 'Enclosure', 'Pdu', 'Line',
'Certificate', 'Enclosure', 'PDU', 'Line',
'Rack', 'SoftwareVersion'];
$CFG_GLPI["asset_types"] = ['Computer', 'Monitor', 'NetworkEquipment',
......
......@@ -187,153 +187,4 @@ class Pdu_Plug extends CommonDBRelation {
}
}
}
/*function showForm($ID, $options = []) {
global $DB, $CFG_GLPI;
$colspan = 4;
echo "<div class='center'>";
$this->initForm($ID, $this->fields);
$this->showFormHeader();
$rack = new Rack();
$rack->getFromDB($this->fields['racks_id']);
$rand = mt_rand();
echo "<tr class='tab_bg_1'>";
echo "<td><label for='dropdown_itemtype$rand'>".__('Item type')."</label></td>";
echo "<td>";
Dropdown::showFromArray(
'itemtype',
array_combine($CFG_GLPI['rackable_types'], $CFG_GLPI['rackable_types']), [
'display_emptychoice' => true,
'value' => $this->fields["itemtype"],
'rand' => $rand
]
);
//get all used items
$used = [];
$iterator = $DB->request([
'FROM' => $this->getTable()
]);
while ($row = $iterator->next()) {
$used [$row['itemtype']][] = $row['items_id'];
}
//items part of an enclosure should not be listed
$iterator = $DB->request([
'FROM' => Item_Enclosure::getTable()
]);
while ($row = $iterator->next()) {
$used[$row['itemtype']][] = $row['items_id'];
}
Ajax::updateItemOnSelectEvent(
"dropdown_itemtype$rand",
"items_id",
$CFG_GLPI["root_doc"]."/ajax/dropdownAllItems.php", [
'idtable' => '__VALUE__',
'name' => 'items_id',
'value' => $this->fields['items_id'],
'rand' => $rand,
'used' => $used
]
);
//TODO: update possible positions according to selected item number of units
//TODO: update positions on rack selection
//TODO: update hpos from item model info is_half_rack
//TODO: update orientation according to item model depth
echo "</td>";
echo "<td><label for='dropdown_items_id$rand'>".__('Item')."</label></td>";
echo "<td id='items_id'>";
if (isset($this->fields['itemtype']) && !empty($this->fields['itemtype'])) {
$itemtype = $this->fields['itemtype'];
$itemtype = new $itemtype();
$itemtype::dropdown([
'name' => "items_id",
'value' => $this->fields['items_id'],
'rand' => $rand
]);
} else {
Dropdown::showFromArray(
'items_id',
[], [
'display_emptychoice' => true,
'rand' => $rand
]
);
}
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td><label for='dropdown_racks_id$rand'>".__('Rack')."</label></td>";
echo "<td>";
Rack::dropdown(['value' => $this->fields["racks_id"], 'rand' => $rand]);
echo "</td>";
echo "<td><label for='dropdown_position$rand'>".__('Position')."</label></td>";
echo "<td >";
Dropdown::showNumber(
'position', [
'value' => $this->fields["position"],
'min' => 1,
'max' => $rack->fields['number_units'],
'step' => 1,
'used' => $rack->getFilled($this->fields['itemtype'], $this->fields['items_id']),
'rand' => $rand
]
);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td><label for='dropdown_orientation$rand'>".__('Orientation (front rack point of view)')."</label></td>";
echo "<td >";
Dropdown::showFromArray(
'orientation', [
Rack::FRONT => __('Front'),
Rack::REAR => __('Rear')
], [
'value' => $this->fields["orientation"],
'rand' => $rand
]
);
echo "</td>";
echo "<td><label for='bgcolor$rand'>".__('Background color')."</label></td>";
echo "<td>";
Html::showColorField(
'bgcolor', [
'value' => $this->fields['bgcolor'],
'rand' => $rand
]
);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td><label for='dropdown_hpos$rand'>".__('Horizontal position (from rack point of view)')."</label></td>";
echo "<td>";
Dropdown::showFromArray(
'hpos',
[
Rack::POS_NONE => __('None'),
Rack::POS_LEFT => __('Left'),
Rack::POS_RIGHT => __('Right')
], [
'value' => $this->fields['hpos'],
'rand' =>$rand
]
);
echo "</td>";
echo "</tr>";
$this->showFormButtons($options);
}*/
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment