Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {ts 1=$totalSelectedContacts}Number of selected contacts: %1{/ts} | |
11 | ||
12 | {if $searchtype eq 'ts_sel'} | |
13 | <div id="popupContainer"> | |
091d24a9 M |
14 | <div class="crm-block crm-form-block crm-search-form-block"> |
15 | <table id="selectedRecords-{$group.id}" class="display crm-copy-fields crm-sortable"> | |
16 | <thead> | |
17 | <tr class="columnheader"> | |
18 | <th class="contact_details">{ts}Name{/ts}</th> | |
6a488035 | 19 | </tr> |
091d24a9 | 20 | </thead> |
6a488035 | 21 | |
091d24a9 M |
22 | <tbody> |
23 | {foreach from=$value item='row'} | |
24 | <tr class="{cycle values="odd-row,even-row"}"> | |
25 | <td class="name">{$row}</td> | |
26 | </tr> | |
27 | {/foreach} | |
28 | </tbody> | |
29 | </table> | |
30 | </div> | |
6a488035 TO |
31 | </div><br /> |
32 | <a href="#" id="popup-button" title="{ts}View Selected Contacts{/ts}">{ts}View Selected Contacts{/ts}</a> | |
33 | {/if} | |
34 | ||
35 | {if $searchtype eq 'ts_sel'} | |
36 | {literal} | |
37 | <script type="text/javascript"> | |
3cc60a06 | 38 | CRM.$(function($) { |
c750e673 | 39 | $("#popupContainer").css({ |
6a488035 | 40 | "background-color":"#E0E0E0", |
f3b62cc1 | 41 | 'display':'none' |
6a488035 TO |
42 | }); |
43 | ||
c750e673 CW |
44 | $("#popup-button").click(function() { |
45 | $("#popupContainer").dialog({ | |
f3b62cc1 | 46 | title: {/literal}"{ts escape='js'}Selected Contacts{/ts}"{literal}, |
6a488035 TO |
47 | width:700, |
48 | height:500, | |
49 | modal: true, | |
50 | overlay: { | |
51 | opacity: 0.5, | |
52 | background: "black" | |
53 | } | |
54 | }); | |
55 | return false; | |
56 | }); | |
57 | ||
58 | var count = 0; var columns = ''; var sortColumn = ''; | |
24e7a504 | 59 | $('#selectedRecords-{/literal}{$group.id}{literal} th').each(function() { |
c750e673 | 60 | if ($(this).attr('class') == 'contact_details') { |
6a488035 TO |
61 | sortColumn += '[' + count + ', "asc" ],'; |
62 | columns += '{"sClass": "contact_details"},'; | |
63 | } | |
64 | else { | |
65 | columns += '{ "bSortable": false },'; | |
66 | } | |
67 | count++; | |
68 | }); | |
69 | ||
6a488035 TO |
70 | }); |
71 | ||
72 | </script> | |
73 | {/literal} | |
74 | {/if} | |
75 | ||
76 | {if $rows} | |
77 | <div class="form-item"> | |
78 | <table width="30%"> | |
79 | <tr class="columnheader"> | |
80 | <th>{ts}Name{/ts}</th> | |
81 | </tr> | |
82 | {foreach from=$rows item=row} | |
83 | <tr class="{cycle values="odd-row,even-row"}"> | |
84 | <td>{$row.displayName}</td> | |
85 | </tr> | |
86 | {/foreach} | |
87 | </table> | |
88 | </div> | |
89 | {/if} |