Skip to content
Snippets Groups Projects
Commit 69164898 authored by Nileema's avatar Nileema
Browse files

-- HR-211 Change in Ajax function for organization search on sub types And...

-- HR-211 Change in Ajax function for organization search on sub types And Modification to webtest to add subtype while creating organization contact
parent 6fe438e6
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,8 @@ class CRM_Contact_Page_AJAX {
'fieldName' => 'field_name',
'tableName' => 'table_name',
'context' => 'context',
'rel' => 'rel'
'rel' => 'rel',
'contact_sub_type' => 'contact_sub_type'
);
foreach ($whitelist as $key => $param) {
if (!empty($_GET[$key])) {
......
......@@ -649,6 +649,11 @@ function civicrm_api3_contact_getquick($params) {
}
}
if (CRM_Utils_Array::value('contact_sub_type', $params)) {
$contactSubType = CRM_Utils_Type::escape($params['contact_sub_type'], 'String');
$where .= " AND cc.contact_sub_type = '{$contactSubType}'";
}
//set default for current_employer or return contact with particular id
if (CRM_Utils_Array::value('id', $params)) {
$where .= " AND cc.id = " . (int) $params['id'];
......
......@@ -341,9 +341,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
return $email;
}
function webtestAddOrganization($organizationName = "Organization XYZ", $email = NULL) {
function webtestAddOrganization($organizationName = "Organization XYZ", $email = NULL, $contactSubtype = NULL) {
$this->openCiviPage("contact/add", "reset=1&ct=Organization");
$url = $this->sboxPath . 'civicrm/contact/add?reset=1&ct=Organization';
if ($contactSubtype) {
$url = $url . "&cst={$contactSubtype}";
}
$this->open($url);
$this->click('organization_name');
$this->type('organization_name', $organizationName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment