Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-08-14-04-44-13
[civicrm-core.git] / templates / CRM / Profile / Page / MultipleRecordFieldsListing.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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 {if $showListing}
27 <h1>{ts}{$customGroupTitle}{/ts}</h1>
28 {if $records and $headers}
29 {include file="CRM/common/jsortable.tpl"}
30 <div id="browseValues">
31 <div>
32 {strip}
33 <table id="records" class="display">
34 <thead>
35 <tr>
36 {foreach from=$headers key=recId item=head}
37 <th>{ts}{$head}{/ts}</th>
38 {/foreach}
39 <th></th>
40 </tr>
41 </thead>
42 {foreach from=$records key=recId item=rows}
43 <tr class="{cycle values="odd-row,even-row"}">
44 {foreach from=$headers key=hrecId item=head}
45 <td>{$rows.$hrecId}</td>
46 {/foreach}
47 <td>{$rows.action}</td>
48 </tr>
49 {/foreach}
50 </table>
51 {/strip}
52 </div>
53 </div>
54 <div id='profile-dialog' class="hiddenElement"></div>
55 {elseif !$records}
56 <div class="messages status no-popup">
57 <div class="icon inform-icon"></div>
58 &nbsp;
59 {ts 1=$customGroupTitle}No records of type '%1' found.{/ts}
60 </div>
61 <div id='profile-dialog' class="hiddenElement"></div>
62 {/if}
63
64 {if !$reachedMax}
65 <a accesskey="N" href="{crmURL p='civicrm/profile/edit' q="reset=1&id=`$contactId`&multiRecord=add&gid=`$gid`&snippet=1&context=multiProfileDialog&onPopupClose=`$onPopupClose`"}"
66 class="button action-item"><span><div class="icon add-icon"></div>{ts}Add New Record{/ts}</span></a>
67 {/if}
68 {/if}
69 {literal}
70 <script type='text/javascript'>
71 cj(function () {
72 function formDialog(dataURL, dialogTitle) {
73 cj.ajax({
74 url: dataURL,
75 success: function (content) {
76 cj('#profile-dialog').show().html(content).dialog({
77 title: dialogTitle,
78 modal: true,
79 width: 680,
80 overlay: {
81 opacity: 0.5,
82 background: "black"
83 },
84
85 close: function (event, ui) {
86 cj('#profile-dialog').html('');
87 }
88 });
89 cj('.action-link').hide();
90 cj('#profile-dialog #crm-profile-block .edit-value label').css('display', 'inline');
91 }});
92 }
93
94 var profileName = {/literal}"{$ufGroupName}"{literal};
95 cj('.action-item').each(function () {
96 if (!cj(this).attr('jshref')) {
97 cj(this).attr('jshref', cj(this).attr('href'));
98 cj(this).attr('href', '#browseValues');
99 }
100 });
101
102 cj(".crm-profile-name-" + profileName + " .action-item").click(function () {
103 dataURL = cj(this).attr('jshref');
104 dialogTitle = cj(this).attr('title');
105 formDialog(dataURL, dialogTitle);
106 });
107 });
108 </script>
109 {/literal}