Skip to content
Snippets Groups Projects
Commit 0e570dec authored by Robert Anderson's avatar Robert Anderson
Browse files

Modified showAdminGroupEditWindow to send SOAP params properly

parent c14ae2b9
No related branches found
No related tags found
No related merge requests found
...@@ -18,8 +18,8 @@ function showAdminGroupWindow() { ...@@ -18,8 +18,8 @@ function showAdminGroupWindow() {
// Inline toolbars // Inline toolbars
tbar: [ tbar: [
{ {
text:'Add', text:'Add/Edit',
tooltip:'Add group', tooltip:'Add or edit group',
iconCls:'add', iconCls:'add',
handler: function() { handler: function() {
showAdminGroupEditWindow(); showAdminGroupEditWindow();
...@@ -172,7 +172,6 @@ function showAdminGroupWindow() { ...@@ -172,7 +172,6 @@ function showAdminGroupWindow() {
function showAdminGroupEditWindow(id) { function showAdminGroupEditWindow(id) {
var submitAjaxConfig; var submitAjaxConfig;
var editMode;
// We doing an update // We doing an update
...@@ -182,41 +181,18 @@ function showAdminGroupEditWindow(id) { ...@@ -182,41 +181,18 @@ function showAdminGroupEditWindow(id) {
SOAPFunction: 'updateAdminGroup', SOAPFunction: 'updateAdminGroup',
SOAPParams: SOAPParams:
'0:ID,'+ '0:ID,'+
'0:UsageCap,'+ '0:Name'
'0:AgentRef,'+
'0:AgentDisabled:boolean'
}; };
editMode = true;
// We doing an Add // We doing an Add
} else { } else {
submitAjaxConfig = { submitAjaxConfig = {
SOAPFunction: 'createAdminGroup', SOAPFunction: 'createAdminGroup',
SOAPParams: SOAPParams:
'0:AgentID,'+ '0:Name'
'0:GroupName,'+
'0:UsageCap,'+
'0:AgentRef,'+
'0:AgentDisabled:boolean'
}; };
editMode = false;
} }
// Service store
var serviceStore = new Ext.ux.JsonStore({
ID: id,
sortInfo: { field: "Name", direction: "ASC" },
baseParams: {
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'AdminGroups',
SOAPFunction: 'getClasses',
AgentID: 1,
SOAPParams: '0:AgentID,__search'
}
});
// Create window // Create window
var wispGroupFormWindow = new Ext.ux.GenericFormWindow( var wispGroupFormWindow = new Ext.ux.GenericFormWindow(
// Window config // Window config
...@@ -240,153 +216,30 @@ function showAdminGroupEditWindow(id) { ...@@ -240,153 +216,30 @@ function showAdminGroupEditWindow(id) {
}, },
items: [ items: [
{ {
fieldLabel: 'Groupname', fieldLabel: 'Name',
name: 'Groupname', name: 'Name',
vtype: 'usernamePart', vtype: 'usernamePart',
maskRe: usernamePartRe, maskRe: usernamePartRe,
allowBlank: false, allowBlank: false
disabled: editMode
},
{
xtype: 'combo',
// We use an ID so we can get the box later
id: 'agent_combobox',
fieldLabel: 'Agent',
name: 'Agent',
allowBlank: false,
width: 225,
store: new Ext.ux.JsonStore({
ID: id,
sortInfo: { field: "Name", direction: "ASC" },
baseParams: {
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'Agents',
SOAPFunction: 'getAgents',
SOAPParams: '__search'
}
}),
displayField: 'Name',
valueField: 'ID',
hiddenName: 'AgentID',
forceSelection: false,
triggerAction: 'all',
editable: false,
disabled: editMode
},
{
xtype: 'combo',
// We use an ID so we can get the box later
id: 'service_combobox',
fieldLabel: 'Service',
name: 'Service',
allowBlank: false,
width: 340,
store: serviceStore,
displayField: 'Service',
valueField: 'ID',
hiddenName: 'ClassID',
forceSelection: false,
triggerAction: 'all',
editable: false,
disabled: true
}, },
{
fieldLabel: 'Usage Cap',
name: 'UsageCap',
},
{
fieldLabel: 'Agent Ref',
name: 'AgentRef'
},
{
xtype: 'checkbox',
fieldLabel: 'Disabled',
name: 'AgentDisabled'
}/*,
{
xtype: 'tabpanel',
plain: 'true',
deferredRender: false, // Load all panels!
activeTab: 0,
height: 100,
defaults: {
layout: 'form',
bodyStyle: 'padding: 10px;'
},
items: [
{
title: 'Policy Settings',
layout: 'form',
defaultType: 'textfield',
items: [
{
fieldLabel: 'Transport Policy',
name: 'Policy',
vtype: 'number',
value: '1'
}
]
}
]
}*/
], ],
}, },
// Submit button config // Submit button config
submitAjaxConfig submitAjaxConfig
); );
// Events
if (!id) {
wispGroupFormWindow.findById('agent_combobox').on({
select: {
fn: function() {
var tb = this.ownerCt.findById('service_combobox');
if (this.getValue()) {
tb.reset();
serviceStore.baseParams.AgentID = this.getValue();
serviceStore.reload();
tb.enable();
} else {
tb.reset();
tb.disable();
}
}
},
});
}
wispGroupFormWindow.show(); wispGroupFormWindow.show();
if (id) { if (id) {
wispGroupFormWindow.getComponent('formpanel').load({ wispGroupFormWindow.getComponent('formpanel').load({
params: { params: {
id: id, ID: id,
SOAPUsername: globalConfig.soap.username, SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password, SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype, SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'AdminGroups', SOAPModule: 'AdminGroups',
SOAPFunction: 'getAdminGroups', SOAPFunction: 'getAdminGroup',
SOAPParams: 'id' SOAPParams: 'ID'
} }
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment