class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
/**
- * static field for all the activity information that we can potentially export
+ * Static field for all the activity information that we can potentially export
*
* @var array
* @static
static $_exportableFields = NULL;
/**
- * static field for all the activity information that we can potentially import
+ * Static field for all the activity information that we can potentially import
*
* @var array
* @static
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the flattened values
*
- * @return CRM_Core_BAO_Meeting object
+ * @return CRM_Activity_DAO_Activity object
* @access public
*/
public static function retrieve(&$params, &$defaults) {
}
/**
- * delete the activity
+ * Delete the activity
*
* @param array $params associated array
* @param bool $moveToTrash
* Delete activity assignment record
*
* @param int $activityId
- * @param null $recordTypeID
+ * @param int $recordTypeID
*
* @return null
* @access public
}
/**
- * process the activities
+ * Process the activities
*
* @param array $params associated array of the submitted values
*
}
/**
- * get the list Activities
+ * Get the list Activities
*
* @param array $input array of parameters
* Keys include
}
/**
- * get the activity Count
+ * Get the activity Count
*
* @param array $input array of parameters
* Keys include
}
/**
- * function to get the activity sql clause to pick activities
+ * Get the activity sql clause to pick activities
*
* @param array $input array of parameters
* Keys include
}
/**
- * send the message to all the contacts and also insert a
+ * Send the message to all the contacts and also insert a
* contact activity in each contacts record
*
* @param array $contactDetails the array of contact details to send the email
}
/**
- * @param $contactDetails
- * @param $activityParams
+ * @param array $contactDetails
+ * @param array $activityParams
* @param array $smsParams
* @param $contactIds
- * @param null $userID
+ * @param int $userID
*
* @return array
* @throws CRM_Core_Exception
$userID = $session->get('userID');
}
- $text = &$activityParams['text_message'];
- $html = &$activityParams['html_message'];
+ $text = &$activityParams['sms_text_message'];
// CRM-4575
// token replacement of addressee/email/postal greetings
// get the tokens added in subject and message
$messageToken = CRM_Utils_Token::getTokens($text);
- $messageToken = array_merge($messageToken,
- CRM_Utils_Token::getTokens($html)
- );
//create the meta level record first ( sms activity )
$activityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
'name'
);
- // CRM-6265: save both text and HTML parts in details (if present)
- if ($html and $text) {
- $details = "-ALTERNATIVE ITEM 0-\n$html\n-ALTERNATIVE ITEM 1-\n$text\n-ALTERNATIVE END-\n";
- }
- else {
- $details = $html ? $html : $text;
- }
+ $details = $text;
$activitySubject = $activityParams['activity_subject'];
$activityParams = array(
$tokenText = CRM_Utils_Token::replaceContactTokens($text, $values, FALSE, $messageToken, FALSE, $escapeSmarty);
$tokenText = CRM_Utils_Token::replaceHookTokens($tokenText, $values, $categories, FALSE, $escapeSmarty);
- $tokenHtml = CRM_Utils_Token::replaceContactTokens($html, $values, TRUE, $messageToken, FALSE, $escapeSmarty);
- $tokenHtml = CRM_Utils_Token::replaceHookTokens($tokenHtml, $values, $categories, TRUE, $escapeSmarty);
-
// Only send if the phone is of type mobile
$phoneTypes = CRM_Core_OptionGroup::values('phone_type', TRUE, FALSE, FALSE, NULL, 'name');
if ($values['phone_type_id'] == CRM_Utils_Array::value('Mobile', $phoneTypes)) {
$sendResult = self::sendSMSMessage(
$contactId,
$tokenText,
- $tokenHtml,
$smsParams,
$activityID,
$userID
}
/**
- * send the sms message to a specific contact
+ * Send the sms message to a specific contact
*
* @param int $toID the contact id of the recipient
* @param $tokenText
* @param $tokenHtml
* @param array $smsParams the params used for sending sms
* @param int $activityID the activity ID that tracks the message
- * @param null $userID
+ * @param int $userID
*
* @return mixed true on success or PEAR_Error object
* @access public
*/
static function sendSMSMessage($toID,
&$tokenText,
- &$tokenHtml,
$smsParams = array(),
$activityID,
$userID = null
);
}
- $message = $tokenHtml ? $tokenHtml : $tokenText;
$recipient = $smsParams['To'];
$smsParams['contact_id'] = $toID;
$smsParams['parent_activity_id'] = $activityID;
$providerObj = CRM_SMS_Provider::singleton(array('provider_id' => $smsParams['provider_id']));
- $sendResult = $providerObj->send($recipient, $smsParams, $message, NULL, $userID);
+ $sendResult = $providerObj->send($recipient, $smsParams, $tokenText, NULL, $userID);
if (PEAR::isError($sendResult)) {
return $sendResult;
}
}
/**
- * send the message to a specific contact
+ * Send the message to a specific contact
*
* @param string $from the name and email of the sender
- * @param $fromID
+ * @param int $fromID
* @param int $toID the contact id of the recipient
* @param string $subject the subject of the message
* @param $text_message
}
/**
- * combine all the importable fields from the lower levels object
+ * Combine all the importable fields from the lower levels object
*
* The ordering is important, since currently we do not have a weight
* scheme. Adding weight is super important and should be done in the
}
/**
- * Function to add activity for Membership/Event/Contribution
+ * Add activity for Membership/Event/Contribution
*
* @param object $activity (reference) particular component object
* @param string $activityType for Membership Signup or Renewal
}
/**
- * Function to find the latest revision of a given activity
+ * Find the latest revision of a given activity
*
- * @param $activityID prior activity id
+ * @param int $activityID prior activity id
*
- * @return int $params current activity id.
+ * @return int current activity id.
* @access public
*/
static function getLatestActivityId($activityID) {
}
/**
- * Function to create a follow up a given activity
+ * Create a follow up a given activity
*
* @param $activityId int activity id of parent activity
* @param array $params
}
/**
- * Function to get Activity specific File according activity type Id.
+ * Get Activity specific File according activity type Id.
*
* @param int $activityTypeId activity id
* @param string $crmDir
}
/**
- * Function to restore the activity
+ * Restore the activity
*
* @param array $params associated array
*
}
/**
- * @param $activityId
- * @param null $recordTypeID
+ * @param int $activityId
+ * @param int $recordTypeID
* @param string $column
*
* @return null
}
/**
- * @param $activityId
+ * @param int $activityId
*
* @return null
*/