rename WhoConfiguration.js to ObjectGroupConfiguration.js

This commit is contained in:
Dietmar Maurer 2017-03-02 15:50:16 +01:00
parent 8bc42ab3ef
commit c790d2ab3a
4 changed files with 63 additions and 17 deletions

View File

@ -4,7 +4,7 @@ JSSRC= \
ServerAdministration.js \ ServerAdministration.js \
ObjectGroupList.js \ ObjectGroupList.js \
ObjectGroup.js \ ObjectGroup.js \
WhoConfiguration.js \ ObjectGroupConfiguration.js \
RuleConfiguration.js \ RuleConfiguration.js \
SystemConfiguration.js \ SystemConfiguration.js \
MailProxyRelaying.js \ MailProxyRelaying.js \

View File

@ -1,17 +1,23 @@
Ext.define('PMG.WhoConfiguration', { Ext.define('PMG.ObjectGroupConfiguration', {
extend: 'Ext.panel.Panel', extend: 'Ext.panel.Panel',
alias: 'widget.pmgWhoConfiguration',
ogclass: 'who',
title: gettext('Who Objects'),
ogclass: undefined, // who, when, what
otype_list: [],
layout: { type: 'hbox', align: 'stretch' }, layout: { type: 'hbox', align: 'stretch' },
border: false, border: false,
initComponent : function() { initComponent : function() {
var me = this; var me = this;
if (me.ogclass === undefined) {
throw "undefined object group class"
}
if (!(me.title = PMG.Utils.oclass_text[me.ogclass])) {
throw "unknown object group class";
}
var left = Ext.create('PMG.ObjectGroupList', { var left = Ext.create('PMG.ObjectGroupList', {
width: 250, width: 250,
ogclass: me.ogclass, ogclass: me.ogclass,
@ -20,7 +26,7 @@ Ext.define('PMG.WhoConfiguration', {
}); });
var right = Ext.create('PMG.ObjectGroup', { var right = Ext.create('PMG.ObjectGroup', {
otype_list: [1000, 1001, 1002, 1003, 1004], otype_list: me.otype_list,
border: false, border: false,
flex: 1, flex: 1,
listeners: { listeners: {
@ -41,7 +47,7 @@ Ext.define('PMG.WhoConfiguration', {
return; return;
} }
right.setObjectInfo(rec.data); right.setObjectInfo(rec.data);
var baseurl = '/config/ruledb/who/' + rec.data.id; var baseurl = '/config/ruledb/' + me.ogclass + '/' + rec.data.id;
right.setBaseUrl(baseurl); right.setBaseUrl(baseurl);
}); });
@ -50,3 +56,36 @@ Ext.define('PMG.WhoConfiguration', {
me.callParent(); me.callParent();
} }
}); });
Ext.define('PMG.WhoConfiguration', {
extend: 'PMG.ObjectGroupConfiguration',
alias: 'widget.pmgWhoConfiguration',
ogclass: 'who',
otype_list: [1000, 1001, 1002, 1003, 1004]
});
Ext.define('PMG.WhenConfiguration', {
extend: 'PMG.ObjectGroupConfiguration',
alias: 'widget.pmgWhenConfiguration',
ogclass: 'when',
otype_list: []
});
Ext.define('PMG.WhatConfiguration', {
extend: 'PMG.ObjectGroupConfiguration',
alias: 'widget.pmgWhatConfiguration',
ogclass: 'what',
otype_list: []
});
Ext.define('PMG.ActionConfiguration', {
extend: 'PMG.ObjectGroupConfiguration',
alias: 'widget.pmgActionConfiguration',
ogclass: 'action',
otype_list: []
});

View File

@ -11,6 +11,13 @@ Ext.define('PMG.Utils', {
senderText: gettext('Sender'), senderText: gettext('Sender'),
receiverText: gettext('Receiver'), receiverText: gettext('Receiver'),
oclass_text: {
who: gettext('Who Objects'),
what: gettext('What Objects'),
when: gettext('When Objects'),
action: gettext('Action Objects')
},
format_otype: function(otype) { format_otype: function(otype) {
var editor = PMG.Utils.object_editors[otype]; var editor = PMG.Utils.object_editors[otype];
if (editor) { if (editor) {

View File

@ -226,32 +226,32 @@ Ext.define('PMG.StdWorkspace', {
{ {
xtype: 'panel', xtype: 'panel',
groups: ['filter'], groups: ['filter'],
title: 'Actions', title: PMG.Utils.oclass_text['action'],
itemId: 'filter-actions', itemId: 'filter-actions',
html: "Actions" items: [{ xtype: 'pmgActionConfiguration' }]
}, },
{ {
xtype: 'panel', xtype: 'panel',
groups: ['filter'], groups: ['filter'],
title: 'Who', title: PMG.Utils.oclass_text['who'],
itemId: 'filter-who', itemId: 'filter-who',
items: [{ xtype: 'pmgWhoConfiguration' }] items: [{ xtype: 'pmgWhoConfiguration' }]
}, },
{ {
xtype: 'panel', xtype: 'panel',
groups: ['filter'], groups: ['filter'],
title: 'What', title: PMG.Utils.oclass_text['what'],
itemId: 'filter-what', itemId: 'filter-what',
html: "What" items: [{ xtype: 'pmgWhatConfiguration' }]
}, },
{ {
xtype: 'panel', xtype: 'panel',
groups: ['filter'], groups: ['filter'],
title: 'When', title: PMG.Utils.oclass_text['when'],
itemId: 'filter-when', itemId: 'filter-when',
html: "When" items: [{ xtype: 'pmgWhenConfiguration' }]
}, },
{ {
xtype: 'panel', xtype: 'panel',
title: 'Configuration', title: 'Configuration',