3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class generates form components for the maling component preferences.
21 class CRM_Admin_Form_Preferences_Mailing
extends CRM_Admin_Form_Preferences
{
23 protected $_settings = [
24 'profile_double_optin' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
25 'profile_add_to_group_double_optin' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
26 'track_civimail_replies' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
27 'civimail_workflow' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
28 'civimail_multiple_bulk_emails' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
29 'civimail_server_wide_lock' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
30 'include_message_id' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
31 'write_activity_record' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
32 'disable_mandatory_tokens_check' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
33 'dedupe_email_default' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
34 'hash_mailing_url' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
35 'auto_recipient_rebuild' => CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
,
38 public function postProcess() {
39 $params = $this->controller
->exportValues($this->_name
);
41 if (empty($params['write_activity_record'])) {
42 // @todo use the setting onToggle & add an action rather than have specific form handling.
43 // see logging setting for eg.
44 $existingViewOptions = Civi
::settings()->get('contact_view_options');
46 $displayViewOptions = CRM_Core_OptionGroup
::values('contact_view_options', TRUE, FALSE, FALSE, NULL, 'name');
47 $displayValue = $displayViewOptions['CiviMail'];
49 $viewOptions = explode(CRM_Core_DAO
::VALUE_SEPARATOR
, $existingViewOptions);
51 if (!in_array($displayValue, $viewOptions)) {
52 $existingViewOptions .= $displayValue . CRM_Core_DAO
::VALUE_SEPARATOR
;
54 Civi
::settings()->set('contact_view_options', $existingViewOptions);
55 CRM_Core_Session
::setStatus(ts('We have automatically enabled the Mailings tab for the Contact Summary screens
56 so that you can view mailings sent to each contact.'), ts('Saved'), 'success');
60 parent
::postProcess();