/** 
  * compose the url to show details of this specific contribution 
  * 
  * @param int $id 
  * @param int $activityHistoryId 
  * 
  * @static 
  * @access public 
  */
 function details($id, $activityHistoryId)
 {
     $params = array();
     $defaults = array();
     $params['id'] = $activityHistoryId;
     $params['entity_table'] = 'civicrm_contact';
     require_once 'CRM/Core/BAO/History.php';
     $history = CRM_Core_BAO_History::retrieve($params, $defaults);
     $contributionId = CRM_Utils_Array::value('activity_id', $defaults);
     if ($contributionId) {
         $cid = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionId, 'contact_id');
         return CRM_Utils_System::url('civicrm/contact/view/contribution', "reset=1&action=view&id={$contributionId}&cid={$cid}&context=basic");
     } else {
         return CRM_Utils_System::url('civicrm');
     }
 }
Beispiel #2
0
 /**
  * compose the url to show details of this specific Meeting
  *
  * @param int $id
  * @param int $activityHistoryId
  *
  * @static
  * @access public
  *
  */
 function showMeetingDetails($id, $activityHistoryId)
 {
     // require_once 'CRM/Core/DAO/Meeting.php';
     //$dao =& new CRM_Core_DAO_Meeting( );
     //$dao->id = $id;
     $params = array();
     $defaults = array();
     $params['id'] = $activityHistoryId;
     $params['entity_table'] = 'civicrm_contact';
     require_once 'CRM/Core/BAO/History.php';
     $history = CRM_Core_BAO_History::retrieve($params, $defaults);
     $contactId = CRM_Utils_Array::value('entity_id', $defaults);
     //if ( $dao->find( true ) ) {
     if ($contactId) {
         //return CRM_Utils_System::url('civicrm/contact/view/activity', "activity_id=1&cid={$dao->source_contact_id}&action=view&id=$id&status=true&history=1");
         return CRM_Utils_System::url('civicrm/contact/view/activity', "activity_id=1&cid={$contactId}&action=view&id={$id}&status=true&history=1");
     } else {
         return CRM_Utils_System::url('civicrm');
     }
 }
Beispiel #3
0
/**
 * Get an existing History object
 *
 * Returns a single existing History object which matches ALL property
 * values passed in $params. An error object is returned if there is
 * no match, or more than one match. 
 *
 * @param array   $params    Associative array of property name/value
 *                           pairs to attempt to match on.
 * @param array   $deaults   An assoc array to hold the flattened values.   
 *
 * @return CRM_Core_DAO_$typeHistory|CRM_Core_Error  Return the Contact Object if found, else Error Object
 *
 * @access public
 *
 */
function &crm_get_activity_history_object(&$params, &$defaults)
{
    _crm_initialize();
    $historyObject =& CRM_Core_BAO_History::retrieve($params, $defaults);
    return $historyObject;
}