當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。