Example #1
0
 function preProcess()
 {
     $msDoc = CRM_Utils_System::docURL2('Multi Site Installation', NULL, NULL, NULL, NULL, "wiki");
     CRM_Utils_System::setTitle(ts('Multi Site Settings'));
     $this->_varNames = array(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME => array('is_enabled' => array('html_type' => 'checkbox', 'title' => ts('Enable Multi Site Configuration'), 'weight' => 1, 'description' => ts('Multi Site provides support for sharing a single CiviCRM database among multiple sites.') . ' ' . $msDoc), 'uniq_email_per_site' => array('html_type' => 'checkbox', 'title' => ts('Ensure multi sites have a unique email per site'), 'weight' => 2, 'description' => NULL), 'domain_group_id' => array('html_type' => 'text', 'title' => ts('Parent group for this domain'), 'weight' => 3, 'description' => ts('Enter the group ID (civicrm_group.id).')), 'event_price_set_domain_id' => array('html_type' => 'text', 'title' => ts('Domain for event price sets'), 'weight' => 4, 'description' => NULL)));
     parent::preProcess();
 }
 function preProcess()
 {
     $msDoc = CRM_Utils_System::docURL2('Multi Site Installation', NULL, NULL, NULL, NULL, "wiki");
     CRM_Utils_System::setTitle(ts('Multi Site Settings'));
     $this->_varNames = array(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME => array('is_enabled' => array('html_type' => 'checkbox', 'title' => ts('Enable Multi Site Configuration'), 'weight' => 1, 'description' => ts('Make CiviCRM aware of multiple domains. You should configure a domain group if enabled') . ' ' . $msDoc), 'domain_group_id' => array('html_type' => 'entity_reference', 'title' => ts('Domain Group'), 'weight' => 3, 'options' => array('entity' => 'group', 'select' => array('minimumInputLength' => 0)), 'description' => ts('Contacts created on this site are added to this group'))));
     parent::preProcess();
 }
Example #3
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     $htmlFields = array();
     foreach ($this->_settings as $setting => $group) {
         $settingMetaData = civicrm_api3('setting', 'getfields', array('name' => $setting));
         $props = $settingMetaData['values'][$setting];
         if (isset($props['quick_form_type'])) {
             $add = 'add' . $props['quick_form_type'];
             if ($add == 'addElement') {
                 if (in_array($props['html_type'], array('checkbox', 'textarea'))) {
                     $this->add($props['html_type'], $setting, $props['title']);
                 } else {
                     if ($props['html_type'] == 'select') {
                         $functionName = CRM_Utils_Array::value('name', CRM_Utils_Array::value('pseudoconstant', $props));
                         if ($functionName) {
                             $props['option_values'] = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::$functionName();
                         }
                     }
                     $this->{$add}($props['html_type'], $setting, ts($props['title']), CRM_Utils_Array::value($props['html_type'] == 'select' ? 'option_values' : 'html_attributes', $props, array()), $props['html_type'] == 'select' ? CRM_Utils_Array::value('html_attributes', $props) : NULL);
                 }
             } elseif ($add == 'addMonthDay') {
                 $this->add('date', $setting, ts($props['title']), CRM_Core_SelectValues::date(NULL, 'M d'));
             } elseif ($add == 'addDate') {
                 $this->addDate($setting, ts($props['title']), FALSE, array('formatType' => $props['type']));
             } else {
                 $this->{$add}($setting, ts($props['title']));
             }
         }
         $htmlFields[$setting] = ts($props['description']);
     }
     $this->assign('htmlFields', $htmlFields);
     parent::buildQuickForm();
     $this->addFormRule(array('CRM_Admin_Form_Preferences_Contribute', 'formRule'), $this);
 }
Example #4
0
 function preProcess()
 {
     CRM_Utils_System::setTitle(ts('CiviEvent Component Settings'));
     // pass "wiki" as 6th param to docURL2 if you are linking to a page in wiki.civicrm.org
     $docLink = CRM_Utils_System::docURL2("CiviEvent Cart Checkout", NULL, NULL, NULL, NULL, "wiki");
     $this->_varNames = array(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME => array('enable_cart' => array('html_type' => 'checkbox', 'title' => ts('Use Shopping Cart Style Event Registration'), 'weight' => 1, 'description' => ts('This feature allows users to register for more than one event at a time. When enabled, users will add event(s) to a "cart" and then pay for them all at once. Enabling this setting will affect online registration for all active events. The code is an alpha state, and you will potentially need to have developer resources to debug and fix sections of the codebase while testing and deploying it. %1', array(1 => $docLink)))));
     parent::preProcess();
 }
Example #5
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     $this->applyFilter('__ALL__', 'trim');
     $this->addFormRule(array('CRM_Admin_Form_Preferences_Address', 'formRule'));
     //get the tokens for Mailing Label field
     $tokens = CRM_Core_SelectValues::contactTokens();
     $this->assign('tokens', CRM_Utils_Token::formatTokensForDisplay($tokens));
     parent::buildQuickForm();
 }
Example #6
0
 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     if ($this->_action == CRM_Core_Action::VIEW) {
         return;
     }
     $this->_params = $this->controller->exportValues($this->_name);
     $this->_config->editor_id = $this->_params['wysiwyg_editor'];
     // set default editor to session if changed
     $session =& CRM_Core_Session::singleton();
     $session->set('defaultWysiwygEditor', $this->_params['wysiwyg_editor']);
     parent::postProcess();
 }
Example #7
0
 public function preProcess()
 {
     CRM_Utils_System::setTitle(ts('CiviEvent Component Settings'));
     // pass "wiki" as 6th param to docURL2 if you are linking to a page in wiki.civicrm.org
     $docLink = CRM_Utils_System::docURL2("CiviEvent Cart Checkout", NULL, NULL, NULL, NULL, "wiki");
     // build an array containing all selectable option values for show_events
     $optionValues = array();
     for ($i = 10; $i <= 100; $i += 10) {
         $optionValues[$i] = $i;
     }
     $this->_varNames = array(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME => array('enable_cart' => array('html_type' => 'checkbox', 'title' => ts('Use Shopping Cart Style Event Registration'), 'weight' => 1, 'description' => ts('This feature allows users to register for more than one event at a time. When enabled, users will add event(s) to a "cart" and then pay for them all at once. Enabling this setting will affect online registration for all active events. The code is an alpha state, and you will potentially need to have developer resources to debug and fix sections of the codebase while testing and deploying it. %1', array(1 => $docLink))), 'show_events' => array('html_type' => 'select', 'title' => ts('Dashboard entries'), 'weight' => 2, 'description' => ts('Configure how many events should be shown on the dashboard. This overrides the default value of 10 entries.'), 'option_values' => array('' => ts('- select -')) + $optionValues + array(-1 => ts('show all')))));
     parent::preProcess();
 }
Example #8
0
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     $this->applyFilter('__ALL__', 'trim');
     // Address Standardization
     $addrProviders = CRM_Core_SelectValues::addressProvider();
     $this->addElement('select', 'address_standardization_provider', ts('Address Provider'), array('' => '- select -') + $addrProviders);
     $this->addFormRule(array('CRM_Admin_Form_Preferences_Address', 'formRule'));
     //get the tokens for Mailing Label field
     $tokens = CRM_Core_SelectValues::contactTokens();
     natcasesort($tokens);
     $this->assign('tokens', json_encode($tokens));
     $this->add('select', 'token1', ts('Insert Token'), $tokens, FALSE, array('size' => "5", 'multiple' => TRUE, 'onclick' => "return tokenReplText(this);"));
     parent::buildQuickForm();
 }
Example #9
0
 public function postProcess()
 {
     // check if mailing tab is enabled, if not prompt user to enable the tab if "write_activity_record" is disabled
     $params = $this->controller->exportValues($this->_name);
     if (empty($params['write_activity_record'])) {
         $existingViewOptions = Civi::settings()->get('contact_view_options');
         $displayValue = CRM_Core_OptionGroup::getValue('contact_view_options', 'CiviMail', 'name');
         $viewOptions = explode(CRM_Core_DAO::VALUE_SEPARATOR, $existingViewOptions);
         if (!in_array($displayValue, $viewOptions)) {
             $existingViewOptions .= $displayValue . CRM_Core_DAO::VALUE_SEPARATOR;
             Civi::settings()->set('contact_view_options', $existingViewOptions);
             CRM_Core_Session::setStatus(ts('We have automatically enabled the Mailings tab for the Contact Summary screens
     so that you can view mailings sent to each contact.'), ts('Saved'), 'success');
         }
     }
     parent::postProcess();
 }
Example #10
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     //CRM-16691: Changes made related to settings of 'CVV'.
     foreach ($this->_settings as $setting => $group) {
         $settingMetaData = civicrm_api3('setting', 'getfields', array('name' => $setting));
         $props = $settingMetaData['values'][$setting];
         if (isset($props['quick_form_type'])) {
             $add = 'add' . $props['quick_form_type'];
             if ($add == 'addElement') {
                 $this->{$add}($props['html_type'], $setting, ts($props['title']), CRM_Utils_Array::value($props['html_type'] == 'select' ? 'option_values' : 'html_attributes', $props, array()), $props['html_type'] == 'select' ? CRM_Utils_Array::value('html_attributes', $props) : NULL);
             } else {
                 $this->{$add}($setting, ts($props['title']));
             }
         }
         $this->assign("{$setting}_description", ts($props['description']));
     }
     $this->add('checkbox', 'invoicing', ts('Enable Tax and Invoicing'));
     parent::buildQuickForm();
 }
Example #11
0
 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     $wysiwyg_options = CRM_Core_OptionGroup::values('wysiwyg_editor', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name');
     //changes for freezing the invoices/credit notes checkbox if invoicing is uncheck
     $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
     $extra = array();
     $this->addElement('select', 'editor_id', ts('WYSIWYG Editor'), $wysiwyg_options, $extra);
     $this->addElement('submit', 'ckeditor_config', ts('Configure CKEditor'));
     $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
     $this->assign('editOptions', $editOptions);
     $contactBlocks = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 1');
     $this->assign('contactBlocks', $contactBlocks);
     $nameFields = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 2');
     $this->assign('nameFields', $nameFields);
     $this->addElement('hidden', 'contact_edit_preferences', NULL, array('id' => 'contact_edit_preferences'));
     $optionValues = CRM_Core_OptionGroup::values('user_dashboard_options', FALSE, FALSE, FALSE, NULL, 'name');
     $invoicesKey = array_search('Invoices / Credit Notes', $optionValues);
     $this->assign('invoicesKey', $invoicesKey);
     parent::buildQuickForm();
 }
Example #12
0
 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();
 }
Example #13
0
 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     $wysiwyg_options = array('' => ts('Textarea')) + CRM_Core_OptionGroup::values('wysiwyg_editor');
     //changes for freezing the invoices/credit notes checkbox if invoicing is uncheck
     $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
     $config = CRM_Core_Config::singleton();
     $extra = array();
     //if not using Joomla, remove Joomla default editor option
     if ($config->userFramework != 'Joomla') {
         unset($wysiwyg_options[3]);
     }
     $drupal_wysiwyg = FALSE;
     if (!$config->userSystem->is_drupal || !module_exists("wysiwyg")) {
         unset($wysiwyg_options[4]);
     } else {
         $extra['onchange'] = '
   if (this.value==4) {
     cj("#crm-preferences-display-form-block-wysiwyg_input_format").show();
   }
   else {
     cj("#crm-preferences-display-form-block-wysiwyg_input_format").hide()
   }';
         $formats = filter_formats();
         $format_options = array();
         foreach ($formats as $id => $format) {
             $format_options[$id] = $format->name;
         }
         $drupal_wysiwyg = TRUE;
     }
     $this->addElement('select', 'editor_id', ts('WYSIWYG Editor'), $wysiwyg_options, $extra);
     if ($drupal_wysiwyg) {
         $this->addElement('select', 'wysiwyg_input_format', ts('Input Format'), $format_options, NULL);
     }
     $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
     $this->assign('editOptions', $editOptions);
     $contactBlocks = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 1');
     $this->assign('contactBlocks', $contactBlocks);
     $nameFields = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 2');
     $this->assign('nameFields', $nameFields);
     $this->addElement('hidden', 'contact_edit_preferences', NULL, array('id' => 'contact_edit_preferences'));
     $optionValues = CRM_Core_OptionGroup::values('user_dashboard_options', FALSE, FALSE, FALSE, NULL, 'name');
     $invoicesKey = array_search('Invoices / Credit Notes', $optionValues);
     $this->assign('invoicesKey', $invoicesKey);
     parent::buildQuickForm();
 }
Example #14
0
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 function buildQuickForm()
 {
     $this->add('select', 'default_renewal_contribution_page', ts('Default Online Membership Renewal Page'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionPage());
     parent::buildQuickForm();
 }
Example #15
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
 }
 function preProcess()
 {
     CRM_Utils_System::setTitle(ts('CiviMail Component Settings'));
     $this->_varNames = array(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME => array('profile_double_optin' => array('html_type' => 'checkbox', 'title' => ts('Enable Double Opt-in for Profile Group(s) field'), 'weight' => 1, 'description' => ts('When CiviMail is enabled, users who "subscribe" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.')), 'profile_add_to_group_double_optin' => array('html_type' => 'checkbox', 'title' => ts('Enable Double Opt-in for Profiles which use the "Add to Group" setting'), 'weight' => 2, 'description' => ts('When CiviMail is enabled and a profile uses the "Add to Group" setting, users who complete the profile form will receive a confirmation email. They must respond (opt-in) before they are added to the group.')), 'track_civimail_replies' => array('html_type' => 'checkbox', 'title' => ts('Track replies using VERP in Reply-To header'), 'weight' => 3, 'description' => ts('If checked, mailings will default to tracking replies using VERP-ed Reply-To.')), 'civimail_workflow' => array('html_type' => 'checkbox', 'title' => ts('Enable workflow support for CiviMail'), 'weight' => 4, 'description' => ts('Drupal-only. Rules module must be enabled (beta feature - use with caution).')), 'civimail_multiple_bulk_emails' => array('html_type' => 'checkbox', 'title' => ts('Enable multiple bulk email address for a contact.'), 'weight' => 5, 'description' => ts('CiviMail will deliver a copy of the email to each bulk email listed for the contact.')), 'civimail_server_wide_lock' => array('html_type' => 'checkbox', 'title' => ts('Enable global server wide lock for CiviMail'), 'weight' => 6, 'description' => NULL), 'include_message_id' => array('html_type' => 'checkbox', 'title' => ts('Enable CiviMail to generate Message-ID header'), 'weight' => 7, 'description' => NULL)));
     parent::preProcess();
 }
Example #17
0
 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     if ($this->_action == CRM_Core_Action::VIEW) {
         return;
     }
     $this->_params = $this->controller->exportValues($this->_name);
     if (CRM_Utils_Array::value('contact_edit_prefences', $this->_params)) {
         $preferenceWeights = explode(',', $this->_params['contact_edit_prefences']);
         foreach ($preferenceWeights as $key => $val) {
             if (!$val) {
                 unset($preferenceWeights[$key]);
             }
         }
         require_once 'CRM/Core/BAO/OptionValue.php';
         $opGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'contact_edit_options', 'id', 'name');
         CRM_Core_BAO_OptionValue::updateOptionWeights($opGroupId, array_flip($preferenceWeights));
     }
     $this->_config->editor_id = $this->_params['wysiwyg_editor'];
     $this->_config->display_name_format = $this->_params['display_name_format'];
     $this->_config->sort_name_format = $this->_params['sort_name_format'];
     // set default editor to session if changed
     $session = CRM_Core_Session::singleton();
     $session->set('defaultWysiwygEditor', $this->_params['wysiwyg_editor']);
     parent::postProcess();
 }
Example #18
0
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     $wysiwyg_options = array('' => ts('Textarea')) + CRM_Core_OptionGroup::values('wysiwyg_editor');
     $config = CRM_Core_Config::singleton();
     $extra = array();
     //if not using Joomla, remove Joomla default editor option
     if ($config->userFramework != 'Joomla') {
         unset($wysiwyg_options[3]);
     }
     $drupal_wysiwyg = FALSE;
     if (!$config->userSystem->is_drupal || !module_exists("wysiwyg")) {
         unset($wysiwyg_options[4]);
     } else {
         $extra['onchange'] = '
   if (this.value==4) {
     cj("#crm-preferences-display-form-block-wysiwyg_input_format").show();
   }
   else {
     cj("#crm-preferences-display-form-block-wysiwyg_input_format").hide()
   }';
         $formats = filter_formats();
         $format_options = array();
         foreach ($formats as $id => $format) {
             $format_options[$id] = $format->name;
         }
         $drupal_wysiwyg = TRUE;
     }
     $this->addElement('select', 'editor_id', ts('WYSIWYG Editor'), $wysiwyg_options, $extra);
     if ($drupal_wysiwyg) {
         $this->addElement('select', 'wysiwyg_input_format', ts('Input Format'), $format_options, NULL);
     }
     $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
     $this->assign('editOptions', $editOptions);
     $contactBlocks = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 1');
     $this->assign('contactBlocks', $contactBlocks);
     $nameFields = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 2');
     $this->assign('nameFields', $nameFields);
     $this->addElement('hidden', 'contact_edit_preferences', NULL, array('id' => 'contact_edit_preferences'));
     parent::buildQuickForm();
 }
Example #19
0
 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     if ($this->_action == CRM_Core_Action::VIEW) {
         return;
     }
     $this->_params = $this->controller->exportValues($this->_name);
     // trim the format and unify line endings to LF
     $format = array('address_format', 'mailing_format');
     foreach ($format as $f) {
         if (!empty($this->_params[$f])) {
             $this->_params[$f] = trim($this->_params[$f]);
             $this->_params[$f] = str_replace(array("\r\n", "\r"), "\n", $this->_params[$f]);
         }
     }
     $this->_config->copyValues($this->_params);
     parent::postProcess();
 }
Example #20
0
 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     $this->add('checkbox', 'invoicing', ts('Enable Tax and Invoicing'));
     parent::buildQuickForm();
 }