Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\admin\software\edit.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"%> <%@ 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="com.edeal.frontline.EnterpriseBean" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="com.edeal.frontline.ActorBean" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.LicenceManager" %> <%@ page import="com.edeal.frontline.SiteBean" %> <%@ page import="com.edeal.frontline.MenuByRoleBean" %> <%@ page import="com.edeal.frontline.MenuBean" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.SoftwareBean" id="Software" 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 = Software.getSfwID(); } catch (FieldNotInitializedException e) {} String sfwName = null; try { sfwName = Software.getSfwName(); } catch (FieldNotInitializedException e) {} boolean sfwStandard = false; try { sfwStandard = Software.isSfwStandard(); } catch (FieldNotInitializedException e) {} Vector menus = new Vector(); Hashtable menuByRolesH = new Hashtable(); if (id != null) { //get the different menus for this software String[] fields1 = {"MenID", "MenLabel", "MenValue", "MenDefault"}; String[][] query1 = {{"MenSfwID = " + Utils.formatToSQL(context, id)}}; String[] orderBy1 = {"MenValue DESC"}; menus = MenuBean.listSummary(context, fields1, query1, orderBy1); //get the different menuByRoles for this software String[] fields2 = {"MbrID", "MbrRole", "MbrMenID"}; String[][] query2 = {{"MbrMenID:MenSfwID = " + Utils.formatToSQL(context, id)}}; Vector menuByRoles = MenuByRoleBean.listSummary(context, fields2, query2); //Hashtable menuByRolesH : key role id, value menu id for (int i=0 ; i<menuByRoles.size() ; i++) { Hashtable mbr = (Hashtable)menuByRoles.elementAt(i); menuByRolesH.put(mbr.get("MbrRole"), mbr.get("MbrMenID")); } } //all available roles Vector roles = dico.getRefList(session, "Rol", "Te1"); String ouiStr = Utils.getMessage(session, "L2005", "Oui"); String nonStr = Utils.getMessage(session, "L2006", "Non"); Vector sfwRoleHidde = null; try { sfwRoleHidde = (Vector)Software.getSfwRoleHidden(); } catch (FieldNotInitializedException e) {} %> <script type="text/javascript" language="javascript"> function doSubmit() { var f = document.forms[0]; <% if (!sfwStandard) { %> if (f.SfwName.value == "") { window.alert("<fl:getMessage code="M2014" alt="Vous devez spécifier un nom." js="true"/>"); f.SfwName.focus(); return false; } <% } %> if (f.SfwHidden.checked == false && f.SfwDisplayName.value == "") { window.alert("<fl:getMessage code="M608B" alt="Vous devez spécifier un nom affiché." js="true"/>"); return false; } return true; } function doSelectLabel(field) { window.open('<fl:link url="/select_label.fl?1=1"/>&field=' + field, 'select_label', 'width=900,height=400,menubar=no,toolbar=no,scrollbars=yes,status=no,resizable=yes'); } function doInactiveChange() { var f = document.forms[0]; if (f.SfwInactive.checked == true) { f.SfwHidden.checked = true; } doHiddenChange(f.SfwInactive.checked); } function doRemoveLabel(field){ var f = window.document.forms[0]; if (f.elements[field] && f.elements[field].value) { f.elements[field].value = ''; } if (f.elements['lbl' + field] && f.elements['lbl' + field].value) { f.elements['lbl' + field].value = ''; } } function doHiddenChange(isChecked) { var elm = $("input[type=checkbox][name='SfwRoleHidden']"); $(elm).prop("checked", isChecked); } </script> <fl:form action="/save_software.fl" bean="Software"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L624A\", false, true, \"Logiciel\") %>" ou="<%= \"/edit_software.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td colspan="5"> <table> <tr> <td class="labelTitreFiche" > <fl:label field="SfwName" labelClassName="titreFiche"/> </td> <td class="fieldTitreFiche" colspan="5"> <%-- if (!sfwStandard) { --%> <fl:input property="SfwName" mandatoryMsgCode="M60F4"/> <input name="SfwDisplayNameIsCode" type="hidden" value="true"> <%-- } else { %> <fl:fieldRead property="SfwName"/> <% } --%> </td> </tr> </table> </td> </tr> <tr><td colspan="5" class="ligne_separation"/></tr> <tr> <td class="column2"> <table class="container" cellpadding="0"> <fl:fieldEdit property="SfwCode" mandatoryMsgCode="M2001" unicityMsgCode="M60CE" /> <fl:fieldEdit property="SfwPosition" /> <fl:fieldRead property="SfwStandard" valueIfTrue="<%= ouiStr %>" valueIfFalse="<%= nonStr %>"/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="data_column" cellpadding="0" border=0> <tr class="fieldline"> <td id="SfwDisplayName_label" class="dataLabel"> <fl:getMessage code="L6015" alt="Nom affiché"/> </td> <td class="dataValue"> <!-- td id="SfwDisplayName_value" class="dataValue"--> <% String fullTitle = null; String codeTitle = null; try { codeTitle = Software.getSfwDisplayName() ; fullTitle = Utils.getMessage(session, Software.getSfwDisplayName(), "Libellé indisponible"); } catch (Exception e) {} %> <table class="container" cellpadding="0"> <tr> <td class="principalText"> <input name="lblSfwDisplayName" class="input fob chpsTextObligatoire" type="text" value="<%= (fullTitle!= null)? fullTitle : "" %>" readOnly> <input name="SfwDisplayName" type="hidden" value="<%= (codeTitle!= null)? codeTitle : "" %>"> </td> <td class="postText"> <a href="javascript:doSelectLabel('SfwDisplayName')"><img src="<fl:webapp/>/icons/ico/rechercher.gif" alt="" width="17" height="17" border="0"></a> <a href="javascript:doRemoveLabel('SfwDisplayName')"><img src="<fl:webapp/>/icons/ico/supprimer.gif" alt="" width="17" height="17" border="0"></a> </td> </tr> </table> </td> </tr> </table> <table class="container" cellpadding="0"> <fl:fieldEdit property="SfwHidden" onclick="doHiddenChange(this.checked)"/> <fl:fieldEdit property="SfwInactive" onclick="doInactiveChange()"/> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> </table> <% if (id != null) {%> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <fl:smallTabs name="SoftRead"> <fl:sTab id="MENU" title="<%= Utils.getMessage(session, \"L625A\", false, true, \"Menu par rôle\") %>"> <table class="container" cellpadding="0"> <tr> <td class="column2"> <table class="container" cellpadding="0"> <% //for each role for (int i=0 ; i < roles.size() ; i++) { String roleID = (String)((Vector)roles.elementAt(i)).elementAt(0); String roleName = (String)((Vector)roles.elementAt(i)).elementAt(1); %> <tr class="fieldline" height="30px"> <td class="dataLabel"><%= roleName %></td> <td class="dataValue"> <select name="Mbr_<%= roleID%>" class="input select"> <option></option> <% for (int j=0 ; j < menus.size() ; j++) { Hashtable menu = (Hashtable)menus.elementAt(j); String menuID = (String)menu.get("MenID"); String menuLabel = menu.get("MenLabel") + (menu.get("MenDefault").equals(Boolean.TRUE) ? " *" : ""); String selected = (menuByRolesH.get(roleID)!=null && menuByRolesH.get(roleID).equals(menuID)) ? " selected" : ""; %> <option value="<%= menuID %>"<%= selected %>><%= menuLabel %></option> <% } %> </select> </td> </tr> <% } %> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="container" cellpadding="0"> <% for (int j = 0 ; j < roles.size() ; j++) { String roleID = (String)((Vector)roles.elementAt(j)).elementAt(0); %> <tr class="fieldline" height="30px"> <td class="dataLabel" id="SfwRoleHidden_label"><div><label title="<fl:getMessage code="F60AB" alt="Caché"/>" for="SfwRoleHidden"><fl:getMessage code="F60AB" alt="Caché"/></label></div></td> <td class="dataValue" id="SfwRoleHidden_value"><div class="input"><input type="checkbox" class="checkbox" value="<%= roleID %>" name="SfwRoleHidden" id="SfwRoleHidden_<%= j %>" <%= sfwRoleHidde != null && sfwRoleHidde.contains(roleID) ? "checked" : "" %>></div></td> </tr> <% } %> </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