<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE 
	name="RH000078"
	label="RH. Formations"
	title="= 'Formations par ' + SELECT.GROUPBY_LABEL + ' de ' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL  +  ' ' + VIEW.TITLE" 
	database="iCTI"
	swf="*CTI_view1"
	globals="RH_globals.XML"
	componentsFile="RH_components.XML"
	softCode="iCTI_rh"
	dboptimizer="RH_dboptimizer.XML"
	helpDokuWIkiDir="rh:vues:formations" helpDokuWIkiFile="rh000078"  helpFile="">
	<VIEWPROPERTIES componentName="PROPERTIES_GROUPBY" />
	<VIEWPROPERTIES>
		<PROPERTY name="TITLE">
			<value><![CDATA[[EVAL 
			
			// <?php
			$r = "";
			
			if('[UNDONE_FORMATIONS]' == 'Y'){
				$r = " + Formations pas encore effectuées";
			}
			
			return $r;
			
			// ?>
					
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY name="FORMATION_DATE">
			<value><![CDATA[[EVAL 
			
			// <?php
			$r = "";
			
			if('[UNDONE_FORMATIONS]' == 'Y'){
				$r = "AND ((v_rh_view_1.formation_date BETWEEN '[PERIODE]' AND '[TOPERIODE]') OR v_rh_view_1.formation_date > '2099-01-01')";
			}else{
				$r = "AND v_rh_view_1.formation_date BETWEEN '[PERIODE]' AND '[TOPERIODE]'";
			}
			
			return $r;
			
			// ?>
					
			EVAL]]]></value>
		</PROPERTY>
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	
	<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="FOR" tree="true" >
				<OPTION label="Formation" data="FOR" treeLevel="1" globalListProvider="FORMATION_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="Formation" data="FOR" treeLevel="1" globalListProvider="FORMATION_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="Formation" data="FOR" treeLevel="1" globalListProvider="FORMATION_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_FORMATIONS_SELECTIONS" />
	<SELECTIONS componentName="FILTRES_SALARIES_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_REFERENTIEL_SAE_SELECTIONS"/>
	<QUERIES>
		<QUERY label=""> 
			<SQL optimizer="V_FOR_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.formation_id),
							sum(v_rh_view_1.nb_heures)
						}
					FROM #V_FOR_X##V_ALL_X#
					WHERE 1=1
						[VIEW.FORMATION_DATE]
						[VIEW.FORMATIONS_SELECT]
						[VIEW.SALARIES_SELECT]
						[VIEW.CONTRATS_SELECT]
						[VIEW.REFERENTIEL_SAE_SELECT]
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS" />
					<FIELD name="NSAL" />
					<FIELD name="NFOR" />
					<FIELD name="NBHR" />
				</FIELDS>
			</SQL>
		</QUERY>
	</QUERIES>
	
	<PRESENTATION>
		
		<VIEWLINKS>
			<VIEWLINK 
				label="Justificatif des formations" 
				shortLabel="Justificatif des formations" 
				view="RH000079.XML" 
				componentName="RH_VIEWLINK">
				
				
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['GROUPBY_2'] = 'FORM'
						return 'OK';
			
					]]></value>
				</ARGS>
			</VIEWLINK>
		</VIEWLINKS>
		
		<ONGLET label="Onglet" multiTab="true">

			<CHART title="Formations"
				type="columnChart"
				subType="stacked"
				maxItems="20"
				maxItemsSortOn="NFOR"
				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="NFOR" displayName="Nombre de formations" />
			</CHART>
			
			<CHART title="Formations" 
				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="NFOR" displayName="Nombre de formations" />
			</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="90"
					outputFormat="#"
					headerText="Code"
					textAlign="left"
					totalComplement="*ROW">
					<INSERT name="COLUMN_COD_MULTITAB_STYLES" />
				</COLUMN>
				<COLUMN dataField="TXT"
					type="Char"
					width="400"
					headerText="Texte"
					textAlign="left"
					totalComplement="*ROW" />
				<COLUMN dataField="NFOR"
					type="Number"
					width="80"
					outputFormat="#"
					headerText="Nb Formations"
					textAlign="right"
					totalComplement="*ROW" />
				<COLUMN dataField="NSAL"
					type="Number"
					width="80"
					outputFormat="#"
					headerText="Nb [DICT.RH.SALARIE#3]"
					textAlign="right"
					totalComplement="*ROW" />
				<COLUMN dataField="NBHR"
					type="Number"
					width="100"
					outputFormat="#,0"
					headerText="Nb Heures"
					textAlign="right"
					totalComplement="*ROW" />
				<COLUMN 
					type="Number"
					minWidth="10"
					outputFormat="#,0"
					headerText=""
					textAlign="right"
					totalComplement="*ROW" />
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>