Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\admin\referential\edit_refvalues.jsp
<% /****************************************************************************** * 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" contentType="text/html; charset=UTF-8"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Vector" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.TablesBean" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="java.lang.reflect.Method" %> <%@ page import="com.edeal.frontline.RefValuesBean" %> <%@ page import="java.lang.reflect.InvocationTargetException" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.RefValuesBean" id="RefValues" 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 = RefValues.getID(); } catch (FieldNotInitializedException fnie) { } String tabID = flRequest.getRequestParameterOrAttribute("tabID"); boolean isCreate = id == null; String[] fields = {"TabT1", "TabT2", "TabT3", "TabN1", "TabN2", "TabN3", "TabD1", "TabD2", "TabD3"}; String[] refFields = {"RefTe1", "RefTe2", "RefTe3", "RefNu1", "RefNu2", "RefNu3", "RefDa1", "RefDa2", "RefDa3"}; String[] refLocaleFields = {"RelTe1", "RelTe2", "RelTe3"}; Hashtable cols = TablesBean.getColumnLabels(context, tabID); Vector vLanguages = dico.getRefList(session, "Lna", "Te1"); Vector vLngID = new Vector(); Vector vLngDisplay = new Vector(); if (vLanguages != null) { for (int i = 0; i < vLanguages.size(); i++) { Vector row = (Vector)vLanguages.elementAt(i); vLngID.addElement(row.elementAt(0)); vLngDisplay.addElement(row.elementAt(1)); } } try { Hashtable translations = RefValues.getTranslations(); %> <html> <head> <title></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/presentField.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/checkFields.jsp"></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 type = "0"; function doSubmit() { return true; } function create() { var f = document.forms[0]; f.$$returnedHtmlHead.value = '<scr' + 'ipt language="javascript" type="text/javascript">window.opener.refreshList();self.close();</scr'+ 'ipt>'; submit(); } function createAndContinue() { var head = document.getElementById("$$returnedHtmlHead"); var parent = head.parentNode; parent.removeChild(head); var body = document.getElementById("$$returnedHtmlBody"); parent = body.parentNode; parent.removeChild(body); submit(); } </script> </head> <body> <div id="object_css" style="top:0px; left:0px; height:100%; overflow: auto; width: 100%;"> <fl:form action="/save_refvalues.fl" bean="RefValues"> <input name="RefTabID" type="hidden" value="<%= tabID %>"> <input name="tabID" type="hidden" value="<%= tabID %>"> <input name="nb_lngID" type="hidden" value="<%= vLngID.size() %>"> <input id="$$returnedHtmlHead" name="$$returnedHtmlHead" type="hidden" value=""> <input id="$$returnedHtmlBody" name="$$returnedHtmlBody" type="hidden" value="Closing..."> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L6427\", false, true, \"Valeur de référence\") %>" ou="<%= \"/edit_refvalue.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <table class="container" cellpadding="0"> <tr> <td class="titreFiche"> <% if (isCreate) { %> <fl:getMessage code="L6428" alt="Création d\'une valeur de référence"/> <% } else { %> <fl:getMessage code="L6429" alt="Edition d\'une valeur de référence"/> <% } %> </td> </tr> <tr class="ligne_separation"> <td></td> </tr> <tr> <td> <div class="edealGrid"><div id="grid-data" class="data"> <table class="container" cellpadding="1" > <thead><tr> <% int nbCols = 0; for (int i = 0; i < fields.length; i++) { if (cols.get(fields[i]) != null) { nbCols++; } } boolean hasTooManyCols = (nbCols > 5); String width = (100/(nbCols + 4)) + "%"; %> <th style="width: 1%;"> </td> <th style="width: 5%;"><fl:getMessage code="F2000" alt="Code"/></th> <% for (int i = 0; i < fields.length; i++) { if (cols.get(fields[i]) != null) { %> <th style="width: <%=width%>"><%= Utils.formatToWeb((String)cols.get(fields[i]), false) %></th> <% } } %> <th style="width: 1%;" nowrap><fl:getMessage code="L601A" alt="Numéro d'ordre"/></th> <th style="width: 1%;"><fl:getMessage code="L601B" alt="Désactivée"/></th> </tr></thead> <tbody><tr class="even bean"> <td nowrap><fl:getMessage code="L207A" alt="Par défaut"/></td> <td><div class="input"><fl:input property="RefVal" mandatoryMsgCode="L6144" nodiv="true"/></div></td> <% for (int i = 0; i < fields.length; i++) { if (cols.get(fields[i]) != null) { try { String methodStr = "get" + refFields[i]; Method meth; Object value; String dispValue = ""; meth = RefValuesBean.class.getMethod(methodStr, null); try { if (refFields[i].indexOf("Nu") > 0) { value = (Number) meth.invoke(RefValues, null); dispValue = Utils.formatToWeb(value,false); } else if (refFields[i].indexOf("Da") > 0) { value = (Date) meth.invoke(RefValues, null); dispValue = Utils.formatToWebDate((Date) value,false); } else { value = (String) meth.invoke(RefValues, null); dispValue = Utils.formatToWeb(value,false); } } catch (InvocationTargetException e) { if (e.getTargetException() instanceof FieldNotInitializedException) { value = ""; } else { throw e.getTargetException(); } } %> <td nowrap style="text-align: <%= fields[i].startsWith("RefN") || fields[i].startsWith("RefD") ? "right" : "left" %>;"> <div class="input"><fl:input property="<%= refFields[i] %>" format="<%= (refFields[i].indexOf(\"Da\") > 0)? \"date\" : \"\" %>" nodiv="true"/></div> </td> <% } catch (Exception e) { logger.error("[edit_refvalues.jsp] - Error getting field: " + refFields[i] + " - " + e.toString()); } } } %> <td style="text-align: right;"><div class="input"><fl:input property="RefPos" nodiv="true"/></div></td> <td style="text-align: center"><fl:input nodiv="true" property="RefEnd"/></td> </tr> <% if (vLngID != null) { for (int i = 0; i < vLngID.size(); i++) { String lngID = (String)vLngID.elementAt(i); String lngDisplay = (String)vLngDisplay.elementAt(i); Hashtable row = (Hashtable)translations.get(lngID); if (row == null) { row = new Hashtable(); } %> <tr class="<%= (i%2 == 0) ? "odd" : "even"%> bean"> <td> <%= Utils.formatToWeb(lngDisplay, false) %> <input type="hidden" name="<%= i %>_RelID" value="<%= Utils.formatToWeb((String)row.get("RelID"), true) %>"> <input type="hidden" name="<%= i %>_RelLngID" value="<%= Utils.formatToWeb(lngID, true) %>"> </td> <td> </td> <% for (int j = 0; j < fields.length; j++) { if (cols.get(fields[j]) != null) { if (j < refLocaleFields.length) { String currRel = (String)row.get(refLocaleFields[j]); %> <td> <% if(!hasTooManyCols) { %> <div class="input"> <% } %> <input name="<%= i %>_<%= refLocaleFields[j] %>" maxlength="250" value="<%= Utils.formatToWeb(currRel, true) %>" class="input text"/> <% if(!hasTooManyCols) { %> </div> <% } %> </td> <% } else { %> <td> </td> <% } } } %> <td> </td> <td> </td> </tr> <% } } %> </tbody></table> </div></div> </td> </tr> </table> </fl:bigTabs> </fl:form> <div style="width: 100%;text-align: center;"> <a href="javascript:create()" title="<fl:getMessage code="A2001" alt="Valider"/>"><img src="<fl:link url="/icons/ico/valid_green_long.gif"/>"></a> <% if (isCreate) { %> <a href="javascript:createAndContinue()" title="<fl:getMessage code="A3069" alt="Valider et nouveau"/>"><img src="<fl:link url="/icons/ico/save_all_long.gif"/>"></a> <% } %> <a href="javascript:window.top.close();" title="<fl:getMessage code="A2002" alt="Annuler"/>"><img src="<fl:link url="/icons/ico/fermer_red_long.gif"/>" class="cancel_button"></a> </div> </div> <fl:title name="RefValues"/> </body> </html> <% } catch (Exception e) { logger.error("Exception: " + e.toString()); } %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de