<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
/**
- * number of columns in where
+ * Number of columns in where
*
* @var int
- * @access public
*/
public $_columnCount;
/**
- * number of blocks to be shown
+ * Number of blocks to be shown
*
* @var int
- * @access public
*/
public $_blockCount;
/**
- * Function to actually build the form
+ * Build the form object
*
* @return void
- * @access public
*/
public function preProcess() {
$this->set('searchFormName', 'Builder');
/**
* Add local and global form rules
*
- * @access protected
*
* @return void
*/
- function addRules() {
+ public function addRules() {
$this->addFormRule(array('CRM_Contact_Form_Search_Builder', 'formRule'), $this);
}
/**
- * global validation rules for the form
+ * Global validation rules for the form
*
* @param $values
* @param $files
* @param $self
*
- * @internal param array $fields posted values of the form
- *
* @return array list of errors to be posted back to the form
* @static
- * @access public
*/
- static function formRule($values, $files, $self) {
+ public static function formRule($values, $files, $self) {
if (!empty($values['addMore']) || !empty($values['addBlock'])) {
return TRUE;
}
foreach ($grpId as $val) {
$error = CRM_Utils_Type::validate($val, 'Integer', FALSE);
if ($error != $val) {
- $errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter valid value.");
+ $errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter a valid value.");
break;
}
}
* Process the uploaded file
*
* @return void
- * @access public
*/
public function postProcess() {
$this->set('isAdvanced', '2');
/**
* @return array
*/
- static function fields() {
+ public static function fields() {
$fields = array_merge(
CRM_Contact_BAO_Contact::exportableFields('All', FALSE, TRUE),
CRM_Core_Component::getQueryFields(),
* @return array: (string => string) key: field_name value: api entity name
* Note: options are fetched via ajax using the api "getoptions" method
*/
- static function fieldOptions() {
+ public static function fieldOptions() {
// Hack to add options not retrieved by getfields
// This list could go on and on, but it would be better to fix getfields
$options = array(
'member_is_pay_later' => 'yesno',
'is_override' => 'yesno',
);
- $entities = array('contact', 'address', 'activity', 'participant', 'pledge', 'member', 'contribution');
+ $entities = array('contact', 'address', 'activity', 'participant', 'pledge', 'member', 'contribution', 'case', 'grant');
CRM_Contact_BAO_Query_Hook::singleton()->alterSearchBuilderOptions($entities, $options);
foreach ($entities as $entity) {
$fields = civicrm_api3($entity, 'getfields');
* CRM-10338
* tags and groups use array keys for selection list.
* if using IS NULL/NOT NULL, an array with no array key is created
- * convert that to simple null so processing can proceed
+ * convert that to simple NULL so processing can proceed
*/
- static function checkArrayKeyEmpty($val) {
+ public static function checkArrayKeyEmpty($val) {
if (is_array($val)) {
- $v2empty = true;
+ $v2empty = TRUE;
foreach ($val as $vk => $vv) {
if (!empty($vk)) {
$v2empty = false;
}
}
if ($v2empty) {
- $val = null;
+ $val = NULL;
}
}
return $val;
}
}
-