minor fix
authormonishdeb <monish.deb@webaccessglobal.com>
Fri, 10 Jul 2015 18:35:20 +0000 (00:05 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Mon, 13 Jul 2015 10:11:35 +0000 (15:41 +0530)
CRM/Contact/BAO/Relationship.php

index d5f2f123b1a668eb8aa8759a66c892c811304364..c026062f0f08e945e32f39daf125a245bba783a5 100644 (file)
@@ -971,7 +971,7 @@ WHERE  relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer');
     }
 
     // get the total count of relationships
-    $v['totalCount'] = CRM_Contact_BAO_Relationship::getRelationship($params['contact_id'], NULL, NULL, TRUE);
+    $v['totalCount'] = count($v['data']);
 
     $values['relationship']['data'] = &$v['data'];
     $values['relationship']['totalCount'] = &$v['totalCount'];
@@ -1222,6 +1222,7 @@ LEFT JOIN  civicrm_country ON (civicrm_address.country_id = civicrm_country.id)
           $mask = $mask & $permissionMask;
         }
       }
+
       while ($relationship->fetch()) {
         $rid = $relationship->civicrm_relationship_id;
         $cid = $relationship->civicrm_contact_id;
@@ -1974,8 +1975,7 @@ AND cc.sort_name LIKE '%$name%'";
     if (!empty($relationships)) {
       // get the total relationships
       if ($params['context'] != 'user') {
-        $params['total'] = CRM_Contact_BAO_Relationship::getRelationship($params['contact_id'],
-          $relationshipStatus, 0, 1, 0, NULL, NULL, $permissionedContacts);
+        $params['total'] = count($relationships);
       }
       else {
         // FIX ME: we cannot directly determine total permissioned relationship, hence re-fire query