[Vtigercrm-commits] [vtiger-commits] r7016 - in /vtigercrm/trunk/install: 5createTables.inc.php populateSeedData.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Jun 13 06:01:38 EDT 2006
Author: richie
Date: Tue Jun 13 04:01:33 2006
New Revision: 7016
Log:
users module added in CRMEntity
Modified:
vtigercrm/trunk/install/5createTables.inc.php
vtigercrm/trunk/install/populateSeedData.php
Modified: vtigercrm/trunk/install/5createTables.inc.php
==============================================================================
--- vtigercrm/trunk/install/5createTables.inc.php (original)
+++ vtigercrm/trunk/install/5createTables.inc.php Tue Jun 13 04:01:33 2006
@@ -67,27 +67,35 @@
// create default admin user
$user = new User();
- $user->last_name = 'Administrator';
- $user->user_name = 'admin';
- $user->status = 'Active';
- $user->is_admin = 'on';
- $user->user_password = $user->encrypt_password($admin_password);
- $user->tz = 'Europe/Berlin';
- $user->holidays = 'de,en_uk,fr,it,us,';
- $user->workdays = '0,1,2,3,4,5,6,';
- $user->weekstart = '1';
- $user->namedays = '';
- $user->date_format = 'yyyy-mm-dd';
+ $user->column_fields["last_name"] = 'Administrator';
+ $user->column_fields["user_name"] = 'admin';
+ $user->column_fields["status"] = 'Active';
+ $user->column_fields["is_admin"] = 'on';
+ $user->column_fields["user_password"] = $user->encrypt_password($admin_password);
+ $user->column_fields["tz"] = 'Europe/Berlin';
+ $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,';
+ $user->column_fields["workdays"] = '0,1,2,3,4,5,6,';
+ $user->column_fields["weekstart"] = '1';
+ $user->column_fields["namedays"] = '';
+ $user->column_fields["currency_id"] = 1;
+ $user->column_fields["date_format"] = 'yyyy-mm-dd';
// added by jeri to populate default image and tagcloud for admin
- $user->imagename = 'shanky.jpg';
- $user->tagcloud = '';
- $user->activity_view = 'This Year';
- $user->defhomeview = 'home_metrics';
+ $user->column_fields["imagename"] = 'shanky.jpg';
+ $user->column_fields["tagcloud"] = '';
+ $user->column_fields["activity_view"] = 'This Year';
+ $user->column_fields["defhomeview"] = 'home_metrics';
//added by philip for default default admin emailid
if($admin_email == '')
$admin_email ="admin at administrator.com";
- $user->email = $admin_email;
- $user->save();
+ $user->column_fields["email"] = $admin_email;
+ //to get the role id for standard_user
+ $role_query = "select roleid from role where rolename='administrator'";
+ $db->database->SetFetchMode(ADODB_FETCH_ASSOC);
+ $role_result = $db->query($role_query);
+ $role_id = $db->query_result($role_result,0,"roleid");
+ $user->column_fields["roleid"] = $role_id;
+
+ $user->save("Users");
// we need to change the admin user to a fixed id of 1.
//$query = "update vtiger_users set id='1' where user_name='$user->user_name'";
@@ -95,70 +103,41 @@
$log->info("Created ".$user->table_name." vtiger_table. for user $user->id");
- /*
- if($create_default_user) {
- $default_user = new User();
- $default_user->last_name = $default_user_name;
- $default_user->user_name = $default_user_name;
- $default_user->status = 'Active';
-
- if (isset($default_user_is_admin) && $default_user_is_admin)
- $default_user->is_admin = 'on';
-
- $default_user->user_password = $default_user->encrypt_password($default_password);
- $default_user->tz = 'Europe/Berlin';
- $default_user->holidays = 'de,en_uk,fr,it,us,';
- $default_user->workdays = '0,1,2,3,4,5,6,';
- $default_user->weekstart = '1';
- $default_user->namedays = '';
- $default_user->save();
- }
- */
-
- // insert values into vtiger_user2role vtiger_table
- $role_query = "select roleid from vtiger_role where rolename='administrator'";
- $db->database->SetFetchMode(ADODB_FETCH_ASSOC);
- $role_result = $db->query($role_query);
- $role_id = $db->query_result($role_result,0,"roleid");
-
- $sql_stmt1 = "insert into vtiger_user2role values(".$user->id.",'".$role_id."')";
- $db->query($sql_stmt1) or die($app_strings['ERR_CREATING_TABLE'].mysql_error());
-
- //Creating the flat vtiger_files
+ //Creating the flat files
createUserPrivilegesfile($user->id);
createUserSharingPrivilegesfile($user->id);
//Creating the Standard User
$user = new User();
- $user->last_name = 'StandardUser';
- $user->user_name = 'standarduser';
- $user->status = 'Active';
- $user->user_password = $user->encrypt_password('standarduser');
- $user->tz = 'Europe/Berlin';
- $user->holidays = 'de,en_uk,fr,it,us,';
- $user->workdays = '0,1,2,3,4,5,6,';
- $user->weekstart = '1';
- $user->namedays = '';
- $user->date_format = 'yyyy-mm-dd';
+ $user->column_fields["last_name"] = 'StandardUser';
+ $user->column_fields["user_name"] = 'standarduser';
+ $user->column_fields["status"] = 'Active';
+ $user->column_fields["user_password"] = $user->encrypt_password('standarduser');
+ $user->column_fields["tz"] = 'Europe/Berlin';
+ $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,';
+ $user->column_fields["workdays"] = '0,1,2,3,4,5,6,';
+ $user->column_fields["weekstart"] = '1';
+ $user->column_fields["namedays"] = '';
+ $user->column_fields["currency_id"] = 1;
+ $user->column_fields["date_format"] = 'yyyy-mm-dd';
// added by jeri to populate default image and tagcloud for admin
- $user->imagename = 'ela.jpg';
- $user->activity_view = 'This Year';
- $user->tagcloud = '';
- $user->defhomeview = 'home_metrics';
+ $user->column_fields["imagename"] = 'ela.jpg';
+ $user->column_fields["activity_view"] = 'This Year';
+ $user->column_fields["tagcloud"] = '';
+ $user->column_fields["defhomeview"] = 'home_metrics';
//added by philip for default default admin emailid
if($admin_email == '')
$std_email ="standarduser at standarduser.com";
- $user->email = $std_email;
- $user->save();
-
+ $user->column_fields["email"] = $std_email;
+ //to get the role id for standard_user
$role_query = "select roleid from vtiger_role where rolename='standard_user'";
$db->database->SetFetchMode(ADODB_FETCH_ASSOC);
$role_result = $db->query($role_query);
$role_id = $db->query_result($role_result,0,"roleid");
-
- $sql_stmt2 = "insert into vtiger_user2role values(".$user->id.",'".$role_id."')";
- $db->query($sql_stmt2) or die($app_strings['ERR_CREATING_TABLE'].mysql_error());
+ $user->column_fields["roleid"] = $role_id;
+
+ $user->save('Users');
//Creating the flat vtiger_files
createUserPrivilegesfile($user->id);
@@ -169,8 +148,8 @@
//$startTime = microtime();
$modules = array("DefaultDataPopulator");
$focus=0;
-// vtiger_tables creation
-eecho("Creating Core vtiger_tables: ");
+// tables creation
+eecho("Creating Core tables: ");
$success = $db->createTables("schema/DatabaseSchema.xml");
// TODO HTML
@@ -194,20 +173,20 @@
//$db->query($sql_stmt1) or die($app_strings['ERR_CREATING_TABLE'].mysql_error());
-// create and populate combo vtiger_tables
+// create and populate combo tables
require_once('include/PopulateComboValues.php');
$combo = new PopulateComboValues();
$combo->create_tables();
create_default_users();
-// default vtiger_report population
+// default report population
require_once('modules/Reports/PopulateReports.php');
-// default vtiger_customview population
+// default customview population
require_once('modules/CustomView/PopulateCustomView.php');
-//Writing vtiger_tab data in flat file
+//Writing tab data in flat file
create_tab_data_file();
create_parenttab_data_file();
Modified: vtigercrm/trunk/install/populateSeedData.php
==============================================================================
--- vtigercrm/trunk/install/populateSeedData.php (original)
+++ vtigercrm/trunk/install/populateSeedData.php Tue Jun 13 04:01:33 2006
@@ -121,7 +121,7 @@
global $current_user;
$current_user = new User();
-$result = $current_user->retrieve($assigned_user_id);
+$result = $current_user->retrieve_entity_info($assigned_user_id,'Users');
$tagkey = 1;
@@ -145,7 +145,7 @@
$account_name = $company_name_array[$i];
- // Create new vtiger_accounts.
+ // Create new accounts.
$account = new Account();
$account->column_fields["accountname"] = $account_name;
$account->column_fields["phone"] = create_phone_number();
@@ -227,7 +227,7 @@
$opportunity_ids[] = $opp->id;
-// $adb->println("PSD Potential [".$opp->id."] - vtiger_account[".$account->id."]");
+// $adb->println("PSD Potential [".$opp->id."] - account[".$account->id."]");
}
@@ -297,10 +297,10 @@
//$query = "insert into opportunities_contacts set id='".create_guid()."', contact_id='$contact->id', contact_role='".$app_list_strings['opportunity_relationship_type_default_key']."', opportunity_id='".$opportunity_ids[$opportunity_key]."'";
//$db->query($query, true, "unable to create seed links between opportunities and contacts");
- $query = "insert into vtiger_contpotentialrel ( contactid, vtiger_potentialid ) values (".$contact->id.",".$opportunity_ids[$opportunity_key].")";
+ $query = "insert into vtiger_contpotentialrel ( contactid, potentialid ) values (".$contact->id.",".$opportunity_ids[$opportunity_key].")";
$db->query($query);
-// $adb->println("PSD Contact [".$contact->id."] - vtiger_account[".$account_ids[$account_key]."] - vtiger_potential[".$opportunity_ids[$opportunity_key]."]");
+// $adb->println("PSD Contact [".$contact->id."] - account[".$account_ids[$account_key]."] - potential[".$opportunity_ids[$opportunity_key]."]");
//Create new tasks
/*$task = new Task();
@@ -396,7 +396,7 @@
}
-// Temp fix since user is not logged in while populating data updating creatorid in vtiger_crmentity - GS
+// Temp fix since user is not logged in while populating data updating creatorid in crmentity - GS
//Populating Vendor Data
@@ -544,7 +544,7 @@
http://support.microsoft.com/default.aspx?scid=kb%3BEN-US%3B263074
If you want to continue working with vtiger Outlook Plug-in, select the Allow access for check box and select the time from drop-down box.",
- " Since, vtigerCRM & all plugins are open source, it is not signed up with third party vtiger_vendors and IE will ask to download even though the plugin are not signed.
+ " Since, vtigerCRM & all plugins are open source, it is not signed up with third party vendors and IE will ask to download even though the plugin are not signed.
This message if produced by Microsoft Windows XP. I English Windows XP with the SP2 and the last updates. I told IE to accept installation of the ActiveX, but after it, this message has appeared. Provably there is a place where to tall to WinXP to not validate if the code is signed... but I don\'t know where.
@@ -633,7 +633,7 @@
$salesorder_ids[] = $so->id;
$product_key = array_rand($product_ids);
- $query = "insert into vtiger_soproductrel ( vtiger_salesorderid, productid, quantity, listprice ) values (".$so->id.",".$product_ids[$product_key].",12,499.000 )";
+ $query = "insert into vtiger_soproductrel ( salesorderid, productid, quantity, listprice ) values (".$so->id.",".$product_ids[$product_key].",12,499.000 )";
$db->query($query);
}
@@ -668,7 +668,7 @@
$purchaseorder_ids[] = $po->id;
$product_key = array_rand($product_ids);
- $query = "insert into vtiger_poproductrel ( vtiger_purchaseorderid, productid, quantity, listprice ) values (".$po->id.",".$product_ids[$product_key].",15,1299.000 )";
+ $query = "insert into vtiger_poproductrel ( purchaseorderid, productid, quantity, listprice ) values (".$po->id.",".$product_ids[$product_key].",15,1299.000 )";
$db->query($query);
}
@@ -710,7 +710,7 @@
}
$product_key = array_rand($product_ids);
- $query = "insert into vtiger_invoiceproductrel ( vtiger_invoiceid, productid, quantity, listprice ) values (".$invoice->id.",".$product_ids[$product_key].",18,269.000 )";
+ $query = "insert into vtiger_invoiceproductrel ( invoiceid, productid, quantity, listprice ) values (".$invoice->id.",".$product_ids[$product_key].",18,269.000 )";
$db->query($query);
}
@@ -781,7 +781,7 @@
$notes_ids[] = $notes ->id;
$product_key = array_rand($product_ids);
- $query = "insert into vtiger_senotesrel (crmid, vtiger_notesid) values (".$product_ids[$product_key].", ".$notes->id.")";
+ $query = "insert into vtiger_senotesrel (crmid, notesid) values (".$product_ids[$product_key].", ".$notes->id.")";
$db->query($query);
}
More information about the vtigercrm-commits
mailing list