-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21065 Replace some CRM_Core_OptionGroup::values with CRM_Activity_BAO_Activ… #10860
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ public static function retrieve(&$params, &$defaults) { | |
$activity->copyValues($params); | ||
|
||
if ($activity->find(TRUE)) { | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above = checked |
||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
|
@@ -209,7 +209,7 @@ public static function deleteActivity(&$params, $moveToTrash = FALSE) { | |
$logMsg = 'Case Activity deleted for'; | ||
$msgs = array(); | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above = checked |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
@@ -633,7 +633,7 @@ public static function create(&$params) { | |
public static function logActivityAction($activity, $logMessage = NULL) { | ||
$id = CRM_Core_Session::getLoggedInContactID(); | ||
if (!$id) { | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above = checked |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$id = self::getActivityContact($activity->id, $sourceID); | ||
} | ||
|
@@ -672,7 +672,7 @@ public static function getActivities($params, $getCount = FALSE) { | |
$activities = array(); | ||
|
||
// fetch all active activity types | ||
$activityTypes = CRM_Core_OptionGroup::values('activity_type'); | ||
$activityTypes = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implicit in the first line is $labelColumnName = 'label' I'm finding the way this parameter is used in the function kinda odd - ie
seems to imply we want to exclude active ones here. I would be inclined to drop this from the PR to get the others through without this holding them up There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eileenmcnaughton I've removed from this PR and raised a more complex change for this line in https://issues.civicrm.org/jira/browse/CRM-21111 - PR #10909 which should also improve performance of that function |
||
|
||
// Activity.Get API params | ||
$activityParams = array( | ||
|
@@ -886,7 +886,7 @@ public static function deprecatedGetActivities($input) { | |
'Bulk Email' | ||
); | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
@@ -1307,7 +1307,7 @@ public static function deprecatedGetActivitySQLClause($input) { | |
// build main activity table select clause | ||
$sourceSelect = ''; | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$sourceJoin = " | ||
INNER JOIN civicrm_activity_contact ac ON ac.activity_id = civicrm_activity.id | ||
|
@@ -1824,7 +1824,7 @@ public static function sendSMSMessage( | |
return $sendResult; | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
||
// add activity target record for every sms that is send | ||
|
@@ -1888,7 +1888,7 @@ public static function sendMessage( | |
$toDisplayName = $toEmail; | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
||
// create the params array | ||
|
@@ -1990,7 +1990,7 @@ public static function &importableFields($status = FALSE) { | |
public static function getContactActivity($contactId) { | ||
// @todo remove this function entirely. | ||
$activities = array(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
@@ -2030,8 +2030,8 @@ public static function getContactActivity($contactId) { | |
|
||
$dao = CRM_Core_DAO::executeQuery($query); | ||
|
||
$activityTypes = CRM_Core_OptionGroup::values('activity_type'); | ||
$activityStatuses = CRM_Core_OptionGroup::values('activity_status'); | ||
$activityTypes = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get'); | ||
$activityStatuses = CRM_Activity_BAO_Activity::buildOptions('activity_status_id', 'get'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this looks correct, being used for rendering a label within the results. CRM_Core_Pseudoconstant::getLabel would make even more sense in the function context There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eileenmcnaughton As it's trivial and neater to use getLabel here I've updated the PR to do so! |
||
|
||
while ($dao->fetch()) { | ||
$activities[$dao->activity_id]['id'] = $dao->activity_id; | ||
|
@@ -2610,7 +2610,7 @@ public static function cleanupActivity($contactId) { | |
if (!$contactId) { | ||
return $result; | ||
} | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
|
||
$transaction = new CRM_Core_Transaction(); | ||
|
@@ -2745,7 +2745,7 @@ public static function checkPermission($activityId, $action) { | |
$permission = CRM_Core_Permission::EDIT; | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
@@ -3083,7 +3083,7 @@ public static function getActivityContact($activityId, $recordTypeID = NULL, $co | |
public static function getSourceContactID($activityId) { | ||
static $sourceID = NULL; | ||
if (!$sourceID) { | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
} | ||
|
||
|
@@ -3100,7 +3100,7 @@ public static function getSourceContactID($activityId) { | |
public function setApiFilter(&$params) { | ||
if (!empty($params['target_contact_id'])) { | ||
$this->selectAdd(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
$obj = new CRM_Activity_BAO_ActivityContact(); | ||
$params['return.target_contact_id'] = 1; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ public function __construct() { | |
*/ | ||
public static function create(&$params) { | ||
$assignment = new CRM_Activity_BAO_ActivityContact(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
|
||
$assignment->copyValues($params); | ||
|
@@ -76,7 +76,7 @@ public static function retrieveAssigneeIdsByActivityId($activity_id) { | |
return $assigneeArray; | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
|
||
$sql = " | ||
|
@@ -112,7 +112,7 @@ public static function getAssigneeNames($activityIDs, $isDisplayName = FALSE, $s | |
if (empty($activityIDs)) { | ||
return $assigneeNames; | ||
} | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
|
||
$whereClause = ""; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ public function __construct() { | |
*/ | ||
public static function create(&$params) { | ||
$target = new CRM_Activity_BAO_ActivityContact(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
||
$target->copyValues($params); | ||
|
@@ -74,7 +74,7 @@ public static function retrieveTargetIdsByActivityId($activity_id) { | |
return $targetArray; | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
||
$sql = " | ||
|
@@ -105,7 +105,7 @@ public static function getTargetNames($activityID) { | |
if (empty($activityID)) { | ||
return $targetNames; | ||
} | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
||
$query = " | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,7 +247,7 @@ public static function whereClauseSingle(&$values, &$query) { | |
|
||
case 'activity_role': | ||
CRM_Contact_BAO_Query::$_activityRole = $values[2]; | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
@@ -399,7 +399,7 @@ public static function from($name, $mode, $side) { | |
break; | ||
|
||
case 'source_contact': | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$from = " | ||
LEFT JOIN civicrm_activity_contact ac | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -986,7 +986,7 @@ public function postProcess($params = NULL) { | |
*/ | ||
protected function processActivity(&$params) { | ||
$activityAssigned = array(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
// format assignee params | ||
if (!CRM_Utils_Array::crmIsEmptyArray($params['assignee_contact_id'])) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ public static function preProcessCommon(&$form, $useTable = FALSE) { | |
public function setContactIDs() { | ||
$IDs = implode(',', $this->_activityHolderIds); | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$query = " | ||
SELECT contact_id | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,7 @@ public function postProcess() { | |
$params = $this->exportValues(); | ||
$this->_contacts = array(); | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
// Get assignee contacts. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ public function preProcess() { | |
// display name and activity details of all selected contacts | ||
$activityIDs = implode(',', $this->_activityHolderIds); | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$query = " | ||
SELECT at.subject as subject, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,7 +339,7 @@ public static function _convertToCaseActivity($params) { | |
$targetContacts = array_unique(explode(',', $params['targetContactIds'])); | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,7 +269,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { | |
$allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE); | ||
|
||
$engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,7 +240,7 @@ public function confirmSignature($activity_id, $contact_id, $petition_id) { | |
// change activity status to completed (status_id = 2) | ||
// I wonder why do we need contact_id when we have activity_id anyway? [chastell] | ||
$sql = 'UPDATE civicrm_activity SET status_id = 2 WHERE id = %1'; | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$params = array( | ||
1 => array($activity_id, 'Integer'), | ||
|
@@ -307,7 +307,7 @@ public static function getPetitionSignatureTotalbyCountry($surveyId) { | |
civicrm_survey.id = %1 AND | ||
a.source_record_id = %1 "; | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$params = array( | ||
1 => array($surveyId, 'Integer'), | ||
|
@@ -432,7 +432,7 @@ public static function getPetitionSignature($surveyId, $status_id = NULL) { | |
} | ||
$sql .= " ORDER BY a.activity_date_time"; | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$params[3] = array($sourceID, 'Integer'); | ||
|
||
|
@@ -497,7 +497,7 @@ public static function checkSignature($surveyId, $contactId) { | |
|
||
$surveyInfo = CRM_Campaign_BAO_Petition::getSurveyInfo($surveyId); | ||
$signature = array(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
|
||
$sql = " | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,7 +221,7 @@ public static function from($name, $mode, $side) { | |
return $from; | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | ||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -529,7 +529,7 @@ public static function voterActivityDetails($surveyId, $voterIds, $interviewerId | |
} | ||
|
||
$targetContactIds = ' ( ' . implode(',', $voterIds) . ' ) '; | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
||
|
@@ -625,7 +625,7 @@ public static function getSurveyActivities( | |
contact_a.display_name as voter_name"; | ||
} | ||
|
||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | ||
|
||
|
@@ -1046,7 +1046,7 @@ public static function getInterviewers() { | |
} | ||
|
||
$interviewers = array(); | ||
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); | ||
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | ||
|
||
$query = " | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting this here for easy reference
Here is the definition of the contexts for buildOptions
In the case of this change the $onlyActive is TRUE in the existing code & FALSE in the changed version, but I don't find it valid that we should be disabling ActivityContact record types.
Definition of record_type_id DOES refer to activity_contacts
Summary of above - change looks good :-)