BUG 7395 cambiar un dato en la BD a autoincrementable

This issue was completed, the autoIncrement option was added.
This commit is contained in:
Carlos Pacha
2011-08-10 15:39:31 -04:00
parent 823e7813b7
commit 18ef1e590a
3 changed files with 34 additions and 7 deletions

View File

@@ -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']);
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}