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


PHP CRM_Utils_Hook::entityRefFilters方法代码示例

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


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

示例1: getEntityRefFilters

 /**
  * Provide a list of available entityRef filters.
  * @todo: move component filters into their respective components (e.g. CiviEvent)
  *
  * @return array
  */
 public static function getEntityRefFilters()
 {
     $filters = array();
     $config = CRM_Core_Config::singleton();
     if (in_array('CiviEvent', $config->enableComponents)) {
         $filters['event'] = array(array('key' => 'event_type_id', 'value' => ts('Event Type')), array('key' => 'start_date', 'value' => ts('Start Date'), 'options' => array(array('key' => '{">":"now"}', 'value' => ts('Upcoming')), array('key' => '{"BETWEEN":["now - 3 month","now"]}', 'value' => ts('Past 3 Months')), array('key' => '{"BETWEEN":["now - 6 month","now"]}', 'value' => ts('Past 6 Months')), array('key' => '{"BETWEEN":["now - 1 year","now"]}', 'value' => ts('Past Year')))));
     }
     $filters['activity'] = array(array('key' => 'activity_type_id', 'value' => ts('Activity Type')), array('key' => 'status_id', 'value' => ts('Activity Status')));
     $filters['contact'] = array(array('key' => 'contact_type', 'value' => ts('Contact Type')), array('key' => 'group', 'value' => ts('Group'), 'entity' => 'group_contact'), array('key' => 'tag', 'value' => ts('Tag'), 'entity' => 'entity_tag'), array('key' => 'state_province', 'value' => ts('State/Province'), 'entity' => 'address'), array('key' => 'country', 'value' => ts('Country'), 'entity' => 'address'), array('key' => 'gender_id', 'value' => ts('Gender')), array('key' => 'is_deceased', 'value' => ts('Deceased')), array('key' => 'source', 'value' => ts('Contact Source'), 'type' => 'text'));
     if (in_array('CiviCase', $config->enableComponents)) {
         $filters['case'] = array(array('key' => 'case_id.case_type_id', 'value' => ts('Case Type'), 'entity' => 'Case'), array('key' => 'case_id.status_id', 'value' => ts('Case Status'), 'entity' => 'Case'));
         foreach ($filters['contact'] as $filter) {
             $filter += array('entity' => 'contact');
             $filter['key'] = 'contact_id.' . $filter['key'];
             $filters['case'][] = $filter;
         }
     }
     CRM_Utils_Hook::entityRefFilters($filters);
     return $filters;
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:26,代码来源:Resources.php


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