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


PHP Vtiger_Field_Model::getPicklistValues方法代码示例

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


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

示例1: getPicklistValues

 public function getPicklistValues()
 {
     $fieldDataType = $this->getFieldDataType();
     if ($fieldDataType != 'picklist') {
         return parent::getPicklistValues();
     }
     $pickListValues = array();
     $pickListValues[""] = vtranslate("LBL_SELECT_OPTION", 'Settings:Webforms');
     return $pickListValues + parent::getPicklistValues();
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:10,代码来源:ModuleField.php

示例2: getPicklistValues

 /**
  * Function which will give the picklistvalues for given roleids
  * @param type $roleIdList -- array of role ids
  * @param type $groupMode -- Intersection/Conjuction , intersection will give only picklist values that exist for all roles
  * @return type -- array
  */
 public function getPicklistValues($roleIdList, $groupMode = 'INTERSECTION')
 {
     if (!$this->isRoleBased()) {
         return parent::getPicklistValues();
     }
     $intersectionMode = false;
     if ($groupMode == 'INTERSECTION') {
         $intersectionMode = true;
     }
     $db = PearDatabase::getInstance();
     $fieldName = $this->getName();
     $tableName = 'vtiger_' . $fieldName;
     $idColName = $fieldName . 'id';
     $query = 'SELECT ' . $fieldName;
     if ($intersectionMode) {
         $query .= ',count(roleid) as rolecount ';
     }
     $query .= ' FROM  vtiger_role2picklist INNER JOIN ' . $tableName . ' ON vtiger_role2picklist.picklistvalueid = ' . $tableName . '.picklist_valueid' . ' WHERE roleid IN (' . generateQuestionMarks($roleIdList) . ') order by sortid';
     if ($intersectionMode) {
         $query .= ' GROUP BY picklistvalueid';
     }
     $result = $db->pquery($query, $roleIdList);
     $pickListValues = array();
     $num_rows = $db->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         $rowData = $db->query_result_rowdata($result, $i);
         if ($intersectionMode) {
             //not equal if specify that the picklistvalue is not present for all the roles
             if ($rowData['rolecount'] != count($roleIdList)) {
                 continue;
             }
         }
         //Need to decode the picklist values twice which are saved from old ui
         $pickListValues[] = decode_html(decode_html($rowData[$fieldName]));
     }
     return $pickListValues;
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:43,代码来源:Field.php

示例3: getPicklistValues

 /**
  * Function to get all the available picklist values for the current field
  * @return <Array> List of picklist values if the field is of type picklist or multipicklist, null otherwise.
  */
 public function getPicklistValues()
 {
     if ($this->get('uitype') == 32) {
         return Vtiger_Language_Handler::getAllLanguages();
     } else {
         if ($this->get('uitype') == '115') {
             $db = PearDatabase::getInstance();
             $query = 'SELECT ' . $this->getFieldName() . ' FROM vtiger_' . $this->getFieldName();
             $result = $db->pquery($query, array());
             $num_rows = $db->num_rows($result);
             $fieldPickListValues = array();
             for ($i = 0; $i < $num_rows; $i++) {
                 $picklistValue = $db->query_result($result, $i, $this->getFieldName());
                 $fieldPickListValues[$picklistValue] = vtranslate($picklistValue, $this->getModuleName());
             }
             return $fieldPickListValues;
         }
     }
     return parent::getPicklistValues();
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:24,代码来源:Field.php


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