[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/include/ -> PopulateComboValues.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9   ********************************************************************************/
  10  
  11  include_once ('config.php');
  12  require_once ('include/logging.php');
  13  require_once ('include/language/en_us.lang.php');
  14  require_once ('include/database/PearDatabase.php');
  15  require_once ('include/ComboStrings.php');
  16  /**
  17   *  Class which handles the population of the combo values
  18   * 
  19   *
  20   */
  21  class PopulateComboValues
  22  {
  23      var $app_list_strings;
  24  
  25  
  26      /** 
  27       * To populate the default combo values for the combo vtiger_tables
  28       * @param $values -- values:: Type string array
  29       * @param $tableName -- tablename:: Type string 
  30       */
  31  	function insertComboValues($values, $tableName)
  32      {
  33          global $log;
  34          $log->debug("Entering insertComboValues(".$values.", ".$tableName.") method ...");
  35          global $adb;
  36          $i=0;
  37          foreach ($values as $val => $cal)
  38          {
  39              $id = $adb->getUniqueID('vtiger_'.$tableName);
  40              if($val != '')
  41              {
  42                  $adb->query("insert into vtiger_".$tableName. " values(".$id.",'".$val."',".$i.",1)");
  43              }
  44              else
  45              {
  46                  $adb->query("insert into vtiger_".$tableName. " values(".$id.",'--None--',".$i.",1)");
  47              }
  48              $i++;
  49          }
  50          $log->debug("Exiting insertComboValues method ...");
  51      }
  52  
  53  
  54      /** 
  55       * To populate the combo vtiger_tables at startup time
  56       */
  57  
  58  	function create_tables () 
  59      {
  60          global $log;
  61          $log->debug("Entering create_tables () method ...");
  62                  
  63          global $app_list_strings,$adb;
  64          global $combo_strings;
  65          $comboTables = Array('leadsource','accounttype','industry','leadstatus','rating','licencekeystatus','opportunity_type','salutationtype','sales_stage','ticketstatus','ticketpriorities','ticketseverities','ticketcategories','duration_minutes','eventstatus','taskstatus','taskpriority','manufacturer','productcategory','activitytype','currency','faqcategories','usageunit','glacct','quotestage','carrier','taxclass','recurringtype','faqstatus','invoicestatus','postatus','sostatus','visibility','campaigntype','campaignstatus','expectedresponse','status','activity_view','lead_view','date_format');
  66  
  67          foreach ($comboTables as $comTab)
  68          {
  69              $this->insertComboValues($combo_strings[$comTab."_dom"],$comTab);
  70          }
  71          $log->debug("Exiting create_tables () method ...");
  72      }
  73  }
  74  ?>


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