BUG 7922 "SRP: wrapped: Could not execute query.." SOLVED

According the solution raised on the meeting
- the default selection for db connetions is workflow instead REPORT
- the prefix PMT for all pmtables was added
This commit is contained in:
Erik Amaru Ortiz
2011-11-21 18:38:39 -04:00
parent bf9d9b5a7b
commit ff4ee1b33d
3 changed files with 48 additions and 17 deletions

View File

@@ -79,6 +79,11 @@ class pmTablesProxy extends HttpProxyController
else { else {
$addTables['rows'][$i]['NUM_ROWS'] = 0; $addTables['rows'][$i]['NUM_ROWS'] = 0;
} }
//removing the prefix "PMT" to aalow alphabetical order
if (substr($addTables['rows'][$i]['ADD_TAB_NAME'], 0, 4) == 'PMT_') {
$addTables['rows'][$i]['ADD_TAB_NAME'] = substr($addTables['rows'][$i]['ADD_TAB_NAME'], 4);
}
} }
catch (Exception $e) { catch (Exception $e) {
$addTables['rows'][$i]['NUM_ROWS'] = G::LoadTranslation('ID_TABLE_NOT_FOUND'); $addTables['rows'][$i]['NUM_ROWS'] = G::LoadTranslation('ID_TABLE_NOT_FOUND');
@@ -207,6 +212,12 @@ class pmTablesProxy extends HttpProxyController
$data = (array) $httpData; $data = (array) $httpData;
$data['PRO_UID'] = trim($data['PRO_UID']); $data['PRO_UID'] = trim($data['PRO_UID']);
$data['columns'] = G::json_decode(stripslashes($httpData->columns)); //decofing data columns $data['columns'] = G::json_decode(stripslashes($httpData->columns)); //decofing data columns
// forcing to use the PMT prefix for all new tables
if ($data['REP_TAB_UID'] == '' || (isset($httpData->forceUid) && $httpData->forceUid)) { //new report table
$data['REP_TAB_NAME'] = sprintf('%s_%s', 'PMT', $data['REP_TAB_NAME']);
}
$isReportTable = $data['PRO_UID'] != '' ? true : false; $isReportTable = $data['PRO_UID'] != '' ? true : false;
$oAdditionalTables = new AdditionalTables(); $oAdditionalTables = new AdditionalTables();
$oFields = new Fields(); $oFields = new Fields();

View File

@@ -534,7 +534,7 @@ Ext.onReady(function(){
items.push({ items.push({
id: 'REP_TAB_NAME', id: 'REP_TAB_NAME',
fieldLabel: _("ID_TABLE_NAME"), fieldLabel: _("ID_TABLE_NAME") + ' <span style="font-size:9">('+_("ID_AUTO_PREFIX") + ' "PMT")</span>',
xtype:'textfield', xtype:'textfield',
emptyText: _("ID_SET_A_TABLE_NAME"), emptyText: _("ID_SET_A_TABLE_NAME"),
width: 250, width: 250,
@@ -561,7 +561,7 @@ Ext.onReady(function(){
var frmDetails = new Ext.FormPanel({ var frmDetails = new Ext.FormPanel({
id :'frmDetails', id :'frmDetails',
region : 'north', region : 'north',
labelWidth : 120, labelWidth : 180,
labelAlign :'right', labelAlign :'right',
title : ADD_TAB_UID ? _('ID_PMTABLE') : _('ID_NEW_PMTABLE'), title : ADD_TAB_UID ? _('ID_PMTABLE') : _('ID_NEW_PMTABLE'),
bodyStyle :'padding:10px', bodyStyle :'padding:10px',
@@ -718,6 +718,13 @@ function createReportTable()
return; return;
} }
Ext.Msg.show({
title : '',
msg : TABLE !== false ? _('ID_UPDATING_TABLE') : _('ID_CREATING_TABLE'),
wait:true,
waitConfig: {interval:500}
});
Ext.Ajax.request({ Ext.Ajax.request({
url: '../pmTablesProxy/save', url: '../pmTablesProxy/save',
params: { params: {
@@ -733,7 +740,8 @@ function createReportTable()
success: function(resp){ success: function(resp){
try { try {
result = Ext.util.JSON.decode(resp.responseText); result = Ext.util.JSON.decode(resp.responseText);
Ext.MessageBox.hide();
if (result.success) { if (result.success) {
proParam = PRO_UID !== false ? '?PRO_UID='+PRO_UID : ''; proParam = PRO_UID !== false ? '?PRO_UID='+PRO_UID : '';
location.href = '../pmTables' + proParam; //history.back(); location.href = '../pmTables' + proParam; //history.back();

View File

@@ -589,18 +589,22 @@ Ext.onReady(function(){
listeners: { listeners: {
load: function() { load: function() {
if (TABLE !== false) { // is editing if (TABLE !== false) { // is editing
// set current editing process combobox defaultValue = TABLE.DBS_UID;
var i = this.findExact('DBS_UID', TABLE.DBS_UID, 0); comboDbConnections.setDisabled(true);
if (i > -1){ }
comboDbConnections.setValue(this.getAt(i).data.DBS_UID); else {
comboDbConnections.setRawValue(this.getAt(i).data.DBS_NAME); defaultValue = 'workflow';
comboDbConnections.setDisabled(true); }
} else {
// DB COnnection deleted // set current editing process combobox
Ext.Msg.alert( _('ID_ERROR'), 'DB Connection doesn\'t exist!'); var i = this.findExact('DBS_UID', defaultValue, 0);
} if (i > -1){
} else { comboDbConnections.setValue(this.getAt(i).data.DBS_UID);
comboDbConnections.setValue('rp'); comboDbConnections.setRawValue(this.getAt(i).data.DBS_NAME);
}
else {
// DB COnnection deleted
Ext.Msg.alert( _('ID_ERROR'), 'DB Connection doesn\'t exist!');
} }
} }
} }
@@ -781,7 +785,7 @@ Ext.onReady(function(){
items.push({ items.push({
id: 'REP_TAB_NAME', id: 'REP_TAB_NAME',
fieldLabel: _("ID_TABLE_NAME"), fieldLabel: _("ID_TABLE_NAME") + ' <span style="font-size:9">('+_("ID_AUTO_PREFIX") + ' "PMT")</span>',
xtype:'textfield', xtype:'textfield',
emptyText: _("ID_SET_A_TABLE_NAME"), emptyText: _("ID_SET_A_TABLE_NAME"),
width: 250, width: 250,
@@ -822,7 +826,7 @@ Ext.onReady(function(){
var frmDetailsConfig = { var frmDetailsConfig = {
id:'frmDetails', id:'frmDetails',
region: 'north', region: 'north',
labelWidth: 120, labelWidth: 180,
labelAlign:'right', labelAlign:'right',
title: ADD_TAB_UID ? _('ID_REPORT_TABLE') : _('ID_NEW_REPORT_TABLE'), title: ADD_TAB_UID ? _('ID_REPORT_TABLE') : _('ID_NEW_REPORT_TABLE'),
bodyStyle:'padding:10px', bodyStyle:'padding:10px',
@@ -974,6 +978,13 @@ function createReportTable()
columns.push(row.data); columns.push(row.data);
} }
Ext.Msg.show({
title : '',
msg : TABLE !== false ? _('ID_UPDATING_TABLE') : _('ID_CREATING_TABLE'),
wait:true,
waitConfig: {interval:500}
});
Ext.Ajax.request({ Ext.Ajax.request({
url: '../pmTablesProxy/save', url: '../pmTablesProxy/save',
params: { params: {
@@ -988,6 +999,7 @@ function createReportTable()
}, },
success: function(resp){ success: function(resp){
result = Ext.util.JSON.decode(resp.responseText); result = Ext.util.JSON.decode(resp.responseText);
Ext.MessageBox.hide();
if (result.success) { if (result.success) {
proParam = PRO_UID !== false ? '?PRO_UID='+PRO_UID : ''; proParam = PRO_UID !== false ? '?PRO_UID='+PRO_UID : '';