Edit C:\Windows\install\galaxie_p01_01-10\sales\person\person_js.jsp
<% /****************************************************************************** * Copyright (c) 2000-2011 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 import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.helper.ContextHelper" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page contentType="text/javascript; charset=UTF8" session="true" %> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); String salesModel = request.getParameter("salesModel"); if (salesModel == null) { salesModel = ""; } String pad = request.getParameter("pad"); boolean personalAddressDefault = "true".equalsIgnoreCase(pad); String emailPattern = request.getParameter("emailPattern"); if (emailPattern == null) { emailPattern = ""; } String PerLocID = request.getParameter("PerLocID"); if (PerLocID == null) { PerLocID = ""; } String id = request.getParameter("id"); %> var eraseFaxOnSubmit = false; var showEmailChange = true; function doAllFormatTel() { var f = document.forms[0]; doFormatTel(f.PerPhone, '<fl:getMessage code="L30B8" alt="Saisie du téléphone" js="true"/> :', f.PerCtrID); doFormatTel(f.PerMobile, '<fl:getMessage code="L62AB" alt="Saisie du mobile" js="true"/> :', f.PerCtrID); if (f.PerFax) { doFormatTel(f.PerFax, '<fl:getMessage code="L30B9" alt="Saisie du fax" js="true"/> :', f.PerCtrID); } } function doPerLocIDChange() { var f = document.forms[0]; doAjax('<fl:webapp/>/sales/person/loc_change_ajax.jsp?newLocID=' + f.PerLocID.value + '&newEntID=' + f.PerEntID.value); } function doUpdatePersonFromSilhouette() { var f = document.forms[0]; doAjax('<fl:webapp/>/getSilhouetteFromEmailOrCookie.fl?emailOrCookie=' + f.PerMail.value); } var mailPatternVal = ''; var perPhoneVal = ''; var perFaxVal = ''; var isPerEntIDChangedFirstTime = true; function doPerEntIDChange() { <% if (Utils.isEmpty(id) || !ContextHelper.hasMultifunction(context)) { %> updateEntFields(); <% } else { %> if (!isPerEntIDChangedFirstTime) { var namePopup = "entchangePopup"; var urlPopup = "<fl:webapp/>/open_popup_entchange.fl"; jQuery.openPopupLayer({ name: namePopup, width: "auto", height: "auto", cache: true, url: urlPopup, error: function () { //alert("Erreur lors de l'ouverture de la popup !"); } }); } else { isPerEntIDChangedFirstTime = false; } <% } %> } function updateEntFields (popName) { $.closePopupLayer(popName); var f = document.forms[0]; doAjax('<fl:webapp/>/sales/person/ent_change_ajax.jsp?newEntID=' + f.PerEntID.value + '&PerLocID=<%= PerLocID %>'); if (!isPerEntIDChangedFirstTime) { loadEntFieldsValues(); if (window.confirm('<fl:getMessage code="L7093" alt="Voulez-vous mettre à jour les champs Téléphone et Fax ?" js="true"/>')) { f.PerPhone.value = perPhoneVal; } doEmailPattern(mailPatternVal); } else { if (f.PerEntID.value != '') { isPerEntIDChangedFirstTime = false; } } } function loadEntFieldsValues() { var f = document.forms[0]; if (f.PerEntID) { $.getJSON("<fl:webapp/>/get_ent_fields.fl?newEntID=" + f.PerEntID.value, function(data) { perPhoneVal = data.entPhone; if (f.PerFax) { perFaxVal = data.entFax; } mailPatternVal = data.entEmailPattern; }); } } function doPerPhoneChange() { var f = document.forms[0]; var phoneField = f.PerPhone; if (f.PerFax) { var faxField = f.PerFax; } var countryField = f.PerCtrID; if (faxField && faxField.value == '' && phoneField.value.length > 3) { faxField.value = phoneField.value.substring(0, phoneField.value.length - 3); eraseFaxOnSubmit = true; } if (faxField && faxField.value == '' && phoneField.value.length > 3) { faxField.value = phoneField.value.substring(0, phoneField.value.length - 3); eraseFaxOnSubmit = true; } doFormatTel(phoneField, '<fl:getMessage code="L30B8" alt="Saisie du téléphone" js="true"/> :', countryField); } function doPerMobileChange() { var f = document.forms[0]; var mobileField = f.PerMobile; var countryField = f.PerCtrID; doFormatTel(mobileField, '<fl:getMessage code="L62AB" alt="Saisie du mobile" js="true"/> :', countryField); } function doPerFaxChange() { var f = document.forms[0]; var faxField = f.PerFax; var countryField = f.PerCtrID; doFormatTel(faxField, '<fl:getMessage code="L30B9" alt="Saisie du fax" js="true"/> :', countryField); eraseFaxOnSubmit = false; } function doCountryChange() { <% if (personalAddressDefault) { %> var f = document.forms[0]; var field = f.PerCtrID; var oldCountry = f.country; retrieveCity(field.options[field.selectedIndex].value, f.PerZip.value, 'PerCity'); doEpureTel(f.PerPhone, f.PerPhone, oldCountry); if (f.PerFax) { doEpureTel(f.PerFax, f.PerFax, oldCountry); } oldCountry.value = field.options[field.selectedIndex].value; doFormatTel(f.PerPhone, '<fl:getMessage code="L30B8" alt="Saisie du téléphone" js="true"/> :', field); if (f.PerFax) { doFormatTel(f.PerFax, '<fl:getMessage code="L30B9" alt="Saisie du fax" js="true"/> :', field); } <% } %> } function removePerEntID() { mf = document.forms[0]; mf.PerEntID.value = ""; mf.lblPerEntID.value = ""; } function doPerEntIDRemove() { if(window.confirm('<fl:getMessage code="L7094" alt="Voulez-vous vider les champs Téléphone, Fax et E-mail?" js="true"/>')) { mf = document.forms[0]; mf.PerPhone.value = ""; if (mf.PerFax) { mf.PerFax.value = ""; } } } function doEmailPattern(emailPattern) { f = document.forms[0]; var oldEmailAddress = f.PerMail.value; var firstName = f.PerFstName.value; firstName = checkString(firstName, 'lower'); firstName = checkString(firstName, 'remaccents'); while(firstName.indexOf(' ') > -1) { firstName = firstName.replace(' ', ''); } var name = f.PerName.value; name = checkString(name, 'lower'); name = checkString(name, 'remaccents'); while(name.indexOf(' ') > -1) { name = name.replace(' ', ''); } var pattern = ''; if (emailPattern == undefined) { pattern = '<%= emailPattern != null ? emailPattern : "" %>'; } else { pattern = emailPattern; } if (name == '') return; if (pattern == '') return; var newEmailAddress = pattern; if (firstName != '') newEmailAddress = newEmailAddress.replace('FIRST', firstName); if (firstName != '') { if (firstName.indexOf("-") != -1){ newEmailAddress = newEmailAddress.replace('INITIAL', firstName.charAt(0)+firstName.substring(firstName.indexOf("-")+1,firstName.indexOf("-")+2)); }else { newEmailAddress = newEmailAddress.replace('INITIAL', firstName.charAt(0)); } } newEmailAddress = newEmailAddress.replace('NAME', name); if (newEmailAddress != oldEmailAddress) { if (oldEmailAddress != '' && showEmailChange) { if (confirm("<fl:getMessage code="M608E" alt="Le modèle d\\\'adresse e-mail de l\\\'entreprise suggère de remplacer" js="true"/>\n'" + oldEmailAddress + "' <fl:getMessage code="L617E" alt="par" js="true"/> '" + newEmailAddress + "'\n<fl:getMessage code="M606C" alt="Voulez-vous continuer?" js="true"/>")) { f.PerMail.value = newEmailAddress; } } else { try { f.PerMail.value = newEmailAddress; } catch (error) { } } } } function doPerFstNameChange() { var f = document.forms[0]; if (f.PerFstName.value != '<%= Utils.getMessage(session, "F611C", true, "<Prénom>") %>') { f.PerFstName.value = checkString(f.PerFstName.value, 'capitalize'); if (f.PerName.value != '<%= Utils.getMessage(session, "F611D", true, "<Nom>") %>') { //doVerifMatchCode(); doEmailPattern(); } } } function doPerNameChange() { var f = document.forms[0]; if (f.PerName.value != '<%= Utils.getMessage(session, "F611D", true, "<Nom>") %>') { f.PerName.value = checkString(f.PerName.value, 'upper'); if (f.PerFstName.value != '<%= Utils.getMessage(session, "F611C", true, "<Prénom>") %>') { doEmailPattern(); } } } function doZipChange() { var f = document.forms[0]; retrieveCity(f.PerCtrID.options[f.PerCtrID.selectedIndex].value, f.PerZip.value, 'PerCity'); } function doOnLoad() { var f = document.forms[0]; if (f) { if (f.PerCtrID) { f.PerCtrID.onchange = doCountryChange; } if (f.PerPhone) { f.PerPhone.onchange = doPerPhoneChange; } if (f.PerFax) { f.PerFax.onchange = doPerFaxChange; } if (f.PerMobile) { f.PerMobile.onchange = doPerMobileChange; } if (f.PerZip) { f.PerZip.onchange = doZipChange; } } <% if (Utils.isEmpty(id) || !ContextHelper.hasMultifunction(context)) { %> doPerEntIDChange(); <% } else { %> updateEntFields(); <% } %> loadEntFieldsValues(); doLoadDep(); }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de