Merge pull request #16584 from eileenmcnaughton/role
[civicrm-core.git] / templates / CRM / Mailing / Page / Event.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
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 |
8 +--------------------------------------------------------------------+
9 *}
10 {include file="CRM/common/pager.tpl" location="top"}
11
12 {if $rows }
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}
40 {else}
41 <div class="messages status no-popup">
42 <div class="icon inform-icon"></div>
43 &nbsp;
44 {ts 1=$title}There are currently no %1.{/ts}
45 </div>
46 {/if}
47
48 <div class="action-link">
49 <a href="{$backUrl}">&raquo; {$backUrlTitle}</a>
50 </div>
51
52 {include file="CRM/common/pager.tpl" location="bottom"}
53
54 {if $pager and ( $pager->_totalPages > 1 )}
55 {literal}
56 <script type="text/javascript">
57 var totalPages = {/literal}{$pager->_totalPages}{literal};
58 CRM.$(function($) {
59 $("#crm-container .crm-pager input.crm-form-submit").click(function () {
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}
74 {foreach from=$pager->_linkData item=val key=k }
75 {if $k neq 'crmPID' && $k neq 'force' && $k neq 'q' }
76 {literal}
77 urlParams += '&{/literal}{$k}={$val}{literal}';
78 {/literal}
79 {/if}
80 {/foreach}
81 {literal}
82 urlParams += '&crmPID=' + parseInt(jumpTo);
83 var submitUrl = {/literal}'{crmURL p="civicrm/mailing/report/event" q="force=1" h=0 }'{literal};
84 document.location = submitUrl + urlParams;
85 }
86 </script>
87 {/literal}
88 {/if}