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