%@page import="com.edeal.frontline.helper.ContextHelper"%> <%@page import="com.edeal.frontline.controller.actions.GetInfoBarInformationAction"%><% /****************************************************************************** * Copyright (c) 2000-2010 E-DEAL * * E-DEAL S.A. * 41, rue Périer * 92120 Montrouge * France * * T: +33 (0)1 73 03 29 80 * 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 isELIgnored="false" %><%@page session="true" contentType="text/html; charset=UTF-8" import="com.edeal.frontline.*, java.util.*, com.edeal.frontline.controller.ControllerServlet"%><%@ page import="com.edeal.frontline.navigation.FlRequest" %><%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %><%@page import="org.apache.commons.lang.StringUtils"%><%@page import="com.edeal.frontline.controller.actions.SaveActionbarCssAction"%><%@page import="com.edeal.frontline.helper.custom.AlarmHelper"%><% 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 bodyPageURL = Utils.getRequestParameter(context, request, "bodyPageURL"); String actionBodyURL = Utils.getRequestParameter(context, request, "actionPageURL"); if (bodyPageURL == null) { bodyPageURL = (String)request.getAttribute("body"); } if (actionBodyURL == null) { actionBodyURL = (String)request.getAttribute("action"); } String strActDisp = null; String actID = (String)session.getAttribute("actorID"); try { strActDisp = dico.getTable("sql", "Actor").toString(session, actID); } catch (Throwable ex) { } Vector jsIncludes = (Vector)request.getAttribute(ControllerServlet.JS_INCLUDES_ATTR); if (jsIncludes == null) { jsIncludes = new Vector(); } Iterator iter = jsIncludes.iterator(); Vector jsBeenIncluded = (Vector)request.getAttribute(ControllerServlet.JS_BEEN_INCLUDED_ATTR); if (jsBeenIncluded == null) { jsBeenIncluded = new Vector(); } Integer resX = (Integer) session.getAttribute("resolutionX"); String activateAlert = context.getContextParameter("ActivateAlert"); boolean isAlertsActivated = ( (activateAlert != null) && ("true".equalsIgnoreCase(activateAlert)) ); String alertType = context.getContextParameter("InfoBar.AlertType"); alertType = (alertType != null) ? alertType : GetInfoBarInformationAction.ALERTTYPE_SCROLL; Boolean isABDeployed = (Boolean)session.getAttribute(SaveActionbarCssAction.ACTIONBAR_DEPLOYED_ATTR); if (isABDeployed == null) { isABDeployed = true; } MenuBean menuBeanMaster = null; SoftwareBean swBeanMaster = null; String menuIdMaster = flRequest.getRequestParameterOrAttribute("mn"); if (menuIdMaster != null) { menuIdMaster = flRequest.getRequestParameterOrAttribute("MenID"); } String sfwIdMaster = flRequest.getRequestParameterOrAttribute("SfwID"); // First try the menu directly, and get sfwIdMaster from that if (menuIdMaster != null) { try { menuBeanMaster = new MenuBean(menuIdMaster, context); try { sfwIdMaster = menuBeanMaster.getMenSfwID(); } catch (FieldNotInitializedException fnie) { } swBeanMaster = new SoftwareBean(sfwIdMaster, context); } 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, context); menuBeanMaster = context.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"), context); swBeanMaster = new SoftwareBean(menuBeanMaster.getMenSfwID(), context); } catch (Exception e) { swBeanMaster = context.getLicenceManager().getSoftwareBeans().elementAt(0); } } String sfwCodeMaster = ""; try { sfwCodeMaster = swBeanMaster.getSfwCode(); } catch (FieldNotInitializedException e) { } if (sfwCodeMaster.equals("")) { sfwCodeMaster = "UNDEFINED"; } // Title StringBuilder pageTitle = new StringBuilder(); //get obj type String objType = flRequest.getRequestParameterOrAttribute("LoadedFooterType"); if (objType != null) { BasicBean objBean = (BasicBean)flRequest.getAttribute(objType); String objID = null; try { objID = objBean.getID(); } catch (Exception e) { } if (objID != null) { pageTitle.append(objBean.toString()); } else { ObjectsBean object = null; try { object = dico.getTable("sql", objType); } catch (FrontlineException fe) {} String objDisplay = null; pageTitle.append(Utils.getMessage(session, "A3057", "Créer") + " "); if("Enterprise".equalsIgnoreCase(objType)) { EnterpriseBean ent = (EnterpriseBean)flRequest.getAttribute("Enterprise"); try { objDisplay = (String)dico.getRefDisp(session, "enttyeid", ent.getEntTyeID()); } catch(FieldNotInitializedException ex) { } } else if (object != null) { try { String objDisplayLabel = object.getObjDisplayLabel(); if (objDisplayLabel != null) { objDisplay = Utils.getMessage(session, objDisplayLabel, ""); } } catch (FieldNotInitializedException fnie2) {} if (StringUtils.isEmpty(objDisplay)) { try { objDisplay = object.getObjDisplay(); } catch (FieldNotInitializedException fnie3) {} } }if("Opportunity".equalsIgnoreCase(objType)) { OpportunityBean opp = (OpportunityBean)flRequest.getAttribute("Opportunity"); try { objDisplay = (String)dico.getRefDisp(session, "OppStoID", opp.getOppStoID()); } catch(FieldNotInitializedException ex) { } } pageTitle.append(StringUtils.isEmpty(objDisplay) ? Utils.formatToWeb(objType, false) : objDisplay); } } if (pageTitle.length() > 0) { pageTitle.append(" - "); } pageTitle.append(Utils.getMessage(session, "M808B", "E-DEAL CRM")); FlLocale flLocale = FlLocale.getInstance(session); String language = flLocale.getLanguage(); boolean isGeolocalizationActivated = false; isGeolocalizationActivated = ContextHelper.isActivatedService(context, "Geolocalization"); String geocoderkey = (String) context.getContextParameter("GoogleMapKey"); String warnMsg = (String) session.getAttribute("warnMsg"); String contextFromRequest = (String)request.getAttribute("jsonContext"); if (contextFromRequest == null) { contextFromRequest = "{\"actorId\":\"" + actID + "\", \"locale\":\"" + language + "\"}"; } %>