From cc144465072be0ff6541bc65b2f11c303d4c5afb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 11 Apr 2017 22:39:50 -0700 Subject: [PATCH] CRM-20420 - Define setting "recordGeneratedLetters" --- CRM/Contact/Form/Task/PDFLetterCommon.php | 14 ++++++++++++++ settings/Core.setting.php | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index d2869f3d2b..6d27e061a2 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -36,6 +36,20 @@ */ class CRM_Contact_Form_Task_PDFLetterCommon { + /** + * @return array + * Array(string $machineName => string $label). + */ + public static function getLoggingOptions() { + return array( + 'none' => ts('Do not record'), + 'multiple' => ts('Multiple activities (one per contact)'), + 'combined' => ts('One combined activity'), + 'combined-attached' => ts('One combined activity plus one file attachment'), + // 'multiple-attached' <== not worth the work + ); + } + /** * Build all the data structures needed to build the form. * diff --git a/settings/Core.setting.php b/settings/Core.setting.php index eaa0fe10fb..9f92efc5f4 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -437,6 +437,27 @@ return array( 'description' => "If enabled, CiviCRM sends PDF receipt as an attachment during event signup or online contribution.", 'help_text' => NULL, ), + 'recordGeneratedLetters' => array( + 'group_name' => 'CiviCRM Preferences', + 'group' => 'core', + 'name' => 'recordGeneratedLetters', + 'type' => 'String', + 'quick_form_type' => 'Select', + 'html_type' => 'Select', + 'html_attributes' => array( + 'class' => 'crm-select2', + ), + 'default' => 'multiple', + 'add' => '4.3', + 'title' => 'Record generated letters', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'When generating a letter (PDF/Word) via mail-merge, how should the letter be recorded?', + 'help_text' => NULL, + 'pseudoconstant' => array( + 'callback' => 'CRM_Contact_Form_Task_PDFLetterCommon::getLoggingOptions', + ), + ), 'wkhtmltopdfPath' => array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', -- 2.25.1