From 0541bc24fa39f516fb6de59a3a878f711bad4b1f Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Thu, 4 Jul 2013 12:55:32 -0400 Subject: [PATCH] BUG 12310 "Imposible crear report tables" SOLVED - Imposible crear report tables - El problema consiste en lo siguiente: > QA tiene backups de sus workspaces, y el mismo es restaurado una y otra vez > El workspace que se muestra en la imagen "wsqa" tiene mal creado el archivo "processmaker/shared/sites/wsqa/pmt-propel/workflow/config/schema.xml" ahi hay un error, que es el sgte: ... el atributo type esta vacio, y el mismo ocasiona el problema, lo que quiere decir que antes en un intento de crear un ReportTable colocaron el campo type vacio lo que causo que se cree mal el archivo schema.xml - Si el archivo schema.xml se creo mal, ahi no se puede hacer nada, se tendra que corregir el mismo manualmente - Se ha mejorado el campo "Type" para ReportTables y PMTables para que trabaje siempre mostrando un valor y no que muestre vacio al principio * Available from version ProcessMaker-2.5.2-testing.1 --- workflow/engine/templates/pmTables/edit.js | 12 +++++++ .../engine/templates/pmTables/editReport.js | 32 +++++++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/workflow/engine/templates/pmTables/edit.js b/workflow/engine/templates/pmTables/edit.js index 1bcd1a2ab..1aebe66d9 100755 --- a/workflow/engine/templates/pmTables/edit.js +++ b/workflow/engine/templates/pmTables/edit.js @@ -211,6 +211,18 @@ Ext.onReady(function(){ sortInfo: {field:'type_id', direction:'ASC'} }), listeners: { + beforerender: function (combo) + { + if (combo.getValue() == "" && combo.store.getAt(0)) { + combo.setValue(combo.store.getAt(0).get(combo.valueField)); + } + }, + beforeshow: function (combo) + { + if (combo.getValue() == "" && combo.store.getAt(0)) { + combo.setValue(combo.store.getAt(0).get(combo.valueField)); + } + }, 'select': function(combo, row, index) { if( cm && cm instanceof Ext.grid.ColumnModel) { if(selCombo != combo.getValue()) { diff --git a/workflow/engine/templates/pmTables/editReport.js b/workflow/engine/templates/pmTables/editReport.js index 2f081a942..17c566bbb 100755 --- a/workflow/engine/templates/pmTables/editReport.js +++ b/workflow/engine/templates/pmTables/editReport.js @@ -236,21 +236,21 @@ Ext.onReady(function(){ id: 'FIELD_FILTER', width: 55 }); - + var sizeField = new fm.NumberField({ name: 'sizeEdit', id: 'sizeEdit', allowBlank: true, allowDecimals: false, - allowNegative: false, + allowNegative: false, disabled: true, nanText: 'This field should content a number', minValue: 1, maxValue: 99, minLength: 0 }); - - + + //columns for table columns grid var cmColumns = [ { @@ -338,8 +338,20 @@ Ext.onReady(function(){ //data : [['VARCHAR',_("ID_VARCHAR")],['TEXT',_("ID_TEXT")],['DATE',_("ID_DATE")],['INT',_("ID_INT")],['FLOAT',_("ID_FLOAT")]], data: columnsTypes, sortInfo: {field:'type_id', direction:'ASC'} - }), + }), listeners: { + beforerender: function (combo) + { + if (combo.getValue() == "" && combo.store.getAt(0)) { + combo.setValue(combo.store.getAt(0).get(combo.valueField)); + } + }, + beforeshow: function (combo) + { + if (combo.getValue() == "" && combo.store.getAt(0)) { + combo.setValue(combo.store.getAt(0).get(combo.valueField)); + } + }, 'select': function(combo, row, index) { if( cm && cm instanceof Ext.grid.ColumnModel) { if(selCombo != combo.getValue()) { @@ -364,8 +376,8 @@ Ext.onReady(function(){ Ext.getCmp('sizeEdit').setMaxValue(99); sizeField.getEl().dom.maxLength = 2; } - if( selCombo == 'CHAR' - || selCombo == 'VARCHAR' + if( selCombo == 'CHAR' + || selCombo == 'VARCHAR' || selCombo == 'TIME' || selCombo == 'DATE' || selCombo == 'DATETIME' @@ -389,7 +401,7 @@ Ext.onReady(function(){ align: 'right', editor: sizeField }, { - + xtype: 'booleancolumn', header: _('ID_AUTO_INCREMENT'), dataIndex: 'field_autoincrement', @@ -970,7 +982,7 @@ function createReportTable() { var tableName = Ext.getCmp('REP_TAB_NAME').getValue().trim(); var tableDescription = Ext.getCmp('REP_TAB_DSC').getValue().trim(); - + //validate table name if(Ext.getCmp('REP_TAB_NAME').getValue().trim() == '') { Ext.getCmp('REP_TAB_NAME').focus(); @@ -1191,7 +1203,7 @@ loadFieldNormal = function(){ Ext.getCmp('assignedGrid').store.removeAll(); } }); - } + } }; loadFieldsGrids = function(){