<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*
*/
class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {
- function __construct(&$formValues) {
+ /**
+ * @param $formValues
+ */
+ public function __construct(&$formValues) {
parent::__construct($formValues);
$this->_columns = array(
- ts('Contact Id') => 'contact_id',
+ ts('Contact ID') => 'contact_id',
ts('Name') => 'sort_name',
ts('Email') => 'email',
ts('Zip') => 'postal_code',
);
}
- function buildForm(&$form) {
+ /**
+ * @param CRM_Core_Form $form
+ */
+ public function buildForm(&$form) {
$form->add('text',
'postal_code_low',
ts('Postal Code Start'),
$form->assign('elements', array('postal_code_low', 'postal_code_high'));
}
- function summary() {
+ /**
+ * @return array
+ */
+ public function summary() {
$summary = array();
return $summary;
}
+ public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) {
+ return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
+ }
+
+ /**
+ * @param int $offset
+ * @param int $rowcount
+ * @param null $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
+ */
function all($offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($justIDs) {
$selectClause = "contact_a.id as contact_id";
+ $sort = "contact_a.id";
}
else {
$selectClause = "
);
}
- function from() {
+ /**
+ * @return string
+ */
+ public function from() {
return "
FROM civicrm_contact contact_a
LEFT JOIN civicrm_address address ON ( address.contact_id = contact_a.id AND
";
}
- function where($includeContactIDs = FALSE) {
+ /**
+ * @param bool $includeContactIDs
+ *
+ * @return string
+ */
+ public function where($includeContactIDs = FALSE) {
$params = array();
$low = CRM_Utils_Array::value('postal_code_low',
return $this->whereClause($where, $params);
}
- function setDefaultValues() {
+ /**
+ * @return array
+ */
+ public function setDefaultValues() {
return array();
}
- function templateFile() {
+ /**
+ * @return string
+ */
+ public function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
- function setTitle($title) {
+ /**
+ * @param $title
+ */
+ public function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
}
}
}
}
-