Commit | Line | Data |
---|---|---|
6a488035 TO |
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 | {ts 1=$totalSelectedContacts}Number of selected contacts: %1{/ts} | |
27 | ||
28 | {if $searchtype eq 'ts_sel'} | |
29 | <div id="popupContainer"> | |
30 | <table id="selectedRecords" class="display crm-copy-fields"> | |
31 | <thead> | |
32 | <tr class="columnheader"> | |
33 | <th class="contact_details">{ts}Name{/ts}</th> | |
34 | </tr> | |
35 | </thead> | |
36 | ||
37 | <tbody> | |
38 | {foreach from=$value item='row'} | |
39 | <tr class="{cycle values="odd-row,even-row"}"> | |
40 | <td class="name">{$row}</td> | |
41 | </tr> | |
42 | {/foreach} | |
43 | </tbody> | |
44 | </table> | |
45 | ||
46 | </div><br /> | |
47 | <a href="#" id="popup-button" title="{ts}View Selected Contacts{/ts}">{ts}View Selected Contacts{/ts}</a> | |
48 | {/if} | |
49 | ||
50 | {if $searchtype eq 'ts_sel'} | |
51 | {literal} | |
52 | <script type="text/javascript"> | |
53 | cj(function() { | |
54 | cj("#popupContainer").css({ | |
55 | "background-color":"#E0E0E0", | |
56 | 'display':'none', | |
57 | }); | |
58 | ||
59 | cj("#popup-button").click(function() { | |
60 | cj("#popupContainer").dialog({ | |
61 | title: "Selected Contacts", | |
62 | width:700, | |
63 | height:500, | |
64 | modal: true, | |
65 | overlay: { | |
66 | opacity: 0.5, | |
67 | background: "black" | |
68 | } | |
69 | }); | |
70 | return false; | |
71 | }); | |
72 | ||
73 | var count = 0; var columns = ''; var sortColumn = ''; | |
74 | cj('#selectedRecords th').each( function( ) { | |
75 | if (cj(this).attr('class') == 'contact_details') { | |
76 | sortColumn += '[' + count + ', "asc" ],'; | |
77 | columns += '{"sClass": "contact_details"},'; | |
78 | } | |
79 | else { | |
80 | columns += '{ "bSortable": false },'; | |
81 | } | |
82 | count++; | |
83 | }); | |
84 | ||
85 | // FIXME | |
86 | var url=location.href.split('&'); | |
87 | if (url[3]) { | |
88 | $('#popup-button').click(); | |
89 | } | |
90 | ||
91 | columns = columns.substring(0, columns.length - 1 ); | |
92 | sortColumn = sortColumn.substring(0, sortColumn.length - 1 ); | |
93 | eval('sortColumn =[' + sortColumn + ']'); | |
94 | eval('columns =[' + columns + ']'); | |
95 | ||
96 | //load jQuery data table. | |
97 | cj('#selectedRecords').dataTable( { | |
98 | "sPaginationType": "full_numbers", | |
99 | "bJQueryUI" : true, | |
100 | "aaSorting" : sortColumn, | |
101 | "aoColumns" : columns, | |
102 | "bFilter" : false | |
103 | }); | |
104 | }); | |
105 | ||
106 | </script> | |
107 | {/literal} | |
108 | {/if} | |
109 | ||
110 | {if $rows} | |
111 | <div class="form-item"> | |
112 | <table width="30%"> | |
113 | <tr class="columnheader"> | |
114 | <th>{ts}Name{/ts}</th> | |
115 | </tr> | |
116 | {foreach from=$rows item=row} | |
117 | <tr class="{cycle values="odd-row,even-row"}"> | |
118 | <td>{$row.displayName}</td> | |
119 | </tr> | |
120 | {/foreach} | |
121 | </table> | |
122 | </div> | |
123 | {/if} |