rushfee/WebContent/www/huaweiScripts/common/agentdialog.html

651 lines
20 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo</title>
<style>
html {
overflow:auto;
}
body {
margin: 0px;
padding: 0px;
font-size: 12px;
font-family: "Arial","Tahoma";
color: #333333;
background-color:#F3F5F8
}
td, th, p, div, a, form, pre ,h1 ,h2 ,h3, h4{
margin: 0px;
padding: 0px;
font-size: 12px;
font-family: "Arial","Tahoma";
color: #333333;
}
input, select, textarea {
margin: 0px;
padding: 0px;
font-size: 12px;
font-family: "Arial","Tahoma";
color: #333333;
}
</style>
<script language="javascript" src="../language/common.agentdialog.lang.string.js" charset="utf-8"></script>
<script language="javascript" src="../i18n.js" charset="utf-8"></script>
<script language="javascript" src="../config/agentconfig.js" charset="utf-8"></script>
<script language="javascript" type="text/javascript">
var AgentOcx;
var OprType;
var LanguagePage = new LanguagePageClass();
var I18N = new I18NClass();
var languageObj = null;
function GetLanguagePageString(LanguagePageItem){
if (languageObj === null || languageObj === undefined){
return LanguagePageItem;
}
if (languageObj[LanguagePageItem] === null || languageObj[LanguagePageItem] === undefined){
return LanguagePageItem;
}
return languageObj[LanguagePageItem];
}
function init()
{
document.getElementById("tbCallOut").style.display="none";
document.getElementById("tbDTMF").style.display="none";
document.getElementById("tbCallData").style.display="none";
document.getElementById("tbInnerCall").style.display="none";
document.getElementById("tbTransfer").style.display = "none";
document.getElementById("tbBusyWithReason").style.display = "none";
document.getElementById("tbMultiConf").style.display = "none";
document.getElementById("tbModifyPWD").style.display = "none";
document.title="Agent Client Demo";
AgentOcx = window.dialogArguments.win.AgentOcx._ocx;
OprType = window.dialogArguments.str;
//internationalize
LanguagePage = new LanguagePageClass();
I18N = new I18NClass();
languageObj = LanguagePage.GetLanguagePage(Config.Common['Language'])
I18N.SwitchI18N(languageObj);
if (OprType === "CallOut")
{
document.getElementById("tbCallOut").style.display="";
document.title="Call Out";
}
else if (OprType === "InnerCall")
{
document.getElementById("tbInnerCall").style.display="";
document.title = "Inner Call";
loadInnerCall();
}
else if (OprType === "DTMF")
{
document.getElementById("tbDTMF").style.display="";
document.title = "DTMF";
}
else if (OprType === "CallData")
{
document.getElementById("tbCallData").style.display="";
document.title = "Call Data";
loadCallData();
}
else if (OprType === "Transfer")
{
document.getElementById("tbTransfer").style.display="";
document.title="Transfer";
loadTransfer();
}
else if (OprType === "InnerHelp")
{
document.getElementById("tbInnerHelp").style.display="";
document.title="Inner Help";
loadInnerHelp();
}
else if (OprType === "BusyWithReason")
{
document.getElementById("tbBusyWithReason").style.display = "";
document.title = "SayBusyWithReason";
loadBusyWithReason();
}
else if (OprType === "MultiConf")
{
document.getElementById("tbMultiConf").style.display="";
document.title="Multimedia Conference";
}
else if (OprType === "ModifyPWD")
{
document.getElementById("tbModifyPWD").style.display="";
document.title="ModifyPWD";
}
}
function response(OprType)
{
var _return;
if (OprType === "CallOut")
{
var Caller = document.getElementById("CallerNo").value;
var Called = document.getElementById("CalledNo").value;
var obj = new Object();
obj.Caller = Caller;
obj.Called = Called;
_return = obj;
}
else if (OprType === "InnerCall")
{
_return = document.getElementById("AgentID").value;
}
else if (OprType === "DTMF")
{
_return = document.getElementById("DTMF").value;
}
else if (OprType === "CallData")
{
_return = document.getElementById("txtCallData").value;
}
else if (OprType === "Transfer")
{
var DeviceType = document.getElementById("DeviceType").value;
var DeviceNo = document.getElementById("DeviceNo").value;
var ExtPhone = document.getElementById("ExtPhone").value;
var TransType = document.getElementById("TransType").value;
if (DeviceType === "5")
{
DeviceNo = ExtPhone;
}
var obj = new Object();
obj.DeviceType = DeviceType;
obj.DeviceNo = DeviceNo;
obj.ExtPhone = ExtPhone;
obj.TransType = TransType;
_return = obj;
}
else if (OprType === "InnerHelp")
{
var HelpDevice = document.getElementById("HelpDevice").value;
var HelpWorkNo = document.getElementById("HelpWorkNo").value;
var HelpSkillNo = document.getElementById("HelpSkillNo").value;
var HelpType = document.getElementById("HelpType").value;
var obj = new Object();
obj.HelpDevice = HelpDevice;
obj.HelpWorkNo = HelpWorkNo;
obj.HelpType = HelpType;
obj.HelpSkillNo = HelpSkillNo;
_return = obj;
}
else if (OprType === "BusyWithReason")
{
var RestCause = document.getElementById("RestCause").value;
var obj = new Object();
obj.RestCause = RestCause;
_return = obj;
}
else if (OprType === "MultiConf")
{
var PartNum = document.getElementById("PartNum").value;
var AgentList = document.getElementById("AgentList").value;
var OprType = document.getElementById("OprType").value;
var obj = new Object();
obj.PartNum = PartNum;
obj.AgentList = AgentList;
obj.OprType = OprType;
_return = obj;
}
else if (OprType === "ModifyPWD")
{
var OldPWD = document.getElementById("OldPWD").value;
var NewPWD = document.getElementById("NewPWD").value;
var ConfirmPWD = document.getElementById("ConfirmPWD").value;
var obj = new Object();
obj.OldPWD = OldPWD;
obj.NewPWD = NewPWD;
obj.ConfirmPWD = ConfirmPWD;
_return = obj;
}
parent.window.returnValue = _return;
window.close();
}
function loadInnerCall()
{
// query agent
var _return = AgentOcx.QueryTotalAgentAbstractEx();
if (_return === 0)
{
var _agentNum = AgentOcx.AgentAbstractNum;
for(var i=0; i<_agentNum; i++)
{
_return = AgentOcx.GetAgentAbstractByIdx(i);
if (_return === 0)
{
var status = AgentOcx.AgentAbstract_Status & 31;
if (status === 2)
{
if (AgentOcx.AgentAbstract_ID != AgentOcx.WorkNo)
{
document.getElementById("AgentID").options.add(new Option(AgentOcx.AgentAbstract_ID,AgentOcx.AgentAbstract_ID));
}
}
}
}
}
}
function loadCallData()
{
// query agent
var _CallData = AgentOcx.QueryCallDataEx(5);
document.getElementById("txtCallData").value = _CallData;
}
function loadTransfer()
{
var _DeviceType = document.getElementById("DeviceType").value;
document.getElementById("DeviceNo").options.length = 0;
document.getElementById("TransType").options.length = 0;
if (_DeviceType === "1")
{
document.getElementById("ExtPhone").style.display = "none";
document.getElementById("DeviceNo").style.display = "";
// query skill queue
var _return = AgentOcx.QueryAcdID();
if(_return === 0 )
{
var _acdNum = AgentOcx.AcdNumber;
for(var i=0; i<_acdNum; i++)
{
var _return = AgentOcx.GetAcdIDByIdx(i);
if(_return === 0)
{
_return = AgentOcx.QueryAcdSkillEx(AgentOcx.AcdID);
if(_return === 0)
{
document.getElementById("DeviceNo").options.add(new Option(AgentOcx.AcdSkillDesc,AgentOcx.AcdID));
}
}
}
}
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_BLIND_TRANSFER"),"0"));
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_WARM_TRANSFER"),"2"));
}
else if (_DeviceType === "2")
{
document.getElementById("ExtPhone").style.display = "none";
document.getElementById("DeviceNo").style.display = "";
// query agent
var _return = AgentOcx.QueryTotalAgentAbstractEx();
if (_return === 0)
{
var _agentNum = AgentOcx.AgentAbstractNum;
for(var i=0; i<_agentNum; i++)
{
_return = AgentOcx.GetAgentAbstractByIdx(i);
if (_return === 0)
{
var status = AgentOcx.AgentAbstract_Status & 31;
if (status === 2)
{
if (AgentOcx.AgentAbstract_ID != AgentOcx.WorkNo)
{
document.getElementById("DeviceNo").options.add(new Option(AgentOcx.AgentAbstract_ID,AgentOcx.AgentAbstract_ID));
}
}
}
}
}
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_BLIND_TRANSFER"),"0"));
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_WARM_TRANSFER"),"2"));
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_SPECIFIED_TRANSFER"),"3"));
}
else if (_DeviceType === "3")
{
document.getElementById("ExtPhone").style.display = "none";
document.getElementById("DeviceNo").style.display = "";
var _return = AgentOcx.QueryIvrID();
if (_return === 0)
{
var _ivrNum = AgentOcx.IVRNumber;
// IVR id starts with 1
for(var i=1; i<_ivrNum; i++)
{
_return = AgentOcx.GetIvrIDByIdx(i);
if (_return === 0)
{
_return = AgentOcx.QueryIvrDescriptionByID(AgentOcx.IvrID)
if (_return === 0)
{
document.getElementById("DeviceNo").options.add(new Option(AgentOcx.IvrInfo_Description,AgentOcx.IvrInfo_InNo));
}
}
}
}
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_BLIND_TRANSFER"),"0"));
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_BLOCKED_TRANSFER"),"1"));
}
else if (_DeviceType === "5")
{
document.getElementById("ExtPhone").style.display = "";
document.getElementById("DeviceNo").style.display = "none";
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_BLIND_TRANSFER"),"1"));
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_WARM_TRANSFER"),"2"));
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_BRIDGED_TRANSFER"),"3"));
document.getElementById("TransType").options.add(new Option(GetLanguagePageString("I18N_AGENTDIALOG_THREE_PARTY_TRANSFER"),"4"));
}
}
function loadInnerHelp()
{
var _HelpDevice = document.getElementById("HelpDevice").value;
if (_HelpDevice === "1")
{
document.getElementById("HelpSkillNo").options.length = 0;
//document.getElementById("HelpNo").empty();
// query skill queue
var _return = AgentOcx.QueryAcdID();
if(_return === 0 )
{
var _acdNum = AgentOcx.AcdNumber;
for(var i=0; i<_acdNum; i++)
{
var _return = AgentOcx.GetAcdIDByIdx(i);
if(_return === 0)
{
_return = AgentOcx.QueryAcdSkillEx(AgentOcx.AcdID);
if(_return === 0)
{
document.getElementById("HelpSkillNo").options.add(new Option(AgentOcx.AcdSkillDesc,AgentOcx.AcdID));
}
}
}
}
}
else if (_HelpDevice === "2")
{
document.getElementById("HelpWorkNo").options.length = 0;
// query agent
var _return = AgentOcx.QueryTotalAgentAbstractEx();
if (_return === 0)
{
var _agentNum = AgentOcx.AgentAbstractNum;
for(var i=0; i<_agentNum; i++)
{
_return = AgentOcx.GetAgentAbstractByIdx(i);
if (_return === 0)
{
var status = AgentOcx.AgentAbstract_Status & 31;
if (status === 2)
{
if (AgentOcx.AgentAbstract_ID != AgentOcx.WorkNo)
{
document.getElementById("HelpWorkNo").options.add(new Option(AgentOcx.AgentAbstract_ID,AgentOcx.AgentAbstract_ID));
}
}
}
}
}
}
}
function loadBusyWithReason()
{
var _return;
var _ReasonNum;
_return = AgentOcx.QueryVDNRestReasonEx(_ReasonNum);
if(_return === 0 )
{
var _ReasonNum = AgentOcx.VDNRestReasonNum;
for(var i=0; i<_ReasonNum; i++)
{
var _return = AgentOcx.GetVDNRestReasonByIdx(i);
//the SayBusyWithReason interface uses 200-250 rest reason cause , see reference book
if ((_return === 0) && (AgentOcx.VDNRestReasonCode >= 200) && (AgentOcx.VDNRestReasonCode <= 250))
{
document.getElementById("RestCause").options.add(new Option(AgentOcx.VDNRestReasonDesc,AgentOcx.VDNRestReasonCode));
}
}
}
}
</script>
</head>
<body onLoad="init();">
<table width="320" height="240" id="tbModifyPWD" style="display:none">
<tr>
<td align="center">
<table width="200">
<tr>
<td height="30" self="I18N_AGENTDIALOG_OLDPWD">OldPWD: </td>
<td height="30" align="right"><input name="OldPWD" type="password" id="OldPWD" value="" style="width:200;" /></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_NEWPWD">NewPWD: </td>
<td height="30" align="right"><input name="NewPWD" type="password" id="NewPWD" value="" style="width:200;" /></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_CONFIRMPWD">ConfirmPWD: </td>
<td height="30" align="right"><input name="ConfirmPWD" type="password" id="ConfirmPWD" value="" style="width:200;" /></td>
</tr>
<tr>
<td height="30" align="right"><input name="btnModifyPwd" type="button" style="width:60;height:25;" onClick="return response('ModifyPWD')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbCallOut" style="display:none">
<tr>
<td align="center">
<table width="200">
<tr>
<td height="30" self="I18N_AGENTDIALOG_CALLED_NUMBER">CalledNumber: </td>
<td height="30" align="right"><input name="CalledNo" type="text" id="CalledNo" value="" style="width:200;" /></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_CALLER_NUMBER">CallerNumber: </td>
<td height="30" align="right"><input name="CallerNo" type="text" id="CallerNo" value="" style="width:200;" /></td>
</tr>
<tr>
<td height="30" align="right"><input name="btnCallOut" type="button" style="width:60;height:25;" onClick="return response('CallOut')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbInnerCall" style="display:none">
<tr>
<td align="center">
<table width="200">
<tr>
<td height="30" self="I18N_AGENTDIALOG_WORK_NO">WorkNo:</td>
</tr>
<tr>
<td height="30" align="right"><select name="AgentID" style="width:200" ID="AgentID"/></td>
</tr>
<tr>
<td height="30" align="right"><input name="btnInnerCall" type="button" style="width:60;height:25;" onClick="return response('InnerCall')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbDTMF" style="display:none">
<tr>
<td align="center">
<table width="200">
<tr>
<td height="30" self="I18N_AGENTDIALOG_ENTER_DTMF">Enter DTMF:</td>
</tr>
<tr>
<td height="30" align="right"><input name="DTMF" type="text" id="DTMF" value="" style="width:200;" /></td>
</tr>
<tr>
<td height="30" align="right"><input name="btnDTMF" type="button" style="width:60;height:25;" onClick="return response('DTMF')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbCallData" style="display:none">
<tr>
<td align="center">
<table width="200">
<tr>
<td height="30" self="I18N_AGENTDIALOG_SET_CALL_DATA">Set Call Data:</td>
</tr>
<tr>
<td height="30" align="right"><input name="txtCallData" type="text" id="txtCallData" value="" style="width:200;" /></td>
</tr>
<tr>
<td height="30" align="right"><input name="btnCallData" type="button" style="width:60;height:25;" onClick="return response('CallData')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbTransfer" style="display:none">
<tr>
<td align="center">
<table cellpadding="5">
<tr>
<td height="30" width="100" self="I18N_AGENTDIALOG_TRANSFER_TYPE"><p>Transfer Type:</p></td>
<td><select name="DeviceType" style="width:150" ID="DeviceType" onChange="loadTransfer()">
<option value="1" self="I18N_AGENTDIALOG_SKILL">Skill</option>
<option value="2" self="I18N_AGENTDIALOG_AGENT">Agent</option>
<option value="3" self="I18N_AGENTDIALOG_IVR">IVR</option>
<option value="5" self="I18N_AGENTDIALOG_EXTERNAL_PHONE">External Phone</option>
</select></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_TRANSFER_TARGET">Transfer Target:</td>
<td height="30"><select name="DeviceNo" style="width:150" ID="DeviceNo"/><input name="ExtPhone" type="text" id="ExtPhone" value="" style="width:150;display:none" /></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_TRANSFER_MODE">Transfer Mode:</td>
<td height="30"><select name="TransType" style="width:150" ID="TransType"/></td>
</tr>
<tr>
<td height="30" colspan="2" align="right"><input name="Input" type="button" style="width:60;height:25;" onClick="return response('Transfer')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbInnerHelp" style="display:none">
<tr>
<td align="center">
<table cellpadding="5">
<tr>
<td height="30" width="100" self="I18N_AGENTDIALOG_HELP_TYPE"><p>Help Type:</p></td>
<td><select name="HelpDevice" style="width:150" ID="HelpDevice" onChange="loadInnerHelp()">
<option value="1" self="I18N_AGENTDIALOG_SKILL">Skill</option>
<option value="2" self="I18N_AGENTDIALOG_AGENT">Agent</option>
</select></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_HELP_MODE">Help Mode:</td>
<td height="30"><select name="HelpType" style="width:150" ID="HelpType">
<option value="1" self="I18N_AGENTDIALOG_TWO_PARTY">Two-Party</option>
<option value="2" self="I18N_AGENTDIALOG_THREE_PARTY">Three-Party</option>
</select></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_HELP_WORKNO">Help WorkNo:</td>
<td height="30"><select name="HelpWorkNo" style="width:150" ID="HelpWorkNo"/></td>
</tr>
<tr>
<td height="30" self="I18N_AGENTDIALOG_HELP_SKILL">Help Skill:</td>
<td height="30"><select name="HelpWorkNo" style="width:150" ID="HelpSkillNo"/></td>
</tr>
<tr>
<td height="30" colspan="2" align="right"><input name="btnInnerHelp" type="button" style="width:60;height:25;" onClick="return response('InnerHelp')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbBusyWithReason" style="display:none">
<tr>
<td align="center">
<table cellpadding="5">
<tr>
<td height="30" self="I18N_AGENTDIALOG_BUSY_CAUSE">Busy Cause:</td>
<td height="30"><select name="RestCause" ID="RestCause" style="width:150;" /></td>
</tr>
<tr>
<td height="30" colspan="2" align="right"><input name="btnRest" type="button" style="width:60;height:25;" onClick="return response('BusyWithReason')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
<table width="320" height="240" id="tbMultiConf" style="display:none">
<tr>
<td align="center">
<table cellpadding="5">
<tr>
<td height="30" self="I18N_AGENTDIALOG_OPERATE_TYPE">Operate Type: </td>
<td><select name="OprType" style="width:150" ID="OprType">
<option value="1" self="I18N_AGENTDIALOG_REQUEST">Request</option>
<option value="2" self="I18N_AGENTDIALOG_INVITE">Invite</option>
</select></td>
</tr>
<tr>
<td height="30" width="100" self="I18N_AGENTDIALOG_AGENT_NUMBER"><p>Agent Number:</p></td>
<td><input type="text" id="PartNum" value="" style="width:150;" /></td>
</tr>
<tr>
<td height="30" width="100" self="I18N_AGENTDIALOG_AGENT_LIST"><p>Agent List:</p></td>
<td><input type="text" id="AgentList" value="" style="width:150;" /></td>
</tr>
<tr>
<td height="30" colspan="2" align="right"><input name="btnRest" type="button" style="width:60;height:25;" onClick="return response('MultiConf')" value="OK"></td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>