Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 378 → Rev 379

/trunk/src/org/tela_botanica/client/vues/StructureDetailPanneauVue.java
1,9 → 1,18
package org.tela_botanica.client.vues;
 
import java.util.Iterator;
import java.util.Map.Entry;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Structure;
import org.tela_botanica.client.modeles.StructureAPersonne;
import org.tela_botanica.client.modeles.StructureAPersonneListe;
import org.tela_botanica.client.modeles.StructureConservation;
import org.tela_botanica.client.modeles.StructureValorisation;
 
import com.extjs.gxt.ui.client.Events;
import com.extjs.gxt.ui.client.Style.Scroll;
25,19 → 34,24
private Mediateur mediateur = null;
private String enteteTpl = null;
private String contenuTpl = null;
private String identificationTpl = null;
private String personnelTpl = null;
private String lignePersonnelTpl = null;
private Structure structure = null;
private StructureAPersonneListe personnel = null;
private StructureValorisation valorisation = null;
private StructureConservation conservation = null;
private ContentPanel panneauPrincipal = null;
private Html entete = null;
private TabPanel onglets = null;
private TabItem identificationOnglet = null;
private TabItem personnelOnglet = null;
 
public StructureDetailPanneauVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
initialiserEnteteHtmlTpl();
initialiserContenuHtmlTpl();
initialiserTousLesTpl();
setLayout(new FitLayout());
setBorders(false);
50,17 → 64,25
entete = new Html();
entete.setId(ComposantId.ZONE_DETAIL);
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
panneauPrincipal.setTopComponent(entete);
onglets = new TabPanel();
onglets.setId(ComposantId.ZONE_DETAIL_CORPS);
onglets.setHeight("100%");
onglets.setBorders(false);
onglets.setBodyBorder(false);
 
identificationOnglet = new TabItem("Général");
identificationOnglet.setBorders(false);
identificationOnglet.setScrollMode(Scroll.AUTO);
onglets.add(identificationOnglet);
personnelOnglet = new TabItem("Personnel");
personnelOnglet.setBorders(false);
personnelOnglet.setScrollMode(Scroll.AUTO);
onglets.add(personnelOnglet);
panneauPrincipal.add(onglets);
add(panneauPrincipal);
}
68,7 → 90,10
private void afficherDetailInstitution(Structure structureCourante) {
if (structureCourante != null) {
structure = structureCourante;
 
personnel = structure.getPersonnel();
valorisation = structure.getValorisation();
conservation = structure.getConservation();
afficherEntete();
afficherIdentification();
}
77,9 → 102,9
private void afficherEntete() {
Params enteteParams = new Params();
enteteParams.add(ComposantId.ZONE_DETAIL);
enteteParams.add(structure.getNom());
enteteParams.add(structure.getVille());
enteteParams.set("id", ComposantId.ZONE_DETAIL_ENTETE);
enteteParams.set("nom", structure.getNom());
enteteParams.set("ville", structure.getVille());
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
87,49 → 112,150
private void afficherIdentification() {
Params contenuParams = new Params();
contenuParams.add(structure.getDescription());
contenuParams.add(structure.getAdresse());
contenuParams.add(structure.getCodePostal());
contenuParams.add(structure.getVille());
contenuParams.add(structure.getRegion());
contenuParams.add(structure.getPays());
contenuParams.add(structure.getTelephone());
contenuParams.add(structure.getFax());
contenuParams.add(structure.getCourriel());
contenuParams.add(structure.getConditionAcces());
contenuParams.add(ComposantId.ZONE_DETAIL_CORPS);
 
String cHtml = Format.substitute(contenuTpl, contenuParams);
contenuParams.set("css_class", ComposantClass.DETAIL_CORPS_CONTENU);
contenuParams.set("description", structure.getDescription());
contenuParams.set("adresse", structure.getAdresse());
contenuParams.set("code_postal", structure.getCodePostal());
contenuParams.set("ville", structure.getVille());
contenuParams.set("region", structure.getRegion());
contenuParams.set("pays", structure.getPays());
contenuParams.set("tel", structure.getTelephone());
contenuParams.set("fax", structure.getFax());
contenuParams.set("courriel", structure.getCourriel());
contenuParams.set("acces", structure.getConditionAcces());
String cHtml = Format.substitute(identificationTpl, contenuParams);
HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
identificationOnglet.removeAll();
identificationOnglet.add(corpsConteneurDuHtml);
}
private void afficherPersonnel() {
Params contenuParams = new Params();
contenuParams.set("css_class", ComposantClass.DETAIL_CORPS_CONTENU);
contenuParams.set("fonction", mediateur.i18nC.fonction());
contenuParams.set("prenom", mediateur.i18nC.prenom());
contenuParams.set("nom", mediateur.i18nC.nom());
contenuParams.set("tel", mediateur.i18nC.telephoneFixe());
contenuParams.set("fax", mediateur.i18nC.fax());
contenuParams.set("courriel", mediateur.i18nC.courrielPrincipal());
contenuParams.set("statut", mediateur.i18nC.statut());
contenuParams.set("tps_w", mediateur.i18nC.tpsTravail());
contenuParams.set("specialite", mediateur.i18nC.specialite());
contenuParams.set("contact", mediateur.i18nC.boolContact());
String lignesPersonnel = "";
personnel = structure.getPersonnel();
Iterator<String> it = personnel.keySet().iterator();
while (it.hasNext()) {
StructureAPersonne personne = personnel.get(it.next());
Params ligneParams = new Params();
ligneParams.set("fonction", personne.getFonction());
ligneParams.set("prenom", personne.getPrenom());
ligneParams.set("nom", personne.getNom());
ligneParams.set("tel", personne.getTelephone());
ligneParams.set("fax", personne.getFax());
ligneParams.set("courriel", personne.getCourriel());
ligneParams.set("statut", personne.getStatut());
ligneParams.set("tps_w", personne.getBotaTravailHebdoTps());
ligneParams.set("specialite", personne.afficherSpecialite());
ligneParams.set("contact", personne.getContact());
lignesPersonnel += Format.substitute(lignePersonnelTpl, ligneParams);
}
contenuParams.set("lignes", lignesPersonnel);
String cHtml = Format.substitute(personnelTpl, contenuParams);
HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
personnelOnglet.removeAll();
personnelOnglet.add(corpsConteneurDuHtml);
}
private void initialiserTousLesTpl() {
initialiserEnteteHtmlTpl();
initialiserIdentificationTpl();
initialiserPersonnelTpl();
initialiserLignePersonnelTpl();
}
private void initialiserEnteteHtmlTpl() {
enteteTpl = "<div id='{0}'>"+
" <h1>{1}</h1>"+
" <h2>{2}</h2>" +
enteteTpl = "<div id='{id}'>"+
" <h1>{nom}</h1>"+
" <h2>{ville}</h2>" +
"</div>";
}
private void initialiserContenuHtmlTpl() {
contenuTpl = "<div id='{10}'>"+
private void initialiserIdentificationTpl() {
identificationTpl =
"<div class='{css_class}'>"+
" <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}"+
" <span style='font-weight:bold;'>Condition d'accès :</span> {acces}<br />"+
" <span style='font-weight:bold;'>Adresse :</span> {adresse}, {code_postal} {ville}, {region}, {pays}<br />"+
" <span style='font-weight:bold;'>Téléphone :</span> {tel}<br />"+
" <span style='font-weight:bold;'>Fax :</span> {fax}<br />"+
" <span style='font-weight:bold;'>Courriel :</span> {courriel}<br />"+
" {description}"+
"</div>";
}
private void initialiserPersonnelTpl() {
personnelTpl =
"<div class='{css_class}'>"+
" <h2>Personnel</h2>"+
" <table>"+
" <thead>"+
" <tr>" +
" <th>{fonction}</th>" +
" <th>{prenom}</th>" +
" <th>{nom}</th>" +
" <th>{tel}</th>" +
" <th>{fax}</th>" +
" <th>{courriel}</th>" +
" <th>{statut}</th>" +
" <th>{tps_w}</th>" +
" <th>{specialite}</th>" +
" <th>{contact}</th>" +
" </tr>"+
" </thead>"+
" <tbody>"+
" {lignes}"+
" </tbody>"+
" </table>"+
"</div>";
}
private void initialiserLignePersonnelTpl() {
lignePersonnelTpl =
"<tr>"+
" <td>{fonction}</td>"+
" <td>{prenom}</td>"+
" <td>{nom}</td>"+
" <td>{tel}</td>" +
" <td>{fax}</td>" +
" <td>{courriel}</td>" +
" <td>{statut}</td>" +
" <td>{tps_w}</td>" +
" <td>{specialite}</td>" +
" <td>{contact}</td>" +
"</tr>";
}
public void rafraichir(Object nouvelleDonnees) {
if (nouvelleDonnees instanceof Structure) {
afficherDetailInstitution((Structure) nouvelleDonnees);
} if (nouvelleDonnees instanceof Information) {
Information info = (Information) nouvelleDonnees;
if (info.getType().equals("liste_structure_a_personne")) {
allouerPersonnelAStructure((StructureAPersonneListe) info.getDonnee(0));
afficherPersonnel();
layout();
}
} else {
GWT.log("Pas de correspondance dans la méthode rafraichir() de la classe "+this.getClass(), null);
}
}
 
private void allouerPersonnelAStructure(StructureAPersonneListe personnel) {
structure.setPersonnel(personnel);
}
 
}
/trunk/src/org/tela_botanica/client/vues/StructureVue.java
2,6 → 2,7
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Structure;
import org.tela_botanica.client.modeles.StructureListe;
 
41,6 → 42,11
panneauInstitutionDetail.rafraichir(nouvelleDonnees);
} else if (nouvelleDonnees instanceof StructureListe) {
panneauInstitutionListe.rafraichir(nouvelleDonnees);
} else if (nouvelleDonnees instanceof Information) {
Information info = (Information) nouvelleDonnees;
if (info.getType().equals("liste_structure_a_personne")) {
panneauInstitutionDetail.rafraichir(nouvelleDonnees);
}
} else {
GWT.log("Pas de correspondance dans la méthode rafraichir() de la classe "+this.getClass(), null);
}
/trunk/src/org/tela_botanica/client/vues/StructureListePanneauVue.java
99,7 → 99,6
store.sort("ville", SortDir.ASC);
binder = new TableBinder<Structure>(table, store);
binder.setAutoSelect(true);
binder.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
public void selectionChanged(SelectionChangedEvent<Structure> event) {
Structure m = (Structure) event.getSelectedItem();
110,24 → 109,26
setLayout(new FitLayout());
}
 
private void clicListe(Structure institution) {
mediateur.clicListeInstitution(institution);
private void clicListe(Structure structure) {
if (store.getCount() > 0) {
mediateur.clicListeStructure(structure);
}
}
 
public void rafraichir(Object nouvelleDonnees) {
if (nouvelleDonnees instanceof StructureListe) {
StructureListe institutions = (StructureListe) nouvelleDonnees;
StructureListe structures = (StructureListe) nouvelleDonnees;
setHeading("Institutions");
List<Structure> liste = (List<Structure>) institutions.toList();
List<Structure> liste = (List<Structure>) structures.toList();
store.removeAll();
store.add(liste);
 
if (institutions.size() > 0) {
mediateur.actualiserPanneauCentral();
if (store.getCount() > 0) {
table.getSelectionModel().select(0);
}
mediateur.actualiserPanneauCentral();
} else if (nouvelleDonnees instanceof Information) {
Information info = (Information) nouvelleDonnees;
if (info.getType().equals("suppression_structure")) {
/trunk/src/org/tela_botanica/client/ComposantClass.java
17,4 → 17,5
public static final String ICONE_RAFRAICHIR = "icone-rafraichir";
public static final String ICONE_REPLIER_TOUT = "icone-replier-tout";
public static final String ICONE_SUPPRIMER = "icone-supprimer";
public static final String DETAIL_CORPS_CONTENU = "coel-detail-corps-contenu";
}
/trunk/src/org/tela_botanica/client/Mediateur.java
178,8 → 178,7
modele.selectionnerPublications(panneauCentre);
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
modele.selectionnerPersonne(panneauCentre, null, getProjetId(), null);
}
else {
} else {
GWT.log("Non implémenté! Menu id : "+codeMenuClique, null);
}
panneauCentre.layout();
304,7 → 303,6
contenuPanneauCentre = formulairePersonneVue;
panneauCentre.add(formulairePersonneVue);
selectionnerPersonne(formulairePersonneVue, personne);
panneauCentre.layout();
353,8 → 351,6
};
MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
} else {
Info.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
}
390,8 → 386,7
}
 
public void clicListePublication(Publication publication) {
((PublicationDetailPanneauVue) Registry.get(RegistreId.PANNEAU_PUBLICATION_DETAIL)).rafraichir(publication);
panneauCentre.rafraichir(publication);
}
 
public void clicAjouterPublication() {
405,8 → 400,7
public void clicModifierPublication(List<Publication> publicationListe) {
if(publicationListe.size() <= 0) {
MessageBox.alert("Attention", "Vous devez sélectionner une publication", null);
}
else {
} else {
Publication pubAModifier = publicationListe.get(publicationListe.size() -1);
panneauCentre.removeAll();
FormPublicationVue formPublicationVue = new FormPublicationVue();
415,15 → 409,12
panneauCentre.layout();
formPublicationVue.rafraichir(pubAModifier);
}
}
public void clicSupprimerPublication(final List<Publication> publicationListe) {
if(publicationListe.size() <= 0) {
MessageBox.alert("Attention", "Vous devez sélectionner une publication", null);
}
else {
} else {
String message = "" ;
if(publicationListe.size() == 1) {
message = "Voulez-vous vraiment supprimer cette publication ?";
439,7 → 430,7
Dialog dialog = (Dialog) ce.component;
Button btn = dialog.getButtonPressed();
if (btn.getText().equals(dialog.yesText)) {
if (btn.getText().equals(dialog.yesText)) {
modele.supprimerPublication(contenuPanneauCentre, getUtilisateurId(),publicationListe);
}
}
460,7 → 451,6
 
public void clicObtenirListeEditeurs(Rafraichissable vue) {
modele.selectionnerStructure(vue, null, null);
}
 
public void clicObtenirListeAuteurs(Rafraichissable vue) {
471,8 → 461,13
// GESTION DES STRUCTURES
//+----------------------------------------------------------------------------------------------------------------+
 
public void clicListeInstitution(Structure institution) {
((StructureDetailPanneauVue) Registry.get(RegistreId.PANNEAU_INSTITUTION_DETAIL)).rafraichir(institution);
public void clicListeStructure(Structure structure) {
contenuPanneauCentre.rafraichir(structure);
if (structure.getPersonnel() == null) {
selectionnerStructureAPersonne(contenuPanneauCentre, structure.getId(), StructureAPersonne.ROLE_EQUIPE);
} else {
GWT.log("OK personnel déjà chargé", null);
}
}
 
public void afficherListeStructures(StructureListe structuresACharger) {
495,9 → 490,9
public void clicModifierStructure(List<Structure> structureSelection) {
if (structureSelection.size() == 0) {
Info.display("Information", "Veuillez sélectionner une structure.");
} else if(structureSelection.size() > 1) {
} else if (structureSelection.size() > 1) {
Info.display("Information", "Veuillez sélectionner une seule structure à la fois.");
} else if(structureSelection.size() == 1) {
} else if (structureSelection.size() == 1) {
panneauCentre.removeAll();
FormStructureVue formStructureVue = new FormStructureVue(FormStructureVue.MODE_MODIFIER);
panneauCentre.add(formStructureVue);
/trunk/src/org/tela_botanica/client/ComposantId.java
17,6 → 17,6
public static final String DIV_IDENTIFICATION = "coel-identification";
public static final String DIV_IDENTIFICATION_MSG = "coel-identification-zone-msg";
public static final String PANNEAU_STATUT = "coel-statut";
public static final String ZONE_DETAIL = "coel-detail";
public static final Object ZONE_DETAIL_CORPS = "coel-detail-corps";
public static final String ZONE_DETAIL_ENTETE = "coel-detail-entete";
public static final String ZONE_DETAIL_CORPS = "coel-detail-corps";
}
/trunk/src/org/tela_botanica/public/Coel.css
81,81 → 81,55
/* #------------------------------------------------------------------------------------------------------# */
/* PANNEAU DÉTAIL */
/* #------------------------------------------------------------------------------------------------------# */
.coel-detail{
#coel-detail-entete{
height:55px;
background-color:#ddd;
border-bottom:1px solid silver;}
.coel-detail h1{
#coel-detail-entete h1{
font-weight:bold;
font-size:12px;
padding:5 0 2 5px;}
.coel-detail h2{
#coel-detail-entete h2{
font-size:11px;
font-weight:normal;
padding:0 5 0 5px;}
.coel-detail h3{
#coel-detail-entete h3{
font-size:11px;
font-weight:normal;
padding:0 5 5 5px;}
.coel-detail-body {
padding:12px;}
/* Liste de définition : style provenant de pompage.net : http://pompage.net/pompe/listesdefinitions/ */
dl.hb_affichage_tabulaire{
width:61em;}
.hb_affichage_tabulaire dt{
width:20em;
float:left;
margin:0;
padding:.2em;}
/* hack de commentaire avec un antislash pour ie5 mac \*/
dt{
clear:both;}
/* end hack */
.hb_affichage_tabulaire dd{
float:left;
z-index:1;
width:40em;
margin:0;
padding:.2em;}
h2, .parent, .hb_espace, .hb_ligne{
clear:both;}
.hb_titre_en_ligne{
display:inline;
padding-top:1em;}
#hb_renseignement_admin{
max-width:650px;
float:left;}
#hb_logo{
float:right;}
dt, label{
font-weight:bold;}
form ul{
list-style-type:none;}
.hb_img_icone{
border:0;
width:9px;
height:9px;}
.hb_img_fermer{
border:0;
width:9px;
height:9px;}
.hb_ligne{
border:.2em dotted;
width:4em;}
.hb_plier_deplier td{
padding:0;
margin:0;
text-align:left;
height:12px;
border-width:0;}
.hb_arborescence td{
padding:0;
margin:-5px 0 0 0;
text-align:left;
vertical-align:top;
border-width:0;}
.pair{
background-color:#FAD2C6;}
.coel-detail-corps-contenu{
padding:12px;
background-color:white;}
.coel-detail-corps-contenu h2{
font-size:14px;
color:#1C3C78;
padding:5px 0}
.coel-detail-corps-contenu table{
border:3px solid #6495ed;
border-collapse:collapse;
width:100%;
margin:auto;}
.coel-detail-corps-contenu thead, .coel-detail-corps-contenu tfoot{
background-color:#D0E3FA;
background-image:url(sky.jpg);
border:1px solid #6495ed;}
.coel-detail-corps-contenu tbody{
background-color:#FFFFFF;
border:1px solid #6495ed;}
.coel-detail-corps-contenu th{
font-family:monospace;
border:1px dotted #6495ed;
padding:5px;
background-color:#EFF6FF;
width:25%;}
.coel-detail-corps-contenu td{
font-family:sans-serif;
font-size:80%;
border:1px solid #6495ed;
padding:5px;
text-align:left;}
.coel-detail-corps-contenu caption {
font-family:sans-serif;}
/* #------------------------------------------------------------------------------------------------------# */
/* ÎCONES */
/* #------------------------------------------------------------------------------------------------------# */