Edit C:\Windows\install\galaxie_p01_01-10\marketing\populationv2\add_multiple.jsp
<%@ page language="java"%> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.AccessDeniedException" %> <%@ page import="com.edeal.frontline.PopulationEntryBean" %> <%@ page import="com.edeal.frontline.PopulationBean" %> <%@ page import="com.edeal.frontline.ObjectsBean" %> <%@ 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 popID = flRequest.getParameter("PopID"); String popType = flRequest.getParameter("PopType"); if (popType == null) { popType = "0"; } String multivalSeparator = flRequest.getParameter("multivalSeparator"); if (multivalSeparator == null || "".equals(multivalSeparator)) { multivalSeparator = "|"; } PopulationBean Popbean = new PopulationBean(popID,context); String paramObjectID = null; Vector paramObjectIDs = new Vector(); String paramObject = null; String paramobjsql = null; Vector VectObject = new Vector(); Vector VectObjectShadow = new Vector(); Vector VectPpeFld = new Vector(); Vector objects = new Vector(); ObjectsBean objetBean =null; String _Label_=null; boolean entPerforcedlink = false,supJouforcedlink=false,isent=false,isper=false,issup=false,isjou=false; //Recuperation des paramétres //recuperer la liste des objets à faire if (Popbean.isPopIsPer()){ isper=true; paramObject ="Person"; try { _Label_ = Utils.getMessage(session, paramObject, paramObject); paramObjectID= dico.getTable("sql",_Label_).getID(); //paramObjectID = Popbean.getPopObj1(); paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); }catch (FieldNotInitializedException e){} VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpePerID"); VectPpeFld.addElement("PpePerID"); } if (Popbean.isPopIsJou()){ isjou=true; paramObject ="Journalist"; try { _Label_ = Utils.getMessage(session, paramObject, paramObject); paramObjectID= dico.getTable("sql",_Label_).getID(); //paramObjectID = Popbean.getPopObj5(); paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); }catch (FieldNotInitializedException e){} VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeJouID"); VectPpeFld.addElement("PpeJouID"); } if (Popbean.isPopIsEnt()){ isent=true; paramObject ="Enterprise"; try { _Label_ = Utils.getMessage(session, paramObject, paramObject); paramObjectID= dico.getTable("sql",_Label_).getID(); //paramObjectID = Popbean.getPopObj2(); paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); }catch (FieldNotInitializedException e){} VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeEntID"); VectPpeFld.addElement("PpeEntID"); } if (Popbean.isPopIsSup()){ issup=true; paramObject ="Support"; try { _Label_ = Utils.getMessage(session, paramObject, paramObject); paramObjectID= dico.getTable("sql",_Label_).getID(); //paramObjectID = Popbean.getPopObj2(); paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); }catch (FieldNotInitializedException e){} VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeSupID"); VectPpeFld.addElement("PpeSupID"); } if (Popbean.isPopIsSil()){ paramObject ="Silhouette"; try { _Label_ = Utils.getMessage(session, paramObject, paramObject); paramObjectID= dico.getTable("sql",_Label_).getID(); //paramObjectID = Popbean.getPopObj3(); paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); }catch (FieldNotInitializedException e){} VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeSilID"); VectPpeFld.addElement("PpeSilID"); } try { paramObjectID = Popbean.getPopObj1(); if (paramObjectID != null){ paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeFob1"); VectPpeFld.addElement("PpeFob1"); } }catch (FieldNotInitializedException e){} try { paramObjectID = Popbean.getPopObj2(); if (paramObjectID != null){ paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeFob2"); VectPpeFld.addElement("PpeFob2"); } }catch (FieldNotInitializedException e){} try { paramObjectID = Popbean.getPopObj3(); if (paramObjectID != null){ paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeFob3"); VectPpeFld.addElement("PpeFob3"); } }catch (FieldNotInitializedException e){} try { paramObjectID = Popbean.getPopObj4(); if (paramObjectID != null){ paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeFob4"); VectPpeFld.addElement("PpeFob4"); } }catch (FieldNotInitializedException e){} try { paramObjectID = Popbean.getPopObj5(); if (paramObjectID != null){ paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql=(String)objBean.getObjSql(); paramObject = objBean.getObjDisplay(); logger.warn("dans le try catch le paramObject is " + paramObject); VectObject.addElement((String)paramObject); VectObjectShadow.addElement(paramobjsql+"|PpeFob5"); VectPpeFld.addElement("PpeFob5"); } }catch (FieldNotInitializedException e){} if(isent && isper) entPerforcedlink=true; if(issup && isjou) supJouforcedlink=true; // Hack to support the Per/Ent/Sil case boolean popIsSil = false; try { popIsSil = "1".equals(flRequest.getRequestParameterOrAttribute("PopIsSil")); } catch (Exception e) { } if (popIsSil) { entPerforcedlink = false; supJouforcedlink = false; paramObject = "Silhouette"; try { _Label_ = Utils.getMessage(session, paramObject, paramObject); paramObjectID = dico.getTable("sql",_Label_).getID(); paramObjectIDs.clear(); paramObjectIDs.addElement(paramObjectID); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramobjsql = objBean.getObjSql(); paramObject = objBean.getObjDisplay(); } catch (FieldNotInitializedException e) { } VectObject.clear(); VectObject.addElement(paramObject); VectObjectShadow.clear(); VectObjectShadow.addElement(paramobjsql+"|PpeSilID"); VectPpeFld.clear(); VectPpeFld.addElement("PpeSilID"); } %><html> <head> <link rel="stylesheet" type="text/css" href="<fl:link url="/sales/correspondent/select_css.jsp"/>"> <title><fl:getMessage code="L2025" alt="E-DEAL"/></title> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/common_css.jsp"> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/master_css.jsp"> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/master_js.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/checkFields.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/presentField.js"></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 type="text/javascript" language="javascript"> var vectID = new FlVector(); var vectDisp = new FlVector(); var vectType = new FlVector(); function doCancel() { window.top.close(); } function isChecked(){ var f = document.forms[0]; <%if (entPerforcedlink){%> if (f.ForcedEntPerlink.checked){ f.ForEntPerlink.value = true; }else{ f.ForEntPerlink.value= false; } <% }%> <%if (supJouforcedlink){%> if (f.ForcedSupJoulink.checked){ f.ForSupJoulink.value = true; }else{ f.ForSupJoulink.value = false; } <%}%> } function validate() { var f = document.forms[0]; <% if (entPerforcedlink){ %> if (f.ForEntPerlink.value == "true") alert("Forcer le lien person/enterprise"); <% } if (supJouforcedlink){ %> if(f.ForSupJoulink.value == "true") alert("Forcer le lien Journaliste/Support"); <% } Vector vtemp=new Vector(); if (VectObjectShadow!= null&& !VectObjectShadow.isEmpty()){ vtemp = Utils.explodeList((String)VectObjectShadow.elementAt(0),"|"); %> if (f.<%=vtemp.lastElement()%>.value==''){ if (window.confirm("Veuillez saisir au moins le premier champs")) return; }else{ <% for (int i=1 ; i< VectObjectShadow.size()+1 ; i++){ Vector v1 = Utils.explodeList((String)VectObjectShadow.elementAt(i-1),"|"); %> if (f.<%=v1.lastElement()%>.value=='') id = 'NULL'; else id = f.<%=v1.lastElement()%>.value; <% if (popType.length() == 1) { %> vectID.removeElementAt(0); vectID.addElement(id); <% } else { %> vectID.addElement(id); <% } } %> var url = '<fl:webapp/><%= "/add_populationentryV2_valid.fl?PopID=" + popID + "&PopType=" + popType %>&ids=' + vectID.toString('<%= multivalSeparator %>') + '&fields=<%= VectPpeFld %>&multivalSeparator=' + encodeURIComponent('<%= multivalSeparator %>'); doAjax(url, doAddEntryCallback); } <%}%> } function doAddEntryCallback(arrIndex) { if (eDealXmlhttpArr[arrIndex].readyState == 4) { if (eDealXmlhttpArr[arrIndex].responseText == '') { if (window.opener.refreshActiveTab) { window.opener.refreshActiveTab(); } window.self.close(); } else { eval(eDealXmlhttpArr[arrIndex].responseText); hideWaiting(); } } } function doSelect(type,field){ var f = document.forms[0]; <% if (entPerforcedlink){%> if (f.ForEntPerlink.value == "true") var w = window.open('<fl:webapp/><%="/add_populationentry.fl?PopType=" + popType +"&PopID=" + popID %>', 'AddPopulationEntry<%= popID %>', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=780,height=600,screenX=50,screenY=10'); else window.open('<fl:webapp/>/select.fl?type='+type+'&field='+field, 'ValChx', 'menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes,width=800,height=400'); <%}else{%> window.open('<fl:webapp/>/select.fl?type='+type+'&field='+field, 'ValChx', 'menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes,width=800,height=400'); <%}%> } function doVoid(p) { return; } </script> <style type="text/css"> form { display: inline; } search_button { width: 74px; height: 17px; margin-left: 10px; border: none; vertical-align: middle; background: transparent; } .dataValue { width: auto; overflow: hidden; margin: 0px; margin: 1px 0px 1px 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: top; } </style> </head> <body style="overflow: auto; height: 100%;" class="popup_body"> <div id="object_css" style="top:0px;left: 0px;right:0px;height:100%;"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"A000F\", false, true, \"Ajouter\") %>" ignoreList="true"> <form action="" method="post"> <input name="PopID" type="hidden" value="<%=popID %>"> <input name="$$presentFields" type="hidden" value=""> <input name="$$multivalSeparator" type="hidden" value=";"> <input name="type" type="hidden" value=""> <table class="container" cellpadding="0"> <tr class="fieldline"> <% String fin = null; String classe=""; if (VectObjectShadow!= null&& !VectObjectShadow.isEmpty()){ if (VectObjectShadow.size()/3 >= 1){ classe ="column3"; }else if(VectObjectShadow.size()/2 >= 1){ classe ="column2"; }else classe=""; if (entPerforcedlink){ %> <td class="column3"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><div><LABEL title="<fl:getMessage code="F6180" alt="Garder le lien personne/entreprise"/>"> <fl:getMessage code="F6180" alt="Garder le lien personne/entreprise"/></LABEL></div></td> <td class="dataValue"> <input type="hidden" name="ForEntPerlink" id="ForEntPerlink" value="false"/> <input name="ForcedEntPerlink" type="checkbox" onclick="isChecked();"> </td> </tr> </table> </td> <% } if(supJouforcedlink){ %> <td class="column3"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><div><LABEL title="<fl:getMessage code="F6180" alt="Garder le lien personne/entreprise"/>"><fl:getMessage code="F6180" alt="Garder le lien personne/entreprise"/></LABEL></div></td> <td class="dataValue"> <input type="hidden" name="ForSupJoulink" id="ForSupJoulink" value="false"/> <input name="ForcedSupJoulink" type="checkbox" onclick="isChecked();"> </td> </tr> </table> </td> </tr> <tr class="fieldline"> <% } if(entPerforcedlink) { %> </tr> <tr class="fieldline"> <% } for (int i=1 ; i< VectObjectShadow.size()+1 ; i++){ Vector v1 = Utils.explodeList((String)VectObjectShadow.elementAt(i-1),"|"); %> <td <%if (!classe.equals("")){ %>class="<%=classe %>" <%} %>> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><div><%=v1.firstElement() %></div></td> <td class="dataValue"> <div class="fieldTable" > <table class="fieldTable" cellpadding="0"> <tr> <td class="principalText"> <div> <div style="width:70%;" class="fobLeftDiv"> <input name="<%=v1.lastElement() %>" type="hidden" value=""> <input name="<%="lbl"+v1.lastElement() %>" type="text" value="" style="width:100%" readonly onfocus="this.blur();"> </div> <div style="width:30%;" class="fobRightDiv"> <input name="type" type="hidden" value="<%=v1.firstElement() %>"> <a href="javascript:var win = window.open('<fl:webapp/>/select.fl?type=<%= v1.firstElement() %>&field=<%=v1.lastElement() %>', 'ValChx', 'menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes,width=800,height=400')"> <img src="<fl:webapp/>/icons/ico/rechercher.gif" class="icon" alt="<fl:getMessage code="A305F" alt="Choisir une valeur"/>"></a> <a href="javascript:doVoid(window.document.forms[0].<%=v1.lastElement() %>.value = window.document.forms[0].<%="lbl"+v1.lastElement() %>.value = '')"> <img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="<fl:getMessage code="A3005" alt="Vider le champ"/>"></a> </div> </div> </td> </tr> </table> </div> </td> </tr> </table> </td> <% if ((i%3)==0){ fin=""; %> </tr> <tr class="fieldline"> <% }else{ fin="</tr>"; } } }else{ fin="</tr>"; %> <fl:getMessage code="M6108" alt="Veuillez spécifier au moins un objet"/> <% } %> <%=fin%> </table> </form> </fl:bigTabs> <br> <table class="container" width="100%"> <tr class="fieldline"> <td colspan="2" style="text-align: center;"> <%if (VectObjectShadow!= null&& !VectObjectShadow.isEmpty()){ %> <a href="javascript:validate();"><img src="<fl:webapp/>/icons/ico/valid_green_long.gif" border="0" alt="<fl:getMessage code="A2001" alt="Valider"/>" title="<fl:getMessage code="A2001" alt="Valider"/>"></a> <%} %> <a href="javascript:doCancel()"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif" border="0" alt="<fl:getMessage code="L61B1" alt="Fermer la fenêtre"/>" title="<fl:getMessage code="L61B1" alt="Fermer la fenêtre"/>"></a> </td> </tr> </table> </div> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de