You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1471 lines
42 KiB
1471 lines
42 KiB
function GetUserList(){
|
|
Ext.Ajax.request({
|
|
url: 'lib/connector/json/user_list.php?UID='+UserID+'&SID='+SessionID,
|
|
success: function( response, opts ){
|
|
var obj = Ext.decode( response.responseText );
|
|
UserListDataStore.loadData( obj );
|
|
Ext.getCmp('user-list-grid').doLayout();
|
|
},
|
|
failure: function( response, opts ){
|
|
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CEUL00227');
|
|
},
|
|
headers: {
|
|
'my-header': 'foo'
|
|
},
|
|
params: { foo: 'bar' }
|
|
});
|
|
};
|
|
function SetUserAddDescription(){
|
|
CVal=Ext.getCmp('add_user_access_select').getValue();
|
|
var DTX=Ext.getCmp('add_user_access_description');
|
|
DTX.removeAll();
|
|
switch( CVal ){
|
|
case 1:{
|
|
DTX.add({html:'Tracking Reviewer Access Level Will Grant:<br><ul><li>Review Online Tracking</li></ul>'});
|
|
break;
|
|
};
|
|
case 2:{
|
|
DTX.add({html:'Report Reviewer Access Level Will Grant:<br><ul><li>Review Online Tracking</li><li>Review and Print Reports</li></ul>'});
|
|
break;
|
|
};
|
|
case 3:{
|
|
DTX.add({html:'Report Manager Access Level Will Grant:<br><ol><li>Review Online Tracking</li><li>Review and Print Reports</li><li>Manage Report Events</li></ol>'});
|
|
break;
|
|
};
|
|
case 4:{
|
|
DTX.add({html:'Administrator Access Level Will Grant:<br><ul><li>Review Online Tracking</li><li>Review and Print Reports</li><li>Manage Report Events</li><li>Manage Account Settings</li><li>Manage Account Users</li></ul>'});
|
|
break;
|
|
};
|
|
};
|
|
DTX.doLayout();
|
|
};
|
|
|
|
function SetUserEditorDescription(){
|
|
CVal=Ext.getCmp('edit_user_access_select').getValue();
|
|
var DTX=Ext.getCmp('edit_user_access_description');
|
|
DTX.removeAll();
|
|
switch( CVal ){
|
|
case 1:{
|
|
DTX.add({html:'Tracking Reviewer Access Level Will Grant:<br><ul><li>Review Online Tracking</li></ul>'});
|
|
break;
|
|
};
|
|
case 2:{
|
|
DTX.add({html:'Report Reviewer Access Level Will Grant:<br><ul><li>Review Online Tracking</li><li>Review and Print Reports</li></ul>'});
|
|
break;
|
|
};
|
|
case 3:{
|
|
DTX.add({html:'Report Manager Access Level Will Grant:<br><ol><li>Review Online Tracking</li><li>Review and Print Reports</li><li>Manage Report Events</li></ol>'});
|
|
break;
|
|
};
|
|
case 4:{
|
|
DTX.add({html:'Administrator Access Level Will Grant:<br><ul><li>Review Online Tracking</li><li>Review and Print Reports</li><li>Manage Report Events</li><li>Manage Account Settings</li><li>Manage Account Users</li></ul>'});
|
|
break;
|
|
};
|
|
};
|
|
DTX.doLayout();
|
|
};
|
|
|
|
var UserListRecord = Ext.data.Record.create([
|
|
'id',
|
|
'login',
|
|
'status',
|
|
'type',
|
|
'created',
|
|
'last_access'
|
|
]);
|
|
|
|
var UserListDataStore = new Ext.data.Store({
|
|
reader: new Ext.data.JsonReader({
|
|
// The metadata property, with configuration options:
|
|
//totalProperty: "results", // the property which contains the total dataset size (optional)
|
|
root: "rows", // the property which contains an Array of row objects
|
|
idProperty: "id" // the property within each row object that provides an ID for the record (optional)
|
|
}, UserListRecord // Ext.data.Record constructor that provides mapping for JSON object
|
|
)
|
|
});
|
|
|
|
|
|
// DEEVICE LIST
|
|
|
|
var DeviceListRecord = Ext.data.Record.create([
|
|
'id',
|
|
'device_id',
|
|
'status',
|
|
'icon',
|
|
'name',
|
|
'created',
|
|
'last_access',
|
|
'sms'
|
|
]);
|
|
|
|
var DeviceListDataStore = new Ext.data.Store({
|
|
reader: new Ext.data.JsonReader({
|
|
root: "rows", // the property which contains an Array of row objects
|
|
idProperty: "id" // the property within each row object that provides an ID for the record (optional)
|
|
}, DeviceListRecord // Ext.data.Record constructor that provides mapping for JSON object
|
|
)
|
|
});
|
|
|
|
function GetDeviceList(){
|
|
Ext.Ajax.request({
|
|
url: 'lib/connector/json/device_list.php?UID='+UserID+'&SID='+SessionID,
|
|
success: function( response, opts ){
|
|
var obj = Ext.decode( response.responseText );
|
|
DeviceListDataStore.loadData( obj );
|
|
},
|
|
failure: function( response, opts ){
|
|
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CEDL00226');
|
|
},
|
|
headers: {
|
|
'my-header': 'foo'
|
|
},
|
|
params: { foo: 'bar' }
|
|
});
|
|
};
|
|
|
|
// New Device List
|
|
|
|
var NDeviceListRecord = Ext.data.Record.create([
|
|
'id',
|
|
'device_id'
|
|
]);
|
|
|
|
var NDeviceListDataStore = new Ext.data.Store({
|
|
reader: new Ext.data.JsonReader({
|
|
// The metadata property, with configuration options:
|
|
//totalProperty: "results", // the property which contains the total dataset size (optional)
|
|
root: "rows", // the property which contains an Array of row objects
|
|
idProperty: "id" // the property within each row object that provides an ID for the record (optional)
|
|
}, NDeviceListRecord // Ext.data.Record constructor that provides mapping for JSON object
|
|
)
|
|
});
|
|
|
|
function GetNewDeviceList(){
|
|
Ext.Ajax.request({
|
|
url: 'lib/connector/json/new_device_list.php?UID='+UserID+'&SID='+SessionID,
|
|
success: function( response, opts ){
|
|
var obj = Ext.decode( response.responseText );
|
|
NDeviceListDataStore.loadData( obj );
|
|
},
|
|
failure: function( response, opts ){
|
|
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00225');
|
|
},
|
|
headers: {
|
|
'my-header': 'foo'
|
|
},
|
|
params: { foo: 'bar' }
|
|
});
|
|
};
|
|
|
|
|
|
// Reports
|
|
|
|
var SelectedRDevice;
|
|
var RepportDeviceButtonList = new Ext.Panel({
|
|
id: 'New-Device-List',
|
|
//renderTo: RDeviceListDiv,
|
|
frame: true,
|
|
title: 'Report Manager',
|
|
bodyStyle:'padding: 5px;'
|
|
});
|
|
|
|
var RepportPlaceholderPanel = new Ext.Panel({
|
|
id: 'New-Device-List',
|
|
//renderTo: RDeviceListDiv,
|
|
frame: true,
|
|
height: PanelH,
|
|
title: 'Reports',
|
|
bodyStyle:'padding: 5px;'
|
|
});
|
|
|
|
|
|
function GetRepDevicesButtons(){
|
|
Ext.Ajax.request({
|
|
url: 'lib/connector/json/device_list.php?UID='+UserID+'&SID='+SessionID,
|
|
success: function( response, opts ){
|
|
var obj = Ext.decode( response.responseText );
|
|
for( index=0; index < obj.rows.length; index++ ){
|
|
RepportDeviceButtonList.add({
|
|
xtype: 'button',
|
|
param: obj.rows[index].device_id,
|
|
text: obj.rows[index].name,
|
|
width: '100%',
|
|
style: 'padding-top: 3px;',
|
|
handler: function( tb, e ){
|
|
alert( tb.param );
|
|
}
|
|
});
|
|
};
|
|
RepportDeviceButtonList.doLayout();
|
|
},
|
|
failure: function( response, opts ){
|
|
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CEDL00224');
|
|
},
|
|
headers: {
|
|
'my-header': 'foo'
|
|
},
|
|
params: { foo: 'bar' }
|
|
});
|
|
};
|
|
|
|
|
|
Ext.onReady( function(){
|
|
|
|
|
|
|
|
Ext.QuickTips.init();
|
|
|
|
// turn on validation errors beside the field globally
|
|
Ext.form.Field.prototype.msgTarget = 'side';
|
|
|
|
|
|
var UserListDiv = Ext.get('user_list');
|
|
var DeviceListDiv = Ext.get('device_list');
|
|
var NDeviceListDiv = Ext.get('ndevice_list');
|
|
var RDeviceListDiv = Ext.get('rep_dev_list');
|
|
var AddNewUserWindow;
|
|
var EditUserWindow;
|
|
|
|
// MAP
|
|
|
|
var gct_p = Ext.get('gmap_control_placeholder');
|
|
var gct_t = Ext.get('gmap_control_toolbox');
|
|
var gct_m = Ext.get('gmap_control_map');
|
|
|
|
var GMapToolbox = new Ext.Panel({
|
|
title: 'Tools',
|
|
//renderTo: gct_t,
|
|
region:'west',
|
|
margins: '5 0 0 5',
|
|
width: 200,
|
|
height: PanelH,
|
|
collapsible: true, // make collapsible
|
|
//collapsed: true,
|
|
//collapseFirst: true,
|
|
cmargins: '5 5 0 5', // adjust top margin when collapsed
|
|
id: 'GMAP-Toolbox',
|
|
style: 'background: white; border: 1px solid black;',
|
|
hideCollapseTool: false,
|
|
layoutConfig: {
|
|
titleCollapse: true,
|
|
//animate: false,
|
|
activeOnTop: true
|
|
},
|
|
items: [
|
|
new Ext.Panel({
|
|
//title: 'Tools',
|
|
//margins: '5 0 0 5',
|
|
width: 200,
|
|
height: PanelH - 220,
|
|
bodyBorder: true,
|
|
layout:'accordion',
|
|
unstyled: true,
|
|
defaults: {
|
|
// applied to each contained panel
|
|
bodyStyle: 'padding:5px',
|
|
frame: false
|
|
},
|
|
layoutConfig: {
|
|
// layout-specific configs go here
|
|
//titleCollapse: false,
|
|
//animate: false
|
|
//activeOnTop: true
|
|
},
|
|
items: [
|
|
new Ext.tree.TreePanel({
|
|
id:'im-tree',
|
|
title: 'Vehicles',
|
|
frame: true,
|
|
loader: new Ext.tree.TreeLoader({
|
|
dataUrl: 'lib/connector/json/tracking_device_list.php?UID='+UserID+'&SID='+SessionID,
|
|
baseAttrs:{
|
|
expanded: true
|
|
},
|
|
listeners:{
|
|
load: function( me, node, response ){
|
|
//alert('lib/connector/json/tracking_device_list.php?UID='+UserID+'&SID='+SessionID);
|
|
//GMapToolbox.doLayout();
|
|
//GMapToolbox.expand();
|
|
if ( node.getPath() == InitTreeNodePath ){
|
|
node.select();
|
|
};
|
|
}
|
|
}
|
|
}),
|
|
selModel: new Ext.tree.DefaultSelectionModel({
|
|
listeners:{
|
|
selectionchange: function ( me, node ){
|
|
if (isNaN(node.id)){
|
|
CDevID=node.id-1;
|
|
CQStyle=2
|
|
RetriveData();
|
|
} else {
|
|
CDevID=node.id-1;
|
|
CQStyle=0
|
|
RetriveData();
|
|
};
|
|
}
|
|
}
|
|
}),
|
|
rootVisible:false,
|
|
lines:false,
|
|
autoScroll:true,
|
|
root: new Ext.tree.AsyncTreeNode({
|
|
text:'All Devices',
|
|
expanded: true
|
|
})
|
|
}), new Ext.Panel({
|
|
title: 'Tracking Settings',
|
|
frame: true,
|
|
//style: 'background: white;',
|
|
align: 'center',
|
|
items: [
|
|
{
|
|
layout: 'form',
|
|
frame: true,
|
|
items: [
|
|
{
|
|
xtype:'label',
|
|
autoWidth: true,
|
|
fieldLabel: 'Tracking Mode'
|
|
},
|
|
new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
boxLabel: 'Real Time Tracking',
|
|
listeners: {
|
|
'check': function( me, checked ){
|
|
if(checked){
|
|
map.checkResize();
|
|
StartTrackingSession(0);
|
|
window.clearInterval(MapUpdateInterval);
|
|
MapUpdateInterval=window.setInterval("RetriveData();",10000);
|
|
trackingMode = 1;
|
|
Ext.getCmp('history-settings').setVisible( false );
|
|
try{
|
|
Ext.getCmp('history-settings').doLayout();
|
|
} catch (e){};
|
|
};
|
|
}
|
|
},
|
|
id: 'track_type_r',
|
|
name: 'track_type'
|
|
}),
|
|
new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
boxLabel: 'Tracking History',
|
|
listeners: {
|
|
'check': function( me, checked ){
|
|
if(checked){
|
|
window.clearInterval(MapUpdateInterval);
|
|
trackingMode = 2;
|
|
StartCalendarSession(5);
|
|
Ext.getCmp('history-settings').setVisible( true );
|
|
try{
|
|
Ext.getCmp('history-settings').doLayout();
|
|
} catch(e){};
|
|
};
|
|
}
|
|
},
|
|
id: 'track_type_h',
|
|
name: 'track_type'
|
|
})
|
|
]
|
|
},
|
|
new Ext.Spacer({
|
|
height: 5,
|
|
style: 'background: white'
|
|
}),
|
|
{
|
|
xtype: 'tabpanel',
|
|
id: 'history-settings',
|
|
activeTab: 0,
|
|
height: 280, // Why do I have to specify the height here?
|
|
// Shouldn't its container's 'fit' layout take
|
|
// care of that?
|
|
//width: PanelH,
|
|
hidden: true,
|
|
border: false,
|
|
deferredRender: true, // This works
|
|
//defaults: {autoScroll: true},
|
|
items: [
|
|
{
|
|
layout: 'form',
|
|
title: 'Simple Param.',
|
|
frame: true,
|
|
//bodyStyle: 'padding 10px;',
|
|
labelWidth: 50,
|
|
defaults: { width: 80},
|
|
items: [{
|
|
html:'koko'
|
|
}/*,
|
|
new Ext.Slider({
|
|
fieldLabel: 'Plot Number',
|
|
width: 150,
|
|
value: 50,
|
|
increment: 10,
|
|
minValue: 0,
|
|
maxValue: 100
|
|
})*/
|
|
],
|
|
buttons: [{
|
|
xtype: 'button',
|
|
text: 'Display History'
|
|
}]
|
|
},{
|
|
layout: 'form',
|
|
title: 'Date/Time',
|
|
frame: true,
|
|
labelAlign: 'right',
|
|
labelWidth: 50,
|
|
defaults: { width: 80},
|
|
items: [
|
|
new Ext.form.TimeField({
|
|
id: 'STimeFROM',
|
|
width: 120,
|
|
fieldLabel: 'From',
|
|
minValue: '00:00',
|
|
maxValue: '24:00',
|
|
increment: 30
|
|
}),
|
|
new Ext.form.TimeField({
|
|
id: 'STimeTO',
|
|
width: 50,
|
|
fieldLabel: 'Till',
|
|
minValue: '00:00',
|
|
maxValue: '24:00',
|
|
increment: 30
|
|
})
|
|
],
|
|
html: '<table width="100%"><tr><td id="calendar_TD" align="center"></td></tr></table>',
|
|
buttons: [{
|
|
xtype: 'button',
|
|
text: 'Display History'
|
|
}]
|
|
}]
|
|
}
|
|
]
|
|
|
|
}),new Ext.Panel({
|
|
title: 'Map Settings',
|
|
frame: true,
|
|
//style: 'background: white;',
|
|
align: 'center',
|
|
items: [{
|
|
layout: 'form',
|
|
//title: 'Address Info',
|
|
frame: true,
|
|
//labelAlign: 'center',
|
|
//style: 'text-align: center;',
|
|
//defaults: {width: 75},
|
|
items: [
|
|
{
|
|
xtype:'label',
|
|
autoWidth: true,
|
|
fieldLabel: 'Map Type'
|
|
},
|
|
new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: 'reg',
|
|
boxLabel: 'Regular Map',
|
|
listeners: {
|
|
'check': function( me, checked ){
|
|
if( checked ){
|
|
if ( InitSetupParameters ) SaveSetting(3,1);
|
|
map.setMapType(G_NORMAL_MAP);
|
|
};
|
|
}
|
|
},
|
|
id: 'map_type_1',
|
|
name: 'map_type'
|
|
}),
|
|
new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: 'sat',
|
|
boxLabel: 'Satelite Map',
|
|
listeners: {
|
|
'check': function( me, checked ){
|
|
if( checked ){
|
|
if ( InitSetupParameters ) SaveSetting(3,2);
|
|
map.setMapType(G_SATELLITE_MAP);
|
|
};
|
|
}
|
|
},
|
|
id: 'map_type_2',
|
|
name: 'map_type'
|
|
}),
|
|
new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: 'comb',
|
|
boxLabel: 'Hybrid Map (Satelite/Regular)',
|
|
listeners: {
|
|
'check': function( me, checked ){
|
|
if( checked ){
|
|
if ( InitSetupParameters ) SaveSetting(3,3);
|
|
map.setMapType(G_HYBRID_MAP);
|
|
};
|
|
}
|
|
},
|
|
id: 'map_type_3',
|
|
name: 'map_type'
|
|
})
|
|
]
|
|
},
|
|
new Ext.Spacer({
|
|
height: 5,
|
|
style: 'background: white'
|
|
}),
|
|
{
|
|
layout: 'form',
|
|
frame: true,
|
|
items: [
|
|
{
|
|
xtype:'label',
|
|
autoWidth: true,
|
|
fieldLabel: 'Advanced Options'
|
|
},
|
|
new Ext.form.Checkbox({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: 'reg',
|
|
boxLabel: 'Show Traffic (If Possible)',
|
|
listeners: {
|
|
'check': function( me, checked ){
|
|
if ( checked ){
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(12,1);
|
|
mapTrafficOverlay=new GTrafficOverlay();
|
|
map.addOverlay( mapTrafficOverlay );
|
|
};
|
|
} else {
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(12,0);
|
|
map.removeOverlay( mapTrafficOverlay );
|
|
mapTrafficOverlay = null;
|
|
};
|
|
};
|
|
}
|
|
},
|
|
id: 'map_show_traffic',
|
|
name: 'map_show_traffic'
|
|
}),
|
|
new Ext.form.Checkbox({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: 'sat',
|
|
boxLabel: 'Show Pan/Zoom Control',
|
|
listeners: {
|
|
'check':function( me, checked ){
|
|
if ( checked ){
|
|
if ( InitSetupParameters ) SaveSetting(11,1);
|
|
mapPZControlPosition = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10));
|
|
mapPZControl = new GLargeMapControl3D();
|
|
map.addControl( mapPZControl, mapPZControlPosition );
|
|
} else {
|
|
if ( InitSetupParameters ) SaveSetting(11,0);
|
|
map.removeControl( mapPZControl );
|
|
mapPZControlPosition = null;
|
|
mapPZControl = null;
|
|
};
|
|
}
|
|
},
|
|
id: 'map_show_ptz',
|
|
name: 'map_show_ptz'
|
|
}),
|
|
new Ext.form.Checkbox({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: 'red',
|
|
boxLabel: 'Connect WayPoints',
|
|
listeners: {
|
|
'check':function( me, checked ){
|
|
if ( checked ){
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(13,1);
|
|
polyline_r = new GPolyline(CPoints, "#ff0000", 5);
|
|
map.addOverlay( polyline_r );
|
|
mapShowRedLine = true;
|
|
};
|
|
} else {
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(13,0);
|
|
mapShowRedLine = false;
|
|
map.removeOverlay( polyline_r );
|
|
polyline_r = null;
|
|
};
|
|
};
|
|
}
|
|
},
|
|
id: 'map_show_red',
|
|
name: 'map_show_red'
|
|
}),
|
|
new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: '0',
|
|
boxLabel: 'Do Not Follow Vehicle',
|
|
listeners: {
|
|
'check':function( me, checked ){
|
|
if ( checked ){
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(8,0);
|
|
mapVehicleCentered = false;
|
|
mapAreaCentered = false;
|
|
};
|
|
};
|
|
}
|
|
},
|
|
id: 'map_no_centered',
|
|
name: 'map_centered'
|
|
}),new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: '1',
|
|
boxLabel: 'Center to Vehicle',
|
|
listeners: {
|
|
'check':function( me, checked ){
|
|
if ( checked ){
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(8,1);
|
|
mapAreaCentered = false;
|
|
mapVehicleCentered = true;
|
|
map.panTo( CPoints[CPoints.length-1] );
|
|
};
|
|
};
|
|
}
|
|
},
|
|
id: 'map_vehicle_centered',
|
|
name: 'map_centered'
|
|
}),
|
|
new Ext.form.Radio({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: '2',
|
|
boxLabel: 'Center to WayPoints Area',
|
|
listeners: {
|
|
'check':function( me, checked ){
|
|
if ( checked ){
|
|
if ( InitSetupParameters ){
|
|
if ( polygon_r == null ){
|
|
polygon_r = new GPolygon(CPoints, "#808080", 5);
|
|
};
|
|
SaveSetting(8,2);
|
|
map.panTo( polygon_r.getBounds().getCenter() );
|
|
mapAreaCentered = true;
|
|
mapVehicleCentered = false;
|
|
};
|
|
};
|
|
}
|
|
},
|
|
id: 'map_area_centered',
|
|
name: 'map_centered'
|
|
}),
|
|
new Ext.form.Checkbox({
|
|
width: 180,
|
|
hideLabel: true,
|
|
value: '',
|
|
boxLabel: 'Zoom to WayPoints Area',
|
|
listeners: {
|
|
'check':function( me, checked ){
|
|
if ( checked ){
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(7,1);
|
|
if ( polygon_r == null ){
|
|
polygon_r = new GPolygon(CPoints, "#808080", 5);
|
|
}
|
|
map.setCenter( map.getCenter(), map.getBoundsZoomLevel( polygon_r.getBounds()) );
|
|
mapShowZoomed = true;
|
|
};
|
|
} else {
|
|
if ( InitSetupParameters ){
|
|
SaveSetting(7,0);
|
|
mapShowZoomed = false;
|
|
};
|
|
};
|
|
}
|
|
},
|
|
id: 'map_show_zoomed',
|
|
name: 'map_show_zoomed'
|
|
})
|
|
]
|
|
}
|
|
]
|
|
})
|
|
]
|
|
}),
|
|
new Ext.Panel({
|
|
title: 'Info',
|
|
frame: true,
|
|
height: 150,
|
|
html: '<table width=100%><tr><td class="small" id="INFO_TD"></td></tr></table>'
|
|
})
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var GMapPanel = new Ext.Panel({
|
|
title: 'Map',
|
|
width: '100%',
|
|
//renderTo: gct_m,
|
|
height: PanelH,
|
|
frame: true,
|
|
//margins: '0 0 0 0',
|
|
region: 'center', // center region is required, no width/height specified
|
|
//xtype: 'container',
|
|
layoutConfig: {
|
|
// layout-specific configs go here
|
|
//titleCollapse: true,
|
|
//animate: true
|
|
//renderHidden: true,
|
|
//activeOnTop: true
|
|
},
|
|
layout: 'fit',
|
|
margins: '5 5 0 0',
|
|
html: '<div style="width: 100%; height: '+(PanelH-70)+'px; background: white;" id="tracking_map"></div>'
|
|
//handlers
|
|
});
|
|
|
|
var GMapWindow = new Ext.Panel({
|
|
width: '100%',
|
|
//renderTo: gct_p,
|
|
frame: true,
|
|
height: PanelH,
|
|
title: 'Online Tracking',
|
|
layout: 'border',
|
|
items: [ GMapPanel, GMapToolbox ]
|
|
});
|
|
|
|
function ShowAddNewUser(){
|
|
// create the window on the first click and reuse on subsequent clicks
|
|
if( !AddNewUserWindow ){
|
|
AddNewUserWindow = new Ext.Window({
|
|
title : 'Add New User Dialog',
|
|
layout : 'fit',
|
|
width : 500,
|
|
height : 300,
|
|
closeAction :'hide',
|
|
plain : false,
|
|
resizable : false,
|
|
items : [ new Ext.FormPanel({
|
|
id: 'add_user_form',
|
|
labelWidth: 150, // label settings here cascade unless overridden
|
|
//url:'lib/connector/add_user.php',
|
|
frame: true,
|
|
//bodyBorder: false,
|
|
//border: false,
|
|
//title: 'Simple Form',
|
|
bodyStyle:'padding:5px 5px 0',
|
|
width: '100%',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: 'User ID(Login)',
|
|
name: 'nnl',
|
|
width: 180,
|
|
allowBlank: false
|
|
},{
|
|
fieldLabel: 'Password',
|
|
width: 180,
|
|
inputType: 'password',
|
|
name: 'npasswd'
|
|
},{
|
|
fieldLabel: 'Retype Password',
|
|
width: 180,
|
|
inputType: 'password',
|
|
name: 'repasswd'
|
|
}, new Ext.form.ComboBox({
|
|
id: 'add_user_access_select',
|
|
typeAhead: true,
|
|
width: 180,
|
|
triggerAction: 'all',
|
|
fieldLabel: 'User Access Level',
|
|
forceSelection: true,
|
|
hiddenName: 'type',
|
|
lazyRender: true,
|
|
mode: 'local',
|
|
listeners: {
|
|
select: SetUserAddDescription
|
|
},
|
|
store: new Ext.data.ArrayStore({
|
|
id: 0,
|
|
fields: [
|
|
'val',
|
|
'displayText'
|
|
],
|
|
data: [[1, 'Tracking Reviewer'], [2, 'Report Reviewer'],[3, 'Report Manager'],[4, 'Administrator']]
|
|
}),
|
|
valueField: 'val',
|
|
displayField: 'displayText'
|
|
}), new Ext.Panel({
|
|
id: 'add_user_access_description',
|
|
frame: true,
|
|
bodyBorder: true,
|
|
border: true,
|
|
collapsible: true,
|
|
width: '100%',
|
|
height: 100
|
|
})]
|
|
})],
|
|
|
|
buttons: [{
|
|
text : 'Add New User',
|
|
disabled : false,
|
|
handler : function(){
|
|
Ext.getCmp('add_user_form').getForm().submit({
|
|
url: 'lib/connector/json/add_user.php?UID='+UserID+'&SID='+SessionID,
|
|
waitMsg:'Creating New User...',
|
|
success : function(){
|
|
AddNewUserWindow.hide();
|
|
}
|
|
});
|
|
}
|
|
},{
|
|
text : 'Cancel',
|
|
handler : function(){
|
|
AddNewUserWindow.hide();
|
|
}
|
|
}]
|
|
});
|
|
}
|
|
AddNewUserWindow.show(UserListDiv);
|
|
};
|
|
|
|
|
|
function ShowEditUser(){
|
|
// create the window on the first click and reuse on subsequent clicks
|
|
if( !EditUserWindow ){
|
|
EditUserWindow = new Ext.Window({
|
|
title : 'Edit User Dialog',
|
|
layout : 'fit',
|
|
width : 500,
|
|
height : 300,
|
|
closeAction :'hide',
|
|
plain : false,
|
|
resizable : false,
|
|
items : new Ext.FormPanel({
|
|
labelWidth: 150, // label settings here cascade unless overridden
|
|
id: 'edit_user_form',
|
|
url:'save-form.php',
|
|
frame: true,
|
|
bodyStyle:'padding:5px 5px 0',
|
|
width: '100%',
|
|
defaultType: 'textfield',
|
|
items: [{
|
|
fieldLabel: 'User ID(Login)',
|
|
name: 'login',
|
|
width: 180,
|
|
//disabled: true,
|
|
readOnly: true,
|
|
allowBlank: false
|
|
},{
|
|
fieldLabel: 'New Password',
|
|
inputType: 'password',
|
|
width: 180,
|
|
name: 'npasswd'
|
|
},{
|
|
fieldLabel: 'Retype New Password',
|
|
inputType: 'password',
|
|
width: 180,
|
|
name: 'repasswd'
|
|
}, new Ext.form.ComboBox({
|
|
typeAhead: true,
|
|
id: 'edit_user_access_select',
|
|
triggerAction: 'all',
|
|
width: 180,
|
|
fieldLabel: 'User Access Level',
|
|
forceSelection: true,
|
|
//lazyRender:true,
|
|
hiddenName: 'type',
|
|
mode: 'local',
|
|
listeners: {
|
|
select: SetUserEditorDescription
|
|
},
|
|
store: new Ext.data.ArrayStore({
|
|
id: 0,
|
|
fields: [
|
|
'val',
|
|
'displayText'
|
|
],
|
|
data: [[1, 'Tracking Reviewer'], [2, 'Report Reviewer'],[3, 'Report Manager'],[4, 'Administrator']]
|
|
}),
|
|
valueField: 'val',
|
|
displayField: 'displayText'
|
|
}), new Ext.Panel({
|
|
id: 'edit_user_access_description',
|
|
frame: true,
|
|
bodyBorder: true,
|
|
border: true,
|
|
collapsible: true,
|
|
width: '100%',
|
|
height: 100
|
|
})]
|
|
}),
|
|
|
|
buttons: [{
|
|
text : 'Update',
|
|
disabled : false,
|
|
handler : function(){
|
|
Ext.getCmp('edit_user_form').getForm().submit({
|
|
url: 'lib/connector/json/update_user.php?UID='+UserID+'&SID='+SessionID,
|
|
waitMsg:'Updating User Data...',
|
|
success : function(){
|
|
EditUserWindow.hide();
|
|
GetUserList();
|
|
}
|
|
});
|
|
}
|
|
},{
|
|
text : 'Cancel',
|
|
handler : function(){
|
|
EditUserWindow.hide();
|
|
}
|
|
}]
|
|
});
|
|
}
|
|
EditUserWindow.show(UserListDiv);
|
|
};
|
|
|
|
function SuspendUser( UserLogin ){
|
|
Ext.Ajax.request({
|
|
url: 'lib/connector/json/suspend_user.php?UID='+UserID+'&SID='+SessionID+'&uln='+UserLogin,
|
|
success: function( response, opts ){
|
|
GetUserList();
|
|
}
|
|
});
|
|
};
|
|
|
|
function ActivateUser( UserLogin ){
|
|
Ext.Ajax.request({
|
|
url: 'lib/connector/json/activate_user.php?UID='+UserID+'&SID='+SessionID+'&uln='+UserLogin,
|
|
success: function( response, opts ){
|
|
GetUserList();
|
|
}
|
|
});
|
|
};
|
|
|
|
|
|
GetUserList();
|
|
|
|
|
|
function StatusRenderer(val){
|
|
switch(val){
|
|
case 0: return '<span style="color: blue; font-weight: bold;">Suspended</span>';
|
|
case 1: return '<span style="color: green; font-weight: bold;">Active</span>';
|
|
};
|
|
return '';
|
|
};
|
|
|
|
function AccessLevelRenderer(val){
|
|
switch(val){
|
|
case 1: return 'Tracking Reviewer';
|
|
case 2: return 'Report Reviewer';
|
|
case 3: return 'Report Manager';
|
|
case 4: return 'Administrator';
|
|
case 5: return 'Account Holder';
|
|
};
|
|
return '';
|
|
};
|
|
|
|
var UserListColModel = new Ext.grid.ColumnModel([
|
|
{header: "User Name (Login)", sortable: true, locked: true, dataIndex: 'login'},
|
|
{header: "Status", width: 85, sortable: true, renderer: StatusRenderer, dataIndex: 'status'},
|
|
{header: "Access Level", width: 95, sortable: true, renderer: AccessLevelRenderer , dataIndex: 'type'},
|
|
{header: "Active Since", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'created'},
|
|
{header: "Last Activity", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'last_access'}
|
|
]);
|
|
|
|
var SelectedUser;
|
|
|
|
var UserListGridForm = new Ext.FormPanel({
|
|
id: 'User-List',
|
|
frame: true,
|
|
labelAlign: 'left',
|
|
title: 'List of Account Users',
|
|
bodyStyle:'padding: 5px; align: center;',
|
|
shim: false,
|
|
//animCollapse: false,
|
|
constrainHeader: true,
|
|
layout: 'fit',
|
|
items: {
|
|
xtype: 'grid',
|
|
ds: UserListDataStore,
|
|
cm: UserListColModel,
|
|
id: 'user-list-grid',
|
|
sm: new Ext.grid.RowSelectionModel({
|
|
singleSelect: true,
|
|
listeners: {
|
|
rowselect: function(sm, row, rec) {
|
|
if (!SelectedUser){
|
|
SelectedUser=rec;
|
|
} else {
|
|
SelectedUser=rec;
|
|
if ( SelectedUser.data.type<5 ){
|
|
Ext.getCmp('Suspend_AUB').enable();
|
|
Ext.getCmp('Edit_AUB').enable();
|
|
Ext.getCmp('Delete_AUB').enable();
|
|
if ( SelectedUser.data.status>0 ){
|
|
Ext.getCmp('Suspend_AUB').setText('Suspend');
|
|
Ext.getCmp('Suspend_AUB').setTooltip('Suspend Access of Selected User');
|
|
} else {
|
|
Ext.getCmp('Suspend_AUB').setText('Activate');
|
|
Ext.getCmp('Suspend_AUB').setTooltip('Activate Access of Selected User');
|
|
};
|
|
} else {
|
|
Ext.getCmp('Edit_AUB').disable();
|
|
Ext.getCmp('Suspend_AUB').disable();
|
|
Ext.getCmp('Delete_AUB').disable();
|
|
};
|
|
};
|
|
}
|
|
}
|
|
}),
|
|
//autoExpandColumn: 'login',
|
|
height: 350,
|
|
width: '100%',
|
|
forceFit: true,
|
|
border: false,
|
|
listeners: {
|
|
render: function(g) {
|
|
g.getSelectionModel().selectRow(0);
|
|
},
|
|
delay: 20 // Allow rows to be rendered.
|
|
},
|
|
viewConfig: {
|
|
forceFit:true
|
|
},
|
|
bbar: [{
|
|
tooltip: 'Create New User and Set Privilegies',
|
|
text: 'Add New',
|
|
iconCls:'user-add',
|
|
handler : function(){
|
|
ShowAddNewUser();
|
|
}
|
|
},{
|
|
tooltip:'Edit Access Level of Selected User',
|
|
id: 'Edit_AUB',
|
|
text: 'Edit',
|
|
iconCls:'user-edit',
|
|
handler: function(){
|
|
ShowEditUser();
|
|
Ext.getCmp("edit_user_form").getForm().loadRecord(SelectedUser);
|
|
SetUserEditorDescription();
|
|
},
|
|
disabled: true
|
|
},{
|
|
tooltip:'Suspend Access of Selected User',
|
|
id: 'Suspend_AUB',
|
|
text: 'Suspend',
|
|
iconCls:'user-block',
|
|
handler: function(){
|
|
if ( SelectedUser.data.status>0 ){
|
|
SuspendUser( SelectedUser.data.login );
|
|
} else {
|
|
ActivateUser( SelectedUser.data.login );
|
|
};
|
|
},
|
|
disabled: true
|
|
},{
|
|
tooltip: 'Remove Selected User from Account',
|
|
id: 'Delete_AUB',
|
|
text:'Delete',
|
|
iconCls:'user-delete',
|
|
disabled: true,
|
|
handler: function(){
|
|
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', function (){
|
|
|
|
});
|
|
}
|
|
}]
|
|
},
|
|
renderTo: UserListDiv
|
|
});
|
|
|
|
|
|
GetDeviceList();
|
|
|
|
function DevStatusRenderer(val){
|
|
switch(val){
|
|
case 0: return '<span style="color: red; font-weight: bold;">Off Line</span>';
|
|
case 1: return '<span style="color: green; font-weight: bold;">On Line</span>';
|
|
};
|
|
return '';
|
|
};
|
|
|
|
function IconRenderer( val ) {
|
|
if ( val > 0) {
|
|
return '<img src="/resources/vehicles/icons/' + val + '.png" >';
|
|
}
|
|
return val;
|
|
};
|
|
function SMSRenderer( val ) {
|
|
if ( val!='Disabled' ) {
|
|
return '<img src="/resources/site/smsgr.gif" alt="SMS Reports to '+val+' Enabled" title="SMS Reports to '+val+' Enabled">';
|
|
} else {
|
|
return '<img src="/resources/site/smsg.gif" alt="SMS Reports '+val+'" title="SMS Reports '+val+'">';
|
|
};
|
|
return '';
|
|
};
|
|
|
|
// the DefaultColumnModel expects this blob to define columns. It can be extended to provide
|
|
// custom or reusable ColumnModels
|
|
|
|
var DeviceListColModel = new Ext.grid.ColumnModel([
|
|
{header: "", width: 38, sortable: false, locked: true, menuDisabled: true, fixed: true, align: 'left', renderer: IconRenderer, dataIndex: 'icon'},
|
|
{header: "Device ID", width: 120, sortable: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'device_id'},
|
|
{header: "Vehicle ID", width: 120, sortable: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'name'},
|
|
{header: "Status", width: 95, sortable: true, align: 'center', css: 'vertical-align: middle;', renderer: DevStatusRenderer, dataIndex: 'status'},
|
|
{header: "SMS", width: 36, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: SMSRenderer, dataIndex: 'sms'},
|
|
{header: "Active Since", width: 85, sortable: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'created'},
|
|
{header: "Last Activity", width: 85, sortable: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'last_access'}
|
|
]);
|
|
|
|
var SelectedDevice;
|
|
|
|
var DeviceListGridForm = new Ext.FormPanel({
|
|
id: 'Device-List',
|
|
frame: true,
|
|
labelAlign: 'left',
|
|
title: 'List of Devices',
|
|
bodyStyle:'padding: 5px; align: center;',
|
|
shim: false,
|
|
//animCollapse: false,
|
|
constrainHeader: true,
|
|
|
|
//layout: 'column', // Specifies that the items will now be arranged in columns
|
|
|
|
layout: 'fit',
|
|
items: {
|
|
xtype: 'grid',
|
|
frame: false,
|
|
forceFit: true,
|
|
ds: DeviceListDataStore,
|
|
cm: DeviceListColModel,
|
|
sm: new Ext.grid.RowSelectionModel({
|
|
singleSelect: true,
|
|
listeners: {
|
|
rowselect: function(sm, row, rec) {
|
|
if (!SelectedUser){
|
|
SelectedDevice=rec;
|
|
} else {
|
|
SelectedDevice=rec;
|
|
if ( SelectedDevice.data.type<5 ){
|
|
Ext.getCmp('Suspend_AUB').enable();
|
|
Ext.getCmp('Edit_AUB').enable();
|
|
Ext.getCmp('Delete_AUB').enable();
|
|
if ( SelectedDevice.data.status>0 ){
|
|
Ext.getCmp('Suspend_AUB').setText('Suspend');
|
|
Ext.getCmp('Suspend_AUB').setTooltip('Suspend Access of Selected User');
|
|
} else {
|
|
Ext.getCmp('Suspend_AUB').setText('Activate');
|
|
Ext.getCmp('Suspend_AUB').setTooltip('Activate Access of Selected User');
|
|
};
|
|
} else {
|
|
Ext.getCmp('Edit_AUB').disable();
|
|
Ext.getCmp('Suspend_AUB').disable();
|
|
Ext.getCmp('Delete_AUB').disable();
|
|
};
|
|
};
|
|
}
|
|
}
|
|
}),
|
|
//autoExpandColumn: 'login',
|
|
height: 350,
|
|
width: '100%',
|
|
border: false,
|
|
listeners: {
|
|
render: function(g) {
|
|
g.getSelectionModel().selectRow(0);
|
|
},
|
|
delay: 10 // Allow rows to be rendered.
|
|
},
|
|
viewConfig: {
|
|
forceFit:true
|
|
},
|
|
bbar: [{
|
|
tooltip:'Edit Vehicle ID and Image',
|
|
id: 'Edit_DEV',
|
|
text: 'Edit',
|
|
iconCls:'user-edit',
|
|
handler: function(){
|
|
//ShowEditUser();
|
|
Ext.getCmp("edit_user_form").getForm().loadRecord(SelectedUser);
|
|
SetUserEditorDescription();
|
|
},
|
|
disabled: false
|
|
},{
|
|
tooltip:'Setup Custom Events',
|
|
id: 'Events_DEV',
|
|
text: 'Events',
|
|
iconCls:'user-block',
|
|
handler: function(){
|
|
if ( SelectedDevice.data.status>0 ){
|
|
//SuspendUser( SelectedUser.data.login );
|
|
} else {
|
|
//ActivateUser( SelectedUser.data.login );
|
|
};
|
|
},
|
|
disabled: false
|
|
}]
|
|
},
|
|
renderTo: DeviceListDiv
|
|
});
|
|
|
|
GetNewDeviceList();
|
|
|
|
function NewIconRenderer( val ) {
|
|
if ( val > 0) {
|
|
return '<img src="/resources/site/ndev.gif" alt="'+val+'" title="'+val+'">';
|
|
}
|
|
return val;
|
|
};
|
|
|
|
// the DefaultColumnModel expects this blob to define columns. It can be extended to provide
|
|
// custom or reusable ColumnModels
|
|
|
|
var NDeviceListColModel = new Ext.grid.ColumnModel([
|
|
{header: "", width: 38, sortable: false, locked: true, menuDisabled: true, fixed: true, align: 'left', renderer: NewIconRenderer,dataIndex: 'id'},
|
|
{header: "Device ID", width: 120, sortable: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'device_id'}
|
|
]);
|
|
|
|
|
|
var SelectedNDevice;
|
|
|
|
var NewDeviceListGridForm = new Ext.FormPanel({
|
|
id: 'New-Device-List',
|
|
frame: true,
|
|
labelAlign: 'left',
|
|
title: 'Newly Purchased Devices',
|
|
bodyStyle:'padding: 5px; align: center;',
|
|
shim: false,
|
|
//animCollapse: false,
|
|
constrainHeader: true,
|
|
|
|
//layout: 'column', // Specifies that the items will now be arranged in columns
|
|
|
|
layout: 'fit',
|
|
items: {
|
|
xtype: 'grid',
|
|
frame: false,
|
|
forceFit: true,
|
|
ds: NDeviceListDataStore,
|
|
cm: NDeviceListColModel,
|
|
sm: new Ext.grid.RowSelectionModel({
|
|
singleSelect: true,
|
|
listeners: {
|
|
rowselect: function(sm, row, rec) {
|
|
if (!SelectedUser){
|
|
SelectedNDevice=rec;
|
|
} else {
|
|
SelectedNDevice=rec;
|
|
if ( SelectedNDevice.data.type<5 ){
|
|
Ext.getCmp('Suspend_AUB').enable();
|
|
Ext.getCmp('Edit_AUB').enable();
|
|
Ext.getCmp('Delete_AUB').enable();
|
|
if ( SelectedDevice.data.status>0 ){
|
|
Ext.getCmp('Suspend_AUB').setText('Suspend');
|
|
Ext.getCmp('Suspend_AUB').setTooltip('Suspend Access of Selected User');
|
|
} else {
|
|
Ext.getCmp('Suspend_AUB').setText('Activate');
|
|
Ext.getCmp('Suspend_AUB').setTooltip('Activate Access of Selected User');
|
|
};
|
|
} else {
|
|
Ext.getCmp('Edit_AUB').disable();
|
|
Ext.getCmp('Suspend_AUB').disable();
|
|
Ext.getCmp('Delete_AUB').disable();
|
|
};
|
|
};
|
|
}
|
|
}
|
|
}),
|
|
//autoExpandColumn: 'login',
|
|
height: 350,
|
|
width: '100%',
|
|
border: false,
|
|
listeners: {
|
|
render: function(g) {
|
|
g.getSelectionModel().selectRow(0);
|
|
},
|
|
delay: 10 // Allow rows to be rendered.
|
|
},
|
|
viewConfig: {
|
|
forceFit:true
|
|
},
|
|
bbar: [{
|
|
tooltip:'Add Purchased Elsewhere Device',
|
|
id: 'ANew_DEV',
|
|
text: 'Add',
|
|
iconCls:'user-block',
|
|
handler: function(){
|
|
if ( SelectedDevice.data.status>0 ){
|
|
//SuspendUser( SelectedUser.data.login );
|
|
} else {
|
|
//ActivateUser( SelectedUser.data.login );
|
|
};
|
|
},
|
|
disabled: false
|
|
},{
|
|
tooltip:'Activate Selected Device',
|
|
id: 'Act_DEV',
|
|
text: 'Activate',
|
|
iconCls:'user-edit',
|
|
handler: function(){
|
|
//ShowEditUser();
|
|
Ext.getCmp("edit_user_form").getForm().loadRecord(SelectedUser);
|
|
SetUserEditorDescription();
|
|
},
|
|
disabled: true
|
|
},{
|
|
tooltip:'Purchase Additional',
|
|
id: 'Purc_DEV',
|
|
text: 'Purchase',
|
|
iconCls:'user-block',
|
|
handler: function(){
|
|
window.location='/Products.php';
|
|
},
|
|
disabled: false
|
|
}]
|
|
},
|
|
renderTo: NDeviceListDiv
|
|
});
|
|
|
|
|
|
|
|
var AccountInfo = new Ext.FormPanel({
|
|
//renderTo: document.body,
|
|
frame: true,
|
|
labelAlign: 'left',
|
|
title: 'Account Settings',
|
|
bodyStyle:'padding: 5px; align: center;',
|
|
//shim: false,
|
|
//animCollapse: false,
|
|
//constrainHeader: true,
|
|
//url: '/',
|
|
width: 500,
|
|
//height: 300,
|
|
layout: 'fit',
|
|
items: [
|
|
{
|
|
xtype: 'tabpanel',
|
|
activeTab: 0,
|
|
height: 324, // Why do I have to specify the height here?
|
|
// Shouldn't its container's 'fit' layout take
|
|
// care of that?
|
|
width: PanelH,
|
|
border: false,
|
|
deferredRender: true, // This works
|
|
//defaults: {autoScroll: true},
|
|
items: [
|
|
{
|
|
title: 'Account Info',
|
|
frame: true,
|
|
bodyStyle: 'padding 10px;',
|
|
html: "This is just some text..."
|
|
},
|
|
{
|
|
layout: 'form',
|
|
title: 'Address Info',
|
|
frame: true,
|
|
labelAlign: 'right',
|
|
defaults: {width: 175},
|
|
items: [
|
|
{
|
|
xtype: 'textfield',
|
|
name: 'address_1',
|
|
value: '',
|
|
fieldLabel: 'Street Adress'
|
|
},{
|
|
xtype: 'textfield',
|
|
name: 'address_2',
|
|
value: '',
|
|
fieldLabel: 'City'
|
|
},
|
|
{
|
|
xtype: 'combo',
|
|
hiddenName: 'state',
|
|
fieldLabel: 'State',
|
|
store: new Ext.data.SimpleStore({
|
|
fields: ['abbr', 'state', 'tooltip'],
|
|
data : Ext.exampledata.states // from states.js
|
|
}),
|
|
editable: false,
|
|
allowBlank: true,
|
|
valueField:'abbr',
|
|
displayField:'state',
|
|
typeAhead: true,
|
|
mode: 'local',
|
|
triggerAction: 'all',
|
|
selectOnFocus:true
|
|
},
|
|
{
|
|
xtype: 'combo',
|
|
hiddenName: 'country',
|
|
fieldLabel: 'Country',
|
|
store: new Ext.data.SimpleStore({
|
|
fields: ['abbr', 'country', 'tooltip'],
|
|
data : Ext.exampledata.countries // from states.js
|
|
}),
|
|
editable: false,
|
|
allowBlank: true,
|
|
valueField:'abbr',
|
|
displayField:'country',
|
|
typeAhead: true,
|
|
mode: 'local',
|
|
triggerAction: 'all',
|
|
selectOnFocus:true
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
bbar: [{
|
|
tooltip: 'Save All Account Settings',
|
|
text: 'Save Changes',
|
|
iconCls:'account-save',
|
|
handler : function(){
|
|
//ShowAddNewUser();
|
|
}
|
|
}]
|
|
});
|
|
|
|
GetRepDevicesButtons();
|
|
RepportPlaceholderPanel.render('rep_placeholder');
|
|
RepportDeviceButtonList.render('rep_dev_list');
|
|
AccountInfo.render('account_info');
|
|
GMapWindow.doLayout();
|
|
//GMapWindow.render('gmap_control_placeholder');
|
|
//GMapToolbox.doLayout();
|
|
//alert('koko2');
|
|
//GMapPanel.doLayout();
|
|
//alert('koko3');
|
|
//GMapWindow.doLayout();
|
|
//alert('koko4');
|
|
//GMapToolbox.collapse();
|
|
//alert('koko5');
|
|
//GMapToolbox.doLayout();
|
|
//alert('koko6');
|
|
try {
|
|
GMapWindow.render('gmap_control_placeholder');
|
|
} catch (e){
|
|
|
|
};
|
|
Ext.MessageBox.wait('Loading items...','Please wait',{
|
|
progressText: 'Initializing...',
|
|
width:300,
|
|
progress:true,
|
|
closable:false
|
|
});
|
|
window.setTimeout(function(){
|
|
GMapToolbox.expand();
|
|
//GMapWindow.doLayout();
|
|
}, 1000 );
|
|
window.setTimeout(function(){
|
|
Tracking_Init();
|
|
}, 2000 );
|
|
});
|