From d79c94d57356f7707065f2c2afdbc5b5ca36f160 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 22 Mar 2014 17:18:46 -0400 Subject: [PATCH] Case cleanup --- CRM/Case/BAO/Case.php | 5 ++--- CRM/Case/Form/CaseView.php | 3 +-- templates/CRM/Case/Form/CaseView.tpl | 17 +++++++---------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 1a8f36335f..089a5ae665 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1757,9 +1757,8 @@ SELECT case_status.label AS case_status, status_id, case_type.label AS case_type $groupInfo['id'] = $results['id']; $groupInfo['title'] = $results['title']; $params = array(array('group', 'IN', array($groupInfo['id'] => 1), 0, 0)); - $return = array('sort_name' => 1, 'display_name' => 1, 'email' => 1, 'phone' => 1); $return = array('contact_id' => 1, 'sort_name' => 1, 'display_name' => 1, 'email' => 1, 'phone' => 1); - list($globalContacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, $return, NULL, $sort, $offset, $rowCount, TRUE, $returnOnlyCount); + list($globalContacts) = CRM_Contact_BAO_Query::apiQuery($params, $return, NULL, $sort, $offset, $rowCount, TRUE, $returnOnlyCount); if ($returnOnlyCount) { return $globalContacts; @@ -1767,7 +1766,7 @@ SELECT case_status.label AS case_status, status_id, case_type.label AS case_type if ($showLinks) { foreach ($globalContacts as $idx => $contact) { - $globalContacts[$idx]['sort_name'] = '' . $contact['sort_name'] . ''; + $globalContacts[$idx]['sort_name'] = '' . $contact['sort_name'] . ''; } } } diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index b8124d2830..0865c54e4e 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -401,8 +401,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form { // Now global contact list that appears on all cases. $globalGroupInfo = array(); - $relGlobal = CRM_Case_BAO_Case::getGlobalContacts($globalGroupInfo); - $this->assign('globalRelationships', $relGlobal); + CRM_Case_BAO_Case::getGlobalContacts($globalGroupInfo); $this->assign('globalGroupInfo', $globalGroupInfo); // List of relationship types diff --git a/templates/CRM/Case/Form/CaseView.tpl b/templates/CRM/Case/Form/CaseView.tpl index 97d653462c..50991b2a4c 100644 --- a/templates/CRM/Case/Form/CaseView.tpl +++ b/templates/CRM/Case/Form/CaseView.tpl @@ -336,13 +336,15 @@ {/literal}
- - {if $globalRelationships} + {if !empty($globalGroupInfo.id)}
{ts 1=$globalGroupInfo.title}Add members to %1{/ts}
+
+ +
@@ -350,15 +352,7 @@
{$globalGroupInfo.title}{ts}Email{/ts}
- {elseif $globalGroupInfo.id} -
-
  - {ts 1=$globalGroupInfo.title}The group %1 has no members.{/ts} -
{/if} -
- -
{literal}