Merge pull request #16938 from civicrm/5.24
[civicrm-core.git] / templates / CRM / Report / Form / Actions.tpl
CommitLineData
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{if !$printOnly} {* NO print section starts *}
11
b69e578b 12 {* build the print pdf buttons *}
b69e578b 13 <div class="crm-tasks">
b69e578b
CW
14 {assign var=group value="_qf_"|cat:$form.formName|cat:"_submit_group"}
15 {assign var=chart value="_qf_"|cat:$form.formName|cat:"_submit_chart"}
16 <table style="border:0;">
17 <tr>
18 <td>
19 <table class="form-layout-compressed">
20 <tr>
87ecd5b7 21 {include file="CRM/common/tasks.tpl" location="botton"}
b69e578b
CW
22 {if $instanceUrl}
23 <td>&nbsp;&nbsp;&raquo;&nbsp;<a href="{$instanceUrl}">{ts}Existing report(s) from this template{/ts}</a></td>
24 {/if}
25 </tr>
26 </table>
27 </td>
28 <td>
29 <table class="form-layout-compressed" align="right">
30 {if $chartSupported}
31 <tr>
32 <td>{$form.charts.html|crmAddClass:big}</td>
33 <td align="right">{$form.$chart.html}</td>
34 </tr>
35 {/if}
36 {if $form.groups}
37 <tr>
38 <td>
39 {$form.groups.html}{$form.$group.html}
40 <script type="text/javascript">
41 {literal}
42 (function($) {
43 $('#groups').val('').change(function() {
44 CRM.confirm({
45 message: ts({/literal}'{ts escape='js' 1='<em>%1</em>'}Add all contacts to %1 group?{/ts}'{literal}, {1: $('option:selected', '#groups').text()})
46 })
47 .on({
48 'crmConfirm:yes': function() {
49 $('#groups').siblings(':submit').click();
50 },
51 'crmConfirm:no dialogclose': function() {
52 $('#groups').select2('val', '');
53 }
54 });
55 });
56 })(CRM.$);
57 {/literal}
58 </script>
59 </td>
60 </tr>
61 {/if}
62 </table>
63 </td>
64 </tr>
65 </table>
66 </div>
6a488035 67
b69e578b
CW
68{literal}
69 <script type="text/javascript">
22b67281
CW
70 CRM.$(function($) {
71 // Disable print/pdf output of charts
72 $('select[name=charts]', 'form.crm-report-form').change(function() {
73 var viewType = $(this).val(),
74 flashChartType = '{/literal}{if $chartType}{$chartType}{else}{/if}{literal}';
75 $('#_qf_Summary_submit_pdf, #_qf_Summary_submit_print').prop('disabled', (viewType && flashChartType != viewType));
76 });
77 });
b69e578b
CW
78 </script>
79{/literal}
6a488035 80{/if} {* NO print section ends *}