<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="RH000110" 
	label="RH Expert. Justificatif" 
	title="= 'Justificatif Contrôles Expert (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')'" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_rh" 
	softOption="iCTI_expert"
	globals="RH_globals.XML"
	componentsFile="RH_components.XML"
	helpFile="iCTI_RH_RH000110.HTML"
    helpDokuWIkiDir="rh:qualite:expert" 
    helpDokuWIkiFile="rh000110" 
>
	<CACHE cachable="false" />
	<VIEWPROPERTIES componentName="PROPERTIES_GROUPBY" />
	<VIEWPROPERTIES>
		
		<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres">
		<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="2009-01-01" globalListProvider="PERIODE_DEBUT"  />
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="200" default="2009-12-31" globalListProvider="PERIODE_FIN"  />
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_EXPERT_SELECTIONS" />
	<SELECTIONS componentName="FILTRES_CONTRATS_SELECTIONS" />
	
	<QUERIES>
		<QUERY label=""> 
			<SQL>
				<select><![CDATA[
				
				
					SELECT 
						v_expert_controle_1.contrat_id,
						p_salaries.matricule,
						p_salaries.finess,
						p_salaries.nom || ' ' || prenom,
						v_expert_controle_1.date_debut_activite,
						v_expert_controle_1.date_fin_activite,
						v_expert_controle_1.date_signalement,
						v_expert_controle_1.etat,
						v_expert_controle_1.etat_texte,
						v_expert_controle_1.expert_controle_code,
						v_expert_controle_1.expert_controle_id,
						v_expert_controle_1.expert_controle_texte,
						v_expert_controle_1.expert_controle_gravite_texte,
						v_expert_controle_1.justificatif
					FROM rh.v_expert_controle_1
					JOIN rh.p_salaries ON p_salaries.oid = v_expert_controle_1.salarie_id
					WHERE 
						date_fin_activite >= '[PERIODE]' AND date_debut_activite <= '[TOPERIODE]'
						[VIEW.CONTRATS_SELECT]
						[VIEW.EXPERT_CONTROLE_SELECT]
					
					
						ORDER BY 2
					
		
				;
				
				]]></select>
				<FIELDS>
					<FIELD name="CID" />
					<FIELD name="SAL" />
					<FIELD name="FIN" />
					<FIELD name="NOM"  ifHideNames="Non autorisé"/>
					<FIELD name="DATE_DEB" />
					<FIELD name="DATE_FIN" />
					<FIELD name="CXDS"/>
					<FIELD name="CXEC"/>
					<FIELD name="CXE"/>
					<FIELD name="CXC"/>
					<FIELD name="CXI"/>
					<FIELD name="CXT"/>
					<FIELD name="CXG"/>
					<FIELD name="CXJ"/>
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
				
				
				
				SELECT 
						COUNT(DISTINCT salarie_id)::text || ' salaries'::text,
						COUNT(*)::text || ' Erreurs'						
					FROM rh.v_expert_controle_1 
					WHERE
						date_fin_activite >= '[PERIODE]' AND date_debut_activite <= '[TOPERIODE]'
						[VIEW.CONTRATS_SELECT]
						[VIEW.EXPERT_CONTROLE_SELECT]
				
				
				]]></select>
				<FIELDS>
					<FIELD name="NOM" />
					<FIELD name="CXT"/>
				</FIELDS>
			</SQL>
			
			
		</QUERY>
			
	</QUERIES>
	<PRESENTATION>
	
		<VIEWLINKS>
			<VIEWLINK label="Ignorer pour le mois" shortLabel="Ignorer/Mois" view="RH000122.XML" 
				enabled="= ROW.CXEC != 'I'" 
				visible="= ROW.CXEC != 'I'">
				<ARG name="CNTM_ID" value="ROW.OID" />
				<ARG name="NOM" value="ROW.NOM" />
				<ARG name="EXPERT_CONTROLE" value="'DT' + ROW.CXI" />
				<ARG name="VAL_ACTION" value="'I'" />
				<ARGS name="SPEC" >
					<value><![CDATA[
						LINKVARIABLES['CNT_ID'] = ''
						return 'OK';
			
					]]></value>
				</ARGS>
			</VIEWLINK>

			<VIEWLINK label="Pointer mois comme corrigé" shortLabel="Pointer comme corrigé" view="RH000122.XML" 
				enabled="= ROW.CXEC != 'T'" 
				visible="= ROW.CXEC != 'T'">
				<ARG name="CNTM_ID" value="ROW.OID" />
				<ARG name="NOM" value="ROW.NOM" />
				<ARG name="VAL_ACTION" value="'T'" />

			</VIEWLINK>
					
			<VIEWLINK label="Remettre en service" shortLabel="Remettre en service" view="RH000122.XML" 
				enabled="= ROW.CXEC == 'I' || ROW.CXEC == 'T'" 
				visible="= ROW.CXEC == 'I' || ROW.CXEC == 'T'">
				<ARG name="CNT_ID" value="ROW.CID" />
				<ARG name="CNTM_ID" value="ROW.OID" />
				<ARG name="EXPERT_CONTROLE" value="'DT' + ROW.CXI" />
				<ARG name="NOM" value="ROW.NOM" />
				<ARG name="VAL_ACTION" value="''" />
			</VIEWLINK>
			<VIEWLINK label="Détail [DICT.RH.SALARIE#2]" shortLabel="Détail [DICT.RH.SALARIE#2]" view="RH000009.XML" >
				<ARG name="SALARIE_ID" value="ROW.SAL"/>
					
			</VIEWLINK>
			
		</VIEWLINKS>
	
		<ONGLET excelLabel="Liste Salarié" >
				
			<DATAGRID title="" total="true" headerHeight="36"  rowHeight="24"
				totalRowInRows="= ROW.OID == '-9999999'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<COLUMN dataField="CXI"
					type="Char"
					visible="false">
				</COLUMN>
				<COLUMN dataField="CID"
					type="Char"
					visible="false">
				</COLUMN>
				<COLUMN dataField="FIN"
					width="60"
					type="Char"
					headerText="Finess" 
					textAlign="left" 
					visibleCondition="ENV.CONSOLIDATION == '1'"
					otherFunction="text"
					totalFunction="text" 
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="SAL"
					width="90"
					type="Char"
					headerText="Matricule" 
					textAlign="center" 
					otherFunction="text"
					totalFunction="text" 
					totalComplement="TOTAL">
				</COLUMN>
				<COLUMN dataField="NOM"
					minWidth="100"
					maxWidth="200"
					type="Char"
					headerText="Nom" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="*ROW">
				</COLUMN>
				<COLUMN dataField="DATE_DEB"
					width="90"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					fixed="false"
					headerText="Date&#xD;début activité" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				<COLUMN dataField="DATE_FIN"
					width="90"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					fixed="false"
					headerText="Date&#xD;fin activité" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				<COLUMN dataField="CXDS"
					width="90"
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="DD/MM/YY"
					fixed="false"
					headerText="Date&#xD;signalement" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text">
				</COLUMN>
				<COLUMN dataField="CXEC"
					width="60"
					type="Char"
					headerText="Etat" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement=""
					visible="false">
				</COLUMN>
				<COLUMN dataField="CXE"
					width="60"
					type="Char"
					headerText="Etat" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXG"
					width="60"
					type="Char"
					headerText="Gravité" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXC"
					width="120"
					type="Char"
					outputFormat="#"
					headerText="Code contrôle" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text" 
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXT"
					minWidth="200"
					type="Char"
					headerText="Texte contrôle" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="">
				</COLUMN>
				<COLUMN dataField="CXJ"
					minWidth="200"
					type="Char"
					headerText="Justificatif contrôle" 
					textAlign="left" 
					otherFunction="text"
					totalFunction="text"
					totalComplement="">
				</COLUMN>
			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>