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


PHP CRM_Core_BAO_CustomField::orderBy方法代码示例

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


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

示例1: browse

 /**
  * Browse all custom group fields.
  *
  * @return void
  */
 public function browse()
 {
     $resourceManager = CRM_Core_Resources::singleton();
     if (!empty($_GET['new']) && $resourceManager->ajaxPopupsEnabled) {
         $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999, 'html-header');
     }
     $customField = array();
     $customFieldBAO = new CRM_Core_BAO_CustomField();
     // fkey is gid
     $customFieldBAO->custom_group_id = $this->_gid;
     $customFieldBAO->orderBy('weight, label');
     $customFieldBAO->find();
     while ($customFieldBAO->fetch()) {
         $customField[$customFieldBAO->id] = array();
         CRM_Core_DAO::storeValues($customFieldBAO, $customField[$customFieldBAO->id]);
         $action = array_sum(array_keys($this->actionLinks()));
         if ($customFieldBAO->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         switch ($customFieldBAO->data_type) {
             case "String":
             case "Int":
             case "Float":
             case "Money":
                 // if Multi Select field is selected in custom field
                 if ($customFieldBAO->html_type == 'Text') {
                     $action -= CRM_Core_Action::BROWSE;
                 }
                 break;
             case "ContactReference":
             case "Memo":
             case "Date":
             case "Boolean":
             case "StateProvince":
             case "Country":
             case "File":
             case "Link":
                 $action -= CRM_Core_Action::BROWSE;
                 break;
         }
         $customFieldDataType = CRM_Core_BAO_CustomField::dataType();
         $customField[$customFieldBAO->id]['data_type'] = $customFieldDataType[$customField[$customFieldBAO->id]['data_type']];
         $customField[$customFieldBAO->id]['order'] = $customField[$customFieldBAO->id]['weight'];
         $customField[$customFieldBAO->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array('id' => $customFieldBAO->id, 'gid' => $this->_gid), ts('more'), FALSE, 'customField.row.actions', 'CustomField', $customFieldBAO->id);
     }
     $returnURL = CRM_Utils_System::url('civicrm/admin/custom/group/field', "reset=1&action=browse&gid={$this->_gid}");
     $filter = "custom_group_id = {$this->_gid}";
     CRM_Utils_Weight::addOrder($customField, 'CRM_Core_DAO_CustomField', 'id', $returnURL, $filter);
     $this->assign('customField', $customField);
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:57,代码来源:Field.php

示例2: browse

 /**
  * Browse all custom group fields.
  * 
  * @param null
  * 
  * @return void
  * @access public
  */
 function browse()
 {
     require_once 'CRM/Core/BAO/CustomField.php';
     $customField = array();
     $customFieldBAO = new CRM_Core_BAO_CustomField();
     // fkey is gid
     $customFieldBAO->custom_group_id = $this->_gid;
     $customFieldBAO->orderBy('weight, label');
     $customFieldBAO->find();
     while ($customFieldBAO->fetch()) {
         $customField[$customFieldBAO->id] = array();
         CRM_Core_DAO::storeValues($customFieldBAO, $customField[$customFieldBAO->id]);
         $action = array_sum(array_keys($this->actionLinks()));
         if ($customFieldBAO->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         switch ($customFieldBAO->data_type) {
             case "String":
             case "Int":
             case "Float":
             case "Money":
                 // if Multi Select field is selected in custom field
                 if ($customFieldBAO->html_type == 'Text') {
                     $action -= CRM_Core_Action::BROWSE;
                 }
                 break;
             case "ContactReference":
             case "Memo":
             case "Date":
             case "Boolean":
             case "StateProvince":
             case "Country":
             case "File":
             case "Link":
                 $action -= CRM_Core_Action::BROWSE;
                 break;
         }
         $customFieldDataType = CRM_Core_BAO_CustomField::dataType();
         $customField[$customFieldBAO->id]['data_type'] = $customFieldDataType[$customField[$customFieldBAO->id]['data_type']];
         $customField[$customFieldBAO->id]['order'] = $customField[$customFieldBAO->id]['weight'];
         $customField[$customFieldBAO->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array('id' => $customFieldBAO->id, 'gid' => $this->_gid));
     }
     $returnURL = CRM_Utils_System::url('civicrm/admin/custom/group/field', "reset=1&action=browse&gid={$this->_gid}");
     $filter = "custom_group_id = {$this->_gid}";
     require_once 'CRM/Utils/Weight.php';
     CRM_Utils_Weight::addOrder($customField, 'CRM_Core_DAO_CustomField', 'id', $returnURL, $filter);
     $this->assign('customField', $customField);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:58,代码来源:Field.php


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