Edit C:\galaxie\Back\galaxie\admin\referential\reflist.jsp
<%@page import="com.edeal.frontline.AccessControlManager"%><% /****************************************************************************** * 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="java.util.Vector" %> <%@ page import="java.util.Hashtable" %> <%@ page import="java.text.DecimalFormat" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.GregorianCalendar" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="com.edeal.frontline.helper.custom.*" %> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.TablesBean" id="Tables" 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(); Vector columnNames = new Vector(); Vector columnSQLNames = new Vector(); columnSQLNames.addElement("RefID"); columnNames.addElement(Utils.getMessage(session, "F2000", "Code")); columnSQLNames.addElement("RefVal"); try { String colName = Tables.getTabT1(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefTe1"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabT2(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefTe2"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabT3(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefTe3"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabN1(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefNu1"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabN2(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefNu2"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabN3(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefNu3"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabD1(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefDa1"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabD2(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefDa2"); } } catch (FieldNotInitializedException fnie) { } try { String colName = Tables.getTabD3(); if (colName != null) { columnNames.addElement(colName); columnSQLNames.addElement("RefDa3"); } } catch (FieldNotInitializedException fnie) { } columnNames.addElement(Utils.getMessage(session, "L601A", "Numéro d\'ordre")); columnSQLNames.addElement("RefPos"); columnNames.addElement(Utils.getMessage(session, "L601B", "Désactivée")); columnSQLNames.addElement("RefEnd"); Vector values = Tables.getRefValuesData(); DecimalFormat floatFormat = FlLocale.getInstance(session).getDecimalFormat("#,##0.00;- #,##0.00"); RefValuesBean rvb = new RefValuesBean(context); rvb.setSession(session); %> <table class="container" cellpadding="0"> <tbody> <tr> <td colspan="3"> </td> </tr> <tr> <td class="column2" style="vertical-align:top;"> <table class="data_column" cellpadding="0" style="text-align: left;"> <fl:fieldRead property="TabName"/> </table> </td> <td class="separation"><div class="separation"> </div></td> <td class="column2" style="vertical-align:top;"> <table class="data_column" cellpadding="0" style="text-align: left;"> <fl:fieldRead property="TabRadical"/> </table> </td> </tr> <tr> <td colspan="3"> </td> </tr> </tbody> </table> <div class="edealGrid"> <div id="grid-data" class="data"> <table cellpadding="0" style="width: 100%;"> <thead> <tr> <th> </th> <% Date exTemps = new Date(0); GregorianCalendar initCal = FlLocale.getInstance(session).getCalendar(); initCal.setTime(exTemps); for(int i = 0; i < columnNames.size(); i++) { %> <th nowrap="nowrap"><%= (String)columnNames.elementAt(i) %></th> <% } %> </tr> </thead> <tbody> <% boolean colorBlue = true; boolean canDel = false; boolean canEdit = false; ActorBean actor=ActorHelper.getSessionActor(session); for(int i = 0; i < values.size(); i++) { Hashtable row = (Hashtable)values.elementAt(i); String refID = (String)row.get("RefID"); colorBlue = !colorBlue; //if (canDel == null) { canDel = rvb.enforceAccess(AccessControlManager.DELETE, refID,actor); //} //if (canEdit == null) { canEdit = rvb.enforceAccess(AccessControlManager.EDIT, refID, actor); //} %> <tr class="<%= colorBlue ? "odd bean" : "even bean" %>"> <td style="width: 1%;" nowrap="nowrap"> <a href="javascript:editRefValues('<%= refID %>', <%= canEdit %>)"><img src="<fl:webapp/>/icons/ico/rechercher.gif"></a> <a href="javascript:deleteRefValues('<%= refID %>', <%= canDel %>)"><img src="<fl:webapp/>/icons/ico/supprimer.gif"></a> </td> <% int width = 100 / columnSQLNames.size(); for(int j = 1; j < columnSQLNames.size() - 1; j++) { String colName = (String)columnSQLNames.elementAt(j); Object col = row.get(colName); boolean isNumeric = (col != null) && ("RefNu1".equals(colName) ||"RefNu2".equals(colName) ||"RefNu3".equals(colName) || "RefPos".equals(colName)); boolean isDate = (col != null) && ("RefDa1".equals(colName) ||"RefDa2".equals(colName) ||"RefDa3".equals(colName)); boolean isRefPos = (col != null) && ("RefPos".equals(colName)); %> <td style="<%= (isNumeric || isDate) ? "text-align: right;" : "" %><%= (isRefPos) ? "width:1%;" : "" %>"> <% if (col != null && ("RefNu1".equals(colName) ||"RefNu2".equals(colName) ||"RefNu3".equals(colName))) { %> <%= floatFormat.format((Number)row.get((String)columnSQLNames.elementAt(j))) %> <% } else if (col != null &&("RefDa1".equals(colName) ||"RefDa2".equals(colName) ||"RefDa3".equals(colName))) { //voir si le resultat est une date ou une heure, se baser sur la date Date currDate = (Date) col; GregorianCalendar currCal = FlLocale.getInstance(session).getCalendar(); currCal.setTime(currDate); boolean isJanuaryFirstOf1970 = false; if (currCal.get(GregorianCalendar.YEAR) == initCal.get(GregorianCalendar.YEAR)) { if (currCal.get(GregorianCalendar.MONTH) == initCal.get(GregorianCalendar.MONTH)) { if (currCal.get(GregorianCalendar.DAY_OF_YEAR) == initCal.get(GregorianCalendar.DAY_OF_YEAR)) { isJanuaryFirstOf1970 = true; } } } if (currDate != null && isJanuaryFirstOf1970) { %> <%= Utils.formatToWebTime(session, (Date) col, false) %> <% } else { %> <%= Utils.formatToWebDate(session, (Date) col, false) %> <% } } else { %> <%= Utils.formatToWeb(col, false) %> <% } %> </td> <% } Object isActivated = row.get("RefEnd"); %> <td style="text-align: center; width: 1%;"> <% if (isActivated != null && ((Boolean)isActivated).booleanValue()) { %> <img src="<fl:webapp/>/icons/ico/close.gif" alt="<fl:getMessage code="L601B" alt="Désactivée"/>" title="<fl:getMessage code="L601B" alt="Désactivée"/>"> <% } else { %> <% } %> </td> </tr> <% } %> </tbody> </table>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de