<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
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_standardization_provider' => array(
'html_type' => 'select',
+ 'title' => ts('Provider'),
+ 'option_values' => $addrProviders,
'weight' => 4,
),
'address_standardization_userid' => array(
parent::preProcess();
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
$defaults = array();
$defaults['address_standardization_provider'] = $this->_config->address_standardization_provider;
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
parent::buildQuickForm();
}
+ /**
+ * @param $fields
+ *
+ * @return bool
+ */
static function formRule($fields) {
$p = $fields['address_standardization_provider'];
$u = $fields['address_standardization_userid'];
";
$countyCount = CRM_Core_DAO::singleValueQuery($sql);
if ($countyCount < 10) {
- global $civicrm_root;
- $sqlFilePath = $civicrm_root . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . 'counties.US.sql.gz';
-
- CRM_Core_Session::setStatus("", ts('You have enabled the County option. Please ensure you populate the county table in your CiviCRM Database. You can find a list of US counties (in gzip format) in your distribution at: <em>%1</em>',
- array(1 => $sqlFilePath)),
+ CRM_Core_Session::setStatus(ts('You have enabled the County option. Please ensure you populate the county table in your CiviCRM Database. You can find extensions to populate counties in the ') . CRM_Utils_System::href(ts('CiviCRM Extensions Directory'), 'civicrm/admin/extensions', array('reset' => 1), TRUE, 'extensions-addnew'),
+ ts('Populate counties'),
"info"
);
}