Update copyright date for 2020
[civicrm-core.git] / templates / CRM / Case / Audit / Audit.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2020 |
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 {*
27 Notes:
28 - Any id's should be prefixed with civicase-audit to avoid name collisions.
29 - The idea behind the regex_replace is that for a css selector on a field, we can make it simple by saying the convention is to use the field label, but convert to lower case and strip out all except a-z and 0-9.
30 There's the potential for collisions (two different labels having the same shortened version), but it would be odd for the user to configure fields that way, and at most affects styling as opposed to crashing or something.
31 - Note the whole output gets contained within a <form> with name="Report".
32 *}
33 <script src="{$config->resourceBase}js/Audit/audit.js" type="text/javascript"></script>
34 <link rel="stylesheet" type="text/css" href="{$config->resourceBase}css/Audit/style.css" />
35 <input type="hidden" name="currentSelection" value="1" />
36
37 <table class = "form-layout">
38 <tr>
39 <td colspan=2>
40 &nbsp;<input type="button" accesskey="P" value="Print Report" name="case_report" onClick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
41 &nbsp;<input type="button" accesskey="B" value="Back to Case" name="back" onClick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
42 </td>
43 </tr>
44 <tr>
45 <td>
46 <div id="civicase-audit">
47 <table><tr><td class="leftpane">
48 <table class="report">
49 <tr class="columnheader-dark">
50 <th>&nbsp;</th>
51 <th>{ts}Description{/ts}</th>
52 </tr>
53 {foreach from=$activities item=activity name=activityloop}
54 <tr class="activity{if $smarty.foreach.activityloop.first} selected{/if}" id="civicase-audit-activity-{$smarty.foreach.activityloop.iteration}">
55 <td class="indicator">
56 {if $activity.completed}
57 <img src="{$config->resourceBase}i/spacer.gif" width="20" height="20">
58 {else}
59 <a href="#" onclick="selectActivity({$smarty.foreach.activityloop.iteration}); return false;">
60 <img src="{$config->resourceBase}i/contribute/incomplete.gif" width="20" height="20" alt="{ts}Incomplete{/ts}" title="{ts}Incomplete{/ts}">
61 </a>
62 {/if}
63 </td>
64 <td>
65 <a href="#" onclick="selectActivity({$smarty.foreach.activityloop.iteration}); return false;">
66 {foreach from=$activity.leftpane item=field name=fieldloop}
67 <span class="civicase-audit-{$field.label|lower|regex_replace:'/[^a-z0-9]+/':''} {$field.datatype}">
68 {if $field.datatype == 'File'}<a href="{$field.value|escape}">{/if}
69 {if $field.datatype == 'Date'}
70 {if $field.includeTime}
71 {$field.value|escape|replace:'T':' '|crmDate}
72 {else}
73 {$field.value|escape|truncate:10:'':true|crmDate}
74 {/if}
75 {else}
76 {$field.value|escape}
77 {/if}
78 {if $field.datatype == 'File'}</a>{/if}
79 </span><br>
80 {/foreach}
81 </a>
82 </td>
83 </tr>
84 {/foreach}
85 </table>
86 </td>
87 <td class="separator">&nbsp;</td>
88 <td class="rightpane">
89 <div class="rightpaneheader">
90 {foreach from=$activities item=activity name=activityloop}
91 <div class="activityheader" id="civicase-audit-header-{$smarty.foreach.activityloop.iteration}">
92 <div class="auditmenu">
93 <span class="editlink"><a target="editauditwin" href="{$activity.editurl}">{ts}Edit{/ts}</a></span>
94 </div>
95 {foreach from=$activity.rightpaneheader item=field name=fieldloop}
96 <div class="civicase-audit-{$field.label|lower|regex_replace:'/[^a-z0-9]+/':''}">
97 <label>{$field.label|escape}</label>
98 <span class="{$field.datatype}">{if $field.datatype == 'File'}<a href="{$field.value|escape}">{/if}
99 {if $field.datatype == 'Date'}
100 {if $field.includeTime}
101 {$field.value|escape|replace:'T':' '|crmDate}
102 {else}
103 {$field.value|escape|truncate:10:'':true|crmDate}
104 {/if}
105 {else}
106 {$field.value|escape}
107 {/if}
108 {if $field.datatype == 'File'}</a>{/if}
109 </span>
110 </div>
111 {/foreach}
112 </div>
113 {/foreach}
114 </div>
115 <div class="rightpanebody">
116 {foreach from=$activities item=activity name=activityloop}
117 <div class="activitybody" id="civicase-audit-body-{$smarty.foreach.activityloop.iteration}">
118 {foreach from=$activity.rightpanebody item=field name=fieldloop}
119 <div class="civicase-audit-{$field.label|lower|regex_replace:'/[^a-z0-9]+/':''}">
120 <label>{$field.label|escape}</label>
121 <span class="{$field.datatype}">{if $field.datatype == 'File'}<a href="{$field.value|escape}">{/if}
122 {if $field.datatype == 'Date'}
123 {if $field.includeTime}
124 {$field.value|escape|replace:'T':' '|crmDate}
125 {else}
126 {$field.value|escape|truncate:10:'':true|crmDate}
127 {/if}
128 {elseif $field.label eq 'Details'}
129 {$field.value}
130 {else}
131 {$field.value|escape}
132 {/if}
133 {if $field.datatype == 'File'}</a>{/if}
134 </span>
135 </div>
136 {/foreach}
137 </div>
138 {/foreach}
139 </div>
140 </td></tr></table>
141 </div>
142 </td>
143 </tr>
144 <tr>
145 <td colspan=2>
146 &nbsp;<input type="button" accesskey="P" value="Print Report" name="case_report" onclick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
147 &nbsp;<input type="button" accesskey="B" value="Back to Case" name="back" onClick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
148 </td>
149 </tr>
150 </table>
151 {literal}
152 <script type="text/javascript">
153 function printReport( id, button ) {
154
155 if ( button.name == 'case_report' ) {
156 var dataUrl = {/literal}"{crmURL p='civicrm/case/report/print' h=0 q='caseID='}"{literal}+id;
157 dataUrl = dataUrl + '&cid={/literal}{$clientID}{literal}&asn=' + {/literal}{$activitySetName|@json_encode}{literal};
158 var redact = '{/literal}{$_isRedact}{literal}'
159
160 var isRedact = 1;
161 if ( redact == 'false' ) {
162 isRedact = 0;
163 }
164
165 var includeActivities = '{/literal}{$includeActivities}{literal}';
166 var all = 0;
167 if( includeActivities == 'All' ) {
168 all = 1;
169 }
170
171 dataUrl = dataUrl + '&redact='+isRedact + '&all='+ all;
172
173 } else {
174
175 var dataUrl = {/literal}"{crmURL p='civicrm/contact/view/case' h=0 q='reset=1&action=view&id='}"{literal}+id;
176 dataUrl = dataUrl + '&cid={/literal}{$clientID}{literal}'+'&selectedChild=case';
177 }
178
179 window.location.href = dataUrl;
180 }
181 </script>
182 {/literal}