Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\marketing\criteria2\template.jsp
<% /****************************************************************************** * Copyright (c) 2000-2004 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.navigation.FlRequest,com.edeal.frontline.*,com.edeal.frontline.custom.*,java.util.*"%> <%@ page import="java.awt.CardLayout" %> <%@ page import="java.text.DecimalFormat" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@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 lngID = FlLocale.getInstance(session).getLanguageID(); //si la langue dans fllocal est null alors français pas defaut if(lngID == null) { try { lngID = dico.getRefIdByCode("Lng", "Val", "fr_FR"); } catch (Exception ex) { } } //je recupére des param //id du ciblage en cours String Cr2Selection = null; try { Cr2Selection = Criteria2.getCr2Se2ID(); }catch (FieldNotInitializedException e){} Selection2Bean selection2Bean = null; try { selection2Bean = new Selection2Bean(Cr2Selection,session); }catch (AccessDeniedException e){} String id = null; //id du critére parent de la template : old idCr2 try { id = Criteria2.getID(); }catch (FieldNotInitializedException e){} boolean isEdit = id != null; String operationID = dico.getRefIdByCode("Cr2Ope","exist"); //c'est id de la condition type si je viens d'une condition type String idCond = null; //old idPattern try { idCond = Criteria2.getCr2Condition(); }catch (FieldNotInitializedException e){} String paramCFldID = "Condition|"+idCond; String paramObject = null; String paramObjectID = null; try { paramObjectID = Criteria2.getCr2FobID(); ObjectsBean objBean = new ObjectsBean(paramObjectID,context); paramObject = objBean.getObjSql(); }catch (FieldNotInitializedException e){} String paramGrpID = null; try { paramGrpID = Criteria2.getCr2ParentID(); }catch (FieldNotInitializedException e){} String paramAlias = null; try { paramAlias = Criteria2.getCr2Alias(); }catch (FieldNotInitializedException e){} String paramType="0"; // the template selection Selection2Bean Sel2Bean = new Selection2Bean(idCond, context); // retriving the root element String TemplateRoot = null; try { TemplateRoot = Sel2Bean.getSe2Cr2ID(); } catch (FieldNotInitializedException ex) {} boolean isblue = true; 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 listID = new Vector(); // for node agraggate clonning Vector listAID = new Vector(); //Ici on recupere la liste des critéres qui ne sont pas des noeuds d'agregat String[] fieldS = {"Cr2ID", "Cr2FobID", "Cr2FldID", "Cr2Ope", "Cr2TempName", "Cr2Chx", "Cr2IsTemplate"}; Vector list = new Vector(); if (isEdit) { String[][] querySEdit = {{"Cr2Se2ID = "+Utils.formatToSQL(context, Cr2Selection),"Cr2Se2IDold = "+Utils.formatToSQL(context,id),"Cr2CardOpe = null", "Cr2TempName <> null", "Cr2IsTemplate = 1"}}; list = Criteria2Bean.listSummary(session, fieldS, querySEdit); } else { String[][] queryS = {{"Cr2Se2ID = "+Utils.formatToSQL(context, idCond),"Cr2CardOpe = null", "Cr2TempName <> null", "Cr2IsTemplate = 1"}}; list = Criteria2Bean.listSummary(session, fieldS, queryS); } //Ici on recupere la liste des critéres qui sont des noeuds d'agregat String[] fieldA={"Cr2ID", "Cr2TempName", "Cr2CardOpe", "Cr2Card"}; Vector listA = new Vector(); if (isEdit) { String[][] queryAEdit={{"Cr2Se2ID = "+Utils.formatToSQL(context, Cr2Selection), "Cr2Se2IDold = "+Utils.formatToSQL(context,id), "Cr2CardOpe <> null", "Cr2TempName <> null", "Cr2IsTemplate = 1"}}; listA = Criteria2Bean.listSummary(session, fieldA, queryAEdit); } else { String[][] queryA={{"Cr2Se2ID = "+Utils.formatToSQL(context, idCond),"Cr2CardOpe <> null", "Cr2TempName <> null", "Cr2IsTemplate = 1"}}; listA = Criteria2Bean.listSummary(session, fieldA, queryA); } //on definit un boolean si la condition type contient au moins des critéres avec des trous boolean isVisible = true; int h = list.size(); int m = listA.size(); if (( h == 0 ) && (m == 0)) isVisible = false; //on les recupére de edit pour afficher la liste des objets dans template.. String SubGroup = null; boolean isSub = false; try { SubGroup = Criteria2.getCr2SubGroup(); isSub= SubGroup != null && !"null".equals(SubGroup); }catch (FieldNotInitializedException ex){} //on uilise le shéma xml pour recuperer la liste des objets à faire Vector VectObject = new Vector(); Vector VectObjectShadow = new Vector(); Vector objects = new Vector(); //ici on parse le xml est on construit la liste des objets String Model =null; try { Model = selection2Bean.getSe2Model(); } catch (FieldNotInitializedException ex) {} SelectionManager Selman= new SelectionManager(context,Model); Selman.parse(); SelectionManager.GroupNode groupNode = Selman.getResultGroup(); if(isSub){ SelectionManager.SubGroupNode subGR = Selman.getSubGroupById(SubGroup); objects = subGR.getVectObjects(); } else { objects = groupNode.getVectObjects(); } Vector subgroup = Selman.getResultSubGroup(); String label = null; try { label = Criteria2.getCr2TempName(); } catch (FieldNotInitializedException fnie) { } if (objects != null && objects.size()>0){ for (int i=0; i<objects.size();i++){ SelectionManager.ObjectNode Nodeobj = (SelectionManager.ObjectNode)objects.elementAt(i); boolean isVisibleObject = Nodeobj.isShowCriteria(); if(isVisibleObject){ String Name1 = Nodeobj.getName(); String objID = dico.getTable("sql",Name1).getID(); String Name = Nodeobj.getDisplayLabel(); String _Label = Utils.getMessage(session, Name, Name); String Alias = Nodeobj.getAlias(); VectObject.addElement(_Label); VectObjectShadow.addElement(objID + "|" + Alias + "|" + Name1); } } } if (subgroup != null && subgroup.size()>0){ for (int i=0; i<subgroup.size();i++){ SelectionManager.SubGroupNode Sub = (SelectionManager.SubGroupNode)subgroup.elementAt(i); if(!isSub){ String Name = Sub.getDisplayLabel(); String _Label_ = Utils.getMessage(session, Name, Name); VectObject.addElement("------------"); VectObjectShadow.addElement("----------"); VectObject.addElement(_Label_); String sbgroup = Sub.getID(); VectObjectShadow.addElement("Agraggate "+sbgroup+"|"+Name); } } } String fromTem="0"; String sfwID = flRequest.getParameter("SfwID"); %> <html> <head> <title>e-DEAL CRM</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 language="javascript" type="text/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="M2006" alt="Veuillez saisir une date." 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="M2007" alt="Veuillez saisir une valeur." 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="M2008" alt="Veuillez sélectionner au moins une valeur." js="true"/>'); submitFlags = false; return; } } else if (eltType.value == 'FOB') { if(!elt.value) { window.alert('<fl:getMessage code="M2009" alt="Veuillez spécifier une valeur." js="true"/>'); submitFlags = false; return; } } else { if(!elt.value) { window.alert('<fl:getMessage code="M2009" alt="Veuillez spécifier une valeur." 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="M2007" alt="Veuillez saisir une valeur." js="true"/>'); elt.focus(); submitFlags = false; return; } prepNumsForSubmit(separateurDecimal, separateurMilliers, elt); } obj = f.Object.options[f.Object.selectedIndex].value; var tab = obj.split('|'); var objectName =tab[2]; var objectAlias = tab[1]; var objID = tab[0]; f.Cr2Fob.value = objectName; f.Cr2FobID.value = objID; f.Cr2Alias.value = objectAlias; var url = '<%=flRequest.computeURL("/edit_selection2.fl?id=" + Cr2Selection + "&SfwID=" + sfwID)%>'; f.$$returnedHtmlHead.value = '<scr' + 'ipt type="text/javascript" language="javascript">window.opener.parent.location = "' + url + '";window.close();</scr' + 'ipt>'; f.action = '<fl:webapp/>/save_criteria2_tmp.fl?se2ID=<%= Cr2Selection %>&SfwID=<%= sfwID %>'; f.submit(); } } function doRefresh(){ var f = document.forms[0]; f.op.value = 'refresh' f.target ='_self'; obj = f.Object.options[f.Object.selectedIndex].value; fob = f.Object.options[f.Object.selectedIndex].text; var Agraggate= obj.substring(0,9); var label = obj.substring(10); doExitConf = false; if (Agraggate=="Agraggate"){ var vab = label.split('|'); var label = vab[1]; var sbgroup = vab[0]; f.action='<fl:webapp/>/refresh_agraggate.fl?label='+label+'&se2ID=<%= Cr2Selection%>&sbgroup='+sbgroup+'&Group=<%=paramGrpID%>&SfwID=<%= sfwID %>'; f.submit(); }else { var tab = obj.split('|'); var objectName =tab[2]; var objectAlias = tab[1]; var objID = tab[0]; f.Cr2Fob.value = objectName; f.Cr2FobID.value = objID; f.Cr2Alias.value = objectAlias; f.action='<fl:link url="<%=\"/refresh_criteria2.fl?notChangeTrou=1&SfwID=\" + sfwID %>"/>'; f.submit(); } } function doRefreshOp(){ var f = document.forms[0]; Cr2Field = f.Cr2FldID.options[f.Cr2FldID.selectedIndex].value; var cond = Cr2Field.substring(0,9); var id = Cr2Field.substring(10); f.Cr2Condition.value=id; if (cond=="Condition"){ f.action= '<fl:link url="<%=\"/refresh_template.fl?1=1&SfwID=\" + sfwID %>"/>'; f.submit(); }else { f.action='<fl:link url="<%=\"/refresh_criteria2.fl?notChangeTrou=1&SfwID=\" + sfwID %>"/>'; f.submit(); } } </script> </head> <body class="popup_body"> <fl:bigTabs ignoreList="true" objectTitle="<%= Utils.getMessage(session, \"L65AF\", false, true, \"Critère question type\") %>"> <fl:form action="" bean="Criteria2" multivalSeparator=";"> <% if (id != null) { %> <input name="id" type="hidden" value="<%= id %>"> <% } %> <input name="$$returnedHtmlHead" type="hidden" value=""> <input name="$$returnedHtmlBody" type="hidden" value="Closing..."> <input type="hidden" name="op" value="save"> <input type="hidden" name="$$whatNext" value=""> <input name="$$presentFields" type="hidden" value=""> <input type="hidden" name="lngID" value="<%= Utils.formatToWeb(lngID, true) %>"> <input type="hidden" name="listSize" value="<%= h %>"> <input type="hidden" name="listASize" value="<%= m %>"> <input type="hidden" name="TemplateRoot" value="<%= TemplateRoot %>"> <input name="Cr2Se2ID" type="hidden" value="<%= Cr2Selection %>"> <input name="Cr2ParentID" type="hidden" value="<%= paramGrpID %>"> <input name="Cr2Condition" type="hidden" value="<%= idCond %>"> <input name="Cr2Fob" type="hidden" value="<%= paramObject %>"> <input name="Cr2FobID" type="hidden" value="<%= paramObjectID %>"> <input name="Cr2Alias" type="hidden" value="<%= paramAlias %>"> <table class="container" cellpadding="0"> <tr> <td class="titreFiche"> <br></td> </tr> <tr class="ligne_separation"><td><br></td></tr> <tr class="fieldline"> <td class="column2"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><br></td> <td class="dataValue"> <select name="Object" onChange="doRefresh();"> <option></option> <% for (int i=0;i< VectObject.size();i++){ String object = (String) VectObject.elementAt(i); String objectshadow = (String)VectObjectShadow.elementAt(i); Vector vectFobAlias = Utils.explodeList(objectshadow,"|"); boolean objToSelect = false; if (vectFobAlias != null && vectFobAlias.size() > 2) { String fobName = (String) vectFobAlias.elementAt(2); objToSelect = fobName != null && fobName.equals(paramObject); } %> <option value="<%=objectshadow%>" <%= objToSelect ? " selected" : "" %>><%= object%></option> <% } %> </select> <br></td> </tr> </table> <br><td class="separation"><br></td> <td class="column2"> <table class="container" cellpadding="0"> <tr class="fieldline"> <% boolean IsAgraggate = false; if (paramObject !=null) { ObjectsBean objetBean =null; try{ objetBean = dico.getTable("sql",paramObject); } catch (FrontlineException ex) { IsAgraggate = true; } if (objetBean != null){ Vector vectFields = dico.getTableFields("sql", paramObject, true, false); Vector Champs = new Vector(); for (int i = 0; i < vectFields.size(); i++) { FieldBean fldBean = (FieldBean) vectFields.elementAt(i); String fldID = null; try { fldID = fldBean.getID(); } catch (FieldNotInitializedException ex) {} String fldSQL = null; try { fldSQL = fldBean.getFldSql(); } catch (FieldNotInitializedException ex) {} boolean horsCible = false; try { horsCible = fldBean.isFldCriteria(); } catch (FieldNotInitializedException ex) {} if (!horsCible) { String fldDisplay = null; try { fldDisplay = fldBean.getFldDisplay(); } catch (FieldNotInitializedException ex) { fldDisplay = ""; } try { fldDisplay = Utils.getMessage(session, fldBean .getFldDisplayLabel(), false, true, fldDisplay); } catch (FieldNotInitializedException fnie) { } if ("".equals(fldDisplay)){ fldDisplay = fldSQL; } String[] Fields = {fldID,fldDisplay}; Champs.addElement(Fields); } } String[] FieldsStat = {"","------------------------"}; // liste des conditions types Champs.addElement(FieldsStat); String condition="1"; String[] fieldCond = {"Se2ID", "Se2Name"}; String[][] queryCond = {{"Se2Condition = "+Utils.formatToSQL(context, condition), "Se2Model:SmdObjID = "+Utils.formatToSQL(context, paramObjectID)}}; Vector listCond = Selection2Bean.listSummary(session, fieldCond, queryCond); if (listCond != null && listCond.size() > 0) { for (int i = 0; i < listCond.size(); i++) { Hashtable row = (Hashtable) listCond.elementAt(i); String conditionID = (String) row.get("Se2ID"); String conditionName = (String) row.get("Se2Name"); String[] Fields= {"Condition|"+conditionID,conditionName}; Champs.addElement(Fields); } } %> <td class="dataLabel"><br></td> <td class="dataValue"> <select id="Cr2FldID" name="Cr2FldID" onChange="doRefreshOp();"> <option></option> <% for (int i=0;i< Champs.size();i++) { String [] field = (String []) Champs.elementAt(i); %> <option value="<%=field[0]%>" <%= field[0].equals(paramCFldID) ? " selected" : "" %> ><%=field[1]%></value> <% } %> </select> <br></td> <% }//fin de objBean }//fin de paramaObject %> </tr> </table> <br></td> </tr> </table> <br> <% if(isVisible) { %> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="headerDataGrid borderLineOne" style="padding-left:10px;"><fl:getMessage code="F6039" alt="Paramètre"/></td> <td class="headerDataGrid borderLineOne" style="padding-left:10px;" ><fl:getMessage code="L65BD" alt="Valeur(s) associée(s)"/></td> </tr> <% //on passe au noueds d'agregat 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"); int Cr2Card = -1; if(isEdit){ Number Card = (Number) row1.get("Cr2Card"); Cr2Card = Card.intValue(); } listAID.addElement(Cr2ID); String Label = (String) row1.get("Cr2TempName"); Label = Utils.getMessage(session, Label, Utils.getMessage(session, "L60E0", "<non spécifié>")); %> <tr class="<%= isblue ? "tabSimpleFdBleu" : "tabSimpleFdBlanc" %>"> <td nowrap style="width:30%;text-align : left;"> <input name="Cr2CardID<%= i%>" type="hidden" value="<%= Cr2ID %>"> <%= Label %> <br></td> <td style="padding-left:10px;padding-right:10px;width:70%; "> <input name="Cr2Card<%=i%>" type="text" size="40" <%if(isEdit) {%> value="<%=Cr2Card%>" <%}%> style="width: 100%;text-align: right" onBlur="ctrlNumField(this, 'integer', '<fl:getMessage code="M001B" alt="La valeur saisie n\'est pas correcte." js="true"/>');"> <br></td> </tr> <% isblue = !isblue; } } if (list != null && list.size() > 0) { 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"); if(isEdit){ vectChx =(Vector)row1.get("Cr2Chx"); } listID.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> <td class="dataValue borderLineOne" style="padding-left:10px;width:70%; "> <input type="hidden" name="Cr2ID<%= i%>" value="<%= Cr2ID%>"> <%= 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(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=500,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 borderLineOne" style="padding-left:10px;padding-right:10px;width:70%; "> <% if(isControledByFob) { String fldFob = null; try { fldFob = fld.getFldFobID(); }catch (FieldNotInitializedException ex) {} ObjectsBean ctlFob = null; if (fldFob != null) { ctlFob = dico.getTable("id", fldFob); %> <table border="0" cellpadding="1" cellspacing="0" width="100%"> <% if(isMultipleValues) { %> <tr valign="top" class="transparent"> <td width="100%"> <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 && !vectChx.isEmpty()) { StringTokenizer st = new StringTokenizer((String)vectChx.elementAt(0),";"); while (st.hasMoreTokens()) { String strChx = st.nextToken(); %> <option value="<%= Utils.formatToWeb(strChx, true) %>"><%= Utils.formatToWeb(ctlFob.toString(session, strChx), true) %></option> <% } } %> </select> </td> </tr> <% } else { %> <tr valign="middle" class="transparent"> <td width="90%"> <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) : "" %>" style="width: 100%" readonly onfocus="this.blur();"> <input name="Cr2ChxType<%=i%>" type="hidden" value="FOB"> </td> <td nowrap width="10%"> <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=500,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\"" : "" %>> <% 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" class="input date" 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"/>');"> <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" class="input date" value="<%= strTime %>" size="5" maxlength="5" onBlur="ctrlHourField(this, '<fl:getMessage code="M200C" alt="Veuillez saisir une heure correcte." js="true"/>');"> <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" style="<%= (isNumeric) ? "width:100%;text-align:right" : "width:100%;" %>"<% 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"></span> <% } } else if(isBoolean) { %> <input name="Cr2ChxType<%=i%>" type="hidden" value="REF"> <% } %> </tr> <% } isblue = !isblue; // end if field }// end for }// end if %> </table> <% } else { //fin de is visible %> <table class="container" width="100%"> <tr class="fieldline"> <td class="dataValue" style="text-align: center"> <fl:getMessage code="L65B7" alt="Cette question type ne nécessite pas la saisie de paramètre, vous pouvez valider directement."/> </td> </tr> </table> <% } %> </fl:form> </fl:bigTabs> <br> <br> <div> <table class="container" width="100%"> <tr class="fieldline"> <td colspan="2" style="text-align: center;"> <a href="javascript:doSubmit();"><img src="<fl:webapp/>/icons/ico/valid_green_long.gif" alt=""></a> <a href="javascript:doCancel()"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif" alt=""></a> </td> </tr> </table> </div> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de