Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
232624b1 | 3 | | CiviCRM version 4.4 | |
6a488035 TO |
4 | +--------------------------------------------------------------------+ |
5 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
6 | +--------------------------------------------------------------------+ | |
7 | | This file is a part of CiviCRM. | | |
8 | | | | |
9 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
10 | | under the terms of the GNU Affero General Public License | | |
11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
12 | | | | |
13 | | CiviCRM is distributed in the hope that it will be useful, but | | |
14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
16 | | See the GNU Affero General Public License for more details. | | |
17 | | | | |
18 | | You should have received a copy of the GNU Affero General Public | | |
19 | | License and the CiviCRM Licensing Exception along | | |
20 | | with this program; if not, contact CiviCRM LLC | | |
21 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
22 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
24 | +--------------------------------------------------------------------+ | |
25 | *} | |
26 | {* View Case Activities *} {* Uses inline styles since we have not figured out yet how to include our normal .css files. *} | |
27 | <div class="crm-block crm-content-block crm-case-activity-view-block"> | |
28 | {if $revs} | |
29 | <strong>{$subject}</strong> ({ts}all revisions{/ts})<br /> | |
30 | {strip} | |
31 | <table style="width: 95%; border: 1px solid #CCCCCC;"> | |
32 | <tr style="background-color: #F6F6F6; color: #000000; border: 1px solid #CCCCCC;"> | |
33 | <th>{ts}Created By{/ts}</th> | |
34 | <th>{ts}Created On{/ts}</th> | |
35 | <th> </th> | |
36 | </tr> | |
37 | {foreach from=$result item=row} | |
38 | <tr {if $row.id EQ $latestRevisionID}style="font-weight: bold;"{/if}> | |
39 | <td class="crm-case-activityview-form-block-name">{$row.name}</td> | |
40 | <td class="crm-case-activityview-form-block-date">{$row.date|crmDate}</td> | |
b7054e52 | 41 | <td class="crm-case-activityview-form-block-{$row.id}"><a href="#" onclick="viewRevision( {$row.id} ); return false;" title="{ts}View this revision of the activity record.{/ts}">{if $row.id != $latestRevisionID}View Prior Revision{else}View Current Revision{/if}</a></td> |
6a488035 TO |
42 | </tr> |
43 | {/foreach} | |
44 | </table> | |
45 | {/strip} | |
46 | {else} | |
47 | {if $report} | |
48 | {if $caseID} | |
49 | <div id="activity-content"> | |
50 | {/if} | |
51 | <table class="crm-info-panel" id="crm-activity-view-table"> | |
52 | {foreach from=$report.fields item=row name=report} | |
53 | <tr class="crm-case-activity-view-{$row.label}"> | |
54 | <td class="label">{$row.label}</td> | |
55 | {if $smarty.foreach.report.first AND ( $activityID OR $parentID OR $latestRevisionID )} {* Add a cell to first row with links to prior revision listing and Prompted by (parent) as appropriate *} | |
56 | <td>{$row.value}</td> | |
57 | <td style="padding-right: 50px; text-align: right; font-size: .9em;"> | |
b7054e52 CW |
58 | {if $activityID}<a href="#" onclick="listRevisions({$activityID}); return false;">» {ts}List all revisions{/ts}</a>{if !$latestRevisionID}<br />{ts}(this is the current revision){/ts}{/if}<br />{/if} |
59 | {if $latestRevisionID}<a href="#" onclick="viewRevision({$latestRevisionID}); return false;">» {ts}View current revision{/ts}</a><br /><span style="color: red;">{ts}(this is not the current revision){/ts}</span><br />{/if} | |
60 | {if $parentID}<a href="#" onclick="viewRevision({$parentID}); return false;">» {ts}Prompted by{/ts}</a>{/if} | |
6a488035 TO |
61 | </td> |
62 | {else} | |
63 | <td colspan="2">{if $row.label eq 'Details'}{$row.value|crmStripAlternatives|nl2br}{elseif $row.type eq 'Date'}{$row.value|crmDate}{else}{$row.value}{/if}</td> | |
64 | {/if} | |
65 | </tr> | |
66 | {/foreach} | |
67 | {* Display custom field data for the activity. *} | |
68 | {if $report.customGroups} | |
69 | {foreach from=$report.customGroups item=customGroup key=groupTitle name=custom} | |
70 | <tr style="background-color: #F6F6F6; color: #000000; border: 1px solid #CCCCCC; font-weight: bold" class="crm-case-activityview-form-block-groupTitle"> | |
71 | <td colspan="3">{$groupTitle}</td> | |
72 | </tr> | |
73 | {foreach from=$customGroup item=customField name=fields} | |
74 | <tr{if ! $smarty.foreach.fields.last} style="border-bottom: 1px solid #F6F6F6;"{/if}> | |
75 | <td class="label">{$customField.label}</td> | |
76 | <td>{$customField.value}</td> | |
77 | </tr> | |
78 | {/foreach} | |
79 | {/foreach} | |
80 | {/if} | |
81 | </table> | |
82 | {if $caseID} | |
83 | <div class="crm-submit-buttons"> | |
84 | <a class="button" href="{crmURL p='civicrm/contact/view/case' q="reset=1&id=`$caseID`&cid=`$contactID`&action=view"}"><span>{ts}Manage Case{/ts}</span></a> | |
85 | </div> | |
86 | {/if} | |
87 | {else} | |
88 | <div class="messages status no-popup">{ts}This activity might not be attached to any case. Please investigate.{/ts}</div> | |
89 | {/if} | |
90 | {/if} | |
91 | ||
92 | ||
93 | {literal} | |
94 | <script type="text/javascript"> | |
95 | function viewRevision( activityId ) { | |
96 | var cid= {/literal}"{$contactID}"{literal}; | |
97 | var type = {/literal}"{$type}"{literal}; | |
98 | var viewAct = cj("#view-activity" + type+ ".ui-dialog-content" ); | |
99 | var viewUrl = {/literal}"{crmURL p='civicrm/case/activity/view' h=0 q="snippet=4" }"{literal}; | |
100 | cj("#activity-content" + type, viewAct).load( viewUrl + "&cid="+cid + "&aid=" + activityId +"&type=" + type); | |
101 | } | |
102 | ||
103 | function listRevisions( activityId ) { | |
104 | var cid= {/literal}"{$contactID}"{literal}; | |
105 | var type = {/literal}"{$type}"{literal}; | |
106 | var viewAct = cj("#view-activity" + type + ".ui-dialog-content" ); | |
107 | var viewUrl = {/literal}"{crmURL p='civicrm/case/activity/view' h=0 q="snippet=4" }"{literal}; | |
108 | cj("#activity-content" + type, viewAct).load( viewUrl + "&cid=" + cid + "&aid=" + activityId + "&revs=1" +"&type=" + type); | |
109 | } | |
110 | </script> | |
111 | {/literal} | |
112 | </div> |