Skip to content

Commit 404cdf6

Browse files
author
kzumueller
committed
2 parents 107fec3 + 4e580e4 commit 404cdf6

File tree

3 files changed

+68
-23
lines changed

3 files changed

+68
-23
lines changed

src/Resources/public/js/SegmentAssignmentView.js

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,36 @@ pimcore.plugin.customermanagementframework.segmentAssignmentTab = Class.create({
1111
return this.layout;
1212
}
1313

14-
var classStore = pimcore.globalmanager.get("object_types_store");
14+
15+
var inheritancePanel = new Ext.create('Ext.form.FieldSet', {
16+
title: t('cmf_segmentAssignment_inheritanceSettings'),
17+
items: [
18+
this.getInheritablePanel(), this.getCheckBox()
19+
]
20+
});
21+
22+
var assignmentPanel = new Ext.create('Ext.form.FieldSet', {
23+
title: t('cmf_segmentAssignment_assignment'),
24+
items: [
25+
this.getAssignedPanel()
26+
]
27+
});
1528

1629
return this.layout = new Ext.Panel({
1730
title: t('segmentAssignment'),
1831
border: false,
1932
iconCls: "plugin_cmf_icon_actiontriggerrule_ExecuteSegmentBuilders",
33+
bodyStyle:'padding:0 10px 0 10px;',
34+
cls: "pimcore_object_panel_edit",
2035
tbar: [],
21-
items: [this.getInheritablePanel(), this.getCheckBox(), this.getAssignedPanel()]
36+
items: [inheritancePanel, assignmentPanel]
2237
});
2338
},
2439

2540
getInheritablePanel: function () {
2641
this.inheritableStore = new Ext.data.Store({
2742
autoDestroy: true,
43+
autoLoad: true,
2844
proxy: {
2945
type: 'ajax',
3046
url: '/admin/customermanagementframework/segment-assignment/inheritable-segments?id=' + this.object.id + '&type=' + this.type,
@@ -36,16 +52,21 @@ pimcore.plugin.customermanagementframework.segmentAssignmentTab = Class.create({
3652
fields: ['id', 'name', 'type']
3753
});
3854

39-
this.inheritableStore.load();
40-
4155
this.inheritableGrid = Ext.create('Ext.grid.Panel', {
56+
minHeight: 80,
57+
border: true,
4258
tbar: {
4359
items: [
44-
Ext.create('Ext.toolbar.TextItem', {
45-
text: t('inheritableAssignments')
46-
})
47-
]
60+
{
61+
xtype: "tbtext",
62+
text: "<b>" + t('cmf_segmentAssignment_inheritableAssignments') + "</b>"
63+
}
64+
],
65+
ctCls: "pimcore_force_auto_width",
66+
cls: "pimcore_force_auto_width",
67+
minHeight: 36
4868
},
69+
bodyCssClass: "pimcore_object_tag_objects",
4970
store: this.inheritableStore,
5071
columns: [
5172
{header: 'Id', sortable: false, dataIndex: 'id', flex: 1},
@@ -61,21 +82,20 @@ pimcore.plugin.customermanagementframework.segmentAssignmentTab = Class.create({
6182
pimcore.helpers.openObject(data.data.id, data.data.type);
6283
});
6384

85+
6486
return this.inheritableGrid;
6587
},
6688

6789
getCheckBox: function () {
6890
var inheritableGrid = this.inheritableGrid;
6991

7092
this.breaksInheritance = Ext.create('Ext.form.FormPanel', {
71-
bodyStyle: {
72-
"background-color": '#ececec'
73-
},
7493
items: [
7594
{
7695
xtype: 'checkbox',
77-
boxLabel: t('cmf.breaksInheritance'),
96+
boxLabel: t('cmf_segmentAssignment_breakInheritance'),
7897
inputValue: '1',
98+
style: "padding-top: 10px",
7999
checked: false,
80100
handler: function (target, checkedState) {
81101
inheritableGrid.setDisabled(checkedState);
@@ -97,7 +117,7 @@ pimcore.plugin.customermanagementframework.segmentAssignmentTab = Class.create({
97117
checkBox.setValue(data.breaksInheritance === '1');
98118
},
99119
failure: function (response) {
100-
pimcore.helpers.showNotification(t("error"), t("plugin_cmf_segment_assignment_error"), "error", response.responseText);
120+
pimcore.helpers.showNotification(t("error"), t("cmf_segmentAssignment_segment_assignment_error"), "error", response.responseText);
101121
}
102122
});
103123

@@ -126,24 +146,33 @@ pimcore.plugin.customermanagementframework.segmentAssignmentTab = Class.create({
126146
this.assignedStore.load();
127147

128148
var assignedGrid = Ext.create('Ext.grid.Panel', {
149+
minHeight: 90,
150+
border: true,
151+
cls: 'object_field',
129152
tbar: {
130153
items: [
131154
Ext.create('Ext.toolbar.Spacer', {
132155
width: 20,
133156
height: 16,
134157
cls: "pimcore_icon_droptarget"
135158
}),
136-
Ext.create('Ext.toolbar.TextItem', {
137-
text: t('assignedSegments')
138-
}),
159+
{
160+
xtype: "tbtext",
161+
text: "<b>" + t('cmf_segmentAssignment_assignedSegments') + "</b>"
162+
},
163+
"->",
139164
{
140165
xtype: "button",
141166
iconCls: "pimcore_icon_search",
142167
handler: this.openSearchEditor.bind(this)
143168
}
144-
]
169+
],
170+
ctCls: "pimcore_force_auto_width",
171+
cls: "pimcore_force_auto_width"
145172
},
173+
bodyCssClass: "pimcore_object_tag_objects",
146174
store: this.assignedStore,
175+
147176
columns: [
148177
{header: 'Id', sortable: false, dataIndex: 'id', flex: 1},
149178
{header: 'Name', sortable: false, dataIndex: 'name', flex: 3},
@@ -264,7 +293,7 @@ pimcore.plugin.customermanagementframework.segmentAssignmentTab = Class.create({
264293
console.log(response.responseText);
265294
},
266295
failure: function(response) {
267-
pimcore.helpers.showNotification(t("error"), t("plugin_cmf_segment_assignment_error"), "error", response.responseText);
296+
pimcore.helpers.showNotification(t("error"), t("cmf_segmentAssignment_segment_assignment_error"), "error", response.responseText);
268297
}
269298
}
270299
);

src/Resources/translations/admin.de.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ plugin_cmf_customerview: "Kunden"
33
plugin_cmf_customerduplicatesview: "Kunden-Duplikate"
44
plugin_cmf_customerautomationrules: "Kunden-Automatisierungsregeln"
55
plugin_cmf_actiontriggerrule_add_rule: "Regel hinzufügen"
6-
plugin_cmf_actiontriggerrule_add_rule_enter_name: "Geben Sie den Namen der neuen Regel ein"
76
plugin_cmf_icon_rule_triggers: "Trigger"
87
plugin_cmf_actiontrigger_rule_saved_successfully: "Regel erfolgreich gespeichert"
8+
plugin_cmf_actiontriggerrule_add_rule_enter_name: "Geben Sie den Namen der neuen Regel ein"
99
plugin_cmf_actiontriggerrule_triggerNewActivity: "Neue Kundenaktivität"
1010
plugin_cmf_actiontriggerrule_triggerExecuteSegmentBuilders: "Segmentbildung"
1111
plugin_cmf_actiontriggerrule_triggerCron: "Cron"
@@ -32,4 +32,14 @@ plugin_cmf_newsletter_queue_running_tooltip: "Newsletter Sync läuft"
3232
plugin_cmf_newsletter_export_template: "MailChimp Template Export"
3333
plugin_cmf_newsletter_export_template_success: "Templateexport erfolgreich"
3434
plugin_cmf_newsletter_export_template_error: "Templateexport fehlgeschlagen"
35-
segmentAssignment: "Segment Zuweisung"
35+
segmentAssignment: "Segment Tagging"
36+
plugin_cmf_perm_activityview: "CMF Aktivitäten"
37+
plugin_cmf_perm_customerview: "CMF Kunden"
38+
plugin_cmf_perm_customer_automation_rules: "CMF Automatisierungsregeln für Kunden"
39+
plugin_cmf_perm_newsletter_enqueue_all_customers: "CMF Newletter Kunden Exportieren"
40+
cmf_segmentAssignment_inheritanceSettings: "Vererbungseinstellungen"
41+
cmf_segmentAssignment_assignment: "Segemente direkt zuweisen"
42+
cmf_segmentAssignment_inheritableAssignments: "Vererbbare Segmente"
43+
cmf_segmentAssignment_breakInheritance: "Vererbung ausschalten"
44+
cmf_segmentAssignment_segment_assignment_error: "Segment Tagging Fehler"
45+
cmf_segmentAssignment_assignedSegments: "Zugewiesene Segments"

src/Resources/translations/admin.en.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ plugin_cmf_actiontriggerrule_countactivities_must_be: "must be"
1919
plugin_cmf_actiontriggerrule_not: "not"
2020
plugin_cmf_actiontriggerrule_changefieldvalue_field: "Field"
2121
plugin_cmf_actiontriggerrule_changefieldvalue_value: "Value"
22+
plugin_cmf_actiontriggerrule_actionChangeFieldValue: "Change customer field value"
2223
plugin_cmf_actiontriggerrule_cron_definition: "Definition"
2324
plugin_cmf_actiontriggerrule_cron_croneditor: "online cron format generator"
24-
plugin_cmf_actiontriggerrule_actionChangeFieldValue: "Change customer field value"
2525
plugin_cmf_actiontriggerrule_addsegment_remove-other-segments-from-group: "remove other segments from selected segment group"
2626
plugin_cmf_customer: "Customer"
2727
custom_report_adapter_termSegmentBuilder: "TermSegmentBuilderDefinition"
@@ -32,8 +32,14 @@ plugin_cmf_newsletter_queue_running_tooltip: "Newsletter sync queue running"
3232
plugin_cmf_newsletter_export_template: "Export Template to MailChimp"
3333
plugin_cmf_newsletter_export_template_success: "Export Template successful"
3434
plugin_cmf_newsletter_export_template_error: "Export Template failed"
35-
segmentAssignment: "Segment Assignment"
35+
segmentAssignment: "Segment Tagging"
3636
plugin_cmf_perm_activityview: "CMF Activity View"
3737
plugin_cmf_perm_customerview: "CMF Customer View"
3838
plugin_cmf_perm_customer_automation_rules: "CMF Customer Automation Rules"
39-
plugin_cmf_perm_newsletter_enqueue_all_customers: "CMF Newletter Enqueue Customers"
39+
plugin_cmf_perm_newsletter_enqueue_all_customers: "CMF Newletter Enqueue Customers"
40+
cmf_segmentAssignment_inheritanceSettings: "Inheritance Settings"
41+
cmf_segmentAssignment_assignment: "Assign Segments Directly"
42+
cmf_segmentAssignment_inheritableAssignments: "Inheritable Segments"
43+
cmf_segmentAssignment_breakInheritance: "Deactivate Inheritance"
44+
cmf_segmentAssignment_segment_assignment_error: "Segment Assignment Error"
45+
cmf_segmentAssignment_assignedSegments: "Assigned Segments"

0 commit comments

Comments
 (0)