Skip to content
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

dev/core#3692: use buildOptions for activityType, activityStatus where easy. Also a relationshipType #23880

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions CRM/Activity/BAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2384,8 +2384,6 @@ public static function getContactActivitySelector(&$params) {
$viewOnlyCaseActivityTypeIDs = array_flip(CRM_Activity_BAO_Activity::getViewOnlyActivityTypeIDs());

if (!empty($activities)) {
$activityStatus = CRM_Core_PseudoConstant::activityStatus();

// Check logged in user for permission.
$page = new CRM_Core_Page();
CRM_Contact_Page_View::checkUserPermission($page, $params['contact_id']);
Expand Down Expand Up @@ -2511,7 +2509,7 @@ public static function getContactActivitySelector(&$params) {
}

$activity['activity_date_time'] = CRM_Utils_Date::customFormat($values['activity_date_time']);
$activity['status_id'] = $activityStatus[$values['status_id']];
$activity['status_id'] = CRM_Core_Pseudoconstant::getLabel('CRM_Activity_BAO_Activity', 'status_id', $values['status_id']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't the same - it now includes disabled. I personally like that but some people won't.


// Get action links.
//
Expand Down
2 changes: 1 addition & 1 deletion CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function getDefaultEntity() {
public function setFields() {
// Remove print document activity type
$unwanted = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, "AND v.name = 'Print PDF Letter'");
$activityTypes = array_diff_key(CRM_Core_PseudoConstant::ActivityType(FALSE), $unwanted);
$activityTypes = array_diff_key(CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'search'), $unwanted);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't the same. Before it didn't include case activity types and now it does and also all the ones with filter=1.


$this->_fields = [
'subject' => [
Expand Down
2 changes: 1 addition & 1 deletion CRM/Activity/Form/ActivityFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CRM_Activity_Form_ActivityFilter extends CRM_Core_Form {

public function buildQuickForm() {
// add activity search filter
$activityOptions = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);
$activityOptions = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get');
asort($activityOptions);

$this->add('select', 'activity_type_filter_id', ts('Include'), $activityOptions, FALSE, ['class' => 'crm-select2', 'multiple' => TRUE, 'placeholder' => ts('- all activity type(s) -')]);
Expand Down
2 changes: 1 addition & 1 deletion CRM/Activity/Form/Task/PickProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function buildQuickForm() {
$types = ['Activity'];
$profiles = CRM_Core_BAO_UFGroup::getProfiles($types, TRUE);

$activityTypeIds = array_flip(CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name'));
$activityTypeIds = array_flip(CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'validate'));
$nonEditableActivityTypeIds = [
$activityTypeIds['Email'],
$activityTypeIds['Bulk Email'],
Expand Down
4 changes: 1 addition & 3 deletions CRM/Activity/Selector/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,6 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $ca
return $rows;
}

$activityStatus = CRM_Core_PseudoConstant::activityStatus();

$engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel();

// CRM-4418
Expand All @@ -406,7 +404,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $ca
$row['class'] = 'status-ontime';
}

$row['status'] = $row['status_id'] ? $activityStatus[$row['status_id']] : NULL;
$row['status'] = $row['status_id'] ? CRM_Core_Pseudoconstant::getLabel('CRM_Activity_BAO_Activity', 'status_id', $row['status_id']) : NULL;

if ($engagementLevel = CRM_Utils_Array::value('engagement_level', $row)) {
$row['engagement_level'] = CRM_Utils_Array::value($engagementLevel, $engagementLevels, $engagementLevel);
Expand Down
6 changes: 2 additions & 4 deletions CRM/Campaign/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ public static function whereClauseSingle(&$values, &$query) {
return;

case 'survey_status_id':
$activityStatus = CRM_Core_PseudoConstant::activityStatus();

$query->_qill[$grouping][] = ts('Survey Status - %1', [1 => $activityStatus[$value]]);
$query->_qill[$grouping][] = ts('Survey Status - %1', [1 => CRM_Core_Pseudoconstant::getLabel('CRM_Activity_BAO_Activity', 'status_id', $value)]);
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause('civicrm_activity.status_id',
$op, $value, 'Integer'
);
Expand Down Expand Up @@ -444,7 +442,7 @@ public static function voterClause($params) {
$searchVoterFor = $params['campaign_search_voter_for'] ?? NULL;

//get the survey activities.
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$status = ['Scheduled'];
if ($searchVoterFor == 'reserve') {
$status[] = 'Completed';
Expand Down
2 changes: 1 addition & 1 deletion CRM/Campaign/BAO/Survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ public static function getInterviewers() {
* success message
*/
public static function releaseRespondent($params) {
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$reserveStatusId = array_search('Scheduled', $activityStatus);
$surveyActivityTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType();
if (!empty($surveyActivityTypes) && is_array($surveyActivityTypes)) {
Expand Down
4 changes: 2 additions & 2 deletions CRM/Campaign/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function buildQuickForm() {
$currentTaskValue = $taskMapping[$this->_operation] ?? NULL;
$taskValue = array($currentTaskValue => $allTasks[$currentTaskValue]);
if ($this->_operation == 'interview' && !empty($this->_formValues['campaign_survey_id'])) {
$activityTypes = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
$activityTypes = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'search');

$surveyTypeId = CRM_Core_DAO::getFieldValue('CRM_Campaign_DAO_Survey',
$this->_formValues['campaign_survey_id'],
Expand Down Expand Up @@ -341,7 +341,7 @@ public function formatParams() {
$this->_operation == 'release'
) {
//to conduct interview / release activity status should be scheduled.
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
if ($scheduledStatusId = array_search('Scheduled', $activityStatus)) {
$this->_formValues['survey_status_id'] = $scheduledStatusId;
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Campaign/Form/Survey/Questions.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function buildQuickForm() {
$subTypeId = CRM_Core_DAO::getFieldValue('CRM_Campaign_DAO_Survey', $this->_surveyId, 'activity_type_id');
if (!CRM_Core_BAO_CustomGroup::autoCreateByActivityType($subTypeId)) {
// everything
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE);
$activityTypes = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get');
// FIXME: Displays weird "/\ Array" message; doesn't work with tabs
CRM_Core_Session::setStatus(
ts(
Expand Down
2 changes: 1 addition & 1 deletion CRM/Campaign/Form/Survey/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public function postProcess() {

// create report if required.
if (!$this->_reportId && $survey->id && !empty($params['create_report'])) {
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$activityStatus = array_flip($activityStatus);
$this->_params = [
'name' => "survey_{$survey->id}",
Expand Down
2 changes: 1 addition & 1 deletion CRM/Campaign/Form/Task/Release.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function preProcess() {
$params = ['id' => $this->_surveyId];
$this->_surveyDetails = CRM_Campaign_BAO_Survey::retrieve($params, $surveyDetails);

$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$statusIds = [];
foreach (['Scheduled'] as $name) {
if ($statusId = array_search($name, $activityStatus)) {
Expand Down
4 changes: 2 additions & 2 deletions CRM/Campaign/Form/Task/Reserve.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function preProcess() {
CRM_Campaign_BAO_Survey::retrieve($params, $this->_surveyDetails);

//get the survey activities.
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@demeritcowboy these swaps are safe aren't they? This PR is stale & I think turned out to be way trickier than initial appearance but I'm thinking maybe I can salvage some of the bits that are straight foward

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of them might be.

$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$statusIds = [];
foreach (['Scheduled'] as $name) {
if ($statusId = array_search($name, $activityStatus)) {
Expand Down Expand Up @@ -220,7 +220,7 @@ public function postProcess() {
//add reservation.
$countVoters = 0;
$maxVoters = $this->_surveyDetails['max_number_of_contacts'] ?? NULL;
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$statusHeld = array_search('Scheduled', $activityStatus);

$reservedVoterIds = [];
Expand Down
4 changes: 2 additions & 2 deletions CRM/Campaign/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function voterList() {
}
else {
//get the survey status in where clause.
$scheduledStatusId = array_search('Scheduled', CRM_Core_PseudoConstant::activityStatus('name'));
$scheduledStatusId = array_search('Scheduled', CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate'));
if ($scheduledStatusId) {
$params['survey_status_id'] = $scheduledStatusId;
}
Expand Down Expand Up @@ -401,7 +401,7 @@ public static function processVoterData() {
}
if ($createActivity) {
$isReserved = CRM_Utils_String::strtoboolstr(CRM_Utils_Type::escape($_POST['isReserved'], 'String'));
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$scheduledStatusId = array_search('Scheduled', $activityStatus);
if ($isReserved) {
$surveyValues = [];
Expand Down
9 changes: 5 additions & 4 deletions CRM/Case/BAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -1268,12 +1268,13 @@ public static function sendActivityCopy($clientId, $activityId, $contacts, $atta
$activityTypeId = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $activityId, 'activity_type_id');
// If it's a case activity
if ($caseId) {
$nonCaseActivityTypes = CRM_Core_PseudoConstant::activityType();
if (!empty($nonCaseActivityTypes[$activityTypeId])) {
$anyActivity = TRUE;
$componentId = CRM_Core_Component::getComponentID('CiviCase');
$caseActivityTypes = CRM_Core_OptionGroup::values('activity_type', TRUE, FALSE, FALSE, " AND v.component_id={$componentId}");
if (!empty($caseActivityTypes[$activityTypeId])) {
$anyActivity = FALSE;
}
else {
$anyActivity = FALSE;
$anyActivity = TRUE;
}
$tplParams['isCaseActivity'] = 1;
$tplParams['client_id'] = $clientId;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/Form/ActivityView.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function preProcess() {

$recentContactDisplay = CRM_Contact_BAO_Contact::displayName($recentContactId);
// add the recently created Activity
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE);
$activityTypes = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get');

$title = "";
if (isset($activitySubject)) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/Form/CaseView.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public static function activityForm($form) {
}
$form->add('select', 'activity_type_filter_id', ts('Activity Type'), ['' => ts('- select activity type -')] + $aTypesFilter, FALSE, ['id' => 'activity_type_filter_id_' . $form->_caseID]);

$activityStatus = CRM_Core_PseudoConstant::activityStatus();
$activityStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'search');
$form->add('select', 'status_id', ts('Status'), ["" => ts(' - any status - ')] + $activityStatus, FALSE, ['id' => 'status_id_' . $form->_caseID]);

// activity date search filters
Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/ManagedEntities.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function createManagedCaseTypes() {
*/
public static function createManagedActivityTypes(CRM_Case_XMLRepository $xmlRepo, CRM_Core_ManagedEntities $me) {
$result = [];
$validActTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name');
$validActTypes = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'validate');

$actTypes = $xmlRepo->getAllDeclaredActivityTypes();
foreach ($actTypes as $actType) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Task/EmailTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function buildQuickForm() {
'followup_activity_type_id' => [
'type' => 'select',
'label' => ts('Followup Activity'),
'attributes' => ['' => '- ' . ts('select activity') . ' -'] + CRM_Core_PseudoConstant::ActivityType(FALSE),
'attributes' => ['' => '- ' . ts('select activity') . ' -'] + CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'search'),
'extra' => ['class' => 'crm-select2'],
],
'followup_activity_subject' => [
Expand Down
32 changes: 15 additions & 17 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Civi\Api4\LineItem;
use Civi\Api4\ContributionSoft;
use Civi\Api4\PaymentProcessor;
use Civi\Api4\RelationshipType;

/**
*
Expand Down Expand Up @@ -2225,8 +2226,7 @@ public static function getOnbehalfIds($contributionId, $contributorId = NULL) {
);
}

$activityTypeIds = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name');
$activityTypeId = array_search('Contribution', $activityTypeIds);
$activityTypeId = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Contribution');

if ($activityTypeId && $contributorId) {
$activityQuery = "
Expand All @@ -2251,23 +2251,21 @@ public static function getOnbehalfIds($contributionId, $contributorId = NULL) {

// for on behalf contribution source is individual and contributor is organization
if ($sourceContactId && $sourceContactId != $contributorId) {
$relationshipTypeIds = CRM_Core_PseudoConstant::relationshipType('name');
// get rel type id for employee of relation
foreach ($relationshipTypeIds as $id => $typeVals) {
if ($typeVals['name_a_b'] == 'Employee of') {
$relationshipTypeId = $id;
break;
$relationshipType = RelationshipType::get(FALSE)
->addSelect('id')
->addWhere('name_a_b', '=', 'Employee of')
->execute()->first();

if (!empty($relationshipType)) {
$rel = new CRM_Contact_DAO_Relationship();
$rel->relationship_type_id = $relationshipType['id'];
$rel->contact_id_a = $sourceContactId;
$rel->contact_id_b = $contributorId;
if ($rel->find(TRUE)) {
$ids['individual_id'] = $rel->contact_id_a;
$ids['organization_id'] = $rel->contact_id_b;
}
}

$rel = new CRM_Contact_DAO_Relationship();
$rel->relationship_type_id = $relationshipTypeId;
$rel->contact_id_a = $sourceContactId;
$rel->contact_id_b = $contributorId;
if ($rel->find(TRUE)) {
$ids['individual_id'] = $rel->contact_id_a;
$ids['organization_id'] = $rel->contact_id_b;
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions CRM/Core/BAO/CustomGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public static function autoCreateByActivityType($activityTypeId) {
return TRUE;
}
// everything
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE);
$activityTypes = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get');
$params = [
'version' => 3,
'extends' => 'Activity',
Expand Down Expand Up @@ -1026,7 +1026,7 @@ public static function &getGroupDetail($groupId = NULL, $searchable = NULL, &$ex

//include case activities customdata if case is enabled
if (in_array('Activity', $extends)) {
$extendValues = implode(',', array_keys(CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE)));
$extendValues = implode(',', array_keys(CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get')));
$where .= " AND ( civicrm_custom_group.extends_entity_column_value IS NULL OR REPLACE( civicrm_custom_group.extends_entity_column_value, %2, ' ') IN ($extendValues) ) ";
$params[2] = [CRM_Core_DAO::VALUE_SEPARATOR, 'String'];
}
Expand Down Expand Up @@ -2347,7 +2347,7 @@ private static function buildGroupTree($entityType, $toReturn, $subTypes, $query
*/
public static function getSubTypes(): array {
$sel2 = [];
$activityType = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
$activityType = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'search');

$eventType = CRM_Core_OptionGroup::values('event_type');
$campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
Expand Down
5 changes: 2 additions & 3 deletions CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,7 @@ public static function getValues(
$params[$index] = implode(',', $entityTags);
}
elseif ($name == 'activity_status_id') {
$activityStatus = CRM_Core_PseudoConstant::activityStatus();
$values[$index] = $activityStatus[$details->$name];
$values[$index] = CRM_Core_Pseudoconstant::getLabel('CRM_Activity_BAO_Activity', 'status_id', $details->$name);
$params[$index] = $details->$name;
}
elseif ($name == 'activity_date_time') {
Expand Down Expand Up @@ -2127,7 +2126,7 @@ public static function buildProfile(
}
elseif ($fieldName == 'activity_status_id') {
$form->add('select', $name, $title,
CRM_Core_PseudoConstant::activityStatus(), $required, ['placeholder' => TRUE]
CRM_Activity_BAO_Activity::buildOptions('status_id', 'search'), $required, ['placeholder' => TRUE]
);
}
elseif ($fieldName == 'activity_engagement_level') {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/CodeGen/GenerateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ private function addActivity() {
$activityDAO = new CRM_Activity_DAO_Activity();
$activityId = CRM_Core_OptionGroup::values('activity_type', NULL, NULL, NULL, ' AND v.name IN ("Tell A Friend", "Pledge Acknowledgment")');
$activityTypeID = $this->randomIndex($activityId);
$activity = CRM_Core_PseudoConstant::activityType();
$activity = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get');
$activityDAO->activity_type_id = $activityTypeID;
$activityDAO->subject = "Subject for $activity[$activityTypeID]";
$activityDAO->activity_date_time = $this->randomDate();
Expand Down
2 changes: 1 addition & 1 deletion CRM/Custom/Page/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function browse() {
// FIXME: This hardcoded array is mostly redundant with CRM_Core_BAO_CustomGroup::getSubTypes
$subTypes = [];

$subTypes['Activity'] = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
$subTypes['Activity'] = CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'search');
$subTypes['Contribution'] = CRM_Contribute_PseudoConstant::financialType();
$subTypes['Membership'] = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
$subTypes['Event'] = CRM_Core_OptionGroup::values('event_type');
Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/BAO/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ public static function deleteParticipant($id) {
$params = [
'source_record_id' => $id,
// activity type id for event registration
'activity_type_id' => 5,
'activity_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Event Registration'),
];

CRM_Activity_BAO_Activity::deleteActivity($params);
Expand Down
4 changes: 2 additions & 2 deletions CRM/Logging/Differ.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function titlesAndValuesForTable($table, $referenceDate) {
'state_province_id' => CRM_Core_PseudoConstant::stateProvince(),
'suffix_id' => CRM_Contact_BAO_Contact::buildOptions('suffix_id'),
'website_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id'),
'activity_type_id' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
'activity_type_id' => CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get'),
'case_type_id' => CRM_Case_PseudoConstant::caseType('title', FALSE),
'priority_id' => CRM_Core_PseudoConstant::get('CRM_Activity_DAO_Activity', 'priority_id'),
'record_type_id' => CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'get'),
Expand All @@ -300,7 +300,7 @@ public function titlesAndValuesForTable($table, $referenceDate) {
break;

case 'civicrm_activity':
$values[$table]['status_id'] = CRM_Core_PseudoConstant::activityStatus();
$values[$table]['status_id'] = CRM_Activity_BAO_Activity::buildOptions('status_id', 'get');
break;
}

Expand Down
2 changes: 1 addition & 1 deletion CRM/Logging/ReportSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function __construct() {

'bracket_info' => [
'entity_column' => 'activity_type_id',
'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
'options' => CRM_Activity_BAO_Activity::buildOptions('activity_type_id', 'get'),
'lookup_table' => 'log_civicrm_activity',
],
],
Expand Down
Loading