Merge pull request #8636 from eileenmcnaughton/slow_query
[civicrm-core.git] / templates / CRM / Report / Form / Actions.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2016 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 *}
26 {if !$printOnly} {* NO print section starts *}
27
28 {* build the print pdf buttons *}
29 <div class="crm-tasks">
30 {assign var=group value="_qf_"|cat:$form.formName|cat:"_submit_group"}
31 {assign var=chart value="_qf_"|cat:$form.formName|cat:"_submit_chart"}
32 <table style="border:0;">
33 <tr>
34 <td>
35 <table class="form-layout-compressed">
36 <tr>
37 {include file="CRM/common/tasks.tpl" location="botton"}
38 {if $instanceUrl}
39 <td>&nbsp;&nbsp;&raquo;&nbsp;<a href="{$instanceUrl}">{ts}Existing report(s) from this template{/ts}</a></td>
40 {/if}
41 </tr>
42 </table>
43 </td>
44 <td>
45 <table class="form-layout-compressed" align="right">
46 {if $chartSupported}
47 <tr>
48 <td>{$form.charts.html|crmAddClass:big}</td>
49 <td align="right">{$form.$chart.html}</td>
50 </tr>
51 {/if}
52 {if $form.groups}
53 <tr>
54 <td>
55 {$form.groups.html}{$form.$group.html}
56 <script type="text/javascript">
57 {literal}
58 (function($) {
59 $('#groups').val('').change(function() {
60 CRM.confirm({
61 message: ts({/literal}'{ts escape='js' 1='<em>%1</em>'}Add all contacts to %1 group?{/ts}'{literal}, {1: $('option:selected', '#groups').text()})
62 })
63 .on({
64 'crmConfirm:yes': function() {
65 $('#groups').siblings(':submit').click();
66 },
67 'crmConfirm:no dialogclose': function() {
68 $('#groups').select2('val', '');
69 }
70 });
71 });
72 })(CRM.$);
73 {/literal}
74 </script>
75 </td>
76 </tr>
77 {/if}
78 </table>
79 </td>
80 </tr>
81 </table>
82 </div>
83
84 {literal}
85 <script type="text/javascript">
86 CRM.$(function($) {
87 // Disable print/pdf output of charts
88 $('select[name=charts]', 'form.crm-report-form').change(function() {
89 var viewType = $(this).val(),
90 flashChartType = '{/literal}{if $chartType}{$chartType}{else}{/if}{literal}';
91 $('#_qf_Summary_submit_pdf, #_qf_Summary_submit_print').prop('disabled', (viewType && flashChartType != viewType));
92 });
93 });
94 </script>
95 {/literal}
96 {/if} {* NO print section ends *}