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 | {include file="CRM/common/pager.tpl" location="top"} | |
27 | ||
28 | {if $rows } | |
e53fdc3b KJ |
29 | {include file="CRM/common/jsortable.tpl"} |
30 | {strip} | |
31 | <table id="mailing_event"> | |
32 | <thead> | |
33 | <tr> | |
34 | {foreach from=$columnHeaders item=header} | |
35 | <th> | |
36 | {if $header.sort} | |
37 | {assign var='key' value=$header.sort} | |
38 | {$sort->_response.$key.link} | |
39 | {else} | |
40 | {$header.name} | |
41 | {/if} | |
42 | </th> | |
43 | {/foreach} | |
44 | </tr> | |
45 | </thead> | |
46 | {counter start=0 skip=1 print=false} | |
47 | {foreach from=$rows item=row} | |
48 | <tr class="{cycle values="odd-row,even-row"}"> | |
49 | {foreach from=$row item=value} | |
50 | <td>{$value}</td> | |
51 | {/foreach} | |
52 | </tr> | |
53 | {/foreach} | |
54 | </table> | |
55 | {/strip} | |
6a488035 | 56 | {else} |
e53fdc3b KJ |
57 | <div class="messages status no-popup"> |
58 | <div class="icon inform-icon"></div> | |
59 | | |
60 | {ts 1=$title}There are currently no %1.{/ts} | |
61 | </div> | |
62 | {/if} | |
6a488035 | 63 | |
e53fdc3b | 64 | <div class="action-link"> |
01c22255 | 65 | <a href="{$backUrl}">» {$backUrlTitle}</a> |
e53fdc3b | 66 | </div> |
6a488035 TO |
67 | |
68 | {include file="CRM/common/pager.tpl" location="bottom"} | |
69 | ||
70 | {if $pager and ( $pager->_totalPages > 1 )} | |
71 | {literal} | |
e53fdc3b KJ |
72 | <script type="text/javascript"> |
73 | var totalPages = {/literal}{$pager->_totalPages}{literal}; | |
74 | cj(function () { | |
75 | cj("#crm-container .crm-pager input.form-submit").click(function () { | |
76 | submitPagerData(this); | |
77 | }); | |
78 | }); | |
79 | ||
80 | function submitPagerData(el) { | |
81 | var urlParams = ''; | |
82 | var jumpTo = cj(el).parent().children('input[type=text]').val(); | |
83 | if (parseInt(jumpTo) == "Nan") { | |
84 | jumpTo = 1; | |
85 | } | |
86 | if (jumpTo > totalPages) { | |
87 | jumpTo = totalPages; | |
88 | } | |
89 | {/literal} | |
6a488035 | 90 | {foreach from=$pager->_linkData item=val key=k } |
e53fdc3b KJ |
91 | {if $k neq 'crmPID' && $k neq 'force' && $k neq 'q' } |
92 | {literal} | |
6a488035 | 93 | urlParams += '&{/literal}{$k}={$val}{literal}'; |
e53fdc3b KJ |
94 | {/literal} |
95 | {/if} | |
6a488035 TO |
96 | {/foreach} |
97 | {literal} | |
e53fdc3b | 98 | urlParams += '&crmPID=' + parseInt(jumpTo); |
6a488035 | 99 | var submitUrl = {/literal}'{crmURL p="civicrm/mailing/report/event" q="force=1" h=0 }'{literal}; |
e53fdc3b KJ |
100 | document.location = submitUrl + urlParams; |
101 | } | |
102 | </script> | |
6a488035 TO |
103 | {/literal} |
104 | {/if} |