... | ... |
@@ -77,4 +77,6 @@ unsavedChanges=You have unsaved changes. |
77 | 77 |
permsTab=Sharing |
78 | 78 |
hsmTab=Archive |
79 | 79 |
defaultGroup=Default group |
80 |
-externalUser=External user |
|
81 | 80 |
\ No newline at end of file |
81 |
+externalUser=External user |
|
82 |
+template=Template |
|
83 |
+templateInfo=This HTML template will be added to the event description. The template may contain variables. These variables are defined above, in the "Custom Properties" section. The usage is: ${MyVariable}. Some variables are always available, such as ${ResourceName} or ${Organizer}. When displaying the template, this is the organizer's language that is used. |
... | ... |
@@ -1,9 +1,9 @@ |
1 | 1 |
headingTitle=Administration centrale |
2 | 2 |
headingTitleVersionned=Administration centrale (version {0}) |
3 |
-logoutLink=Se déconnecter |
|
3 |
+logoutLink=Se d\u00e9connecter |
|
4 | 4 |
loading=Chargement... |
5 | 5 |
centralAdmin=Administration centrale |
6 |
-selectColumn=Sélectionner |
|
6 |
+selectColumn=S\u00e9lectionner |
|
7 | 7 |
typeColumn=Type |
8 | 8 |
loginColumn=Identifiant |
9 | 9 |
displayNameColumn=Nom complet |
... | ... |
@@ -11,27 +11,27 @@ domainColumn=Domaine |
11 | 11 |
iconTipUser=Utilisateur |
12 | 12 |
iconTipGroup=Groupe |
13 | 13 |
iconTipResource=Ressource |
14 |
-iconTipMailshare=Boîte aux lettres partagée |
|
14 |
+iconTipMailshare=Bo\u00eete aux lettres partag\u00e9e |
|
15 | 15 |
iconTipExternalUser=Utilisateur externe |
16 | 16 |
iconTipCalendar=Calendrier |
17 |
-iconTipAddressBook=Carnet d’adresses |
|
18 |
-iconTipGenPassword=Générer un mot de passe pour l’utilisateur |
|
17 |
+iconTipAddressBook=Carnet d\u2019adresses |
|
18 |
+iconTipGenPassword=G\u00e9n\u00e9rer un mot de passe pour l\u2019utilisateur |
|
19 | 19 |
newButton=Nouveau |
20 | 20 |
pagerOf=sur |
21 | 21 |
newUserTitle=Nouvel utilisateur |
22 |
-firstName=Prénom |
|
22 |
+firstName=Pr\u00e9nom |
|
23 | 23 |
lastName=Nom |
24 | 24 |
displayName=Nom complet |
25 | 25 |
login=Identifiant |
26 | 26 |
password=Mot de passe |
27 | 27 |
mailAddress=Adresse mail |
28 | 28 |
domain=Domaine |
29 |
-perms=Groupe par défaut |
|
29 |
+perms=Groupe par d\u00e9faut |
|
30 | 30 |
save=Enregistrer |
31 | 31 |
done=Valider |
32 | 32 |
cancel=Annuler |
33 |
-create=Créer |
|
34 |
-createEdit=Créer & éditer |
|
33 |
+create=Cr\u00e9er |
|
34 |
+createEdit=Cr\u00e9er & \u00e9diter |
|
35 | 35 |
description=Description |
36 | 36 |
changePassword=Forcer le changement du mot de passe |
37 | 37 |
confirmPass=Confirmation du mot de passe |
... | ... |
@@ -39,43 +39,45 @@ delete=Supprimer |
39 | 39 |
user=Utilisateur |
40 | 40 |
none=Aucun |
41 | 41 |
group=Groupe |
42 |
-mailshare=Boîte aux lettres partagée |
|
42 |
+mailshare=Bo\u00eete aux lettres partag\u00e9e |
|
43 | 43 |
resource=Ressource |
44 | 44 |
calendar=Calendrier |
45 |
-addressBook=Carnet d’adresses |
|
45 |
+addressBook=Carnet d\u2019adresses |
|
46 | 46 |
allAliases=Tous les alias |
47 | 47 |
allDomain=Tous les domaines |
48 |
-newMailshareTitle=Nouvelle boîte aux lettres partagée |
|
48 |
+newMailshareTitle=Nouvelle bo\u00eete aux lettres partag\u00e9e |
|
49 | 49 |
newGroupTitle=Nouveau groupe |
50 | 50 |
newResourceTitle=Nouvelle ressource |
51 | 51 |
newDomainTitle=Nouveau domaine |
52 | 52 |
newResourceTypeTitle=Nouveau type de ressource |
53 | 53 |
postalAddressTitle=Adresse postale |
54 | 54 |
accountName=Informations sur le compte |
55 |
-rootDelegation=Délégation racine |
|
55 |
+rootDelegation=D\u00e9l\u00e9gation racine |
|
56 | 56 |
all=Tous |
57 | 57 |
addFilter=Ajouter un filtre... |
58 |
-deleteConfirmation=Voulez-vous supprimer cette entrée ? |
|
59 |
-massDeleteConfirmation=Voulez-vous supprimer ces entrées ? |
|
60 |
-markAsDefault=Marquer comme email par défaut |
|
61 |
-defaultEmail=Email par défaut |
|
58 |
+deleteConfirmation=Voulez-vous supprimer cette entr\u00e9e ? |
|
59 |
+massDeleteConfirmation=Voulez-vous supprimer ces entr\u00e9es ? |
|
60 |
+markAsDefault=Marquer comme email par d\u00e9faut |
|
61 |
+defaultEmail=Email par d\u00e9faut |
|
62 | 62 |
addEmail=Ajouter un email |
63 | 63 |
removeEmail=Supprimer cet email |
64 | 64 |
emailAddress=Adresse email |
65 |
-resourceTypeDefaultIcon=Icône par défaut |
|
66 |
-resourceBookingMinDuration=Durée minimale de réservation |
|
67 |
-workingDays=Jours ouvrés |
|
68 |
-workingHours=Heures ouvrées |
|
69 |
-generalTab=Général |
|
70 |
-customProperties=Propriétés personnalisées |
|
65 |
+resourceTypeDefaultIcon=Ic\u00f4ne par d\u00e9faut |
|
66 |
+resourceBookingMinDuration=Dur\u00e9e minimale de r\u00e9servation |
|
67 |
+workingDays=Jours ouvr\u00e9s |
|
68 |
+workingHours=Heures ouvr\u00e9es |
|
69 |
+generalTab=G\u00e9n\u00e9ral |
|
70 |
+customProperties=Propri\u00e9t\u00e9s personnalis\u00e9es |
|
71 | 71 |
type=Type |
72 |
-hideFromGal=Cacher des listes d’adresses BlueMind |
|
73 |
-hideMembersFromGal=Ne pas afficher les membres dans le carnet d’adresses |
|
74 |
-enableArchiveMail=Conserver une copie des messages reçus |
|
75 |
-unsavedChanges=Vous avez des modifications non sauvegardées. |
|
72 |
+hideFromGal=Cacher des listes d\u2019adresses BlueMind |
|
73 |
+hideMembersFromGal=Ne pas afficher les membres dans le carnet d\u2019adresses |
|
74 |
+enableArchiveMail=Conserver une copie des messages re\u00e7us |
|
75 |
+unsavedChanges=Vous avez des modifications non sauvegard\u00e9es. |
|
76 | 76 |
permsTab=Partage |
77 | 77 |
hsmTab=Archivage |
78 | 78 |
emailColumn=Email |
79 | 79 |
iconTipCalendar=Calendrier |
80 |
-defaultGroup=Groupe par défaut |
|
80 |
+defaultGroup=Groupe par d\u00e9faut |
|
81 | 81 |
externalUser=Utilisateur externe |
82 |
+template=Patron |
|
83 |
+templateInfo=Le patron, qui est au format HTML, sera ajout\u00e9 \u00e0 la description de l'\u00e9v\u00e8nement. Des variables peuvent \u00eatres utilis\u00e9es pour le rendre dynamique. Ces variables sont d\u00e9finies plus haut dans la partie "Propri\u00e9t\u00e9s personnalis\u00e9es". Le format pour int\u00e9grer une variable est: ${MaVariable}. Certaines variables sont toujours disponibles, c'est le cas de ${NomRessource} et ${Organisateur}. La langue utilis\u00e9e sera celle de l'organisateur. |
... | ... |
@@ -34,6 +34,7 @@ import com.google.gwt.user.client.ui.Image; |
34 | 34 |
|
35 | 35 |
import net.bluemind.core.commons.gwt.GwtSerDerUtils; |
36 | 36 |
import net.bluemind.core.commons.gwt.JsMapStringJsObject; |
37 |
+import net.bluemind.core.commons.gwt.JsMapStringString; |
|
37 | 38 |
import net.bluemind.gwtconsoleapp.base.editor.WidgetElement; |
38 | 39 |
import net.bluemind.gwtconsoleapp.base.editor.gwt.CompositeGwtWidgetElement; |
39 | 40 |
import net.bluemind.gwtconsoleapp.base.editor.gwt.GwtWidgetElement; |
... | ... |
@@ -67,6 +68,9 @@ public class ResourceTypeGeneralEditor extends CompositeGwtWidgetElement { |
67 | 68 |
|
68 | 69 |
private String imageUuid; |
69 | 70 |
|
71 |
+ @UiField |
|
72 |
+ TemplateContainer templateContainer; |
|
73 |
+ |
|
70 | 74 |
protected ResourceTypeGeneralEditor() { |
71 | 75 |
HTMLPanel panel = uiBinder.createAndBindUi(this); |
72 | 76 |
icon.getElement().getStyle().setCursor(Cursor.POINTER); |
... | ... |
@@ -92,6 +96,8 @@ public class ResourceTypeGeneralEditor extends CompositeGwtWidgetElement { |
92 | 96 |
new ResourceTypeDescriptorPropertyGwtSerDer()).deserialize(new JSONArray(rt.getProperties().cast())); |
93 | 97 |
|
94 | 98 |
customPropContainer.setProperties(properties); |
99 |
+ |
|
100 |
+ templateContainer.setTemplates(rt.getTemplates().asMap()); |
|
95 | 101 |
} |
96 | 102 |
|
97 | 103 |
@Override |
... | ... |
@@ -113,6 +119,8 @@ public class ResourceTypeGeneralEditor extends CompositeGwtWidgetElement { |
113 | 119 |
map.putString("resourceTypeIcon", imageUuid); |
114 | 120 |
} |
115 | 121 |
|
122 |
+ rt.setTemplates(JsMapStringString.create(templateContainer.getTemplates())); |
|
123 |
+ |
|
116 | 124 |
} |
117 | 125 |
|
118 | 126 |
@UiHandler("icon") |
... | ... |
@@ -86,6 +86,15 @@ |
86 | 86 |
<rt:CustomPropertyContainer ui:field="customPropContainer"></rt:CustomPropertyContainer> |
87 | 87 |
</td> |
88 | 88 |
</tr> |
89 |
+ <tr class="setting"> |
|
90 |
+ <td class="label" > |
|
91 |
+ <ui:msg key="template">Template</ui:msg> |
|
92 |
+ </td> |
|
93 |
+ <td class="form"> |
|
94 |
+ <p align="justify" style="width:32.7rem;"><i><ui:msg key="templateInfo">Template info</ui:msg></i></p> |
|
95 |
+ <rt:TemplateContainer ui:field="templateContainer"></rt:TemplateContainer> |
|
96 |
+ </td> |
|
97 |
+ </tr> |
|
89 | 98 |
|
90 | 99 |
</table> |
91 | 100 |
|
92 | 101 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,153 @@ |
1 |
+/* BEGIN LICENSE |
|
2 |
+ * Copyright © Blue Mind SAS, 2012-2016 |
|
3 |
+ * |
|
4 |
+ * This file is part of BlueMind. BlueMind is a messaging and collaborative |
|
5 |
+ * solution. |
|
6 |
+ * |
|
7 |
+ * This program is free software; you can redistribute it and/or modify |
|
8 |
+ * it under the terms of either the GNU Affero General Public License as |
|
9 |
+ * published by the Free Software Foundation (version 3 of the License). |
|
10 |
+ * |
|
11 |
+ * |
|
12 |
+ * This program is distributed in the hope that it will be useful, |
|
13 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
15 |
+ * |
|
16 |
+ * See LICENSE.txt |
|
17 |
+ * END LICENSE |
|
18 |
+ */ |
|
19 |
+package net.bluemind.ui.adminconsole.directory.resourcetype; |
|
20 |
+ |
|
21 |
+import java.util.ArrayList; |
|
22 |
+import java.util.Arrays; |
|
23 |
+import java.util.HashMap; |
|
24 |
+import java.util.List; |
|
25 |
+import java.util.Map; |
|
26 |
+import java.util.Map.Entry; |
|
27 |
+ |
|
28 |
+import com.google.gwt.event.logical.shared.SelectionEvent; |
|
29 |
+import com.google.gwt.event.logical.shared.SelectionHandler; |
|
30 |
+import com.google.gwt.uibinder.client.UiConstructor; |
|
31 |
+import com.google.gwt.user.client.ui.Composite; |
|
32 |
+import com.google.gwt.user.client.ui.Label; |
|
33 |
+import com.google.gwt.user.client.ui.ListBox; |
|
34 |
+import com.google.gwt.user.client.ui.TabPanel; |
|
35 |
+import com.google.gwt.user.client.ui.TextArea; |
|
36 |
+import com.google.gwt.user.client.ui.VerticalPanel; |
|
37 |
+ |
|
38 |
+public class TemplateContainer extends Composite { |
|
39 |
+ private static final String WIDTH = "32.7rem"; |
|
40 |
+ private static final String NEW_BUTTON = "New"; |
|
41 |
+ private static final String MINUS_BUTTON = "-"; |
|
42 |
+ private static final String PLUS_BUTTON = "+"; |
|
43 |
+ private static final List<String> SUPPORTED_LANGUAGES = Arrays |
|
44 |
+ .asList(new String[] { "de", "en", "es", "fr", "hu", "it", "nl", "pl", "pt", "ru", "sk", "uk", "zh" }); |
|
45 |
+ private TabPanel tabPanel = new TabPanel(); |
|
46 |
+ private List<TemplatePanel> templatePanels = new ArrayList<>(); |
|
47 |
+ |
|
48 |
+ @UiConstructor |
|
49 |
+ public TemplateContainer() { |
|
50 |
+ // add listeners for the '+' and '-' buttons |
|
51 |
+ this.tabPanel.addSelectionHandler(new SelectionHandler<Integer>() { |
|
52 |
+ |
|
53 |
+ @Override |
|
54 |
+ public void onSelection(SelectionEvent<Integer> event) { |
|
55 |
+ if (event.getSelectedItem() == tabPanel.getWidgetCount() - 1) { |
|
56 |
+ // add new template |
|
57 |
+ final TemplatePanel templatePanel = new TemplatePanel(availableLanguages()); |
|
58 |
+ tabPanel.insert(templatePanel, NEW_BUTTON, tabPanel.getWidgetCount() - 1); |
|
59 |
+ tabPanel.selectTab(tabPanel.getWidgetCount() - 2); |
|
60 |
+ templatePanels.add(templatePanel); |
|
61 |
+ |
|
62 |
+ if (tabPanel.getWidgetCount() == 2) { |
|
63 |
+ // add 'delete' button |
|
64 |
+ tabPanel.insert(new Label(), MINUS_BUTTON, 0); |
|
65 |
+ } |
|
66 |
+ } else if (tabPanel.getWidgetCount() > 2 && event.getSelectedItem() == 0) { |
|
67 |
+ // delete last template |
|
68 |
+ tabPanel.remove(tabPanel.getWidgetCount() - 2); |
|
69 |
+ templatePanels.remove(templatePanels.size() - 1); |
|
70 |
+ |
|
71 |
+ if (tabPanel.getWidgetCount() == 2) { |
|
72 |
+ // remove 'delete' button |
|
73 |
+ tabPanel.remove(0); |
|
74 |
+ } |
|
75 |
+ } |
|
76 |
+ } |
|
77 |
+ }); |
|
78 |
+ |
|
79 |
+ initWidget(tabPanel); |
|
80 |
+ tabPanel.setWidth(WIDTH); |
|
81 |
+ } |
|
82 |
+ |
|
83 |
+ /** @return the languages that are not already used */ |
|
84 |
+ private List<String> availableLanguages() { |
|
85 |
+ final List<String> availableLanguages = new ArrayList<>(SUPPORTED_LANGUAGES); |
|
86 |
+ for (final TemplatePanel templatePanel : this.templatePanels) { |
|
87 |
+ availableLanguages.remove(templatePanel.languageBox.getSelectedItemText()); |
|
88 |
+ } |
|
89 |
+ return availableLanguages; |
|
90 |
+ } |
|
91 |
+ |
|
92 |
+ /** |
|
93 |
+ * Initialize this component with <i>templates</i>. <b>/!\ Should be called once |
|
94 |
+ * only!</b> |
|
95 |
+ */ |
|
96 |
+ public void setTemplates(final Map<String, String> templates) { |
|
97 |
+ for (final Entry<String, String> entry : templates.entrySet()) { |
|
98 |
+ final TemplatePanel templatePanel = new TemplatePanel(SUPPORTED_LANGUAGES, entry.getKey()); |
|
99 |
+ templatePanel.templateArea.setText(entry.getValue()); |
|
100 |
+ this.tabPanel.add(templatePanel, entry.getKey()); |
|
101 |
+ this.templatePanels.add(templatePanel); |
|
102 |
+ } |
|
103 |
+ this.tabPanel.add(new Label(), PLUS_BUTTON); |
|
104 |
+ |
|
105 |
+ if (this.tabPanel.getWidgetCount() > 1) { |
|
106 |
+ this.tabPanel.insert(new Label(), MINUS_BUTTON, 0); |
|
107 |
+ this.tabPanel.selectTab(1); |
|
108 |
+ } |
|
109 |
+ } |
|
110 |
+ |
|
111 |
+ public Map<String, String> getTemplates() { |
|
112 |
+ final Map<String, String> templates = new HashMap<>(); |
|
113 |
+ for (final TemplatePanel templatePanel : this.templatePanels) { |
|
114 |
+ final String language = templatePanel.languageBox.getSelectedItemText(); |
|
115 |
+ final String template = templatePanel.templateArea.getText(); |
|
116 |
+ if (!template.trim().isEmpty()) { |
|
117 |
+ templates.put(language, template); |
|
118 |
+ } |
|
119 |
+ } |
|
120 |
+ return templates; |
|
121 |
+ } |
|
122 |
+ |
|
123 |
+ /** |
|
124 |
+ * A simple panel with combo-box for the languages and a text area for the |
|
125 |
+ * template. |
|
126 |
+ */ |
|
127 |
+ private class TemplatePanel extends VerticalPanel { |
|
128 |
+ private ListBox languageBox; |
|
129 |
+ private TextArea templateArea; |
|
130 |
+ |
|
131 |
+ public TemplatePanel(final List<String> languages, final String selectedLanguage) { |
|
132 |
+ languageBox = new ListBox(); |
|
133 |
+ int index = 0; |
|
134 |
+ for (final String language : languages) { |
|
135 |
+ languageBox.addItem(language); |
|
136 |
+ if (language.equals(selectedLanguage)) { |
|
137 |
+ languageBox.setSelectedIndex(index); |
|
138 |
+ } |
|
139 |
+ index++; |
|
140 |
+ } |
|
141 |
+ templateArea = new TextArea(); |
|
142 |
+ templateArea.setWidth("98%"); |
|
143 |
+ templateArea.getElement().getStyle().setProperty("marginTop", "2px"); |
|
144 |
+ this.add(languageBox); |
|
145 |
+ this.add(templateArea); |
|
146 |
+ } |
|
147 |
+ |
|
148 |
+ public TemplatePanel(final List<String> languages) { |
|
149 |
+ this(languages, null); |
|
150 |
+ } |
|
151 |
+ } |
|
152 |
+ |
|
153 |
+} |