Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1680 Rev 1764
1
package org.tela_botanica.client.vues.commentaire;
1
package org.tela_botanica.client.vues.commentaire;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
 
4
 
5
import org.tela_botanica.client.ComposantClass;
5
import org.tela_botanica.client.ComposantClass;
6
import org.tela_botanica.client.Mediateur;
6
import org.tela_botanica.client.Mediateur;
7
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
7
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
8
import org.tela_botanica.client.composants.ChampSliderPourcentage;
8
import org.tela_botanica.client.composants.ChampSliderPourcentage;
9
import org.tela_botanica.client.composants.InfoLogger;
9
import org.tela_botanica.client.composants.InfoLogger;
10
import org.tela_botanica.client.composants.pagination.ProxyProjets;
-
 
11
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.interfaces.Rafraichissable;
12
import org.tela_botanica.client.modeles.Information;
11
import org.tela_botanica.client.modeles.Information;
13
import org.tela_botanica.client.modeles.MenuApplicationId;
12
import org.tela_botanica.client.modeles.MenuApplicationId;
14
import org.tela_botanica.client.modeles.commentaire.Commentaire;
13
import org.tela_botanica.client.modeles.commentaire.Commentaire;
15
import org.tela_botanica.client.modeles.projet.Projet;
-
 
16
import org.tela_botanica.client.synchronisation.Sequenceur;
14
import org.tela_botanica.client.synchronisation.Sequenceur;
17
import org.tela_botanica.client.util.Debug;
15
import org.tela_botanica.client.util.Debug;
18
import org.tela_botanica.client.util.UtilArray;
16
import org.tela_botanica.client.util.UtilArray;
19
import org.tela_botanica.client.util.UtilString;
17
import org.tela_botanica.client.util.UtilString;
20
import org.tela_botanica.client.vues.Formulaire;
18
import org.tela_botanica.client.vues.Formulaire;
21
 
19
 
22
import com.extjs.gxt.ui.client.data.ModelData;
20
import com.extjs.gxt.ui.client.data.ModelData;
23
import com.extjs.gxt.ui.client.data.ModelType;
21
import com.extjs.gxt.ui.client.data.ModelType;
24
import com.extjs.gxt.ui.client.event.Events;
22
import com.extjs.gxt.ui.client.event.Events;
25
import com.extjs.gxt.ui.client.widget.MessageBox;
23
import com.extjs.gxt.ui.client.widget.MessageBox;
26
import com.extjs.gxt.ui.client.widget.form.CheckBox;
24
import com.extjs.gxt.ui.client.widget.form.CheckBox;
27
import com.extjs.gxt.ui.client.widget.form.Field;
25
import com.extjs.gxt.ui.client.widget.form.Field;
28
import com.extjs.gxt.ui.client.widget.form.TextArea;
26
import com.extjs.gxt.ui.client.widget.form.TextArea;
29
import com.extjs.gxt.ui.client.widget.form.TextField;
27
import com.extjs.gxt.ui.client.widget.form.TextField;
30
import com.extjs.gxt.ui.client.widget.form.Validator;
28
import com.extjs.gxt.ui.client.widget.form.Validator;
31
import com.extjs.gxt.ui.client.widget.layout.FormData;
29
import com.extjs.gxt.ui.client.widget.layout.FormData;
32
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
30
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
33
import com.google.gwt.user.client.Window;
31
import com.google.gwt.user.client.Window;
34
 
32
 
35
 
33
 
36
public class CommentaireForm extends Formulaire implements Rafraichissable {
34
public class CommentaireForm extends Formulaire implements Rafraichissable {
37
	
35
	
38
	private Commentaire commentaire;
36
	private Commentaire commentaire;
39
 
-
 
40
	private ChampComboBoxRechercheTempsReelPaginable projetsCombo = null;
37
 
41
	private TextField<String> titreChp;
38
	private TextField<String> titreChp;
42
	private TextArea texteChp;
39
	private TextArea texteChp;
43
	private ChampSliderPourcentage ponderationChp;
40
	private ChampSliderPourcentage ponderationChp;
44
	private CheckBox publicChp;
41
	private CheckBox publicChp;
45
	
42
	
46
	private static boolean formulaireValideOk = false;
43
	private static boolean formulaireValideOk = false;
47
	private static boolean commentaireValideOk = false;
44
	private static boolean commentaireValideOk = false;
48
	
45
	
49
	private Sequenceur sequenceur = new Sequenceur();
46
	private Sequenceur sequenceur = new Sequenceur();
50
 
47
 
51
	public CommentaireForm(Mediateur mediateurCourrant, String commentaireId) {
48
	public CommentaireForm(Mediateur mediateurCourrant, String commentaireId) {
52
		initialiserCommentaireForm(mediateurCourrant, commentaireId);
49
		initialiserCommentaireForm(mediateurCourrant, commentaireId);
53
	}
50
	}
54
 
51
 
55
	public CommentaireForm(Mediateur mediateurCourrant, String commentaireId, Rafraichissable vueARafraichirApresValidation) {
52
	public CommentaireForm(Mediateur mediateurCourrant, String commentaireId, Rafraichissable vueARafraichirApresValidation) {
56
		vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
53
		vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
57
		initialiserCommentaireForm(mediateurCourrant, commentaireId);
54
		initialiserCommentaireForm(mediateurCourrant, commentaireId);
58
	}
55
	}
59
	
56
	
60
	private void initialiserCommentaireForm(Mediateur mediateurCourrant, String commentaireId) {
57
	private void initialiserCommentaireForm(Mediateur mediateurCourrant, String commentaireId) {
61
		initialiserValidation();
58
		initialiserValidation();
62
		
59
		
63
		commentaire = new Commentaire();
60
		commentaire = new Commentaire();
64
		commentaire.setId(commentaireId);
61
		commentaire.setId(commentaireId);
65
		
62
		
66
		String modeDeCreation = (UtilString.isEmpty(commentaire.getId()) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
63
		String modeDeCreation = (UtilString.isEmpty(commentaire.getId()) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
67
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.COMMENTAIRE);
64
		initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.COMMENTAIRE);
68
		
65
		
69
		panneauFormulaire.setLayout(new FormLayout());
66
		panneauFormulaire.setLayout(new FormLayout());
70
		genererTitreFormulaire();
67
		genererTitreFormulaire();
71
		creerChamps();
68
		creerChamps();
72
 
69
 
73
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
70
		if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
74
			mediateur.selectionnerCommentaire(this, commentaireId, null);
71
			mediateur.selectionnerCommentaire(this, commentaireId, null);
75
		}
72
		}
76
	}
73
	}
77
	
74
	
78
	private void genererTitreFormulaire() {
75
	private void genererTitreFormulaire() {
79
		String titre = i18nC.commentaireTitreFormAjout();
76
		String titre = i18nC.commentaireTitreFormAjout();
80
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
77
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
81
			 titre = i18nC.commentaireTitreFormModif();
78
			 titre = i18nC.commentaireTitreFormModif();
82
			 if (commentaire != null) {
79
			 if (commentaire != null) {
83
				 titre += " - "+i18nC.id()+": "+commentaire.getId();
80
				 titre += " - "+i18nC.id()+": "+commentaire.getId();
84
			 }
81
			 }
85
		}
82
		}
86
		panneauFormulaire.setHeadingHtml(titre);
83
		panneauFormulaire.setHeadingHtml(titre);
87
	}
84
	}
88
	
85
	
89
	private void creerChamps() {
86
	private void creerChamps() {
90
		
-
 
91
		ModelType modelTypeProjets = new ModelType();
-
 
92
		modelTypeProjets.setRoot("projets");
-
 
93
		modelTypeProjets.setTotalName("nbElements");
-
 
94
		modelTypeProjets.addField("cpr_nom");
-
 
95
		modelTypeProjets.addField("cpr_id_projet");
-
 
96
		
-
 
97
		String displayNameProjets = "cpr_nom";
-
 
98
		ProxyProjets<ModelData> proxyProjets = new ProxyProjets<ModelData>(null);
-
 
99
		
-
 
100
		projetsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyProjets, modelTypeProjets, displayNameProjets);
-
 
101
		projetsCombo.setWidth(100, 550);
-
 
102
		projetsCombo.getCombo().setTabIndex(tabIndex++);
-
 
103
		projetsCombo.getCombo().setFieldLabel(i18nC.projetChamp());
-
 
104
		projetsCombo.getCombo().setEmptyText(i18nC.txtListeProjetDefaut());
-
 
105
		projetsCombo.getCombo().setForceSelection(true);
-
 
106
		projetsCombo.getCombo().setEditable(false);
-
 
107
		projetsCombo.getCombo().setAllowBlank(false);
-
 
108
		projetsCombo.getCombo().setValidator(new Validator() {
-
 
109
			public String validate(Field<?> champ, String valeurAValider) {
-
 
110
				String retour = null;
-
 
111
				if (UtilString.isEmpty(valeurAValider) 
-
 
112
						|| projetsCombo.getStore().findModel("cpr_nom", valeurAValider) == null) {
-
 
113
					champ.setValue(null);
-
 
114
					retour = i18nC.selectionnerValeur();
-
 
115
				}
-
 
116
				if(retour == null) {
-
 
117
					projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE_OK);
-
 
118
					projetsCombo.getCombo().removeStyleName(ComposantClass.OBLIGATOIRE);
-
 
119
				} else {
-
 
120
					projetsCombo.getCombo().removeStyleName(ComposantClass.OBLIGATOIRE_OK);
-
 
121
					projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
-
 
122
				}
-
 
123
				return retour;
-
 
124
			}
-
 
125
		});
-
 
126
		projetsCombo.getCombo().addStyleName(ComposantClass.OBLIGATOIRE);
-
 
127
		
-
 
128
		panneauFormulaire.add(projetsCombo, new FormData(450, 0));
-
 
129
		
87
				
130
		titreChp = new TextField<String>();
88
		titreChp = new TextField<String>();
131
		titreChp.setFieldLabel(i18nC.commentaireTitre());
89
		titreChp.setFieldLabel(i18nC.commentaireTitre());
132
		titreChp.setAllowBlank(false);
90
		titreChp.setAllowBlank(false);
133
		titreChp.addStyleName(ComposantClass.OBLIGATOIRE);
91
		titreChp.addStyleName(ComposantClass.OBLIGATOIRE);
134
		titreChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
92
		titreChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
135
		titreChp.addListener(Events.Invalid, creerEcouteurChampObligatoire());
93
		titreChp.addListener(Events.Invalid, creerEcouteurChampObligatoire());
136
		panneauFormulaire.add(titreChp, new FormData(450, 0));
94
		panneauFormulaire.add(titreChp, new FormData(450, 0));
137
		
95
		
138
		texteChp = new TextArea();
96
		texteChp = new TextArea();
139
		texteChp.setFieldLabel(i18nC.commentaireTexte());
97
		texteChp.setFieldLabel(i18nC.commentaireTexte());
140
		panneauFormulaire.add(texteChp, new FormData(450, 250));
98
		panneauFormulaire.add(texteChp, new FormData(450, 250));
141
		
99
		
142
		ponderationChp = new ChampSliderPourcentage(i18nC.commentairePonderation());
100
		ponderationChp = new ChampSliderPourcentage(i18nC.commentairePonderation());
143
		panneauFormulaire.add(ponderationChp, new FormData(450, 0));
101
		panneauFormulaire.add(ponderationChp, new FormData(450, 0));
144
		
102
		
145
		publicChp = new CheckBox();
103
		publicChp = new CheckBox();
146
		publicChp.setFieldLabel(i18nC.donneePublic());
104
		publicChp.setFieldLabel(i18nC.donneePublic());
147
		panneauFormulaire.add(publicChp, new FormData(50, 0));
105
		panneauFormulaire.add(publicChp, new FormData(50, 0));
148
	}
106
	}
149
	
107
	
150
	public void rafraichir(Object nouvellesDonnees) {
108
	public void rafraichir(Object nouvellesDonnees) {
151
		if (nouvellesDonnees instanceof Commentaire) {
109
		if (nouvellesDonnees instanceof Commentaire) {
152
			// Si on a reçu les details d'une publication
110
			// Si on a reçu les details d'une publication
153
			rafraichirCommentaire((Commentaire) nouvellesDonnees);
111
			rafraichirCommentaire((Commentaire) nouvellesDonnees);
154
		} else if (nouvellesDonnees instanceof Information) {
112
		} else if (nouvellesDonnees instanceof Information) {
155
			rafraichirInformation((Information) nouvellesDonnees);	
113
			rafraichirInformation((Information) nouvellesDonnees);	
156
		} else {
114
		} else {
157
			Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
115
			Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
158
		}
116
		}
159
		
117
		
160
		if (etreValide()) {
118
		if (etreValide()) {
161
			initialiserValidation();
119
			initialiserValidation();
162
			repandreRafraichissement();
120
			repandreRafraichissement();
163
			controlerFermeture();
121
			controlerFermeture();
164
		}
122
		}
165
	}
123
	}
166
	
124
	
167
	private void rafraichirCommentaire(Commentaire commentaireRecu) {
125
	private void rafraichirCommentaire(Commentaire commentaireRecu) {
168
		commentaire = commentaireRecu;
126
		commentaire = commentaireRecu;
169
		peuplerFormulaire();
127
		peuplerFormulaire();
170
		genererTitreFormulaire();
128
		genererTitreFormulaire();
171
	}
129
	}
172
	
-
 
173
	private String getValeurComboProjets() {
-
 
174
		String valeur = "";
-
 
175
		if (projetsCombo.getCombo().getValue() != null && projetsCombo.getCombo().isValid()) {
-
 
176
			Projet projet = new Projet (projetsCombo.getValeur());
-
 
177
			valeur = projet.getId();
-
 
178
		}
-
 
179
		return valeur;
-
 
180
	}
-
 
181
	
-
 
182
	private void setValeurComboProjets() {
-
 
183
		if (mode.equals(Formulaire.MODE_MODIFIER)) {
-
 
184
			if (projetsCombo.getCombo().getStore() != null
-
 
185
					&& commentaire != null
-
 
186
					&& commentaire.getIdProjet() != null
-
 
187
					&& !UtilString.isEmpty(commentaire.getIdProjet())) {
-
 
188
				projetsCombo.chargerValeurInitiale(commentaire.getIdProjet(), "cpr_id_projet");
-
 
189
			} else {
-
 
190
				projetsCombo.getCombo().setValue(null);
-
 
191
			}
-
 
192
		} else if (mode.equals(Formulaire.MODE_AJOUTER)) {
-
 
193
			if (projetsCombo.getCombo().getStore() != null) {
-
 
194
				projetsCombo.chargerValeurInitiale(mediateur.getProjetId(), "cpr_id_projet");
-
 
195
			} else {
-
 
196
				projetsCombo.getCombo().setValue(null);
-
 
197
			}
-
 
198
		}
-
 
199
	}
-
 
200
	
130
	
201
	private void rafraichirInformation(Information info) {
131
	private void rafraichirInformation(Information info) {
202
		// Gestion des messages d'erreur
132
		// Gestion des messages d'erreur
203
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
133
		if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
204
			Debug.log("MESSAGES:\n"+info.getMessages().toString());
134
			Debug.log("MESSAGES:\n"+info.getMessages().toString());
205
		}
135
		}
206
		
136
		
207
		// Gestion des actions
137
		// Gestion des actions
208
		String type = info.getType();
138
		String type = info.getType();
209
		if (type.equals("ajout_commentaire") || type.equals("modif_commentaire")) {
139
		if (type.equals("ajout_commentaire") || type.equals("modif_commentaire")) {
210
			commentaireValideOk = true;
140
			commentaireValideOk = true;
211
		}
141
		}
212
		if (info.getType().equals("ajout_commentaire")) {
142
		if (info.getType().equals("ajout_commentaire")) {
213
				String noteId = (String) info.getDonnee(0);
143
				String noteId = (String) info.getDonnee(0);
214
				commentaire.setId(noteId);
144
				commentaire.setId(noteId);
215
				this.mode = MODE_MODIFIER;
145
				this.mode = MODE_MODIFIER;
216
		}
146
		}
217
		
147
		
218
		// Gestion des messages
148
		// Gestion des messages
219
		if (info.getType().equals("modif_commentaire")) {
149
		if (info.getType().equals("modif_commentaire")) {
220
			InfoLogger.display("Modification d'une note", info.toString());
150
			InfoLogger.display("Modification d'une note", info.toString());
221
		} else if (info.getType().equals("ajout_commentaire")) {
151
		} else if (info.getType().equals("ajout_commentaire")) {
222
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
152
			if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
223
				String noteId = (String) info.getDonnee(0);
153
				String noteId = (String) info.getDonnee(0);
224
				InfoLogger.display("Ajout d'une note", "La note '"+noteId+"' a bien été ajoutée");
154
				InfoLogger.display("Ajout d'une note", "La note '"+noteId+"' a bien été ajoutée");
225
			} else {
155
			} else {
226
				InfoLogger.display("Ajout d'une note", info.toString());
156
				InfoLogger.display("Ajout d'une note", info.toString());
227
			}
157
			}
228
		}
158
		}
229
	}
159
	}
230
 
160
 
231
	private Boolean etreValide() {
161
	private Boolean etreValide() {
232
		Boolean valide = false;
162
		Boolean valide = false;
233
		if (formulaireValideOk && commentaireValideOk) {
163
		if (formulaireValideOk && commentaireValideOk) {
234
			valide = true;
164
			valide = true;
235
		}
165
		}
236
		return valide;
166
		return valide;
237
	}
167
	}
238
	
168
	
239
	private void initialiserValidation() {
169
	private void initialiserValidation() {
240
		formulaireValideOk = false;
170
		formulaireValideOk = false;
241
		commentaireValideOk = false;
171
		commentaireValideOk = false;
242
	}
172
	}
243
	
173
	
244
	private void repandreRafraichissement() {
174
	private void repandreRafraichissement() {
245
		if (vueExterneARafraichirApresValidation != null) {
175
		if (vueExterneARafraichirApresValidation != null) {
246
			String type = "commentaire_modifiee";
176
			String type = "commentaire_modifiee";
247
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
177
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
248
				type = "commentaire_ajoutee";
178
				type = "commentaire_ajoutee";
249
			}
179
			}
250
			Information info = new Information(type);
180
			Information info = new Information(type);
251
			info.setDonnee(0, commentaire);
181
			info.setDonnee(0, commentaire);
252
			vueExterneARafraichirApresValidation.rafraichir(info);
182
			vueExterneARafraichirApresValidation.rafraichir(info);
253
		}
183
		}
254
	}
184
	}
255
	
185
	
256
	public boolean soumettreFormulaire() {
186
	public boolean soumettreFormulaire() {
257
		formulaireValideOk = verifierFormulaire();
187
		formulaireValideOk = verifierFormulaire();
258
		if (formulaireValideOk) {
188
		if (formulaireValideOk) {
259
			soumettreCommentaire();
189
			soumettreCommentaire();
260
		}
190
		}
261
		return formulaireValideOk;
191
		return formulaireValideOk;
262
	}
192
	}
263
	
193
	
264
	private void soumettreCommentaire() {
194
	private void soumettreCommentaire() {
265
		Commentaire commentaireCollectee = collecterCommentaire();
195
		Commentaire commentaireCollectee = collecterCommentaire();
266
		if (commentaireCollectee != null) {
196
		if (commentaireCollectee != null) {
267
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
197
			if (mode.equals(Formulaire.MODE_AJOUTER)) {
268
				mediateur.ajouterCommentaire(this, commentaireCollectee);
198
				mediateur.ajouterCommentaire(this, commentaireCollectee);
269
			} else if (mode.equals(Formulaire.MODE_MODIFIER)) {
199
			} else if (mode.equals(Formulaire.MODE_MODIFIER)) {
270
				mediateur.modifierCommentaire(this, commentaireCollectee);
200
				mediateur.modifierCommentaire(this, commentaireCollectee);
271
			}
201
			}
272
		} else {
202
		} else {
273
			if(clicBoutonvalidation) {
203
			if(clicBoutonvalidation) {
274
				fermerFormulaire();
204
				fermerFormulaire();
275
			}
205
			}
276
		}
206
		}
277
	}
207
	}
278
	
208
	
279
	public boolean verifierFormulaire() {
209
	public boolean verifierFormulaire() {
280
		boolean valide = true;
210
		boolean valide = true;
281
		ArrayList<String> messages = new ArrayList<String>();
211
		ArrayList<String> messages = new ArrayList<String>();
282
		
212
		
283
		String titre = titreChp.getValue();
213
		String titre = titreChp.getValue();
284
		if (titre == null || titre.equals("")) {
214
		if (titre == null || titre.equals("")) {
285
			messages.add(i18nC.commentaireMessageTitre());
215
			messages.add(i18nC.commentaireMessageTitre());
286
		}
216
		}
287
		
-
 
288
		if (UtilString.isEmpty(getValeurComboProjets())) {
-
 
289
			String selectionDe = i18nC.articleUn()+" "+i18nC.projetSingulier();
-
 
290
			String pour = i18nC.articleLa()+" "+i18nC.commentaireSingulier();
-
 
291
			messages.add(i18nM.selectionObligatoire(selectionDe, pour));
-
 
292
		}
-
 
293
		
217
		
294
		if (messages.size() != 0) {
218
		if (messages.size() != 0) {
295
			String[] tableauDeMessages = {};
219
			String[] tableauDeMessages = {};
296
			tableauDeMessages = messages.toArray(tableauDeMessages);
220
			tableauDeMessages = messages.toArray(tableauDeMessages);
297
			MessageBox.alert(i18nC.erreurSaisieTitre(), UtilArray.implode(tableauDeMessages, "<br />"), null);
221
			MessageBox.alert(i18nC.erreurSaisieTitre(), UtilArray.implode(tableauDeMessages, "<br />"), null);
298
			valide = false;
222
			valide = false;
299
		}
223
		}
300
		return valide;		
224
		return valide;		
301
	}
225
	}
302
	
226
	
303
	private void peuplerFormulaire() {
227
	private void peuplerFormulaire() {
304
		setValeurComboProjets();
-
 
305
		titreChp.setValue(commentaire.getTitre());
228
		titreChp.setValue(commentaire.getTitre());
306
		texteChp.setValue(commentaire.getTexte());
229
		texteChp.setValue(commentaire.getTexte());
307
		ponderationChp.peupler(commentaire.getPonderation());
230
		ponderationChp.peupler(commentaire.getPonderation());
308
		boolean acces = (commentaire.etrePublic() ? true : false);
231
		boolean acces = (commentaire.etrePublic() ? true : false);
309
		publicChp.setValue(acces);
232
		publicChp.setValue(acces);
310
	}
233
	}
311
	
234
	
312
	private Commentaire collecterCommentaire() {
235
	private Commentaire collecterCommentaire() {
313
		Commentaire commentaireCollectee = (Commentaire) commentaire.cloner(new Commentaire());
236
		Commentaire commentaireCollectee = (Commentaire) commentaire.cloner(new Commentaire());
314
		
-
 
315
		commentaireCollectee.setIdProjet(getValeurComboProjets());
-
 
316
		
237
		
317
		String titre = titreChp.getValue();
238
		String titre = titreChp.getValue();
318
		commentaireCollectee.setTitre(titre);
239
		commentaireCollectee.setTitre(titre);
319
		
240
		
320
		String texte = texteChp.getValue();
241
		String texte = texteChp.getValue();
321
		commentaireCollectee.setTexte(texte);
242
		commentaireCollectee.setTexte(texte);
322
		
243
		
323
		String ponderation = ponderationChp.getValeur();
244
		String ponderation = ponderationChp.getValeur();
324
		commentaireCollectee.setPonderation(ponderation);
245
		commentaireCollectee.setPonderation(ponderation);
325
		
246
		
326
		String acces = (publicChp.getValue() ? "1" : "0");
247
		String acces = (publicChp.getValue() ? "1" : "0");
327
		commentaireCollectee.setPublic(acces);
248
		commentaireCollectee.setPublic(acces);
328
		
249
		
329
		Commentaire commentaireARetourner = null;
250
		Commentaire commentaireARetourner = null;
330
		if (!commentaireCollectee.comparer(commentaire)) {
251
		if (!commentaireCollectee.comparer(commentaire)) {
331
			commentaireARetourner = commentaire = commentaireCollectee;
252
			commentaireARetourner = commentaire = commentaireCollectee;
332
		}
253
		}
333
		return commentaireARetourner;
254
		return commentaireARetourner;
334
	}
255
	}
335
}
256
}