Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\admin\accessmanager\accessmanager.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.DataDictionary" %> <%@ page import="com.edeal.frontline.ObjectsBean" %> <%@ page import="java.util.Vector" %> <%@ page import="java.util.Hashtable" %> <%@ page import="java.util.Enumeration" %> <%@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()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String sfwID = flRequest.getRequestParameterOrAttribute("SfwID"); Vector modules = (Vector)flRequest.getAttribute("Modules"); Hashtable objIdsByModule = (Hashtable) flRequest.getAttribute("ObjIdsByModule"); Hashtable objDisplayByModule = (Hashtable) flRequest.getAttribute("ObjDisplayByModule"); Vector rolesDisplayToSave = dico.getRefList(session, "ActRoles"); ObjectsBean bean = null; String moduleFromRequest = null; Object objIDFormRequest = flRequest.getAttribute("objID"); String strObjIDFormRequest = null; if(objIDFormRequest != null && objIDFormRequest instanceof String && !"".equals(objIDFormRequest)){ bean = dico.getTable("id", (String)objIDFormRequest); moduleFromRequest = bean.getObjModule(); strObjIDFormRequest = (String)objIDFormRequest; } int idxForModule = 0; int idxForObjID = 0; %> <!-- Javascript include --> <script type="text/javascript" language="javascript"> var modules = [<% for (int i = 0; i < modules.size(); i++) { String module = (String)modules.elementAt(i); if(module.equals(moduleFromRequest)){ idxForModule = i + 1 ; } %><%= i > 0 ? ", " : "" %>'<%= Utils.formatToJavascript(module) %>'<% } %>]; var objectsID = new Array(); <% Enumeration keys = objIdsByModule.keys(); while (keys.hasMoreElements()) { String module = (String)keys.nextElement(); Vector objIDs = (Vector)objIdsByModule.get(module); %>objectsID['<%= module %>'] = [<% for (int i = 0; i < objIDs.size(); i++) { String objID = (String)objIDs.elementAt(i); if(objID.equals(strObjIDFormRequest)){ idxForObjID = i + 1 ; } %><%= i > 0 ? ", " : "" %>'<%= Utils.formatToJavascript(objID) %>'<% } %>]; <% } %> var objectsDisplay = new Array(); <% keys = objDisplayByModule.keys(); while (keys.hasMoreElements()) { String module = (String)keys.nextElement(); Vector objectsDisplay = (Vector)objDisplayByModule.get(module); %>objectsDisplay['<%= module %>'] = [<% for (int i = 0; i < objectsDisplay.size(); i++) { %><%= i > 0 ? ", " : "" %>'<%= Utils.formatToJavascript((String)objectsDisplay.elementAt(i)) %>'<% } %>]; <% } %> <% if(strObjIDFormRequest != null){ %> $(document).ready(function() { var f = document.forms[0]; f.modules.selectedIndex = '<%=idxForModule%>'; window.changeModule(); f.objects.selectedIndex = '<%=idxForObjID%>'; window.changeObject(); }); <%}%> function changeModule() { // on vide les combos objets et table de ref var f = document.forms[0]; for (var i = f.objects.options.length - 1; i > 0; i--) { f.objects.options[i] = null; } var value = f.modules.options[f.modules.selectedIndex].value; // si value == "" on cache les 2 autres combos // si value == "UNATTACHED" on cache la combo objects et on met a jour tables // sinon on met a jour objets et on cache tables if (value == "") { hideObjects(); } else { var module = modules[value]; for (var i = 0; i < objectsID[module].length; i++) { f.objects.options[f.objects.options.length] = new Option(objectsDisplay[module][i], objectsID[module][i]); } showObjects(); } } function changeObject() { var f = document.forms[0]; if (f.objects.selectedIndex == 0) { return; } var value = f.objects.options[f.objects.selectedIndex].value; showObject(value); } function showObject(id) { displayedObjID = id; doAjax('<fl:webapp/>/read_access_object.fl?id=' + encodeURIComponent(id), showContent); } function refreshList(arrIndex) { window.setTimeout(changeObject, 0); } function showContent(arrIndex) { hideWaiting(); if (eDealXmlhttpArr[arrIndex].readyState == 4){ var contentTD = document.getElementById('table_content'); contentTD.innerHTML = eDealXmlhttpArr[arrIndex].responseText; showActions(); //resizeBlock(); } } function showActions() { var ids = ["save_object1", "modify_object1","save_object2","modify_object2", "dictionary_object1", "dictionary_object2"]; for (var i = 0; i < ids.length; i++) { var node = document.getElementById(ids[i]); if (node!=null) node.style.display = ""; } } function hideObjects() { var objLabel = document.getElementById("objects_label"); objLabel.style.visibility = "hidden"; var objSelect = document.getElementById("objects"); objSelect.style.visibility = "hidden"; } function showObjects() { var objLabel = document.getElementById("objects_label"); objLabel.style.visibility = "visible"; var objSelect = document.getElementById("objects"); objSelect.style.visibility = "visible"; } var displayedObjID = null; function exportObjects() { window.parent.location = "<fl:webapp/>/export_access_object.fl"; } function resizeBlock(){ var tab1 = document.getElementById('tab1'); var tab2 = document.getElementById('tab2'); var tab3 = document.getElementById('tab3'); tab1.style.width = '100%'; tab2.style.width = '100%'; tab3.style.width = '100%'; } function saveObjects(){ f = document.forms[0]; f.submit(); } function doSubmit() { return true; } function doReset() { var f = document.forms[0]; if(confirm('<fl:getMessage code="M202E" alt="Etes-vous sûr de vouloir réinitialiser ?" js="true"/>')) { var id = f.objects.options[f.objects.selectedIndex].value; doAjax('<fl:webapp/>/read_access_object.fl?id=' + encodeURIComponent(id), showContent); } } function showDictionary(){ document.location = "<fl:webapp/>/dictionary.fl?SfwID=<%=sfwID%>&id=" + displayedObjID; } function doSubmit() { if (displayedObjID) { var mf = window.document.forms[0]; mf.id.value = displayedObjID; <% if (rolesDisplayToSave != null) { %> var readRights = ''; var editRights = ''; var createRights = ''; var deleteRights = ''; for (i=0; i < <%=rolesDisplayToSave.size()%> ; i++) { if (i>0) { readRights += '|'; editRights += '|'; createRights += '|'; deleteRights += '|'; } readRights += mf.elements['Read_' + i].options[mf.elements['Read_' + i].selectedIndex].value; editRights += mf.elements['Edit_' + i].options[mf.elements['Edit_' + i].selectedIndex].value; createRights += mf.elements['Create_' + i].options[mf.elements['Create_' + i].selectedIndex].value; deleteRights += mf.elements['Delete_' + i].options[mf.elements['Delete_' + i].selectedIndex].value; } <% } %> mf.ObjRolesRead.value = readRights; mf.ObjRolesEdit.value = editRights; mf.ObjRolesCreate.value = createRights; mf.ObjRolesDelete.value = deleteRights; presentFieldsValue(); return true; } } </script> <form action="<fl:link url="/save_access_object.fl" menu="true"/>" id="AccessManager_form" method="POST" name="AccessManager_form"> <input type="hidden" id="ObjAlterTable" name="ObjAlterTable" value="false"/> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L607F\", false, true, \"Gest. des droits\") %>" ou="/accessmanager.fl" showFooter="false"> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td class="dataValue" style="vertical-align:top; width: 100%"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel" style="width: 1%"><fl:getMessage code="F6004" alt="Module"/> </td> <td class="dataValue" style="width: 35%"> <select id="modules" name="modules" onchange="changeModule();"> <option value="" selected></option> <% for (int i = 0; i < modules.size(); i++) { String module = (String)modules.elementAt(i); %> <option value="<%= i %>"><%= Utils.formatToWeb(module, false) %></option> <% } %> </select> </td> <td class="dataLabel" style="width: 1%"><label id="objects_label" for="objects" style="visibility: hidden""><fl:getMessage code="F1022" alt="Objet"/></label> </td> <td class="dataValue" style="width: 35%"> <select id="objects" name="objects" style="visibility: hidden" onchange="changeObject()"> <option value=""> </option> </select> </td> <td width="20%"> </td> </tr> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr> <td style="width: 100%"> <div id="table_content" style="vertical-align: top; width: 100%;"> </div> </td> </tr> </table> </fl:bigTabs> </form> <fl:title title="<%= Utils.getMessage(session, \"L607F\", false, true, \"Gest. des droits\") %>"/>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de