using schema_proc's new GetTableDefintion method if availible

This commit is contained in:
Ralf Becker 2004-08-15 20:58:12 +00:00
parent adf79e6d7e
commit 03f1739205

View File

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