Edit C:\galaxie\Back\galaxie\marketing\population\actions.jsp
<% /****************************************************************************** * Copyright (c) 2000-2005 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.controller.actions.PopulationSalesInvestAction.PopSalesInvestCreationType"%> <%@ 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.ObjectsBean" %> <%@ page import="com.edeal.frontline.DocumentBean" %> <%@ page import="java.util.Vector" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.ActorBean" %> <%@ page import="com.edeal.frontline.SalesInvestBean" %> <%@ page import="com.edeal.frontline.controller.actions.SelectAction" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean id="Population" class="com.edeal.frontline.PopulationBean" scope="request"/> <% 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 pPopType = flRequest.getRequestParameterOrAttribute("PopType"); String salesModel = context.getContextParameter("SalesModel"); String id = flRequest.getRequestParameterOrAttribute("id"); String actorID = (String) session.getAttribute("actorID"); String actMail = null; String[] fieldsA = {"ActID", "ActMail"}; String[][] queryA = {{"ActID = " + Utils.formatToSQL(context, actorID)}}; Vector actV = ActorBean.listSummary(context, fieldsA, queryA); if (actV.size() > 0) { Hashtable actH = (Hashtable)actV.elementAt(0); actMail = (String)actH.get("ActMail"); } String type = flRequest.getRequestParameterOrAttribute("PvtTypeSelect"); String montant = flRequest.getRequestParameterOrAttribute("PvtMontant"); %> <!-- Javascript include --> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/jsOnload.jsp"></script> <script type="text/javascript" language="javascript"> function doPvtEventIDChange() { setTimeout("runAjax()", 50); } function runAjax() { var f = document.forms['eventForm']; doAjax('<fl:link url="/event_status.fl?formName=eventForm&field=PvtStatusSelect" />&EvtID=' + f.PvtEventID.value); } function doSendMail() { var f = document.forms['emailForm']; try { if (acCurHighlightedDiv != null) { return false; } } catch (error) { } var msgID = f.EmaHtmlMsgID.value; if (msgID) { var fenetreChoix = window.open('<fl:webapp/>/prepare_population_email.fl?popID=<%= id%>&msgID='+msgID , 'EnvoiMessage' , 'menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes,width=500,height=210'); } else { window.alert('<fl:getMessage code="F6033" alt="Veuillez entrer un message." js="true"/>'); } return; } function doImpactBase() { var f = document.forms['impactForm']; var perPevID = f.PerPevID.options[f.PerPevID.selectedIndex].value; var perPevIDRemove = f.PerPevIDRemove.checked; if (f.EntEveID) { var entEveID = f.EntEveID.options[f.EntEveID.selectedIndex].value; var entEveIDRemove = f.EntEveIDRemove.checked; } if (perPevID || entEveID) { f.Val.value = (perPevID ? perPevID : '') + ';' + (entEveID ? entEveID : ''); f.Rem.value = (perPevIDRemove ? perPevIDRemove : '') + ';' + (entEveIDRemove ? entEveIDRemove : ''); var win = window.open('<fl:webapp/>/blank.jsp', 'PopulationImpact<%= id %>', 'width=500,height=170,scrollbars'); f.target = win.name; f.submit(); } return; } function doSelection() { var fenetreChoix = window.open('<fl:webapp/>/select.fl?formIndex=1&field=EmaHtmlMsgID&type=Messages' , 'MessageSelection' , 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=<%= SelectAction.SELECT_WINDOW_WIDTH %>,height=350'); } function doSelectNone() { var f = document.forms['emailForm']; f.EmaHtmlMsgID .value = ''; f.lblEmaHtmlMsgID.value = ''; } function mailing() { var f = document.forms['mailingForm']; var query = "<fl:webapp/>/population_person_mailing.fl?"; query += "id=" + f.id.value; var i = 0; for (i = 0; i < f.delim.length; i++) { if (f.delim[i].checked) { query += "&delim=" + encodeURIComponent(f.delim[i].value); } } for (i = 0; i < f.separator.length; i++) { if (f.separator[i].checked) { query += "&separator=" + encodeURIComponent(f.separator[i].value); } } if (f.model) { query += "&model=" + encodeURIComponent(f.model.options[f.model.selectedIndex].value); } window.parent.location = query; } function doEvent() { var f = document.forms['eventForm']; var pvtStatus = ""; try { if (acCurHighlightedDiv != null) { return false; } } catch (error) { } if (f.PvtStatusSelect.options[f.PvtStatusSelect.selectedIndex].value != "") { pvtStatus = f.PvtStatusSelect.options[f.PvtStatusSelect.selectedIndex].value; f.PopEvtID.value = f.PvtEventID.value; window.open("<fl:link url="<%= \"/population_person_event.fl?popID=\" + id %>"/>&PvtEventID=" + encodeURIComponent(f.PvtEventID.value) + "&PvtStatus=" + encodeURIComponent(pvtStatus) + "&PopEvtID=" + encodeURIComponent(f.PopEvtID.value), "impactWin", "menubar=no,status=no,toolbar=no,resizable=yes,width=500,height=150"); } else { window.alert("<fl:getMessage code="M604D" alt="Veuillez sélectionner un événement." js="true"/>"); return; } } function doInvest(){ var f = document.forms['investForm']; var type = f.PvtTypeSelect.options[f.PvtTypeSelect.selectedIndex].value; var montant = f.SinMt.value; window.open("<fl:link url="<%= \"/population_salesinvest.fl?popID=\" + id %>"/>&PvtType=" + encodeURIComponent(type) + "&PvtMontant=" + encodeURIComponent(montant), "salesinvestWin","scrollbars=auto,menubar=no,status=no,toolbar=no,resizable=yes,width=500,height=150"); } function critOnKeyPress(event) { var keyPress = 0; try { keyPress = event.which; } catch (error) { } if (keyPress == 0) { try { keyPress = window.event.keyCode; } catch (error) { } } // Someone pressed the enter key, AND we're not AC'ing if (keyPress == 13 && acCurHighlightedDiv == null) { if (acCurFieldName == 'lblPvtEventID') doEvent(); if (acCurFieldName == 'lblEmaHtmlMsgID') doSendMail(); } } function doOnLoad() { window.document.forms['eventForm'].onsubmit = doEvent; window.document.forms['emailForm'].onsubmit = doSendMail; document.onkeypress = critOnKeyPress; } </script> <style type="text/css"> .submit { font-weight: bold; white-space: nowrap; width: 1%; vertical-align: bottom; text-align: center; padding-left: 10px; padding-right: 10px; } </style> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L30DE\", false, true, \"Actions sur une population\") %>" ou="/population_actions.fl"> <table class="container" cellpadding="0"> <tr> <td class="titreFiche"><fl:getProperty name="Population" property="PopName" alt=" " /></td> </tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:label code="L30CF" label="Mailing" labelClassName="titrePartie"/></td> </tr> <% ObjectsBean obj = dico.getTable("sql", "Population"); String objID = obj.getID(); String[] fields = {"DocID", "DocTitle"}; String[][] query = {{"DocObjID = " + Utils.formatToSQL(context, objID)}}; String[] orderBy = {"DocTitle"}; Vector docList = DocumentBean.listSummary(session, fields, query, orderBy); %> <tr> <td class="dataValue" style="vertical-align:top; width: 100%"> <form name="mailingForm" method="get" id="mailingForm" action=""> <input name="id" type="hidden" value="<%= id %>"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><fl:label code="L30D0" label="Délimiteur"/></td> <td class="dataValue"> <input name="delim" id="delim1" type="radio" class="radio" value="" checked><label id="delim1_label" for="delim1" class="radioLabel"><fl:getMessage code="L30D1" alt="Aucun"/></label> <input name="delim" id="delim2" type="radio" class="radio" value="""><label id="delim2_label" for="delim2" class="radioLabel"><fl:getMessage code="L30D2" alt="Guillemet"/></label> </td> <td class="submit" rowspan="<%= docList != null && docList.size() > 0 ? "3" : "2" %>"> <a href="javascript:mailing();"><img src="<fl:webapp/>/icons/ico/valider.gif" alt="<fl:getMessage code="A303F" alt="télécharger le fichier de mailing"/>" title="<fl:getMessage code="A303F" alt="télécharger le fichier de mailing"/>" style="vertical-align: middle;"></a> </td> </tr> <tr class="fieldline"> <td class="dataLabel"><fl:label code="L30D3" label="Séparateur"/></td> <td class="dataValue" style="overflow: visible;"> <input name="separator" id="sep1" type="radio" class="radio" value=" "><label id="sep1_label" for="sep1" class="radioLabel"><fl:getMessage code="L30D4" alt="Tabulation"/></label> <input name="separator" id="sep2" type="radio" class="radio" value=";" checked><label id="sep2_label" for="sep2" class="radioLabel"><fl:getMessage code="L30D5" alt="Point-virgule"/></label> <input name="separator" id="sep3" type="radio" class="radio" value=","><label id="sep3_label" for="sep3" class="radioLabel"><fl:getMessage code="L30D6" alt="Virgule"/></label> </td> </tr> <% if (docList != null && !docList.isEmpty()) { %> <tr class="fieldline"> <td class="dataLabel"><fl:label code="L6169" label="Modèle" forInput="model"/></td> <td class="dataValue"> <div class="input select"><select name="model" id="model" class="input select"> <% for (int i = 0; i < docList.size(); i++) { Hashtable row = (Hashtable)docList.elementAt(i); String docID = (String)row.get("DocID"); String docTitle = (String)row.get("DocTitle"); %> <option value="<%= Utils.formatToWeb(docID, true) %>"><%= Utils.formatToWeb(docTitle, false) %></option> <% } %> </select></div> </td> </tr> <% } %> </table> </form> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:label code="L0005" label="e-Mailing" labelClassName="titrePartie"/></td> </tr> <tr> <td class="dataValue" style="vertical-align:top; width: 100%"> <form name="emailForm" method="get" id="emailForm" action=""> <input name="id" type="hidden" value="<%= id %>"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><fl:label code="L0022" label="Sélection d\'un message"/></td> <td class="dataValue"> <div class="fieldTable"><table class="fieldTable" cellpadding="0"> <tr> <td class="principalText"> <input id="EmaHtmlMsgID" name="EmaHtmlMsgID" type="hidden" value="" > <input id="lblEmaHtmlMsgID" name="lblEmaHtmlMsgID" type="text" value="" autocomplete="off" onfocus="displayOnFocusTwo(this,1);acResizeDisplayDiv(lblEmaHtmlMsgID);" class="input fob"> </td> <td class="postText"> <a href="javascript:doSelection()"> <img src="<fl:webapp/>/icons/ico/rechercher.gif" class="icon" alt="Sélectionner" title="Sélectionner"></a> <a href="javascript:var f = window.document.forms[1]; f.EmaHtmlMsgID.value = f.lblEmaHtmlMsgID.value = ''; acLastCompleteValues['lblEmaHtmlMsgID'] = '';acLastCompleteValues['EmaHtmlMsgID'] = ''; void('')"> <img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="Vider le champ" title="Vider le champ"></a> <script language="javascript">runOnTime("installFobAC(document.forms[1].lblEmaHtmlMsgID);", 200);</script> </td> </tr> </table></div> </td> <td class="submit" rowspan="3"> <a href="javascript:doSendMail();"><img src="<fl:webapp/>/icons/ico/valider.gif" alt="<fl:getMessage code="A3041" alt="envoyer l'e-mailing"/>" title="<fl:getMessage code="A3041" alt="envoyer l'e-mailing"/>" style="vertical-align: middle"></a> </td> </tr> <% if (actMail == null) { %> <tr class="fieldline"> <td class="dataValue" colspan="2" style="color: red;" class="dataValue"> <fl:getMessage code="L60DA" alt="Vous n\'avez pas de mail! veuillez le saisir ou demander à l\'administrateur de le faire avant de lancer cette action."/> </td> </tr> <% } %> </table> </form> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"> <% if (!"B2C".equalsIgnoreCase(salesModel)) { %> <fl:label code="L30DA" label="Marquage Entreprises / Personnes" labelClassName="titrePartie"/> <% } else { %> <fl:label code="L62D6" label="Marquage personnes" labelClassName="titrePartie"/> <% } %> </td> </tr> <tr> <td class="dataValue" style="vertical-align:top; width: 100%"> <form name="impactForm" method="get" id="impactForm" action="<fl:link url="/population_person_impact.fl"/>"> <input name="id" type="hidden" value="<%= id %>"> <input name="PopFld" type="hidden" value="PpePerID;PpeEntID"> <input name="Fld" type="hidden" value="PerPevID;EntEveID"> <input name="Val" type="hidden" value=""> <input name="Rem" type="hidden" value=""> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><fl:label code="L30DC" label="Evènement interlocuteur" forInput="PerPevID"/></td> <td class="dataValue"> <div class="fieldTable"><table class="fieldTable" cellpadding="0"> <tr> <td class="bigFieldPart"> <div class="input select"><select name="PerPevID" id="PerPevID" class="input select"> <option value=""><<fl:getMessage code="L30D1" alt="Aucun"/>></option> <% Vector vectPerEvt = dico.getRefList(session, "PerPevID", false); for (int i = 0; i < vectPerEvt.size(); i++) { Vector vectRef = (Vector)vectPerEvt.elementAt(i); String refID = (String)vectRef.elementAt(0); String refDisp = (String)vectRef.elementAt(1); %> <option value="<%= refID %>"><%= Utils.formatToWeb(refDisp, false) %></option> <% } %> </select></div> </td> <td class="smallFieldPart"> <input type="checkbox" class="checkbox" name="PerPevIDRemove" id="PerPevIDRemove"><label id="PerPevIDRemove_label" for="PerPevIDRemove" class="checkboxLabel"><fl:getMessage code="A0012" alt="Retirer"/></label> </td> </tr> </table></div> </td> <td class="submit"<% if (!"B2C".equals(salesModel)) { %> rowspan="2"<% } %>> <a href="javascript:doImpactBase();"><img src="<fl:webapp/>/icons/ico/valider.gif" alt="<fl:getMessage code="L614E" alt="Marquer / démarquer entreprises/interlocuteurs"/>" title="<fl:getMessage code="L614E" alt="Marquer / démarquer entreprises/interlocuteurs"/>" style="vertical-align: middle;"></a> </td> </tr> <% if (!"B2C".equals(salesModel)) { %> <tr class="fieldline"> <td class="dataLabel"><fl:label code="L30DD" label="Evènement entreprise" forInput="EntEveID"/></td> <td class="dataValue"> <div class="fieldTable"><table class="fieldTable" cellpadding="0"> <tr> <td class="bigFieldPart"> <div class="input select"><select name="EntEveID" id="EntEveID" class="input select"> <option value=""><<fl:getMessage code="L30D1" alt="Aucun"/>></option> <% Vector vectEntEvt = dico.getRefList(session, "EntEveID", false); for (int i = 0; i < vectEntEvt.size(); i++) { Vector vectRef = (Vector)vectEntEvt.elementAt(i); String refID = (String)vectRef.elementAt(0); String refDisp = (String)vectRef.elementAt(1); %> <option value="<%= refID %>"><%= Utils.formatToWeb(refDisp, false) %></option> <% } %> </select></div> </td> <td class="smallFieldPart"> <input type="checkbox" class="checkbox" name="EntEveIDRemove" id="EntEveIDRemove"><label id="EntEveIDRemove_label" for="EntEveIDRemove" class="checkboxLabel"><fl:getMessage code="A0012" alt="Retirer"/></label> </td> </tr> </table></div> </td> </tr> <% } %> </table> </form> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:label code="L615F" label="Evénements personne" labelClassName="titrePartie"/></td> </tr> <tr> <td class="dataValue" style="vertical-align:top; width: 100%"> <form name="eventForm" method="get" id="eventForm" action=""> <input name="id" type="hidden" value="<%= id %>"> <input id="PopEvtID" name="PopEvtID" type="hidden" value="" > <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><fl:label code="F605B" label="Evénement personne"/></td> <td class="dataValue"> <div class="fieldTable"><table class="fieldTable" cellpadding="0"> <tr> <td class="bigFieldPart"> <table class="fieldTable" cellpadding="0"><tr><td class="principalText"> <input id="PvtEventID" name="PvtEventID" type="hidden" value="" > <input id="lblPvtEventID" name="lblPvtEventID" type="text" value="" onblur="doPvtEventIDChange();" autocomplete="off" onfocus="displayOnFocusTwo(this,3);acResizeDisplayDiv(lblPvtEventID);" class="input fob"> </td><td class="postText"> <a href="javascript:var win = window.open('<fl:webapp/>/select.fl?type=Event&field=PvtEventID&formIndex=3', 'SelectActor', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400')"> <img src="<fl:webapp/>/icons/ico/rechercher.gif" class="icon" alt="Sélectionner" title="Sélectionner"></a> <a href="javascript:var f = window.document.forms[3]; f.PvtEventID.value = f.lblPvtEventID.value = ''; acLastCompleteValues['lblPvtEventID'] = '';acLastCompleteValues['PvtEventID'] = ''; void('')"> <img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="Vider le champ" title="Vider le champ"></a> <script language="javascript">runOnTime("installFobAC(document.forms[3].lblPvtEventID);", 200);</script> </td></tr></table></div> </td> <td class="smallFieldPart" style="padding-left: 20px"> <div class="input select"> <select class="input select" name="PvtStatusSelect" style="width: auto;"> <option value=""><fl:getMessage code="L6203" alt="<Statut>"/></option> </select> </div> </td> </tr> </table> </td> <td class="submit"> <a href="javascript:doEvent();"><img src="<fl:webapp/>/icons/ico/valider.gif" alt="<fl:getMessage code="L615F" alt="Evénements personne"/>" title="<fl:getMessage code="L615F" alt="Evénements personne"/>" style="vertical-align: middle"></a> </td> </tr> </table> </form> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> <% boolean isSalesInvestActive = SalesInvestBean.isSalesInvestActive(context); String globalSIType = PopSalesInvestCreationType.GLOBAL.toString(); String unitaireSIType = PopSalesInvestCreationType.UNITAIRE.toString(); if (isSalesInvestActive) { %> <tr> <td class="titrePartie"><fl:label code="L64EC" label="Investissements commerciaux" labelClassName="titrePartie"/></td> </tr> <tr> <td class="dataValue" style="vertical-align:top; width: 100%"> <form name="investForm" method="get" id="investForm" action=""> <input name="id" type="hidden" value="<%= id %>"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><fl:label code="F1023" label="Type"/></td> <td class="dataValue"> <div class="fieldTable"><table class="fieldTable" cellpadding="0"> <tr> <td class="bigFieldPart"> <div class="input select"><select name="PvtTypeSelect" class="input select"> <option value="<%= unitaireSIType %>" <%= unitaireSIType.equals(type) ? "selected" : "" %>><fl:getMessage code="L64F4" alt="Unitaire"/></option> <option value="<%= globalSIType %>" <%= globalSIType.equals(type) ? "selected" : "" %>><fl:getMessage code="L0018" alt="global"/></OPTION> </select></div> </td> </tr> </table></div> </td> <td> <td> </tr> <tr class="fieldline"> <td class="dataLabel"><fl:label code="L6330" label="Montant"/></td> <td class="dataValue"> <div class="fieldTable"><table class="fieldTable" cellpadding="0"> <tr> <td class="bigFieldPart"> <fl:input name="SalesInvest" property="SinMt" postText=" € " nodiv="true"/> </td> </tr> </table></div> </td> <td class="submit"> <a href="javascript:doInvest();"><img src="<fl:webapp/>/icons/ico/valider.gif" alt="<fl:getMessage code="L64EC" alt="Investissements commerciaux"/>" title="<fl:getMessage code="L64EC" alt="Investissements commerciaux"/>" style="vertical-align: middle"></a> </td> </tr> </table> </form> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> <% } %> </table> </fl:bigTabs>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de