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);
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();
}
*}
{*this template is used for activity accordion*}
{assign var=caseid value=$caseID}
-<div class="crm-accordion-wrapper crm-case_activities-accordion crm-case-activities-block">
- <div class="crm-accordion-header">
- {ts}Activities{/ts}
- </div>
- <div id="activities" class="crm-accordion-body">
+{if isset($isForm) and $isForm}
+ <div class="crm-accordion-wrapper crm-case_activities-accordion crm-case-activities-block">
+ <div class="crm-accordion-header">
+ {ts}Activities{/ts}
+ </div>
+
+ <div id="activities" class="crm-accordion-body">
<div class="crm-accordion-wrapper crm-accordion-inner crm-search_filters-accordion collapsed">
<div class="crm-accordion-header">
{ts}Search Filters{/ts}
</table>
</div><!-- /.crm-accordion-body -->
</div><!-- /.crm-accordion-wrapper -->
+{/if}
<table id="case_id_{$caseid}" class="nestedActivitySelector crm-ajax-table" data-order='[[0,"desc"]]' data-page-length="10">
<thead><tr>
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(),
</script>
{/literal}
- </div><!-- /.crm-accordion-body -->
-</div><!-- /.crm-accordion-wrapper -->
+{if isset($isForm) and $isForm}
+ </div><!-- /.crm-accordion-body -->
+ </div><!-- /.crm-accordion-wrapper -->
+{/if}
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-{strip}
-{if $rows}
- <table class="nestedActivitySelector" data-params='{$data_params}'>
- <tr class="columnheader">
- <th>{ts}Date{/ts}</th>
- <th>{ts}Subject{/ts}</th>
- <th>{ts}Type{/ts}</th>
- <th>{ts}With{/ts}</th>
- <th>{ts}Reporter / Assignee{/ts}</th>
- <th>{ts}Status{/ts}</th>
- <th></th>
- </tr>
- {counter start=0 skip=1 print=false}
- {foreach from=$rows item=row}
- <tr class="crm-entity {$row.class}" data-entity="activity" data-id="{$row.id}">
- <td class="crm-case-display_date">{$row.display_date}</td>
- <td class="crm-case-subject">{$row.subject}</td>
- <td class="crm-case-type">{$row.type}</td>
- <td class="crm-case-with_contacts">{$row.with_contacts}</td>
- <td class="crm-case-reporter">{$row.reporter}</td>
- <td class="crm-case-status">{$row.status}</td>
- <td style="white-space: nowrap;">{$row.links}</td>
- </tr>
- {/foreach}
- </table>
-{else}
- <strong>{ts}There are no activities defined for this case.{/ts}</strong>
-{/if}
-{/strip}
+{include file="CRM/Case/Form/ActivityTab.tpl"}
{include file="CRM/Case/Form/ActivityToCase.tpl"}