Commit | Line | Data |
---|---|---|
50951061 EM |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
50951061 | 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 | | |
50951061 EM |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | ||
11 | ||
12 | <div id="report-tab-order-by-elements" class="civireport-criteria"> | |
13 | <table id="optionField"> | |
14 | <tr> | |
15 | <th> </th> | |
16 | <th> {ts}Column{/ts}</th> | |
17 | <th> {ts}Order{/ts}</th> | |
18 | <th> {ts}Section Header / Group By{/ts}</th> | |
19 | <th> {ts}Page Break{/ts}</th> | |
20 | </tr> | |
21 | ||
22 | {section name=rowLoop start=1 loop=6} | |
23 | {assign var=index value=$smarty.section.rowLoop.index} | |
24 | <tr id="optionField_{$index}" class="form-item {cycle values="odd-row,even-row"}"> | |
25 | <td> | |
26 | {if $index GT 1} | |
27 | <a onclick="hideRow({$index}); return false;" name="orderBy_{$index}" href="#" class="form-link"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}hide field or section{/ts}"/></a> | |
28 | {/if} | |
29 | </td> | |
30 | <td> {$form.order_bys.$index.column.html}</td> | |
31 | <td> {$form.order_bys.$index.order.html}</td> | |
32 | <td> {$form.order_bys.$index.section.html}</td> | |
33 | <td> {$form.order_bys.$index.pageBreak.html}</td> | |
34 | </tr> | |
35 | {/section} | |
36 | </table> | |
37 | <div id="optionFieldLink" class="add-remove-link"> | |
38 | <a onclick="showHideRow(); return false;" name="optionFieldLink" href="#" class="form-link"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}show field or section{/ts}"/>{ts}another column{/ts}</a> | |
39 | </div> | |
40 | <script type="text/javascript"> | |
41 | var showRows = new Array({$showBlocks}); | |
42 | var hideBlocks = new Array({$hideBlocks}); | |
43 | var rowcounter = 0; | |
44 | {literal} | |
45 | if (navigator.appName == "Microsoft Internet Explorer") { | |
46 | for ( var count = 0; count < hideBlocks.length; count++ ) { | |
47 | var r = document.getElementById(hideBlocks[count]); | |
48 | r.style.display = 'none'; | |
49 | } | |
50 | } | |
51 | ||
52 | // hide and display the appropriate blocks as directed by the php code | |
53 | on_load_init_blocks( showRows, hideBlocks, ''); | |
54 | ||
55 | cj('input[id^="order_by_section_"]').click(disPageBreak).each(disPageBreak); | |
56 | ||
57 | function disPageBreak() { | |
58 | if (!cj(this).prop('checked')) { | |
59 | cj(this).parent('td').next('td').children('input[id^="order_by_pagebreak_"]').prop({checked: false, disabled: true}); | |
60 | } | |
61 | else { | |
62 | cj(this).parent('td').next('td').children('input[id^="order_by_pagebreak_"]').prop({disabled: false}); | |
63 | } | |
64 | } | |
65 | ||
66 | function hideRow(i) { | |
67 | showHideRow(i); | |
68 | // clear values on hidden field, so they're not saved | |
a156fb42 | 69 | cj('select#order_bys_'+ i +'_column').val('-'); |
9f448530 | 70 | cj('select#order_bys_'+ i +'_order').val('ASC'); |
50951061 EM |
71 | cj('input#order_by_section_'+ i).prop('checked', false); |
72 | cj('input#order_by_pagebreak_'+ i).prop('checked', false); | |
73 | } | |
74 | ||
75 | {/literal} | |
76 | </script> | |
77 | </div> |