%
/******************************************************************************
* Copyright (c) 2000-2004 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" import="com.edeal.frontline.*,java.util.*"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="com.edeal.frontline.FlLocale" %>
<%@ page import="com.edeal.frontline.FieldNotInitializedException" %>
<%@ page import="java.util.TimeZone" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="com.edeal.frontline.InteractionBean" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="com.edeal.frontline.ActorBean" %>
<%@ page import="com.edeal.frontline.CorrespondentBean" %>
<%@ 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();
Date fromDate = new Date();
try {
fromDate = Interaction.getIntDate();
}catch (FieldNotInitializedException e){}
String id = null;
try {
id = Interaction.getIntID();
}catch (FieldNotInitializedException e){}
String beginTime = null;
String endTimeValue = null;
String activite = null;
Date begTime = null;
try {
begTime = Interaction.getIntTimeBeg();
beginTime = Utils.formatToWebTime(session,begTime,false);
}catch (FieldNotInitializedException e){
begTime = new Date();
beginTime = "";
}
Date endTime = null;
try {
endTime = Interaction.getIntTimeEnd();
endTimeValue = Utils.formatToWebTime(session,endTime,false);
}catch (FieldNotInitializedException e){
endTimeValue="";
}
try {
String atvID = Interaction.getIntAtvID();
String etvDisp = (String) dico.getRefDisp("IntAtvID",atvID);
activite = Utils.formatToWeb(etvDisp,false);
}catch (FieldNotInitializedException e){
}
String subject = null;
try {
subject = Interaction.getIntSubject();
}catch (FieldNotInitializedException e){
}
String place = null;
try {
place = Interaction.getIntPlace();
} catch (FieldNotInitializedException e) {
}
String actorID = (String)session.getAttribute("actorID");
String todo = dico.getRefIdByCode("IntStiID","TODO");
//faire la liste des interactions pour savoir s'il y a un preview ou pas?
String[] fieldPrev = {"IntID"};
String[][] queryPrev = {{"IntActID contains (" + Utils.formatToSQL(context, actorID) + ")","IntTimeBeg <="+Utils.formatToSQL(context,begTime),"IntDate <="+Utils.formatToSQL(context,fromDate),"IntID <> "+Utils.formatToSQL(context,id)},{"IntActID contains (" + Utils.formatToSQL(context, actorID) + ")","IntDate <"+Utils.formatToSQL(context,fromDate),"IntID <> "+Utils.formatToSQL(context,id)}};
String[] orderBy = {"IntDate DESC","IntTimeBeg DESC"};
Vector listPrev = InteractionBean.listSummary(context,fieldPrev,queryPrev,orderBy);
String intPrevID = null;
if (listPrev != null && listPrev.size() > 0) {
Hashtable hash = (Hashtable) listPrev.elementAt(0);
intPrevID = (String) hash.get("IntID");
}
String[][] queryNext = {{"IntActID contains (" + Utils.formatToSQL(context, actorID) + ")","IntTimeBeg >="+Utils.formatToSQL(context,begTime),"IntDate >="+Utils.formatToSQL(context,fromDate),"IntID <> "+Utils.formatToSQL(context,id)},{"IntActID contains (" + Utils.formatToSQL(context, actorID) + ")","IntDate >"+Utils.formatToSQL(context,fromDate),"IntID <> "+Utils.formatToSQL(context,id)}};
String[] orderByNext = {"IntDate ASC","IntTimeBeg ASC"};
Vector listNext = InteractionBean.listSummary(context,fieldPrev,queryNext,orderByNext);
String intNextID = null;
if (listNext != null && listNext.size() > 0) {
Hashtable hash = (Hashtable) listNext.elementAt(0);
intNextID = (String) hash.get("IntID");
}
%>
<% if (intPrevID != null) { %>
<
<% } %>
<% if (intNextID != null) { %>
>
<% } %>
<%= ((subject!= null) ? Utils.formatToWeb(subject,false) : "")%>
|
<%= Utils.formatToWebDate(session,fromDate,false) %>
<%= Utils.formatToWebTime(session,begTime,false,false)%> - <%= Utils.formatToWebTime(session,endTime,false,false)%>
<% if (activite != null) {%>
<%= activite %>
<% } %>
<% if (place != null) {%>
<%= Utils.formatToWeb(place,false) %>
<% } %>
<%
String notes = null;
try {
notes = Interaction.getIntDetails();
String notesStr = Utils.replace(notes,"\n"," ");
int nbLigne = 2;
int nbChar = 20;
String nbMaxLigne = (String) session.getAttribute("ActNbLigneReadMax");
String nbCharMax = (String) session.getAttribute("ActNbCharMax");
if (nbCharMax != null) {
Integer nbMax = new Integer(nbCharMax);
nbChar = nbMax.intValue();
}
if (nbMaxLigne != null) {
Integer nbMaxLig = new Integer(nbMaxLigne);
nbLigne = nbMaxLig.intValue();
}
//je tronque selon la regle :
int toDisplay = nbChar * nbLigne;
if (notesStr.length() > toDisplay )
notesStr = notesStr.substring(0,toDisplay)+".";
%>
<%= Utils.formatToWeb(notesStr,false) %>
<%
} catch (FieldNotInitializedException e){}
%>
|
<% Vector vectActor = new Vector();
try {
vectActor = Interaction.getIntActID();
}catch (FieldNotInitializedException e){}
String[] fieldAct = {"ActName","ActFstName","ActMobile","ActPhone","ActMail"};
String[][] queryAct = {{"ActID in ("+Utils.implodeList(vectActor,",","'")+")"}};
Vector vectAct = ActorBean.listSummary(session,fieldAct,queryAct);
if (vectAct != null && vectAct.size() > 0) {
%>
|
<%
for (int k = 0; k < vectAct.size(); k++) {
Hashtable row = (Hashtable) vectAct.elementAt(k);
String fstName = (String) row.get("ActFstName");
String name = (String) row.get("ActName");
String mobile = (String) row.get("ActMobile");
String phone = (String) row.get("ActPhone");
String mail = (String) row.get("ActMail");
%>
> <%= (fstName != null)? Utils.formatToWeb(fstName,false) +" " : "" %><%= Utils.formatToWeb(name,false) +" " %>
()
<%= (phone == null) ? "" : " "+ Utils.getMessage(session, "L70BD", "T.") + " " + Utils.formatPhoneToMobile(phone,session)%>
<%= (mobile == null) ? "" : " "+ Utils.getMessage(session, "L70BE", "M.") + " " + Utils.formatPhoneToMobile(mobile,session)%>
<%= (mail == null) ? "" : " "+ " " + Utils.formatToWeb(mail,false) + ""%>
|
<% }
%>
<%
}
%>
<% Vector vectCorre = new Vector();
try {
vectCorre = Interaction.getIntCorID();
}catch (FieldNotInitializedException e){}
String[] fieldCor = {"CorPerID","CorPerID:PerName","CorPerID:PerFstName","CorPerID:PerMobile","CorPerID:PerMail","CorEntID:EntCorpName","CorEntID"};
String[][] queryCor = {{"CorID in ("+Utils.implodeList(vectCorre,",","'")+")"}};
Vector vectCor = CorrespondentBean.listSummary(session,fieldCor,queryCor);
if (vectCor != null && vectCor.size() > 0) {
%>
|
<%
for (int k = 0; k < vectCor.size(); k++) {
Hashtable row = (Hashtable) vectCor.elementAt(k);
String perID = (String) row.get("CorPerID");
String fstName = (String) row.get("CorPerID:PerFstName");
String name = (String) row.get("CorPerID:PerName");
String phone = (String) row.get("CorPerID:PerPhone");
String mobile = (String) row.get("CorPerID:PerMobile");
String mail = (String) row.get("CorPerID:PerMail");
String raison = (String) row.get("CorEntID:EntCorpName");
String entID = (String) row.get("CorEntID");
if (perID != null || entID != null) {
%>
>
<% if (perID != null) { %>
<%= (fstName != null)? Utils.formatToWeb(fstName,false) +" " : "" %><%= Utils.formatToWeb(name,false)%>
<% } %>
<% if (entID != null) { %>
(<%= Utils.formatToWeb(raison,false)%>)
<% } %>
<% if (phone != null) {%>
<%= Utils.formatPhoneToMobile(phone,session)%>
<% } %>
<% if (mobile != null) {%>
<%= Utils.formatPhoneToMobile(mobile,session)%>
<% } %>
<% if (mail != null) {%>
<%= Utils.formatToWeb(mail,false)%>
<% } %>
|
<% }//if perid
}//for
%>
<%
} //if vectCor
%>