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 \
ObjectGroupList.js \
ObjectGroup.js \
WhoConfiguration.js \
ObjectGroupConfiguration.js \
RuleConfiguration.js \
SystemConfiguration.js \
MailProxyRelaying.js \

View File

@ -1,17 +1,23 @@
Ext.define('PMG.WhoConfiguration', {
Ext.define('PMG.ObjectGroupConfiguration', {
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' },
border: false,
initComponent : function() {
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', {
width: 250,
ogclass: me.ogclass,
@ -20,7 +26,7 @@ Ext.define('PMG.WhoConfiguration', {
});
var right = Ext.create('PMG.ObjectGroup', {
otype_list: [1000, 1001, 1002, 1003, 1004],
otype_list: me.otype_list,
border: false,
flex: 1,
listeners: {
@ -41,7 +47,7 @@ Ext.define('PMG.WhoConfiguration', {
return;
}
right.setObjectInfo(rec.data);
var baseurl = '/config/ruledb/who/' + rec.data.id;
var baseurl = '/config/ruledb/' + me.ogclass + '/' + rec.data.id;
right.setBaseUrl(baseurl);
});
@ -50,3 +56,36 @@ Ext.define('PMG.WhoConfiguration', {
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'),
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) {
var editor = PMG.Utils.object_editors[otype];
if (editor) {

View File

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