<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE 
	name="RH000076" 
	label="RH. Justificatif Visites Médicales" 
	title="= 'Justificatif des Visites Médicales par ' +  SELECT.GROUPBY_LABEL + ' de ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL " 
	database="iCTI" 
	swf="*CTI_view1" 
	globals="RH_globals.XML" 
	componentsFile="RH_components.XML" 
	softCode="iCTI_rh"
	dboptimizer="RH_dboptimizer.XML"
	helpDokuWIkiDir="rh:vues:visites_medicales" helpDokuWIkiFile="rh000076"  helpFile="">
	<VIEWPROPERTIES componentName="PROPERTIES_VISITE"/>
	<VIEWPROPERTIES componentName="PROPERTIES_GROUPBY"/>
	<SELECTIONS label="Paramètres de l'analyse" displayText="">
		<GROUP label="Période">
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
			<FIELD name="PERIODE" label="" UI="combo" tree="true" width="200" default="2010-01-01" globalListProvider="PERIODE_DEBUT">
			</FIELD>
			<FIELD name="TOPERIODE" label="au" UI="combo" tree="true" width="200" default="2010-01-31" globalListProvider="PERIODE_FIN">
			</FIELD>
		</GROUP>
		<GROUP label="Regroupement">
			<FIELD name="GROUPBY" label="" UI="combo" width="200" default="MVM" tree="true" >
				<OPTION label="Visite" data="MVM" treeLevel="1" globalListProvider="VISITE_GROUPBY"/>
				<OPTION label="[DICT.RH.SALARIE#1]" data="SAL" treeLevel="1" globalListProvider="SALARIE_GROUPBY"/>
				<OPTION label="[DICT.RH.CONTRAT#1]" data="CNT" treeLevel="1" globalListProvider="CONTRAT_GROUPBY"/>
				<OPTION label="Temporel" data="MOIACT" treeLevel="1" globalListProvider="TEMPOREL_GROUPBY"/>
				<OPTION label="Référentiel SAE" data="REFERENTIEL_SAE" treeLevel="1" globalListProvider="REFERENTIEL_SAE_GROUPBY"/>
			</FIELD>
			<FIELD name="GROUPBY_TAB" width="100" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.GROUPBY_2 != '-1' ">
				<OPTION label="Automatique" data="AUTO"/>
				<OPTION label="Arbre" data="TREE"/>
				<OPTION label="Onglet" data="TAB"/>
			</FIELD>
		</GROUP>
		<GROUP label="Niveau de détail">
			<FIELD name="GROUPBY_2" label="" width="200" UI="combo" default="VIS" tree="true">
				<OPTION label="Visite" data="VIS" />
				<OPTION label="[DICT.RH.SALARIE]" data="SAL" />
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_VISITES_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SALARIES_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_REFERENTIEL_SAE_SELECTIONS"/>
	<QUERIES>
		<QUERY label=""> 
			<SQL optimizer="V_VIS_X" optimizer2="V_ALL_X">
				<select><![CDATA[		

					CTISELECT_TREE
						GROUPBY1{[VIEW.GROUPBY_OID_FIELD],, [VIEW.GROUPBY_COD_FIELD],, [VIEW.GROUPBY_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_OID_FIELD],, [VIEW.GROUPBY_2_COD_FIELD],, [VIEW.GROUPBY_2_TXT_FIELD]}
						INDICATORS{
							count(DISTINCT v_rh_view_1.visite_id),,
						}
						INDICATORS_2_TEXT{
							max(v_rh_view_1.salarie_id)::text,,
							(max(ARRAY[v_rh_view_1.date_visite::text, motif_visite_texte::text]))[2],,
							max(v_rh_view_1.date_visite)::text
						}						
					FROM #V_VIS_X##V_ALL_X#
					WHERE v_rh_view_1.date_visite BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.SALARIES_SELECT]
						[VIEW.CONTRATS_SELECT]
						[VIEW.REFERENTIEL_SAE_SELECT]
						[VIEW.VISITES_SELECT]

				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="NBV" />
					<FIELD name="ISAL" />
					<FIELD name="MTF" />
					<FIELD name="DATV" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK 
				label="Détail [DICT.RH.SALARIE#2]" 
				shortLabel="Détail [DICT.RH.SALARIE#2]" 
				view="RH000009.XML" 
				componentName=""
			>
				<ARGS name="ALL" >
					<value><![CDATA[
					
					{LINKVARIABLES['SALARIE_ID'] = ROW.ISAL}
					{LINKVARIABLES['MATRICULE'] = ''}
					
					return 'OK';
			
					]]></value>
				</ARGS>
			</VIEWLINK>
		</VIEWLINKS>		
		<ONGLET label="Onglet" multiTab="true">
			<DATAGRID 	
				title="" 
				total="true" 
				headerHeight="40" 
				selectRowInRows="= ROW.OID == '-9999997'" 
				otherRowInRows="= ROW.OID == '-9999998'" 
				totalRowInRows="= ROW.OID == '-9999999'"
				variableRowHeight="true" 
				sortable="= SELECT.GROUPBY == '-1' || SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'"
			>
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN 
					dataField="OID"
					type="Number"
					visible="false"
				/>
				<COLUMN 
					dataField="ISAL"
					type="Number"
					visible="false"
				/>
				<COLUMN
					dataField="COD" 
					type="Char" 
					width="80"
					outputFormat="#"
					headerText="Matricule" 
					textAlign="left" 
					totalComplement="*ROW"
				>
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN 
					dataField="TXT" 
					type="Char" 
					minWidth="110"
					headerText="Nom" 
					textAlign="left" 
					totalComplement="*ROW"
				/>
				<COLUMN 
					dataField="DATV" 
					type="Date" 
					width="80"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					headerText="Date Visite" 
					totalComplement="*ROW"
				/>
				<COLUMN 
					dataField="MTF" 
					type="Char" 
					minWidth="100"
					headerText="Motif" 
					totalComplement=""
				/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>

			
