From 994bde4e9cae7b80f48695e058e435ade277b4ab Mon Sep 17 00:00:00 2001 From: Sudha Bisht Date: Thu, 2 Jul 2015 20:09:45 +0530 Subject: [PATCH] Webtest Fix --- CRM/Contact/Form/Search/Advanced.php | 3 +++ CRM/Member/BAO/Query.php | 8 +++++--- CRM/Member/Form/Search.php | 2 +- templates/CRM/Member/Form/Search/Common.tpl | 4 ++-- .../phpunit/WebTest/Contact/AdvanceSearchPaneTest.php | 10 ++++++---- tests/phpunit/WebTest/Contact/SearchBuilderTest.php | 4 ++-- tests/phpunit/WebTest/Contribute/PCPAddTest.php | 2 +- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index f73ebd4a9c..8b8768187a 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -370,6 +370,9 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { 'contribution_status', 'contribution_status_id', 'contribution_source', + 'membership_type_id', + 'membership_status_id', + 'participant_status_id', 'contribution_trxn_id', 'activity_type_id', 'status_id', diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 8c35a1fd6c..097f9da102 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -88,7 +88,7 @@ class CRM_Member_BAO_Query { $query->_whereTables['civicrm_membership_status'] = 1; } - if (!empty($query->_returnProperties['status_id'])) { + if (!empty($query->_returnProperties['membership_status_id'])) { $query->_select['status_id'] = "civicrm_membership_status.id as status_id"; $query->_element['status_id'] = 1; $query->_tables['civicrm_membership_status'] = 1; @@ -203,6 +203,7 @@ class CRM_Member_BAO_Query { case 'membership_status': case 'member_status_id': + case 'membership_status_id': case 'membership_type': case 'membership_type_id': case 'member_id': @@ -390,8 +391,9 @@ class CRM_Member_BAO_Query { * @param CRM_Core_Form $form */ public static function buildSearchForm(&$form) { - $form->addSelect('status_id', - array('entity' => 'membership', 'multiple' => 'multiple', 'label' => ts('Memebership Status(s)'), 'option_url' => NULL, 'placeholder' => ts('- any -')) + $membershipStatus = CRM_Member_PseudoConstant::membershipStatus(); + $form->add('select', 'membership_status_id', ts('Memebership Status(s)'), $membershipStatus, FALSE, + array('id' => 'membership_status_id', 'multiple' => 'multiple', 'class' => 'crm-select2') ); $form->addSelect('membership_type_id', diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php index 6d1bfa9b8d..66c3656608 100644 --- a/CRM/Member/Form/Search.php +++ b/CRM/Member/Form/Search.php @@ -210,7 +210,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { } $specialParams = array( - 'status_id', + 'membership_status_id', 'membership_type_id', ); foreach ($specialParams as $element) { diff --git a/templates/CRM/Member/Form/Search/Common.tpl b/templates/CRM/Member/Form/Search/Common.tpl index 638472ec39..29bf40776b 100644 --- a/templates/CRM/Member/Form/Search/Common.tpl +++ b/templates/CRM/Member/Form/Search/Common.tpl @@ -27,8 +27,8 @@
{$form.membership_type_id.html|crmAddClass:twenty} -
- {$form.status_id.html|crmAddClass:twenty} +
+ {$form.membership_status_id.html} diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php index aa06e308eb..5b4b71bcd6 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php @@ -327,12 +327,14 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { 'title' => 'Memberships', 'fields' => array( 'Membership Type' => array( - 'type' => 'checkbox', - 'values' => array('member_membership_type_id[1]', 'member_membership_type_id[2]'), + 'type' => 'multiselect2', + 'locator' => 'membership_type_id', + 'values' => array(array('General', 'Student')), ), 'Membership Status' => array( - 'type' => 'checkbox', - 'values' => array('member_status_id[1]', 'member_status_id[2]'), + 'type' => 'multiselect2', + 'locator' => 'membership_status_id', + 'values' => array(array('New', 'Current')), ), ), ), diff --git a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php index 6ccb1be70a..a7c080cdc0 100644 --- a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php +++ b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php @@ -528,14 +528,14 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->waitForText('search-status', "2 Results"); $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']"); - $this->multiselect2("status_id", array("New", "Grace")); + $this->multiselect2("membership_status_id", array("New", "Grace")); $this->clickLink('_qf_Search_refresh'); $this->waitForText('search-status', "2 Results"); $this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh"); $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']"); $this->multiselect2("membership_type_id", array($membershipTypes['membership_type'])); - $this->multiselect2("status_id", array("New")); + $this->multiselect2("membership_status_id", array("New")); $this->clickLink('_qf_Search_refresh'); $this->waitForText('search-status', "1 Result"); } diff --git a/tests/phpunit/WebTest/Contribute/PCPAddTest.php b/tests/phpunit/WebTest/Contribute/PCPAddTest.php index 46d1d97023..9b4abc55ea 100755 --- a/tests/phpunit/WebTest/Contribute/PCPAddTest.php +++ b/tests/phpunit/WebTest/Contribute/PCPAddTest.php @@ -176,7 +176,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase { //Find Contribution $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); $this->waitForElementPresent('contribution_pcp_made_through_id'); - $this->select('contribution_pcp_made_through_id', "label={$pcpTitle}"); + $this->select2('pcp_made_through_id', $lastName.', '.$firstName); $this->clickLink("_qf_Search_refresh", "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1][text()='View']"); $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1][text()='View']"); -- 2.25.1