Merge pull request #596 from kurund/CRM-12357
[civicrm-core.git] / templates / CRM / Mailing / Page / Tab.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
27 <div class="crm-mailing-selector">
28 <table id="contact-mailing-selector">
29 <thead>
30 <tr>
31 <th class='crm-mailing-contact-subject'>{ts}Subject{/ts}</th>
32 <th class='crm-mailing-contact_created'>{ts}Added By{/ts}</th>
33 <th class='crm-contact-activity_contact nosort'>{ts}With{/ts}</th>
34 <th class='crm-mailing-contact-date'>{ts}Date{/ts}</th>
35 <th class='crm-mailing-contact-links nosort'>&nbsp;</th>
36 </tr>
37 </thead>
38 </table>
39 </div>
40 {literal}
41 <script type="text/javascript">
42 var oTable;
43
44 cj(function ( ) {
45 buildMailingContact( );
46 });
47
48 function buildMailingContact() {
49
50 var columns = '';
51 var sourceUrl = {/literal}'{crmURL p="civicrm/ajax/contactmailing" h=0 q="contact_id=$contactId"}'{literal};
52
53 var ZeroRecordText = {/literal}'{ts escape="js"}No mailings found{/ts}.'{literal};
54
55 oTable = cj('#contact-mailing-selector').dataTable({
56 "bFilter" : false,
57 "bAutoWidth" : false,
58 "aaSorting" : [],
59 "aoColumns" : [
60 {sClass:'crm-mailing-contact-subject'},
61 {sClass:'crm-mailing-contact_created'},
62 {sClass: 'crm-contact-activity_contact'},
63 {sClass: 'crm-mailing-contact-date'},
64 {sClass:'crm-mailing-contact-links', bSortable:false}
65 ],
66 "bProcessing": true,
67 "sPaginationType": "full_numbers",
68 "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
69 "bServerSide": true,
70 "bJQueryUI": true,
71 "sAjaxSource": sourceUrl,
72 "iDisplayLength": 25,
73 "oLanguage": {
74 "sZeroRecords": ZeroRecordText,
75 "sProcessing": {/literal}"{ts escape='js'}Processing...{/ts}"{literal},
76 "sLengthMenu": {/literal}"{ts escape='js'}Show _MENU_ entries{/ts}"{literal},
77 "sInfo": {/literal}"{ts escape='js'}Showing _START_ to _END_ of _TOTAL_ entries{/ts}"{literal},
78 "sInfoEmpty": {/literal}"{ts escape='js'}Showing 0 to 0 of 0 entries{/ts}"{literal},
79 "sInfoFiltered": {/literal}"{ts escape='js'}(filtered from _MAX_ total entries){/ts}"{literal},
80 "sSearch": {/literal}"{ts escape='js'}Search:{/ts}"{literal},
81 "oPaginate": {
82 "sFirst": {/literal}"{ts escape='js'}First{/ts}"{literal},
83 "sPrevious": {/literal}"{ts escape='js'}Previous{/ts}"{literal},
84 "sNext": {/literal}"{ts escape='js'}Next{/ts}"{literal},
85 "sLast": {/literal}"{ts escape='js'}Last{/ts}"{literal}
86 }
87 }
88 });
89 }
90
91 function setSelectorClass( ) {
92 cj('#contact-mailing-selector' + ' td:last-child').each( function( ) {
93 cj(this).parent().addClass(cj(this).text() );
94 });
95 }
96 </script>
97 {/literal}