Skip to content

Commit

Permalink
Merge pull request #10119 from eileenmcnaughton/deprecated
Browse files Browse the repository at this point in the history
Add deprecation comments, CRM-19987
  • Loading branch information
eileenmcnaughton authored Apr 6, 2017
2 parents f71e9ef + a59cecb commit 4e48646
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CRM/Activity/BAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,8 @@ public static function &importableFields($status = FALSE) {
}

/**
* @deprecated - use the api instead.
*
* Get the Activities of a target contact.
*
* @param int $contactId
Expand All @@ -1467,6 +1469,7 @@ public static function &importableFields($status = FALSE) {
* array of activity fields
*/
public static function getContactActivity($contactId) {
// @todo remove this function entirely.
$activities = array();
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
Expand Down
1 change: 1 addition & 0 deletions CRM/Contact/Form/Task/SMSCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public static function buildQuickForm(&$form) {

if (CRM_Utils_System::getClassName($form) == 'CRM_Activity_Form_Task_SMS') {
//to check for "if the contact id belongs to a specified activity type"
// @todo use the api instead - function is deprecated.
$actDetails = CRM_Activity_BAO_Activity::getContactActivity($contactId);
if (self::RECIEVED_SMS_ACTIVITY_SUBJECT !=
CRM_Utils_Array::retrieveValueRecursive($actDetails, 'subject')
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/CRM/Activity/BAO/ActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function testGetContactActivity() {
'subject', 'Database check for created activity.'
);

// @todo - remove this deprecated functions
$activities = CRM_Activity_BAO_Activity::getContactActivity($targetContactId);

$this->assertEquals($activities[$activityId]['subject'], 'Scheduling Meeting', 'Verify activity subject is correct.');
Expand Down

0 comments on commit 4e48646

Please sign in to comment.