worked on ExTJs variables and report table part

This commit is contained in:
safan
2011-01-03 10:29:07 +00:00
parent e7e086c4dd
commit 2840f1235c
3 changed files with 449 additions and 484 deletions

View File

@@ -25,38 +25,42 @@
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
G::LoadClass('reportTables');
if(isset($_POST['form']))
$value= $_POST['form'];
else
$value=$_POST;
$oReportTable = new ReportTable();
if (!isset($_POST['form']['REP_TAB_CONNECTION'])) {
$_POST['form']['REP_TAB_CONNECTION'] = 'report';
if (!isset($value['REP_TAB_CONNECTION'])) {
$value['REP_TAB_CONNECTION'] = 'report';
}
if ($_POST['form']['REP_TAB_UID'] != '') {
$aReportTable = $oReportTable->load($_POST['form']['REP_TAB_UID']);
if ($value['REP_TAB_UID'] != '') {
$aReportTable = $oReportTable->load($value['REP_TAB_UID']);
$sOldTableName = $aReportTable['REP_TAB_NAME'];
$sOldConnection = $aReportTable['REP_TAB_CONNECTION'];
}
else {
$sOldTableName = $_POST['form']['REP_TAB_NAME'];
$sOldConnection = $_POST['form']['REP_TAB_CONNECTION'];
$oReportTable->create($_POST['form']);
$_POST['form']['REP_TAB_UID'] = $oReportTable->getRepTabUid();
$sOldTableName = $value['REP_TAB_NAME'];
$sOldConnection = $value['REP_TAB_CONNECTION'];
$oReportTable->create($value);
$value['REP_TAB_UID'] = $oReportTable->getRepTabUid();
}
$oReportTable->update($_POST['form']);
$oReportTable->update($value);
$oReportVar = new ReportVar();
$oReportTables = new ReportTables();
$oReportTables->deleteAllReportVars($_POST['form']['REP_TAB_UID']);
$oReportTables->deleteAllReportVars($value['REP_TAB_UID']);
$aFields = array();
if ($_POST['form']['REP_TAB_TYPE'] == 'GRID') {
$aAux = explode('-', $_POST['form']['REP_TAB_GRID']);
if ($value['REP_TAB_TYPE'] == 'GRID') {
$aAux = explode('-', $value['REP_TAB_GRID']);
global $G_FORM;
$G_FORM = new Form($_POST['form']['PRO_UID'] . '/' . $aAux[1], PATH_DYNAFORM, SYS_LANG, false);
$G_FORM = new Form($value['PRO_UID'] . '/' . $aAux[1], PATH_DYNAFORM, SYS_LANG, false);
$aAux = $G_FORM->getVars(false);
foreach ($aAux as $aField) {
$_POST['form']['FIELDS'][] = $aField['sName'] . '-' . $aField['sType'];
$value['FIELDS'][] = $aField['sName'] . '-' . $aField['sType'];
}
}
foreach ($_POST['form']['FIELDS'] as $sField) {
foreach ($value['FIELDS'] as $sField) {
$aField = explode('-', $sField);
switch ($aField[1]) {
case 'currency':
@@ -82,13 +86,13 @@ foreach ($_POST['form']['FIELDS'] as $sField) {
$sType = 'char';
break;
}
$oReportVar->create(array('REP_TAB_UID' => $_POST['form']['REP_TAB_UID'],
'PRO_UID' => $_POST['form']['PRO_UID'],
$oReportVar->create(array('REP_TAB_UID' => $value['REP_TAB_UID'],
'PRO_UID' => $value['PRO_UID'],
'REP_VAR_NAME' => $aField[0],
'REP_VAR_TYPE' => $sType));
$aFields[] = array('sFieldName' => $aField[0], 'sType' => $sType);
}
$oReportTables->dropTable($sOldTableName, $sOldConnection);
$oReportTables->createTable($_POST['form']['REP_TAB_NAME'], $_POST['form']['REP_TAB_CONNECTION'], $_POST['form']['REP_TAB_TYPE'], $aFields);
$oReportTables->populateTable($_POST['form']['REP_TAB_NAME'], $_POST['form']['REP_TAB_CONNECTION'], $_POST['form']['REP_TAB_TYPE'], $aFields, $_POST['form']['PRO_UID'], $_POST['form']['REP_TAB_GRID']);
$oReportTables->createTable($value['REP_TAB_NAME'], $value['REP_TAB_CONNECTION'], $value['REP_TAB_TYPE'], $aFields);
$oReportTables->populateTable($value['REP_TAB_NAME'], $value['REP_TAB_CONNECTION'], $value['REP_TAB_TYPE'], $aFields, $value['PRO_UID'], $value['REP_TAB_GRID']);
?>

View File

@@ -1582,36 +1582,34 @@ ProcessMapContext.prototype.caseTrackerProperties= function()
defaults: {width: 350},
defaultType: 'textfield',
items: [{
width: 100,
xtype: 'combo',
mode: 'local',
triggerAction: 'all',
forceSelection: true,
editable: false,
fieldLabel: 'Map Type',
name: 'CT_MAP_TYPE',
displayField: 'name',
value: 'Process Map',
valueField: 'value',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data :[{name: 'None', value:'0'},
{name: 'Process Map', value: '1'},
{name: 'Stages Map', value:'2'}]
})
},{
width :100,
xtype :'combo',
mode :'local',
triggerAction :'all',
forceSelection :true,
editable :false,
fieldLabel :'Map Type',
name :'CT_MAP_TYPE',
displayField :'name',
value :'Process Map',
valueField :'value',
store :new Ext.data.JsonStore({
fields : ['name', 'value'],
data :[{name: 'None', value:'0'},
{name: 'Process Map', value: '1'},
{name: 'Stages Map', value:'2'}]
})
},{
xtype: 'checkbox',
fieldLabel: 'Derivation History',
name: 'CT_DERIVATION_HISTORY'
//checked:checkDerivation
},{
},{
xtype: 'checkbox',
fieldLabel: 'Messages History',
name: 'CT_MESSAGE_HISTORY'
// checked:checkMessages
}
]
}]
});
var Propertieswindow = new Ext.Window({
@@ -1629,7 +1627,7 @@ ProcessMapContext.prototype.caseTrackerProperties= function()
items: PropertiesForm,
buttons: [{
text: 'Save',
handler: function(){
handler: function(){
var getForm = PropertiesForm.getForm().getValues();
var pro_uid = getForm.PRO_UID;
var MapType = getForm.CT_MAP_TYPE;
@@ -1637,26 +1635,25 @@ ProcessMapContext.prototype.caseTrackerProperties= function()
var MessageHistory = getForm.CT_MESSAGE_HISTORY;
Ext.Ajax.request({
url : '../tracker/tracker_save.php',
method: 'POST',
params:{
PRO_UID :pro_uid,
CT_MAP_TYPE :MapType,
CT_DERIVATION_HISTORY :DerivationHistory,
CT_MESSAGE_HISTORY :MessageHistory
},
success: function(response) {
Ext.MessageBox.alert ('Status','Connection Saved Successfully.');
}
url : '../tracker/tracker_save.php',
method: 'POST',
params:{
PRO_UID :pro_uid,
CT_MAP_TYPE :MapType,
CT_DERIVATION_HISTORY :DerivationHistory,
CT_MESSAGE_HISTORY :MessageHistory
},
success: function(response) {
Ext.MessageBox.alert ('Status','Connection Saved Successfully.');
}
});
}
},{
text: 'Cancel',
handler: function(){
Propertieswindow.close();
}
}
]
}
},{
text: 'Cancel',
handler: function(){
Propertieswindow.close();
}
}]
});
Propertieswindow.show();
}
@@ -1701,19 +1698,17 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
});
var assignedStore = new Ext.data.JsonStore({
root : 'data',
totalProperty: 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : ObjectFields,
proxy: new Ext.data.HttpProxy({
url: 'proxyCaseTrackerObjects?pid='+pro_uid
})
root : 'data',
totalProperty : 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : ObjectFields,
proxy : new Ext.data.HttpProxy({
url : 'proxyCaseTrackerObjects?pid='+pro_uid
})
});
//taskUsers.setDefaultSort('LABEL', 'asc');
assignedStore.load();
// create the Data Store of users that are not assigned to a task
var availableStore = new Ext.data.JsonStore({
root : 'data',
url : 'proxyCaseTrackerObjects?tid='+pro_uid,
@@ -1731,22 +1726,21 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
handler: function(){
var User = Objectsgrid.getStore();
var e = new ObjectFields({
OBJECT_TITLE:'',
OBJECT_TYPE:'',
OBJECT_UID: ''
OBJECT_TITLE :'',
OBJECT_TYPE :'',
OBJECT_UID : ''
});
//storeUsers.reload();
if(availableStore.data.items.length == 0)
Ext.MessageBox.alert ('Status','No users are available. All users have been already assigned.');
else
{
editor.stopEditing();
assignedStore.insert(0, e);
Objectsgrid.getView().refresh();
//grid.getSelectionModel().selectRow(0);
editor.startEditing(0, 0);
}
if(availableStore.data.items.length == 0)
Ext.MessageBox.alert ('Status','No users are available. All users have been already assigned.');
else
{
editor.stopEditing();
assignedStore.insert(0, e);
Objectsgrid.getView().refresh();
//grid.getSelectionModel().selectRow(0);
editor.startEditing(0, 0);
}
}
@@ -1791,7 +1785,7 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
});
}
else
assignedStore.remove(r);
assignedStore.remove(r);
}
}
});
@@ -1826,15 +1820,15 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
editor: new Ext.form.ComboBox({
xtype: 'combo',
store:availableStore,
fieldLabel: 'Title',
hiddenName: 'number',
fieldLabel : 'Title',
hiddenName : 'number',
displayField : 'OBJECT_TITLE' ,
valueField : 'OBJECT_TITLE',
name : 'OBJECT_TITLE',
triggerAction: 'all',
emptyText: 'Select User or Group',
allowBlank: false,
onSelect: function(record, index){
emptyText : 'Select User or Group',
allowBlank : false,
onSelect : function(record, index){
var User = Objectsgrid.getStore();
var selectedrowIndex = '0';
User.data.items[selectedrowIndex].data.OBJECT_UID = record.data.OBJECT_UID;
@@ -1844,36 +1838,29 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
this.collapse();
}
})
},
{
header: 'Type',
dataIndex: 'CTO_TYPE_OBJ',
//width: 200,
editable: false
},
{
header: 'Condition',
dataIndex: 'CTO_CONDITION',
name: 'CTO_CONDITION',
//width: 200,
},{
header : 'Type',
dataIndex : 'CTO_TYPE_OBJ',
editable : false
},{
header : 'Condition',
dataIndex : 'CTO_CONDITION',
name : 'CTO_CONDITION',
editable: true,
editor: new Ext.form.TextField({
allowBlank: true
allowBlank: true
})
},
{
},{
header: 'Assign Condition',
//width: 50,
renderer: function(val){return '<input type="button" value="@@" id="'+val+'"/>';}
}
],
}],
sm: new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(smObj, rowIndex, record) {
workflow.currentrowIndex = rowIndex;
}
}
}
}),
stripeRows: true,
viewConfig: {forceFit: true},
@@ -1924,20 +1911,7 @@ ProcessMapContext.prototype.caseTrackerObjects= function()
}
});
//Updating the user incase if already assigned user has been replaced by other user
/*if(changes != '' && typeof record.json != 'undefined')
{
var user_TURel = record.json.TU_RELATION;
var userUID = record.json.USR_UID;
var user_TUtype = record.json.TU_TYPE;
urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}';
Ext.Ajax.request({
url : 'processes_Ajax.php' +urlparams ,
success: function(response) {
//Ext.MessageBox.alert ('Status','User has been updated successfully.');
}
});
}*/
assignedStore.reload();
availableStore.reload();
@@ -2016,48 +1990,49 @@ ProcessMapContext.prototype.ExtVariables = function()
bodyStyle :'padding:5px 5px 0',
width : 400,
height : 350,
renderer: function(val){return '<table border=1> <tr> <td> @@ </td> <td> Replace the value in quotes </td> </tr> </table>';},
items:
{
xtype:'tabpanel',
activeTab: 0,
defaults:{
autoHeight:true,
bodyStyle:'padding:10px'
},
items:[{
title:'All Variables',
id :'allVar',
layout:'form',
listeners: {
activate: function(tabPanel){
// use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@';
varStore.proxy.setUrl(link, true);
varStore.load();
}
},
xtype:'tabpanel',
activeTab: 0,
defaults:{
autoHeight:true,
bodyStyle:'padding:10px'
},
items:[{
xtype: 'grid',
ds: varStore,
cm: varColumns,
width: 380,
autoHeight: true,
//plugins: [editor],
//loadMask : true,
loadingText : 'Loading...',
border: false
}]
},{
title:'All Variables',
id :'allVar',
layout:'form',
listeners: {
activate: function(tabPanel){
// use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@';
varStore.proxy.setUrl(link, true);
varStore.load();
}
},
items:[{
xtype: 'grid',
ds: varStore,
cm: varColumns,
width: 380,
autoHeight: true,
//plugins: [editor],
//loadMask : true,
loadingText : 'Loading...',
border: false
}]
},{
title:'System',
id:'system',
layout:'form',
listeners: {
activate: function(tabPanel){
// use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@';
varStore.proxy.setUrl(link, true);
varStore.load();
}
listeners:{
activate: function(tabPanel){
// use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@';
varStore.proxy.setUrl(link, true);
varStore.load();
}
},
items:[{
xtype: 'grid',
@@ -2070,18 +2045,18 @@ ProcessMapContext.prototype.ExtVariables = function()
loadingText : 'Loading...',
border: false
}]
},{
},{
title:'Process',
id :'process',
layout:'form',
listeners: {
activate: function(tabPanel){
// use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@';
varStore.proxy.setUrl(link, true);
varStore.load();
}
},
activate: function(tabPanel){
// use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@';
varStore.proxy.setUrl(link, true);
varStore.load();
}
},
items:[{
xtype: 'grid',
ds: varStore,
@@ -2093,14 +2068,16 @@ ProcessMapContext.prototype.ExtVariables = function()
loadingText : 'Loading...',
border: false
}]
}]
}
});
}]
}
});
var window = new Ext.Window({
title: 'Steps Of',
collapsible: false,
maximizable: false,
scrollable: true,
width: 400,
height: 350,
minWidth: 200,
@@ -2109,7 +2086,10 @@ ProcessMapContext.prototype.ExtVariables = function()
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: varForm
items: [varForm]
/*buttons: [{
text: 'Save',
handler: function(){

View File

@@ -673,55 +673,114 @@ ProcessOptions.prototype.dbConnection = function()
buttonAlign: 'center',
items:[{
xtype: 'combo',
width: 150,
mode: 'local',
editable: false,
fieldLabel: 'Engine',
triggerAction: 'all',
forceSelection: true,
name: 'DBS_TYPE',
displayField: 'name',
//emptyText : 'Select Format',
valueField : 'value',
value : 'Select',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name : 'Select', value: 'select'},
{name : 'MySql', value: 'MySql'},
{name : 'PostGreSql', value: 'PostGreSql'},
{name : 'Microsoft SQL server', value: 'Microsoft SQL server'}
]}),
onSelect: function(record, index) {
//Show-Hide Format Type Field
xtype: 'combo',
width: 150,
mode: 'local',
editable: false,
fieldLabel: 'Engine',
triggerAction: 'all',
forceSelection: true,
name: 'DBS_TYPE',
displayField: 'name',
//emptyText : 'Select Format',
valueField : 'value',
value : 'Select',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name : 'Select', value: 'select'},
{name : 'MySql', value: 'MySql'},
{name : 'PostGreSql', value: 'PostGreSql'},
{name : 'Microsoft SQL server', value: 'Microsoft SQL server'}
]}),
onSelect: function(record, index) {
//Show-Hide Format Type Field
if(record.data.value == 'MySql')
{Ext.getCmp("encode").show();
Ext.getCmp("postgre").hide();
Ext.getCmp("port").setValue('3306')}
Ext.getCmp("postgre").hide();
Ext.getCmp("port").setValue('3306')}
else if(record.data.value == 'PostGreSql')
{Ext.getCmp("postgre").show();
Ext.getCmp("encode").hide();
Ext.getCmp("port").setValue('5432')}
{Ext.getCmp("postgre").show();
Ext.getCmp("encode").hide();
Ext.getCmp("port").setValue('5432')}
else
{Ext.getCmp("sqlserver").show();
Ext.getCmp("postgre").hide();
Ext.getCmp("port").setValue('1433')}
this.setValue(record.data[this.valueField || this.displayField]);
this.collapse();
}
},
{
xtype: 'fieldset',
id: 'encode',
border:false,
hidden: true,
items: [{
{Ext.getCmp("sqlserver").show();
Ext.getCmp("postgre").hide();
Ext.getCmp("port").setValue('1433')}
this.setValue(record.data[this.valueField || this.displayField]);
this.collapse();
}
},{
xtype: 'fieldset',
id: 'encode',
border:false,
hidden: true,
items: [{
xtype: 'combo',
width: 150,
mode: 'local',
// hidden: true,
editable: false,
fieldLabel: 'Encode',
triggerAction: 'all',
forceSelection: true,
//dataIndex : 'ENGINE',
displayField: 'name',
valueField: 'value',
name: 'DBS_ENCODE',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name:'big5', value: 'big5'},
{name:'dec8', value:'dec8' },
{name:'cp850', value:'cp850'},
{name:'hp8', value:'hp8' },
{name:'koi8r', value:'koi8r'},
{name:'latin1', value:'latin1'},
{name:'latin2', value:'latin2'},
{name:'swe7', value:'swe7' },
{name:'ascii', value:'ascii'},
{name:'ujis', value:'ujis' },
{name:'sjis', value:'sjis' },
{name:'hebrew', value:'hebrew'},
{name:'tis620', value:'tis620' },
{name:'euckr', value:'euckr'},
{name:'koi8u', value:'koi8u' },
{name:'gb2312', value:'gb2312'},
{name:'greek', value:'greek'},
{name:'cp1250', value:'cp1250'},
{name:'gbk', value:'gbk' },
{name:'latin5', value:'latin5' },
{name:'armscii8', value:'armscii8'},
{name:'utf8', value:'utf8' },
{name:'ucs2', value:'ucs2'},
{name:'cp866', value:'cp866'},
{name:'keybcs2', value:'keybcs2' },
{name:'macce', value:'macce'},
{name:'macroman', value:'macroman' },
{name:'cp852', value:'cp852' },
{name:'latin7', value:'atin7' },
{name:'cp1251', value:'cp1251'},
{name:'cp1256', value:'cp1256'},
{name:'cp1257', value:'cp1257'},
{name:'binary', value:'binary'},
{name:'geostd8', value:'geostd8'},
{name:'cp932', value:'cp932'},
{name:'eucjpms', value:'eucjpms'}
]})
}]
},{
xtype: 'fieldset',
id: 'postgre',
border:false,
hidden: true,
items:[{
xtype: 'combo',
width: 150,
width: 150,
mode: 'local',
// hidden: true,
editable: false,
// hidden: true,
editable:false,
fieldLabel: 'Encode',
triggerAction: 'all',
forceSelection: true,
@@ -732,276 +791,198 @@ ProcessOptions.prototype.dbConnection = function()
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name:'big5', value: 'big5'},
{name:'dec8', value:'dec8' },
{name:'cp850', value:'cp850'},
{name:'hp8', value:'hp8' },
{name:'koi8r', value:'koi8r'},
{name:'latin1', value:'latin1'},
{name:'latin2', value:'latin2'},
{name:'swe7', value:'swe7' },
{name:'ascii', value:'ascii'},
{name:'ujis', value:'ujis' },
{name:'sjis', value:'sjis' },
{name:'hebrew', value:'hebrew'},
{name:'tis620', value:'tis620' },
{name:'euckr', value:'euckr'},
{name:'koi8u', value:'koi8u' },
{name:'gb2312', value:'gb2312'},
{name:'greek', value:'greek'},
{name:'cp1250', value:'cp1250'},
{name:'gbk', value:'gbk' },
{name:'latin5', value:'latin5' },
{name:'armscii8', value:'armscii8'},
{name:'utf8', value:'utf8' },
{name:'ucs2', value:'ucs2'},
{name:'cp866', value:'cp866'},
{name:'keybcs2', value:'keybcs2' },
{name:'macce', value:'macce'},
{name:'macroman', value:'macroman' },
{name:'cp852', value:'cp852' },
{name:'latin7', value:'atin7' },
{name:'cp1251', value:'cp1251'},
{name:'cp1256', value:'cp1256'},
{name:'cp1257', value:'cp1257'},
{name:'binary', value:'binary'},
{name:'geostd8', value:'geostd8'},
{name:'cp932', value:'cp932'},
{name:'eucjpms', value:'eucjpms'}
]})
}]
//displayField: 'name',
//emptyText : 'Select Format',
// valueField : 'value',
// value : 'Select'
}, {
xtype: 'fieldset',
id: 'postgre',
border:false,
hidden: true,
items:[{
xtype: 'combo',
width: 150,
mode: 'local',
// hidden: true,
editable:false,
fieldLabel: 'Encode',
triggerAction: 'all',
forceSelection: true,
//dataIndex : 'ENGINE',
displayField: 'name',
valueField: 'value',
name: 'DBS_ENCODE',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name:"BIG5", value:"BIG5"},
{name:"EUC_CN", value:"EUC_CN"},
{name:"EUC_JP", value:"EUC_JP"},
{name:"EUC_KR", value:"EUC_KR"},
{name:"EUC_TW", value:"EUC_TW"},
{name:"GB18030", value:"GB18030"},
{name:"GBK", value:"GBK"},
{name:"ISO_8859_5", value:"ISO_8859_5"},
{name:"ISO_8859_6", value:"ISO_8859_6"},
{name:"ISO_8859_7", value:"ISO_8859_7"},
{name:"ISO_8859_8", value: "ISO_8859_8"},
{name:"JOHAB", value:"JOHAB"},
{name:"KOI8", value: "KOI8"},
{name:"selected", value: "LATIN1"},
{name:"LATIN2", value:"LATIN2"},
{name:"LATIN3", value:"LATIN3"},
{name:"LATIN4", value: "LATIN4"},
{name:"LATIN5", value:"LATIN5"},
{name:"LATIN6", value: "LATIN6"},
{name:"LATIN7", value:"LATIN7"},
{name:"LATIN8", value:"LATIN8"},
{name:"LATIN9", value:"LATIN9"},
{name:"LATIN10", value:"LATIN10"},
{name:"SJIS", value:"SJIS"},
{name:"SQL_ASCII", value:"SQL_ASCII"},
{name:"UHC", value: "UHC"},
{name:"UTF8", value: "UTF8"},
{name:"WIN866", value: "WIN866"},
{name:"WIN874", value:"WIN874"},
{name:"WIN1250", value:"WIN1250"},
{name:"WIN1251", value:"WIN1251"},
{name:"WIN1252", value:"WIN1252"},
{name:"WIN1256", value:"WIN1256"},
{name:"WIN1258", value:"WIN1258"}
]})
}]
//displayField: 'name',
//emptyText : 'Select Format',
// valueField : 'value',
// value : 'Select'
}, {
xtype: 'fieldset',
id: 'sqlserver',
border:false,
hidden: true,
items:[{
xtype: 'combo',
width: 150,
mode: 'local',
// hidden: true,
editable: false,
fieldLabel: 'Encode',
triggerAction: 'all',
forceSelection: true,
//dataIndex : 'ENGINE',
displayField: 'name',
valueField: 'value',
name: 'DBS_ENCODE',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name:'utf8', value: 'utf8'}
]})
}]
//displayField: 'name',
//emptyText : 'Select Format',
// valueField : 'value',
// value : 'Select'
}, {
xtype: 'textfield',
fieldLabel: 'Server',
name: 'DBS_SERVER',
allowBlank: false
}, {
xtype: 'textfield',
fieldLabel: 'Database name',
name: 'DBS_DATABASE_NAME',
allowBlank: false
},{
xtype: 'textfield',
fieldLabel: 'Username',
name: 'DBS_USERNAME',
allowBlank: false
}, {
xtype: 'textfield',
fieldLabel: 'Password',
name: 'DBS_PASSWORD',
allowBlank: true
}, {
xtype: 'textfield',
fieldLabel: 'Port',
name: 'DBS_PORT',
id:'port',
allowBlank: false
}, {
xtype: 'textarea',
fieldLabel: 'Description',
name: 'DBS_DESCRIPTION',
allowBlank: true
},{
id : 'DBS_UID',
xtype: 'hidden',
name : 'DBS_UID'
}
]
{name:"BIG5", value:"BIG5"},
{name:"EUC_CN", value:"EUC_CN"},
{name:"EUC_JP", value:"EUC_JP"},
{name:"EUC_KR", value:"EUC_KR"},
{name:"EUC_TW", value:"EUC_TW"},
{name:"GB18030", value:"GB18030"},
{name:"GBK", value:"GBK"},
{name:"ISO_8859_5", value:"ISO_8859_5"},
{name:"ISO_8859_6", value:"ISO_8859_6"},
{name:"ISO_8859_7", value:"ISO_8859_7"},
{name:"ISO_8859_8", value: "ISO_8859_8"},
{name:"JOHAB", value:"JOHAB"},
{name:"KOI8", value: "KOI8"},
{name:"selected", value: "LATIN1"},
{name:"LATIN2", value:"LATIN2"},
{name:"LATIN3", value:"LATIN3"},
{name:"LATIN4", value: "LATIN4"},
{name:"LATIN5", value:"LATIN5"},
{name:"LATIN6", value: "LATIN6"},
{name:"LATIN7", value:"LATIN7"},
{name:"LATIN8", value:"LATIN8"},
{name:"LATIN9", value:"LATIN9"},
{name:"LATIN10", value:"LATIN10"},
{name:"SJIS", value:"SJIS"},
{name:"SQL_ASCII", value:"SQL_ASCII"},
{name:"UHC", value: "UHC"},
{name:"UTF8", value: "UTF8"},
{name:"WIN866", value: "WIN866"},
{name:"WIN874", value:"WIN874"},
{name:"WIN1250", value:"WIN1250"},
{name:"WIN1251", value:"WIN1251"},
{name:"WIN1252", value:"WIN1252"},
{name:"WIN1256", value:"WIN1256"},
{name:"WIN1258", value:"WIN1258"}
]})
}]
},{
xtype: 'fieldset',
id: 'sqlserver',
border:false,
hidden: true,
items:[{
xtype: 'combo',
width: 150,
mode: 'local',
editable: false,
fieldLabel: 'Encode',
triggerAction: 'all',
forceSelection: true,
//dataIndex : 'ENGINE',
displayField: 'name',
valueField: 'value',
name: 'DBS_ENCODE',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name:'utf8', value: 'utf8'}
]})
}]
},{
xtype: 'textfield',
fieldLabel: 'Server',
name: 'DBS_SERVER',
allowBlank: false
},{
xtype: 'textfield',
fieldLabel: 'Database name',
name: 'DBS_DATABASE_NAME',
allowBlank: false
},{
xtype: 'textfield',
fieldLabel: 'Username',
name: 'DBS_USERNAME',
allowBlank: false
},{
xtype: 'textfield',
fieldLabel: 'Password',
name: 'DBS_PASSWORD',
allowBlank: true
},{
xtype: 'textfield',
fieldLabel: 'Port',
name: 'DBS_PORT',
id:'port',
allowBlank: false
},{
xtype: 'textarea',
fieldLabel: 'Description',
name: 'DBS_DESCRIPTION',
allowBlank: true
},{
id : 'DBS_UID',
xtype: 'hidden',
name : 'DBS_UID'
}
]
})
var formWindow = new Ext.Window({
title: 'Add new Database Source',
collapsible: false,
maximizable: true,
width: 450,
//autoHeight: true,
height: 400,
//layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: dbconnForm,
buttons: [{
text: 'Save',
handler: function(){
var getForm = dbconnForm.getForm().getValues();
var dbConnUID = getForm.DBS_UID;
var Type = getForm.DBS_TYPE;
var Server = getForm.DBS_SERVER;
var DatabaseName = getForm.DBS_DATABASE_NAME;
var Username = getForm.DBS_USERNAME;
var Password = getForm.DBS_PASSWORD;
var Port = getForm.DBS_PORT;
var Description = getForm.DBS_DESCRIPTION;
var formWindow = new Ext.Window({
title: 'Add new Database Source',
collapsible: false,
maximizable: true,
width: 450,
//autoHeight: true,
height: 400,
//layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: dbconnForm,
buttons: [{
text: 'Save',
handler: function(){
var getForm = dbconnForm.getForm().getValues();
var dbConnUID = getForm.DBS_UID;
var Type = getForm.DBS_TYPE;
var Server = getForm.DBS_SERVER;
var DatabaseName = getForm.DBS_DATABASE_NAME;
var Username = getForm.DBS_USERNAME;
var Password = getForm.DBS_PASSWORD;
var Port = getForm.DBS_PORT;
var Description = getForm.DBS_DESCRIPTION;
if(dbConnUID=='')
{
Ext.Ajax.request({
url : '../dbConnections/dbConnectionsAjax.php',
method: 'POST',
params:{
DBS_uid :dbConnUID,
type :Type,
server :Server,
db_name :DatabaseName,
user :Username ,
passwd :Password,
port :Port,
desc :Description,
action :'saveConnection'
},
success: function(response) {
Ext.MessageBox.alert ('Status','Connection Saved Successfully.');
}
});
if(dbConnUID=='')
{
Ext.Ajax.request({
url : '../dbConnections/dbConnectionsAjax.php',
method: 'POST',
params:{
DBS_uid :dbConnUID,
type :Type,
server :Server,
db_name :DatabaseName,
user :Username ,
passwd :Password,
port :Port,
desc :Description,
action :'saveConnection'
},
success: function(response) {
Ext.MessageBox.alert ('Status','Connection Saved Successfully.');
}
});
}
else
{
Ext.Ajax.request({
url : '../dbConnections/dbConnectionsAjax.php',
method: 'POST',
params:{
dbs_uid :dbConnUID,
type :Type,
server :Server,
db_name :DatabaseName,
user :Username ,
passwd :Password,
port :Port,
desc :Description,
action :'saveEditConnection'
},
success: function(response) {
Ext.MessageBox.alert ('Status','Connection Edited Successfully.');
}
else
{
Ext.Ajax.request({
url : '../dbConnections/dbConnectionsAjax.php',
method: 'POST',
params:{
dbs_uid :dbConnUID,
type :Type,
server :Server,
db_name :DatabaseName,
user :Username ,
passwd :Password,
port :Port,
desc :Description,
action :'saveEditConnection'
},
success: function(response) {
Ext.MessageBox.alert ('Status','Connection Edited Successfully.');
}
});
}
//var getData = getstore.data.items;
//taskExtObj.saveTaskUsers(getData);
}
formWindow.close();
dbStore.reload();
}
},{
text: 'Cancel',
handler: function(){
// when this button clicked,
formWindow.close();
dbStore.reload();
}
},{
text: 'Cancel',
handler: function(){
// when this button clicked,
formWindow.close();
}
}]
});
}
}]
});
var gridWindow = new Ext.Window({
title: 'Database Source List',
collapsible: false,
maximizable: true,
width: 550,
//autoHeight: true,
height: 400,
//layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: dbGrid
});
gridWindow.show();
var gridWindow = new Ext.Window({
title: 'Database Source List',
collapsible: false,
maximizable: true,
width: 550,
//autoHeight: true,
height: 400,
//layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: dbGrid
});
gridWindow.show();
}
@@ -2279,8 +2260,8 @@ var formWindow = new Ext.Window({
var Type = getForm.REP_TAB_TYPE;
var Grid = getForm.REP_TAB_GRID;
var Fields = getForm.FIELDS;
var VariableName = getForm.REP_VAR_NAME;
var VariableType = getForm.REP_VAR_TYPE;
// var VariableName = getForm.REP_VAR_NAME;
// var VariableType = getForm.REP_VAR_TYPE;
var Connection = getForm.REP_TAB_CONNECTION
@@ -2289,14 +2270,14 @@ var formWindow = new Ext.Window({
method: 'POST',
params:{
PRO_UID :pro_uid,
REP_TAB_UID :'',
REP_TAB_UID :tableUID,
REP_TAB_TITLE :Title,
REP_TAB_NAME :Name,
REP_TAB_TYPE :Type ,
REP_TAB_GRID :Grid,
FIELDS :Fields,
REP_VAR_NAME : VariableName,
REP_VAR_TYPE : VariableType,
//REP_VAR_NAME : VariableName,
//REP_VAR_TYPE : VariableType,
REP_TAB_CONNECTION: Connection
},