本文整理汇总了PHP中CRM_Contact_BAO_Contact::getNumOpenActivity方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact::getNumOpenActivity方法的具体用法?PHP CRM_Contact_BAO_Contact::getNumOpenActivity怎么用?PHP CRM_Contact_BAO_Contact::getNumOpenActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Contact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Contact::getNumOpenActivity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: browse
/**
* Browse all activities for a particular contact
*
* @param boolean $history - true if we want to browse activity history, false otherwise.
* @return none
*
* @access public
*/
function browse($history)
{
$this->assign('totalCountOpenActivity', CRM_Contact_BAO_Contact::getNumOpenActivity($this->_contactId));
$this->assign('totalCountActivity', CRM_Core_BAO_History::getNumHistory($this->_contactId, 'Activity'));
require_once 'CRM/Core/Selector/Controller.php';
if ($history) {
$this->assign('history', true);
// create the selector, controller and run - store results in session
$output = CRM_CORE_SELECTOR_CONTROLLER_SESSION;
require_once 'CRM/History/Selector/Activity.php';
$selector =& new CRM_History_Selector_Activity($this->_contactId, $this->_permission);
$sortID = null;
if ($this->get(CRM_UTILS_SORT_SORT_ID)) {
$sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_UTILS_SORT_SORT_ID), $this->get(CRM_UTILS_SORT_SORT_DIRECTION));
}
$controller =& new CRM_Core_Selector_Controller($selector, $this->get(CRM_UTILS_PAGER_PAGE_ID), $sortID, CRM_CORE_ACTION_VIEW, $this, $output);
$controller->setEmbedded(true);
$controller->run();
$controller->moveFromSessionToTemplate();
} else {
$this->assign('history', false);
// create the selector, controller and run - store results in session
$output = CRM_CORE_SELECTOR_CONTROLLER_SESSION;
require_once 'CRM/Contact/Selector/Activity.php';
$selector =& new CRM_Contact_Selector_Activity($this->_contactId, $this->_permission);
$sortID = null;
if ($this->get(CRM_UTILS_SORT_SORT_ID)) {
$sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_UTILS_SORT_SORT_ID), $this->get(CRM_UTILS_SORT_SORT_DIRECTION));
}
$controller =& new CRM_Core_Selector_Controller($selector, $this->get(CRM_UTILS_PAGER_PAGE_ID), $sortID, CRM_CORE_ACTION_VIEW, $this, $output);
$controller->setEmbedded(true);
$controller->run();
$controller->moveFromSessionToTemplate();
}
}
示例2: getTotalCount
/**
* Returns total number of rows for the query.
*
* @param string $action - action being performed
* @return int Total number of rows
* @access public
*/
function getTotalCount($action)
{
return CRM_Contact_BAO_Contact::getNumOpenActivity($this->_contactId);
}
示例3: retrieve
/**
* Takes a bunch of params that are needed to match certain criteria and
* retrieves the relevant objects. Typically the valid params are only
* contact_id. We'll tweak this function to be more full featured over a period
* of time. This is the inverse function of create. It also stores all the retrieved
* values in the default array
*
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the name / value pairs
* in a hierarchical manner
* @param array $ids (reference) the array that holds all the db ids
*
* @return object CRM_Contact_BAO_Contact object
* @access public
* @static
*/
function retrieve(&$params, &$defaults, &$ids)
{
$contact = CRM_Contact_BAO_Contact::getValues($params, $defaults, $ids);
unset($params['id']);
require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_BAO_" . $contact->contact_type) . ".php";
eval('$contact->contact_type_object =& CRM_Contact_BAO_' . $contact->contact_type . '::getValues( $params, $defaults, $ids );');
$locParams = $params + array('entity_id' => $params['contact_id'], 'entity_table' => CRM_Contact_BAO_Contact::getTableName());
$contact->location =& CRM_Core_BAO_Location::getValues($locParams, $defaults, $ids, 3);
$contact->notes =& CRM_Core_BAO_Note::getValues($params, $defaults, $ids);
$contact->relationship =& CRM_Contact_BAO_Relationship::getValues($params, $defaults, $ids);
$contact->groupContact =& CRM_Contact_BAO_GroupContact::getValues($params, $defaults, $ids);
$activityParam = array('entity_id' => $params['contact_id']);
$contact->activity =& CRM_Core_BAO_History::getValues($activityParam, $defaults, 'Activity');
$activityParam = array('contact_id' => $params['contact_id']);
$defaults['openActivity'] = array('data' => CRM_Contact_BAO_Contact::getOpenActivities($activityParam, 0, 3), 'totalCount' => CRM_Contact_BAO_Contact::getNumOpenActivity($params['contact_id']));
return $contact;
}