Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\navigation\dashboard\dashboard.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@page import="com.edeal.frontline.helper.ContextHelper"%> <%@ page session="true" %> <%@ page import="com.edeal.frontline.DashboardBean, com.edeal.frontline.DashboardPageBean, com.edeal.frontline.DataDictionary, com.edeal.frontline.FieldNotInitializedException, com.edeal.frontline.FlContext, com.edeal.frontline.MenuBean, com.edeal.frontline.SoftwareBean, com.edeal.frontline.Utils, com.edeal.frontline.dashboard.DashboardPage, com.edeal.frontline.helper.custom.DashboardHelper, com.edeal.frontline.helper.custom.AlarmHelper, com.edeal.frontline.helper.custom.ActorHelper, com.edeal.frontline.navigation.FlRequest, java.util.HashMap, java.util.LinkedHashMap, java.util.HashSet, java.util.Vector, org.apache.commons.logging.Log, org.apache.commons.logging.LogFactory" %> <%@page import="com.edeal.frontline.controller.actions.GetInfoBarInformationAction"%> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %><% String actID = (String) session.getAttribute("actorID"); %> <% Vector<DashboardBean> dashboardBeans = new Vector<DashboardBean>(); FlRequest flRequest = new FlRequest(request); final Log logger = LogFactory.getLog(getClass()); String actionBodyURL = Utils.getRequestParameter(flRequest.getContext(), request, "actionPageURL"); String bodyPageURL = Utils.getRequestParameter(flRequest.getContext(), request, "bodyPageURL"); FlContext context = flRequest.getContext(); DataDictionary dico = flRequest.getContext().getDataDictionary(); String strActDisp = null; if (bodyPageURL == null) bodyPageURL = (String) request.getAttribute("body"); if (actionBodyURL == null) actionBodyURL = (String) request.getAttribute("action"); if (flRequest.getAttribute("Dashboards") != null) dashboardBeans = (Vector<DashboardBean>) flRequest.getAttribute("Dashboards"); try { strActDisp = flRequest.getContext().getDataDictionary().getTable("sql", "Actor").toString(session, actID); } catch (Throwable e) { } Integer resX = (Integer) session.getAttribute("resolutionX"); String activateAlert = flRequest.getContext().getContextParameter("ActivateAlert"); boolean isAlertsActivated = ((activateAlert != null) && ("true".equalsIgnoreCase(activateAlert))); String alertType = context.getContextParameter("InfoBar.AlertType "); alertType = (alertType != null) ? alertType : GetInfoBarInformationAction.ALERTTYPE_SCROLL; MenuBean menuBeanMaster = null; String menuIdMaster = null; SoftwareBean swBeanMaster = null; String sfwIdMaster = flRequest.getRequestParameterOrAttribute("SfwID"); if (flRequest.getRequestParameterOrAttribute("mn") != null) menuIdMaster = flRequest.getRequestParameterOrAttribute("mn"); else if (flRequest.getRequestParameterOrAttribute("MenID") != null) menuIdMaster = flRequest.getRequestParameterOrAttribute("MenID"); // First try the menu directly, and get sfwIdMaster from that if (menuIdMaster != null) { try { menuBeanMaster = new MenuBean(menuIdMaster, flRequest.getContext()); try { sfwIdMaster = menuBeanMaster.getMenSfwID(); } catch (FieldNotInitializedException fnie) { logger.debug("Master software ID was not found in the master MenuBean", fnie); } swBeanMaster = new SoftwareBean(sfwIdMaster, flRequest.getContext()); } catch (Exception e) { menuBeanMaster = null; swBeanMaster = null; } } // Then try the getting the software and pulling the menu from there if (menuBeanMaster == null) { try { swBeanMaster = new SoftwareBean(sfwIdMaster, flRequest.getContext()); menuBeanMaster = flRequest.getContext().getMenuManager().getMenu(actID, swBeanMaster.getID()); } catch (Exception e) { menuBeanMaster = null; swBeanMaster = null; } } // If we still don't have a menu, try getting it from the default stored in the session if (menuBeanMaster == null) { try { menuBeanMaster = new MenuBean((String) session.getAttribute("DefaultMenID"), flRequest.getContext()); swBeanMaster = new SoftwareBean(menuBeanMaster.getMenSfwID(), flRequest.getContext()); } // Try to affect the first available software and visible for current actor catch (Exception e) { Vector<SoftwareBean> softwareBeans = flRequest.getContext().getLicenceManager().getSoftwareBeans(); for (SoftwareBean softwareBean : softwareBeans) { Vector sfwRoleHidden = null; try { sfwRoleHidden = (Vector)softwareBean.getSfwRoleHidden(); } catch (FieldNotInitializedException fnie) { } ActorBean actBean = ActorHelper.getSessionActor(session); Vector actRoles = null; try { actRoles = actBean.getActRoles(); } catch (FieldNotInitializedException fnie) { } Boolean isSfwRoleHidden = true; if (sfwRoleHidden != null && actRoles != null) { for (int j = 0; j < actRoles.size(); j++) { if (!sfwRoleHidden.contains(actRoles.elementAt(j))) { // if at least one of my role allows me to see a software so I can see it isSfwRoleHidden = false; break; } } } else { isSfwRoleHidden = false; } if (softwareBean.isSfwInactive() || softwareBean.isSfwHidden() || (isSfwRoleHidden)) { continue; } swBeanMaster = softwareBean; flRequest.setAttribute("SfwID", softwareBean.getSfwID()); break; } } } String sfwCodeMaster = ""; try { sfwCodeMaster = swBeanMaster.getSfwCode(); } catch (FieldNotInitializedException fnie) { logger.debug("Master software code was not found", fnie); } if (sfwCodeMaster.equals("")) sfwCodeMaster = "UNDEFINED"; Vector<DashboardBean> availableDashboardBeans = DashboardHelper.toVector(DashboardHelper.collectDefaultDashboards(context, actID)); FlLocale flLocale = FlLocale.getInstance(session); String language = flLocale.getLanguage(); String warnMsg = (String) session.getAttribute("warnMsg"); boolean isGeolocalizationActivated = false; isGeolocalizationActivated = ContextHelper.isActivatedService(context, "Geolocalization"); String geocoderkey = (String) context.getContextParameter("GoogleMapKey"); String contextFromRequest = (String)request.getAttribute("jsonContext"); if (contextFromRequest == null) { contextFromRequest = "{\"actorId\":\"" + actID + "\", \"locale\":\"" + language + "\"}"; } %> <html> <head> <title><fl:getMessage code="L2025" alt="E-DEAL"/> CRM <%=strActDisp == null ? "" : " - " + Utils.formatToWeb(strActDisp, false)%></title> <link rel="stylesheet" href="<fl:webapp/>/css/common_css.jsp" type="text/css"> <link rel="stylesheet" href="<fl:webapp/>/css/tooltip.css" type="text/css"> <link rel="stylesheet" href="<fl:webapp/>/css/master_css.jsp?sfwCode=<%=sfwCodeMaster%>" type="text/css"> <link rel="stylesheet" href="<fl:webapp/>/css/smalltabs_css.jsp" type="text/css"> <link rel="icon" href="<fl:webapp/>/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="<fl:webapp/>/favicon.ico" type="image/x-icon"> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/master_js.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/presentField.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ajax/sarissa.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ajax/ajax.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/global_js.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ac/fobAC_js.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/infobar/infobar_js.jsp"></script> <!--[if IE 7]> <script type="text/javascript" language="javascript" src="./js/edeal/libraries/json.org/json2/json2.js"></script> <![endif]--> <script type="text/javascript" language="javascript" src="./js/edeal/context/edContext.js"></script> <script type="text/javascript" language="javascript" src="./js/edeal/application/edApplication.js"></script> <script type="text/javascript" language="javascript" src="./js/edeal/libraries/includeJS/include.js"></script> <script type="text/javascript" language="javascript" src="./js/edeal/tools/utils.js"></script> <script type="text/javascript" language="javascript" src="./js/edeal/managers/edManager.js"></script> <script language="javascript"> $(document).ready(loadMainContent); function loadMainContent() { var context = new edContext('<%=contextFromRequest%>'); //Gérer ici l'auto post de l'input jsonContext et la surcharge des submit de formulaire $(document).one("edApplication_onInitialize", computeEdViews); var application = new edApplication({path: "<fl:webapp/>/", isgeolocalizationactivated: <%=isGeolocalizationActivated%>, geocoderkey: "<%=geocoderkey%>"}); initializeLayout(); switchDashboard($(".dashboard").first().parent().attr("id")); alertWarn(); } function computeEdViews() { edManager.createEdViewsFromHTML(); } function alertWarn() { <% if (warnMsg != null) { %> displayWarning("<b><%= warnMsg %></b>"); <% session.removeAttribute("warnMsg"); } %> } </script> <script type="text/javascript" language="javascript"> function addDashboard(dashboardID, dashboardOrder) { //Creation window.location.href = "<fl:webapp/>/unlock_dashboard.fl?id=" + $("#dashboardSelection-" + dashboardID).val() + "&model=0&order=" + dashboardOrder;; } function unlock(id, model) { //Update window.location.href = "<fl:webapp/>/unlock_dashboard.fl?id=" + id + "&model=" + model; } var selectedDashboardId = null; function initializeDashboard(id) { var containerHeight = parseInt($("#dashboard-" + id).css("height")); var containerX = $("#dashboard-" + id).position().left; var containerY = $("#dashboard-" + id).position().top; var initialized = $("#initialized-" + id).attr("value"); var tabWidth = $(window).width() - 26; if (initialized == "false") { $("#" + id + " .pageContainer").each(function() { var pageHeight = $(this).outerHeight(); var pageWidth = $(this).outerWidth(); var pageX = parseInt($(this).css("left")); var pageY = parseInt($(this).css("top")); if (pageHeight + pageY > containerHeight) { containerHeight = pageHeight + pageY; $("#dashboard-" + id).css("height", containerHeight); } $(this).parent().css("height", containerHeight); $(this).parent().css("left", containerX); $(this).parent().css("top", containerY); $(this).parent().css("width", tabWidth); }); //if (!$.browser.msie) { //$("#" + id + " .pageContainer").wrapAll("<div class='wrapper' style='height: " + containerHeight + "px; left: " + containerX + "px; overflow: hidden; position: absolute; top: " + containerY + "px; width: " + tabWidth + "px;' />"); $("#" + id + " .pageContainer").wrapAll("<div class='wrapper' style='height: " + containerHeight + "px; left: " + containerX + "px; overflow-x: auto; overflow-y: hidden; position: absolute; top: " + containerY + "px; width: " + tabWidth + "px;' />"); //} $("#initialized-" + id).attr("value", "true"); } } function initializeLayout() { $(".initialized").attr("value", "false"); //if (!$.browser.msie) { $(".wrapper").children().unwrap(); //} } function switchDashboard(id) { selectedDashboardId = id; initializeDashboard(selectedDashboardId); // IE sucks: iframes must be reloaded! /*if ($.browser.msie) { $("#" + id + " iframe").each(function() { this.contentWindow.location.reload(true); }); }*/ } $(window).resize(function() { $(".wrapper").width($(window).width() - 26); }); </script> <style> .buttons { height: 23px; margin: 0px; padding: 0px; } .clickableIcon { cursor: pointer; margin: 0px; margin-top: 3px; padding: 0px; } #dashboard { overflow-x: auto; overflow-y: hidden; width: 100%; } .dashboardMenu { background-color: #EEF1FB; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin: 5px 0px 0px 0px; padding: 2px 10px 2px 10px; } .dashboards { background-color: white; border: 3px solid rgb(160, 199, 209); border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; margin: 5px; padding: 5px; position: absolute; width: 98%; } legend { margin-left: 10px; padding: 0px 5px 0px 5px; } .pageContainer { border: 2px solid rgb(160, 199, 209); border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; height: 146px; overflow: hidden; padding: 0px; position: absolute; width: 246px; padding-bottom: 17px; } .pageContent { border: none; height: 100%; margin: 0px; overflow: auto; padding: 0px; width: 100%; } .singleTab { display: inline; } </style> </head> <body> <div id="header"> <div id="infobar_css"> <%@include file="/navigation/infobar/infobar.jsp" %> </div> <div id="menubar_css"> <%@include file="/navigation/menubar/menubar.jsp" %> </div> </div> <div id="object_css" style="width: 100%; margin: 0px; padding: 0px; padding-top: 5px;"> <% if (dashboardBeans.size() == 1) { %> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="98%" bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1%"><img src="<fl:webapp/>/icons/smalltabs/bd_n-w_small.gif" width="16" height="10" border="0" name="dashboards_swapPict"></td> <td id="dashboards_stab0" class="stabselected" width="98%"></td> <td width="1%"><img src="<fl:webapp/>/icons/smalltabs/bd_w-n_small.gif" width="15" height="10" name="dashboards_swapPict0"></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td style="width: 13px; height: 13px; background: url(<fl:webapp/>/icons/smalltabs/b_left.gif)"></td> <td> <% for (DashboardBean dashboard : dashboardBeans) { %> <div id="<%= dashboard.getDshID() %>" style="display:inline"> <% DashboardHelper dashboardHelper = new DashboardHelper(dashboard); int dashboardHeight = 0; int pageOrder = 0; int pageHeight, pageWidth, pageX, pageY; DashboardPage pageModel = null; Vector<DashboardPageBean> pages = dashboardHelper.collectPages(); for (DashboardPageBean dashboardPageBean : pages) { pageHeight = dashboardPageBean.getDspHeight(); pageY = dashboardPageBean.getDspY(); if (pageHeight + pageY > dashboardHeight) dashboardHeight = pageHeight + pageY; } %> <input class="initialized" id="initialized-<%= dashboard.getDshID() %>" type="hidden" value="false"/> <div class="dashboard" id="dashboard-<%= dashboard.getDshID() %>" style="height: <%= dashboardHeight %>px"> <% for (DashboardPageBean dashboardPageBean : pages) { try { pageModel = new DashboardPage(session, context, dashboardPageBean.getDspPage()); pageHeight = dashboardPageBean.getDspHeight(); pageWidth = dashboardPageBean.getDspWidth(); pageX = dashboardPageBean.getDspX(); pageY = dashboardPageBean.getDspY(); %> <div class='wrapper' style="overflow: hidden; position: absolute;"> <fieldset class="pageContainer" id="pageContainer-0-<%= pageOrder %>" style="left: <%= pageX %>px; height: <%= pageHeight %>px; top: <%= pageY %>px; width: <%= pageWidth %>px"> <legend><%= pageModel.getName() %></legend> <iframe frameborder="0" class="pageContent" id="pageContent-0<%= pageOrder %>" name="<%= pageModel.getCode() %>" src="<%= flRequest.computeURL(pageModel.getUrl()) %>"></iframe> </fieldset> </div> <% } catch (FieldNotInitializedException fnie) { logger.error("Pages properties incomplete", fnie); } pageOrder ++; } %> </div> <div class="dashboardMenu"> <fl:access operation="edit" name="Dashboard" id="<%= dashboard.getDshID() %>"> <img class="clickableIcon" onClick="unlock('<%= dashboard.getDshID() %>', '0');" src="<fl:link url="/icons/ico/lock_open.gif"/>" title="<fl:getMessage alt="Personnaliser cet onglet" code="L70AB"/>" /> </fl:access> <fl:access operation="create" name="Dashboard" id="<%= dashboard.getDshID() %>"> <span class="menuLabel"><fl:getMessage code="F8083" alt="Créer un nouvel onglet depuis le modèle"/></span> <select class="dashboardSelection" id="dashboardSelection-<%= dashboard.getDshID() %>" name="dashboardSelection"> <% for (DashboardBean dashboardModel : availableDashboardBeans) { %> <option value="<%= dashboardModel.getDshID() %>"><%= dashboardModel.getDshName() %></option> <% } %> </select> <img class="clickableIcon" onClick="addDashboard('<%= dashboard.getDshID() %>', '0')" src="<fl:link url="/icons/ico/tab_add.gif"/>" title="<fl:getMessage code="L6646" alt="Ajouter cet onglet"/>" /> </fl:access> </div> </div> <% } %> </td> <td style="width: 15px; height: 15px; background: url(<fl:webapp/>/icons/smalltabs/b_right.gif)"></td> </tr> <tr> <td style="width: 13px; height: 15px; background: url(<fl:webapp/>/icons/smalltabs/b_bottom-left.gif)"></td> <td style="background: url(<fl:webapp/>/icons/smalltabs/b_bottom.gif)"></td> <td style="width: 15px; height: 15px; background: url(<fl:webapp/>/icons/smalltabs/b_bottom-right.gif)"></td> </tr> </table> </td> </tr> </table> <a name="bottom_smalltabs"></a> <% } else { int dashboardOrder = 0; %> <fl:smallTabs name="dashboards"> <% for (DashboardBean dashboard : dashboardBeans) { %> <fl:sTab id="<%= dashboard.getDshID() %>" title="<%= dashboard.getDshName() %>" onselect="<%= \"switchDashboard('\" + dashboard.getDshID() + \"')\" %>"> <% DashboardHelper dashboardHelper = new DashboardHelper(dashboard); int dashboardHeight = 0; int pageOrder = 0; int pageHeight, pageWidth, pageX, pageY; DashboardPage pageModel = null; Vector<DashboardPageBean> pages = dashboardHelper.collectPages(); for (DashboardPageBean dashboardPageBean : pages) { pageHeight = dashboardPageBean.getDspHeight(); pageY = dashboardPageBean.getDspY(); if (pageHeight + pageY > dashboardHeight) dashboardHeight = pageHeight + pageY; } %> <input class="initialized" id="initialized-<%= dashboard.getDshID() %>" type="hidden" value="false"/> <div class="dashboard" id="dashboard-<%= dashboard.getDshID() %>" style="height: <%= dashboardHeight %>px"> <% for (DashboardPageBean dashboardPageBean : pages) { try { pageModel = new DashboardPage(session, context, dashboardPageBean.getDspPage()); pageHeight = dashboardPageBean.getDspHeight(); pageWidth = dashboardPageBean.getDspWidth(); pageX = dashboardPageBean.getDspX(); pageY = dashboardPageBean.getDspY(); %> <div class='wrapper' style="overflow: hidden; position: absolute;"> <fieldset class="pageContainer" id="pageContainer-<%= dashboardOrder %>-<%= pageOrder %>" style="left: <%= pageX %>px; height: <%= pageHeight %>px; top: <%= pageY %>px; width: <%= pageWidth %>px"> <legend><%= pageModel.getName() %></legend> <iframe frameborder="0" class="pageContent" id="pageContent-<%= dashboardOrder %>-<%= pageOrder %>" name="<%= pageModel.getCode() %>" src="<%= flRequest.computeURL(pageModel.getUrl()) %>"></iframe> </fieldset> </div> <% } catch (FieldNotInitializedException fnie) { logger.error("Pages properties incomplete", fnie); } pageOrder ++; } %> </div> <div class="dashboardMenu"> <fl:access operation="edit" name="Dashboard" id="<%= dashboard.getDshID() %>"> <img class="clickableIcon" onClick="unlock('<%= dashboard.getDshID() %>', '0');" src="<fl:link url="/icons/ico/lock_open.gif"/>" title="<fl:getMessage alt="Personnaliser cet onglet" code="L70AB"/>" /> </fl:access> <fl:access operation="create" name="Dashboard" id="<%= dashboard.getDshID() %>"> <span class="menuLabel"><fl:getMessage code="F8083" alt="Créer un nouvel onglet depuis le modèle"/></span> <select class="dashboardSelection" id="dashboardSelection-<%= dashboard.getDshID() %>" name="dashboardSelection"> <% for (DashboardBean dashboardModel : availableDashboardBeans) { %> <option value="<%= dashboardModel.getDshID() %>"><%= dashboardModel.getDshName() %></option> <% } %> </select> <span class="menuLabel"><fl:getMessage code="F8082" alt="à la suite de cet onglet"/></span> <img class="clickableIcon" onClick="addDashboard('<%= dashboard.getDshID() %>', '<%= dashboard.getDshCrOrder() +1 %>')" src="<fl:link url="/icons/ico/tab_add.gif"/>" title="<fl:getMessage code="L6646" alt="Ajouter cet onglet"/>" /> </fl:access> </div> </fl:sTab> <% dashboardOrder ++; } %> </fl:smallTabs> <% } %> </div> <div id="waiting" style="display:none"><fl:getMessage code="L639B" alt="Chargement ..."/></div> <script type="text/javascript" language="javascript"> <% if (isAlertsActivated && alertType.equals(GetInfoBarInformationAction.ALERTTYPE_POPUP)) { %> checkAlarms(); <% } else if (isAlertsActivated && alertType.equals(GetInfoBarInformationAction.ALERTTYPE_SCROLL)) { %> getInfoBarInformation(); window.setInterval("getInfoBarInformation()", <%= AlarmHelper.getRefreshTime(context) %>); <% } if (resX == null || "".equals(resX)) { %> doAjax("<fl:webapp/>/navigation/setres.jsp?resx=" + screen.width + "&resy=" + screen.height); <% } %> </script> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de