Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1098 → Rev 1099

/trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireForm.java
16,10 → 16,9
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
64,9 → 63,7
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.COMMENTAIRE);
panneauFormulaire.setLayout(new FormLayout());
String titre = genererTitreFormulaire();
panneauFormulaire.setHeading(titre);
 
genererTitreFormulaire();
creerChamps();
 
if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
74,12 → 71,15
}
}
private String genererTitreFormulaire() {
private void genererTitreFormulaire() {
String titre = i18nC.commentaireTitreFormAjout();
if (mode.equals(Formulaire.MODE_MODIFIER)) {
titre = i18nC.commentaireTitreFormModif()+" - "+i18nC.id()+": "+commentaire.getId();
titre = i18nC.commentaireTitreFormModif();
if (commentaire != null) {
titre += " - "+i18nC.id()+": "+commentaire.getId();
}
}
return titre;
panneauFormulaire.setHeading(titre);
}
private void creerChamps() {
174,11 → 174,34
}
private void rafraichirInformation(Information info) {
// Gestion des messages d'erreur
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
Debug.log("MESSAGES:\n"+info.getMessages().toString());
}
// Gestion des actions
String type = info.getType();
if (type.equals("ajout_commentaire") || type.equals("modif_commentaire")) {
commentaireValideOk = true;
commentaire.setId((String) info.getDonnee(0));
}
if (info.getType().equals("ajout_commentaire")) {
if (vueExterneARafraichirApresValidation != null) {
String noteId = (String) info.getDonnee(0);
commentaire.setId(noteId);
}
}
// Gestion des messages
if (info.getType().equals("modif_commentaire")) {
Info.display("Modification d'une note", info.toString());
} else if (info.getType().equals("ajout_commentaire")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String noteId = (String) info.getDonnee(0);
Info.display("Ajout d'une note", "La note '"+noteId+"' a bien été ajoutée");
} else {
Info.display("Ajout d'une note", info.toString());
}
}
}
 
private Boolean etreValide() {
209,7 → 232,6
public boolean soumettreFormulaire() {
formulaireValideOk = verifierFormulaire();
Debug.log("Form?"+formulaireValideOk);
if (formulaireValideOk) {
soumettreCommentaire();
}
219,7 → 241,6
private void soumettreCommentaire() {
Commentaire commentaireCollectee = collecterCommentaire();
if (commentaireCollectee != null) {
Debug.log("Info public collectée ? ok");
if (mode.equals(Formulaire.MODE_AJOUTER)) {
mediateur.ajouterCommentaire(this, commentaireCollectee);
} else if (mode.equals(Formulaire.MODE_MODIFIER)) {
241,9 → 262,7
String selectionDe = i18nC.articleUn()+" "+i18nC.projetSingulier();
String pour = i18nC.articleLa()+" "+i18nC.commentaireSingulier();
messages.add(i18nM.selectionObligatoire(selectionDe, pour));
Debug.log("Projet combo vide");
}
Debug.log("Projet combo non vide : "+getValeurComboProjets());
if (messages.size() != 0) {
String[] tableauDeMessages = {};