mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
using schema_proc's new GetTableDefintion method if availible
This commit is contained in:
parent
adf79e6d7e
commit
03f1739205
@ -171,22 +171,29 @@
|
||||
else // import
|
||||
{
|
||||
$oProc = CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
|
||||
$oProc->m_odb = $GLOBALS['phpgw']->db;
|
||||
$oProc->m_oTranslator->_GetColumns($oProc,$content['new_table_name'],$nul);
|
||||
|
||||
while (list($key,$tbldata) = each ($oProc->m_oTranslator->sCol))
|
||||
if (method_exists($oProc,'GetTableDefinition'))
|
||||
{
|
||||
$cols .= $tbldata;
|
||||
$this->data[$this->table = $content['new_table_name']] = $oProc->GetTableDefinition($content['new_table_name']);
|
||||
}
|
||||
else // to support eGW 1.0
|
||||
{
|
||||
$oProc->m_odb = $GLOBALS['phpgw']->db;
|
||||
$oProc->m_oTranslator->_GetColumns($oProc,$content['new_table_name'],$nul);
|
||||
|
||||
while (list($key,$tbldata) = each ($oProc->m_oTranslator->sCol))
|
||||
{
|
||||
$cols .= $tbldata;
|
||||
}
|
||||
eval('$cols = array('. $cols . ');');
|
||||
|
||||
$this->data[$this->table = $content['new_table_name']] = array(
|
||||
'fd' => $cols,
|
||||
'pk' => $oProc->m_oTranslator->pk,
|
||||
'fk' => $oProc->m_oTranslator->fk,
|
||||
'ix' => $oProc->m_oTranslator->ix,
|
||||
'uc' => $oProc->m_oTranslator->uc
|
||||
);
|
||||
}
|
||||
eval('$cols = array('. $cols . ');');
|
||||
|
||||
$this->data[$this->table = $content['new_table_name']] = array(
|
||||
'fd' => $cols,
|
||||
'pk' => $oProc->m_oTranslator->pk,
|
||||
'fk' => $oProc->m_oTranslator->fk,
|
||||
'ix' => $oProc->m_oTranslator->ix,
|
||||
'uc' => $oProc->m_oTranslator->uc
|
||||
);
|
||||
}
|
||||
}
|
||||
elseif ($content['editor'])
|
||||
|
Loading…
Reference in New Issue
Block a user