Edit C:\galaxie\Back\galaxie\marketing\selection2\popup.jsp
<% /****************************************************************************** * 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" import="com.edeal.frontline.*,java.util.*,com.edeal.frontline.custom.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@page import="com.edeal.frontline.navigation.WebUtils"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.Criteria2Bean" id="Criteria2" 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 operationID = dico.getRefIdByCode("Cr2Ope","exist"); // Selection Pattern ID String id = flRequest.getRequestParameterOrAttribute("id"); String type = flRequest.getRequestParameterOrAttribute("type"); boolean isMultival = false; boolean isControledByRef = false; boolean isControledByFob = false; boolean isMultipleValues = false; boolean isBoolean = false; boolean isDate = false; boolean isDecimal = false; boolean isInteger = false; boolean isNumeric = false; boolean isText = false; boolean isFirstLoad= true; boolean _date= false; Vector vectChx = new Vector(); Vector listPID = new Vector(); // for node agraggate clonning Vector listPAID = new Vector(); String[] fieldS = {"Cr2ID", "Cr2FobID", "Cr2FldID", "Cr2Ope", "Cr2TempName", "Cr2Chx"}; String[][] queryS = {{"Cr2Se2ID = "+Utils.formatToSQL(context, id), "Cr2Ope <> null", "Cr2Ope <> "+Utils.formatToSQL(context, operationID) , "Cr2Chx = null" }}; String[] fieldA={"Cr2ID", "Cr2TempName", "Cr2CardOpe", "Cr2Card"}; String[][] queryA={{"Cr2Se2ID = "+Utils.formatToSQL(context, id), "Cr2CardOpe <> null", "Cr2Card = null"}}; Vector listA = new Vector(); listA = Criteria2Bean.listSummary(session, fieldA, queryA); Vector list = new Vector(); list = Criteria2Bean.listSummary(session, fieldS, queryS); int h = list.size(); int m=listA.size(); boolean isVisible= false; if(h==0 && m==0) { isVisible = true; } String falseH ="0"; Selection2Bean selBean = null; try { selBean= new Selection2Bean(id,context); } catch(FrontlineException e){} catch(AccessDeniedException e){} String selName = null; try { selName = selBean.getSe2Name(); } catch (FieldNotInitializedException ex){} %> <html> <head> <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" href="<fl:webapp/>/css/master_css.jsp" type="text/css"> <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 language="javascript"> function doCancel() { window.close(); } var submitFlags = false; var count = '<%=h%>'; var mount ='<%=m%>'; function doSubmit() { if(!submitFlags) { submitFlags = true; var f = document.forms[0]; for (var l=0;l< parseInt(count);l++){ var choix= 'Cr2Chx'+l; var choixType= 'Cr2ChxType'+l; var label ='lblDate'+l; var time ='lblTime'+l var elt= document.getElementsByName(choix)[0]; var eltType = document.getElementsByName(choixType)[0]; if (eltType.value == 'DATE') { var eldate= document.getElementsByName(label)[0]; var eltime =document.getElementsByName(time)[0]; if(eldate != null){ if(!eldate.value) { window.alert('<fl:getMessage code="M6112" alt="Merci de remplir tous les champs" js="true"/>'); eldate.focus(); submitFlags = false; return; } else { if(!eltime.value) { eltime.value = '00:00'; } elt.value = eldate.value + ' ' + eltime.value; } } } else if (eltType.value == 'NUMERIC') { if(!elt.value) { window.alert('<fl:getMessage code="M6112" alt="Merci de remplir tous les champs" js="true"/>'); elt.focus(); submitFlags = false; return; } prepNumsForSubmit(separateurDecimal, separateurMilliers, elt); } else if (eltType.value == 'REF') { if(elt.selectedIndex < 0) { window.alert('<fl:getMessage code="M6112" alt="Merci de remplir tous les champs" js="true"/>'); submitFlags = false; return; } } else if (eltType.value == 'FOB') { if(!elt.value) { window.alert('<fl:getMessage code="M6112" alt="Merci de remplir tous les champs" js="true"/>'); submitFlags = false; return; } } else { if(!elt.value) { window.alert('<fl:getMessage code="M6112" alt="Merci de remplir tous les champs" js="true"/>'); elt.focus(); submitFlags = false; return; } } } // fin for for (var l=0;l< parseInt(mount);l++) { var card= 'Cr2Card'+l; var elt= document.getElementsByName(card)[0]; if(!elt.value) { window.alert('<fl:getMessage code="M6112" alt="Merci de remplir tous les champs" js="true"/>'); elt.focus(); submitFlags = false; return; } prepNumsForSubmit(separateurDecimal, separateurMilliers, elt); } <% if("2".equals(type)){%> f.action='<fl:link url="<%=\"/process.fl?type=0&id=\" + id%>"/>'; <% }else{ %> f.action='<fl:link url="<%=\"/process_questiontype.fl?type=0&id=\" + id + (selName == null ? \"\" : \"&SelName=\" + WebUtils.urlEncode(context, selName))%>"/>'; <% } %> f.submit(); } } function doTestOrGenerate(){ <%if (isVisible){%> <% if("2".equals(type)) {%> window.open('<fl:link url="<%= \"/test_selection2.fl?id=\" + id %>"/>', 'test<%= id %>', 'width=400,height=200,menubar=no,status=no,resizable=yes,toolbar=no,location=no'); window.close(); <%}else{%> window.resizeTo('500','220'); window.location ='<fl:link url="<%= \"/prepare_generate_population2.fl?id=\" + id + (selName == null ? \"\" : \"&SelName=\" + WebUtils.urlEncode(context, selName))%>"/>'; <%} } %> } </script> <body onload="doTestOrGenerate();"> <form method="post" action="" target="_self"> <input name="WhatNext" type="hidden" value="/load?typ=Selection2&op=edit<%= id == null ? "": "&id=" + id %>&disp=/marketing/selection2/main_body.jsp"> <input name="op" value="" type="hidden"> <input name="$$presentFields" type="hidden" value="Se2Code"> <div id="object_css" style="top: 0px; left: 0px; height: 100%; width: 100%;"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L30F7\", \"Test du ciblage\")%>" ignoreList="true" showFooter="false"> <table class="container" cellpadding="0" > <tr> <td colspan="3"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="titreFiche"> <fl:getProperty name="Selection2" property="Se2Name" alt="<%= Utils.getMessage(session, \"L60F1\", \"Ciblage\") %>"/> </td> </tr> </table> </td> </tr> <tr><td colspan="3" class="ligne_separation"/></tr> <tr valign="middle"> <td> <table class="container" cellpadding="0"> <% if (list != null && list.size() > 0) { %> <tr class="fieldline"> <td class="headerDataGrid"><fl:getMessage code="F6039" alt="Paramètre"/></td> <td class="headerDataGrid"><fl:getMessage code="L65BD" alt="Valeur(s) associée(s)"/></td> </tr> <% for (int i = 0; i < list.size(); i++) { FieldBean fld = null; String fldType = null; isMultival = false; isControledByRef = false; isControledByFob = false; isMultipleValues = false; isBoolean = false; isDate = false; isDecimal = false; isInteger = false; isNumeric = false; isText = false; Hashtable row1 = (Hashtable) list.elementAt(i); String Cr2ID = (String) row1.get("Cr2ID"); listPID.addElement(Cr2ID); String Label = (String) row1.get("Cr2TempName"); Label = Utils.getMessage(session, Label, Utils.getMessage(session, "L60E0", "<non spécifié>")); String op = (String) row1.get("Cr2Ope"); String field = (String) row1.get("Cr2FldID"); if(field != null) { fld = dico.getFieldByID(field); String opeDisp = (String)dico.getRefDisp(session, "Cr2Ope", op); try { fldType = dico.getRefCode("FldFltID", fld.getFldFltID()); } catch (FieldNotInitializedException ex) {}; try { isControledByRef = (fld.getFldTabID() != null); } catch (FieldNotInitializedException ex) {}; try { isControledByFob = (fld.getFldFobID() != null); } catch (FieldNotInitializedException ex) {}; if("BIT".equals(fldType)) { isBoolean = true; } else if("DATE".equals(fldType) || "TIME".equals(fldType) || "TIMESTAMP".equals(fldType)) { isDate = true; } else if("FLOAT|DOUBLE".equals(fldType) || "REAL".equals(fldType)) { isDecimal = true; isNumeric = true; } else if("INTEGER".equals(fldType) || "BIGINT".equals(fldType) || "SMALLINT".equals(fldType) || "DECIMAL|NUMERIC".equals(fldType) || "TINYINT".equals(fldType)) { isInteger = true; isNumeric = true; } else if("CHAR|VARCHAR|LONGVARCHAR|CLOB".equals(fldType)) { isText = true; } String opeID = dico.getRefIdByCode("Cr2Ope","in"); if(fld.isFldMultival()||op.equals(opeID)) { isMultipleValues = true; } %> <tr class="<%= i%2 == 0 ? "tabSimpleFdBleu" : "tabSimpleFdBlanc" %>"> <td class="dataValue" style="width:30%;"> <%=Label%><br> <% if(isControledByFob){ String fldFob = null; try { fldFob = fld.getFldFobID(); }catch (FieldNotInitializedException ex) {} ObjectsBean ctlFob = null; if (fldFob != null) { ctlFob = dico.getTable("id", fldFob); } if(fldFob != null && isMultipleValues){ %> <a href="javascript:var win = window.open('<fl:webapp/>/select_multiple.fl?type=<%= ctlFob.getObjSql() %>&field=Cr2Chx<%=i%>', 'Cr2Chx<%=i%>', 'menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes,width=520,height=560')"><img src="<fl:webapp/>/icons/ico/rechercher.gif" class="icon" alt="<fl:getMessage code="A305F" alt="Choisir une valeur"/>"></a> <a href="javascript:unselectMultiple('Cr2Chx<%=i%>')"><img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="<fl:getMessage code="A3005" alt="Vider le champ"/>"></a> <% } } %> </td> <td class="dataValue" style="width:70%;"> <% if(isControledByFob) { String fldFob = null; logger.warn("test fob"+i); try { fldFob = fld.getFldFobID(); }catch (FieldNotInitializedException ex) {} ObjectsBean ctlFob = null; if (fldFob != null) { ctlFob = dico.getTable("id", fldFob); %> <table class="fieldTable" cellpadding="0" cellspacing="0"> <% if(isMultipleValues) { %> <tr valign="top"> <td class="principalText bigFieldPart"> <div class="fobLeftDiv"> <input name="Cr2Chx<%=i%>" type="hidden" value="<%= vectChx != null && !vectChx.isEmpty() ? Utils.formatToWeb(Utils.implodeList(vectChx, ";"), true) : "" %>"> <input name="evalCr2Chx<%=i%>" type="hidden" value=""> <input name="Cr2ChxType<%=i%>" type="hidden" value="FOB"> <select name="lblCr2Chx<%=i%>" multiple size="5" class="input selectMultiple" onfocus="eval(document.forms[0].evalCr2Chx<%=i%>.value); document.forms[0].evalCr2Chx<%=i%>.value = '';"> <% if(vectChx != null) { for(int j = 0; j < vectChx.size(); j++) { String strChx = (String)vectChx.elementAt(j); %> <option value="<%= Utils.formatToWeb(strChx, true) %>"><%= Utils.formatToWeb(ctlFob.toString(session, strChx), true) %></option> <% } } %> </select> </div> </td> </tr> <% } else { %> <tr valign="top"> <td class="principalText bigFieldPart"> <div class="fobLeftDiv"> <input name="Cr2Chx<%=i%>" type="hidden" value="<%= vectChx != null && !vectChx.isEmpty() ? Utils.formatToWeb((String)vectChx.firstElement(), true) : "" %>"> <input name="lblCr2Chx<%=i%>" type="text" class="input fob" value="<%= vectChx != null && !vectChx.isEmpty() ? Utils.formatToWeb(ctlFob.toString(session, (String)vectChx.firstElement()), true) : "" %>" readonly onfocus="this.blur();"> <input name="Cr2ChxType<%=i%>" type="hidden" value="FOB"> </div> </td> <td class="smallFieldPart"> <a href="javascript:var win = window.open('<fl:webapp/>/select.fl?type=<%= ctlFob.getObjSql() %>&field=Cr2Chx<%=i%>', 'Cr2Chx<%=i%>', 'menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes,width=520,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:void(window.document.forms[0].Cr2Chx<%=i%>.value = window.document.forms[0].lblCr2Chx<%=i%>.value = '')"><img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="<fl:getMessage code="A3005" alt="Vider le champ"/>"></a> </td> </tr> <% } %> </table> <% } } else if(isControledByRef) { Vector vectRef = dico.getRefList(session, fld.getFldSql()); %> <select name="Cr2Chx<%=i%>"<%= isMultipleValues ? " multiple size=\"5\"" : "" %> class="input selectMultiple"> <% for(int k = 0; k < vectRef.size(); k++) { Vector row = (Vector)vectRef.elementAt(k); %> <option value="<%= (String)row.elementAt(0) %>"<%= vectChx.contains(row.elementAt(0)) ? " selected" : "" %>><%= Utils.formatToWeb(row.elementAt(1), false) %></option> <% } %> </select> <input name="Cr2ChxType<%=i%>" type="hidden" value="REF"> <% } else if(isDate) { String strDate = ""; String strTime = ""; if(vectChx.size() > 0) { java.util.Date date = Utils.formatDateFromWeb(session, (String)vectChx.firstElement()); strDate = Utils.formatToWebDate(session, date, true); strTime = Utils.formatToWebTime(session, date, true).substring(0, 5); } %> <input name="lblDate<%=i%>" type="text" value="<%= strDate %>" size="10" maxlength="10" onBlur="ctrlDateField(this, '<fl:getMessage code="M200A" alt="Veuillez saisir une date correcte du type jj/mm/aaaa." js="true"/>');" class="input date"> <a href="JavaScript:openCalendar(document.forms[0].lblDate<%=i%>)" onMouseOver="window.status='<fl:getMessage code="A2000" alt="Afficher le calendrier" js="true"/>';return true;" onMouseOut="window.status=' '; return true"><img src="<fl:webapp/>/icons/ico/clock_neutre.gif" class="icon"></a> <input name="lblTime<%=i%>" type="text" value="<%= strTime %>" size="5" maxlength="5" onBlur="ctrlHourField(this, '<fl:getMessage code="M200C" alt="Veuillez saisir une heure correcte." js="true"/>');" class="input date"> <input name="Cr2Chx<%=i%>" type="hidden" value=""> <input name="Cr2ChxType<%=i%>" type="hidden" value="DATE"> <% } else if(isNumeric || isText) { %> <input name="Cr2Chx<%=i%>" type="text" value="<%= vectChx != null && !vectChx.isEmpty() ? Utils.formatToWeb((String)vectChx.firstElement(), true) : "" %>" size="40" class="<%=(isNumeric) ? "input number" : "input text" %>"<% if(isNumeric) { %> onBlur="ctrlNumField(this, '<%= isDecimal ? "float" : "integer" %>', '<fl:getMessage code="M001B" alt="La valeur saisie n\'est pas correcte." js="true"/>');"<% } %>> <% if (isNumeric) { %> <input name="Cr2ChxType<%=i%>" type="hidden" value="NUMERIC"> <% } else { %> <input name="Cr2ChxType<%=i%>" type="hidden" value="TEXT"> <% } %> <% if(isMultipleValues) { %> <br><span class="comment"><fl:getMessage code="L202E" alt="Séparer les valeurs multiples par des points virgules"/></span> <% } } else if(isBoolean) { %> <select name="Cr2Chx<%=i%>" class="input select"> <option value="1"><fl:getMessage code="L2005" alt="Oui"/></option> <option value="0"><fl:getMessage code="L2006" alt="Non"/></option> </select> <input name="Cr2ChxType<%=i%>" type="hidden" value="REF"> <% } %> </td> </tr> <% } // end if field }// end for session.setAttribute("listPID", listPID); }// end if if (listA != null && listA.size() > 0) { for (int i = 0; i < listA.size(); i++) { Hashtable row1 = (Hashtable) listA.elementAt(i); String Cr2ID = (String) row1.get("Cr2ID"); listPAID.addElement(Cr2ID); String Label = (String) row1.get("Cr2TempName"); Label = Utils.getMessage(session, Label, Utils.getMessage(session, "L60E0", "<non spécifié>")); %> <tr class="<%= i%2 == 0 ? "tabSimpleFdBleu" : "tabSimpleFdBlanc" %>"> <td class="dataValue" style="width:30%;"> <%=Label%> </td> <td class="dataValue" style="width:70%;"> <input name="Cr2Card<%=i%>" class="input number" type="text" size="40" value="" onBlur="ctrlNumField(this, 'integer', '<fl:getMessage code="M001B" alt="La valeur saisie n\'est pas correcte." js="true"/>');"> </td> </tr> <% } } session.setAttribute("listPAID", listPAID); %> </table> </td></tr></table> <br> </fl:bigTabs> <br><center> <a href="javascript:doSubmit();"><img src="<fl:webapp/>/icons/ico/valid_green_long.gif"></a> <a href="javascript:doCancel()"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif"></a> </center> </div> </form> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de