Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 695 Rev 701
Line 10... Line 10...
10
 
10
 
11
import org.tela_botanica.client.ComposantClass;
11
import org.tela_botanica.client.ComposantClass;
12
import org.tela_botanica.client.Mediateur;
12
import org.tela_botanica.client.Mediateur;
13
import org.tela_botanica.client.RegistreId;
13
import org.tela_botanica.client.RegistreId;
-
 
14
import org.tela_botanica.client.composants.ChampMultiValeurs;
14
import org.tela_botanica.client.composants.ChampMultiValeurs;
15
import org.tela_botanica.client.composants.ChampMultiValeursImage;
15
import org.tela_botanica.client.images.Images;
16
import org.tela_botanica.client.images.Images;
16
import org.tela_botanica.client.interfaces.Rafraichissable;
17
import org.tela_botanica.client.interfaces.Rafraichissable;
Line 17... Line 18...
17
import org.tela_botanica.client.modeles.Configuration;
18
import org.tela_botanica.client.modeles.Configuration;
Line 499... Line 500...
499
		fsContact.setLayout(new RowLayout());
500
		fsContact.setLayout(new RowLayout());
Line 500... Line 501...
500
 
501
 
501
		right.add(fsContact);
502
		right.add(fsContact);
Line 502... Line -...
502
		hmIdentite.put("fsContact", fsContact);
-
 
503
 
-
 
504
		//LabelField lfCourriel = new LabelField();
-
 
505
		//lfCourriel.setText("<b>Courriels:</b>");
503
		hmIdentite.put("fsContact", fsContact);
-
 
504
 
506
 
505
		ChampMultiValeurs courriels = new ChampMultiValeurs("Courriels");
507
		ChampMultiValeurs courriels = new ChampMultiValeurs("Courriels");
506
		courriels.setValidation("(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*", "moi@domaine.fr");
Line 508... Line 507...
508
		fsContact.add(courriels);
507
		fsContact.add(courriels);
Line 558... Line 557...
558
		
557
		
559
		// Logo
558
		// Logo
560
		LayoutContainer lcLogoUrl = new LayoutContainer();
559
		LayoutContainer lcLogoUrl = new LayoutContainer();
Line 561... Line 560...
561
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
560
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
562
		
561
		
-
 
562
		ChampMultiValeursImage logo = new ChampMultiValeursImage("Logos");
-
 
563
		logo.setImageHeight("150px");
563
		LabelField lfUrlLogo = new LabelField();
564
		logo.setValeurParDefaut("http://");
Line 564... Line -...
564
		lfUrlLogo.setText("<b>Logo:</b>");
-
 
565
		lcLogoUrl.add(lfUrlLogo);
-
 
566
		
-
 
567
		LayoutContainer lcUrlLogo = new LayoutContainer(new ColumnLayout());
-
 
568
		hmIdentite.put("lcUrlLogo", lcUrlLogo);
565
		logo.setValeurBoutonSupprimer("Supprimer");
Line 569... Line -...
569
	
-
 
570
		TextField tfUrlLogo = new TextField();
-
 
571
		tfUrlLogo.setValue("http://");
-
 
572
		
-
 
573
		HiddenField<String> hfUrlLogo = new HiddenField<String>();
-
 
574
		hmIdentite.put("hfUrlLogo", hfUrlLogo);
-
 
575
 
-
 
576
		lcUrlLogo.add(tfUrlLogo, new ColumnData(0.8));
-
 
577
		hmIdentite.put("tfUrlLogo", tfUrlLogo);
-
 
578
 
-
 
579
		Button ibAjouterUrlLogo = new Button();
-
 
580
		ibAjouterUrlLogo.setIcon(Images.ICONES.ajouter());
-
 
581
		ibAjouterUrlLogo.addSelectionListener(new SelectionListener<ButtonEvent>() {
-
 
582
 
-
 
583
			public void componentSelected(ButtonEvent ce) {
-
 
584
				
-
 
585
				TextField<String> tfUrlLogo = (TextField) hmIdentite.get("tfUrlLogo");
-
 
586
				String strUrl = tfUrlLogo.getValue();
-
 
587
				
-
 
588
				if ((strUrl == null)||(strUrl.trim().equals("http://"))||(strUrl.trim().equals("")))	{
-
 
589
					MessageBox.alert("Erreur de saisie", "Vous devez saisir un URL", null);
-
 
590
				} else if(hmIdentite.get("lc-" + strUrl) != null)	{
-
 
591
					MessageBox.alert("Erreur de saisie", "L'url est déjà présente dans la liste.", null);
-
 
592
				}	else	{
-
 
593
					tfUrlLogo.setValue("http://");
-
 
594
					//if (!strUrl.matches("[a-z]{3,}://[a-z0-9-]+.[.a-z0-9-]+(?::[0-9]*)?"))	{
-
 
595
					if (!strUrl.startsWith("http://"))	{
-
 
596
							MessageBox.alert("Erreur de saisie", "L'adresse n'est pas au bon format (ex: http://www.domain.com)", null);			
-
 
597
						} else if (strUrl.length()>255){
-
 
598
							MessageBox.alert("Erreur de saisie", "L'adresse ne peut dépasser 255 caractères", null);
-
 
599
						} else {
-
 
600
							ajouterUrlLogo(strUrl);
-
 
601
						}
-
 
602
					
-
 
603
				}
-
 
604
				
-
 
605
			}
-
 
606
		});
-
 
607
	
566
		hmIdentite.put("logos", logo);
Line 608... Line 567...
608
		lcUrlLogo.add(ibAjouterUrlLogo, new ColumnData(0.15));
567
		
609
		lcLogoUrl.add(lcUrlLogo);
568
		lcLogoUrl.add(logo);
610
			
569
		
Line 611... Line -...
611
		fsAutresInfos.add(lcLogoUrl);
-
 
612
		
-
 
613
		LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
-
 
614
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
-
 
615
		fsAutresInfos.add(lcAutreInformations2);
-
 
616
			
-
 
617
		TextArea taLogo = new TextArea();
-
 
618
		taLogo.setFieldLabel("Logos");
-
 
619
		taLogo.setWidth("100%");
570
		fsAutresInfos.add(logo);
Line 620... Line 571...
620
		taLogo.setEmptyText("Saisissez les adresses des logos séparées par un saut de ligne");
571
		
621
		//fsAutresInfos.add(taLogo, fd100);
572
		LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
622
			
573
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
Line 1011... Line 962...
1011
						cbSexe.setRawValue(strSexe);
962
						cbSexe.setRawValue(strSexe);
1012
					}
963
					}
Line 1013... Line 964...
1013
					
964
					
Line 1014... Line 965...
1014
					((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
965
					((TextArea) hmIdentite.get("taDescription")).setRawValue((String) personne.get("description"));
1015
					
-
 
1016
					// Logos
966
					
1017
					TextArea taLogo = (TextArea) hmIdentite.get("taLogo");
-
 
1018
					LinkedList<String> lLogo = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
-
 
1019
					if (lLogo!=null)	{
-
 
1020
						Iterator<String> itLogo = lLogo.iterator(); 
-
 
1021
						String strValeurLogo = "";
-
 
1022
						while (itLogo.hasNext())	{
-
 
1023
							strValeurLogo = itLogo.next();
-
 
1024
							if (!strValeurLogo.trim().equals(""))	{
-
 
1025
								ajouterUrlLogo(strValeurLogo);
-
 
1026
							}
-
 
Line 1027... Line 967...
1027
						}
967
					//Logo
1028
					}
968
					((ChampMultiValeurs) hmIdentite.get("logos")).peupler(personne.getString("truk_logo"));
1029
					
969
					
Line 1410... Line 1350...
1410
		strValeur = obtenirValeurCombo("cbRegion");
1350
		strValeur = obtenirValeurCombo("cbRegion");
1411
		personneSelectionnee.set("ce_truk_region", strValeur);
1351
		personneSelectionnee.set("ce_truk_region", strValeur);
Line 1412... Line 1352...
1412
		
1352
		
Line 1413... Line 1353...
1413
		personneSelectionnee.set("truk_telephone", ((HiddenField<String>) hmIdentite.get("hfTelephone")).getValue());
1353
		personneSelectionnee.set("truk_telephone", ((HiddenField<String>) hmIdentite.get("hfTelephone")).getValue());
1414
		
-
 
1415
		String logoUrls = ((HiddenField<String>) hmIdentite.get("hfUrlLogo")).getValue();
-
 
1416
		if (logoUrls == null)	{
-
 
1417
			logoUrls = "";
1354
		
Line 1418... Line 1355...
1418
		}
1355
		String logoUrls = ((ChampMultiValeursImage) hmIdentite.get("logos")).getValeurs();
Line 1419... Line 1356...
1419
		personneSelectionnee.set("truk_logo", logoUrls);
1356
		personneSelectionnee.set("truk_logo", logoUrls);