153 lines
5.4 KiB
HTML
153 lines
5.4 KiB
HTML
<html>
|
|
<head>
|
|
<title>Untitled Document</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<LINK REL="STYLESHEET" HREF="rcBuddy.css" TYPE="text/css">
|
|
</head>
|
|
|
|
<body OnLoad="DoLoad()">
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
|
|
<tr valign="top">
|
|
<td>
|
|
<font class="cssHeader">
|
|
View Invitation Status
|
|
</font>
|
|
<br><hr>
|
|
<p>
|
|
<font class="cssBody">
|
|
Click cancel to revoke an active invitation.
|
|
<P>
|
|
Click remove to delete an expired or
|
|
cancelled invitation from the list.
|
|
</FONT>
|
|
<p>
|
|
<table class="cssGrid" cellspacing="0" cellpadding="0">
|
|
<tr class="cssTblTitle">
|
|
<td nowrap align="center">
|
|
<font class="cssBody" color="white">
|
|
Remote Assistance Invitation Status
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<table id="tblIncs" width="100%" border="0" cellspacing="3" cellpadding="0"
|
|
style="font:xx-small Verdana, Arial, Helvetica, sans-serif">
|
|
<tr bgcolor="Gainsboro" height="20px">
|
|
<td>Helper Email Address</td>
|
|
<td>Expires</td>
|
|
<td>Status</td>
|
|
<td>Action</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</TD></TR>
|
|
</TABLE>
|
|
</body>
|
|
<Script Language=JavaScript>
|
|
var L_EXPIRED_STATUS = "Expired";
|
|
var L_CANCELLED_STATUS = "Cancelled";
|
|
var L_ACTIVE_STATUS = "Active";
|
|
var L_IPCHANGED_STATUS = "IP changed";
|
|
|
|
function DoLoad() {
|
|
var sVendorID = "CN=Microsoft Corporation,L=Redmond,S=Washington,C=US";
|
|
var sProductID = "Microsoft BuddyHelp Channel";
|
|
var L_LOAD_MSG = "DoLoad() failed: ";
|
|
try {
|
|
var chan = parent.pchealth.CreateObject_Channel(sVendorID,sProductID );
|
|
for(var e = new Enumerator(chan.Incidents(2)); !e.atEnd(); e.moveNext())
|
|
{
|
|
var inc = e.item();
|
|
var XMLFile = inc.XMLDataFile;
|
|
if (XMLFile == "") {
|
|
alert("Incident file not found.");
|
|
return;
|
|
}
|
|
var oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.LoadFromXMLFile(XMLFile);
|
|
var iStart = parseInt(oInc.Misc("DtStart")) +
|
|
parseInt(oInc.Misc("DtLength")) * 60;
|
|
if(oInc.Misc("Status") == null ||
|
|
oInc.Misc("Status") == "Active") {
|
|
var iNow = Math.round(Date.parse(new Date()) / 1000);
|
|
if (iNow <= iStart)
|
|
sStatus = L_ACTIVE_STATUS;
|
|
else
|
|
sStatus = L_EXPIRED_STATUS;
|
|
} else if (oInc.Misc("Status") == "Cancelled")
|
|
sStatus = L_CANCELLED_STATUS;
|
|
|
|
AddRecord(inc.DisplayString, iStart, sStatus, inc);
|
|
}
|
|
} catch (e) {
|
|
alert(L_LOAD_MSG + e.description);
|
|
}
|
|
if (tblIncs.rows.length == 1) // No record
|
|
AddRecord("(No record)", null, null, null);
|
|
}
|
|
|
|
var L_CANCEL_MSG = "Cancel";
|
|
var L_REMOVE_MSG = "Remove";
|
|
|
|
function AddRecord(sEmail, iExpired, sStatus, incItem) {
|
|
var sAction = "<font class=cssAction OnClick='DoCancel()'>" +
|
|
L_CANCEL_MSG + "</font>";
|
|
|
|
var oRow = tblIncs.insertRow(tblIncs.rows.length);
|
|
//oRow.bgcolor="white";
|
|
oRow.insertCell(0);
|
|
oRow.cells(0).innerText = sEmail;
|
|
if (iExpired != null) {
|
|
oRow.insertCell(1);
|
|
var oDate = new Date(iExpired*1000);
|
|
oRow.cells(1).innerText = oDate.toLocaleString();
|
|
oRow.insertCell(2);
|
|
oRow.cells(2).innerText = sStatus;
|
|
oRow.insertCell(3);
|
|
oRow.setAttribute("item", incItem);
|
|
if (sStatus == L_EXPIRED_STATUS || sStatus == L_CANCELLED_STATUS)
|
|
sAction = "<font class=cssAction OnClick='DoRemove()'>" +
|
|
L_REMOVE_MSG + "</font>";
|
|
|
|
oRow.cells(3).innerHTML = sAction;
|
|
}
|
|
}
|
|
|
|
function DoCancel() {
|
|
var oRow = window.event.srcElement.parentElement.parentElement;
|
|
var oItem = oRow.getAttribute("item");
|
|
var sAction;
|
|
var XMLFile = oItem.XMLDataFile;
|
|
var oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.LoadFromXMLFile(XMLFile);
|
|
var oDict = oInc.Misc;
|
|
|
|
oInc.Misc("Status") = L_CANCELLED_STATUS;
|
|
oInc.GetXML(XMLFile);
|
|
// Close Session
|
|
var oSession = parent.pchealth.CreateObject_RemoteDesktopSession(parent.VIEWDESKTOP_PERMISSION_NOT_REQUIRE, 0, oItem.URL);
|
|
oSession.CloseRemoteDesktopSession();
|
|
// Update table
|
|
oRow.cells(2).innerText = L_CANCELLED_STATUS;
|
|
sAction = "<font class=cssAction OnClick='DoRemove()'>" +
|
|
L_REMOVE_MSG + "</font>";
|
|
oRow.cells(3).innerHTML = sAction;
|
|
}
|
|
|
|
function DoRemove() {
|
|
var oRow = window.event.srcElement.parentElement.parentElement;
|
|
var oInc = oRow.getAttribute("item");
|
|
var XMLFile = oInc.XMLDataFile;
|
|
oInc.DeleteIncidentItem();
|
|
tblIncs.deleteRow(oRow.rowIndex);
|
|
// delete file
|
|
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
|
fso.DeleteFile( XMLFile );
|
|
}
|
|
|
|
</Script>
|
|
</html>
|