<%@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="java.util.Calendar" %> <%@ 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 dateBegin = Utils.getRequestParameter(request,"fromDate",false); boolean firstCall = dateBegin == null; Date fromDate = new Date(); if (dateBegin != null && !dateBegin.equals(Utils.getMessage(session, "M602F", ""))) { fromDate = Utils.formatFromWeb(dateBegin); if (fromDate == null) fromDate = new Date(); }else { fromDate = new Date(); } Vector days = new Vector(); String dateValue = Utils.formatToWebDate(fromDate,false); fromDate = Utils.formatFromWeb(dateValue); GregorianCalendar myCalendar = new GregorianCalendar(); myCalendar.setTime(fromDate); //Récupération du premier jour de la semaine courante myCalendar.set(Calendar.DAY_OF_WEEK, myCalendar.getFirstDayOfWeek()); Date beginDate = myCalendar.getTime(); for (int j = 0; j < 7; j++) { days.addElement(Utils.formatToWebDate(session, myCalendar.getTime(), false)); myCalendar.setTime(new Date(myCalendar.getTime().getTime() + 86400000)); } beginDate = Utils.formatDateFromWeb(session, (String) days.firstElement()); Date endDate = Utils.formatDateFromWeb(session, (String) days.lastElement()); java.text.SimpleDateFormat sdfDayName = FlLocale.getInstance(session).getSimpleDateFormat("EEE"); //SimpleDateFormat sdfDay = new SimpleDateFormat("d", usrLocale); java.text.SimpleDateFormat sdfDay = FlLocale.getInstance(session).getSimpleDateFormat("dd/MM"); %> <fl:getMessage code="L309D" alt="Agenda"/>
<% 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(); %> <  <%= Utils.formatToWebDate(beginDate,false)%>  > 
") %> ">
<% String actorID = (String)session.getAttribute("actorID"); GregorianCalendar calGreg = new GregorianCalendar(); for (int k = 0; k < 5; k ++) { calGreg.setTime(beginDate); calGreg.add(Calendar.DATE,k); Date baseDate = calGreg.getTime(); %>
<% } %> <% if (perID != null) { %> <% } %> <% if (perPhone != null) { %> <% } %> <% if (perMail != null) { %> <% } --%> <% } %> <% }else { %> <% } %> [+]
<%=sdfDayName.format(baseDate)%> <%=sdfDay.format(baseDate)%>   <% Vector list = new Vector() ; if (!firstCall) { String[] field = {"IntID","IntTimeBeg","IntTimeEnd","IntSubject","IntDetails","IntCorID"}; String[][] query = {{"IntActID contains (" + Utils.formatToSQL(context, actorID) + ")","IntDate = "+Utils.formatToSQL(context,baseDate),"IntStiID = "+Utils.formatToSQL(context,todo)}}; String[] orderBy = {"IntTimeBeg"}; list = InteractionBean.listSummary(session,field,query,orderBy); } 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,false); String hourEnd = Utils.formatToWebTime(session, endHour,false); String notes = (String) row.get("IntDetails"); Vector vectCor = (Vector) row.get("IntCorID"); String personName = ""; String perID = null; String perPhone = 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.getPerMobile(); }catch (FieldNotInitializedException ex){} try { perMail = perBean.getPerMail(); }catch (FieldNotInitializedException ex){} } } %> <%= hourBeg %><%= ((hourEnd != null) ? " - " + hourEnd : "") %> <%= (subject != null) ? subject : "" %>
<%-- if (notes != null) { %>
<%= Utils.formatToWeb(notes,false)%>
<%= Utils.formatToWeb(personName,false)%>
<%= Utils.formatPhoneToMobile(perPhone,session)%>
<%= Utils.formatToWeb(perMail,false)%>
<% } %>