Subversion Repositories eFlore/Applications.coel

Rev

Rev 1417 | Rev 1573 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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