当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Util_Helper::getPickListId方法代码示例

本文整理汇总了PHP中Vtiger_Util_Helper::getPickListId方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Util_Helper::getPickListId方法的具体用法?PHP Vtiger_Util_Helper::getPickListId怎么用?PHP Vtiger_Util_Helper::getPickListId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Util_Helper的用法示例。


在下文中一共展示了Vtiger_Util_Helper::getPickListId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getValuesFromField

 public static function getValuesFromField($fieldName)
 {
     $db = PearDatabase::getInstance();
     $primaryKey = Vtiger_Util_Helper::getPickListId($fieldName);
     $query = 'SELECT * FROM vtiger_' . $fieldName . ' order by sortorderid';
     $values = array();
     $result = $db->pquery($query, array());
     $num_rows = $db->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         //Need to decode the picklist values twice which are saved from old ui
         $groupColors[] = array('id' => $db->query_result($result, $i, $primaryKey), 'value' => decode_html(decode_html($db->query_result($result, $i, $fieldName))), 'color' => $db->query_result($result, $i, 'color'));
     }
     return $groupColors;
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:14,代码来源:Colors.php

示例2: getPickListValues

	/**
     * Function which will give the picklist values for a field
     * @param type $fieldName -- string
     * @return type -- array of values
     */
    public static function getPickListValues($fieldName) {
        $cache = Vtiger_Cache::getInstance();
        if($cache->getPicklistValues($fieldName)) {
            return $cache->getPicklistValues($fieldName);
        }
        $db = PearDatabase::getInstance();

		$primaryKey = Vtiger_Util_Helper::getPickListId($fieldName);
        $query = 'SELECT '.$primaryKey.', '.$fieldName.' FROM vtiger_'.$fieldName.' order by sortorderid';
        $values = array();
        $result = $db->pquery($query, array());
        $num_rows = $db->num_rows($result);
        for($i=0; $i<$num_rows; $i++) {
			//Need to decode the picklist values twice which are saved from old ui
            $values[$db->query_result($result,$i,$primaryKey)] = decode_html(decode_html($db->query_result($result,$i,$fieldName)));
        }
        $cache->setPicklistValues($fieldName, $values);
        return $values;
    }
开发者ID:jeremyevans6,项目名称:kulturedTiger-,代码行数:24,代码来源:Util.php

示例3: updateSequence

 public function updateSequence($pickListFieldName, $picklistValues)
 {
     $db = PearDatabase::getInstance();
     $primaryKey = Vtiger_Util_Helper::getPickListId($pickListFieldName);
     $query = 'UPDATE ' . $this->getPickListTableName($pickListFieldName) . ' SET sortorderid = CASE ';
     foreach ($picklistValues as $values => $sequence) {
         $query .= ' WHEN ' . $primaryKey . '="' . $values . '" THEN "' . $sequence . '"';
     }
     $query .= ' END';
     $db->pquery($query, array());
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:11,代码来源:Module.php

示例4: getPickListValues

 /**
  * Function which will give the picklist values for a field
  * @param type $fieldName -- string
  * @return type -- array of values
  */
 public static function getPickListValues($fieldName)
 {
     $cache = Vtiger_Cache::getInstance();
     if ($cache->getPicklistValues($fieldName)) {
         return $cache->getPicklistValues($fieldName);
     }
     $db = PearDatabase::getInstance();
     $primaryKey = Vtiger_Util_Helper::getPickListId($fieldName);
     $query = 'SELECT ' . $primaryKey . ', ' . $fieldName . ' FROM vtiger_' . $fieldName . ' order by sortorderid';
     $values = [];
     $result = $db->query($query);
     while ($row = $db->fetch_array($result)) {
         $values[$row[$primaryKey]] = decode_html(decode_html($row[$fieldName]));
     }
     $cache->setPicklistValues($fieldName, $values);
     return $values;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:22,代码来源:Util.php

示例5: getNonEditablePicklistValues

 /**
  * Function which will give the non editable picklist values for a field
  * @param type $fieldName -- string
  * @return type -- array of values
  */
 public static function getNonEditablePicklistValues($fieldName)
 {
     $cache = Vtiger_Cache::getInstance();
     $NonEditablePicklistValues = $cache->get('NonEditablePicklistValues', $fieldName);
     if ($NonEditablePicklistValues) {
         return $NonEditablePicklistValues;
     }
     $db = PearDatabase::getInstance();
     //SalesPlatform.ru begin fix picklist value unique id cretation
     $primaryKey = Vtiger_Util_Helper::getPickListId($fieldName);
     $query = "select {$primaryKey} ,{$fieldName} from vtiger_{$fieldName} where presence=0";
     //$query = "select $fieldName from vtiger_$fieldName where presence=0";
     //SalesPlatform.ru end
     $values = array();
     $result = $db->pquery($query, array());
     $num_rows = $db->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         //Need to decode the picklist values twice which are saved from old ui
         //SalesPlatform.ru begin fix picklist value unique id cretation
         $values[$db->query_result($result, $i, $primaryKey)] = decode_html(decode_html($db->query_result($result, $i, $fieldName)));
         //$values[] = decode_html(decode_html($db->query_result($result,$i,$fieldName)));
         //SalesPlatform.ru end
     }
     $cache->set('NonEditablePicklistValues', $fieldName, $values);
     return $values;
 }
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:31,代码来源:Field.php

示例6: getEditablePicklistValues

 /**
  * Function which will give the editable picklist values for a field
  * @param type $fieldName -- string
  * @return type -- array of values
  */
 public static function getEditablePicklistValues($fieldName)
 {
     $cache = Vtiger_Cache::getInstance();
     $EditablePicklistValues = $cache->get('EditablePicklistValues', $fieldName);
     if ($EditablePicklistValues) {
         return $EditablePicklistValues;
     }
     $db = PearDatabase::getInstance();
     $primaryKey = Vtiger_Util_Helper::getPickListId($fieldName);
     $query = "SELECT {$primaryKey} ,{$fieldName} FROM vtiger_{$fieldName} WHERE presence=1 AND {$fieldName} <> '--None--'";
     $values = array();
     $result = $db->pquery($query, array());
     $num_rows = $db->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         //Need to decode the picklist values twice which are saved from old ui
         $values[$db->query_result($result, $i, $primaryKey)] = decode_html(decode_html($db->query_result($result, $i, $fieldName)));
     }
     $cache->set('EditablePicklistValues', $fieldName, $values);
     return $values;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:25,代码来源:Field.php


注:本文中的Vtiger_Util_Helper::getPickListId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。