From 0bf8c94e6ca0d4129510cedfaee95991df33782f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 1 Mar 2014 07:59:53 -0500 Subject: [PATCH] CRM-14288 - Remove unused datatable callback --- CRM/Contact/Page/AJAX.php | 108 ---------------------------------- CRM/Core/xml/Menu/Contact.xml | 5 -- 2 files changed, 113 deletions(-) diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index e4995f7163..f5c68e86c3 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -908,114 +908,6 @@ LIMIT {$offset}, {$rowCount} CRM_Utils_System::civiExit(); } - static function relationshipContacts() { - $searchValues = $searchRows = array(); - $addCount = 0; - - $relType = CRM_Utils_Type::escape($_REQUEST['relType'], 'String'); - $typeName = isset($_REQUEST['typeName']) ? CRM_Utils_Type::escape($_REQUEST['typeName'], 'String') : ''; - $relContact = CRM_Utils_Type::escape($_REQUEST['relContact'], 'String'); - $currentContactId = CRM_Utils_Type::escape($_REQUEST['cid'], 'Integer'); - - if (in_array($typeName, array( - 'Employee of', 'Employer of'))) { - $addCount = 1; - } - - $sortMapper = array( - 1 => 'sort_name', (2 + $addCount) => 'city', (3 + $addCount) => 'state_province', - (4 + $addCount) => 'email', (5 + $addCount) => 'phone', - ); - - $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); - $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0; - $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25; - $sort = isset($_REQUEST['iSortCol_0']) ? $sortMapper[CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer')] : 'sort_name'; - $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc'; - - $searchValues[] = array('sort_name', 'LIKE', $relContact, 0, 1); - - list($rid, $direction) = explode('_', $relType, 2); - - $relationshipType = new CRM_Contact_DAO_RelationshipType(); - - $relationshipType->id = $rid; - if ($relationshipType->find(TRUE)) { - if ($direction == 'a_b') { - $type = $relationshipType->contact_type_b; - $subType = $relationshipType->contact_sub_type_b; - } - else { - $type = $relationshipType->contact_type_a; - $subType = $relationshipType->contact_sub_type_a; - } - - if ($type == 'Individual' || $type == 'Organization' || $type == 'Household') { - $searchValues[] = array('contact_type', '=', $type, 0, 0); - } - - if ($subType) { - $searchValues[] = array('contact_sub_type', '=', $subType, 0, 0); - } - } - - // exclude current contact - $searchValues[] = array('contact_id', '!=', $currentContactId, 0, 0); - - $query = new CRM_Contact_BAO_Query($searchValues); - $searchCount = $query->searchQuery(0, 0, NULL, TRUE); - $iTotal = $searchCount; - - if ($searchCount > 0) { - // get the result of the search - $result = $query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, - FALSE, FALSE, FALSE, NULL, $sortOrder - ); - - $config = CRM_Core_Config::singleton(); - - while ($result->fetch()) { - $query->convertToPseudoNames($result); - $contactID = $result->contact_id; - $typeImage = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? - $result->contact_sub_type : $result->contact_type, - FALSE, $contactID - ); - - $searchRows[$contactID]['id'] = $contactID; - $searchRows[$contactID]['name'] = $typeImage . ' ' . $result->sort_name; - $searchRows[$contactID]['city'] = $result->city; - $searchRows[$contactID]['state'] = $result->state_province; - $searchRows[$contactID]['email'] = $result->email; - $searchRows[$contactID]['phone'] = $result->phone; - } - } - - foreach ($searchRows as $cid => $row) { - $searchRows[$cid]['check'] = ''; - - if ($typeName == 'Employee of') { - $searchRows[$cid]['employee_of'] = ''; - } - elseif ($typeName == 'Employer of') { - $searchRows[$cid]['employer_of'] = ''; - } - } - - $selectorElements = array('check', 'name'); - if ($typeName == 'Employee of') { - $selectorElements[] = 'employee_of'; - } - elseif ($typeName == 'Employer of') { - $selectorElements[] = 'employer_of'; - } - $selectorElements = array_merge($selectorElements, array('city', 'state', 'email', 'phone')); - - $iFilteredTotal = $iTotal; - echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements); - CRM_Utils_System::civiExit(); - } - /** * Function to process dupes. * diff --git a/CRM/Core/xml/Menu/Contact.xml b/CRM/Core/xml/Menu/Contact.xml index a79deb2344..d3c5daa2ec 100644 --- a/CRM/Core/xml/Menu/Contact.xml +++ b/CRM/Core/xml/Menu/Contact.xml @@ -323,11 +323,6 @@ CRM_Contact_Page_AJAX::getSignature access CiviCRM - - civicrm/ajax/relationshipcontacts - CRM_Contact_Page_AJAX::relationshipContacts - access CiviCRM - civicrm/ajax/pdfFormat CRM_Contact_Page_AJAX::pdfFormat -- 2.25.1