From: Eileen McNaughton Date: Sun, 11 Dec 2022 23:04:34 +0000 (+1300) Subject: Remove no-longer-used noisily deprecated function X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fcaf8dca0464f7428cf5824f48ad6f5a8e59f6c9;p=civicrm-core.git Remove no-longer-used noisily deprecated function --- diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index 405fd7dd0f..eb2e058e99 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -109,88 +109,6 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter return [$formValues, $categories, $html_message, $messageToken, $returnProperties]; } - /** - * @param CRM_Core_Form $form - * @param string $html_message - * @param array $contactIds - * @param string $subject - * @param int $campaign_id - * @param array $perContactHtml - * - * @return array - * List of activity IDs. - * There may be 1 or more, depending on the system-settings - * and use-case. - * - * @throws CRM_Core_Exception - * - * @deprecated - */ - public static function createActivities($form, $html_message, $contactIds, $subject, $campaign_id, $perContactHtml = []) { - CRM_Core_Error::deprecatedFunctionWarning('no alternative'); - - $activityParams = [ - 'subject' => $subject, - 'campaign_id' => $campaign_id, - 'source_contact_id' => CRM_Core_Session::getLoggedInContactID(), - 'activity_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Print PDF Letter'), - 'activity_date_time' => date('YmdHis'), - 'details' => $html_message, - ]; - if (!empty($form->_activityId)) { - $activityParams += ['id' => $form->_activityId]; - } - - $activityIds = []; - switch (Civi::settings()->get('recordGeneratedLetters')) { - case 'none': - return []; - - case 'multiple': - // One activity per contact. - foreach ($contactIds as $i => $contactId) { - $fullParams = [ - 'target_contact_id' => $contactId, - ] + $activityParams; - if (!empty($form->_caseId)) { - $fullParams['case_id'] = $form->_caseId; - } - elseif (!empty($form->_caseIds[$i])) { - $fullParams['case_id'] = $form->_caseIds[$i]; - } - - if (isset($perContactHtml[$contactId])) { - $fullParams['details'] = implode('
', $perContactHtml[$contactId]); - } - $activity = civicrm_api3('Activity', 'create', $fullParams); - $activityIds[$contactId] = $activity['id']; - } - - break; - - case 'combined': - case 'combined-attached': - // One activity with all contacts. - $fullParams = [ - 'target_contact_id' => $contactIds, - ] + $activityParams; - if (!empty($form->_caseId)) { - $fullParams['case_id'] = $form->_caseId; - } - elseif (!empty($form->_caseIds)) { - $fullParams['case_id'] = $form->_caseIds; - } - $activity = civicrm_api3('Activity', 'create', $fullParams); - $activityIds[] = $activity['id']; - break; - - default: - throw new CRM_Core_Exception("Unrecognized option in recordGeneratedLetters: " . Civi::settings()->get('recordGeneratedLetters')); - } - - return $activityIds; - } - /** * Convert from a vague-type/file-extension to mime-type. *