2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
26 {* CiviCase - view case screen*}
28 <div class="crm-block crm-form-block crm-case-caseview-form-block">
30 {* here we are showing related cases w/ jquery dialog *}
31 {if $showRelatedCases}
32 {include file="CRM/Case/Form/ViewRelatedCases.tpl"}
37 <h3>{ts}Summary{/ts}</h3>
38 <table class="report crm-entity case-summary" data-entity="case" data-id="{$caseID}" data-cid="{$contactID}">
40 <tr class="crm-case-caseview-client">
41 <td colspan="5" class="label">
43 {foreach from=$caseRoles.client item=client name=clients}
44 <a href="{crmURL p='civicrm/contact/view' q="action=view&reset=1&cid=`$client.contact_id`"}" title="{ts}view contact record{/ts}">{$client.display_name}</a>{if not $smarty.foreach.clients.last}, {/if}
46 <a href="#addClientDialog" class="crm-hover-button case-miniform" title="{ts}Add Client{/ts}" data-key="{crmKey name='civicrm/case/ajax/addclient'}">
47 <span class="icon add-icon"></span>
49 <div id="addClientDialog" class="hiddenElement">
50 <input name="add_client_id" placeholder="{ts}- select contact -{/ts}" class="huge" />
53 <div class="crm-block relatedCases-link"><a class="crm-hover-button crm-popup medium-popup" href="{$relatedCaseUrl}">{$relatedCaseLabel}</a></div>
61 <table class="form-layout-compressed">
62 {foreach from=$caseRoles.client item=client}
63 <tr class="crm-case-caseview-display_name">
64 <td class="label-left bold" style="padding: 0px; border: none;">{$client.display_name}</td>
67 <tr class="crm-case-caseview-phone">
68 <td class="label-left description" style="padding: 1px">{$client.phone}</td>
71 {if $client.birth_date}
72 <tr class="crm-case-caseview-birth_date">
73 <td class="label-left description" style="padding: 1px">{ts}DOB{/ts}: {$client.birth_date|crmDate}</td>
79 <div class="crm-block relatedCases-link"><a class="crm-hover-button crm-popup medium-popup" href="{$relatedCaseUrl}">{$relatedCaseLabel}</a></div>
83 <td class="crm-case-caseview-case_subject label">
84 <span class="crm-case-summary-label">{ts}Subject{/ts}:</span> {$caseDetails.case_subject}
86 <td class="crm-case-caseview-case_type label">
87 <span class="crm-case-summary-label">{ts}Type{/ts}:</span> {$caseDetails.case_type} <a class="crm-hover-button crm-popup" href="{crmURL p='civicrm/case/activity' q="action=add&reset=1&cid=`$contactId`&caseid=`$caseId`&selectedChild=activity&atype=`$changeCaseTypeId`"}" title="{ts}Change case type (creates activity record){/ts}"><span class="icon edit-icon"></span></a>
89 <td class="crm-case-caseview-case_status label">
90 <span class="crm-case-summary-label">{ts}Status{/ts}:</span> {$caseDetails.case_status} <a class="crm-hover-button crm-popup" href="{crmURL p='civicrm/case/activity' q="action=add&reset=1&cid=`$contactId`&caseid=`$caseId`&selectedChild=activity&atype=`$changeCaseStatusId`"}" title="{ts}Change case status (creates activity record){/ts}"><span class="icon edit-icon"></span></a>
92 <td class="crm-case-caseview-case_start_date label">
93 <span class="crm-case-summary-label">{ts}Open Date{/ts}:</span> {$caseDetails.case_start_date|crmDate} <a class="crm-hover-button crm-popup" href="{crmURL p='civicrm/case/activity' q="action=add&reset=1&cid=`$contactId`&caseid=`$caseId`&selectedChild=activity&atype=`$changeCaseStartDateId`"}" title="{ts}Change case start date (creates activity record){/ts}"><span class="icon edit-icon"></span></a>
95 <td class="crm-case-caseview-{$caseID} label">
96 <span class="crm-case-summary-label">{ts}ID{/ts}:</span> {$caseID}
100 {if $hookCaseSummary}
101 <div id="caseSummary">
102 {foreach from=$hookCaseSummary item=val key=div_id}
103 <div id="{$div_id}"><label>{$val.label}</label><div class="value">{$val.value}</div></div>
108 <div class="case-control-panel">
111 {$form.add_activity_type_id.html}
112 {if $hasAccessToAllCases}
113 {$form.timeline_id.html}{$form._qf_CaseView_next.html}
114 {$form.report_id.html}
120 {if $hasAccessToAllCases}
121 <a class="crm-hover-button action-item no-popup" href="{crmURL p='civicrm/case/report/print' q="all=1&redact=0&cid=$contactID&caseID=$caseId&asn=standard_timeline"}"><span class="icon print-icon"></span> {ts}Print Report{/ts}</a>
125 <a href="#mergeCasesDialog" class="action-item no-popup crm-hover-button case-miniform"><span class="icon ui-icon-copy"></span>{ts}Merge Case{/ts}</a>
126 {$form._qf_CaseView_next_merge_case.html}
127 <span id="mergeCasesDialog" class="hiddenElement">
128 {$form.merge_case_id.html}
132 {if call_user_func(array('CRM_Core_Permission','giveMeAllACLs'))}
133 <a class="action-item crm-hover-button medium-popup" href="{crmURL p='civicrm/contact/view/case/editClient' h=1 q="reset=1&action=update&id=$caseID&cid=$contactID"}"><span class="icon ui-icon-person"></span> {ts}Assign to Another Client{/ts}</a>
139 <div class="clear"></div>
140 {include file="CRM/Case/Page/CustomDataView.tpl"}
142 <div class="crm-accordion-wrapper collapsed crm-case-roles-block">
143 <div class="crm-accordion-header">
145 </div><!-- /.crm-accordion-header -->
146 <div class="crm-accordion-body">
148 {if $hasAccessToAllCases}
149 <div class="crm-submit-buttons">
150 <a class="button case-miniform" href="#addCaseRoleDialog" data-key="{crmKey name='civicrm/ajax/relation'}" rel="#caseRoles-selector"><div class="icon add-icon"></div>{ts}Add new role{/ts}</a>
152 <div id="addCaseRoleDialog" class="hiddenElement">
153 <div>{$form.role_type.label}</div>
154 <div>{$form.role_type.html}</div><br />
155 <div><label for="add_role_contact_id">{ts}Assign To{/ts}:</label></div>
156 <div><input name="add_role_contact_id" placeholder="{ts}- select contact -{/ts}" class="huge" /></div>
160 <div id="editCaseRoleDialog" class="hiddenElement">
161 <div><label for="edit_role_contact_id">{ts}Change To{/ts}:</label></div>
162 <div><input name="edit_role_contact_id" placeholder="{ts}- select contact -{/ts}" class="huge" /></div>
165 <table id="caseRoles-selector" class="report-layout">
167 <th>{ts}Case Role{/ts}</th>
168 <th>{ts}Name{/ts}</th>
169 <th>{ts}Phone{/ts}</th>
170 <th>{ts}Email{/ts}</th>
171 {if $relId neq 'client' and $hasAccessToAllCases}
172 <th id="nosort">{ts}Actions{/ts}</th>
177 <div id="deleteCaseRoleDialog" class="hiddenElement">
178 {ts}Are you sure you want to delete this case role?{/ts}
182 <script type="text/javascript">
186 buildCaseRoles(false);
189 function buildCaseRoles(filterSearch) {
195 var sourceUrl = {/literal}"{crmURL p='civicrm/ajax/caseroles' h=0 q='snippet=4&caseID='}{$caseID}"{literal};
196 sourceUrl = sourceUrl + '&cid={/literal}{$contactID}{literal}';
197 sourceUrl = sourceUrl + '&userID={/literal}{$userID}{literal}';
199 cj('#caseRoles-selector th').each( function( ) {
200 if ( cj(this).attr('id') != 'nosort' ) {
201 columns += '{"sClass": "' + cj(this).attr('class') +'"},';
204 columns += '{ "bSortable": false },';
209 columns = columns.substring(0, columns.length - 1 );
210 eval('columns =[' + columns + ']');
212 oTable = cj('#caseRoles-selector').dataTable({
214 "bAutoWidth" : false,
216 "aoColumns" : columns,
219 "asStripClasses" : [ "odd-row", "even-row" ],
220 "sPaginationType": "full_numbers",
221 "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
223 "sAjaxSource": sourceUrl,
224 "iDisplayLength": 10,
225 "fnDrawCallback": function() { setCaseRolesSelectorClass(); },
226 "fnServerData": function ( sSource, aoData, fnCallback ) {
232 "success": fnCallback
238 function setCaseRolesSelectorClass( ) {
239 cj("#caseRoles-selector td:last-child").each( function( ) {
240 cj(this).parent().addClass(cj(this).text() );
246 </div><!-- /.crm-accordion-body -->
247 </div><!-- /.crm-accordion-wrapper -->
249 {if $hasAccessToAllCases}
250 <div class="crm-accordion-wrapper collapsed crm-case-other-relationships-block">
251 <div class="crm-accordion-header">
252 {ts}Other Relationships{/ts}
253 </div><!-- /.crm-accordion-header -->
254 <div class="crm-accordion-body">
255 {capture assign=relUrl}{crmURL p='civicrm/contact/view/rel' q="action=add&reset=1&cid=`$contactId`&caseID=`$caseID`"}{/capture}
256 {if $clientRelationships}
257 <div class="crm-submit-buttons">
258 <a class="button" href="{$relUrl}">
259 <div class="icon add-icon"></div>{ts}Add client relationship{/ts}</a>
261 <table id="clientRelationships-selector" class="report-layout">
263 <th>{ts}Client Relationship{/ts}</th>
264 <th>{ts}Name{/ts}</th>
265 <th>{ts}Phone{/ts}</th>
266 <th>{ts}Email{/ts}</th>
270 <div class="messages status no-popup">
271 <div class="icon inform-icon"></div>
272 {capture assign=link}class="action-item" href="{$relUrl}"{/capture}
273 {ts 1=$link}There are no Relationships entered for this client. You can <a %1>add one</a>.{/ts}
277 <script type="text/javascript">
279 buildCaseClientRelationships(false);
282 function buildCaseClientRelationships(filterSearch) {
288 var sourceUrl = {/literal}"{crmURL p='civicrm/ajax/clientrelationships' h=0 q='snippet=4&caseID='}{$caseID}"{literal};
289 sourceUrl = sourceUrl + '&cid={/literal}{$contactID}{literal}';
290 sourceUrl = sourceUrl + '&userID={/literal}{$userID}{literal}';
292 cj('#clientRelationships-selector th').each( function( ) {
293 if ( cj(this).attr('id') != 'nosort' ) {
294 columns += '{"sClass": "' + cj(this).attr('class') +'"},';
297 columns += '{ "bSortable": false },';
302 columns = columns.substring(0, columns.length - 1 );
303 eval('columns =[' + columns + ']');
305 oTable = cj('#clientRelationships-selector').dataTable({
307 "bAutoWidth" : false,
309 "aoColumns" : columns,
312 "asStripClasses" : [ "odd-row", "even-row" ],
313 "sPaginationType": "full_numbers",
314 "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
316 "sAjaxSource": sourceUrl,
317 "iDisplayLength": 10,
318 "fnDrawCallback": function() { setClientRelationshipsSelectorClass(); },
319 "fnServerData": function (sSource, aoData, fnCallback) {
325 "success": fnCallback
331 function setClientRelationshipsSelectorClass( ) {
332 cj("#clientRelationships-selector td:last-child").each(function() {
333 cj(this).parent().addClass(cj(this).text());
339 {if !empty($globalGroupInfo.id)}
340 <div class="crm-submit-buttons">
341 <a class="button case-miniform" href="#addMembersToGroupDialog" rel="#globalRelationships-selector" data-group_id="{$globalGroupInfo.id}">
342 <div class="icon add-icon"></div>{ts 1=$globalGroupInfo.title}Add members to %1{/ts}
345 <div id="addMembersToGroupDialog" class="hiddenElement">
346 <input name="add_member_to_group_contact_id" placeholder="{ts}- select contact -{/ts}" class="huge" />
348 <table id="globalRelationships-selector" class="report-layout">
350 <th>{$globalGroupInfo.title}</th>
351 <th>{ts}Phone{/ts}</th>
352 <th>{ts}Email{/ts}</th>
358 <script type="text/javascript">
361 buildCaseGlobalRelationships(false);
364 function buildCaseGlobalRelationships(filterSearch) {
370 var sourceUrl = {/literal}"{crmURL p='civicrm/ajax/globalrelationships' h=0 q='snippet=4&caseID='}{$caseID}"{literal};
371 sourceUrl = sourceUrl + '&cid={/literal}{$contactID}{literal}';
372 sourceUrl = sourceUrl + '&userID={/literal}{$userID}{literal}';
374 cj('#globalRelationships-selector th').each( function( ) {
375 if (cj(this).attr('id') != 'nosort') {
376 columns += '{"sClass": "' + cj(this).attr('class') +'"},';
379 columns += '{ "bSortable": false },';
384 columns = columns.substring(0, columns.length - 1 );
385 eval('columns =[' + columns + ']');
387 oTable = cj('#globalRelationships-selector').dataTable({
389 "bAutoWidth" : false,
391 "aoColumns" : columns,
394 "asStripClasses" : [ "odd-row", "even-row" ],
395 "sPaginationType": "full_numbers",
396 "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
398 "sAjaxSource": sourceUrl,
399 "iDisplayLength": 10,
400 "fnDrawCallback": function() { setGlobalRelationshipsSelectorClass(); },
402 "sEmptyTable": {/literal}'{ts escape='js' 1=$globalGroupInfo.title}The group %1 has no members.{/ts}'{literal}
404 "fnServerData": function ( sSource, aoData, fnCallback ) {
410 "success": fnCallback
416 function setGlobalRelationshipsSelectorClass( ) {
417 cj("#globalRelationships-selector td:last-child").each( function( ) {
418 cj(this).parent().addClass(cj(this).text() );
423 </div><!-- /.crm-accordion-body -->
424 </div><!-- /.crm-accordion-wrapper -->
426 {/if} {* other relationship section ends *}
427 {include file="CRM/Case/Form/ActivityToCase.tpl"}
429 {* pane to display / edit regular tags or tagsets for cases *}
430 {if $showTags OR $showTagsets}
432 <div id="casetags" class="crm-accordion-wrapper crm-case-tags-block">
433 <div class="crm-accordion-header">
435 </div><!-- /.crm-accordion-header -->
436 <div class="crm-accordion-body">
437 {assign var="tagExits" value=0}
439 <div class="crm-block crm-content-block crm-case-caseview-display-tags"> {$tags}</div>
440 {assign var="tagExits" value=1}
443 {foreach from=$tagsetInfo_case item=displayTagset}
444 {if $displayTagset.entityTagsArray}
445 <div class="crm-block crm-content-block crm-case-caseview-display-tagset">
446 {$displayTagset.parentName}:
447 {foreach from=$displayTagset.entityTagsArray item=val name="tagsetList"}
448 {$val.name}{if !$smarty.foreach.tagsetList.last},{/if}
451 {assign var="tagExits" value=1}
457 {ts}There are no tags currently assigned to this case.{/ts}
461 <div class="crm-submit-buttons">
462 <a class="button case-miniform" href="#manageTagsDialog" data-key="{crmKey name='civicrm/case/ajax/processtags'}">{if $tagExits}{ts}Edit Tags{/ts}{else}{ts}Add Tags{/ts}{/if}</a>
465 </div><!-- /.crm-accordion-body -->
466 </div><!-- /.crm-accordion-wrapper -->
468 <div id="manageTagsDialog" class="hiddenElement">
469 <div class="label">{$form.case_tag.label}</div>
470 <div class="view-value"><div class="crm-select-container">{$form.case_tag.html}</div>
472 <div style="text-align:left;">{include file="CRM/common/Tag.tpl" tagsetType='case'}</div>
474 <div class="clear"></div>
478 {/if} {* end of tag block*}
480 {include file="CRM/Case/Form/ActivityTab.tpl"}
482 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
484 {include file="CRM/Case/Form/ActivityChangeStatusJs.tpl"}
485 {/if} {* view related cases if end *}