jonb
Joined: 25 May 2007
Posts: 42
Location: Santa Fe, NM
|
| Posted: Wed Jun 20, 2007 3:51 pm Post subject: Changes in DefaultDataPopulator.php for new module |
|
|
In case it may help someone else, here's the changes I had to make to the DefaultDataPopulator.php in order to setup the tables properly. The module name used here is "Licenses", so just replace that with the module name you would like to use. This patch is against 5.0.3.
Code: Index: DefaultDataPopulator.php
===================================================================
--- DefaultDataPopulator.php (revision 113)
+++ DefaultDataPopulator.php (working copy)
@@ -76,7 +76,8 @@
$this->db->query("INSERT INTO vtiger_tab VALUES (26,'Campaigns',0,23,'Campaigns',null,null,0,0)");
$this->db->query("INSERT INTO vtiger_tab VALUES (27,'Portal',0,24,'Portal',null,null,0,1)");
$this->db->query("INSERT INTO vtiger_tab VALUES (28,'Webmails',0,25,'Webmails',null,null,0,1)");
- $this->db->query("insert into vtiger_tab values (29,'Users',0,26,'Users',null,null,0,1)");
+ $this->db->query("INSERT INTO vtiger_tab values (29,'Users',0,26,'Users',null,null,0,1)");
+ $this->db->query("INSERT INTO vtiger_tab values (30,'Licenses', 27, 'Licenses',null,null,0,1);
// Populate the vtiger_blocks vtiger_table
$this->db->query("insert into vtiger_blocks values (1,2,'LBL_OPPORTUNITY_INFORMATION',1,0,0,0,0,0)");
@@ -164,6 +165,9 @@
$this->db->query("insert into vtiger_blocks values (82,26,'LBL_DESCRIPTION_INFORMATION',4,0,0,0,0,0)");
$this->db->query("insert into vtiger_blocks values (83,29,'LBL_USER_IMAGE_INFORMATION',4,0,0,0,0,0)"); //Added a New Block User Image Info in Users Module
+//Added an extra block for the Licenses module
+$this->db->query("insert into vtiger_blocks values (84,30,'LBL_LICENSE_INFORMATION',1,0,0,0,0,0)");
+
//
//Account Details -- START
@@ -906,6 +910,21 @@
$this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'address_postalcode','vtiger_users',1,'1','address_postalcode','Postal Code',1,0,0,100,4,81,1,'V~O',1,null,'BAS')");
$this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'address_country','vtiger_users',1,'1','address_country','Country',1,0,0,100,2,81,1,'V~O',1,null,'BAS')");
+
+//License Details -- START
+//Block84 -- Start
+
+$this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'contact_id','vtiger_licenses',1,'57','contact_id','Contact Name',1,0,0,100,1,17,1,'V~O',1,null,'BAS')");
+ $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'crmid','vtiger_selicensesrel',1,'62','parent_id','Related To',1,0,0,100,2,17,1,'I~O',1,null,'BAS')");
+ $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'title','vtiger_licenses',1,'2','licenses_title','Title',1,0,0,100,3,17,1,'V~M',0,1,'BAS')");
+$this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,4,17,2,'T~O',1,null,'BAS')");
+ $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,5,17,2,'T~O',1,null,'BAS')");
+ $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'filename','vtiger_licenses',1,'61','filename','File',1,0,0,100,4,17,1,'V~O',1,null,'BAS')");
+ $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'licensecontent','vtiger_licenses',1,'19','licensecontent','License',1,0,0,100,5,18,1,'V~O',1,null,'BAS')");
+
+//Block84 -- End
+//License Details -- END
+
//User Image Information
$this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'imagename','vtiger_users',1,'105','imagename','User Image',1,0,0,250,10,83,1,'V~O',1,null,'BAS')");
//user Details End
@@ -930,6 +949,7 @@
$this->db->query("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid','pricebookid')");
$this->db->query("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid','campaignid')");
$this->db->query("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id','id')");
+$this->db->query("insert into vtiger_entityname values(30,'Licenses','vtiger_licenses','title','licensesid','licensesid')");
// Insert End
//Inserting into vtiger_groups table
@@ -2114,7 +2134,7 @@
$this->db->query("insert into vtiger_actionmapping values(3,'Popup',1)");
//Insert values for vtiger_moduleowners vtiger_table which contains the modules and their vtiger_users. default user id admin - after 4.2 patch 2
- $module_array = Array('Potentials','Contacts','Accounts','Leads','Notes','Calendar','Emails','HelpDesk','Products','Faq','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Reports','Campaigns');
+ $module_array = Array('Potentials','Contacts','Accounts','Leads','Notes','Calendar','Emails','HelpDesk','Products','Faq','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Reports','Campaigns','Licenses');
foreach($module_array as $mod)
{
$this->db->query("insert into vtiger_moduleowners values(".getTabid($mod).",1)"); |
|