Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\js\cti\cti_isicom_applet_js.jsp
<% /****************************************************************************** * Copyright (c) 2000-2008 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. ******************************************************************************/ %><%@page session="true" import="com.edeal.frontline.*,java.util.*"%><%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%> // The following code has been used with permission of ISICom from pcb.js var gRefCom1 = 0; var gRefCom2 = 0; var gNbCom = 1; var gTypePauseEnCours = 0; var bCommAutomate = false; var bPreview = false; var CTIObject = null; var isipbx = true; var optTrace = false; var optTraceAll = false; // DGE : id de la fiche recu. var datatransfered = ''; var currentCallID = ''; // Booléens de synchronisation. var transferafterdelivered = false; // need to deliver the call before raising the form. var clearcallafterestablished = false; // need to establish the communication then we can clear the line of the transfer. var dataAlreadyTransfered = false; // for group transfer, need to attached data before transfer the call. var objID; var objType; var transfRef = ''; var callerPhone = ''; function activateDebug() { document.getElementById('isicomDebugHref').href = 'javascript:deactivateDebug()'; document.getElementById('isicomDebugHref').innerHTML = '<fl:getMessage code="M6110" alt="Désactiver le mode debug" js="true"/>'; document.getElementById('ISICOM_DEBUG').style.display = 'block'; optTrace = true; optTraceAll = true; } function deactivateDebug() { document.getElementById('isicomDebugHref').href = 'javascript:activateDebug()'; document.getElementById('isicomDebugHref').innerHTML = '<fl:getMessage code="M610F" alt="Activer le mode debug" js="true"/>'; document.getElementById('ISICOM_DEBUG').style.display = 'none'; optTrace = false; optTraceAll = false; } function doCtiOnLoad() { // Called from body.onLoad() try { window.onbeforeunload = doUnload; } catch (error) { } doOnLoadCTI(true); } function doOnLoadCTI(doBlur) { //createCookie('EdealCtiWindow','1'); window.resizeTo(475,275); onLoadBody(); } //function doCallCTI(arg0, arg1, arg2){ function doCallCTI(pPhone, pObj, pID){ //if (arg0 == '') { if (pPhone == '') { return; } try { //CTIObject.AppelUnClient(arg0); CTIObject.AppelUnClient(pPhone); } catch (error) { alert(error); } } //var currentCallID = ''; function doAnswerCTI(pRef){ //alert('doAnswerCTI pRef : '+pRef); transferafterdelivered = false; objID = ''; objType = ''; try { CTIObject.FctCSTA_ANSWER_CALL(pRef); } catch (error) { alert(error); } } // Raccrocher. function doReleaseCTI(pRef){ CTIObject.FctCSTA_CLEAR_CALL(gRefCom1); } // Transfert direct sans transfert de fiche. function doDirectTransferCTI(pRef, pPhone){ //alert('pRef : '+pRef); //alert('gRefCom1 : '+gRefCom1); try { CTIObject.FctCSTA_ANSWER_CALL(gRefCom1); } catch (error) { alert(error); } CTIObject.AppelUnClient(pPhone); clearcallafterestablished = true; CTIObject.FctCSTA_TRANSFERT_CALL(pRef); CTIObject.FctCSTA_CLEAR_CALL(gRefCom1); } // Transfert 2 temps sans transfert de fiche. function doTransferCTI(pRef, pPhone){ //alert('pRef : '+pRef); //alert('gRefCom1 : '+gRefCom1); try { //CTIObject.FctCSTA_ANSWER_CALL(pRef); CTIObject.FctCSTA_ANSWER_CALL(gRefCom1); } catch (error) { alert(error); } CTIObject.AppelUnClient(pPhone); clearcallafterestablished = true; CTIObject.FctCSTA_TRANSFERT_CALL(pRef); // La synchro doit être fait après l'évènement ESTABLISHED. //CTIObject.FctCSTA_CLEAR_CALL(gRefCom1); } // Transfert 2 temps avec transfert de fiche. function doTransferFormCTI(pRef, pPhone, pobjID, pType, pIsGroup, pCallerPhone){ // DGE. //alert('isicom applet js doTransferFormCTI : '+pCallerPhone+'|'); transferafterdelivered = true; objID = pobjID; objType = pType; transfRef = gRefCom1; callerPhone = pCallerPhone; try { CTIObject.FctCSTA_ANSWER_CALL(gRefCom1); } catch (error) { alert(error); } if (pIsGroup == 'true') { CTIObject.FctCSTA_PRIVATE_TRANSFERT_DATA(objID+";"+objType+";"+callerPhone); dataAlreadyTransfered = true; } CTIObject.AppelUnClient(pPhone); // dépend de cstadelivered //CTIObject.FctCSTA_TRANSFERT_CALL(gRefCom1); //CTIObject.FctCSTA_CLEAR_CALL(gRefCom1); } // ***************************** // Transfert accompagné : fonctions non testées // ***************************** function doInitiateTransfer(pRef, pActID, pPhone) { // consult call. CTIObject.FctCSTA_CONSULT_CALL(pPhone); } function doFormTransfer(pRef, actID, pPhone, pobjID, pType) { CTIObject.FctCSTA_PRIVATE_TRANSFERT_DATA(pobjID+";"+pType); //CTIObject.FctCSTA_REDIRECT_CALL(pRef, pPhone); CTIObject.FctCSTA_TRANSFERT_CALL(pRef); CTIObject.FctCSTA_CLEAR_CALL(pRef); } function retrieveTransfer(pRef, pActID, pPhone) { } // ***************************** function doChangeStatusCTI(newState) { if (newState) { fnSetEtatCTI('', '<fl:getMessage code="L65D0" alt="Connecté" js="true"/>'); CTIObject.FctAgentEtatACD(4); } else { fnSetEtatCTI('', '<fl:getMessage code="L65D9" alt="Pause perso." js="true"/>'); CTIObject.FctAgentEtatACD(3); } } // The following code added from function onLoadMe(){ fnSetEtatCTI("FFFF00", "<fl:getMessage code="L65CF" alt="Connexion au PABX" js="true"/>"); //fnDebug("onLoadMe", "startMode(1) automatique"); } function QuitMe(){ fnSetEtatCTI("FF0000", "Quit"); bConnexPCB = false; fnDebug("QuitMe", "Mode Applet, on quitte"); } function EvtLinkUp(){ { try { fnDebug('EvtLinkUp', 'Evenement appelé par l\'applet lorsque celle ci est connecté au PCB'); onLoadMe(); bConnexPCB = true; } catch (e){ fnDebug('EvtLinkUp :: ERREUR', e); } } } function EvtLinkDown(){ fnDebug('EvtLinkDown', 'Evenement appelé par l\'applet lorsque celle ci est déconnecté du PCB'); etatConnexion('1'); bConnexPCB = false; } function IdentificationAgent(nomAgent, numAgent, post) { fnSetEtatCTI("00FF00", "<fl:getMessage code="L65D0" alt="Connecté" js="true"/>"); pcbIdentificationAgent(nomAgent, numAgent, post); } function CSTA_ALERTING(refCom, Correspondant, appele){ pcbCSTA_ALERTING(refCom, Correspondant, appele); } function CSTA_ESTABLISHED(refCom, Correspondant, appele){ pcbCSTA_ESTABLISHED(refCom,Correspondant,appele); } function CSTA_CONNECTION_CLEAR(refCom){ pcbCSTA_CONNECTION_CLEAR(refCom); } function CSTA_CLEAR_MCDU(refCom){ pcbCSTA_CLEAR_MCDU(refCom) } function CSTA_SERVICE_INITIATED(refCom){ pcbCSTA_SERVICE_INITIATED(refCom); } function CSTA_TRANSFERED(arg0, arg1, arg2){ pcbCSTA_TRANSFERED(arg0, arg1, arg2); } function CSTA_HOLD_ME(arg0, arg1){ pcbCSTA_HOLD_ME(arg0, arg1); } function EvtAgentACD(arg0){ pcbEvtAgentACD(arg0); } function EvtDataFromAutomateCRM(idTicket, idContac, ResteTrame){ pcbEvtDataFromAutomateCRM(idTicket, idContac, ResteTrame); } function EvtDataPreviewFromAutomateCRM(idTicket, idContac, ResteTrame){ pcbEvtDataPreviewFromAutomateCRM(idTicket, idContac, ResteTrame); } function EvtScriptACD(arg0, arg1, arg2, arg3){ pcbEvtScriptACD(arg0, arg1, arg2, arg3); } function Unknown_Msg(){ pcbUnknown_Msg(); } function AppelIdClientEntrant(arg0, arg1){ pcbAppelIdClientEntrant(arg0, arg1); } function AppelTelephonique(arg0, arg1){ // DGE mode auto if (telephonyMode == 'Auto') { var winIncoming = window.open('<fl:webapp/>/receive_call.fl?phone=' + arg0 + '&ref=' + escape(currentCallID), 'Dring', 'menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=600'); } pcbAppelTelephonique(arg0, arg1); } function AutomateAppel(arg0, arg1, arg2, arg3){ pcbAutomateAppel(arg0, arg1, arg2, arg3); } function CommunicationIdClientEntrant(arg0, arg1){ pcbCommunicationIdClientEntrant(arg0, arg1); } function CommunicationTelephonique(arg0, arg1){ pcbCommunicationTelephonique(arg0, arg1); } function CstaClearCall(arg0, arg1){ pcbCSTA_CLEAR_CALL(arg0, arg1); } function CSTA_CONFERENCE(arg0, arg1, arg2){ pcbCSTA_CONFERENCE(arg0, arg1, arg2); } function CSTA_DELIVERED(arg0, arg1){ pcbCSTA_DELIVERED(arg0, arg1); } function CSTA_DIVERTED(arg0, arg1){ pcbCSTA_DIVERTED(arg0, arg1); } function CSTA_FAILED(arg0){ pcbCSTA_FAILED(arg0); } function CSTA_HOLD_OTHER(arg0, arg1){ pcbCSTA_HOLD_OTHER(arg0, arg1); } function CSTA_NETWORK_REACHED(arg0, arg1){ pcbCSTA_NETWORK_REACHED(arg0, arg1); } function CSTA_ORIGINATED(arg0, arg1){ pcbCSTA_ORIGINATED(arg0, arg1); } function CSTA_QUEUE(arg0, arg1){ pcbCSTA_QUEUE(arg0, arg1); } function CSTA_RETRIEVED(arg0, arg1){ pcbCSTA_RETRIEVED(arg0, arg1); } function CSTA_SERVICE_INITIATED(arg0){ pcbCSTA_SERVICE_INITIATED(arg0); } function errorRcpt(){ pcberrorRcpt(); } function EtatConnectionPCB(arg0){ pcbEtatConnectionPCB(arg0); } function EvtResultPreviewFromAutomateCRM(arg0, arg1, arg2){ pcbEvtResultPreviewFromAutomateCRM(arg0, arg1, arg2); } function EvtSupervisionAgent(arg0, arg1, arg2){ pcbEvtSupervisionAgent(arg0, arg1, arg2); } function FinCommunicationTelephonique(arg0, arg1){ pcbFinCommunicationTelephonique(arg0, arg1); } function JournalAppelant(arg0, arg1){ pcbJournalAppelant(arg0, arg1); } function RequestIdentification(arg0, arg1, arg2){ currentCallID = arg0; pcbRequestIdentification(arg0, arg1, arg2); } function ResultatAppel(arg0, arg1){ pcbResultatAppel(arg0, arg1); } function TransferData(arg0, arg1){ pcbTransferData(arg0, arg1); } function ViewDataCTI(arg0, arg1, arg2){ pcbViewDataCTI(arg0, arg1, arg2); } ////////////////////////////////////////////////// // **************** /////////////////////////////////////////////////// function onLoadBody(){ fnTraceDiv(); var strBInfo = "b style='width:100%;background-color:#000000;color:#FFFFFF'"; /* fnDebug("ISI-Com", "- Visualisation des états du Téléopérateur (libre, occupé, Pauses...)", strBInfo); fnDebug("ISI-Com", "- Transfert un appel", strBInfo); fnDebug("ISI-Com", "- Raccrocher un appel", strBInfo); fnDebug("ISI-Com", "- Répondre à un appel", strBInfo); fnDebug("ISI-Com", "- Effectuer un appel", strBInfo); fnDebug("ISI-Com", "Exemple d'utilisation de l'OCX/Applet de la solution CTI.", strBInfo); */ if (!CTIObject) { CTIObject = document.getElementById("oCTIObject"); //fnDebug("onLoadBody", "Chargement CTIObject"); fnDebug("onLoadBody", "Chargement CTIObject"); } if(CTIObject != null && CTIObject != undefined){ //fnDebug("onLoadBody", "Chargement OCX/Applet OK"); fnDebug("onLoadBody", "Chargement OCX/Applet OK"); onLoadMe(); } else if(CTIObject == null || CTIObject == undefined) fnDebug("onLoadBody", "Impossibilité de se connecter au PCB", "Impossibilité de se connecter au PCB, veuillez vérifier si l'Applet Java est correctement installée. (F5)", ""); } /** * Methodes Envoyées vers l'Applet */ function FinCom(){ CTIObject.FinCom(gRefCom1); } function fnDemandeEtat(arg){ fnDebug('fnDemandeEtat', 'Function JS qui fait une demande a l\'applet de changement d\'état :: ' + arg); var state = parseFloat(arg); if(state != 0 && gTypePauseEnCours == 0){ CTIObject.FctAgentEtatACD(arg); gTypePauseEnCours = parseFloat(state); } else if(state == 0){ eval("CTIObject.FctAgentEtatACD('" + (gTypePauseEnCours + 1 ) + "')"); gTypePauseEnCoursEnCours = 0; } else if(gTypePauseEnCours != 0){ if(gTypePauseEnCours != state){ if(state != 0){ CTIObject.FctAgentEtatACD(arg); gTypePauseEnCours = parseFloat(state); } } } } /** * Evenement Appelées depuis l'Applet */ function pcbIdentificationAgent(nomAgent, numAgent, post){ fnDebug('IdentificationAgent', 'Nom::' + nomAgent + ', Num::' + numAgent + ', Post::' + post); if(numAgent != ''){ fnSetInfoAgent(numAgent + ' - ' + nomAgent); } } function pcbCSTA_ESTABLISHED(refCom, Appelant, Appele) { // Raccroche de suite pour faire le transfert direct. if (clearcallafterestablished == true) { CTIObject.FctCSTA_CLEAR_CALL(refCom); clearcallafterestablished = false; } try{ if(refCom > 0){ gRefCom1 = refCom; fnDebug('CSTA_ESTABLISHED', 'Affection d\'une ref de com1' + gRefCom1); fnDebug('CSTA_ESTABLISHED', 'Appelant:' + Appelant); fnDebug('CSTA_ESTABLISHED', 'Appele:' + Appele); if(Appelant != '') str = 'En communication avec : ' + Appelant; else str = 'Numéro caché'; fnSetEtatAppel(str); fnBtnClearCall(true); fnBtnTrfCall(true); fnBtnHoldCall(true); fnBtnRetrieveCall(false); fnBtnAskCall(false); } else{ fnDebug('CSTA_ESTABLISHED', 'Gestion d\'une ref de com null'); } } catch(e){ fnDebug('CSTA_ESTABLISHED::ERREUR', '' + e); } //doAjax('<fl:webapp/>/doAddCTICallTime_ajax.fl?pRef=' + escape(refCom) + '¬ifType=1&timeMillis=' + (new Date()).getTime()); } function fnBtnClearCall(bBool){ var oObj = document.getElementById("BtnClearCall"); if(bBool) oObj.style.display = ''; else oObj.style.display = 'none'; } function fnBtnTrfCall(bBool){ var oObj = document.getElementById("BtnTrfCall"); if(bBool) oObj.style.display = ''; else oObj.style.display = 'none'; } function fnBtnAskCall(bBool){ var oObj = document.getElementById("BtnAskCall"); if(bBool) oObj.style.display = ''; else oObj.style.display = 'none'; } function fnBtnHoldCall(bBool){ var oObj = document.getElementById("BtnHoldCall"); if(bBool) oObj.style.display = ''; else oObj.style.display = 'none'; } function fnBtnRetrieveCall(bBool){ var oObj = document.getElementById("BtnRetrieveCall"); if(bBool) oObj.style.display = ''; else oObj.style.display = 'none'; } function pcbCSTA_ALERTING(refCom,Appelant,Appele){ gRefCom1 = refCom; fnDebug('CSTA_ALERTING', 'Affection d\'une ref de com1' + gRefCom1); if(Appelant != '') str = 'Appel de : ' + Appelant; else str = 'Numéro caché'; fnSetEtatAppel(str); fnBtnAskCall(true); } function pcbCSTA_CONNECTION_CLEAR(refCom,Appelant){ fnDebug('CSTA_CONNECTION_CLEAR', 'Suppresion de la ref :' + refCom + ',en cours : gRefCom1:' + gRefCom1); //gRefCom1 = 0; if (refCom == gRefCom1) { gRefCom1 = 0; } if (gRefCom2 == refCom) { gRefCom2 = 0; } fnSetEtatAppel(''); fnBtnClearCall(false); fnBtnTrfCall(false); fnBtnRetrieveCall(false); fnBtnHoldCall(false); //doAjax('<fl:webapp/>/doAddCTICallTime_ajax.fl?pRef=' + escape(refCom) + '¬ifType=2&timeMillis=' + (new Date()).getTime()); } function pcbCSTA_CLEAR_MCDU(refCom,Appelant){ fnDebug('CSTA_CLEAR_MCDU', 'Suppresion de la ref :' + refCom + ',en cours : gRefCom1:' + gRefCom1); gRefCom1 = 0; fnSetEtatAppel(''); fnBtnClearCall(false); fnBtnTrfCall(false); fnBtnRetrieveCall(false); fnBtnHoldCall(false); } function pcbCSTA_SERVICE_INITIATED(arg0){ fnDebug('CSTA_SERVICE_INITIATED', 'arg0:' + arg0); } //function pcbCSTA_TRANSFERED(arg0, arg1, arg2){ // fnDebug('CSTA_TRANSFERED', 'arg0:' + arg0 + ', arg1:' + arg1 + ', arg2:' + arg2); //} function pcbCSTA_TRANSFERED(oldRefcom, correspondant, newRefCom){ fnDebug('CSTA_TRANSFERED', 'oldRefcom:' + oldRefcom + ', correspondant:' + correspondant + ', newRefCom:' + newRefCom); gRefCom1 = newRefCom; if (datatransfered != '') { var index = datatransfered.indexOf(";", 0); var type; var callerPhone = ''; // 1ere position. if (index > 0) { // 2nde position. type = datatransfered.substring(index + 1) ; datatransfered = datatransfered.substring(0, index) ; index = type.indexOf(";", 0); if (index > 0) { callerPhone = type.substring(index + 1) ; type = type.substring(0, index) ; } } else { //datatransfered = arg1; type = 'solicitation'; } // Object window. window.open('<fl:webapp/>/read_'+type+'.fl?id='+datatransfered, 'fiche_cti'+newRefCom, 'menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=1000,height=800'); datatransfered = ''; // Incoming call window. var winIncoming = window.open('<fl:webapp/>/receive_call.fl?phone=' + callerPhone, 'Dring', 'menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=600'); //winIncoming.focus(); } } // arg0 = RefCom // arg1 = Correspondent function pcbCSTA_HOLD_ME(arg0, arg1){ fnDebug('CSTA_HOLD_ME', 'arg0:' + arg0 + ', arg1:' + arg1); // On fait suivre la référence de communication. if (gRefCom2 == arg0) { if (gRefCom1 > 0) gRefCom2 = gRefCom1 ; else gRefCom2 = 0; } gRefCom1 = arg0 if(arg1 != '') str = 'En communication avec : ' + arg1 ; else str = 'Numéro caché'; str += ' (Appel en attente)'; fnSetEtatAppel(str); fnBtnHoldCall(false); fnBtnRetrieveCall(true); } function EvtEtatAgent(arg){ try{ fnDebug('EvtEtatAgent', '...'); return EvtAgentACD(arg) }catch(e){ fnDebug('EvtEtatAgent :: ERREUR', e); }; } function EvtCallACD(arg0, arg1, arg2) { pcbEvtCallACD(arg0, arg1, arg2); } function pcbEvtCallACD(arg0, arg1, arg2) { //doAjax('<fl:webapp/>/doAddCTICallTime_ajax.fl?pRef=' + escape(arg0) + '¬ifType=3&timeMillis=' + escape(arg2)); } function pcbEvtAgentACD(arg){ fnDebug('EvtAgentACD', 'Evenement appelé par l\'applet lors d\'un changement d\'état de l\'agent :: ' + arg); bPauseAfterAutomate = true; switch(parseInt(arg)){ case 1: //Libre fnDebug('EvtAgentACD', 'Agent passe en "Libre"'); fnSetInfoAgentEtat("Libre"); break; case 2: //Occupé fnDebug('EvtAgentACD', 'Agent passe en"Occupe"'); fnSetInfoAgentEtat("Occupe"); break; case 3: //Deconnecte fnDebug('EvtAgentACD', 'Agent passe en "Deconnecte"'); fnSetInfoAgentEtat("Deconnecte"); break; case 4://Traitement informatique fnDebug('EvtAgentACD', 'Agent passe en "Traitement informatique"'); fnSetInfoAgentEtat("Traitement informatique"); break; case 5://En appel ACD fnDebug('EvtAgentACD', 'Agent passe en "En appel ACD"'); fnSetInfoAgentEtat("En appel ACD"); break; case 6: //En Communication ACD fnDebug('EvtAgentACD', 'Agent passe en "En Communication ACD"'); fnSetInfoAgentEtat("En Communication ACD"); break; case 7: //Pause Personnelle fnDebug('EvtAgentACD', 'Agent passe en "Pause Personnelle"'); fnSetInfoAgentEtat("Pause Personnelle"); break; case 8://Pause Administrative fnDebug('EvtAgentACD', 'Agent passe en "Pause Administrative"'); fnSetInfoAgentEtat("Pause Administrative"); break; case 9://Reservation automate fnDebug('EvtAgentACD', 'Reservation par l\'automate d\'appels'); fnSetInfoAgentEtat("Reservation par l'automate d'appels"); break; case 10://Communication Automate fnDebug('EvtAgentACD', 'Communication Automate d\'appels'); fnSetInfoAgentEtat("Communication Automate d'appels"); break; case 11://Wrapup Automate fnDebug('EvtAgentACD', 'Wrapup Automate'); fnSetInfoAgentEtat("Wrapup Automate"); break; case 0: //Pause fnDebug('EvtAgentACD', 'Agent passe en "Pause"'); fnSetInfoAgentEtat("Pause"); break; } } function pcbEvtDataFromAutomateCRM(idTicket, idContac, ResteTrame){ fnDebug('EvtDataFromAutomateCRM', 'ID_TICKET:' + idTicket + ', ID_CONTACT:' + idContac + ', ResteTrame:' + ResteTrame); } function pcbEvtDataPreviewFromAutomateCRM(idContac, idTicket, ResteTrame){ fnDebug('EvtDataPreviewFromAutomateCRM', 'ID_TICKET:' + idTicket + ', ID_CONTACT:' + idContac + ', ResteTrame:' + ResteTrame); } function pcbEvtScriptACD(arg0, arg1, arg2){ fnDebug('EvtScriptACD', 'arg0:' + arg0 + ', arg1:' + arg1 + ', arg2:' + arg2); } function pcbUnknown_Msg(){ fnDebug('Unknown_Msg', 'Unknown_Msg'); } function pcbAppelIdClientEntrant(arg0, arg1){ fnDebug('AppelIdClientEntrant', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbAppelTelephonique(arg0, arg1){ fnDebug('AppelTelephonique', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbAutomateAppel(arg0, arg1, arg2, arg3){ fnDebug('AutomateAppel', 'arg0:' + arg0 + ', arg1:' + arg1 + ', arg2:' + arg2 + ', arg3:' + arg3); } function pcbCommunicationIdClientEntrant(arg0, arg1){ fnDebug('CommunicationIdClientEntrant', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbCommunicationTelephonique(arg0, arg1){ fnDebug('CommunicationTelephonique', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbCSTA_CLEAR_CALL(arg0, arg1){ fnDebug('CSTA_CLEAR_CALL', 'arg0:' + arg0 + ', arg1:' + arg1); fnSetEtatAppel(''); //doAjax('<fl:webapp/>/doAddCTICallTime_ajax.fl?pRef=' + escape(arg0) + '¬ifType=2&timeMillis=' + (new Date()).getTime()); } function pcbCSTA_CONFERENCE(arg0, arg1, arg2){ fnDebug('CSTA_CONFERENCE', 'arg0:' + arg0 + ', arg1:' + arg1 + ', arg2:' + arg2); fnSetEtatAppel('En conférence avec : ' + arg1 + ' - ' + arg2); } function pcbCSTA_DELIVERED(arg0, arg1){ fnDebug('CSTA_DELIVERED', 'arg0:' + arg0 + ', arg1:' + arg1); fnSetEtatAppel('Appel : ' + arg1); //alert('DELIVERED [transferafterdelivered : '+transferafterdelivered+' , objID : '+objID+' , transfRef : '+transfRef+']'); // DGE. if (transferafterdelivered == true) { if (objID != null && objID != '') { // L'association des données est déjà faite si on transfert vers un groupe de compétences. if (dataAlreadyTransfered == false) { // Association des données au transfert. CTIObject.FctCSTA_PRIVATE_TRANSFERT_DATA(objID+";"+objType+";"+callerPhone); } else { dataAlreadyTransfered = false; CTIObject.FctCSTA_TRANSFERT_CALL(transfRef); } //CTIObject.FctCSTA_TRANSFERT_CALL(transfRef); //CTIObject.FctCSTA_CLEAR_CALL(transfRef); transferafterdelivered = false; objID = ''; objType = ''; transfRef = ''; } } } function pcbCSTA_DIVERTED(arg0, arg1){ fnDebug('CSTA_DIVERTED', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbCSTA_FAILED(arg0){ fnDebug('CSTA_FAILED', 'arg0:' + arg0); } function pcbCSTA_HOLD_OTHER(arg0, arg1){ fnDebug('CSTA_HOLD_OTHER', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbCSTA_NETWORK_REACHED(arg0, arg1){ fnDebug('CSTA_NETWORK_REACHED', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbCSTA_ORIGINATED(arg0, arg1){ fnDebug('CSTA_ORIGINATED', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbCSTA_QUEUE(arg0, arg1){ fnDebug('CSTA_QUEUE', 'arg0:' + arg0 + ', arg1:' + arg1); } // arg0 : RefCom // arg1 : Correspondent function pcbCSTA_RETRIEVED(arg0, arg1){ //gRefCom1 = arg0; //fnDebug('CSTA_RETRIEVED', 'arg0:' + gRefCom1 + ',arg1:' + arg1); //gRefCom1 = arg0; if (gRefCom2 == 0) { gRefCom2 = gRefCom1; gRefCom1 = 0; } fnDebug('CSTA_RETRIEVED', 'arg0:' + arg0 + ',arg1:' + arg1); if(arg1 != '') str = 'En communication avec : ' + arg1 ; else str = 'Numéro caché'; str += ' (reprise de communication)'; fnSetEtatAppel(str); fnBtnClearCall(true); fnBtnTrfCall(true); fnBtnRetrieveCall(false); fnBtnAskCall(false); fnBtnHoldCall(true); } function pcberrorRcpt(){ fnDebug('errorRcpt', ''); } function pcbEtatConnectionPCB(arg0){ fnDebug('EtatConnectionPCB', 'arg0:' + arg0); } function pcbEvtResultPreviewFromAutomateCRM(arg0, arg1, arg2){ fnDebug('EvtResultPreviewFromAutomateCRM', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbEvtSupervisionAgent(arg0, arg1, arg2){ fnDebug('EvtSupervisionAgent', 'arg0:' + arg0 + ', arg1:' + arg1 + ', arg2:' + arg2); } function pcbFinCommunicationTelephonique(arg0, arg1){ fnSetEtatAppel(''); fnDebug('FinCommunicationTelephonique', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbJournalAppelant(arg0, arg1){ fnDebug('JournalAppelant', 'arg0:' + arg0 + ', arg1:' + arg1); } // arg0 : refAppel // arg1 : appelant // arg2 : appele function pcbRequestIdentification(arg0, arg1, arg2){ fnDebug('RequestIdentification', 'arg0:' + arg0 + ', arg1:' + arg1 + ', arg2:' + arg2); // Pas de traitement si numéro interne ... if ((arg1 == '') || (arg1 != '' && arg1.length >= 5)) { doAjax('<fl:webapp/>/doRequestId_ajax.fl?phone='+arg1+'&ref='+arg0); } } function doSendIdentificationCTI(entCorpName, perName, perFstName, pRef) { CTIObject.SendIdentificationPCB(pRef, perName, perFstName, entCorpName); } function pcbResultatAppel(arg0, arg1){ fnDebug('ResultatAppel', 'arg0:' + arg0 + ', arg1:' + arg1); } function pcbTransferData(arg0, arg1){ fnDebug('TransferData', 'arg0:' + arg0 + ', arg1:' + arg1); // Les données du transfert sont récupérées. // Elles ne sont lues qu'au décroché de l'agent B. datatransfered = arg1; } // arg0 : refcom // arg1 : numberCaller // arg2 : numberCalling function pcbViewDataCTI(arg0, arg1, arg2){ fnDebug('ViewDataCTI', 'arg0:' + arg0 + ', arg1:' + arg1 + ', arg2:' + arg2); // DGE mode auto if (telephonyMode != 'Auto') { // Incoming call window. var winIncoming = window.open('<fl:webapp/>/receive_call.fl?phone=' + arg1, 'Dring', 'menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=600'); } } /*Function libre ........ OCX exemple*/ function makeCall(strValue){ if(strValue != '') CTIObject.AppelUnClient(strValue); fnDebug('makeCall', 'Demande d\'appel : ' + strValue); } function askCall(){ if(gRefCom1 > 0) CTIObject.FctCstaAnswerCall(gRefCom1); } function trfCall(){ if(gRefCom1 > 0 && gRefCom2 > 0){ CTIObject.FctCstaTransfertCall(gRefCom1); clearCall(1); } else{ if(gRefCom2 <= 0) fnDebug('trfCall::ERREUR', 'Demande de transfert de communication impossible car pas 2eme communication.'); } } function clearCall(nCom){ if(gRefCom1 > 0 && (nCom == undefined || nCom == 1)) CTIObject.FctCstaClearCall(gRefCom1); else if(gRefCom2 > 0 && (nCom == undefined || nCom == 2)) CTIObject.FctCstaClearCall(gRefCom2); } function holdCall(nCom){ if(gRefCom1 > 0 && (nCom == undefined || nCom == 1)) CTIObject.FctCstaHoldCall(gRefCom1); else if(gRefCom2 > 0 && (nCom == undefined || nCom == 2)) CTIObject.FctCstaHoldCall(gRefCom2); } function retrieveCall(nCom){ if(gRefCom1 > 0 && (nCom == undefined || nCom == 1)) CTIObject.FctCstaRetrieveCall(gRefCom1); else if(gRefCom2 > 0 && (nCom == undefined || nCom == 2)) CTIObject.FctCstaRetrieveCall(gRefCom2); } /*Function libre ........ Java exemple*/ function j_makeCall(strValue){ if(strValue != '') CTIObject.AppelUnClient(strValue); fnDebug('makeCall', 'Demande d\'appel : ' + strValue); } function j_askCall(){ alert(gRefCom1); if(gRefCom1 > 0) CTIObject.FctCSTA_ANSWER_CALL(gRefCom1); } function j_trfCall(){ if(gRefCom1 > 0 && gRefCom2 > 0){ CTIObject.FctCSTA_TRANSFERT_CALL(gRefCom1); clearCall(1); } else{ if(gRefCom2 <= 0) fnDebug('trfCall::ERREUR', 'Demande de transfert de communication impossible car pas 2eme communication.'); } } function j_clearCall(nCom){ if(gRefCom1 > 0 && (nCom == undefined || nCom == 1)) CTIObject.FctCSTA_CLEAR_CALL(gRefCom1); else if(gRefCom2 > 0 && (nCom == undefined || nCom == 2)) CTIObject.FctCSTA_CLEAR_CALL(gRefCom2); } function j_holdCall(nCom){ if(gRefCom1 > 0 && (nCom == undefined || nCom == 1)) CTIObject.FctCSTA_HOLD_CALL(gRefCom1); else if(gRefCom2 > 0 && (nCom == undefined || nCom == 2)) CTIObject.FctCSTA_HOLD_CALL(gRefCom2); } function j_retrieveCall(nCom){ if(gRefCom1 > 0 && (nCom == undefined || nCom == 1)) CTIObject.FctCSTA_RETRIEVE_CALL(gRefCom1); else if(gRefCom2 > 0 && (nCom == undefined || nCom == 2)) CTIObject.FctCSTA_RETRIEVE_CALL(gRefCom2); } /* TRACE */ function fnTraceDiv(){ try{ var oObjTrace = document.getElementById('divDebug'); if(!oObjTrace){ oObjTrace = document.createElement('DIV'); oObjTrace.setAttribute('id', 'divDebug'); oObjTrace.setAttribute('name', 'divDebug'); oObjTrace.ondblclick = function (){this.innerHTML = '';}; oObjTrace.style.font = '7pt Verdana'; oObjTrace.style.width = '100%'; oObjTrace.style.display = 'none'; document.body.appendChild(oObjTrace); } if(!optTrace){ oObjTrace.style.bottom = '-100px'; oObjTrace.style.display = 'none'; } else{ oObjTrace.style.top = '50px'; oObjTrace.style.width = '100%'; oObjTrace.style.display = ''; oObjTrace.style.border = '1px solid #AAAAAA'; oObjTrace.style.backgroundColor = '#FEFEFE'; fnDebug('fnTraceDiv', 'DEBUG ACTIF'); fnDebug('fnTraceDiv::warning', 'ATTENTION LE MODULE DE TRACE EST ACTIF, CETTE ELEMENT PREND LA MAIN SUR LES ELEMENTS SE TROUVANT AU DESOUS!!!'); } } catch(e){} } function fnDebug(strFunc, strTrace, strBalise, bNrl){ try{ if(!optTrace) return; var oObjTrace = document.getElementById('divDebug'); if(!oObjTrace) return; var dS = ''; var dE = ''; if(strBalise != undefined){ dS = '<' + strBalise + '>'; dE = '</' + strBalise + '>'; } if(bNrl == undefined) bNrl = false; if(bNrl == false) dE += '<BR>'; if(strFunc.toLowerCase().indexOf('error') > 0 || strFunc.toLowerCase().indexOf('erreur') > 0) oObjTrace.innerHTML = '<DIV style=\'color:#FF0000;\'>' + dS + '<b>'+ strFunc + '</b> :: ' + strTrace + dE + '</DIV>' + ((optTraceAll && oObjTrace.scrollHeight < 1024)?oObjTrace.innerHTML:''); else if(strFunc.toLowerCase().indexOf('warning') > 0 || strFunc.toLowerCase().indexOf('warning') > 0) oObjTrace.innerHTML = '<DIV style=\'color:#FF9900;\'>' + dS + '<b>'+ strFunc + '</b> :: ' + strTrace + dE + '</DIV>' + ((optTraceAll && oObjTrace.scrollHeight < 1024)?oObjTrace.innerHTML:''); else oObjTrace.innerHTML = dS + '<b>'+ strFunc + '</b> :: ' + strTrace + dE + ((optTraceAll && oObjTrace.scrollHeight < 512)?oObjTrace.innerHTML:''); } catch(e){} } function fnSetEtatAppel(strLib){ var oLibAppelDe = document.getElementById('bLibAppelDe'); oLibAppelDe.innerHTML = strLib; } function fnSetInfoAgent(strLib){ // var oLibAgent = document.getElementById('bLibAgent'); // oLibAgent.innerHTML = strLib; } function fnSetInfoAgentEtat(strLib){ // var oLibEtatt = document.getElementById('bLibEtat'); // oLibEtatt.innerHTML = strLib; } function fnSetEtatCTI(strColor, strLib){ var oObj = document.getElementById('bConnexCTI'); // oObj.style.backgroundColor = strColor; if(strLib) oObj.innerHTML = strLib; }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de