<%
/******************************************************************************
 * Copyright (c) 2000-2005 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"%>
<%@ page import="com.edeal.frontline.navigation.FlRequest" %>
<%@ page import="com.edeal.frontline.FlContext" %>
<%@ page import="com.edeal.frontline.Utils" %>
<%@ page import="com.edeal.frontline.FieldNotInitializedException" %>
<%@ page import="com.edeal.frontline.DataDictionary" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="com.edeal.frontline.FrontlineException" %>
<%@ page import="java.util.Vector" %>
<%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %>
<jsp:useBean class="com.edeal.frontline.SilhouetteBean" id="Silhouette" scope="request"/>
<html>
<head>

<%
	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 id = null;
	try {
		id = Silhouette.getID();
	} catch (FieldNotInitializedException e) {
	}
		
	
	StringBuffer fullName = new StringBuffer();
	if (id != null) {
		String val;
		try {
			val = Silhouette.getSilCivID();
			fullName.append(dico.getRefDisp(session, "SilCivID", val) + " ");
		} catch (FieldNotInitializedException e) {
		}
		
		try {
			val = Silhouette.getSilFstName();
			fullName.append(val + " ");
		} catch (FieldNotInitializedException e) {
		}
		
		try {
			val = Silhouette.getSilName();
			fullName.append(val + " ");
		} catch (FieldNotInitializedException e) {
		}
	}
String silZip = null;
	try {
		silZip = Silhouette.getSilZip();
	} catch (FieldNotInitializedException e) {
	}
	String silCity = null;
	try {
		silCity = Silhouette.getSilCity();
	} catch (FieldNotInitializedException e) {
	}
%>
<!-- Javascript include -->
<script type="text/javascript" language="javascript">
	function doMail() {
		window.open('<fl:webapp/>/netbusiness/messages/popup.jsp?ObjSql=Silhouette&destID=<fl:getProperty name="Silhouette" property="SilID" alt=""/>&email=' + encodeURIComponent('<fl:getProperty name="Silhouette" property="SilMail" alt=""/>'), 'EMAIL', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=700,height=350');
	}
	function refreshSols() {
		_grid__SOLSIL_EMB_js_.render()
	}
	function refreshQuals() {
		_grid__APPETENCES_js_.render()
	}
	function refreshLogs() {
		_grid__ILV2_js_.render();
	}
</script>
<title>E-DEAL CRM  - Silhouette</title>
<link rel="stylesheet" href="<fl:webapp/>/css/common_css.jsp" type="text/css">
<link rel="stylesheet" href="<fl:webapp/>/css/tooltip.css" type="text/css">
<link rel="stylesheet" href="<fl:webapp/>/css/master_css.jsp" type="text/css">
<script type="text/javascript" language="javascript" src="<fl:webapp/>/js/master_js.jsp"></script>
<script type="text/javascript" language="javascript" src="<fl:webapp/>/js/utils.js"></script>
<script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ac/fobAC_js.jsp"></script>
<script type="text/javascript" language="javascript" src="<fl:webapp/>/js/checkFields.jsp"></script>
<script type="text/javascript" language="javascript" src="<fl:webapp/>/js/calendar.jsp"></script>

</head>
<body class="main_body" style="border:none; height: 100%;">
<fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L643C\", false, true, \"Silhouette\") %>" ou="<%= \"/read_silhouette.fl?id=\" + id %>">
	<table class="container" cellpadding="0" cellspacing="0">
		<tr>
			<td colspan="5" class="titreFiche">
				<%= (id == null) ? Utils.getMessage(session, "L2094", "Identité") : fullName.toString() %>
			</td>
		</tr>
		<tr class="ligne_separation"><td></td></tr>
	</table>
	<table class="container" cellpadding="0">	
		<tr>
			<td class="column2">
				<table class="data_column" cellpadding="0">
					<fl:fieldRead property="SilEnterprise" />
					<fl:fieldRead property="SilFonction" />
					<fl:fieldRead property="SilService" />
					<fl:fieldRead property="SilPhone" format="phone"/>
					<fl:fieldRead property="SilFax"/>
					<tr class="fieldline">
						<td id="PerMail_label" class="dataLabel"><fl:label field="PerMail"/></td>
						<td id="PerMail_value" class="dataValue"><div title="<fl:getProperty name="Person" property="perMail" alt=""/>"><a href="javascript:doMail();"><fl:getProperty name="Person" property="perMail" alt="&nbsp;"/></a></div></td>
					</tr>
				</table>
			</td>
			<td class="separation"><div class="separation"></div></td>
			<td class="column2">
				<table class="container" cellpadding="0">
					<tr class="fieldline">
						<td class="dataLabel"><fl:label code="F2012" label="Adresse"/></td>
						<td class="dataValue">
							<div title="">
								<fl:getProperty name="Silhouette" property="SilAd1" alt="" postText="<br>"/>
								<fl:getProperty name="Silhouette" property="SilAd2" alt="" postText="<br>"/>
								<fl:getProperty name="Silhouette" property="SilAd3" alt="" postText="<br>"/>
								<fl:getProperty name="Silhouette" property="SilZip" alt="" postText="&nbsp;"/><fl:getProperty name="Silhouette" property="SilCity" alt="" postText=""/><% try { Silhouette.getSilZip(); Silhouette.getSilCity(); %><br><% } catch(FieldNotInitializedException e) { try { Silhouette.getSilCity(); %><br><% } catch (FieldNotInitializedException ex) {}} %>
								<fl:getProperty name="Silhouette" property="SilCtrID" alt="&nbsp;" preText="<%= (silCity == null && silZip != null) ? \"<br>\" : \"\"%>"/>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr class="ligne_separation"><td></td></tr>		
	</table>
	<link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css">

	<fl:smallTabs name="SilhouetteTabs">
		<fl:sTab id="WEBACCESS" title="<%= Utils.getMessage(session, \"L0055\", false, true, \"Accès web\") %>">
			<table class="container" cellpadding="0">
				<tr>
					<td class="column2">
						<table class="data_column" cellpadding="0">
							<fl:fieldRead property="SilCookie"/>
							<fl:fieldRead property="SilToken"/>
						</table>
					</td>
					<td class="separation"><div class="separation"></div></td>
					<td class="column2">
						<table class="data_column" cellpadding="0">
							<fl:fieldRead property="SilCtyID" />
							<fl:fieldRead property="SilNltID"/>
						</table>
					</td>
				</tr>
			</table>
		</fl:sTab>
		<fl:sTab id="SOLS" title="<%= Utils.getMessage(session, \"L60E8\", false, true, \"Sollicitations\") %>" onselect="refreshSols();">
			<fl:grid height="150px" name="SOLSIL_EMB" ajaxUrl="<%= \"/embedded_list_ajax.fl?SolSilID=\" + id %>"/>
		</fl:sTab>
		<fl:sTab id="QUALS" title="<%= Utils.getMessage(session, \"L65D5\", false, true, \"Appétence\") %>" onselect="refreshQuals();">
			<fl:grid height="150px" name="APPETENCES" ajaxUrl="<%= \"/embedded_list_ajax.fl?AptSilID=\" + id %>"/>
		</fl:sTab>
		<fl:sTab id="LOGS" title="<%= Utils.getMessage(session, \"L6082\", \"Log web\") %>" onselect="refreshLogs();">
			<fl:grid height="150px" name="ILV2" ajaxUrl="<%= \"/embedded_list_ajax.fl?IblVisitorID=\" + id %>"/>
		</fl:sTab>
	</fl:smallTabs>
</fl:bigTabs>
<br>
<table class="container" width="100%">
	<tr class="fieldline">
		<td style="text-align: center;">
			<a href="javascript:window.close()"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif"></a>
		</td>
	</tr>
</table>
</body>
</html>
