<%@page import="com.edeal.frontline.Logger"%> <%@page import="com.edeal.frontline.InteractionBean"%> <%@page import="com.genesyslab.ail.Interaction"%> <%@page import="com.edeal.frontline.helper.InteractionBaseHelper"%> <%@page import="com.edeal.frontline.helper.custom.InteractionHelper"%> <%@page import="java.util.Map"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.Vector"%> <%@page import="org.json.JSONArray"%> <%@page import="org.json.JSONObject"%> <%@page import="com.edeal.frontline.FieldNotInitializedException"%> <%@page import="com.edeal.frontline.navigation.FlRequest"%> <%@page import="com.edeal.frontline.MessagesBean"%> <%@page import="com.edeal.frontline.EnterpriseBean"%> <%@page import="com.edeal.frontline.SolicitationBean"%> <%@page import="com.edeal.frontline.AttachmentBean"%> <%@page import="com.edeal.frontline.custom.Dossier_Bean"%> <%@page import="com.edeal.frontline.custom.Classement_Bean"%> <%@page import="com.edeal.frontline.helper.ContextHelper"%> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% InteractionHelper interactionHelper = new InteractionHelper(Interaction); //InteractionBaseHelper interactionHelper = new InteractionBaseHelper(Interaction); JSONArray emailCorrespondantJSONObj = interactionHelper.getEmailCorrespondantCustomJSONArray(); String emailCorrespondantJSON = emailCorrespondantJSONObj!=null?emailCorrespondantJSONObj.toString():"[]"; String idint = flRequest.getRequestParameterOrAttribute("id"); String idmsg=""; try{ idmsg = (String)InteractionBean.lookup(context, "IntMsgID", idint); }catch(Exception e){ } if(idmsg==null){ try{ InteractionBean intb = new InteractionBean(idint,context); MessagesBean msgb = new MessagesBean(context); msgb.save(); idmsg = msgb.getMsgID(); intb.setIntMsgID(idmsg); intb.save(); }catch(Exception e){ } } String corrsIdsTo = ""; String corrsIdsCc = ""; if (emailCorrespondantJSONObj != null) { int len = emailCorrespondantJSONObj.length(); for (int i=0;i docVectorID = new Vector(); Vector dossierAttID = null; Vector dossierAttNameID = null; /* 0041739: Relance de correspondance http://u-project2.umanis.com/view.php?id=41739 */ String type = null; try{ Interaction.getIntOppID(); Interaction.getIntMsgID(); type = "Opportunity"; }catch(FieldNotInitializedException dfg){ type = "Interaction"; } String modelType = "MODELE"; String frID= null; String deID= null; String enID= null; String esID= null; String itID= null; String lngRefID = null; String tiersID = null; try { tiersID = (String) Interaction.getCustomProperty("IntTiersConc_"); } catch (FieldNotInitializedException e) { } String dossierID = null; try { dossierID = (String) Interaction.getCustomProperty("IntDossierID_"); } catch (FieldNotInitializedException e) { } String classementID = null; try { dossierID = (String) Interaction.getCustomProperty("IntDossierLastCls"); } catch (FieldNotInitializedException e) { } String solicitationID = null; try { solicitationID = (String) Interaction.getCustomProperty("IntSolicitation_"); } catch (FieldNotInitializedException e) { } JSONArray emailCorrespondantAssosJSONObj = null; String emailCorrespondantAssoJSON = null; if(tiersID != null) { try { frID = dico.getRefIdByCode("Lna", "Te1", "fr_FR"); deID = dico.getRefIdByCode("Lna", "Te1", "de_DE"); enID = dico.getRefIdByCode("Lna", "Te1", "en_US"); esID = dico.getRefIdByCode("Lna", "Te1", "es_ES"); itID = dico.getRefIdByCode("Lna", "Te1", "it_IT"); } catch (Exception e) { } EnterpriseBean ent = new EnterpriseBean(tiersID, context); // la langue referente du tiers try { lngRefID = (String) ent.getCustomProperty("EntRefLngID_"); } catch (FieldNotInitializedException e) { lngRefID = frID; } if(lngRefID != null && dossierID != null) { // Tester si c'est un classement segmentation ou cocottes/cheminées Dossier_Bean dossier = new Dossier_Bean(dossierID,context); String[] flds = {"Cl_ID","Cl_ClassType"}; String[][] query = {{"Cl_Dossier = '" + dossierID + "'" }}; String[] orderBy = {"Cl_CrDt DESC"}; Vector result = Classement_Bean.listSummary(context, flds, query, orderBy); String classementType = null; if (result != null && !result.isEmpty()) { Hashtable tab = (Hashtable)result.elementAt(0); classementType = (String)tab.get("Cl_ClassType"); } String segHebClass =null; try{ segHebClass = dico.getRefIdByCode("Cy_", "Te1", "SEH"); } catch (FrontlineException e) { segHebClass=""; } String segResClass =null; try{ segResClass = dico.getRefIdByCode("Cy_", "Te1", "SER"); } catch (FrontlineException e) { segResClass=""; } if(!classementType.equals(segHebClass) && !classementType.equals(segResClass)){ // notif de la d�cision if(frID.equals(lngRefID)){ code = "DECISIONFR"; } else if(deID.equals(lngRefID)){ code = "DECISIONDE"; } else if(enID.equals(lngRefID)){ code = "DECISIONEN"; } else if(esID.equals(lngRefID)){ code = "DECISIONES"; } else if(itID.equals(lngRefID)){ code = "DECISIONIT"; } else { code = "DECISIONFR"; } } // mettre en copie l'association li�e au tiers si elle existe //http://u-project2.umanis.com/view.php?id=40672 String assoID = null; try { assoID = (String) ent.getCustomProperty("EntStructureLocalID_"); } catch (FieldNotInitializedException e) { } if(assoID != null) { //emailCorrespondantAssosJSONObj = interactionHelper.getEmailCorrespondantAssoCustomJSONArray(assoID); emailCorrespondantAssosJSONObj = interactionHelper.getEmailCorrespondantAssoCustomJSONArrayWithConTech(assoID,ent.getEntID()); emailCorrespondantAssoJSON = emailCorrespondantAssosJSONObj!=null?emailCorrespondantAssosJSONObj.toString():"[]"; if (emailCorrespondantAssosJSONObj != null) { int len = emailCorrespondantAssosJSONObj.length(); for (int i=0;i(); dossierAttDossNameID = new Vector (); try { dossierAttDossID = (Vector) ds_.getDs_Fichiers(); } catch (FieldNotInitializedException e) { } for (int i =0; i< dossierAttDossID.size(); i++) { AttachmentBean att = new AttachmentBean((String)dossierAttDossID.elementAt(i), context); try { dossierAttDossNameID.add((String)att.getAttFileName()); } catch (Exception e) { } } } if(solicitationID != null) { SolicitationBean sol = new SolicitationBean(solicitationID, context); // r�cup des pi�ces jointes des sollicitations dossierAttSolID = new Vector (); dossierAttSolNameID = new Vector (); try { dossierAttSolID = (Vector) sol.getSolAttID(); } catch (FieldNotInitializedException e) { } for (int i =0; i< dossierAttSolID.size(); i++) { AttachmentBean att = new AttachmentBean((String)dossierAttSolID.elementAt(i), context); try { dossierAttSolNameID.add((String)att.getAttFileName()); } catch (Exception e) { } } } // r�cup�ration des pi�ces jointes try { dossierAttGlobalID = new Vector (); dossierAttGlobalNameID = new Vector (); try { dossierAttGlobalID = (Vector) Interaction.getIntAttID(); } catch (FieldNotInitializedException e) { } for (int i =0; i< dossierAttGlobalID.size(); i++) { AttachmentBean att = new AttachmentBean((String)dossierAttGlobalID.elementAt(i), context); try { dossierAttGlobalNameID.add((String)att.getAttFileName()); } catch (FieldNotInitializedException e) { } } } catch (Exception e) { } // remplir dossierAttID, dossierAttNameID try { dossierAttID = new Vector (); dossierAttNameID = new Vector (); if(dossierAttGlobalID != null && dossierAttGlobalNameID != null) { // remplir le vecteur for (int i =0; i< dossierAttGlobalID.size(); i++) { dossierAttID.add((String)dossierAttGlobalID.elementAt(i)); } for (int i =0; i< dossierAttGlobalNameID.size(); i++) { dossierAttNameID.add((String)dossierAttGlobalNameID.elementAt(i)); } } if(dossierAttSolID != null && dossierAttSolNameID != null) { // remplir le vecteur for (int i =0; i< dossierAttSolID.size(); i++) { dossierAttID.add((String)dossierAttSolID.elementAt(i)); } for (int i =0; i< dossierAttSolNameID.size(); i++) { dossierAttNameID.add((String)dossierAttSolNameID.elementAt(i)); } } if(dossierAttDossID != null && dossierAttDossNameID != null) { // remplir le vecteur for (int i =0; i< dossierAttDossID.size(); i++) { dossierAttID.add((String)dossierAttDossID.elementAt(i)); } for (int i =0; i< dossierAttDossNameID.size(); i++) { dossierAttNameID.add((String)dossierAttDossNameID.elementAt(i)); } } if(dossierAttID!= null && !dossierAttID.isEmpty()) { String x = ""; MessagesBean msgb = null; Vector attids = null; try{ msgb = new MessagesBean(idmsg,context); attids = (Vector)msgb.getMsgAttID(); }catch(Exception e){ } //Vector attfns = msgb.getMsgAttFileName(); boolean update = false; if(attids!=null){ for (int i=0; i <% } } } catch (Exception e) { String x = ""; } /*code du message � initilaiser*/ if(code != null) { String[] fieldsQuery = {"MsgID", "MsgSubject", "MsgDocID"}; String[][] queryList = {{"MsgCode = '" + code + "'"}}; String[] orderBy = {"MsgCrDt DESC"}; Vector listRes = MessagesBean.listSummary(context, fieldsQuery, queryList); // on prend le premier MESSAGE si la liste n'est pas vide if(listRes != null && !listRes.isEmpty()) { Hashtable tab = (Hashtable)listRes.firstElement(); idModDefaut = (String)tab.get("MsgID"); dispModele = (String)tab.get("MsgSubject"); docVectorID = (Vector)tab.get("MsgDocID"); if(docVectorID !=null && !docVectorID.isEmpty()){ docID= (String)docVectorID.firstElement(); } } } // pour n'afficher que les mod�les de fusion de l'int�raction String idObjInteraction = dico.getTable("sql", "Interaction").getObjID(); String query =""; query ="[[DocObjID = '" + idObjInteraction + "']]"; ObjectsBean docBean = dico.getTable("sql", "Document"); String xmlListSelect = docBean.getObjSelectListID(); %> <% ObjectsBean actorBean = dico.getTable("sql", "Actor"); String xmlActortListID = null; try { xmlActortListID = actorBean.getObjSelectListID(); } catch (FieldNotInitializedException e) { } ObjectsBean personBean = dico.getTable("sql", "Person"); String xmlPersonListID = null; try { xmlPersonListID = personBean.getObjSelectListID(); } catch (FieldNotInitializedException e) { } %> <% try { Interaction.getIntPvtID(); %> <% } catch (FieldNotInitializedException e) { } %> <% try { Interaction.getIntAtvID(); %> <% } catch (FieldNotInitializedException e) { } String selectPersonLinkMultiple = ""; if (xmlPersonListID != null) { selectPersonLinkMultiple = "xml_select_multiple_list.fl?id=" + xmlPersonListID; } else { if (ContextHelper.hasMultifunction(context)) { selectPersonLinkMultiple = "xml_select_multiple_list.fl?code=FUNCTIONS"; } else { selectPersonLinkMultiple = "xml_select_multiple_list.fl?code=PERSON"; } } String selectActorLinkMultiple = ""; if (xmlActortListID != null) { selectActorLinkMultiple = "xml_select_multiple_list.fl?id=" + xmlActortListID; } else { selectActorLinkMultiple = "xml_select_multiple_list.fl?code=ACTOR"; } String selectCorrespondentToMultiple = ""; selectCorrespondentToMultiple = "select_correspondent_realize_mail.fl?CorID=" + corrsIdsTo + "&multivalSeparator=|"; String selectCorrespondentCcMultiple = ""; selectCorrespondentCcMultiple = "select_correspondent_realize_mail.fl?CorID=" + corrsIdsCc + "&multivalSeparator=|"; %> <%-- --%> <%-- --%>
<% Vector> emailModels = (Vector>)request.getAttribute("emailModels"); String intRefMsgID = null; try { try{ intRefMsgID = Interaction.getIntRefMsgID(); }catch(Exception exx){ intRefMsgID = Interaction.getIntMsgID(); } /* * 43358: Un modèle n'est plus appliqué (FD) * http://u-project2.umanis.com/view.php?id=43358 */ Object field = MessagesBean.lookup(context, "MsgSubject", intRefMsgID); if(field==null){ throw new Exception(); }else{ dispModele = field.toString(); } } catch (Exception e) { if(idModDefaut!=null) intRefMsgID = idModDefaut; else intRefMsgID = null; } if (emailModels!=null && emailModels.size()>0) { %> <%--
Charger le mod�le" alt="" class="icon" src="/icons/ico/importer.gif"/>
--%> <% } else { %>
S�lectionner" alt="" class="icon" src="/icons/ico/rechercher.gif"/> Vider le champ" alt="" class="icon" src="/icons/ico/supprimer.gif"/> Charger le mod�le" alt="" class="icon" src="/icons/ico/importer.gif"/>
<% } %> <% if (Boolean.valueOf(request.getParameter("loadmodel"))) { %> <% } else { %> <% } %>
<%-- Mod�le Apercu --%>
<% if(docID != null) { %> <%} %>
<fl:getMessage code=" title="">

"> <%-- --%>
" target="POPUP" url='xml_select_multiple_list_interaction.fl?IntID=<%=idInteraction%>&id=<%=xmlListSelect%>&field=MsgDocID&formIndex=0&query=%5B%5BDocObjID+%3D+%27<%=idObjInteraction%>%27%5D%5D' >
"> <%-- --%>
<%-- ">
--%>