2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2018 |
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 +--------------------------------------------------------------------+
27 {if $dontShowTitle neq 1}<h1>{ts}{$customGroupTitle}{/ts}</h1>{/if}
28 {if $pageViewType eq 'customDataView'}
29 {assign var='dialogId' value='custom-record-dialog'}
31 {assign var='dialogId' value='profile-dialog'}
33 {if ($records and $headers) or ($pageViewType eq 'customDataView')}
34 {include file="CRM/common/jsortable.tpl"}
35 <div id="custom-{$customGroupId}-table-wrapper" {if $pageViewType eq 'customDataView'}class="crm-entity" data-entity="contact" data-id="{$contactId}"{/if}>
38 <table id="records-{$customGroupId}" class={if $pageViewType eq 'customDataView'}"crm-multifield-selector crm-ajax-table"{else}'display'{/if}>
40 {if $pageViewType eq 'customDataView'}
41 {foreach from=$headers key=recId item=head}
42 <th data-data={ts}'{$headerAttr.$recId.columnName}'{/ts}
43 {if !empty($headerAttr.$recId.dataType)}cell-data-type="{$headerAttr.$recId.dataType}"{/if}
44 {if !empty($headerAttr.$recId.dataEmptyOption)}cell-data-empty-option="{$headerAttr.$recId.dataEmptyOption}"{/if}>{ts}{$head}{/ts}
47 <th data-data="action" data-orderable="false"> </th>
50 <script type="text/javascript">
52 var ZeroRecordText = {/literal}'{ts 1=$customGroupTitle}No records of type \'%1\' found.{/ts}'{literal};
53 var $table = $('#records-' + {/literal}'{$customGroupId}'{literal});
54 $('table.crm-multifield-selector').data({
56 "url": {/literal}'{crmURL p="civicrm/ajax/multirecordfieldlist" h=0 q="snippet=4&cid=$contactId&cgid=$customGroupId"}'{literal},
59 "emptyTable": ZeroRecordText,
61 //Add class attributes to cells
62 "rowCallback": function(row, data) {
63 $('thead th', $table).each(function(index) {
64 var fName = $(this).attr('data-data');
65 var cell = $('td:eq(' + index + ')', row);
66 if (typeof data[fName] == 'object') {
67 if (typeof data[fName].data != 'undefined') {
68 $(cell).html(data[fName].data);
70 if (typeof data[fName].cellClass != 'undefined') {
71 $(cell).attr('class', data[fName].cellClass);
82 {foreach from=$headers key=recId item=head}
83 <th>{ts}{$head}{/ts}</th>
86 {foreach from=$dateFields key=fieldId item=v}
87 <th class='hiddenElement'></th>
91 {foreach from=$records key=recId item=rows}
92 <tr class="{cycle values="odd-row,even-row"}">
93 {foreach from=$headers key=hrecId item=head}
94 <td {crmAttributes a=$attributes.$hrecId.$recId}>{$rows.$hrecId}</td>
96 <td>{$rows.action}</td>
97 {foreach from=$dateFieldsVals key=fid item=rec}
98 <td class='crm-field-{$fid}_date hiddenElement'>{$rec.$recId}</td>
107 <div id='{$dialogId}' class="hiddenElement"></div>
109 <div class="messages status no-popup">
110 <div class="icon inform-icon"></div>
112 {ts 1=$customGroupTitle}No records of type '%1' found.{/ts}
114 <div id='{$dialogId}' class="hiddenElement"></div>
118 <div class="action-link">
119 {if $pageViewType eq 'customDataView'}
120 <br/><a accesskey="N" title="{ts 1=$customGroupTitle}Add %1 Record{/ts}" href="{crmURL p='civicrm/contact/view/cd/edit' q="reset=1&type=$ctype&groupID=$customGroupId&entityID=$contactId&cgcount=$newCgCount&multiRecordDisplay=single&mode=add"}"
121 class="button action-item"><span><i class="crm-i fa-plus-circle"></i> {ts 1=$customGroupTitle}Add %1 Record{/ts}</span></a>
123 <a accesskey="N" href="{crmURL p='civicrm/profile/edit' q="reset=1&id=`$contactId`&multiRecord=add&gid=`$gid`&context=multiProfileDialog&onPopupClose=`$onPopupClose`"}"
124 class="button action-item"><span><i class="crm-i fa-plus-circle"></i> {ts}Add New Record{/ts}</span></a>