<?php require_once "db.inc.php"; require_once "facilities.inc.php"; $subheader = __("Data Center Escalation Rules"); if (!$person->ContactAdmin) { // No soup for you. header('Location: ' . redirect()); exit; } $esc = new Escalations(); $status = ""; if (isset($_REQUEST['escalationid'])) { $esc->EscalationID = $_REQUEST['escalationid']; if (isset($_POST['action'])) { if ($_POST['details'] != null && $_POST['details'] != '') { switch ($_POST['action']) { case 'Create': $esc->Details = $_POST['details']; $esc->CreateEscalation(); break; case 'Update': $esc->Details = $_POST['details']; $status = __("Updated"); $esc->UpdateEscalation(); break; case 'Delete': $esc->DeleteEscalation(); header('Location: ' . redirect("escalations.php")); exit; }
$cab->CabinetID = $pdu->CabinetID; $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'])) {
case "SNMPCommunity": if (isset($pdu->SNMPCommunity)) { $tooltip .= __($row["Label"]) . ": " . $pdu->{$row}["Field"] . "<br>\n"; } else { if ($dev->ESX) { $tooltip .= __($row["Label"]) . ": " . $dev->{$row}["Field"] . "<br>\n"; } } 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";
function UpdateEscalation() { $this->MakeSafe(); $oldesc = new Escalations(); $oldesc->EscalationID = $this->EscalationID; $oldesc->GetEscalation(); $sql = "UPDATE fac_Escalations SET Details=\"{$this->Details}\" WHERE \n\t\t\tEscalationID={$this->EscalationID};"; $this->MakeDisplay(); class_exists('LogActions') ? LogActions::LogThis($this, $oldesc) : ''; return $this->query($sql); }