Merge pull request #1418 from hector-cortez/BUG-11025

BUG 11025  Error al crear un pmtable con nombre largo SOLVED
This commit is contained in:
julceslauhub
2013-03-18 15:53:11 -07:00
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(){