Skip to content
Snippets Groups Projects
Unverified Commit 63155d32 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #17523 from mattwire/customsearchzipcode

Zip code range search only supports numeric zip codes 
parents 18252270 2fda4535
Branches
Tags
No related merge requests found
......@@ -146,16 +146,22 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND
* @return string
*/
public function where($includeContactIDs = FALSE) {
$params = [];
$low = CRM_Utils_Array::value('postal_code_low',
$this->_formValues
);
$high = CRM_Utils_Array::value('postal_code_high',
$this->_formValues
);
$errorMessage = NULL;
if ($low == NULL || $high == NULL) {
CRM_Core_Error::statusBounce(ts('Please provide start and end postal codes'),
$errorMessage = ts('Please provide start and end postal codes.');
}
if (!is_numeric($low) || !is_numeric($high)) {
$errorMessage = ts('This search only supports numeric postal codes.');
}
if ($errorMessage) {
CRM_Core_Error::statusBounce($errorMessage,
CRM_Utils_System::url('civicrm/contact/search/custom',
"reset=1&csid={$this->_formValues['customSearchID']}",
FALSE, NULL, FALSE, TRUE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment