Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 183 Rev 189
Line 1... Line 1...
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
Line -... Line 2...
-
 
2
 
-
 
3
 
-
 
4
 
-
 
5
import java.util.List;
2
 
6
 
3
import org.tela_botanica.client.RegistreId;
7
import org.tela_botanica.client.RegistreId;
-
 
8
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
9
import org.tela_botanica.client.modeles.Information;
5
import org.tela_botanica.client.modeles.Personne;
10
import org.tela_botanica.client.modeles.Personne;
6
import org.tela_botanica.client.modeles.Projet;
11
import org.tela_botanica.client.modeles.Projet;
7
import org.tela_botanica.client.modeles.ProjetsListeAsyncDao;
12
import org.tela_botanica.client.modeles.ProjetsListeAsyncDao;
8
import org.tela_botanica.client.modeles.Structure;
13
import org.tela_botanica.client.modeles.Structure;
Line 12... Line 17...
12
import com.extjs.gxt.ui.client.Style.Scroll;
17
import com.extjs.gxt.ui.client.Style.Scroll;
13
import com.extjs.gxt.ui.client.util.Format;
18
import com.extjs.gxt.ui.client.util.Format;
14
import com.extjs.gxt.ui.client.util.Params;
19
import com.extjs.gxt.ui.client.util.Params;
15
import com.extjs.gxt.ui.client.widget.ContentPanel;
20
import com.extjs.gxt.ui.client.widget.ContentPanel;
16
import com.extjs.gxt.ui.client.widget.Html;
21
import com.extjs.gxt.ui.client.widget.Html;
-
 
22
import com.extjs.gxt.ui.client.widget.TabItem;
-
 
23
import com.extjs.gxt.ui.client.widget.TabPanel;
17
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
24
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-
 
25
import com.google.gwt.user.client.ui.FlexTable;
-
 
26
import com.google.gwt.user.client.ui.Grid;
-
 
27
import com.google.gwt.user.client.ui.Hyperlink;
-
 
28
import com.google.gwt.user.client.ui.Label;
-
 
29
import com.google.gwt.user.client.ui.Widget;
-
 
30
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
-
 
31
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
-
 
32
 
-
 
33
public class PersonneDetailPanneauVue extends TabPanel implements Rafraichissable {
Line 18... Line -...
18
 
-
 
Line 19... Line -...
19
public class PersonneDetailPanneauVue extends ContentPanel implements Rafraichissable {
-
 
20
 
34
 
-
 
35
	
-
 
36
	private Html header;
21
	private ContentPanel content;
37
	
-
 
38
	//TABS
22
	private Html header;
39
	// Informations générales : nom, prénom, adresse, cp, ville, adresse email, sexe, projet
-
 
40
	private TabItem infoGenerales;
23
	private String enteteHTML = "<div class='coel-detail'><h1>{0}</h1><h2><a href=\"mailto:{1}\">{1}</a></h2></div>";
41
	private String contenuInfo = "<div style='padding: 12px;'><h1>{0}</h1><a href=\"{1}\">{1}</a><br /><br /><p><b>Adresse: </b>{2}<br />{3}<br />{4} {5}<br /> {7}</p><br />{6}</div>";
24
	private String contenuHTML = "<div style='padding: 12px;'><p>{0}</p><b>Adresse: </b>{1}<br />{2}<br /></div>";
42
	
25
	private String structureNom = null;
43
	private TabItem infoBio;
-
 
44
	private String contenuBio = "";
Line 26... Line 45...
26
	private String structureVille = null;
45
			// <div style='padding: 12px;'><h1>{0} {1} {2}</h1><h2>{3}</h2><br><b>Date de naissance: </b>{4}<br /><b>Date de décès:{5}</b><p>{6}</p></div>";
27
	private String structureDescription = null;
-
 
Line 28... Line 46...
28
 
46
	
29
	public PersonneDetailPanneauVue() {
47
	
Line 30... Line 48...
30
		Registry.register(RegistreId.PANNEAU_PERSONNE_DETAIL, this);
48
	public PersonneDetailPanneauVue() {
31
		
49
		
32
		setHeaderVisible(false);
-
 
33
		setLayout(new FitLayout());
-
 
34
 
-
 
35
		content = new ContentPanel();
-
 
36
		content.setBodyBorder(false);
-
 
37
		content.setHeaderVisible(false);
-
 
Line -... Line 50...
-
 
50
		Registry.register(RegistreId.PANNEAU_PERSONNE_DETAIL, this);
-
 
51
		setLayout(new FitLayout());
38
		content.setScrollMode(Scroll.AUTO);
52
		
39
 
53
		infoGenerales = new TabItem("Informations Générales");
Line 40... Line 54...
40
		header = new Html();
54
		this.add(infoGenerales);
41
		header.setStyleName("coel-detail");
55
		
42
		content.setTopComponent(header);
56
		infoBio = new TabItem("Biographie");
43
 
57
		infoBio.disable();
Line 44... Line 58...
44
		add(content);
58
		this.add(infoBio);
45
	}
59
	}
46
 
60
 
47
	public void ajouterParam(Params parametres, String nomChamp, Personne personne)	{
-
 
48
		parametres.add(personne.obtenirValeurChamp(nomChamp));
61
	private void ajouterParam(Params parametres, String nomChamp, Personne personne)	{
49
		//return parametres;
62
		Object valeur = personne.obtenirValeurChamp(nomChamp);
50
	}	
-
 
51
	
-
 
52
	public void afficherDetailPersonne(Personne personne) {
-
 
53
		if (personne != null) {
-
 
Line 54... Line 63...
54
			content.removeAll();
63
		parametres.add(valeur);
55
			
64
	}	
-
 
65
	
-
 
66
	public void afficherDetailPersonne(Personne personne) {
-
 
67
		if (personne != null) {
-
 
68
			infoGenerales.removeAll();
-
 
69
			infoBio.removeAll();
-
 
70
			infoBio.disable();
56
			//Header	
71
			
-
 
72
			//Contenu
-
 
73
			Params infoGenParams = new Params();
-
 
74
			ajouterParam(infoGenParams, "fmt_nom_complet", personne);
-
 
75
			ajouterParam(infoGenParams, "truk_courriel", personne);
-
 
76
			ajouterParam(infoGenParams, "adresse_01", personne);
-
 
77
			ajouterParam(infoGenParams, "adresse_02", personne);
-
 
78
			ajouterParam(infoGenParams, "code_postal", personne);
-
 
79
			ajouterParam(infoGenParams, "ville", personne);
-
 
80
			ajouterParam(infoGenParams, "description", personne);
-
 
81
			ajouterParam(infoGenParams, "cp_truk_fax", personne);
-
 
82
			
-
 
83
			//Info générales
-
 
84
			infoGenerales.addText(Format.substitute(contenuInfo, infoGenParams));
-
 
85
			
-
 
86
			Params bioParams = new Params();
-
 
87
			// Nécessaire que si une biographie existe...
-
 
88
			// FIXME : remplacer par un id role? 
-
 
89
			if ((personne.obtenirValeurChamp("biographie")!=null)&&(!((String) personne.obtenirValeurChamp("biographie")).trim().equals("")))	{
-
 
90
				
-
 
91
				contenuBio = "<div style='padding: 12px;'><h1>{0} {1} {2}</h1><h2>{3}</h2><br><b>Date de naissance: </b>{4}<br /><b>Date de décès:{5}</b><p>a{6}a</p></div>";
-
 
92
								
-
 
93
				ajouterParam(bioParams, "ce_truk_prefix", personne);
Line 57... Line -...
57
			Params enteteParams = new Params();
-
 
58
			ajouterParam(enteteParams, "fmt_nom_complet", personne);
-
 
Line 59... Line 94...
59
			ajouterParam(enteteParams, "truk_courriel", personne);
94
				ajouterParam(bioParams, "fmt_nom_complet", personne);
Line 60... Line 95...
60
			
95
				ajouterParam(bioParams, "ce_truk_suffix", personne);
61
			header.getElement().setInnerHTML(Format.substitute(enteteHTML, enteteParams));
96
				ajouterParam(bioParams, "abreviation", personne);
62
			
97
				ajouterParam(bioParams, "naissance_date", personne);
63
			//Contenu
-
 
-
 
98
				ajouterParam(bioParams, "deces_date", personne);
64
			Params contenuParams = new Params();
99
				ajouterParam(bioParams, "biographie", personne);
65
			ajouterParam(contenuParams, "description", personne);
100
				infoBio.enable();
Line 66... Line 101...
66
			
101
				
67
			ajouterParam(contenuParams, "adresse_01", personne);
102
			}