<td>{$form.$cbName.html}</td>
{/if}
<td class="crm-case-id crm-case-id_{$row.case_id}">
- <span id="{$list}{$row.case_id}_show">
- <a href="#" onclick="cj('#caseDetails{$list}{$row.case_id}').show();
- buildCaseDetails('{$list}{$row.case_id}','{$row.contact_id}');
- cj('#{$list}{$row.case_id}_show').hide();
- cj('#minus{$list}{$row.case_id}_hide').show();
- cj('#{$list}{$row.case_id}_hide').show();
- return false;"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}Show recent activities{/ts}"/></a>
- </span>
- <span id="minus{$list}{$row.case_id}_hide">
- <a href="#" onclick="cj('#caseDetails{$list}{$row.case_id}').hide();
- cj('#{$list}{$row.case_id}_show').show();
- cj('#{$list}{$row.case_id}_hide').hide();
- cj('#minus{$list}{$row.case_id}_hide').hide();
- return false;"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}Hide activities{/ts}"/></a>
+ <a title="{ts}Activities{/ts}" class="crm-expand-row" href="{crmURL p='civicrm/case/details' q="caseId=`$row.case_id`&cid=`$row.contact_id`"}"></a>
</td>
{if !$single}
<td class="crm-case-case_scheduled_activity_type">{if $row.case_scheduled_activity_type}
{$row.case_scheduled_activity_type}<br />{$row.case_scheduled_activity_date|crmDate}{else}---{/if}</td>
<td>{$row.action|replace:'xx':$row.case_id}{$row.moreActions|replace:'xx':$row.case_id}</td>
- </tr>
- <tr id="{$list}{$row.case_id}_hide" class='{$rowClass}'>
- <td>
- </td>
-{if $context EQ 'Search'}
- <td colspan="10" class="enclosingNested">
-{else}
- <td colspan="9" class="enclosingNested">
-{/if}
- <div id="caseDetails{$list}{$row.case_id}"></div>
- </td>
- </tr>
- <script type="text/javascript">
- cj('#{$list}{$row.case_id}_hide').hide();
- cj('#minus{$list}{$row.case_id}_hide').hide();
- </script>
{/foreach}
{* Dashboard only lists 10 most recent cases. *}
{/strip}
{include file="CRM/common/pager.tpl" location="bottom"}
-
-{* Build case details*}
-{literal}
-<script type="text/javascript">
-
-function buildCaseDetails( caseId, contactId ) {
- var dataUrl = {/literal}"{crmURL p='civicrm/case/details' h=0 q='caseId='}{literal}" + caseId +'&cid=' + contactId;
- CRM.loadPage(dataUrl, {target: '#caseDetails' + caseId});
-}
-</script>
-
-{/literal}
+{crmScript file='js/crm.expandRow.js'}
<tr id='{$context}-{$list}-rowid-{$row.case_id}' class="crm-case crm-case_{$row.case_id}">
<td>
- {* {$row.contact_type_icon}<br /> *}
- <span id="{$context}{$list}{$row.case_id}_show">
- <a href="#" onclick="{$context}{$list}CaseDetails('{$row.case_id}','{$row.contact_id}', '{$list}', '{$context}');
- showCaseActivities('{$row.case_id}','{$list}', '{$context}');
- return false;"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}open section{/ts}"/></a>
- </span>
- <span id="minus{$context}{$list}{$row.case_id}_hide">
- <a href="#" onclick="hideCaseActivities('{$row.case_id}','{$list}', '{$context}');
- return false;"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}open section{/ts}"/></a>
+ <a title="{ts}Activities{/ts}" class="crm-expand-row" href="{crmURL p='civicrm/case/details' q="caseId=`$row.case_id`&cid=`$row.contact_id`&type=$list"}"></a>
</td>
<td class="crm-case-phone"><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a>{if $row.phone}<br /><span class="description">{$row.phone}</span>{/if}<br /><span class="description">{ts}Case ID{/ts}: {$row.case_id}</span></td>
<td>{$row.action}{$row.moreActions}</td>
</tr>
- <tr id="{$list}{$row.case_id}_hide" class="crm-case_{$row.case_id}">
- <td>
- </td>
- <td colspan="7" width="99%" class="enclosingNested crm-case_{$row.case_id}">
- <div id="{$context}-{$list}-casedetails-{$row.case_id}"></div>
- </td>
- </tr>
- <script type="text/javascript">
- cj('#minus{$context}{$list}{$row.case_id}_hide').hide();
- </script>
{/foreach}
{* Dashboard only lists 10 most recent casess. *}
{/strip}
-{* Build case details*}
-{literal}
-<script type="text/javascript">
-function {/literal}{$context}{$list}{literal}CaseDetails( caseId, contactId, type, context )
-{
- var dataUrl = CRM.url('civicrm/case/details', {caseId: caseId, cid: contactId, type: type});
- CRM.loadPage(dataUrl, {target: '#'+ context + '-' + type +'-casedetails-' + caseId});
-}
-
-function showCaseActivities( caseId, type, context ) {
- cj('#' + context + '-' + type +'-casedetails-'+ caseId).show();
- cj('#' + context+type+caseId+'_show').hide();
- cj('#minus'+context+type+caseId+'_hide').show();
-}
-
-function hideCaseActivities( caseId , type, context ) {
- cj('#' + context + '-' + type +'-casedetails-' + caseId).hide();
- cj('#' + context+type+caseId+'_show').show();
- cj('#minus'+context+type+caseId+'_hide').hide();
-}
-
-</script>
-{/literal}
+{crmScript file='js/crm.expandRow.js'}