[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Users/ -> DefaultDataPopulator.php (source)

   1  <?php
   2  
   3  /*********************************************************************************
   4  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   5   * ("License"); You may not use this file except in compliance with the License
   6   * The Original Code is:  vtiger CRM Open Source
   7   * The Initial Developer of the Original Code is vtiger.
   8   * Portions created by vtiger are Copyright (C) vtiger.
   9   * All Rights Reserved.
  10   ********************************************************************************/
  11  
  12  include_once ('config.php');
  13  require_once ('include/logging.php');
  14  require_once ('include/database/PearDatabase.php');
  15  require_once ('data/SugarBean.php');
  16  require_once ('data/CRMEntity.php');
  17  require_once ('include/utils/utils.php');
  18  
  19  /** Class to populate the default required data during installation  
  20   */
  21  
  22  class DefaultDataPopulator extends CRMEntity {
  23          
  24  	function DefaultDataPopulator() {
  25          $this->log = LoggerManager::getLogger('DefaultDataPopulator');
  26          $this->db = new PearDatabase();
  27      }
  28  
  29      var $new_schema = true;
  30  
  31  
  32      /** Function to populate the default required data during installation  
  33       */
  34  	function create_tables () {
  35          global $app_strings;
  36  
  37          $role1_id = $this->db->getUniqueID("vtiger_role");
  38          $role2_id = $this->db->getUniqueID("vtiger_role");
  39          $role3_id = $this->db->getUniqueID("vtiger_role");
  40          $role4_id = $this->db->getUniqueID("vtiger_role");
  41          $role5_id = $this->db->getUniqueID("vtiger_role");
  42  
  43          $profile1_id = $this->db->getUniqueID("vtiger_profile");
  44          $profile2_id = $this->db->getUniqueID("vtiger_profile");
  45          $profile3_id = $this->db->getUniqueID("vtiger_profile");
  46          $profile4_id = $this->db->getUniqueID("vtiger_profile");
  47  
  48                  $this->db->query("insert into vtiger_role values('H".$role1_id."','Organisation','H".$role1_id."',0)");
  49                  $this->db->query("insert into vtiger_role values('H".$role2_id."','CEO','H".$role1_id."::H".$role2_id."',1)");
  50                  $this->db->query("insert into vtiger_role values('H".$role3_id."','Vice President','H".$role1_id."::H".$role2_id."::H".$role3_id."',2)");
  51                  $this->db->query("insert into vtiger_role values('H".$role4_id."','Sales Manager','H".$role1_id."::H".$role2_id."::H".$role3_id."::H".$role4_id."',3)");
  52                  $this->db->query("insert into vtiger_role values('H".$role5_id."','Sales Man','H".$role1_id."::H".$role2_id."::H".$role3_id."::H".$role4_id."::H".$role5_id."',4)");
  53                  
  54  
  55   $this->db->query("INSERT INTO vtiger_tab VALUES (3,'Home',0,1,'Home',null,null,1)");
  56   $this->db->query("INSERT INTO vtiger_tab VALUES (7,'Leads',0,4,'Leads',null,null,1)");
  57   $this->db->query("INSERT INTO vtiger_tab VALUES (6,'Accounts',0,5,'Accounts',null,null,1)");
  58   $this->db->query("INSERT INTO vtiger_tab VALUES (4,'Contacts',0,6,'Contacts',null,null,1)");
  59   $this->db->query("INSERT INTO vtiger_tab VALUES (2,'Potentials',0,7,'Potentials',null,null,1)");
  60   $this->db->query("INSERT INTO vtiger_tab VALUES (8,'Notes',0,9,'Notes',null,null,1)");
  61   $this->db->query("INSERT INTO vtiger_tab VALUES (9,'Calendar',0,3,'Calendar',null,null,1)");
  62   $this->db->query("INSERT INTO vtiger_tab VALUES (10,'Emails',0,10,'Emails',null,null,1)");
  63   $this->db->query("INSERT INTO vtiger_tab VALUES (13,'HelpDesk',0,11,'HelpDesk',null,null,1)");
  64   $this->db->query("INSERT INTO vtiger_tab VALUES (14,'Products',0,8,'Products',null,null,1)");
  65   $this->db->query("INSERT INTO vtiger_tab VALUES (1,'Dashboard',0,12,'Dashboards',null,null,1)");
  66   $this->db->query("INSERT INTO vtiger_tab VALUES (15,'Faq',0,14,'Faq',null,null,1)");
  67   $this->db->query("INSERT INTO vtiger_tab VALUES (16,'Events',2,13,'Events',null,null,1)");
  68   $this->db->query("INSERT INTO vtiger_tab VALUES (18,'Vendors',0,15,'Vendors',null,null,1)");
  69   $this->db->query("INSERT INTO vtiger_tab VALUES (19,'PriceBooks',0,16,'PriceBooks',null,null,1)");
  70   $this->db->query("INSERT INTO vtiger_tab VALUES (20,'Quotes',0,17,'Quotes',null,null,1)");
  71   $this->db->query("INSERT INTO vtiger_tab VALUES (21,'PurchaseOrder',0,18,'PurchaseOrder',null,null,1)");
  72   $this->db->query("INSERT INTO vtiger_tab VALUES (22,'SalesOrder',0,19,'SalesOrder',null,null,1)");
  73   $this->db->query("INSERT INTO vtiger_tab VALUES (23,'Invoice',0,20,'Invoice',null,null,1)");
  74   $this->db->query("INSERT INTO vtiger_tab VALUES (24,'Rss',0,21,'Rss',null,null,1)");
  75   $this->db->query("INSERT INTO vtiger_tab VALUES (25,'Reports',0,22,'Reports',null,null,1)");
  76   $this->db->query("INSERT INTO vtiger_tab VALUES (26,'Campaigns',0,23,'Campaigns',null,null,1)");
  77   $this->db->query("INSERT INTO vtiger_tab VALUES (27,'Portal',0,24,'Portal',null,null,1)");
  78   $this->db->query("INSERT INTO vtiger_tab VALUES (28,'Webmails',0,25,'Webmails',null,null,1)");
  79   $this->db->query("insert into vtiger_tab values (29,'Users',0,26,'Users',null,null,1)");
  80  
  81  // Populate the vtiger_blocks vtiger_table
  82  $this->db->query("insert into vtiger_blocks values (1,2,'LBL_OPPORTUNITY_INFORMATION',1,0,0,0,0,0)");
  83  $this->db->query("insert into vtiger_blocks values (2,2,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
  84  $this->db->query("insert into vtiger_blocks values (3,2,'LBL_DESCRIPTION_INFORMATION',3,0,0,0,0,0)");
  85  $this->db->query("insert into vtiger_blocks values (4,4,'LBL_CONTACT_INFORMATION',1,0,0,0,0,0)");
  86  $this->db->query("insert into vtiger_blocks values (5,4,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
  87  $this->db->query("insert into vtiger_blocks values (6,4,'LBL_CUSTOMER_PORTAL_INFORMATION',3,0,0,0,0,0)");
  88  $this->db->query("insert into vtiger_blocks values (7,4,'LBL_ADDRESS_INFORMATION',4,0,0,0,0,0)");
  89  $this->db->query("insert into vtiger_blocks values (8,4,'LBL_DESCRIPTION_INFORMATION',6,0,0,0,0,0)");
  90  $this->db->query("insert into vtiger_blocks values (9,6,'LBL_ACCOUNT_INFORMATION',1,0,0,0,0,0)");
  91  $this->db->query("insert into vtiger_blocks values (10,6,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
  92  $this->db->query("insert into vtiger_blocks values (11,6,'LBL_ADDRESS_INFORMATION',3,0,0,0,0,0)");
  93  $this->db->query("insert into vtiger_blocks values (12,6,'LBL_DESCRIPTION_INFORMATION',4,0,0,0,0,0)");
  94  $this->db->query("insert into vtiger_blocks values (13,7,'LBL_LEAD_INFORMATION',1,0,0,0,0,0)");
  95  $this->db->query("insert into vtiger_blocks values (14,7,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
  96  $this->db->query("insert into vtiger_blocks values (15,7,'LBL_ADDRESS_INFORMATION',3,0,0,0,0,0)");
  97  $this->db->query("insert into vtiger_blocks values (16,7,'LBL_DESCRIPTION_INFORMATION',4,0,0,0,0,0)");
  98  $this->db->query("insert into vtiger_blocks values (17,8,'LBL_NOTE_INFORMATION',1,0,0,0,0,0)");
  99  $this->db->query("insert into vtiger_blocks values (18,8,'',2,1,0,0,0,0)");
 100  $this->db->query("insert into vtiger_blocks values (19,9,'LBL_TASK_INFORMATION',1,0,0,0,0,0)");
 101  $this->db->query("insert into vtiger_blocks values (20,9,'',2,1,0,0,0,0)");
 102  $this->db->query("insert into vtiger_blocks values (21,10,'LBL_EMAIL_INFORMATION',1,0,0,0,0,0)");
 103  $this->db->query("insert into vtiger_blocks values (22,10,'',2,1,0,0,0,0)");
 104  $this->db->query("insert into vtiger_blocks values (23,10,'',3,1,0,0,0,0)");
 105  $this->db->query("insert into vtiger_blocks values (24,10,'',4,1,0,0,0,0)");
 106  $this->db->query("insert into vtiger_blocks values (25,13,'LBL_TICKET_INFORMATION',1,0,0,0,0,0)");
 107  $this->db->query("insert into vtiger_blocks values (26,13,'',2,1,0,0,0,0)");
 108  $this->db->query("insert into vtiger_blocks values (27,13,'LBL_CUSTOM_INFORMATION',3,0,0,0,0,0)");
 109  $this->db->query("insert into vtiger_blocks values (28,13,'LBL_DESCRIPTION_INFORMATION',4,0,0,0,0,0)");
 110  $this->db->query("insert into vtiger_blocks values (29,13,'LBL_TICKET_RESOLUTION',5,0,0,1,0,0)");
 111  $this->db->query("insert into vtiger_blocks values (30,13,'LBL_COMMENTS',6,0,0,1,0,0)");
 112  $this->db->query("insert into vtiger_blocks values (31,14,'LBL_PRODUCT_INFORMATION',1,0,0,0,0,0)");
 113  $this->db->query("insert into vtiger_blocks values (32,14,'LBL_PRICING_INFORMATION',2,0,0,0,0,0)");
 114  $this->db->query("insert into vtiger_blocks values (33,14,'LBL_STOCK_INFORMATION',3,0,0,0,0,0)");
 115  $this->db->query("insert into vtiger_blocks values (34,14,'LBL_CUSTOM_INFORMATION',4,0,0,0,0,0)");
 116  $this->db->query("insert into vtiger_blocks values (35,14,'LBL_IMAGE_INFORMATION',5,0,0,0,0,0)");
 117  $this->db->query("insert into vtiger_blocks values (36,14,'LBL_DESCRIPTION_INFORMATION',6,0,0,0,0,0)");
 118  $this->db->query("insert into vtiger_blocks values (37,15,'LBL_FAQ_INFORMATION',1,0,0,0,0,0)");
 119  $this->db->query("insert into vtiger_blocks values (38,15,'',2,1,0,0,0,0)");
 120  $this->db->query("insert into vtiger_blocks values (39,15,'',3,1,0,0,0,0)");
 121  $this->db->query("insert into vtiger_blocks values (40,15,'LBL_COMMENT_INFORMATION',4,0,0,1,0,0)");
 122  $this->db->query("insert into vtiger_blocks values (41,16,'LBL_EVENT_INFORMATION',1,0,0,0,0,0)");
 123  $this->db->query("insert into vtiger_blocks values (42,16,'',2,1,0,0,0,0)");
 124  $this->db->query("insert into vtiger_blocks values (43,16,'',3,1,0,0,0,0)");
 125  $this->db->query("insert into vtiger_blocks values (44,18,'LBL_VENDOR_INFORMATION',1,0,0,0,0,0)");
 126  $this->db->query("insert into vtiger_blocks values (45,18,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
 127  $this->db->query("insert into vtiger_blocks values (46,18,'LBL_VENDOR_ADDRESS_INFORMATION',3,0,0,0,0,0)");
 128  $this->db->query("insert into vtiger_blocks values (47,18,'LBL_DESCRIPTION_INFORMATION',4,0,0,0,0,0)");
 129  $this->db->query("insert into vtiger_blocks values (48,19,'LBL_PRICEBOOK_INFORMATION',1,0,0,0,0,0)");
 130  $this->db->query("insert into vtiger_blocks values (49,19,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
 131  $this->db->query("insert into vtiger_blocks values (50,19,'LBL_DESCRIPTION_INFORMATION',3,0,0,0,0,0)");
 132  $this->db->query("insert into vtiger_blocks values (51,20,'LBL_QUOTE_INFORMATION',1,0,0,0,0,0)");
 133  $this->db->query("insert into vtiger_blocks values (52,20,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
 134  $this->db->query("insert into vtiger_blocks values (53,20,'LBL_ADDRESS_INFORMATION',3,0,0,0,0,0)");
 135  $this->db->query("insert into vtiger_blocks values (54,20,'LBL_RELATED_PRODUCTS',4,0,0,0,0,0)");
 136  $this->db->query("insert into vtiger_blocks values (55,20,'LBL_TERMS_INFORMATION',5,0,0,0,0,0)");
 137  $this->db->query("insert into vtiger_blocks values (56,20,'LBL_DESCRIPTION_INFORMATION',6,0,0,0,0,0)");
 138  $this->db->query("insert into vtiger_blocks values (57,21,'LBL_PO_INFORMATION',1,0,0,0,0,0)");
 139  $this->db->query("insert into vtiger_blocks values (58,21,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
 140  $this->db->query("insert into vtiger_blocks values (59,21,'LBL_ADDRESS_INFORMATION',3,0,0,0,0,0)");
 141  $this->db->query("insert into vtiger_blocks values (60,21,'LBL_RELATED_PRODUCTS',4,0,0,0,0,0)");
 142  $this->db->query("insert into vtiger_blocks values (61,21,'LBL_TERMS_INFORMATION',5,0,0,0,0,0)");
 143  $this->db->query("insert into vtiger_blocks values (62,21,'LBL_DESCRIPTION_INFORMATION',6,0,0,0,0,0)");
 144  $this->db->query("insert into vtiger_blocks values (63,22,'LBL_SO_INFORMATION',1,0,0,0,0,0)");
 145  $this->db->query("insert into vtiger_blocks values (64,22,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
 146  $this->db->query("insert into vtiger_blocks values (65,22,'LBL_ADDRESS_INFORMATION',3,0,0,0,0,0)");
 147  $this->db->query("insert into vtiger_blocks values (66,22,'LBL_RELATED_PRODUCTS',4,0,0,0,0,0)");
 148  $this->db->query("insert into vtiger_blocks values (67,22,'LBL_TERMS_INFORMATION',5,0,0,0,0,0)");
 149  $this->db->query("insert into vtiger_blocks values (68,22,'LBL_DESCRIPTION_INFORMATION',6,0,0,0,0,0)");
 150  $this->db->query("insert into vtiger_blocks values (69,23,'LBL_INVOICE_INFORMATION',1,0,0,0,0,0)");
 151  $this->db->query("insert into vtiger_blocks values (70,23,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
 152  $this->db->query("insert into vtiger_blocks values (71,23,'LBL_ADDRESS_INFORMATION',3,0,0,0,0,0)");
 153  $this->db->query("insert into vtiger_blocks values (72,23,'LBL_RELATED_PRODUCTS',4,0,0,0,0,0)");
 154  $this->db->query("insert into vtiger_blocks values (73,23,'LBL_TERMS_INFORMATION',5,0,0,0,0,0)");
 155  $this->db->query("insert into vtiger_blocks values (74,23,'LBL_DESCRIPTION_INFORMATION',6,0,0,0,0,0)");
 156  $this->db->query("insert into vtiger_blocks values (75,4,'LBL_IMAGE_INFORMATION',5,0,0,0,0,0)");
 157  $this->db->query("insert into vtiger_blocks values (76,26,'LBL_CAMPAIGN_INFORMATION',1,0,0,0,0,0)");
 158  $this->db->query("insert into vtiger_blocks values (77,26,'LBL_CUSTOM_INFORMATION',2,0,0,0,0,0)");
 159  $this->db->query("insert into vtiger_blocks values (78,26,'LBL_EXPECTATIONS_AND_ACTUALS',3,0,0,0,0,0)");
 160  $this->db->query("insert into vtiger_blocks values (79,29,'LBL_USERLOGIN_ROLE',1,0,0,0,0,0)");
 161  $this->db->query("insert into vtiger_blocks values (80,29,'LBL_MORE_INFORMATION',2,0,0,0,0,0)");
 162  $this->db->query("insert into vtiger_blocks values (81,29,'LBL_ADDRESS_INFORMATION',3,0,0,0,0,0)");
 163  //Added an extra block for new UI Settings in Campaigns module 
 164  $this->db->query("insert into vtiger_blocks values (82,26,'LBL_DESCRIPTION_INFORMATION',4,0,0,0,0,0)");
 165  $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
 166  
 167  //
 168  
 169  //Account Details -- START
 170   //Block9
 171  
 172  $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'accountname','vtiger_account',1,'2','accountname','Account Name',1,0,0,100,1,9,1,'V~M',0,1,'BAS')");    
 173   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'phone','vtiger_account',1,'11','phone','Phone',1,0,0,100,2,9,1,'V~O',0,2,'BAS')");    
 174   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'website','vtiger_account',1,'17','website','Website',1,0,0,100,3,9,1,'V~O',0,3,'BAS')");    
 175  
 176   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'fax','vtiger_account',1,'1','fax','Fax',1,0,0,100,4,9,1,'V~O',1,null,'BAS')");    
 177   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'tickersymbol','vtiger_account',1,'1','tickersymbol','Ticker Symbol',1,0,0,100,5,9,1,'V~O',1,null,'BAS')");    
 178   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'otherphone','vtiger_account',1,'11','otherphone','Other Phone',1,0,0,100,6,9,1,'V~O',1,null,'ADV')");
 179   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'parentid','vtiger_account',1,'51','account_id','Member Of',1,0,0,100,7,9,1,'I~O',1,null,'BAS')");
 180   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'email1','vtiger_account',1,'13','email1','Email',1,0,0,100,8,9,1,'E~O',1,null,'BAS')");
 181   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'employees','vtiger_account',1,'7','employees','Employees',1,0,0,100,9,9,1,'I~O',1,null,'ADV')");
 182   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'email2','vtiger_account',1,'13','email2','Other Email',1,0,0,100,10,9,1,'E~O',1,null,'ADV')");
 183  
 184   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'ownership','vtiger_account',1,'1','ownership','Ownership',1,0,0,100,11,9,1,'V~O',1,null,'ADV')");
 185   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'rating','vtiger_account',1,'15','rating','Rating',1,0,0,100,12,9,1,'V~O',1,null,'ADV')");
 186   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'industry','vtiger_account',1,'15','industry','industry',1,0,0,100,13,9,1,'V~O',1,null,'ADV')");
 187   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'siccode','vtiger_account',1,'1','siccode','SIC Code',1,0,0,100,14,9,1,'V~O',1,null,'ADV')");
 188   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'account_type','vtiger_account',1,'15','accounttype','Type',1,0,0,100,15,9,1,'V~O',1,null,'ADV')");
 189   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'annualrevenue','vtiger_account',1,'71','annual_revenue','Annual Revenue',1,0,0,100,16,9,1,'I~O',1,null,'ADV')");
 190   //Added vtiger_field emailoptout for vtiger_accounts -- after 4.2 patch2
 191   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'emailoptout','vtiger_account',1,'56','emailoptout','Email Opt Out',1,0,0,100,17,9,1,'C~O',1,null,'ADV')");
 192   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'notify_owner','vtiger_account',1,56,'notify_owner','Notify Owner',1,0,0,10,18,9,1,'C~O',1,NULL,'ADV')");
 193   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,19,9,1,'V~M',1,null,'BAS')");
 194   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,20,9,2,'T~O',1,null,'BAS')");
 195   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,21,9,2,'T~O',1,null,'BAS')");
 196  
 197  
 198  
 199  
 200   //Block 11
 201  $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'street','vtiger_accountbillads',1,'21','bill_street','Billing Address',1,0,0,100,1,11,1,'V~O',1,null,'BAS')");
 202   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'street','vtiger_accountshipads',1,'21','ship_street','Shipping Address',1,0,0,100,2,11,1,'V~O',1,null,'BAS')");
 203  
 204   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'city','vtiger_accountbillads',1,'1','bill_city','Billing City',1,0,0,100,5,11,1,'V~O',1,null,'BAS')");
 205   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'city','vtiger_accountshipads',1,'1','ship_city','Shipping City',1,0,0,100,6,11,1,'V~O',1,null,'BAS')");
 206  
 207   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'state','vtiger_accountbillads',1,'1','bill_state','Billing State',1,0,0,100,7,11,1,'V~O',1,null,'BAS')");
 208   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'state','vtiger_accountshipads',1,'1','ship_state','Shipping State',1,0,0,100,8,11,1,'V~O',1,null,'BAS')");
 209  
 210   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'code','vtiger_accountbillads',1,'1','bill_code','Billing Code',1,0,0,100,9,11,1,'V~O',1,null,'BAS')");
 211   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'code','vtiger_accountshipads',1,'1','ship_code','Shipping Code',1,0,0,100,10,11,1,'V~O',1,null,'BAS')");
 212  
 213  
 214   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'country','vtiger_accountbillads',1,'1','bill_country','Billing Country',1,0,0,100,11,11,1,'V~O',1,null,'BAS')");
 215   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'country','vtiger_accountshipads',1,'1','ship_country','Shipping Country',1,0,0,100,12,11,1,'V~O',1,null,'BAS')");
 216  
 217  $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'pobox','vtiger_accountbillads',1,'1','bill_pobox','Billing Po Box',1,0,0,100,3,11,1,'V~O',1,null,'BAS')");
 218   $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'pobox','vtiger_accountshipads',1,'1','ship_pobox','Shipping Po Box',1,0,0,100,4,11,1,'V~O',1,null,'BAS')");
 219  
 220  
 221   //Block12
 222  $this->db->query("insert into vtiger_field values (6,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,12,1,'V~O',1,null,'BAS')");
 223   
 224  
 225  
 226  //Account Details -- END
 227  
 228              
 229  //Lead Details --- START
 230  
 231  //Block13 -- Start
 232  
 233  $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'salutation','vtiger_leaddetails',1,'55','salutationtype','Salutation',1,0,0,100,1,13,3,'V~O',1,null,'BAS')");    
 234   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'firstname','vtiger_leaddetails',1,'55','firstname','First Name',1,0,0,100,2,13,1,'V~O',0,1,'BAS')");    
 235   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'phone','vtiger_leadaddress',1,'11','phone','Phone',1,0,0,100,3,13,1,'V~O',0,4,'BAS')");    
 236  
 237   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'lastname','vtiger_leaddetails',1,'2','lastname','Last Name',1,0,0,100,4,13,1,'V~M',0,2,'BAS')");    
 238   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'mobile','vtiger_leadaddress',1,'1','mobile','Mobile',1,0,0,100,5,13,1,'V~O',1,null,'BAS')");    
 239   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'company','vtiger_leaddetails',1,'2','company','Company',1,0,0,100,6,13,1,'V~M',0,3,'BAS')");
 240   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'fax','vtiger_leadaddress',1,'1','fax','Fax',1,0,0,100,7,13,1,'V~O',1,null,'BAS')");
 241   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'designation','vtiger_leaddetails',1,'1','designation','Designation',1,0,0,100,8,13,1,'V~O',1,null,'BAS')");
 242   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'email','vtiger_leaddetails',1,'13','email','Email',1,0,0,100,9,13,1,'E~O',0,5,'BAS')");
 243   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'leadsource','vtiger_leaddetails',1,'15','leadsource','Lead Source',1,0,0,100,10,13,1,'V~O',1,null,'BAS')");
 244   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'website','vtiger_leadsubdetails',1,'17','website','Website',1,0,0,100,11,13,1,'V~O',1,null,'ADV')");
 245   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'industry','vtiger_leaddetails',1,'15','industry','Industry',1,0,0,100,12,13,1,'V~O',1,null,'ADV')");
 246   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'leadstatus','vtiger_leaddetails',1,'15','leadstatus','Lead Status',1,0,0,100,13,13,1,'V~O',1,null,'BAS')");
 247   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'annualrevenue','vtiger_leaddetails',1,'71','annualrevenue','Annual Revenue',1,0,0,100,14,13,1,'I~O',1,null,'ADV')");
 248   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'rating','vtiger_leaddetails',1,'15','rating','Rating',1,0,0,100,15,13,1,'V~O',1,null,'ADV')");
 249   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'noofemployees','vtiger_leaddetails',1,'1','noofemployees','No Of Employees',1,0,0,100,16,13,1,'V~O',1,null,'ADV')");
 250   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,17,13,1,'V~M',1,null,'BAS')");
 251   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'yahooid','vtiger_leaddetails',1,'13','yahooid','Yahoo Id',1,0,0,100,18,13,1,'V~O',1,null,'ADV')");
 252  $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,19,13,2,'T~O',1,null,'BAS')");
 253   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,20,13,2,'T~O',1,null,'BAS')");
 254  
 255  //Block13 -- End
 256  
 257  
 258  //Block15 -- Start
 259  
 260  $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'lane','vtiger_leadaddress',1,'21','lane','Street',1,0,0,100,1,15,1,'V~O',1,null,'BAS')");
 261   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'code','vtiger_leadaddress',1,'1','code','Postal Code',1,0,0,100,3,15,1,'V~O',1,null,'BAS')");
 262   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'city','vtiger_leadaddress',1,'1','city','City',1,0,0,100,4,15,1,'V~O',1,null,'BAS')");
 263   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'country','vtiger_leadaddress',1,'1','country','Country',1,0,0,100,5,15,1,'V~O',1,null,'BAS')");
 264   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'state','vtiger_leadaddress',1,'1','state','State',1,0,0,100,6,15,1,'V~O',1,null,'BAS')");
 265   $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'pobox','vtiger_leadaddress',1,'1','pobox','Po Box',1,0,0,100,2,15,1,'V~O',1,null,'BAS')");
 266  
 267  //Block15 --End
 268  
 269  //Block16 -- Start
 270  
 271  $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,16,1,'V~O',1,null,'BAS')");
 272  
 273  //Block16 -- End
 274  
 275  //Lead Details -- END
 276  
 277  
 278  //Contact Details -- START
 279  //Block4 -- Start
 280  
 281  $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'salutation','vtiger_contactdetails',1,'55','salutationtype','Salutation',1,0,0,100,1,4,3,'V~O',1,null,'BAS')");    
 282   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'firstname','vtiger_contactdetails',1,'55','firstname','First Name',1,0,0,100,2,4,1,'V~O',0,1,'BAS')");    
 283   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'phone','vtiger_contactdetails',1,'11','phone','Office Phone',1,0,0,100,3,4,1,'V~O',0,4,'BAS')");    
 284   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'lastname','vtiger_contactdetails',1,'2','lastname','Last Name',1,0,0,100,4,4,1,'V~M',0,2,'BAS')");    
 285   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'mobile','vtiger_contactdetails',1,'1','mobile','Mobile',1,0,0,100,5,4,1,'V~O',1,null,'BAS')");    
 286   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'accountid','vtiger_contactdetails',1,'51','account_id','Account Name',1,0,0,100,6,4,1,'I~O',0,3,'BAS')");    
 287   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'homephone','vtiger_contactsubdetails',1,'11','homephone','Home Phone',1,0,0,100,7,4,1,'V~O',1,null,'ADV')");    
 288   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'leadsource','vtiger_contactsubdetails',1,'15','leadsource','Lead Source',1,0,0,100,8,4,1,'V~O',1,null,'BAS')");    
 289   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'otherphone','vtiger_contactsubdetails',1,'11','otherphone','Phone',1,0,0,100,9,4,1,'V~O',1,null,'ADV')");
 290   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'title','vtiger_contactdetails',1,'1','title','Title',1,0,0,100,10,4,1,'V~O',1,null,'BAS')");
 291   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'fax','vtiger_contactdetails',1,'1','fax','Fax',1,0,0,100,11,4,1,'V~O',1,null,'BAS')");    
 292   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'department','vtiger_contactdetails',1,'1','department','Department',1,0,0,100,12,4,1,'V~O',1,null,'ADV')");
 293   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'birthday','vtiger_contactsubdetails',1,'5','birthday','Birthdate',1,0,0,100,14,4,1,'V~O',1,null,'ADV')");
 294   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'email','vtiger_contactdetails',1,'13','email','Email',1,0,0,100,15,4,1,'E~O',0,5,'BAS')");
 295   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'reportsto','vtiger_contactdetails',1,'57','contact_id','Reports To',1,0,0,100,16,4,1,'V~O',1,null,'ADV')");
 296   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'assistant','vtiger_contactsubdetails',1,'1','assistant','Assistant',1,0,0,100,17,4,1,'V~O',1,null,'ADV')");
 297   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'yahooid','vtiger_contactdetails',1,'13','yahooid','Yahoo Id',1,0,0,100,18,4,1,'V~O',1,null,'ADV')");
 298   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'assistantphone','vtiger_contactsubdetails',1,'11','assistantphone','Assistant Phone',1,0,0,100,19,4,1,'V~O',1,null,'ADV')");
 299   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'donotcall','vtiger_contactdetails',1,'56','donotcall','Do Not Call',1,0,0,100,20,4,1,'C~O',1,null,'ADV')");
 300   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'emailoptout','vtiger_contactdetails',1,'56','emailoptout','Email Opt Out',1,0,0,100,21,4,1,'C~O',1,null,'ADV')");
 301   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,22,4,1,'V~M',1,null,'BAS')");
 302   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'reference','vtiger_contactdetails',1,'56','reference','Reference',1,0,0,10,23,4,1,'C~O',1,null,'ADV')");
 303   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'notify_owner','vtiger_contactdetails',1,'56','notify_owner','Notify Owner',1,0,0,10,24,4,1,'C~O',1,null,'ADV')");
 304   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,25,4,2,'T~O',1,null,'BAS')");
 305   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,26,4,2,'T~O',1,null,'BAS')");
 306  
 307  //Block4 -- End
 308  
 309  //Block6 - Begin Customer Portal
 310  
 311  $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'portal','vtiger_customerdetails',1,'56','portal','Portal User',1,0,0,100,1,6,1,'C~O',1,null,'ADV')");
 312  $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'support_start_date','vtiger_customerdetails',1,'5','support_start_date','Support Start Date',1,0,0,100,2,6,1,'D~O',1,null,'ADV')");
 313  $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'support_end_date','vtiger_customerdetails',1,'5','support_end_date','Support End Date',1,0,0,100,3,6,1,'D~O~OTH~GE~support_start_date~Support Start Date',1,null,'ADV')");
 314  
 315  //Block6 - End Customer Portal
 316  
 317  //Block 7 -- Start
 318  
 319  $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'mailingstreet','vtiger_contactaddress',1,'21','mailingstreet','Mailing Street',1,0,0,100,1,7,1,'V~O',1,null,'BAS')");
 320   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'otherstreet','vtiger_contactaddress',1,'21','otherstreet','Other Street',1,0,0,100,2,7,1,'V~O',1,null,'BAS')");
 321   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'mailingcity','vtiger_contactaddress',1,'1','mailingcity','Mailing City',1,0,0,100,5,7,1,'V~O',1,null,'BAS')");
 322   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'othercity','vtiger_contactaddress',1,'1','othercity','Other City',1,0,0,100,6,7,1,'V~O',1,null,'BAS')");
 323   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'mailingstate','vtiger_contactaddress',1,'1','mailingstate','Mailing State',1,0,0,100,7,7,1,'V~O',1,null,'BAS')");
 324   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'otherstate','vtiger_contactaddress',1,'1','otherstate','Other State',1,0,0,100,8,7,1,'V~O',1,null,'BAS')");
 325   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'mailingzip','vtiger_contactaddress',1,'1','mailingzip','Mailing Zip',1,0,0,100,9,7,1,'V~O',1,null,'BAS')");
 326   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'otherzip','vtiger_contactaddress',1,'1','otherzip','Other Zip',1,0,0,100,10,7,1,'V~O',1,null,'BAS')");
 327   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'mailingcountry','vtiger_contactaddress',1,'1','mailingcountry','Mailing Country',1,0,0,100,11,7,1,'V~O',1,null,'BAS')");
 328   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'othercountry','vtiger_contactaddress',1,'1','othercountry','Other Country',1,0,0,100,12,7,1,'V~O',1,null,'BAS')");
 329  $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'mailingpobox','vtiger_contactaddress',1,'1','mailingpobox','Mailing Po Box',1,0,0,100,3,7,1,'V~O',1,null,'BAS')");
 330   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'otherpobox','vtiger_contactaddress',1,'1','otherpobox','Other Po Box',1,0,0,100,4,7,1,'V~O',1,null,'BAS')");
 331  //Block7 -- End
 332  
 333  //ContactImageInformation
 334   $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'imagename','vtiger_contactdetails',1,'69','imagename','Contact Image',1,0,0,100,1,75,1,'V~O',1,null,'ADV')");
 335  
 336  
 337  //Block8 -- Start
 338  $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,8,1,'V~O',1,null,'BAS')");
 339  //Block8 -- End
 340  //Contact Details -- END
 341  
 342  
 343  //Potential Details -- START
 344  //Block1 -- Start
 345  
 346  $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'potentialname','vtiger_potential',1,'2','potentialname','Potential Name',1,0,0,100,1,1,1,'V~M',0,1,'BAS')");    
 347   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'amount','vtiger_potential',1,71,'amount','Amount',1,0,0,100,2,1,1,'N~O',0,5,'BAS')");    
 348   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'accountid','vtiger_potential',1,'50','account_id','Account Name',1,0,0,100,3,1,1,'V~M',0,2,'BAS')");    
 349   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'closingdate','vtiger_potential',1,'23','closingdate','Expected Close Date',1,0,0,100,5,1,1,'D~M',0,3,'BAS')");    
 350   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'potentialtype','vtiger_potential',1,'15','opportunity_type','Type',1,0,0,100,6,1,1,'V~O',1,null,'BAS')");    
 351   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'nextstep','vtiger_potential',1,'1','nextstep','Next Step',1,0,0,100,7,1,1,'V~O',1,null,'BAS')");
 352   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'leadsource','vtiger_potential',1,'15','leadsource','Lead Source',1,0,0,100,8,1,1,'V~O',1,null,'BAS')");    
 353   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'sales_stage','vtiger_potential',1,'16','sales_stage','Sales Stage',1,0,0,100,9,1,1,'V~O',0,4,'BAS')");
 354   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,10,1,1,'V~M',1,null,'BAS')");
 355   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'probability','vtiger_potential',1,'9','probability','Probability',1,0,0,100,11,1,1,'N~O',1,null,'BAS')");
 356   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'campaignid','vtiger_potential',1,'58','campaignid','Campaign Source',1,0,0,100,12,1,1,'N~O',1,null,'BAS')");
 357  $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,13,1,2,'T~O',1,null,'BAS')");
 358   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,14,1,2,'T~O',1,null,'BAS')");
 359  
 360  //Block1 -- End
 361  
 362  //Block3 -- Start
 363  
 364   $this->db->query("insert into vtiger_field values (2,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,3,1,'V~O',1,null,'BAS')");
 365  
 366  //Block3 -- End
 367  //Potential Details -- END
 368  
 369  
 370  //campaign entries being added
 371  
 372  
 373   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'campaignname','vtiger_campaign',1,'2','campaignname','Campaign Name',1,0,0,100,1,76,1,'V~M',0,1,'BAS')");
 374   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'campaigntype','vtiger_campaign',1,15,'campaigntype','Campaign Type',1,0,0,100,5,76,1,'V~O',0,3,'BAS')");
 375   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'product_id','vtiger_campaign',1,59,'product_id','Product',1,0,0,100,4,76,1,'I~O',0,5,'BAS')");
 376   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'campaignstatus','vtiger_campaign',1,15,'campaignstatus','Campaign Status',1,0,0,100,2,76,1,'V~O',0,6,'BAS')");
 377   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'closingdate','vtiger_campaign',1,'23','closingdate','Expected Close Date',1,0,0,100,6,76,1,'D~M',0,2,'BAS')");
 378   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,3,76,1,'V~M',1,null,'BAS')");
 379   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'numsent','vtiger_campaign',1,'9','numsent','Num Sent',1,0,0,100,10,76,1,'N~O',1,null,'BAS')");
 380  $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'sponsor','vtiger_campaign',1,'1','sponsor','Sponsor',1,0,0,100,9,76,1,'V~O',1,null,'BAS')");
 381  $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'targetaudience','vtiger_campaign',1,'1','targetaudience','Target Audience',1,0,0,100,7,76,1,'V~O',1,null,'BAS')");
 382  $this->db->query("insert into vtiger_field values(26,".$this->db->getUniqueID("vtiger_field").",'targetsize','vtiger_campaign',1,'1','targetsize','TargetSize',1,0,0,100,8,76,1,'N~O',1,null,'BAS')");
 383  $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,11,76,2,'T~O',1,null,'BAS')");
 384   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,12,76,2,'T~O',1,null,'BAS')");
 385  
 386  $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'expectedresponse','vtiger_campaign',1,'15','expectedresponse','Expected Response',1,0,0,100,3,78,1,'V~O',0,4,'BAS')");
 387   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'expectedrevenue','vtiger_campaign',1,'1','expectedrevenue','Expected Revenue',1,0,0,100,4,78,1,'I~O',1,null,'BAS')");
 388   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'budgetcost','vtiger_campaign',1,'1','budgetcost','Budget Cost',1,0,0,100,1,78,1,'I~O',1,null,'BAS')");
 389   $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'actualcost','vtiger_campaign',1,'1','actualcost','Actual Cost',1,0,0,100,2,78,1,'I~O',1,null,'BAS')");
 390  $this->db->query("insert into vtiger_field values(26,".$this->db->getUniqueID("vtiger_field").",'expectedresponsecount','vtiger_campaign',1,'1','expectedresponsecount','Expected Response Count',1,0,0,100,7,78,1,'N~O',1,null,'BAS')");
 391  $this->db->query("insert into vtiger_field values(26,".$this->db->getUniqueID("vtiger_field").",'expectedsalescount','vtiger_campaign',1,'1','expectedsalescount','Expected Sales Count',1,0,0,100,5,78,1,'N~O',1,null,'BAS')");
 392  $this->db->query("insert into vtiger_field values(26,".$this->db->getUniqueID("vtiger_field").",'expectedroi','vtiger_campaign',1,'1','expectedroi','Expected ROI',1,0,0,100,9,78,1,'N~O',1,null,'BAS')");
 393  $this->db->query("insert into vtiger_field values(26,".$this->db->getUniqueID("vtiger_field").",'actualresponsecount','vtiger_campaign',1,'1','actualresponsecount','Actual Response Count',1,0,0,100,8,78,1,'N~O',1,null,'BAS')");
 394  $this->db->query("insert into vtiger_field values(26,".$this->db->getUniqueID("vtiger_field").",'actualsalescount','vtiger_campaign',1,'1','actualsalescount','Actual Sales Count',1,0,0,100,6,78,1,'N~O',1,null,'BAS')");
 395  $this->db->query("insert into vtiger_field values(26,".$this->db->getUniqueID("vtiger_field").",'actualroi','vtiger_campaign',1,'1','actualroi','Actual ROI',1,0,0,100,10,78,1,'N~O',1,null,'BAS')");
 396  
 397  $this->db->query("insert into vtiger_field values (26,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,82,1,'V~O',1,null,'BAS')");
 398  //Campaign entries end
 399  
 400  
 401  //Ticket Details -- START
 402  //Block25 -- Start
 403  
 404   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,2,25,1,'V~M',1,null,'BAS')");
 405   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'parent_id','vtiger_troubletickets',1,'68','parent_id','Related To',1,0,0,100,4,25,1,'I~O',1,null,'BAS')");
 406   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'priority','vtiger_troubletickets',1,'15','ticketpriorities','Priority',1,0,0,100,5,25,1,'V~O',0,4,'BAS')");
 407   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'product_id','vtiger_troubletickets',1,'59','product_id','Product Name',1,0,0,100,6,25,1,'I~O',1,null,'BAS')");
 408   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'severity','vtiger_troubletickets',1,'15','ticketseverities','Severity',1,0,0,100,7,25,1,'V~O',1,null,'BAS')");
 409   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'status','vtiger_troubletickets',1,'111','ticketstatus','Status',1,0,0,100,8,25,1,'V~O',1,null,'BAS')");
 410   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'category','vtiger_troubletickets',1,'15','ticketcategories','Category',1,0,0,100,9,25,1,'V~O',1,null,'BAS')");
 411   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'update_log','vtiger_troubletickets',1,'15','update_log','Update History',1,0,0,100,9,25,3,'V~O',1,null,'BAS')");
 412  $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,10,25,2,'T~O',1,null,'BAS')");
 413   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,11,25,2,'T~O',1,null,'BAS')");
 414   //Added on 26-12-2005 to add attachment in ticket editview
 415   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'filename','vtiger_attachments',1,'61','filename','Attachment',1,0,0,100,12,25,1,'V~O',0,3,'BAS')");
 416  
 417   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'title','vtiger_troubletickets',1,'22','ticket_title','Title',1,0,0,100,1,26,1,'V~M',0,1,'BAS')");
 418   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_troubletickets',1,'19','description','Description',1,0,0,100,1,28,1,'V~O',0,2,'BAS')");
 419   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'solution','vtiger_troubletickets',1,'19','solution','Solution',1,0,0,100,1,29,1,'V~O',1,null,'BAS')");
 420   $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'comments','vtiger_ticketcomments',1,'19','comments','Add Comment',1,0,0,100,1,30,1,'V~O',1,null,'BAS')");
 421  
 422  //Block25-30 -- End
 423  //Ticket Details -- END
 424  
 425  //Product Details -- START
 426  //Block31-36 -- Start
 427  
 428  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productname','vtiger_products',1,'2','productname','Product Name',1,0,0,100,1,31,1,'V~M',1,null,'BAS')");
 429   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcode','vtiger_products',1,'1','productcode','Product Code',1,0,0,100,2,31,1,'V~O',1,null,'BAS')");
 430   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'discontinued','vtiger_products',1,'56','discontinued','Product Active',1,0,0,100,3,31,1,'V~O',1,null,'BAS')");
 431   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'manufacturer','vtiger_products',1,'15','manufacturer','Manufacturer',1,0,0,100,4,31,1,'V~O',1,null,'BAS')");
 432   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcategory','vtiger_products',1,'15','productcategory','Product Category',1,0,0,100,4,31,1,'V~O',1,null,'BAS')");
 433  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'sales_start_date','vtiger_products',1,'5','sales_start_date','Sales Start Date',1,0,0,100,5,31,1,'D~O',1,null,'BAS')");
 434   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'sales_end_date','vtiger_products',1,'5','sales_end_date','Sales End Date',1,0,0,100,6,31,1,'D~O~OTH~GE~sales_start_date~Sales Start Date',1,null,'BAS')");
 435   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'start_date','vtiger_products',1,'5','start_date','Support Start Date',1,0,0,100,7,31,1,'D~O',1,null,'BAS')");
 436   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'expiry_date','vtiger_products',1,'5','expiry_date','Support Expiry Date',1,0,0,100,8,31,1,'D~O~OTH~GE~start_date~Start Date',1,null,'BAS')");
 437   
 438  
 439   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'crmid','vtiger_seproductsrel',1,'66','parent_id','Related To',1,0,0,100,10,31,1,'I~O',1,null,'BAS')");
 440  
 441   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'contactid','vtiger_products',1,'57','contact_id','Contact Name',1,0,0,100,11,31,1,'I~O',1,null,'BAS')");
 442   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'website','vtiger_products',1,'17','website','Website',1,0,0,100,12,31,1,'V~O',1,null,'BAS')");
 443   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'vendor_id','vtiger_products',1,'75','vendor_id','Vendor Name',1,0,0,100,13,31,1,'I~O',1,null,'BAS')");
 444  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'mfr_part_no','vtiger_products',1,'1','mfr_part_no','Mfr PartNo',1,0,0,100,14,31,1,'V~O',1,null,'BAS')");
 445   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'vendor_part_no','vtiger_products',1,'1','vendor_part_no','Vendor PartNo',1,0,0,100,15,31,1,'V~O',1,null,'BAS')");
 446   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'serialno','vtiger_products',1,'1','serial_no','Serial No',1,0,0,100,16,31,1,'V~O',1,null,'BAS')");
 447  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productsheet','vtiger_products',1,'1','productsheet','Product Sheet',1,0,0,100,17,31,1,'V~O',1,null,'BAS')");
 448   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'glacct','vtiger_products',1,'15','glacct','GL Account',1,0,0,100,18,31,1,'V~O',1,null,'BAS')");
 449  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,19,31,2,'T~O',1,null,'BAS')");
 450   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,20,31,2,'T~O',1,null,'BAS')");
 451  
 452  
 453  //Block32 Pricing Information
 454  
 455  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'unit_price','vtiger_products',1,'71','unit_price','Unit Price',1,0,0,100,1,32,1,'N~O',1,null,'BAS')"); 
 456   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'commissionrate','vtiger_products',1,'9','commissionrate','Commission Rate',1,0,0,100,2,32,1,'N~O',1,null,'BAS')"); 
 457   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'taxclass','vtiger_producttaxrel',1,'83','taxclass','Tax Class',1,0,0,100,4,32,1,'V~O',1,null,'BAS')");
 458  
 459  
 460  //Block 33 stock info
 461  
 462   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'usageunit','vtiger_products',1,'15','usageunit','Usage Unit',1,0,0,100,1,33,1,'V~O',1,null,'ADV')");
 463   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'qty_per_unit','vtiger_products',1,'1','qty_per_unit','Qty/Unit',1,0,0,100,2,33,1,'N~O',1,null,'ADV')");
 464   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'qtyinstock','vtiger_products',1,'1','qtyinstock','Qty In Stock',1,0,0,100,3,33,1,'I~O',1,null,'ADV')");
 465  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'reorderlevel','vtiger_products',1,'1','reorderlevel','Reorder Level',1,0,0,100,4,33,1,'I~O',1,null,'ADV')");
 466   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'handler','vtiger_products',1,'52','assigned_user_id','Handler',1,0,0,100,5,33,1,'I~O',1,null,'ADV')");
 467   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'qtyindemand','vtiger_products',1,'1','qtyindemand','Qty In Demand',1,0,0,100,6,33,1,'I~O',1,null,'ADV')");
 468  
 469  
 470  //ProductImageInformation
 471  
 472   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'imagename','vtiger_products',1,'69','imagename','Product Image',1,0,0,100,1,35,1,'V~O',1,null,'ADV')");
 473  
 474  
 475  //Block 36 Description Info
 476   $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'product_description','vtiger_products',1,'19','product_description','Description',1,0,0,100,1,36,1,'V~O',1,null,'BAS')");
 477  
 478  //Product Details -- END
 479  
 480  //Note Details -- START
 481  //Block17 -- Start
 482  
 483  $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'contact_id','vtiger_notes',1,'57','contact_id','Contact Name',1,0,0,100,1,17,1,'V~O',1,null,'BAS')");
 484   $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'crmid','vtiger_senotesrel',1,'62','parent_id','Related To',1,0,0,100,2,17,1,'I~O',1,null,'BAS')");
 485   $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'title','vtiger_notes',1,'2','notes_title','Title',1,0,0,100,3,17,1,'V~M',0,1,'BAS')");
 486  $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')");
 487   $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')");
 488   $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'filename','vtiger_notes',1,'61','filename','File',1,0,0,100,4,17,1,'V~O',1,null,'BAS')");
 489   $this->db->query("insert into vtiger_field values (8,".$this->db->getUniqueID("vtiger_field").",'notecontent','vtiger_notes',1,'19','notecontent','Note',1,0,0,100,5,18,1,'V~O',1,null,'BAS')");
 490  
 491  //Block17 -- End
 492  //Note Details -- END
 493  
 494  //Email Details -- START
 495  //Block21 -- Start
 496  
 497      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'date_start','vtiger_activity',1,'6','date_start','Date & Time Sent',1,0,0,100,1,21,1,'DT~M~time_start~Time Start',1,null,'BAS')");
 498      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'semodule','vtiger_activity',1,'2','parent_type','Sales Enity Module',1,0,0,100,2,21,3,'',1,null,'BAS')");
 499      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'activitytype','vtiger_activity',1,'2','activitytype','Activtiy Type',1,0,0,100,3,21,3,'V~O',1,null,'BAS')");
 500      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'crmid','vtiger_seactivityrel',1,'357','parent_id','Related To',1,0,0,100,1,22,1,'I~O',1,null,'BAS')");
 501      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,5,21,1,'V~M',1,null,'BAS')");
 502      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_activity',1,'2','subject','Subject',1,0,0,100,1,23,1,'V~M',1,null,'BAS')");
 503      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'filename','vtiger_attachments',1,'61','filename','Attachment',1,0,0,100,2,23,1,'V~O',1,null,'BAS')");
 504      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,24,1,'V~O',1,null,'BAS')");
 505      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'time_start','vtiger_activity',1,'2','time_start','Time Start',1,0,0,100,9,23,1,'T~O',1,null,'BAS')");
 506      $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,10,22,1,'T~O',1,null,'BAS')");
 507       $this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,11,21,2,'T~O',1,null,'BAS')");
 508  
 509  //Block21 -- End
 510  //Email Details -- END
 511  
 512  //Task Details --START
 513  //Block19 -- Start
 514  $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_activity',1,'2','subject','Subject',1,0,0,100,1,19,1,'V~M',0,1,'BAS')");
 515   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,2,19,1,'V~M',1,null,'BAS')");
 516   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'date_start','vtiger_activity',1,'6','date_start','Start Date & Time',1,0,0,100,3,19,1,'DT~M~time_start',0,2,'BAS')");
 517   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'time_start','vtiger_activity',1,'2','time_start','Time Start',1,0,0,100,4,19,3,'T~O',1,null,'BAS')");
 518   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'time_end','vtiger_activity',1,'2','time_end','End Time',1,0,0,100,4,19,3,'T~O',1,null,'BAS')");
 519   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'due_date','vtiger_activity',1,'23','due_date','Due Date',1,0,0,100,5,19,1,'D~M~OTH~GE~date_start~Start Date & Time',1,null,'BAS')");
 520   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'crmid','vtiger_seactivityrel',1,'66','parent_id','Related To',1,0,0,100,7,19,1,'I~O',1,null,'BAS')");
 521   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'contactid','vtiger_cntactivityrel',1,'57','contact_id','Contact Name',1,0,0,100,8,19,1,'I~O',1,null,'BAS')");
 522   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'status','vtiger_activity',1,'111','taskstatus','Status',1,0,0,100,9,19,1,'V~O',0,3,'BAS')");
 523   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'eventstatus','vtiger_activity',1,'111','eventstatus','Status',1,0,0,100,9,19,3,'V~O',1,null,'BAS')");
 524   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'priority','vtiger_activity',1,'15','taskpriority','Priority',1,0,0,100,10,19,1,'V~O',1,null,'BAS')");
 525   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'sendnotification','vtiger_activity',1,'56','sendnotification','Send Notification',1,0,0,100,11,19,1,'C~O',1,null,'BAS')");
 526  $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,14,19,2,'T~O',1,null,'BAS')");
 527   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,15,19,2,'T~O',1,null,'BAS')");
 528   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'activitytype','vtiger_activity',1,'15','activitytype','Activity Type',1,0,0,100,16,19,3,'V~O',1,null,'BAS')");
 529   $this->db->query("Insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'visibility','vtiger_activity',1,15,'visibility','Visibility',1,0,0,100,17,19,3,'V~O',1,null,'BAS')");
 530  
 531   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,20,1,'V~O',1,null,'BAS')");
 532  
 533  
 534  $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'duration_hours','vtiger_activity',1,'63','duration_hours','Duration',1,0,0,100,17,19,3,'T~O',1,null,'BAS')");
 535   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'duration_minutes','vtiger_activity',1,'15','duration_minutes','Duration Minutes',1,0,0,100,18,19,3,'T~O',1,null,'BAS')");
 536   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'location','vtiger_activity',1,'1','location','Location',1,0,0,100,19,19,3,'V~O',1,null,'BAS')");
 537   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'reminder_time','vtiger_activity_reminder',1,'30','reminder_time','Send Reminder',1,0,0,100,1,19,3,'I~O',1,null,'BAS')");
 538   
 539   $this->db->query("insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'recurringtype','vtiger_recurringevents',1,'15','recurringtype','Recurrence',1,0,0,100,6,19,3,'O~O',1,null,'BAS')");
 540  
 541   $this->db->query("Insert into vtiger_field values (9,".$this->db->getUniqueID("vtiger_field").",'notime','vtiger_activity',1,56,'notime','No Time',1,0,0,100,20,19,3,'C~O',1,null,'BAS')");
 542  //Block19 -- End
 543  //Task Details -- END
 544  
 545  //Event Details --START
 546  //Block41-43-- Start
 547   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_activity',1,'2','subject','Subject',1,0,0,100,1,41,1,'V~M',0,1,'BAS')");
 548   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,2,41,1,'V~M',1,null,'BAS')");
 549   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'date_start','vtiger_activity',1,'6','date_start','Start Date & Time',1,0,0,100,3,41,1,'DT~M~time_start',0,2,'BAS')");
 550   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'time_start','vtiger_activity',1,'2','time_start','Time Start',1,0,0,100,4,41,3,'T~M',1,null,'BAS')");
 551  
 552   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'due_date','vtiger_activity',1,'23','due_date','End Date',1,0,0,100,5,41,1,'D~M~OTH~GE~date_start~Start Date & Time',0,5,'BAS')");
 553   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'time_end','vtiger_activity',1,'2','time_end','End Time',1,0,0,100,5,41,3,'T~M',1,null,'BAS')");
 554   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'recurringtype','vtiger_recurringevents',1,'15','recurringtype','Recurrence',1,0,0,100,6,41,1,'O~O',1,null,'BAS')");
 555    
 556   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'duration_hours','vtiger_activity',1,'63','duration_hours','Duration',1,0,0,100,7,41,1,'I~M',1,null,'BAS')");
 557   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'duration_minutes','vtiger_activity',1,'15','duration_minutes','Duration Minutes',1,0,0,100,8,41,3,'O~O',1,null,'BAS')");
 558   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'crmid','vtiger_seactivityrel',1,'66','parent_id','Related To',1,0,0,100,9,41,1,'I~O',1,null,'BAS')");
 559   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'eventstatus','vtiger_activity',1,'111','eventstatus','Status',1,0,0,100,10,41,1,'V~O',0,3,'BAS')");
 560   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'sendnotification','vtiger_activity',1,'56','sendnotification','Send Notification',1,0,0,100,11,41,1,'C~O',1,null,'BAS')");
 561   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'activitytype','vtiger_activity',1,'15','activitytype','Activity Type',1,0,0,100,12,41,1,'V~O',0,4,'BAS')");
 562   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'location','vtiger_activity',1,'1','location','Location',1,0,0,100,13,41,1,'V~O',1,null,'BAS')");
 563   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,14,41,2,'T~O',1,null,'BAS')");
 564   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,15,41,2,'T~O',1,null,'BAS')");
 565   $this->db->query("Insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'priority','vtiger_activity',1,15,'taskpriority','Priority',1,0,0,100,16,41,1,'V~O',1,null,'BAS')");
 566   $this->db->query("Insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'notime','vtiger_activity',1,56,'notime','No Time',1,0,0,100,17,41,1,'C~O',1,null,'BAS')");
 567   $this->db->query("Insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'visibility','vtiger_activity',1,15,'visibility','Visibility',1,0,0,100,18,41,1,'V~O',1,null,'BAS')");
 568   
 569   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,43,1,'V~O',1,null,'BAS')");
 570   $this->db->query("insert into vtiger_field values (16,".$this->db->getUniqueID("vtiger_field").",'reminder_time','vtiger_activity_reminder',1,'30','reminder_time','Send Reminder',1,0,0,100,1,42,1,'I~O',1,null,'BAS')");
 571  //Block41-43 -- End
 572  //Event Details -- END
 573  
 574  //Faq Details -- START
 575  //Block37-40 -- Start
 576  
 577  $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'product_id','vtiger_faq',1,'59','product_id','Product Name',1,0,0,100,1,37,1,'I~O',1,null,'BAS')");
 578   $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'category','vtiger_faq',1,'15','faqcategories','Category',1,0,0,100,2,37,1,'V~O',1,null,'BAS')");
 579   $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'status','vtiger_faq',1,'111','faqstatus','Status',1,0,0,100,3,37,1,'V~O',1,null,'BAS')");
 580   $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'question','vtiger_faq',1,'20','question','Question',1,0,0,100,1,38,1,'V~M',1,null,'BAS')");
 581   $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'answer','vtiger_faq',1,'20','faq_answer','Answer',1,0,0,100,1,39,1,'V~M',1,null,'BAS')");
 582   $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'comments','vtiger_faqcomments',1,'19','comments','Add Comment',1,0,0,100,1,40,1,'V~O',1,null,'BAS')");
 583  $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,3,37,2,'T~O',1,null,'BAS')");
 584   $this->db->query("insert into vtiger_field values (15,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,4,37,2,'T~O',1,null,'BAS')");
 585  
 586  
 587  //Block37-40 -- End
 588  //Ticket Details -- END
 589  
 590  //Vendor Details --START
 591  //Block44-47
 592  
 593  $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'vendorname','vtiger_vendor',1,'2','vendorname','Vendor Name',1,0,0,100,1,44,1,'V~M',0,1,'BAS')");
 594   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'phone','vtiger_vendor',1,'1','phone','Phone',1,0,0,100,3,44,1,'V~O',0,2,'BAS')");
 595   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'email','vtiger_vendor',1,'13','email','Email',1,0,0,100,4,44,1,'E~O',0,3,'BAS')");
 596   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'website','vtiger_vendor',1,'17','website','Website',1,0,0,100,5,44,1,'V~O',1,null,'BAS')");
 597   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'glacct','vtiger_vendor',1,'15','glacct','GL Account',1,0,0,100,6,44,1,'V~O',1,null,'BAS')");
 598   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'category','vtiger_vendor',1,'1','category','Category',1,0,0,100,7,44,1,'V~O',1,null,'BAS')");
 599  $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,8,44,2,'T~O',1,null,'BAS')");
 600   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,9,44,2,'T~O',1,null,'BAS')");
 601  
 602  //Block 46
 603  
 604  $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'street','vtiger_vendor',1,'21','street','Street',1,0,0,100,1,46,1,'V~O',1,null,'ADV')");
 605   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'pobox','vtiger_vendor',1,'1','pobox','Po Box',1,0,0,100,2,46,1,'V~O',1,null,'ADV')");
 606   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'city','vtiger_vendor',1,'1','city','City',1,0,0,100,3,46,1,'V~O',1,null,'ADV')");
 607   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'state','vtiger_vendor',1,'1','state','State',1,0,0,100,4,46,1,'V~O',1,null,'ADV')");
 608   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'postalcode','vtiger_vendor',1,'1','postalcode','Postal Code',1,0,0,100,5,46,1,'V~O',1,null,'ADV')");
 609   $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'country','vtiger_vendor',1,'1','country','Country',1,0,0,100,6,46,1,'V~O',1,null,'ADV')");
 610  
 611  //Block 47
 612  
 613  $this->db->query("insert into vtiger_field values (18,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,47,1,'V~O',1,null,'ADV')");
 614  
 615  //Vendor Details -- END
 616  
 617  //PriceBook Details Start
 618  //Block48
 619  
 620  $this->db->query("insert into vtiger_field values (19,".$this->db->getUniqueID("vtiger_field").",'bookname','vtiger_pricebook',1,'2','bookname','Price Book Name',1,0,0,100,1,48,1,'V~M',0,1,'BAS')");
 621   $this->db->query("insert into vtiger_field values (19,".$this->db->getUniqueID("vtiger_field").",'active','vtiger_pricebook',1,'56','active','Active',1,0,0,100,3,48,1,'V~O',0,2,'BAS')");
 622  $this->db->query("insert into vtiger_field values (19,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,4,48,2,'T~O',1,null,'BAS')");
 623   $this->db->query("insert into vtiger_field values (19,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,5,48,2,'T~O',1,null,'BAS')");
 624  
 625  //Block50
 626  
 627  $this->db->query("insert into vtiger_field values (19,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,50,1,'V~O',1,null,'BAS')");
 628  
 629  //PriceBook Details End
 630  
 631  
 632  //Quote Details -- START
 633   //Block51
 634  
 635  $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_quotes',1,'2','subject','Subject',1,0,0,100,1,51,1,'V~M',1,null,'BAS')");    
 636   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'potentialid','vtiger_quotes',1,'76','potential_id','Potential Name',1,0,0,100,2,51,1,'I~O',1,null,'BAS')");    
 637   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'quotestage','vtiger_quotes',1,'111','quotestage','Quote Stage',1,0,0,100,3,51,1,'V~O',1,null,'BAS')");    
 638  
 639   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'validtill','vtiger_quotes',1,'5','validtill','Valid Till',1,0,0,100,4,51,1,'D~O',1,null,'BAS')");    
 640   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'team','vtiger_quotes',1,'1','team','Team',1,0,0,100,5,51,1,'V~O',1,null,'BAS')");    
 641   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'contactid','vtiger_quotes',1,'57','contact_id','Contact Name',1,0,0,100,6,51,1,'V~O',1,null,'BAS')");
 642   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'carrier','vtiger_quotes',1,'15','carrier','Carrier',1,0,0,100,8,51,1,'V~O',1,null,'BAS')");
 643   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'subtotal','vtiger_quotes',1,'1','hdnSubTotal','Sub Total',1,0,0,100,9,51,3,'N~O',1,null,'BAS')");
 644   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'shipping','vtiger_quotes',1,'1','shipping','Shipping',1,0,0,100,10,51,1,'V~O',1,null,'BAS')");
 645  
 646   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'inventorymanager','vtiger_quotes',1,'77','assigned_user_id1','Inventory Manager',1,0,0,100,11,51,1,'I~O',1,null,'BAS')");
 647   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'tax','vtiger_quotes',1,'1','txtTax','Tax',1,0,0,100,13,51,3,'N~O',1,null,'BAS')");
 648   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'adjustment','vtiger_quotes',1,'1','txtAdjustment','Adjustment',1,0,0,100,20,51,3,'NN~O',1,null,'BAS')");
 649   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'total','vtiger_quotes',1,'1','hdnGrandTotal','Total',1,0,0,100,14,51,3,'N~O',1,null,'BAS')");
 650  //Added fields taxtype, discount percent, discount amount and S&H amount for Tax process
 651   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'taxtype','vtiger_quotes',1,'15','hdnTaxType','Tax Type',1,0,0,100,14,51,3,'V~O',1,null,'BAS')");
 652   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'discount_percent','vtiger_quotes',1,'1','hdnDiscountPercent','Discount Percent',1,0,0,100,14,51,3,'N~O',1,null,'BAS')");
 653   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'discount_amount','vtiger_quotes',1,'1','hdnDiscountAmount','Discount Amount',1,0,0,100,14,51,3,'N~O',1,null,'BAS')");
 654   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'s_h_amount','vtiger_quotes',1,'1','hdnS_H_Amount','S&H Amount',1,0,0,100,14,51,3,'N~O',1,null,'BAS')");
 655  
 656   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'accountid','vtiger_quotes',1,'73','account_id','Account Name',1,0,0,100,16,51,1,'I~M',1,null,'BAS')");
 657   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,17,51,1,'V~M',1,null,'BAS')");
 658   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,18,51,2,'T~O',1,null,'BAS')");
 659   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,19,51,2,'T~O',1,null,'BAS')");
 660  
 661  
 662   //Block 53
 663  
 664  $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'bill_street','vtiger_quotesbillads',1,'24','bill_street','Billing Address',1,0,0,100,1,53,1,'V~M',1,null,'BAS')");
 665   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'ship_street','vtiger_quotesshipads',1,'24','ship_street','Shipping Address',1,0,0,100,2,53,1,'V~M',1,null,'BAS')");
 666  
 667   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'bill_city','vtiger_quotesbillads',1,'1','bill_city','Billing City',1,0,0,100,5,53,1,'V~O',1,null,'BAS')");
 668   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'ship_city','vtiger_quotesshipads',1,'1','ship_city','Shipping City',1,0,0,100,6,53,1,'V~O',1,null,'BAS')");
 669  
 670   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'bill_state','vtiger_quotesbillads',1,'1','bill_state','Billing State',1,0,0,100,7,53,1,'V~O',1,null,'BAS')");
 671   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'ship_state','vtiger_quotesshipads',1,'1','ship_state','Shipping State',1,0,0,100,8,53,1,'V~O',1,null,'BAS')");
 672  
 673   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'bill_code','vtiger_quotesbillads',1,'1','bill_code','Billing Code',1,0,0,100,9,53,1,'V~O',1,null,'BAS')");
 674   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'ship_code','vtiger_quotesshipads',1,'1','ship_code','Shipping Code',1,0,0,100,10,53,1,'V~O',1,null,'BAS')");
 675  
 676  
 677   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'bill_country','vtiger_quotesbillads',1,'1','bill_country','Billing Country',1,0,0,100,11,53,1,'V~O',1,null,'BAS')");
 678   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'ship_country','vtiger_quotesshipads',1,'1','ship_country','Shipping Country',1,0,0,100,12,53,1,'V~O',1,null,'BAS')");
 679  
 680  $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'bill_pobox','vtiger_quotesbillads',1,'1','bill_pobox','Billing Po Box',1,0,0,100,3,53,1,'V~O',1,null,'BAS')");
 681   $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'ship_pobox','vtiger_quotesshipads',1,'1','ship_pobox','Shipping Po Box',1,0,0,100,4,53,1,'V~O',1,null,'BAS')");
 682   //Block55
 683  
 684  $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,56,1,'V~O',1,null,'ADV')");
 685  
 686  //Block 56
 687  $this->db->query("insert into vtiger_field values (20,".$this->db->getUniqueID("vtiger_field").",'terms_conditions','vtiger_quotes',1,'19','terms_conditions','Terms & Conditions',1,0,0,100,1,55,1,'V~O',1,null,'ADV')");
 688  
 689  
 690  //Quote Details -- END
 691  
 692  //Purchase Order Details -- START
 693   //Block57
 694   
 695  $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_purchaseorder',1,'2','subject','Subject',1,0,0,100,1,57,1,'V~M',1,null,'BAS')");    
 696   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'vendorid','vtiger_purchaseorder',1,'81','vendor_id','Vendor Name',1,0,0,100,3,57,1,'I~M',1,null,'BAS')");    
 697   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'requisition_no','vtiger_purchaseorder',1,'1','requisition_no','Requisition No',1,0,0,100,4,57,1,'V~O',1,null,'BAS')");    
 698  
 699   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'tracking_no','vtiger_purchaseorder',1,'1','tracking_no','Tracking Number',1,0,0,100,5,57,1,'V~O',1,null,'BAS')");    
 700   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'contactid','vtiger_purchaseorder',1,'57','contact_id','Contact Name',1,0,0,100,6,57,1,'I~O',1,null,'BAS')");    
 701   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'duedate','vtiger_purchaseorder',1,'5','duedate','Due Date',1,0,0,100,7,57,1,'V~O',1,null,'BAS')");
 702   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'carrier','vtiger_purchaseorder',1,'15','carrier','Carrier',1,0,0,100,8,57,1,'V~O',1,null,'BAS')");
 703   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'salestax','vtiger_purchaseorder',1,'1','txtTax','Sales Tax',1,0,0,100,10,57,3,'N~O',1,null,'BAS')");
 704   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'adjustment','vtiger_purchaseorder',1,'1','txtAdjustment','Adjustment',1,0,0,100,10,57,3,'NN~O',1,null,'BAS')");
 705   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'salescommission','vtiger_purchaseorder',1,'1','salescommission','Sales Commission',1,0,0,100,11,57,1,'N~O',1,null,'BAS')");
 706   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'exciseduty','vtiger_purchaseorder',1,'1','exciseduty','Excise Duty',1,0,0,100,12,57,1,'N~O',1,null,'BAS')");
 707   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'total','vtiger_purchaseorder',1,'1','hdnGrandTotal','Total',1,0,0,100,13,57,3,'N~O',1,null,'BAS')");
 708   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'subtotal','vtiger_purchaseorder',1,'1','hdnSubTotal','Sub Total',1,0,0,100,14,57,3,'N~O',1,null,'BAS')");
 709  //Added fields taxtype, discount percent, discount amount and S&H amount for Tax process
 710   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'taxtype','vtiger_purchaseorder',1,'15','hdnTaxType','Tax Type',1,0,0,100,14,57,3,'V~O',1,null,'BAS')");
 711   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'discount_percent','vtiger_purchaseorder',1,'1','hdnDiscountPercent','Discount Percent',1,0,0,100,14,57,3,'N~O',1,null,'BAS')");
 712   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'discount_amount','vtiger_purchaseorder',1,'1','hdnDiscountAmount','Discount Amount',1,0,0,100,14,57,3,'N~O',1,null,'BAS')");
 713   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'s_h_amount','vtiger_purchaseorder',1,'1','hdnS_H_Amount','S&H Amount',1,0,0,100,14,57,3,'N~O',1,null,'BAS')");
 714   
 715   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'postatus','vtiger_purchaseorder',1,'111','postatus','Status',1,0,0,100,15,57,1,'V~O',1,null,'BAS')");
 716   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,16,57,1,'V~M',1,null,'BAS')");
 717   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,17,57,2,'T~O',1,null,'BAS')");
 718   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,18,57,2,'T~O',1,null,'BAS')");
 719  
 720  
 721  
 722   //Block 59
 723  
 724  $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'bill_street','vtiger_pobillads',1,'24','bill_street','Billing Address',1,0,0,100,1,59,1,'V~M',1,null,'BAS')");
 725   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'ship_street','vtiger_poshipads',1,'24','ship_street','Shipping Address',1,0,0,100,2,59,1,'V~M',1,null,'BAS')");
 726  
 727   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'bill_city','vtiger_pobillads',1,'1','bill_city','Billing City',1,0,0,100,5,59,1,'V~O',1,null,'BAS')");
 728   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'ship_city','vtiger_poshipads',1,'1','ship_city','Shipping City',1,0,0,100,6,59,1,'V~O',1,null,'BAS')");
 729  
 730   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'bill_state','vtiger_pobillads',1,'1','bill_state','Billing State',1,0,0,100,7,59,1,'V~O',1,null,'BAS')");
 731   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'ship_state','vtiger_poshipads',1,'1','ship_state','Shipping State',1,0,0,100,8,59,1,'V~O',1,null,'BAS')");
 732  
 733   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'bill_code','vtiger_pobillads',1,'1','bill_code','Billing Code',1,0,0,100,9,59,1,'V~O',1,null,'BAS')");
 734   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'ship_code','vtiger_poshipads',1,'1','ship_code','Shipping Code',1,0,0,100,10,59,1,'V~O',1,null,'BAS')");
 735  
 736  
 737   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'bill_country','vtiger_pobillads',1,'1','bill_country','Billing Country',1,0,0,100,11,59,1,'V~O',1,null,'BAS')");
 738   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'ship_country','vtiger_poshipads',1,'1','ship_country','Shipping Country',1,0,0,100,12,59,1,'V~O',1,null,'BAS')");
 739  
 740   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'bill_pobox','vtiger_pobillads',1,'1','bill_pobox','Billing Po Box',1,0,0,100,3,59,1,'V~O',1,null,'BAS')");
 741    $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'ship_pobox','vtiger_poshipads',1,'1','ship_pobox','Shipping Po Box',1,0,0,100,4,59,1,'V~O',1,null,'BAS')");
 742    
 743   //Block61
 744   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,62,1,'V~O',1,null,'ADV')");
 745  
 746   //Block62
 747   $this->db->query("insert into vtiger_field values (21,".$this->db->getUniqueID("vtiger_field").",'terms_conditions','vtiger_purchaseorder',1,'19','terms_conditions','Terms & Conditions',1,0,0,100,1,61,1,'V~O',1,null,'ADV')");
 748  
 749  //Purchase Order Details -- END
 750  
 751  //Sales Order Details -- START
 752   //Block63
 753   
 754  $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_salesorder',1,'2','subject','Subject',1,0,0,100,1,63,1,'V~M',1,null,'BAS')");    
 755   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'potentialid','vtiger_salesorder',1,'76','potential_id','Potential Name',1,0,0,100,2,63,1,'I~O',1,null,'BAS')");    
 756   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'customerno','vtiger_salesorder',1,'1','customerno','Customer No',1,0,0,100,3,63,1,'V~O',1,null,'BAS')");
 757  $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'quoteid','vtiger_salesorder',1,'78','quote_id','Quote Name',1,0,0,100,4,63,1,'I~O',1,null,'BAS')");    
 758  $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'purchaseorder','vtiger_salesorder',1,'1','vtiger_purchaseorder','Purchase Order',1,0,0,100,4,63,1,'V~O',1,null,'BAS')");    
 759  
 760   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'contactid','vtiger_salesorder',1,'57','contact_id','Contact Name',1,0,0,100,6,63,1,'I~O',1,null,'BAS')");    
 761   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'duedate','vtiger_salesorder',1,'5','duedate','Due Date',1,0,0,100,8,63,1,'D~O',1,null,'BAS')");
 762   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'carrier','vtiger_salesorder',1,'15','carrier','Carrier',1,0,0,100,9,63,1,'V~O',1,null,'BAS')");
 763   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'pending','vtiger_salesorder',1,'1','pending','Pending',1,0,0,100,10,63,1,'V~O',1,null,'BAS')");
 764   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'sostatus','vtiger_salesorder',1,'111','sostatus','Status',1,0,0,100,11,63,1,'V~O',1,null,'BAS')");
 765   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'salestax','vtiger_salesorder',1,'1','txtTax','Sales Tax',1,0,0,100,12,63,3,'N~O',1,null,'BAS')");
 766   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'adjustment','vtiger_salesorder',1,'1','txtAdjustment','Sales Tax',1,0,0,100,12,63,3,'NN~O',1,null,'BAS')");
 767   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'salescommission','vtiger_salesorder',1,'1','salescommission','Sales Commission',1,0,0,100,13,63,1,'N~O',1,null,'BAS')");
 768   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'exciseduty','vtiger_salesorder',1,'1','exciseduty','Excise Duty',1,0,0,100,13,63,1,'N~O',1,null,'BAS')");
 769   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'total','vtiger_salesorder',1,'1','hdnGrandTotal','Total',1,0,0,100,14,63,3,'N~O',1,null,'BAS')");
 770   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'subtotal','vtiger_salesorder',1,'1','hdnSubTotal','Total',1,0,0,100,15,63,3,'N~O',1,null,'BAS')");
 771  //Added fields taxtype, discount percent, discount amount and S&H amount for Tax process
 772   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'taxtype','vtiger_salesorder',1,'15','hdnTaxType','Tax Type',1,0,0,100,15,63,3,'V~O',1,null,'BAS')");
 773   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'discount_percent','vtiger_salesorder',1,'1','hdnDiscountPercent','Discount Percent',1,0,0,100,15,63,3,'N~O',1,null,'BAS')");
 774   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'discount_amount','vtiger_salesorder',1,'1','hdnDiscountAmount','Discount Amount',1,0,0,100,15,63,3,'N~O',1,null,'BAS')");
 775   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'s_h_amount','vtiger_salesorder',1,'1','hdnS_H_Amount','S&H Amount',1,0,0,100,15,63,3,'N~O',1,null,'BAS')");
 776  
 777   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'accountid','vtiger_salesorder',1,'73','account_id','Account Name',1,0,0,100,16,63,1,'I~M',1,null,'BAS')");
 778   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,17,63,1,'V~M',1,null,'BAS')");
 779   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,18,63,2,'T~O',1,null,'BAS')");
 780   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,19,63,2,'T~O',1,null,'BAS')");
 781  
 782  
 783  
 784   //Block 65
 785  
 786   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'bill_street','vtiger_sobillads',1,'24','bill_street','Billing Address',1,0,0,100,1,65,1,'V~M',1,null,'BAS')");
 787   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'ship_street','vtiger_soshipads',1,'24','ship_street','Shipping Address',1,0,0,100,2,65,1,'V~M',1,null,'BAS')");
 788  
 789   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'bill_city','vtiger_sobillads',1,'1','bill_city','Billing City',1,0,0,100,5,65,1,'V~O',1,null,'BAS')");
 790   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'ship_city','vtiger_soshipads',1,'1','ship_city','Shipping City',1,0,0,100,6,65,1,'V~O',1,null,'BAS')");
 791  
 792   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'bill_state','vtiger_sobillads',1,'1','bill_state','Billing State',1,0,0,100,7,65,1,'V~O',1,null,'BAS')");
 793   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'ship_state','vtiger_soshipads',1,'1','ship_state','Shipping State',1,0,0,100,8,65,1,'V~O',1,null,'BAS')");
 794  
 795   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'bill_code','vtiger_sobillads',1,'1','bill_code','Billing Code',1,0,0,100,9,65,1,'V~O',1,null,'BAS')");
 796   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'ship_code','vtiger_soshipads',1,'1','ship_code','Shipping Code',1,0,0,100,10,65,1,'V~O',1,null,'BAS')");
 797  
 798  
 799   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'bill_country','vtiger_sobillads',1,'1','bill_country','Billing Country',1,0,0,100,11,65,1,'V~O',1,null,'BAS')");
 800   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'ship_country','vtiger_soshipads',1,'1','ship_country','Shipping Country',1,0,0,100,12,65,1,'V~O',1,null,'BAS')");
 801  
 802   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'bill_pobox','vtiger_sobillads',1,'1','bill_pobox','Billing Po Box',1,0,0,100,3,65,1,'V~O',1,null,'BAS')");
 803    $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'ship_pobox','vtiger_soshipads',1,'1','ship_pobox','Shipping Po Box',1,0,0,100,4,65,1,'V~O',1,null,'BAS')");
 804    
 805  //Block67
 806   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,68,1,'V~O',1,null,'ADV')");
 807  
 808   //Block68
 809   $this->db->query("insert into vtiger_field values (22,".$this->db->getUniqueID("vtiger_field").",'terms_conditions','vtiger_salesorder',1,'19','terms_conditions','Terms & Conditions',1,0,0,100,1,67,1,'V~O',1,null,'ADV')");
 810  
 811  
 812  //Sales Order Details -- END
 813  
 814  //Invoice Details -- START
 815   //Block69
 816  
 817  $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_invoice',1,'2','subject','Subject',1,0,0,100,1,69,1,'V~M',1,null,'BAS')");
 818   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'salesorderid','vtiger_invoice',1,'80','salesorder_id','Sales Order',1,0,0,100,2,69,1,'I~O',1,null,'BAS')");    
 819   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'customerno','vtiger_invoice',1,'1','customerno','Customer No',1,0,0,100,3,69,1,'V~O',1,null,'BAS')");    
 820  
 821   
 822  //to include contact name vtiger_field in Invoice-start
 823  $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'contactid','vtiger_invoice',1,'57','contact_id','Contact Name',1,0,0,100,4,69,1,'I~O',1,null,'BAS')");
 824  //end
 825  
 826  $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'invoicedate','vtiger_invoice',1,'5','invoicedate','Invoice Date',1,0,0,100,5,69,1,'D~O',1,null,'BAS')");
 827   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'duedate','vtiger_invoice',1,'5','duedate','Due Date',1,0,0,100,6,69,1,'D~O',1,null,'BAS')");
 828  $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'purchaseorder','vtiger_invoice',1,'1','vtiger_purchaseorder','Purchase Order',1,0,0,100,8,69,1,'V~O',1,null,'BAS')");
 829   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'salestax','vtiger_invoice',1,'1','txtTax','Sales Tax',1,0,0,100,9,69,3,'N~O',1,null,'BAS')");
 830   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'adjustment','vtiger_invoice',1,'1','txtAdjustment','Sales Tax',1,0,0,100,9,69,3,'NN~O',1,null,'BAS')");
 831   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'salescommission','vtiger_invoice',1,'1','salescommission','Sales Commission',1,0,0,10,13,69,1,'N~O',1,null,'BAS')");
 832   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'exciseduty','vtiger_invoice',1,'1','exciseduty','Excise Duty',1,0,0,100,11,69,1,'N~O',1,null,'BAS')");
 833   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'subtotal','vtiger_invoice',1,'1','hdnSubTotal','Sub Total',1,0,0,100,12,69,3,'N~O',1,null,'BAS')");
 834   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'total','vtiger_invoice',1,'1','hdnGrandTotal','Total',1,0,0,100,13,69,3,'N~O',1,null,'BAS')");
 835  //Added fields taxtype, discount percent, discount amount and S&H amount for Tax process
 836   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'taxtype','vtiger_invoice',1,'15','hdnTaxType','Tax Type',1,0,0,100,13,69,3,'V~O',1,null,'BAS')");
 837   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'discount_percent','vtiger_invoice',1,'1','hdnDiscountPercent','Discount Percent',1,0,0,100,13,69,3,'N~O',1,null,'BAS')");
 838   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'discount_amount','vtiger_invoice',1,'1','hdnDiscountAmount','Discount Amount',1,0,0,100,13,69,3,'N~O',1,null,'BAS')");
 839   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'s_h_amount','vtiger_invoice',1,'1','hdnS_H_Amount','S&H Amount',1,0,0,100,14,57,3,'N~O',1,null,'BAS')");
 840  
 841  $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'accountid','vtiger_invoice',1,'73','account_id','Account Name',1,0,0,100,14,69,1,'I~M',1,null,'BAS')");
 842   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'invoicestatus','vtiger_invoice',1,'111','invoicestatus','Status',1,0,0,100,15,69,1,'V~O',1,null,'BAS')");
 843   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,16,69,1,'V~M',1,null,'BAS')");
 844   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,17,69,2,'T~O',1,null,'BAS')");
 845   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,18,69,2,'T~O',1,null,'BAS')"); 
 846  
 847   //Block 71
 848  
 849  $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'bill_street','vtiger_invoicebillads',1,'24','bill_street','Billing Address',1,0,0,100,1,71,1,'V~M',1,null,'BAS')");
 850   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'ship_street','vtiger_invoiceshipads',1,'24','ship_street','Shipping Address',1,0,0,100,2,71,1,'V~M',1,null,'BAS')");
 851  
 852   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'bill_city','vtiger_invoicebillads',1,'1','bill_city','Billing City',1,0,0,100,5,71,1,'V~O',1,null,'BAS')");
 853   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'ship_city','vtiger_invoiceshipads',1,'1','ship_city','Shipping City',1,0,0,100,6,71,1,'V~O',1,null,'BAS')");
 854  
 855   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'bill_state','vtiger_invoicebillads',1,'1','bill_state','Billing State',1,0,0,100,7,71,1,'V~O',1,null,'BAS')");
 856   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'ship_state','vtiger_invoiceshipads',1,'1','ship_state','Shipping State',1,0,0,100,8,71,1,'V~O',1,null,'BAS')");
 857  
 858   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'bill_code','vtiger_invoicebillads',1,'1','bill_code','Billing Code',1,0,0,100,9,71,1,'V~O',1,null,'BAS')");
 859   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'ship_code','vtiger_invoiceshipads',1,'1','ship_code','Shipping Code',1,0,0,100,10,71,1,'V~O',1,null,'BAS')");
 860  
 861  
 862   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'bill_country','vtiger_invoicebillads',1,'1','bill_country','Billing Country',1,0,0,100,11,71,1,'V~O',1,null,'BAS')");
 863   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'ship_country','vtiger_invoiceshipads',1,'1','ship_country','Shipping Country',1,0,0,100,12,71,1,'V~O',1,null,'BAS')");
 864  
 865   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'bill_pobox','vtiger_invoicebillads',1,'1','bill_pobox','Billing Po Box',1,0,0,100,3,71,1,'V~O',1,null,'BAS')");
 866    $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'ship_pobox','vtiger_invoiceshipads',1,'1','ship_pobox','Shipping Po Box',1,0,0,100,4,71,1,'V~O',1,null,'BAS')");
 867  
 868  //Block73
 869   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,74,1,'V~O',1,null,'ADV')");
 870   //Block74
 871   $this->db->query("insert into vtiger_field values (23,".$this->db->getUniqueID("vtiger_field").",'terms_conditions','vtiger_invoice',1,'19','terms_conditions','Terms & Conditions',1,0,0,100,1,73,1,'V~O',1,null,'ADV')");
 872  
 873  
 874  //Invoice Details -- END
 875   //users Details Starts Block 79,80,81
 876  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'user_name','vtiger_users',1,'106','user_name','User Name',1,0,0,11,1,79,1,'V~M',1,null,'BAS')");
 877  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'is_admin','vtiger_users',1,'156','is_admin','Admin',1,0,0,3,2,79,1,'V~O',1,null,'BAS')");
 878  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'user_password','vtiger_users',1,'99','user_password','Password',1,0,0,30,3,79,4,'P~M',1,null,'BAS')");
 879  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'confirm_password','vtiger_users',1,'99','confirm_password','Confirm Password',1,0,0,30,5,79,4,'P~M',1,null,'BAS')");
 880  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'first_name','vtiger_users',1,'1','first_name','First Name',1,0,0,30,7,79,1,'V~O',1,null,'BAS')");
 881  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'last_name','vtiger_users',1,'2','last_name','Last Name',1,0,0,30,9,79,1,'V~M',1,null,'BAS')");
 882  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'roleid','vtiger_user2role',1,'98','roleid','Role',1,0,0,200,11,79,1,'V~M',1,null,'BAS')");
 883  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'email1','vtiger_users',1,'104','email1','Email',1,0,0,100,4,79,1,'E~M',1,null,'BAS')");
 884  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'status','vtiger_users',1,'115','status','Status',1,0,0,100,6,79,1,'V~O',1,null,'BAS')");
 885  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'activity_view','vtiger_users',1,'15','activity_view','Default Activity View',1,0,0,100,12,79,1,'V~O',1,null,'BAS')");
 886  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'lead_view','vtiger_users',1,'15','lead_view','Default Lead View',1,0,0,100,10,79,1,'V~O',1,null,'BAS')");
 887  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'currency_id','vtiger_users',1,'116','currency_id','Currency',1,0,0,100,8,79,1,'I~O',1,null,'BAS')");
 888  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'hour_format','vtiger_users',1,'116','hour_format','Calendar Hour Format',1,0,0,100,13,79,3,'I~O',1,null,'BAS')");
 889  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'end_hour','vtiger_users',1,'116','end_hour','Day ends at',1,0,0,100,15,79,3,'I~O',1,null,'BAS')");
 890  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'start_hour','vtiger_users',1,'116','start_hour','Day starts at',1,0,0,100,14,79,3,'I~O',1,null,'BAS')");
 891  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'title','vtiger_users',1,'1','title','Title',1,0,0,50,1,80,1,'V~O',1,null,'BAS')");
 892  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'phone_work','vtiger_users',1,'1','phone_work','Office Phone',1,0,0,50,5,80,1,'V~O',1,null,'BAS')");
 893  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'department','vtiger_users',1,'1','department','Department',1,0,0,50,3,80,1,'V~O',1,null,'BAS')");
 894  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'phone_mobile','vtiger_users',1,'1','phone_mobile','Mobile',1,0,0,50,7,80,1,'V~O',1,null,'BAS')");
 895  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'reports_to_id','vtiger_users',1,'101','reports_to_id','Reports To',1,0,0,50,8,80,1,'V~O',1,null,'BAS')");
 896  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'phone_other','vtiger_users',1,'1','phone_other','Other Phone',1,0,0,50,11,80,1,'V~O',1,null,'BAS')");
 897  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'email2','vtiger_users',1,'13','email2','Other Email',1,0,0,100,4,80,1,'E~O',1,null,'BAS')");
 898  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'phone_fax','vtiger_users',1,'1','phone_fax','Fax',1,0,0,50,2,80,1,'V~O',1,null,'BAS')");
 899  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'yahoo_id','vtiger_users',1,'13','yahoo_id','Yahoo id',1,0,0,100,6,80,1,'E~O',1,null,'BAS')");
 900  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'phone_home','vtiger_users',1,'1','phone_home','Home Phone',1,0,0,50,9,80,1,'V~O',1,null,'BAS')");
 901  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'date_format','vtiger_users',1,'15','date_format','Date Format',1,0,0,30,12,80,1,'V~O',1,null,'BAS')");
 902  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'signature','vtiger_users',1,'21','signature','Signature',1,0,0,250,13,80,1,'V~O',1,null,'BAS')");
 903  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_users',1,'21','description','Notes',1,0,0,250,14,80,1,'V~O',1,null,'BAS')");
 904  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'address_street','vtiger_users',1,'21','address_street','Street Address',1,0,0,250,1,81,1,'V~O',1,null,'BAS')");
 905  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'address_city','vtiger_users',1,'1','address_city','City',1,0,0,100,3,81,1,'V~O',1,null,'BAS')");
 906  $this->db->query("insert into vtiger_field values (29,".$this->db->getUniqueID("vtiger_field").",'address_state','vtiger_users',1,'1','address_state','State',1,0,0,100,5,81,1,'V~O',1,null,'BAS')");
 907  $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')");
 908  $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')");
 909  
 910  //User Image Information
 911  $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')");
 912   //user Details End
 913  
 914  
 915  //The Entity Name for the modules are maintained in this table
 916  $this->db->query("insert into vtiger_entityname values(7,'Leads','vtiger_leaddetails','lastname,firstname','leadid')");
 917  $this->db->query("insert into vtiger_entityname values(6,'Accounts','vtiger_account','accountname','accountid')");
 918  $this->db->query("insert into vtiger_entityname values(4,'Contacts','vtiger_contactdetails','lastname,firstname','contactid')");
 919  $this->db->query("insert into vtiger_entityname values(2,'Potentials','vtiger_potential','potentialname','potentialid')");
 920  $this->db->query("insert into vtiger_entityname values(8,'Notes','vtiger_notes','title','notesid')");
 921  $this->db->query("insert into vtiger_entityname values(13,'HelpDesk','vtiger_troubletickets','title','ticketid')");
 922  $this->db->query("insert into vtiger_entityname values(9,'Calendar','vtiger_activity','subject','activityid')");
 923  $this->db->query("insert into vtiger_entityname values(10,'Emails','vtiger_activity','subject','activityid')");
 924  $this->db->query("insert into vtiger_entityname values(14,'Products','vtiger_products','productname','productid')");
 925  $this->db->query("insert into vtiger_entityname values(29,'Users','vtiger_users','last_name,first_name','id')");
 926  $this->db->query("insert into vtiger_entityname values(23,'Invoice','vtiger_invoice','subject','invoiceid')");
 927  $this->db->query("insert into vtiger_entityname values(20,'Quotes','vtiger_quotes','subject','quoteid')");
 928  $this->db->query("insert into vtiger_entityname values(21,'PurchaseOrder','vtiger_purchaseorder','subject','purchaseorderid')");
 929  $this->db->query("insert into vtiger_entityname values(22,'SalesOrder','vtiger_salesorder','subject','salesorderid')");
 930  $this->db->query("insert into vtiger_entityname values(18,'Vendors','vtiger_vendor','vendorname','vendorid')");
 931  $this->db->query("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid')");
 932  $this->db->query("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid')");
 933  $this->db->query("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id')");
 934  
 935                  // Insert End
 936          
 937          //Inserting into vtiger_groups table
 938          $group1_id = $this->db->getUniqueID("vtiger_groups");
 939           $group2_id = $this->db->getUniqueID("vtiger_groups");
 940           $group3_id = $this->db->getUniqueID("vtiger_groups");
 941          
 942          $this->db->query("insert into vtiger_groups values ('".$group1_id."','Team Selling','Group Related to Sales')");    
 943          $this->db->query("insert into vtiger_group2role values ('".$group1_id."','H".$role4_id."')");    
 944          $this->db->query("insert into vtiger_group2rs values ('".$group1_id."','H".$role5_id."')");    
 945  
 946          $this->db->query("insert into vtiger_groups values ('".$group2_id."','Marketing Group','Group Related to Marketing Activities')");    
 947          $this->db->query("insert into vtiger_group2role values ('".$group2_id."','H".$role2_id."')");    
 948          $this->db->query("insert into vtiger_group2rs values ('".$group2_id."','H".$role3_id."')");    
 949  
 950          $this->db->query("insert into vtiger_groups values ('".$group3_id."','Support Group','Group Related to providing Support to Customers')");
 951          $this->db->query("insert into vtiger_group2role values ('".$group3_id."','H".$role3_id."')");
 952          $this->db->query("insert into vtiger_group2rs values ('".$group3_id."','H".$role3_id."')");
 953  
 954          //New Security Start
 955          //Inserting into vtiger_profile vtiger_table
 956          $this->db->query("insert into vtiger_profile values ('".$profile1_id."','Administrator','Admin Profile')");    
 957          $this->db->query("insert into vtiger_profile values ('".$profile2_id."','Sales Profile','Profile Related to Sales')");
 958          $this->db->query("insert into vtiger_profile values ('".$profile3_id."','Support Profile','Profile Related to Support')");
 959          $this->db->query("insert into vtiger_profile values ('".$profile4_id."','Guest Profile','Guest Profile for Test Users')");
 960          
 961          //Inserting into vtiger_profile2gloabal permissions
 962          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile1_id."',1,0)");
 963          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile1_id."',2,0)");
 964          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile2_id."',1,1)");
 965          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile2_id."',2,1)");
 966          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile3_id."',1,1)");
 967          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile3_id."',2,1)");
 968          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile4_id."',1,1)");
 969          $this->db->query("insert into vtiger_profile2globalpermissions values ('".$profile4_id."',2,1)");
 970  
 971          //Inserting into vtiger_profile2tab
 972          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",1,0)");
 973          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",2,0)");
 974          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",3,0)");
 975          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",4,0)");
 976          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",6,0)");
 977          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",7,0)");
 978          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",8,0)");
 979          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",9,0)");
 980          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",10,0)");
 981          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",13,0)");
 982          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",14,0)");
 983          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",15,0)");
 984          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",16,0)");
 985          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",18,0)");
 986          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",19,0)");
 987          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",20,0)");
 988          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",21,0)");
 989          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",22,0)");
 990          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",23,0)");
 991          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",24,0)");
 992          $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",25,0)");
 993                 $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",26,0)");
 994                 $this->db->query("insert into vtiger_profile2tab values (".$profile1_id.",27,0)");
 995  
 996          //Inserting into vtiger_profile2tab
 997          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",1,0)");
 998          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",2,0)");
 999          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",3,0)");
1000          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",4,0)");
1001          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",6,0)");
1002          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",7,0)");
1003          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",8,0)");
1004          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",9,0)");
1005          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",10,0)");
1006          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",13,0)");
1007          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",14,0)");
1008          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",15,0)");
1009          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",16,0)");
1010          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",18,0)");
1011          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",19,0)");
1012          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",20,0)");
1013          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",21,0)");
1014          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",22,0)");
1015          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",23,0)");
1016          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",24,0)");
1017          $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",25,0)");
1018              $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",26,0)");
1019                 $this->db->query("insert into vtiger_profile2tab values (".$profile2_id.",27,0)");
1020  
1021          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",1,0)");
1022          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",2,0)");
1023          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",3,0)");
1024          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",4,0)");
1025          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",6,0)");
1026          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",7,0)");
1027          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",8,0)");
1028          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",9,0)");
1029          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",10,0)");
1030          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",13,0)");
1031          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",14,0)");
1032          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",15,0)");
1033          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",16,0)");
1034          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",18,0)");
1035          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",19,0)");
1036          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",20,0)");
1037          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",21,0)");
1038          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",22,0)");
1039          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",23,0)");
1040          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",24,0)");
1041          $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",25,0)");
1042              $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",26,0)");
1043                 $this->db->query("insert into vtiger_profile2tab values (".$profile3_id.",27,0)");
1044          
1045  
1046          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",1,0)");
1047          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",2,0)");
1048          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",3,0)");
1049          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",4,0)");
1050          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",6,0)");
1051          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",7,0)");
1052          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",8,0)");
1053          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",9,0)");
1054          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",10,0)");
1055          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",13,0)");
1056          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",14,0)");
1057          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",15,0)");
1058          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",16,0)");    
1059          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",18,0)");
1060          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",19,0)");
1061          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",20,0)");
1062          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",21,0)");
1063          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",22,0)");
1064          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",23,0)");
1065          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",24,0)");
1066          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",25,0)");
1067          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",26,0)");
1068          $this->db->query("insert into vtiger_profile2tab values (".$profile4_id.",27,0)");
1069          //Inserting into vtiger_profile2standardpermissions  Adminsitrator
1070          
1071          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",2,0,0)");
1072          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",2,1,0)");
1073          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",2,2,0)");
1074          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",2,3,0)");
1075          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",2,4,0)");
1076  
1077          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",4,0,0)");
1078          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",4,1,0)");
1079          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",4,2,0)");
1080          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",4,3,0)");
1081          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",4,4,0)");
1082  
1083          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",6,0,0)");
1084          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",6,1,0)");
1085          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",6,2,0)");
1086          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",6,3,0)");
1087          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",6,4,0)");
1088  
1089          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",7,0,0)");
1090          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",7,1,0)");
1091          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",7,2,0)");
1092          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",7,3,0)");
1093          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",7,4,0)");
1094  
1095          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",8,0,0)");
1096          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",8,1,0)");
1097          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",8,2,0)");
1098          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",8,3,0)");
1099          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",8,4,0)");
1100  
1101          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",9,0,0)");
1102          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",9,1,0)");
1103          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",9,2,0)");
1104          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",9,3,0)");
1105          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",9,4,0)");
1106  
1107          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",13,0,0)");
1108          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",13,1,0)");
1109          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",13,2,0)");
1110          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",13,3,0)");
1111          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",13,4,0)");
1112  
1113          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",14,0,0)");
1114          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",14,1,0)");
1115          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",14,2,0)");
1116          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",14,3,0)");
1117          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",14,4,0)");
1118  
1119          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",15,0,0)");
1120          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",15,1,0)");
1121          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",15,2,0)");
1122          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",15,3,0)");
1123          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",15,4,0)");
1124  
1125          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",16,0,0)");
1126          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",16,1,0)");
1127          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",16,2,0)");
1128          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",16,3,0)");
1129          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",16,4,0)");
1130  
1131          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",18,0,0)");
1132          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",18,1,0)");
1133          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",18,2,0)");
1134          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",18,3,0)");
1135          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",18,4,0)");
1136  
1137          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",19,0,0)");
1138          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",19,1,0)");
1139          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",19,2,0)");
1140          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",19,3,0)");
1141          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",19,4,0)");
1142  
1143          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",20,0,0)");
1144          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",20,1,0)");
1145          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",20,2,0)");
1146          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",20,3,0)");
1147          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",20,4,0)");
1148  
1149          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",21,0,0)");
1150          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",21,1,0)");
1151          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",21,2,0)");
1152          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",21,3,0)");
1153          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",21,4,0)");
1154  
1155          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",22,0,0)");
1156          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",22,1,0)");
1157          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",22,2,0)");
1158          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",22,3,0)");
1159          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",22,4,0)");
1160  
1161          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",23,0,0)");
1162          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",23,1,0)");
1163          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",23,2,0)");
1164          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",23,3,0)");
1165          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",23,4,0)");
1166  
1167  
1168  
1169              $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",26,0,0)");
1170          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",26,1,0)");
1171          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",26,2,0)");
1172          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",26,3,0)");
1173          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile1_id.",26,4,0)");
1174  
1175  
1176          //Insert into Profile 2 std permissions for Sales User  
1177          //Help Desk Create/Delete not allowed. Read-Only    
1178  
1179          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",2,0,0)");
1180          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",2,1,0)");
1181          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",2,2,0)");
1182          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",2,3,0)");
1183          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",2,4,0)");
1184  
1185          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",4,0,0)");
1186          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",4,1,0)");
1187          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",4,2,0)");
1188          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",4,3,0)");
1189          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",4,4,0)");
1190  
1191          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",6,0,0)");
1192          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",6,1,0)");
1193          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",6,2,0)");
1194          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",6,3,0)");
1195          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",6,4,0)");
1196  
1197          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",7,0,0)");
1198          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",7,1,0)");
1199          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",7,2,0)");
1200          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",7,3,0)");
1201          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",7,4,0)");
1202  
1203          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",8,0,0)");
1204          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",8,1,0)");
1205          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",8,2,0)");
1206          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",8,3,0)");
1207          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",8,4,0)");
1208  
1209          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",9,0,0)");
1210          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",9,1,0)");
1211          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",9,2,0)");
1212          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",9,3,0)");
1213          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",9,4,0)");
1214          
1215          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",13,0,1)");
1216          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",13,1,1)");
1217          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",13,2,1)");
1218          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",13,3,0)");
1219          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",13,4,0)");
1220  
1221          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",14,0,0)");
1222          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",14,1,0)");
1223          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",14,2,0)");
1224          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",14,3,0)");
1225          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",14,4,0)");
1226  
1227          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",15,0,0)");
1228          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",15,1,0)");
1229          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",15,2,0)");
1230          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",15,3,0)");
1231          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",15,4,0)");
1232  
1233          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",16,0,0)");
1234          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",16,1,0)");
1235          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",16,2,0)");
1236          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",16,3,0)");
1237          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",16,4,0)");
1238  
1239          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",18,0,0)");
1240          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",18,1,0)");
1241          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",18,2,0)");
1242          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",18,3,0)");
1243          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",18,4,0)");
1244  
1245          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",19,0,0)");
1246          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",19,1,0)");
1247          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",19,2,0)");
1248          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",19,3,0)");
1249          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",19,4,0)");
1250  
1251          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",20,0,0)");
1252          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",20,1,0)");
1253          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",20,2,0)");
1254          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",20,3,0)");
1255          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",20,4,0)");
1256  
1257          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",21,0,0)");
1258          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",21,1,0)");
1259          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",21,2,0)");
1260          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",21,3,0)");
1261          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",21,4,0)");
1262  
1263          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",22,0,0)");
1264          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",22,1,0)");
1265          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",22,2,0)");
1266          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",22,3,0)");
1267          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",22,4,0)");
1268  
1269          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",23,0,0)");
1270          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",23,1,0)");
1271          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",23,2,0)");
1272          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",23,3,0)");
1273          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",23,4,0)");
1274  
1275  
1276              $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",26,0,0)");
1277          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",26,1,0)");
1278          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",26,2,0)");
1279          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",26,3,0)");
1280          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile2_id.",26,4,0)");
1281  
1282          //Inserting into vtiger_profile2std for Support Profile
1283          // Potential is read-only
1284  
1285          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",2,0,1)");
1286          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",2,1,1)");
1287          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",2,2,1)");
1288          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",2,3,0)");
1289          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",2,4,0)");
1290  
1291          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",4,0,0)");
1292          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",4,1,0)");
1293          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",4,2,0)");
1294          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",4,3,0)");
1295          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",4,4,0)");
1296  
1297          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",6,0,0)");
1298          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",6,1,0)");
1299          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",6,2,0)");
1300          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",6,3,0)");
1301          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",6,4,0)");
1302  
1303          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",7,0,0)");
1304          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",7,1,0)");
1305          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",7,2,0)");
1306          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",7,3,0)");
1307          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",7,4,0)");
1308  
1309          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",8,0,0)");
1310          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",8,1,0)");
1311          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",8,2,0)");
1312          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",8,3,0)");
1313          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",8,4,0)");
1314  
1315          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",9,0,0)");
1316          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",9,1,0)");
1317          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",9,2,0)");
1318          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",9,3,0)");
1319          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",9,4,0)");
1320  
1321          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",13,0,0)");
1322          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",13,1,0)");
1323          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",13,2,0)");
1324          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",13,3,0)");
1325          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",13,4,0)");
1326  
1327          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",14,0,0)");
1328          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",14,1,0)");
1329          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",14,2,0)");
1330          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",14,3,0)");
1331          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",14,4,0)");
1332  
1333          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",15,0,0)");
1334          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",15,1,0)");
1335          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",15,2,0)");
1336          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",15,3,0)");
1337          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",15,4,0)");
1338  
1339          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",16,0,0)");
1340          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",16,1,0)");
1341          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",16,2,0)");
1342          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",16,3,0)");
1343          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",16,4,0)");
1344  
1345          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",18,0,0)");
1346          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",18,1,0)");
1347          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",18,2,0)");
1348          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",18,3,0)");
1349          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",18,4,0)");
1350  
1351          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",19,0,0)");
1352          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",19,1,0)");
1353          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",19,2,0)");
1354          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",19,3,0)");
1355          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",19,4,0)");
1356  
1357          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",20,0,0)");
1358          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",20,1,0)");
1359          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",20,2,0)");
1360          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",20,3,0)");
1361          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",20,4,0)");
1362  
1363          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",21,0,0)");
1364          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",21,1,0)");
1365          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",21,2,0)");
1366          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",21,3,0)");
1367          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",21,4,0)");
1368  
1369          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",22,0,0)");
1370          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",22,1,0)");
1371          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",22,2,0)");
1372          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",22,3,0)");
1373          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",22,4,0)");
1374  
1375          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",23,0,0)");
1376          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",23,1,0)");
1377          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",23,2,0)");
1378          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",23,3,0)");
1379          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",23,4,0)");
1380  
1381  
1382              $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",26,0,0)");
1383          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",26,1,0)");
1384          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",26,2,0)");
1385          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",26,3,0)");
1386          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile3_id.",26,4,0)");
1387          
1388          //Inserting into vtiger_profile2stdper for Profile Guest Profile
1389          //All Read-Only
1390          
1391          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",2,0,1)");
1392          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",2,1,1)");
1393          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",2,2,1)");
1394          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",2,3,0)");
1395          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",2,4,0)");
1396  
1397          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",4,0,1)");
1398          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",4,1,1)");
1399          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",4,2,1)");
1400          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",4,3,0)");
1401          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",4,4,0)");
1402  
1403          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",6,0,1)");
1404          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",6,1,1)");
1405          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",6,2,1)");
1406          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",6,3,0)");
1407          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",6,4,0)");
1408  
1409          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",7,0,1)");
1410          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",7,1,1)");
1411          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",7,2,1)");
1412          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",7,3,0)");
1413          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",7,4,0)");
1414  
1415          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",8,0,1)");
1416          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",8,1,1)");
1417          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",8,2,1)");
1418          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",8,3,0)");
1419          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",8,4,0)");
1420  
1421          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,0,1)");
1422          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,1,1)");
1423          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,2,1)");
1424          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,3,0)");
1425          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",9,4,0)");
1426  
1427          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,0,1)");
1428          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,1,1)");
1429          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,2,1)");
1430          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,3,0)");
1431          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",13,4,0)");
1432  
1433          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",14,0,1)");
1434          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",14,1,1)");
1435          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",14,2,1)");
1436          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",14,3,0)");
1437          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",14,4,0)");
1438  
1439          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",15,0,1)");
1440          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",15,1,1)");
1441          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",15,2,1)");
1442          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",15,3,0)");
1443          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",15,4,0)");
1444  
1445          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",16,0,1)");
1446          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",16,1,1)");
1447          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",16,2,1)");
1448          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",16,3,0)");
1449          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",16,4,0)");
1450  
1451          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",18,0,1)");
1452          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",18,1,1)");
1453          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",18,2,1)");
1454          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",18,3,0)");
1455          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",18,4,0)");    
1456          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",19,0,1)");
1457          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",19,1,1)");
1458          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",19,2,1)");
1459          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",19,3,0)");
1460          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",19,4,0)");    
1461          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",20,0,1)");
1462          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",20,1,1)");
1463          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",20,2,1)");
1464          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",20,3,0)");
1465          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",20,4,0)");
1466  
1467          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",21,0,1)");
1468          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",21,1,1)");
1469          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",21,2,1)");
1470          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",21,3,0)");
1471          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",21,4,0)");
1472  
1473          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",22,0,1)");
1474          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",22,1,1)");
1475          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",22,2,1)");
1476          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",22,3,0)");
1477          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",22,4,0)");
1478  
1479          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",23,0,1)");
1480          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",23,1,1)");
1481          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",23,2,1)");
1482          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",23,3,0)");
1483          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",23,4,0)");    
1484  
1485  
1486          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",26,0,1)");
1487          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",26,1,1)");
1488          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",26,2,1)");
1489          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",26,3,0)");
1490          $this->db->query("insert into vtiger_profile2standardpermissions values (".$profile4_id.",26,4,0)");
1491  
1492          //Insert into vtiger_role2profile
1493          $this->db->query("insert into vtiger_role2profile values ('H".$role2_id."',".$profile1_id.")");
1494          $this->db->query("insert into vtiger_role2profile values ('H".$role3_id."',".$profile2_id.")");
1495        $this->db->query("insert into vtiger_role2profile values ('H".$role4_id."',".$profile2_id.")");
1496          $this->db->query("insert into vtiger_role2profile values ('H".$role5_id."',".$profile2_id.")"); 
1497         
1498          //Insert into vtiger_profile2field
1499              
1500                  insertProfile2field($profile1_id);
1501                  insertProfile2field($profile2_id);    
1502                  insertProfile2field($profile3_id);    
1503                  insertProfile2field($profile4_id);
1504  
1505          insert_def_org_field();    
1506          
1507  
1508          //Inserting into vtiger_profile 2 utility Admin
1509                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",2,5,0)");
1510                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",2,6,0)");
1511                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",4,5,0)");
1512                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",4,6,0)");
1513                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",6,5,0)");
1514                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",6,6,0)");
1515                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,5,0)");
1516                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,6,0)");
1517                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",8,6,0)");
1518                  //$this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",9,6,0)");
1519                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",10,6,0)");
1520          $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,8,0)");
1521                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",6,8,0)");
1522                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",4,8,0)");
1523                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",13,8,0)");
1524          $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",14,5,0)");
1525                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",14,6,0)");
1526                  $this->db->query("insert into vtiger_profile2utility values (".$profile1_id.",7,9,0)");
1527  
1528          //Inserting into vtiger_profile2utility Sales Profile
1529          //Import Export Not Allowed.    
1530          $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",2,5,1)");
1531                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",2,6,1)");
1532                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",4,5,1)");
1533                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",4,6,1)");
1534                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",6,5,1)");
1535                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",6,6,1)");
1536                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",7,5,1)");
1537                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",7,6,1)");
1538                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",8,6,1)");
1539                  //$this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",9,6,1)");
1540                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",10,6,1)");
1541                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",7,8,0)");
1542                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",6,8,0)");
1543                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",4,8,0)");
1544                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",13,8,0)");
1545          $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",14,5,1)");
1546                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",14,6,1)");
1547                  $this->db->query("insert into vtiger_profile2utility values (".$profile2_id.",7,9,0)");
1548  
1549          //Inserting into vtiger_profile2utility Support Profile
1550          //Import Export Not Allowed.    
1551          $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",2,5,1)");
1552                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",2,6,1)");
1553                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",4,5,1)");
1554                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",4,6,1)");
1555                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",6,5,1)");
1556                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",6,6,1)");
1557                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",7,5,1)");
1558                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",7,6,1)");
1559                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",8,6,1)");
1560                  //$this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",9,6,1)");
1561                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",10,6,1)");
1562                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",7,8,0)");
1563                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",6,8,0)");
1564                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",4,8,0)");
1565                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",13,8,0)");
1566          $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",14,5,1)");
1567                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",14,6,1)");
1568                  $this->db->query("insert into vtiger_profile2utility values (".$profile3_id.",7,9,0)");
1569  
1570          //Inserting into vtiger_profile2utility Guest Profile Read-Only
1571          //Import Export BusinessCar Not Allowed.    
1572          $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",2,5,1)");
1573                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",2,6,1)");
1574                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",4,5,1)");
1575                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",4,6,1)");
1576                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",6,5,1)");
1577                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",6,6,1)");
1578                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",7,5,1)");
1579                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",7,6,1)");
1580                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",8,6,1)");
1581                  //$this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",9,6,1)");
1582                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",10,6,1)");
1583                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",7,8,1)");
1584                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",6,8,1)");
1585                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",4,8,1)");        
1586                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",13,8,1)");        
1587          $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",14,5,1)");
1588                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",14,6,1)");
1589                  $this->db->query("insert into vtiger_profile2utility values (".$profile4_id.",7,9,0)");
1590  
1591          //Inserting values into org share action mapping
1592                  $this->db->query("insert into vtiger_org_share_action_mapping values(0,'Public: Read Only')");
1593                  $this->db->query("insert into vtiger_org_share_action_mapping values(1,'Public: Read, Create/Edit')");
1594                  $this->db->query("insert into vtiger_org_share_action_mapping values(2,'Public: Read, Create/Edit, Delete')");
1595                  $this->db->query("insert into vtiger_org_share_action_mapping values(3,'Private')");
1596  
1597                  $this->db->query("insert into vtiger_org_share_action_mapping values(4,'Hide Details')");
1598                  $this->db->query("insert into vtiger_org_share_action_mapping values(5,'Hide Details and Add Events')");
1599                  $this->db->query("insert into vtiger_org_share_action_mapping values(6,'Show Details')");
1600                  $this->db->query("insert into vtiger_org_share_action_mapping values(7,'Show Details and Add Events')");
1601  
1602  
1603          //Inserting for all vtiger_tabs
1604                  $def_org_tabid= Array(2,4,6,7,9,10,13,16,20,21,22,23,26);
1605  
1606                  foreach($def_org_tabid as $def_tabid)
1607                  {
1608                          $this->db->query("insert into vtiger_org_share_action2tab values(0,".$def_tabid.")");
1609                          $this->db->query("insert into vtiger_org_share_action2tab values(1,".$def_tabid.")");
1610                          $this->db->query("insert into vtiger_org_share_action2tab values(2,".$def_tabid.")");
1611                          $this->db->query("insert into vtiger_org_share_action2tab values(3,".$def_tabid.")");
1612                  }
1613  
1614          //Insert into default_org_sharingrule
1615                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",2,2,0)");
1616  
1617                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",4,2,2)");
1618  
1619                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",6,2,0)");
1620  
1621                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",7,2,0)");
1622  
1623                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",9,3,1)");
1624                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",13,2,0)");
1625                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",16,3,2)");
1626                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",20,2,0)");
1627                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",21,2,0)");
1628                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",22,2,0)");
1629                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",23,2,0)");
1630                 $this->db->query("insert into vtiger_def_org_share values (".$this->db->getUniqueID('vtiger_def_org_share').",26,2,0)");
1631  
1632          //Populating the DataShare Related Modules
1633  
1634          //Lead Related Module
1635  
1636          //Account Related Module
1637          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",6,2)");
1638          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",6,13)");
1639          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",6,20)");
1640          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",6,22)");
1641          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",6,23)");
1642  
1643          //Potential Related Module
1644          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",2,20)");
1645          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",2,22)");
1646  
1647          //Quote Related Module
1648          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",20,22)");
1649  
1650          //SO Related Module
1651          $this->db->query("insert into vtiger_datashare_relatedmodules values (".$this->db->getUniqueID('vtiger_datashare_relatedmodules').",22,23)");    
1652  
1653  
1654              
1655                      
1656    // New Secutity End
1657  
1658  
1659           //insert into the vtiger_notificationscheduler vtiger_table
1660  
1661      //insert into related list vtiger_table
1662      //Inserting for vtiger_account related lists
1663      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("Potentials").",'get_opportunities',1,'Potentials',0)");    
1664          
1665      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("Contacts").",'get_contacts',2,'Contacts',0)");
1666  
1667      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("Calendar").",'get_activities',3,'Activities',0)");
1668  
1669      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("HelpDesk").",'get_tickets',4,'HelpDesk',0)");
1670      
1671      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("Calendar").",'get_history',5,'Activity History',0)");
1672  
1673      
1674      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",0,'get_attachments',6,'Attachments',0)");
1675  
1676      
1677      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("Quotes").",'get_quotes',7,'Quotes',0)");
1678      
1679      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("Invoice").",'get_invoices',8,'Invoice',0)");
1680      
1681      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("SalesOrder").",'get_salesorder',9,'Sales Order',0)");
1682      
1683      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Accounts").",".getTabid("Products").",'get_products',10,'Products',0)");
1684  
1685      //Inserting Lead Related Lists    
1686  
1687      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Leads").",".getTabid("Calendar").",'get_activities',1,'Activities',0)");
1688      
1689      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Leads").",".getTabid("Emails").",'get_emails',2,'Emails',0)");
1690      
1691      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Leads").",".getTabid("Calendar").",'get_history',3,'Activity History',0)");
1692      
1693      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Leads").",0,'get_attachments',4,'Attachments',0)");
1694      
1695      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Leads").",".getTabid("Products").",'get_products',5,'Products',0)");
1696  
1697      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Leads").",".getTabid("Campaigns").",'get_campaigns',6,'Campaigns',0)");
1698  
1699      //Inserting for contact related lists
1700      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("Potentials").",'get_opportunities',1,'Potentials',0)");    
1701          
1702      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("Calendar").",'get_activities',2,'Activities',0)");
1703  
1704      
1705      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("Emails").",'get_emails',3,'Emails',0)");
1706  
1707      
1708      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("HelpDesk").",'get_tickets',4,'HelpDesk',0)");
1709      
1710      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("Quotes").",'get_quotes',5,'Quotes',0)");
1711      
1712      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("PurchaseOrder").",'get_purchase_orders',6,'Purchase Order',0)");
1713      
1714      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("SalesOrder").",'get_salesorder',7,'Sales Order',0)");
1715      
1716      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("Products").",'get_products',8,'Products',0)");
1717  
1718      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("Calendar").",'get_history',9,'Activity History',0)");
1719  
1720      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",0,'get_attachments',10,'Attachments',0)");
1721  
1722      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Contacts").",".getTabid("Campaigns").",'get_campaigns',11,'Campaigns',0)");
1723  
1724      //Inserting Potential Related Lists    
1725  
1726      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",".getTabid("Calendar").",'get_activities',1,'Activities',0)");
1727  
1728      
1729      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",".getTabid("Contacts").",'get_contacts',2,'Contacts',0)");
1730  
1731      
1732      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",".getTabid("Products").",'get_products',3,'Products',0)");
1733  
1734      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",0,'get_stage_history',4,'Sales Stage History',0)");
1735      
1736      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",0,'get_attachments',5,'Attachments',0)");
1737      
1738      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",".getTabid("Quotes").",'get_Quotes',6,'Quotes',0)");
1739      
1740      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",".getTabid("SalesOrder").",'get_salesorder',7,'Sales Order',0)");
1741      
1742      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Potentials").",".getTabid("Calendar").",'get_history',8,'Activity History',0)");
1743  
1744          //Inserting Product Related Lists    
1745  
1746      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Products").",".getTabid("HelpDesk").",'get_tickets',1,'HelpDesk',0)");
1747  
1748      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Products").",0,'get_attachments',3,'Attachments',0)");
1749      
1750      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Products").",".getTabid("Quotes").",'get_quotes',4,'Quotes',0)");
1751      
1752      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Products").",".getTabid("PurchaseOrder").",'get_purchase_orders',5,'Purchase Order',0)");
1753      
1754      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Products").",".getTabid("SalesOrder").",'get_salesorder',6,'Sales Order',0)");
1755      
1756      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Products").",".getTabid("Invoice").",'get_invoices',7,'Invoice',0)");
1757      
1758      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Products").",".getTabid("PriceBooks").",'get_product_pricebooks',8,'PriceBooks',0)");
1759      
1760          //Inserting Emails Related Lists    
1761  
1762      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Emails").",".getTabid("Contacts").",'get_contacts',1,'Contacts',0)");
1763  
1764      
1765      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Emails").",0,'get_users',2,'Users',0)");
1766  
1767      
1768      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Emails").",0,'get_attachments',3,'Attachments',0)");
1769  
1770          //Inserting HelpDesk Related Lists
1771          
1772      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("HelpDesk").",".getTabid("Calendar").",'get_activities',1,'Activities',0)");
1773  
1774      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("HelpDesk").",0,'get_attachments',2,'Attachments',0)");
1775  
1776      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("HelpDesk").",0,'get_ticket_history',3,'Ticket History',0)");
1777      
1778      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("HelpDesk").",".getTabid("Calendar").",'get_history',4,'Activity History',0)");
1779  
1780      //Inserting PriceBook Related Lists
1781      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("PriceBooks").",14,'get_pricebook_products',2,'Products',0)");
1782  
1783          // Inserting Vendor Related Lists
1784          $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Vendors").",14,'get_products',1,'Products',0)");
1785  
1786          $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Vendors").",21,'get_purchase_orders',2,'Purchase Order',0)");
1787  
1788          $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Vendors").",4,'get_contacts',3,'Contacts',0)");
1789  
1790      // Inserting Quotes Related Lists
1791      
1792          $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",".getTabid("Invoice").",'get_salesorder',1,'Sales Order',0)");
1793          
1794      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",9,'get_activities',2,'Activities',0)");
1795      
1796      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",9,'get_history',3,'Activity History',0)");
1797  
1798      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Quotes").",0,'get_quotestagehistory',4,'Quote Stage History',0)");
1799  
1800      // Inserting Purchase order Related Lists
1801  
1802      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("PurchaseOrder").",9,'get_activities',1,'Activities',0)");
1803      
1804      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("PurchaseOrder").",0,'get_attachments',2,'Attachments',0)");
1805      
1806      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("PurchaseOrder").",".getTabid("Calendar").",'get_history',3,'Activity History',0)");
1807      
1808      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("PurchaseOrder").",0,'get_postatushistory',4,'PurchaseOrder Status History',0)");
1809  
1810      // Inserting Sales order Related Lists
1811  
1812      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("SalesOrder").",9,'get_activities',1,'Activities',0)");
1813      
1814      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("SalesOrder").",0,'get_attachments',2,'Attachments',0)");
1815      
1816      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("SalesOrder").",".getTabid("Invoice").",'get_invoices',3,'Invoice',0)");
1817      
1818      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("SalesOrder").",".getTabid("Calendar").",'get_history',4,'Activity History',0)");
1819      
1820      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("SalesOrder").",0,'get_sostatushistory',5,'SalesOrder Status History',0)");
1821  
1822      // Inserting Invoice Related Lists
1823  
1824      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Invoice").",9,'get_activities',1,'Activities',0)");
1825      
1826      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Invoice").",0,'get_attachments',2,'Attachments',0)");
1827  
1828      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Invoice").",".getTabid("Calendar").",'get_history',3,'Activity History',0)");
1829  
1830      $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Invoice").",0,'get_invoicestatushistory',4,'Invoice Status History',0)");
1831  
1832      // Inserting Activities Related Lists
1833      
1834      $this->db->query("insert into vtiger_relatedlists values (".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Calendar").",0,'get_users',1,'Users',0)");
1835      $this->db->query("insert into vtiger_relatedlists values (".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Calendar").",4,'get_contacts',2,'Contacts',0)");
1836  
1837      // Inserting Campaigns Related Lists
1838  
1839           $this->db->query("insert into vtiger_relatedlists values (".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Campaigns").",".getTabid("Contacts").",'get_contacts',1,'Contacts',0)");
1840           $this->db->query("insert into vtiger_relatedlists values (".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Campaigns").",".getTabid("Leads").",'get_leads',2,'Leads',0)");
1841       $this->db->query("insert into vtiger_relatedlists values (".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Campaigns").",".getTabid("Potentials").",'get_opportunities',3,'Potentials',0)");
1842       $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('vtiger_relatedlists').",".getTabid("Campaigns").",9,'get_activities',4,'Activities',0)");
1843  
1844                 $this->db->query("insert into vtiger_notificationscheduler(schedulednotificationid,schedulednotificationname,active,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_notificationscheduler").",'LBL_TASK_NOTIFICATION_DESCRITPION',1,'Task Delay Notification','Tasks delayed beyond 24 hrs ','LBL_TASK_NOTIFICATION')");
1845  
1846  
1847                  $this->db->query("insert into vtiger_notificationscheduler(schedulednotificationid,schedulednotificationname,active,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_notificationscheduler").",'LBL_BIG_DEAL_DESCRIPTION' ,1,'Big Deal notification','Success! A big deal has been won! ','LBL_BIG_DEAL')");
1848  
1849  
1850                  $this->db->query("insert into vtiger_notificationscheduler(schedulednotificationid,schedulednotificationname,active,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_notificationscheduler").",'LBL_TICKETS_DESCRIPTION',1,'Pending Tickets notification','Ticket pending please ','LBL_PENDING_TICKETS')");
1851  
1852  
1853                  $this->db->query("insert into vtiger_notificationscheduler(schedulednotificationid,schedulednotificationname,active,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_notificationscheduler").",'LBL_MANY_TICKETS_DESCRIPTION',1,'Too many tickets Notification','Too many tickets pending against this entity ','LBL_MANY_TICKETS')");
1854  
1855  
1856                  $this->db->query("insert into vtiger_notificationscheduler(schedulednotificationid,schedulednotificationname,active,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_notificationscheduler").",'LBL_START_DESCRIPTION' ,1,'Support Start Notification','Support starts please ','LBL_START_NOTIFICATION')");
1857  
1858                  $this->db->query("insert into vtiger_notificationscheduler(schedulednotificationid,schedulednotificationname,active,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_notificationscheduler").",'LBL_SUPPORT_DESCRIPTION',1,'Support ending please','Support Ending Notification','LBL_SUPPORT_NOTICIATION')");
1859          
1860           $this->db->query("insert into vtiger_notificationscheduler(schedulednotificationid,schedulednotificationname,active,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_notificationscheduler").",'LBL_ACTIVITY_REMINDER_DESCRIPTION' ,1,'Activity Reminder Notification','This is a reminder notification for the Activity','LBL_ACTIVITY_NOTIFICATION')");
1861  
1862          //Inserting Inventory Notifications
1863      $invoice_body = 'Dear {HANDLER},
1864  
1865  The current stock of {PRODUCTNAME} in our warehouse is {CURRENTSTOCK}. Kindly procure required number of units as the stock level is below reorder level {REORDERLEVELVALUE}.
1866  
1867  Please treat this information as Urgent as the invoice is already sent  to the customer.
1868  
1869  Severity: Critical
1870  
1871  Thanks,
1872  {CURRENTUSER}';
1873  
1874          
1875                 $this->db->query("insert into vtiger_inventorynotification(notificationid,notificationname,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_inventorynotification").",'InvoiceNotification','{PRODUCTNAME} Stock Level is Low','".$invoice_body." ','InvoiceNotificationDescription')");
1876  
1877          $quote_body = 'Dear {HANDLER},
1878  
1879  Quote is generated for {QUOTEQUANTITY} units of {PRODUCTNAME}. The current stock of {PRODUCTNAME} in our warehouse is {CURRENTSTOCK}. 
1880  
1881  Severity: Minor
1882  
1883  Thanks,
1884  {CURRENTUSER}';    
1885          
1886          
1887                 $this->db->query("insert into vtiger_inventorynotification(notificationid,notificationname,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_inventorynotification").",'QuoteNotification','Quote given for {PRODUCTNAME}','".$quote_body." ','QuoteNotificationDescription')");
1888  
1889          $so_body = 'Dear {HANDLER},
1890  
1891  SalesOrder is generated for {SOQUANTITY} units of {PRODUCTNAME}. The current stock of {PRODUCTNAME} in our warehouse is {CURRENTSTOCK}. 
1892  
1893  Please treat this information  with priority as the sales order is already generated.
1894  
1895  Severity: Major
1896  
1897  Thanks,
1898  {CURRENTUSER}';
1899  
1900          
1901                 $this->db->query("insert into vtiger_inventorynotification(notificationid,notificationname,notificationsubject,notificationbody,label) values (".$this->db->getUniqueID("vtiger_inventorynotification").",'SalesOrderNotification','Sales Order generated for {PRODUCTNAME}','".$so_body." ','SalesOrderNotificationDescription')");
1902  
1903  //insert into inventory terms and conditions table
1904  
1905      $inv_tandc_text='
1906   - Unless otherwise agreed in writing by the supplier all invoices are payable within thirty (30) days of the date of invoice, in the currency of the invoice, drawn on a bank based in India or by such other method as is agreed in advance by the Supplier.
1907  
1908   - All prices are not inclusive of VAT which shall be payable in addition by the Customer at the applicable rate.';
1909  
1910      $this->db->query("insert into vtiger_inventory_tandc(id,type,tandc) values (".$this->db->getUniqueID("vtiger_inventory_tandc").", 'Inventory', '".$inv_tandc_text."')");    
1911  
1912  //insert into email template vtiger_table
1913  
1914      $body='
1915      Hello!
1916  
1917      On behalf of the vtiger team,  I am pleased to announce the release of vtiger crm4.2 . This is a feature packed release including the mass email template handling, custom view feature, vtiger_reports feature and a host of other utilities. vtiger runs on all platforms.
1918  
1919      Notable Features of vtiger are :
1920      -Email Client Integration
1921      -Trouble Ticket Integration
1922      -Invoice Management Integration
1923      -Reports Integration
1924      -Portal Integration
1925      -Enhanced Word Plugin Support
1926      -Custom View Integration
1927  
1928      Known Issues:
1929      -ABCD
1930      -EFGH
1931      -IJKL
1932      -MNOP
1933      -QRST';
1934  
1935            $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Announcement for Release','Announcement for Release','Announcement of a release','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
1936      
1937  
1938  
1939  $body='name
1940  street,
1941  city,
1942  state,
1943   zip)
1944   
1945   Dear
1946   
1947   Please check the following invoices that are yet to be paid by you:
1948   
1949   No. Date      Amount
1950   1   1/1/01    $4000
1951   2   2/2//01   $5000
1952   3   3/3/01    $10000
1953   4   7/4/01    $23560
1954   
1955   Kindly let us know if there are any issues that you feel are pending to be discussed.
1956   We will be more than happy to give you a call.
1957   We would like to continue our business with you.';
1958  
1959  
1960                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Pending Invoices','Invoices Pending','Payment Due','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
1961  
1962  
1963  
1964  
1965  
1966  $body=' Dear
1967  
1968  Your proposal on the project XYZW has been reviewed by us
1969  and is acceptable in its entirety.
1970  
1971  We are eagerly looking forward to this project
1972  and are pleased about having the opportunity to work
1973  together. We look forward to a long standing relationship
1974  with your esteemed firm.
1975  
1976  I would like to take this opportunity to invite you
1977  to a game of golf on Wednesday morning 9am at the
1978  Cuff Links Ground. We will be waiting for you in the
1979  Executive Lounge.
1980  
1981  Looking forward to seeing you there.';
1982  
1983             
1984                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Acceptance Proposal','Acceptance Proposal','Acceptance of Proposal','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
1985  
1986  
1987  $body= ' The undersigned hereby acknowledges receipt and delivery
1988  of the goods.
1989  The undersigned will release the payment subject to the goods being discovered not satisfactory.
1990  
1991  Signed under seal this <date>';
1992  
1993             
1994                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Goods received acknowledgement','Goods received acknowledgement','Acknowledged Receipt of Goods','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
1995  
1996  
1997             $body= ' Dear
1998       We are in receipt of your order as contained in the
1999     purchase order form.We consider this to be final and binding on both sides.
2000  If there be any exceptions noted, we shall consider them
2001  only if the objection is received within ten days of receipt of
2002  this notice.
2003  
2004  Thank you for your patronage.';
2005  
2006  
2007  
2008             
2009                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Accept Order','Accept Order','Acknowledgement/Acceptance of Order','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
2010  
2011  
2012  
2013  
2014  $body='Dear
2015  
2016  We are relocating our office to
2017  11111,XYZDEF Cross,
2018  UVWWX Circle
2019  The telephone number for this new location is (101) 1212-1328.
2020  
2021  Our Manufacturing Division will continue operations
2022  at 3250 Lovedale Square Avenue, in Frankfurt.
2023  
2024  We hope to keep in touch with you all.
2025  Please update your addressbooks.';
2026  
2027             
2028                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Address Change','Change of Address','Address Change','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
2029  
2030  
2031  
2032  $body='Dear
2033  
2034  Thank you for extending us the opportunity to meet with
2035  you and members of your staff.
2036  
2037  I know that John Doe serviced your account
2038  for many years and made many friends at your firm. He has personally
2039  discussed with me the deep relationship that he had with your firm.
2040  While his presence will be missed, I can promise that we will
2041  continue to provide the fine service that was accorded by
2042  John to your firm.
2043  
2044  I was genuinely touched to receive such fine hospitality.
2045  
2046  Thank you once again.';
2047  
2048  
2049             
2050                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Follow Up','Follow Up','Follow Up of meeting','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
2051  
2052  
2053  
2054  $body='Congratulations!
2055  
2056  The numbers are in and I am proud to inform you that our
2057  total sales for the previous quarter
2058  amounts to $100,000,00.00!. This is the first time
2059  we have exceeded the target by almost 30%.
2060  We have also beat the previous quarter record by a
2061  whopping 75%!
2062  
2063  Let us meet at Smoking Joe for a drink in the evening!
2064  
2065  C you all there guys!';
2066  
2067  
2068             
2069                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Target Crossed!','Target Crossed!','Fantastic Sales Spree!','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
2070  
2071  $body='
2072  Dear
2073  
2074  Thank you for your confidence in our ability to serve you.
2075  We are glad to be given the chance to serve you.I look
2076  forward to establishing a long term partnership with you.
2077  Consider me as a friend.
2078  Should any need arise,please do give us a call.';
2079  
2080  
2081             
2082                 $this->db->query("insert into vtiger_emailtemplates(foldername,templatename,subject,description,body,deleted,templateid) values ('Public','Thanks Note','Thanks Note','Note of thanks','".$body."',0,".$this->db->getUniqueID('vtiger_emailtemplates').")");
2083  
2084          
2085             //Insert into vtiger_organizationdetails vtiger_table 
2086             $this->db->query("insert into vtiger_organizationdetails(organizationname,address,city,state,country,code,phone,fax,website,logoname) values ('vtiger',' 40-41-42, Sivasundar Apartments, Flat D-II, Shastri Street, Velachery','Chennai','Tamil Nadu','India','600 042','+91-44-5202-1990','+91-44-5202-1990','www.vtiger.com','vtiger-crm-logo.jpg')");
2087  
2088  
2089      $this->db->query("insert into vtiger_actionmapping values(0,'Save',0)");
2090      $this->db->query("insert into vtiger_actionmapping values(1,'EditView',0)");
2091      $this->db->query("insert into vtiger_actionmapping values(2,'Delete',0)");
2092      $this->db->query("insert into vtiger_actionmapping values(3,'index',0)");
2093      $this->db->query("insert into vtiger_actionmapping values(4,'DetailView',0)");
2094      $this->db->query("insert into vtiger_actionmapping values(5,'Import',0)");
2095      $this->db->query("insert into vtiger_actionmapping values(6,'Export',0)");
2096      //$this->db->query("insert into vtiger_actionmapping values(7,'AddBusinessCard',0)");
2097      $this->db->query("insert into vtiger_actionmapping values(8,'Merge',0)");
2098      $this->db->query("insert into vtiger_actionmapping values(1,'VendorEditView',1)");
2099      $this->db->query("insert into vtiger_actionmapping values(4,'VendorDetailView',1)");
2100      $this->db->query("insert into vtiger_actionmapping values(0,'SaveVendor',1)");
2101      $this->db->query("insert into vtiger_actionmapping values(2,'DeleteVendor',1)");
2102      $this->db->query("insert into vtiger_actionmapping values(1,'PriceBookEditView',1)");
2103      $this->db->query("insert into vtiger_actionmapping values(4,'PriceBookDetailView',1)");
2104      $this->db->query("insert into vtiger_actionmapping values(0,'SavePriceBook',1)");
2105      $this->db->query("insert into vtiger_actionmapping values(2,'DeletePriceBook',1)");
2106      $this->db->query("insert into vtiger_actionmapping values(9,'ConvertLead',0)");
2107      $this->db->query("insert into vtiger_actionmapping values(1,'DetailViewAjax',1)");
2108      $this->db->query("insert into vtiger_actionmapping values(4,'TagCloud',1)");
2109      $this->db->query("insert into vtiger_actionmapping values(1,'QuickCreate',1)");
2110      $this->db->query("insert into vtiger_actionmapping values(3,'Popup',1)");
2111  
2112      //Insert values for vtiger_moduleowners vtiger_table which contains the modules and their vtiger_users. default user id admin - after 4.2 patch 2
2113      $module_array = Array('Potentials','Contacts','Accounts','Leads','Notes','Calendar','Emails','HelpDesk','Products','Faq','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Reports','Campaigns');
2114      foreach($module_array as $mod)
2115      {
2116          $this->db->query("insert into vtiger_moduleowners values(".getTabid($mod).",1)");
2117      }
2118      //added by jeri for category view from db
2119      $this->db->query("insert into vtiger_parenttab values (1,'My Home Page',1,0)");
2120      $this->db->query("insert into vtiger_parenttab values (2,'Marketing',2,0)");
2121      $this->db->query("insert into vtiger_parenttab values (3,'Sales',3,0)");
2122      $this->db->query("insert into vtiger_parenttab values (4,'Support',4,0)");
2123      $this->db->query("insert into vtiger_parenttab values (5,'Analytics',5,0)");
2124      $this->db->query("insert into vtiger_parenttab values (6,'Inventory',6,0)");
2125      $this->db->query("insert into vtiger_parenttab values (7,'Tools',7,0)");
2126      $this->db->query("insert into vtiger_parenttab values (8,'Settings',8,0)");
2127  
2128      $this->db->query("insert into vtiger_parenttabrel values (1,9,2)");
2129      $this->db->query("insert into vtiger_parenttabrel values (1,10,4)");
2130      $this->db->query("insert into vtiger_parenttabrel values (1,3,1)");
2131      $this->db->query("insert into vtiger_parenttabrel values (3,7,1)");
2132      $this->db->query("insert into vtiger_parenttabrel values (3,6,2)");
2133      $this->db->query("insert into vtiger_parenttabrel values (3,4,3)");
2134      $this->db->query("insert into vtiger_parenttabrel values (3,2,4)");
2135      $this->db->query("insert into vtiger_parenttabrel values (3,20,5)");
2136      $this->db->query("insert into vtiger_parenttabrel values (3,22,6)");
2137      $this->db->query("insert into vtiger_parenttabrel values (3,23,7)");
2138      $this->db->query("insert into vtiger_parenttabrel values (3,14,8)");
2139      $this->db->query("insert into vtiger_parenttabrel values (3,19,9)");
2140      $this->db->query("insert into vtiger_parenttabrel values (3,8,10)");
2141      $this->db->query("insert into vtiger_parenttabrel values (4,13,1)");
2142      $this->db->query("insert into vtiger_parenttabrel values (4,15,2)");
2143      $this->db->query("insert into vtiger_parenttabrel values (4,6,3)");
2144      $this->db->query("insert into vtiger_parenttabrel values (4,4,4)");
2145      $this->db->query("insert into vtiger_parenttabrel values (4,14,5)");
2146      $this->db->query("insert into vtiger_parenttabrel values (4,8,6)");
2147      $this->db->query("insert into vtiger_parenttabrel values (5,1,1)");
2148      $this->db->query("insert into vtiger_parenttabrel values (5,25,2)");
2149      $this->db->query("insert into vtiger_parenttabrel values (6,14,1)");
2150      $this->db->query("insert into vtiger_parenttabrel values (6,18,2)");
2151      $this->db->query("insert into vtiger_parenttabrel values (6,19,3)");
2152      $this->db->query("insert into vtiger_parenttabrel values (6,21,4)");
2153      $this->db->query("insert into vtiger_parenttabrel values (6,22,5)");
2154      $this->db->query("insert into vtiger_parenttabrel values (6,20,6)");
2155      $this->db->query("insert into vtiger_parenttabrel values (6,23,7)");
2156      $this->db->query("insert into vtiger_parenttabrel values (7,24,1)");
2157      $this->db->query("insert into vtiger_parenttabrel values (7,27,2)");
2158      $this->db->query("insert into vtiger_parenttabrel values (7,8,3)");
2159      $this->db->query("insert into vtiger_parenttabrel values (2,26,1)");
2160      $this->db->query("insert into vtiger_parenttabrel values (2,6,2)");
2161      $this->db->query("insert into vtiger_parenttabrel values (2,4,3)");
2162      $this->db->query("insert into vtiger_parenttabrel values (2,10,4)");
2163      $this->db->query("insert into vtiger_parenttabrel values (4,10,7)");
2164      $this->db->query("insert into vtiger_parenttabrel values (2,7,5)");
2165      $this->db->query("insert into vtiger_parenttabrel values (2,9,6)");
2166      $this->db->query("insert into vtiger_parenttabrel values (4,9,8)");
2167      $this->db->query("insert into vtiger_parenttabrel values (2,8,8)");
2168      $this->db->query("insert into vtiger_parenttabrel values (3,9,11)");
2169          
2170      //Added to populate the default inventory tax informations
2171      $vatid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
2172      $salesid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
2173      $serviceid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
2174      $this->db->query("insert into vtiger_inventorytaxinfo values($vatid,'tax".$vatid."','VAT','4.50','0')");
2175      $this->db->query("insert into vtiger_inventorytaxinfo values($salesid,'tax".$salesid."','Sales','10.00','0')");
2176      $this->db->query("insert into vtiger_inventorytaxinfo values($serviceid,'tax".$serviceid."','Service','12.50','0')");
2177      //After added these taxes we should add these taxes as columns in vtiger_inventoryproductrel table
2178      $this->db->query("alter table vtiger_inventoryproductrel add column tax$vatid decimal(7,3) default NULL");
2179      $this->db->query("alter table vtiger_inventoryproductrel add column tax$salesid decimal(7,3) default NULL");
2180      $this->db->query("alter table vtiger_inventoryproductrel add column tax$serviceid decimal(7,3) default NULL");
2181  
2182  
2183      //Added to populate the default Shipping & Hanlding tax informations
2184      $shvatid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
2185      $shsalesid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
2186      $shserviceid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
2187      $this->db->query("insert into vtiger_shippingtaxinfo values($shvatid,'shtax".$shvatid."','VAT','4.50','0')");
2188      $this->db->query("insert into vtiger_shippingtaxinfo values($shsalesid,'shtax".$shsalesid."','Sales','10.00','0')");
2189      $this->db->query("insert into vtiger_shippingtaxinfo values($shserviceid,'shtax".$shserviceid."','Service','12.50','0')");
2190      //After added these taxes we should add these taxes as columns in vtiger_inventoryshippingrel table
2191      $this->db->query("alter table vtiger_inventoryshippingrel add column shtax$shvatid decimal(7,3) default NULL");
2192      $this->db->query("alter table vtiger_inventoryshippingrel add column shtax$shsalesid decimal(7,3) default NULL");
2193      $this->db->query("alter table vtiger_inventoryshippingrel add column shtax$shserviceid decimal(7,3) default NULL");
2194  
2195  
2196      }
2197  }
2198  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7