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


PHP CRM_Core_BAO_Log::useLoggingReport方法代码示例

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


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

示例1: browse

 /**
  * This function is called when action is browse
  *
  * return null
  * @access public
  */
 function browse()
 {
     $loggingReport = CRM_Core_BAO_Log::useLoggingReport();
     $this->assign('useLogging', $loggingReport);
     if ($loggingReport) {
         $this->assign('instanceUrl', CRM_Utils_System::url("civicrm/report/instance/{$loggingReport}", "reset=1&force=1&snippet=4&section=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE));
         return;
     }
     $log = new CRM_Core_DAO_Log();
     $log->entity_table = 'civicrm_contact';
     $log->entity_id = $this->_contactId;
     $log->orderBy('modified_date desc');
     $log->find();
     $logEntries = array();
     while ($log->fetch()) {
         list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($log->modified_id);
         $logEntries[] = array('id' => $log->modified_id, 'name' => $displayName, 'image' => $contactImage, 'date' => $log->modified_date);
     }
     $this->assign('logCount', count($logEntries));
     $this->assign_by_ref('log', $logEntries);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:27,代码来源:Log.php

示例2: getCountComponent

 /**
  * Given the component name and returns the count of participation of contact.
  *
  * @param string $component
  *   Input component name.
  * @param int $contactId
  *   Input contact id.
  * @param string $tableName
  *   Optional tableName if component is custom group.
  *
  * @return int
  *   total number in database
  */
 public static function getCountComponent($component, $contactId, $tableName = NULL)
 {
     $object = NULL;
     switch ($component) {
         case 'tag':
             return CRM_Core_BAO_EntityTag::getContactTags($contactId, TRUE);
         case 'rel':
             $result = CRM_Contact_BAO_Relationship::getRelationship($contactId, CRM_Contact_BAO_Relationship::CURRENT, 0, 1);
             return $result;
         case 'group':
             return CRM_Contact_BAO_GroupContact::getContactGroup($contactId, "Added", NULL, TRUE);
         case 'log':
             if (CRM_Core_BAO_Log::useLoggingReport()) {
                 return FALSE;
             }
             return CRM_Core_BAO_Log::getContactLogCount($contactId);
         case 'note':
             return CRM_Core_BAO_Note::getContactNoteCount($contactId);
         case 'contribution':
             return CRM_Contribute_BAO_Contribution::contributionCount($contactId);
         case 'membership':
             return CRM_Member_BAO_Membership::getContactMembershipCount($contactId, TRUE);
         case 'participant':
             return CRM_Event_BAO_Participant::getContactParticipantCount($contactId);
         case 'pledge':
             return CRM_Pledge_BAO_Pledge::getContactPledgeCount($contactId);
         case 'case':
             return CRM_Case_BAO_Case::caseCount($contactId);
         case 'grant':
             return CRM_Grant_BAO_Grant::getContactGrantCount($contactId);
         case 'activity':
             $input = array('contact_id' => $contactId, 'admin' => FALSE, 'caseId' => NULL, 'context' => 'activity');
             return CRM_Activity_BAO_Activity::getActivitiesCount($input);
         case 'mailing':
             $params = array('contact_id' => $contactId);
             return CRM_Mailing_BAO_Mailing::getContactMailingsCount($params);
         default:
             $custom = explode('_', $component);
             if ($custom['0'] = 'custom') {
                 if (!$tableName) {
                     $tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $custom['1'], 'table_name');
                 }
                 $queryString = "SELECT count(id) FROM {$tableName} WHERE entity_id = {$contactId}";
                 return CRM_Core_DAO::singleValueQuery($queryString);
             }
     }
 }
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:60,代码来源:Contact.php


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