Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\netbusiness\messages\edit.jsp
<% /****************************************************************************** * 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" %> <jsp:useBean class="com.edeal.frontline.MessagesBean" id="Messages" scope="request"/><% 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); %> <script language="javascript"> function doRefresh() { var f = document.forms[0]; presentFieldsValue(); f.action = "<fl:link url='/refresh_message.fl'/>"; doExitConf = false; f.submit(); } </script> <fl:form action="/save_messages.fl" bean="Messages"> <input type="hidden" id="MsgType" name="MsgType" value="<%= msgType %>"/> <input type="hidden" id="MsgEvtID" name="MsgEvtID" value="<%= msgEvtID %>"/> <fl:bigTabs listTitle="<%= Utils.getMessage(session, \"L0020\", \"Liste des messages\") %>" objectTitle="<%= Utils.getMessage(session, \"F6002\", \"Message\") %>" ou="<%= \"/edit_messages.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <table class="container" cellpadding="0"> <tr> <td colspan="3"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="labelTitreFiche"> <fl:label field="MsgSubject" labelClassName="titreFiche"/> </td> <td class="fieldTitreFiche"> <fl:input property="MsgSubject" mandatoryMsgCode="M000C" /> </td> </tr> </table> </td> </tr> <tr class="ligne_separation"><td colspan="3"></td></tr> <tr> <td class="column2"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><fl:label field="MsgCtyID"/></td> <td class="dataValue"> <div> <% if(pCty != null) { String ctyID = dico.getRefIdByCode("MsgCtyID", pCty); %> <input name="MsgCtyID" type="hidden" value="<%= ctyID %>"><%= dico.getRefDisp(session, "MsgCtyID", ctyID) %><% } else { %> <select name="MsgCtyID" id="MsgCtyID" class="input select" onchange="doRefresh();"> <fl:getProperty name="Messages" property="MsgCtyID" alt="" type="select" except="MIME" edit="true"/> </select> <% } %> </div> </td> </tr> <fl:fieldEdit property="MsgCode" mandatoryMsgCode="L6144" unicityMsgCode="M6045"/> <fl:fieldEdit property="MsgTypeForm_" except="FRMENV;FRMOPT" /> <fl:fieldEdit property="MsgTypeEnvoi_"/> <%-- <fl:fieldEdit property="MsgTypeTiers_"/> <fl:fieldEdit property="MsgTypeContrat_"/> --%> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"><fl:label field="MsgObjID"/></td> <td class="dataValue"> <div> <% if (objList != null && objList.size() > 0) { %> <select name="MsgObjID" id="MsgObjID" class="input select chpsTextObligatoire" onchange="javascript:checkCibleFields(this);" > <option ed:objsql="" value=""></option> <% 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; %> <option ed:objsql="<%=Utils.formatToWeb(objSql, false) %>" value="<%= Utils.formatToWeb(objID, true) %>"<%= objID != null && objID.equals(msgObjID) ? " selected" : "" %>><%= objDisplay != null ? Utils.formatToWeb(objDisplay, false) : Utils.formatToWeb(objSql, false) %></option> <% } %> </select> <% } %> </div> </td> </tr> <fl:fieldEdit property="MsgLngRef"/> <!-- http://u-project2.umanis.com/view.php?id=48306 | Elimination du statut intégré du "except" pour l'afficher dans les options à cocher | mmi --> <fl:fieldEdit property="MsgStatParticip_" except="OK;NOK;NO;INT;NOINT;RDV;DOC;EVTNPAI;UNKN;CRENV"/> <fl:fieldEdit property="MsgStatFinanc_"/> </table> </td> </tr> </table> <table class="container" cellpadding="0"> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:label field="MsgBody"/></td> </tr> <tr> <td class="dataValue noPaddingLeft"> <fl:input height="350px" property="MsgBody" nodiv="true"/> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titrePartie"><fl:label field="MsgBodyText"/></td> </tr> <tr> <td class="dataValue noPaddingLeft"><fl:input property="MsgBodyText" nodiv="true"/></td> </tr> <tr class="ligne_separation"><td></td></tr> </table> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <fl:smallTabs name="AttachmentsTabs"> <fl:sTab id="files" title="<%= Utils.getMessage(session, \"L201C\", false, true, \"Documents joints\") %>"> <fl:attach name="Messages" colID="MsgAttID" edit="true"/> </fl:sTab> <fl:sTab id="docs" title="<%= Utils.getMessage(session, \"L813E\", false, true, \"Références documentaire\") %>"> <table class="container" cellpadding="0"> <tr> <td class="column2"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="column2"> <table class="container" cellpadding="0"> <fl:fieldEdit property="MsgDocID" name="Messages"/> </table> </td> </tr> <tr class="fieldline"><td></td></tr> </table> </td> <td style="width:20px"></td> <td class="column2"></td> </tr> </table> </fl:sTab> </fl:smallTabs> </fl:bigTabs> </fl:form> <script type="text/javascript"> function checkCibleFields(e){ var cibleid = '<%=cible_ID%>'; var objid = e.options[e.selectedIndex].value; try{ if(objid.indexOf(cibleid)==0 && cibleid.indexOf(objid)==0){ showCibleFields(); }else{ hideCibleFields(); } }catch(x){} } function setDisplayElement(e,s){ document.getElementById(e+"_label").parentElement.style.display = s.indexOf('on')==0 ? 'table-row' : 'none'; } function showCibleFields(){ setDisplayElement("MsgStatParticip_","on"); setDisplayElement("MsgStatFinanc_","on"); setDisplayElement("MsgTypeForm_","on"); setDisplayElement("MsgTypeEnvoi_","on"); } function hideCibleFields(){ setDisplayElement("MsgStatParticip_","off"); setDisplayElement("MsgStatFinanc_","off"); setDisplayElement("MsgTypeForm_","off"); setDisplayElement("MsgTypeEnvoi_","off"); } checkCibleFields(document.getElementById('MsgObjID')); <% if(id == null){ %> var listStatutPart = document.getElementsByName("MsgStatParticip_"); var listStatutFinance = document.getElementsByName("MsgStatFinanc_"); var StatutPart; var StatutFinance; for(var i=0; i<listStatutPart.length; i++){ StatutPart = listStatutPart[i].value; if(StatutPart == '<%=NonRepondu%>'){ listStatutPart[i].checked = true; } } for(var j=0; j<listStatutFinance.length; j++){ StatutFinance = listStatutFinance[j].value; if(StatutFinance == '<%=RienPaye%>'){ listStatutFinance[j].checked = true; } } <% } %> function doSubmit() { var testPartOK = false; var testFinOK = false; var QuestionnaireGuide = document.forms[0].MsgTypeForm_.value; var objet = document.forms[0].MsgObjID.value; if(objet == '<%=cible_ID%>'){ if(QuestionnaireGuide == '<%=QSTGuide%>'){ var listStatutPart = document.getElementsByName("MsgStatParticip_"); var listStatutFinance = document.getElementsByName("MsgStatFinanc_"); for(var i=0; i<listStatutPart.length; i++){ if(listStatutPart[i].checked == true){ testPartOK = true; break; } } for(var j=0; j<listStatutFinance.length; j++){ if(listStatutFinance[j].checked == true){ testFinOK = true; break; } } if(testPartOK == true && testFinOK == true){ return true; }else{ alert('<fl:getMessage code="MF174" alt="Veuillez cochez un statut" js="true"/>'); return false; } //le else si le client demande un traitement pour les questionnaire stat }else{ return true; } } else { return true; } } </script> <!-- CKEditor --> <% if("TEXT/HTML".equals(msgCty)){ %> <script type="text/javascript" src="<fl:webapp/>/js/wysiwyg/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="<fl:webapp/>/js/wysiwyg/ckeditor/adapters/jquery.js"></script> <script type="text/javascript"> var simpleLinkURL = ''; var simpleLinkText = ''; var editor = CKEDITOR.replace('MsgBody', { <% if (hasFileStorageService) { %> filebrowserImageBrowseUrl : '<fl:webapp/>/js/wysiwyg/filemanager/index.jsp', filebrowserWindowWidth : 1024, filebrowserWindowHeight : 500, height : "350", <% } %> resize_enabled : false, toolbar : [ ['Styles','Format','Font','FontSize','-','Bold','Italic','Underline','StrikeThrough','-','Undo','Redo','-','Cut','Copy','Paste','Find','Replace','-','Outdent','Indent','-','Print'], '/', ['NumberedList','BulletedList','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], [<% if(hasFileStorageService){ %>'Image',<% } %>'Table','-','Link','Flash','Smiley','TextColor','BGColor','Source','-','FusionButton','SimpleLinkButton'<%if(hasUrlTrackingService) { %>,'TrackingLinkButton','SnippetButton'<% } %>] ] }); CKEDITOR.on( 'dialogDefinition', function( ev ){ var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if ( dialogName == 'image' ){ dialogDefinition.removeContents('advanced'); // Get a reference to the 'Image Info' tab. var infoTab = dialogDefinition.getContents('info'); // Remove unnecessary widgets from the 'Image Info' tab. infoTab.remove('txtHeight'); infoTab.remove('txtWidth'); infoTab.remove('txtBorder'); infoTab.remove('txtHSpace'); infoTab.remove('txtVSpace'); infoTab.remove('cmbAlign'); infoTab.remove('btnLockSizes');// infoTab.remove('btnResetSize'); infoTab.remove('previewImage'); infoTab.remove('ImagePreviewLoader'); infoTab.remove('ImagePreviewBox'); infoTab.remove('previewImage'); } }); editor.on('pluginsLoaded', function( ev ){ //Fusion button editor.addCommand('fusionCommand', { exec : function(editor) { getFusionField(); } }); editor.ui.addButton('FusionButton', { label : '<fl:getMessage code="F7066" alt="Fusion" js="true"/>', command : 'fusionCommand', icon: '<fl:webapp/>/icons/fusion.gif' }); //Tracking link button editor.addCommand('tlinkCommand', { exec : function(editor) { getTrackingLink(); } }); editor.ui.addButton('TrackingLinkButton', { label : '<fl:getMessage code="L702E" alt="Lien Suivi" js="true"/>', command : 'tlinkCommand', icon: '<fl:webapp/>/icons/link_go.gif' }); //Simple link button editor.addCommand('slinkCommand', { exec : function(editor) { getSimpleLink(); } }); editor.ui.addButton('SimpleLinkButton', { label : '<fl:getMessage code="L6180" alt="Lien" js="true"/>', command : 'slinkCommand', icon: '<fl:webapp/>/icons/link.gif' }); //Snippet Email button editor.addCommand('snippetCommand', { exec : function(editor) { getSnippet(); } }); editor.ui.addButton('SnippetButton', { label : '<fl:getMessage code="L706A" alt="Snippet" js="true"/>', command : 'snippetCommand', icon: '<fl:webapp/>/icons/snippet.gif' }); }); editor.on('doubleclick', function( ev ){ var element; if(editor.getSelection().getType() == CKEDITOR.SELECTION_ELEMENT){ element = editor.getSelection().getSelectedElement(); if (element.hasAttribute('href')) { if (element.hasAttribute('ed:id') && element.getAttribute('class') == 'linktracking'){ trackingLinkID = element.getAttribute('ed:id'); getTrackingLink(trackingLinkID); } else { simpleLinkURL = element.getAttribute('href'); simpleLinkText = element.getText(); getSimpleLink(); } } ev.stop(); } }); function insertFusionField(sqlName, lbl, id){ var value = '<span id="' + id + '" title="' + sqlName + '" ed:fusionfield="'+sqlName+'">$$' + lbl + '$$</span> '; if ( editor.mode == 'wysiwyg' ){ editor.insertHtml(value); } if (fusionFieldPopUp != null) { window.setTimeout("fusionFieldPopUp.focus()",400); } } function insertSnippet(content){ if ( editor.mode == 'wysiwyg' ){ editor.insertHtml(decodeURIComponent(content)); } if (snippetPopUp != null) { window.setTimeout("snippetPopUp.focus()",400); } } function insertTrackingLink(link, text, idel){ var value = "<a href='" + link + "' class='linktracking' ed:id='" + idel + "'>" + text + "</a>"; var element = CKEDITOR.dom.element.createFromHtml(value); editor.insertElement(element); } function insertSimpleLink(link,text){ var value = "<a href='" + link + "'>" + text + "</a>"; if ( editor.mode == 'wysiwyg' ){ editor.insertHtml(value); } } function insertContents(value){ editor.setData(value); } function getContents(){ return editor.getData(); } function isEmptyContents(){ var editor_val = editor.document.getBody().getText(); if (editor_val != '') { return false ; } return true ; //return ( ("" == getContents()) || ('<br />\n' == getContents()) || ('<br />' == getContents())); } var fusionFieldPopUp; var snippetPopUp; function getFusionField(){ var desType = getdestType(); if (desType != '') { fusionFieldPopUp = window.open('<fl:link list="false" url="/fusion_popup.fl"/>&destype=' + desType, '', 'toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no, width=600, height=320'); } else { alert('<fl:getMessage code="M6056" alt="Veuillez choisir un objet" js="true"/>'); } } function getTrackingLink(elnID){ urlPopUp = '<fl:link list="false" url="<%= \"/edit_tracking_link.fl\" + (id != null ? \"?meID=\" + id : \"\") %>"/>'+ (elnID ? '&elnID=' + elnID : ''); window.open(urlPopUp,'', 'menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes,location=no,width=600,height=200'); } function getSnippet(){ var f = document.forms[0]; var url='<fl:link list="false" url="/get_snippet.fl"/>'; if (f.MsgLngRef) { if (f.MsgLngRef.value != "") { url = url + "&EmtLanguage=" + f.MsgLngRef.value; } } snippetPopUp = window.open(url,'', 'toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no,width=600, height=200'); } function getSimpleLink(){ window.open('<fl:link list="false" url="/edit_simple_link.fl"/>','', 'toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no, width=600, height=200'); } function getdestType(){ return $("#MsgObjID option:selected").attr("ed:objsql"); } </script> <%} %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de