Exemplo n.º 1
0
/**
 * Determines ownership of the cabinet and returns the CSS class in case a
 * color unequal white is assigned to the owner
 *
 * @param 	Cabinet 	$cabinet
 * @param 	array 		&$deptswithcolor
 * @return 	string		CSS class or empty string
 */
function get_cabinet_owner_color($cabinet, &$deptswithcolor)
{
    $cab_color = '';
    if ($cabinet->AssignedTo != 0) {
        $tempDept = new Department();
        $tempDept->DeptID = $cabinet->AssignedTo;
        $deptid = $tempDept->DeptID;
        $tempDept->GetDeptByID();
        if (strtoupper($tempDept->DeptColor) != "#FFFFFF") {
            $deptswithcolor[$cabinet->AssignedTo]["color"] = $tempDept->DeptColor;
            $deptswithcolor[$cabinet->AssignedTo]["name"] = $tempDept->Name;
            $cab_color = "class=\"dept{$deptid}\"";
        }
    }
    return $cab_color;
}
Exemplo n.º 2
0
/**
 * Determines ownership of the cabinet and returns the CSS class in case a
 * color unequal white is assigned to the owner.
 *
 * @param Cabinet $cabinet
 * @param array $deptswithcolor
 * @return (string|array)[] CSS class or empty string
 */
function getColorofCabinetOwner($cabinet, $deptswithcolor)
{
    $cab_color = '';
    if ($cabinet->AssignedTo != 0) {
        $tempDept = new Department();
        $tempDept->DeptID = $cabinet->AssignedTo;
        $deptid = $tempDept->DeptID;
        if ($tempDept->GetDeptByID()) {
            if (strtoupper($tempDept->DeptColor) != '#FFFFFF') {
                $deptswithcolor[$cabinet->AssignedTo]['color'] = $tempDept->DeptColor;
                $deptswithcolor[$cabinet->AssignedTo]['name'] = $tempDept->Name;
                $cab_color = "class=\"dept{$deptid}\"";
            }
        }
    }
    return array($cab_color, $deptswithcolor);
}
Exemplo n.º 3
0
         } else {
             $outageStatus = __("Normal");
         }
     }
 }
 if (!$skipNormal || $skipNormal && ($outageStatus == __("Down") || $outageStatus == __("Undocumented"))) {
     echo "<tr>\n";
     printf("<td>%s</td>\n", $cabRow->Location);
     printf("<td>%s</td>\n", $devRow->Label);
     printf("<td>%s</td>\n", $outageStatus);
     printf("<td>%s</td>\n", $devRow->Position);
     $tmpPerson->PersonID = $devRow->PrimaryContact;
     $tmpPerson->GetPerson();
     printf("<td>%s</td>\n", $tmpPerson->Email);
     $dept->DeptID = $devRow->Owner;
     $dept->GetDeptByID();
     printf("<td>%s</td>\n", $dept->Name);
     echo "</tr>\n";
 }
 if ($devRow->ChassisSlots > 0 || $devRow->RearChassisSlots > 0) {
     $kidList = $devRow->GetDeviceChildren();
     foreach ($kidList as $k) {
         $tmpPerson->PersonID = $devRow->PrimaryContact;
         $tmpPerson->GetPerson();
         echo "<tr>\n";
         printf("<td>%s</td>\n", $cabRow->Location);
         printf("<td>%s</td>\n", $k->Label);
         printf("<td>%s</td>\n", $outageStatus);
         printf("<td>%s</td>\n", __("Child"));
         printf("<td>%s</td>\n", $tmpPerson->Email);
         $dept->DeptID = $k->Owner;
Exemplo n.º 4
0
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";
    foreach ($vmList as $vmRow) {
        $onOff = preg_match('/off/i', $vmRow->vmState) ? 'off' : 'on';
        $Dept = new Department();
        $Dept->DeptID = $vmRow->Owner;
        if ($Dept->DeptID > 0) {
            $Dept->GetDeptByID();
        } else {
            $Dept->Name = __("Unknown");
        }
        print "<div><div>{$vmRow->vmName}</div><div class=\"{$onOff}\">{$vmRow->vmState}</div><div><a href=\"updatevmowner.php?vmindex={$vmRow->VMIndex}\">{$Dept->Name}</a></div><div>{$vmRow->LastUpdated}</div></div>\n";
    }
    echo '</div> <!-- END div.table -->';
}
Exemplo n.º 5
0
 function UpdateDepartment()
 {
     $this->MakeSafe();
     $olddept = new Department();
     $olddept->DeptID = $this->DeptID;
     $olddept->GetDeptByID();
     $sql = "UPDATE fac_Department SET Name=\"{$this->Name}\", \n\t\t\tExecSponsor=\"{$this->ExecSponsor}\", SDM=\"{$this->SDM}\", \n\t\t\tClassification=\"{$this->Classification}\" , DeptColor=\"{$this->DeptColor}\" \n\t\t\tWHERE DeptID=\"{$this->DeptID}\";";
     class_exists('LogActions') ? LogActions::LogThis($this, $olddept) : '';
     $this->query($sql);
     $this->MakeDisplay();
 }
Exemplo n.º 6
0
/**
 * Collect rack information and add it to the cab_data inventory on all data
 *  centers
 *
 * @param array $invCab
 * @param Cabinet $cab
 * @param $cabinetColumns
 * @param DataCenter $dc
 * @param array $dcContainerList
 */
function addRackStat(&$invCab, $cab, $cabinetColumns, $dc, $dcContainerList)
{
    $rack = makeEmptySpec($cabinetColumns, $dcContainerList);
    if ($cab->AssignedTo != 0) {
        $dept = new Department();
        $dept->DeptID = $cab->AssignedTo;
        $dept->GetDeptByID();
        $deptName = $dept->Name;
    } else {
        $deptName = null;
    }
    $rack['CabID'] = $cab->CabinetID;
    $rack['Zone'] = getZoneName($cab);
    $rack['Row'] = getRowName($cab);
    $rack['DC Name'] = $dc->Name;
    $rack['Cabinet'] = $cab->Location;
    $rack['AssignedTo'] = $deptName;
    $rack['Tags'] = getTagsString($cab);
    $rack['Height'] = $cab->CabinetHeight;
    $rack['Model'] = $cab->Model;
    $rack['Keylock'] = $cab->Keylock;
    $rack['MaxKW'] = $cab->MaxKW;
    $rack['MaxWeight'] = $cab->MaxWeight;
    $rack['Install Date'] = $cab->InstallationDate;
    $rack['Auditor'] = getAuditorName($cab);
    $rack['Front Edge'] = $cab->FrontEdge;
    $rack['Timestamp'] = getAuditTimestamp($cab);
    $rack['Notes'] = html_entity_decode(strip_tags($cab->Notes), ENT_COMPAT, 'UTF-8');
    $invCab[$dc->DataCenterID][$cab->Location] = $rack;
}