Example #1
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Search Preferences'));
     // @todo remove the following adds in favour of setting via the settings array (above).
     $this->addYesNo('includeWildCardInName', ts('Automatic Wildcard'));
     $this->addYesNo('includeEmailInName', ts('Include Email'));
     $this->addYesNo('includeNickNameInName', ts('Include Nickname'));
     $this->addYesNo('includeAlphabeticalPager', ts('Include Alphabetical Pager'));
     $this->addYesNo('includeOrderByClause', ts('Include Order By Clause'));
     $this->addElement('text', 'smartGroupCacheTimeout', ts('Smart group cache timeout'), array('size' => 3, 'maxlength' => 5));
     $types = array('Contact', 'Individual', 'Organization', 'Household');
     $profiles = CRM_Core_BAO_UFGroup::getProfiles($types);
     $this->add('select', 'defaultSearchProfileID', ts('Default Contact Search Profile'), array('' => ts('- none -')) + $profiles, FALSE, array('class' => 'crm-select2 huge'));
     // Autocomplete for Contact Search (quick search etc.)
     $options = array(ts('Contact Name') => 1) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options', FALSE, FALSE, TRUE));
     $this->addCheckBox('autocompleteContactSearch', ts('Autocomplete Contact Search'), $options, NULL, NULL, NULL, NULL, array('  '));
     $element = $this->getElement('autocompleteContactSearch');
     $element->_elements[0]->_flagFrozen = TRUE;
     // Autocomplete for Contact Reference (custom fields)
     $optionsCR = array(ts('Contact Name') => 1) + array_flip(CRM_Core_OptionGroup::values('contact_reference_options', FALSE, FALSE, TRUE));
     $this->addCheckBox('autocompleteContactReference', ts('Contact Reference Options'), $optionsCR, NULL, NULL, NULL, NULL, array('  '));
     $element = $this->getElement('autocompleteContactReference');
     $element->_elements[0]->_flagFrozen = TRUE;
     parent::buildQuickForm();
 }
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts(' Settings - Debugging and Error Handling '));
     if (CRM_Core_Config::singleton()->userSystem->supports_UF_Logging == '1') {
         $this->_settings['userFrameworkLogging'] = CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME;
     }
     parent::buildQuickForm();
 }
Example #3
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Mapping Provider'));
     $map = CRM_Core_SelectValues::mapProvider();
     $this->addElement('select', 'mapProvider', ts('Map Provider'), array('' => '- select -') + $map);
     $this->add('text', 'mapAPIKey', ts('Provider Key'), null);
     parent::buildQuickForm();
 }
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Simple donate form'));
     $attributes = array('entity' => 'Contribution', 'field' => 'contribution_page_id', 'option_url' => NULL);
     $this->addSelect('simpleDonation', $attributes, TRUE);
     $this->addElement('checkbox', "ziptastic", ts('Is Ziptastic enabled?'));
     parent::buildQuickForm();
 }
 public function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     $defaults['selected_profile'] = 'Default';
     $defaults['pdfinfo_path'] = CRM_Donrec_Logic_Settings::get('donrec_pdfinfo_path');
     $defaults['packet_size'] = CRM_Donrec_Logic_Settings::get('donrec_packet_size');
     return $defaults;
 }
Example #6
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)'));
     $this->assign('validTriggerPermission', CRM_Core_DAO::checkTriggerViewPermission(FALSE));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Miscellaneous', 'formRule'), $this);
     parent::buildQuickForm();
     $this->addRule('checksum_timeout', ts('Value should be a positive number'), 'positiveInteger');
 }
Example #7
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Miscellaneous'));
     $this->addYesNo('versionCheck', ts('Version Check & Statistics Reporting'));
     $this->addElement('text', 'maxAttachments', ts('Maximum Attachments'), array('size' => 2, 'maxlength' => 8));
     $this->addElement('text', 'recaptchaPublicKey', ts('Public Key'), array('size' => 64, 'maxlength' => 64));
     $this->addElement('text', 'recaptchaPrivateKey', ts('Private Key'), array('size' => 64, 'maxlength' => 64));
     parent::buildQuickForm();
 }
Example #8
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - CiviMail'));
     $check = TRUE;
     // redirect to Administer Section After hitting either Save or Cancel button.
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Mail', 'formRule'));
     parent::buildQuickForm($check);
 }
 public function postProcess()
 {
     parent::postProcess();
     // handle logging
     // FIXME: do it only if the setting changed
     require_once 'CRM/Logging/Schema.php';
     $values = $this->exportValues();
     $logging = new CRM_Logging_Schema();
     $values['logging'] ? $logging->enableLogging() : $logging->disableLogging();
 }
 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Date'));
     $this->addElement('text', 'dateformatDatetime', ts('Complete Date and Time'));
     $this->addElement('text', 'dateformatFull', ts('Complete Date'));
     $this->addElement('text', 'dateformatPartial', ts('Month and Year'));
     $this->addElement('text', 'dateformatYear', ts('Year Only'));
     $this->addElement('text', 'dateformatTime', ts('Time Only'));
     parent::buildQuickForm();
 }
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Mapping and Geocoding Providers'));
     $map = CRM_Core_SelectValues::mapProvider();
     $geo = CRM_Core_SelectValues::geoProvider();
     $this->addElement('select', 'mapProvider', ts('Mapping Provider'), array('' => '- select -') + $map, array('onChange' => 'showHideMapAPIkey( this.value );'));
     $this->add('text', 'mapAPIKey', ts('Map Provider Key'), NULL);
     $this->addElement('select', 'geoProvider', ts('Geocoding Provider'), array('' => '- select -') + $geo, array('onChange' => 'showHideGeoAPIkey( this.value );'));
     $this->add('text', 'geoAPIKey', ts('Geo Provider Key'), NULL);
     parent::buildQuickForm();
 }
Example #12
0
 public function postProcess()
 {
     // if extensions url is set, lets clear session status messages to avoid
     // a potentially spurious message which might already have been set. This
     // is a bit hackish
     // CRM-10629
     $session = CRM_Core_Session::singleton();
     $session->getStatus(TRUE);
     parent::postProcess();
     parent::rebuildMenu();
 }
 public function postProcess()
 {
     $values = $this->exportValues();
     // store settings
     $expected_values = array('hh_mode', 'hh_head_mode', 'hh_member_relation', 'hh_head_relation');
     foreach ($expected_values as $key) {
         if (isset($values[$key])) {
             CRM_Householdmerge_Logic_Configuration::setConfigValue($key, $values[$key]);
         }
     }
     parent::postProcess();
 }
Example #14
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Search Preferences'));
     parent::buildQuickForm();
     // @todo remove the following adds in favour of setting via the settings array (above).
     // Autocomplete for Contact Search (quick search etc.)
     $element = $this->getElement('contact_autocomplete_options');
     $element->_elements[0]->_flagFrozen = TRUE;
     // Autocomplete for Contact Reference (custom fields)
     $element = $this->getElement('contact_reference_options');
     $element->_elements[0]->_flagFrozen = TRUE;
 }
Example #15
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - CiviMail'));
     $this->addElement('text', 'verpSeparator', ts('VERP Separator'));
     $this->addElement('text', 'mailerBatchLimit', ts('Mailer Batch Limit'));
     $this->addElement('text', 'mailerJobSize', ts('Mailer Job Size'));
     $check = true;
     // redirect to Administer Section After hitting either Save or Cancel button.
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
     parent::buildQuickForm($check);
 }
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts(' Settings - Debugging and Error Handling '));
     $config = CRM_Core_Config::singleton();
     $this->addYesNo('debug', ts('Enable Debugging'));
     if ($config->userSystem->is_drupal == '1') {
         $this->addYesNo('userFrameworkLogging', ts('Enable Drupal Watchdog Logging'));
     }
     $this->addYesNo('backtrace', ts('Display Backtrace'));
     $this->addElement('text', 'fatalErrorTemplate', ts('Fatal Error Template'));
     $this->addElement('text', 'fatalErrorHandler', ts('Fatal Error Handler'));
     parent::buildQuickForm();
 }
 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)'));
     $this->assign('validTriggerPermission', CRM_Core_DAO::checkTriggerViewPermission(FALSE));
     $this->addElement('text', 'wkhtmltopdfPath', ts('Path to wkhtmltopdf executable'), array('size' => 64, 'maxlength' => 256));
     $this->addElement('text', 'recaptchaPublicKey', ts('Public Key'), array('size' => 64, 'maxlength' => 64));
     $this->addElement('text', 'recaptchaPrivateKey', ts('Private Key'), array('size' => 64, 'maxlength' => 64));
     $this->addElement('text', 'dashboardCacheTimeout', ts('Dashboard cache timeout'), array('size' => 3, 'maxlength' => 5));
     $this->addElement('text', 'recaptchaOptions', ts('Recaptcha Options'), array('size' => 64, 'maxlength' => 64));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Miscellaneous', 'formRule'), $this);
     parent::buildQuickForm();
     $this->addRule('checksumTimeout', ts('Value should be a positive number'), 'positiveInteger');
 }
Example #18
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Date'));
     $this->addElement('text', 'dateformatDatetime', ts('Complete Date and Time'));
     $this->addElement('text', 'dateformatFull', ts('Complete Date'));
     $this->addElement('text', 'dateformatPartial', ts('Month and Year'));
     $this->addElement('text', 'dateformatYear', ts('Year Only'));
     $this->addElement('text', 'dateformatTime', ts('Time Only'));
     $this->add('select', 'dateInputFormat', ts('Complete Date'), CRM_Core_SelectValues::getDatePluginInputFormats());
     $this->add('select', 'timeInputFormat', ts('Time'), CRM_Core_SelectValues::getTimeFormats());
     $this->add('date', 'fiscalYearStart', ts('Fiscal Year Start'), CRM_Core_SelectValues::date(null, 'M d'));
     parent::buildQuickForm();
 }
Example #19
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     $outBoundOption = array('0' => ts('SMTP'), '1' => ts('Sendmail'), '2' => ts('Disable Outbound Email'));
     $this->addRadio('outBound_option', ts('Select Mailer'), $outBoundOption);
     CRM_Utils_System::setTitle(ts('Settings - Outbound Mail'));
     $this->add('text', 'sendmail_path', ts('Sendmail Path'));
     $this->add('text', 'sendmail_args', ts('Sendmail Argument'));
     $this->add('text', 'smtpServer', ts('SMTP Server'));
     $this->add('text', 'smtpPort', ts('SMTP Port'));
     $this->addYesNo('smtpAuth', ts('Authentication?'));
     $this->addElement('text', 'smtpUsername', ts('SMTP Username'));
     $this->addElement('password', 'smtpPassword', ts('SMTP Password'));
     $this->_testButtonName = $this->getButtonName('refresh', 'test');
     $this->add('submit', $this->_testButtonName, ts('Save & Send Test Email'));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Smtp', 'formRule'));
     parent::buildQuickForm();
 }
Example #20
0
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     $outBoundOption = array(CRM_Mailing_Config::OUTBOUND_OPTION_MAIL => ts('mail()'), CRM_Mailing_Config::OUTBOUND_OPTION_SMTP => ts('SMTP'), CRM_Mailing_Config::OUTBOUND_OPTION_SENDMAIL => ts('Sendmail'), CRM_Mailing_Config::OUTBOUND_OPTION_DISABLED => ts('Disable Outbound Email'), CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB => ts('Redirect to Database'));
     $this->addRadio('outBound_option', ts('Select Mailer'), $outBoundOption);
     CRM_Utils_System::setTitle(ts('Settings - Outbound Mail'));
     $this->add('text', 'sendmail_path', ts('Sendmail Path'));
     $this->add('text', 'sendmail_args', ts('Sendmail Argument'));
     $this->add('text', 'smtpServer', ts('SMTP Server'));
     $this->add('text', 'smtpPort', ts('SMTP Port'));
     $this->addYesNo('smtpAuth', ts('Authentication?'));
     $this->addElement('text', 'smtpUsername', ts('SMTP Username'));
     $this->addElement('password', 'smtpPassword', ts('SMTP Password'));
     $this->_testButtonName = $this->getButtonName('refresh', 'test');
     $this->add('submit', $this->_testButtonName, ts('Save & Send Test Email'));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Smtp', 'formRule'));
     parent::buildQuickForm();
 }
 public function postProcess()
 {
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     // get current logging status
     $values = $this->exportValues();
     parent::postProcess();
     $config = CRM_Core_Config::singleton();
     if ($config->logging != $values['logging']) {
         $logging = new CRM_Logging_Schema();
         if ($values['logging']) {
             $config->logging = TRUE;
             $logging->enableLogging();
         } else {
             $config->logging = FALSE;
             $logging->disableLogging();
         }
     }
 }
 public function postProcess()
 {
     if (!empty($_POST['_qf_UpdateConfigBackend_next_cleanup'])) {
         $config = CRM_Core_Config::singleton();
         // cleanup templates_c directory
         $config->cleanup(1, FALSE);
         // clear all caches
         CRM_Core_Config::clearDBCache();
         CRM_Utils_System::flushCache();
         parent::rebuildMenu();
         CRM_Core_BAO_WordReplacement::rebuild();
         CRM_Core_Session::setStatus(ts('Cache has been cleared and menu has been rebuilt successfully.'), ts("Success"), "success");
     }
     if (!empty($_POST['_qf_UpdateConfigBackend_next_resetpaths'])) {
         $msg = CRM_Core_BAO_ConfigSetting::doSiteMove();
         CRM_Core_Session::setStatus($msg, ts("Success"), "success");
     }
     return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/setting/updateConfigBackend', 'reset=1'));
 }
Example #23
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - CiviMail'));
     $this->addElement('text', 'verpSeparator', ts('VERP Separator'));
     $this->addElement('text', 'mailerBatchLimit', ts('Mailer Batch Limit'));
     $this->addElement('text', 'mailThrottleTime', ts('Mailer Throttle Time'));
     $this->addElement('text', 'mailerJobSize', ts('Mailer Job Size'));
     $this->addElement('text', 'mailerJobsMax', ts('Mailer CRON job limit'));
     $check = TRUE;
     // redirect to Administer Section After hitting either Save or Cancel button.
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Mail', 'formRule'));
     $this->addRule('mailerBatchLimit', ts('Please enter a valid integer.'), 'integer');
     $this->addRule('mailThrottleTime', ts('Please enter a valid integer.'), 'integer');
     $this->addRule('mailerJobSize', ts('Please enter a valid integer.'), 'integer');
     $this->addRule('mailerJobsMax', ts('Please enter a valid integer.'), 'integer');
     parent::buildQuickForm($check);
 }
Example #24
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     $config =& CRM_Core_Config::singleton();
     $uf = $config->userFramework;
     CRM_Utils_System::setTitle(ts('Settings - %1 Integration', array(1 => $uf)));
     $this->addElement('text', 'userFrameworkVersion', ts('%1 Version', array(1 => $uf)));
     $this->addElement('text', 'userFrameworkUsersTableName', ts('%1 Users Table Name', array(1 => $uf)));
     if (function_exists('module_exists') && module_exists('views') && $config->dsn != $config->userFrameworkDSN) {
         $dsnArray = DB::parseDSN($config->dsn);
         $tableNames = CRM_Core_DAO::GetStorageValues(null, 0, 'Name');
         $tablePrefixes = '$db_prefix = array(';
         foreach ($tableNames as $tableName => $value) {
             $tablePrefixes .= "\n  '" . str_pad($tableName . "'", 41) . " => '{$dsnArray['database']}.',";
         }
         $tablePrefixes .= "\n);";
         $this->assign('tablePrefixes', $tablePrefixes);
     }
     parent::buildQuickForm();
 }
Example #25
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Search'));
     $this->addYesNo('includeWildCardInName', ts('Automatic Wildcard'));
     $this->addYesNo('includeEmailInName', ts('Include Email'));
     $this->addYesNo('includeNickNameInName', ts('Include Nickname'));
     $this->addYesNo('includeAlphabeticalPager', ts('Include Alphabetical Pager'));
     $this->addYesNo('includeOrderByClause', ts('Include Order By Clause'));
     $this->addElement('text', 'smartGroupCacheTimeout', ts('Smart group cache timeout'), array('size' => 3, 'maxlength' => 5));
     require_once "CRM/Core/BAO/UFGroup.php";
     $types = array('Contact', 'Individual', 'Organization', 'Household');
     $profiles = CRM_Core_BAO_UFGroup::getProfiles($types);
     $this->add('select', 'defaultSearchProfileID', ts('Default Contact Search Profile'), array('' => ts('- select -')) + $profiles);
     require_once 'CRM/Core/OptionGroup.php';
     $options = array(ts('Contact Name') => 1) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options', false, false, true));
     $this->addCheckBox('autocompleteContactSearch', 'Autocomplete Contact Search', $options, null, null, null, null, array('  '));
     $element = $this->getElement('autocompleteContactSearch');
     $element->_elements[0]->_flagFrozen = true;
     parent::buildQuickForm();
 }
 /**
  * Build the form object.
  */
 function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Mandrill SMTP Settings - Outbound Mail'));
     $this->add('text', 'smtpServer', ts('SMTP Server'), NULL, TRUE);
     $this->add('text', 'smtpPort', ts('SMTP Port'), NULL, TRUE);
     $this->addYesNo('smtpAuth', ts('Authentication?'), NULL, TRUE);
     $this->addElement('text', 'smtpUsername', ts('SMTP Username'));
     $this->addElement('password', 'smtpPassword', ts('SMTP Password'));
     $this->_testButtonName = $this->getButtonName('refresh', 'test');
     $this->add('submit', $this->_testButtonName, ts('Save & Send Test Email'));
     $this->add('checkbox', 'is_active', ts('Enabled?'));
     $options = array('Transactional Emails' => 1, 'CiviMail Bulk Mailings' => 2);
     $this->addCheckBox('used_for', ts('Used For?'), $options, NULL, NULL, NULL, NULL, array('&nbsp;&nbsp;', '&nbsp;&nbsp;', '<br/>'));
     $element = $this->add('text', 'mandril_post_url', ts('Mandrill Post to URL'));
     $element->freeze();
     // add select for groups
     $this->add('select', 'group_id', ts('Group to notify'), array('' => ts('- any group -')) + CRM_Core_PseudoConstant::group());
     $this->addFormRule(array('CRM_Mte_Form_MandrillSmtpSetting', 'formRule'));
     parent::buildQuickForm();
 }
Example #27
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     $config = CRM_Core_Config::singleton();
     $this->_uf = $config->userFramework;
     if ($this->_uf == 'WordPress') {
         $this->_settings['wpBasePage'] = CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME;
     }
     CRM_Utils_System::setTitle(ts('Settings - %1 Integration', array(1 => $this->_uf)));
     if ($config->userSystem->is_drupal) {
         $this->_settings['userFrameworkUsersTableName'] = CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME;
     }
     // find out if drupal has its database prefixed
     global $databases;
     $drupal_prefix = '';
     if (isset($databases['default']['default']['prefix'])) {
         if (is_array($databases['default']['default']['prefix'])) {
             $drupal_prefix = $databases['default']['default']['prefix']['default'];
         } else {
             $drupal_prefix = $databases['default']['default']['prefix'];
         }
     }
     if (function_exists('module_exists') && module_exists('views') && ($config->dsn != $config->userFrameworkDSN || !empty($drupal_prefix))) {
         $dsnArray = DB::parseDSN($config->dsn);
         $tableNames = CRM_Core_DAO::GetStorageValues(NULL, 0, 'Name');
         $tablePrefixes = '$databases[\'default\'][\'default\'][\'prefix\']= array(';
         $tablePrefixes .= "\n  'default' => '{$drupal_prefix}',";
         // add default prefix: the drupal database prefix
         $prefix = "";
         if ($config->dsn != $config->userFrameworkDSN) {
             $prefix = "`{$dsnArray['database']}`.";
         }
         foreach ($tableNames as $tableName => $value) {
             $tablePrefixes .= "\n  '" . str_pad($tableName . "'", 41) . " => '{$prefix}',";
         }
         $tablePrefixes .= "\n);";
         $this->assign('tablePrefixes', $tablePrefixes);
     }
     parent::buildQuickForm();
 }
Example #28
0
 public function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     parent::commonProcess($params);
     // reset navigation when components are enabled / disabled
     CRM_Core_BAO_Navigation::resetNavigation();
 }
Example #29
0
 public function postProcess()
 {
     $values = $this->exportValues();
     //cache contact fields retaining localized titles
     //though we changed localization, so reseting cache.
     CRM_Core_BAO_Cache::deleteGroup('contact fields');
     //CRM-8559, cache navigation do not respect locale if it is changed, so reseting cache.
     CRM_Core_BAO_Cache::deleteGroup('navigation');
     // we do this only to initialize monetary decimal point and thousand separator
     $config = CRM_Core_Config::singleton();
     // save enabled currencies and defaul currency in option group 'currencies_enabled'
     // CRM-1496
     if (empty($values['currencyLimit'])) {
         $values['currencyLimit'] = array($values['defaultCurrency']);
     } elseif (!in_array($values['defaultCurrency'], $values['currencyLimit'])) {
         $values['currencyLimit'][] = $values['defaultCurrency'];
     }
     // sort so that when we display drop down, weights have right value
     sort($values['currencyLimit']);
     // get labels for all the currencies
     $options = array();
     $currencySymbols = self::getCurrencySymbols();
     for ($i = 0; $i < count($values['currencyLimit']); $i++) {
         $options[] = array('label' => $currencySymbols[$values['currencyLimit'][$i]], 'value' => $values['currencyLimit'][$i], 'weight' => $i + 1, 'is_active' => 1, 'is_default' => $values['currencyLimit'][$i] == $values['defaultCurrency']);
     }
     $dontCare = NULL;
     CRM_Core_OptionGroup::createAssoc('currencies_enabled', $options, $dontCare);
     // unset currencyLimit so we dont store there
     unset($values['currencyLimit']);
     // make the site multi-lang if requested
     if (!empty($values['makeMultilingual'])) {
         CRM_Core_I18n_Schema::makeMultilingual($values['lcMessages']);
         $values['languageLimit'][$values['lcMessages']] = 1;
         // make the site single-lang if requested
     } elseif (!empty($values['makeSinglelingual'])) {
         CRM_Core_I18n_Schema::makeSinglelingual($values['lcMessages']);
         $values['languageLimit'] = '';
     }
     // add a new db locale if the requested language is not yet supported by the db
     if (!CRM_Utils_Array::value('makeSinglelingual', $values) and CRM_Utils_Array::value('addLanguage', $values)) {
         $domain = new CRM_Core_DAO_Domain();
         $domain->find(TRUE);
         if (!substr_count($domain->locales, $values['addLanguage'])) {
             CRM_Core_I18n_Schema::addLocale($values['addLanguage'], $values['lcMessages']);
         }
         $values['languageLimit'][$values['addLanguage']] = 1;
     }
     // if we manipulated the language list, return to the localization admin screen
     $return = (bool) (CRM_Utils_Array::value('makeMultilingual', $values) or CRM_Utils_Array::value('addLanguage', $values));
     $filteredValues = $values;
     unset($filteredValues['makeMultilingual']);
     unset($filteredValues['makeSinglelingual']);
     unset($filteredValues['addLanguage']);
     unset($filteredValues['languageLimit']);
     Civi::settings()->set('languageLimit', CRM_Utils_Array::value('languageLimit', $values));
     // save all the settings
     parent::commonProcess($filteredValues);
     if ($return) {
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/setting/localization', 'reset=1'));
     }
 }
Example #30
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Mapping and Geocoding Providers'));
     parent::buildQuickForm();
 }