Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\admin\history\embedded_list.jsp
<!-- DEPRECATED REPLACED BY history.jsp in the same folder --> <%/****************************************************************************** * 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 pageEncoding="UTF-8" session="true" import="com.edeal.frontline.*,java.util.*,java.io.*"%> <%@ page import="com.edeal.frontline.HistoryBean" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="java.util.Date" %> <%@ page import="java.text.SimpleDateFormat" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); String contextPath = (String) session.getAttribute("contextPath"); FlContext context = null; if (contextPath!=null) { context = Frontline.getContext(contextPath); } else { context = Frontline.getContext(request.getContextPath()); } DataDictionary dico = context.getDataDictionary(); String id = Utils.getRequestParameter(context, request, "id"); int nb = 0; String strNb = Utils.getRequestParameter(context, request, "nb"); if (strNb != null && !"".equals(strNb)) { try { nb = Integer.parseInt(strNb); } catch (NumberFormatException nfe) { } } //boolean isPopup = Utils.getRequestParameter(context, request, "popup") != null; String[] objFields = {"HisID", "HisDate", "HisActID", "HisPerID", "HisJouID", "HisSilID", "HisActID:ActFstName", "HisActID:ActName", "HisPerID:PerFstName", "HisPerID:PerName", "HisPerID:PerEntID", "HisPerID:PerEntID:EntCorpName", "HisJouID:JouFstName", "HisJouID:JouName", "HisSilID:SilFstName", "HisSilID:SilName", "HisCrDt"}; String[][] objQuery = {{"HisType = " + HistoryBean.OBJECT_UPDATE_LOG, "HisObjectID = " + Utils.formatToSQL(context, id)}}; String[] objOrderBy = {"HisDate DESC"}; Vector objList = HistoryBean.listSummary(context, objFields, objQuery, objOrderBy, 0, nb); //if (isPopup) { %> <html> <head> <title><fl:getMessage code="L6555" alt="Historique"/></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"> <% //} //if (!isPopup) { %> <style type="text/css"> .dataValueX { width: 30%; overflow: hidden; margin: 0px; padding: 0px; padding-left: 10px; font-size: small; font-size: expression("x-small"); color: rgb(0, 0, 0); font-family: Arial, Verdana, sans-serif; vertical-align: top; padding: 4px; } .borderLineOne { //border-right: 1px dashed #9EC6D0; border-bottom: 1px dashed #9EC6D0; } .borderLineTwo { border-right: 1px dashed #9EC6D0; } .borderLineTree { border-left: 1px dashed #9EC6D0; } .borderLineRight { border-right: 1px dashed #9EC6D0; } </style> <script language="javascript"> function viewActor(id,type){ window.opener.location = "<fl:webapp/>/read_"+type+".fl?id="+id; window.close(); } //function viewHistory(){ <%--window.open('<fl:webapp/>/admin/history/embedded_list.jsp?popup=1<%= id != null ? "&id=" + id : "" %>', 'listHisto','menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=860,height=500');--%> //} </script> <% //} //if (isPopup) { %> </head> <body> <div id="object_css" style="top: 0px; left: 0px; bottom: 0px; height: 100%;"> <fl:bigTabs ignoreList="true" objectTitle="<%=Utils.getMessage(session, \"L6555\", false, true, \"Historique\")%>"> <% //} if (objList != null && !objList.isEmpty()) { StringBuffer parents = new StringBuffer(); for (int i = 0; i < objList.size(); i++) { Hashtable row = (Hashtable)objList.elementAt(i); if (parents.length() > 0) { parents.append(", "); } parents.append(Utils.formatToSQL(context, (String)row.get("HisID"))); } String[] fldFields = {"HisName", "HisDataType", "HisParentID", "HisOldTextValue", "HisNewTextValue", "HisOldFobValue", "HisNewFobValue", "HisOldRefValue", "HisNewRefValue", "HisOldLongTextValue", "HisNewLongTextValue", "HisOldDateTimeValue", "HisNewDateTimeValue", "HisOldIntValue", "HisNewIntValue", "HisOldFloatValue", "HisNewFloatValue", "HisOldMvaTextValue", "HisNewMvaTextValue", "HisOldMvaDateTimeValue", "HisNewMvaDateTimeValue", "HisOldMvaIntValue", "HisNewMvaIntValue", "HisOldMvaFloatValue", "HisNewMvaFloatValue", "HisCrDt" }; String[][] fldQuery = {{"HisType = " + HistoryBean.FIELD_UPDATE_LOG, "HisParentID in (" + parents.toString() + ")", "HisObjectID = " + Utils.formatToSQL(context, id)}}; String[] fldOrderBy = {"HisName"}; Vector fldList = HistoryBean.listSummary(context, fldFields, fldQuery, fldOrderBy); Hashtable fieldModifications = new Hashtable(); if (fldList != null) { for (int i = 0; i < fldList.size(); i++) { Hashtable row = (Hashtable)fldList.elementAt(i); String parentID = (String)row.get("HisParentID"); if (parentID != null) { Vector v = (Vector)fieldModifications.get(parentID); if (v == null) { v = new Vector(); fieldModifications.put(parentID, v); } v.addElement(row); } } } %><table cellspacing="3" cellpadding="3" border="0" width="95%" align="center"> <% for (int i = 0; i < objList.size(); i++) { Hashtable row = (Hashtable)objList.elementAt(i); String hisID = (String)row.get("HisID"); Date date = (Date)row.get("HisDate"); String actID = (String)row.get("HisActID"); String actFstName = (String)row.get("HisActID:ActFstName"); String actName = (String)row.get("HisActID:ActName"); String perID = (String)row.get("HisPerID"); String perFstName = (String)row.get("HisPerID:PerFstName"); String perName = (String)row.get("HisPerID:PerName"); String entID = (String)row.get("HisPerID:PerEntID"); String entCorpName = (String)row.get("HisPerID:PerEntID:EntCorpName"); String jouID = (String)row.get("HisJouID"); String jouFstName = (String)row.get("HisJouID:JouFstName"); String jouName = (String)row.get("HisJouID:JouName"); String silID = (String)row.get("HisSilID"); String silFstName = (String)row.get("HisSilID:SilFstName"); String silName = (String)row.get("HisSilID:SilName"); String modifierID = null; String modifierName = null; String modifierType = null; String modifierGroupID = null; String modifierGroupName = null; String modifierGroupType = null; Date dateCrDt = (Date)row.get("HisCrDt"); if (perID != null) { modifierID = perID; modifierType = "person"; modifierGroupName = "enterprise"; modifierName = (perFstName != null ? perFstName + " " : "") + (perName != null ? perName : ""); modifierGroupID = entID; modifierGroupName = entCorpName; } else if (jouID != null) { modifierID = jouID; modifierType = "journalist"; modifierName = (jouFstName != null ? jouFstName + " " : "") + (jouName != null ? jouName : ""); } else if (silID != null) { modifierID = silID; modifierType = "silhouette"; modifierName = (silFstName != null ? silFstName + " " : "") + (silName != null ? silName : ""); } else { modifierID = actID; modifierType = "actor"; modifierName = (actFstName != null ? actFstName + " " : "") + (actName != null ? actName : ""); } boolean isActorSpecial=false; if ("actor".equals(modifierType)) { isActorSpecial=context.getSystemID().equals(modifierID) || context.getAnonymousID().equals(modifierID); } HistoryBean his = new HistoryBean(hisID, context); %> <tr valign="top"> <td colspan="5" class="dataValueX tabSimpleFdBleuImportant" nowrap> <fl:getMessage code="L0043" alt="le"/> <%= Utils.formatToWeb(date, false) %> <fl:getMessage code="L617E" alt="par"/> <% if (isActorSpecial) { %> <%= Utils.formatToWeb(modifierName, false) %> <% } else { %> <a href="javascript:viewActor('<%= modifierID %>','<%= modifierType %>');"><%= Utils.formatToWeb(modifierName, false) %></a> <% } %> <% if (modifierGroupID != null) { if (isActorSpecial) { %> <%= Utils.formatToWeb(modifierGroupName, false) %> <% } else { %> <a href="javascript:viewActor('<%= modifierGroupID %>','<%= modifierGroupType %>');"> <%= Utils.formatToWeb(modifierGroupName, false) %> </a> <% } } %> </td> </tr> <% Vector fields = (Vector)fieldModifications.get(hisID); if (fields != null) { for (int j = 0; j < fields.size(); j++) { Hashtable modif = (Hashtable)fields.elementAt(j); String name = (String) modif.get("HisName"); String type = (String)modif.get("HisDataType"); FieldBean field = dico.getFieldByName(name); String fieldName = null; try { //fieldName = Utils.getMessage(session, field.getFldDisplayLabel(), ""); // is doing silently a format to web, so when we format to web again in the lines below, there can be a problem. fieldName = Utils.getMessage(session, field.getFldDisplayLabel(), false, true, ""); } catch (FieldNotInitializedException fnie) { } if (fieldName == null || "".equals(fieldName)) { try { fieldName = Utils.formatToWeb(field.getFldDisplay(), false); } catch (FieldNotInitializedException fnie) { } } if (fieldName == null || "".equals(fieldName)) { fieldName = Utils.formatToWeb(name, false); } String oldValue = null; String newValue = null; if (field.isFldMultival()) { if (field.isFob() || field.isRef() || field.isString()) { Vector oldValues = (Vector)modif.get("HisOldMvaTextValue"); Vector newValues = (Vector)modif.get("HisNewMvaTextValue"); if (oldValues != null) { Vector v = new Vector(); for (Iterator iter = oldValues.iterator(); iter.hasNext();) { String element = (String)iter.next(); if (element != null) { if (field.isRef()) { v.addElement(dico.getRefDisp(session, name, element)); } else if (field.isFob()) { ObjectsBean fobBean = dico.getTable("id", field.getFldFobID()); String fob = fobBean.toString(session, element); if (fob == null || "".equals(fob)) { fob = "--?--"; } v.addElement(fob); } else { v.addElement(element); } } } StringBuffer buf = new StringBuffer(); for (Iterator iter = v.iterator(); iter.hasNext();) { String element = (String)iter.next(); if (buf.length() > 0) { buf.append("\n"); } buf.append(element); } oldValue = buf.toString(); } if (newValues != null) { Vector v = new Vector(); for (Iterator iter = newValues.iterator(); iter.hasNext();) { String element = (String)iter.next(); if (element != null) { if (field.isRef()) { v.addElement(dico.getRefDisp(session, name, element)); } else if (field.isFob()) { ObjectsBean fobBean = dico.getTable("id", field.getFldFobID()); String fob = fobBean.toString(session, element); if (fob == null || "".equals(fob)) { fob = "--?--"; } v.addElement(fob); } else { v.addElement(element); } } } StringBuffer buf = new StringBuffer(); for (Iterator iter = v.iterator(); iter.hasNext();) { String element = (String)iter.next(); if (buf.length() > 0) { buf.append("\n"); } buf.append(element); } newValue = buf.toString(); } } else if (field.isBoolean()) { Vector oldValues = (Vector)modif.get("HisOldMvaIntValue"); if (oldValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = oldValues.iterator(); iter.hasNext();) { Number element = (Number)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } if (element.intValue() == 1) { buf.append(Utils.getMessage(session, "L2005", "Oui")); } else { buf.append(Utils.getMessage(session, "L2006", "Non")); } } } oldValue = buf.toString(); } Vector newValues = (Vector)modif.get("HisNewMvaIntValue"); if (newValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = newValues.iterator(); iter.hasNext();) { Number element = (Number)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } if (element.intValue() == 1) { buf.append(Utils.getMessage(session, "L2005", "Oui")); } else { buf.append(Utils.getMessage(session, "L2006", "Non")); } } } newValue = buf.toString(); } } else if (field.isInteger() || field.isByte() || field.isLong() || field.isShort()) { Vector oldValues = (Vector)modif.get("HisOldMvaIntValue"); if (oldValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = oldValues.iterator(); iter.hasNext();) { Number element = (Number)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } buf.append(FlLocale.getInstance(session).getDecimalFormat("#,###").format(element.longValue())); } } oldValue = buf.toString(); } Vector newValues = (Vector)modif.get("HisNewMvaIntValue"); if (newValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = newValues.iterator(); iter.hasNext();) { Number element = (Number)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } buf.append(FlLocale.getInstance(session).getDecimalFormat("#,###").format(element.longValue())); } } newValue = buf.toString(); } } else if (field.isFloat() || field.isDouble()) { Vector oldValues = (Vector)modif.get("HisOldMvaFloatValue"); if (oldValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = oldValues.iterator(); iter.hasNext();) { Number element = (Number)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } buf.append(FlLocale.getInstance(session).getDecimalFormat().format(element.doubleValue())); } } oldValue = buf.toString(); } Vector newValues = (Vector)modif.get("HisNewMvaFloatValue"); if (newValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = newValues.iterator(); iter.hasNext();) { Number element = (Number)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } buf.append(FlLocale.getInstance(session).getDecimalFormat().format(element.doubleValue())); } } newValue = buf.toString(); } } else if (field.isDate() || field.isDateTime() || field.isTime()) { SimpleDateFormat sdf = FlLocale.getInstance(session).getDateTimeFormat(); if (field.isTime()) { sdf = FlLocale.getInstance(session).getTimeFormat(); }else if(field.isDateTime()){ sdf = FlLocale.getInstance(session).getDateTimeFormat(); }else if (field.isDate()) { sdf = FlLocale.getInstance(session).getDateFormat(); } Vector oldValues = (Vector)modif.get("HisOldMvaDateTimeValue"); if (oldValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = oldValues.iterator(); iter.hasNext();) { Date element = (Date)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } if (element != null) { buf.append(sdf.format(element)); } } } oldValue = buf.toString(); } Vector newValues = (Vector)modif.get("HisNewMvaDateTimeValue"); if (newValues != null) { Vector v = new Vector(); StringBuffer buf = new StringBuffer(); for (Iterator iter = newValues.iterator(); iter.hasNext();) { Date element = (Date)iter.next(); if (element != null) { if (buf.length() > 0) { buf.append("\n"); } buf.append(sdf.format(element)); } } newValue = buf.toString(); } } } else { if (field.isRef()) { Object objOldValue = modif.get("HisOldRefValue"); if (objOldValue != null) { objOldValue = dico.getRefDisp(session, name, objOldValue.toString()); } Object objNewValue = modif.get("HisNewRefValue"); if (objNewValue != null) { objNewValue = dico.getRefDisp(session, name, objNewValue.toString()); } oldValue=(objOldValue==null)?"":objOldValue.toString(); newValue=(objNewValue==null)?"":objNewValue.toString(); } else if (field.isFob()) { try { ObjectsBean fobBean = dico.getTable("id", field.getFldFobID()); oldValue = (String)modif.get("HisOldFobValue"); if (oldValue != null) { oldValue = fobBean.toString(session, oldValue); if (oldValue == null || "".equals(oldValue)) { oldValue = "--?--"; } } newValue = (String)modif.get("HisNewFobValue"); if (newValue != null) { newValue = fobBean.toString(session, newValue); if (newValue == null || "".equals(newValue)) { newValue = "--?--"; } } } catch (FieldNotInitializedException fnie) { } } else if (field.isString()) { oldValue = (String)modif.get("HisOldTextValue"); newValue = (String)modif.get("HisNewTextValue"); if (oldValue == null && newValue == null) { oldValue = (String)modif.get("HisOldLongTextValue"); newValue = (String)modif.get("HisNewLongTextValue"); } } else if (field.isBoolean()) { Number nOldValue = (Number)modif.get("HisOldIntValue"); if (nOldValue != null) { if (nOldValue.intValue() == 1) { oldValue = Utils.getMessage(session, "L2005", "Oui"); } else { oldValue = Utils.getMessage(session, "L2006", "Non"); } } Number nNewValue = (Number)modif.get("HisNewIntValue"); if (nNewValue != null) { if (nNewValue.intValue() == 1) { newValue = Utils.getMessage(session, "L2005", "Oui"); } else { newValue = Utils.getMessage(session, "L2006", "Non"); } } } else if (field.isInteger() || field.isByte() || field.isLong() || field.isShort()) { Number nOldValue = (Number)modif.get("HisOldIntValue"); if (nOldValue != null) { oldValue = FlLocale.getInstance(session).getDecimalFormat("#,###").format(nOldValue.longValue()); } Number nNewValue = (Number)modif.get("HisNewIntValue"); if (nNewValue != null) { newValue = FlLocale.getInstance(session).getDecimalFormat("#,###").format(nNewValue.longValue()); } } else if (field.isFloat() || field.isDouble()) { Number nOldValue = (Number)modif.get("HisOldFloatValue"); if (nOldValue != null) { oldValue = FlLocale.getInstance(session).getDecimalFormat().format(nOldValue.doubleValue()); } Number nNewValue = (Number)modif.get("HisNewFloatValue"); if (nNewValue != null) { newValue = FlLocale.getInstance(session).getDecimalFormat().format(nNewValue.doubleValue()); } } else if (field.isDate() || field.isDateTime() || field.isTime()) { Date dOldValue = (Date)modif.get("HisOldDateTimeValue"); SimpleDateFormat sdf = FlLocale.getInstance(session).getDateTimeFormat(); if (field.isTime()) { sdf = FlLocale.getInstance(session).getTimeFormat(false); }else if(field.isDateTime()){ sdf = FlLocale.getInstance(session).getDateTimeFormat(false); }else if (field.isDate()) { sdf = FlLocale.getInstance(session).getDateFormat(); } if (dOldValue != null) { oldValue = sdf.format(dOldValue); } Date dNewValue = (Date)modif.get("HisNewDateTimeValue"); if (dNewValue != null) { newValue = sdf.format(dNewValue); } } } fieldName = Utils.formatToWeb(session, fieldName, false); oldValue = Utils.formatToWeb(session, oldValue, false); newValue = Utils.formatToWeb(session, newValue, false); %> <tr valign="middle"> <!-- td class="transparent" width="5%"> </td---> <td class="dataValueX borderLineTree borderLineOne borderLineRight" style="padding-left:50px;" nowrap><%= fieldName %></td> <td class="dataValueX borderLineOne" style="padding-left:20px;" nowrap><%= oldValue != null ? oldValue : " " %></td> <td class="dataValueX borderLineOne" width="10%" style="text-align: center;" nowrap><img src="<fl:webapp/>/icons/arrow-right-long.gif" alt=""/></td> <td class="dataValueX borderLineOne borderLineRight" nowrap><%= newValue != null ? newValue : " " %></td> </tr> <% } } } %></table> <% } %> </fl:bigTabs> <br> <table class="container" width="100%"> <tr class="fieldline"> <td colspan="2" style="text-align: center;"> <a href="javascript:window.close()"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif"></a> </td> </tr> </table> </div> </body> </html> <% /****************************************************************************** * CVS Log File - This is no longer maintained! * * Revision 1.1 2004/07/23 18:20:21 brian * Initial Revision * *****************************************************************************/ %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de