<?xml version="1.0" encoding="ISO-8859-1"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:cti_control="CTI.technique.controls.*" xmlns="*"
	creationComplete="creationComplete()" resize="resize()"
	styleName="CTIView"
	paddingTop="0" paddingBottom="0" paddingRight="0" paddingLeft="0"
	creationPolicy="all">
   <mx:Script>
        <![CDATA[
		
			import mx.controls.Alert;
			import mx.collections.XMLListCollection;
			import mx.events.CloseEvent
			import mx.collections.ArrayCollection;
			
			import CTI.technique.CTI_Utilitaires;
			import CTI.technique.CTI_Dictionary;
			import CTI.technique.CTI_ExcelUtilitaires;
			import CTI.print.CTI_Print;
			import CTI.technique.CTI_ExcelUtilitaires;
			import CTI.technique.CTI_PDFUtilitaires;
			import CTI.technique.CTI_ArrayCollection;

			import mx.events.ListEvent;
			
			public var buildComplete:Boolean = false;
			
			[Embed(source="../../base/swf/CTI/images/24/print.png")]
			public var button_print24:Class;
			
			[Embed(source="../../base/swf/CTI/images/24/dialog-question.png")]
            public static var question_class:Class;
			
			// Variables CTI
			public static var softCode:String = "iCTI_rh";
			
			[Bindable]
			public var title:String = "Gestion ...";
			public var titlePrint:String = "Tables Ressources Humaines";
			
			[Bindable]
			public var hasHelp:Boolean = false;
			
			[Bindable]
			public var optStdHp:Boolean = false; // Paramétrage de rh.t_divers OPT_STD_HP.
			
			private var viewName:String;
			private var tableName:String;
			
			[Bindable]
			private var tableCode:String;
			
			[Bindable]
			private var list_collection:CTI_ArrayCollection = new CTI_ArrayCollection();
			
			
			[Bindable]
			private var ref_list_collection:CTI_ArrayCollection = new CTI_ArrayCollection();
						
			[Bindable]
            public var EXC_gravite_provider: Array = [
                {label:"Information", data:"0"},
				{label:"Avertissement", data:"5"},
				{label:"Erreur", data:"9"}];
			
			[Bindable]
            public var EXC_table_provider: Array = [
                {label:"Contrats", data:"1"},
				{label:"Historique de paie", data:"2"},
                {label:"Arrêts de travail", data:"3"},
				{label:"Mouvement planning", data:"4"},
				{label:"SQL brut", data:"99"}];
				
			[Bindable]
            public var EXC_mode:int = 0;
			
			[Bindable]
			private var recordUpdated:Boolean = false;
			
			[Bindable]
			private var currendRecordItem:Object = null;
			
			private var tableList:Object = new Object();
			
			[Bindable]
			private var texte_court_is_visible:Boolean = true;
			
			[Bindable]
			private var calculCodeList:ArrayCollection = new ArrayCollection([
				{label:"Aucun", data:"0"},
				{label:"(1) Heures payées", data:"1"},
				{label:"(2) Heures (non) travaillées", data:"2"},
				{label:"(3) Frais imposables", data:"3"},
				{label:"(4) Avantages en nature", data:"4"},
				{label:"(5) OD/net salariées", data:"5"},
				{label:"(6) OD/net patronales", data:"6"},
				{label:"(7)", data:"7"},
				{label:"(8)", data:"8"},
				{label:"(9) Ignorer", data:"9"},
                {label:"(10) Heures contrat", data:"10"},
                {label:"(11) Heures c/p/t", data:"11"}
			]);

            [Bindable]
            private var rubSource:ArrayCollection = new ArrayCollection([
                {label:"Nombre", data:"0"},
                {label:"Base", data:"1"},
                {label:"Tx. salarial", data:"2"},
                {label:"Mt. salarial", data:"3"},
                {label:"Tx. patronal", data:"4"},
                {label:"Mt. patronal", data:"5"},
                {label:"Mt. +sal. +pat.", data:"6"},
                {label:"Mt. +sal. -pat.", data:"7"},
                {label:"Mt. -sal. +pat.", data:"8"}
            ]);

			[Bindable]
			private var uniteList:ArrayCollection = new ArrayCollection([
				{label:"Originale", data:"0"},
				{label:"Autre", data:"1"}
			]);
			
			[Bindable]
			private var has_refsettings:Boolean = false;
			
			[Bindable]
            public var qimport:Boolean = false;
			
			[Bindable]
			private var _prestataire_collection:CTI_ArrayCollection;
			
			// FONCTIONS
			public function creationComplete():void {
				if (application.currentHelpFile != "") {
					hasHelp = true;
				}
				if (application.name == "CTI") {
				}
				if (application.name == "CTI_1") {
					GUI_titleBar.height = 0
				}
				
				viewName = application.currentViewName;
				tableCode = application.currentSwfData;
				
				tableList["DIV"] = ["t_divers","Eléments divers","Divers"];
				tableList["CSP"] = ["t_categories_socio_professionnelle","Gestion [DICT.RH.CATEGORIE_SOC_PRO#3]","[DICT.RH.CATEGORIE_SOC_PRO#3]"];
				tableList["CEM"] = ["t_codes_emploi","Gestion [DICT.RH.CODE_EMPLOI#3]","[DICT.RH.CODE_EMPLOI#3]"];
				tableList["ENT"] = ["t_entreprises","Gestion Entreprises","Entreprises"];
				tableList["ETA"] = ["t_etablissements","Gestion Etablissements","Etablissements"];
				tableList["GRI"] = ["t_grilles","Gestion [DICT.RH.GRILLE#3]","[DICT.RH.GRILLE#3]"];
				tableList["GGR"] = ["t_grilles_groupes","Gestion [DICT.RH.GROUPE_GRILLE#3]","[DICT.RH.GROUPE_GRILLE#3]"];
				tableList["GCO"] = ["t_groupes_cotisant","Gestion [DICT.RH.GROUPE_COTISANT#3]","[DICT.RH.GROUPE_COTISANT#3]"];
				tableList["MAR"] = ["t_motifs_arret","Gestion Motifs d'[DICT.RH.ARRET_TRAVAIL#2]","Motifs d'[DICT.RH.ARRET_TRAVAIL#2]"];
				tableList["MDC"] = ["t_motifs_debut_contrat","Gestion [DICT.RH.MOTIF_DEBUT#3] de [DICT.RH.CONTRAT]","[DICT.RH.MOTIF_DEBUT#3] de [DICT.RH.CONTRAT]"];
				tableList["MFC"] = ["t_motifs_fin_contrat","Gestion [DICT.RH.MOTIF_FIN#3] de [DICT.RH.CONTRAT]","[DICT.RH.MOTIF_FIN#3] de [DICT.RH.CONTRAT]"];
				tableList["NAT"] = ["t_nationalites","Gestion Nationalités","Nationalités"];
				tableList["ORG"] = ["t_organismes_cotisation","Gestion [DICT.RH.ORGANISME_COTISATION#3]","[DICT.RH.ORGANISME_COTISATION#3]"];
				tableList["PMA"] = ["t_precisions_motif_arret","Gestion Précisions motif d'[DICT.RH.ARRET_TRAVAIL#2]","Précisions motif d'[DICT.RH.ARRET_TRAVAIL#2]"];
				tableList["QUA"] = ["t_qualifications","Gestion Qualifications","Qualifications"];
				tableList["RUB"] = ["t_rubriques","Gestion Rubriques","Rubriques"];
				tableList["SAN"] = ["t_sections_analytiques","Gestion Sections analytiques","Sections analytiques"];
				tableList["SAP"] = ["t_sections_analytiques_paie","Gestion Sections analytiques paie","Sections analytiques paie"];
				tableList["SER"] = ["t_services","Gestion [DICT.RH.SERVICE#3]","[DICT.RH.SERVICE#3]"];
				tableList["SIT"] = ["t_situations_famille","Gestion Situations de famille","Situations de famille"];
				tableList["SOC"] = ["t_societes_interim","Gestion Sociétés intérimaires","Sociétés intérimaires"];
				tableList["SPE"] = ["t_specialites","Gestion Spécialités","Spécialités"];
				tableList["STA"] = ["t_statuts","Gestion [DICT.RH.STATUT#3]","[DICT.RH.STATUT#3]"];
				tableList["TCO"] = ["t_types_contrat","Gestion [DICT.RH.TYPE_CONTRAT#3]","[DICT.RH.TYPE_CONTRAT#3]"];
				tableList["THO"] = ["t_types_horaire","Gestion Types d'horaire","Types d'horaire"];
				tableList["TTT"] = ["t_types_temps_travail", "Gestion [DICT.RH.TYPE_TEMPS_TRAVAIL#3]", "[DICT.RH.TYPE_TEMPS_TRAVAIL#3]"];
				tableList["MVM"] = ["t_motifs_visite","Gestion Motifs de visite médicale","Motifs de visite médicale"];
				tableList["ATC"] = ["t_accident_circonstance","Gestion [DICT.RH.CIRCONSTANCE#3] Accident du Travail","[DICT.RH.CIRCONSTANCE#3] Accident du Travail"];
				tableList["ATL"] = ["t_accident_lieu","Gestion [DICT.RH.LIEU#3] Accident du Travail","[DICT.RH.LIEU#3] Accident du Travail"];
				tableList["ATN"] = ["t_accident_nature","Gestion Natures Accident du Travail","Natures Accident du Travail"];
				tableList["ATS"] = ["t_accident_siege","Gestion Sièges Accident du Travail","Sièges Accident du Travail"];
				tableList["UNF"] = ["t_unite_fonctionnelle","Gestion Unités fonctionnelles","Unités fonctionnelles"];
				tableList["LEB"] = ["t_lettre_budgetaire","Gestion Lettres Budgétaires","Lettres Budgétaires"];
				tableList["GCP"] = ["t_commission_paritaire","Gestion Groupes de commission paritaire","Groupes de commission paritaire"];
				tableList["COI"] = ["t_compte_imputation","Gestion Comptes d'imputation","Comptes d'imputation"];
				tableList["CAC"] = ["t_categorie_conge","Gestion Catégories de congé","Catégories de congé"];
				tableList["CAE"] = ["t_cadre_emploi","Gestion Cadres d'emploi","Cadres d'emploi"];
				tableList["FIL"] = ["t_filiere","Gestion Filières","Filières"];
				tableList["CAS"] = ["t_categorie_statutaire", "Gestion Catégories statutaires", "Catégories statutaires"];
				tableList["CPT"] = ["t_compte","Gestion Comptes","Comptes"];
				tableList["TRF"] = ["t_transformation","Gestion Transformations","Transformations"];
				tableList["EXC"] = ["t_expert_controle","Gestion Controles Expert","Controles Expert"];
				tableList["PSE"] = ["t_planning_service","Gestion services planning","Services planning"];
				tableList["PQU"] = ["t_planning_qualification","Gestion qualifications planning","Qualification planning"];
				tableList["PAB"] = ["t_planning_type_absence","Gestion types d'absence planning","Types d'absence planning"];
				tableList["DPR"] = ["t_data_profile","Gestion Profils de données","Profils de données"];
                tableList["POP"] = ["t_population","Gestion Populations","Populations"];
                tableList["PER"] = ["t_population_regle","Gestion Règles Population","Règles Population"];

				tableName = tableList[tableCode][0];
				
                // Visibilité des panneaux principaux.			
                if (tableCode == "POP") {
                    POP_mainBox.visible = true;
                } else if (tableCode == "PER") {
                    PER_mainBox.visible = true;
                } else if (tableCode == "EXC") {
                    EXC_mainBox.visible = true;
                }  else {
                    mainBox.visible = true;
                }
				
				// Visibilité des colonnes
				texte_court_is_visible = true
				if (tableCode == "DIV" ||
					tableCode == "TRF" ||
					tableCode == "PSE" ||
					tableCode == "PQU" ||
					tableCode == "PAB" ||
					tableCode == "DPR" ) {
					texte_court_is_visible = false
				}
	
				CTI_Dictionary.load_dictionary(renameView);
				
				getData();
			}
			
			public function renameView():void {
				title = CTI_Dictionary.dictionary_translate(tableList[tableCode][1]);
				titlePrint = CTI_Dictionary.dictionary_translate(tableList[tableCode][2]);
			}
			
			public function eventDispatcher(eventCode:String):Boolean {
				return true;
			}
			
			public function getData():void {
				var urlVariables:URLVariables = new URLVariables();
				urlVariables.tableName = tableName;
				urlVariables.softCode = softCode;
				CTI_Utilitaires.startRequestHTTP("modules/rh/php/httpService_tablesManager_getData.php",urlVariables,exec,true,this.parentApplication);
				
				function exec(resultatService:XML):void {
					if (list_collection != null) {
						list_collection.filterFunction = null;
						list_collection.refresh();
					}
					list_collection.loadXMLList(resultatService.RECORD);
					
                    if (tableCode == "ETA") {
                        ETA_finess_id_GUI.dataProvider = resultatService.COMBO_FINESS.RECORD;
                    }
					if (tableCode == "TRF") {
						TRF_date_debut_GUI.dataProvider = resultatService.COMBO_FROMDAT.RECORD
						TRF_date_fin_GUI.dataProvider = resultatService.COMBO_TODAT.RECORD
						TRF_salarie_id_GUI.dataProvider = resultatService.COMBO_SAL.RECORD
						TRF_from_service_id_GUI.dataProvider = resultatService.COMBO_FROMSER.RECORD
						TRF_to_service_id_GUI.dataProvider = resultatService.COMBO_TOSER.RECORD
						TRF_from_qualification_id_GUI.dataProvider = resultatService.COMBO_FROMQUA.RECORD
						TRF_to_qualification_id_GUI.dataProvider = resultatService.COMBO_TOQUA.RECORD
					}
					if (tableCode == "PSE") {
						PSE_service_id_GUI.dataProvider = resultatService.COMBO_SER.RECORD
					}
					if (tableCode == "PQU") {
						PQU_qualification_id_GUI.dataProvider = resultatService.COMBO_QUA.RECORD
					}
                    if (tableCode == "PER") {
						PER_population_id_GUI.dataProvider = resultatService.COMBO_POP.RECORD;
					}

					if (tableCode == "RUB") {
						if (resultatService.DIVERS.RECORD.@valeur == '1') {
							optStdHp = true;
						} else {
                            optStdHp = false;
						}
					}
					if (tableCode == "EXC"){
						if (resultatService.GENERAL_SETTINGS[0].@EXPERT_ACTIVE == "1") {
							EXC_EXPERT_ACTIVE_GUI.selected = true;
						}
						else {
							EXC_EXPERT_ACTIVE_GUI.selected = false;
						}
						EXC_EXPERT_DATE_DEBUT_GUI.text = resultatService.GENERAL_SETTINGS[0].@EXPERT_DATE_DEBUT.toString();
						
						ref_list_collection.loadXMLList(resultatService.REFRECORD);
						
						if (ref_list_collection.length > 0) {
							has_refsettings = true;
						}
						
						// Charge la liste des prestataires RH
						_prestataire_collection = new CTI_ArrayCollection();
						_prestataire_collection.loadXMLList(resultatService.PRESTATAIRE);
					}

					
					
					searchChange();
					setTimeout(setBuildComplete, 1000);
				}
			}
			
			private function setBuildComplete():void {
				buildComplete = true;
			}
					
			private function resize():void {
			}
			
			private function searchChange():void {
				if (list_collection.filterFunction == null) {
					list_collection.filterFunction = filterFunction;
				}
			list_collection.refresh();
			}

			// Filter function
			public function filterFunction(item:Object):Boolean {
				var result:Boolean = true;

				if (Number(item.oid) >= 0) {
					if (textSearch_GUI.text != "") {
						result = false
						
						for each (var attributeName:String in list_collection.attributesArray) {
							if (item[attributeName].toString().toUpperCase().indexOf(textSearch_GUI.text.toUpperCase()) >= 0) {
								result=true;
								break;
							}
						}
						
					}
					if (result == true) {
						if (refSearch_GUI.selected == true) {
							if (item.hasOwnProperty("nbref")) {
								if (Number(item.nbref.toString()) <= 0) {
									if (item.hasOwnProperty("nbref2")) {
										if (Number(item.nbref.toString()) <= 0) {
											result = false;
										}
									}
									else {
										result = false;
									}
								}
							}

						}
					}
					if (result == true) {
						if (code_calcul_search_GUI.selected == true) {
							if (item.hasOwnProperty("code_calcul")) {
								if (Number(item.code_calcul.toString()) <= 0) {
									result = false;
								}
							}else {
								result = false;
							}
						}
					}
				}
				return result;
			}
			
			public function clearSearchText():void {
				textSearch_GUI.text = "";
				searchChange();
			}
			
			public function getRecord():void {
				if (recordUpdated == true) {
					return;
				}
                if (tableCode == "POP") {
                    if (POP_list_GUI.selectedIndex < 0) {
                        return;
                    }
                    currendRecordItem = POP_list_GUI.selectedItem as Object;
                } else if (tableCode == "PER") {
                    if (PER_list_GUI.selectedIndex < 0) {
                        return;
                    }
                    currendRecordItem = PER_list_GUI.selectedItem as Object;
                } else	if (tableCode == "EXC") {
					/*if (event.columnIndex == 0) {
						return;
					}*/
					if (qimport) {
						return;
					}
					if (EXC_list_GUI.selectedIndex < 0) {
						return;
					} 
					currendRecordItem = EXC_list_GUI.selectedItem as Object;
				} else {
					if (list_GUI.selectedIndex < 0) {
                        return;
                    }
                    currendRecordItem = list_GUI.selectedItem as Object;
                }
				
				showDetail();
			}
			
			public function addRecord():void {
			
				if (currendRecordItem == null) {
				
					currendRecordItem = new Object();	
					currendRecordItem.oid = "-1";
					currendRecordItem.code = "";
					currendRecordItem.code_original = "";
					currendRecordItem.texte = "";
					currendRecordItem.texte_court = "";
					currendRecordItem.nbref = 0;
					
                    currendRecordItem.valeur = "";
                    currendRecordItem.valeur_date = "";
                    currendRecordItem.code_calcul = "";
                    currendRecordItem.base_calcul_etp = "";
                    currendRecordItem.code_ets_planning = "";
                    currendRecordItem.code_ent_planning = "";
                    currendRecordItem.unite = "";
                    currendRecordItem.coefficient = "";
                    currendRecordItem.coefficient_base = "";
                    currendRecordItem.coefficient_nombre = "";
                    currendRecordItem.coefficient_txs = "";
                    currendRecordItem.coefficient_txp = "";
					currendRecordItem.coefficient_nombre = "";
					currendRecordItem.user_modified = "";
					
					currendRecordItem.p_cumul = "";
					currendRecordItem.p_detail = "";
					currendRecordItem.p_nombre = "";
					currendRecordItem.s_nombre = "";
					currendRecordItem.c_nombre = "";
					currendRecordItem.p_base = "";
					currendRecordItem.s_base = "";
					currendRecordItem.c_base = "";
                    currendRecordItem.p_heures_contrat = "";
					currendRecordItem.s_heures_contrat = "";
					currendRecordItem.c_heures_contrat = "";
					currendRecordItem.p_heures_payees = "";
					currendRecordItem.s_heures_payees = "";
					currendRecordItem.c_heures_payees = "";
					currendRecordItem.p_heures_travaillees = "";
					currendRecordItem.s_heures_travaillees = "";
					currendRecordItem.c_heures_travaillees = "";
					currendRecordItem.p_masse_salariale = "";
					currendRecordItem.s_masse_salariale = "";
					currendRecordItem.c_masse_salariale = "";
					currendRecordItem.p_brut = "";
					currendRecordItem.s_brut = "";
					currendRecordItem.c_brut = "";
					currendRecordItem.p_avantage_nature = "";
					currendRecordItem.s_avantage_nature = "";
					currendRecordItem.c_avantage_nature = "";
					currendRecordItem.p_frais_imposables = "";
					currendRecordItem.s_frais_imposables = "";
					currendRecordItem.c_frais_imposables = "";
					currendRecordItem.p_cotisation_salarie = "";
					currendRecordItem.s_cotisation_salarie = "";
					currendRecordItem.c_cotisation_salarie = "";
					currendRecordItem.p_cotisation_patronale = "";
					currendRecordItem.s_cotisation_patronale = "";
					currendRecordItem.c_cotisation_patronale = "";
					currendRecordItem.p_od_net_salarie = "";
					currendRecordItem.s_od_net_salarie = "";
					currendRecordItem.c_od_net_salarie = "";
					currendRecordItem.p_od_net_patronale = "";
					currendRecordItem.s_od_net_patronale = "";
					currendRecordItem.c_od_net_patronale = "";
					currendRecordItem.p_net_imposable = "";
					currendRecordItem.s_net_imposable = "";
					currendRecordItem.c_net_imposable = "";
					currendRecordItem.p_net_a_payer = "";
					currendRecordItem.s_net_a_payer = "";
					currendRecordItem.c_net_a_payer = "";
				
				
					switch (tableCode) {
                    
                        case "ETA" :
                            currendRecordItem.finess_id = "0";
                            break;
                            
						case "TRF" :
                   
                            currendRecordItem.texte_date = "";
                            currendRecordItem.texte_from = "";
                            currendRecordItem.texte_to = "";
                            currendRecordItem.date_debut = "0001-01-01";
                            currendRecordItem.date_fin = "2099-12-31";
                            currendRecordItem.salarie_id = "-1";
                            currendRecordItem.from_service_id = "-1";
                            currendRecordItem.to_service_id = "-1";
                            currendRecordItem.from_qualification_id = "-1";
                            currendRecordItem.to_qualification_id = "-1";
							break;
						
						case "DPR" :
							
							currendRecordItem.etablissement_inclus
							currendRecordItem.etablissement_exclus
							currendRecordItem.service_inclus		
							currendRecordItem.service_exclus		
							currendRecordItem.statut_inclus			
							currendRecordItem.statut_exclus	
							break;
						case "POP" :
                            currendRecordItem.oid = "-1";
                            currendRecordItem.nbref = 0;
                            currendRecordItem.code = "";
                            currendRecordItem.texte = "";
                        case "PER" :
                            currendRecordItem.oid = "-1";
                            currendRecordItem.texte = "";
                            currendRecordItem.priorite = "5000";
                            currendRecordItem.population_id = "0";
                            currendRecordItem.liste_finess = "";
                            currendRecordItem.liste_etablissement = "";
                            currendRecordItem.liste_service = "";
                            currendRecordItem.liste_specialite = "";
                            currendRecordItem.liste_section_analytique = "";
                            currendRecordItem.liste_section_analytique_paie = "";
                            currendRecordItem.liste_qualification = "";
                            currendRecordItem.liste_grille = "";
                            currendRecordItem.liste_code_emploi = "";
                            currendRecordItem.liste_categorie_socio_professionnelle = "";
                            currendRecordItem.liste_statut = "";
						case "EXC" :
							currendRecordItem.oid = "-1";
                            currendRecordItem.nbref = 0;
                            currendRecordItem.code = "";
                            currendRecordItem.texte = "";
							currendRecordItem.texte_abrege = "";
							currendRecordItem.description = "";
							currendRecordItem.is_hide = "0";
							currendRecordItem.is_active = "1";
							currendRecordItem.is_cti = "0";
							currendRecordItem.gravite = "0";
							currendRecordItem.gravite_texte = "";
							currendRecordItem.complement = "";
							currendRecordItem.rule_oid1 = "0";
							currendRecordItem.sqlcmd_where1 = "";
							currendRecordItem.sqlcmd_justificatif1 = "";
							currendRecordItem.table1 = "0";
							currendRecordItem.last_execution_date1 = "";
							currendRecordItem.last_execution_ok1 = "";
							currendRecordItem.prestataire_id = "-1";
							currendRecordItem.prestataire_texte = "Tous";
							currendRecordItem.is_alert = "0";
					}    
					
					showDetail();
				}
			}
					
			public function getRecordExpert(event:ListEvent = null):void {
				// SpÃ©cial Controles Expert
				
				if (tableCode == "EXC") {
					/*if (event.columnIndex == 0) {
						return;
					}*/
					if (qimport) {
						return;
					}
				}
				if (recordUpdated == true) {
					return;
				}
				if (EXC_list_GUI.selectedIndex < 0) {
					return;
				}
				currendRecordItem = EXC_list_GUI.selectedItem as Object;
				showDetail();
			}
			
			public function showDetail():void {
				var i:Number;
				var item:Object;
				if (currendRecordItem == null) {
					return;
				}

				if (tableCode == "EXC"){
					fillFields(new Array("oid", "code", "texte", "texte_court", "texte_abrege", "description", 
						"rule_oid1", "sqlcmd_where1", "sqlcmd_justificatif1", 
						"is_hide", "is_cti", "is_active", "is_alert"
						));
					setSelectedIndex(EXC_gravite_GUI, currendRecordItem.gravite.toString());
					setSelectedIndex(EXC_prestataire_GUI, currendRecordItem.prestataire_id.toString());
					setSelectedIndex(EXC_table1_GUI, currendRecordItem.table1.toString());
					EXC_is_alert_GUI.selected = currendRecordItem.is_alert.toString() == '1' ? true : false;
					EXC_sqlcmd_where1_GUI.setStyle("backgroundColor", null);
					EXC_sqlcmd_justificatif1_GUI.setStyle("backgroundColor", null);
					
				} else {
					oid_GUI.text = currendRecordItem.oid.toString();
					nbref_GUI.text = currendRecordItem.nbref.toString();
					code_GUI.text = currendRecordItem.code.toString();
					texte_GUI.text = currendRecordItem.texte.toString();
					texte_court_GUI.text = currendRecordItem.texte_court.toString();
					valeur_GUI.text = currendRecordItem.valeur.toString();
					valeur_date_GUI.text = currendRecordItem.valeur_date.toString();
					code_original_GUI.text = currendRecordItem.code_original.toString();
					code_calcul_GUI.selectedIndex = currendRecordItem.code_calcul.toString();
					base_calcul_etp_GUI.text = currendRecordItem.base_calcul_etp.toString();
                    code_ets_planning_GUI.text = currendRecordItem.code_ets_planning.toString();
					code_ent_planning_GUI.text = currendRecordItem.code_ent_planning.toString();
					unite_GUI.selectedIndex = currendRecordItem.unite.toString();
					coefficient_GUI.text = currendRecordItem.coefficient.toString();
					coefficient_base_GUI.text = currendRecordItem.coefficient_base.toString();
                    coefficient_nombre_GUI.text = currendRecordItem.coefficient_nombre.toString();
					coefficient_txs_GUI.text = currendRecordItem.coefficient_txs.toString();
					coefficient_txp_GUI.text = currendRecordItem.coefficient_txp.toString();
				}
                if (tableCode == "RUB") {
                    user_modified_GUI.selected = (currendRecordItem.user_modified.toString() == "M");
                    p_cumul_GUI.selected = (currendRecordItem.p_cumul.toString() == "C");
                    p_detail_GUI.selected = (currendRecordItem.p_detail.toString() == "D");
                    proratiser_conversion_GUI.selected = (currendRecordItem.proratiser_conversion.toString() == "X");

				    p_nombre_GUI.selected = (currendRecordItem.p_nombre.toString() == "X");
                    s_nombre_GUI.selectedIndex = currendRecordItem.s_nombre;
                    c_nombre_GUI.text = currendRecordItem.c_nombre;
				    p_base_GUI.selected = (currendRecordItem.p_base.toString() == "X");
                    s_base_GUI.selectedIndex = currendRecordItem.s_base;
                    c_base_GUI.text = currendRecordItem.c_base;
                    p_heures_contrat_GUI.selected = (currendRecordItem.p_heures_contrat.toString() == "X");
                    s_heures_contrat_GUI.selectedIndex = currendRecordItem.s_heures_contrat;
                    c_heures_contrat_GUI.text = currendRecordItem.c_heures_contrat;
				    p_heures_payees_GUI.selected = (currendRecordItem.p_heures_payees.toString() == "X");
                    s_heures_payees_GUI.selectedIndex = currendRecordItem.s_heures_payees;
                    c_heures_payees_GUI.text = currendRecordItem.c_heures_payees;
				    p_heures_travaillees_GUI.selected = (currendRecordItem.p_heures_travaillees.toString() == "X");
                    s_heures_travaillees_GUI.selectedIndex = currendRecordItem.s_heures_travaillees;
                    c_heures_travaillees_GUI.text = currendRecordItem.c_heures_travaillees;
				    p_masse_salariale_GUI.selected = (currendRecordItem.p_masse_salariale.toString() == "X");
                    s_masse_salariale_GUI.selectedIndex = currendRecordItem.s_masse_salariale;
                    c_masse_salariale_GUI.text = currendRecordItem.c_masse_salariale;
				    p_brut_GUI.selected = (currendRecordItem.p_brut.toString() == "X");
                    s_brut_GUI.selectedIndex = currendRecordItem.s_brut;
                    c_brut_GUI.text = currendRecordItem.c_brut;
				    p_avantage_nature_GUI.selected = (currendRecordItem.p_avantage_nature.toString() == "X");
                    s_avantage_nature_GUI.selectedIndex = currendRecordItem.s_avantage_nature;
                    c_avantage_nature_GUI.text = currendRecordItem.c_avantage_nature;
				    p_frais_imposables_GUI.selected = (currendRecordItem.p_frais_imposables.toString() == "X");
                    s_frais_imposables_GUI.selectedIndex = currendRecordItem.s_frais_imposables;
                    c_frais_imposables_GUI.text = currendRecordItem.c_frais_imposables;
				    p_cotisation_salarie_GUI.selected = (currendRecordItem.p_cotisation_salarie.toString() == "X");
                    s_cotisation_salarie_GUI.selectedIndex = currendRecordItem.s_cotisation_salarie;
                    c_cotisation_salarie_GUI.text = currendRecordItem.c_cotisation_salarie;
				    p_cotisation_patronale_GUI.selected = (currendRecordItem.p_cotisation_patronale.toString() == "X");
                    s_cotisation_patronale_GUI.selectedIndex = currendRecordItem.s_cotisation_patronale;
                    c_cotisation_patronale_GUI.text = currendRecordItem.c_cotisation_patronale;
				    p_od_net_salarie_GUI.selected = (currendRecordItem.p_od_net_salarie.toString() == "X");
                    s_od_net_salarie_GUI.selectedIndex = currendRecordItem.s_od_net_salarie;
                    c_od_net_salarie_GUI.text = currendRecordItem.c_od_net_salarie;
				    p_od_net_patronale_GUI.selected = (currendRecordItem.p_od_net_patronale.toString() == "X");
                    s_od_net_patronale_GUI.selectedIndex = currendRecordItem.s_od_net_patronale;
                    c_od_net_patronale_GUI.text = currendRecordItem.c_od_net_patronale;
				    p_net_imposable_GUI.selected = (currendRecordItem.p_net_imposable.toString() == "X");
                    s_net_imposable_GUI.selectedIndex = currendRecordItem.s_net_imposable;
                    c_net_imposable_GUI.text = currendRecordItem.c_net_imposable;
				    p_net_a_payer_GUI.selected = (currendRecordItem.p_net_a_payer.toString() == "X");
                    s_net_a_payer_GUI.selectedIndex = currendRecordItem.s_net_a_payer;
				    c_net_a_payer_GUI.text = currendRecordItem.c_net_a_payer;
                }

				if (tableCode == "ETA") {
					setComboSelectedIndex(ETA_finess_id_GUI, currendRecordItem.finess_id)
				}
    				if (tableCode == "TRF") {
    					setComboSelectedIndex(TRF_date_debut_GUI, currendRecordItem.date_debut)
    					setComboSelectedIndex(TRF_date_fin_GUI, currendRecordItem.date_fin)
    					
    					setComboSelectedIndex(TRF_salarie_id_GUI, currendRecordItem.salarie_id)
    					setComboSelectedIndex(TRF_from_service_id_GUI, currendRecordItem.from_service_id)
    					setComboSelectedIndex(TRF_to_service_id_GUI, currendRecordItem.to_service_id)
    					setComboSelectedIndex(TRF_from_qualification_id_GUI, currendRecordItem.from_qualification_id)
    					setComboSelectedIndex(TRF_to_qualification_id_GUI, currendRecordItem.to_qualification_id)
    				}
    				
    				if (tableCode == "PSE") {
    					setComboSelectedIndex(PSE_service_id_GUI, currendRecordItem.service_id)
    				}
                if (tableCode == "DIV") {
                    show_info_module_GUI.selected = (currendRecordItem.show_info_module.toString() == "1");
                }
    				if (tableCode == "PQU") {
    					setComboSelectedIndex(PQU_qualification_id_GUI, currendRecordItem.qualification_id)
    				}
				
				if (tableCode == "DPR") {
					DPR_etablissement_inclus_GUI.text = currendRecordItem.etablissement_inclus;
					DPR_etablissement_exclus_GUI.text = currendRecordItem.etablissement_exclus;
					DPR_service_inclus_GUI.text = currendRecordItem.service_inclus;
					DPR_service_exclus_GUI.text = currendRecordItem.service_exclus;
					DPR_statut_inclus_GUI.text = currendRecordItem.statut_inclus;
					DPR_statut_exclus_GUI.text = currendRecordItem.statut_exclus;
				}
				
                if (tableCode == "POP") {
					POP_oid_GUI.text = currendRecordItem.oid.toString();
					POP_nbref_GUI.text = currendRecordItem.nbref.toString();
					POP_code_GUI.text = currendRecordItem.code.toString();
					POP_texte_GUI.text = currendRecordItem.texte.toString();
				}

                if (tableCode == "PER") {
                    PER_oid_GUI.text = currendRecordItem.oid.toString();
                    PER_code_GUI.text = currendRecordItem.code.toString();
					PER_texte_GUI.text = currendRecordItem.texte.toString();
                    PER_priorite_GUI.text = currendRecordItem.priorite.toString();
                    PER_RH_liste_service_GUI.text = currendRecordItem.liste_service.toString();
                    PER_RH_liste_specialite_GUI.text = currendRecordItem.liste_specialite.toString();
                    PER_RH_liste_section_analytique_GUI.text = currendRecordItem.liste_section_analytique.toString();
                    PER_RH_liste_section_analytique_paie_GUI.text = currendRecordItem.liste_section_analytique_paie.toString();
                    PER_RH_liste_qualification_GUI.text = currendRecordItem.liste_qualification.toString();
                    PER_RH_liste_grille_GUI.text = currendRecordItem.liste_grille.toString();
                    PER_RH_liste_code_emploi_GUI.text = currendRecordItem.liste_code_emploi.toString();
                    PER_RH_liste_categorie_socio_professionnelle_GUI.text = currendRecordItem.liste_categorie_socio_professionnelle.toString();
                    PER_RH_liste_statut_GUI.text = currendRecordItem.liste_statut.toString();
                    PER_RH_liste_finess_GUI.text = currendRecordItem.liste_finess.toString();
                    PER_RH_liste_etablissement_GUI.text = currendRecordItem.liste_etablissement.toString();
                    PER_RH_Qliste_service_GUI.selected = PER_RH_liste_service_GUI.text != "" ? true : false;
                    PER_RH_Qliste_specialite_GUI.selected = PER_RH_liste_specialite_GUI.text != "" ? true : false;
                    PER_RH_Qliste_section_analytique_GUI.selected = PER_RH_liste_section_analytique_GUI.text != "" ? true : false;
                    PER_RH_Qliste_section_analytique_paie_GUI.selected = PER_RH_liste_section_analytique_paie_GUI.text != "" ? true : false;
                    PER_RH_Qliste_qualification_GUI.selected = PER_RH_liste_qualification_GUI.text != "" ? true : false;
                    PER_RH_Qliste_grille_GUI.selected = PER_RH_liste_grille_GUI.text != "" ? true : false;
                    PER_RH_Qliste_code_emploi_GUI.selected = PER_RH_liste_code_emploi_GUI.text != "" ? true : false;
                    PER_RH_Qliste_categorie_socio_professionnelle_GUI.selected = PER_RH_liste_categorie_socio_professionnelle_GUI.text != ""? true : false;
                    PER_RH_Qliste_statut_GUI.selected = PER_RH_liste_statut_GUI.text != ""? true : false;
                    PER_RH_Qliste_finess_GUI.selected = PER_RH_liste_finess_GUI.text != "" ? true : false;
                    PER_RH_Qliste_etablissement_GUI.selected = PER_RH_liste_etablissement_GUI.text != "" ? true : false;
                    setComboSelectedIndex(PER_population_id_GUI, currendRecordItem.population_id.toString());
                }

                recordUpdated = false;
                if (tableCode == "POP") {
                    POP_detailBox_GUI.height = 500;
                } else if (tableCode == "PER") {
                    PER_detailBox_GUI.height = 500;
                } else if (tableCode == "EXC") {
                    EXC_detailBox_GUI.height = 500;
                } else {
                    detailBox_GUI.height = 535;
                }
			}
			
			private function askCancel():void {
				if (recordUpdated == false) {
					hideRecord();
					return;
				}
				Alert.yesLabel = "OUI";
                Alert.noLabel = "NON";
	            var alert:Alert = Alert.show("Les données ont été changées, désirez vous les annuler ?", title, 3, this, alertClickHandler, question_class);
				
	            function alertClickHandler(event:CloseEvent):void {
	                if (event.detail==Alert.YES) {
						hideRecord();
					}
	            }
			}
			
			private function hideRecord():void {
				if (tableCode == "POP") {
                    POP_detailBox_GUI.height = 0
                } else if (tableCode == "PER") {
                    PER_detailBox_GUI.height = 0
                } else if (tableCode == "EXC") {
                    EXC_detailBox_GUI.height = 0
					if (EXC_mode == 2) {
						EXC_mode = 0;
					}
				}
				else {
                    detailBox_GUI.height = 0
				}
				
				currendRecordItem = null;
				recordUpdated = false;
			}

			private function askDelete():void {
				Alert.yesLabel = "OUI";
                Alert.noLabel = "NON";
	            var alert:Alert = Alert.show("Désirez vous vraiment supprimer " + texte_GUI.text + " ?", title, 3, this, alertClickHandler, question_class);
				
				
	            function alertClickHandler(event:CloseEvent):void {
	                if (event.detail==Alert.YES) {
						deleteRecord()
					}
	            }
			}
			
			public function deleteRecord():void {
				updateRecord("delete");
			}
			
			private function askPurge():void {
				
				var alert:Alert;
				
				Alert.yesLabel = "OUI";
				Alert.noLabel = "NON";
				
				if (currendRecordItem == null) {
					Alert.show("Désirez vous vraiment supprimer l'historique de TOUS les contrôles experts ?", title, 3, this, alertClickHandler, question_class);
				}
				else {
					Alert.show("Désirez vous vraiment supprimer l'historique de " + EXC_texte_GUI.text + " ?", title, 3, this, alertClickHandler, question_class);
				}
				function alertClickHandler(event:CloseEvent):void {
					if (event.detail == Alert.YES) {
						purgeHistory();
					}
				}
			}
			
			public function purgeHistory():void {
				
				updateRecord("purge_history");
				
			}
			
			
			public function copyRecord():void {
				updateRecord("copy");
			}
			
			public function saveRecord():void {
				updateRecord("save");
			}
			
			public function updateRecord(action:String):void {
				var urlVariables:URLVariables = new URLVariables()
				urlVariables.tableName = tableName;
				urlVariables.action = action;
				urlVariables.softCode = softCode;
				var recordNode:XML = new XML(<RECORD />);
                recordNode.@oid = oid_GUI.text;
                recordNode.@code = code_GUI.text;
                recordNode.@texte = texte_GUI.text;
                recordNode.@texte_court = texte_court_GUI.text;
                recordNode.@valeur = valeur_GUI.text;
                recordNode.@valeur_date = valeur_date_GUI.text;
                recordNode.@show_info_module = (show_info_module_GUI.selected ? "1" : "0");
                recordNode.@code_original = code_original_GUI.text;
                recordNode.@code_calcul = code_calcul_GUI.selectedIndex;
                recordNode.@base_calcul_etp = base_calcul_etp_GUI.text;
                recordNode.@code_ets_planning = code_ets_planning_GUI.text;
                recordNode.@code_ent_planning = code_ent_planning_GUI.text;
                recordNode.@unite = unite_GUI.selectedIndex;
                recordNode.@coefficient = coefficient_GUI.text;
                recordNode.@coefficient_base = coefficient_base_GUI.text;
                recordNode.@coefficient_nombre = coefficient_nombre_GUI.text;
                recordNode.@coefficient_txs = coefficient_txs_GUI.text;
                recordNode.@coefficient_txp = coefficient_txp_GUI.text;

                recordNode.@user_modified = (user_modified_GUI.selected ? "M" : "");
                recordNode.@p_cumul = (p_cumul_GUI.selected ? "C" : "");
                recordNode.@p_detail = (p_detail_GUI.selected ? "D" : "");
                recordNode.@proratiser_conversion = (proratiser_conversion_GUI.selected ? "X" : "");

                recordNode.@p_nombre = (p_nombre_GUI.selected ? "X" : "");
                recordNode.@s_nombre = s_nombre_GUI.selectedIndex;
                recordNode.@c_nombre = c_nombre_GUI.text;
                recordNode.@p_base = (p_base_GUI.selected ? "X" : "");
                recordNode.@s_base = s_base_GUI.selectedIndex;
                recordNode.@c_base = c_base_GUI.text;
                recordNode.@p_heures_contrat = (p_heures_contrat_GUI.selected ? "X" : "");
                recordNode.@s_heures_contrat = s_heures_contrat_GUI.selectedIndex;
                recordNode.@c_heures_contrat = c_heures_contrat_GUI.text;
                recordNode.@p_heures_payees = (p_heures_payees_GUI.selected ? "X" : "");
                recordNode.@s_heures_payees = s_heures_payees_GUI.selectedIndex;
                recordNode.@c_heures_payees = c_heures_payees_GUI.text;
                recordNode.@p_heures_travaillees = (p_heures_travaillees_GUI.selected ? "X" : "");
                recordNode.@s_heures_travaillees = s_heures_travaillees_GUI.selectedIndex;
                recordNode.@c_heures_travaillees = c_heures_travaillees_GUI.text;
                recordNode.@p_masse_salariale = (p_masse_salariale_GUI.selected ? "X" : "");
                recordNode.@s_masse_salariale = s_masse_salariale_GUI.selectedIndex;
                recordNode.@c_masse_salariale = c_masse_salariale_GUI.text;
                recordNode.@p_brut = (p_brut_GUI.selected ? "X" : "");
                recordNode.@s_brut = s_brut_GUI.selectedIndex;
                recordNode.@c_brut = c_brut_GUI.text;
                recordNode.@p_avantage_nature = (p_avantage_nature_GUI.selected ? "X" : "");
                recordNode.@s_avantage_nature = s_avantage_nature_GUI.selectedIndex;
                recordNode.@c_avantage_nature = c_avantage_nature_GUI.text;
                recordNode.@p_frais_imposables = (p_frais_imposables_GUI.selected ? "X" : "");
                recordNode.@s_frais_imposables = s_frais_imposables_GUI.selectedIndex;
                recordNode.@c_frais_imposables = c_frais_imposables_GUI.text;
                recordNode.@p_cotisation_salarie = (p_cotisation_salarie_GUI.selected ? "X" : "");
                recordNode.@s_cotisation_salarie = s_cotisation_salarie_GUI.selectedIndex;
                recordNode.@c_cotisation_salarie = c_cotisation_salarie_GUI.text;
                recordNode.@p_cotisation_patronale = (p_cotisation_patronale_GUI.selected ? "X" : "");
                recordNode.@s_cotisation_patronale = s_cotisation_patronale_GUI.selectedIndex;
                recordNode.@c_cotisation_patronale = c_cotisation_patronale_GUI.text;
                recordNode.@p_od_net_salarie = (p_od_net_salarie_GUI.selected ? "X" : "");
                recordNode.@s_od_net_salarie = s_od_net_salarie_GUI.selectedIndex;
                recordNode.@c_od_net_salarie = c_od_net_salarie_GUI.text;
                recordNode.@p_od_net_patronale = (p_od_net_patronale_GUI.selected ? "X" : "");
                recordNode.@s_od_net_patronale = s_od_net_patronale_GUI.selectedIndex;
                recordNode.@c_od_net_patronale = c_od_net_patronale_GUI.text;
                recordNode.@p_net_imposable = (p_net_imposable_GUI.selected ? "X" : "");
                recordNode.@s_net_imposable = s_net_imposable_GUI.selectedIndex;
                recordNode.@c_net_imposable = c_net_imposable_GUI.text;
                recordNode.@p_net_a_payer = (p_net_a_payer_GUI.selected ? "X" : "");
                recordNode.@s_net_a_payer = s_net_a_payer_GUI.selectedIndex;
                recordNode.@c_net_a_payer = c_net_a_payer_GUI.text;
				
                if (tableCode == "ETA") {
					recordNode.@finess_id = ETA_finess_id_GUI.selectedItem.@oid
				}
				if (tableCode == "TRF") {
					recordNode.@date_debut = TRF_date_debut_GUI.selectedItem.@oid
					recordNode.@date_fin = TRF_date_fin_GUI.selectedItem.@oid
					recordNode.@salarie_id = TRF_salarie_id_GUI.selectedItem.@oid
					recordNode.@from_service_id = TRF_from_service_id_GUI.selectedItem.@oid
					recordNode.@to_service_id = TRF_to_service_id_GUI.selectedItem.@oid
					recordNode.@from_qualification_id = TRF_from_qualification_id_GUI.selectedItem.@oid
					recordNode.@to_qualification_id = TRF_to_qualification_id_GUI.selectedItem.@oid
				}
				if (tableCode == "PSE") {
					recordNode.@service_id = PSE_service_id_GUI.selectedItem.@oid
				}
				if (tableCode == "PQU") {
					recordNode.@qualification_id = PQU_qualification_id_GUI.selectedItem.@oid
                } 

				if (tableCode == "DPR") {
					recordNode.@etablissement_inclus	= DPR_etablissement_inclus_GUI.text 
					recordNode.@etablissement_exclus	= DPR_etablissement_exclus_GUI.text 
					recordNode.@service_inclus			= DPR_service_inclus_GUI.text	
					recordNode.@service_exclus			= DPR_service_exclus_GUI.text	
					recordNode.@statut_inclus			= DPR_statut_inclus_GUI.text 	
					recordNode.@statut_exclus			= DPR_statut_exclus_GUI.text 	
				}
				
                if (tableCode == "POP") {
					recordNode.@oid = POP_oid_GUI.text
					recordNode.@code = POP_code_GUI.text
					recordNode.@texte = POP_texte_GUI.text
				}
				
                if (tableCode == "PER") {
                    recordNode.@oid        = PER_oid_GUI.text
                    recordNode.@code        = PER_code_GUI.text
					recordNode.@texte      = PER_texte_GUI.text
                    recordNode.@priorite   = PER_priorite_GUI.text
                    recordNode.@liste_service = PER_RH_liste_service_GUI.text 
                    recordNode.@liste_specialite = PER_RH_liste_specialite_GUI.text 
                    recordNode.@liste_section_analytique = PER_RH_liste_section_analytique_GUI.text 
                    recordNode.@liste_section_analytique_paie = PER_RH_liste_section_analytique_paie_GUI.text 
                    recordNode.@liste_qualification = PER_RH_liste_qualification_GUI.text 
                    recordNode.@liste_grille = PER_RH_liste_grille_GUI.text 
                    recordNode.@liste_code_emploi = PER_RH_liste_code_emploi_GUI.text 
                    recordNode.@liste_categorie_socio_professionnelle = PER_RH_liste_categorie_socio_professionnelle_GUI.text 
                    recordNode.@liste_statut = PER_RH_liste_statut_GUI.text 
                    recordNode.@liste_finess = PER_RH_liste_finess_GUI.text 
                    recordNode.@liste_etablissement = PER_RH_liste_etablissement_GUI.text 
                    recordNode.@population_id = PER_population_id_GUI.selectedItem.@oid;
				} 
					
				if (tableCode == "EXC") {
                    // Controles normaux
                    if (EXC_mode == 0) {
                        recordNode.@mode = EXC_mode;
                        recordNode = readFields(new Array(
                            "oid", "code", "texte", "texte_court", "texte_abrege", "description", 
                            "rule_oid1", "sqlcmd_where1", "sqlcmd_justificatif1", 
                            "prestataire",
                            "gravite", "table1",
                            "is_active","is_alert", "is_hide", "is_cti"
                            ), recordNode); 
                    }
                    // ParamÃ¨tres gÃ©nÃ©raux
                    if (EXC_mode == 2) {
                        recordNode.@mode = EXC_mode;
                        recordNode.@EXPERT_ACTIVE = EXC_EXPERT_ACTIVE_GUI.selected == true ? "1" : "0";
                        recordNode.@EXPERT_DATE_DEBUT = EXC_EXPERT_DATE_DEBUT_GUI.text;
                        EXC_mode = 0;
                    }
				}	
				
				urlVariables.recordNode = recordNode.toXMLString();
				CTI_Utilitaires.startRequestHTTP("modules/rh/php/httpService_tablesManager_setData.php",urlVariables,exec,true,this.parentApplication)
				function exec(resultatService:XML):void {
					getData();
                    if (tableCode == "POP") {
                        POP_detailBox_GUI.height = 0
                    } else if (tableCode == "PER") {
                        PER_detailBox_GUI.height = 0
                    } else if (tableCode == "EXC") {
                        EXC_detailBox_GUI.height = 0
                    } else {
                        detailBox_GUI.height = 0
                    }
					currendRecordItem = null;
					recordUpdated = false;
				}
				
				
            }
			
			public function print():void {
				var printReport:CTI_Print = new CTI_Print();
				if (printReport.start("RH_TablesManager", titlePrint) == false) {
					return;
				}
				printReport.addAdvancedDataGrid(list_GUI)
				printReport.print();
			}
			
			public function exportExcel():void {
				var xml:XML = new XML(<EXCELEXPORT />);
				var ongletNode:XML;
				var similiTabNode:XML;
				var selectionsNode:XML;
				var datagridNode:XML;
				var columnNode:XML;
				var dataNode:XML;
				var rowNode:XML;
				xml.@viewName = this.viewName;
				xml.@title = this.title;
				selectionsNode = new XML(<SELECTIONS />);
				selectionsNode.displayText = "";
				if (refSearch_GUI.selected == true) {
					selectionsNode.@displayText = selectionsNode.displayText + "Uniquement les codes référencés. ";
				}
				if (textSearch_GUI.text != "") {
					selectionsNode.@displayText = selectionsNode.displayText + "(Filtre : " + textSearch_GUI.text + ")  ";
				}
				xml.appendChild(selectionsNode);
				ongletNode = new XML(<ONGLET />);
				ongletNode.@excelLabel = tableCode;
				xml.appendChild(ongletNode);
				similiTabNode = new XML(<SIMILITAB />);
				similiTabNode.@excelLabel = "Liste";
				ongletNode.appendChild(similiTabNode);
				datagridNode = new XML(<DATAGRID />);
				datagridNode.@total = "false";
				ongletNode.appendChild(datagridNode);
				for each (var column:AdvancedDataGridColumn in list_GUI.columns) {
					columnNode = new XML(<COLUMN />);
					columnNode.@dataField = column.dataField;
					columnNode.@headerText = column.headerText;
					columnNode.@type = "Char";
					columnNode.@textAlign = column.getStyle("textAlign");
					datagridNode.appendChild(columnNode);
				}
				dataNode = new XML(<DATA />);
				similiTabNode.appendChild(dataNode);
				for each (var itemNode:Object in list_collection) {
					if (itemNode.oid != "-1") {
						rowNode = new XML(<ROW />)
						var c:int = 0;
						for each (column in list_GUI.columns) {
							c++;
							rowNode.@["c" + c.toString()] = itemNode[column.dataField]
						}
						dataNode.appendChild(rowNode);
					}
				}
				CTI_ExcelUtilitaires.exportExcel(xml);
			}
			
			public function exportPDF():void {
				var xml:XML = new XML(<PDFEXPORT />);
				var ongletNode:XML;
				var selectionsNode:XML;
				var datagridNode:XML;
				var columnNode:XML;
				var dataNode:XML;
				var rowNode:XML;
				xml.@viewName = this.viewName;
				xml.@title = this.title;
				selectionsNode = new XML(<SELECTIONS />);
				selectionsNode.displayText = "";
				if (refSearch_GUI.selected == true) {
					selectionsNode.displayText = selectionsNode.displayText + "Uniquement les codes référencés. ";
				}
				if (textSearch_GUI.text != "") {
					selectionsNode.displayText = selectionsNode.displayText + "(Filtre : " + textSearch_GUI.text + ")  ";
				}
				xml.appendChild(selectionsNode);
				ongletNode = new XML(<ONGLET />);
				ongletNode.@excelLabel = tableCode;
				xml.appendChild(ongletNode);
				datagridNode = new XML(<DATAGRID />);
				datagridNode.@total = "false";
				ongletNode.appendChild(datagridNode);
				for each (var column:AdvancedDataGridColumn in list_GUI.columns) {
					columnNode = new XML(<COLUMN />);
					columnNode.@dataField = column.dataField;
					columnNode.@headerText = column.headerText;
					columnNode.@type = "Char";
					columnNode.@textAlign = column.getStyle("textAlign");
					datagridNode.appendChild(columnNode);
				}
				dataNode = new XML(<DATA />);
				ongletNode.appendChild(dataNode);
				for each (var itemNode:Object in list_collection) {
					if (itemNode.oid != "-1") {
						rowNode = new XML(<ROW />)
						var c:int = 0;
						for each (column in list_GUI.columns) {
							c++;
							rowNode.@["c" + c.toString()] = itemNode[column.dataField]
						}
						dataNode.appendChild(rowNode);
					}
				}
				CTI_PDFUtilitaires.exportPDF(xml);
				xml = null;
			}
			
						public function copyRefSettings():void {
				
				var urlVariables:URLVariables = new URLVariables();
				urlVariables.tableName = tableName;
				urlVariables.oids = "";
				for each (var item:Object in ref_list_collection) {
					if (item.selected == "1") {
						if (urlVariables.oids != "") {
							urlVariables.oids = urlVariables.oids + ", ";
						}
						urlVariables.oids = urlVariables.oids + item.oid;
					}
				}
				
				if (urlVariables.oids == "") {
					CTI_Utilitaires.alert_error("Import de données", "Vous devez d'abord choisir les données à récupérer");
					return;
				}
				
				CTI_Utilitaires.startRequestHTTP("modules/rh/php/httpService_RH_tableManager_copyRef.php", urlVariables, exec, true, this.parentApplication);
				
				function exec(resultatService:XML):void {
					
					getData();
					
					detailBox_GUI.visible = false;
					detailBox_GUI.includeInLayout = false;
					currendRecordItem = null;
					toggleUpdate(false);
				}
			}
			
			
			
			
			
			
			private function setComboSelectedIndex(cb:Object, str:String):void {
				for (var idx:int = 0; idx < cb.dataProvider.length; idx++){
					if (cb.dataProvider.getItemAt(idx).@oid == str){
						cb.selectedIndex = idx;
					}
				}
			}
			
				private function setSelectedIndex(cb:Object, str:String, field:String='data'):void {
				for (var idx:int = 0, len:int = cb.dataProvider.length; idx < len; idx++) {
					if (cb.dataProvider.getItemAt(idx)[field] == str) {
						cb.selectedIndex = idx;
					}
				}
			}
        
			private function fillFields(fields:Array):void {
				var dobj:DisplayObject;
				var field:String;
				for each (field in fields) {
					dobj = findChild(EXC_detailBox_GUI, tableCode + "_" + field + "_GUI");
					if (dobj is RichTextEditor) {
						if (currendRecordItem[field].toString() != "") {
							(dobj as RichTextEditor).htmlText = CTI_Utilitaires.uncompress64(currendRecordItem[field].toString());
						}
						else {
							(dobj as RichTextEditor).htmlText = "";
						}
					}
					else if (dobj is TextArea) {
						(dobj as TextArea).text = currendRecordItem[field].toString();
					}
					else if (dobj is DateField) {
						(dobj as DateField).selectedDate = DateField.stringToDate(currendRecordItem[field].toString(), 'DD/MM/YYYY');
					}
					else if (dobj is CheckBox) {
						(dobj as CheckBox).selected = currendRecordItem[field].toString() == "1" ? true : false;
					}
				}
				dobj = null;
			}
			
			private function readFields(fields:Array, recordNode:XML):XML {
				
				var dobj:DisplayObject;
				var field:String;
				for each (field in fields) {
					
					dobj = findChild(EXC_detailBox_GUI, tableCode + "_" + field + "_GUI");
					if (dobj is RichTextEditor) {
						if ((dobj as RichTextEditor).text != "") {
							recordNode.@[field] = CTI_Utilitaires.compress64((dobj as RichTextEditor).htmlText);
						}
						else {
							recordNode.@[field] = "";
						}
					}
					else if (dobj is TextArea) {
						recordNode.@[field] = (dobj as TextArea).text;
					}
					else if (dobj is DateField) {
						recordNode.@[field] = DateField.dateToString((dobj as DateField).selectedDate, 'DD/MM/YYYY');
					}
					else if (dobj is ComboBox) {
						recordNode.@[field] = (dobj as ComboBox).selectedItem.data;
					}
					else if (dobj is CheckBox) {
						recordNode.@[field] = (dobj as CheckBox).selected ? "1" : "0";
					}
					
				}
				dobj = null;
				return recordNode;
			}
			
			private function EXC_show_generalSettings():void {
				
				EXC_mode = 2;
				detailBox_GUI.visible = true;
				detailBox_GUI.includeInLayout = true;
			}
								
			public function EXC_execute_rules(controle_id:String=null):void {
				
				var urlVariables:URLVariables = new URLVariables()
				urlVariables.tableName = tableName;
				urlVariables.action = 'execute_rules';
				
				if (controle_id != null) {
					urlVariables.oids = controle_id
				}
				else {
					urlVariables.oids = "";
				//	for each (var item:Object in list_collection) {
				//		if (item.selected == "1") {
				//			if (urlVariables.oids != "") {
				//				urlVariables.oids = urlVariables.oids + ", "
				//			}
				//			urlVariables.oids = urlVariables.oids + item.oid
				//		}
				//	}
				}
				
				CTI_Utilitaires.startRequestHTTP("modules/rh/php/RH_setTableRecord.php", urlVariables, exec, true, this.parentApplication);
				
				function exec(resultatService:XML):void {
					
					if (resultatService.RETURN.@code.toString() != "KO") {
						CTI_Utilitaires.alert_info("Exécution règles Expert", "Exécution terminée : " + resultatService.RETURN.@message.toString());
					}
					else {
						CTI_Utilitaires.alert_error("Exécution règles Expert", "Exécution terminée avec ERREURS : " + resultatService.RETURN.@message.toString());
					}
					
					getData();
					
					detailBox_GUI.visible = false
					detailBox_GUI.includeInLayout = false
					currendRecordItem = null;
					recordUpdated = false;
				}
			}
									
			public function EXC_getSQL(controle_id:String=null):void {
				
				var urlVariables:URLVariables = new URLVariables();
				urlVariables.tableName = tableName;
				if (controle_id != null) {
					urlVariables.oids = controle_id;
				}
				else {
					urlVariables.oids = "";
					for each (var item:Object in list_collection) {
						if (item.selected == "1") {
							if (urlVariables.oids != "") {
								urlVariables.oids = urlVariables.oids + ", ";
							}
							urlVariables.oids = urlVariables.oids + item.oid;
						}
					}
				}
				
				if (urlVariables.oids == "") {
					CTI_Utilitaires.alert_error("Export SQL", "Vous devez d'abord choisir les contrôles à exporter");
					return;
				}
				
				// @todo
				CTI_Utilitaires.openURL("modules/rh/php/httpService_RH_tableManager_getSqlScript.php", urlVariables, "iCTI_expert_controle.SQL");
			}
			
			/**
			 * Fonction qui cherche un displayObject par son nom dans toute l'arboresence d'un
			 * container. Cette fonction supplante la fonction getChildByName dans le sens oÃ¹ elle
			 * ne se cantonne pas au premier niveau de l'arboresence mais inspecte tous les niveaux
			 * 
			 * @param	container	Container dans lequel chercher l'enfant
			 * @param	childname	Nom de l'enfant Ã  chercher
			 * @return	L'Ã©lement trouvÃ© dans l'arborescence
			 */
			private function findChild(container:DisplayObjectContainer, childname:String ):DisplayObject {
				
				if (container == null) {
					container = this;
				}
				
				for (var j:int = 0; j < container.numChildren; ++j) { 
					
					var obj:DisplayObject = container.getChildAt(j) as DisplayObject;
					if (obj.name == childname) {
						return obj;
					}
					if (obj is DisplayObjectContainer) {
						var doc:DisplayObjectContainer = obj as DisplayObjectContainer;
						if (doc.numChildren > 0) {
							var ret:DisplayObject = findChild( doc, childname );
							if (ret != null) {
								return ret;
							}
						}
					} 
				}
				return null;
			}
			
			public function toggleUpdate(value:Boolean):void {
				recordUpdated = value;
			}
			
            public function PER_execute_regles():void {
				var urlVariables:URLVariables = new URLVariables()
				urlVariables.tableName = tableName;
                urlVariables.softCode = softCode
				urlVariables.action = 'PER_execute_regles';
				CTI_Utilitaires.startRequestHTTP("modules/rh/php/httpService_tablesManager_setData.php", urlVariables, exec, true, this.parentApplication);
				function exec(resultatService:XML):void {
					getData();
				}
			}
					
			public function getRefSettings():void {
				detailBox_GUI.visible = false;
				detailBox_GUI.includeInLayout = false;
				qimport = true;
			}
			
			public function hideRefSettings():void {
				detailBox_GUI.visible = true;
				detailBox_GUI.includeInLayout = true;
				qimport = false;
			}
						
		]]>
    </mx:Script>

	<mx:VBox width="100%" height="100%">
		<cti_control:CTIViewTitle id="GUI_titleBar" label="{title}" width="100%" height="25" />
		<mx:Canvas width="100%" height="28" >
			<mx:HBox id="GUI_buttonBar" width="100%">
				<mx:Button height="28" width="28" toolTip="Imprimer" icon="@Embed('../../base/swf/CTI/images/24/print.png')" labelPlacement="right" click="print()"/>
				<mx:Button height="28" width="28" toolTip="Réafficher" icon="@Embed('../../base/swf/CTI/images/24/view-refresh.png')" labelPlacement="right" click="getData()" />
				<mx:Button height="28" width="28" toolTip="Exporter vers Excel" icon="@Embed('../../base/swf/CTI/images/24/excel.png')" labelPlacement="right" click="exportExcel()"/>
				<mx:Spacer />
				<mx:Button height="28" width="28" toolTip="Ajouter" icon="@Embed('../../base/swf/CTI/images/24/list-add.png')" labelPlacement="right" click="addRecord()" visible="{currendRecordItem == null &amp;&amp; (tableCode == 'TRF' || tableCode == 'DPR')}" />
				<mx:Button height="28" width="28" toolTip="Importer depuis l'environnement de référence" icon="@Embed('../../base/swf/CTI/images/24/document-save.png')" labelPlacement="right" click="getRefSettings()" visible="{has_refsettings &amp;&amp; tableCode == 'EXC' &amp;&amp; recordUpdated == false &amp;&amp; EXC_mode != 2}" includeInLayout="{has_refsettings &amp;&amp; tableCode == 'EXC'}"  />
				<mx:Spacer />
				<mx:Button height="28" width="28" toolTip="Ajouter" icon="@Embed('../../base/swf/CTI/images/24/list-add.png')" labelPlacement="right" click="addRecord()" visible="{tableCode == 'EXC'}" />
				<mx:Spacer />
				<mx:Button height="28" width="130" label="Préférences" toolTip="Préférences" icon="@Embed('../../base/swf/CTI/images/24/preferences-desktop.png')" labelPlacement="right" click="EXC_show_generalSettings()" enabled="{!recordUpdated &amp;&amp; currendRecordItem == null}" visible="{tableCode == 'EXC' &amp;&amp; EXC_mode != 2}" includeInLayout="{tableCode == 'EXC' &amp;&amp; EXC_mode != 2}" />
				<mx:Spacer />
				<mx:Button height="28" width="130" label="Exécuter" toolTip="Exécuter les règles Expert" icon="@Embed('../../base/swf/CTI/images/24/system-upgrade.png')" labelPlacement="right" click="EXC_execute_rules()" enabled="{!recordUpdated &amp;&amp; currendRecordItem == null}" visible="{EXC_mode != 2 &amp;&amp; tableCode == 'EXC'}" includeInLayout="{EXC_mode != 2 &amp;&amp; tableCode == 'EXC'}" />
				<mx:Spacer />
				<mx:Button height="28" label="Effacer historique" toolTip="Effacer historique" icon="@Embed('../../base/swf/CTI/images/24/window-close.png')" labelPlacement="right" click="askPurge()"  enabled="{!recordUpdated &amp;&amp; currendRecordItem == null}" visible="{EXC_mode != 2 &amp;&amp; tableCode == 'EXC'}" includeInLayout="{EXC_mode != 2 &amp;&amp; tableCode == 'EXC'}" />
				<mx:Button height="28" width="28" toolTip="Script SQL" icon="@Embed('../../base/swf/CTI/images/sql24.png')" labelPlacement="right" click="EXC_getSQL()"  visible="{tableCode == 'EXC' &amp;&amp; recordUpdated == false}" includeInLayout="{tableCode == 'EXC'}"  />
				<mx:Button height="28" width="28" toolTip="Ajouter" icon="@Embed('../../base/swf/CTI/images/24/list-add.png')" labelPlacement="right" click="addRecord()" visible="{currendRecordItem == null &amp;&amp; (tableCode == 'POP' || tableCode == 'PER' || tableCode == 'TRF' || tableCode == 'DPR' || tableCode == 'EXC')}" />
				<mx:Spacer />
				<mx:Button height="28" width="28" toolTip="Aide" icon="@Embed('../../base/swf/CTI/images/24/help.png')" labelPlacement="right" click="application.displayHelp()" visible="{hasHelp}" />
				<mx:Button height="28" width="28" toolTip="A propos" icon="@Embed('../../base/swf/CTI/images/24/information.png')" labelPlacement="right" click="application.showApropos_view()"  />
				<mx:Spacer />
                <mx:Button height="28" width="170" toolTip="Exécuter les règles" icon="@Embed('../../base/swf/CTI/images/24/system-software-installer.png')" label="Exécuter les règles" labelPlacement="right" click="PER_execute_regles()" enabled="{!recordUpdated}" visible="{tableCode == 'PER'}" includeInLayout="{tableCode == 'PER'}" />
				<mx:Spacer width="100%" />
				<mx:HBox verticalAlign="middle">
					<mx:Label text="Filtre" />
					<mx:TextArea width="100%" height="18" id="textSearch_GUI" change="searchChange()"/>
					<mx:Button height="28" width="28" toolTip="Effacer la recherche" icon="@Embed('../../base/swf/CTI/images/edit-clear.png')" click="clearSearchText()"/>
					<mx:Spacer width="10" />
					<mx:Label text="Référencés Uniquement" visible="false"/>
					<mx:CheckBox id="refSearch_GUI" change="searchChange()" visible="false"/>
					<mx:Label text="Avec code calcul uniquement" visible="{tableCode == 'RUB'}"/>
					<mx:CheckBox id="code_calcul_search_GUI" change="searchChange()" visible="{tableCode == 'RUB'}"/>
					<mx:Spacer width="10" />
				</mx:HBox>
			</mx:HBox>

		</mx:Canvas>
		<mx:Canvas width="100%" height="100%">
            <mx:VDividedBox id="POP_mainBox" width="100%" height="100%" visible="false">
				<mx:DataGrid id="POP_list_GUI" rowHeight="20" headerHeight="40"
					rowCount="{list_collection.length + 1}" height="100%" width="100%"  
					wordWrap="false" dataProvider="{list_collection}" 
					fontFamily="tahoma"
					itemClick="getRecord()" 
					selectable="{!recordUpdated}">
					<mx:columns>
						<mx:DataGridColumn dataField="code" headerText="Code" width="100"  editable="false" headerWordWrap="true"/>
						<mx:DataGridColumn dataField="texte" headerText="Texte" width="400"  editable="false" headerWordWrap="true"/>
						<mx:DataGridColumn dataField="nbref" headerText="Nombre Références (règles)" width="100"  editable="false" headerWordWrap="true" textAlign="right" />
					</mx:columns>
				</mx:DataGrid>
				<mx:VBox id="POP_detailBox_GUI" width="100%"  height="0" backgroundColor="0xFFFFFF">
					<mx:HBox>
						<mx:Canvas>
							<mx:Button height="28" label="Annuler" toolTip="Annuler les modifications" icon="@Embed('../../base/swf/CTI/images/24/window-close.png')" labelPlacement="right" click="askCancel()" visible="{recordUpdated == true}" />
							<mx:Button height="28" label="Masquer" toolTip="Masquer la fiche" icon="@Embed('../../base/swf/CTI/images/24/go-up.png')" labelPlacement="right" click="hideRecord()" visible="{recordUpdated == false}" />
						</mx:Canvas>
						<mx:Canvas>
							<mx:Button height="28" label="Enregistrer" toolTip="Enregistrer les modifications" icon="@Embed('../../base/swf/CTI/images/24/dialog-ok.png')" labelPlacement="right" click="saveRecord()" visible="{recordUpdated == true &amp;&amp; POP_code_GUI.text != ''}" />
							<mx:HBox>
								<mx:Button height="28" label="Supprimer" toolTip="Supprimer la spécialité" icon="@Embed('../../base/swf/CTI/images/24/user-trash.png')" labelPlacement="right" click="askDelete()" enabled="{Number(POP_nbref_GUI.text) == 0}" visible="{recordUpdated == false &amp;&amp; POP_oid_GUI.text != '-1'}" />
							</mx:HBox>
						</mx:Canvas>
					</mx:HBox>
					<mx:HBox>
						<mx:Label width="150" text="Code" />
						<mx:TextArea width="100" height="18" id="POP_code_GUI" change="recordUpdated = true" fontWeight="bold" />
					</mx:HBox>
					<mx:HBox>
						<mx:Label width="150" text="Texte" />
						<mx:TextArea width="300" height="18" id="POP_texte_GUI" change="recordUpdated = true" fontWeight="bold"/>
					</mx:HBox>
					<mx:HBox visible="false" includeInLayout="false" height="0">
						<mx:Label width="150" text="Oid" />
						<mx:TextArea width="300" height="18" id="POP_oid_GUI" change="recordUpdated = true" editable="false"/>
					</mx:HBox>
					<mx:HBox visible="false" includeInLayout="false" height="0">
						<mx:Label width="150" text="Nombre références" />
						<mx:TextArea width="300" height="18" id="POP_nbref_GUI" change="recordUpdated = true" editable="false"/>
					</mx:HBox>
				</mx:VBox>
			</mx:VDividedBox>
            <mx:VDividedBox id="PER_mainBox" width="100%" height="100%" visible="false">
				<mx:DataGrid id="PER_list_GUI" rowHeight="20" headerHeight="40"
					rowCount="{list_collection.length + 1}" height="100%" width="100%"  
					wordWrap="false" dataProvider="{list_collection}"
					fontFamily="tahoma"
					itemClick="getRecord()" 
					selectable="{!recordUpdated}">
					<mx:columns>
						<mx:DataGridColumn dataField="priorite" headerText="Priorité" width="100"  editable="false" headerWordWrap="true"/>
                        <mx:DataGridColumn dataField="texte" headerText="Texte" minWidth="300"  editable="false" headerWordWrap="true"/>
						<mx:DataGridColumn dataField="population_texte" headerText="Population" minWidth="300"  editable="false" headerWordWrap="true"/>
						<mx:DataGridColumn dataField="regle_resume" headerText="Règles" minWidth="200"  editable="false" headerWordWrap="true"/>
					</mx:columns>
				</mx:DataGrid>
				<mx:VBox id="PER_detailBox_GUI" width="100%"  height="0" backgroundColor="0xFFFFFF">
					<mx:HBox>
						<mx:Canvas>
							<mx:Button height="28" label="Annuler" toolTip="Annuler les modifications" icon="@Embed('../../base/swf/CTI/images/24/window-close.png')" labelPlacement="right" click="askCancel()" visible="{recordUpdated == true}" />
							<mx:Button height="28" label="Masquer" toolTip="Masquer la fiche" icon="@Embed('../../base/swf/CTI/images/24/go-up.png')" labelPlacement="right" click="hideRecord()" visible="{recordUpdated == false}" />
						</mx:Canvas>
						<mx:Canvas>
							<mx:Button height="28" label="Enregistrer" toolTip="Enregistrer les modifications" icon="@Embed('../../base/swf/CTI/images/24/dialog-ok.png')" labelPlacement="right" click="saveRecord()" visible="{recordUpdated == true}" />
							<mx:HBox>
								<mx:Button height="28" label="Supprimer" toolTip="Supprimer la clé" icon="@Embed('../../base/swf/CTI/images/24/user-trash.png')" labelPlacement="right" click="askDelete()" enabled="{recordUpdated == false &amp;&amp; PER_oid_GUI.text != '-1'}" visible="{recordUpdated == false &amp;&amp; PER_oid_GUI.text != '-1'}" />
							</mx:HBox>
						</mx:Canvas>
					</mx:HBox>
					<mx:HBox width="100%">
						<mx:Label width="150" text="Texte" />
						<mx:TextArea width="50%" height="18" id="PER_texte_GUI" change="toggleUpdate(true)" fontWeight="bold" />
						<mx:Label width="80" text="Code règle" />
						<mx:TextArea width="100" height="18" id="PER_code_GUI" change="toggleUpdate(true)" fontWeight="bold"  />
					</mx:HBox>
					<mx:HBox>
						<mx:Label width="150" text="Population" />
						<mx:ComboBox id="PER_population_id_GUI" width="400" labelField="@texte" change="toggleUpdate(true)" disabledColor="0x0B333C" />
					</mx:HBox>
                    <mx:HBox visible="false" includeInLayout="false" height="0">
						<mx:Label width="150" text="Oid" />
						<mx:TextArea width="300" height="18" id="PER_oid_GUI" change="recordUpdated = true" editable="false"/>
					</mx:HBox>
					<mx:HBox>
						<mx:Label width="150" text="Priorité" />
						<mx:TextArea width="100" height="18" id="PER_priorite_GUI" change="toggleUpdate(true)" fontWeight="bold" />
					</mx:HBox>
                    <mx:VBox width="100%"  height="100%">
                        <mx:HBox width="100%">
                            <mx:Label width="150" text="Listes de codes" />
                            <mx:CheckBox id="PER_RH_Qliste_service_GUI" label="Service" 
                                    enabled="{PER_RH_liste_service_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_specialite_GUI" label="Spécialité" 
                                    enabled="{PER_RH_liste_specialite_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_section_analytique_GUI" label="Section" 
                                    enabled="{PER_RH_liste_section_analytique_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_section_analytique_paie_GUI" label="Section Paie" 
                                    enabled="{PER_RH_liste_section_analytique_paie_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_grille_GUI" label="Grille" 
                                    enabled="{PER_RH_liste_grille_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_qualification_GUI" label="Qualification" 
                                    enabled="{PER_RH_liste_qualification_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_categorie_socio_professionnelle_GUI" label="Categorie SocPro" 
                                    enabled="{PER_RH_liste_categorie_socio_professionnelle_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_statut_GUI" label="Statut" 
                                    enabled="{PER_RH_liste_statut_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_code_emploi_GUI" label="Code emploi" 
                                    enabled="{PER_RH_liste_code_emploi_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_etablissement_GUI" label="Finess" 
                                    enabled="{PER_RH_liste_etablissement_GUI.text == ''}" />
                            <mx:CheckBox id="PER_RH_Qliste_finess_GUI" label="Finess" 
                                    enabled="{PER_RH_liste_finess_GUI.text == ''}" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_service_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_service_GUI.selected}">
                            <mx:Label width="150" text="Services" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_service_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_specialite_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_specialite_GUI.selected}">
                            <mx:Label width="150" text="Spécialités" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_specialite_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_section_analytique_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_section_analytique_GUI.selected}">
                            <mx:Label width="150" text="Sections" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_section_analytique_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_grille_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_grille_GUI.selected}">
                            <mx:Label width="150" text="Grilles" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_grille_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_section_analytique_paie_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_section_analytique_paie_GUI.selected}">
                            <mx:Label width="150" text="Sections Paie" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_section_analytique_paie_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_qualification_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_qualification_GUI.selected}">
                            <mx:Label width="150" text="Qualifications" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_qualification_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_code_emploi_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_code_emploi_GUI.selected}">
                            <mx:Label width="150" text="Codes emploi" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_code_emploi_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_categorie_socio_professionnelle_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_categorie_socio_professionnelle_GUI.selected}">
                            <mx:Label width="150" text="Catégories" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_categorie_socio_professionnelle_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_statut_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_statut_GUI.selected}">
                            <mx:Label width="150" text="Statut" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_statut_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_etablissement_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_etablissement_GUI.selected}">
                            <mx:Label width="150" text="Etablissements" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_etablissement_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                        <mx:HBox width="100%" height="100%"
                            visible="{PER_RH_Qliste_finess_GUI.selected}" 
                            includeInLayout="{PER_RH_Qliste_finess_GUI.selected}">
                            <mx:Label width="150" text="Finess" />
                            <mx:TextArea width="100%" height="100%" id="PER_RH_liste_finess_GUI" change="toggleUpdate(true)" fontWeight="bold" />
                        </mx:HBox>
                    </mx:VBox>
				</mx:VBox>
            </mx:VDividedBox>
            <mx:VDividedBox id="EXC_mainBox" width="100%" height="100%" visible="false">

				<mx:DataGrid id="EXC_list_GUI" rowHeight="20" headerHeight="40"
					rowCount="{list_collection.length + 1}" height="100%" width="100%"
					wordWrap="false" dataProvider="{list_collection}" 
					fontFamily="tahoma"
					itemClick="getRecordExpert(event)" 
					selectable="{!recordUpdated}"
					visible="{EXC_mode == 0}" includeInLayout="{EXC_mode == 0}"
					>
					<mx:columns>
						<mx:DataGridColumn resizable="false" sortable="false"  headerText="" width="15" textAlign="center"  editable="false" headerWordWrap="true"
								/><!-- dataField="selected" rendererIsEditor="true"  editorDataField="result" itemRenderer="CTI.renderers.CTI_dataGridColumn_checkbox_renderer"  -->
						<mx:DataGridColumn dataField="code" headerText="Code" width="100" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="texte" headerText="Texte" width="400" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="is_active_texte" headerText="Etat" width="50" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="complement" headerText="Complément" width="70" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="prestataire_texte" headerText="Prestataire" width="65" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="gravite_texte" headerText="Gravité" width="50" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="last_execution_date" headerText="Date dernière exécution" width="85" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="last_execution_ok" headerText="Etat dernière exécution" width="75" editable="false" headerWordWrap="true" />
						<mx:DataGridColumn dataField="nbref" headerText="Nombre Références" width="60" editable="false" headerWordWrap="true" textAlign="right" />
						<!--<mx:AdvancedDataGridColumn dataField="nbref0" headerText="dont Actives" width="100" editable="false" headerWordWrap="true" textAlign="right" />-->
					</mx:columns>
				</mx:DataGrid>


				<mx:VBox id="EXC_detailBox_GUI" width="100%" height="0" backgroundColor="0xF0F0F0">
					<mx:VBox width="100%" height="100%" backgroundColor="0xF0F0F0" visible="{EXC_mode == 0 &amp;&amp; !qimport }" includeInLayout="{EXC_mode == 0 &amp;&amp; !qimport}" >
						<mx:HBox name="Barre de boutons du contrôle">
							<mx:Canvas>
								<mx:Button height="28" label="Annuler" toolTip="Annuler les modifications" icon="@Embed('../../base/swf/CTI/images/24/window-close.png')" labelPlacement="right" click="askCancel()" visible="{recordUpdated == true}" />
								<mx:Button height="28" label="Masquer" toolTip="Masquer la fiche" icon="@Embed('../../base/swf/CTI/images/24/go-up.png')" labelPlacement="right" click="hideRecord()" visible="{recordUpdated == false}" />
							</mx:Canvas>
							<mx:Canvas>
								<mx:Button height="28" label="Enregistrer" toolTip="Enregistrer les modifications" icon="@Embed('../../base/swf/CTI/images/24/dialog-ok.png')" labelPlacement="right" click="saveRecord()" visible="{recordUpdated == true &amp;&amp; EXC_code_GUI.text != ''}" />
								<mx:HBox>
									<mx:Button height="28" label="Copier" toolTip="Copier le controle" icon="@Embed('../../base/swf/CTI/images/24/edit-copy.png')" labelPlacement="right" click="copyRecord()" visible="{recordUpdated == false &amp;&amp; EXC_oid_GUI.text != '-1'}" />
									<mx:Button height="28" label="Supprimer" toolTip="Supprimer le controle" icon="@Embed('../../base/swf/CTI/images/24/user-trash.png')" labelPlacement="right" click="askDelete()" visible="{recordUpdated == false &amp;&amp; EXC_oid_GUI.text != '-1'}" />
									<mx:Button height="28" label="Exécuter" toolTip="Exécuter les règles Expert !" icon="@Embed('../../base/swf/CTI/images/24/system-upgrade.png')" labelPlacement="right" click="EXC_execute_rules(EXC_oid_GUI.text)" visible="{recordUpdated == false &amp;&amp; EXC_code_GUI.text != '' &amp;&amp; EXC_oid_GUI.text != '-1'}" enabled="{EXC_is_active_GUI.selected}"  />
									<mx:Button height="28" label="Effacer historique" toolTip="Effacer historique" icon="@Embed('../../base/swf/CTI/images/24/window-close.png')" labelPlacement="right" click="askPurge()"  visible="{recordUpdated == false &amp;&amp; EXC_code_GUI.text != '' &amp;&amp; EXC_oid_GUI.text != '-1'}"  />
									<mx:Button height="28" label="Script SQL" toolTip="Script SQL" icon="@Embed('../../base/swf/CTI/images/sql24.png')" labelPlacement="right" click="EXC_getSQL(EXC_oid_GUI.text)"  visible="{recordUpdated == false &amp;&amp; EXC_code_GUI.text != '' &amp;&amp; EXC_oid_GUI.text != '-1'}"  />
								</mx:HBox>
							</mx:Canvas>
						</mx:HBox>
						
						<mx:HBox width="100%">
							<mx:Label width="150" text="Code" />
							<mx:TextArea width="200" height="18" id="EXC_code_GUI" change="toggleUpdate(true)" fontWeight="bold" />
							<mx:Spacer width="100" />
							<mx:CheckBox id="EXC_is_cti_GUI" label="CTI ?" labelPlacement="left" change="toggleUpdate(true)" />
						</mx:HBox>

						<mx:TabNavigator width="100%" height="100%">
							<mx:VBox label="Définition" width="100%" height="100%">
								<mx:Form width="100%">
									<mx:FormItem label="Contrôle activé" width="100%">
										<mx:CheckBox id="EXC_is_active_GUI" change="toggleUpdate(true)" />
									</mx:FormItem>
									<mx:FormItem label="Texte" width="100%">
										<mx:TextArea width="500" height="36" id="EXC_texte_GUI" change="toggleUpdate(true)" fontWeight="bold" enabled="{EXC_is_active_GUI.selected}" />
									</mx:FormItem>
									<mx:FormItem label="Texte affiché" width="100%">
										<mx:TextArea width="500" height="20" id="EXC_texte_court_GUI" change="toggleUpdate(true)" fontWeight="bold" enabled="{EXC_is_active_GUI.selected}" />
									</mx:FormItem>
									<mx:FormItem label="Texte abrégé" width="100%">
										<mx:TextArea width="250" height="20" id="EXC_texte_abrege_GUI" change="toggleUpdate(true)" fontWeight="bold" enabled="{EXC_is_active_GUI.selected}" />
									</mx:FormItem>
									<mx:FormItem label="Prestataire" width="100%" direction="horizontal">
										<mx:ComboBox id="EXC_prestataire_GUI" width="150" dataProvider="{_prestataire_collection}" change="toggleUpdate(true)" rowCount="7" enabled="{EXC_is_active_GUI.selected}" />
										<mx:Label width="100%" text="Contrôle spécifique à un prestataire particulier" fontStyle="italic" enabled="{EXC_is_active_GUI.selected}" />
									</mx:FormItem>
									<mx:FormItem label="Gravité" width="100%">
										<mx:ComboBox id="EXC_gravite_GUI" width="150" dataProvider="{EXC_gravite_provider}" change="toggleUpdate(true)" enabled="{EXC_is_active_GUI.selected}" />
									</mx:FormItem>
									<mx:FormItem label="Alerte" width="100%">
										<mx:CheckBox id="EXC_is_alert_GUI" change="toggleUpdate(true)" enabled="{EXC_is_active_GUI.selected}"/>
									</mx:FormItem>
									<mx:FormItem label="Masquer contrôle" width="100%" visible="false" includeInLayout="false">
										<mx:CheckBox id="EXC_is_hide_GUI" change="toggleUpdate(true)" />
									</mx:FormItem>
									<mx:FormItem label="Oid" visible="false" includeInLayout="false" width="100%">
										<mx:TextArea width="300" height="18" id="EXC_oid_GUI" change="toggleUpdate(true)" editable="false" />
									</mx:FormItem>
								</mx:Form>
							</mx:VBox>
							<mx:VBox label="Règle 1" width="100%" height="100%" enabled="{EXC_is_active_GUI.selected}">
								<mx:Form width="100%" height="100%">
									<mx:FormItem label="Données" width="100%">
										<mx:ComboBox id="EXC_table1_GUI" dataProvider="{EXC_table_provider}" change="toggleUpdate(true)" />
										 <!-- @todo Message Ã  adapter Ã  RH si cet avertissement a du sens dans RH.
										<mx:Label width="100%" text="Attention ! Les champs sejour_id, no_sejour et date_sortie doivent quand mÃªme apparaÃ®tre dans le SELECT" fontStyle="italic" visible="{EXC_table1_GUI.selectedItem.data == '99'}" includeInLayout="{EXC_table1_GUI.selectedItem.data == '99'}" /> -->
									</mx:FormItem>
									<mx:FormItem label="Sélection" width="100%" height="100%">
										<mx:TextArea width="100%" height="100%" id="EXC_sqlcmd_where1_GUI" change="toggleUpdate(true)" fontWeight="bold" />
									</mx:FormItem>
									<mx:FormItem label="Justificatif" width="100%">
										<mx:TextArea width="100%" height="36" id="EXC_sqlcmd_justificatif1_GUI" change="toggleUpdate(true)" fontWeight="bold" />
									</mx:FormItem>
									<mx:FormItem label="Oid" width="100%" visible="false" includeInLayout="false">
										<mx:TextArea id="EXC_rule_oid1_GUI" />
									</mx:FormItem>
								</mx:Form>
							</mx:VBox>
							<mx:VBox label="Description" width="100%" height="100%" enabled="{EXC_is_active_GUI.selected}">
									<mx:RichTextEditor width="100%" height="100%" id="EXC_description_GUI" change="toggleUpdate(true)"  />
							</mx:VBox>
						</mx:TabNavigator>
					</mx:VBox>
					
					<mx:VBox width="100%" height="100%" backgroundColor="0xF0F0F0" visible="{EXC_mode == 2 &amp;&amp; !qimport}" includeInLayout="{EXC_mode == 2 &amp;&amp; !qimport}">
						<mx:HBox>
							<mx:Canvas>
								<mx:Button height="28" label="Annuler" toolTip="Annuler les modifications" icon="@Embed('../../base/swf/CTI/images/24/window-close.png')" labelPlacement="right" click="askCancel()" visible="{recordUpdated == true}" />
								<mx:Button height="28" label="Masquer" toolTip="Masquer" icon="@Embed('../../base/swf/CTI/images/24/go-up.png')" labelPlacement="right" click="hideRecord()" visible="{recordUpdated == false}" />
							</mx:Canvas>
							<mx:Canvas>
								<mx:Button height="28" label="Enregistrer" toolTip="Enregistrer les modifications" icon="@Embed('../../base/swf/CTI/images/24/dialog-ok.png')" labelPlacement="right" click="saveRecord()" visible="{recordUpdated == true}" />
							</mx:Canvas>
						</mx:HBox>
						
						<mx:Form width="100%" height="100%">
							<mx:FormItem label="Activer Expert" width="100%">
								<mx:CheckBox id="EXC_EXPERT_ACTIVE_GUI" width="100" change="toggleUpdate(true)" />
							</mx:FormItem>
							<mx:FormItem label="Date démarrage" width="100%" height="100%" direction="horizontal" enabled="{EXC_EXPERT_ACTIVE_GUI.selected}">
								<mx:DateField width="100" 
								id="EXC_EXPERT_DATE_DEBUT_GUI" 
								change="toggleUpdate(true)" fontWeight="bold"
								formatString = "DD/MM/YYYY"
								firstDayOfWeek="1"
								dayNames="['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa']"
								monthNames="['Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai',
								'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre',
								'Decembre']"
								/>
								<mx:Label width="100%" text="Date de début des données Ã  contrôler." />
							</mx:FormItem>
						</mx:Form>
					</mx:VBox>
				
				</mx:VBox>
				
				<mx:VBox label="Import depuis l'environnement de réfèrence" 
					width="100%" height="100%" visible="{EXC_mode == 0 &amp;&amp; qimport}" includeInLayout="{EXC_mode == 0 &amp;&amp; qimport}">
					<mx:Label text="Import depuis l'environnement de référence" fontWeight="bold" fontSize="14" />
					<mx:HBox>
						<mx:Canvas>
							<mx:Button height="28" label="Masquer" toolTip="Masquer les références" icon="@Embed('../../base/swf/CTI/images/24/go-up.png')" labelPlacement="right" click="hideRefSettings()" />
						</mx:Canvas>
						<mx:Button height="28" label="Importer" toolTip="Importer la sélection" icon="@Embed('../../base/swf/CTI/images/24/edit-copy.png')" labelPlacement="right" click="copyRefSettings()"  />
					</mx:HBox>
					<mx:DataGrid id="EXC_reflist_GUI" rowHeight="20" headerHeight="40"
						rowCount="{list_collection.length + 1}" height="100%" width="100%"
						wordWrap="false" dataProvider="{ref_list_collection}" 
						fontFamily="tahoma" editable="true"
						>
						<mx:columns>
							<mx:DataGridColumn resizable="false" sortable="false" dataField="selected" headerText="" width="15" textAlign="center"  editable="true" headerWordWrap="true"
									rendererIsEditor="true"  editorDataField="result" itemRenderer="CTI.renderers.CTI_dataGridColumn_checkbox_renderer" />
							<mx:DataGridColumn dataField="code" headerText="Code" width="100" editable="false" headerWordWrap="true" />
							<mx:DataGridColumn dataField="texte" headerText="Texte" width="400" editable="false" headerWordWrap="true" />
							<mx:DataGridColumn dataField="texte_abrege" headerText="Abrégé" width="100" editable="false" headerWordWrap="true" />
							<mx:DataGridColumn dataField="complement" headerText="Complément" width="100" editable="false" headerWordWrap="true" />
							<mx:DataGridColumn dataField="gravite_texte" headerText="Gravité" width="50" editable="false" headerWordWrap="true" />
							<mx:DataGridColumn dataField="ok" headerText="Différence" width="100" editable="false" headerWordWrap="true" />
						</mx:columns>
					</mx:DataGrid>
				</mx:VBox>
			</mx:VDividedBox>
				
			<mx:VDividedBox id="mainBox" width="100%" height="100%" visible="false">
				<mx:AdvancedDataGrid id="list_GUI" height="100%" width="100%"
					wordWrap="false" dataProvider="{list_collection}"
					itemClick="getRecord()"
                    sortExpertMode="true"
					selectable="{!recordUpdated}">
					<mx:groupedColumns>
						<mx:AdvancedDataGridColumn dataField="code" headerText="Code" width="100"  editable="false" headerWordWrap="true" visible="{tableCode != 'TRF'}"/>
						<mx:AdvancedDataGridColumn dataField="texte_date" headerText="Période" width="200"  editable="false" headerWordWrap="true" visible="{tableCode == 'TRF'}"/>
						<mx:AdvancedDataGridColumn dataField="texte_from" headerText="De" width="400"  editable="false" headerWordWrap="true" visible="{tableCode == 'TRF'}"/>
						<mx:AdvancedDataGridColumn dataField="texte_to" headerText="Vers" width="400"  editable="false" headerWordWrap="true" visible="{tableCode == 'TRF'}"/>
						<mx:AdvancedDataGridColumn dataField="texte" headerText="Texte" width="200"  editable="false" headerWordWrap="true"/>
						<mx:AdvancedDataGridColumn dataField="texte_court" headerText="Texte court" width="100"  editable="false" headerWordWrap="true" visible="{texte_court_is_visible &amp;&amp; tableCode != 'RUB'}"/>
						<mx:AdvancedDataGridColumn dataField="service_paie_associe_texte" headerText="Service (code paie) associé" width="400"  editable="false" headerWordWrap="true" visible="{tableCode == 'PSE'}"/>
						<mx:AdvancedDataGridColumn dataField="qualification_paie_associe_texte" headerText="Qualification (code paie) associée" width="400"  editable="false" headerWordWrap="true" visible="{tableCode == 'PQU'}"/>
						<mx:AdvancedDataGridColumn dataField="code_original" headerText="Code original" width="100"  editable="false" headerWordWrap="true" visible="{tableCode != 'DIV' &amp;&amp; tableCode != 'TRF' &amp;&amp; tableCode != 'RUB' &amp;&amp; tableCode != 'DPR'}"/>
						<mx:AdvancedDataGridColumn dataField="code_calcul" headerText="Code calcul" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}"/>
						<mx:AdvancedDataGridColumn dataField="unite" headerText="Unite" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}"/>
						<mx:AdvancedDataGridColumn dataField="coefficient" headerText="Coefficient" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}"/>
                        <mx:AdvancedDataGridColumn dataField="coefficient_base" headerText="Coeff. Base" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}"/>
                        <mx:AdvancedDataGridColumn dataField="coefficient_nombre" headerText="Coeff. Nombre" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}"/>

                        <mx:AdvancedDataGridColumnGroup headerText="Global">
                            <mx:AdvancedDataGridColumn dataField="user_modified" headerText="M" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="p_cumul" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="p_detail" headerText="D" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Nombre">
    						<!-- <mx:AdvancedDataGridColumn dataField="p_nombre" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_nombre" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_nombre" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Base">
    						<!-- <mx:AdvancedDataGridColumn dataField="p_base" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_base" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_base" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Heures C.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_heures_contrat" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_heures_contrat" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_heures_contrat" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Heures P.">
						    <!-- <mx:AdvancedDataGridColumn dataField="p_heures_payees" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_heures_payees" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_heures_payees" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Heures W.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_heures_travaillees" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_heures_travaillees" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_heures_travaillees" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Masse Sal.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_masse_salariale" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_masse_salariale" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_masse_salariale" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Brut">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_brut" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_brut" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_brut" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Avt. Nat.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_avantage_nature" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_avantage_nature" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_avantage_nature" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Frais Imp.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_frais_imposables" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_frais_imposables" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_frais_imposables" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Cot. Sal.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_cotisation_salarie" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_cotisation_salarie" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_cotisation_salarie" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Cot. Pat.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_cotisation_patronale" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_cotisation_patronale" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_cotisation_patronale" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="OD/Net Sal.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_od_net_salarie" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_od_net_salarie" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_od_net_salarie" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="OD/Net Pat.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_od_net_patronale" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_od_net_patronale" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_od_net_patronale" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Net Imp.">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_net_imposable" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_net_imposable" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_net_imposable" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>
                        <mx:AdvancedDataGridColumnGroup headerText="Net à payer">
                            <!-- <mx:AdvancedDataGridColumn dataField="p_net_a_payer" headerText="X" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/> -->
                            <mx:AdvancedDataGridColumn dataField="s_net_a_payer" headerText="S" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                            <mx:AdvancedDataGridColumn dataField="c_net_a_payer" headerText="C" width="25"  editable="false" headerWordWrap="true" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}"/>
                        </mx:AdvancedDataGridColumnGroup>

						<mx:AdvancedDataGridColumn dataField="base_calcul_etp" headerText="Base calcul ETP" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'ETA'}"/>
                        <mx:AdvancedDataGridColumn dataField="code_ets_planning" headerText="Code Planning" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'ETA'}"/>
                        <mx:AdvancedDataGridColumn dataField="code_ent_planning" headerText="Code Planning" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'ENT'}"/>
						<mx:AdvancedDataGridColumn dataField="valeur" headerText="Valeur" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'DIV'}"/>
						<mx:AdvancedDataGridColumn dataField="valeur_date" headerText="Valeur date" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'DIV'}"/>
						<mx:AdvancedDataGridColumn dataField="description" headerText="Description" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'DIV'}"/>
                        <mx:AdvancedDataGridColumn dataField="regles" headerText="Règles" minWidth="400"  editable="false" headerWordWrap="true" visible="{tableCode == 'DPR'}"/>
                                                <mx:AdvancedDataGridColumn dataField="show_info_module" headerText="Info Module" width="100"  editable="false" headerWordWrap="true" visible="{tableCode == 'DIV'}"/>
						<mx:AdvancedDataGridColumn dataField="regles" headerText="Règles" minWidth="400"  editable="false" headerWordWrap="true" visible="{tableCode == 'DPR'}"/>
					</mx:groupedColumns>
				</mx:AdvancedDataGrid>
				<mx:VBox id="detailBox_GUI" width="100%"  height="0" backgroundColor="0xFFFFFF">
					<mx:HBox>
						<mx:Canvas>
							<mx:Button height="28" label="Annuler" toolTip="Annuler les modifications" icon="@Embed('../../base/swf/CTI/images/24/window-close.png')" labelPlacement="right" click="askCancel()" visible="{recordUpdated == true}" />
							<mx:Button height="28" label="Masquer" toolTip="Masquer la fiche" icon="@Embed('../../base/swf/CTI/images/24/go-up.png')" labelPlacement="right" click="hideRecord()" visible="{recordUpdated == false}" />
						</mx:Canvas>
						<mx:Canvas>
							<mx:Button height="28" label="Enregistrer" toolTip="Enregistrer les modifications" icon="@Embed('../../base/swf/CTI/images/24/dialog-ok.png')" labelPlacement="right" click="saveRecord()" visible="{recordUpdated == true &amp;&amp; (code_GUI.text != '' || tableCode == 'TRF')}" />
							<mx:HBox>
								<mx:Button height="28" label="Supprimer" toolTip="Supprimer" icon="@Embed('../../base/swf/CTI/images/24/user-trash.png')" labelPlacement="right" click="askDelete()" visible="{recordUpdated == false &amp;&amp; (tableCode == 'TRF' || tableCode == 'DPR') &amp;&amp; nbref_GUI.text != '-1'}" />
							</mx:HBox>
						</mx:Canvas>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode != 'TRF'}" includeInLayout="{tableCode != 'TRF'}">
						<mx:Label width="150" text="Code" />
						<mx:TextArea width="100" height="18" id="code_GUI" change="recordUpdated = true" editable="{tableCode == 'DPR'}"/>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode != 'DIV' &amp;&amp; tableCode != 'TRF' &amp;&amp; tableCode != 'DPR'}" includeInLayout="{tableCode != 'DIV' &amp;&amp; tableCode != 'TRF' &amp;&amp; tableCode != 'DPR'}">
						<mx:Label width="150" text="Code original" />
						<mx:TextArea width="300" height="18" id="code_original_GUI" change="recordUpdated = true" editable="false" />
					</mx:HBox>
					<mx:HBox verticalAlign="middle" >
						<mx:Label width="150" text="Texte" />
						<mx:TextArea width="300" height="18" id="texte_GUI" change="recordUpdated = true" fontWeight="bold"/>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{texte_court_is_visible}" includeInLayout="{texte_court_is_visible}">
						<mx:Label width="150" text="Texte_court" />
						<mx:TextArea width="300" height="18" id="texte_court_GUI" change="recordUpdated = true" fontWeight="bold" />
					</mx:HBox>
                    <mx:HBox verticalAlign="middle" visible="{tableCode == 'RUB'}" includeInLayout="{tableCode == 'RUB'}">
                        <mx:CheckBox id="proratiser_conversion_GUI" label="Proratiser la conversion j-&gt;h selon le temps de travail" change="recordUpdated = true"/>
                    </mx:HBox>
                    <mx:HBox verticalAlign="middle" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}" includeInLayout="{tableCode == 'RUB' &amp;&amp; optStdHp}">
                        <mx:CheckBox id="p_cumul_GUI" label="Cumul" change="recordUpdated = true"/>
                        <mx:CheckBox id="p_detail_GUI" label="Détail" change="recordUpdated = true"/>
                        <mx:CheckBox id="user_modified_GUI" label="(Modifié par l'utilisateur)" change="recordUpdated = true"/>
                    </mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'RUB' &amp;&amp; optStdHp}" includeInLayout="{tableCode == 'RUB' &amp;&amp; optStdHp}">
                        <mx:VBox width="100%"  height="100%" horizontalAlign="center">
                            <mx:VBox width="100%"  height="100%" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
        						<mx:CheckBox id="p_nombre_GUI" label="Nombre" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_nombre_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_nombre_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_nombre_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_nombre_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_masse_salariale_GUI" label="Masse salariale" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_masse_salariale_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_masse_salariale_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_masse_salariale_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_masse_salariale_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%" height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_cotisation_patronale_GUI" label="Cotisation patronale" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_cotisation_patronale_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_cotisation_patronale_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_cotisation_patronale_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_cotisation_patronale_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_tx_cotisation_patronale_GUI" change="recordUpdated = true" restrict="0-9\.\-" toolTip="Coefficient à appliquer au taux de cotisation patronale" enabled="{p_cotisation_patronale_GUI.selected}"/>
                            </mx:VBox>
                        </mx:VBox>
                        <mx:VBox width="100%"  height="100%" horizontalAlign="center">
                            <mx:VBox width="100%"  height="100%" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_base_GUI" label="Base" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_base_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_base_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_base_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_base_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_brut_GUI" label="Brut" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_brut_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_brut_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_brut_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_brut_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_od_net_salarie_GUI" label="OD/Net salarie" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_od_net_salarie_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_od_net_salarie_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_od_net_salarie_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_od_net_salarie_GUI.selected}"/>
                            </mx:VBox>
                        </mx:VBox>
                        <mx:VBox width="100%"  height="100%" horizontalAlign="center">
                            <mx:VBox width="100%"  height="100%" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_heures_contrat_GUI" label="Heures contrat" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_heures_contrat_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_heures_contrat_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_heures_contrat_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_heures_contrat_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_avantage_nature_GUI" label="Avantage nature" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_avantage_nature_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_avantage_nature_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_avantage_nature_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_avantage_nature_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_od_net_patronale_GUI" label="OD/Net patronale" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_od_net_patronale_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_od_net_patronale_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_od_net_patronale_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_od_net_patronale_GUI.selected}"/>
                            </mx:VBox>
                        </mx:VBox>
                        <mx:VBox width="100%"  height="100%" horizontalAlign="center">
                            <mx:VBox width="100%"  height="100%" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_heures_payees_GUI" label="Heures payées" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_heures_payees_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_heures_payees_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_heures_payees_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_heures_payees_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_frais_imposables_GUI" label="Frais imposables" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_frais_imposables_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_frais_imposables_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_frais_imposables_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_frais_imposables_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_net_imposable_GUI" label="Net imposable" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_net_imposable_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_net_imposable_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_net_imposable_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_net_imposable_GUI.selected}"/>
                            </mx:VBox>
                        </mx:VBox>
                        <mx:VBox width="100%"  height="100%" horizontalAlign="center">
                            <mx:VBox width="100%"  height="100%" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_heures_travaillees_GUI" label="Heures travaillées" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_heures_travaillees_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_heures_travaillees_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_heures_travaillees_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_heures_travaillees_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_cotisation_salarie_GUI" label="Cotisation salarie" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_cotisation_salarie_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_cotisation_salarie_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_cotisation_salarie_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_cotisation_salarie_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_tx_cotisation_salarie_GUI" change="recordUpdated = true" restrict="0-9\.\-" toolTip="Coefficient à appliquer au taux de cotisation salariale" enabled="{p_cotisation_salarie_GUI.selected}"/>
                            </mx:VBox>
                            <mx:VBox width="100%"  height="110" horizontalAlign="center" backgroundColor="0xFFFFFF" enabled="{p_cumul_GUI.selected || p_detail_GUI.selected}">
                                <mx:CheckBox id="p_net_a_payer_GUI" label="Net à payer" change="recordUpdated = true"/>
                                <mx:ComboBox width="100" id="s_net_a_payer_GUI" change="recordUpdated = true" dataProvider="{rubSource}" enabled="{p_net_a_payer_GUI.selected}"/>
                                <mx:TextInput width="100" id="c_net_a_payer_GUI" change="recordUpdated = true" restrict="0-9\.\-" enabled="{p_net_a_payer_GUI.selected}"/>
                            </mx:VBox>
                        </mx:VBox>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'DIV'}" includeInLayout="{tableCode == 'DIV'}" >
						<mx:Label width="150" text="Valeur" />
						<mx:TextArea width="300" height="18" id="valeur_GUI" change="recordUpdated = true" fontWeight="bold" />
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'DIV'}" includeInLayout="{tableCode == 'DIV'}">
						<mx:Label width="150" text="Valeur date" />
						<mx:TextArea width="300" height="18" id="valeur_date_GUI" change="recordUpdated = true" fontWeight="bold" />
					</mx:HBox>
                    <mx:HBox verticalAlign="middle" visible="{tableCode == 'DIV'}" includeInLayout="{tableCode == 'DIV'}">
                        <mx:Label width="150" text="Info Module" />
                        <mx:CheckBox width="300" height="18" id="show_info_module_GUI" change="recordUpdated = true" />
                    </mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'ETA'}" includeInLayout="{tableCode == 'ETA'}">
						<mx:Label width="150" text="Base calcul ETP" />
						<mx:TextInput width="80" id="base_calcul_etp_GUI" change="recordUpdated = true" restrict="0-9\,\-" />
					</mx:HBox>
                    <mx:HBox verticalAlign="middle" visible="{tableCode == 'ETA'}" includeInLayout="{tableCode == 'ETA'}">
                        <mx:Label width="150" text="Code Planning" />
                        <mx:TextInput width="80" id="code_ets_planning_GUI" change="recordUpdated = true" />
                    </mx:HBox>
                    <mx:HBox verticalAlign="middle" visible="{tableCode == 'ETA'}" includeInLayout="{tableCode == 'ETA'}">
						<mx:Label width="150" text="Etablissement" />
						<mx:ComboBox id="ETA_finess_id_GUI"  width="300" labelField="@texte" change="recordUpdated = true" />
					</mx:HBox>
                    <mx:HBox verticalAlign="middle" visible="{tableCode == 'ENT'}" includeInLayout="{tableCode == 'ENT'}">
                        <mx:Label width="150" text="Code Planning" />
                        <mx:TextInput width="80" id="code_ent_planning_GUI" change="recordUpdated = true" />
                    </mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}" includeInLayout="{tableCode == 'RUB' &amp;&amp; !optStdHp}">
						<mx:Label width="150" text="Code calcul"/>
						<mx:ComboBox width="200" id="code_calcul_GUI" change="recordUpdated = true" dataProvider="{calculCodeList}"/>
						<mx:HBox visible="{tableCode == 'RUB' &amp;&amp; code_calcul_GUI.selectedIndex > 0}" verticalAlign="middle">
							<mx:Label width="35" text="Unité"/>
							<mx:ComboBox width="80" id="unite_GUI" change="recordUpdated = true" dataProvider="{uniteList}"/>
						</mx:HBox>
						<mx:HBox visible="{tableCode == 'RUB' &amp;&amp; code_calcul_GUI.selectedIndex > 0 &amp;&amp; unite_GUI.selectedIndex > 0}" verticalAlign="middle">
							<mx:Label width="70" text="Coefficient"/>
							<mx:TextInput width="80" id="coefficient_GUI" change="recordUpdated = true" restrict="0-9\.\-"/>
						</mx:HBox>
					</mx:HBox>
                    <mx:HBox verticalAlign="middle" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}" includeInLayout="{tableCode == 'RUB' &amp;&amp; !optStdHp}">
						<mx:Label width="150" text="Coefficient base"/>
						<mx:TextInput width="80" id="coefficient_base_GUI" change="recordUpdated = true" restrict="0-9\.\-"/>
                        <mx:Label width="150" text="Coefficient nombre"/>
                        <mx:TextInput width="80" id="coefficient_nombre_GUI" change="recordUpdated = true" restrict="0-9\.\-"/>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'RUB' &amp;&amp; !optStdHp}" includeInLayout="{tableCode == 'RUB'}">
						<mx:Label width="150" text="Coefficient taux salarial"/>
						<mx:TextInput width="80" id="coefficient_txs_GUI" change="recordUpdated = true" restrict="0-9\.\-"/>
						<mx:Label width="150" text="Coefficient taux patronal"/>
						<mx:TextInput width="80" id="coefficient_txp_GUI" change="recordUpdated = true" restrict="0-9\.\-"/>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'PSE'}" includeInLayout="{tableCode == 'PSE'}">
						<mx:HBox>
							<mx:Label width="150" text="Code service paie associé" />
							<mx:ComboBox id="PSE_service_id_GUI" width="400" labelField="@texte" change="recordUpdated = true"/>
						</mx:HBox>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="{tableCode == 'PQU'}" includeInLayout="{tableCode == 'PQU'}">
						<mx:HBox>
							<mx:Label width="150" text="Code qualification paie associé" />
							<mx:ComboBox id="PQU_qualification_id_GUI" width="400" labelField="@texte" change="recordUpdated = true"/>
						</mx:HBox>
					</mx:HBox>
					<mx:VBox width="100%" verticalAlign="middle" visible="{tableCode == 'TRF'}" includeInLayout="{tableCode == 'TRF'}">
						<mx:HBox>
							<mx:Label width="150" text="Période" />
							<mx:ComboBox id="TRF_date_debut_GUI" width="180" labelField="@texte" change="recordUpdated = true"/>
							<mx:ComboBox id="TRF_date_fin_GUI" width="180" labelField="@texte" change="recordUpdated = true"/>
						</mx:HBox>
						<mx:HBox width="100%">
							<mx:VBox width="50%">
								<mx:Label width="150" text="Source" fontWeight="bold" />
								<mx:HBox>
									<mx:Label width="150" text="Salarié" />
									<mx:ComboBox id="TRF_salarie_id_GUI" width="400" labelField="@texte" change="recordUpdated = true"/>
								</mx:HBox>
								<mx:HBox>
									<mx:Label width="150" text="Service" />
									<mx:ComboBox id="TRF_from_service_id_GUI" width="400" labelField="@texte" change="recordUpdated = true"/>
								</mx:HBox>
								<mx:HBox>
									<mx:Label width="150" text="Qualification" />
									<mx:ComboBox id="TRF_from_qualification_id_GUI" width="400" labelField="@texte" change="recordUpdated = true"/>
								</mx:HBox>
							</mx:VBox>
							<mx:VBox width="50%">
								<mx:Label width="150" text="Cible" fontWeight="bold" />
								<mx:HBox>
									<mx:Label width="150" text="" />
								</mx:HBox>
								<mx:HBox>
									<mx:Label width="150" text="Service" />
									<mx:ComboBox id="TRF_to_service_id_GUI" width="400" labelField="@texte" change="recordUpdated = true"/>
								</mx:HBox>
								<mx:HBox>
									<mx:Label width="150" text="Qualification" />
									<mx:ComboBox id="TRF_to_qualification_id_GUI" width="400" labelField="@texte" change="recordUpdated = true"/>
								</mx:HBox>
							</mx:VBox>
						</mx:HBox>
					</mx:VBox>
					<mx:VBox width="100%" verticalAlign="middle" visible="{tableCode == 'DPR'}" includeInLayout="{tableCode == 'DPR'}">
						<mx:Spacer height="20" />
						<mx:Label width="150" text="Règles :" fontWeight="bold" />
						<mx:HBox>
							<mx:Label width="150" text="Etablissements" />
							<mx:Label width="40" text="Inclus" />
							<mx:TextArea width="300" height="18" id="DPR_etablissement_inclus_GUI" change="recordUpdated = true" fontWeight="bold" />
							<mx:Label width="40" text="Exclus" />
							<mx:TextArea width="300" height="18" id="DPR_etablissement_exclus_GUI" change="recordUpdated = true" fontWeight="bold" />
						</mx:HBox>
						<mx:HBox>
							<mx:Label width="150" text="Services" />
							<mx:Label width="40" text="Inclus" />
							<mx:TextArea width="300" height="18" id="DPR_service_inclus_GUI" change="recordUpdated = true" fontWeight="bold" />
							<mx:Label width="40" text="Exclus" />
							<mx:TextArea width="300" height="18" id="DPR_service_exclus_GUI" change="recordUpdated = true" fontWeight="bold" />
						</mx:HBox>
						<mx:HBox>
							<mx:Label width="150" text="Statuts" />
							<mx:Label width="40" text="Inclus" />
							<mx:TextArea width="300" height="18" id="DPR_statut_inclus_GUI" change="recordUpdated = true" fontWeight="bold" />
							<mx:Label width="40" text="Exclus" />
							<mx:TextArea width="300" height="18" id="DPR_statut_exclus_GUI" change="recordUpdated = true" fontWeight="bold" />
						</mx:HBox>
					</mx:VBox>
					<mx:HBox verticalAlign="middle" visible="false" includeInLayout="false">
						<mx:Label width="150" text="Oid" />
						<mx:TextArea width="300" height="18" id="oid_GUI" change="recordUpdated = true" editable="false"/>
					</mx:HBox>
					<mx:HBox verticalAlign="middle" visible="false" includeInLayout="false">
						<mx:Label width="150" text="Nombre références" />
						<mx:TextArea width="300" height="18" id="nbref_GUI" change="recordUpdated = true" editable="false"/>
					</mx:HBox>
				</mx:VBox>
			</mx:VDividedBox>
			
		</mx:Canvas>
	</mx:VBox>
</mx:Application>