Example #1
0
         }
     }
     break;
 case "ESX":
     if ($dev->ESX) {
         $tooltip .= __($row["Label"]) . ": " . $dev->{$row}["Field"] . "<br>\n";
     }
     break;
 case "EscalationID":
     $esc = new Escalations();
     $esc->EscalationID = $dev->{$row}["Field"];
     $esc->GetEscalation();
     $tooltip .= __($row["Label"]) . ": {$esc->Details}<br>\n";
     break;
 case "EscalationTimeID":
     $escTime = new EscalationTimes();
     $escTime->EscalationTimeID = $dev->{$row}["Field"];
     $escTime->GetEscalationTime();
     $tooltip .= __($row["Label"]) . ": {$escTime->TimePeriod}<br>\n";
     break;
 case "Owner":
     $dept = new Department();
     $dept->DeptID = $dev->Owner;
     $dept->GetDeptByID();
     $tooltip .= __($row["Label"]) . ": {$dept->Name}<br>\n";
     break;
 case "TemplateID":
     $tmpl = new DeviceTemplate();
     $tmpl->TemplateID = $dev->TemplateID;
     $tmpl->GetTemplateByID();
     $man = new Manufacturer();
Example #2
0
 function UpdatePeriod()
 {
     $this->MakeSafe();
     $oldperiod = new EscalationTimes();
     $oldperiod->EscalationTimeID = $this->EscalationTimeID;
     $oldperiod->GetEscalationTime();
     $sql = "UPDATE fac_EscalationTimes SET TimePeriod=\"{$this->TimePeriod}\" WHERE \n\t\t\tEscalationTimeID={$this->EscalationTimeID};";
     class_exists('LogActions') ? LogActions::LogThis($this, $oldperiod) : '';
     return $this->query($sql);
 }
Example #3
0
        $cab->GetCabinet();
        if ($person->canWrite($cab->AssignedTo)) {
            $wattage = $pdu->LogManualWattage($_POST["currwatts"]);
            $wattage->LastRead = strftime("%c", strtotime($wattage->LastRead));
        }
    }
    header('Content-Type: application/json');
    echo json_encode($wattage);
    exit;
}
// END AJAX
// These objects are used no matter what operation we're performing
$templ = new DeviceTemplate();
$mfg = new Manufacturer();
$esc = new Escalations();
$escTime = new EscalationTimes();
$contactList = $person->GetUserList();
$Dept = new Department();
$pwrConnection = new PowerPorts();
$pdu = new PowerDistribution();
$panel = new PowerPanel();
$pwrCords = null;
$chassis = "";
$copy = false;
$copyerr = __("This device is a copy of an existing device.  Remember to set the new location before saving.");
$childList = array();
// This page was called from somewhere so let's do stuff.
// If this page wasn't called then present a blank record for device creation.
if (isset($_REQUEST['action']) || isset($_REQUEST['DeviceID'])) {
    if (isset($_REQUEST['CabinetID'])) {
        $dev->Cabinet = $_REQUEST['CabinetID'];
Example #4
0
<?php

require_once 'db.inc.php';
require_once 'facilities.inc.php';
$subheader = __("Data Center Time Periods Listing");
if (!$person->ContactAdmin) {
    // No soup for you.
    header('Location: ' . redirect());
    exit;
}
$period = new EscalationTimes();
$status = '';
if (isset($_REQUEST['escalationtimeid'])) {
    $period->EscalationTimeID = $_REQUEST['escalationtimeid'];
    if (isset($_POST['action'])) {
        if ($_POST['timeperiod'] != null && $_POST['timeperiod'] != '') {
            switch ($_POST['action']) {
                case 'Create':
                    $period->TimePeriod = $_POST['timeperiod'];
                    $period->CreatePeriod();
                    break;
                case 'Update':
                    $period->TimePeriod = $_POST['timeperiod'];
                    $status = __("Updated");
                    $period->UpdatePeriod();
                    break;
                case 'Delete':
                    $period->DeletePeriod();
                    header('Location: ' . redirect("timeperiods.php"));
                    exit;
            }