Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\marketing\populationv2\edit.jsp
<%@page import="com.edeal.frontline.FrontlineException"%> <%@page import="com.edeal.frontline.DataDictionary"%> <%@page import="com.edeal.frontline.FlContext"%> <% /****************************************************************************** * Copyright (c) 2000-2008 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 session="true"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.PopulationBean" id="Population" 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 id = null; try { id = Population.getPopID(); } catch (FieldNotInitializedException fnie) { } int popType = 0; try { popType = Population.getPopType(); } catch (FieldNotInitializedException ex) { } boolean isEditType = (Boolean)flRequest.getAttribute("isEditType"); boolean hasFob1, hasFob2, hasFob3, hasFob4, hasFob5; try { hasFob1 = Population.getPopObj1() != null; } catch (FieldNotInitializedException ex) { hasFob1 = false; } try { hasFob2 = Population.getPopObj2() != null; } catch (FieldNotInitializedException ex) { hasFob2 = false; } try { hasFob3 = Population.getPopObj3() != null; } catch (FieldNotInitializedException ex) { hasFob3 = false; } try { hasFob4 = Population.getPopObj4() != null; } catch (FieldNotInitializedException ex) { hasFob4 = false; } try { hasFob5 = Population.getPopObj5() != null; } catch (FieldNotInitializedException ex) { hasFob5 = false; } // Query string. String queryString = flRequest.getRequest().getQueryString(); if (Utils.isEmpty(queryString)) { //this line is to overcome a Websphere bug/weird behaviour... queryString = (String)flRequest.getRequest().getAttribute("javax.servlet.forward.query_string"); } String manualPopTypeId = null; String emailingPopTypeId = null; String populationGenTypeId = null; try{ manualPopTypeId = dico.getRefIdByCode("PopGenType", "MANUAL"); } catch (FrontlineException e){ } try{ emailingPopTypeId = dico.getRefIdByCode("PopGenType", "MAILTEST"); } catch (FrontlineException e){ } try{ populationGenTypeId = Population.getPopGenType(); } catch (FieldNotInitializedException e){ } %> <!-- Javascript include --> <style type="text/css"> .dataValueX { width: 30%; overflow: hidden; margin: 0px; padding: 0px; padding-left: 10px; font-size: small; font-size: expression("x-small"); color: rgb(0, 0, 0); font-family: Arial, Verdana, sans-serif; vertical-align: auto; padding: 1px; } .borderLineOne { border-bottom: 1px dashed #9EC6D0; } .borderLineTwo { border-right: 1px dashed #9EC6D0; } .borderLineLeft { border-left: 1px dashed #9EC6D0; } .borderLineRight { border-right: 1px dashed #9EC6D0; } </style> <script type="text/javascript" language="javascript"> var queryString = "<%= queryString %>"; function refreshSynthesis() { <% if (queryString.indexOf("id=") == -1) { if (queryString.indexOf("?") == -1) { queryString = "id=" + id; } else { queryString += "&id=" + id; } } %> doAjax('<fl:link url="<%= \"/refresh_populationv2_synthesis.fl?\" + queryString %>"/>'); } <%-- function refreshSynthesisAjax() { setTimeout('refreshSynthesis();', 50); } --%> function refreshPopulationEntry() { doAjax('<fl:link url="<%=\"/population2entry_list_ajax.fl?$$nb=30&PpeRemoved=0&PpeAdded=0&PpePopID=\"+ (id != null ? id : \"\") +\"&PopType=\"+ popType %>"/>&targetDiv=PopulationEntryList'); } function refreshAddedPopulationEntry() { doAjax('<fl:link url="<%=\"/population2entry_list_ajax.fl?showOnlyAdded=true&PpeRemoved=0&PpeAdded=1&PpePopID=\"+ Population.getID() +\"&PopType=\"+ popType %>"/>&targetDiv=AddedPopulationEntryList'); } function refreshPopulationEntryShowAll() { doAjax('<fl:link url="<%=\"/population2entry_list_ajax.fl?PpeRemoved=0&PpeAdded=0&PpePopID=\"+ (id != null ? id : \"\") +\"&PopType=\"+ popType %>"/>&targetDiv=PopulationEntryList'); } function refreshRemovedPopulationEntry() { doAjax('<fl:link url="<%=\"/population2entry_list_removed_ajax.fl?PpeRemoved=1&PpeAdded=0&PpePopID=\"+ (id != null ? id : \"\") +\"&PopType=\"+ popType %>"/>&targetDiv=RemovedPopulationEntryList'); } function refreshActiveTab() { if (PopulationTabs_selectedSTab == 0) { refreshSynthesis(); } else if (PopulationTabs_selectedSTab == 1) { refreshPopulationEntry(); } else if (PopulationTabs_selectedSTab == 2) { refreshAddedPopulationEntry(); } else if (PopulationTabs_selectedSTab == 3) { refreshRemovedPopulationEntry(); } } function doRemove(ppeID, del) { <%-- Case 1 : remove an entry not previously manually added. --%> var elementId='popentry_'+ppeID; var elementToRemove=document.getElementById(elementId); <%-- Case 2 : remove an entry previously manually added, it's ID is something like popentryadded_... : after the getAjaxCallBackDeleteForElement callback, it's IDs will be changed to popentryremoved_, so the element that must be updated is the one those ID will become popentryremoved_... after this method. --%> var elementId2='popentryadded_'+ppeID; var elementToRemove2=document.getElementById(elementId2); if (del) { doAjax('<fl:link url="/delete_object_ajax.fl?type=PopulationEntry" />&id=' + ppeID, removeExcReturn); } else { doAjax('<fl:link url="/save_object_ajax_with_report.fl?type=PopulationEntry&PpeRemoved=true&PpeAdded=false&$$presentFields=PpeRemoved" />&id=' + ppeID, getAjaxCallBackDeleteForElement(elementToRemove, elementToRemove2)); } } function getAjaxCallBackDeleteForElement(jsElement, jsElement2) { var fn=function(arrIndex) { if(eDealXmlhttpArr[arrIndex].readyState == 4) { hideWaiting(); rtrn = eDealXmlhttpArr[arrIndex].responseText; chrtrn=trimStr(rtrn); if (chrtrn == '') { //pas d'erreur //Changer la classe de l'élément TR //utilise jsElement et jsElement2; if (jsElement) { jsElement.style.backgroundColor="#C0C0C0" } // do not do else if here : we want to update both elements. if (jsElement2) { jsElement2.style.backgroundColor="#C0C0C0" } } else { //voir global_js.jsp result = eval('(' + rtrn + ')'); alert('<fl:getMessage code="L604E" alt="Une erreur est survenue " js="true"/>'+' '+displayError(result)); } } } return fn; } function removeExcReturn(arrIndex) { if(eDealXmlhttpArr[arrIndex].readyState == 4) { var rtrn = trimStr(eDealXmlhttpArr[arrIndex].responseText); if (rtrn == '') { refreshActiveTab(); } else { eval(rtrn); } } } function doAdd(ppeID) { var elementId='popentryremoved_'+ppeID; var elementToAdd=document.getElementById(elementId); doAjax('<fl:link url="/save_object_ajax.fl?type=PopulationEntry&PpeRemoved=false&PpeAdded=true&$$presentFields=PpeRemoved" />&id=' + ppeID, getAjaxCallBackAddForElement(elementToAdd)); } function getAjaxCallBackAddForElement(jsElement) { var fn=function(arrIndex) { if(eDealXmlhttpArr[arrIndex].readyState == 4) { hideWaiting(); rtrn = eDealXmlhttpArr[arrIndex].responseText; chrtrn=trimStr(rtrn); if (chrtrn == '') { //pas d'erreur //Changer la classe de l'élément TR //utilise jsElement; jsElement.style.backgroundColor="#C0C0C0" } else { //voir global_js.jsp result = eval('(' + rtrn + ')'); alert('<fl:getMessage code="L604E" alt="Une erreur est survenue " js="true"/>'+' '+displayError(result)); } } } return fn; } function addExcReturn(arrIndex) { if(eDealXmlhttpArr[arrIndex].readyState == 4) { var rtrn = trimStr(eDealXmlhttpArr[arrIndex].responseText); if (rtrn == '') { refreshActiveTab(); } else { eval(rtrn); } } } function doSubmit() { return true; } function isAutoDel(){ var f = document.forms[0]; if (f.PopAutoDelete.checked) { f.PopAutoDel.value = "true"; } else { f.PopAutoDel.value= "false"; } } // If the objects of the population have changed, // we have to force the recreation of the PopDisplay field function removePopDisplay() { document.forms[0].PopDisplay.value = ''; } function refreshTestPop() { var f = document.forms[0]; var checkboxValue = f.EmailingTestPopChekbox.checked; if (checkboxValue == true) { f.PopGenType.value = '<%= emailingPopTypeId %>'; } else { f.PopGenType.value = '<%= manualPopTypeId %>'; } } </script> <fl:form action="/save_populationv2.fl" bean="Population"> <input type="hidden" name="PopDisplay" value="<fl:getProperty name="Population" property="PopDisplay" alt=""/>"> <input type="hidden" name="PopType" id="PopType" value="<fl:getProperty name="Population" property="PopType" alt=""/>"/> <input type="hidden" name="PopGenType" value="<%= populationGenTypeId %>" > <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"F000C\", false, true, \"Population\") %>" ou="<%= \"/edit_populationv2.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <table class="container" cellpadding="0"> <tr> <td colspan="<%= isEditType ? "5" : "3" %>"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="labelTitreFiche"> <fl:label field="PopName" labelClassName="titreFiche"/> </td> <td class="fieldTitreFiche"> <fl:input property="PopName" mandatoryMsgCode="M60A2"/> </td> </tr> </table> </td> </tr> <tr><td colspan="<%= isEditType ? "5" : "3" %>" class="ligne_separation"/></tr> <tr> <td class="column<%= isEditType ? "3" : "2" %>"> <table class="container" cellpadding="0"> <fl:fieldEdit column3="true" property="PopAutoDel" onclick="isAutoDel()"/> <tr> <td id="EmailingTestPopChekbox_label" class="dataLabel"> <fl:label code="L8272" forInput="EmailingTestPopChekbox" label="Population de tests pour e-mailing"/> </td> <td> <% if(populationGenTypeId != null && emailingPopTypeId != null && populationGenTypeId.equals(emailingPopTypeId)){ %> <input type="checkbox" name="EmailingTestPopChekbox" onchange="refreshTestPop()" checked="checked"/> <%} else { %> <input type="checkbox" name="EmailingTestPopChekbox" onchange="refreshTestPop()"/> <%} %> </td> </tr> <fl:fieldEdit property="PopParentPopID"/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column<%= isEditType ? "3" : "2" %>"> <table class="container" cellpadding="0"> <% if (isEditType) { %> <fl:fieldRead property="PopIsPer" valueCodeIfFalse="L2006" valueCodeIfTrue="L2005"/> <fl:fieldRead property="PopIsEnt" valueCodeIfFalse="L2006" valueCodeIfTrue="L2005"/> <fl:fieldRead property="PopIsSil" valueCodeIfFalse="L2006" valueCodeIfTrue="L2005"/> <fl:fieldRead property="PopIsJou" valueCodeIfFalse="L2006" valueCodeIfTrue="L2005"/> <fl:fieldRead property="PopIsSup" valueCodeIfFalse="L2006" valueCodeIfTrue="L2005"/> <% } else { %> <tr><td> </td></tr> <% } %> </table> </td> <% if (isEditType) { %> <td class="separation"><div class="separation"></div></td> <td class="column<%= isEditType ? "3" : "2" %>"> <table class="container" cellpadding="0"> <fl:fieldRead property="PopObj1" bean="true"/> <fl:fieldRead property="PopObj2" bean="true"/> <fl:fieldRead property="PopObj3" bean="true"/> <fl:fieldRead property="PopObj4" bean="true"/> <fl:fieldRead property="PopObj5" bean="true"/> </table> </td> <% } %> </tr> <tr><td colspan="<%= isEditType ? "5" : "3" %>" class="ligne_separation"/></tr> </table> <% if (id != null) { %> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript" src="<fl:webapp/>/js/smalltabs.jsp"></script> <fl:smallTabs name="PopulationTabs"> <fl:sTab id="QUANTITATIF" title="<%= Utils.getMessage(session, \"L6382\", \"Synthèse\") %>" onselect="refreshSynthesis();"> <div style="text-align: center;width: 100%"> <table class="container" cellpadding="1" style="width:50%" align="center"> <tr> <td colspan="1" class="headerDataGrid" style="width: 100%; text-align: center;" nowrap><span id="PopTotNbr"><fl:getProperty name="Population" property="PopTotNbr" alt="0" format="int"/></span> <fl:getMessage code="F617E" alt="Entrée(s)"/></td> </tr> <tr style="vertical-align: top"> <td class="tabSimpleFdBleu dataValue" style="white-space: nowrap;"> <table class="container" cellpadding="0"> <% try { if (Population.isPopIsEnt()) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopEntNbr"> <fl:getProperty name="Population" property="PopEntNbr" alt=" " format="int"/> </td> <td class="dataValue" style="width: 99%; white-space: nowrap;"><fl:getMessage code="F0033" alt="Entreprise(s)"/></td> </tr> <% } } catch (FieldNotInitializedException fnie) { } try { if (Population.isPopIsPer()) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopPerNbr"> <fl:getProperty name="Population" property="PopPerNbr" alt="0" format="int"/> </td> <td class="dataValue" style="width: 99%; white-space: nowrap;"><fl:getMessage code="F0034" alt="Personne(s)"/></td> </tr> <% } } catch (FieldNotInitializedException fnie) { } try { if (Population.isPopIsSil()) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopSilNbr"> <fl:getProperty name="Population" property="PopSilNbr" alt="0" format="int"/> </td> <td class="dataValue" style="width: 99%; white-space: nowrap;"><fl:getMessage code="F0035" alt="Silhouette(s)"/></td> </tr> <% } } catch (FieldNotInitializedException fnie) { } try { if (Population.isPopIsSup()) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopSupNbr"> <fl:getProperty name="Population" property="PopSupNbr" alt="0" format="int"/> </td> <td class="dataValue" style="width: auto; white-space: nowrap;"><fl:getMessage code="F0037" alt="Support(s)"/></td> </tr> <% } } catch (FieldNotInitializedException fnie) { } try { if (Population.isPopIsJou()) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopJouNbr"> <fl:getProperty name="Population" property="PopJouNbr" alt="0" format="int"/> </td> <td class="dataValue" style="width: auto; white-space: nowrap;"><fl:getMessage code="F0038" alt="Journaliste(s)"/></td> </tr> <% } } catch (FieldNotInitializedException fnie) { } if (hasFob1 ) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopObj1"> <fl:getProperty name="Population" property="PopFob1Nbr" alt=" "/> </td> <td class="dataValue" style="width: auto; white-space: nowrap;"> <fl:getProperty name="Population" property="PopObj1" alt=" " bean="true"/>(s) </td> </tr> <% } %> <% if (hasFob2) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopObj2"> <fl:getProperty name="Population" property="PopFob2Nbr" alt=" "/> </td> <td class="dataValue" style="width: auto; white-space: nowrap;"><fl:getProperty name="Population" property="PopObj2" alt=" " bean="true"/>(s) </td> </tr> <% } %> <% if (hasFob3) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopObj3"> <fl:getProperty name="Population" property="PopFob3Nbr" alt=" "/> </td> <td class="dataValue" style="width: auto; white-space: nowrap;"><fl:getProperty name="Population" property="PopObj3" alt=" " bean="true"/>(s) </td> </tr> <% } %> <% if (hasFob4) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopObj4"> <fl:getProperty name="Population" property="PopFob4Nbr" alt=" "/> </td> <td class="dataValue" style="width: auto; white-space: nowrap;"><fl:getProperty name="Population" property="PopObj4" alt=" " bean="true"/>(s) </td> </tr> <% } %> <% if (hasFob5) { %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopObj5"> <fl:getProperty name="Population" property="PopFob5Nbr" alt=" "/> </td> <td class="dataValue" style="width: auto; white-space: nowrap;"><fl:getProperty name="Population" property="PopObj5" alt=" " bean="true"/>(s) </td> </tr> <% } %> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopAddNbr"> <fl:getProperty name="Population" property="PopAddNbr" alt="0" format="int"/> </td> <td class="dataValue" style="width: 99%;" nowrap><fl:getMessage code="F0039" alt="Contacts rajoutés manuellement"/></td> </tr> <tr> <td class="dataValue" style="text-align: right; width: 1%; white-space: nowrap;" id="PopRmvNbr"> <fl:getProperty name="Population" property="PopRmvNbr" alt="0" format="int"/> </td> <td class="dataValue" style="width: 99%;" nowrap><fl:getMessage code="F003A" alt="Contacts retirés manuellement"/></td> </tr> </table> </td> </tr> </table> </div> </fl:sTab> <fl:sTab id="BELONG" title="<%= Utils.getMessage(session, \"L002B\", \"Appartiennent à la cible\") %>" onselect="refreshPopulationEntry();"> <div id="PopulationEntryList"> <table cellpadding="0" style="width: 100%;"> <tr> <td> </td> </tr> </table> </div> </fl:sTab> <fl:sTab id="ADDED" title="<%= Utils.getMessage(session, \"A3072\", \"Ont été ajoutés manuellement\") %>" onselect="refreshAddedPopulationEntry();"> <div id="AddedPopulationEntryList"> <table cellpadding="0" style="width: 100%;"> <tr> <td> </td> </tr> </table> </div> </fl:sTab> <fl:sTab id="REMOVED" title="<%= Utils.getMessage(session, \"L002C\", \"Ont été retirés de la cible\") %>" onselect="refreshRemovedPopulationEntry();"> <div id="RemovedPopulationEntryList"> <table cellpadding="0" style="width: 100%;"> <tr> <td> </td> </tr> </table> </div> </fl:sTab> </fl:smallTabs > <% } %> </fl:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de