diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index 6b91b099b..5f0a857ed 100644 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -278,7 +278,7 @@ class pmTablesProxy extends HttpProxyController 'FLD_TYPE' => $column->field_type, 'FLD_SIZE' => $column->field_size, 'FLD_NULL' => (isset($column->field_null) && $column->field_null ? 1 : 0), - 'FLD_AUTO_INCREMENT' => 0, + 'FLD_AUTO_INCREMENT' => (isset($column->field_bai) && $column->field_bai ? 1 : 0), 'FLD_KEY' => (isset($column->field_key) && $column->field_key ? 1 : 0), 'FLD_FOREIGN_KEY' => 0, 'FLD_FOREIGN_KEY_TABLE' => '', @@ -296,7 +296,7 @@ class pmTablesProxy extends HttpProxyController 'iSize' => $column->field_size, 'sFieldName' => $column->field_name, 'bNull' => (isset($column->field_null) ? $column->field_null : 1), - 'bAI' => 0, + 'bAI' => (isset($column->field_bai) ? $column->field_bai : 0), 'bPrimaryKey' => (isset($column->field_key) ? $column->field_key : 0) ); } else { //editing @@ -306,13 +306,12 @@ class pmTablesProxy extends HttpProxyController } if ($data['REP_TAB_UID'] == '') { //create a new report table $oAdditionalTables->createTable($data['REP_TAB_NAME'], $data['REP_TAB_CONNECTION'], $aFields); + } else { //editing //print_R($aFields); $oAdditionalTables->updateTable($data['REP_TAB_NAME'], $data['REP_TAB_CONNECTION'], $aFields, $oldFields); } - $oAdditionalTables->createPropelClasses($data['REP_TAB_NAME'], '', $fieldsList, $addTabUid, $data['REP_TAB_CONNECTION']); - if ($isReportTable) { $oAdditionalTables->populateReportTable($data['REP_TAB_NAME'], $data['REP_TAB_CONNECTION'], $data['REP_TAB_TYPE'], $fieldsList, $data['PRO_UID'], $data['REP_TAB_GRID']); } diff --git a/workflow/engine/templates/pmTables/edit.js b/workflow/engine/templates/pmTables/edit.js index b82f312b9..d8272b58c 100644 --- a/workflow/engine/templates/pmTables/edit.js +++ b/workflow/engine/templates/pmTables/edit.js @@ -228,6 +228,17 @@ Ext.onReady(function(){ editor: { xtype: 'checkbox' } + }, { + xtype: 'booleancolumn', + header: _('ID_AUTO_INCREMENT'), + dataIndex: 'field_bai', + align: 'center', + width: 50, + trueText: 'Yes', + falseText: 'No', + editor: { + xtype: 'checkbox' + } } ]; @@ -266,6 +277,7 @@ Ext.onReady(function(){ {name: 'field_type'}, {name: 'field_size', type: 'float'}, {name: 'field_null', type: 'float'}, + {name: 'field_bai', type: 'float'}, {name: 'field_filter', type: 'string'} ] }); @@ -914,7 +926,8 @@ function loadTableRowsFromArray(records) field_type : records[i].FLD_TYPE, field_size : records[i].FLD_SIZE, field_key : records[i].FLD_KEY == '1' ? true : false, - field_null : records[i].FLD_NULL == '1' ? true : false, + field_null : records[i].FLD_NULL == '1' ? true : false, + field_bai : records[i].FLD_AUTO_INCREMENT == '1' ? true : false, field_filter: records[i].FLD_FILTER == '1' ? true : false }); store.add(row); @@ -927,4 +940,4 @@ function in_array(needle, haystack) { if(haystack[i] == needle) return true; } return false; -} \ No newline at end of file +} diff --git a/workflow/engine/templates/pmTables/editReport.js b/workflow/engine/templates/pmTables/editReport.js index c0941226c..170415e48 100644 --- a/workflow/engine/templates/pmTables/editReport.js +++ b/workflow/engine/templates/pmTables/editReport.js @@ -327,7 +327,20 @@ Ext.onReady(function(){ editor: new fm.NumberField({ allowBlank: true }) + }, { + xtype: 'booleancolumn', + header: _('ID_AUTO_INCREMENT'), + dataIndex: 'field_bai', + align: 'center', + width: 50, + trueText: 'Yes', + falseText: 'No', + editor: { + xtype: 'checkbox' + } } + + ]; //if permissions plugin is enabled @@ -367,6 +380,7 @@ Ext.onReady(function(){ {name: 'field_type'}, {name: 'field_size', type: 'float'}, {name: 'field_null', type: 'float'}, + {name: 'field_bai', type: 'float'}, {name: 'field_filter', type: 'string'} ] }); @@ -1217,6 +1231,7 @@ function loadTableRowsFromArray(records) field_size : records[i].FLD_SIZE, field_key : records[i].FLD_KEY, field_null : records[i].FLD_NULL, + field_bai : records[i].FLD_AUTO_INCREMENT == '1' ? true : false, field_filter: records[i].FLD_FILTER == '1' ? true : false, _index : '' }); @@ -1318,4 +1333,4 @@ function in_array(needle, haystack) { if(haystack[i] == needle) return true; } return false; -} \ No newline at end of file +}