Merge pull request #17116 from lcdservices/dev-core-1721
[civicrm-core.git] / templates / CRM / Report / Form / Actions.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 {if !$printOnly} {* NO print section starts *}
11
12 {* build the print pdf buttons *}
13 <div class="crm-tasks">
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>
21 {include file="CRM/common/tasks.tpl" location="botton"}
22 {if $instanceUrl}
23 <td>&nbsp;&nbsp;<i class="crm-i fa-chevron-right"></i>&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>
67
68 {literal}
69 <script type="text/javascript">
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 });
78 </script>
79 {/literal}
80 {/if} {* NO print section ends *}