Edit C:\galaxie\Back\galaxie\admin\requester\prepare.jsp
<%@page import="com.edeal.frontline.helper.RequesterBaseHelper"%> <%@page import="com.edeal.frontline.navigation.WebUtils"%> <% /****************************************************************************** * 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"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.ActorBean" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.RequesterBean" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.RequesterBean" id="Requester" 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 = flRequest.getParameter("id"); } catch (Exception e) { } String reqTitle = null; String reqName = null; String reqRemarks = null; boolean isPopType = false; try { reqTitle = Requester.getReqTitle(); reqName = reqTitle;} catch (FieldNotInitializedException ex) {reqName="<non spécifié>";} try { reqRemarks = Requester.getReqRemarks(); } catch (FieldNotInitializedException ex) {} try { String idPopType = dico.getRefIdByCode("ReqTyrID","POPULATION"); String pReqType = Requester.getReqTyrID(); isPopType = pReqType!= null && idPopType != null && idPopType.equals(pReqType); } catch (FieldNotInitializedException e) { } Vector vectParams = Requester.getQueryParameters(); if (vectParams == null) { vectParams = new Vector(); } for(int i = 0; i < vectParams.size(); i++) { Hashtable row = (Hashtable)vectParams.elementAt(i); String reqLookUp = (String)row.get("lookup"); Hashtable lookUp = null; if(reqLookUp != null) { try { lookUp = RequesterBaseHelper.validateLookUp(context, reqLookUp); } catch (Exception ex) { } } if(lookUp != null) { row.put("lookup", lookUp); } vectParams.setElementAt(row, i); } %> <script language="javascript" src="<fl:webapp/>/js/utils.js"></script> <script language="javascript"> function doSubmit() { var f = document.forms[0]; f.submit(); //return true; } function afterSubmit() { flagSubmit = true; } function doTestPop() { var f = document.forms[0]; var param =''; <% for(int i = 0; i < vectParams.size(); i++) { Hashtable row = (Hashtable)vectParams.elementAt(i); String reqNum = (String)row.get("num"); %> if(f.Param<%=reqNum%>.value != null){ param +="&Param"+<%=reqNum%>+"="+ f.Param<%=reqNum%>.value; } <% }%> window.open('<%=flRequest.computeURL("/test_requester.fl")+ (id != null ? "&id="+id : "")%> '+ param , 'testReq<%= id %>', 'width=600,height=180'); } function doGeneratePopulation() { var f = document.forms[0]; var param =''; <% for(int i = 0; i < vectParams.size(); i++) { Hashtable row = (Hashtable)vectParams.elementAt(i); String reqNum = (String)row.get("num"); %> if(f.Param<%=reqNum%>.value != null){ param +="&Param"+<%=reqNum%>+"="+ f.Param<%=reqNum%>.value; } <% }%> window.open('<%=flRequest.computeURL("/req_prepare_generate_population2.fl")+ (id != null ? "&id="+id : "")+(reqName == null ? "" : "&reqName=" + WebUtils.urlEncode(context, reqName) )%>'+ param , 'GenerateReq<%= id %>', 'width=500,height=220,menubar=no,status=no,resizable=yes,toolbar=no,location=no'); } function doSetList(pFld) { var i = 0; var args = doSetList.arguments; var o = document.forms[0].elements[pFld].options; for(i = o.length - 1; i >= 0; i--) o[i] = null; o.length = 0; for(i = 1; i < args.length; i++) { o[i - 1] = new Option(args[i], ''); } } function doSelectTxt(pFld, pQuery, pMultiple) { var value = document.forms[0].elements[pFld].value; if(pMultiple) { window.open('<fl:webapp/>/text_select_multiple.fl?fld=' + pFld + '&query=' + pQuery, 'SelectTxt', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=400,height=550'); } else { window.open('<fl:webapp/>/text_select.fl?fld=' + pFld + '&query=' + pQuery, 'SelectTxt', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=400,height=380'); } } function doSelectFob(pFld, pQuery, pMultiple) { var value = document.forms[0].elements[pFld].value; if(pMultiple) { window.open('<fl:webapp/>/fob_select_multiple.fl?fld=' + encodeURIComponent(pFld) + '&query=' + encodeURIComponent(pQuery) + (value == '' ? '' : '&value=' + encodeURIComponent(value)), 'SelectFob', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=400,height=550'); } else { window.open('<fl:webapp/>/fob_select.fl?fld=' + encodeURIComponent(pFld) + '&query=' + encodeURIComponent(pQuery) + (value == '' ? '' : '&value=' + encodeURIComponent(value)), 'SelectFob', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=400,height=380'); } } function doRemoveFob(pFld, pMultiple) { if(pMultiple) { unselectMultiple(pFld); } else { var f = document.forms[0]; f.elements[pFld].value = ''; f.elements['lbl' + pFld].value = ''; } } function fillMvaSelect(fldName,strIDs,arrValues) { var f = document.forms[0]; if(f[fldName]) { <%-- alert("setting the value to "+fldName); --%> f[fldName].value = strIDs; } if(f[fldName] && f["lbl"+fldName]) { var lblField=f["lbl"+fldName]; <%-- alert("empty o lbl"+fldName); --%> var selectOptions=lblField.options; for (var cnt = 0; cnt <selectOptions.length; ++cnt) { <%-- alert("emtpty array for "+cnt); --%> selectOptions[cnt] = null; } <%-- alert("attempt to set values to lbl"); --%> for (var cnt2 = 0; cnt2 < arrValues.size(); ++cnt2) { <%-- alert("adding ["+cnt2+"]"+arrValues.elementAt(cnt2)); --%> opt=new Option(arrValues.elementAt(cnt2), strIDs.split(";")[cnt2]); <%-- alert("option built - array:"+selectOptions[cnt2]); --%> selectOptions[cnt2]=opt; <%-- alert("continue loop"); --%> } <%-- alert("end loop"); --%> } } </script> <fl:form action="/requester_execute.fl" target="_blank" bean="Requester" multivalSeparator=";"> <fl:bigTabs listTitle="<%= Utils.getMessage(session, \"L63CB\", false, true, \"Liste des requesters\") %>" objectTitle="<%= Utils.getMessage(session, \"L60E2\", \"Requester\") %>" ou="<%= \"/edit_requester.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <table class="container" cellpadding="0"> <tr> <td colspan="5" class="titreFiche"> <fl:getProperty name="Requester" property="ReqTitle" alt=""/> </td> </tr> </table> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie" colspan="3"><fl:getMessage code="L6070" alt="Paramètres"/></td> </tr> <tr class="ligne_separation_couleur"><td colspan="3"></td></tr> <tr class="ligne_separation"><td></td></tr> <% for(int i = 0; i < vectParams.size(); i++) { Hashtable row = (Hashtable)vectParams.elementAt(i); String reqNum = (String)row.get("num"); String reqParam = (String)row.get("name"); Hashtable lookUp = (Hashtable)row.get("lookup"); String reqType = row.get("type") == null ? "CHAR|VARCHAR|LONGVARCHAR|CLOB" : dico.getRefCode("ReqType1", (String)row.get("type")); %> <tr class="fieldline"> <td id="ReqParam<%= i %>_label" class="dataLabel"> <%= reqParam == null ? Utils.getMessage(session, "L60E0", "<non spécifié>") : Utils.getMessage(session, reqParam, Utils.getMessage(session, "L60E0", "<non spécifié>")) %> </td> <td id="ReqParam<%= i %>_value" class="dataValue"> <% if ("BIT".equals(reqType)) { %> <input name="Param<%= reqNum %>" type="radio" value="1" checked><fl:getMessage code="L60EA" alt="vrai"/> <input name="Param<%= reqNum %>" type="radio" value="0"><fl:getMessage code="L60EB" alt="faux"/> <% } else if (lookUp == null || lookUp.get("type") == null) { %> <input name="Param<%= reqNum %>" type="text" value="" size="60"> <% if (lookUp != null && "1".equals(lookUp.get("multival"))) { %> <br><span class="comment"><fl:getMessage code="L202E" alt="Séparer les valeurs multiples par des points virgules"/></span> <% } %> <% } else if ("TXT".equals((String)lookUp.get("type"))) { %> <input name="Param<%= reqNum %>" type="text" value="" size="60"> <a href="javascript:doSelectTxt('Param<%= reqNum %>', '<%= Utils.formatToJavascript((String)lookUp.get("fld")) %>'<%= "1".equals(lookUp.get("multival")) ? ", true" : "" %>)"><img src="<fl:webapp/>/icons/ico/rechercher.gif" alt="" width="15" height="15" border="0"></a> <% if ("1".equals(lookUp.get("multival"))) { %> <br><span class="comment"><fl:getMessage code="L202E" alt="Séparer les valeurs multiples par des points virgules"/></span> <% } } else if ("OBJ".equals((String)lookUp.get("type"))) { if("1".equals(lookUp.get("multival"))) { %> <select name="lblParam<%= reqNum %>" size="4" style="width: 30em"> </select> <input name="Param<%= reqNum %>" type="hidden" value=""> <a href="javascript:doSelectFob('Param<%= reqNum %>', '<%= Utils.formatToJavascript((String)lookUp.get("fld")) %>', true)"><img src="<fl:webapp/>/icons/ico/rechercher.gif" alt="" width="15" height="15" border="0"></a> <a href="javascript:doRemoveFob('Param<%= reqNum %>', true)"><img src="<fl:webapp/>/icons/ico/supprimer.gif" alt="" width="15" height="15" border="0"></a> <% } else { String objParamFieldName="Param"+reqNum; %> <input id="<%= objParamFieldName %>" name="<%= objParamFieldName %>" type="hidden" value=""> <input id="lbl<%= objParamFieldName %>" name="lbl<%= objParamFieldName %>" type="text" value="" size="60" autocomplete = "off" onfocus="displayOnFocus(lbl<%= objParamFieldName %>);acResizeDisplayDiv(lbl<%= objParamFieldName %>);" class="input fob"> </td> <td class="postText"> <a href="javascript:doSelectFob('<%=objParamFieldName%>','<%= Utils.formatToJavascript((String)lookUp.get("fld")) %>')"> <img src="<fl:webapp/>/icons/ico/rechercher.gif" class="icon" alt="Sélectionner" title="Sélectionner"></a> <a href="javascript:var f = window.document.forms[0];f.<%= objParamFieldName %>.value = f.lbl<%= objParamFieldName %>.value = ''; acLastCompleteValues['lbl<%= objParamFieldName %>'] = '';acLastCompleteValues['<%= objParamFieldName %>'] = ''; void('')"> <img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="Vider le champ" title="Vider le champ"></a> <% } } else if ("REF".equals((String)lookUp.get("type"))) { %> <select name="Param<%= reqNum %>"<%= "1".equals(lookUp.get("multival")) ? " size=\"4\" multiple" : "" %> > <% Vector vectRefList = (Vector)lookUp.get("refvalues"); for(int j = 0; j < vectRefList.size(); j++) { Vector vectRef = (Vector)vectRefList.elementAt(j); %> <option value="<%= Utils.formatToWeb((String)vectRef.elementAt(0), true) %>"><%= Utils.formatToWeb((String)vectRef.elementAt(1), false) %></option> <% } %> </select> <% } %> </td> </tr> <tr class="ligne_separation"><td></td></tr> <% } %> </table> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <fl:smallTabs name="RequesterTabs"> <fl:sTab id="Résultat" title="<%= Utils.getMessage(session, \"L200C\", \"Résultat\") %>"> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td style="vertical-align:top; width: 50%"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td id="format1_label" class="dataLabel"> <fl:getMessage code="F2054" alt="Format"/> </td> <td id="format1_value" class="dataValue"> <input name="format" type="radio" value="dlcsv"> <fl:getMessage code="L60E7" alt="télécharger au format CSV"/> </td> </tr> <tr class="fieldline"> <td id="format2_label" class="dataLabel"> </td> <td id="format2_value" class="dataValue"> <input name="format" type="radio" value="viewcsv"> <fl:getMessage code="L60E6" alt="voir au format CSV"/> </td> </tr> <tr class="fieldline"> <td id="format3_label" class="dataLabel"> </td> <td id="format3_value" class="dataValue"> <input name="format" type="radio" value="viewhtml" checked> <fl:getMessage code="L60E5" alt="voir au format HTML"/> </td> </tr> </table> </td> <td class="separation"><div class="separation"> </div></td> <td style="vertical-align:top; width: 50%"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td id="sepChoice_label" class="dataLabel"> <fl:getMessage code="L30D3" alt="Séparateur"/> </td> <td id="sepChoice_value" class="dataValue" nowrap> <input type="radio" name="sepChoice" value="SEMICOL" checked><fl:getMessage code="L30D5" alt="Point-virgule"/> <input type="radio" name="sepChoice" value="TAB"><fl:getMessage code="L30D4" alt="Tabulation"/> <input type="radio" name="sepChoice" value="OTHER"><fl:getMessage code="L6098" alt="Autre"/> : <input type="text" name="sepValue" value="" size="5"> </td> </tr> <tr class="fieldline"> <td id="delChoice_label" class="dataLabel"> <fl:getMessage code="L30D0" alt="Délimiteur"/> </td> <td id="delChoice_value" class="dataValue" nowrap> <input type="radio" name="delChoice" value="QUOTE" checked><fl:getMessage code="L30D2" alt="Guillemet"/> <input type="radio" name="delChoice" value="OTHER"><fl:getMessage code="L6098" alt="Autre"/> : <input type="text" name="delValue" value="" size="5"> </td> </tr> <tr class="fieldline"> <td id="headers_label" class="dataLabel"></td> <td id="headers_value" class="dataValue"> <input type="checkbox" name="headers" value="1"><fl:getMessage code="L60ED" alt="En-tête des colonnes"/> </td> </tr> </table> </td> </tr> </table> </fl:sTab> <fl:sTab id="Commentaires" title="<%= Utils.getMessage(session, \"L64B4\", \"Commentaires\") %>"> <table class="container" cellpadding="0"> <tr><td></td> <td class="dataValue" style="vertical-align:top; width: 50%"> <table class="container" cellpadding="0"> <fl:fieldRead property="ReqRemarks"/> </table> </td> </tr> </table> </fl:sTab> </fl:smallTabs> </fl:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de