if ($dev->ParentDevice > 0) { $devarray = array('Server' => __("Server"), 'Appliance' => __("Appliance"), 'Storage Array' => __("Storage Array"), 'Switch' => __("Switch"), 'Chassis' => __("Chassis"), 'Patch Panel' => __("Patch Panel"), 'Sensor' => __("Sensor")); } else { $devarray = array('Server' => __("Server"), 'Appliance' => __("Appliance"), 'Storage Array' => __("Storage Array"), 'Switch' => __("Switch"), 'Chassis' => __("Chassis"), 'Patch Panel' => __("Patch Panel"), 'Physical Infrastructure' => __("Physical Infrastructure"), 'CDU' => __("CDU"), 'Sensor' => __("Sensor")); } if ($config->ParameterArray["mDate"] == "now") { if ($dev->MfgDate <= "1970-01-01") { $dev->MfgDate = date("Y-m-d"); } } if ($config->ParameterArray["wDate"] == "now") { if ($dev->WarrantyExpire <= "1970-01-01") { $dev->WarrantyExpire = date("Y-m-d"); } } $portList = DevicePorts::getPortList($dev->DeviceID); $mediaTypes = MediaTypes::GetMediaTypeList(); $colorCodes = ColorCoding::GetCodeList(); $templateList = $templ->GetTemplateList(); $escTimeList = $escTime->GetEscalationTimeList(); $escList = $esc->GetEscalationList(); $deptList = $Dept->GetDepartmentList(); $templ->TemplateID = $dev->TemplateID; $templ->GetTemplateByID(); $title = $dev->Label != '' ? "{$dev->Label} :: {$dev->DeviceID}" : __("openDCIM Device Maintenance"); function buildESXtable($DeviceID) { $ESX = new ESX(); $ESX->DeviceID = $DeviceID; $vmList = $ESX->GetDeviceInventory(); print "\n<div class=\"table border\"><div><div>" . __("VM Name") . "</div><div>" . __("Status") . "</div><div>" . __("Owner") . "</div><div>" . __("Last Updated") . "</div></div>\n";
} } elseif (isset($_REQUEST['tagname'])) { $graphname .= "Custom Tag " . $_REQUEST['tagname']; $device = new Device(); foreach ($device->SearchByCustomTag($_REQUEST['tagname']) as $dev) { if (!isset($devList[$dev->DeviceType])) { $devList[$dev->DeviceType] = array(); } $devList[$dev->DeviceType][$dev->DeviceID] = array(); } } # start building the graphfile. $graphstr .= "graph openDCIM {\n\nlabel = \"" . $graphname . "\";\nrankdir = LR;\nfontsize = 30;\nlabelloc = t;\noverlap = scale;\n\n\tedge [ color=\"#0000a0\" ];\n\tnode [ shape=box, headport=n, tailport=n ];\n\n"; foreach ($devList as $deviceType => $dev) { foreach ($dev as $devid => $interesting_ports) { $ports = DevicePorts::getPortList($devid); foreach ($ports as $port) { if ($mediaID == -1 || $port->MediaID == $mediaID) { if (isset($port->ConnectedDeviceID) && $port->ConnectedDeviceID > 0) { # if the connected device isn't in our list of devices, add it so we # at least get nice names for the devices outside the selected scope $tdev = new Device(); $tdev->DeviceID = $port->ConnectedDeviceID; $tdev->GetDevice(); if (!isset($devList[$tdev->DeviceType][$port->ConnectedDeviceID])) { $tPort = new DevicePorts(); $tPort->DeviceID = $port->ConnectedDeviceID; $tPort->PortNumber = $port->ConnectedPort; $tPort->getPort(); $devList[$tdev->DeviceType][$tdev->DeviceID] = array(); $devList[$tdev->DeviceType][$tdev->DeviceID][] = $tPort;