From 692f930ef5ffeacdeac1f001dafd88f625e57586 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 20 Nov 2015 20:21:32 +0530 Subject: [PATCH] CRM-17599 fix - CiviCase case details table is broken https://issues.civicrm.org/jira/browse/CRM-17599 --- CRM/Case/Page/CaseDetails.php | 25 +++------------------ templates/CRM/Case/Form/ActivityTab.tpl | 21 ++++++++++------- templates/CRM/Case/Page/CaseDetails.tpl | 30 +------------------------ 3 files changed, 17 insertions(+), 59 deletions(-) diff --git a/CRM/Case/Page/CaseDetails.php b/CRM/Case/Page/CaseDetails.php index df9471e764..51bf4a1da8 100644 --- a/CRM/Case/Page/CaseDetails.php +++ b/CRM/Case/Page/CaseDetails.php @@ -42,7 +42,6 @@ class CRM_Case_Page_CaseDetails extends CRM_Core_Page { public function run() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); - $type = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject); $this->assign('action', $this->_action); $this->assign('context', $this->_context); @@ -53,27 +52,9 @@ class CRM_Case_Page_CaseDetails extends CRM_Core_Page { CRM_Case_Page_Tab::setContext(); - $params = array('date_range' => 0); - - $caseDetails = array(); - if (CRM_Case_BAO_Case::accessCiviCase()) { - $caseDetails = CRM_Case_BAO_Case::getCaseActivity($caseId, $params, $this->_contactId, NULL, NULL, $type); - } - - $this->assign('rows', $caseDetails); - $this->assign('caseId', $caseId); - $this->assign('contactId', $this->_contactId); - - // Make it easy to refresh this table - $params = array( - 'caseId' => $caseId, - 'type' => $type, - 'context' => $this->_context, - 'cid' => $this->_contactId, - 'action' => $this->_action, - 'snippet' => 4, - ); - $this->assign('data_params', json_encode($params)); + $this->assign('caseID', $caseId); + $this->assign('contactID', $this->_contactId); + $this->assign('userID', CRM_Core_Session::singleton()->get('userID')); return parent::run(); } diff --git a/templates/CRM/Case/Form/ActivityTab.tpl b/templates/CRM/Case/Form/ActivityTab.tpl index 68c3110537..a0459e7c10 100644 --- a/templates/CRM/Case/Form/ActivityTab.tpl +++ b/templates/CRM/Case/Form/ActivityTab.tpl @@ -25,11 +25,13 @@ *} {*this template is used for activity accordion*} {assign var=caseid value=$caseID} -
-
- {ts}Activities{/ts} -
-
+{if isset($isForm) and $isForm} +
+
+ {ts}Activities{/ts} +
+ +
+{/if} @@ -89,7 +92,7 @@ var caseId = {/literal}{$caseID}{literal}; CRM.$('table#case_id_' + caseId).data({ "ajax": { - "url": {/literal}'{crmURL p="civicrm/ajax/activity" h=0 q="snippet=4&caseID=$caseId&cid=$contactID&userID=$userID"}'{literal}, + "url": {/literal}'{crmURL p="civicrm/ajax/activity" h=0 q="snippet=4&caseID=$caseID&cid=$contactID&userID=$userID"}'{literal}, "data": function (d) { d.status_id = $("select#status_id_" + caseId).val(), d.reporter_id = $("select#reporter_id_" + caseId).val(), @@ -109,5 +112,7 @@ {/literal} - - +{if isset($isForm) and $isForm} + + +{/if} diff --git a/templates/CRM/Case/Page/CaseDetails.tpl b/templates/CRM/Case/Page/CaseDetails.tpl index a04e66f1b3..39c08913ea 100644 --- a/templates/CRM/Case/Page/CaseDetails.tpl +++ b/templates/CRM/Case/Page/CaseDetails.tpl @@ -23,36 +23,8 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{strip} -{if $rows} -
- - - - - - - - - - {counter start=0 skip=1 print=false} - {foreach from=$rows item=row} - - - - - - - - - - {/foreach} -
{ts}Date{/ts}{ts}Subject{/ts}{ts}Type{/ts}{ts}With{/ts}{ts}Reporter / Assignee{/ts}{ts}Status{/ts}
{$row.display_date}{$row.subject}{$row.type}{$row.with_contacts}{$row.reporter}{$row.status}{$row.links}
-{else} - {ts}There are no activities defined for this case.{/ts} -{/if} -{/strip} +{include file="CRM/Case/Form/ActivityTab.tpl"} {include file="CRM/Case/Form/ActivityToCase.tpl"} -- 2.25.1