<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE 
	name="RH000081" 
	label="RH. Accidents du Travail" 
	title="= 'Accidents du Travail 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:accidents_de_travail" helpDokuWIkiFile="rh000081"  helpFile=""
>
	<VIEWPROPERTIES componentName="PROPERTIES_ACCIDENT"/>
	<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 name="TOPERIODE" label="au" UI="combo" tree="true" width="200" default="2010-01-31" globalListProvider="PERIODE_FIN" />
		</GROUP>
		<GROUP label="Regroupement">
			<FIELD name="GROUPBY" label="" UI="combo" width="200" default="ATC" tree="true" >
				<OPTION label="Accident" data="ATC" treeLevel="1" globalListProvider="ACCIDENT_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="">
			<FIELD name="GROUPBY_2" label="" width="200" UI="combo" default="-1" tree="true" >
				<OPTION label="Pas de second niveau" data="-1"/>
				<OPTION label="Accident" data="ATC" treeLevel="1" globalListProvider="ACCIDENT_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>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_3" label="" width="200" UI="combo" default="-1" tree="true" >
				<OPTION label="Pas de troisième niveau" data="-1"/>
				<OPTION label="Accident" data="ATC" treeLevel="1" globalListProvider="ACCIDENT_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>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_ACCIDENT_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_SALARIES_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_REFERENTIEL_SAE_SELECTIONS"/>
	<QUERIES>
		<QUERY label=""> 
			<SQL optimizer="V_ACC_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]}
						GROUPBY3{[VIEW.GROUPBY_3_OID_FIELD],, [VIEW.GROUPBY_3_COD_FIELD],, [VIEW.GROUPBY_3_TXT_FIELD]}
						OPTIONS{NOTZERO=1}
						INDICATORS{
							count(DISTINCT v_rh_view_1.salarie_id),
							count(DISTINCT v_rh_view_1.accident_travail_id)
						}
					FROM #V_ACC_X##V_ALL_X#
					WHERE v_rh_view_1.date_accident_travail BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.SALARIES_SELECT]
						[VIEW.CONTRATS_SELECT]
						[VIEW.REFERENTIEL_SAE_SELECT]
						[VIEW.ACCIDENT_SELECT]

				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS"/>
					<FIELD name="NSAL" />
					<FIELD name="NACC" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK
				label="Justificatif des Accidents" 
				shortLabel="Justificatif des Accidents" 
				view="RH000082.XML" 
				componentName="RH_VIEWLINK"
			>
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['GROUPBY_2'] = 'ACC'
						return 'OK';
					]]></value>
				</ARGS>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET label="Onglet" multiTab="true" >
			<CHART 
				title="Accidents du Travail" 
				type="columnChart" 
				subType="stacked" 
				maxItems="20" 
				maxItemsSortOn="NACC" 
				maxItemsSortSeq="D" 
				sortField="COD" 
				sortSeq="A" 
				condition="ROW.LVL == '1'"
				visibleCondition="SELECT.GROUPBY != 'MOIACT' &amp;&amp; SELECT.GROUPBY != 'ANNACT'"
			>
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="NACC" displayName="Nombre d'accidents"/>
			</CHART>
			<CHART 
				title="Accidents du Travail" 
				type="lineChart" 
				subType="" 
				maxItems="20" 
				maxItemsSortOn="COD" 
				maxItemsSortSeq="D" 
				sortField="COD" 
				sortSeq="A" 
				condition="ROW.LVL == '1'"
				visibleCondition="SELECT.GROUPBY == 'MOIACT' || SELECT.GROUPBY == 'ANNACT'"
			>
				<CATEGORY field="COD" type="Char"/>
				<SERIE field="NACC" displayName="Nombre d'aaccidents"/>
			</CHART>
			<DATAGRID 	
				title="" 
				total="true" 
				headerHeight="54" 
				selectRowInRows="= ROW.OID == '-9999997'" 
				otherRowInRows="= ROW.OID == '-9999998'" 
				totalRowInRows="= ROW.OID == '-9999999'"
				variableRowHeight="true" 
				sortable="= SELECT.GROUPBY_3 == '-1' &amp;&amp; (SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB')"
			>
				<INSERT name="DATAGRID_MULTITAB_STYLES"/>
				<COLUMN 
					dataField="OID"
					type="Number"
					visible="false" 
				/>
				<COLUMN 
					dataField="COD" 
					type="Char" 
					width="60"
					outputFormat="#"
					headerText="Code" 
					textAlign="left" 
					totalComplement="*ROW"
				>
					<INSERT name="COLUMN_COD_MULTITAB_STYLES"/>
				</COLUMN>
				<COLUMN 
					dataField="TXT" 
					type="Char" 
					minWidth="110"
					headerText="Texte" 
					textAlign="left" 
					totalComplement="*ROW"
				/>
				<COLUMN 
					dataField="NACC" 
					type="Number" 
					width="80"
					outputFormat="#"
					headerText="Nb Accidents" 
					textAlign="right"
					totalComplement="*ROW" 
				/>
				<COLUMN 
					dataField="NSAL" 
					type="Number" 
					width="80"
					outputFormat="#"
					headerText="Nb [DICT.RH.SALARIE#3]" 
					textAlign="right"
					totalComplement="*ROW" 
				/>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>

			
