oProc->RenameTable('lang','phpgw_lang'); $GLOBALS['phpgw_setup']->oProc->RenameTable('languages','phpgw_languages'); $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.15.002'; return $GLOBALS['setup_info']['phpgwapi']['currentver']; } $test[] = '0.9.15.002'; function phpgwapi_upgrade0_9_15_002() { $GLOBALS['phpgw_setup']->oProc->CreateTable( 'phpgw_newprefs', array( 'fd' => array( 'preference_owner' => array('type' => 'int', 'precision' => 4, 'nullable' => False), 'preference_value' => array('type' => 'text') ), 'pk' => array('preference_owner'), 'fk' => array(), 'ix' => array(), 'uc' => array() ) ); $GLOBALS['phpgw_setup']->oProc->query('SELECT * FROM phpgw_preferences',__LINE__,__FILE__); $db2 = $GLOBALS['phpgw_setup']->db; while($GLOBALS['phpgw_setup']->oProc->next_record()) { $accountid = $GLOBALS['phpgw_setup']->oProc->f('preference_owner'); settype($accountid,'integer'); $db2->query('INSERT INTO phpgw_newprefs (preference_owner,preference_value) VALUES(' . $accountid . ",'" . $GLOBALS['phpgw_setup']->oProc->f('preference_value') . "')", __LINE__,__FILE__); } $GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_preferences'); $GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_newprefs','phpgw_preferences'); $setup_info['phpgwapi']['currentver'] = '0.9.15.003'; return $setup_info['phpgwapi']['currentver']; } ?>