Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\cti\call.jsp
<%@page import="com.edeal.frontline.services.cti.CTIServiceClient"%> <% /****************************************************************************** * Copyright (c) 2000-2004 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. * * CVS Info for $RCSfile$ * * $Revision$ * $Author$ $Date$ ******************************************************************************/ %><%@page session="true" pageEncoding="UTF-8" import="com.edeal.frontline.*,java.util.*,com.edeal.frontline.navigation.*,com.edeal.frontline.helper.ActorBaseHelper"%> <%@page import="com.edeal.frontline.helper.CTIHelper"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%> <%!private String formatPhone(String pFmt, String pPhone) { String strResult = ""; for (int i = 0, j = -1; i < pFmt.length(); i++) { char c = pFmt.charAt(i); if (c == '?') { for (j++; j < pPhone.length() && !(((c = pPhone.charAt(j)) >= '0' && c <= '9') || c == '_'); j++) ; if (j < pPhone.length()) strResult += c; } else { strResult += c; } } return strResult; }%> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); String contextPath = (String) session.getAttribute("contextPath"); FlContext context = null; if (contextPath != null) { context = Frontline.getContext(contextPath); } else { context = Frontline.getContext(request.getContextPath()); } DataDictionary dico = context.getDataDictionary(); boolean isPostgreSQL = context.isDbPostgreSQL(); boolean isOracle = context.isDbOracle(); String pPhone = Utils.getRequestParameter(context, request, "phone"); if (pPhone == null || "null".equalsIgnoreCase(pPhone)) { pPhone = ""; } String pRef = Utils.getRequestParameter(context, request, "ref"); if (pRef == null) { pRef = ""; } boolean isDoCTIWindow = false; boolean isicomAppletCTI = false; boolean isCCACTI = false; try { CTIServiceClient cti = (CTIServiceClient)context.getServiceManager().getServiceClient(session, "CTI"); if (cti != null) { String idService = cti.getProviderId(); isicomAppletCTI = "isicom_applet".equalsIgnoreCase(idService); isCCACTI = "cca".equalsIgnoreCase(idService); isDoCTIWindow = !cti.useHideFrame(); } } catch (Exception e) { } String actID = (String)session.getAttribute("actorID"); boolean actHasCTILic; try { actHasCTILic = ((Boolean)session.getAttribute("actorHasCTI")).booleanValue(); } catch (Exception e) { // Lic V3 version. actHasCTILic = context.getLicenceManager().actorHasSoftware(actID, CTIServiceClient.CTI_LIC_CODE, LicenceManager.LicenceType.PermanentLicence, null); session.setAttribute("actorHasCTI", new Boolean(actHasCTILic)); } boolean isMasked = pPhone == null || "".equals(pPhone.trim()); boolean isIdentified = false; boolean isUnknown = false; // boolean isUnknown = true; //String strActID = (String)session.getAttribute("actorID"); FlRequest flRequest = new FlRequest(request); Vector vectObjs = (Vector) request.getAttribute("vectObjs"); if (vectObjs == null){ vectObjs = new Vector(); } Boolean isU, isM, isI; isU = (Boolean) request.getAttribute("isUnknown"); isM = (Boolean) request.getAttribute("isMasked"); isI = (Boolean) request.getAttribute("isIdentified"); if (isU!=null) isUnknown = (isU).booleanValue(); if (isM!=null) isMasked = (isM).booleanValue(); if (isI!=null) isIdentified = (isI).booleanValue(); String pCut = flRequest.getRequestParameterOrAttribute("cut"); // DGE : ISI-COM applet telephony mode. // YGU: Do not show Isi-COM buttons if not necessary. boolean hasTelephonyAccess = false; String telephonyMode = "Auto"; if (isicomAppletCTI) { telephonyMode = context.getContextParameter("CTI.Option.ISICOM_TelephonyMode"); if (telephonyMode == null) telephonyMode = "Auto"; } hasTelephonyAccess = (telephonyMode.equalsIgnoreCase("Auto")); %><html> <head> <title><fl:getMessage code="L2025" alt="E-DEAL" /> CRM - <%= Utils.formatToWeb(pPhone, false) %></title> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/common_css.jsp"> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/master_css.jsp"> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/master_js.jsp"></script> <script language="javascript" src="<fl:webapp/>/js/format_tel.jsp"></script> <script language="javascript" src="<fl:webapp/>/js/utils.js"></script> <script language="javascript"> var pRef = '<%= pRef %>'; function doSelect(pObj, pID, pPhone) { pPhone = doEpurePhone2(pPhone); var url = '<fl:webapp/>/cti_popup.fl?type='+flEscape(pObj) + '&id=' + flEscape(pID) + '&phone=' + flEscape(pPhone) + '&ref=<%= WebUtils.urlEncode(context, pRef) %>'; doAjax(url); <% if (actHasCTILic) { %> <% if (isDoCTIWindow) { %> var ctiWin = window.open('', 'CTI'); ctiWin.doAnswer(pRef); <% } else { %> doAnswer(pRef); <% } %> <% } %> } // CCA: Not used function openAnnuaire() { window.open('<fl:webapp/>/cti/annuaire.jsp', 'Annuaire', 'menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=' + (screen.width * 3/4) + ',height=' + (screen.height * 3 / 4) + ',left=0,top=0'); } // CCA: Invoked when the user clicks "Décrocher" function doAnswerCall(pRef){ alert("Entering in call.jsp#doAnswerCall(pRef=" + pRef + ")..."); var doHold = document.getElementById('doHoldLink'); alert("call.jsp#doAnswerCall(pRef=" + pRef + ") : var doHold = " + doHold); doHold.disabled = false; var doAnswer = document.getElementById('doAnswerLink'); alert("call.jsp#doAnswerCall(pRef=" + pRef + ") : var doAnswer = " + doAnswer); doAnswer.href = 'javascript:doRelease(' + pRef + ')'; doAnswer.innerHTML = '<fl:getMessage code="LFFFF" alt="Raccrocher" js="true"/>'; alert("call.jsp#doAnswerCall(pRef=" + pRef + ") : will do window.opener.doAnswer(pRef=" + pRef + ")"); window.opener.doAnswer(pRef); } function refreshSolicitant(cut){ if (cut == '2'){ _grid__Solicitant2_js_.callAjaxForHtml(_grid__Solicitant2_js_.getAjaxUrl(),{ "phone":'<%=pPhone%>',"ref":'<%= pRef %>' },false); } else{ _grid__Solicitant3_js_.callAjaxForHtml(_grid__Solicitant3_js_.getAjaxUrl(),{ "phone":'<%=pPhone%>',"ref":'<%= pRef %>'},false); } } // Release for call for Isicom-applet CTI. function doReleaseCall() { <% if (isDoCTIWindow && actHasCTILic) { %> var ctiWin = window.open('', 'CTI'); //alert('pRef : '+pRef+'!'); ctiWin.doRelease(); <% } else { %> doRelease(); <% } %> } // CCA: nvoked when the user hangs up on the call function doRelease(pRef){ window.opener.doRelease(pRef); //window.close(); } // Taken from cca_ratp //Invoked when user wants to start a 2nd call function doTransfert() { alert("Entering in call.jsp#doTransfert()..."); var doHold = document.getElementById('doHoldLink'); alert("call.jsp#doTransfert() : var doHold=" + doHold); doHold.disabled = false; var varLink = document.getElementById('doTransferLink'); alert("call.jsp#doTransfert() : var varLink=" + varLink); varLink.href = 'javascript:doFinalTransfer()'; alert("call.jsp#doTransfert() : will do window.open('<fl:webapp/>/cti/select.jsp?phone=<%= WebUtils.urlEncode(context, pPhone) %>&ref=<%= WebUtils.urlEncode(context, pRef) %>', 'Transfert', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=400,height=600'"); window.open('<fl:webapp/>/cti/select.jsp?phone=<%= WebUtils.urlEncode(context, pPhone) %>&ref=<%= WebUtils.urlEncode(context, pRef) %>', 'Transfert', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=400,height=600'); } // Taken from cca_ratp //Invoked when user wish to transfer one call to another (both already en ligne) function doFinalTransfer() { window.opener.doTransferCTI(); window.close(); } function doTransferCall() { <%-- Delegates logic to CCA specific code if necessary. --%> <% if (isCCACTI) { %> doTransfert(); <% } else { %> window.open('<fl:webapp/>/select_actor_cti.fl?ref=<%= pRef %>', 'SelectActorCI', 'menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=500,height=600'); <% } %> } function pickupPhone() { <%-- Delegates logic to CCA specific code if necessary. --%> <% if (isCCACTI) { %> doAnswerCall('<%= pRef %>'); <% } else { %> <% if (isDoCTIWindow && actHasCTILic) { %> var ctiWin = window.open('', 'CTI'); //ctiWin.doAnswer(pRef); ctiWin.doAnswer('<%= pRef %>'); <% } else { %> //doAnswer(pRef); doAnswer('<%= pRef %>'); <% } %> <% } %> } // Not used for CCA // Consult / Transfer the call. function doConsultTransfer() { window.open('<fl:webapp/>/select_actor_cti.fl?ref=<%= pRef %>&consult=true', 'SelectActorCI', 'menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=500,height=600'); } //CCA: Puts the current call on hold function doHoldCall() { <% if (isCCACTI) { %> linkVar = document.getElementById('doHoldLink'); linkVar.innerHTML = '<fl:getMessage code="L8180" alt="Reprendre" js="true"/>'; linkVar.href = 'javascript:doRetrieveCall()'; <% } %> window.opener.doHoldCall(); } //CCA: Retrieves a call previously put on hold function doRetrieveCall() { <% if (isCCACTI) { %> var linkVar = document.getElementById('doAlternateLink'); linkVar.disabled = true; linkVar = document.getElementById('doHoldLink'); linkVar.innerHTML = '<fl:getMessage code="LFFFF" alt="Attente" js="true"/>'; linkVar.href = 'javascript:doHoldCall()'; <% } %> window.opener.doRetrieveCall(); } <%-- //CCA: Debug method function showURL() { alert(window.location); } --%> // CCA: Used to display the current call, plus the call on hold var oldPhone = '<%= pPhone %>'; var newPhone = ''; // CCA: Switch between the call "en ligne" and the call on hold function doAlternateCall() { window.opener.doAlternateCall(); var tempPhone = oldPhone; oldPhone = newPhone; newPhone = tempPhone; var tdCallInfo = document.getElementById('tdCallInfo'); tdCallInfo.innerHTML = '<fl:getMessage code="LFFFF" alt="Vous êtes en relation avec:" js="true"/> ' + newPhone + '. <fl:getMessage code="LFFFF" alt="N° en attente:" js="true"/> ' + oldPhone; } // CCA: Called to indicate that we have started the transfer process, // ie, we started a 2nd call function secondCall(pPhone) { var linkVar = document.getElementById('doAlternateLink'); linkVar.disabled = false; linkVar = document.getElementById('doHoldLink'); linkVar.disabled = true; newPhone = pPhone; var tdCallInfo = document.getElementById('tdCallInfo'); tdCallInfo.innerHTML = '<fl:getMessage code="LFFFF" alt="Vous êtes en relation avec:" js="true"/> ' + newPhone + '. <fl:getMessage code="LFFFF" alt="N° en attente:" js="true"/> ' + oldPhone; } // Work only if not used in <body onload="doOnload"; else it is impossible // to switch between smalltabs, and no javascript error neither Java exception // occurs. function doOnLoad() { // Refresh grid soliciteur <%-- alert("refresh grid soliciteur"); var strUrl = _grid__Solicitant_js_.getAjaxUrl(); var params={} ; params["phone"] = '<%= pPhone %>'; params["ref"] = pRef; params["gridName"] = "Solicitant"; params["cut"] = ""; alert("url:"+strUrl); _grid__Solicitant_js_.callAjaxForHtml(strUrl,params,false); --%> _grid__Solicitant2_js_.callAjaxForHtml(_grid__Solicitant2_js_.getAjaxUrl(),{ "phone":'<%=pPhone%>',"ref":'<%= pRef %>' },false); } </script> </head> <!-- <body style="overflow: auto;"> --> <body style="overflow: auto;"> <div id="object_css" style="top: 0px; left: 0px; bottom: 0px; height: 100%;"> <fl:bigTabs objectTitle="<%=Utils.getMessage(session, \"L62BE\", false, true, \"Appel entrant\")%>"> <table class="container" style="width: 100%; margin-top: 10px;"> <tr> <!-- <td class="titrePartie" style="width: 100%" > --> <td id="tdCallInfo" class="titrePartie"> <% if (isUnknown) { %> <fl:getMessage code="L62BE" alt="Appel entrant" /><%= isUnknown ? " inconnu N°" : ""%><%= (pPhone == null || "".equals(pPhone)) ? " masqué" : pPhone %> <% } else { %> <fl:getMessage code="L62BE" alt="Appel entrant" /><%=" N° " + ((pPhone == null || "".equals(pPhone)) ? " masqué" : pPhone) %> <% } %> </td> </tr> <tr><td class="ligne_separation_couleur"></td></tr> <tr><td class="ligne_separation"> </td></tr> <tr> <%-- <!-- ISICOM-applet specific logic. --> <!-- Telephony functions. --> <% if (hasTelephonyAccess) {%> <td style="width: 10%"> <span class="button"> <a href="javascript:pickupPhone()"><fl:getMessage code="L6430" alt="Décrocher"/></a> </span> </td> <td style="width: 10%"> <span class="button"> <a href="javascript:doTransferCall()"><fl:getMessage code="L6431" alt="Transférer"/></a> </span> </td> <td style="width: 10%"> <span class="button"> <a href="javascript:doRelease()">Raccrocher</a> </span> </td> <% } %> <!-- End of ISICOM-applet specific logic. --> --%> <td> <span class="button"> <a href="javascript:openAnnuaire();"><fl:getMessage code="L6205" alt="Annuaire" /> </a> </span> </td> </tr> <tr> <td> <img src="icons/nav/spacer.gif" width="12" height="12"> </td> </tr> <tr> <td> <% if (isCCACTI) { %> <a id="doAnswerLink" href="javascript:doAnswerCall(<%= pRef %>)"><fl:getMessage code="L6430" alt="Décrocher"/></a> <% } else { %> <span class="button"> <a href="javascript:pickupPhone()"><fl:getMessage code="L6430" alt="Décrocher" /> </a> </span> <img src="icons/nav/spacer.gif" width="12" height="12"> <% } %> <% if (isCCACTI) { %> <a id="doTransferLink" href="javascript:doTransfert()"><fl:getMessage code="LFFFF" alt="Transférer"/></a> <% } else { %> <span class="button"> <a href="javascript:doTransferCall()"><fl:getMessage code="L6431" alt="Transférer" /> </a> </span> <% } %> <% if ( ("1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_GENESYSLOGGED))) || ("1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_ALGORIALOGGED))) ) { %> <img src="icons/nav/spacer.gif" width="12" height="12"> <span class="button"> <a href="javascript:doRelease()"><fl:getMessage code="L7000" alt="Raccrocher" /> </a> </span> <% } %> <% if (!isIdentified) { %> <img src="icons/nav/spacer.gif" width="12" height="12"> <span class="button"> <a href="<fl:webapp/>/create_enterprise.fl<%= (pPhone!=null && !"".equals(pPhone)) ? "?EntPhone="+WebUtils.urlEncode(context, pPhone) : ""%>" target="_blank"><fl:getMessage code="L60D6" alt="Nouveau" /> </a> </span> <% } %> </td> </tr> <% if ( ("1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_GENESYSLOGGED))) || ("1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_ALGORIALOGGED))) ) { %> <tr> <td> <img src="icons/nav/spacer.gif" width="12" height="12"> </td> </tr> <tr> <td> <span class="button"> <a href="javascript:doConsultTransfer()"><fl:getMessage code="L7001" alt="Initier transfert" /> </a> </span> </td> </tr> <% } %> <% if ( ("1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_GENESYSLOGGED))) || ("1".equals((String)session.getAttribute(CTIHelper.SESSION_ATTRIBUTE_ALGORIALOGGED))) ) { %> <tr> <td> <img src="icons/nav/spacer.gif" width="12" height="12"> </td> </tr> <tr> <td> <span class="button"> <a href="javascript:doHoldCall()"><fl:getMessage code="L7002" alt="Mettre en attente" /> </a> </span> <img src="icons/nav/spacer.gif" width="12" height="12"> <span class="button"> <a href="javascript:doRetrieveCall()"><fl:getMessage code="L7003" alt="Reprendre appel" /> </a> </span> <img src="icons/nav/spacer.gif" width="12" height="12"> </td> </tr> <% } else if (isCCACTI) { %> <tr> <td> <img src="icons/nav/spacer.gif" width="12" height="12"> </td> </tr> <tr> <td> <a disabled id="doHoldLink" href="javascript:doHoldCall()"><fl:getMessage code="LFFFF" alt="Attente"/></a> <img src="icons/nav/spacer.gif" width="12" height="12"> <span class="button"> <a href="javascript:doRetrieveCall()"><fl:getMessage code="L7003" alt="Reprendre appel" /> </a> </span> <img src="icons/nav/spacer.gif" width="12" height="12"> <a disabled id="doAlternateLink" href="javascript:doAlternateCall()"><fl:getMessage code="LFFFF" alt="Alterner"/></a> </td> <% } %> <tr class="ligne_separation"> <td> </td> </tr> </table> <!-- show caller information; using grids --> <% if (!isMasked){ if (isUnknown){ %> <fl:smallTabs name="NumApproch"> <fl:sTab id="Sol2" onselect="refreshSolicitant(2)" title="<%=Utils.getMessage(session, \"L642E\", false, true, \"Numéros approchant à 2 chiffres\")%>"> <div> <fl:grid name="Solicitant2" height="200" ajaxUrl="/list_solicitant.fl?cut=2"/> </div> </fl:sTab> <fl:sTab id="Sol3" onselect="refreshSolicitant(3)" title="<%=Utils.getMessage(session, \"L642F\", false, true, \"Numéros approchant à 3 chiffres\")%>"> <div> <fl:grid name="Solicitant3" height="200" ajaxUrl="/list_solicitant.fl?cut=3"/> </div> </fl:sTab> </fl:smallTabs> <% } else { %> <fl:smallTabs name="Num"> <fl:sTab hideLink="true" id="nume" title="<%= Utils.getMessage(session, \"M1009\", false, true, \"Solliciteur\") %>"> <div> <fl:grid name="Solicitant2" height="200" ajaxUrl="/list_solicitant.fl"/> </div> </fl:sTab> </fl:smallTabs> <% } } %> <table class="container" width="100%" style="margin-top: 5px;"> <tr> <td colspan="2" style="text-align: center;"> <a href="javascript:window.close()"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif"> </a> </td> </tr> </table> </fl:bigTabs> </div> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de