Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\marketing\event\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="java.util.*" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="com.edeal.frontline.SalesInvestBean" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="com.edeal.frontline.EnterpriseBean"%> <%@ page import="com.edeal.frontline.PersonBean"%> <%@ page import="com.edeal.frontline.OpportunityBean"%> <%@ page import="com.edeal.frontline.helper.EventBaseHelper.EventCategory" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.EventBean" id="Event" 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(); // On récupère l'ID de l'acteur connecté String actID = null; String valRestr = "AGFED;CAFED;BNFED;CM;SEM;CONG;AGASSO;CAASSO;BNASSO"; 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"); } } } String id = null; try { id = Event.getID(); } catch (Exception e) { id = null; Vector <String> actorsList = new Vector<String>(); // on initialize l'acteur connecté actorsList.addElement(actID); Event.setEvtActors(actorsList); } boolean isSalesInvest = false; try { isSalesInvest = Event.isEvtIsSalesInvest(); } catch (FieldNotInitializedException e) { } boolean isActiveSalesInvest = SalesInvestBean.isSalesInvestActive(context); String eventCategoryID = null; try { eventCategoryID = Event.getEvtCategory(); } catch (FieldNotInitializedException e){ } String statutEvt = ""; // Catégorie de l'Event MEET, TMK , QST ou autre String eventCategory = null; try { eventCategory = (String) dico.getRefDisp("Ect", "Te2", eventCategoryID); } catch (Exception e) { } // Type de l'Evenementt Asso String eventTypeAssoID = null; try { eventTypeAssoID = (String) dico.getRefIdByCode("EvtCategory", "AGASSO"); } catch (Exception e) { eventTypeAssoID =""; } // Type de l'Evenementt Agfed String eventTypeFedID = null; try { eventTypeFedID = (String) dico.getRefIdByCode("EvtCategory", "AGFED"); } catch (Exception e) { eventTypeAssoID =""; } // On initialise l'état de l'évènement pour le cas AGASSO: AG des Associations seulement dans le cas de la création if ( ( eventTypeAssoID.equalsIgnoreCase(eventCategoryID) || eventTypeFedID.equalsIgnoreCase(eventCategoryID) ) && id == null) { // Types du statut de l'Evenement String openStatutType = null; String closedStatutType = null; try { openStatutType = (String) dico.getRefIdByCode("EvtStatut_", "OPEN"); closedStatutType = (String) dico.getRefIdByCode("EvtStatut_", "CLOSED"); } catch (Exception e) { } Event.setCustomProperty("EvtStatut_", openStatutType); statutEvt = openStatutType; } else if ( !( eventTypeAssoID.equalsIgnoreCase(eventCategoryID) || eventTypeFedID.equalsIgnoreCase(eventCategoryID) ) && id == null) { statutEvt = ""; Event.setCustomProperty("EvtStatut_", ""); } 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", "D_DIR_PRES"); /* Role Directeur/Président*/ String role7ID = dico.getRefIdByCode("ActRoles", "J_RESP_POLE_JUR"); /* Role Responsable Pôle Réseau - Juridique - Qualité*/ String role8ID = dico.getRefIdByCode("ActRoles", "R_ASSIST_RES_AFFIL"); /* Role Assistant Réseau Affiliés */ if(!(actRolesIDs.isEmpty())) { // on prend le 1er role de l'acteur connecté String actRoleIDactuel = actRolesIDs.get(0).toString(); if(actRoleIDactuel.equals(role1ID)) { valRestr ="AGASSO;CAASSO;BNASSO"; } else if (actRoleIDactuel.equals(role7ID)) { valRestr ="AGASSO;CAASSO;BNASSO;SEM;CONG"; } else if (actRoleIDactuel.equals(role8ID)) { valRestr ="AGFED;CAFED;BNFED;SEM;CONG;AGASSO;CAASSO;BNASSO"; } else if (actRoleIDactuel.equals(role6ID) || actRoleIDactuel.equals(role2ID)) { valRestr ="AGFED;CAFED;BNFED;CM;AGASSO;CAASSO;BNASSO"; } else if (actRoleIDactuel.equals(role4ID) || actRoleIDactuel.equals(role5ID)) { valRestr ="AGFED;CAFED;BNFED;CM;SEM;CONG"; } else if (actRoleIDactuel.equals(roleADMID) || actRoleIDactuel.equals(roleTECHADMID)) { valRestr =""; } } } catch (FrontlineException e) { } String numvoie= null, nature = null, libvoie = null, ville = null, pays = null, cp = null; String tiersDisp = ""; String eventTiersID = null; try { eventTiersID = (String) Event.getCustomProperty("EvtTiers_"); } catch (FieldNotInitializedException e){ } Boolean changeAdresseOK = false; String eventTiersIDOrig = ""; try { eventTiersIDOrig = (String) Event.getCustomProperty("EvtTrsOrigine_"); } catch (FieldNotInitializedException e){ } if( !eventTiersIDOrig.equalsIgnoreCase(eventTiersID)) { changeAdresseOK = true; } String evtTiersOrig = ""; if( !evtTiersOrig.equalsIgnoreCase("")) { evtTiersOrig = eventTiersID; } /* if(eventTiersID != null && changeAdresseOK){ EnterpriseBean Enterprise = new EnterpriseBean(eventTiersID , context); try { numvoie = (String) Enterprise.getCustomProperty("EntVoieNum_"); } catch (FieldNotInitializedException e) { } try { tiersDisp = (String) Enterprise.getEntCorpName(); } catch (FieldNotInitializedException e) { tiersDisp =""; } try{ nature = (String) Enterprise.getCustomProperty("EntNatureVoieID_"); } catch (FieldNotInitializedException e) { } try{ libvoie = (String) Enterprise.getCustomProperty("EntLblVoie_"); } catch (FieldNotInitializedException e) { } try{ cp= (String) Enterprise.getEntZip(); } catch (FieldNotInitializedException e) { } try{ ville= (String) Enterprise.getEntCity(); } catch (FieldNotInitializedException e) { } try{ pays= (String) Enterprise.getEntCtrID(); } catch (FieldNotInitializedException e) { } if(cp != null) { Event.setEvtZip(cp); } if(ville != null) { Event.setEvtCity(ville); } if(pays != null) { Event.setEvtCtrID(pays); } if(numvoie != null) { Event.setCustomProperty("EvtNumVoie_", numvoie); } if(nature != null) { Event.setCustomProperty("EvtNatureVoie", nature); } if(libvoie != null) { Event.setCustomProperty("EvtLibelleVoie", libvoie); } } else if (eventTiersID != null && !changeAdresseOK){ EnterpriseBean Enterprise = new EnterpriseBean(eventTiersID , context); try { tiersDisp = (String) Enterprise.getEntCorpName(); } catch (FieldNotInitializedException e) { tiersDisp =""; } } */ // Id de l'objet Localite String lo_ObjID = null; String lstObjID = null; try { String[] fieldslo_ = {"ObjID"}; String[][] querylo_ = {{"ObjSql = 'Enterprise'"}}; 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 language="javascript"> function doEvtCategoryChange() { doRefreshEvent(); } /*[{"INSCRIPTION":"A valider<br>Ecarté<br>Invité<br>Viendra<br>Ne viendra pas<br>Ne sait pas"},{"PARTICIPATION":"Venu<br>Absent<br>Excusé"}]*/ function doOnLoad() { doLoadListStatus(); //changeDisplay(); //doEvtCategoryChange(); var f = document.forms[0]; <% if(eventTiersID != null && tiersDisp != null) {%> f.EvtTiers_.value = '<%= eventTiersID %>' ; f.lblEvtTiers_.value = '<%= tiersDisp %>' ; <% }else if ( id == null) { %> f.EvtNumVoie_.value =''; f.EvtNatureVoie.value=''; f.EvtLibelleVoie.value=''; f.EvtZip.value=''; f.EvtCity.value=''; f.EvtCtrID.value=''; <% } %> if (f) { if (f.EvtZip) { f.EvtZip.onchange = doZipChange; } } } function doZipChange() { var f = document.forms[0]; retrieveCity(f.EvtCtrID.options[f.EvtCtrID.selectedIndex].value, f.EvtZip.value, 'EvtCity'); } function doLoadListStatus() { $.getJSON('<fl:webapp/>/get_list_event_status.fl?categoryID=' + $("#EvtCategory").val(), function(data) { if (data != null) { $("#StatusIscription").html(data.INSCRIPTION); $("#StatusParticipation").html(data.PARTICIPATION); } }); } function doRefreshEvent() { var f = document.forms[0]; f.action = "<fl:webapp/>/refresh_event.fl"; f.submit(); } function changeDisplay() { f = document.forms[0]; if (f.EvtIsSalesInvest && f.EvtIsSalesInvest.checked){ document.getElementById("EvtAvgAmountInvest").style.visibility = 'visible'; } else { document.getElementById("EvtAvgAmountInvest").style.visibility = 'hidden'; } } function doEvtTiers_Change() { doRefreshEvent(); } function doCompareDate() { f = document.forms[0]; var dateBeg = f.EvtDate.value; var dateEnd = f.EvtEndDate.value; /*if (dateBeg != "" && dateEnd == "") { alert('<fl:getMessage code="M9012" alt="Veuillez spécifier la date de fin" js="true"/>'); return; }*/ if (/*dateEnd != "" && */dateBeg == "") { alert('<fl:getMessage code="M9011" alt="Veuillez spécifier la date de début" js="true"/>'); return; } if (dateBeg != "" && dateEnd != "" && compareDate(dateBeg,'',dateEnd,'') > 0) { alert('<fl:getMessage code="M0021" alt="La date de début doit être inférieure à la date de fin." js="true"/>'); return; } return true; } function doSubmit() { var f = document.forms[0]; if (!doCompareDate()) { return; } return true; } </script> <fl:form action="/save_event.fl" bean="Event"> <input type="hidden" name="EvtTrsOrigine_" value="<fl:getProperty name="Event" property="EvtTrsOrigine_" alt=""/>"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L305F\", \"Evénement\") %>" listTitle="<%= Utils.getMessage(session, \"L6401\", \"Liste des événements\") %>" ou="<%=\"/edit_event.fl\" + ( id !=null ? \"?id=\"+id : \"\")%>" > <% if( id == null ) { %> <input name="EvtStatut_" type="hidden" value="<%=statutEvt%>"> <%} %> <table class="container" cellpadding="0"> <tr> <td colspan="3"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="labelTitreFiche"> <fl:label field="EvtLabel" labelClassName="titreFiche"/> </td> <td class="fieldTitreFiche"> <fl:input property="EvtLabel" mandatoryMsgCode="M2002"/> </td> </tr> </table> </td> </tr> <tr class="ligne_separation"><td colspan="3"></td></tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <% if(id == null) { %> <fl:fieldEdit property="EvtCategory" alt="" except="<%=valRestr%>" onchange="doEvtCategoryChange();"/> <%} else { %> <fl:fieldRead property="EvtCategory" alt=""/> <%} if (!statutEvt.equals("")){ %> <fl:fieldRead property="EvtStatut_"/> <%} %> <fl:fieldEdit property="EvtCode" mandatoryMsgCode="L6144"/> <fl:fieldEdit property="EvtDate" mandatoryMsgCode="M9011"/> <fl:fieldEdit property="EvtEndDate"/> <fl:fieldEdit property="EvtModelMail_"/> <fl:fieldEdit property="EvtActors" mandatoryMsgCode="MF062"/> <fl:fieldEdit property="EvtQuota"/> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="column2"> <table class="data_column" cellpadding="0"> <%--if ( EventCategory.MEET.toString().equals(eventCategory)) { --%> <%-- <fl:fieldEdit property="EvtTiers_" onchange="doRefreshEvent();"/> --%> <%-- <tr class="fieldline"> <td class="dataLabel"><fl:label field="EvtTiers_" /></td> <td id="EvtTiers_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 id="EvtTiers_" name="EvtTiers_" class="input" value="" type="hidden"> <input id="lblEvtTiers_" name="lblEvtTiers_" onfocus="this.blur();" class="input fob" type="text"> </div> </td> <td class="smallFieldPart"> <span id="EvtTiers_icons"> <a href="javascript: var win = window.open('<fl:webapp/>/xml_select_list.fl?id=<%=lstObjID%>&field=EvtTiers_&formIndex=0', 'SelectEvtTiers_', '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.EvtTiers_.value = ''; if (f.lblEvtTiers_) f.lblEvtTiers_.value = ''; void(''); doRefreshEvent();"><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> --%> <%--<%} --%> <% if (isActiveSalesInvest) { %> <fl:fieldEdit property="EvtIsSalesInvest" onchange="changeDisplay();" onselect="changeDisplay();"/> <tr class="fieldline" id ="EvtAvgAmountInvest" style="<%= isSalesInvest ? "visibility : visible" : "visibility : hidden"%>"> <td class="dataLabel" > <fl:label field="EvtAvgAmountInvest"/> </td> <td class="dataValue"> <fl:input property="EvtAvgAmountInvest" postText="€"/> </td> </tr> <% } /*if (EventCategory.MEET.toString().equals(eventCategory)) { */%> <tr><td colspan="5" class="ligne_separation"/></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="EvtNumVoie_" width="80%" /> <!-- <td><div> </div></td> --> </td> <td style="width: 30%"> <%-- <fl:input property="EntNatureVoieID_" mandatoryMsgCode="MF075" width="auto"/> --%> <fl:input property="EvtNatureVoie" alt="" width="90%"/> </td> <td style="width: 50%"> <%-- <fl:input property="EntLblVoie_" mandatoryMsgCode="MF076" /> --%> <fl:input property="EvtLibelleVoie" width="100%"/> </td> </tr> </table> </div> </td> </tr> <tr class="fieldline"> <td class="dataLabel"><fl:getMessage code="FF096" alt="Code Postal/Ville"/></td> <!-- <td class="dataLabel"><div> </div></td> --> <td class="dataValue" nowrap> <div class="fieldTable"> <table class="fieldTable" cellpadding="0"> <tr> <td style="width: 20%"> <input class="input text" type="text" name="EvtZip" onchange="doZipChange();" value="<fl:getProperty name="Event" property="EvtZip" alt=""/>" size="4" style="width: 80%;"/> </td> <td class="bigFieldPart"> <input class="input text" type="text" maxlength="50" id="EvtCity" onblur="this.value = checkString(this.value, 'upper');" name="EvtCity" value="<fl:getProperty name="Event" property="EvtCity" alt=""/>" style="width:100%" /> </td> </tr> </table> </div> </td> </tr> <tr class="fieldline"> <td class="dataLabel"><fl:getMessage code="F2015" alt="Pays"/></td> <td class="dataValue"> <fl:input id="EvtCtrID" property="EvtCtrID"/> </td> </tr> <%/* } */%> </table> </td> </tr> </table> </td> </tr> <tr class="ligne_separation"><td colspan="3"></td></tr> <tr> <td class="column2"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel" id="StatusIscription_label"> <div> <fl:label code="L8187"/> </div> </td> <td class="dataValue" id="StatusIscription_value"> <div id="StatusIscription"></div> </td> </tr> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="data_column" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel" id="StatusParticipation_label"> <div> <fl:label code="L818F"/> </div> </td> <td class="dataValue" id="StatusParticipation_value"> <div id="StatusParticipation"></div> </td> </tr> </table> </td> </tr> <tr class="ligne_separation"><td colspan="3"></td></tr> </table> <table class="container" cellpadding="0"> <tr><td class="titrePartie"><fl:getMessage code="F2024" alt="Notes"/></td></tr> <tr><td class="dataValue noPaddingLeft"><fl:input property="EvtRemarks" 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> <fl:smallTabs name="Events__Tabs"> <fl:sTab id="AttFiles" title="<%=Utils.getMessage(session, \"L201C\", false, true, \"Fichiers\")%>"> <div> <table class="container" cellpadding="0"> <fl:fieldEdit property="EvtAttID"/> </table> </div> </fl:sTab> </fl:smallTabs> </fl:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de