2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
27 <div class="crm-mailing-selector">
28 <table id="contact-mailing-selector">
31 <th class='crm-mailing-contact-subject'>{ts}Subject{/ts}</th>
32 <th class='crm-mailing-contact_created'>{ts}Created By{/ts}</th>
33 <th class='crm-mailing-contact-date'>{ts}Date{/ts}</th>
34 <th class='crm-mailing-contact-links nosort'> </th>
35 <th class='hiddenElement'> </th>
41 <script type="text/javascript">
45 buildMailingContact( );
48 function buildMailingContact() {
52 var sourceUrl = {/literal}'{crmURL p="civicrm/ajax/rest" h=0 q="entity=MailingContact&action=get&sequential=1&json=1&contact_id=$contactId"}'{literal};
54 var ZeroRecordText = {/literal}'{ts escape="js"}No mailings found{/ts}.'{literal};
56 oTable = cj('#mailing-contact-selector').dataTable({
61 {sClass:'crm-mailing-contact-subject'},
62 {sClass:'crm-mailing-contact_created'},
63 {sClass:'crm-mailing-contact-date'},
64 {sClass:'crm-mailing-contact-links', bSortable:false},
65 {sClass:'hiddenElement', bSortable:false}
68 "sPaginationType": "full_numbers",
69 "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
72 "sAjaxSource": sourceUrl,
75 "sZeroRecords": ZeroRecordText,
76 "sProcessing": {/literal}"{ts escape='js'}Processing...{/ts}"{literal},
77 "sLengthMenu": {/literal}"{ts escape='js'}Show _MENU_ entries{/ts}"{literal},
78 "sInfo": {/literal}"{ts escape='js'}Showing _START_ to _END_ of _TOTAL_ entries{/ts}"{literal},
79 "sInfoEmpty": {/literal}"{ts escape='js'}Showing 0 to 0 of 0 entries{/ts}"{literal},
80 "sInfoFiltered": {/literal}"{ts escape='js'}(filtered from _MAX_ total entries){/ts}"{literal},
81 "sSearch": {/literal}"{ts escape='js'}Search:{/ts}"{literal},
83 "sFirst": {/literal}"{ts escape='js'}First{/ts}"{literal},
84 "sPrevious": {/literal}"{ts escape='js'}Previous{/ts}"{literal},
85 "sNext": {/literal}"{ts escape='js'}Next{/ts}"{literal},
86 "sLast": {/literal}"{ts escape='js'}Last{/ts}"{literal}
89 "fnDrawCallback": function() { setSelectorClass(); },
90 "fnServerData": function ( sSource, aoData, fnCallback ) {
91 aoData.push( {name:'contact_id', value: {/literal}{$contactId}{literal}},
92 {name:'admin', value: {/literal}'{$admin}'{literal}}
100 "success": fnCallxback,
102 "dataFilter": function(data, type) { return data.replace(/[\n\v\t]/g, " "); }
108 function setSelectorClass( ) {
109 cj('#contact-mailing-selector' + ' td:last-child').each( function( ) {
110 cj(this).parent().addClass(cj(this).text() );