Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\cti\listAjax.jsp
<%@ page language="java" contentType="text/plain;charset=UTF-8"%> <%@page session="true" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="java.util.Vector" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.Utils" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String typ = (String)flRequest.getAttribute("typ"); String salesModel = context.getContextParameter("SalesModel"); Vector results = (Vector)flRequest.getAttribute("results"); String imageStr = "<img src=\\\"" + context.getContextName() + "/icons/ico_interaction/alerte_courrier.gif\\\">"; if (results == null) { results = new Vector(); } int size = results.size(); %> var toAdd = ""; <% if (size == 0) { %> toAdd = "<div><label>"; toAdd += '<fl:getMessage code="L0001" alt="Aucune entrée disponible" js="true" />'; toAdd += "</label></div>"; <% } else if ("per".equals(typ)) { %> toAdd = '<div class=\"edealGrid\"><div id=\"grid-data\" class=\"data\"><table>'; toAdd += '<thead><tr>'; toAdd += '<th><fl:getMessage code="F2025" alt="Nom" js="true" /></th>'; <% if (!"B2C".equals(salesModel)) { %> toAdd += '<th><fl:getMessage code="F0046" alt="Société" js="true" /></th>'; <% } %> toAdd += '<th><fl:getMessage code="L622D" alt="A:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L622E" alt="Cc:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L636E" alt="Bcc:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L6209" alt="Tél standard" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L620A" alt="Tél Tél direct" js="true" /></th>'; toAdd += '<th><fl:getMessage code="F201D" alt="Mobile" js="true" /></th>'; toAdd += '<th><fl:getMessage code="F201E" alt="e-mail" js="true" /></th>'; toAdd += '</tr></thead><tbody>'; <% for (int cnt = 0; cnt < size; ++cnt) { Hashtable row = (Hashtable)results.elementAt(cnt); StringBuffer name = new StringBuffer(); try { name.append(row.get("PerCivID:Val") + " "); } catch (Exception e) { } String tmpFstName = (String)row.get("PerFstName"); if (tmpFstName != null) { name.append(Utils.formatToJavascript(tmpFstName)+ " "); } String tmpName = (String)row.get("PerName"); if (tmpName != null && !"".equals(tmpName)) { name.append(Utils.formatToJavascript(tmpName)); } String mailAddr = (String)row.get("PerMail"); if (mailAddr == null) { mailAddr = ""; } String perID = (String)row.get("PerID"); if (perID == null) { perID = ""; } StringBuffer mail = new StringBuffer(); if (!"".equals(mailAddr)) { mail.append("(\\'"); mail.append(Utils.formatToJavascript(name.toString())); mail.append(" <" + mailAddr + ">\\');"); } String stdNumber = (String)row.get("PerEntID:EntPhone"); if (stdNumber == null) { stdNumber = ""; } StringBuffer doCallStd = new StringBuffer(); if (!"".equals(stdNumber)) { doCallStd.append("javascript:doCall(\\'"); doCallStd.append(stdNumber); doCallStd.append("\\', \\'Enterprise\\', \\'"); doCallStd.append((String)row.get("PerEntID")); doCallStd.append("\\');"); } String directNumber = (String)row.get("PerPhone"); if (directNumber == null) { directNumber = ""; } StringBuffer doCallDirect = new StringBuffer(); if (!"".equals(directNumber)) { doCallDirect.append("javascript:doCall(\\'"); doCallDirect.append(directNumber); doCallDirect.append("\\', \\'Person\\', \\'"); doCallDirect.append((String)row.get("PerID")); doCallDirect.append("\\');"); } String mobileNumber = (String)row.get("PerMobile"); if (mobileNumber == null) { mobileNumber = ""; } StringBuffer doCallMobile = new StringBuffer(); if (!"".equals(mobileNumber)) { doCallMobile.append("javascript:doCall(\\'"); doCallMobile.append(mobileNumber); doCallMobile.append("\\', \\'Person\\', \\'"); doCallMobile.append((String)row.get("PerID")); doCallMobile.append("\\');"); } String lignCssClass = (cnt%2 == 0) ? "even" : "odd" ; %> toAdd += '<tr class=\"<%= lignCssClass %> bean\">'; <% String read_person ="javascript:read_person(\\'"; read_person +=row.get("PerID"); read_person +="\\');"; String read_enterprise ="javascript:read_enterprise(\\'"; read_enterprise +=row.get("PerEntID"); read_enterprise +="\\');"; %> toAdd += '<td class=\"entry\"><a href=\"<%=read_person%>\"><%= Utils.formatToJavascript(Utils.formatToWeb(name.toString(), false)) %></a></td>'; <% if (!"B2C".equals(salesModel)) { %> toAdd += '<td class=\"entry\"><a href=\"<%=read_enterprise%>\"><%= Utils.formatToJavascript(Utils.formatToWeb(row.get("PerEntID:EntCorpName"), false)) %></a></td>'; <% } %> toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectTo" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectCc" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectBcc" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(stdNumber) ? "" : doCallStd.toString() %>\"><%= "".equals(stdNumber) ? "" : stdNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(directNumber) ? "" : doCallDirect.toString() %>\"><%= "".equals(directNumber) ? "" : directNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(mobileNumber) ? "" : doCallMobile.toString() %>\"><%= "".equals(mobileNumber) ? "" : mobileNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(mailAddr) ? "" : "javascript:doMail(\\'Person\\',\\'" + perID + "\\',\\'" + mailAddr + "\\')" %>\"><%= "".equals(mailAddr) ? "" : mailAddr %></a></td>'; toAdd += '</tr>'; <% } %> toAdd += '</tbody></table></div></div>'; <% } else if ("jou".equals(typ)) { %> toAdd += '<div class=\"edealGrid\"><div id=\"grid-data\" class=\"data\" ed:embedded=\"true\"><table>'; toAdd += '<thead><tr>'; toAdd += '<th><fl:getMessage code="F2025" alt="Nom" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L622D" alt="A:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L622E" alt="Cc:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L636E" alt="Bcc:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L6209" alt="Tél standard" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L620A" alt="Tél Tél direct" js="true" /></th>'; toAdd += '<th><fl:getMessage code="F201D" alt="Mobile" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L30ED" alt="e-mail (per)" js="true"/></th>'; toAdd += '</tr></thead><tbody>'; <% for (int cnt = 0; cnt < size; ++cnt) { Hashtable row = (Hashtable)results.elementAt(cnt); StringBuffer name = new StringBuffer(); try { name.append(row.get("JouCivID:Val") + " "); } catch (Exception e) { } String tmpName = (String)row.get("JouName"); if (tmpName != null && !"".equals(tmpName)) { name.append(Utils.formatToJavascript(tmpName) + " "); } tmpName = (String)row.get("JouFstName"); if (tmpName != null) { name.append(Utils.formatToJavascript(tmpName)); } String mailAddr = (String)row.get("JouPerMail"); if (mailAddr == null) { mailAddr = ""; } StringBuffer mail = new StringBuffer(); if (!"".equals(mailAddr)) { mail.append("(\\'"); mail.append(Utils.formatToJavascript(name.toString())); mail.append(" <" + mailAddr + ">\\');"); } String stdNumber = (String)row.get("JouProPhone"); if (stdNumber == null) { stdNumber = ""; } StringBuffer doCallStd = new StringBuffer(); if (!"".equals(stdNumber)) { doCallStd.append("javascript:doCall(\\'"); doCallStd.append(stdNumber); doCallStd.append("\\', \\'Journalist\\', \\'"); doCallStd.append((String)row.get("JouID")); doCallStd.append("\\');"); } String directNumber = (String)row.get("JouPerPhone"); if (directNumber == null) { directNumber = ""; } StringBuffer doCallDirect = new StringBuffer(); if (!"".equals(directNumber)) { doCallDirect.append("javascript:doCall(\\'"); doCallDirect.append(directNumber); doCallDirect.append("\\', \\'Journalist\\', \\'"); doCallDirect.append((String)row.get("JouID")); doCallDirect.append("\\');"); } String mobileNumber = (String)row.get("JouPerMobile"); if (mobileNumber == null) { mobileNumber = ""; } StringBuffer doCallMobile = new StringBuffer(); if (!"".equals(mobileNumber)) { doCallMobile.append("javascript:doCall(\\'"); doCallMobile.append(mobileNumber); doCallMobile.append("\\', \\'Journalist\\', \\'"); doCallMobile.append((String)row.get("JouID")); doCallMobile.append("\\');"); } String lignCssClass = (cnt%2 == 0) ? "even" : "odd" ; String read_journalist ="javascript:read_journalist(\\'"; read_journalist +=row.get("JouID"); read_journalist +="\\');"; %> toAdd += '<tr class=\"<%= lignCssClass %> bean\">'; toAdd += '<td class=\"entry\"><a href=\"<%=read_journalist%>\"><%= Utils.formatToJavascript(Utils.formatToWeb(name.toString(), false)) %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectTo" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectCc" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectBcc" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(stdNumber) ? "" : doCallStd.toString() %>\"><%= "".equals(stdNumber) ? "" : stdNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(directNumber) ? "" : doCallDirect.toString() %>\"><%= "".equals(directNumber) ? "" : directNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(mobileNumber) ? "" : doCallMobile.toString() %>\"><%= "".equals(mobileNumber) ? "" : mobileNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(mailAddr) ? "" : "mailto:" + Utils.formatToJavascript(name.toString()) + " <" + mailAddr + ">" %>\"><%= "".equals(mailAddr) ? "" : mailAddr %></a></td>'; toAdd += '</tr>'; <% } %> toAdd += '</tbody></table></div></div>'; <% } else if ("act".equals(typ)){ %> toAdd += '<div class=\"edealGrid\"><div id=\"grid-data\" class=\"data\" ed:embedded=\"true\"><table>'; toAdd += '<thead><tr>'; toAdd += '<th><fl:getMessage code="F2025" alt="Nom" js="true" /></th>'; toAdd += '<th><fl:getMessage code="F2078" alt="Site" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L622D" alt="A:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L622E" alt="Cc:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L636E" alt="Bcc:" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L6209" alt="Tél standard" js="true" /></th>'; toAdd += '<th><fl:getMessage code="L620A" alt="Tél direct" js="true" /></th>'; toAdd += '<th><fl:getMessage code="F201D" alt="Mobile" js="true" /></th>'; toAdd += '<th><fl:getMessage code="F201E" alt="e-mail" js="true"/></th>'; toAdd += '</tr></thead><tbody>'; <% int realCnt = 0; for (int cnt = 0; cnt < size; ++cnt) { Hashtable row = (Hashtable)results.elementAt(cnt); StringBuffer name = new StringBuffer(); try { name.append(row.get("ActCivID:Val") + " "); } catch (Exception e) { } String tmpName = (String)row.get("ActName"); if ("Anonymous".equals(tmpName) || "System".equals(tmpName)) { continue; } if (tmpName != null && !"".equals(tmpName)) { name.append(Utils.formatToWeb(tmpName,false) + " "); } tmpName = (String)row.get("ActFstName"); if (tmpName != null) { name.append(Utils.formatToWeb(tmpName,false)); } String mailAddr = (String)row.get("ActMail"); if (mailAddr == null) { mailAddr = ""; } StringBuffer mail = new StringBuffer(); if (!"".equals(mailAddr)) { mail.append("(\\'"); mail.append(Utils.formatToJavascript(name.toString())); mail.append(" <" + mailAddr + ">\\');"); } String stdNumber = (String)row.get("ActSitID:SitPhone"); if (stdNumber == null) { stdNumber = ""; } StringBuffer doCallStd = new StringBuffer(); if (!"".equals(stdNumber)) { doCallStd.append("javascript:doCall(\\'"); doCallStd.append(stdNumber); doCallStd.append("\\', \\'Actor\\', \\'"); doCallStd.append((String)row.get("ActID")); doCallStd.append("\\');"); } String directNumber = (String)row.get("ActPhone"); if (directNumber == null) { directNumber = ""; } StringBuffer doCallDirect = new StringBuffer(); if (!"".equals(directNumber)) { doCallDirect.append("javascript:doCall(\\'"); doCallDirect.append(directNumber); doCallDirect.append("\\', \\'Actor\\', \\'"); doCallDirect.append((String)row.get("ActID")); doCallDirect.append("\\');"); } String mobileNumber = (String)row.get("ActMobile"); if (mobileNumber == null) { mobileNumber = ""; } StringBuffer doCallMobile = new StringBuffer(); if (!"".equals(mobileNumber)) { doCallMobile.append("javascript:doCall(\\'"); doCallMobile.append(mobileNumber); doCallMobile.append("\\', \\'Actor\\', \\'"); doCallMobile.append((String)row.get("ActID")); doCallMobile.append("\\');"); } String lignCssClass = (cnt%2 == 0) ? "even" : "odd" ; String read_actor ="javascript:read_actor(\\'"; read_actor +=row.get("ActID"); read_actor +="\\');"; String read_site ="javascript:read_site(\\'"; read_site +=row.get("ActSitID"); read_site +="\\');"; %> toAdd += '<tr class=\"<%= lignCssClass %> bean\">'; toAdd += '<td class=\"entry\"><a href=\"<%= read_actor %>\"><%= Utils.formatToJavascript(name.toString()) %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%=read_site%>\"><%= Utils.formatToJavascript((String) row.get("ActSitID:SitName")) %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectTo" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectCc" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"javascript:<%= "".equals(mailAddr) ? "" : "selectBcc" + mail.toString() %>\"><%= "".equals(mailAddr) ? "" : imageStr %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(stdNumber) ? "" : doCallStd.toString() %>\"><%= "".equals(stdNumber) ? "" : stdNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(directNumber) ? "" : doCallDirect.toString() %>\"><%= "".equals(directNumber) ? "" : directNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(mobileNumber) ? "" : doCallMobile.toString() %>\"><%= "".equals(mobileNumber) ? "" : mobileNumber %></a></td>'; toAdd += '<td class=\"entry\"><a href=\"<%= "".equals(mailAddr) ? "" : "mailto:" + Utils.formatToJavascript(name.toString()) + " <" + mailAddr + ">" %>\"><%= "".equals(mailAddr) ? "" : mailAddr %></a></td>'; toAdd += '</tr>'; <% realCnt++; } %> toAdd += '</tbody></table></div></div>'; <% } %> document.getElementById('list').innerHTML = toAdd;
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de