Skip to content
Snippets Groups Projects
Unverified Commit 8ac717a2 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #16660 from demeritcowboy/audit-tpl

#1366 - Case Audit.tpl file no longer used
parents 4beda4a7 ec22c2e3
No related branches found
No related tags found
No related merge requests found
/* Note there will also be a bunch of classes specific to the site for each activity they've configured. The class name is "civicase-audit-" plus the name they've given the activity with any non-alphanumeric characters removed. */
#civicase-audit {
}
#civicase-audit table {
border: 0px;
}
#civicase-audit td {
margin: 0px;
}
#civicase-audit td.leftpane {
}
#civicase-audit table.report{
width: 100%;
margin-top: -4px;
}
#civicase-audit tr.selected td a:link, tr.selected td a:visited, tr.selected td a:active {
color: #027AC6;
background-color: #FFFF99;
font-weight: bold;
}
#civicase-audit .indicator{
width: 30px;
text-align: center;
}
#civicase-audit .separator{
width: 10px;
}
#civicase-audit td.rightpane {
background-color: #CCE3F1;
border: #333333 solid 1px;
padding: 2%;
width: 60%;
}
.rightpaneheader {
}
.rightpanebody {
}
#civicase-audit label {
font-weight: bold;
}
.activity {
}
.auditmenu {
padding-bottom: 20px;
}
.editlink {
background: #EEEEEE;
border: #333333 solid 1px;
padding: 2px 3px 2px 3px;
font-size: xx-small;
text-transform: uppercase;
width: 30px;
}
.editlink a {
text-decoration: none;
color: #0000CC;
font-weight: bold;
}
.editlink a:hover {
color: #CC0000;
}
.activity a {
text-decoration: none;
}
.activity a:link, .activity a:visited {
}
.activityheader {
display: none;
padding-bottom: 20px;
font-size: smaller;
}
.activityheader span {
display: list-item;
list-style-type: none;
margin-left: 20px;
}
.auditmenu span {
display: inline;
margin-left: 0px;
}
.activitybody {
background: #FFFFFF;
padding: 2px;
display: none;
}
.activitybody span {
display: list-item;
list-style-type: none;
margin-left: 20px;
}
/* The right pane starts off hidden except for the first activity. */
#civicase-audit-header-1 {
display: block;
}
#civicase-audit-body-1 {
display: block;
}
.String {
}
.Date {
}
.File {
}
.Int {
}
.Memo {
}
.Boolean {
}
{*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{*
Notes:
- Any id's should be prefixed with civicase-audit to avoid name collisions.
- 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.
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.
- Note the whole output gets contained within a <form> with name="Report".
*}
<script src="{$config->resourceBase}js/Audit/audit.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="{$config->resourceBase}css/Audit/style.css" />
<input type="hidden" name="currentSelection" value="1" />
<table class = "form-layout">
<tr>
<td colspan=2>
&nbsp;<input type="button" accesskey="P" value="Print Report" name="case_report" onClick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
&nbsp;<input type="button" accesskey="B" value="Back to Case" name="back" onClick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
</td>
</tr>
<tr>
<td>
<div id="civicase-audit">
<table><tr><td class="leftpane">
<table class="report">
<tr class="columnheader-dark">
<th>&nbsp;</th>
<th>{ts}Description{/ts}</th>
</tr>
{foreach from=$activities item=activity name=activityloop}
<tr class="activity{if $smarty.foreach.activityloop.first} selected{/if}" id="civicase-audit-activity-{$smarty.foreach.activityloop.iteration}">
<td class="indicator">
{if $activity.completed}
<img src="{$config->resourceBase}i/spacer.gif" width="20" height="20">
{else}
<a href="#" onclick="selectActivity({$smarty.foreach.activityloop.iteration}); return false;">
<img src="{$config->resourceBase}i/contribute/incomplete.gif" width="20" height="20" alt="{ts}Incomplete{/ts}" title="{ts}Incomplete{/ts}">
</a>
{/if}
</td>
<td>
<a href="#" onclick="selectActivity({$smarty.foreach.activityloop.iteration}); return false;">
{foreach from=$activity.leftpane item=field name=fieldloop}
<span class="civicase-audit-{$field.label|lower|regex_replace:'/[^a-z0-9]+/':''} {$field.datatype}">
{if $field.datatype == 'File'}<a href="{$field.value|escape}">{/if}
{if $field.datatype == 'Date'}
{if $field.includeTime}
{$field.value|escape|replace:'T':' '|crmDate}
{else}
{$field.value|escape|truncate:10:'':true|crmDate}
{/if}
{else}
{$field.value|escape}
{/if}
{if $field.datatype == 'File'}</a>{/if}
</span><br>
{/foreach}
</a>
</td>
</tr>
{/foreach}
</table>
</td>
<td class="separator">&nbsp;</td>
<td class="rightpane">
<div class="rightpaneheader">
{foreach from=$activities item=activity name=activityloop}
<div class="activityheader" id="civicase-audit-header-{$smarty.foreach.activityloop.iteration}">
<div class="auditmenu">
<span class="editlink"><a target="editauditwin" href="{$activity.editurl}">{ts}Edit{/ts}</a></span>
</div>
{foreach from=$activity.rightpaneheader item=field name=fieldloop}
<div class="civicase-audit-{$field.label|lower|regex_replace:'/[^a-z0-9]+/':''}">
<label>{$field.label|escape}</label>
<span class="{$field.datatype}">{if $field.datatype == 'File'}<a href="{$field.value|escape}">{/if}
{if $field.datatype == 'Date'}
{if $field.includeTime}
{$field.value|escape|replace:'T':' '|crmDate}
{else}
{$field.value|escape|truncate:10:'':true|crmDate}
{/if}
{else}
{$field.value|escape}
{/if}
{if $field.datatype == 'File'}</a>{/if}
</span>
</div>
{/foreach}
</div>
{/foreach}
</div>
<div class="rightpanebody">
{foreach from=$activities item=activity name=activityloop}
<div class="activitybody" id="civicase-audit-body-{$smarty.foreach.activityloop.iteration}">
{foreach from=$activity.rightpanebody item=field name=fieldloop}
<div class="civicase-audit-{$field.label|lower|regex_replace:'/[^a-z0-9]+/':''}">
<label>{$field.label|escape}</label>
<span class="{$field.datatype}">{if $field.datatype == 'File'}<a href="{$field.value|escape}">{/if}
{if $field.datatype == 'Date'}
{if $field.includeTime}
{$field.value|escape|replace:'T':' '|crmDate}
{else}
{$field.value|escape|truncate:10:'':true|crmDate}
{/if}
{elseif $field.label eq 'Details'}
{$field.value}
{else}
{$field.value|escape}
{/if}
{if $field.datatype == 'File'}</a>{/if}
</span>
</div>
{/foreach}
</div>
{/foreach}
</div>
</td></tr></table>
</div>
</td>
</tr>
<tr>
<td colspan=2>
&nbsp;<input type="button" accesskey="P" value="Print Report" name="case_report" onclick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
&nbsp;<input type="button" accesskey="B" value="Back to Case" name="back" onClick="printReport({$caseId}, this );"/>&nbsp;&nbsp;
</td>
</tr>
</table>
{literal}
<script type="text/javascript">
function printReport( id, button ) {
if ( button.name == 'case_report' ) {
var dataUrl = {/literal}"{crmURL p='civicrm/case/report/print' h=0 q='caseID='}"{literal}+id;
dataUrl = dataUrl + '&cid={/literal}{$clientID}{literal}&asn=' + {/literal}{$activitySetName|@json_encode}{literal};
var redact = '{/literal}{$_isRedact}{literal}'
var isRedact = 1;
if ( redact == 'false' ) {
isRedact = 0;
}
var includeActivities = '{/literal}{$includeActivities}{literal}';
var all = 0;
if( includeActivities == 'All' ) {
all = 1;
}
dataUrl = dataUrl + '&redact='+isRedact + '&all='+ all;
} else {
var dataUrl = {/literal}"{crmURL p='civicrm/contact/view/case' h=0 q='reset=1&action=view&id='}"{literal}+id;
dataUrl = dataUrl + '&cid={/literal}{$clientID}{literal}'+'&selectedChild=case';
}
window.location.href = dataUrl;
}
</script>
{/literal}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment