2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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}
34 {include file="CRM/common/jsortable.tpl"}
35 <div id="browseValues">
38 <table id="records" class="display">
41 {foreach from=$headers key=recId item=head}
42 <th>{ts}{$head}{/ts}</th>
47 {foreach from=$records key=recId item=rows}
48 <tr class="{cycle values="odd-row,even-row"}">
49 {foreach from=$headers key=hrecId item=head}
50 <td>{$rows.$hrecId}</td>
52 <td>{$rows.action}</td>
59 <div id='{$dialogId}' class="hiddenElement"></div>
61 <div class="messages status no-popup">
62 <div class="icon inform-icon"></div>
64 {ts 1=$customGroupTitle}No records of type '%1' found.{/ts}
66 <div id='{$dialogId}' class="hiddenElement"></div>
70 {if $pageViewType eq 'customDataView'}
71 <a accesskey="N" title="{ts 1=$customGroupTitle}Add %1 Record{/ts}" href="{crmURL p='civicrm/contact/view/cd/edit' q="reset=1&snippet=1&type=$ctype&groupID=$customGroupId&entityID=$contactId&cgcount=$cgcount&multiRecordDisplay=single"}"
72 class="button action-item"><span><div class="icon add-icon"></div>{ts 1=$customGroupTitle}Add %1 Record{/ts}</span></a>
74 <a accesskey="N" href="{crmURL p='civicrm/profile/edit' q="reset=1&id=`$contactId`&multiRecord=add&gid=`$gid`&snippet=1&context=multiProfileDialog&onPopupClose=`$onPopupClose`"}"
75 class="button action-item"><span><div class="icon add-icon"></div>{ts}Add New Record{/ts}</span></a>
80 <script type='text/javascript'>
82 var dialogId = '{/literal}{$dialogId}{literal}';
83 var pageViewType = '{/literal}{$pageViewType}{literal}';
84 // NOTE: Triggers two events, "profile-dialog:FOO:open" and "profile-dialog:FOO:close",
85 // where "FOO" is the internal name of a profile form
86 function formDialog(dialogName, dataURL, dialogTitle) {
89 success: function (content) {
90 cj('#' + dialogId).show().html(content).dialog({
98 open: function(event, ui) {
99 cj('#' + dialogId).trigger({
101 profileName: dialogName
104 close: function (event, ui) {
105 cj('#' + dialogId).trigger({
106 type: "crmFormClose",
107 profileName: dialogName
109 cj('#' + dialogId).html('');
112 cj('.action-link').hide();
113 if (pageViewType != 'customDataView') {
114 cj('#profile-dialog #crm-profile-block .edit-value label').css('display', 'inline');
120 var profileName = {/literal}"{$ufGroupName}"{literal};
121 cj('.action-item').each(function () {
122 if (!cj(this).attr('jshref') && !cj(this).hasClass('ignore-jshref')) {
123 cj(this).attr('jshref', cj(this).attr('href'));
124 cj(this).attr('href', '#browseValues');
128 if (pageViewType == 'customDataView') {
129 var actionItemHeirarchy = '.action-item';
130 profileName = 'customRecordView';
133 var actionItemHeirarchy = '.crm-profile-name-' + profileName + ' .action-item';
136 cj(actionItemHeirarchy).click(function () {
137 dataURL = cj(this).attr('jshref');
138 dialogTitle = cj(this).attr('title');
139 if (!cj(this).hasClass('ignore-jshref')) {
140 formDialog(profileName, dataURL, dialogTitle);