Subversion Repositories eFlore/Applications.coel

Rev

Rev 1331 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1331 Rev 1339
1
package org.tela_botanica.client.modeles.personne;
1
package org.tela_botanica.client.modeles.personne;
2
 
2
 
3
import java.util.Date;
3
import java.util.Date;
4
import java.util.Iterator;
4
import java.util.Iterator;
-
 
5
import java.util.Map;
5
import java.util.Set;
6
import java.util.Set;
6
 
7
 
7
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.modeles.aDonnee;
9
import org.tela_botanica.client.modeles.aDonnee;
9
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
10
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
10
import org.tela_botanica.client.util.Debug;
11
import org.tela_botanica.client.util.Debug;
11
import org.tela_botanica.client.util.UtilString;
12
import org.tela_botanica.client.util.UtilString;
12
 
13
 
13
import com.extjs.gxt.ui.client.data.ModelData;
14
import com.extjs.gxt.ui.client.data.ModelData;
14
import com.google.gwt.core.client.GWT;
15
import com.google.gwt.core.client.GWT;
15
import com.google.gwt.i18n.client.DateTimeFormat;
16
import com.google.gwt.i18n.client.DateTimeFormat;
16
import com.google.gwt.json.client.JSONObject;
17
import com.google.gwt.json.client.JSONObject;
17
 
18
 
18
public class Personne extends aDonnee {
19
public class Personne extends aDonnee {
19
 
20
 
20
	private static final long serialVersionUID = -6974716696155349332L;
21
	private static final long serialVersionUID = -6974716696155349332L;
21
 
22
 
22
	public static final String PREFIXE = "cp";
23
	public static final String PREFIXE = "cp";
23
	public static final String TELEPHONE_FIXE = "FIX";
24
	public static final String TELEPHONE_FIXE = "FIX";
24
	public static final String TELEPHONE_GSM = "GSM";
25
	public static final String TELEPHONE_GSM = "GSM";
25
	public static final String TELEPHONE_FAX = "FAX";
26
	public static final String TELEPHONE_FAX = "FAX";
26
	public static final String ETRE_DECEDE = "30745";
27
	public static final String ETRE_DECEDE = "30745";
27
	public static final String ETRE_VIVANT = "30746";
28
	public static final String ETRE_VIVANT = "30746";
28
	public static String[] champsObligatoires = {"cp_id_personne"};
29
	public static String[] champsObligatoires = {"cp_id_personne"};
29
	
30
	
30
	private PublicationAPersonneListe publicationsLiees= null;
31
	private PublicationAPersonneListe publicationsLiees= null;
31
	
32
	
32
	public Personne() {
33
	public Personne() {
33
	}
34
	}
34
 
35
 
35
	public Personne(ModelData model)
36
	public Personne(ModelData model)
36
	{		
37
	{
37
		this.set("id_personne", model.get("cp_id_personne"));
38
		Map<String, Object> a = model.getProperties();
-
 
39
 
38
		this.set("fmt_nom_complet", model.get("cp_fmt_nom_complet"));
40
		Set<String> cles = a.keySet();
39
		this.set("code_postal", model.get("cp_code_postal"));
41
		Iterator<String> it = cles.iterator();
-
 
42
		while (it.hasNext()) {
-
 
43
			String cle = it.next();			
40
		this.set("ville", model.get("cp_ville"));
44
			if (a.get(cle) != null) {
-
 
45
				String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
41
		this.set("truk_courriel", model.get("cp_truk_courriel"));
46
				this.set(cleObjet, a.get(cle));
-
 
47
			}
-
 
48
		}
42
	}	
49
	}	
43
	
50
	
44
	public Personne(JSONObject personne) {
51
	public Personne(JSONObject personne) {
45
		initialiserModele(personne);
52
		initialiserModele(personne);
46
		//Ajout du champ courriel principal
53
		//Ajout du champ courriel principal
47
		this.setCourrielPrinc(this.getInfoDenormaliseParPosition(this.renvoyerValeurCorrecte("truk_courriel"), 1));
54
		this.setCourrielPrinc(this.getInfoDenormaliseParPosition(this.renvoyerValeurCorrecte("truk_courriel"), 1));
48
	}
55
	}
49
	
56
	
50
	@Override
57
	@Override
51
	protected String getPrefixe() {
58
	protected String getPrefixe() {
52
		return PREFIXE;
59
		return PREFIXE;
53
	}
60
	}
54
	
61
	
55
	protected String[] getChampsObligatoires()	{
62
	protected String[] getChampsObligatoires()	{
56
		return champsObligatoires;
63
		return champsObligatoires;
57
	}
64
	}
58
	
65
	
59
	public Object obtenirValeurChamp(String nomChamp)	{
66
	public Object obtenirValeurChamp(String nomChamp)	{
60
		return renvoyerValeurCorrecte(nomChamp);
67
		return renvoyerValeurCorrecte(nomChamp);
61
	}
68
	}
62
	
69
	
63
	public Date getDate(String nomChamp)	{
70
	public Date getDate(String nomChamp)	{
64
		String strDate = renvoyerValeurCorrecte(nomChamp);
71
		String strDate = renvoyerValeurCorrecte(nomChamp);
65
		Date dateRetour = null;
72
		Date dateRetour = null;
66
		try {
73
		try {
67
			if ((strDate != null) && (!strDate.equals("0000-00-00"))) {
74
			if ((strDate != null) && (!strDate.equals("0000-00-00"))) {
68
				dateRetour = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(strDate);
75
				dateRetour = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(strDate);
69
			}
76
			}
70
		} catch (StringIndexOutOfBoundsException e)	{
77
		} catch (StringIndexOutOfBoundsException e)	{
71
			GWT.log("Impossible de parser la date " + strDate, e);
78
			GWT.log("Impossible de parser la date " + strDate, e);
72
		}
79
		}
73
		return dateRetour;		
80
		return dateRetour;		
74
	}
81
	}
75
	
82
	
76
	public String getString(String nomChamp)	{
83
	public String getString(String nomChamp)	{
77
		return String.valueOf(renvoyerValeurCorrecte(nomChamp));
84
		return String.valueOf(renvoyerValeurCorrecte(nomChamp));
78
	}
85
	}
79
	
86
	
80
	//Traitement des truks
87
	//Traitement des truks
81
	protected void remplacerTypeDansChaineDenormalise(String champ, String type, Object valeur) {
88
	protected void remplacerTypeDansChaineDenormalise(String champ, String type, Object valeur) {
82
		if (valeur != null && !valeur.equals("")) {
89
		if (valeur != null && !valeur.equals("")) {
83
			ajouterChaineDenormaliseAvecType(champ, type, valeur);
90
			ajouterChaineDenormaliseAvecType(champ, type, valeur);
84
		} else {
91
		} else {
85
			supprimerTypeDansChaineDenormalise(champ, type);
92
			supprimerTypeDansChaineDenormalise(champ, type);
86
		}
93
		}
87
	}
94
	}
88
	/**
95
	/**
89
	 * Ajoute un nouvel élément sans type à une chaine dénormalisée.
96
	 * Ajoute un nouvel élément sans type à une chaine dénormalisée.
90
	 * Champ de type "truk" contenant seulement des valeurs séparées par ";;".
97
	 * Champ de type "truk" contenant seulement des valeurs séparées par ";;".
91
	 * Si l'élément existe déjà, il ne sera pas ajouté.
98
	 * Si l'élément existe déjà, il ne sera pas ajouté.
92
	 * 
99
	 * 
93
	 * @param champ le nom du champ dénormalisé
100
	 * @param champ le nom du champ dénormalisé
94
	 * @param valeur la valeur à ajouter
101
	 * @param valeur la valeur à ajouter
95
	 */
102
	 */
96
	protected void ajouterChaineDenormalise(String champ, Object valeur) {
103
	protected void ajouterChaineDenormalise(String champ, Object valeur) {
97
		if (valeur instanceof String) {
104
		if (valeur instanceof String) {
98
			String chaineExistante = renvoyerValeurCorrecte(champ);
105
			String chaineExistante = renvoyerValeurCorrecte(champ);
99
			if (chaineExistante.equals("")) {
106
			if (chaineExistante.equals("")) {
100
				this.set(champ, valeur);
107
				this.set(champ, valeur);
101
			} else {
108
			} else {
102
				// Si la valeur à ajouter n'est pas déjà présente, nous l'ajoutons
109
				// Si la valeur à ajouter n'est pas déjà présente, nous l'ajoutons
103
				if (!chaineExistante.matches("(^|"+SEPARATEUR_VALEURS+")"+valeur+"("+SEPARATEUR_VALEURS+"|$)")) {
110
				if (!chaineExistante.matches("(^|"+SEPARATEUR_VALEURS+")"+valeur+"("+SEPARATEUR_VALEURS+"|$)")) {
104
					this.set(champ, chaineExistante+SEPARATEUR_VALEURS+valeur);
111
					this.set(champ, chaineExistante+SEPARATEUR_VALEURS+valeur);
105
				}
112
				}
106
			}
113
			}
107
		}
114
		}
108
	}
115
	}
109
	
116
	
110
	// ID PERSONNE
117
	// ID PERSONNE
111
	public String getId() {
118
	public String getId() {
112
		return renvoyerValeurCorrecte("id_personne");
119
		return renvoyerValeurCorrecte("id_personne");
113
	}
120
	}
114
	public void setId(String personneId) {
121
	public void setId(String personneId) {
115
		this.set("id_personne", personneId);
122
		this.set("id_personne", personneId);
116
	}
123
	}
117
	
124
	
118
	// ID PROJET
125
	// ID PROJET
119
	public String getIdProjet() {
126
	public String getIdProjet() {
120
		return renvoyerValeurCorrecte("ce_projet");
127
		return renvoyerValeurCorrecte("ce_projet");
121
	}
128
	}
122
	
129
	
123
	// NOM COMPLET
130
	// NOM COMPLET
124
	public String getNomComplet() {
131
	public String getNomComplet() {
125
		return renvoyerValeurCorrecte("fmt_nom_complet");
132
		return renvoyerValeurCorrecte("fmt_nom_complet");
126
	}
133
	}
127
	public void setNomComplet(String nomComplet) {
134
	public void setNomComplet(String nomComplet) {
128
		this.set("fmt_nom_complet", nomComplet);
135
		this.set("fmt_nom_complet", nomComplet);
129
	}
136
	}
130
	public void setFmtNomComplet(String prefixe, String suffixe)	{
137
	public void setFmtNomComplet(String prefixe, String suffixe)	{
131
		String fmtNomComplet = "";
138
		String fmtNomComplet = "";
132
		
139
		
133
		if ((prefixe != null)&&(!prefixe.trim().equals("")))	{
140
		if ((prefixe != null)&&(!prefixe.trim().equals("")))	{
134
			fmtNomComplet += prefixe + " ";
141
			fmtNomComplet += prefixe + " ";
135
		}
142
		}
136
		
143
		
137
		if ((this.getPrenom()!=null)&&(!this.getPrenom().trim().equals("")))	{
144
		if ((this.getPrenom()!=null)&&(!this.getPrenom().trim().equals("")))	{
138
			fmtNomComplet += this.getPrenom() + " ";
145
			fmtNomComplet += this.getPrenom() + " ";
139
		}
146
		}
140
		
147
		
141
		if ((this.getNom()!=null)&&(!this.getNom().trim().equals("")))	{
148
		if ((this.getNom()!=null)&&(!this.getNom().trim().equals("")))	{
142
			fmtNomComplet += this.getNom() + " ";
149
			fmtNomComplet += this.getNom() + " ";
143
		}
150
		}
144
		
151
		
145
		if ((suffixe!=null)&&(!suffixe.trim().equals("")))	{
152
		if ((suffixe!=null)&&(!suffixe.trim().equals("")))	{
146
			fmtNomComplet += suffixe;
153
			fmtNomComplet += suffixe;
147
		}
154
		}
148
 
155
 
149
		setNomComplet(UtilString.ucFirst(fmtNomComplet));
156
		setNomComplet(UtilString.ucFirst(fmtNomComplet));
150
	}
157
	}
151
	
158
	
152
	// NOM
159
	// NOM
153
	public String getNom() {
160
	public String getNom() {
154
		return renvoyerValeurCorrecte("nom");
161
		return renvoyerValeurCorrecte("nom");
155
	}
162
	}
156
	public void setNom(String nom) {
163
	public void setNom(String nom) {
157
		set("nom", nom);
164
		set("nom", nom);
158
	}
165
	}
159
	
166
	
160
	// PRÉNOM
167
	// PRÉNOM
161
	public String getPrenom() {
168
	public String getPrenom() {
162
		return renvoyerValeurCorrecte("prenom");
169
		return renvoyerValeurCorrecte("prenom");
163
	}
170
	}
164
	public void setPrenom(String prenom) {
171
	public void setPrenom(String prenom) {
165
		set("prenom", prenom);
172
		set("prenom", prenom);
166
	}
173
	}
167
	
174
	
168
	// TÉLÉPHONE
175
	// TÉLÉPHONE
169
	public String getTelephone() {
176
	public String getTelephone() {
170
		return renvoyerValeurCorrecte("truk_telephone");
177
		return renvoyerValeurCorrecte("truk_telephone");
171
	}
178
	}
172
	public void setTelephone(String t) {
179
	public void setTelephone(String t) {
173
		this.set("truk_telephone", t);
180
		this.set("truk_telephone", t);
174
	}
181
	}
175
	public void ajouterTelephone(String type, Object valeur) {
182
	public void ajouterTelephone(String type, Object valeur) {
176
		ajouterChaineDenormaliseAvecType("truk_telephone", type, valeur);
183
		ajouterChaineDenormaliseAvecType("truk_telephone", type, valeur);
177
	}
184
	}
178
	public String selectionnerTelephone(String type) {
185
	public String selectionnerTelephone(String type) {
179
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), type);
186
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), type);
180
	}
187
	}
181
	
188
	
182
	// FAX
189
	// FAX
183
	public String getFax() {
190
	public String getFax() {
184
		return renvoyerValeurCorrecte("truk_fax");
191
		return renvoyerValeurCorrecte("truk_fax");
185
	}
192
	}
186
	public void setFax(String f) {
193
	public void setFax(String f) {
187
		this.set("truk_fax", f);
194
		this.set("truk_fax", f);
188
	}
195
	}
189
	public void ajouterFax(Object valeur) {
196
	public void ajouterFax(Object valeur) {
190
		ajouterChaineDenormalise("truk_fax", valeur);
197
		ajouterChaineDenormalise("truk_fax", valeur);
191
	}
198
	}
192
	public String selectionnerFax(int position) {
199
	public String selectionnerFax(int position) {
193
		return getInfoDenormaliseParPosition(renvoyerValeurCorrecte("truk_fax"), position);
200
		return getInfoDenormaliseParPosition(renvoyerValeurCorrecte("truk_fax"), position);
194
	}
201
	}
195
	
202
	
196
	// COURRIEL
203
	// COURRIEL
197
	public String getCourriel() {
204
	public String getCourriel() {
198
		return renvoyerValeurCorrecte("truk_courriel");
205
		return renvoyerValeurCorrecte("truk_courriel");
199
	}
206
	}
200
	public void setCourriel(String c) {
207
	public void setCourriel(String c) {
201
		this.set("truk_courriel", c);
208
		this.set("truk_courriel", c);
202
	}
209
	}
203
	public void ajouterCourriel(String c) {
210
	public void ajouterCourriel(String c) {
204
		ajouterChaineDenormalise("truk_courriel", c);
211
		ajouterChaineDenormalise("truk_courriel", c);
205
	}
212
	}
206
	public String selectionnerCourriel(int position) {
213
	public String selectionnerCourriel(int position) {
207
		return getInfoDenormaliseParPosition(renvoyerValeurCorrecte("truk_courriel"), position);
214
		return getInfoDenormaliseParPosition(renvoyerValeurCorrecte("truk_courriel"), position);
208
	}
215
	}
209
	
216
	
210
	// SPÉCIALITÉ
217
	// SPÉCIALITÉ
211
	public String getSpecialite() {
218
	public String getSpecialite() {
212
		return renvoyerValeurCorrecte("ce_truk_specialite");
219
		return renvoyerValeurCorrecte("ce_truk_specialite");
213
	}
220
	}
214
	public void setSpecialite(String s) {
221
	public void setSpecialite(String s) {
215
		// Pas de liste pour l'instant, donc tout passe dans "Autre".
222
		// Pas de liste pour l'instant, donc tout passe dans "Autre".
216
		setChaineDenormaliseUnique("ce_truk_specialite", "AUTRE", s);
223
		setChaineDenormaliseUnique("ce_truk_specialite", "AUTRE", s);
217
	}
224
	}
218
	public String afficherSpecialite() {
225
	public String afficherSpecialite() {
219
		return getChaineDenormaliseUnique("ce_truk_specialite");
226
		return getChaineDenormaliseUnique("ce_truk_specialite");
220
	}
227
	}
221
	
228
	
222
	// NAISSANCE DATE
229
	// NAISSANCE DATE
223
	public String getNaissanceDate()	{
230
	public String getNaissanceDate()	{
224
		String dateNaiss = "";
231
		String dateNaiss = "";
225
		dateNaiss = get("naissance_date");
232
		dateNaiss = get("naissance_date");
226
		if (UtilString.isEmpty(dateNaiss)||dateNaiss.equals("0000-00-00"))	{
233
		if (UtilString.isEmpty(dateNaiss)||dateNaiss.equals("0000-00-00"))	{
227
			dateNaiss = Mediateur.i18nC.inconnue();
234
			dateNaiss = Mediateur.i18nC.inconnue();
228
		}
235
		}
229
		return dateNaiss;
236
		return dateNaiss;
230
	}
237
	}
231
	
238
	
232
	public String getDateSouple(String date) {
239
	public String getDateSouple(String date) {
233
		String valeurDate = date;
240
		String valeurDate = date;
234
		
241
		
235
		String jour = "";
242
		String jour = "";
236
		String mois = "";
243
		String mois = "";
237
		String annee = "";
244
		String annee = "";
238
 
245
 
239
		// pas de date dans la BD
246
		// pas de date dans la BD
240
		if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
247
		if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
241
			valeurDate  = "";
248
			valeurDate  = "";
242
		
249
		
243
		// YYYY
250
		// YYYY
244
		} else if (valeurDate.endsWith("00-00")) {
251
		} else if (valeurDate.endsWith("00-00")) {
245
			valeurDate = valeurDate.substring(0, 4);
252
			valeurDate = valeurDate.substring(0, 4);
246
			if (valeurDate.matches("\\d{4}")) {
253
			if (valeurDate.matches("\\d{4}")) {
247
				jour = "";
254
				jour = "";
248
				mois = "";
255
				mois = "";
249
				annee = valeurDate.substring(0,4);
256
				annee = valeurDate.substring(0,4);
250
				valeurDate = annee;
257
				valeurDate = annee;
251
			}
258
			}
252
			
259
			
253
		// YYYY-MM
260
		// YYYY-MM
254
		} else if (valeurDate.endsWith("-00")) {
261
		} else if (valeurDate.endsWith("-00")) {
255
			valeurDate = valeurDate.substring(0, 7);
262
			valeurDate = valeurDate.substring(0, 7);
256
			if (valeurDate.matches("\\d{4}-\\d{2}")) {
263
			if (valeurDate.matches("\\d{4}-\\d{2}")) {
257
				jour = "";
264
				jour = "";
258
				mois = valeurDate.substring(5,7);
265
				mois = valeurDate.substring(5,7);
259
				annee = valeurDate.substring(0,4);
266
				annee = valeurDate.substring(0,4);
260
				valeurDate = mois+"/"+annee;
267
				valeurDate = mois+"/"+annee;
261
			}
268
			}
262
		}
269
		}
263
		
270
		
264
		// YYYY-MM-DD
271
		// YYYY-MM-DD
265
		else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
272
		else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
266
			Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
273
			Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
267
			DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
274
			DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
268
			valeurDate = fmt.format(objetDate);
275
			valeurDate = fmt.format(objetDate);
269
		}
276
		}
270
		 
277
		 
271
		 return valeurDate;
278
		 return valeurDate;
272
	}
279
	}
273
	
280
	
274
	public String getAnneeOuDateNaiss()	{
281
	public String getAnneeOuDateNaiss()	{
275
		String valeurDateNaissance = get("naissance_date");		 
282
		String valeurDateNaissance = get("naissance_date");		 
276
		return getDateSouple(valeurDateNaissance);
283
		return getDateSouple(valeurDateNaissance);
277
	}
284
	}
278
	
285
	
279
	public void setNaissanceDate(Date naissanceDate) {
286
	public void setNaissanceDate(Date naissanceDate) {
280
		if (naissanceDate != null) {
287
		if (naissanceDate != null) {
281
			this.set("naissance_date", DateTimeFormat.getFormat("yyyy-MM-dd").format(naissanceDate));
288
			this.set("naissance_date", DateTimeFormat.getFormat("yyyy-MM-dd").format(naissanceDate));
282
		} else {
289
		} else {
283
			this.set("naissance_date", null);
290
			this.set("naissance_date", null);
284
		}
291
		}
285
	}
292
	}
286
	
293
	
287
	// NAISSANCE LIEU
294
	// NAISSANCE LIEU
288
	public String getNaissanceLieu() {
295
	public String getNaissanceLieu() {
289
		return renvoyerValeurCorrecte("naissance_lieu");
296
		return renvoyerValeurCorrecte("naissance_lieu");
290
	}
297
	}
291
	public void setNaissanceLieu(String naissanceLieu) {
298
	public void setNaissanceLieu(String naissanceLieu) {
292
		this.set("naissance_lieu", naissanceLieu);
299
		this.set("naissance_lieu", naissanceLieu);
293
	}
300
	}
294
	
301
	
295
	// DÉCÉS
302
	// DÉCÉS
296
	public boolean estDecedee()	{
303
	public boolean estDecedee()	{
297
		String ceDeces = getDeces();
304
		String ceDeces = getDeces();
298
		if (ceDeces.isEmpty() || ceDeces.equals(ETRE_DECEDE))	{
305
		if (ceDeces.isEmpty() || ceDeces.equals(ETRE_DECEDE))	{
299
			return true;
306
			return true;
300
		} else {
307
		} else {
301
			return false;
308
			return false;
302
		}
309
		}
303
	}
310
	}
304
	
311
	
305
	public String getDeces()	{
312
	public String getDeces()	{
306
		return renvoyerValeurCorrecte("ce_deces");
313
		return renvoyerValeurCorrecte("ce_deces");
307
	}
314
	}
308
	
315
	
309
	public String getAnneeOuDateDeces()	{
316
	public String getAnneeOuDateDeces()	{
310
		String valeurDateDeces = get("deces_date");	 
317
		String valeurDateDeces = get("deces_date");	 
311
		return getDateSouple(valeurDateDeces);
318
		return getDateSouple(valeurDateDeces);
312
	}
319
	}
313
	
320
	
314
	public void setDeces(String deces)	{
321
	public void setDeces(String deces)	{
315
		set("ce_deces", deces);
322
		set("ce_deces", deces);
316
	}
323
	}
317
	
324
	
318
	public void setDeces(Date decesDate, String lieuDeces)	{
325
	public void setDeces(Date decesDate, String lieuDeces)	{
319
		set("ce_deces", ETRE_DECEDE);
326
		set("ce_deces", ETRE_DECEDE);
320
		setDecesDate(decesDate);
327
		setDecesDate(decesDate);
321
		setDecesLieu(lieuDeces);
328
		setDecesLieu(lieuDeces);
322
	}
329
	}
323
	public void setNonDecedee()	{
330
	public void setNonDecedee()	{
324
		set("ce_deces", ETRE_VIVANT);
331
		set("ce_deces", ETRE_VIVANT);
325
		setDecesDate(null);
332
		setDecesDate(null);
326
		setDecesLieu("");
333
		setDecesLieu("");
327
	}
334
	}
328
	
335
	
329
	// DÉCÉS DATE
336
	// DÉCÉS DATE
330
	public String getDecesDate()	{
337
	public String getDecesDate()	{
331
		String dateDeces = renvoyerValeurCorrecte("deces_date");
338
		String dateDeces = renvoyerValeurCorrecte("deces_date");
332
		if (UtilString.isEmpty(dateDeces) || dateDeces.equals("0000-00-00"))	{
339
		if (UtilString.isEmpty(dateDeces) || dateDeces.equals("0000-00-00"))	{
333
			dateDeces = Mediateur.i18nC.inconnue();
340
			dateDeces = Mediateur.i18nC.inconnue();
334
		}
341
		}
335
		return dateDeces;
342
		return dateDeces;
336
	}
343
	}
337
	
344
	
338
	public void setDecesDate(Date decesDate) {
345
	public void setDecesDate(Date decesDate) {
339
		if (decesDate != null)	{
346
		if (decesDate != null)	{
340
			this.set("deces_date", DateTimeFormat.getFormat("yyyy-MM-dd").format(decesDate));
347
			this.set("deces_date", DateTimeFormat.getFormat("yyyy-MM-dd").format(decesDate));
341
		}	else	{
348
		}	else	{
342
			this.set("deces_date", "");			
349
			this.set("deces_date", "");			
343
		}
350
		}
344
	}
351
	}
345
	
352
	
346
	// DÉCÉS LIEU
353
	// DÉCÉS LIEU
347
	public String getDecesLieu() {
354
	public String getDecesLieu() {
348
		return renvoyerValeurCorrecte("deces_lieu");
355
		return renvoyerValeurCorrecte("deces_lieu");
349
	}
356
	}
350
	public void setDecesLieu(String decesLieu) {
357
	public void setDecesLieu(String decesLieu) {
351
		this.set("deces_lieu", decesLieu);
358
		this.set("deces_lieu", decesLieu);
352
	}
359
	}
353
	
360
	
354
	// PARAMÊTRE
361
	// PARAMÊTRE
355
	public String getParametre() {
362
	public String getParametre() {
356
		return renvoyerValeurCorrecte("parametre");
363
		return renvoyerValeurCorrecte("parametre");
357
	}
364
	}
358
	public void setParametre(String parametre) {
365
	public void setParametre(String parametre) {
359
		this.set("parametre", parametre);
366
		this.set("parametre", parametre);
360
	}
367
	}
361
	
368
	
362
	public void setCourrielPrinc(String courriel)	{
369
	public void setCourrielPrinc(String courriel)	{
363
		this.set("_courriel_princ_", courriel);
370
		this.set("_courriel_princ_", courriel);
364
	}
371
	}
365
	
372
	
366
	public String getCourrielPrinc()	{
373
	public String getCourrielPrinc()	{
367
		return (String) this.get("_courriel_princ_");
374
		return (String) this.get("_courriel_princ_");
368
	}
375
	}
369
	
376
	
370
	// PUBLICATIONS LIÉES
377
	// PUBLICATIONS LIÉES
371
	public PublicationAPersonneListe getPublicationsLiees() {
378
	public PublicationAPersonneListe getPublicationsLiees() {
372
		return publicationsLiees;
379
		return publicationsLiees;
373
	}
380
	}
374
	
381
	
375
	public void setPublicationsLiees(PublicationAPersonneListe relationsCollectionAPublication) {
382
	public void setPublicationsLiees(PublicationAPersonneListe relationsCollectionAPublication) {
376
		publicationsLiees = relationsCollectionAPublication;
383
		publicationsLiees = relationsCollectionAPublication;
377
	}
384
	}
378
}
385
}
379
	
386