Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\netbusiness\emailing\send_mail.jsp
<% /****************************************************************************** * 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. * * ******************************************************************************/ %><%@page session="true"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.AccessDeniedException" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.EMailingBean" %> <%@ page import="com.edeal.frontline.MessagesBean" %> <%@ page import="com.edeal.frontline.PopulationBean" %> <%@ page import="com.edeal.frontline.BasicBean" %> <%@ page import="com.edeal.frontline.FlLocale" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.FlLocale" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% //CONSTANTES DE LIMITES //LIMITE DE TAILLE DU MESSAGE EN KILOOCTETS AU-DELA DE LAQUELLE L'ENVOI DOIT ETRE REGULE int MAX_MSG_SIZE = 50; //LIMITE DE NOMBRE D'INDIVIDUS DE LA POPULATION OU D'ABONNES AUX NEWSLETTERS AU-DELA DE LAQUELLE L'ENVOI DOIT ETRE REGULE int MAX_POP_SIZE = 2000; 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 SfwID = flRequest.getRequestParameterOrAttribute("SfwID"); String strActID = (String)session.getAttribute("actorID"); String emaID = flRequest.getRequestParameterOrAttribute("emaID"); String ctl = flRequest.getRequestParameterOrAttribute("ctl"); boolean hasToBeQueued = false; EMailingBean ema = null; String date = ""; String time = ""; try { ema = new EMailingBean(emaID, context); Date sendDate = ema.getEmaDate(); //SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); java.text.SimpleDateFormat sdf = FlLocale.getInstance(session).getTimeFormat(false); time = Utils.formatToWeb(sdf.format((Date) sendDate), true); sdf = new java.text.SimpleDateFormat("dd/MM/yyyy"); date = Utils.formatToWeb(sdf.format((Date) sendDate), true); } catch (FrontlineException e) { } catch (AccessDeniedException e) { } //check size of html msg if (!"1".equals(ctl) && !hasToBeQueued) { MessagesBean message = null; try { message = new MessagesBean(ema.getEmaHtmlMsgID(), context); int size = message.getMailSize(); if(size > MAX_MSG_SIZE * 1000) hasToBeQueued = true; } catch (FrontlineException e) { } catch (AccessDeniedException e) { } } //check size of text msg if (!"1".equals(ctl) && !hasToBeQueued) { MessagesBean message = null; try { message = new MessagesBean(ema.getEmaTextMsgID(), context); int size = message.getMailSize(); if(size > MAX_MSG_SIZE * 1000) hasToBeQueued = true; } catch (FrontlineException e) { } catch (AccessDeniedException e) { } } //check size of population if (!"1".equals(ctl) && !hasToBeQueued && ema.getEmaPopTypID().equals(dico.getRefIdByCode("EmaPopTypID", "POPULATION"))) { PopulationBean population = null; try { population = new PopulationBean(ema.getEmaPopID(), context); int size = population.getPopTotNbr() + population.getPopAddNbr() - population.getPopRmvNbr(); //logger.debug("population size " + size); if(size > MAX_POP_SIZE) hasToBeQueued = true; } catch (FrontlineException e) { } catch (AccessDeniedException e) { } } //check number of individuals to send to if (!"1".equals(ctl) && !hasToBeQueued && ema.getEmaPopTypID().equals(dico.getRefIdByCode("EmaPopTypID", "NEWSLETTER"))) { // 20021203 : RaF : nouvelle gestion des multival int total = 0; String[] countFields = {"count"}; StringBuffer countQuery = new StringBuffer(); countQuery.append("SELECT count(DISTINCT m1.MvaColID) FROM MvaPerNltID m1, EMailing, MvaEmaNltID m2 WHERE m1.MvaText = m2.MvaText AND EmaID = m2.MvaColID "); countQuery.append("UNION "); countQuery.append("SELECT count(DISTINCT m1.MvaColID) FROM MvaSilNltID m1, EMailing, MvaEmaNltID m2 WHERE m1.MvaText = m2.MvaText AND EmaID = m2.MvaColID "); Vector vCount = BasicBean.listSQL(context, countFields, countQuery.toString()); if (vCount != null && vCount.size() > 0) { for (int i = 0; i < vCount.size(); i++) { Hashtable row = (Hashtable)vCount.elementAt(i); total += ((Number)row.get("count")).intValue(); } } if (total > MAX_POP_SIZE) hasToBeQueued = true; } //depending on the size of the population and the size of the message, we could have two or three radio buttons, //which complicates the javascript a little... String indexImmediat1 = hasToBeQueued ? "-1" : "0"; String indexImmediat2 = hasToBeQueued ? "0" : "1"; String indexDiffere = hasToBeQueued ? "1" : "2"; %> <html> <head> <title><fl:getMessage code="L2025" alt="e-Deal"/></title> <link rel="stylesheet" href="<fl:webapp/>/css/common_css.jsp" type="text/css"> <link rel="stylesheet" href="<fl:webapp/>/css/tooltip.css" type="text/css"> <link rel="stylesheet" href="<fl:webapp/>/css/master_css.jsp" type="text/css"> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/edeal/libraries/jquery/jquery.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/FormatHeure.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/presentField.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/checkFields.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/utils.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/calendar.jsp"></script> <script language="javascript"> function doSubmit() { f = document.forms[0]; if (f.mode[0].checked == false && f.mode[1].checked == false <%= hasToBeQueued ? "" : "&& f.mode[2].checked == false" %>) { alert('<fl:getMessage code="M606D" alt="Veuillez choisir un mode d\'envoi." js="true"/>'); return false; } if (<%=indexImmediat1%> != -1 && f.mode[<%=indexImmediat1%>].checked == true) f.queued.value = 'false'; else f.queued.value = 'true'; if (f.mode[<%=indexImmediat2%>].checked == true) { f.activationDate.value = ""; f.activationTime.value = ""; } if (f.mode[<%=indexDiffere%>].checked == true) { if (f.activationDate.value == "") { alert('<fl:getMessage code="M2006" alt="Veuillez saisir une date." js="true"/>'); f.activationDate.focus(); return false; } if (checkField(f.activationDate.value, "date", true, 'dd/mm/yyyy', 'DD/MM/yyyy') == false) { alert('<fl:getMessage code="M200A" alt="Veuillez saisir une date correcte du type jj/mm/aaaa." js="true"/>'); f.activationDate.focus(); return false; } } f.submit(); } </script> </head> <body class="popup_body"> <div id="object_css" style="top:0px;left: 0px;height:100%;"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L0005\", false, true, \"e-Mailing\") %>" ignoreList="true"> <form action="<fl:link url="/send_emailing.fl"/>"> <input type="hidden" name="$$presentFields" id="$$presentFields" value=""/> <input type="hidden" name="queued" id="queued" value=""/> <input type="hidden" name="id" id="id" value="<%= emaID %>"/> <input type="hidden" name="ctl" id="ctl" value="<%= ctl %>"/> <input type="hidden" name="SfwID" id="SfwID" value="<%= SfwID %>"/> <table class="container" cellpadding="0"> <tbody> <tr class="fieldline"> <td class="dataValue"> <% if (!hasToBeQueued) { %> <input type="radio" name="mode" id="immediat1" value="immediat1"/><label for="immediat1"><fl:getMessage code="F6083" alt="Envoi immédiat / Débit maximum"/></label><br> <% } %> <input type="radio" name="mode" id="immediat2" value="immediat2" checked><label for="immediat2"><fl:getMessage code="F6084" alt="Envoi immédiat / Débit régulé"/></label><br> <input type="radio" name="mode" id="differe" value="differe"><label for="differe"><fl:getMessage code="F6085" alt="Envoi différé / Débit régulé"/></label> <label for="activationDate"><fl:getMessage code="L0043" alt="Le"/></label> <input id="activationDate" name="activationDate" value="" size="10" onClick="document.forms[0].mode[<%= hasToBeQueued ? "1" : "2" %>].checked=true" onblur="ctrlDateField(this, '<fl:getMessage code="M202B" alt="Format de date incorrect. Veuillez corriger." js="true"/>');"/> <a href="javascript:openCalendar(document.forms[0].activationDate);" title="<fl:getMessage code="A2000" alt="Afficher le calendrier"/>"><img src="<fl:webapp/>/icons/ico/clock_neutre.gif"></a> <label for="activationTime"><fl:getMessage code="L2059" alt="à"/></label> <input id="activationTime" name="activationTime" value="" size="4" onblur="ctrlHourField(this, '<fl:getMessage code="M202C" alt="Format de l\\\'heure de début incorrect. Veuillez corriger" js="true"/>');"/> </td> </tr> <tr class="ligne_separation"> <td colspan="2"></td> </tr> </tbody> </table> </form> </fl:bigTabs> <br> <table class="container" width="100%"> <tr class="fieldline"> <td colspan="2" style="text-align: center;"> <a href="javascript:doSubmit();"><img src="<fl:webapp/>/icons/ico/valid_green_long.gif"></a> <a href="javascript:window.close()"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif"></a> </td> </tr> </table> </div> <div id="waiting" style="display:none"><fl:getMessage code="L639B" alt="Chargement ..."/></div> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de