Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {include file="CRM/common/pager.tpl" location="top"} | |
11 | ||
12 | {if $rows } | |
e53fdc3b KJ |
13 | {include file="CRM/common/jsortable.tpl"} |
14 | {strip} | |
15 | <table id="mailing_event"> | |
16 | <thead> | |
17 | <tr> | |
18 | {foreach from=$columnHeaders item=header} | |
19 | <th> | |
20 | {if $header.sort} | |
21 | {assign var='key' value=$header.sort} | |
22 | {$sort->_response.$key.link} | |
23 | {else} | |
24 | {$header.name} | |
25 | {/if} | |
26 | </th> | |
27 | {/foreach} | |
28 | </tr> | |
29 | </thead> | |
30 | {counter start=0 skip=1 print=false} | |
31 | {foreach from=$rows item=row} | |
32 | <tr class="{cycle values="odd-row,even-row"}"> | |
33 | {foreach from=$row item=value} | |
34 | <td>{$value}</td> | |
35 | {/foreach} | |
36 | </tr> | |
37 | {/foreach} | |
38 | </table> | |
39 | {/strip} | |
6a488035 | 40 | {else} |
e53fdc3b KJ |
41 | <div class="messages status no-popup"> |
42 | <div class="icon inform-icon"></div> | |
43 | | |
44 | {ts 1=$title}There are currently no %1.{/ts} | |
45 | </div> | |
46 | {/if} | |
6a488035 | 47 | |
e53fdc3b | 48 | <div class="action-link"> |
08293aff | 49 | <a href="{$backUrl}"><i class="crm-i fa-chevron-left"></i> {$backUrlTitle}</a> |
e53fdc3b | 50 | </div> |
6a488035 TO |
51 | |
52 | {include file="CRM/common/pager.tpl" location="bottom"} | |
53 | ||
54 | {if $pager and ( $pager->_totalPages > 1 )} | |
55 | {literal} | |
e53fdc3b KJ |
56 | <script type="text/javascript"> |
57 | var totalPages = {/literal}{$pager->_totalPages}{literal}; | |
3cc60a06 | 58 | CRM.$(function($) { |
ae8f569f | 59 | $("#crm-container .crm-pager input.crm-form-submit").click(function () { |
e53fdc3b KJ |
60 | submitPagerData(this); |
61 | }); | |
62 | }); | |
63 | ||
64 | function submitPagerData(el) { | |
65 | var urlParams = ''; | |
66 | var jumpTo = cj(el).parent().children('input[type=text]').val(); | |
67 | if (parseInt(jumpTo) == "Nan") { | |
68 | jumpTo = 1; | |
69 | } | |
70 | if (jumpTo > totalPages) { | |
71 | jumpTo = totalPages; | |
72 | } | |
73 | {/literal} | |
6a488035 | 74 | {foreach from=$pager->_linkData item=val key=k } |
e53fdc3b KJ |
75 | {if $k neq 'crmPID' && $k neq 'force' && $k neq 'q' } |
76 | {literal} | |
6a488035 | 77 | urlParams += '&{/literal}{$k}={$val}{literal}'; |
e53fdc3b KJ |
78 | {/literal} |
79 | {/if} | |
6a488035 TO |
80 | {/foreach} |
81 | {literal} | |
e53fdc3b | 82 | urlParams += '&crmPID=' + parseInt(jumpTo); |
6a488035 | 83 | var submitUrl = {/literal}'{crmURL p="civicrm/mailing/report/event" q="force=1" h=0 }'{literal}; |
e53fdc3b KJ |
84 | document.location = submitUrl + urlParams; |
85 | } | |
86 | </script> | |
6a488035 | 87 | {/literal} |
232624b1 | 88 | {/if} |