From b982dca08fb0db766d2f698a334072a1101ad1f7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 13 Mar 2017 09:57:37 -0400 Subject: [PATCH] Fix double-negative in function signature --- CRM/Case/BAO/Case.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index b240d85e8b..de60d0c338 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1204,18 +1204,19 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @param int $caseID * Case id. - * @param bool $skipDetails + * @param bool $includeDetails * If true include details of contacts. * * @return array * array of return properties * */ - public static function getRelatedContacts($caseID, $skipDetails = FALSE) { + public static function getRelatedContacts($caseID, $includeDetails = TRUE) { $caseRoles = array(); - if (!$skipDetails) { + if ($includeDetails) { $caseInfo = civicrm_api3('Case', 'getsingle', array( 'id' => $caseID, + // Most efficient way of retrieving definition is to also include case type id and name so the api doesn't have to look it up separately 'return' => array('case_type_id', 'case_type_id.name', 'case_type_id.definition'), )); if (!empty($caseInfo['case_type_id.definition']['caseRoles'])) { @@ -1239,7 +1240,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c $dao = CRM_Core_DAO::executeQuery($query, $params); while ($dao->fetch()) { - if ($skipDetails) { + if (!$includeDetails) { $values[$dao->id] = 1; } else { @@ -1251,6 +1252,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c 'role' => $dao->role, 'email' => $dao->email, ); + // Add more info about the role (creator, manager) $role = CRM_Utils_Array::value($details['role'], $caseRoles); if ($role) { unset($role['name']); @@ -1482,7 +1484,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c // TODO: May want to replace this with a call to getRelatedAndGlobalContacts() when this feature is revisited. // (Or for efficiency call the global one outside the loop and then union with this each time.) - $contactDetails = self::getRelatedContacts($caseId, TRUE); + $contactDetails = self::getRelatedContacts($caseId, FALSE); if (!empty($contactDetails[$result['from']['id']])) { $params = array(); -- 2.25.1