Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\sales\localite_\edit.jsp
<%/****************************************************************************** * Copyright (c) 2000-2005 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * 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.FlContext" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.custom.Localite_Bean"%> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.ObjectsBean" %> <%@ page import="com.edeal.frontline.ListBean" %> <%@ page import="java.util.Hashtable"%> <%@ page import="java.util.Vector" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.custom.Localite_Bean" id="Localite_" scope="request"/> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/common_css.jsp"> <% 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 = Localite_.getID(); } catch (FieldNotInitializedException fnie) {} String ctrFrID = null; ctrFrID = dico.getRefIdByCode("Ctr", "Val", "FR"); String localDepartementID = null; try { localDepartementID = Localite_.getLo_Dep(); } catch (Exception e) { localDepartementID = ""; } String paysVal = ""; String regVal = ""; String localRegionID = ""; String region = ""; String localPaysID = ""; String pays = ""; if(localDepartementID != null && !localDepartementID.equalsIgnoreCase("")) { try{ regVal = (String)dico.getRefDisp("Dp_", "Te2", localDepartementID); localRegionID = dico.getRefIdByCode("Rg_", "Te2", regVal); region = (String)dico.getRefDisp("Rg_", "Te1",localRegionID); paysVal = (String)dico.getRefDisp("Rg_", "Te2", localRegionID); localPaysID = dico.getRefIdByCode("Ctr", "Te2", paysVal); pays = (String)dico.getRefDisp("Ctr", "Te1", localPaysID); }catch(FrontlineException e){ } } String localRtID = null; String localDisp = null; try { localRtID = (String) Localite_.getLo_RattID(); if(localRtID != null) { Localite_Bean lrt = new Localite_Bean(localRtID, context); localDisp = (String) lrt.getLo_Nom(); } } catch (Exception e) { } // Id de l'objet Localite String lo_ObjID = null; String lstObjID = null; try { String[] fieldslo_ = {"ObjID"}; String[][] querylo_ = {{"ObjSql = 'Localite_'"}}; Vector listlo_ = ObjectsBean.listSummary(context, fieldslo_, querylo_); // on prend le premier si la liste n'est pas vide if(listlo_ != null && !listlo_.isEmpty()) { Hashtable tab = (Hashtable)listlo_.firstElement(); lo_ObjID = (String)tab.get("ObjID"); } } catch (Exception e) { lo_ObjID =""; } if (lo_ObjID!= null && !lo_ObjID.equalsIgnoreCase("")){ ObjectsBean obj = new ObjectsBean(lo_ObjID, context); String codeListe = obj.getObjSelectListCode(); if (codeListe != null) { try { String[] fieldslst = {"LstID"}; String[][] querylst = {{"LstCode = '" + codeListe + "'"}}; Vector listlst = ListBean.listSummary(context, fieldslst, querylst); // on prend le premier si la liste n'est pas vide if(listlst != null && !listlst.isEmpty()) { Hashtable tab = (Hashtable)listlst.firstElement(); lstObjID = (String)tab.get("LstID"); } } catch (Exception e) { lstObjID =""; } } } %> <script type="text/javascript" language="javascript"> function doSubmit() { var f = document.forms[0]; return true; } function setChampInsee() { var oForm = document.forms[0]; var paysSelect = oForm.Lo_Pays; // pour le pays FR if(paysSelect.value == "<%=ctrFrID%>"){ document.getElementById("Lo_Ins").style.display = 'table'; } else { document.getElementById("Lo_Ins").style.display = 'none'; } } function doLo_RattIDChange() { var oForm = document.forms[0]; var locRatt = oForm.Lo_RattID; var locRattLbl = oForm.lblLo_RattID; if(locRatt.value == "" || locRattLbl.value == ""){ document.getElementById("Lo_Acc").style.display = 'none'; } else { document.getElementById("Lo_Acc").style.display = 'table'; } } function doOnLoad() { var f = document.forms[0]; f.Lo_Pays.value = '<%= localPaysID %>' ; f.Lo_Reg.value = '<%= localRegionID %>' ; loadRegion(f.Lo_Pays.value); loadDepartment(f.Lo_Reg.value); setChampInsee(); <% if(localRtID != null && localDisp != null) {%> f.Lo_RattID.value = '<%= localRtID %>' ; f.lblLo_RattID.value = '<%= localDisp %>' ; doLo_RattIDChange(); <% } %> } function loadRegion(ctrID) { if (ctrID == undefined || ctrID == null || ctrID == '') { $("#Lo_Reg").html("<option value=''> </option>"); $("#Lo_Reg").width($("#div_Lo_Reg").width()); return; } $.getJSON("<fl:webapp/>/get_enterprise_regions.fl?ctrID=" + ctrID, function(data) { if (data != null) { var optContent = "<option value=''> </option>"; for (var i = 0; i < data.length; i++) { var optValue = data[i].value; var optText = data[i].text; optContent += "<option" if (optValue == '<%=localRegionID%>') { optContent += " selected"; } optContent += " value='" + optValue + "'>" + optText + "</option>" } $("#Lo_Reg").html(optContent); $("#Lo_Reg").width($("#div_Lo_Reg").width());//For IE7 } }); } function loadDepartment(rg_ID) { if (rg_ID == undefined || rg_ID == null || rg_ID == '') { $("#Lo_Dep").html("<option value=''> </option>"); $("#Lo_Dep").width($("#div_Lo_Dep").width()); return; } $.getJSON("<fl:webapp/>/get_enterprise_departments.fl?rg_ID=" + rg_ID, function(data) { if (data != null) { var optContent = "<option value=''> </option>"; for (var i = 0; i < data.length; i++) { var optValue = data[i].value; var optText = data[i].text; optContent += "<option" if (optValue == '<%=localDepartementID%>') { optContent += " selected"; } optContent += " value='" + optValue + "'>" + optText + "</option>" } $("#Lo_Dep").html(optContent); $("#Lo_Dep").width($("#div_Lo_Dep").width());//For IE7 } }); } function loadNbrHotels(lo_ID) { $.getJSON("<fl:webapp/>/get_localite_nbr_hotels.fl?Lo_RattID=" + lo_ID, function(data) { if (data != null) { var optValue = data[0].nombre; alert("Le nombre d'hôtels attachés à cette localité est : " + optValue); } }); } function doSubmit() { var f = document.forms[0]; var locRatt = f.Lo_RattID; if(locRatt.value != "") { loadNbrHotels(locRatt.value); alert("L'hotel va apparaître sur cette commune de rattachement."); return true; } else { return true; } } </script> <fl:form action="save_localite_.fl" bean="Localite_"> <fl:bigTabs objectTitle="Localite" ou="<%= \"edit_localite_.fl\" + (id != null ? \"?id=\" + id : \"\")%>" > <table class="container" cellpadding="0"> <tr> <td colspan="5"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="labelTitreFiche"> <fl:label field="Lo_Nom" labelClassName="titreFiche"/> </td> <td class="fieldTitreFiche"> <fl:input property="Lo_Nom" mandatoryMsgCode="MF019"/> </td> </tr> </table> </td> </tr> <tr><td colspan="5" class="ligne_separation"/></tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <fl:fieldEdit property="Lo_NomTri" mandatoryMsgCode="MF01A"/> <tr> <td class="titreInterneSmalltabs" colspan="5"> <fl:getMessage code="L8293" alt="Localisation"/> </td> </tr> <tr><td colspan="5" class="ligne_separation"/></tr> <tr class="fieldline"> <td id="Lo_Pays_label" class="dataLabel"> <div><fl:getMessage code="F2015" alt="Pays"/> </div> </td> <td id="Lo_Pays_value" class="dataValue"> <div class="input select"> <% try { Vector<Vector<String>> values = dico.getRefList(session, "Ctr", "Te1"); %> <select name="Lo_Pays" class="input select" id="Lo_Pays" onchange="loadRegion(this.value);loadDepartment(this.value);setChampInsee();"> <option value=""></option> <% if (values != null) { for (Vector<String> row : values) { String refID = row.firstElement(); String refDisp = row.elementAt(1); %> <option value="<%= Utils.formatToWeb(refID, true) %>"><%= Utils.formatToWeb(refDisp, false) %></option> <% } } %> </select> <% }catch (FrontlineException fle) { } %> </div> </td> </tr> <tr class="fieldline"> <td id="Lo_Reg_label" class="dataLabel"> <div><fl:getMessage code="F6006" alt="Région"/> </div> </td> <td id="Lo_Reg_value" class="dataValue"> <div class="input select"> <% try { Vector<Vector<String>> values = dico.getRefList(session, "Rg_", "Te1"); %> <select name="Lo_Reg" class="input select" id="Lo_Reg" onchange="loadDepartment(this.value);"> <option value=""></option> <% if (values != null) { for (Vector<String> row : values) { String refID = row.firstElement(); String refDisp = row.elementAt(1); %> <option value="<%= Utils.formatToWeb(refID, true) %>"><%= Utils.formatToWeb(refDisp, false) %></option> <% } } %> </select> <% }catch (FrontlineException fle) { } %> </div> </td> </tr> <fl:fieldEdit property="Lo_Dep" alt=""/> <fl:fieldEdit property="Lo_Cdpost"/> <tr class="fieldline"> <td class="dataLabel"><fl:label field="Lo_RattID" /></td> <td id="Lo_RattID_value" class="dataValue"> <div class="input fieldTable"> <table class="fieldTable" cellpadding="0" cellspacing="0"> <tbody> <tr valign="top"> <td class="principalText bigFieldPart"> <div class="fobLeftDiv"> <input type="hidden" name="nbrHotelsLocalite" value=""> <input id="Lo_RattID" name="Lo_RattID" class="input" value="" type="hidden"> <input id="lblLo_RattID" name="lblLo_RattID" value="" onfocus="this.blur();" readonly="" class="input fob" onchange="doLo_RattIDChange();" type="text"> </div> </td> <td class="smallFieldPart"> <span id="Lo_RattID_icons"> <a href="javascript: var win = window.open('<fl:webapp/>/xml_select_list.fl?id=<%=lstObjID%>&field=Lo_RattID&formIndex=0', 'SelectLo_RattID', 'resizeable=yes,scrollbars=yes,menubar=no,toolbar=no,height=670,width =800')"><img src="<fl:webapp/>/icons/ico/rechercher.gif" class="icon" alt="<fl:getMessage code="A2003" alt="Sélectionner"/>" title="<fl:getMessage code="A2003" alt="Sélectionner"/>"></a> <a class="fob" href="javascript:var f = window.document.forms[0]; f.Lo_RattID.value = ''; if (f.lblLo_RattID) f.lblLo_RattID.value = ''; void(''); doLo_RattIDChange();"><img src="<fl:webapp/>/icons/ico/supprimer.gif" class="icon" alt="<fl:getMessage code="S004B" alt="Vider le champ"/>" title="<fl:getMessage code="S004B" alt="Vider le champ"/>"></a> </span> </td> </tr> </tbody> </table> </div> </td> </tr> </table> <table id="Lo_Acc" class="data_column" cellpadding="0" style="display:none;"> <fl:fieldEdit property="Lo_Acces"/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table id="Lo_Ins" class="data_column" cellpadding="0" style="display:none;"> <fl:fieldEdit property="Lo_Insee" /> </table> <table class="data_column" cellpadding="0"> <fl:fieldEdit property="Lo_Nbhab"/> <fl:fieldEdit property="Lo_Alt"/> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="titreInterneSmalltabs" colspan="5"> <fl:getMessage code="LF00E" alt="Coordonnées GPS"/> </td> <tr><td colspan="5" class="ligne_separation"/></tr> <fl:fieldEdit property="Lo_GpsX"/> <fl:fieldEdit property="Lo_GpsY"/> <tr><td colspan="5" class="ligne_separation"/></tr> <fl:fieldEdit property="Lo_AtFranceZn1" alt=""/> <fl:fieldEdit property="Lo_AtFranceZn2" alt=""/> <fl:fieldEdit property="Lo_AtFranceZn3" alt=""/> <fl:fieldEdit property="Lo_AtFranceZn4" alt=""/> <fl:fieldEdit property="Lo_AtFranceZn5" alt=""/> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> </table> </fl:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de