Case cleanup
authorColeman Watts <coleman@civicrm.org>
Sat, 22 Mar 2014 21:18:46 +0000 (17:18 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 22 Mar 2014 21:18:46 +0000 (17:18 -0400)
CRM/Case/BAO/Case.php
CRM/Case/Form/CaseView.php
templates/CRM/Case/Form/CaseView.tpl

index 1a8f36335f81c3edf2947fb28e3fad91638258c7..089a5ae665ed695781dc6eb3644e3f012b4a7167 100644 (file)
@@ -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'] = '<a href="' . $contactViewUrl . $contact['contact_id'] . '">' . $contact['sort_name'] . '</a>';
+              $globalContacts[$idx]['sort_name'] = '<a href="' . CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$contact['contact_id']}") . '">' . $contact['sort_name'] . '</a>';
             }
           }
         }
index b8124d283087995744458551c09ca1084a8dadfb..0865c54e4eb139708a71a5d0b2de690e354e8ef4 100644 (file)
@@ -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
index 97d653462c7ff07e0b46044abf4ea044e8e64e68..50991b2a4c5a380524e3b43e07f570ce7fe7518f 100644 (file)
  </script>
  {/literal}
   <br />
-
-  {if $globalRelationships}
+  {if !empty($globalGroupInfo.id)}
     <div class="crm-submit-buttons">
       <a class="button case-miniform" href="#addMembersToGroupDialog" rel="#globalRelationships-selector" data-group_id="{$globalGroupInfo.id}">
         <div class="icon add-icon"></div>{ts 1=$globalGroupInfo.title}Add members to %1{/ts}
       </a>
     </div>
+    <div id="addMembersToGroupDialog" class="hiddenElement">
+      <input name="add_member_to_group_contact_id" placeholder="{ts}- select contact -{/ts}" class="huge" />
+    </div>
     <table id="globalRelationships-selector"  class="report-layout">
       <thead><tr>
         <th>{$globalGroupInfo.title}</th>
         <th>{ts}Email{/ts}</th>
       </tr></thead>
     </table>
-    {elseif $globalGroupInfo.id}
-    <div class="messages status no-popup">
-      <div class="icon inform-icon"></div>&nbsp;
-      {ts 1=$globalGroupInfo.title}The group %1 has no members.{/ts}
-    </div>
   {/if}
-  <div id="addMembersToGroupDialog" class="hiddenElement">
-    <input name="add_member_to_group_contact_id" placeholder="{ts}- select contact -{/ts}" class="huge" />
-  </div>
 
  {literal}
  <script type="text/javascript">
       "sAjaxSource": sourceUrl,
       "iDisplayLength": 10,
       "fnDrawCallback": function() { setGlobalRelationshipsSelectorClass(); },
+      "oLanguage": {
+        "sEmptyTable": {/literal}'{ts escape='js' 1=$globalGroupInfo.title}The group %1 has no members.{/ts}'{literal}
+      },
       "fnServerData": function ( sSource, aoData, fnCallback ) {
         cj.ajax( {
           "dataType": 'json',