Пример #1
0
 public function preProcess()
 {
     CRM_Utils_System::setTitle(ts('Settings - Addresses'));
     // Address Standardization
     $addrProviders = array('' => '- select -') + CRM_Core_SelectValues::addressProvider();
     $this->_varNames = array(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array('address_options' => array('html_type' => 'checkboxes', 'title' => ts('Address Fields'), 'weight' => 1), 'address_format' => array('html_type' => 'textarea', 'title' => ts('Display Format'), 'description' => NULL, 'weight' => 2), 'mailing_format' => array('html_type' => 'textarea', 'title' => ts('Mailing Label Format'), 'description' => NULL, 'weight' => 3)), CRM_Core_BAO_Setting::ADDRESS_STANDARDIZATION_PREFERENCES_NAME => array('address_standardization_provider' => array('html_type' => 'select', 'title' => ts('Provider'), 'option_values' => $addrProviders, 'weight' => 4), 'address_standardization_userid' => array('html_type' => 'text', 'title' => ts('User ID'), 'description' => NULL, 'weight' => 5), 'address_standardization_url' => array('html_type' => 'text', 'title' => ts('Web Service URL'), 'description' => NULL, 'weight' => 6)));
     parent::preProcess();
 }
Пример #2
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();
 }