Skip to content

Commit

Permalink
Merge pull request #14621 from pradpnayak/CleanUps
Browse files Browse the repository at this point in the history
Use api to create activity and removed hardcoded status id
  • Loading branch information
eileenmcnaughton authored Sep 4, 2019
2 parents 1f5d2c3 + c1aac8a commit 8437566
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions CRM/Financial/BAO/ExportFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,10 @@ public static function createActivityExport($batchIds, $fileName) {

// create activity.
$subject .= ' ' . ts('Batch') . '[' . $values['title'] . ']';
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name');
$activityParams = [
'activity_type_id' => array_search('Export Accounting Batch', $activityTypes),
'activity_type_id' => 'Export Accounting Batch',
'subject' => $subject,
'status_id' => 2,
'status_id' => 'Completed',
'activity_date_time' => date('YmdHis'),
'source_contact_id' => $session->get('userID'),
'source_record_id' => $values['id'],
Expand All @@ -226,8 +225,7 @@ public static function createActivityExport($batchIds, $fileName) {
'upload_date' => date('YmdHis'),
],
];

CRM_Activity_BAO_Activity::create($activityParams);
civicrm_api3('Activity', 'create', $activityParams);
}

/**
Expand Down

0 comments on commit 8437566

Please sign in to comment.