Subversion Repositories eFlore/Applications.coel

Rev

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

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