<% /****************************************************************************** * 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" contentType="text/html; charset=UTF-8"%> <%@ 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.DataDictionary" %> <%@ page import="java.util.Iterator" %> <%@ page import="com.edeal.frontline.ObjectsBean" %> <%@ page import="java.text.DecimalFormat" %> <%@ page import="com.edeal.frontline.FlLocale" %> <%@ page import="com.edeal.frontline.CampaignBean" %> <%@ page import="java.util.Vector" %> <%@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 copyCpgID = (String)request.getAttribute("copyCpgID"); if (copyCpgID != null) { try { Campaign = new CampaignBean(copyCpgID, context); request.setAttribute("Campaign", Campaign); } catch (Exception e) { } } String id = null; try { id = Campaign.getID(); } catch (FieldNotInitializedException fnie) { } int eveEnt = 0; int evePer = 0; try { eveEnt = Campaign.getCpgEventEnt(); } catch (FieldNotInitializedException e) { } try { evePer = Campaign.getCpgEventPer(); } catch (FieldNotInitializedException e) { } String salesModel = context.getContextParameter("SalesModel"); boolean isB2C = "B2C".equalsIgnoreCase(salesModel); Vector stages; ObjectsBean stg = null; try { stages = Campaign.getCpgStgID(); stg = dico.getTable("sql", "Stage"); } catch (FieldNotInitializedException e) { stages = new Vector(); } DecimalFormat intFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0;- #,##0"); DecimalFormat floatFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0.00;- #,##0.00"); int budgetEst; try { budgetEst = Integer.parseInt((String)request.getAttribute("budgetEst")); } catch (Exception e) { budgetEst = 0; } int budgetReal; try { budgetReal = Integer.parseInt((String)request.getAttribute("budgetReal")); } catch (Exception e) { budgetReal = 0; } double budgetDiffN; try { budgetDiffN = Double.parseDouble((String)request.getAttribute("budgetDiffN")); } catch (Exception e) { budgetDiffN = 0; } double budgetDiffP; try { budgetDiffP = Double.parseDouble((String)request.getAttribute("budgetDiffP")); } catch (Exception e) { budgetDiffP = 0; } //Intitulés des indicateurs par defaut String defIndic1 = (String)dico.getRefDisp(session, "Cai", "Te1", dico.getRefIdByCode("Cai", "Te1", "INDIC1")); String defIndic2 = (String)dico.getRefDisp(session, "Cai", "Te1", dico.getRefIdByCode("Cai", "Te1", "INDIC2")); String defIndic3 = (String)dico.getRefDisp(session, "Cai", "Te1", dico.getRefIdByCode("Cai", "Te1", "INDIC3")); String defIndic4 = (String)dico.getRefDisp(session, "Cai", "Te1", dico.getRefIdByCode("Cai", "Te1", "INDIC4")); String defIndic5 = (String)dico.getRefDisp(session, "Cai", "Te1", dico.getRefIdByCode("Cai", "Te1", "INDIC5")); String defIndic1JS = Utils.formatToJavascript(defIndic1); String defIndic2JS = Utils.formatToJavascript(defIndic2); String defIndic3JS = Utils.formatToJavascript(defIndic3); String defIndic4JS = Utils.formatToJavascript(defIndic4); String defIndic5JS = Utils.formatToJavascript(defIndic5); Vector units = dico.getRefCodeList("CpgIndicUnit1"); String errorMsg = Utils.getMessage(session, "M2000", true, "Format du champ incorrect"); %> <% if (!"B2C".equalsIgnoreCase(salesModel)) { %> "> <% } %> "> " ou="<%= \"/edit_campaign.fl\" + (id != null ? \"?id=\" + id : \"\") %>">
<% String CpgYearID = null; try { CpgYearID = Campaign.getCpgYear(); } catch (FieldNotInitializedException e) { } if (CpgYearID == null) { %> <% } else { %> <% } // Marqueur Enterprise if (!isB2C) { %> <% if (eveEnt != 2) { %> <% } else { %> <% } %> <% } %>
<% if (evePer != 2) { %> <% } else { %> <% } %>
<% if (id != null) { %>
">  
<% } %> ">
<%= intFormat.format(budgetEst) %> €
<%= intFormat.format(budgetReal) %> €
<%= intFormat.format(budgetDiffN) %> € : <%= floatFormat.format(budgetDiffP) %> %
<% int roi = 0; try { roi = Campaign.getCpgROIEst(); } catch (FieldNotInitializedException e) { } %>  
" visible="<%= context.getAutoDisplayManager().hasEntry(\"Campaign\", \"Campagne 1\") %>"> ">
" SIZE="25" maxlength="100" onBlur="if(this.value=='')this.value='<%=defIndic1JS%>';"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> ')" onFocus="this.blur()"> : %
" SIZE="25" maxlength="100" onBlur="if(this.value=='')this.value='<%= defIndic2JS %>';"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> ')" onFocus="this.blur()"> : %
" SIZE="25" maxlength="100" onBlur="if(this.value=='')this.value='<%= defIndic3JS %>';"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> ')" onFocus="this.blur()"> : %
" SIZE="25" maxlength="100" onBlur="if(this.value=='')this.value='<%= defIndic4JS %>';"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> ')" onFocus="this.blur()"> : %
" SIZE="25" maxlength="100" onBlur="if(this.value=='')this.value='<%= defIndic5JS %>';"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> " SIZE="15" onBlur="ctrlNumField(this , 'float', '');doCalculResultat(this)"> ')" onFocus="this.blur()"> : %
" visible="<%= context.getAutoDisplayManager().hasEntry(\"Campaign\", \"Campagne 2\") %>"> ">