Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
e7112fa7 | 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
6a488035 TO |
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 | ||
b69e578b CW |
28 | {* build the print pdf buttons *} |
29 | {if $rows} | |
30 | <div class="crm-tasks"> | |
31 | {assign var=print value="_qf_"|cat:$form.formName|cat:"_submit_print"} | |
32 | {assign var=pdf value="_qf_"|cat:$form.formName|cat:"_submit_pdf"} | |
33 | {assign var=csv value="_qf_"|cat:$form.formName|cat:"_submit_csv"} | |
34 | {assign var=group value="_qf_"|cat:$form.formName|cat:"_submit_group"} | |
35 | {assign var=chart value="_qf_"|cat:$form.formName|cat:"_submit_chart"} | |
36 | <table style="border:0;"> | |
37 | <tr> | |
38 | <td> | |
39 | <table class="form-layout-compressed"> | |
40 | <tr> | |
41 | <td>{$form.$print.html} </td> | |
42 | <td>{$form.$pdf.html} </td> | |
43 | <td>{$form.$csv.html} </td> | |
44 | {if $instanceUrl} | |
45 | <td> » <a href="{$instanceUrl}">{ts}Existing report(s) from this template{/ts}</a></td> | |
46 | {/if} | |
47 | </tr> | |
48 | </table> | |
49 | </td> | |
50 | <td> | |
51 | <table class="form-layout-compressed" align="right"> | |
52 | {if $chartSupported} | |
53 | <tr> | |
54 | <td>{$form.charts.html|crmAddClass:big}</td> | |
55 | <td align="right">{$form.$chart.html}</td> | |
56 | </tr> | |
57 | {/if} | |
58 | {if $form.groups} | |
59 | <tr> | |
60 | <td> | |
61 | {$form.groups.html}{$form.$group.html} | |
62 | <script type="text/javascript"> | |
63 | {literal} | |
64 | (function($) { | |
65 | $('#groups').val('').change(function() { | |
66 | CRM.confirm({ | |
67 | message: ts({/literal}'{ts escape='js' 1='<em>%1</em>'}Add all contacts to %1 group?{/ts}'{literal}, {1: $('option:selected', '#groups').text()}) | |
68 | }) | |
69 | .on({ | |
70 | 'crmConfirm:yes': function() { | |
71 | $('#groups').siblings(':submit').click(); | |
72 | }, | |
73 | 'crmConfirm:no dialogclose': function() { | |
74 | $('#groups').select2('val', ''); | |
75 | } | |
76 | }); | |
77 | }); | |
78 | })(CRM.$); | |
79 | {/literal} | |
80 | </script> | |
81 | </td> | |
82 | </tr> | |
83 | {/if} | |
84 | </table> | |
85 | </td> | |
86 | </tr> | |
87 | </table> | |
88 | </div> | |
89 | {/if} | |
6a488035 | 90 | |
b69e578b CW |
91 | {literal} |
92 | <script type="text/javascript"> | |
22b67281 CW |
93 | CRM.$(function($) { |
94 | // Disable print/pdf output of charts | |
95 | $('select[name=charts]', 'form.crm-report-form').change(function() { | |
96 | var viewType = $(this).val(), | |
97 | flashChartType = '{/literal}{if $chartType}{$chartType}{else}{/if}{literal}'; | |
98 | $('#_qf_Summary_submit_pdf, #_qf_Summary_submit_print').prop('disabled', (viewType && flashChartType != viewType)); | |
99 | }); | |
100 | }); | |
b69e578b CW |
101 | </script> |
102 | {/literal} | |
6a488035 | 103 | {/if} {* NO print section ends *} |