Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
232624b1 | 3 | | CiviCRM version 4.4 | |
6a488035 TO |
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} | |
e5e3f1ad | 27 | <h1>{ts}{$customGroupTitle}{/ts}</h1> |
f8c36033 | 28 | {if $records and $headers} |
6a488035 | 29 | {include file="CRM/common/jsortable.tpl"} |
f8c36033 KJ |
30 | <div id="browseValues"> |
31 | <div> | |
6a488035 TO |
32 | {strip} |
33 | <table id="records" class="display"> | |
f8c36033 | 34 | <thead> |
7253f198 | 35 | <tr> |
f8c36033 KJ |
36 | {foreach from=$headers key=recId item=head} |
37 | <th>{ts}{$head}{/ts}</th> | |
7253f198 | 38 | {/foreach} |
f8c36033 | 39 | <th></th> |
7253f198 | 40 | </tr> |
f8c36033 KJ |
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> | |
6a488035 | 49 | {/foreach} |
6a488035 TO |
50 | </table> |
51 | {/strip} | |
6a488035 | 52 | </div> |
f8c36033 KJ |
53 | </div> |
54 | <div id='profile-dialog' class="hiddenElement"></div> | |
f8c36033 KJ |
55 | {elseif !$records} |
56 | <div class="messages status no-popup"> | |
57 | <div class="icon inform-icon"></div> | |
58 | | |
e5e3f1ad | 59 | {ts 1=$customGroupTitle}No records of type '%1' found.{/ts} |
f8c36033 | 60 | </div> |
04a0519a | 61 | <div id='profile-dialog' class="hiddenElement"></div> |
f8c36033 | 62 | {/if} |
6a488035 | 63 | |
f8c36033 | 64 | {if !$reachedMax} |
3a2e7d2b | 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`"}" |
04a0519a | 66 | class="button action-item"><span><div class="icon add-icon"></div>{ts}Add New Record{/ts}</span></a> |
f8c36033 | 67 | {/if} |
6a488035 | 68 | {/if} |
04a0519a RN |
69 | {literal} |
70 | <script type='text/javascript'> | |
71 | cj(function () { | |
bf55af92 TO |
72 | // NOTE: Triggers two events, "profile-dialog:FOO:open" and "profile-dialog:FOO:close", |
73 | // where "FOO" is the internal name of a profile form | |
74 | function formDialog(dialogName, dataURL, dialogTitle) { | |
04a0519a RN |
75 | cj.ajax({ |
76 | url: dataURL, | |
77 | success: function (content) { | |
78 | cj('#profile-dialog').show().html(content).dialog({ | |
79 | title: dialogTitle, | |
80 | modal: true, | |
81 | width: 680, | |
82 | overlay: { | |
83 | opacity: 0.5, | |
84 | background: "black" | |
85 | }, | |
bf55af92 | 86 | open: function(event, ui) { |
25794aa8 TO |
87 | cj('#profile-dialog').trigger({ |
88 | type: "crmFormLoad", | |
89 | profileName: dialogName | |
bf55af92 TO |
90 | }); |
91 | }, | |
b40d870d | 92 | close: function (event, ui) { |
25794aa8 TO |
93 | cj('#profile-dialog').trigger({ |
94 | type: "crmFormClose", | |
95 | profileName: dialogName | |
bf55af92 | 96 | }); |
b40d870d TO |
97 | cj('#profile-dialog').html(''); |
98 | } | |
99 | }); | |
100 | cj('.action-link').hide(); | |
101 | cj('#profile-dialog #crm-profile-block .edit-value label').css('display', 'inline'); | |
102 | } | |
103 | }); | |
04a0519a RN |
104 | } |
105 | ||
3a2e7d2b | 106 | var profileName = {/literal}"{$ufGroupName}"{literal}; |
04a0519a | 107 | cj('.action-item').each(function () { |
3a2e7d2b RN |
108 | if (!cj(this).attr('jshref')) { |
109 | cj(this).attr('jshref', cj(this).attr('href')); | |
110 | cj(this).attr('href', '#browseValues'); | |
34efc347 | 111 | } |
04a0519a RN |
112 | }); |
113 | ||
3a2e7d2b | 114 | cj(".crm-profile-name-" + profileName + " .action-item").click(function () { |
04a0519a RN |
115 | dataURL = cj(this).attr('jshref'); |
116 | dialogTitle = cj(this).attr('title'); | |
bf55af92 | 117 | formDialog(profileName, dataURL, dialogTitle); |
04a0519a RN |
118 | }); |
119 | }); | |
120 | </script> | |
c481c79f | 121 | {/literal} |