return CRM_Core_BAO_EntityTag::getContactTags($contactId, TRUE);
case 'rel':
+
return CRM_Contact_BAO_Relationship::getRelationship($contactId,
CRM_Contact_BAO_Relationship::CURRENT,
0, 1
);
case 'group':
+
return CRM_Contact_BAO_GroupContact::getContactGroup($contactId, "Added", NULL, TRUE);
case 'log':
}
/**
- * Process greetings and cache
+ * Process greetings and cache.
*
* @param object $contact
* Contact object after save.
}
/**
- * Retrieve display name of contact that address is shared
- * based on $masterAddressId or $contactId .
+ * Retrieve display name of contact that address is shared.
+ *
+ * This is based on $masterAddressId or $contactId .
*
* @param int $masterAddressId
* Master id.
}
/**
- * Get the creation/modification times for a contact
+ * Get the creation/modification times for a contact.
*
* @param int $contactId
*
- * @return array('created_date' => $, 'modified_date' => $)
+ * @return array
+ * Dates - ('created_date' => $, 'modified_date' => $)
*/
public static function getTimestamps($contactId) {
$timestamps = CRM_Core_DAO::executeQuery(
}
/**
- * Generate triggers to update the timestamp on the corresponding civicrm_contact row,
- * on insert/update/delete to a table that extends civicrm_contact.
+ * Generate triggers to update the timestamp.
+ *
+ * The corresponding civicrm_contact row is updated on insert/update/delete
+ * to a table that extends civicrm_contact.
* Don't regenerate triggers for all such tables if only asked for one table.
*
* @param array $info
/**
* @var object see CiviTest/CiviMailUtils
*/
- var $mut;
+ public $mut;
public function setUp() {
parent::setUp();
'start_action_unit' => 'day',
'subject' => '1-Day (repeating)',
);
- $this->fixtures['sched_membership_join_2week'] = array(// create()
+ $this->fixtures['sched_membership_join_2week'] = array(
'name' => 'sched_membership_join_2week',
'title' => 'sched_membership_join_2week',
'absolute_date' => '',
'start_action_unit' => 'week',
'subject' => 'subject sched_membership_join_2week',
);
- $this->fixtures['sched_membership_end_2week'] = array(// create()
+ $this->fixtures['sched_membership_end_2week'] = array(
'name' => 'sched_membership_end_2week',
'title' => 'sched_membership_end_2week',
'absolute_date' => '',
'subject' => 'subject sched_membership_end_2week',
);
- $this->fixtures['sched_membership_end_2month'] = array(// create()
+ $this->fixtures['sched_membership_end_2month'] = array(
'name' => 'sched_membership_end_2month',
'title' => 'sched_membership_end_2month',
'absolute_date' => '',
'subject' => 'subject sched_membership_end_2month',
);
- $this->fixtures['sched_contact_bday_yesterday'] = array(// create()
+ $this->fixtures['sched_contact_bday_yesterday'] = array(
'name' => 'sched_contact_bday_yesterday',
'title' => 'sched_contact_bday_yesterday',
'absolute_date' => '',
'subject' => 'subject sched_contact_bday_yesterday',
);
- $this->fixtures['sched_contact_bday_anniv'] = array(// create()
+ $this->fixtures['sched_contact_bday_anniv'] = array(
'name' => 'sched_contact_bday_anniv',
'title' => 'sched_contact_bday_anniv',
'absolute_date' => '',
'subject' => 'subject sched_contact_bday_anniv',
);
- $this->fixtures['sched_contact_grad_tomorrow'] = array(// create()
+ $this->fixtures['sched_contact_grad_tomorrow'] = array(
'name' => 'sched_contact_grad_tomorrow',
'title' => 'sched_contact_grad_tomorrow',
'absolute_date' => '',
'subject' => 'subject sched_contact_grad_tomorrow',
);
- $this->fixtures['sched_contact_grad_anniv'] = array(// create()
+ $this->fixtures['sched_contact_grad_anniv'] = array(
'name' => 'sched_contact_grad_anniv',
'title' => 'sched_contact_grad_anniv',
'absolute_date' => '',
'start_action_unit' => 'week',
'subject' => 'subject sched_contact_grad_anniv',
);
- $this->fixtures['sched_membership_end_2month_repeat_twice_4_weeks'] = array(// create()
+ $this->fixtures['sched_membership_end_2month_repeat_twice_4_weeks'] = array(
'name' => 'sched_membership_end_2month',
'title' => 'sched_membership_end_2month',
'absolute_date' => '',
'start_action_unit' => 'month',
'subject' => 'subject sched_membership_end_2month',
);
- $this->fixtures['sched_membership_end_limit_to_none'] = array(// create()
+ $this->fixtures['sched_membership_end_limit_to_none'] = array(
'name' => 'limit to none',
'title' => 'limit to none',
'absolute_date' => '',
$activityContact->save();
$this->assertCronRuns(array(
- array(// Before the 24-hour mark, no email
+ array(
+ // Before the 24-hour mark, no email
'time' => '2012-06-14 04:00:00',
'recipients' => array(),
),
- array(// After the 24-hour mark, an email
+ array(
+ // After the 24-hour mark, an email
'time' => '2012-06-14 15:00:00',
'recipients' => array(array('test-member@example.com')),
),
- array(// Run cron again; message already sent
+ array(
+ // Run cron again; message already sent
'time' => '',
'recipients' => array(),
),
$activityContact->save();
$this->assertCronRuns(array(
- array(// Before the 24-hour mark, no email
+ array(
+ // Before the 24-hour mark, no email
'time' => '012-06-14 04:00:00',
'recipients' => array(),
),
- array(// After the 24-hour mark, an email
+ array(
+ // After the 24-hour mark, an email
'time' => '2012-06-14 15:00:00',
'recipients' => array(array('test-member@example.com')),
),
- array(// Run cron 4 hours later; first message already sent
+ array(
+ // Run cron 4 hours later; first message already sent
'time' => '2012-06-14 20:00:00',
'recipients' => array(),
),
- array(// Run cron 6 hours later; send second message
+ array(
+ // Run cron 6 hours later; send second message.
'time' => '2012-06-14 21:00:01',
'recipients' => array(array('test-member@example.com')),
),
// start_date=2012-03-15 ; schedule is 2 weeks after start_date
$this->assertCronRuns(array(
- array(// Before the 2-week mark, no email
+ array(
+ // Before the 2-week mark, no email.
'time' => '2012-03-28 01:00:00',
'recipients' => array(),
),
- array(// After the 2-week mark, send an email
+ array(
+ // After the 2-week mark, send an email.
'time' => '2012-03-29 01:00:00',
'recipients' => array(array('test-member@example.com')),
),
// start_date=2012-03-15 ; schedule is 2 weeks after start_date
$this->assertCronRuns(array(
- array(// After the 2-week mark, don't send email because we have different membership type
+ array(
+ // After the 2-week mark, don't send email because we have different membership type.
'time' => '2012-03-29 01:00:00',
'recipients' => array(),
),
// end_date=2012-06-15 ; schedule is 2 weeks before end_date
$this->assertCronRuns(array(
- array(// After the 2-week mark, send an email
+ array(
+ // After the 2-week mark, send an email.
'time' => '2012-08-15 01:00:00',
'recipients' => array(array('test-member@example.com')),
),
- array(// After the 2-week mark, send an email
+ array(
+ // After the 2-week mark, send an email.
'time' => '2012-09-12 01:00:00',
'recipients' => array(array('test-member@example.com')),
),
$this->callAPISuccess('action_schedule', 'create', $actionSchedule);
// end_date=2012-06-15 ; schedule is 2 weeks before end_date
$this->assertCronRuns(array(
- array(// After the 2-week mark, send an email
+ array(
+ // After the 2-week mark, send an email.
'time' => '2012-08-15 01:00:00',
'recipients' => array(array('test-member@example.com')),
),