Commit a7e15692 authored by eileen's avatar eileen

Fix campaign preferences form

parent 5fe59b42
...@@ -29,35 +29,16 @@ ...@@ -29,35 +29,16 @@
* *
* @package CRM * @package CRM
* @copyright CiviCRM LLC (c) 2004-2018 * @copyright CiviCRM LLC (c) 2004-2018
* $Id: Display.php 36505 2011-10-03 14:19:56Z lobo $
*
*/ */
/** /**
* This class generates form components for the display preferences * This class displays campaign preferences.
*
*/ */
class CRM_Admin_Form_Preferences_Campaign extends CRM_Admin_Form_Preferences { class CRM_Admin_Form_Preferences_Campaign extends CRM_Admin_Form_Preferences {
public function preProcess() {
CRM_Utils_System::setTitle(ts('CiviCampaign Component Settings'));
$this->_varNames = array(
CRM_Core_BAO_Setting::CAMPAIGN_PREFERENCES_NAME => array(
'tag_unconfirmed' => array(
'html_type' => 'text',
'title' => ts('Tag for Unconfirmed Petition Signers'),
'weight' => 1,
'description' => ts('If set, new contacts that are created when signing a petition are assigned a tag of this name.'),
),
'petition_contacts' => array(
'html_type' => 'text',
'title' => ts('Petition Signers Group'),
'weight' => 2,
'description' => ts('All contacts that have signed a CiviCampaign petition will be added to this group. The group will be created if it does not exist (it is required for email verification).'),
),
),
);
parent::preProcess(); protected $_settings = [
} 'tag_unconfirmed' => CRM_Core_BAO_Setting::CAMPAIGN_PREFERENCES_NAME,
'petition_contacts' => CRM_Core_BAO_Setting::CAMPAIGN_PREFERENCES_NAME,
];
} }
...@@ -229,6 +229,7 @@ trait CRM_Admin_Form_SettingTrait { ...@@ -229,6 +229,7 @@ trait CRM_Admin_Form_SettingTrait {
'radio' => 'Radio', 'radio' => 'Radio',
'select' => 'Select', 'select' => 'Select',
'textarea' => 'Element', 'textarea' => 'Element',
'text' => 'Element',
'entity_reference' => 'EntityRef', 'entity_reference' => 'EntityRef',
]; ];
return $mapping[$spec['html_type']]; return $mapping[$spec['html_type']];
......
...@@ -29,10 +29,9 @@ ...@@ -29,10 +29,9 @@
* *
* @package CRM * @package CRM
* @copyright CiviCRM LLC (c) 2004-2017 * @copyright CiviCRM LLC (c) 2004-2017
* $Id$
*
*/ */
/*
/**
* Settings metadata file * Settings metadata file
*/ */
...@@ -42,28 +41,28 @@ return array( ...@@ -42,28 +41,28 @@ return array(
'group' => 'campaign', 'group' => 'campaign',
'name' => 'tag_unconfirmed', 'name' => 'tag_unconfirmed',
'type' => 'String', 'type' => 'String',
'html_type' => 'Text', 'html_type' => 'text',
'default' => 'Unconfirmed', 'default' => 'Unconfirmed',
'add' => '4.1', 'add' => '4.1',
'title' => 'Tag for Unconfirmed Petition Signers', 'title' => ts('Tag for Unconfirmed Petition Signers'),
'is_domain' => 1, 'is_domain' => 1,
'is_contact' => 0, 'is_contact' => 0,
'description' => NULL, 'description' => ts('If set, new contacts that are created when signing a petition are assigned a tag of this name.'),
'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.', 'help_text' => '',
), ),
'petition_contacts' => array( 'petition_contacts' => array(
'group_name' => 'Campaign Preferences', 'group_name' => 'Campaign Preferences',
'group' => 'campaign', 'group' => 'campaign',
'name' => 'petition_contacts', 'name' => 'petition_contacts',
'type' => 'String', 'type' => 'String',
'html_type' => 'Text', 'html_type' => 'text',
'default' => 'Petition Contacts', 'default' => 'Petition Contacts',
'add' => '4.1', 'add' => '4.1',
'title' => 'Petition Signers Group', 'title' => ts('Petition Signers Group'),
'is_domain' => 1, 'is_domain' => 1,
'is_contact' => 0, 'is_contact' => 0,
'description' => NULL, 'description' => ts('All contacts that have signed a CiviCampaign petition will be added to this group. The group will be created if it does not exist (it is required for email verification).'),
'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.', 'help_text' => '',
), ),
); );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment