Subversion Repositories eFlore/Applications.coel

Rev

Rev 150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 183
Line 1... Line 1...
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
Line 2... Line 2...
2
 
2
 
3
import org.tela_botanica.client.RegistreId;
3
import org.tela_botanica.client.RegistreId;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
5
import org.tela_botanica.client.modeles.Personne;
-
 
6
import org.tela_botanica.client.modeles.Projet;
5
import org.tela_botanica.client.modeles.Personne;
7
import org.tela_botanica.client.modeles.ProjetsListeAsyncDao;
6
import org.tela_botanica.client.modeles.Structure;
8
import org.tela_botanica.client.modeles.Structure;
Line 7... Line 9...
7
import org.tela_botanica.client.modeles.StructureListe;
9
import org.tela_botanica.client.modeles.StructureListe;
8
 
10
 
9
import com.extjs.gxt.ui.client.Registry;
11
import com.extjs.gxt.ui.client.Registry;
10
import com.extjs.gxt.ui.client.Style.Scroll;
12
import com.extjs.gxt.ui.client.Style.Scroll;
11
import com.extjs.gxt.ui.client.util.Format;
13
import com.extjs.gxt.ui.client.util.Format;
12
import com.extjs.gxt.ui.client.util.Params;
14
import com.extjs.gxt.ui.client.util.Params;
13
import com.extjs.gxt.ui.client.widget.ContentPanel;
15
import com.extjs.gxt.ui.client.widget.ContentPanel;
14
import com.extjs.gxt.ui.client.widget.Html;
-
 
15
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-
 
Line 16... Line 16...
16
import com.google.gwt.core.client.GWT;
16
import com.extjs.gxt.ui.client.widget.Html;
Line 17... Line 17...
17
import com.google.gwt.user.client.Window;
17
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
18
 
18
 
19
public class PersonneDetailPanneauVue extends ContentPanel implements Rafraichissable {
19
public class PersonneDetailPanneauVue extends ContentPanel implements Rafraichissable {
20
 
20
 
21
	private ContentPanel content;
21
	private ContentPanel content;
22
	private Html header;
22
	private Html header;
23
	private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2>{1}</h2></div>";
23
	private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2><a href=\"mailto:{1}\">{1}</a></h2></div>";
24
	private String contenuHTML = ""; //<div style='padding: 12px;'><h2>Renseignements administratifs</h2><span style='font-weight:bold;'>Condition d'accès :</span> {9}<br /><span style='font-weight:bold;'>Adresse :</span> {1}, {2} {3}, {4}, {5}<br /><span style='font-weight:bold;'>Téléphone :</span> {6}<br /><span style='font-weight:bold;'>Fax :</span> {7}<br /><span style='font-weight:bold;'>Courriel :</span> {8}<br />{0}</div>";
24
	private String contenuHTML = "<div style='padding: 12px;'><p>{0}</p><b>Adresse: </b>{1}<br />{2}<br /></div>";
25
	private String structureNom = null;
25
	private String structureNom = null;
26
	private String structureVille = null;
26
	private String structureVille = null;
Line 27... Line 27...
27
	private String structureDescription = null;
27
	private String structureDescription = null;
28
	
28
 
Line 42... Line 42...
42
		content.setTopComponent(header);
42
		content.setTopComponent(header);
Line 43... Line 43...
43
 
43
 
44
		add(content);
44
		add(content);
Line -... Line 45...
-
 
45
	}
-
 
46
 
-
 
47
	public void ajouterParam(Params parametres, String nomChamp, Personne personne)	{
-
 
48
		parametres.add(personne.obtenirValeurChamp(nomChamp));
-
 
49
		//return parametres;
45
	}
50
	}	
46
 
51
	
47
	public void afficherDetailPersonne(Personne personne) {
52
	public void afficherDetailPersonne(Personne personne) {
Line 48... Line 53...
48
		if (personne != null) {
53
		if (personne != null) {
49
			content.removeAll();
-
 
50
			
-
 
51
			/*structureNom = structure.getNom();
54
			content.removeAll();
52
			structureVille = structure.getVille();
55
			
53
			structureDescription = structure.getDescription();
56
			//Header	
54
			Params enteteParams = new Params();
57
			Params enteteParams = new Params();
55
				enteteParams.add(structureNom);
58
			ajouterParam(enteteParams, "fmt_nom_complet", personne);
56
				enteteParams.add(structureVille);
-
 
57
 
59
			ajouterParam(enteteParams, "truk_courriel", personne);
-
 
60
			
58
			String eHtml = Format.substitute(enteteHTML, enteteParams);
61
			header.getElement().setInnerHTML(Format.substitute(enteteHTML, enteteParams));
59
			header.getElement().setInnerHTML(eHtml);
-
 
60
 
-
 
61
			Params contenuParams = new Params();
-
 
62
			contenuParams.add(structureDescription);
-
 
63
			contenuParams.add(structure.getAdresse());
62
			
-
 
63
			//Contenu
64
			contenuParams.add(structure.getCodePostal());
64
			Params contenuParams = new Params();
65
			contenuParams.add(structure.getVille());
-
 
66
			contenuParams.add(structure.getRegion());
65
			ajouterParam(contenuParams, "description", personne);
67
			contenuParams.add(structure.getPays());
-
 
68
			contenuParams.add(structure.getTelephone());
-
 
-
 
66
			
69
			contenuParams.add(structure.getFax());
67
			ajouterParam(contenuParams, "adresse_01", personne);
70
			contenuParams.add(structure.getCourriel());
68
			ajouterParam(contenuParams, "adresse_02", personne);
71
			contenuParams.add(structure.getConditionAcces());
-
 
72
			
69
			
73
			String cHtml = Format.substitute(contenuHTML, contenuParams);
70
			
74
			content.addText(cHtml);
71
			content.addText(Format.substitute(contenuHTML, contenuParams));
75
			 */
72
 
76
			layout();
73
			layout();
77
		} else {
74
		} else {
78
			header.setHtml("");
75
			header.setHtml("");
Line 79... Line 76...
79
			content.removeAll();
76
			content.removeAll();
80
		}
77
		}
81
	}
78
	}
82
 
-
 
83
	public void rafraichir(Object nouvellesDonnees) {
-
 
84
		if (nouvellesDonnees instanceof Personne)	{
-
 
85
			afficherDetailPersonne((Personne) nouvellesDonnees);
-
 
86
		}
-
 
87
		
-
 
88
		
79
 
89
		
80
	public void rafraichir(Object nouvelleDonnees) {
90
		/*if (nouvelleDonnees instanceof Structure) {
81
		if (nouvelleDonnees instanceof Personne) {
91
			afficherDetailInstitution((Structure) nouvelleDonnees);
82
			afficherDetailPersonne((Personne) nouvelleDonnees);
92
		} else if (nouvelleDonnees instanceof StructureListe) {
83
		} else if (nouvelleDonnees instanceof StructureListe) {
93
			StructureListe listeInstitutions = (StructureListe) nouvelleDonnees;
84
			StructureListe listeInstitutions = (StructureListe) nouvelleDonnees;
94
			// Test pour savoir si la liste contient des éléments
85
			// Test pour savoir si la liste contient des éléments
95
			if (listeInstitutions.size() == 0) {
86
			if (listeInstitutions.size() == 0) {
Line 96... Line 87...
96
				afficherDetailInstitution(null);
87
				afficherDetailPersonne(null);