Remove no-longer-used noisily deprecated function
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 11 Dec 2022 23:04:34 +0000 (12:04 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 11 Dec 2022 23:08:57 +0000 (12:08 +1300)
CRM/Contact/Form/Task/PDFLetterCommon.php

index 405fd7dd0f0884b3cd0c8408cb26fa45fa879b3c..eb2e058e99eaa5a8664ff82c14f3550e08541a63 100644 (file)
@@ -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('<hr>', $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.
    *