From ac844df66f62fc05b6e2420eb0fcbd6bd3222670 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Fri, 24 Apr 2020 16:23:29 +0100 Subject: [PATCH] activity api accepts name in activity type --- CRM/Contribute/Form/Task/Invoice.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index cb847d18a0..85a0c01007 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -521,25 +521,17 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { $config->doNotAttachPDFReceipt = 1; if (!empty($params['output']) && $params['output'] == 'pdf_invoice') { - $activityTypeID = CRM_Core_PseudoConstant::getKey( - 'CRM_Activity_DAO_Activity', - 'activity_type_id', - 'Downloaded Invoice' - ); + $activityType = 'Downloaded Invoice'; } else { - $activityTypeID = CRM_Core_PseudoConstant::getKey( - 'CRM_Activity_DAO_Activity', - 'activity_type_id', - 'Emailed Invoice' - ); + $activityType = 'Emailed Invoice'; } $activityParams = [ 'subject' => $subject, 'source_contact_id' => $userID, 'target_contact_id' => $contactIds, - 'activity_type_id' => $activityTypeID, + 'activity_type_id' => $activityType, 'activity_date_time' => date('YmdHis'), 'attachFile_1' => [ 'uri' => $fileName, -- 2.25.1