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


PHP CRM_Core_BAO_UFGroup::getWeight方法代码示例

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


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

示例1: setDefaultValues

 /**
  * This function sets the default values for the form. Note that in edit/view mode
  * the default values are retrieved from the database
  *
  * @access public
  *
  * @return void
  */
 function setDefaultValues()
 {
     $defaults = array();
     $showHide = new CRM_Core_ShowHideBlocks();
     if ($this->_action == CRM_Core_Action::ADD) {
         $defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_UFJoin');
     }
     //id fetched for Dojo Pane
     $pId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     if (isset($pId)) {
         $this->_id = $pId;
     }
     if (isset($this->_id)) {
         $defaults['weight'] = CRM_Core_BAO_UFGroup::getWeight($this->_id);
         $params = array('id' => $this->_id);
         CRM_Core_BAO_UFGroup::retrieve($params, $defaults);
         $defaults['group'] = CRM_Utils_Array::value('limit_listings_group_id', $defaults);
         $defaults['add_contact_to_group'] = CRM_Utils_Array::value('add_to_group_id', $defaults);
         //get the uf join records for current uf group
         $ufJoinRecords = CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id);
         foreach ($ufJoinRecords as $key => $value) {
             $checked[$value] = 1;
         }
         $defaults['uf_group_type'] = isset($checked) ? $checked : "";
         //get the uf join records for current uf group other than default modules
         $otherModules = array();
         $otherModules = CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id, TRUE, TRUE);
         if (!empty($otherModules)) {
             $otherModuleString = NULL;
             foreach ($otherModules as $key) {
                 $otherModuleString .= " [ x ] <label>" . $key . "</label>";
             }
             $this->assign('otherModuleString', $otherModuleString);
         }
         $showAdvanced = 0;
         $advFields = array('group', 'post_URL', 'cancel_URL', 'add_captcha', 'is_map', 'is_uf_link', 'is_edit_link', 'is_update_dupe', 'is_cms_user', 'is_proximity_search');
         foreach ($advFields as $key) {
             if (!empty($defaults[$key])) {
                 $showAdvanced = 1;
                 $this->_allPanes['Advanced Settings']['open'] = 'true';
                 break;
             }
         }
     } else {
         $defaults['is_active'] = 1;
         $defaults['is_map'] = 0;
         $defaults['is_update_dupe'] = 0;
         $defaults['is_proximity_search'] = 0;
     }
     // Don't assign showHide elements to template in DELETE mode (fields to be shown and hidden don't exist)
     if (!($this->_action & CRM_Core_Action::DELETE) && !($this->_action & CRM_Core_Action::DISABLE)) {
         $showHide->addToTemplate();
     }
     $this->assign('allPanes', $this->_allPanes);
     return $defaults;
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:64,代码来源:Group.php

示例2: setDefaultValues

 /**
  * This function sets the default values for the form. Note that in edit/view mode
  * the default values are retrieved from the database
  *
  * @access public
  * @return void
  */
 function setDefaultValues()
 {
     $defaults = array();
     if ($this->_action == CRM_CORE_ACTION_ADD) {
         $defaults['weight'] = CRM_Core_BAO_UFGroup::getWeight();
         $UFGroupType = CRM_Core_SelectValues::ufGroupTypes();
         foreach ($UFGroupType as $key => $value) {
             $checked[$key] = 1;
         }
         $defaults['uf_group_type'] = $checked;
     }
     if (isset($this->_id)) {
         $defaults['weight'] = CRM_Core_BAO_UFGroup::getWeight($this->_id);
         $params = array('id' => $this->_id);
         CRM_Core_BAO_UFGroup::retrieve($params, $defaults);
         $defaults['group'] = $defaults['limit_listings_group_id'];
         //get the uf join records for current uf group
         $ufJoinRecords = CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id);
         foreach ($ufJoinRecords as $key => $value) {
             $checked[$value] = 1;
         }
         $defaults['uf_group_type'] = $checked;
         //get the uf join records for current uf group other than default modules
         $otherModules = array();
         $otherModules = CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id, true, true);
         if (!empty($otherModules)) {
             foreach ($otherModules as $key) {
                 $otherModuleString .= " [ x ] " . $key;
             }
             $this->assign('otherModuleString', $otherModuleString);
         }
     } else {
         $defaults['is_active'] = 1;
     }
     return $defaults;
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:43,代码来源:Group.php


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