/**
  * funtion to add activity target
  *
  * @param array  $activity_id           (reference ) an assoc array of name/value pairs
  * @param array  $target_contact_id     (reference ) the array that holds all the db ids
  *
  * @return object activity type of object that is added
  * @access public
  * 
  */
 public function create(&$params)
 {
     require_once 'CRM/Activity/BAO/ActivityTarget.php';
     $target = new CRM_Activity_BAO_ActivityTarget();
     $target->copyValues($params);
     return $target->save();
 }
 /**
  * funtion to add activity target
  *
  * @param array  $activity_id           (reference ) an assoc array of name/value pairs
  * @param array  $target_contact_id     (reference ) the array that holds all the db ids
  *
  * @return object activity type of object that is added
  * @access public
  *
  */
 public static function create(&$params)
 {
     $target = new CRM_Activity_BAO_ActivityTarget();
     $target->copyValues($params);
     return $target->save();
 }
 /**
  * Create activity target record
  *
  * @param array    activity_id, target_contact_id
  *
  * @return null
  * @access public
  */
 public function createActivityTarget($params)
 {
     if (!$params['target_contact_id']) {
         return;
     }
     $target = new CRM_Activity_BAO_ActivityTarget();
     $target->activity_id = $params['activity_id'];
     $target->target_contact_id = $params['target_contact_id'];
     // avoid duplicate entries, CRM-7484
     // happens if sending email to the same contact with different email addresses
     if (!$target->find(TRUE)) {
         $target->save();
     }
 }
Esempio n. 4
0
 /**
  * Create activity target record
  *
  * @param array    activity_id, target_contact_id
  *
  * @return null
  * @access public
  */
 public function createActivityTarget($params)
 {
     if (!$params['target_contact_id']) {
         return;
     }
     require_once 'CRM/Activity/BAO/ActivityTarget.php';
     $target = new CRM_Activity_BAO_ActivityTarget();
     $target->activity_id = $params['activity_id'];
     $target->target_contact_id = $params['target_contact_id'];
     // avoid duplicate entries
     $target->find(true);
     $target->save();
 }