Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 681 Rev 689
Line 70... Line 70...
70
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
70
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
71
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
71
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
72
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
72
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
73
import com.google.gwt.core.client.GWT;
73
import com.google.gwt.core.client.GWT;
74
import com.google.gwt.i18n.client.DateTimeFormat;
74
import com.google.gwt.i18n.client.DateTimeFormat;
-
 
75
import com.google.gwt.user.client.ui.Image;
75
import com.google.gwt.user.client.ui.Widget;
76
import com.google.gwt.user.client.ui.Widget;
Line 76... Line 77...
76
 
77
 
Line 77... Line 78...
77
public class PersonneForm extends FormPanel implements Rafraichissable {
78
public class PersonneForm extends FormPanel implements Rafraichissable {
Line 647... Line 648...
647
		hmIdentite.put("taDescription", taDescription);
648
		hmIdentite.put("taDescription", taDescription);
Line 648... Line 649...
648
		
649
		
Line 649... Line 650...
649
		fsAutresInfos.add(lcAutreInformations1);
650
		fsAutresInfos.add(lcAutreInformations1);
650
		
651
		
651
		// Logo
652
		// Logo
Line 652... Line 653...
652
		LayoutContainer lcAutreInformations2 = new LayoutContainer();
653
		LayoutContainer lcLogoUrl = new LayoutContainer();
653
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
654
		hmIdentite.put("lcLogoUrl", lcLogoUrl);
654
		
655
		
Line 655... Line 656...
655
		LabelField lfUrlLogo = new LabelField();
656
		LabelField lfUrlLogo = new LabelField();
656
		lfUrlLogo.setText("<b>Logo:</b>");
657
		lfUrlLogo.setText("<b>Logo:</b>");
Line 657... Line 658...
657
		lcAutreInformations2.add(lfUrlLogo);
658
		lcLogoUrl.add(lfUrlLogo);
Line 677... Line 678...
677
				TextField<String> tfUrlLogo = (TextField) hmIdentite.get("tfUrlLogo");
678
				TextField<String> tfUrlLogo = (TextField) hmIdentite.get("tfUrlLogo");
678
				String strUrl = tfUrlLogo.getValue();
679
				String strUrl = tfUrlLogo.getValue();
Line 679... Line 680...
679
				
680
				
680
				if ((strUrl == null)||(strUrl.trim().equals("http://"))||(strUrl.trim().equals("")))	{
681
				if ((strUrl == null)||(strUrl.trim().equals("http://"))||(strUrl.trim().equals("")))	{
681
					MessageBox.alert("Erreur de saisie", "Vous devez saisir un URL", null);
682
					MessageBox.alert("Erreur de saisie", "Vous devez saisir un URL", null);
682
				} else if(hmIdentite.get("url-" + strUrl) != null)	{
683
				} else if(hmIdentite.get("lc-" + strUrl) != null)	{
683
					MessageBox.alert("Erreur de saisie", "L'url est déjà présente dans la liste.", null);
684
					MessageBox.alert("Erreur de saisie", "L'url est déjà présente dans la liste.", null);
684
				}	else	{
685
				}	else	{
685
					tfUrlLogo.setValue("http://");
686
					tfUrlLogo.setValue("http://");
686
					//if (!strUrl.matches("[a-z]{3,}://[a-z0-9-]+.[.a-z0-9-]+(?::[0-9]*)?"))	{
687
					//if (!strUrl.matches("[a-z]{3,}://[a-z0-9-]+.[.a-z0-9-]+(?::[0-9]*)?"))	{
Line 696... Line 697...
696
				
697
				
697
			}
698
			}
Line 698... Line 699...
698
		});
699
		});
699
	
700
	
Line -... Line 701...
-
 
701
		lcUrlLogo.add(ibAjouterUrlLogo, new ColumnData(0.15));
-
 
702
		lcLogoUrl.add(lcUrlLogo);
-
 
703
			
-
 
704
		fsAutresInfos.add(lcLogoUrl);
700
		lcUrlLogo.add(ibAjouterUrlLogo, new ColumnData(0.15));
705
		
Line 701... Line 706...
701
		lcAutreInformations2.add(lcUrlLogo);
706
		LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
702
			
707
		hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
703
		fsAutresInfos.add(lcAutreInformations2);
708
		fsAutresInfos.add(lcAutreInformations2);
Line 1121... Line 1126...
1121
					LinkedList<String> lLogo = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
1126
					LinkedList<String> lLogo = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_logo");
1122
					if (lLogo!=null)	{
1127
					if (lLogo!=null)	{
1123
						Iterator<String> itLogo = lLogo.iterator(); 
1128
						Iterator<String> itLogo = lLogo.iterator(); 
1124
						String strValeurLogo = "";
1129
						String strValeurLogo = "";
1125
						while (itLogo.hasNext())	{
1130
						while (itLogo.hasNext())	{
1126
							strValeurLogo += itLogo.next();
1131
							strValeurLogo = itLogo.next();
1127
							if (!strValeurLogo.trim().equals(""))	{
1132
							if (!strValeurLogo.trim().equals(""))	{
1128
								ajouterUrlLogo(strValeurLogo);
1133
								ajouterUrlLogo(strValeurLogo);
1129
							}
1134
							}
1130
						}
1135
						}
1131
					}
1136
					}
Line 1462... Line 1467...
1462
	public void ajouterUrlLogo(String strUrl)	{
1467
	public void ajouterUrlLogo(String strUrl)	{
Line 1463... Line 1468...
1463
		
1468
		
Line 1464... Line 1469...
1464
		LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcAutreInformations2");
1469
		LayoutContainer lcUrlContainer  = (LayoutContainer) hmIdentite.get("lcAutreInformations2");
1465
		
1470
		
1466
		LayoutContainer lcUrl = new LayoutContainer();
1471
		LayoutContainer lcUrl = new LayoutContainer();
Line 1467... Line -...
1467
		lcUrl.setLayout(new ColumnLayout());
-
 
1468
		hmIdentite.put("lc-" + strUrl, lcUrl);
1472
		lcUrl.setLayout(new RowLayout());
-
 
1473
		hmIdentite.put("lc-" + strUrl, lcUrl);
1469
		
1474
		
1470
		
-
 
1471
		Text tUrl = new Text(strUrl);
1475
		Image logo = new Image(strUrl);
Line 1472... Line 1476...
1472
		hmIdentite.put("url-"+strUrl, tUrl);
1476
		logo.setHeight("150px");
1473
		
1477
		logo.setTitle(strUrl);
-
 
1478
		lcUrl.add(logo);
1474
		lcUrl.add(tUrl, new ColumnData(0.8));
1479
		
1475
		
1480
		Button ibSupprimerUrl = new Button();
Line 1476... Line 1481...
1476
		Button ibSupprimerUrl = new Button();
1481
		ibSupprimerUrl.setIcon(Images.ICONES.supprimer());
Line 1487... Line 1492...
1487
				
1492
				
Line 1488... Line 1493...
1488
				lcUrlContainer.remove(lcUrl);
1493
				lcUrlContainer.remove(lcUrl);
1489
				
1494
				
1490
				HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo");
1495
				HiddenField<String> hfUrlLogo = (HiddenField<String>) hmIdentite.get("hfUrlLogo");
Line 1491... Line 1496...
1491
				String strValeurUrl = hfUrlLogo.getValue();
1496
				String strValeurUrl = hfUrlLogo.getValue();
1492
				strValeurUrl = strUrl.replace(strUrl, "");
1497
				strValeurUrl = strValeurUrl.replace(strUrl, "");
1493
				
1498
				
Line 1494... Line 1499...
1494
				hfUrlLogo.setValue(strValeurUrl);
1499
				hfUrlLogo.setValue(strValeurUrl);
1495
			}
1500
			}
Line -... Line 1501...
-
 
1501
		});
-
 
1502
		
1496
		});
1503
		lcUrl.add(ibSupprimerUrl);
1497
		
1504
		lcUrlContainer.add(lcUrl);
1498
		lcUrl.add(ibSupprimerUrl, new ColumnData(0.15));
1505
		
1499
		lcUrlContainer.add(lcUrl);
1506
		
1500
		
1507