Example #1
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     $config = CRM_Core_Config::singleton();
     CRM_Utils_System::setTitle(ts('Settings - Localization'));
     $warningTitle = json_encode(ts("Warning"));
     $defaultLocaleOptions = CRM_Admin_Form_Setting_Localization::getDefaultLocaleOptions();
     $domain = new CRM_Core_DAO_Domain();
     $domain->find(TRUE);
     if ($domain->locales) {
         // add language limiter and language adder
         $this->addCheckBox('languageLimit', ts('Available Languages'), array_flip($defaultLocaleOptions), NULL, NULL, NULL, NULL, '   ');
         $this->addElement('select', 'addLanguage', ts('Add Language'), array_merge(array('' => ts('- select -')), array_diff(CRM_Core_I18n::languages(), $defaultLocaleOptions)));
         // add the ability to return to single language
         $warning = ts('This will make your CiviCRM installation a single-language one again. THIS WILL DELETE ALL DATA RELATED TO LANGUAGES OTHER THAN THE DEFAULT ONE SELECTED ABOVE (and only that language will be preserved).');
         $this->assign('warning', $warning);
         $warning = json_encode($warning);
         $this->addElement('checkbox', 'makeSinglelingual', ts('Return to Single Language'), NULL, array('onChange' => "if (this.checked) CRM.alert({$warning}, {$warningTitle})"));
     } else {
         $warning = ts('Enabling multiple languages changes the schema of your database, so make sure you know what you are doing when enabling this function; making a database backup is strongly recommended.');
         $this->assign('warning', $warning);
         $warning = json_encode($warning);
         $validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(TRUE);
         if ($validTriggerPermission && !$config->logging) {
             $this->addElement('checkbox', 'makeMultilingual', ts('Enable Multiple Languages'), NULL, array('onChange' => "if (this.checked) CRM.alert({$warning}, {$warningTitle})"));
         }
     }
     $this->addElement('select', 'contact_default_language', ts('Default Language for users'), CRM_Admin_Form_Setting_Localization::getDefaultLanguageOptions());
     $includeCurrency =& $this->addElement('advmultiselect', 'currencyLimit', ts('Available Currencies') . ' ', self::getCurrencySymbols(), array('size' => 5, 'style' => 'width:150px', 'class' => 'advmultiselect'));
     $includeCurrency->setButtonAttributes('add', array('value' => ts('Add >>')));
     $includeCurrency->setButtonAttributes('remove', array('value' => ts('<< Remove')));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Localization', 'formRule'));
     parent::buildQuickForm();
 }
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Undelete, Logging and ReCAPTCHA'));
     $this->addYesNo('contactUndelete', ts('Contact Trash & Undelete'));
     // also check if we can enable triggers
     $validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(FALSE);
     // FIXME: for now, disable logging for multilingual sites OR if triggers are not permittted
     $domain = new CRM_Core_DAO_Domain();
     $domain->find(TRUE);
     $attribs = $domain->locales || !$validTriggerPermission ? array('disabled' => 'disabled') : NULL;
     $this->assign('validTriggerPermission', $validTriggerPermission);
     $this->addYesNo('logging', ts('Logging'), NULL, NULL, $attribs);
     $this->addYesNo('versionCheck', ts('Version Check & Statistics Reporting'));
     $this->addYesNo('doNotAttachPDFReceipt', ts('Attach PDF copy to receipts'));
     $this->addElement('text', 'wkhtmltopdfPath', ts('Path to wkhtmltopdf executable'), array('size' => 64, 'maxlength' => 256));
     $this->addElement('text', 'maxAttachments', ts('Maximum Attachments'), array('size' => 2, 'maxlength' => 8));
     $this->addElement('text', 'maxFileSize', ts('Maximum File Size'), 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));
     $this->addElement('text', 'dashboardCacheTimeout', ts('Dashboard cache timeout'), array('size' => 3, 'maxlength' => 5));
     $this->addElement('text', 'checksumTimeout', ts('CheckSum Lifespan'), array('size' => 2, 'maxlength' => 8));
     $this->addElement('text', 'recaptchaOptions', ts('Recaptcha Options'), array('size' => 64, 'maxlength' => 64));
     $this->addRule('maxAttachments', ts('Value should be a positive number'), 'positiveInteger');
     $this->addRule('maxFileSize', ts('Value should be a positive number'), 'positiveInteger');
     $this->addRule('checksumTimeout', ts('Value should be a positive number'), 'positiveInteger');
     parent::buildQuickForm();
 }
Example #3
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('&nbsp;&nbsp;'));
     $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('&nbsp;&nbsp;'));
     $element = $this->getElement('autocompleteContactReference');
     $element->_elements[0]->_flagFrozen = TRUE;
     parent::buildQuickForm();
 }
Example #4
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 #5
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();
 }
 /**
  * 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 #8
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 #9
0
 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Enable Components'));
     $components = $this->_getComponentSelectValues();
     $include =& $this->addElement('advmultiselect', 'enableComponents', ts('Components') . ' ', $components, array('size' => 5, 'style' => 'width:150px', 'class' => 'advmultiselect'));
     $include->setButtonAttributes('add', array('value' => ts('Enable >>')));
     $include->setButtonAttributes('remove', array('value' => ts('<< Disable')));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Component', 'formRule'), $this);
     parent::buildQuickForm();
 }
 public function buildQuickForm()
 {
     // load realtionships
     $relationshipOptions = $this->getEligibleRelationships();
     $this->addElement('select', 'hh_mode', ts('Household Mode', array('domain' => 'de.systopia.householdmerge')), CRM_Householdmerge_Logic_Configuration::getHouseholdModeOptions(), array('class' => 'crm-select2'));
     $this->addElement('select', 'hh_head_mode', ts('Household Head Mode', array('domain' => 'de.systopia.householdmerge')), CRM_Householdmerge_Logic_Configuration::getHouseholdHeadModeOptions(), array('class' => 'crm-select2'));
     $this->addElement('select', 'hh_member_relation', ts('Household Member Relationship', array('domain' => 'de.systopia.householdmerge')), $relationshipOptions, array('class' => 'crm-select2'));
     $this->addElement('select', 'hh_head_relation', ts('Household Head Relationship', array('domain' => 'de.systopia.householdmerge')), $relationshipOptions, array('class' => 'crm-select2'));
     parent::buildQuickForm();
 }
Example #11
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);
 }
Example #12
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Resource URLs'));
     $this->addElement('text', 'userFrameworkResourceURL', ts('CiviCRM Resource URL'));
     $this->addElement('text', 'imageUploadURL', ts('Image Upload URL'));
     $this->addElement('text', 'customCSSURL', ts('Custom CiviCRM CSS URL'));
     $this->addYesNo('enableSSL', ts('Force Secure URLs (SSL)'));
     $this->addFormRule(array('CRM_Admin_Form_Setting_Url', 'formRule'));
     parent::buildQuickForm();
 }
 /**
  * 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();
 }
Example #14
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Upload Directories'));
     $directories = array('uploadDir' => ts('Temporary Files'), 'imageUploadDir' => ts('Images'), 'customFileUploadDir' => ts('Custom Files'), 'customTemplateDir' => ts('Custom Templates'), 'customPHPPathDir' => ts('Custom PHP Path Directory'), 'extensionsDir' => ts('CiviCRM Extensions Directory'));
     foreach ($directories as $name => $title) {
         $this->add('text', $name, $title);
         $this->addRule($name, ts("'%1' directory does not exist", array(1 => $title)), 'fileExists');
     }
     parent::buildQuickForm();
 }
Example #15
0
 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Resource URLs'));
     $settingFields = civicrm_api('setting', 'getfields', array('version' => 3));
     $this->addYesNo('enableSSL', ts('Force Secure URLs (SSL)'));
     $this->addYesNo('verifySSL', ts('Verify SSL Certs'));
     // FIXME: verifySSL should use $_settings instead of manually adding fields
     $this->assign('verifySSL_description', $settingFields['values']['verifySSL']['description']);
     $this->addFormRule(array('CRM_Admin_Form_Setting_Url', 'formRule'));
     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 #17
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);
 }
Example #18
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;
 }
 /**
  * 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 #20
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();
 }
 /**
  * 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();
 }
Example #22
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Update Directory Path and URL'));
     require_once 'CRM/Core/BAO/Setting.php';
     list($this->_oldBaseURL, $this->_oldBaseDir, $this->_oldSiteName) = CRM_Core_BAO_Setting::getConfigSettings();
     $this->assign('oldBaseURL', $this->_oldBaseURL);
     $this->assign('oldBaseDir', $this->_oldBaseDir);
     $this->assign('oldSiteName', $this->_oldSiteName);
     $this->add('text', 'newBaseURL', ts('New Base URL'), null, true);
     $this->add('text', 'newBaseDir', ts('New Base Directory'), null, true);
     $this->add('text', 'newSiteName', ts('New Site Name'), null, true);
     $this->addFormRule(array('CRM_Admin_Form_Setting_UpdateConfigBackend', 'formRule'));
     parent::buildQuickForm();
 }
Example #23
0
 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Resource URLs'));
     $settingFields = civicrm_api('setting', 'getfields', array('version' => 3));
     $this->addElement('text', 'userFrameworkResourceURL', ts('CiviCRM Resource URL'));
     $this->addElement('text', 'imageUploadURL', ts('Image Upload URL'));
     $this->addElement('text', 'customCSSURL', ts('Custom css URL'));
     $this->addElement('text', 'extensionsURL', ts('Extension Resource URL'));
     $this->addYesNo('enableSSL', ts('Force Secure URLs (SSL)'));
     $this->addYesNo('verifySSL', ts('Verify SSL Certs'));
     // FIXME: verifySSL should use $_settings instead of manually adding fields
     $this->assign('verifySSL_description', $settingFields['values']['verifySSL']['description']);
     $this->addFormRule(array('CRM_Admin_Form_Setting_Url', 'formRule'));
     parent::buildQuickForm();
 }
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Settings - Cleanup Caches and Update Paths'));
     list($this->_oldBaseURL, $this->_oldBaseDir, $this->_oldSiteName) = CRM_Core_BAO_ConfigSetting::getConfigSettings();
     $this->assign('oldBaseURL', $this->_oldBaseURL);
     $this->assign('oldBaseDir', $this->_oldBaseDir);
     $this->assign('oldSiteName', $this->_oldSiteName);
     $this->addElement('submit', $this->getButtonName('next', 'cleanup'), 'Cleanup Caches', array('class' => 'form-submit', 'id' => 'cleanup-cache'));
     $this->add('text', 'newBaseURL', ts('New Base URL'), NULL, TRUE);
     $this->add('text', 'newBaseDir', ts('New Base Directory'), NULL, TRUE);
     if ($this->_oldSiteName) {
         $this->add('text', 'newSiteName', ts('New Site Name'), NULL, TRUE);
     }
     $this->addFormRule(array('CRM_Admin_Form_Setting_UpdateConfigBackend', 'formRule'));
     parent::buildQuickForm();
 }
Example #25
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();
 }
Example #26
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 #27
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 #28
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();
 }
 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)'));
     // also check if we can enable triggers
     $validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(FALSE);
     // FIXME: for now, disable logging for multilingual sites OR if triggers are not permittted
     $domain = new CRM_Core_DAO_Domain();
     $domain->find(TRUE);
     $attribs = $domain->locales || !$validTriggerPermission ? array('disabled' => 'disabled') : array();
     $this->assign('validTriggerPermission', $validTriggerPermission);
     $this->addYesNo('logging', ts('Logging'), NULL, NULL, $attribs);
     $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 #30
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('&nbsp;&nbsp;'));
     $element = $this->getElement('autocompleteContactSearch');
     $element->_elements[0]->_flagFrozen = true;
     parent::buildQuickForm();
 }