Edit C:\Users\Administrator\Desktop\Back\Livraison EVQG22\sales\person\edit.jsp
<%@page import="com.itextpdf.text.log.SysoLogger"%> <% /****************************************************************************** * 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 contentType="text/html; charset=UTF8" session="true" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.EnterpriseBean" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="com.edeal.frontline.LocationBean" %> <%@ page import="com.edeal.frontline.SalesInvestBean" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.BasicBean" %> <%@ page import="com.edeal.frontline.custom.Photo_Bean" %> <%@ page import="com.edeal.frontline.PersonBean" %> <%@ page import="com.edeal.frontline.helper.ContextHelper" %> <%@ page import="com.edeal.frontline.controller.actions.GetSilhouetteFromEmailOrCookieAction" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@page import="com.edeal.frontline.ActorBean"%> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.PersonBean" id="Person" scope="request"/> <jsp:useBean class="com.edeal.frontline.EnterpriseBean" id="Enterprise" 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 objID = dico.getTable("rad", "Per").getID(); Boolean hasDoubloon = false; try{ hasDoubloon = (Boolean)flRequest.getAttribute("HasDoubloon"); } catch(Exception e) { } if(hasDoubloon == null) { hasDoubloon = false; } Vector<String> listFieldsForDbl = (Vector)flRequest.getAttribute("matchCodeFields"); // If no match code fields is undefined if (listFieldsForDbl == null) { listFieldsForDbl = new Vector<String>(); } //Vector matchCodeTemplates = (Vector)flRequest.getAttribute("matchCodeTemplates"); Vector<String> fieldDisplay = (Vector)flRequest.getAttribute("fieldDisplay"); if (fieldDisplay == null) { fieldDisplay = new Vector<String>(); } Vector<Integer> seuils = (Vector)flRequest.getAttribute("seuils"); boolean isCreation = true; String perId = null; try { perId = Person.getID(); isCreation = false; } catch(FieldNotInitializedException fnie) { } // JSA Yellow Pages integation if (flRequest.getAttribute("__YPBean__") != null) { BasicBean bean = (BasicBean)flRequest.getAttribute("__YPBean__"); if (bean != null) { request.setAttribute("Person", (PersonBean)bean); Person = (PersonBean)bean; //formatter le telephone try { String pPhone = Person.getPerPhone(); if (!pPhone.startsWith("+33") && !pPhone.startsWith("33")) { //pPhone = Utils.formatPhone("+33 (?)? ?? ?? ?? ?? ",pPhone); pPhone = Utils.formatPhone("?? ?? ?? ?? ??", pPhone); Person.setPerPhone(pPhone); } if (pPhone.startsWith("33")) { //pPhone = Utils.formatPhone("+33 (?)? ?? ?? ?? ?? ","0"+pPhone.substring(2, pPhone.length())); pPhone = Utils.formatPhone("?? ?? ?? ?? ??","0" + pPhone.substring(2, pPhone.length())); Person.setPerPhone(pPhone); } } catch (FieldNotInitializedException e) { } } flRequest.removeAttribute("__YPBean__"); } else if (flRequest.getAttribute("__Address__Person") != null || session.getAttribute("__Address__Person") != null) { BasicBean bean = (BasicBean)flRequest.getAttribute("__Address__Person"); if (bean == null) { bean = (BasicBean)session.getAttribute("__Address__Person"); } if (bean != null) { request.setAttribute("Person", (PersonBean) bean); Person = (PersonBean) bean; //formatter le telephone try { String pPhone = Person.getPerPhone(); if (!pPhone.startsWith("+33") && !pPhone.startsWith("33")) { //pPhone = Utils.formatPhone("+33 (?)? ?? ?? ?? ?? ",pPhone); pPhone = Utils.formatPhone("?? ?? ?? ?? ??", pPhone); Person.setPerPhone(pPhone); } if (pPhone.startsWith("33")) { //pPhone = Utils.formatPhone("+33 (?)? ?? ?? ?? ?? ","0"+pPhone.substring(2, pPhone.length())); pPhone = Utils.formatPhone("?? ?? ?? ?? ??","0" + pPhone.substring(2, pPhone.length())); Person.setPerPhone(pPhone); } } catch (FieldNotInitializedException e) { } } flRequest.removeAttribute("__Address__Person"); } String id = null; String strActID = (String)session.getAttribute("actorID"); try { id = Person.getID(); } catch (FieldNotInitializedException fnie) { Person.setPerCounselor(strActID); } StringBuffer fullName = new StringBuffer(); if (id != null) { String val; try { val = Person.getPerCivID(); fullName.append(dico.getRefDisp(session, "PerCivID", val) + " "); } catch (FieldNotInitializedException e) { } try { val = Person.getPerName(); fullName.append(val + " "); } catch (FieldNotInitializedException e) { Person.setPerName(Utils.getMessage(session, "F611D", true, "<Nom>")); } try { val = Person.getPerFstName(); fullName.append(val + " "); } catch (FieldNotInitializedException e) { Person.setPerFstName(Utils.getMessage(session, "F611C", true, "<Prénom>")); } } else { //voir si entreprise existe try { logger.debug("je recupère l'id de l'entreprise"); Person.setPerEntID(Enterprise.getEntID()); logger.debug("j'ai bien une entreprise " + Enterprise.getEntID()); } catch (FieldNotInitializedException e) { } String perName = null; try { perName = Person.getPerName(); } catch (FieldNotInitializedException e) { Person.setPerName(Utils.getMessage(session, "F611D", true, "<Nom>")); } String perFstName = null; try { perFstName = Person.getPerFstName(); } catch (FieldNotInitializedException e) { Person.setPerFstName(Utils.getMessage(session, "F611C", true, "<Prénom>")); } } String salesModel = context.getContextParameter("SalesModel"); String personAddress = context.getContextParameter("PersonAddress"); String personScoring = context.getContextParameter("PersonScoring"); String emailPattern = (String) request.getAttribute("emailPattern"); if (emailPattern == null) { emailPattern = ""; } boolean isB2C = "B2C".equalsIgnoreCase(salesModel); Vector vectLoc = new Vector(); String PerLocID; try { PerLocID = Person.getPerLocID(); } catch (FieldNotInitializedException e) { PerLocID = ""; } //if sales model is B2C, no enterprise boolean hasEnterprise = false; if (!isB2C) { try { EnterpriseBean enterprise = Person.getPerEnterprise(); hasEnterprise = true; pageContext.setAttribute("Enterprise", enterprise); try { vectLoc = LocationBean.listSummary( context, new String[] { "LocName", "LocID" }, new String[][] {{ "LocEntID = " + Utils.formatToSQL(context, enterprise.getID()) }}, new String[] { "LocName" } ); } catch (Exception e) { } } catch (FieldNotInitializedException e) { pageContext.setAttribute("Enterprise", new EnterpriseBean()); } } String tempAttr = (String) request.getAttribute("personalAddressDefault"); boolean personalAddressDefault = "true".equalsIgnoreCase(tempAttr); // People history stuff String valPehEntID = Utils.getRequestParameter(context, request, "PehEntID"); if (valPehEntID == null) { try { valPehEntID = Person.getPerEntID(); } catch (FieldNotInitializedException fnie) { valPehEntID = ""; } } String valPehFctID = Utils.getRequestParameter(context, request, "PehFctID"); if (valPehFctID == null) { try { valPehFctID = Person.getPerFctID(); } catch (FieldNotInitializedException fnie) { valPehFctID = ""; } } String valPehFunction = null; try { valPehFunction = (String) dico.getRefDisp(session, "PerFctID" , valPehFctID); } catch (FrontlineException fex) { } if (valPehFunction == null) { valPehFunction = ""; } String valPehPhone = Utils.getRequestParameter(context, request, "PehPhone"); if (valPehPhone == null) { try { valPehPhone = Person.getPerPhone(); } catch (FieldNotInitializedException fnie) { valPehPhone = ""; } } String valPehFax = Utils.getRequestParameter(context, request, "PehFax"); if (valPehFax == null) { try { valPehFax = Person.getPerFax(); } catch (FieldNotInitializedException fnie) { valPehFax = ""; } } String valPehMail = Utils.getRequestParameter(context, request, "PehMail"); if (valPehMail == null) { try { valPehMail = Person.getPerMail(); } catch (FieldNotInitializedException fnie) { valPehMail = ""; } } Enterprise = (EnterpriseBean) pageContext.getAttribute("Enterprise"); if (Enterprise == null) { try { Enterprise = new EnterpriseBean(session); } catch (Exception e) { } pageContext.setAttribute("Enterprise", Enterprise); } String perFirstNameOnFocus = "if (this.value == '" + Utils.getMessage(session, "F611C", true, "<Prénom>") + "') { this.value = ''; }"; String perNameOnFocus = "if (this.value == '" + Utils.getMessage(session, "F611D", true, "<Nom>") + "') { this.value = ''; }"; String initPerEntID = flRequest.getParameter("initPerEntID"); String perFctID = null; try { perFctID = Person.getPerFctID(); } catch (FieldNotInitializedException fnie) { perFctID = ""; } String perDepID = null; try { perDepID = Person.getPerDepID(); } catch (FieldNotInitializedException e) { } String perCtrID = null; try { perCtrID = Person.getPerCtrID(); System.out.println("Person.getPerCtrID() = "+Person.getPerCtrID()); } catch (Exception e) { perCtrID = ""; } String ctrAssID = null; ctrAssID = dico.getRefIdByCode("PerGrpFct_", "ASS"); // On récupère l'ID de l'acteur connecté String actID = null; String query = ""; if (session != null) { actID = (String)session.getAttribute("effectiveActorID"); if (actID == null) { actID = (String)session.getAttribute("actorID"); if (actID == null) { throw new FrontlineException("there is not an actor ID in session"); } } } Boolean createGuest = false; try { ActorBean act = new ActorBean(actID, context); Vector<String> actRolesIDs = new Vector<String>(); // On récupère les roles actRolesIDs.addAll(act.getRoles()); String roleADMID = dico.getRefIdByCode("ActRoles", "ADMIN"); /* Role Administrateur*/ String roleTECHADMID = dico.getRefIdByCode("ActRoles", "S_ADM_TECH"); /* Role Administrateur Technique*/ String role1ID = dico.getRefIdByCode("ActRoles", "D_ATTACH_DIR"); /* Role Attache de Direction*/ String role2ID = dico.getRefIdByCode("ActRoles", "D_SECR_DIR"); /* Role Secretariat de direction */ String role3ID = dico.getRefIdByCode("ActRoles", "R_RESP_RES_AFFIL"); /* Role Responsable Affilies */ String role4ID = dico.getRefIdByCode("ActRoles", "ASSO_SAL"); /* Role Association avec Salarié */ String role5ID = dico.getRefIdByCode("ActRoles", "ASSO_SANS_SAL"); /* Role Association sans Salarié*/ String role6ID = dico.getRefIdByCode("ActRoles", "R_DEV_AFFIL"); /* Devel affiliés*/ String role7ID = dico.getRefIdByCode("ActRoles", "C_COMRCLE"); /* Commercial*/ String role8ID = dico.getRefIdByCode("ActRoles", "C_CONS_TECH"); /* Role conseiller technique */ String role9ID = dico.getRefIdByCode("ActRoles", "P_RESP_CHARG_DEV"); /* Role resp charge de dev */ if(!(actRolesIDs.isEmpty())) { // on prend le 1er role de l'acteur connecté String actRoleIDactuel = actRolesIDs.get(0).toString(); if(actRoleIDactuel.equals(role3ID) || actRoleIDactuel.equals(role6ID)) { query ="[[EntTyeID:RefVal = 'ETAB'], [EntTyeID:RefVal = 'HOTEL'], [EntTyeID:RefVal = 'RESTO']]"; } else if (actRoleIDactuel.equals(role7ID)) { query ="[[EntTyeID:RefVal = 'PART']]"; } else if (actRoleIDactuel.equals(role1ID) || actRoleIDactuel.equals(role2ID)) { query ="[[EntTyeID:RefVal = 'ASSO']]"; //Mantis 29108 //} else if (actRoleIDactuel.equals(role9ID) || actRoleIDactuel.equals(role8ID) || actRoleIDactuel.equals(role4ID) || actRoleIDactuel.equals(role5ID)) { } else if (actRoleIDactuel.equals(role9ID) || actRoleIDactuel.equals(role8ID)) { query ="[[EntTyeID:RefVal = 'HOTEL']]"; } else if (actRoleIDactuel.equals(roleADMID) || actRoleIDactuel.equals(roleTECHADMID)) { query =""; } else { createGuest= true; } } } catch (FrontlineException e) { } /* String codeXploitant = null; codeXploitant = dico.getRefIdByCode("PerFctID", "EXPL"); String perEntID = null; try { perEntID = Person.getPerEntID(); } catch (FieldNotInitializedException e) { } if( perEntID != null && codeXploitant.equals(perFctID) ){ String mail = null; EnterpriseBean entB = new EnterpriseBean(perEntID,context); try{ mail = (String) entB.getCustomProperty("EntMail_"); }catch (FieldNotInitializedException e) { } Person.setPerMail(mail); } */ // Extension de la civilité // charger l'AttId de la photo String personPhotoID = null; String personPhotoAttID = null; try { personPhotoID = (String) Person.getCustomProperty("PerPhoto_"); } catch (FieldNotInitializedException fnie) { } if(personPhotoID != null){ Photo_Bean po_ = new Photo_Bean(personPhotoID , context); try { personPhotoAttID = (String) po_.getPo_Apercu(); } catch (FieldNotInitializedException fnie) { } } %> <script type="text/javascript" language="javascript" src="<fl:link url="/sales/person/person_js.jsp?"/>&id=<%= id %>&salesModel=<%= salesModel %>&pad=<%= personalAddressDefault %>&emailPattern=<%= emailPattern %>&PerLocID=<%= PerLocID %>"></script> <script language="javascript"> function doSimilarFunctions() { var f = document.forms[0]; var name = (f.PerName.value == '<fl:getMessage code="F611D" alt="<Nom>" js="true"/>') ? '' : f.PerName.value; var fstname = (f.PerFstName.value == '<fl:getMessage code="F611C" alt="<Prénom>" js="true"/>') ? '' : f.PerFstName.value; if (name != '') { window.open('<fl:webapp/>/list_functions.fl?name=' + name + '&fstname=' + fstname, 'Person', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=1024,height=768'); } } //var fieldsList = new Array; var fieldsList = {};//new Array; var seuilcert = <%= (seuils != null && !seuils.isEmpty()) ? seuils.get(0) : null %>; function doSubmit() { showEmailChange = false; var f = document.forms[0]; var filter = /^[0-9-+() ]+$/; if (f.PerName.value == '' || f.PerName.value == '<fl:getMessage code="F611D" alt="<Nom>" js="true"/>') { document.getElementById('PerName_msg').style.display = "inline"; alert('<fl:getMessage code="L63B1" alt="Veuillez saisir un nom" js="true"/>'); f.PerName.focus(); showEmailChange = true; return false; } if (f.PerFstName.value == '<fl:getMessage code="F611C" alt="<Prénom>" js="true"/>') { f.PerFstName.value = ''; } if (f.PerName.value == '<fl:getMessage code="F611D" alt="<Nom>" js="true"/>') { f.PerName.value = ''; } try { if (f.PerEntID.value != f.PehEntID.value || f.PerFctID.value != f.PehFctID.value) { f.type.value += ';PersonHistory'; f.id.value += ';'; if (f.PerEntID.value == f.PehEntID.value) { f.PehEntID.value = ''; } } } catch(err) { } if (f.PerMail){ var permailVal = f.PerMail.value; if (permailVal != null && permailVal.length > 0){ if (!checkEmail(permailVal)){ alert('<fl:getMessage code="MF0D1" alt="Veuillez vérifier l\'adresse mail principale." js="true"/>'); f.PerMail.focus(); return false; } } } if (f.PerMailSec_){ var permailSecVal = f.PerMailSec_.value; if (permailSecVal != null && permailSecVal.length > 0){ if (!checkEmail(permailSecVal)){ alert('<fl:getMessage code="MF0CF" alt="Veuillez vérifier l\'adresse mail secondaire." js="true"/>'); f.PerMailSec_.focus(); return false; } } } if(f.PerPhone) { var entphoneVal = f.PerPhone.value; if(entphoneVal != null && entphoneVal.length > 0){ if(!filter.test(entphoneVal)) { alert('<fl:getMessage code="MF08C" alt="Veuillez vérifier le numéro de téléphone principal." js="true"/>'); f.PerPhone.focus(); return false; } } } if(f.PerMobile) { var entsecondphoneVal = f.PerMobile.value; if(entsecondphoneVal != null && entsecondphoneVal.length > 0){ if(!filter.test(entsecondphoneVal)) { alert('<fl:getMessage code="MF08D" alt="Veuillez vérifier le numéro de téléphone secondaire." js="true"/>'); f.PerMobile.focus(); return false; } } } if(f.PerFax) { var perfaxVal = f.PerFax.value; if(perfaxVal != null && perfaxVal.length > 0){ if(!filter.test(perfaxVal)) { alert('<fl:getMessage code="MF08E" alt="Veuillez vérifier le fax." js="true"/>'); f.PerFax.focus(); return false; } } } if (eraseFaxOnSubmit) { f.PerFax.value = ''; } return true; } function selectDepValue(sValue) { var oForm = document.forms[0]; var oDepartement = oForm.PerDepID; oDepartement.options[oDepartement.selectedIndex].text == ""; for(i = 0;i < oDepartement.options.length; i++){ if (oDepartement.options[i].value == sValue) { oDepartement.selectedIndex = i; } } } //on department change //fill the fonction select if necessary with corresponding values function setFctID() { var oForm = document.forms[0]; var oDepartement = oForm.PerDepID; var oFonction = oForm.PerFctID; url = '<fl:webapp/>/sales/person/perdepid_change_ajax.jsp?PerDepID=' + oDepartement.value + '&PerFctID=' + oFonction.value; doAjax(url); } //on fonction change //if department's empty, select the corresponding one //if title is empty, fill it with the focntion value function setTitle() { var oForm = document.forms[0]; var oFonction = oForm.PerFctID; // alert(oFonction.value); var oTitle = oForm.PerTitle; creation = <%= (id != null) ? "false" : "true"%>; if (oForm.PerTitle.value == "" || creation == true) { oTitle.value = oFonction.options[oFonction.selectedIndex].text; } } function setChampAss() { var oForm = document.forms[0]; var oFonction = oForm.PerGrpFct_; // pour le pays FR if(oFonction.value == "<%=ctrAssID%>"){ document.getElementById("AssocChamps").style.display = 'table'; } else { document.getElementById("AssocChamps").style.display = 'none'; } } <% if (hasDoubloon) { %> $(function() { <% for(String field : listFieldsForDbl) { %> $('#<%= field %>').bind('change', function() { checkDoublon('<%= field %>', $('#<%= field %>').val()); }); <%}%> }); <% } %> function checkDoublon(field, value){ <% if (isCreation) { %> checkArrayValue(field, value); <% } else { %> updateArrayValues(); <% } %> var jsonstring = JSON.stringify(fieldsList); var data = {}; data.objID = '<%= objID %>'; <% if (Utils.isEmpty(id)) { } else { %> data.id = '<%= id %>'; <% } %> data.notDoublon = $("#notDoublon").val(); data.fieldsList = jsonstring; $.ajax({ //data: jsonstring data: data, //type: "POST", url: "<fl:webapp/>/find_double.fl", timeout: 20000, contentType: "application/json;charset=utf-8", dataType: 'json', async: true, success: function (data) { if (data.status == 0) { return; } else { namePopup = "doublonPopup"; <% if (ContextHelper.hasMultifunction(context)) { %> data.objID = '<%= objID %>'; urlPopup = "<fl:webapp/>/open_popup_doublon_multifunction.fl"; openAjaxPopupWithMultifonction(namePopup, urlPopup, data); <% } else { %> urlPopup = "<fl:webapp/>/open_popup_doublon.fl"; openAjaxPopup(namePopup, urlPopup, data); <% } %> } }, error:function (xhr, ajaxOptions, thrownError) { if (xhr.status != 0) { //alert(thrownError); } } }); }; function cleanFieldsValues() { f = document.forms[0]; if (f.PerFstName.value == '<fl:getMessage code="F611C" alt="<Prénom>" js="true"/>') { f.PerFstName.value = ''; } if (f.PerName.value == '<fl:getMessage code="F611D" alt="<Nom>" js="true"/>') { f.PerName.value = ''; } } function updateArrayValues() { cleanFieldsValues(); //fieldsList = new Array; fieldsList = {}; <% for (String field : listFieldsForDbl) { %> if ($("#<%= field %>").val() == undefined) { fieldsList['<%= field %>'] = ''; } else { fieldsList['<%= field %>'] = $("#<%= field %>").val(); } <% } %> }; function checkArrayValue(field, value) { cleanFieldsValues(); fieldsList[field] = value; /*for (i = 0; i < fieldsList.length; i++) { if(fieldsList[i][0] == field){ fieldsList[i][1] = value; return; } } fieldsList[fieldsList.length] = [field, value] */ }; function isNotDoublon(id, poids) { $("#tr_" + id.toString()).hide(); $("#notDoublon").val($("#notDoublon").val() + id + '#'+ poids + ';'); } function openObjPopup(id) { window.open('<fl:webapp/>/read_person.fl?id='+id, 'Person', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=1024,height=768'); }; function doMerge(id) { var f = document.forms[0]; f.action = "<fl:webapp/>/save_merge_person.fl?objMasterID=" + id; f.submit(); } function openAjaxPopupWithMultifonction(namePopup, urlPopup, jsonResponse){ jQuery.openPopupLayer({ name: namePopup, width: "auto", height: "auto", cache: true, parameters: {data: JSON.stringify(jsonResponse)}, url: urlPopup, error: function () { //alert("Erreur lors de l'ouverture de la popup"); } }); } function openAjaxPopup(namePopup, urlPopup, jsonResponse){ var cmp = 0; jQuery.openPopupLayer({ name: namePopup, width: "auto", height: "auto", url: urlPopup, cache: true, success: function (data) { $("#doublon_content").append("<thead> <tr valign=\"top\">" + "<th style=\"width: 10%\"> </th>" + <% for(String fieldDisp : fieldDisplay) { %> "<th><%= fieldDisp %></th>" + <% } %> "</tr> </thead>"); $.each(jsonResponse.doublons, function(i, doublon) { var str = $("#notDoublon").val(); if (str.indexOf(doublon.id) > -1) { } else { cmp++; var lignCssClass = (i%2 == 0) ? "even" : "odd"; var content = "<tr id=\"tr_" + doublon.id.toString() + "\" class=\"" + lignCssClass + " bean\" "; var poidsColor = ""; if (doublon.poids >= seuilcert) { poidsColor = "#F2D5D9"; } else { poidsColor ="background-color: #FBFAC8;"; } content += ">" + "<td style=\"" + poidsColor + "\">" + "<a href=\"javascript:openObjPopup('" + doublon.id + "')\"><img title=\"Voir\" alt=\"Voir\" src=\"<fl:webapp/>/icons/ico/zoom.gif\"></a> " + "<a href=\"javascript:doMerge('" + doublon.id + "')\"><img title=\"Fusionner\" alt=\"Fusionner\" src=\"<fl:webapp/>/icons/fusion.gif\"></a> " + "<a href=\"javascript:isNotDoublon('" + doublon.id + "','" + doublon.poids + "')\"><img title=\"Enregistrer en non-doublon\" alt=\"Enregistrer en non-doublon\" src=\"<fl:webapp/>/icons/ico/supprimer.gif\"></a>" + "</td>" + <% for (String field : listFieldsForDbl) { %> "<td style=\"text-align: center\">" + doublon.<%= field %> + "</td>" + <% } %> "</tr></br>"; $("#doublon_content").append(content); } }); }, error: function () { //alert("Erreur lors de l'ouverture de la popup "); } }); }; function newFunction() { var f = document.forms[0]; var perEntID = f.PerEntID.value; var perFctParentID = f.PerFctParentID.value; var url = '<fl:link url="/create_person.fl?"/>'; url = url + '&initPerEntID=' + perEntID + '&PerFctParentID=' + perFctParentID; window.location = url; } function stripPhoneNo(phoneNo) { if (phoneNo == '') { return ''; } // We have to strip the extraneous characters from the phone to make it work properly var finalPhone = ''; var haveParan = false; for (var cnt = 0; cnt < phoneNo.length; cnt++) { var charPhoneNo = phoneNo.charAt(cnt); if (charPhoneNo == '(') { haveParan = true; continue; } if (charPhoneNo == ')') { haveParan = false; continue; } if (haveParan) { continue; } switch (charPhoneNo) { case '+': case '.': case ' ': continue; } finalPhone += charPhoneNo; } return finalPhone; } function doYellowPage() { var f = window.document.forms[0]; var phone = ""; if (f && f.elements['PerPhone']) { phone = f.elements['PerPhone'].value; } phone = stripPhoneNo(phone); if (phone == '') { alert('<fl:getMessage code="M60F9" alt="Une recherche sur l\'annuaire inversé Amabis ne peut être lancée si aucun numéro de téléphone n\'a été fourni." js="true"/>'); } else { //window.parent.location = "<fl:webapp/>/check_phone_enterprise.fl?id=<%=id%>&type=Enterprise&EntPhone=" + phone; //doAjax('<fl:webapp/>/check_phone_enterprise.fl?id=<%=id%>&EntPhone=' + phone + '&type=Enterprise'); presentFieldsValue(); f.action = '<fl:link url="<%= \"/check_phone_person.fl?id=\" + ( id != null ? id : \"\") %>"/>' + '&PerPhone=' + phone + '&type=Person'; doExitConf = false; f.submit(); } } function doRefreshPerson(parentID) { var f = document.forms[0]; f.PerFctParentID.value = parentID; f.action = "<fl:webapp/>/refresh_person_function.fl"; <% if (!Utils.isEmpty(initPerEntID)) { %> f.action += "?initPerEntID=<%= initPerEntID %>"; <% } %> f.submit(); } function doRefreshPersonCustom() { var f = document.forms[0]; f.action = "<fl:webapp/>/refresh_person_custom.fl"; f.submit(); } function doPerFct_Change() { doRefreshPerson(); } function doLoadDep() { url = '<fl:webapp/>/sales/person/perdepid_change_ajax.jsp?PerDepID=<%= perDepID == null ? "" : perDepID %>&PerFctID=<%= perFctID == null ? "" : perFctID %>'; doAjax(url); } function displayAddressDefault() { return ($("#PerAd1").val() != "" || $("#PerAd2").val() != "" || $("#PerZip").val() != "" || $("#PerCity").val() != ""); } function doCheckDefautAddress() { if (displayAddressDefault()) { $("#PerLocDiv2").show(); } else { $("#PerLocDiv2").hide(); } } $("#PerLocDiv2").ready(function() { doCheckDefautAddress(); }); </script> <fl:form action="/save_person.fl" bean="Person" multivalSeparator=";"> <input type="hidden" name="notDoublon" id="notDoublon" value=""> <% if (ContextHelper.hasMultifunction(context)) { %> <%-- variable pour le multifunction --%> <input name="PerFctParentID" type="hidden" value="<fl:getProperty name="Person" property="PerFctParentID" alt="" />"> <input name="PerFctIsActive" type="hidden" value="<fl:getProperty name="Person" property="PerFctIsActive" alt="" />"> <input name="PerFctOrder" type="hidden" value="<fl:getProperty name="Person" property="PerFctOrder" alt="" />"> <% } %> <input name="PehPerID" type="hidden" value="<fl:getProperty name="Person" property="PerID" alt=""/>"> <input name="PehEndDate" type="hidden" value="<%= Utils.formatToWeb(new Date(), true) %>"> <% if (!hasEnterprise || isB2C) { %> <input name="PerPersonalAddressDefault" type="hidden" value="true"> <% } else if ("NO".equalsIgnoreCase(personAddress)) { %> <input name="PerPersonalAddressDefault" type="hidden" value="false"> <% } if (isB2C) { %> <input id="PerEntID" name="PerEntID" type="hidden" value="" onchange="doRefreshPersonCustom();"> <% } %> <input name="PehEntID" type="hidden" value="<%= valPehEntID %>"> <input name="PehMail" type="hidden" value="<%= valPehMail %>"> <input name="PehFax" type="hidden" value="<%= valPehFax %>"> <input name="PehPhone" type="hidden" value="<%= valPehPhone %>"> <input name="PehFunction" type="hidden" value="<%= valPehFunction %>"> <input name="PehFctID" type="hidden" value="<%= valPehFctID %>"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"F002E\", false, true, \"Personne\") %>" ou="/edit_person.fl"> <table class="container" cellpadding="0" cellspacing="0"> <tr> <td class="labelTitreFiche"><fl:label field="PerFstName" labelClassName="labelTitreFiche" code="L2094"/></td> <td style="padding-left: 10px; width: 75px;"> <fl:input name="Person" property="PerCivID" alt=""/> </td> <td style="padding-left: 10px;"> <fl:input name="Person" id="PerName" property="PerName" onfocus="<%= perNameOnFocus %>" mandatoryMsgCode="M3013" onchange="doPerNameChange()"/> <span id="PerName_msg" class="mandatory_alert" style="display: none">!</span> </td> <td style="padding-left: 10px;" nowrap> <fl:input name="Person" id="PerFstName" property="PerFstName" onfocus="<%= perFirstNameOnFocus %>" onchange="doPerFstNameChange();"/> </td> </tr> <tr class="ligne_separation"> <td colspan="5"></td> </tr> </table> <table class="container" cellpadding="0" cellspacing="0"> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <fl:fieldEdit property="PerDateNaiss_"/> <fl:fieldEdit property="PerOptIN_" /> <fl:fieldEdit property="PerCatSocial_" alt=""/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="data_column" cellpadding="0"> <fl:fieldEdit property="PerLngRef_" mandatoryMsgCode="MF003" alt="" /> <fl:fieldEdit property="PerLngSec_" alt="" /> <tr class="fieldline"> <td class="dataLabel"> <fl:label field="PerPhoto_" code="FF122"/> </td> <%if(personPhotoAttID != null) { %> <td id="PerPhoto_" class="dataValue"> <img alt="" src='<fl:webapp/>/download?id=<%=personPhotoAttID%>' onclick="" height="100" width="100"> <fl:fieldRead property="PerPhoto_" separator="<br>" bean="true" href="true" disp="<%= flRequest.computeURL(\"/read_photo_.fl\") %>"/> </td> <%} else { %> <td class="dataValue"> <fl:attach name="Apercu" colID="PerPhoto_" multivalSeparator=";" edit="true" allowedExtensions="'jpg', 'jpeg', 'png', 'gif'" mandatory="false"/> </td> <%} %> </tr> <fl:fieldEdit property="PerCollege_" /> </table> </td> </tr> </table> <table class="container" cellpadding="0"> <tr><td class="titrePartie"><fl:getMessage code="L64B4" alt="Commentaires"/></td></tr> <tr><td class="dataValue noPaddingLeft"><fl:input property="PerRemarks" rows="5" nodiv="false"/></td></tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></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="PersonTabs"> <fl:sTab id="FCTS" title="<%= Utils.getMessage(session, \"L658A\", false, true, \"Fonctions\") %>"> <table class="container" cellpadding="0"> <tr> <td class="column2"> <table class="container" cellpadding="0"> <!-- <fl:fieldEdit property="PerGrpFct_" mandatoryMsgCode="MF005" onchange="setChampAss();"/> --> <fl:fieldEdit property="PerGrpFct_" alt="" onchange="setChampAss();"/> <fl:fieldEdit property="PerFctID" alt="" onblur="setTitle();" onchange="doRefreshPersonCustom();"/> <!-- <fl:fieldEdit property="PerFctID" alt=" " onblur="setTitle();" mandatoryMsgCode="MF006"/> --> <%-- <fl:fieldEdit property="PerTitle"/> --%> <!-- <fl:fieldEdit property="PerEntID" ondelete="doPerEntIDRemove();" mandatoryMsgCode="MF00E"/> --> <%-- if (!createGuest) {--%> <fl:fieldEdit property="PerEntID" ondelete="doPerEntIDRemove();" query="<%=query%>" onchange="doRefreshPersonCustom();" /> <%-- } --%> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titreInterneSmalltabs" colspan="5"> <fl:getMessage code="F6099" alt="Coordonnées"/> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="fieldline"> <td class="dataLabel"><fl:getMessage code="FF1D0" alt="Numéro/Nature/Libellé Voie"/></td> <td class="dataValue"><div class="fieldTable" > <table class="fieldTable" cellpadding="0"> <tr> <td style="width: 20%"> <fl:input property="PerNumVoie_" width="80%"/> </td> <td style="width: 30%"> <%-- <fl:input property="PerNatVoie_" mandatoryMsgCode="MF075" width="auto"/> --%> <fl:input property="PerNatVoie_" alt="" width="90%"/> </td> <td style="width: 50%"> <%-- <fl:input property="PerLibVoie_" mandatoryMsgCode="MF076" /> --%> <fl:input property="PerLibVoie_" width="100%"/> </td> </tr> </table> </div> </td> </tr> <fl:fieldEdit property="PerBtq_"/> <fl:fieldEdit property="PerCplGeo_"/> <fl:fieldEdit property="PerAd1"/> <fl:fieldEdit property="PerPremcou_"/> <fl:fieldEdit property="PerBP_"/> <fl:fieldEdit property="PerLieuDit_"/> <tr class="fieldline"> <td class="dataLabel"><fl:getMessage code="FF096" alt="Code Postal/Ville"/></td> <td class="dataValue"><div class="fieldTable" > <table class="fieldTable" cellpadding="0"> <tr> <td style="width: 20%"> <!-- <input class="input text" type="text" id="EntZip" name="EntZip" value="<fl:getProperty name="Enterprise" property="EntZip" alt=""/>" size="4" style="width: auto;"/> --> <!-- <fl:input property="PerZip" mandatoryMsgCode="MF074" width="auto"/> --> <fl:input property="PerZip" width="80%"/> </td> <td class="bigFieldPart"> <!-- <input class="input text" type="text" maxlength="50" id="EntCity" onblur="this.value = checkString(this.value, 'upper');" name="EntCity" value="<fl:getProperty name="Enterprise" property="EntCity" alt=""/>" style="width:100%" /> --> <fl:input property="PerCity" /> <!-- <fl:input property="PerCity" mandatoryMsgCode="MF073"/> --> </td> </tr> </table> </div></td> </tr> <!-- <fl:fieldEdit property="PerCtrID" mandatoryMsgCode="MF00D"/> --> <fl:fieldEdit property="PerCtrID"/> <fl:fieldEdit property="PerPhone" /> <fl:fieldEdit property="PerMobile"/> <fl:fieldEdit property="PerFax"/> <%-- <fl:fieldEdit property="PerMail" onchange="doRefreshPersonCustom();"/> --%> <%-- rendre le champ PerMail obligatoire si la fonction du contact = "Expoiltant" --%> <%String codeXploitant = null; codeXploitant = dico.getRefIdByCode("PerFctID", "EXPL"); if(!codeXploitant.equals(perFctID) ){%> <fl:fieldEdit property="PerMail" /> <%} else { %> <fl:fieldEdit property="PerMail" mandatoryMsgCode="L7055" /> <%} %> <fl:fieldEdit property="PerMailSec_" /> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="container" cellpadding="0"> <tr> <td class="column2"> <table class="container" cellpadding="0"> <tr> <!-- <fl:fieldEdit property="PerFctEntryDt" mandatoryMsgCode="MF012"/> --> <fl:fieldEdit property="PerFctEntryDt"/> <fl:fieldEdit property="PerFctExitDt"/> <fl:fieldEdit property="PerNvComm_"/> </table> <table id="AssocChamps" class="container" cellpadding="0" > <%-- A afficher seulement si le groupe de fonctions est "ASSOCIATION" --%> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titreInterneSmalltabs" colspan="5"> <fl:getMessage code="LF04D" alt="Liste structure Logis"/> </td> </tr> <tr class="ligne_separation"><td></td></tr> <fl:fieldEdit property="PerStatutAnim_" alt=""/> <fl:fieldEdit property="PerAffectedTaux_"/> <fl:fieldEdit property="PerAffCatAss_"/> <fl:fieldEdit property="PerColCatAss_" alt=""/> <fl:fieldEdit property="PerOrdAff_"/> <fl:fieldEdit property="PerAssRem_"/> <tr class="ligne_separation"><td></td></tr> <td class="titreInterneSmalltabs" colspan="5"> <fl:getMessage code="LF33F" alt="Dates Mandat"/> </td> <tr class="ligne_separation"><td></td></tr> <fl:fieldEdit property="PerDteCandidature_"/> <fl:fieldEdit property="PerDteElection_"/> <fl:fieldEdit property="PerDteDemission_"/> <fl:fieldEdit property="PerDteRevocation_"/> <tr class="ligne_separation"><td></td></tr> </table> </td> </tr> </table> </td> </tr> </table> </fl:sTab> </fl:smallTabs> </fl:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de