[Vtigercrm-commits] [vtiger-commits] r4462 - in /vtigercrm/trunk/install: 3confirmConfig.php 5createTables.inc.php 5createTables.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Mar 27 10:19:10 EST 2006
Author: saraj
Date: Mon Mar 27 08:19:04 2006
New Revision: 4462
Log:
junk code removed
Modified:
vtigercrm/trunk/install/3confirmConfig.php
vtigercrm/trunk/install/5createTables.inc.php
vtigercrm/trunk/install/5createTables.php
Modified: vtigercrm/trunk/install/3confirmConfig.php
==============================================================================
Binary files - no diff available.
Modified: vtigercrm/trunk/install/5createTables.inc.php
==============================================================================
--- vtigercrm/trunk/install/5createTables.inc.php (original)
+++ vtigercrm/trunk/install/5createTables.inc.php Mon Mar 27 08:19:04 2006
@@ -24,7 +24,6 @@
require_once('include/logging.php');
require_once('modules/Leads/Lead.php');
require_once('modules/Settings/FileStorage.php');
-//require_once('modules/imports/Headers.php');
require_once('modules/Contacts/Contact.php');
require_once('modules/Accounts/Account.php');
require_once('modules/Potentials/Opportunity.php');
@@ -32,7 +31,6 @@
require_once('modules/Notes/Note.php');
require_once('modules/Emails/Email.php');
require_once('modules/Users/User.php');
-require_once('modules/Import/SugarFile.php');
require_once('modules/Import/ImportMap.php');
require_once('modules/Import/UsersLastImport.php');
require_once('modules/Users/TabMenu.php');
@@ -59,79 +57,6 @@
echo $msg;
}
}
-
-/*
-function createSchemaTable() {
- global $log;
-
- // create the schema tables
- $query = "CREATE TABLE modules (id int(11) NOT NULL auto_increment, name text,PRIMARY KEY ( ID ))";
-
- $this->query($query);
-}
-
-function createObjectTable() {
- global $log;
-
- // create the object tables
- $query = "CREATE TABLE objects (module_id int(11), name text, PRIMARY KEY ( module_id, name ))";
-
- $this->query($query);
-}
-
-function createAttributesTable() {
- global $log;
-
- // create the attributes tables
- $query = "CREATE TABLE attributes (module_id int(11), object_name text, name text, PRIMARY KEY ( module_id, object_name ))";
- // fk module_id, object_name -> object table.
-
- $this->query($query);
-}
-
-function createLabelsTable() {
- global $log;
-
- // create the translation tables
- $query = "CREATE TABLE labels (module_id int(11), name text, value text, value_long text, value_popup text, PRIMARY KEY ( module_id, name ))";
-
- $this->query($query);
-}
-
-// drop old tables if table exists and told to drop it
-function drop_table_install(&$focus) {
- global $log, $db;
-
- $result = $db->requireSingleResult("SHOW TABLES LIKE '".$focus->table_name."'");
-
- if (!empty($result)) {
- $focus->drop_tables();
- $log->info("Dropped old ".$focus->table_name." table.");
- return 1;
- }
- else {
- $log->info("Did not need to drop old ".$focus->table_name." table. It doesn't exist.");
- return 0;
- }
-}
-
-// create new tables if they don't exist.
-function create_table_install(&$focus) {
- global $log, $db;
-
- $result = $db->query("SHOW TABLES LIKE '".$focus->table_name."'");
-
- if ($db->getRowCount($result) == 0) {
- $focus->create_tables();
- $log->info("Created ".$focus->table_name." table.");
- return 1;
- }
- else {
- $log->info("Table ".$focus->table_name." already exists.");
- return 0;
- }
-}
-*/
function create_default_users() {
global $log, $db;
@@ -201,27 +126,6 @@
$startTime = microtime();
-$modules = array(
- "Contact"
- ,"Account"
- ,"potential"
- ,"Lead"
- ,"Tab"
- ,"Security"
- ,"LoginHistory"
- ,"FileStorage"
- ,"User"
- ,"Tracker"
- ,"Activity"
- ,"Note"
- ,"Email"
- ,"SugarFile"
- ,"ImportMap"
- ,"UsersLastImport"
-);
-
-$focus = 0;
-
// tables creation
eecho("Creating Core tables: ");
$success = $db->createTables("schema/DatabaseSchema.xml");
@@ -234,56 +138,12 @@
else
eecho("Tables Successfully created.\n");
-eecho ("Creating tables for module: ");
-foreach ( $modules as $module ) {
- $focus = new $module();
-
- /*
- if ($db_drop_tables == true ) {
- $existed = drop_table_install($focus);
-
- if ($existed)
- echo "<font color=red>Dropped existing ".$focus->table_name." table</font><BR>\n";
- else
- echo "<font color=green>Table ".$focus->table_name." does not exist</font><BR>\n";
- }
-
- $success = create_table_install($focus);
-
- if ( $success) {
- echo "<font color=green>Created new ".$focus->table_name." table</font><BR>\n";
-
- if ( $module == "User")
- $new_tables = 1;
- }
- else
- echo "Table ".$focus->table_name." already exists<BR>\n";
- */
-
- eecho ("$module");
- $focus->create_tables(); // inserts only rows
- eecho (", ");
-}
-eecho ("Done.");
-
-/*
-if ($new_tables)
- create_default_users();
-*/
-
-/*
-if($success==2) {
-*/
- create_default_users();
-//}
+create_default_users();
// populate users table
$uid = $db->getUniqueID("users");
$sql_stmt1 = "insert into users(id,user_name,user_password,last_name,email1,date_format) values(".$uid.",'standarduser','stX/AHHNK/Gkw','standarduser','standarduser at standard.user.com','yyyy-mm-dd')";
$db->query($sql_stmt1) or die($app_strings['ERR_CREATING_TABLE'].mysql_error());
-
-//$sql_stmt1 = "insert into user2role values(1,1)";
-//$db->query($sql_stmt1) or die($app_strings['ERR_CREATING_TABLE'].mysql_error());
$role_query = "select roleid from role where rolename='standard_user'";
$db->database->SetFetchMode(ADODB_FETCH_ASSOC);
@@ -309,7 +169,6 @@
require_once('modules/CustomView/PopulateCustomView.php');
// create and Populate PHPBB tables and data
-//require_once('include/PopulatePhpBBtables.php');
//create_populate_phpbb();
// populate the db with seed data
@@ -321,23 +180,12 @@
// populate forums data
global $log, $db;
-/*
-$db->query("update phpbb_config set config_value='".$admin_email."' where config_name='board_email'");
-$db->query("update phpbb_config set config_value='modules/MessageBoard/images/smiles' where config_name='smilies_path'");
-$db->query("update phpbb_config set config_value='".$server_name."' where config_name='server_name'");
-$db->query("update phpbb_config set config_value='".$server_port."' where config_name='server_port'");
-$db->query("update phpbb_config set config_value='modules/MessageBoard' where config_name='script_path'");
-$curr_time=time();
-$db->query("insert phpbb_config values('board_startdate','".$curr_time."')");
-$db->query("insert phpbb_config values('default_lang', 'english')");
-*/
$endTime = microtime();
$deltaTime = microtime_diff($startTime, $endTime);
// populate calendar data
-//include("modules/Calendar/admin/scheme.php");
//eecho ("total time: $deltaTime seconds.\n");
?>
Modified: vtigercrm/trunk/install/5createTables.php
==============================================================================
Binary files - no diff available.
More information about the vtigercrm-commits
mailing list