From 59f4c9ee9a6b7fe89759f94ae14cd96050179c30 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 13 Jan 2015 16:26:35 -0800 Subject: [PATCH] INFRA-132 - Batch 0 --- CRM/Activity/BAO/Activity.php | 40 +- CRM/Contact/BAO/Query.php | 292 ++++++------- .../Form/Search/Custom/PostalMailing.php | 2 +- CRM/Core/BAO/LocationType.php | 2 - CRM/Core/BAO/Preferences.php | 1 - .../Form/Checkout/ParticipantsAndPrices.php | 2 +- CRM/Report/Form/Grant/Statistics.php | 2 +- CRM/Utils/SQL/Insert.php | 2 +- api/v3/OptionGroup.php | 3 +- .../WebTest/Contact/AdvanceSearchPaneTest.php | 389 ++++++++---------- 10 files changed, 331 insertions(+), 404 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 30529a7d00..a7ba162374 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -59,7 +59,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { * @param array $params * (reference ) an assoc array of name/value pairs. * - * @return boolean + * @return bool */ public static function dataExists(&$params) { if (!empty($params['source_contact_id']) || !empty($params['id'])) { @@ -249,8 +249,6 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { * * @param int $activityId * @param int $recordTypeID - * - * @return null */ public static function deleteActivityContact($activityId, $recordTypeID = NULL) { $activityContact = new CRM_Activity_BAO_ActivityContact(); @@ -269,7 +267,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { * * @throws CRM_Core_Exception * - * @return $this|null|object + * @return CRM_Activity_BAO_Activity|null|object */ public static function create(&$params) { // check required params @@ -905,7 +903,7 @@ ORDER BY fixed_sort_order * * @return array * Array of component id and name. - **/ + */ public static function activityComponents() { $components = array(); $compInfo = CRM_Core_Component::getEnabledComponents(); @@ -1052,7 +1050,6 @@ LEFT JOIN civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a $includeCaseActivities = TRUE; } - // build main activity table select clause $sourceSelect = ''; @@ -1176,7 +1173,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND * @return array * ( sent, activityId) if any email is sent and activityId */ - static function sendEmail( + public static function sendEmail( &$contactDetails, &$subject, &$text, @@ -1273,7 +1270,6 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND } } - // get token details for contacts, call only if tokens are used $details = array(); if (!empty($returnProperties) || !empty($tokens) || !empty($allTokens)) { @@ -1370,7 +1366,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND * @return array * @throws CRM_Core_Exception */ - static function sendSMS( + public static function sendSMS( &$contactDetails, &$activityParams, &$smsParams = array(), @@ -1508,7 +1504,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND * @return bool|PEAR_Error * true on success or PEAR_Error object */ - static function sendSMSMessage( + public static function sendSMSMessage( $toID, &$tokenText, $smsParams = array(), @@ -1556,7 +1552,6 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); - // add activity target record for every sms that is send $activityTargetParams = array( 'activity_id' => $activityID, @@ -1588,10 +1583,10 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND * @param null $cc * @param null $bcc * - * @return boolean - * true if successfull else false. + * @return bool + * TRUE if successful else FALSE. */ - static function sendMessage( + public static function sendMessage( $from, $fromID, $toID, @@ -1724,7 +1719,6 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); - // First look for activities where contactId is one of the targets $query = " SELECT activity_id, record_type_id @@ -1791,9 +1785,9 @@ WHERE activity.id IN ($activityIds)"; * For Membership Signup or Renewal. * @param int $targetContactID * - * @return bool + * @return bool|NULL */ - static function addActivity( + public static function addActivity( &$activity, $activityType = 'Membership Signup', $targetContactID = NULL @@ -1849,7 +1843,7 @@ SELECT display_name elseif ($activity->__table == 'civicrm_contribution') { //create activity record only for Completed Contributions if ($activity->contribution_status_id != 1) { - return; + return NULL; } $subject = NULL; @@ -2058,11 +2052,11 @@ AND cl.modified_id = c.id * activity id of parent activity. * @param array $params * - * @return $this|null|object + * @return CRM_Activity_BAO_Activity|null|object */ public static function createFollowupActivity($activityId, $params) { if (!$activityId) { - return; + return NULL; } $session = CRM_Core_Session::singleton(); @@ -2165,7 +2159,6 @@ AND cl.modified_id = c.id 'type' => CRM_Utils_Type::T_STRING, ); - $Activityfields = array( 'activity_type' => array('title' => ts('Activity Type'), 'name' => 'activity_type', 'type' => CRM_Utils_Type::T_STRING), 'activity_status' => array('title' => ts('Activity Status'), 'name' => 'activity_status', 'type' => CRM_Utils_Type::T_STRING), @@ -2297,7 +2290,7 @@ AND cl.modified_id = c.id * @param int $action * Edit/view. * - * @return boolean + * @return bool */ public static function checkPermission($activityId, $action) { $allow = FALSE; @@ -2612,7 +2605,8 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n } foreach ($customValues as $key => $value) { - if ($value !== NULL) { // CRM-10542 + if ($value !== NULL) { + // CRM-10542 if (in_array($key, $htmlType)) { $fileValues = CRM_Core_BAO_File::path($value, $params['activityID']); $customParams["custom_{$key}_-1"] = array( diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index c5b9ba0f62..1e7ef740cd 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -409,7 +409,7 @@ class CRM_Contact_BAO_Query { * * @return \CRM_Contact_BAO_Query */ - function __construct( + public function __construct( $params = NULL, $returnProperties = NULL, $fields = NULL, $includeContactIds = FALSE, $strict = FALSE, $mode = 1, $skipPermission = FALSE, $searchDescendentGroups = TRUE, @@ -688,20 +688,20 @@ class CRM_Contact_BAO_Query { $this->_pseudoConstantsSelect[$name]['element'] = $name; if ($tableName == 'email_greeting') { - $this->_pseudoConstantsSelect[$name]['join'] = - " LEFT JOIN civicrm_option_group option_group_email_greeting ON (option_group_email_greeting.name = 'email_greeting')"; + $this->_pseudoConstantsSelect[$name]['join'] + = " LEFT JOIN civicrm_option_group option_group_email_greeting ON (option_group_email_greeting.name = 'email_greeting')"; $this->_pseudoConstantsSelect[$name]['join'] .= " LEFT JOIN civicrm_option_value email_greeting ON (contact_a.email_greeting_id = email_greeting.value AND option_group_email_greeting.id = email_greeting.option_group_id ) "; } elseif ($tableName == 'postal_greeting') { - $this->_pseudoConstantsSelect[$name]['join'] = - " LEFT JOIN civicrm_option_group option_group_postal_greeting ON (option_group_postal_greeting.name = 'postal_greeting')"; + $this->_pseudoConstantsSelect[$name]['join'] + = " LEFT JOIN civicrm_option_group option_group_postal_greeting ON (option_group_postal_greeting.name = 'postal_greeting')"; $this->_pseudoConstantsSelect[$name]['join'] .= " LEFT JOIN civicrm_option_value postal_greeting ON (contact_a.postal_greeting_id = postal_greeting.value AND option_group_postal_greeting.id = postal_greeting.option_group_id ) "; } elseif ($tableName == 'addressee') { - $this->_pseudoConstantsSelect[$name]['join'] = - " LEFT JOIN civicrm_option_group option_group_addressee ON (option_group_addressee.name = 'addressee')"; + $this->_pseudoConstantsSelect[$name]['join'] + = " LEFT JOIN civicrm_option_group option_group_addressee ON (option_group_addressee.name = 'addressee')"; $this->_pseudoConstantsSelect[$name]['join'] .= " LEFT JOIN civicrm_option_value addressee ON (contact_a.addressee_id = addressee.value AND option_group_addressee.id = addressee.option_group_id ) "; } @@ -726,32 +726,29 @@ class CRM_Contact_BAO_Query { $tName = substr($tableName, 8); if (in_array($tName, array('country', 'state_province', 'county'))) { if ($tName == 'state_province') { - $this->_pseudoConstantsSelect['state_province_name'] = - array( - 'pseudoField' => "{$tName}", - 'idCol' => "{$tName}_id", - 'bao' => 'CRM_Core_BAO_Address', - 'table' => "civicrm_{$tName}", - 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ", - ); - - $this->_pseudoConstantsSelect[$tName] = - array( - 'pseudoField' => 'state_province_abbreviation', - 'idCol' => "{$tName}_id", - 'table' => "civicrm_{$tName}", - 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ", - ); + $this->_pseudoConstantsSelect['state_province_name'] = array( + 'pseudoField' => "{$tName}", + 'idCol' => "{$tName}_id", + 'bao' => 'CRM_Core_BAO_Address', + 'table' => "civicrm_{$tName}", + 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ", + ); + + $this->_pseudoConstantsSelect[$tName] = array( + 'pseudoField' => 'state_province_abbreviation', + 'idCol' => "{$tName}_id", + 'table' => "civicrm_{$tName}", + 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ", + ); } else { - $this->_pseudoConstantsSelect[$name] = - array( - 'pseudoField' => "{$tName}_id", - 'idCol' => "{$tName}_id", - 'bao' => 'CRM_Core_BAO_Address', - 'table' => "civicrm_{$tName}", - 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ", - ); + $this->_pseudoConstantsSelect[$name] = array( + 'pseudoField' => "{$tName}_id", + 'idCol' => "{$tName}_id", + 'bao' => 'CRM_Core_BAO_Address', + 'table' => "civicrm_{$tName}", + 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ", + ); } $this->_select["{$tName}_id"] = "civicrm_address.{$tName}_id as {$tName}_id"; @@ -1009,7 +1006,6 @@ class CRM_Contact_BAO_Query { // this is either phone, email or IM list($elementName, $elementType) = explode('-', $elementName); - if (($elementName != 'phone') && ($elementName != 'im')) { $cond = self::getPrimaryCondition($elementType); } @@ -1105,13 +1101,18 @@ class CRM_Contact_BAO_Query { ); if (substr_count($a, 'state_province_name') > 0) { - $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] = - array('pseudoField' => "{$pf}_id", 'idCol' => "{$tName}_id", 'bao' => 'CRM_Core_BAO_Address'); + $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] = array( + 'pseudoField' => "{$pf}_id", + 'idCol' => "{$tName}_id", + 'bao' => 'CRM_Core_BAO_Address', + ); $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['select'] = "`$tName`.name as `{$name}-{$elementFullName}`"; } else { - $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] = - array('pseudoField' => 'state_province_abbreviation', 'idCol' => "{$tName}_id"); + $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] = array( + 'pseudoField' => 'state_province_abbreviation', + 'idCol' => "{$tName}_id", + ); $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['select'] = "`$tName`.abbreviation as `{$name}-{$elementFullName}`"; } } @@ -1178,8 +1179,8 @@ class CRM_Contact_BAO_Query { case 'civicrm_state_province': $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['table'] = $tName; - $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] = - "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.state_province_id"; + $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] + = "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.state_province_id"; if ($addWhere) { $this->_whereTables["{$name}-address"] = $addressJoin; } @@ -1187,8 +1188,8 @@ class CRM_Contact_BAO_Query { case 'civicrm_country': $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['table'] = $newName; - $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] = - "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.country_id"; + $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] + = "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.country_id"; if ($addWhere) { $this->_whereTables["{$name}-address"] = $addressJoin; } @@ -1196,8 +1197,8 @@ class CRM_Contact_BAO_Query { case 'civicrm_county': $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['table'] = $newName; - $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] = - "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.county_id"; + $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] + = "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.county_id"; if ($addWhere) { $this->_whereTables["{$name}-address"] = $addressJoin; } @@ -1437,7 +1438,7 @@ class CRM_Contact_BAO_Query { * * @return array */ - static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) { + public static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) { $params = array(); if (empty($formValues)) { return $params; @@ -1507,7 +1508,7 @@ class CRM_Contact_BAO_Query { * * @return array|null */ - static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) { + public static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) { // skip a few search variables static $skipWhere = NULL; static $likeNames = NULL; @@ -2986,7 +2987,6 @@ WHERE id IN ( $groupIDs ) $op = "LIKE"; $value = "%{$value}%"; - $useAllTagTypes = $this->getWhereValues('all_tag_types', $grouping); $tagTypesText = $this->getWhereValues('tag_types_text', $grouping); @@ -2994,37 +2994,34 @@ WHERE id IN ( $groupIDs ) $tTable = "`civicrm_tag-" . $value . "`"; if ($useAllTagTypes[2]) { - $this->_tables[$etTable] = - $this->_whereTables[$etTable] = - " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id) - LEFT JOIN civicrm_tag {$tTable} ON ( {$etTable}.tag_id = {$tTable}.id )"; + $this->_tables[$etTable] = $this->_whereTables[$etTable] + = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id) + LEFT JOIN civicrm_tag {$tTable} ON ( {$etTable}.tag_id = {$tTable}.id )"; // search tag in cases $etCaseTable = "`civicrm_entity_case_tag-" . $value . "`"; $tCaseTable = "`civicrm_case_tag-" . $value . "`"; - $this->_tables[$etCaseTable] = - $this->_whereTables[$etCaseTable] = - " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id - LEFT JOIN civicrm_case + $this->_tables[$etCaseTable] = $this->_whereTables[$etCaseTable] + = " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id + LEFT JOIN civicrm_case ON (civicrm_case_contact.case_id = civicrm_case.id AND civicrm_case.is_deleted = 0 ) - LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id ) - LEFT JOIN civicrm_tag {$tCaseTable} ON ( {$etCaseTable}.tag_id = {$tCaseTable}.id )"; + LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id ) + LEFT JOIN civicrm_tag {$tCaseTable} ON ( {$etCaseTable}.tag_id = {$tCaseTable}.id )"; // search tag in activities $etActTable = "`civicrm_entity_act_tag-" . $value . "`"; $tActTable = "`civicrm_act_tag-" . $value . "`"; $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); - $this->_tables[$etActTable] = - $this->_whereTables[$etActTable] = - " LEFT JOIN civicrm_activity_contact + $this->_tables[$etActTable] = $this->_whereTables[$etActTable] + = " LEFT JOIN civicrm_activity_contact ON ( civicrm_activity_contact.contact_id = contact_a.id AND civicrm_activity_contact.record_type_id = {$targetID} ) - LEFT JOIN civicrm_activity + LEFT JOIN civicrm_activity ON ( civicrm_activity.id = civicrm_activity_contact.activity_id AND civicrm_activity.is_deleted = 0 AND civicrm_activity.is_current_revision = 1 ) - LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id ) - LEFT JOIN civicrm_tag {$tActTable} ON ( {$etActTable}.tag_id = {$tActTable}.id )"; + LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id ) + LEFT JOIN civicrm_tag {$tActTable} ON ( {$etActTable}.tag_id = {$tActTable}.id )"; $this->_where[$grouping][] = "({$tTable}.name $op '" . $value . "' OR {$tCaseTable}.name $op '" . $value . "' OR {$tActTable}.name $op '" . $value . "')"; $this->_qill[$grouping][] = ts('Tag %1 %2', array(1 => $tagTypesText[2], 2 => $op)) . ' ' . $value; @@ -3066,39 +3063,35 @@ WHERE id IN ( $groupIDs ) $names = CRM_Utils_Array::value($value, $tagNames); } - $useAllTagTypes = $this->getWhereValues('all_tag_types', $grouping); $tagTypesText = $this->getWhereValues('tag_types_text', $grouping); $etTable = "`civicrm_entity_tag-" . $value . "`"; if ($useAllTagTypes[2]) { - $this->_tables[$etTable] = - $this->_whereTables[$etTable] = - " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id AND {$etTable}.entity_table = 'civicrm_contact') "; + $this->_tables[$etTable] = $this->_whereTables[$etTable] + = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id AND {$etTable}.entity_table = 'civicrm_contact') "; // search tag in cases $etCaseTable = "`civicrm_entity_case_tag-" . $value . "`"; $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); - $this->_tables[$etCaseTable] = - $this->_whereTables[$etCaseTable] = - " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id - LEFT JOIN civicrm_case + $this->_tables[$etCaseTable] = $this->_whereTables[$etCaseTable] + = " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id + LEFT JOIN civicrm_case ON (civicrm_case_contact.case_id = civicrm_case.id AND civicrm_case.is_deleted = 0 ) - LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id ) "; + LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id ) "; // search tag in activities $etActTable = "`civicrm_entity_act_tag-" . $value . "`"; - $this->_tables[$etActTable] = - $this->_whereTables[$etActTable] = - " LEFT JOIN civicrm_activity_contact + $this->_tables[$etActTable] = $this->_whereTables[$etActTable] + = " LEFT JOIN civicrm_activity_contact ON ( civicrm_activity_contact.contact_id = contact_a.id AND civicrm_activity_contact.record_type_id = {$targetID} ) - LEFT JOIN civicrm_activity + LEFT JOIN civicrm_activity ON ( civicrm_activity.id = civicrm_activity_contact.activity_id AND civicrm_activity.is_deleted = 0 AND civicrm_activity.is_current_revision = 1 ) - LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id ) "; + LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id ) "; // CRM-10338 if (in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) { @@ -3110,9 +3103,8 @@ WHERE id IN ( $groupIDs ) $this->_qill[$grouping][] = ts('Tag %1 %2', array(1 => $op, 2 => $tagTypesText[2])) . ' ' . $names; } else { - $this->_tables[$etTable] = - $this->_whereTables[$etTable] = - " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id AND {$etTable}.entity_table = 'civicrm_contact') "; + $this->_tables[$etTable] = $this->_whereTables[$etTable] + = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id AND {$etTable}.entity_table = 'civicrm_contact') "; // CRM-10338 if (in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) { @@ -3144,9 +3136,8 @@ WHERE id IN ( $groupIDs ) $this->_useDistinct = TRUE; - $this->_tables['civicrm_note'] = - $this->_whereTables['civicrm_note'] = - " LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id ) "; + $this->_tables['civicrm_note'] = $this->_whereTables['civicrm_note'] + = " LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id ) "; $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; $n = trim($value); @@ -3555,7 +3546,7 @@ WHERE id IN ( $groupIDs ) * @param $values * @param bool $fromStateProvince * - * @return array + * @return array|NULL */ public function country(&$values, $fromStateProvince = TRUE) { list($name, $op, $value, $grouping, $wildcard) = $values; @@ -3565,7 +3556,7 @@ WHERE id IN ( $groupIDs ) if (!empty($stateValues)) { // return back to caller if there are state province values // since that handles this case - return; + return NULL; } } @@ -3841,7 +3832,6 @@ WHERE id IN ( $groupIDs ) } } - $this->dateQueryBuilder($values, 'contact_a', 'log_date', $fieldName, $fieldTitle); self::$_openedPanes[ts('Change Log')] = TRUE; @@ -4032,9 +4022,7 @@ WHERE id IN ( $groupIDs ) $relationshipTempTable = NULL; if (self::$_relType == 'reciprocal' && empty($targetGroup)) { $where = array(); - self::$_relationshipTempTable = - $relationshipTempTable = - CRM_Core_DAO::createTempTableName('civicrm_rel'); + self::$_relationshipTempTable = $relationshipTempTable = CRM_Core_DAO::createTempTableName('civicrm_rel'); if ($nameClause) { $where[$grouping][] = " sort_name $nameClause "; } @@ -4046,7 +4034,6 @@ WHERE id IN ( $groupIDs ) } } - $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual'); $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization'); $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household'); @@ -4063,15 +4050,12 @@ WHERE id IN ( $groupIDs ) } } - //check to see if the target contact is in specified group if ($targetGroup) { //add contacts from static groups - $this->_tables['civicrm_relationship_group_contact'] = - $this->_whereTables['civicrm_relationship_group_contact'] = - " LEFT JOIN civicrm_group_contact civicrm_relationship_group_contact ON civicrm_relationship_group_contact.contact_id = contact_b.id AND civicrm_relationship_group_contact.status = 'Added'"; - $groupWhere[] = - "( civicrm_relationship_group_contact.group_id IN (" . + $this->_tables['civicrm_relationship_group_contact'] = $this->_whereTables['civicrm_relationship_group_contact'] + = " LEFT JOIN civicrm_group_contact civicrm_relationship_group_contact ON civicrm_relationship_group_contact.contact_id = contact_b.id AND civicrm_relationship_group_contact.status = 'Added'"; + $groupWhere[] = "( civicrm_relationship_group_contact.group_id IN (" . implode(",", $targetGroup[2]) . ") ) "; //add contacts from saved searches @@ -4342,7 +4326,7 @@ civicrm_relationship.is_permission_a_b = 0 * * @return array */ - static function apiQuery( + public static function apiQuery( $params = NULL, $returnProperties = NULL, $fields = NULL, @@ -4448,7 +4432,7 @@ civicrm_relationship.is_permission_a_b = 0 * * @return CRM_Core_DAO */ - function searchQuery( + public function searchQuery( $offset = 0, $rowCount = 0, $sort = NULL, $count = FALSE, $includeContactIds = FALSE, $sortByChar = FALSE, $groupContacts = FALSE, @@ -4661,8 +4645,6 @@ civicrm_relationship.is_permission_a_b = 0 * Only get deleted contacts. * @param bool $count * Return Count only. - * - * @return null */ public function generatePermissionClause($onlyDeleted = FALSE, $count = FALSE) { if (!$this->_skipPermission) { @@ -4734,7 +4716,6 @@ SELECT COUNT( conts.total_amount ) as total_count, // make sure contribution is completed - CRM-4989 $completedWhere = $where . " AND civicrm_contribution.contribution_status_id = 1 "; - $summary = array(); $summary['total'] = array(); $summary['total']['count'] = $summary['total']['amount'] = $summary['total']['avg'] = "n/a"; @@ -4887,50 +4868,49 @@ SELECT COUNT( conts.total_amount ) as cancel_count, 'do_not_mail' => 1, 'do_not_sms' => 1, 'do_not_trade' => 1, - 'location' => - array( - '1' => array( - 'location_type' => 1, - 'street_address' => 1, - 'city' => 1, - 'state_province' => 1, - 'postal_code' => 1, - 'postal_code_suffix' => 1, - 'country' => 1, - 'phone-Phone' => 1, - 'phone-Mobile' => 1, - 'phone-Fax' => 1, - 'phone-1' => 1, - 'phone-2' => 1, - 'phone-3' => 1, - 'im-1' => 1, - 'im-2' => 1, - 'im-3' => 1, - 'email-1' => 1, - 'email-2' => 1, - 'email-3' => 1, - ), - '2' => array( - 'location_type' => 1, - 'street_address' => 1, - 'city' => 1, - 'state_province' => 1, - 'postal_code' => 1, - 'postal_code_suffix' => 1, - 'country' => 1, - 'phone-Phone' => 1, - 'phone-Mobile' => 1, - 'phone-1' => 1, - 'phone-2' => 1, - 'phone-3' => 1, - 'im-1' => 1, - 'im-2' => 1, - 'im-3' => 1, - 'email-1' => 1, - 'email-2' => 1, - 'email-3' => 1, - ), + 'location' => array( + '1' => array( + 'location_type' => 1, + 'street_address' => 1, + 'city' => 1, + 'state_province' => 1, + 'postal_code' => 1, + 'postal_code_suffix' => 1, + 'country' => 1, + 'phone-Phone' => 1, + 'phone-Mobile' => 1, + 'phone-Fax' => 1, + 'phone-1' => 1, + 'phone-2' => 1, + 'phone-3' => 1, + 'im-1' => 1, + 'im-2' => 1, + 'im-3' => 1, + 'email-1' => 1, + 'email-2' => 1, + 'email-3' => 1, ), + '2' => array( + 'location_type' => 1, + 'street_address' => 1, + 'city' => 1, + 'state_province' => 1, + 'postal_code' => 1, + 'postal_code_suffix' => 1, + 'country' => 1, + 'phone-Phone' => 1, + 'phone-Mobile' => 1, + 'phone-1' => 1, + 'phone-2' => 1, + 'phone-3' => 1, + 'im-1' => 1, + 'im-2' => 1, + 'im-3' => 1, + 'email-1' => 1, + 'email-2' => 1, + 'email-3' => 1, + ), + ), ); } return self::$_defaultHierReturnProperties; @@ -4944,7 +4924,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * @param $fieldTitle * @param bool $appendTimeStamp */ - function dateQueryBuilder( + public function dateQueryBuilder( &$values, $tableName, $fieldName, $dbFieldName, $fieldTitle, $appendTimeStamp = TRUE @@ -5057,7 +5037,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * @param $fieldTitle * @param null $options */ - function numberRangeBuilder( + public function numberRangeBuilder( &$values, $tableName, $fieldName, $dbFieldName, $fieldTitle, @@ -5106,8 +5086,8 @@ SELECT COUNT( conts.total_amount ) as cancel_count, $displayValue = $options ? $options[$value] : $value; $secondDisplayValue = $options ? $options[$secondValue] : $secondValue; - $this->_qill[$grouping][] = - "$fieldTitle - $firstPhrase \"$displayValue\" " . ts('AND') . " $secondPhrase \"$secondDisplayValue\""; + $this->_qill[$grouping][] + = "$fieldTitle - $firstPhrase \"$displayValue\" " . ts('AND') . " $secondPhrase \"$secondDisplayValue\""; } else { $this->_where[$grouping][] = "{$tableName}.{$dbFieldName} $firstOP {$value}"; @@ -5129,8 +5109,6 @@ SELECT COUNT( conts.total_amount ) as cancel_count, $displayValue = $options ? $options[$value] : $value; $this->_qill[$grouping][] = "$fieldTitle - $phrase \"$displayValue\""; } - - return; } /** @@ -5148,7 +5126,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * Data type of the field. * * @return string - * where clause for the query + * Where clause for the query. */ public static function buildClause($field, $op, $value = NULL, $dataType = NULL) { $op = trim($op); @@ -5387,7 +5365,7 @@ AND displayRelType.is_active = 1 * @return void * adds the where clause and qill to the query object */ - function optionValueQuery( + public function optionValueQuery( $name, $op, $value, @@ -5508,14 +5486,14 @@ AND displayRelType.is_active = 1 /** * Convert the pseudo constants id's to their names * - * @param CRM_Core_DAO dao + * @param CRM_Core_DAO $dao * @param bool $return * - * @return array + * @return array|NULL */ public function convertToPseudoNames(&$dao, $return = FALSE) { if (empty($this->_pseudoConstantsSelect)) { - return; + return NULL; } $values = array(); foreach ($this->_pseudoConstantsSelect as $key => $value) { @@ -5586,11 +5564,11 @@ AND displayRelType.is_active = 1 * Include pseudo fields LEFT JOIN * @param string|array $sort can be a object or string * - * @return array + * @return array|NULL */ public function includePseudoFieldsJoin($sort) { if (!$sort || empty($this->_pseudoConstantsSelect)) { - return; + return NULL; } $sort = is_string($sort) ? $sort : $sort->orderBy(); $present = array(); @@ -5633,7 +5611,7 @@ AND displayRelType.is_active = 1 return array($presentClause, $presentSimpleFromClause); } - static function buildQillForFieldValue($daoName, $fieldName, $fieldValue, $op, $pseduoExtraParam = array()) { + public static function buildQillForFieldValue($daoName, $fieldName, $fieldValue, $op, $pseduoExtraParam = array()) { $pseduoOptions = CRM_Core_PseudoConstant::get($daoName, $fieldName, $pseduoExtraParam = array()); $qillOperators = CRM_Core_SelectValues::getSearchBuilderOperators(); if ($fieldName == 'activity_type_id') { @@ -5656,7 +5634,7 @@ AND displayRelType.is_active = 1 $op = key($fieldValue); $fieldValue = $fieldValue[$op]; } - foreach ((array)$fieldValue as $val) { + foreach ((array) $fieldValue as $val) { $qillString[] = $pseduoOptions[$val]; } $fieldValue = implode(', ', $qillString); diff --git a/CRM/Contact/Form/Search/Custom/PostalMailing.php b/CRM/Contact/Form/Search/Custom/PostalMailing.php index 58d0366041..eaad6b2989 100644 --- a/CRM/Contact/Form/Search/Custom/PostalMailing.php +++ b/CRM/Contact/Form/Search/Custom/PostalMailing.php @@ -75,7 +75,7 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear * * @return string */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { diff --git a/CRM/Core/BAO/LocationType.php b/CRM/Core/BAO/LocationType.php index 87848be35c..7dc1fe5d9c 100644 --- a/CRM/Core/BAO/LocationType.php +++ b/CRM/Core/BAO/LocationType.php @@ -87,8 +87,6 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { /** * Retrieve the default location_type * - * @param NULL - * * @return object * The default location type object on success, * null otherwise diff --git a/CRM/Core/BAO/Preferences.php b/CRM/Core/BAO/Preferences.php index 1b1900af95..c2bb7e1fab 100644 --- a/CRM/Core/BAO/Preferences.php +++ b/CRM/Core/BAO/Preferences.php @@ -130,7 +130,6 @@ AND v.option_group_id = g.id AND v.is_active = 1 "; - $dao = CRM_Core_DAO::executeQuery($sql); while ($dao->fetch()) { if (!$dao->value) { diff --git a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php index 608c1e2399..74fe540a9d 100644 --- a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php +++ b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php @@ -146,7 +146,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ $this->_errors[$form->html_field_name('email')] = ts("The participant %1 is already registered for %2 (%3).", array( 1 => $participant_fields['email'], 2 => $event_in_cart->event->title, - 3 => $event_in_cart->event->start_date + 3 => $event_in_cart->event->start_date, )); } } diff --git a/CRM/Report/Form/Grant/Statistics.php b/CRM/Report/Form/Grant/Statistics.php index 738e4101ac..a2e1990143 100644 --- a/CRM/Report/Form/Grant/Statistics.php +++ b/CRM/Report/Form/Grant/Statistics.php @@ -530,7 +530,7 @@ SELECT COUNT({$this->_aliases['civicrm_grant']}.id) as count , * @param $awardedGrantsAmount * @param bool $customData */ - static function getStatistics( + public static function getStatistics( &$grantStatistics, $fieldValue, $values, $awardedGrants, $awardedGrantsAmount, $customData = FALSE ) { diff --git a/CRM/Utils/SQL/Insert.php b/CRM/Utils/SQL/Insert.php index afa8560aea..9ec754374a 100644 --- a/CRM/Utils/SQL/Insert.php +++ b/CRM/Utils/SQL/Insert.php @@ -53,7 +53,7 @@ class CRM_Utils_SQL_Insert { /** * Create a new SELECT query * - * @param string $from + * @param string $table * Table-name and optional alias. */ public function __construct($table) { diff --git a/api/v3/OptionGroup.php b/api/v3/OptionGroup.php index 1fc5136caa..81d001b351 100644 --- a/api/v3/OptionGroup.php +++ b/api/v3/OptionGroup.php @@ -51,8 +51,7 @@ function _civicrm_api3_option_group_create_spec(&$params) { * * @return array * API Result Array - * message otherwise - * {@getfields OptionGroup_delete} + * {@getfields OptionGroup_delete} */ function civicrm_api3_option_group_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php index 35883bb5c0..6d870b7414 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php @@ -35,8 +35,8 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { parent::setUp(); } - /* - * test individual pane seperatly. + /** + * Test individual pane seperatly. */ public function testIndividualPanes() { $this->webtestLogin(); @@ -61,8 +61,8 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { } } - /* - * test by selecting all panes at a time. + /** + * Test by selecting all panes at a time. */ public function testAllPanes() { $this->webtestLogin(); @@ -89,7 +89,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { /** * @param array $openedPanes */ - function _checkOpenedPanes($openedPanes = array()) { + public function _checkOpenedPanes($openedPanes = array()) { if (!$this->isTextPresent('None found.')) { $this->click('css=div.crm-advanced_search_form-accordion div.crm-accordion-header'); } @@ -111,7 +111,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { * @param $paneRef * @param array $selectFields */ - function _selectPaneFields($paneRef, $selectFields = array()) { + public function _selectPaneFields($paneRef, $selectFields = array()) { $pane = $this->_advanceSearchPanes($paneRef); $this->click("css=div.crm-accordion-wrapper {$pane['headerLocator']}"); @@ -173,227 +173,186 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { if (!isset($_advance_search_panes) || empty($_advance_search_panes)) { $_advance_search_panes = array( - 'location' => - array( - 'headerLocator' => 'div#location', - 'bodyLocator' => 'select#country', - 'title' => 'Address Fields', - 'fields' => - array( - 'Location Type' => - array( - 'type' => 'multiselect2', - 'locator' => 'location_type', - 'values' => array(array('Home', 'Work')), - ), - 'Country' => - array( - 'type' => 'select', - 'locator' => 'country', - 'values' => array('United States'), - ), - 'State' => - array( - 'type' => 'multiselect2', - 'locator' => 'state_province', - 'values' => array(array('Alabama', 'California', 'New Jersey', 'New York')), - ), + 'location' => array( + 'headerLocator' => 'div#location', + 'bodyLocator' => 'select#country', + 'title' => 'Address Fields', + 'fields' => array( + 'Location Type' => array( + 'type' => 'multiselect2', + 'locator' => 'location_type', + 'values' => array(array('Home', 'Work')), + ), + 'Country' => array( + 'type' => 'select', + 'locator' => 'country', + 'values' => array('United States'), + ), + 'State' => array( + 'type' => 'multiselect2', + 'locator' => 'state_province', + 'values' => array( + array('Alabama', 'California', 'New Jersey', 'New York'), ), + ), ), - 'custom' => - array( - 'headerLocator' => 'div#custom', - 'bodyLocator' => 'div#constituent_information', - 'title' => 'Custom Data', - 'fields' => - array( - 'Marital Status' => - array( - 'type' => 'select', - 'locator' => 'custom_2', - 'values' => array('Single'), - ), - ), + ), + 'custom' => array( + 'headerLocator' => 'div#custom', + 'bodyLocator' => 'div#constituent_information', + 'title' => 'Custom Data', + 'fields' => array( + 'Marital Status' => array( + 'type' => 'select', + 'locator' => 'custom_2', + 'values' => array('Single'), + ), ), - 'activity' => - array( - 'headerLocator' => 'div#activity', - 'bodyLocator' => 'input#activity_subject', - 'title' => 'Activities', - 'fields' => - array( - 'Activity Type' => - array( - 'type' => 'checkbox', - 'values' => array( - 'activity_type_id[6]', - 'activity_type_id[3]', - 'activity_type_id[5]', - 'activity_type_id[7]' - ), - ), - 'Activity Subject' => - array( - 'type' => 'text', - 'locator' => 'activity_subject', - 'values' => array('Test Subject'), - ), - 'Activity Status' => - array( - 'type' => 'checkbox', - 'values' => array('activity_status[1]', 'activity_status[2]'), - ), + ), + 'activity' => array( + 'headerLocator' => 'div#activity', + 'bodyLocator' => 'input#activity_subject', + 'title' => 'Activities', + 'fields' => array( + 'Activity Type' => array( + 'type' => 'checkbox', + 'values' => array( + 'activity_type_id[6]', + 'activity_type_id[3]', + 'activity_type_id[5]', + 'activity_type_id[7]', ), + ), + 'Activity Subject' => array( + 'type' => 'text', + 'locator' => 'activity_subject', + 'values' => array('Test Subject'), + ), + 'Activity Status' => array( + 'type' => 'checkbox', + 'values' => array('activity_status[1]', 'activity_status[2]'), + ), ), - 'relationship' => - array( - 'headerLocator' => 'div#relationship', - 'bodyLocator' => 'select#relation_type_id', - 'title' => 'Relationships', - 'fields' => - array( - 'Relation Type' => - array( - 'type' => 'select', - 'locator' => 'relation_type_id', - 'values' => array('Employee of'), - ), - 'Relation Target' => - array( - 'type' => 'text', - 'locator' => 'relation_target_name', - 'values' => array('Test Contact'), - ), - ), + ), + 'relationship' => array( + 'headerLocator' => 'div#relationship', + 'bodyLocator' => 'select#relation_type_id', + 'title' => 'Relationships', + 'fields' => array( + 'Relation Type' => array( + 'type' => 'select', + 'locator' => 'relation_type_id', + 'values' => array('Employee of'), + ), + 'Relation Target' => array( + 'type' => 'text', + 'locator' => 'relation_target_name', + 'values' => array('Test Contact'), + ), ), - 'demographics' => - array( - 'headerLocator' => 'div#demographics', - 'bodyLocator' => 'input#birth_date_low_display', - 'title' => 'Demographics', - 'fields' => - array( - 'Birth Date Range' => - array( - 'type' => 'select', - 'locator' => 'birth_date_relative', - 'values' => array('Choose Date Range'), - ), - 'Birth Date from' => - array( - 'type' => 'date', - 'locator' => 'birth_date_low', - 'values' => array('10 September 1980'), - ), - 'Birth Date to' => - array( - 'type' => 'date', - 'locator' => 'birth_date_high', - 'values' => array('10 September 2000'), - ), - ), + ), + 'demographics' => array( + 'headerLocator' => 'div#demographics', + 'bodyLocator' => 'input#birth_date_low_display', + 'title' => 'Demographics', + 'fields' => array( + 'Birth Date Range' => array( + 'type' => 'select', + 'locator' => 'birth_date_relative', + 'values' => array('Choose Date Range'), + ), + 'Birth Date from' => array( + 'type' => 'date', + 'locator' => 'birth_date_low', + 'values' => array('10 September 1980'), + ), + 'Birth Date to' => array( + 'type' => 'date', + 'locator' => 'birth_date_high', + 'values' => array('10 September 2000'), + ), ), - 'note' => - array( - 'headerLocator' => 'div#notes', - 'bodyLocator' => 'input#note', - 'title' => 'Notes', - 'fields' => - array( - 'note' => - array( - 'type' => 'text', - 'locator' => 'css=div#notes-search input#note', - 'values' => array('Test Note'), - ), - ), + ), + 'note' => array( + 'headerLocator' => 'div#notes', + 'bodyLocator' => 'input#note', + 'title' => 'Notes', + 'fields' => array( + 'note' => array( + 'type' => 'text', + 'locator' => 'css=div#notes-search input#note', + 'values' => array('Test Note'), + ), ), - 'change_log' => - array( - 'headerLocator' => 'div#changeLog', - 'bodyLocator' => 'input#changed_by', - 'title' => 'Change Log', - 'fields' => - array( - 'Modified By' => - array( - 'type' => 'text', - 'locator' => 'changed_by', - 'values' => array('Test User'), - ), - ), + ), + 'change_log' => array( + 'headerLocator' => 'div#changeLog', + 'bodyLocator' => 'input#changed_by', + 'title' => 'Change Log', + 'fields' => array( + 'Modified By' => array( + 'type' => 'text', + 'locator' => 'changed_by', + 'values' => array('Test User'), + ), ), - 'contribution' => - array( - 'headerLocator' => 'div#CiviContribute', - 'bodyLocator' => 'select#financial_type_id', - 'title' => 'Contributions', - 'fields' => - array( - 'Amount from' => - array( - 'type' => 'text', - 'locator' => 'contribution_amount_low', - 'values' => array('10'), - ), - 'Amount to' => - array( - 'type' => 'text', - 'locator' => 'contribution_amount_high', - 'values' => array('1000'), - ), - 'Financial Type' => - - array( - 'type' => 'select', - 'locator' => 'financial_type_id', - 'values' => array('Donation'), - ), - 'Contribution Status' => - array( - 'type' => 'checkbox', - 'values' => array('contribution_status_id[1]', 'contribution_status_id[2]'), - ), - ), + ), + 'contribution' => array( + 'headerLocator' => 'div#CiviContribute', + 'bodyLocator' => 'select#financial_type_id', + 'title' => 'Contributions', + 'fields' => array( + 'Amount from' => array( + 'type' => 'text', + 'locator' => 'contribution_amount_low', + 'values' => array('10'), + ), + 'Amount to' => array( + 'type' => 'text', + 'locator' => 'contribution_amount_high', + 'values' => array('1000'), + ), + 'Financial Type' => array( + 'type' => 'select', + 'locator' => 'financial_type_id', + 'values' => array('Donation'), + ), + 'Contribution Status' => array( + 'type' => 'checkbox', + 'values' => array('contribution_status_id[1]', 'contribution_status_id[2]'), + ), ), - 'membership' => - array( - 'headerLocator' => 'div#CiviMember', - 'bodyLocator' => 'input#member_source', - 'title' => 'Memberships', - 'fields' => - array( - 'Membership Type' => - array( - 'type' => 'checkbox', - 'values' => array('member_membership_type_id[1]', 'member_membership_type_id[2]'), - ), - 'Membership Status' => - array( - 'type' => 'checkbox', - 'values' => array('member_status_id[1]', 'member_status_id[2]'), - ), - ), + ), + 'membership' => array( + 'headerLocator' => 'div#CiviMember', + 'bodyLocator' => 'input#member_source', + 'title' => 'Memberships', + 'fields' => array( + 'Membership Type' => array( + 'type' => 'checkbox', + 'values' => array('member_membership_type_id[1]', 'member_membership_type_id[2]'), + ), + 'Membership Status' => array( + 'type' => 'checkbox', + 'values' => array('member_status_id[1]', 'member_status_id[2]'), + ), ), - 'event' => - array( - 'headerLocator' => 'div#CiviEvent', - 'bodyLocator' => 'input#event_id', - 'title' => 'Events', - 'fields' => - array( - 'Participant Status' => - array( - 'type' => 'checkbox', - 'values' => array('participant_status_id[1]', 'participant_status_id[2]'), - ), - 'Participant Role' => - array( - 'type' => 'checkbox', - 'values' => array('participant_role_id[1]', 'participant_role_id[2]'), - ), - ), + ), + 'event' => array( + 'headerLocator' => 'div#CiviEvent', + 'bodyLocator' => 'input#event_id', + 'title' => 'Events', + 'fields' => array( + 'Participant Status' => array( + 'type' => 'checkbox', + 'values' => array('participant_status_id[1]', 'participant_status_id[2]'), + ), + 'Participant Role' => array( + 'type' => 'checkbox', + 'values' => array('participant_role_id[1]', 'participant_role_id[2]'), + ), ), + ), ); } -- 2.25.1