684 lines
16 KiB
HTML
684 lines
16 KiB
HTML
<html>
|
|
<head>
|
|
<!--
|
|
Copyright (c) 2000 Microsoft Corporation
|
|
-->
|
|
<TITLE>Remote Assistance</TITLE>
|
|
<meta http-equiv="MSThemeCompatible" content="Yes">
|
|
<LINK REL="STYLESHEET" HREF="Css/rcBuddy.css" TYPE="text/css">
|
|
</head>
|
|
|
|
<body id="idBody" OnLoad="DoLoad()">
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
|
|
<tr valign="top">
|
|
<td>
|
|
<font class="cssHeader">
|
|
Remote Assistance - View Invitation Status
|
|
</font>
|
|
<P>
|
|
</td>
|
|
</TR>
|
|
<TR>
|
|
<TD>
|
|
<font class="cssTitle">
|
|
Expire, resend, or delete your invitations
|
|
</font>
|
|
<BR>
|
|
<font class="cssBody">
|
|
To expire, resend, or delete an invitation, first select the invitation, then click the action of your choice.
|
|
</FONT>
|
|
<p>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>
|
|
<Table class="cssGrid" id="tblIncs" style="width:100%;" cellspacing="0" cellpadding="0" >
|
|
<tr height="30px">
|
|
<td style="border-Right:solid 1px;border-Bottom:solid 1px;" width=5%> </td>
|
|
<td style="border-Right:solid 1px;border-Bottom:solid 1px;" width=40%> <Font class="cssTitle">Recipient's E-mail</Font></td>
|
|
<td style="border-Right:solid 1px;border-Bottom:solid 1px;" width=40% > <Font class="cssTitle">Expiration Time</Font></td>
|
|
<td style="border-Bottom:solid 1px;" width=15%> <Font class="cssTitle">Status</Font></td>
|
|
</tr>
|
|
<tr height="30px">
|
|
<td colspan=4 style="background-color:gainsboro">
|
|
<Table border=0 style="width:100%;BORDER-TOP: gray 1pt solid;">
|
|
<TR>
|
|
<TD style="width:50%;">
|
|
|
|
</TD>
|
|
<TD>
|
|
<Input type="button" class="styButton" id="btnExpire" name="btnExpire" value="Expire" OnClick='DoExpire();'>
|
|
</TD>
|
|
<TD>
|
|
<Input type="button" class="styButton" id="btnResend" name="btnResend" value="Resend" OnClick="DoReSend()">
|
|
</TD>
|
|
<TD>
|
|
<Input type="button" class="styButton" id="btnDelete" name="btnDelete" value="Delete" disabled OnClick='DoDelete();'>
|
|
</TD>
|
|
</TR>
|
|
</Table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<P> </P>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>
|
|
<Font class="cssbody">
|
|
<A href="" Onclick="parent.LaunchHelp(1);return false;">Learn about connection issues...</A>
|
|
</Font>
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</body>
|
|
<Script Language=JavaScript>
|
|
var sIP = "";
|
|
|
|
/*
|
|
Function :DoLoad()
|
|
Description: This function gets called on the window onload event
|
|
This reads the incident database and visually presents,
|
|
the Recipient's Email, Expiration Time and status for each incident
|
|
*/
|
|
function DoLoad()
|
|
{
|
|
var L_ERRACCESSDENIED_MSG = "Directly launching this page is not allowed. ";
|
|
|
|
if( null == parent.TraceFunctEnter )
|
|
{
|
|
idBody.style.visibility = "hidden";
|
|
alert( L_ERRACCESSDENIED_MSG );
|
|
return;
|
|
}
|
|
|
|
parent.TraceFunctEnter("DoLoad");
|
|
|
|
/* Get IP address for later usage */
|
|
try
|
|
{
|
|
var oSetting = new ActiveXObject("RcBdyCtl.Setting");
|
|
sIP = oSetting.GetIPAddress;
|
|
}
|
|
catch (error)
|
|
{
|
|
// Couldn't get IPAddress
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
try
|
|
{
|
|
var chan = parent.pchealth.CreateObject_Channel(parent.sVendorID,parent.sProductID );
|
|
|
|
for(var e = new Enumerator(chan.Incidents(2)); !e.atEnd(); e.moveNext())
|
|
{
|
|
var inc = e.item();
|
|
var XMLFile = inc.XMLDataFile;
|
|
if (XMLFile == "")
|
|
{
|
|
alert(parent.L_File_NotFound);
|
|
return;
|
|
}
|
|
var oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.LoadFromXMLFile(XMLFile);
|
|
if (oInc.Misc("Method")!="IM")
|
|
{
|
|
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)
|
|
{
|
|
if (sIP.length >0 && IPChanged(oInc.Misc("IP")))
|
|
{
|
|
sStatus = "<Font color='#00009D'>"+ parent.L_IPCHANGED_STATUS +"</Font>";
|
|
}
|
|
else
|
|
{
|
|
sStatus ="<Font color='#228B22'>"+ parent.L_ACTIVE_STATUS +"</Font>";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
sStatus = "<Font color='#000000'>"+parent.L_EXPIRED_STATUS+"</Font>";
|
|
}
|
|
}
|
|
else if (oInc.Misc("Status")=="Expired")
|
|
{
|
|
sStatus="<Font color='#000000'>"+parent.L_EXPIRED_STATUS+"</Font>";
|
|
}
|
|
|
|
AddRecord(inc.DisplayString, iStart, sStatus, inc);
|
|
}
|
|
}
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError(parent.L_LOAD_MSG ,error);
|
|
}
|
|
|
|
// if No Records are present
|
|
if (tblIncs.rows.length == 2)
|
|
{
|
|
AddRecord("(No record)", null, null, null);
|
|
btnDelete.disabled=true;
|
|
btnResend.disabled=true;
|
|
btnExpire.disabled=true;
|
|
}
|
|
|
|
//to give the look for the table
|
|
Tablelook();
|
|
}
|
|
|
|
/*
|
|
Function : IPChanged()
|
|
Description : It checked if any of the new IPs is still inside the old IPs.
|
|
*/
|
|
function IPChanged(oldIPs)
|
|
{
|
|
var ips = sIP.split(";");
|
|
for (i=0; i< ips.length; i++)
|
|
{
|
|
if(oldIPs.indexOf(ips[i]) != -1)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/*
|
|
Function : AddRecord()
|
|
Description : This dynamically creates rows to display the information about each incident object
|
|
*/
|
|
function AddRecord(sEmail, iExpired, sStatus, incItem)
|
|
{
|
|
parent.TraceFunctEnter("AddRecord");
|
|
|
|
btnDelete.disabled=false;
|
|
btnResend.disabled=false;
|
|
btnExpire.disabled=false;
|
|
|
|
var oRow = tblIncs.insertRow(tblIncs.rows.length-1);
|
|
oRow.style.font="8pt Tahoma,Trebuchet MS, Verdana, Arial;";
|
|
oRow.style.height="30px";
|
|
|
|
if (iExpired != null)
|
|
{
|
|
oRow.insertCell(0);
|
|
oRow.cells(0).innerHTML="<Input type='checkbox' name='Status'>";
|
|
oRow.cells(0).style.borderRight="solid 1px";
|
|
oRow.insertCell(1);
|
|
oRow.cells(1).innerText = " "+sEmail;
|
|
oRow.cells(1).style.borderRight="solid 1px";
|
|
|
|
oRow.insertCell(2);
|
|
try
|
|
{
|
|
var oDate = new Date(iExpired*1000);
|
|
oRow.cells(2).innerText = " "+oDate.toLocaleString();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
oRow.cells(2).style.borderRight="solid 1px";
|
|
oRow.insertCell(3);
|
|
oRow.cells(3).innerHTML = " "+sStatus;
|
|
|
|
oRow.setAttribute("item", incItem);
|
|
}
|
|
else
|
|
{
|
|
oRow.insertCell(0);
|
|
oRow.cells(0).innerHTML="";
|
|
oRow.insertCell(1);
|
|
oRow.cells(1).innerText = " "+sEmail;
|
|
oRow.cells(1).colspan=3;
|
|
}
|
|
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
/*
|
|
Function : DoDelete()
|
|
Description : This function gets called on the click event of the Delete button.
|
|
This removes the invitation from the list
|
|
*/
|
|
function DoDelete()
|
|
{
|
|
parent.TraceFunctEnter("DoDelete");
|
|
|
|
try
|
|
{
|
|
var col=new Enumerator(document.all.tags("Input"));
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
try
|
|
{
|
|
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
|
var oRow;
|
|
var oItem;
|
|
var XMLFile;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
//check if any selection has been made or not
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
x=col.item();
|
|
if(x.type=="checkbox" && x.checked)
|
|
{
|
|
var flag=1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (flag==1)
|
|
{
|
|
//pop-up a confirmation dialog window
|
|
ret=window.showModalDialog("confirm.htm","","DialogWidth:350px;DialogHeight:175px;Status:no;scroll:no");
|
|
if (ret==1)
|
|
{
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
x=col.item();
|
|
if (x.type=="checkbox"&& x.checked)
|
|
{
|
|
oRow=x.parentElement.parentElement;
|
|
|
|
oItem = oRow.getAttribute("item");
|
|
XMLFile = oItem.XMLDataFile;
|
|
var oInc = null;
|
|
|
|
try
|
|
{
|
|
oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.LoadFromXMLFile(XMLFile);
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
//check if the status is already expired.
|
|
if (oInc.Misc("Status")!=parent.L_EXPIRED_STATUS)
|
|
{
|
|
oInc.Misc("Status") = parent.L_EXPIRED_STATUS;
|
|
oInc.GetXML(XMLFile);
|
|
try
|
|
{
|
|
// Close Session
|
|
var oSession = parent.pchealth.CreateObject_RemoteDesktopSession(parent.VIEWDESKTOP_PERMISSION_NOT_REQUIRE, 0, oInc.RcTicket, "");
|
|
oSession.CloseRemoteDesktopSession();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
}
|
|
|
|
oItem.DeleteIncidentItem();
|
|
// Update table
|
|
tblIncs.deleteRow(oRow.rowIndex);
|
|
|
|
try
|
|
{
|
|
// delete file
|
|
fso.DeleteFile( XMLFile );
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
alert(parent.L_VIEWSTATUS_SELECTION);
|
|
return false;
|
|
}
|
|
|
|
if (tblIncs.rows.length == 2) // No record
|
|
{
|
|
AddRecord("(No record)", null, null, null);
|
|
btnDelete.disabled=true;
|
|
btnResend.disabled=true;
|
|
btnExpire.disabled=true;
|
|
}
|
|
Tablelook();
|
|
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
/*
|
|
Function : DoExpire()
|
|
Description : This function gets called on the click event of the Delete button.
|
|
This prevents recipient from using the invitation to log on to your computer
|
|
*/
|
|
function DoExpire()
|
|
{
|
|
parent.TraceFunctEnter("DoExpire");
|
|
|
|
try
|
|
{
|
|
var col=new Enumerator(document.all.tags("Input"));
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
var oRow;
|
|
var oItem;
|
|
var XMLFile;
|
|
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
x=col.item();
|
|
if (x.type=="checkbox"&& x.checked)
|
|
{
|
|
oRow=x.parentElement.parentElement;
|
|
x.checked=false;
|
|
oItem = oRow.getAttribute("item");
|
|
XMLFile = oItem.XMLDataFile;
|
|
|
|
try
|
|
{
|
|
var oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.LoadFromXMLFile(XMLFile);
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
//check if the status is already expired.
|
|
if (oInc.Misc("Status")!=parent.L_EXPIRED_STATUS)
|
|
{
|
|
oInc.Misc("Status") = parent.L_EXPIRED_STATUS;
|
|
oInc.GetXML(XMLFile);
|
|
try
|
|
{
|
|
// Close Session
|
|
var oSession = parent.pchealth.CreateObject_RemoteDesktopSession(parent.VIEWDESKTOP_PERMISSION_NOT_REQUIRE, 0, oInc.RcTicket, "");
|
|
oSession.CloseRemoteDesktopSession();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
// Update table
|
|
oRow.cells(3).innerHTML =" "+"<Font color='#000000'>"+parent.L_EXPIRED_STATUS+"</Font>";
|
|
}
|
|
}
|
|
}
|
|
if (oRow==null)
|
|
{
|
|
alert(parent.L_VIEWSTATUS_SELECTION);
|
|
return false;
|
|
}
|
|
|
|
//var oDict = oInc.Misc;
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
/*
|
|
Function: Tablelook()
|
|
Description : changes the look of the status display table
|
|
*/
|
|
function Tablelook()
|
|
{
|
|
for(i=1;i< tblIncs.rows.length-1;i++)
|
|
{
|
|
if ((tblIncs.rows(i).rowIndex % 2)==0)
|
|
{
|
|
tblIncs.rows(i).bgColor="#efefef";
|
|
}
|
|
else
|
|
{
|
|
tblIncs.rows(i).bgColor="#ffffff";
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
Function : DoReSend()
|
|
Description : This function will take the existing ticket, update IP address
|
|
and re-send to the original email recipients.
|
|
*/
|
|
function DoReSend()
|
|
{
|
|
parent.TraceFunctEnter("DoReSend");
|
|
|
|
var tempflag=0;
|
|
var pos=0;
|
|
var temppos=0;
|
|
|
|
try
|
|
{
|
|
var col=new Enumerator(document.all.tags("Input"));
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
pos=pos+1;
|
|
x=col.item();
|
|
if (x.type=="checkbox"&& x.checked)
|
|
{
|
|
if (tempflag==0)
|
|
{
|
|
tempflag=1;
|
|
temppos=pos;
|
|
}
|
|
else
|
|
{
|
|
alert(parent.L_NOMULTIPLE_TICKETRESENDS);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (tempflag==1)
|
|
{
|
|
col.moveFirst();
|
|
while(tempflag!=temppos)
|
|
{
|
|
tempflag=tempflag+1;
|
|
col.moveNext();
|
|
}
|
|
|
|
x=col.item();
|
|
|
|
var oRow=x.parentElement.parentElement;
|
|
x.checked=false;
|
|
var oItem = oRow.getAttribute("item");
|
|
var XMLFile = oItem.XMLDataFile;
|
|
|
|
try
|
|
{
|
|
var oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.LoadFromXMLFile(XMLFile);
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
if (oInc.Misc("Method") == "File")
|
|
{
|
|
alert(parent.L_NOFILE_TICKETRESENDS);
|
|
return;
|
|
}
|
|
|
|
// Close existing Session if required...
|
|
try
|
|
{
|
|
if (oInc.Misc("Status")!=parent.L_EXPIRED_STATUS)
|
|
{
|
|
oInc.Misc("Status") = parent.L_EXPIRED_STATUS;
|
|
var oSession = parent.pchealth.CreateObject_RemoteDesktopSession(
|
|
parent.VIEWDESKTOP_PERMISSION_NOT_REQUIRE, 0, oInc.RcTicket, "");
|
|
oSession.CloseRemoteDesktopSession();
|
|
oSession = null;
|
|
}
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
// Get a new Salem Ticket
|
|
try
|
|
{
|
|
var iExpiry = oInc.Misc("DtLength");
|
|
oSession = parent.pchealth.CreateObject_RemoteDesktopSession(
|
|
parent.VIEWDESKTOP_PERMISSION_NOT_REQUIRE, iExpiry*60 , "", "");
|
|
oInc.RcTicket = oSession.ConnectParms;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
var sEmails = oItem.DisplayString;
|
|
|
|
if (sIP.length > 0)
|
|
{
|
|
oInc.Misc("IP") = sIP;
|
|
}
|
|
else
|
|
{
|
|
alert(parent.L_RCCTL_MSG);
|
|
return;
|
|
}
|
|
|
|
// Update Date.
|
|
try
|
|
{
|
|
var d = new Date();
|
|
var iNow = Math.round(Date.parse(d)/1000);
|
|
oInc.Misc("DtStart") = iNow;
|
|
oInc.Misc("Status") = "Active";
|
|
d = new Date((iNow + iExpiry * 60) * 1000);
|
|
sExpiry = d.toLocaleString();
|
|
iStart = parseInt(iNow) + parseInt(iExpiry) * 60;
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
// Send ticket
|
|
try
|
|
{
|
|
var oChannel = parent.pchealth.CreateObject_Channel(parent.sVendorID, parent.sProductID);
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
var IncidentFile = oChannel.VendorDirectory + "\\rcBuddy.MsRcIncident";
|
|
|
|
// Save incident OFF to an XML file
|
|
try
|
|
{
|
|
oInc.GetXML(IncidentFile);
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
// Email the incident to the Expert
|
|
{
|
|
var lRet = parent.oSmapi.Logon();
|
|
if (lRet == 1)
|
|
{
|
|
parent.oSmapi.ClearRecipList();
|
|
parent.oSmapi.AddRecipient(sEmails);
|
|
parent.oSmapi.Subject = parent.L_SUBJECT_MSG + oInc.UserName;
|
|
parent.oSmapi.Body = parent.L_LINE1_MSG + parent.L_SENDER_MSG + oInc.UserName + ":\n\n" +
|
|
parent.L_EXPIRY_MSG + sExpiry + "\n\n" +
|
|
parent.L_DESCIPTION_MSG + oInc.ProblemDescription + "\n\n" +
|
|
parent.L_NOTE_MSG ;
|
|
|
|
parent.oSmapi.AttachedXMLFile = IncidentFile;
|
|
lRet = parent.oSmapi.SendMail();
|
|
if (lRet == 1)
|
|
{
|
|
UpdateTable( oRow, iStart );
|
|
// save modified incident
|
|
try
|
|
{
|
|
oInc.GetXML(XMLFile);
|
|
// save updated salem Ticket
|
|
oItem.URL = oInc.RcTicket;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
alert(parent.L_SENDFAIL_MSG);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
alert(parent.L_MAPIFAIL_MSG);
|
|
}
|
|
}
|
|
alert(parent.L_RESEND_CONFIRM);
|
|
}
|
|
|
|
else
|
|
{
|
|
alert(parent.L_VIEWSTATUS_SELECTION);
|
|
return false;
|
|
}
|
|
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
/*
|
|
Function: UpdateTable
|
|
Description : Updates the status table
|
|
*/
|
|
|
|
function UpdateTable( oRow, iStart )
|
|
{
|
|
parent.TraceFunctEnter("UpdateTable");
|
|
|
|
var sStatus ="<Font color='#228B22'>"+ parent.L_ACTIVE_STATUS +"</Font>";
|
|
try
|
|
{
|
|
var oDate = new Date(iStart*1000);
|
|
oRow.cells(2).innerText = " "+oDate.toLocaleString();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
oRow.cells(3).innerHTML = " "+sStatus;
|
|
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
</Script>
|
|
</html>
|