Commit | Line | Data |
---|---|---|
2ede60ec DL |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
232624b1 | 3 | | CiviCRM version 4.4 | |
2ede60ec DL |
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> | |
a582d9f2 KJ |
32 | <th class='crm-mailing-contact_created'>{ts}Added By{/ts}</th> |
33 | <th class='crm-contact-activity_contact nosort'>{ts}With{/ts}</th> | |
2ede60ec | 34 | <th class='crm-mailing-contact-date'>{ts}Date{/ts}</th> |
50f5a393 | 35 | <th class='crm-mailing_openstats'>{ts}Opens/ Clicks{/ts}</th> |
2ede60ec | 36 | <th class='crm-mailing-contact-links nosort'> </th> |
2ede60ec DL |
37 | </tr> |
38 | </thead> | |
39 | </table> | |
40 | </div> | |
41 | {literal} | |
42 | <script type="text/javascript"> | |
0991dfb0 KJ |
43 | cj(function($) { |
44 | var oTable; | |
2ede60ec | 45 | |
0991dfb0 KJ |
46 | buildMailingContact(); |
47 | ||
48 | function buildMailingContact() { | |
0991dfb0 | 49 | var sourceUrl = {/literal}'{crmURL p="civicrm/ajax/contactmailing" h=0 q="contact_id=$contactId"}'{literal}; |
2ede60ec | 50 | |
0991dfb0 | 51 | var ZeroRecordText = {/literal}'{ts escape="js"}No mailings found{/ts}.'{literal}; |
2ede60ec | 52 | |
0991dfb0 KJ |
53 | oTable = $('#contact-mailing-selector').dataTable({ |
54 | "bFilter": false, | |
55 | "bAutoWidth": false, | |
56 | "aaSorting": [], | |
57 | "aoColumns": [ | |
58 | {sClass: 'crm-mailing-contact-subject'}, | |
59 | {sClass: 'crm-mailing-contact_created'}, | |
5a99d240 | 60 | {sClass: 'crm-contact-activity_contact', bSortable:false}, |
0991dfb0 | 61 | {sClass: 'crm-mailing-contact-date'}, |
50f5a393 | 62 | {sClass: 'crm-mailing_openstats', bSortable:false}, |
0991dfb0 KJ |
63 | {sClass: 'crm-mailing-contact-links', bSortable: false} |
64 | ], | |
65 | "bProcessing": true, | |
66 | "sPaginationType": "full_numbers", | |
67 | "sDom": '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>', | |
68 | "bServerSide": true, | |
69 | "bJQueryUI": true, | |
70 | "sAjaxSource": sourceUrl, | |
71 | "iDisplayLength": 25, | |
72 | "oLanguage": { | |
73 | "sZeroRecords": ZeroRecordText, | |
74 | "sProcessing": {/literal}"{ts escape='js'}Processing...{/ts}"{literal}, | |
75 | "sLengthMenu": {/literal}"{ts escape='js'}Show _MENU_ entries{/ts}"{literal}, | |
76 | "sInfo": {/literal}"{ts escape='js'}Showing _START_ to _END_ of _TOTAL_ entries{/ts}"{literal}, | |
77 | "sInfoEmpty": {/literal}"{ts escape='js'}Showing 0 to 0 of 0 entries{/ts}"{literal}, | |
78 | "sInfoFiltered": {/literal}"{ts escape='js'}(filtered from _MAX_ total entries){/ts}"{literal}, | |
79 | "sSearch": {/literal}"{ts escape='js'}Search:{/ts}"{literal}, | |
80 | "oPaginate": { | |
81 | "sFirst": {/literal}"{ts escape='js'}First{/ts}"{literal}, | |
82 | "sPrevious": {/literal}"{ts escape='js'}Previous{/ts}"{literal}, | |
83 | "sNext": {/literal}"{ts escape='js'}Next{/ts}"{literal}, | |
84 | "sLast": {/literal}"{ts escape='js'}Last{/ts}"{literal} | |
85 | } | |
86 | }, | |
87 | "fnDrawCallback": function () { | |
88 | addMailingViewDialog() | |
89 | } | |
90 | }); | |
91 | } | |
2ede60ec | 92 | |
0991dfb0 KJ |
93 | function addMailingViewDialog() { |
94 | $('a.crm-mailing-view').click(function() { | |
95 | var o = $('<div class="crm-container crm-mailing-view-dialog"></div>'); | |
96 | o.block({theme: true}); | |
97 | o.load($(this).attr('href'), function() { | |
98 | o.unblock(); | |
99 | }); | |
2ede60ec | 100 | |
0991dfb0 KJ |
101 | CRM.confirm( '' |
102 | ,{ | |
5a99d240 | 103 | title: ts('Email Message'), |
0991dfb0 | 104 | message: o, |
706cff6d KJ |
105 | width : "680px", // don't remove px |
106 | height: "560" | |
107 | }, | |
108 | ts('Done') | |
0991dfb0 KJ |
109 | ); |
110 | return false; | |
111 | }); | |
2ede60ec | 112 | } |
2ede60ec | 113 | |
2ede60ec | 114 | }); |
2ede60ec DL |
115 | </script> |
116 | {/literal} |