BUG 11025 Error al crear un pmtable con nombre largo SOLVED

- Al crear un PmTable con un nombre extenso y guardar el mismo, despliega un mensaje de error, de nombre de tabla incorrecto.
- Validate table name of the new PM Tables
This commit is contained in:
Hector Cortez
2013-03-18 17:36:10 -04:00
parent efbc22d489
commit 2db873bd36
3 changed files with 28 additions and 1 deletions

View File

@@ -109,6 +109,7 @@ class pmTables extends Controller
$this->setJSVar( 'columnsTypes', $columnsTypesList );
$this->setJSVar( 'dataNumRows', $dataNumRows );
$this->setJSVar( '_plugin_permissions', $repTabPluginPermissions );
$this->setJSVar( 'sizeTableName', $this->getSizeTableName());
G::RenderPage( 'publish', 'extJs' );
}
@@ -180,5 +181,29 @@ class pmTables extends Controller
}
return $repTabPluginPermissions;
}
/**
*
* Return of size ok the engine on course.
*
* @return int
*/
public function getSizeTableName()
{
switch (DB_ADAPTER) {
case 'mysql':
$tableSize = 64;
break;
case 'mssql':
$tableSize = 128;
break;
case 'oci8':
$tableSize = 30;
default:
$tableSize = 30;
break;
}
$tableSize = $tableSize - 4; // Prefix PMT_
return $tableSize;
}
}

View File

@@ -547,10 +547,11 @@ Ext.onReady(function(){
xtype:'textfield',
emptyText: _("ID_SET_A_TABLE_NAME"),
width: 250,
autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: sizeTableName },
stripCharsRe: /(\W+)/g,
listeners:{
change: function(){
this.setValue(this.getValue().toUpperCase())
this.setValue(this.getValue().toUpperCase());
}
}
});

View File

@@ -802,6 +802,7 @@ Ext.onReady(function(){
xtype:'textfield',
emptyText: _("ID_SET_A_TABLE_NAME"),
width: 250,
autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: sizeTableName },
stripCharsRe: /(\W+)/g,
listeners:{
change: function(){