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


PHP CRM_Core_SelectValues::getDedupeRuleTypes方法代码示例

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


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

示例1: preProcess

 /**
  * Pre processing.
  *
  * @return void
  */
 public function preProcess()
 {
     // Ensure user has permission to be here
     if (!CRM_Core_Permission::check('administer dedupe rules')) {
         CRM_Utils_System::permissionDenied();
         CRM_Utils_System::civiExit();
     }
     $this->_options = CRM_Core_SelectValues::getDedupeRuleTypes();
     $this->_rgid = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0);
     $this->_contactType = CRM_Utils_Request::retrieve('contact_type', 'String', $this, FALSE, 0);
     if ($this->_rgid) {
         $rgDao = new CRM_Dedupe_DAO_RuleGroup();
         $rgDao->id = $this->_rgid;
         $rgDao->find(TRUE);
         $this->_defaults['threshold'] = $rgDao->threshold;
         $this->_contactType = $rgDao->contact_type;
         $this->_defaults['used'] = CRM_Utils_Array::key($rgDao->used, $this->_options);
         $this->_defaults['title'] = $rgDao->title;
         $this->_defaults['name'] = $rgDao->name;
         $this->_defaults['is_reserved'] = $rgDao->is_reserved;
         $this->assign('isReserved', $rgDao->is_reserved);
         $this->assign('ruleName', $rgDao->name);
         $ruleDao = new CRM_Dedupe_DAO_Rule();
         $ruleDao->dedupe_rule_group_id = $this->_rgid;
         $ruleDao->find();
         $count = 0;
         while ($ruleDao->fetch()) {
             $this->_defaults["where_{$count}"] = "{$ruleDao->rule_table}.{$ruleDao->rule_field}";
             $this->_defaults["length_{$count}"] = $ruleDao->rule_length;
             $this->_defaults["weight_{$count}"] = $ruleDao->rule_weight;
             $count++;
         }
     }
     $supported = CRM_Dedupe_BAO_RuleGroup::supportedFields($this->_contactType);
     if (is_array($supported)) {
         foreach ($supported as $table => $fields) {
             foreach ($fields as $field => $title) {
                 $this->_fields["{$table}.{$field}"] = $title;
             }
         }
     }
     asort($this->_fields);
 }
开发者ID:rajeshrhino,项目名称:civicrm-core,代码行数:48,代码来源:DedupeRules.php

示例2: browse

 /**
  * Browse all rule groups.
  */
 public function browse()
 {
     // get all rule groups
     $ruleGroups = array();
     $dao = new CRM_Dedupe_DAO_RuleGroup();
     $dao->orderBy('contact_type,used ASC');
     $dao->find();
     $dedupeRuleTypes = CRM_Core_SelectValues::getDedupeRuleTypes();
     while ($dao->fetch()) {
         $ruleGroups[$dao->contact_type][$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $ruleGroups[$dao->contact_type][$dao->id]);
         // form all action links
         $action = array_sum(array_keys($this->links()));
         $links = self::links();
         /* if ($dao->is_default) {
            unset($links[CRM_Core_Action::MAP]);
            unset($links[CRM_Core_Action::DELETE]);
            }*/
         if ($dao->is_reserved) {
             unset($links[CRM_Core_Action::DELETE]);
         }
         $ruleGroups[$dao->contact_type][$dao->id]['action'] = CRM_Core_Action::formLink($links, $action, array('id' => $dao->id), ts('more'), FALSE, 'dedupeRule.manage.action', 'DedupeRule', $dao->id);
         $ruleGroups[$dao->contact_type][$dao->id]['used_display'] = $dedupeRuleTypes[$ruleGroups[$dao->contact_type][$dao->id]['used']];
     }
     $this->assign('brows', $ruleGroups);
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:29,代码来源:DedupeRules.php


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