<%@page session="true" import="com.edeal.frontline.*,java.util.*"%> <%@ page import="java.util.GregorianCalendar" %> <%@ page import="com.edeal.frontline.DataDictionary" %> <%@ page import="com.edeal.frontline.CorrespondentBean" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <%@ page import="com.edeal.frontline.AccessDeniedException" %> <%@ page import="com.edeal.frontline.PersonBean" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%> <% 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 todo = dico.getRefIdByCode("IntStiID","TODO"); String beginDate = flRequest.getParameter("fromDate"); //Utils.getRequestParameter(request,"fromDate",false); boolean firstCall = beginDate == null; boolean isToday = false; Date fromDate = new Date(); if (beginDate != null && !beginDate.equals(Utils.getMessage(session, "M602F", "")) && !"".equals(beginDate.trim())) { fromDate = Utils.formatDateFromWeb(session,beginDate); if (fromDate == null) { beginDate = flRequest.getParameter("oldDate"); fromDate = Utils.formatDateFromWeb(session,beginDate); if (fromDate == null) { fromDate = new Date(); } } }else { fromDate = new Date(); } GregorianCalendar fromCal = new GregorianCalendar(); GregorianCalendar today = new GregorianCalendar(); fromCal.setTime(fromDate); today.setTime(new Date()); if ( (today.get(today.DAY_OF_MONTH)==fromCal.get(fromCal.DAY_OF_MONTH)) && (today.get(today.MONTH)==fromCal.get(fromCal.MONTH)) && (today.get(today.YEAR)==fromCal.get(fromCal.YEAR)) ) isToday=true; String dateValue = Utils.formatToWebDate(session,fromDate,false); fromDate = Utils.formatDateFromWeb(session,dateValue); String actorID = (String)session.getAttribute("actorID"); Vector list = new Vector() ; if (!firstCall) { String[] field = {"IntID","IntTimeBeg","IntTimeEnd","IntSubject","IntDetails","IntCorID","IntPlace"}; //String[][] query = {{"IntActID contains (" + Utils.formatToSQL(context, actorID) + ")", "IntDate = "+Utils.formatToSQL(context,fromDate),"IntStiID = "+Utils.formatToSQL(context,todo)}}; // Why should we display only done interactions ?? String[][] query = {{"IntActID contains (" + Utils.formatToSQL(context, actorID) + ")", "IntDate = "+Utils.formatToSQL(context,fromDate)}}; String[] orderBy = {"IntTimeBeg"}; list = InteractionBean.listSummary(session,field,query,orderBy); } %> <fl:getMessage code="L309D" alt="Agenda"/>
<% java.text.SimpleDateFormat sdfDayName = FlLocale.getInstance(session).getSimpleDateFormat("EEE"); GregorianCalendar greg = new GregorianCalendar(); greg.setTime(fromDate); //hier greg.add(Calendar.DATE,-1); Date yesterday = greg.getTime(); //demain greg.setTime(fromDate); greg.add(Calendar.DATE,1); Date tomorrow = greg.getTime(); //last week greg.setTime(fromDate); greg.add(Calendar.DATE,-7); Date lastWeek = greg.getTime(); //next week greg.setTime(fromDate); greg.add(Calendar.DATE,7); Date nextWeek = greg.getTime(); %> <<  <  <% if (isToday) {%> <% } else { %> <%=sdfDayName.format(fromDate)%> <%= Utils.formatToWebDate(session,fromDate,false)%>   <% } %> >  >> 
"> "> [+]
<% if(list != null && !list.isEmpty()){ for(int i=0; i < list.size(); i++){ Hashtable row = (Hashtable)list.elementAt(i); String id = (String) row.get("IntID"); Date beginHour = (Date) row.get("IntTimeBeg"); Date endHour = (Date) row.get("IntTimeEnd"); String subject = Utils.formatToWeb((String) row.get("IntSubject"),false); String hourBeg = Utils.formatToWebTime(session, beginHour,true,false); String hourEnd = Utils.formatToWebTime(session, endHour,true,false); String notes = (String) row.get("IntDetails"); String place = (String) row.get("IntPlace"); /* Vector vectCor = (Vector) row.get("IntCorID"); String personName = ""; String perID = null; String perPhone = null; String perMobile = null; String perMail = null; if (vectCor != null && vectCor.size() > 0) { String corID = (String) vectCor.firstElement(); PersonBean perBean = null; try { CorrespondentBean corBean = new CorrespondentBean(corID,session); perID = corBean.getCorPerID(); perBean = new PersonBean(perID,session); }catch (AccessDeniedException e){ }catch (FieldNotInitializedException ex){} if (perBean != null) { try { String perFstName = perBean.getPerFstName(); personName = perFstName +" "; }catch (FieldNotInitializedException ex){} try { String perName = perBean.getPerName(); personName += perName; }catch (FieldNotInitializedException ex){} try { perPhone = perBean.getPerPhone(); }catch (FieldNotInitializedException ex){} try { perMobile = perBean.getPerMobile(); }catch (FieldNotInitializedException ex){} try { perMail = perBean.getPerMail(); }catch (FieldNotInitializedException ex){} } } */ %>
<%-- if (notes != null) { //traitement 2*x x= paramétre 2 String notesStr =Utils.replace(notes,"\n"," "); String nbCharMax = (String) session.getAttribute("ActNbCharMax"); int nbMax = 20; if (nbCharMax != null) { Integer nbChar = new Integer(nbCharMax); if (nbChar != null) nbMax = nbChar.intValue(); } nbMax = 2 * nbMax; if (notesStr.length() > nbMax ) { notesStr = notesStr.substring(0,nbMax)+"."; } %>
<%= Utils.formatToWeb(notesStr,false)%> <% } --%> <%= hourBeg %>
  <%= hourBeg %><%= ((hourEnd != null) ? " - " + hourEnd : "") %> <%= (subject != null) ? subject : "" %> <% if (place != null) {%>
<%= Utils.formatToWeb(place,false) %> <% } %> <%-- if (perID != null) { %> <%= Utils.formatToWeb(personName,false)%>
<% } %> <% if (perPhone != null) { %> <%= Utils.formatPhoneToMobile(perPhone,session)%>
<% } %> <% if (perMobile != null) { %> <%= Utils.formatPhoneToMobile(perMobile,session)%>
<% } %> <% if (perMail != null) { %> <%= Utils.formatToWeb(perMail,false)%> <% } --%>
<% } }else if (!firstCall) { %> <% } %>