Edit C:\Windows\install\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.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; 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;COM;COPIL;AGASSO;CAASSO;BNASSO"; } else if (actRoleIDactuel.equals(role4ID) || actRoleIDactuel.equals(role5ID)) { valRestr ="BNFED;CM;COM;COPIL;SEM;CONG;AGASSO;CAASSO"; } else if (actRoleIDactuel.equals(roleADMID) || actRoleIDactuel.equals(roleTECHADMID)) { valRestr =""; } } } catch (FrontlineException e) { } %> <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(); } 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 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"> <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" except="<%=valRestr%>" onchange="doEvtCategoryChange();"/> <%} else { %> <fl:fieldRead property="EvtCategory"/> <%} 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="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_"/> <%} %> <% 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)) { */%> <fl:fieldEdit property="EvtAd1"/> <tr class="fieldline"> <td class="dataLabel"><div> </div></td> <td class="dataValue"> <fl:input property="EvtAd2"/> </td> </tr> <tr class="fieldline"> <td class="dataLabel"><div> </div></td> <td class="dataValue"> <fl:input property="EvtAd3"/> </td> </tr> <tr class="fieldline"> <td class="dataLabel"><div> </div></td> <td class="dataValue" nowrap> <div class="fieldTable"> <table class="fieldTable" cellpadding="0"> <tr> <td class="smallFieldPart"> <input class="input text" type="text" name="EvtZip" value="<fl:getProperty name="Event" property="EvtZip" alt=""/>" size="4" style="width: auto;"/> </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"><div> </div></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:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de