% /****************************************************************************** * Copyright (c) 2000-2013 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 session="true"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.services.FlServiceException" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.ObjectsBean" %> <%@ page import="com.edeal.frontline.MessagesBean" %> <%@ page import="java.util.*" %> <%@ 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 id = null; try { id = Messages.getID(); } catch (FieldNotInitializedException fnie) { id = null; } String MsgTypeForm_ = null; String FRMGUIDE = null; boolean champsOblig = false; try { FRMGUIDE = (String)dico.getRefIdByCode("Ftp", "Te1", "FRMGUIDE"); } catch (Exception e) { e.printStackTrace(); FRMGUIDE = null; } /* try { MsgTypeForm_ = (String)Messages.getCustomProperty("MsgTypeForm_"); } catch (Exception e) { e.printStackTrace(); MsgTypeForm_ = null; } */ String msgObjID = null; try { msgObjID = Messages.getMsgObjID(); } catch (Exception e) { } String pCode = flRequest.getParameter("code"); String pCty = flRequest.getParameter("cty"); String pNext = flRequest.getParameter("next"); String pTarget = flRequest.getParameter("target"); String pObject = flRequest.getParameter("object"); MessagesBean obj = (MessagesBean)request.getAttribute("Messages"); if (pObject != null && !"".equals(pObject)) { obj.setMsgObjID(pObject); } String msgCty = null; try { msgCty = dico.getRefCode("MsgCtyID", obj.getMsgCtyID()); if("MIME".equalsIgnoreCase(msgCty)) { Utils.forward(request, response, "/read_messages.fl" + (id == null ? "" : "?id=" + id)); } } catch (Exception ex) { Vector refDefault = (Vector) dico.getRefCodeList("MsgCtyID").get(0); msgCty = (String) (refDefault.get(1)); obj.setMsgCtyID((String) refDefault.get(0)); } //Set the default value for the text body if it's null String defaultMsgBodyText = Utils.getMessage(session, "L8131", false, "Vous pouvez visualiser ce message sur $$url_readmail$$."); try { Messages.getMsgBodyText(); } catch (FieldNotInitializedException fnie) { Messages.setMsgBodyText(defaultMsgBodyText); } String[] objFields = { "ObjID", "ObjDisplay", "ObjSql", "ObjRadical"}; String[][] objQuery = {{ "ObjSql in (" + Utils.formatToSQL(context, "PersonEvent") + ", " + Utils.formatToSQL(context, "Person") + ", " + Utils.formatToSQL(context, "Contrat_") + ", " + Utils.formatToSQL(context, "Solicitation") + ", " + Utils.formatToSQL(context, "License_") + ", " + Utils.formatToSQL(context, "PaymentSlip_") + ", " + Utils.formatToSQL(context, "Silhouette") + ", " + Utils.formatToSQL(context, "Actor") + ", " + Utils.formatToSQL(context, "FAQ") + ", " + Utils.formatToSQL(context, "Comments") + ", " + Utils.formatToSQL(context, "FAQHeader") + ", " + Utils.formatToSQL(context, "Correspondent") + ", " + Utils.formatToSQL(context, "Opportunity") + ", " + Utils.formatToSQL(context, "Interaction") + ", " + Utils.formatToSQL(context, "ContratProduit_") + ", " + Utils.formatToSQL(context, "Form") + ", " + Utils.formatToSQL(context, "CmdGiftCheque_") + ")"}}; String[] objOrderBy = { "ObjDisplay" }; Vector objList; try { objList = ObjectsBean.listSummary(session, objFields, objQuery, objOrderBy); } catch (FrontlineException e) { objList = new Vector(); } String msgType = null; try{ msgType = Messages.getMsgType(); }catch(FieldNotInitializedException e){ msgType = dico.getRefIdByCode("MsgType","MODELE"); } String msgEvtID = ""; try{ msgEvtID = Messages.getMsgEvtID(); }catch(FieldNotInitializedException e){ } boolean hasFileStorageService; try{ context.getServiceManager().getServiceClient("FileStorage"); hasFileStorageService = true; }catch(FlServiceException e){ hasFileStorageService = false; } boolean hasUrlTrackingService; try{ context.getServiceManager().getServiceClient("UrlTracking"); hasUrlTrackingService = true; }catch(FlServiceException e){ hasUrlTrackingService = false; } String msgLngCode = null; try { String msgLngID = Messages.getMsgLngRef(); msgLngCode = dico.getRefCode("msgLngID",msgLngID); } catch (Exception e) { msgLngCode = "fr_FR"; } String CIBLE_RADICAL = "Pvt"; String cible_ID = ""; String NonRepondu = dico.getRefIdByCode("Esp", "Te1", "NORES"); String RienPaye = dico.getRefIdByCode("Sf_", "Te1", "PRN"); String QSTGuide = dico.getRefIdByCode("Ftp", "Te1", "FRMGUIDE"); System.out.println("QSTGuide= "+QSTGuide); %> " objectTitle="<%= Utils.getMessage(session, \"F6002\", \"Message\") %>" ou="<%= \"/edit_messages.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <% if(pCty != null) { String ctyID = dico.getRefIdByCode("MsgCtyID", pCty); %> <%= dico.getRefDisp(session, "MsgCtyID", ctyID) %><% } else { %> <% } %> <%-- --%> <% if (objList != null && objList.size() > 0) { %> <% for (int i = 0; i < objList.size(); i++) { Hashtable row = (Hashtable)objList.elementAt(i); String objID = (String)row.get("ObjID"); String objDisplay = (String)row.get("ObjDisplay"); String objSql = (String)row.get("ObjSql"); String objRadical = (String)row.get("ObjRadical"); if(objRadical!=null && !objRadical.isEmpty() && objRadical.equals(CIBLE_RADICAL)) cible_ID = objID; %> ><%= objDisplay != null ? Utils.formatToWeb(objDisplay, false) : Utils.formatToWeb(objSql, false) %> <% } %> <% } %> "> "> <% if("TEXT/HTML".equals(msgCty)){ %> <%} %>