Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\sales\person\personEventTable_ajax.jsp
<% /****************************************************************************** * 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("<div class=\"edealGrid\"><div id=\"grid-data\" class=\"data\" ed:embedded=\"true\"><table cellpadding=\"0\" style=\"width: 100%;\">"); if (events.size() == 0) { tableBuffer.append("<thead><tr class=\\\"fieldline\\\"><td class=\\\"titreInterneSmalltabs\\\">"); tableBuffer.append(titleStr); tableBuffer.append("</td></tr></thead></table><div><label>"); tableBuffer.append(Utils.getMessage(session, "L0001", true, "Aucune entrée disponible")); tableBuffer.append("</label></div>"); } else { tableBuffer.append("<thead><tr class=\\\"fieldline\\\"><td colspan=\\\"5\\\" class=\\\"titreInterneSmalltabs\\\">"); tableBuffer.append(titleStr); tableBuffer.append("</td></tr><tr><th style=\\\"width:10%;\\\"></th>"); tableBuffer.append("<th style=\\\"width:20%;\\\">"); tableBuffer.append(titleStr); tableBuffer.append("</th>"); tableBuffer.append("<th style=\\\"width:11%;\\\">"); tableBuffer.append(Utils.getMessage(session, "F2029", true, "Catégorie")); tableBuffer.append("</th><th style=\\\"width:12%;\\\">"); tableBuffer.append(Utils.getMessage(session, "L819D", true, "Statut d\\\'inscription")); tableBuffer.append("</th><th style=\\\"width:12%;\\\">"); tableBuffer.append(Utils.getMessage(session, "L819E", true, "Statut de participation")); tableBuffer.append("</th><th style=\\\"width:15%;\\\">"); tableBuffer.append(Utils.getMessage(session, "F2019", true, "Date en cours")); if (isConsolided) { tableBuffer.append("</th><th style=\\\"width:10%;\\\">"); tableBuffer.append(Utils.getMessage(session, "L6589", true, "Fonction")); tableBuffer.append("</th><th style=\\\"width:10%;\\\">"); tableBuffer.append(Utils.getMessage(session, "F002B", true, "Entreprise")); } tableBuffer.append("</th></tr></thead><tbody>"); 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("<tr class=\\\""+ lignCssClass +" bean\\\"><td><a href=\\\"javascript:editMarkedEvent(\\\'" + PvtID + "\\\');\\\"><img src=\\\"" + context.getContextName() + "/icons/ico/zoom.gif\\\" class=\\\"icon\\\"></a>"); if(hasEdtAccess){ tableBuffer.append(" <a href=\\\"javascript:deleteMarkedEvent(\\\'" + PvtID + "\\\');\\\"><img src=\\\"" + context.getContextName() + "/icons/ico/supprimer.gif\\\" class=\\\"icon\\\"></a>"); } if (PvtFrpID != null) { tableBuffer.append(" <a href=\\\"javascript: viewResponse(\\\'"+ PvtFrpID + "\\\');\\\"><img src=\\\"" + context.getContextName() + "/icons/ico/aide.gif\\\" class=\\\"icon\\\"></a>"); } if (PvtSrpID != null && scriptResponse != null) { tableBuffer.append(" <a href=\\\"javascript: previewScriptResponse(\\\'" + scriptResponse.getSrpID() + "\\\',\\\'" + hasNotes + "\\\',\\\'" + session.getAttribute("PerID") + "\\\');\\\"><img src=\\\"" + context.getContextName() + "/icons/ico/lister.gif\\\" class=\\\"icon\\\"></a>"); } tableBuffer.append("</td><td>"); String href = flRequest.computeURL("/read_event.fl?id=" + PvtEventID, true, false, true); tableBuffer.append("<a href=\\\"" + href + "\\\">" + Utils.formatToJavascript(EvtLabel) + "</a>"); tableBuffer.append("</td><td>"); tableBuffer.append(Utils.formatToJavascript(EvtCategory)); tableBuffer.append("</td><td>"); tableBuffer.append(Utils.formatToJavascript(pvtParStatus)); tableBuffer.append("</td><td>"); tableBuffer.append(Utils.formatToJavascript(pvtInsStatus)); tableBuffer.append("</td><td align=\\\"right\\\">"); tableBuffer.append(dateFormat.format(EvtDate)); if (isConsolided) { tableBuffer.append("</td><td>"); tableBuffer.append(Utils.formatToJavascript(PerFct)); tableBuffer.append("</td><td>"); tableBuffer.append(Utils.formatToJavascript(EntCorpName)); } tableBuffer.append("</td></tr>"); } tableBuffer.append("</tbody></table>"); } tableBuffer.append("</div></div>"); %>var f = document.getElementById('<%= "future".equalsIgnoreCase(eventType) ? "PersonFutureEventTable" : "PersonPastEventTable" %>'); f.innerHTML = '<%= tableBuffer.toString() %>'; window.location = '#bottom_smalltabs';
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de