<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<synchronization>
	<external_system_type>GoogleApps</external_system_type>
	
	<external_system_version>1.34</external_system_version>

	<!-- Comment a résoudre une conflit
	   E-DEAL - L'objet e-DEAL gagne.
	   EXTERNAL - l'objet External gagne.
	   LAST - l'objet plus récente gagne. -->
	<conflict_resolution>LAST</conflict_resolution>

	<!-- 'true' pour s'afficher les message debug pendant une synchronization -->
	<verbose_debug>false</verbose_debug>

	<!--
		'true' si les rendez-vous privés sont synchronisés
	-->
	<synchronize_private_appointments>false</synchronize_private_appointments>

	<!--
		Code de l'activité d'interaction utilisée pour les rendez-vous privés
	-->
	<private_appointment_activity>PERRDV</private_appointment_activity>

	<!--
		Sujet d'interaction utilisé pour les rendez-vous privés
	-->
	<private_appointment_subject>RDV personnel</private_appointment_subject>

	<!--
		'true' si les tâches privées sont synchronisées
	-->

	<synchronize_private_tasks>false</synchronize_private_tasks>
	<!--
		Code de l'activité d'interaction utilisée pour les tâches privées
	-->

	<private_task_activity>PERTASK</private_task_activity>
	<!--
		Sujet d'interaction utilisé pour les tâches privées
	-->
	<private_task_subject>Tâche personnelle</private_task_subject>

	<!-- 
		Whether or not we want to synchronize the correspondants of RDVs. This variable
		is only used for Webdav configurations. Possible values are:
		INCOMING - Correspondants will only be copied from Exchange to EDEAL
		OUTGOING - Correspondants will only be copied from EDEAL to Exchange
		BOTH - All correspondants are copied
		NONE - No correspondants are copied (default value if nothing is specified)
	-->   
   <correspondant_handling>NONE</correspondant_handling>
   
   <connection>
		<!-- If you want to use SSL when connecting to Google -->
		<connection_param name="useSSL" value="true"/>
		
		<!-- The timezone of your clients (ex. Europe/Paris). Leave
		 blank to use the system default (acceptable in most circumstances) -->
      <connection_param name="timezone" value="Europe/Paris"/>
      
		<!-- The master user/password used to synchronize each user. If you use
		 this method, contacts cannot be synchronized. If you want to synchronize
		 contacts, you MUST set each user's login/pwd in the actor screen
		<connection_param name="username" value="user"/>
		<connection_param name="password" value="password"/>
		-->
	</connection>

	<sync_objects>
		<object name="ContactDefault" synctype="out" type="Contact">
			<edeal_class>Person</edeal_class>
			<edeal_select>
			   <!-- La requête suivante est un exemple. Il faut la modifier pour correspondre à votre base des données -->
				<select_param name="query"><![CDATA[
					SELECT PerID FROM Person
					join Enterprise on PerEntID = PerID
					join Actor on EntActID = ActID
					where ActLogin = $$login$$
				]]></select_param>
			</edeal_select>
		</object>
		<object name="ContactDirecteur" synctype="out" type="Contact">
			<edeal_class>Person</edeal_class>
			<edeal_select>
				<select_param name="query"><![CDATA[
					SELECT PerID from Person
				]]></select_param>
			</edeal_select>
		</object>
		<object name="AppointmentDefault" synctype="bi" type="Appointment">
			<edeal_class>Interaction</edeal_class>
			<edeal_select>
			   <!-- La requête suivante est un exemple. Il faut la modifier pour correspondre à votre base des données -->
				<select_param name="query"><![CDATA[
					SELECT DISTINCT IntID
					FROM Interaction, Actor, RefValues
					WHERE IntEmetteur = ActID
					AND ActLogin = $$login$$
					AND IntDate IS NOT NULL
					AND IntTimeBeg IS NOT NULL
					AND IntTimeEnd IS NOT NULL
					AND IntDate > DATEADD(day, -5, GETDATE()) 
					AND IntDate < DATEADD(day, 10, GETDATE())
					AND IntAtvID = RefID
					AND RefVal <> 'NOTE'
				]]></select_param>
			   <!-- La requête suivante est un exemple. Il faut la modifier pour correspondre à votre base des données -->
				<select_param name="cor_query"><![CDATA[
					select EntID, PerID from Person
					left outer join Enterprise on PerEntID = EntID
					where PerMail = ? 
					union
					SELECT EntID, PerID FROM Person
					left outer join Enterprise on PerEntID = EntID
					left outer join RefValues on RefID = PerCivID
					WHERE
					(
						('"' + ISNULL(RefTe1 + ' ', '') + ISNULL(PerFstName + ' ', '') +
						ISNULL(PerName, '') + '" ' + ISNULL('<' +  PerMail + '>', '') =  ?)
						or
						('"' + ISNULL(PerFstName +  ' ', '') +
						ISNULL(PerName, '') + '" ' + ISNULL('<'  + PerMail + '>', '') = ?)
					)
				]]></select_param>
				<select_param name="cor_query_nb_params">3</select_param>
				<select_param name="cor_query_columns">CorEntID,CorPerID</select_param>
			</edeal_select>
			<external_select>
				<select_param name="from">-5</select_param>
				<select_param name="to">10</select_param>
			</external_select>
		</object>
		<object name="TaskDefault" synctype="bi" type="Task">
			<edeal_class>Interaction</edeal_class>
			<edeal_select>
			   <!-- La requête suivante est un exemple. Il faut la modifier pour correspondre à votre base des données -->
				<select_param name="query"><![CDATA[
					SELECT DISTINCT IntID, IntDate, IntSubject, ActLogin
					FROM Interaction, Multival, Actor, RefValues
					WHERE IntEmetteur = MvaColID AND MvaText = ActID
					AND ActLogin = $$login$$
					AND IntDate IS NOT NULL
					AND IntDate > DATEADD(day, -15, GETDATE()) 
					AND IntDate < DATEADD(day, 30, GETDATE())
					AND IntAtvID = RefID
					AND RefVal = 'NOTE'
				]]></select_param>
			   <!-- La requête suivante est un exemple. Il faut la modifier pour correspondre à votre base des données -->
				<select_param name="cor_query"><![CDATA[
					select EntID, PerID from Person
					left outer join Enterprise on PerEntID = EntID
					where PerMail = ? 
					union
					SELECT EntID, PerID FROM Person
					left outer join Enterprise on PerEntID = EntID
					left outer join RefValues on RefID = PerCivID
					WHERE
					(
						('"' + ISNULL(RefTe1 + ' ', '') + ISNULL(PerFstName + ' ', '') +
						ISNULL(PerName, '') + '" ' + ISNULL('<' +  PerMail + '>', '') =  ?)
						or
						('"' + ISNULL(PerFstName +  ' ', '') +
						ISNULL(PerName, '') + '" ' + ISNULL('<'  + PerMail + '>', '') = ?)
					)
				]]></select_param>
				<select_param name="cor_query_nb_params">1</select_param>
				<select_param name="cor_query_columns">CorEntID,CorPerID</select_param>
			</edeal_select>
			<external_select>
				<select_param name="from">-15</select_param>
				<select_param name="to">30</select_param>
			</external_select>
		</object>
	</sync_objects>
</synchronization>