/**
* Retrieve list of selections/drop downs for Scheduled Reminder form
*
- * @param bool $id mapping id
+ * @param bool $id
+ * Mapping id.
*
* @return array associated array of all the drop downs in the form
* @static
- * @access public
*/
public static function getSelection($id = NULL) {
$mapping = self::getMapping();
/**
* Retrieve list of Scheduled Reminders
*
- * @param bool $namesOnly return simple list of names
+ * @param bool $namesOnly
+ * Return simple list of names.
*
* @param null $entityValue
* @param int $id
*
* @return array (reference) reminder list
* @static
- * @access public
*/
public static function &getList($namesOnly = FALSE, $entityValue = NULL, $id = NULL) {
$activity_type = CRM_Core_PseudoConstant::activityType(TRUE, TRUE);
$$elem = $smarty->fetch("string:{$$elem}");
}
+ //@todo - this next section is a duplicate of function CRM_Utils_Token::getTokens
$matches = array();
preg_match_all('/(?<!\{|\\\\)\{(\w+\.\w+)\}(?!\})/',
$body_subject,
}
}
+ // @todo this (along with the copy-&-paste chunk above is a commonly repeated chunk of code & should be in a re-usable function
$messageSubject = CRM_Utils_Token::replaceContactTokens($body_subject, $contact, FALSE, $subjectToken);
$messageSubject = CRM_Utils_Token::replaceDomainTokens($messageSubject, $domain, TRUE, $subjectToken);
$messageSubject = CRM_Utils_Token::replaceComponentTokens($messageSubject, $contact, $subjectToken, TRUE);
/**
* Add the schedules reminders in the db
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $ids the array that holds all the db ids
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $ids
+ * The array that holds all the db ids.
*
* @return CRM_Core_DAO_ActionSchedule
- * @access public
* @static
*
*/
* retrieves the relevant objects. It also stores all the retrieved
* values in the default array
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $values (reference ) an assoc array to hold the flattened values
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $values
+ * (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Core_DAO_ActionSchedule object on success, null otherwise
- * @access public
* @static
*/
public static function retrieve(&$params, &$values) {
/**
* Delete a Reminder
*
- * @param int $id ID of the Reminder to be deleted.
+ * @param int $id
+ * ID of the Reminder to be deleted.
*
- * @access public
* @static
*/
public static function del($id) {
/**
* Update the is_active flag in the db
*
- * @param int $id id of the database record
- * @param boolean $is_active value we want to set the is_active field
+ * @param int $id
+ * Id of the database record.
+ * @param bool $is_active
+ * Value we want to set the is_active field.
*
* @return Object DAO object on success, null otherwise
* @static
while ($actionSchedule->fetch()) {
$extraSelect = $extraJoin = $extraWhere = $extraOn = '';
- if ($actionSchedule->from_email)
+ if ($actionSchedule->from_email) {
$fromEmailAddress = "$actionSchedule->from_name <$actionSchedule->from_email>";
+ }
- $activityTypeID = false;
- $activityStatusID = false;
+ $activityTypeID = FALSE;
+ $activityStatusID = FALSE;
if ($actionSchedule->record_activity) {
if ($mapping->entity == 'civicrm_membership') {
$activityTypeID =
elseif ($field == 'registration_url') {
$entityTokenParams["{$tokenEntity}." . $field] = CRM_Utils_System::url('civicrm/event/register', 'reset=1&id=' . $dao->event_id, TRUE, NULL, FALSE);
}
- elseif (in_array($field, array('start_date','end_date','join_date','activity_date_time'))) {
+ elseif (in_array($field, array('start_date', 'end_date', 'join_date', 'activity_date_time'))) {
$entityTokenParams["{$tokenEntity}." . $field] = CRM_Utils_Date::customFormat($dao->$field);
}
elseif ($field == 'balance') {
'source_record_id' => $dao->entityID,
);
$activity = CRM_Activity_BAO_Activity::create($activityParams);
-
+
//file reminder on case if source activity is a case activity
if (!empty($dao->case_id)) {
$caseActivityParams = array();
);
$status = implode(',', $status);
- $anniversary = false;
+ $anniversary = FALSE;
if (!CRM_Utils_System::isNull($mapping->entity_recipient)) {
if ($mapping->entity_recipient == 'event_contacts') {
$notINClause = self::permissionedRelationships($contactField);
$membershipStatus = CRM_Member_PseudoConstant::membershipStatus(NULL, "(is_current_member = 1 OR name = 'Expired')", 'id');
- $mStatus = implode (',', $membershipStatus);
+ $mStatus = implode(',', $membershipStatus);
$where[] = "e.status_id IN ({$mStatus})";
}
if (in_array(2, $status_)) {
// anniversary mode:
$dateField = 'DATE_ADD(e.' . $dateDBField . ', INTERVAL ROUND(DATEDIFF(DATE(' . $now . '), e.' . $dateDBField . ') / 365) YEAR)';
- $anniversary = true;
+ $anniversary = TRUE;
}
else {
// regular mode:
if ($addWhere) {
$addWhereClause = "AND {$addWhere}";
}
- $insertAdditionalSql ="
+ $insertAdditionalSql = "
INSERT INTO civicrm_action_log (contact_id, entity_id, entity_table, action_schedule_id)
{$addSelect}
FROM ({$contactTable})
if (!empty($excludeIds)) {
$clause = "AND {$field} NOT IN ( " .implode(', ', $excludeIds) . ' ) ';
- return $clause;
+ return $clause;
}
return NULL;
}