Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • smradius/smradius
  • centiva-shail/smradius
  • nkukard/smradius
3 results
Show changes
Showing
with 1019 additions and 1828 deletions
/*
WiSP Resellers
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
function showWiSPResellersWindow() {
......@@ -8,10 +26,10 @@ function showWiSPResellersWindow() {
title: "Resellers",
width: 400,
height: 325,
height: 335,
minWidth: 400,
minHeight: 325,
minHeight: 335
},
// Grid config
{
......@@ -31,7 +49,7 @@ function showWiSPResellersWindow() {
tooltip:'Edit Reseller',
iconCls:'option',
handler: function() {
var selectedItem = WiSPResellerWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(WiSPResellerWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
......@@ -59,7 +77,7 @@ function showWiSPResellersWindow() {
tooltip:'Remove Reseller',
iconCls:'remove',
handler: function() {
var selectedItem = WiSPResellerWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(WiSPResellerWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
......@@ -157,10 +175,10 @@ function showWiSPResellerEditWindow(id) {
title: "Reseller Information",
width: 300,
height: 325,
height: 348,
minWidth: 300,
minHeight: 325
minHeight: 348
},
// Form panel config
{
......@@ -254,7 +272,7 @@ function showWiSPResellerEditWindow(id) {
}
]
}
],
]
},
// Submit button config
submitAjaxConfig
......@@ -263,7 +281,7 @@ function showWiSPResellerEditWindow(id) {
WiSPResellerFormWindow.show();
if (id) {
WiSPResellerFormWindow.getComponent('formpanel').load({
Ext.getCmp(WiSPResellerFormWindow.formPanelID).load({
params: {
id: id,
SOAPUsername: globalConfig.soap.username,
......@@ -327,3 +345,5 @@ function showWiSPResellerRemoveWindow(parent,id) {
// vim: ts=4
/*
WiSP User Logs
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
function showWiSPUserLogsWindow(wispUserID) {
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
function showWiSPUserLogsWindow(id) {
// Calculate dates we going to need
var today = new Date();
var firstOfMonth = today.getFirstDateOfMonth();
var firstOfNext = today.getLastDateOfMonth().add(Date.DAY, 1);
var formID = Ext.id();
var formPeriodKeyID = Ext.id();
var formSearchButtonID = Ext.id();
var summaryFormID = Ext.id();
var summaryTotalID = Ext.id();
var currentPeriod = today.format('Y-m');
var wispUserLogsWindow = new Ext.ux.GenericGridWindow(
// Window config
{
title: 'User Logs',
title: 'Logs',
iconCls: 'silk-page_white_text',
layout:'border',
height: 480,
width: 700,
......@@ -20,66 +48,60 @@ function showWiSPUserLogsWindow(wispUserID) {
uxItems: [
{
xtype: 'form',
id: 'search-form',
id: formID,
title: 'Search',
region: 'west',
border: true,
frame: true,
defaultType: 'datefield',
height: 180,
width: 300,
width: 320,
labelWidth: 100,
items: [
{
id: 'after',
name: 'after',
width: 180,
fieldLabel: 'From',
vtype: 'daterange',
format: 'Y-m-d',
value: firstOfMonth,
endDateField: 'before',
},
{
id: 'before',
name: 'before',
width: 180,
fieldLabel: 'To',
vtype: 'daterange',
format: 'Y-m-d',
value: firstOfNext,
startDateField: 'after'
id: formPeriodKeyID,
xtype: 'textfield',
name: 'periodkey',
regex: /^\d{4}\-(0[1-9]|1(0|1|2))$/,
regexText: 'Please enter month in the format: YYYY-MM',
height: 25,
width: 100,
fieldLabel: 'Period',
value: currentPeriod
}
],
buttons: [
{
text: 'Search',
id: 'formbtn',
id: formSearchButtonID,
handler: function() {
// Pull in window, grid & form
var mainWindow = this.ownerCt.ownerCt;
var grid = mainWindow.getComponent('gridpanel');
var form = mainWindow.getComponent('search-form');
var grid = Ext.getCmp(wispUserLogsWindow.gridPanelID);
// Grab store
var store = grid.getStore();
// Grab timestamp filter
var gridFilters = grid.filters;
var timestampFilter = gridFilters.getFilter('Timestamp');
var timestampFilter = gridFilters.getFilter('EventTimestamp');
// Grab form field
var periodKeyField = Ext.getCmp(formPeriodKeyID);
if (periodKeyField.isValid()) {
var periodKeyValue = periodKeyField.getValue();
// Grab form fields
var afterField = form.getForm().findField('after');
var beforeField = form.getForm().findField('before');
// Convert our periodKey into DateTime values
var dtSearchStart = Date.parseDate(periodKeyValue+'-01','Y-m-d');
var dtSearchEnd = dtSearchStart.add(Date.MONTH,1);
// Set filter values from form
timestampFilter.setValue({
after: afterField.getValue(),
before: beforeField.getValue()
});
// Set filter values from form
timestampFilter.setValue({
after: dtSearchStart,
before: dtSearchEnd
});
// Trigger store reload
store.reload();
// Trigger store reload
store.reload();
}
}
}
],
......@@ -87,23 +109,24 @@ function showWiSPUserLogsWindow(wispUserID) {
},
{
xtype: 'form',
id: 'summary-form',
id: summaryFormID,
region: 'center',
split: true,
border: true,
border: false,
autoScroll: true,
defaultType: 'textarea',
height: 180,
height: 300,
width: 400,
labelWidth: 80,
labelWidth: 0,
items: [
{
id: 'summaryTotal',
id: summaryTotalID,
name: 'summaryTotal',
readOnly: true,
height: 135,
width: 200,
height: 300,
width: 400,
fieldLabel: 'Summary',
hideLabel: true,
fieldClass: 'font-family: monospace; font-size: 10px;',
value: ''
}
......@@ -116,78 +139,53 @@ function showWiSPUserLogsWindow(wispUserID) {
region: 'south',
width: 700,
border: true,
tbar: [
{
text: 'Add Port Lock',
tooltip: 'Add port lock',
iconCls: 'add'
}
],
// Column model
colModel: new Ext.grid.ColumnModel([
{
id: 'ID',
header: "ID",
hidden: true,
dataIndex: 'ID'
},
{
header: "Username",
hidden: true,
dataIndex: 'Username'
header: "Timestamp",
sortable: true,
dataIndex: 'EventTimestamp'
},
{
header: "Status",
sortable: true,
hidden: true,
dataIndex: 'Status'
dataIndex: 'AcctStatusType'
},
{
header: "Timestamp",
header: "Service Type",
sortable: true,
dataIndex: 'Timestamp'
},
{
header: "Session ID",
hidden: true,
dataIndex: 'AcctSessionID'
dataIndex: 'ServiceType'
},
{
header: "Session Time",
dataIndex: 'AcctSessionTime'
},
{
header: "NAS IP",
hidden: true,
dataIndex: 'NASIPAddress'
header: "Framed Protocol",
sortable: true,
dataIndex: 'FramedProtocol'
},
{
header: "Port Type",
header: "NAS Port Type",
hidden: true,
dataIndex: 'NASPortType'
},
{
header: "NAS Port",
dataIndex: 'NASPort'
},
{
header: "Called Station",
hidden: true,
dataIndex: 'CalledStationID'
},
{
header: "Calling Station",
sortable: true,
dataIndex: 'CallingStationID'
},
{
header: "NAS Xmit Rate",
dataIndex: 'NASTransmitRate'
header: "Called Station",
hidden: true,
dataIndex: 'CalledStationID'
},
{
header: "NAS Recv Rate",
header: "Session ID",
hidden: true,
dataIndex: 'NASReceiveRate'
dataIndex: 'AcctSessionID'
},
{
header: "IP Address",
......@@ -196,16 +194,17 @@ function showWiSPUserLogsWindow(wispUserID) {
},
{
header: "Input Mbyte",
dataIndex: 'AcctInputMbyte'
dataIndex: 'AcctInput',
renderer: renderUsageFloat
},
{
header: "Output Mbyte",
dataIndex: 'AcctOutputMbyte'
dataIndex: 'AcctOutput',
renderer: renderUsageFloat
},
{
header: "Last Update",
hidden: true,
dataIndex: 'LastAcctUpdate'
header: "Session Uptime",
dataIndex: 'AcctSessionTime'
},
{
header: "Term. Reason",
......@@ -216,72 +215,171 @@ function showWiSPUserLogsWindow(wispUserID) {
// Store config
{
baseParams: {
ID: id,
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUsers',
SOAPModule: 'WiSPUserLogs',
SOAPFunction: 'getWiSPUserLogs',
SOAPParams: '0:UserID,__search',
UserID: wispUserID
SOAPParams: 'ID,__search'
}
},
// Filter config
{
filters: [
{type: 'numeric', dataIndex: 'ID'},
{type: 'string', dataIndex: 'Username'},
{type: 'numeric', dataIndex: 'Status'},
{type: 'numeric', dataIndex: 'ID'},
{
type: 'date',
dataIndex: 'Timestamp',
type: 'date',
format: 'Y-m-d H:i:s',
dataIndex: 'EventTimestamp',
value: {
after: firstOfMonth,
before: firstOfNext
}
},
{type: 'string', dataIndex: 'AcctSessionID'},
{type: 'numeric', dataIndex: 'AcctSessionTime'},
{type: 'string', dataIndex: 'NASIPAddress'},
{type: 'string', dataIndex: 'NASPortType'},
{type: 'string', dataIndex: 'NASPort'},
{type: 'string', dataIndex: 'CalledStationID'},
{type: 'numeric', dataIndex: 'AcctStatusType'},
{type: 'numeric', dataIndex: 'ServiceType'},
{type: 'numeric', dataIndex: 'FramedProtocol'},
{type: 'numeric', dataIndex: 'NASPortType'},
{type: 'string', dataIndex: 'NASPortID'},
{type: 'string', dataIndex: 'CallingStationID'},
{type: 'string', dataIndex: 'NASTransmitRate'},
{type: 'string', dataIndex: 'NASReceiveRate'},
{type: 'string', dataIndex: 'CalledStationID'},
{type: 'string', dataIndex: 'AcctSessionID'},
{type: 'string', dataIndex: 'FramedIPAddress'},
{type: 'date', dataIndex: 'LastAcctUpdate'},
{type: 'numeric', dataIndex: 'AcctInput'},
{type: 'numeric', dataIndex: 'AcctOutput'},
{type: 'numeric', dataIndex: 'AcctSessionTime'},
{type: 'string', dataIndex: 'ConnectTermReason'}
]
}
);
// Grab store
var store = wispUserLogsWindow.getComponent('gridpanel').getStore();
var store = Ext.getCmp(wispUserLogsWindow.gridPanelID).getStore();
store.on('load',function() {
var inputTotal = store.sum('AcctInputMbyte');
var outputTotal = store.sum('AcctOutputMbyte');
var userCap = 3000;
var userTopups = 1000;
// Total up into this ...
var userTotalAllowed = userCap + userTopups;
var userUsage = inputTotal + outputTotal;
var userLeft = userTotalAllowed - userUsage;
// Fetch periodKey from form
var periodKeyField = (Ext.getCmp(formPeriodKeyID)).getValue();
// Mask parent window
wispUserLogsWindow.getEl().mask();
uxAjaxRequest(
wispUserLogsWindow,
{
params: {
PeriodKey: periodKeyField,
ID: id,
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUserLogs',
SOAPFunction: 'getWiSPUserLogsSummary',
SOAPParams: '0:ID,0:PeriodKey'
},
customSuccess: function (result) {
response = Ext.decode(result.responseText);
// Caps
var trafficCap = response.data.trafficCap; // value of -1: prepaid
var uptimeCap = response.data.uptimeCap; // value of -1: prepaid
// Usage
var trafficUsage = response.data.trafficUsage;
var uptimeUsage = response.data.uptimeUsage;
// Topups
var trafficTopups = response.data.trafficTopups;
var uptimeTopups = response.data.uptimeTopups;
var totalTrafficTopups = response.data.TotalTrafficTopups;
var totalUptimeTopups = response.data.TotalUptimeTopups;
// Format string before printing
var trafficString = '';
// Prepaid traffic
if (trafficCap == -1) {
trafficCap = 'Prepaid';
trafficString += sprintf('Traffic:\nCap: %s \nTopup balance for current month: %d MB\nTotal Topups: %d MB\nUsage: %d/%d MB\n',
trafficCap,trafficTopups,totalTrafficTopups,trafficUsage,trafficTopups);
trafficString += '---\n';
// Uncapped traffic
} else if (trafficCap == 0) {
trafficString += sprintf('Traffic:\nCap: Uncapped\nUsage: %d MB\n',
trafficUsage);
trafficString += '---\n';
// Capped traffic
} else {
var combinedTrafficCap = trafficCap + trafficTopups;
trafficString += sprintf('Traffic:\nCap: %d MB\nTopup balance for current month: %d MB\nTotal Topups: %d MB\n'+
'Usage: %d/%d MB\n',
trafficCap,trafficTopups,totalTrafficTopups,trafficUsage,combinedTrafficCap);
trafficString += '---\n';
}
// Format string before printing
var uptimeString = '';
// Prepaid uptime
if (uptimeCap == -1) {
uptimeCap = 'Prepaid';
uptimeString += sprintf('Uptime:\nCap: %s \nTopup balance for current month: %d Min\nTotal Topups: %d Min\n'+
'Usage: %d/%d Min\n',
uptimeCap,uptimeTopups,totalUptimeTopups,uptimeUsage,uptimeTopups);
uptimeString += '---\n';
// Uncapped uptime
} else if (uptimeCap == 0) {
uptimeString += sprintf('Uptime:\nCap: Uncapped\nUsage: %d Min\n',
uptimeUsage);
uptimeString += '---\n';
// Capped uptime
} else {
var combinedUptimeCap = uptimeCap + uptimeTopups;
uptimeString += sprintf('Uptime:\nCap: %d Min\nTopup balance for current month: %d Min\nTotal Topups: %d Min\n'+
'Usage: %d/%d Min\n',
uptimeCap,uptimeTopups,totalUptimeTopups,uptimeUsage,combinedUptimeCap);
uptimeString += '---\n';
}
// Topup breakdown
var tTopups = response.data.AllTrafficTopups;
var uTopups = response.data.AllUptimeTopups;
var form = wispUserLogsWindow.getComponent('summary-form');
var summaryTotal = form.getForm().findField('summaryTotal');
// Format topups string
var topupString = '';
if (tTopups.length > 0) {
topupString += 'Valid Traffic Topups:';
}
for (var i = 0; i < tTopups.length; i++) {
var id = tTopups[i].ID;
var used = tTopups[i].Used;
var cap = tTopups[i].Cap;
var validTo = tTopups[i].ValidTo;
topupString += sprintf('\nID: %s\nUsage: %d/%d MB\nValid Until: %s\n--',id,used,cap,validTo);
}
if (uTopups.length > 0) {
topupString += 'Valid Uptime Topups:';
}
for (var i = 0; i < uTopups.length; i++) {
var id = uTopups[i].ID;
var used = uTopups[i].Used;
var cap = uTopups[i].Cap;
var validTo = uTopups[i].ValidTo;
topupString += sprintf('\nID: %s\nUsage: %d/%d MB\nValid Until: %s\n--',id,used,cap,validTo);
}
summaryTotal.setValue(
sprintf('Cap Total: %6d\nTopups : %6d\n-----------------\n %6d\n-----------------\nUsage : %6d\n=================\nAvailable: %6d',userCap,userTopups,userTotalAllowed,userUsage,userLeft)
// Get summary field
var form = Ext.getCmp(summaryFormID);
var summaryField = Ext.getCmp(summaryTotalID);
summaryField.setValue(trafficString+uptimeString+topupString);
},
failure: function (result) {
Ext.MessageBox.alert('Failed', 'Couldn\'t fetch data: '+result.date);
}
}
);
});
wispUserLogsWindow.show();
wispUserLogsWindow.show();
}
// vim: ts=4
/*
WiSP User Topups
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
function showWiSPUserTopupsWindow(userID) {
......@@ -6,11 +24,12 @@ function showWiSPUserTopupsWindow(userID) {
// Window config
{
title: "User Topups",
iconCls: 'silk-chart_bar',
width: 500,
height: 335,
minWidth: 500,
minHeight: 335,
minHeight: 335
},
// Grid config
{
......@@ -19,22 +38,22 @@ function showWiSPUserTopupsWindow(userID) {
{
text:'Add',
tooltip:'Add topup',
iconCls:'add',
iconCls:'silk-chart_bar_add',
handler: function() {
showWiSPUserTopupEditWindow(userID,0);
showWiSPUserTopupAddEditWindow(wispUserTopupsWindow,userID,0);
}
},
'-',
'-',
{
text:'Edit',
tooltip:'Edit topup',
iconCls:'option',
iconCls:'silk-chart_bar_edit',
handler: function() {
var selectedItem = wispUserTopupsWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(wispUserTopupsWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
showWiSPUserTopupEditWindow(userID,selectedItem.data.ID);
showWiSPUserTopupAddEditWindow(wispUserTopupsWindow,userID,selectedItem.data.ID);
} else {
wispUserTopupsWindow.getEl().mask();
......@@ -56,9 +75,9 @@ function showWiSPUserTopupsWindow(userID) {
{
text:'Remove',
tooltip:'Remove topup',
iconCls:'remove',
iconCls:'silk-chart_bar_delete',
handler: function() {
var selectedItem = wispUserTopupsWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(wispUserTopupsWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
......@@ -91,9 +110,14 @@ function showWiSPUserTopupsWindow(userID) {
dataIndex: 'ID'
},
{
header: "Bandwidth",
header: "Type",
sortable: true,
dataIndex: 'Bandwidth'
dataIndex: 'Type'
},
{
header: "Value",
sortable: true,
dataIndex: 'Value'
},
{
header: "Timestamp",
......@@ -110,13 +134,8 @@ function showWiSPUserTopupsWindow(userID) {
header: "ValidTo",
sortable: true,
dataIndex: 'ValidTo'
},
{
header: "AgentRef",
sortable: true,
dataIndex: 'AgentRef'
}
]),
])
},
// Store config
{
......@@ -134,11 +153,10 @@ function showWiSPUserTopupsWindow(userID) {
{
filters: [
{type: 'numeric', dataIndex: 'ID'},
{type: 'numeric', dataIndex: 'Bandwidth'},
{type: 'date', dataIndex: 'Timestamp'},
{type: 'numeric', dataIndex: 'Value'},
{type: 'date', dataIndex: 'ValidFrom'},
{type: 'date', dataIndex: 'ValidTo'},
{type: 'string', dataIndex: 'AgentRef'}
{type: 'date', dataIndex: 'ValidTo'}
]
}
);
......@@ -148,30 +166,53 @@ function showWiSPUserTopupsWindow(userID) {
// Display edit/add form
function showWiSPUserTopupEditWindow(userID,topupID) {
function showWiSPUserTopupAddEditWindow(wispUserTopupsWindow,userID,topupID) {
var today = new Date();
var firstOfMonth = today.getFirstDateOfMonth();
var firstOfNext = today.getLastDateOfMonth().add(Date.DAY, 1);
var submitAjaxConfig;
var icon;
// We doing an update
if (topupID) {
icon = 'silk-chart_bar_edit';
submitAjaxConfig = {
ID: topupID,
SOAPFunction: 'updateWiSPUserTopup',
SOAPParams:
'0:ID,0:Bandwidth,'+
'0:Timestamp,0:ValidFrom,0:ValidTo,0:AgentRef'
params: {
ID: topupID,
SOAPFunction: 'updateWiSPUserTopup',
SOAPParams:
'0:ID,0:Value,0:Type,'+
'0:ValidFrom,0:ValidTo'
},
onSuccess: function() {
var store = Ext.getCmp(wispUserTopupsWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
// We doing an Add
} else {
icon = 'silk-chart_bar_add';
submitAjaxConfig = {
UserID: userID,
SOAPFunction: 'createWiSPUserTopup',
SOAPParams:
'0:UserID,0:Bandwidth,'+
'0:Timestamp,0:ValidFrom,0:ValidTo,0:AgentRef'
params: {
UserID: userID,
SOAPFunction: 'createWiSPUserTopup',
SOAPParams:
'0:UserID,0:Value,0:Type,'+
'0:ValidFrom,0:ValidTo'
},
onSuccess: function() {
var store = Ext.getCmp(wispUserTopupsWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
};
}
......@@ -180,6 +221,7 @@ function showWiSPUserTopupEditWindow(userID,topupID) {
// Window config
{
title: "Topup Information",
iconCls: icon,
width: 400,
height: 200,
......@@ -196,23 +238,40 @@ function showWiSPUserTopupEditWindow(userID,topupID) {
SOAPModule: 'WiSPUsers'
},
items: [
{
xtype: 'combo',
fieldLabel: 'Type',
name: 'Type',
allowBlank: false,
width: 157,
store: [
[ '1', 'Traffic' ],
[ '2', 'Uptime' ]
],
displayField: 'Type',
valueField: 'Type',
hiddenName: 'Type',
forceSelection: true,
triggerAction: 'all',
editable: false
},
{
xtype: 'numberfield',
fieldLabel: 'Bandwidth',
name: 'Bandwidth',
fieldLabel: 'Value',
name: 'Value',
minValue: 1,
allowBlank: false
},
{
xtype: 'datefield',
xtype: 'datefield',
fieldLabel: 'ValidFrom',
name: 'ValidFrom',
id: 'ValidFrom',
vtype: 'daterange',
disabledDates: ["(0(2|3|4|5|6|7|8|9)|1[0-9]|2[0-9]|3[0-1])$"],
value: firstOfMonth,
format: 'Y-m-d',
endDateField: 'ValidTo'
},
{
xtype: 'datefield',
......@@ -220,15 +279,12 @@ function showWiSPUserTopupEditWindow(userID,topupID) {
name: 'ValidTo',
id: 'ValidTo',
vtype: 'daterange',
disabledDates: ["(0(2|3|4|5|6|7|8|9)|1[0-9]|2[0-9]|3[0-1])$"],
value: firstOfNext,
format: 'Y-m-d',
startDateField: 'ValidFrom'
},
{
fieldLabel: 'AgentRef',
name: 'AgentRef'
}
],
]
},
// Submit button config
submitAjaxConfig
......@@ -237,7 +293,7 @@ function showWiSPUserTopupEditWindow(userID,topupID) {
wispUserTopupFormWindow.show();
if (topupID) {
wispUserTopupFormWindow.getComponent('formpanel').load({
Ext.getCmp(wispUserTopupFormWindow.formPanelID).load({
params: {
id: topupID,
SOAPUsername: globalConfig.soap.username,
......@@ -254,10 +310,10 @@ function showWiSPUserTopupEditWindow(userID,topupID) {
// Display edit/add form
function showWiSPUserTopupRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
// Display remove form
function showWiSPUserTopupRemoveWindow(wispUserTopupsWindow,id) {
// Mask wispUserTopupsWindow window
wispUserTopupsWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -271,7 +327,7 @@ function showWiSPUserTopupRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(wispUserTopupsWindow,{
params: {
id: id,
SOAPUsername: globalConfig.soap.username,
......@@ -280,15 +336,25 @@ function showWiSPUserTopupRemoveWindow(parent,id) {
SOAPModule: 'WiSPUsers',
SOAPFunction: 'removeWiSPUserTopup',
SOAPParams: 'id'
},
customSuccess: function() {
var store = Ext.getCmp(wispUserTopupsWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
wispUserTopupsWindow.getEl().unmask();
}
}
});
}
// vim: ts=4
/*
WiSP Users
Copyright (C) 2007-2011, AllWorldIT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
function showWiSPUserWindow() {
......@@ -6,12 +24,13 @@ function showWiSPUserWindow() {
// Window config
{
title: "Users",
iconCls: 'silk-user',
width: 600,
height: 335,
minWidth: 600,
minHeight: 335,
minHeight: 335
},
// Grid config
{
......@@ -20,22 +39,22 @@ function showWiSPUserWindow() {
{
text:'Add',
tooltip:'Add user',
iconCls:'add',
iconCls:'silk-user_add',
handler: function() {
showWiSPUserEditWindow();
showWiSPUserAddEditWindow(WiSPUserWindow);
}
},
'-',
},
'-',
{
text:'Edit',
tooltip:'Edit user',
iconCls:'option',
iconCls:'silk-user_edit',
handler: function() {
var selectedItem = WiSPUserWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(WiSPUserWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
showWiSPUserEditWindow(selectedItem.data.ID);
showWiSPUserAddEditWindow(WiSPUserWindow,selectedItem.data.ID);
} else {
WiSPUserWindow.getEl().mask();
......@@ -57,9 +76,9 @@ function showWiSPUserWindow() {
{
text:'Remove',
tooltip:'Remove user',
iconCls:'remove',
iconCls:'silk-user_delete',
handler: function() {
var selectedItem = WiSPUserWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(WiSPUserWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
......@@ -85,9 +104,9 @@ function showWiSPUserWindow() {
{
text:'Logs',
tooltip:'User logs',
iconCls:'logs',
iconCls: 'silk-page_white_text',
handler: function() {
var selectedItem = WiSPUserWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(WiSPUserWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
......@@ -113,9 +132,9 @@ function showWiSPUserWindow() {
{
text:'Topups',
tooltip:'User topups',
iconCls:'topups',
iconCls:'silk-chart_bar',
handler: function() {
var selectedItem = WiSPUserWindow.getComponent('gridpanel').getSelectionModel().getSelected();
var selectedItem = Ext.getCmp(WiSPUserWindow.gridPanelID).getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// If so display window
......@@ -142,42 +161,42 @@ function showWiSPUserWindow() {
colModel: new Ext.grid.ColumnModel([
{
id: 'ID',
header: "ID",
header: "UserID",
sortable: true,
dataIndex: 'ID'
},
{
header: "AgentName",
header: "Username",
sortable: true,
dataIndex: 'AgentName'
dataIndex: 'Username'
},
{
header: "Username",
header: "First Name",
sortable: true,
dataIndex: 'Username'
dataIndex: 'Firstname'
},
{
header: "Service",
header: "Last Name",
sortable: true,
dataIndex: 'Service'
dataIndex: 'Lastname'
},
{
header: "Usage Cap",
header: "Email",
sortable: true,
dataIndex: 'UsageCap'
dataIndex: 'Email'
},
{
header: "Agent Ref",
header: "Phone",
sortable: true,
dataIndex: 'AgentRef'
dataIndex: 'Phone'
},
{
header: "Disabled",
sortable: false,
sortable: true,
dataIndex: 'Disabled'
}
]),
autoExpandColumn: 'Service'
autoExpandColumn: 'Username'
},
// Store config
{
......@@ -194,11 +213,12 @@ function showWiSPUserWindow() {
{
filters: [
{type: 'numeric', dataIndex: 'ID'},
{type: 'string', dataIndex: 'AgentName'},
{type: 'string', dataIndex: 'Username'},
{type: 'string', dataIndex: 'Service'},
{type: 'numeric', dataIndex: 'UsageCap'},
{type: 'string', dataIndex: 'AgentRef'}
{type: 'boolean', dataIndex: 'Disabled'},
{type: 'string', dataIndex: 'Firstname'},
{type: 'string', dataIndex: 'Lastname'},
{type: 'string', dataIndex: 'Email'},
{type: 'string', dataIndex: 'Phone'}
]
}
);
......@@ -208,65 +228,520 @@ function showWiSPUserWindow() {
// Display edit/add form
function showWiSPUserEditWindow(id) {
function showWiSPUserAddEditWindow(WiSPUserWindow,id) {
var submitAjaxConfig;
var editMode;
var icon;
// Arrays for removed items
var RemovedAttributes = new Array();
var RemovedGroups = new Array();
// To identify newly inserted rows
var attributeInsertID = -1;
var groupInsertID = -1;
// Attribute record that can be added to below store
var attributeRecord = Ext.data.Record.create([
{name: 'ID'},
{name: 'Name'},
{name: 'Operator'},
{name: 'Value'},
{name: 'Modifier'}
]);
// Attribute store
var attributeStore;
// If this is an update we need to pull in record
if (id) {
attributeStore = new Ext.ux.JsonStore({
pruneModifiedRecords: true,
baseParams: {
ID: id,
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUsers',
SOAPFunction: 'getWiSPUserAttributes',
SOAPParams: 'ID'
}
});
} else {
attributeStore = new Ext.data.SimpleStore({
pruneModifiedRecords: true,
fields: ['ID', 'Name', 'Operator', 'Value', 'Modifer']
});
}
// Group record that can be added to below store
var groupRecord = Ext.data.Record.create([
{name: 'Name'}
]);
// Group store
var groupStore;
// If this is an update we need to pull in record
if (id) {
groupStore = new Ext.ux.JsonStore({
pruneModifiedRecords: true,
baseParams: {
ID: id,
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUsers',
SOAPFunction: 'getWiSPUserGroups',
SOAPParams: 'ID'
}
});
} else {
groupStore = new Ext.data.SimpleStore({
pruneModifiedRecords: true,
fields: [
'Name'
]
});
}
// We doing an update
if (id) {
icon = 'silk-user_edit';
submitAjaxConfig = {
ID: id,
SOAPFunction: 'updateWiSPUser',
SOAPParams:
'0:ID,'+
'0:UsageCap,'+
'0:AgentRef,'+
'0:AgentDisabled:boolean'
};
editMode = true;
params: {
ID: id,
SOAPFunction: 'updateWiSPUser',
SOAPParams:
'0:ID,'+
'0:Username,'+
'0:Password,'+
'0:Disabled,'+
'0:Firstname,'+
'0:Lastname,'+
'0:Phone,'+
'0:LocationID,'+
'0:Attributes,'+
'0:Groups,'+
'0:Email,'+
'0:RGroups,'+
'0:RAttributes'
},
onSuccess: function() {
var store = Ext.getCmp(WiSPUserWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
},
hook: function() {
// Get modified attribute records
var attributes = attributeStore.getModifiedRecords();
// Get modified group records
var groups = groupStore.getModifiedRecords();
var ret = { };
// Set attributes we will be adding
for (var i = 0, len = attributes.length; i < len; i++) {
var attribute = attributes[i];
// Safe to add this attribute
ret['Attributes['+i+'][ID]'] = attribute.get('ID');
ret['Attributes['+i+'][Name]'] = attribute.get('Name');
ret['Attributes['+i+'][Operator]'] = attribute.get('Operator');
ret['Attributes['+i+'][Value]'] = attribute.get('Value');
ret['Attributes['+i+'][Modifier]'] = attribute.get('Modifier');
}
// Set groups we will be adding
for (var i = 0, len = groups.length; i < len; i++) {
var group = groups[i];
// Safe to add this attribute
ret['Groups['+i+'][Name]'] = group.get('Name');
}
// Add removed attributes
if ((id) && (RemovedAttributes.length > 0)) {
var c = 0;
var len = RemovedAttributes.length;
for (var i = 0; i < len; i++) {
// If this is a new add then the user has no attributes
if (RemovedAttributes[i] >= 0) {
ret['RAttributes['+c+']'] = RemovedAttributes[i];
c++;
}
}
}
// Add removed groups
if ((id) && (RemovedGroups.length > 0)) {
var c = 0;
var len = RemovedGroups.length;
for (var i = 0; i < len; i++) {
// If this is a new add then the user has no attributes
if (RemovedGroups[i] >= 0) {
ret['RGroups['+c+']'] = RemovedGroups[i];
c++;
}
}
}
return ret;
}
};
// We doing an Add
} else {
icon = 'silk-user_add';
submitAjaxConfig = {
SOAPFunction: 'createWiSPUser',
SOAPParams:
'0:AgentID,'+
'0:UserName,'+
'0:UsageCap,'+
'0:AgentRef,'+
'0:AgentDisabled:boolean'
params: {
SOAPFunction: 'createWiSPUser',
SOAPParams:
'0:Username,'+
'0:Disabled,'+
'0:Password,'+
'0:Firstname,'+
'0:Lastname,'+
'0:Phone,'+
'0:Email,'+
'0:LocationID,'+
'0:Attributes,'+
'0:Groups,'+
'0:Number,'+
'0:Prefix'
},
onSuccess: function() {
var store = Ext.getCmp(WiSPUserWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
},
hook: function() {
// Get modified attribute records
var attributes = attributeStore.getModifiedRecords();
// Get modified group records
var groups = groupStore.getModifiedRecords();
var ret = { };
// Set attributes we will be adding
for (var i = 0, len = attributes.length; i < len; i++) {
var attribute = attributes[i];
// Safe to add this attribute
ret['Attributes['+i+'][ID]'] = attribute.get('ID');
ret['Attributes['+i+'][Name]'] = attribute.get('Name');
ret['Attributes['+i+'][Operator]'] = attribute.get('Operator');
ret['Attributes['+i+'][Value]'] = attribute.get('Value');
ret['Attributes['+i+'][Modifier]'] = attribute.get('Modifier');
}
// Set groups we will be adding
for (var i = 0, len = groups.length; i < len; i++) {
var group = groups[i];
// Safe to add this attribute
ret['Groups['+i+'][Name]'] = group.get('Name');
}
return ret;
}
};
editMode = false;
}
// Service store
var serviceStore = new Ext.ux.JsonStore({
ID: id,
// Build the attribute editor grid
var attributeEditor = new Ext.grid.EditorGridPanel({
plain: true,
autoHeight: true,
// Set row selection model
selModel: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
// Inline toolbars
tbar: [
{
text:'Add',
tooltip:'Add attribute',
iconCls:'silk-table_add',
handler: function() {
var newAttrStoreRecord = new attributeRecord({
ID: attributeInsertID,
Name: '',
Operator: '',
Value: '',
Modifier: ''
});
attributeStore.insert(0,newAttrStoreRecord);
attributeInsertID -= 1;
}
},
'-',
{
text:'Remove',
tooltip:'Remove attribute',
iconCls:'silk-table_delete',
handler: function() {
var selectedItem = attributeEditor.getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// Get selected item value
var attributeID = selectedItem.get('ID');
// Remove selected
attributeStore.remove(selectedItem);
// Add to list of removed attributes
RemovedAttributes.push(attributeID);
} else {
wispUserFormWindow.getEl().mask();
// Display error
Ext.Msg.show({
title: "Nothing selected",
msg: "No attribute selected",
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.CANCEL,
modal: false,
fn: function() {
wispUserFormWindow.getEl().unmask();
}
});
}
}
}
],
cm: new Ext.grid.ColumnModel([
{
id: 'ID',
header: 'ID',
dataIndex: 'ID',
hidden: true,
width: 30
},
{
id: 'Name',
header: 'Name',
dataIndex: 'Name',
width: 150,
editor: new Ext.form.ComboBox({
allowBlank: false,
mode: 'local',
store: [
[ 'SMRadius-Capping-Traffic-Limit', 'Traffic Limit' ],
[ 'SMRadius-Capping-Uptime-Limit', 'Uptime Limit' ],
[ 'Framed-IP-Address', 'IP Address' ],
[ 'Calling-Station-Id', 'MAC Address' ]
],
triggerAction: 'all',
editable: false
})
},
{
id: 'Operator',
header: 'Operator',
dataIndex: 'Operator',
width: 300,
editor: new Ext.form.ComboBox({
allowBlank: false,
mode: 'local',
store: [
[ '=', 'Add as reply if unique' ],
[ ':=', 'Set configuration value' ],
[ '==', 'Match value in request' ],
[ '+=', 'Add reply and set configuration' ],
[ '!=', 'Inverse match value in request' ],
[ '<', 'Match less-than value in request' ],
[ '>', 'Match greater-than value in request' ],
[ '<=', 'Match less-than or equal value in request' ],
[ '>=', 'Match greater-than or equal value in request' ],
[ '=~', 'Match string containing regex in request' ],
[ '!~', 'Match string not containing regex in request' ],
[ '=*', 'Match if attribute is defined in request' ],
[ '!*', 'Match if attribute is not defined in request' ],
[ '||==', 'Match any of these values in request' ]
],
triggerAction: 'all',
editable: true
})
},
{
id: 'Value',
header: 'Value',
dataIndex: 'Value',
width: 100,
editor: new Ext.form.TextField({
allowBlank: false
})
},
{
id: 'Modifier',
header: 'Modifier',
dataIndex: 'Modifier',
width: 80,
editor: new Ext.form.ComboBox({
allowBlank: false,
mode: 'local',
store: [
[ 'Seconds', 'Seconds' ],
[ 'Minutes', 'Minutes' ],
[ 'Hours', 'Hours' ],
[ 'Days', 'Days' ],
[ 'Weeks', 'Weeks' ],
[ 'Months', 'Months' ],
[ 'MBytes', 'MBytes' ],
[ 'GBytes', 'GBytes' ],
[ 'TBytes', 'TBytes' ]
],
triggerAction: 'all',
editable: true
})
}
]),
store: attributeStore
});
// Editor combobox ID
var editorComboBoxID = Ext.id();
// Render display value
editorComboBoxRenderer = function(editorComboBoxID) {
var combo = Ext.getCmp(editorComboBoxID);
return function(value){
var record = combo.findRecord(combo.valueField, value);
return record ? record.get(combo.displayField) : value;
}
}
// Build the group editor grid
var groupEditor = new Ext.grid.EditorGridPanel({
plain: true,
autoHeight: true,
// Set row selection model
selModel: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
// Inline toolbars
tbar: [
{
text:'Add',
tooltip:'Add group',
iconCls:'silk-group_add',
handler: function() {
var newGroupStoreRecord = new groupRecord({
ID: groupInsertID,
Name: ''
});
groupStore.insert(0,newGroupStoreRecord);
groupInsertID -= 1;
}
},
'-',
{
text:'Remove',
tooltip:'Remove group',
iconCls:'silk-group_delete',
handler: function() {
var selectedItem = groupEditor.getSelectionModel().getSelected();
// Check if we have selected item
if (selectedItem) {
// Get selected item value
var groupID = selectedItem.get('ID');
// Remove selected
groupStore.remove(selectedItem);
// Add to our removed groups hash
RemovedGroups.push(groupID);
} else {
wispUserFormWindow.getEl().mask();
// Display error
Ext.Msg.show({
title: "Nothing selected",
msg: "No group selected",
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.CANCEL,
modal: false,
fn: function() {
wispUserFormWindow.getEl().unmask();
}
});
}
}
}
],
cm: new Ext.grid.ColumnModel([
{
id: 'ID',
header: 'ID',
dataIndex: 'ID',
hidden: true,
width: 30
},
{
id: 'Name',
header: 'Name',
dataIndex: 'Name',
width: 150,
editor: new Ext.form.ComboBox({
id: editorComboBoxID,
allowBlank: false,
store: new Ext.ux.JsonStore({
sortInfo: { field: "Name", direction: "ASC" },
baseParams: {
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'AdminUserGroups',
SOAPFunction: 'getAdminGroups',
SOAPParams: '__null,__search'
}
}),
displayField: 'Name',
valueField: 'ID',
forceSelection: true,
triggerAction: 'all',
editable: false
}),
renderer: editorComboBoxRenderer(editorComboBoxID)
}
]),
store: groupStore
});
var locationStore = new Ext.ux.JsonStore({
sortInfo: { field: "Name", direction: "ASC" },
baseParams: {
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUsers',
SOAPFunction: 'getClasses',
AgentID: 1,
SOAPParams: '0:AgentID,__search'
SOAPFunction: 'getWiSPLocations',
SOAPParams: '__null,__search'
}
});
})
// Create window
var wispUserFormWindow = new Ext.ux.GenericFormWindow(
// Window config
{
title: "User Information",
iconCls: icon,
width: 475,
height: 260,
width: 700,
height: 362,
minWidth: 475,
minHeight: 260
minWidth: 700,
minHeight: 362
},
// Form panel config
{
......@@ -281,163 +756,151 @@ function showWiSPUserEditWindow(id) {
{
fieldLabel: 'Username',
name: 'Username',
vtype: 'usernamePart',
maskRe: usernamePartRe,
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
vtype: 'usernameRadius',
maskRe: usernameRadiusPartRe,
allowBlank: true
},
{
fieldLabel: 'Usage Cap',
name: 'UsageCap',
fieldLabel: 'Password',
name: 'Password',
allowBlank: true
},
{
fieldLabel: 'Agent Ref',
name: 'AgentRef'
},
{
xtype: 'checkbox',
fieldLabel: 'Disabled',
name: 'AgentDisabled'
}/*,
name: 'Disabled',
xtype: 'checkbox',
inputValue: '1'
},
{
xtype: 'tabpanel',
plain: 'true',
deferredRender: false, // Load all panels!
activeTab: 0,
height: 100,
height: 200,
maxHeight: 200,
defaults: {
layout: 'form',
bodyStyle: 'padding: 10px;'
},
items: [
{
title: 'Policy Settings',
title: 'Personal',
iconCls: 'silk-user_comment',
layout: 'form',
defaultType: 'textfield',
items: [
{
fieldLabel: 'Transport Policy',
name: 'Policy',
fieldLabel: 'First Name',
name: 'Firstname',
allowBlank: true
},
{
fieldLabel: 'Last Name',
name: 'Lastname',
allowBlank: true
},
{
fieldLabel: 'Phone',
name: 'Phone',
vtype: 'number',
value: '1'
allowBlank: true
},
{
fieldLabel: 'Email',
name: 'Email',
allowBlank: true
},
{
xtype: 'combo',
fieldLabel: 'Location',
name: 'Location',
allowBlank: true,
width: 140,
store: locationStore,
displayField: 'Name',
valueField: 'ID',
hiddenName: 'LocationID',
forceSelection: true,
triggerAction: 'all',
editable: false
}
]
},
{
title: 'Groups',
iconCls: 'silk-group',
layout: 'form',
autoScroll: true,
defaultType: 'textfield',
items: [
groupEditor
]
},
{
title: 'Attributes',
iconCls: 'silk-table',
layout: 'form',
autoScroll: true,
defaultType: 'textfield',
items: [
attributeEditor
]
},
{
title: 'Add Many',
iconCls: 'silk-user_suit',
layout: 'form',
defaultType: 'textfield',
items: [
{
fieldLabel: 'Prefix',
name: 'Prefix',
allowBlank: true
},
{
fieldLabel: 'Number',
name: 'Number',
vtype: 'number',
allowBlank: true
}
]
}
]
}*/
],
}
]
},
// Submit button config
submitAjaxConfig
);
// Events
if (!id) {
wispUserFormWindow.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();
}
}
},
});
}
wispUserFormWindow.show();
if (id) {
wispUserFormWindow.getComponent('formpanel').load({
Ext.getCmp(wispUserFormWindow.formPanelID).load({
params: {
id: id,
ID: id,
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUsers',
SOAPFunction: 'getWiSPUser',
SOAPParams: 'id'
SOAPParams: 'ID'
}
});
locationStore.load();
attributeStore.load();
groupStore.load();
}
}
// Display edit/add form
function showWiSPUserRemoveWindow(parent,id) {
// Mask parent window
parent.getEl().mask();
// Display remove form
function showWiSPUserRemoveWindow(WiSPUserWindow,id) {
// Mask WiSPUserWindow window
WiSPUserWindow.getEl().mask();
// Display remove confirm window
Ext.Msg.show({
......@@ -451,22 +914,30 @@ function showWiSPUserRemoveWindow(parent,id) {
if (buttonId == 'yes') {
// Do ajax request
uxAjaxRequest(parent,{
uxAjaxRequest(WiSPUserWindow,{
params: {
id: id,
ID: id,
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'WiSPUsers',
SOAPFunction: 'removeWiSPUser',
SOAPParams: 'id'
SOAPParams: 'ID'
},
customSuccess: function() {
var store = Ext.getCmp(WiSPUserWindow.gridPanelID).getStore();
store.load({
params: {
limit: 25
}
});
}
});
// Unmask if user answered no
} else {
parent.getEl().unmask();
WiSPUserWindow.getEl().unmask();
}
}
});
......@@ -481,3 +952,5 @@ function showWiSPUserRemoveWindow(parent,id) {
// vim: ts=4
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.grid.GridFilters = function(config){
this.filters = new Ext.util.MixedCollection();
this.filters.getKey = function(o) {return o ? o.dataIndex : null};
for(var i=0, len=config.filters.length; i<len; i++) {
this.addFilter(config.filters[i]);
}
this.deferredUpdate = new Ext.util.DelayedTask(this.reload, this);
delete config.filters;
Ext.apply(this, config);
};
Ext.extend(Ext.grid.GridFilters, Ext.util.Observable, {
/**
* @cfg {Integer} updateBuffer
* Number of milisecond to defer store updates since the last filter change.
*/
updateBuffer: 500,
/**
* @cfg {String} paramPrefix
* The url parameter prefix for the filters.
*/
paramPrefix: 'filter',
/**
* @cfg {String} fitlerCls
* The css class to be applied to column headers that active filters. Defaults to 'ux-filterd-column'
*/
filterCls: 'ux-filtered-column',
/**
* @cfg {Boolean} local
* True to use Ext.data.Store filter functions instead of server side filtering.
*/
local: false,
/**
* @cfg {Boolean} autoReload
* True to automagicly reload the datasource when a filter change happens.
*/
autoReload: true,
/**
* @cfg {String} stateId
* Name of the Ext.data.Store value to be used to store state information.
*/
stateId: undefined,
/**
* @cfg {Boolean} showMenu
* True to show the filter menus
*/
showMenu: true,
init: function(grid){
if(grid instanceof Ext.grid.GridPanel){
this.grid = grid;
this.store = this.grid.getStore();
if(this.local){
this.store.on('load', function(store) {
store.filterBy(this.getRecordFilter());
}, this);
} else {
this.store.on('beforeload', this.onBeforeLoad, this);
}
this.grid.filters = this;
this.grid.addEvents('filterupdate');
grid.on("render", this.onRender, this);
grid.on("beforestaterestore", this.applyState, this);
grid.on("beforestatesave", this.saveState, this);
} else if(grid instanceof Ext.PagingToolbar) {
this.toolbar = grid;
}
},
/** private **/
applyState: function(grid, state) {
this.suspendStateStore = true;
this.clearFilters();
if(state.filters) {
for(var key in state.filters) {
var filter = this.filters.get(key);
if(filter) {
filter.setValue(state.filters[key]);
filter.setActive(true);
}
}
}
this.deferredUpdate.cancel();
if(this.local) {
this.reload();
}
this.suspendStateStore = false;
},
/** private **/
saveState: function(grid, state){
var filters = {};
this.filters.each(function(filter) {
if(filter.active) {
filters[filter.dataIndex] = filter.getValue();
}
});
return state.filters = filters;
},
/** private **/
onRender: function(){
var hmenu;
if(this.showMenu) {
hmenu = this.grid.getView().hmenu;
this.sep = hmenu.addSeparator();
this.menu = hmenu.add(new Ext.menu.CheckItem({
text: 'Filters',
menu: new Ext.menu.Menu()
}));
this.menu.on('checkchange', this.onCheckChange, this);
this.menu.on('beforecheckchange', this.onBeforeCheck, this);
hmenu.on('beforeshow', this.onMenu, this);
}
this.grid.getView().on("refresh", this.onRefresh, this);
this.updateColumnHeadings(this.grid.getView());
},
/** private **/
onMenu: function(filterMenu) {
var filter = this.getMenuFilter();
if(filter) {
this.menu.menu = filter.menu;
this.menu.setChecked(filter.active, false);
}
this.menu.setVisible(filter !== undefined);
this.sep.setVisible(filter !== undefined);
},
/** private **/
onCheckChange: function(item, value) {
this.getMenuFilter().setActive(value);
},
/** private **/
onBeforeCheck: function(check, value) {
return !value || this.getMenuFilter().isActivatable();
},
/** private **/
onStateChange: function(event, filter) {
if(event == "serialize") {
return;
}
if(filter == this.getMenuFilter()) {
this.menu.setChecked(filter.active, false);
}
if(this.autoReload || this.local) {
this.deferredUpdate.delay(this.updateBuffer);
}
var view = this.grid.getView();
this.updateColumnHeadings(view);
this.grid.saveState();
this.grid.fireEvent('filterupdate', this, filter);
},
/** private **/
onBeforeLoad: function(store, options) {
options.params = options.params || {};
this.cleanParams(options.params);
var params = this.buildQuery(this.getFilterData());
Ext.apply(options.params, params);
},
/** private **/
onRefresh: function(view) {
this.updateColumnHeadings(view);
},
/** private **/
getMenuFilter: function() {
var view = this.grid.getView();
if(!view || view.hdCtxIndex === undefined) {
return null;
}
return this.filters.get(view.cm.config[view.hdCtxIndex].dataIndex);
},
/** private **/
updateColumnHeadings: function(view) {
if(!view || !view.mainHd) {
return;
}
var hds = view.mainHd.select('td').removeClass(this.filterCls);
for(var i=0, len=view.cm.config.length; i<len; i++) {
var filter = this.getFilter(view.cm.config[i].dataIndex);
if(filter && filter.active) {
hds.item(i).addClass(this.filterCls);
}
}
},
/** private **/
reload: function() {
if(this.local){
this.grid.store.clearFilter(true);
this.grid.store.filterBy(this.getRecordFilter());
} else {
this.deferredUpdate.cancel();
var store = this.grid.store;
if(this.toolbar) {
var start = this.toolbar.paramNames.start;
if(store.lastOptions && store.lastOptions.params && store.lastOptions.params[start]) {
store.lastOptions.params[start] = 0;
}
}
store.reload();
}
},
/**
* Method factory that generates a record validator for the filters active at the time
* of invokation.
*
* @private
*/
getRecordFilter: function() {
var f = [];
this.filters.each(function(filter) {
if(filter.active) {
f.push(filter);
}
});
var len = f.length;
return function(record) {
for(var i=0; i<len; i++) {
if(!f[i].validateRecord(record)) {
return false;
}
}
return true;
};
},
/**
* Adds a filter to the collection.
*
* @param {Object/Ext.grid.filter.Filter} config A filter configuration or a filter object.
*
* @return {Ext.grid.filter.Filter} The existing or newly created filter object.
*/
addFilter: function(config) {
var filter = config.menu ? config : new (this.getFilterClass(config.type))(config);
this.filters.add(filter);
Ext.util.Observable.capture(filter, this.onStateChange, this);
return filter;
},
/**
* Returns a filter for the given dataIndex, if on exists.
*
* @param {String} dataIndex The dataIndex of the desired filter object.
*
* @return {Ext.grid.filter.Filter}
*/
getFilter: function(dataIndex){
return this.filters.get(dataIndex);
},
/**
* Turns all filters off. This does not clear the configuration information.
*/
clearFilters: function() {
this.filters.each(function(filter) {
filter.setActive(false);
});
},
/** private **/
getFilterData: function() {
var filters = [];
this.filters.each(function(f) {
if(f.active) {
var d = [].concat(f.serialize());
for(var i=0, len=d.length; i<len; i++) {
filters.push({field: f.dataIndex, data: d[i]});
}
}
});
return filters;
},
/**
* Function to take structured filter data and 'flatten' it into query parameteres. The default function
* will produce a query string of the form:
* filters[0][field]=dataIndex&filters[0][data][param1]=param&filters[0][data][param2]=param...
*
* @param {Array} filters A collection of objects representing active filters and their configuration.
* Each element will take the form of {field: dataIndex, data: filterConf}. dataIndex is not assured
* to be unique as any one filter may be a composite of more basic filters for the same dataIndex.
*
* @return {Object} Query keys and values
*/
buildQuery: function(filters) {
var p = {};
for(var i=0, len=filters.length; i<len; i++) {
var f = filters[i];
var root = [this.paramPrefix, '[', i, ']'].join('');
p[root + '[field]'] = f.field;
var dataPrefix = root + '[data]';
for(var key in f.data) {
p[[dataPrefix, '[', key, ']'].join('')] = f.data[key];
}
}
return p;
},
/**
* Removes filter related query parameters from the provided object.
*
* @param {Object} p Query parameters that may contain filter related fields.
*/
cleanParams: function(p) {
var regex = new RegExp("^" + this.paramPrefix + "\[[0-9]+\]");
for(var key in p) {
if(regex.test(key)) {
delete p[key];
}
}
},
/**
* Function for locating filter classes, overwrite this with your favorite
* loader to provide dynamic filter loading.
*
* @param {String} type The type of filter to load.
*
* @return {Class}
*/
getFilterClass: function(type){
return Ext.grid.filter[type.substr(0, 1).toUpperCase() + type.substr(1) + 'Filter'];
}
});
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.grid.filter.BooleanFilter = Ext.extend(Ext.grid.filter.Filter, {
defaultValue: false,
init: function(){
var gId = Ext.id();
this.options = [
new Ext.menu.CheckItem({text: "Yes", group: gId, checked: this.defaultValue === true}),
new Ext.menu.CheckItem({text: "No", group: gId, checked: this.defaultValue === false})
];
this.menu.add(this.options[0], this.options[1]);
for(var i=0; i<this.options.length; i++) {
this.options[i].on('click', this.fireUpdate, this);
this.options[i].on('checkchange', this.fireUpdate, this);
}
},
isActivatable: function() {
return true;
},
fireUpdate: function() {
this.fireEvent("update", this);
this.setActive(true);
},
setValue: function(value) {
this.options[value ? 0 : 1].setChecked(true);
},
getValue: function() {
return this.options[0].checked;
},
serialize: function() {
var args = {type: 'boolean', value: this.getValue()};
this.fireEvent('serialize', args, this);
return args;
},
validateRecord: function(record) {
return record.get(this.dataIndex) == this.getValue();
}
});
\ No newline at end of file
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.grid.filter.DateFilter = Ext.extend(Ext.grid.filter.Filter, {
dateFormat: 'Y-m-d', // ISO 8601 standard date format
pickerOpts: {},
init: function() {
var opts = Ext.apply(this.pickerOpts, {
minDate: this.minDate,
maxDate: this.maxDate,
format: this.dateFormat
});
var dates = this.dates = {
'after': new Ext.menu.CheckItem({text: "From", menu: new Ext.menu.DateMenu(opts)}),
'before': new Ext.menu.CheckItem({text: "To", menu: new Ext.menu.DateMenu(opts)}),
'on': new Ext.menu.CheckItem({text: "On", menu: new Ext.menu.DateMenu(opts)})
};
this.menu.add(dates.after, dates.before, "-", dates.on);
for(var key in dates) {
var date = dates[key];
date.menu.on('select', this.onSelect.createDelegate(this, [date]), this);
date.on('checkchange', function(){
this.setActive(this.isActivatable());
}, this);
};
},
onSelect: function(date, menuItem, value, picker) {
date.setChecked(true);
var dates = this.dates;
if(date == dates.on) {
dates.before.setChecked(false, true);
dates.after.setChecked(false, true);
} else {
dates.on.setChecked(false, true);
if(date == dates.after && dates.before.menu.picker.value < value) {
dates.before.setChecked(false, true);
} else if (date == dates.before && dates.after.menu.picker.value > value) {
dates.after.setChecked(false, true);
}
}
this.fireEvent("update", this);
},
getFieldValue: function(field) {
return this.dates[field].menu.picker.getValue();
},
getPicker: function(field) {
return this.dates[field].menu.picker;
},
isActivatable: function() {
return this.dates.on.checked || this.dates.after.checked || this.dates.before.checked;
},
setValue: function(value) {
for(var key in this.dates) {
if(value[key]) {
this.dates[key].menu.picker.setValue(value[key]);
this.dates[key].setChecked(true);
} else {
this.dates[key].setChecked(false);
}
}
},
getValue: function() {
var result = {};
for(var key in this.dates) {
if(this.dates[key].checked) {
result[key] = this.dates[key].menu.picker.getValue();
}
}
return result;
},
serialize: function() {
var args = [];
if(this.dates.before.checked) {
args = [{type: 'date', comparison: 'lt', value: this.getFieldValue('before').format(this.dateFormat)}];
}
if(this.dates.after.checked) {
args.push({type: 'date', comparison: 'gt', value: this.getFieldValue('after').format(this.dateFormat)});
}
if(this.dates.on.checked) {
args = {type: 'date', comparison: 'eq', value: this.getFieldValue('on').format(this.dateFormat)};
}
this.fireEvent('serialize', args, this);
return args;
},
validateRecord: function(record) {
var val = record.get(this.dataIndex).clearTime(true).getTime();
if(this.dates.on.checked && val != this.getFieldValue('on').clearTime(true).getTime()) {
return false;
}
if(this.dates.before.checked && val >= this.getFieldValue('before').clearTime(true).getTime()) {
return false;
}
if(this.dates.after.checked && val <= this.getFieldValue('after').clearTime(true).getTime()) {
return false;
}
return true;
}
});
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.ns("Ext.grid.filter");
Ext.grid.filter.Filter = function(config){
Ext.apply(this, config);
this.events = {
/**
* @event activate
* Fires when a inactive filter becomes active
* @param {Ext.ux.grid.filter.Filter} this
*/
'activate': true,
/**
* @event deactivate
* Fires when a active filter becomes inactive
* @param {Ext.ux.grid.filter.Filter} this
*/
'deactivate': true,
/**
* @event update
* Fires when a filter configuration has changed
* @param {Ext.ux.grid.filter.Filter} this
*/
'update': true,
/**
* @event serialize
* Fires after the serialization process. Use this to apply additional parameters to the serialized data.
* @param {Array/Object} data A map or collection of maps representing the current filter configuration.
* @param {Ext.ux.grid.filter.Filter} filter The filter being serialized.
**/
'serialize': true
};
Ext.grid.filter.Filter.superclass.constructor.call(this);
this.menu = new Ext.menu.Menu();
this.init();
if(config && config.value) {
this.setValue(config.value);
this.setActive(config.active !== false, true);
delete config.value;
}
};
Ext.extend(Ext.grid.filter.Filter, Ext.util.Observable, {
/**
* @cfg {Boolean} active
* Indicates the default status of the filter (defaults to false).
*/
/**
* True if this filter is active. Read-only.
* @type Boolean
* @property
*/
active: false,
/**
* @cfg {String} dataIndex
* The {@link Ext.data.Store} data index of the field this filter represents. The dataIndex does not actually
* have to exist in the store.
*/
dataIndex: null,
/**
* The filter configuration menu that will be installed into the filter submenu of a column menu.
* @type Ext.menu.Menu
* @property
*/
menu: null,
/**
* Initialize the filter and install required menu items.
*/
init: Ext.emptyFn,
fireUpdate: function() {
this.value = this.item.getValue();
if(this.active) {
this.fireEvent("update", this);
}
this.setActive(this.value.length > 0);
},
/**
* Returns true if the filter has enough configuration information to be activated.
* @return {Boolean}
*/
isActivatable: function() {
return true;
},
/**
* Sets the status of the filter and fires that appropriate events.
* @param {Boolean} active The new filter state.
* @param {Boolean} suppressEvent True to prevent events from being fired.
*/
setActive: function(active, suppressEvent) {
if(this.active != active) {
this.active = active;
if(suppressEvent !== true) {
this.fireEvent(active ? 'activate' : 'deactivate', this);
}
}
},
/**
* Get the value of the filter
* @return {Object} The 'serialized' form of this filter
*/
getValue: Ext.emptyFn,
/**
* Set the value of the filter.
* @param {Object} data The value of the filter
*/
setValue: Ext.emptyFn,
/**
* Serialize the filter data for transmission to the server.
* @return {Object/Array} An object or collection of objects containing key value pairs representing
* the current configuration of the filter.
*/
serialize: Ext.emptyFn,
/**
* Validates the provided Ext.data.Record against the filters configuration.
* @param {Ext.data.Record} record The record to validate
* @return {Boolean} True if the record is valid with in the bounds of the filter, false otherwise.
*/
validateRecord: function(){return true;}
});
\ No newline at end of file
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.grid.filter.ListFilter = Ext.extend(Ext.grid.filter.Filter, {
labelField: 'text',
loadingText: 'Loading...',
loadOnShow: true,
value: [],
loaded: false,
phpMode: false,
init: function(){
this.menu.add('<span class="loading-indicator">' + this.loadingText + '</span>');
if(this.store && this.loadOnShow) {
this.menu.on('show', this.onMenuLoad, this);
} else if(this.options) {
var options = [];
for(var i=0, len=this.options.length; i<len; i++) {
var value = this.options[i];
switch(Ext.type(value)) {
case 'array':
options.push(value);
break;
case 'object':
options.push([value.id, value[this.labelField]]);
break;
case 'string':
options.push([value, value]);
break;
}
}
this.store = new Ext.data.Store({
reader: new Ext.data.ArrayReader({id: 0}, ['id', this.labelField])
});
this.options = options;
this.menu.on('show', this.onMenuLoad, this);
}
this.store.on('load', this.onLoad, this);
this.bindShowAdapter();
},
/**
* Lists will initially show a 'loading' item while the data is retrieved from the store. In some cases the
* loaded data will result in a list that goes off the screen to the right (as placement calculations were done
* with the loading item). This adaptor will allow show to be called with no arguments to show with the previous
* arguments and thusly recalculate the width and potentially hang the menu from the left.
*
*/
bindShowAdapter: function() {
var oShow = this.menu.show;
var lastArgs = null;
this.menu.show = function() {
if(arguments.length == 0) {
oShow.apply(this, lastArgs);
} else {
lastArgs = arguments;
oShow.apply(this, arguments);
}
};
},
onMenuLoad: function() {
if(!this.loaded) {
if(this.options) {
this.store.loadData(this.options);
} else {
this.store.load();
}
}
},
onLoad: function(store, records) {
var visible = this.menu.isVisible();
this.menu.hide(false);
this.menu.removeAll();
var gid = this.single ? Ext.id() : null;
for(var i=0, len=records.length; i<len; i++) {
var item = new Ext.menu.CheckItem({
text: records[i].get(this.labelField),
group: gid,
checked: this.value.indexOf(records[i].id) > -1,
hideOnClick: false
});
item.itemId = records[i].id;
item.on('checkchange', this.checkChange, this);
this.menu.add(item);
}
this.setActive(this.isActivatable());
this.loaded = true;
if(visible) {
this.menu.show(); //Adaptor will re-invoke with previous arguments
}
},
checkChange: function(item, checked) {
var value = [];
this.menu.items.each(function(item) {
if(item.checked) {
value.push(item.itemId);
}
},this);
this.value = value;
this.setActive(this.isActivatable());
this.fireEvent("update", this);
},
isActivatable: function() {
return this.value.length > 0;
},
setValue: function(value) {
var value = this.value = [].concat(value);
if(this.loaded) {
this.menu.items.each(function(item) {
item.setChecked(false, true);
for(var i=0, len=value.length; i<len; i++) {
if(item.itemId == value[i]) {
item.setChecked(true, true);
}
}
}, this);
}
this.fireEvent("update", this);
},
getValue: function() {
return this.value;
},
serialize: function() {
var args = {type: 'list', value: this.phpMode ? this.value.join(',') : this.value};
this.fireEvent('serialize', args, this);
return args;
},
validateRecord: function(record) {
return this.getValue().indexOf(record.get(this.dataIndex)) > -1;
}
});
\ No newline at end of file
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.grid.filter.NumericFilter = Ext.extend(Ext.grid.filter.Filter, {
init: function() {
this.menu = new Ext.menu.RangeMenu();
this.menu.on("update", this.fireUpdate, this);
},
fireUpdate: function() {
this.setActive(this.isActivatable());
this.fireEvent("update", this);
},
isActivatable: function() {
var value = this.menu.getValue();
return value.eq !== undefined || value.gt !== undefined || value.lt !== undefined;
},
setValue: function(value) {
this.menu.setValue(value);
},
getValue: function() {
return this.menu.getValue();
},
serialize: function() {
var args = [];
var values = this.menu.getValue();
for(var key in values) {
args.push({type: 'numeric', comparison: key, value: values[key]});
}
this.fireEvent('serialize', args, this);
return args;
},
validateRecord: function(record) {
var val = record.get(this.dataIndex),
values = this.menu.getValue();
if(values.eq != undefined && val != values.eq) {
return false;
}
if(values.lt != undefined && val >= values.lt) {
return false;
}
if(values.gt != undefined && val <= values.gt) {
return false;
}
return true;
}
});
\ No newline at end of file
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.grid.filter.StringFilter = Ext.extend(Ext.grid.filter.Filter, {
updateBuffer: 500,
icon: '/img/small_icons/famfamfam/find.png',
init: function() {
var value = this.value = new Ext.menu.EditableItem({icon: this.icon});
value.on('keyup', this.onKeyUp, this);
this.menu.add(value);
this.updateTask = new Ext.util.DelayedTask(this.fireUpdate, this);
},
onKeyUp: function(event) {
if(event.getKey() == event.ENTER){
this.menu.hide(true);
return;
}
this.updateTask.delay(this.updateBuffer);
},
isActivatable: function() {
return this.value.getValue().length > 0;
},
fireUpdate: function() {
if(this.active) {
this.fireEvent("update", this);
}
this.setActive(this.isActivatable());
},
setValue: function(value) {
this.value.setValue(value);
this.fireEvent("update", this);
},
getValue: function() {
return this.value.getValue();
},
serialize: function() {
var args = {type: 'string', value: this.getValue()};
this.fireEvent('serialize', args, this);
return args;
},
validateRecord: function(record) {
var val = record.get(this.dataIndex);
if(typeof val != "string") {
return this.getValue().length == 0;
}
return val.toLowerCase().indexOf(this.getValue().toLowerCase()) > -1;
}
});
\ No newline at end of file
Ext.ux.ProgressFormPanel = function(config) {
config = Ext.apply({
bodyStyle: 'border:0px;',
autoHeight: true,
loadMsg: 'Loading...',
submitMsg:'Saving...'
}, config);
Ext.ux.ProgressFormPanel.superclass.constructor.call(this, config);
// Create event handlers
this.on({
// Display failure message
actionfailed: { scope:this, fn:function(form, action){
var hideMe = 0;
// We should hide the loadmask here
if ((action.type == 'load' || action.type == 'submit') && this.rendered == true) {
this.getLoadMask().hide();
}
// If we loading hide the window
if (action.type == 'load') {
hideMe = 1;
}
printStr = '<b>Error: </b>';
// Check if we have result.msg
if (action.result && action.result.msg) {
printStr += action.result.msg;
// Check if we have result.errors
} else if (action.result && action.result.errors) {
// Add all errors
for (var i = 0; i < action.result.errors.length; i++) {
printStr += action.result.errors[i] + '<br />';
}
// Check if we just have a error code
} else if (action.result.data && action.result.data.ErrorCode) {
printStr += "Code: "+action.result.data.ErrorCode+"<br />";
printStr += "Reason: "+action.result.data.ErrorReason+"<br />";
// Check if we just have a result
} else if (action.result) {
printStr += action.result;
// Unknown
} else {
printStr += 'UNKNOWN ERROR: '+action.failureType;
}
// Display error
Ext.Msg.show({
title: "Exception occured: ",
msg: printStr,
icon: Ext.MessageBox.ERROR,
modal: true,
buttons: Ext.Msg.CANCEL,
scope: this,
fn: function() {
// Check if we must hide this
if (hideMe) {
this.ownerCt.hide();
}
}
});
}},
// Before action, fire up mask
beforeaction: { scope:this, fn:function(form, action){
if((action.type == 'load' || action.type == 'submit') && this.rendered == true){
this.getLoadMask().show();
}
}},
// Completed action, hide mask
actioncomplete: { scope:this, fn:function(form, action){
if((action.type == 'load' || action.type == 'submit') && this.rendered == true){
this.getLoadMask().hide();
}
}}
});
}
Ext.reg('progressformpanel',Ext.ux.ProgressFormPanel);
Ext.extend(Ext.ux.ProgressFormPanel, Ext.FormPanel, {
// Setup the loadmask messages
load: function(options){
this.getLoadMask().msg = this.loadMsg;
Ext.ux.ProgressFormPanel.superclass.load.call(this,options);
},
submit: function(options){
this.getLoadMask().msg = this.submitMsg;
// Ext.ux.ProgressFormPanel.superclass.submit.call(this,options);
this.getForm().submit(options);
},
// Get load mask
getLoadMask: function() {
// If we don't have a load mask ,create one
if(!this.loadmask){
this.loadmask = new Ext.LoadMask(this.ownerCt.getEl());
}
return this.loadmask;
}
});
/*
* Nigels's utility functions
*/
Ext.BLANK_IMAGE_URL = 'resources/extjs/images/default/s.gif';
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.menu.EditableItem = Ext.extend(Ext.menu.BaseItem, {
itemCls : "x-menu-item",
hideOnClick: false,
initComponent: function(){
Ext.menu.EditableItem.superclass.initComponent.call(this);
this.addEvents('keyup');
this.editor = this.editor || new Ext.form.TextField();
if(this.text) {
this.editor.setValue(this.text);
}
},
onRender: function(container){
var s = container.createChild({
cls: this.itemCls,
html: '<img src="' + this.icon + '" class="x-menu-item-icon" style="margin: 3px 3px 2px 2px;" />'
});
Ext.apply(this.config, {width: 125});
this.editor.render(s);
this.el = s;
this.relayEvents(this.editor.el, ["keyup"]);
if(Ext.isGecko) {
s.setStyle('overflow', 'auto');
}
Ext.menu.EditableItem.superclass.onRender.call(this, container);
},
getValue: function(){
return this.editor.getValue();
},
setValue: function(value){
this.editor.setValue(value);
},
isValid: function(preventMark){
return this.editor.isValid(preventMark);
}
});
\ No newline at end of file
/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.menu.RangeMenu = function(config){
Ext.menu.RangeMenu.superclass.constructor.call(this, config);
this.updateTask = new Ext.util.DelayedTask(this.fireUpdate, this);
var cfg = this.fieldCfg;
var cls = this.fieldCls;
var fields = this.fields = Ext.applyIf(this.fields || {}, {
'gt': new Ext.menu.EditableItem({
icon: this.icons.gt,
editor: new cls(typeof cfg == "object" ? cfg.gt || '' : cfg)
}),
'lt': new Ext.menu.EditableItem({
icon: this.icons.lt,
editor: new cls(typeof cfg == "object" ? cfg.lt || '' : cfg)
}),
'eq': new Ext.menu.EditableItem({
icon: this.icons.eq,
editor: new cls(typeof cfg == "object" ? cfg.gt || '' : cfg)
})
});
this.add(fields.gt, fields.lt, '-', fields.eq);
for(var key in fields) {
fields[key].on('keyup', this.onKeyUp.createDelegate(this, [fields[key]], true), this);
}
this.addEvents('update');
};
Ext.extend(Ext.menu.RangeMenu, Ext.menu.Menu, {
fieldCls: Ext.form.NumberField,
fieldCfg: '',
updateBuffer: 500,
icons: {
gt: '/img/small_icons/greater_then.png',
lt: '/img/small_icons/less_then.png',
eq: '/img/small_icons/equals.png'
},
fireUpdate: function() {
this.fireEvent("update", this);
},
setValue: function(data) {
for(var key in this.fields) {
this.fields[key].setValue(data[key] !== undefined ? data[key] : '');
}
this.fireEvent("update", this);
},
getValue: function() {
var result = {};
for(var key in this.fields) {
var field = this.fields[key];
if(field.isValid() && String(field.getValue()).length > 0) {
result[key] = field.getValue();
}
}
return result;
},
onKeyUp: function(event, input, notSure, field) {
if(event.getKey() == event.ENTER && field.isValid()) {
this.hide(true);
return;
}
if(field == this.fields.eq) {
this.fields.gt.setValue(null);
this.fields.lt.setValue(null);
} else {
this.fields.eq.setValue(null);
}
this.updateTask.delay(this.updateBuffer);
}
});
\ No newline at end of file
// Domain name
var domainRe = /[a-z0-9\.\-]/;
// Local part of email address regex (or mask in this case)
var emailLocalPartRe = /[a-z0-9\._\+&]/;
// Full email address
var emailAddressRe = /[a-z0-9\._\+&@\-]/;
// Typical username
var usernamePartRe = /[a-z0-9\._]/;
// Add the additional 'advanced' VTypes
Ext.apply(Ext.form.VTypes, {
'number': function(v) {
var numberMask = /^[0-9]+$/;
return numberMask.test(v);
},
'numberText': "This field must contain a number",
'domain': function(v) {
var domainMask = /^[a-z0-9]+[a-z0-9\-]*(\.[a-z0-9\-]+)+$/;
return domainMask.test(v);
},
'domainText': "This is not a valid domain",
'emailLocalPart': function(v) {
var emailLocalPartMask = /^[a-z0-9\._\+&]+$/;
return emailLocalPartMask.test(v);
},
'emailLocalPartText': "This is not a valid local part",
'usernamePart': function(v) {
var usernamePartMask = /^[a-z0-9\._]+$/;
return usernamePartMask.test(v);
},
'usernamePartText': "This is not a valid username",
'emailAddress': function(v) {
var emailAddressMask = /^[a-z0-9\._\-\+&]+@[a-z0-9]+[a-z0-9\-]*(\.[a-z0-9\-]+)+$/;
return emailAddressMask.test(v);
},
'emailAddressPartText': "This is not a valid email address",
'daterange': function(val, field) {
var date = field.parseDate(val);
if(!date){
return;
}
// Set maximum value for date, cant be less than minimum value
if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) {
var start = Ext.getCmp(field.startDateField);
start.setMaxValue(date);
start.validate();
this.dateRangeMax = date;
// Set minimum value for date, cant be more than maximum value
} else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
var end = Ext.getCmp(field.endDateField);
end.setMinValue(date);
end.validate();
this.dateRangeMin = date;
}
/*
* Always return true since we're only using this vtype to set the
* min/max allowed values (these are tested for after the vtype test)
*/
return true;
}
});
Source diff could not be displayed: it is too large. Options to address this: view the blob.
/*
* Ext JS Library 2.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext={version:"2.2"};window["undefined"]=window["undefined"];Ext.apply=function(C,D,B){if(B){Ext.apply(C,B)}if(C&&D&&typeof D=="object"){for(var A in D){C[A]=D[A]}}return C};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isSafari=(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isGecko=!isSafari&&ua.indexOf("gecko")>-1,isGecko3=!isSafari&&ua.indexOf("rv:1.9")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isAir=(ua.indexOf("adobeair")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;if(isIE&&!isIE7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return }var cache={};for(var b in o){var parts=b.split("@");if(parts[1]){var s=parts[0];if(!cache[s]){cache[s]=Ext.select(s)}cache[s].on(parts[1],o[b])}}cache=null},id:function(el,prefix){prefix=prefix||"ext-gen";el=Ext.getDom(el);var id=prefix+(++idSeed);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+" == \"undefined\"){"+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=="undefined"){buf.push(k,"=&")}else{if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&")}else{if(Ext.isArray(ov)){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}else{buf.push(k,"=&")}}}}}buf.pop();return buf.join("")},urlDecode:function(string,overwrite){if(!string||!string.length){return{}}var obj={};var pairs=string.split("&");var pair,name,value;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split("=");name=decodeURIComponent(pair[0]);value=decodeURIComponent(pair[1]);if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value}else{if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value)}else{obj[name].push(value)}}}else{obj[name]=value}}return obj},each:function(array,fn,scope){if(typeof array.length=="undefined"||typeof array=="string"){array=[array]}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(Ext.isArray(a)){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,scope,args,delay){if(typeof cb=="function"){if(delay){cb.defer(delay,scope,args||[])}else{cb.apply(scope,args||[])}}},getDom:function(el){if(!el||!document){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getDoc:function(){return Ext.get(document)},getBody:function(){return Ext.get(document.body||document.documentElement)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,defaultValue){if(typeof v!="number"){return defaultValue}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(typeof as.destroy=="function"){as.destroy()}else{if(as.dom){as.removeAllListeners();as.remove()}}}}},removeNode:isIE?function(){var d;return function(n){if(n&&n.tagName!="BODY"){d=d||document.createElement("div");d.appendChild(n);d.innerHTML=""}}}():function(n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false)},value:function(v,defaultValue,allowBlank){return Ext.isEmpty(v,allowBlank)?defaultValue:v},isArray:function(v){return v&&typeof v.length=="number"&&typeof v.splice=="function"},isDate:function(v){return v&&typeof v.getFullYear=="function"},isOpera:isOpera,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7,isIE7:isIE7,isGecko:isGecko,isGecko2:isGecko&&!isGecko3,isGecko3:isGecko3,isBorderBox:isBorderBox,isLinux:isLinux,isWindows:isWindows,isMac:isMac,isAir:isAir,useShims:((isIE&&!isIE7)||(isMac&&isGecko&&!isGecko3))});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var A=arguments;var B=this;return function(){return B.apply(window,A)}},createDelegate:function(C,B,A){var D=this;return function(){var F=B||arguments;if(A===true){F=Array.prototype.slice.call(arguments,0);F=F.concat(B)}else{if(typeof A=="number"){F=Array.prototype.slice.call(arguments,0);var E=[A,0].concat(B);Array.prototype.splice.apply(F,E)}}return D.apply(C||window,F)}},defer:function(C,E,B,A){var D=this.createDelegate(E,B,A);if(C){return setTimeout(D,C)}D();return 0},createSequence:function(B,A){if(typeof B!="function"){return this}var C=this;return function(){var D=C.apply(this||window,arguments);B.apply(A||this||window,arguments);return D}},createInterceptor:function(B,A){if(typeof B!="function"){return this}var C=this;return function(){B.target=this;B.method=C;if(B.apply(A||this||window,arguments)===false){return }return C.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1")},leftPad:function(D,B,C){var A=new String(D);if(!C){C=" "}while(A.length<B){A=C+A}return A.toString()},format:function(B){var A=Array.prototype.slice.call(arguments,1);return B.replace(/\{(\d+)\}/g,function(C,D){return A[D]})}});String.prototype.toggle=function(B,A){return this==B?A:B};String.prototype.trim=function(){var A=/^\s+|\s+$/g;return function(){return this.replace(A,"")}}();Ext.applyIf(Number.prototype,{constrain:function(B,A){return Math.min(Math.max(this,B),A)}});Ext.applyIf(Array.prototype,{indexOf:function(C){for(var B=0,A=this.length;B<A;B++){if(this[B]==C){return B}}return -1},remove:function(B){var A=this.indexOf(B);if(A!=-1){this.splice(A,1)}return this}});Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime())};
(function(){var B;Ext.lib.Dom={getViewWidth:function(E){return E?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(E){return E?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var E=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(E,this.getViewportHeight())},getDocumentWidth:function(){var E=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(E,this.getViewportWidth())},getViewportHeight:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientHeight:document.body.clientHeight}else{return self.innerHeight}},getViewportWidth:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientWidth:document.body.clientWidth}else{return self.innerWidth}},isAncestor:function(F,G){F=Ext.getDom(F);G=Ext.getDom(G);if(!F||!G){return false}if(F.contains&&!Ext.isSafari){return F.contains(G)}else{if(F.compareDocumentPosition){return !!(F.compareDocumentPosition(G)&16)}else{var E=G.parentNode;while(E){if(E==F){return true}else{if(!E.tagName||E.tagName.toUpperCase()=="HTML"){return false}}E=E.parentNode}return false}}},getRegion:function(E){return Ext.lib.Region.getRegion(E)},getY:function(E){return this.getXY(E)[1]},getX:function(E){return this.getXY(E)[0]},getXY:function(G){var F,K,M,N,J=(document.body||document.documentElement);G=Ext.getDom(G);if(G==J){return[0,0]}if(G.getBoundingClientRect){M=G.getBoundingClientRect();N=C(document).getScroll();return[M.left+N.left,M.top+N.top]}var O=0,L=0;F=G;var E=C(G).getStyle("position")=="absolute";while(F){O+=F.offsetLeft;L+=F.offsetTop;if(!E&&C(F).getStyle("position")=="absolute"){E=true}if(Ext.isGecko){K=C(F);var P=parseInt(K.getStyle("borderTopWidth"),10)||0;var H=parseInt(K.getStyle("borderLeftWidth"),10)||0;O+=H;L+=P;if(F!=G&&K.getStyle("overflow")!="visible"){O+=H;L+=P}}F=F.offsetParent}if(Ext.isSafari&&E){O-=J.offsetLeft;L-=J.offsetTop}if(Ext.isGecko&&!E){var I=C(J);O+=parseInt(I.getStyle("borderLeftWidth"),10)||0;L+=parseInt(I.getStyle("borderTopWidth"),10)||0}F=G.parentNode;while(F&&F!=J){if(!Ext.isOpera||(F.tagName!="TR"&&C(F).getStyle("display")!="inline")){O-=F.scrollLeft;L-=F.scrollTop}F=F.parentNode}return[O,L]},setXY:function(E,F){E=Ext.fly(E,"_setXY");E.position();var G=E.translatePoints(F);if(F[0]!==false){E.dom.style.left=G.left+"px"}if(F[1]!==false){E.dom.style.top=G.top+"px"}},setX:function(F,E){this.setXY(F,[E,false])},setY:function(E,F){this.setXY(E,[false,F])}};Ext.lib.Event=function(){var F=false;var G=[];var K=[];var I=0;var H=[];var E=0;var J=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var L=this;var M=function(){L._tryPreloadAttach()};this._interval=setInterval(M,this.POLL_INTERVAL)}},onAvailable:function(N,L,O,M){H.push({id:N,fn:L,obj:O,override:M,checkReady:false});I=this.POLL_RETRYS;this.startInterval()},addListener:function(Q,M,P){Q=Ext.getDom(Q);if(!Q||!P){return false}if("unload"==M){K[K.length]=[Q,M,P];return true}var O=function(R){return typeof Ext!="undefined"?P(Ext.lib.Event.getEvent(R)):false};var L=[Q,M,P,O];var N=G.length;G[N]=L;this.doAdd(Q,M,O,false);return true},removeListener:function(S,O,R){var Q,N;S=Ext.getDom(S);if(!R){return this.purgeElement(S,false,O)}if("unload"==O){for(Q=0,N=K.length;Q<N;Q++){var M=K[Q];if(M&&M[0]==S&&M[1]==O&&M[2]==R){K.splice(Q,1);return true}}return false}var L=null;var P=arguments[3];if("undefined"==typeof P){P=this._getCacheIndex(S,O,R)}if(P>=0){L=G[P]}if(!S||!L){return false}this.doRemove(S,O,L[this.WFN],false);delete G[P][this.WFN];delete G[P][this.FN];G.splice(P,1);return true},getTarget:function(N,M){N=N.browserEvent||N;var L=N.target||N.srcElement;return this.resolveTextNode(L)},resolveTextNode:function(L){if(Ext.isSafari&&L&&3==L.nodeType){return L.parentNode}else{return L}},getPageX:function(M){M=M.browserEvent||M;var L=M.pageX;if(!L&&0!==L){L=M.clientX||0;if(Ext.isIE){L+=this.getScroll()[1]}}return L},getPageY:function(L){L=L.browserEvent||L;var M=L.pageY;if(!M&&0!==M){M=L.clientY||0;if(Ext.isIE){M+=this.getScroll()[0]}}return M},getXY:function(L){L=L.browserEvent||L;return[this.getPageX(L),this.getPageY(L)]},getRelatedTarget:function(M){M=M.browserEvent||M;var L=M.relatedTarget;if(!L){if(M.type=="mouseout"){L=M.toElement}else{if(M.type=="mouseover"){L=M.fromElement}}}return this.resolveTextNode(L)},getTime:function(N){N=N.browserEvent||N;if(!N.time){var M=new Date().getTime();try{N.time=M}catch(L){this.lastError=L;return M}}return N.time},stopEvent:function(L){this.stopPropagation(L);this.preventDefault(L)},stopPropagation:function(L){L=L.browserEvent||L;if(L.stopPropagation){L.stopPropagation()}else{L.cancelBubble=true}},preventDefault:function(L){L=L.browserEvent||L;if(L.preventDefault){L.preventDefault()}else{L.returnValue=false}},getEvent:function(M){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break}N=N.caller}}return L},getCharCode:function(L){L=L.browserEvent||L;return L.charCode||L.keyCode||0},_getCacheIndex:function(Q,N,P){for(var O=0,M=G.length;O<M;++O){var L=G[O];if(L&&L[this.FN]==P&&L[this.EL]==Q&&L[this.TYPE]==N){return O}}return -1},elCache:{},getEl:function(L){return document.getElementById(L)},clearCache:function(){},_load:function(M){F=true;var L=Ext.lib.Event;if(Ext.isIE){L.doRemove(window,"load",L._load)}},_tryPreloadAttach:function(){if(this.locked){return false}this.locked=true;var R=!F;if(!R){R=(I>0)}var Q=[];for(var M=0,L=H.length;M<L;++M){var P=H[M];if(P){var O=this.getEl(P.id);if(O){if(!P.checkReady||F||O.nextSibling||(document&&document.body)){var N=O;if(P.override){if(P.override===true){N=P.obj}else{N=P.override}}P.fn.call(N,P.obj);H[M]=null}}else{Q.push(P)}}}I=(Q.length===0)?0:I-1;if(R){this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false;return true},purgeElement:function(P,Q,N){var R=this.getListeners(P,N);if(R){for(var O=0,L=R.length;O<L;++O){var M=R[O];this.removeListener(P,M.type,M.fn)}}if(Q&&P&&P.childNodes){for(O=0,L=P.childNodes.length;O<L;++O){this.purgeElement(P.childNodes[O],Q,N)}}},getListeners:function(M,R){var P=[],L;if(!R){L=[G,K]}else{if(R=="unload"){L=[K]}else{L=[G]}}for(var O=0;O<L.length;++O){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===M&&(!R||R===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.ADJ_SCOPE],index:Q})}}}}return(P.length)?P:null},_unload:function(S){var R=Ext.lib.Event,P,O,M,L,N;for(P=0,L=K.length;P<L;++P){M=K[P];if(M){var Q=window;if(M[R.ADJ_SCOPE]){if(M[R.ADJ_SCOPE]===true){Q=M[R.OBJ]}else{Q=M[R.ADJ_SCOPE]}}M[R.FN].call(Q,R.getEvent(S),M[R.OBJ]);K[P]=null;M=null;Q=null}}K=null;if(G&&G.length>0){O=G.length;while(O){N=O-1;M=G[N];if(M){R.removeListener(M[R.EL],M[R.TYPE],M[R.FN],N)}O=O-1}M=null;R.clearCache()}R.doRemove(window,"unload",R._unload)},getScroll:function(){var L=document.documentElement,M=document.body;if(L&&(L.scrollTop||L.scrollLeft)){return[L.scrollTop,L.scrollLeft]}else{if(M){return[M.scrollTop,M.scrollLeft]}else{return[0,0]}}},doAdd:function(){if(window.addEventListener){return function(O,M,N,L){O.addEventListener(M,N,(L))}}else{if(window.attachEvent){return function(O,M,N,L){O.attachEvent("on"+M,N)}}else{return function(){}}}}(),doRemove:function(){if(window.removeEventListener){return function(O,M,N,L){O.removeEventListener(M,N,(L))}}else{if(window.detachEvent){return function(N,L,M){N.detachEvent("on"+L,M)}}else{return function(){}}}}()}}();var D=Ext.lib.Event;D.on=D.addListener;D.un=D.removeListener;if(document&&document.body){D._load()}else{D.doAdd(window,"load",D._load)}D.doAdd(window,"unload",D._unload);D._tryPreloadAttach();Ext.lib.Ajax={request:function(K,I,E,J,F){if(F){var G=F.headers;if(G){for(var H in G){if(G.hasOwnProperty(H)){this.initHeader(H,G[H],false)}}}if(F.xmlData){if(!G||!G["Content-Type"]){this.initHeader("Content-Type","text/xml",false)}K=(K?K:(F.method?F.method:"POST"));J=F.xmlData}else{if(F.jsonData){if(!G||!G["Content-Type"]){this.initHeader("Content-Type","application/json",false)}K=(K?K:(F.method?F.method:"POST"));J=typeof F.jsonData=="object"?Ext.encode(F.jsonData):F.jsonData}}}return this.asyncRequest(K,I,E,J)},serializeForm:function(F){if(typeof F=="string"){F=(document.getElementById(F)||document.forms[F])}var G,E,H,J,K="",M=false;for(var L=0;L<F.elements.length;L++){G=F.elements[L];J=F.elements[L].disabled;E=F.elements[L].name;H=F.elements[L].value;if(!J&&E){switch(G.type){case"select-one":case"select-multiple":for(var I=0;I<G.options.length;I++){if(G.options[I].selected){if(Ext.isIE){K+=encodeURIComponent(E)+"="+encodeURIComponent(G.options[I].attributes["value"].specified?G.options[I].value:G.options[I].text)+"&"}else{K+=encodeURIComponent(E)+"="+encodeURIComponent(G.options[I].hasAttribute("value")?G.options[I].value:G.options[I].text)+"&"}}}break;case"radio":case"checkbox":if(G.checked){K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&"}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(M==false){K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&";M=true}break;default:K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&";break}}}K=K.substr(0,K.length-1);return K},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(E){this.activeX.unshift(E)},setDefaultPostHeader:function(E){this.useDefaultHeader=E},setDefaultXhrHeader:function(E){this.useDefaultXhrHeader=E},setPollingInterval:function(E){if(typeof E=="number"&&isFinite(E)){this.pollInterval=E}},createXhrObject:function(I){var H,E;try{E=new XMLHttpRequest();H={conn:E,tId:I}}catch(G){for(var F=0;F<this.activeX.length;++F){try{E=new ActiveXObject(this.activeX[F]);H={conn:E,tId:I};break}catch(G){}}}finally{return H}},getConnectionObject:function(){var F;var G=this.transactionId;try{F=this.createXhrObject(G);if(F){this.transactionId++}}catch(E){}finally{return F}},asyncRequest:function(I,F,H,E){var G=this.getConnectionObject();if(!G){return null}else{G.conn.open(I,F,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders["X-Requested-With"]){this.initHeader("X-Requested-With",this.defaultXhrHeader,true)}}if(E&&this.useDefaultHeader&&(!this.hasHeaders||!this.headers["Content-Type"])){this.initHeader("Content-Type",this.defaultPostHeader)}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(G)}this.handleReadyState(G,H);G.conn.send(E||null);return G}},handleReadyState:function(F,G){var E=this;if(G&&G.timeout){this.timeout[F.tId]=window.setTimeout(function(){E.abort(F,G,true)},G.timeout)}this.poll[F.tId]=window.setInterval(function(){if(F.conn&&F.conn.readyState==4){window.clearInterval(E.poll[F.tId]);delete E.poll[F.tId];if(G&&G.timeout){window.clearTimeout(E.timeout[F.tId]);delete E.timeout[F.tId]}E.handleTransactionResponse(F,G)}},this.pollInterval)},handleTransactionResponse:function(I,J,E){if(!J){this.releaseObject(I);return }var G,F;try{if(I.conn.status!==undefined&&I.conn.status!=0){G=I.conn.status}else{G=13030}}catch(H){G=13030}if(G>=200&&G<300){F=this.createResponseObject(I,J.argument);if(J.success){if(!J.scope){J.success(F)}else{J.success.apply(J.scope,[F])}}}else{switch(G){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:F=this.createExceptionObject(I.tId,J.argument,(E?E:false));if(J.failure){if(!J.scope){J.failure(F)}else{J.failure.apply(J.scope,[F])}}break;default:F=this.createResponseObject(I,J.argument);if(J.failure){if(!J.scope){J.failure(F)}else{J.failure.apply(J.scope,[F])}}}}this.releaseObject(I);F=null},createResponseObject:function(E,K){var H={};var M={};try{var G=E.conn.getAllResponseHeaders();var J=G.split("\n");for(var I=0;I<J.length;I++){var F=J[I].indexOf(":");if(F!=-1){M[J[I].substring(0,F)]=J[I].substring(F+2)}}}catch(L){}H.tId=E.tId;H.status=E.conn.status;H.statusText=E.conn.statusText;H.getResponseHeader=M;H.getAllResponseHeaders=G;H.responseText=E.conn.responseText;H.responseXML=E.conn.responseXML;if(typeof K!==undefined){H.argument=K}return H},createExceptionObject:function(L,H,E){var J=0;var K="communication failure";var G=-1;var F="transaction aborted";var I={};I.tId=L;if(E){I.status=G;I.statusText=F}else{I.status=J;I.statusText=K}if(H){I.argument=H}return I},initHeader:function(E,H,G){var F=(G)?this.defaultHeaders:this.headers;if(F[E]===undefined){F[E]=H}else{F[E]=H+","+F[E]}if(G){this.hasDefaultHeaders=true}else{this.hasHeaders=true}},setHeader:function(E){if(this.hasDefaultHeaders){for(var F in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(F)){E.conn.setRequestHeader(F,this.defaultHeaders[F])}}}if(this.hasHeaders){for(var F in this.headers){if(this.headers.hasOwnProperty(F)){E.conn.setRequestHeader(F,this.headers[F])}}this.headers={};this.hasHeaders=false}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false},abort:function(F,G,E){if(this.isCallInProgress(F)){F.conn.abort();window.clearInterval(this.poll[F.tId]);delete this.poll[F.tId];if(E){delete this.timeout[F.tId]}this.handleTransactionResponse(F,G,true);return true}else{return false}},isCallInProgress:function(E){if(E.conn){return E.conn.readyState!=4&&E.conn.readyState!=0}else{return false}},releaseObject:function(E){E.conn=null;E=null},activeX:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]};Ext.lib.Region=function(G,H,E,F){this.top=G;this[1]=G;this.right=H;this.bottom=E;this.left=F;this[0]=F};Ext.lib.Region.prototype={contains:function(E){return(E.left>=this.left&&E.right<=this.right&&E.top>=this.top&&E.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(I){var G=Math.max(this.top,I.top);var H=Math.min(this.right,I.right);var E=Math.min(this.bottom,I.bottom);var F=Math.max(this.left,I.left);if(E>=G&&H>=F){return new Ext.lib.Region(G,H,E,F)}else{return null}},union:function(I){var G=Math.min(this.top,I.top);var H=Math.max(this.right,I.right);var E=Math.max(this.bottom,I.bottom);var F=Math.min(this.left,I.left);return new Ext.lib.Region(G,H,E,F)},constrainTo:function(E){this.top=this.top.constrain(E.top,E.bottom);this.bottom=this.bottom.constrain(E.top,E.bottom);this.left=this.left.constrain(E.left,E.right);this.right=this.right.constrain(E.left,E.right);return this},adjust:function(G,F,E,H){this.top+=G;this.left+=F;this.right+=H;this.bottom+=E;return this}};Ext.lib.Region.getRegion=function(H){var J=Ext.lib.Dom.getXY(H);var G=J[1];var I=J[0]+H.offsetWidth;var E=J[1]+H.offsetHeight;var F=J[0];return new Ext.lib.Region(G,I,E,F)};Ext.lib.Point=function(E,F){if(Ext.isArray(E)){F=E[1];E=E[0]}this.x=this.right=this.left=this[0]=E;this.y=this.top=this.bottom=this[1]=F};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.lib.Anim={scroll:function(H,F,I,J,E,G){return this.run(H,F,I,J,E,G,Ext.lib.Scroll)},motion:function(H,F,I,J,E,G){return this.run(H,F,I,J,E,G,Ext.lib.Motion)},color:function(H,F,I,J,E,G){return this.run(H,F,I,J,E,G,Ext.lib.ColorAnim)},run:function(I,F,K,L,E,H,G){G=G||Ext.lib.AnimBase;if(typeof L=="string"){L=Ext.lib.Easing[L]}var J=new G(I,F,K,L);J.animateX(function(){Ext.callback(E,H)});return J}};function C(E){if(!B){B=new Ext.Element.Flyweight()}B.dom=E;return B}if(Ext.isIE){function A(){var E=Function.prototype;delete E.createSequence;delete E.defer;delete E.createDelegate;delete E.createCallback;delete E.createInterceptor;window.detachEvent("onunload",A)}window.attachEvent("onunload",A)}Ext.lib.AnimBase=function(F,E,G,H){if(F){this.init(F,E,G,H)}};Ext.lib.AnimBase.prototype={toString:function(){var E=this.getEl();var F=E.id||E.tagName;return("Anim "+F)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(E,G,F){return this.method(this.currentFrame,G,F-G,this.totalFrames)},setAttribute:function(E,G,F){if(this.patterns.noNegatives.test(E)){G=(G>0)?G:0}Ext.fly(this.getEl(),"_anim").setStyle(E,G+F)},getAttribute:function(E){var G=this.getEl();var I=C(G).getStyle(E);if(I!=="auto"&&!this.patterns.offsetUnit.test(I)){return parseFloat(I)}var F=this.patterns.offsetAttribute.exec(E)||[];var J=!!(F[3]);var H=!!(F[2]);if(H||(C(G).getStyle("position")=="absolute"&&J)){I=G["offset"+F[0].charAt(0).toUpperCase()+F[0].substr(1)]}else{I=0}return I},getDefaultUnit:function(E){if(this.patterns.defaultUnit.test(E)){return"px"}return""},animateX:function(G,E){var F=function(){this.onComplete.removeListener(F);if(typeof G=="function"){G.call(E||this,this)}};this.onComplete.addListener(F,this);this.animate()},setRuntimeAttribute:function(F){var K;var G;var H=this.attributes;this.runtimeAttributes[F]={};var J=function(L){return(typeof L!=="undefined")};if(!J(H[F]["to"])&&!J(H[F]["by"])){return false}K=(J(H[F]["from"]))?H[F]["from"]:this.getAttribute(F);if(J(H[F]["to"])){G=H[F]["to"]}else{if(J(H[F]["by"])){if(K.constructor==Array){G=[];for(var I=0,E=K.length;I<E;++I){G[I]=K[I]+H[F]["by"][I]}}else{G=K+H[F]["by"]}}}this.runtimeAttributes[F].start=K;this.runtimeAttributes[F].end=G;this.runtimeAttributes[F].unit=(J(H[F].unit))?H[F]["unit"]:this.getDefaultUnit(F)},init:function(G,L,K,E){var F=false;var H=null;var J=0;G=Ext.getDom(G);this.attributes=L||{};this.duration=K||1;this.method=E||Ext.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Ext.lib.AnimMgr.fps;this.getEl=function(){return G};this.isAnimated=function(){return F};this.getStartTime=function(){return H};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Ext.lib.AnimMgr.fps*this.duration):this.duration;Ext.lib.AnimMgr.registerElement(this)};this.stop=function(O){if(O){this.currentFrame=this.totalFrames;this._onTween.fire()}Ext.lib.AnimMgr.stop(this)};var N=function(){this.onStart.fire();this.runtimeAttributes={};for(var O in this.attributes){this.setRuntimeAttribute(O)}F=true;J=0;H=new Date()};var M=function(){var Q={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};Q.toString=function(){return("duration: "+Q.duration+", currentFrame: "+Q.currentFrame)};this.onTween.fire(Q);var P=this.runtimeAttributes;for(var O in P){this.setAttribute(O,this.doMethod(O,P[O].start,P[O].end),P[O].unit)}J+=1};var I=function(){var O=(new Date()-H)/1000;var P={duration:O,frames:J,fps:J/O};P.toString=function(){return("duration: "+P.duration+", frames: "+P.frames+", fps: "+P.fps)};F=false;J=0;this.onComplete.fire(P)};this._onStart=new Ext.util.Event(this);this.onStart=new Ext.util.Event(this);this.onTween=new Ext.util.Event(this);this._onTween=new Ext.util.Event(this);this.onComplete=new Ext.util.Event(this);this._onComplete=new Ext.util.Event(this);this._onStart.addListener(N);this._onTween.addListener(M);this._onComplete.addListener(I)}};Ext.lib.AnimMgr=new function(){var G=null;var F=[];var E=0;this.fps=1000;this.delay=1;this.registerElement=function(J){F[F.length]=J;E+=1;J._onStart.fire();this.start()};this.unRegister=function(K,J){K._onComplete.fire();J=J||I(K);if(J!=-1){F.splice(J,1)}E-=1;if(E<=0){this.stop()}};this.start=function(){if(G===null){G=setInterval(this.run,this.delay)}};this.stop=function(L){if(!L){clearInterval(G);for(var K=0,J=F.length;K<J;++K){if(F[0].isAnimated()){this.unRegister(F[0],0)}}F=[];G=null;E=0}else{this.unRegister(L)}};this.run=function(){for(var L=0,J=F.length;L<J;++L){var K=F[L];if(!K||!K.isAnimated()){continue}if(K.currentFrame<K.totalFrames||K.totalFrames===null){K.currentFrame+=1;if(K.useSeconds){H(K)}K._onTween.fire()}else{Ext.lib.AnimMgr.stop(K,L)}}};var I=function(L){for(var K=0,J=F.length;K<J;++K){if(F[K]==L){return K}}return -1};var H=function(K){var N=K.totalFrames;var M=K.currentFrame;var L=(K.currentFrame*K.duration*1000/K.totalFrames);var J=(new Date()-K.getStartTime());var O=0;if(J<K.duration*1000){O=Math.round((J/L-1)*K.currentFrame)}else{O=N-(M+1)}if(O>0&&isFinite(O)){if(K.currentFrame+O>=N){O=N-(M+1)}K.currentFrame+=O}}};Ext.lib.Bezier=new function(){this.getPosition=function(I,H){var J=I.length;var G=[];for(var F=0;F<J;++F){G[F]=[I[F][0],I[F][1]]}for(var E=1;E<J;++E){for(F=0;F<J-E;++F){G[F][0]=(1-H)*G[F][0]+H*G[parseInt(F+1,10)][0];G[F][1]=(1-H)*G[F][1]+H*G[parseInt(F+1,10)][1]}}return[G[0][0],G[0][1]]}};(function(){Ext.lib.ColorAnim=function(I,H,J,K){Ext.lib.ColorAnim.superclass.constructor.call(this,I,H,J,K)};Ext.extend(Ext.lib.ColorAnim,Ext.lib.AnimBase);var F=Ext.lib;var G=F.ColorAnim.superclass;var E=F.ColorAnim.prototype;E.toString=function(){var H=this.getEl();var I=H.id||H.tagName;return("ColorAnim "+I)};E.patterns.color=/color$/i;E.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;E.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;E.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;E.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;E.parseColor=function(H){if(H.length==3){return H}var I=this.patterns.hex.exec(H);if(I&&I.length==4){return[parseInt(I[1],16),parseInt(I[2],16),parseInt(I[3],16)]}I=this.patterns.rgb.exec(H);if(I&&I.length==4){return[parseInt(I[1],10),parseInt(I[2],10),parseInt(I[3],10)]}I=this.patterns.hex3.exec(H);if(I&&I.length==4){return[parseInt(I[1]+I[1],16),parseInt(I[2]+I[2],16),parseInt(I[3]+I[3],16)]}return null};E.getAttribute=function(H){var J=this.getEl();if(this.patterns.color.test(H)){var K=C(J).getStyle(H);if(this.patterns.transparent.test(K)){var I=J.parentNode;K=C(I).getStyle(H);while(I&&this.patterns.transparent.test(K)){I=I.parentNode;K=C(I).getStyle(H);if(I.tagName.toUpperCase()=="HTML"){K="#fff"}}}}else{K=G.getAttribute.call(this,H)}return K};E.doMethod=function(I,M,J){var L;if(this.patterns.color.test(I)){L=[];for(var K=0,H=M.length;K<H;++K){L[K]=G.doMethod.call(this,I,M[K],J[K])}L="rgb("+Math.floor(L[0])+","+Math.floor(L[1])+","+Math.floor(L[2])+")"}else{L=G.doMethod.call(this,I,M,J)}return L};E.setRuntimeAttribute=function(I){G.setRuntimeAttribute.call(this,I);if(this.patterns.color.test(I)){var K=this.attributes;var M=this.parseColor(this.runtimeAttributes[I].start);var J=this.parseColor(this.runtimeAttributes[I].end);if(typeof K[I]["to"]==="undefined"&&typeof K[I]["by"]!=="undefined"){J=this.parseColor(K[I].by);for(var L=0,H=M.length;L<H;++L){J[L]=M[L]+J[L]}}this.runtimeAttributes[I].start=M;this.runtimeAttributes[I].end=J}}})();Ext.lib.Easing={easeNone:function(F,E,H,G){return H*F/G+E},easeIn:function(F,E,H,G){return H*(F/=G)*F+E},easeOut:function(F,E,H,G){return -H*(F/=G)*(F-2)+E},easeBoth:function(F,E,H,G){if((F/=G/2)<1){return H/2*F*F+E}return -H/2*((--F)*(F-2)-1)+E},easeInStrong:function(F,E,H,G){return H*(F/=G)*F*F*F+E},easeOutStrong:function(F,E,H,G){return -H*((F=F/G-1)*F*F*F-1)+E},easeBothStrong:function(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F*F+E}return -H/2*((F-=2)*F*F*F-2)+E},elasticIn:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}return -(F*Math.pow(2,10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I))+E},elasticOut:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}return F*Math.pow(2,-10*G)*Math.sin((G*J-H)*(2*Math.PI)/I)+K+E},elasticBoth:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J/2)==2){return E+K}if(!I){I=J*(0.3*1.5)}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}if(G<1){return -0.5*(F*Math.pow(2,10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I))+E}return F*Math.pow(2,-10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I)*0.5+K+E},backIn:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}return I*(F/=H)*F*((G+1)*F-G)+E},backOut:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}return I*((F=F/H-1)*F*((G+1)*F+G)+1)+E},backBoth:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}if((F/=H/2)<1){return I/2*(F*F*(((G*=(1.525))+1)*F-G))+E}return I/2*((F-=2)*F*(((G*=(1.525))+1)*F+G)+2)+E},bounceIn:function(F,E,H,G){return H-Ext.lib.Easing.bounceOut(G-F,0,H,G)+E},bounceOut:function(F,E,H,G){if((F/=G)<(1/2.75)){return H*(7.5625*F*F)+E}else{if(F<(2/2.75)){return H*(7.5625*(F-=(1.5/2.75))*F+0.75)+E}else{if(F<(2.5/2.75)){return H*(7.5625*(F-=(2.25/2.75))*F+0.9375)+E}}}return H*(7.5625*(F-=(2.625/2.75))*F+0.984375)+E},bounceBoth:function(F,E,H,G){if(F<G/2){return Ext.lib.Easing.bounceIn(F*2,0,H,G)*0.5+E}return Ext.lib.Easing.bounceOut(F*2-G,0,H,G)*0.5+H*0.5+E}};(function(){Ext.lib.Motion=function(K,J,L,M){if(K){Ext.lib.Motion.superclass.constructor.call(this,K,J,L,M)}};Ext.extend(Ext.lib.Motion,Ext.lib.ColorAnim);var H=Ext.lib;var I=H.Motion.superclass;var F=H.Motion.prototype;F.toString=function(){var J=this.getEl();var K=J.id||J.tagName;return("Motion "+K)};F.patterns.points=/^points$/i;F.setAttribute=function(J,L,K){if(this.patterns.points.test(J)){K=K||"px";I.setAttribute.call(this,"left",L[0],K);I.setAttribute.call(this,"top",L[1],K)}else{I.setAttribute.call(this,J,L,K)}};F.getAttribute=function(J){if(this.patterns.points.test(J)){var K=[I.getAttribute.call(this,"left"),I.getAttribute.call(this,"top")]}else{K=I.getAttribute.call(this,J)}return K};F.doMethod=function(J,N,K){var M=null;if(this.patterns.points.test(J)){var L=this.method(this.currentFrame,0,100,this.totalFrames)/100;M=H.Bezier.getPosition(this.runtimeAttributes[J],L)}else{M=I.doMethod.call(this,J,N,K)}return M};F.setRuntimeAttribute=function(S){if(this.patterns.points.test(S)){var K=this.getEl();var M=this.attributes;var J;var O=M["points"]["control"]||[];var L;var P,R;if(O.length>0&&!Ext.isArray(O[0])){O=[O]}else{var N=[];for(P=0,R=O.length;P<R;++P){N[P]=O[P]}O=N}Ext.fly(K,"_anim").position();if(G(M["points"]["from"])){Ext.lib.Dom.setXY(K,M["points"]["from"])}else{Ext.lib.Dom.setXY(K,Ext.lib.Dom.getXY(K))}J=this.getAttribute("points");if(G(M["points"]["to"])){L=E.call(this,M["points"]["to"],J);var Q=Ext.lib.Dom.getXY(this.getEl());for(P=0,R=O.length;P<R;++P){O[P]=E.call(this,O[P],J)}}else{if(G(M["points"]["by"])){L=[J[0]+M["points"]["by"][0],J[1]+M["points"]["by"][1]];for(P=0,R=O.length;P<R;++P){O[P]=[J[0]+O[P][0],J[1]+O[P][1]]}}}this.runtimeAttributes[S]=[J];if(O.length>0){this.runtimeAttributes[S]=this.runtimeAttributes[S].concat(O)}this.runtimeAttributes[S][this.runtimeAttributes[S].length]=L}else{I.setRuntimeAttribute.call(this,S)}};var E=function(J,L){var K=Ext.lib.Dom.getXY(this.getEl());J=[J[0]-K[0]+L[0],J[1]-K[1]+L[1]];return J};var G=function(J){return(typeof J!=="undefined")}})();(function(){Ext.lib.Scroll=function(I,H,J,K){if(I){Ext.lib.Scroll.superclass.constructor.call(this,I,H,J,K)}};Ext.extend(Ext.lib.Scroll,Ext.lib.ColorAnim);var F=Ext.lib;var G=F.Scroll.superclass;var E=F.Scroll.prototype;E.toString=function(){var H=this.getEl();var I=H.id||H.tagName;return("Scroll "+I)};E.doMethod=function(H,K,I){var J=null;if(H=="scroll"){J=[this.method(this.currentFrame,K[0],I[0]-K[0],this.totalFrames),this.method(this.currentFrame,K[1],I[1]-K[1],this.totalFrames)]}else{J=G.doMethod.call(this,H,K,I)}return J};E.getAttribute=function(H){var J=null;var I=this.getEl();if(H=="scroll"){J=[I.scrollLeft,I.scrollTop]}else{J=G.getAttribute.call(this,H)}return J};E.setAttribute=function(H,K,J){var I=this.getEl();if(H=="scroll"){I.scrollLeft=K[0];I.scrollTop=K[1]}else{G.setAttribute.call(this,H,K,J)}}})()})();
webgui/resources/custom/images/extjs-powered.gif

2.24 KiB