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


PHP CRM_Campaign_PseudoConstant::activityType方法代码示例

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


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

示例1: from

 /**
  * @param string $name
  * @param $mode
  * @param $side
  *
  * @return null|string
  */
 public static function from($name, $mode, $side)
 {
     $from = NULL;
     //get survey clause in force,
     //only when we have survey id.
     if (!self::$_applySurveyClause) {
         return $from;
     }
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
     $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
     switch ($name) {
         case self::CIVICRM_ACTIVITY_TARGET:
             $from = " INNER JOIN civicrm_activity_contact civicrm_activity_target\n   ON ( civicrm_activity_target.contact_id = contact_a.id AND civicrm_activity_target.record_type_id = {$targetID}) ";
             break;
         case self::CIVICRM_ACTIVITY:
             $surveyActivityTypes = CRM_Campaign_PseudoConstant::activityType();
             $surveyKeys = "(" . implode(',', array_keys($surveyActivityTypes)) . ")";
             $from = " INNER JOIN civicrm_activity ON ( civicrm_activity.id = civicrm_activity_target.activity_id\n                                 AND civicrm_activity.activity_type_id IN {$surveyKeys} ) ";
             break;
         case self::CIVICRM_ACTIVITY_ASSIGNMENT:
             $from = "\nINNER JOIN  civicrm_activity_contact civicrm_activity_assignment ON ( civicrm_activity.id = civicrm_activity_assignment.activity_id AND\ncivicrm_activity_assignment.record_type_id = {$assigneeID} ) ";
             break;
         case 'civicrm_survey':
             $from = " INNER JOIN civicrm_survey ON ( civicrm_survey.id = civicrm_activity.source_record_id ) ";
             break;
         case 'civicrm_campaign':
             $from = " {$side} JOIN civicrm_campaign ON ( civicrm_campaign.id = civicrm_survey.campaign_id ) ";
             break;
     }
     return $from;
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:40,代码来源:Query.php

示例2: from

 static function from($name, $mode, $side)
 {
     $from = null;
     //get survey clause in force,
     //only when we have survey id.
     if (!self::$_applySurveyClause) {
         return $from;
     }
     switch ($name) {
         case self::civicrm_activity_target:
             $from = " INNER JOIN civicrm_activity_target ON civicrm_activity_target.target_contact_id = contact_a.id ";
             break;
         case self::civicrm_activity:
             require_once 'CRM/Campaign/PseudoConstant.php';
             $surveyActivityTypes = CRM_Campaign_PseudoConstant::activityType();
             $surveyKeys = "(" . implode(',', array_keys($surveyActivityTypes)) . ")";
             $from = " \nINNER JOIN civicrm_activity ON ( civicrm_activity.id = civicrm_activity_target.activity_id AND \n                                 civicrm_activity.activity_type_id IN {$surveyKeys} )\nINNER JOIN civicrm_activity_assignment ON ( civicrm_activity.id = civicrm_activity_assignment.activity_id )\n";
             break;
         case 'civicrm_survey':
             $from = " INNER JOIN civicrm_survey ON civicrm_survey.id = civicrm_activity.source_record_id ";
             break;
         case 'civicrm_campaign':
             $from = " {$side} JOIN civicrm_campaign ON civicrm_campaign.id = civicrm_survey.campaign_id ";
             break;
     }
     return $from;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:27,代码来源:Query.php


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