Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\admin\menu\read.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. * * ******************************************************************************/ /* a.stouky@e-deal.ma : 16/08/06 Modifications: Afficher le nom du logiciel au lieu de l'ID avec un lien Afficher "oui" si true et "non" si false dans "par défaut" Aligner les informations avec le titre Enlever les champs icones Diminuer la taille des liens et les espacements entre les icônes dans les smalltabs */ %><%@page session="true"%> <%@ 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="com.edeal.frontline.DataDictionary" %> <%@ page import="java.util.Hashtable" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.MenuBean" %> <%@ page import="com.edeal.frontline.ListBean" %> <%@ page import="com.edeal.frontline.MenuElementBean" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.MenuBean" id="Menu" 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 ouiStr = Utils.getMessage(session, "L2005", "Oui"); String nonStr = Utils.getMessage(session, "L2006", "Non"); String id = null; try { id = Menu.getID(); } catch (FieldNotInitializedException e) {} Vector nodes = new Vector(); Vector leaves = new Vector(); //get first level menuelements (nodes) String[] fields1 = {"MelID", "MelLabel", "MelLabelIsCode", "MelType", "MelIconName", "MelPosition", "MelLink"}; String[][] query1 = {{"MelMenID = " + Utils.formatToSQL(context, Menu.getMenID()), "MelParentID = null"}}; String[] orderBy1 = {"MelPosition"}; nodes = MenuElementBean.listSummary(context, fields1, query1, orderBy1); //get second level menuelements (leaves) ordered by their parent's position String[] fields2 = {"MelID", "MelLabel", "MelLabelIsCode", "MelIconName", "MelParentID", "MelPosition", "MelLink", "MelParentID:MelPosition"}; String[][] query2 = {{"MelMenID = " + Utils.formatToSQL(context, Menu.getMenID()), "MelParentID <> null"}}; String[] orderBy2 = {"MelParentID:MelPosition","MelParentID", "MelPosition"}; leaves = MenuElementBean.listSummary(context, fields2, query2, orderBy2); String menMainList = null; try { menMainList = Menu.getMenMainList(); } catch (FieldNotInitializedException e) {} String listName = ""; if (menMainList != null) { try { ListBean list = new ListBean(menMainList, context); listName = list.getLstCode() + " - " + list.getLstName(); } catch (Exception e) {} } String menMainLink = null; try { menMainLink = Menu.getMenMainLink(); } catch (FieldNotInitializedException e) {} %> <HEAD> <script type="text/javascript" language="javascript"> function doRefresh() { this.location.reload(); } function doRead(id) { var strLink = '<fl:link url="/read_menuelement.fl?id='+id+'" list="false"/>'; window.open(strLink, 'MenuElement', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=250'); } function doEdit(id) { var strLink = '<fl:link url="/edit_menuelement.fl?id='+id+'" list="false"/>'; window.open(strLink, 'MenuElement', 'menubar=no,status=no,toolbar=no,scrollbars=auto,resizable=yes,width=800,height=250'); } function doDel(eltID) { if (confirm('<fl:getMessage code="M2004" alt="Etes-vous sûr de vouloir supprimer?" js="true"/>')) { doAjax('<fl:link url="/delete.fl?type=MenuElement&id=' + eltID + '"/>&successPage=' + encodeURIComponent('/read_menu.fl?id=<%= id%>')); } } </script> </HEAD> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L624C\", \"Menu\") %>" ou="<%= \"/read_menu.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <table class="container" cellpadding="0"> <tr> <td colspan="5" class="titreFiche"> <fl:getProperty name="Menu" property="MenLabel" alt=""/> </td> </tr> </table> <table class="container" cellpadding="0"> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0" border=0> <fl:fieldRead property="MenSfwID" href="true" disp="/read_software.fl" bean="true"/> <tr class="fieldline"> <td id="MenTitle_label" class="dataLabel"> <fl:getMessage code="L6015" alt="Nom affiché"/> </td> <td id="MenTitle_value" class="dataValue"> <% String fullTitle = null; try { if (Menu.isMenTitleIsCode()) fullTitle = Utils.getMessage(session, Menu.getMenTitle(), "Libellé indisponible"); } catch (Exception e) {} %> <fl:getProperty name="Menu" property="MenTitle" alt=""/><%= fullTitle == null ? "" : " (" + fullTitle + ")"%> </td> </tr> <fl:fieldRead property="MenValue"/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <TABLE class="data_column" cellpadding="0" border=0> <fl:fieldRead property="MenDefault" valueCodeIfTrue="L2005" valueCodeIfFalse="L2006"/> <tr class="fieldline"> <td id="menMainList_label" class="dataLabel"> <fl:getMessage code="F60A9" alt="Page par défaut"/> </td> <td id="menMainList_value" class="dataValue"> <% if (menMainList != null) { %><a href="<fl:webapp/>/read_list.fl?op=read&id=<fl:getProperty name="Menu" property="MenMainList" alt=""/>" target="_blank"><%=listName%></a> <% } else if (menMainLink != null) { %> <a href="<% if (menMainLink.indexOf("/") == 0) { %><fl:webapp/><% } %><fl:getProperty name="Menu" property="MenMainLink" alt=""/>" target="_blank"><fl:getProperty name="Menu" property="MenMainLink" alt=""/></a> <% } else { %> <% } %> </td> </tr> <tr class="fieldline"> <td id="MenLocked_label" class="dataLabel"> <fl:getMessage code="F6091" alt="Verrouillé"/> </td> <td id="MenLocked_value" class="dataValue"> <fl:getProperty name="Menu" property="MenLocked" alt="<%= nonStr %>" valueIfTrue="<%= ouiStr %>" valueIfFalse="<%= nonStr %>"/> </td> </tr> <tr class="fieldline"> </tr> </table> </td> </tr> </table> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:getMessage code="L624F" alt="Eléments de menu"/></td> </tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> </table> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <div style="width:100%; overflow:auto;"> <fl:smallTabs name="MenuELT"> <% //leavesIndex is used to navigate on the leaves vector int leavesIndex = 0; //for each node for (int i=0 ; i<nodes.size() ; i++) { Hashtable node = (Hashtable)nodes.elementAt(i); String nodeID = (String)node.get("MelID"); String nodeLabel = (String)node.get("MelLabel"); Boolean nodeLabelIsCode = (Boolean)node.get("MelLabelIsCode"); String nodeIconName = (String)node.get("MelIconName"); String nodeType = (String)node.get("MelType"); String nodeLink = (String)node.get("MelLink"); String title = (nodeLink != null ? "title='" + Utils.formatToJavascript(nodeLink) + "'" : ""); int nodePosition = 0; if (node.get("MelPosition") != null) nodePosition = ((Number)node.get("MelPosition")).intValue(); String nodeLabelDisplay = (nodeLabelIsCode.equals(Boolean.FALSE) ? nodeLabel : Utils.getMessage(session, nodeLabel, "Libellé indisponible")); //display info on first line %> <fl:sTab id="<%= nodeLabel %>" title="<%= nodeLabelDisplay %>"> <table class="data_column" cellpadding="0" border="0"> <tr class="fieldline"> <td colspan="2"> <table class="data_column" cellpadding="0" border="0"> <tr> <td style="width: 2%"> <a href="javascript:doEdit('<%=nodeID%>');"> <img src="<fl:webapp/>/icons/ico/zoom.gif" alt="Edit"> </a> </td> <td style="width: 2%"> <a href="javascript:doDel('<%=nodeID%>');"> <img src="<fl:webapp/>/icons/ico/supprimer.gif" alt="Sup"> </a> </td> <td style="text-align:left;width: 80%" class="dataValue"> <a href="javascript:doRead('<%=nodeID%>')"><%= nodeLabelDisplay %></a> (<%= nodePosition %>)</td> </tr> </table> </td> </tr> <% if (nodeType != null && nodeType.equals("NODE")){ %> <tr class="ligne_separation_couleur"><td colspan="3"></td></tr> <% } %> <% boolean atLeastOneLeaf = false; while (leavesIndex < leaves.size()) { Hashtable leaf = (Hashtable)leaves.elementAt(leavesIndex); String leafParentID = (String)leaf.get("MelParentID"); //if this leaf belongs to current node, display info if (leafParentID.equals(nodeID)) { atLeastOneLeaf = true; String leafID = (String)leaf.get("MelID"); String leafLabel = (String)leaf.get("MelLabel"); Boolean leafLabelIsCode = (Boolean)leaf.get("MelLabelIsCode"); String leafIconName = (String)leaf.get("MelIconName"); String leafLink = (String)leaf.get("MelLink"); title = (leafLink != null ? "title='" + Utils.formatToJavascript(leafLink) + "'" : ""); int leafPosition = 0; if (leaf.get("MelPosition") != null) leafPosition = ((Number)leaf.get("MelPosition")).intValue(); String leafLabelDisplay = (leafLabelIsCode.equals(Boolean.FALSE) ? leafLabel : Utils.getMessage(session, leafLabel, "Libellé indisponible")); leavesIndex++; %> <tr class="fieldline"> <td style="width: 10%"></td> <td> <table class="data_column" cellpadding="0" border="0"> <tr> <td style="width: 3%"> <a href="javascript:doEdit('<%=leafID%>');"> <img src="<fl:webapp/>/icons/ico/zoom.gif" alt="Edit"> </a> </td> <td style="width: 3%"> <a href="javascript:doDel('<%=leafID%>');"> <img src="<fl:webapp/>/icons/ico/supprimer.gif" alt="Sup"> </a> </td> <% if (leafIconName != null) { %> <td style="width: 3%"><img src="<fl:webapp/>/icons/menu/<%= leafIconName %>"></td> <% } else { %> <td style="width: 3%"><img src="<fl:webapp/>/icons/menu/Default.gif"></td> <% } %> <td style="text-align:left;width: 80%" class="dataValue"> <a href="javascript:doRead('<%=leafID%>')" <%=title%>><%= leafLabelDisplay %></a> (<%= leafPosition %>)</td> </tr> </table> </td> <% } else { break; } } %> <% if (!atLeastOneLeaf && nodeType != null && nodeType.equals("NODE")) { %><td colspan="2"><fl:getMessage code="L6259" alt="Aucune feuille"/></td><% } %> </tr> </table> </fl:sTab> <% } %> </fl:smallTabs> </div> </fl:bigTabs>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de