<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
- *
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
*/
/**
*
* @return bool
*/
- static function checkAddress(&$values) {
+ public static function checkAddress(&$values) {
if (!isset($values['street_address']) ||
(!isset($values['city']) &&
!isset($values['state_province']) &&
return FALSE;
}
-
$userID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::ADDRESS_STANDARDIZATION_PREFERENCES_NAME,
'address_standardization_userid'
);
$code = $request->getResponseCode();
if ($code != 200) {
$session->setStatus(ts('USPS Address Lookup Failed with HTTP status code: %1',
- array(1 => $code)
- ));
+ array(1 => $code)
+ ));
return FALSE;
}
return FALSE;
}
- $values['street_address'] = (string)$xml->Address->Address2;
- $values['city'] = (string)$xml->Address->City;
- $values['state_province'] = (string)$xml->Address->State;
- $values['postal_code'] = (string)$xml->Address->Zip5;
- $values['postal_code_suffix'] = (string)$xml->Address->Zip4;
+ $values['street_address'] = (string) $xml->Address->Address2;
+ $values['city'] = (string) $xml->Address->City;
+ $values['state_province'] = (string) $xml->Address->State;
+ $values['postal_code'] = (string) $xml->Address->Zip5;
+ $values['postal_code_suffix'] = (string) $xml->Address->Zip4;
if (array_key_exists('Address1', $xml->Address)) {
- $values['supplemental_address_1'] = (string)$xml->Address->Address1;
+ $values['supplemental_address_1'] = (string) $xml->Address->Address1;
}
return TRUE;
}
-}
+}