<% /****************************************************************************** * Copyright (c) 2000-2006 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" contentType="text/plain;charset=UTF-8"%> <%@ page import="java.text.DateFormat" %> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.FlLocale" %> <%@ page import="com.edeal.frontline.Utils" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Hashtable" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.ScriptResponseBean" %> <%@ page import="com.edeal.frontline.ScriptBean" %> <%@ page import="com.edeal.frontline.AccessControlManager" %> <%@ page import="com.edeal.frontline.PersonBean" %> <%@ page import="com.edeal.frontline.AccessDeniedException" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); Boolean isConsolided = false; String id = flRequest.getParameter("PerID"); if (id == null) { id = flRequest.getParameter("PerFctParentID"); if (id != null) { isConsolided = true; } } boolean hasEdtAccess = false; if(id != null) { try { PersonBean person = new PersonBean(id, session); hasEdtAccess = person.enforceAccess(AccessControlManager.EDIT); } catch (AccessDeniedException ex) { } } String eventType = flRequest.getParameter("eventType"); Vector events = (Vector)flRequest.getAttribute("future".equalsIgnoreCase(eventType) ? "futureEvents" : "pastEvents"); if (events == null) { events = new Vector(); } String titleStr; if ("future".equalsIgnoreCase(eventType)) { titleStr = Utils.getMessage(session, "L614F", true, "Evénements en cours"); } else { titleStr = Utils.getMessage(session, "L6151", true, "Evénements passés"); } FlLocale userLocale = FlLocale.getInstance(session); DateFormat dateFormat = userLocale.getDateFormat(); StringBuffer tableBuffer = new StringBuffer(); tableBuffer.append("
"); if (events.size() == 0) { tableBuffer.append("
"); tableBuffer.append(titleStr); tableBuffer.append("
"); } else { tableBuffer.append(""); tableBuffer.append(titleStr); tableBuffer.append(""); tableBuffer.append(""); tableBuffer.append(titleStr); tableBuffer.append(""); tableBuffer.append(""); tableBuffer.append(Utils.getMessage(session, "F2029", true, "Catégorie")); tableBuffer.append(""); tableBuffer.append(Utils.getMessage(session, "L819D", true, "Statut d\\\'inscription")); tableBuffer.append(""); tableBuffer.append(Utils.getMessage(session, "L819E", true, "Statut de participation")); tableBuffer.append(""); tableBuffer.append(Utils.getMessage(session, "F2019", true, "Date en cours")); if (isConsolided) { tableBuffer.append(""); tableBuffer.append(Utils.getMessage(session, "L6589", true, "Fonction")); tableBuffer.append(""); tableBuffer.append(Utils.getMessage(session, "F002B", true, "Entreprise")); } tableBuffer.append(""); for (int cnt = 0; cnt < events.size(); ++cnt) { Hashtable row = (Hashtable)events.elementAt(cnt); String PvtID = (String)row.get("PvtID"); String PvtEventID = (String)row.get("PvtEventID"); String EvtCategory = (String) row.get("PvtEventID:EvtCategory:Val"); Date EvtDate = (Date) row.get("PvtEventID:EvtDate"); String EvtLabel = (String) row.get("PvtEventID:EvtLabel"); String pvtParStatus = (String) row.get("PvtParStatus:Val"); String pvtInsStatus = (String) row.get("PvtInsStatus:Val"); //String EvtStatus = pStatusI == null ? " " : (String)row.get("PvtEventID:EvtStatus" + pStatusI.toString()); String PvtFrpID = (String) row.get("PvtFrpID"); String PvtSrpID = (String) row.get("PvtSrpID"); String PerFct = (String) row.get("PvtPersonID:PerFctID:Val"); String EntCorpName = (String) row.get("PvtPersonID:PerEntID:EntCorpName"); ScriptResponseBean scriptResponse = null; String[][] query = {{"SrpID = " + Utils.formatToSQL(context, PvtSrpID)}}; String[] fields = {"SrpScriptID"}; Vector list = ScriptResponseBean.list(session, query); if (list != null && list.size() > 0) { scriptResponse = (ScriptResponseBean) list.elementAt(0); } ScriptBean script = null; String[][] queryRep = {{"ScrID = " + Utils.formatToSQL(context, PvtSrpID)}}; String[] fieldsRep = {"ScrNotes"}; Vector listRep = ScriptBean.list(session, queryRep); if (listRep != null && listRep.size() > 0) { script = (ScriptBean) listRep.elementAt(0); } String hasNotes = ""; if(script!=null && script.isScrHasNotes()) hasNotes = "true"; else hasNotes = "false"; String lignCssClass = (cnt%2 == 0) ? "even" : "odd" ; tableBuffer.append(""); if(hasEdtAccess){ tableBuffer.append(" "); } if (PvtFrpID != null) { tableBuffer.append(" "); } if (PvtSrpID != null && scriptResponse != null) { tableBuffer.append(" "); } tableBuffer.append(""); String href = flRequest.computeURL("/read_event.fl?id=" + PvtEventID, true, false, true); tableBuffer.append("" + Utils.formatToJavascript(EvtLabel) + ""); tableBuffer.append(""); tableBuffer.append(Utils.formatToJavascript(EvtCategory)); tableBuffer.append(""); tableBuffer.append(Utils.formatToJavascript(pvtParStatus)); tableBuffer.append(""); tableBuffer.append(Utils.formatToJavascript(pvtInsStatus)); tableBuffer.append(""); tableBuffer.append(dateFormat.format(EvtDate)); if (isConsolided) { tableBuffer.append(""); tableBuffer.append(Utils.formatToJavascript(PerFct)); tableBuffer.append(""); tableBuffer.append(Utils.formatToJavascript(EntCorpName)); } tableBuffer.append(""); } tableBuffer.append(""); } tableBuffer.append("
"); %>var f = document.getElementById('<%= "future".equalsIgnoreCase(eventType) ? "PersonFutureEventTable" : "PersonPastEventTable" %>'); f.innerHTML = '<%= tableBuffer.toString() %>'; window.location = '#bottom_smalltabs';