Merge remote-tracking branch 'upstream/4.4' into 4.4-4.5-2014-09-29-14-51-22
[civicrm-core.git] / templates / CRM / Report / Form / Actions.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 {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}&nbsp;&nbsp;</td>
42 <td>{$form.$pdf.html}&nbsp;&nbsp;</td>
43 <td>{$form.$csv.html}&nbsp;&nbsp;</td>
44 {if $instanceUrl}
45 <td>&nbsp;&nbsp;&raquo;&nbsp;<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('crmConfirm:yes', function() {
70 $('#groups').siblings(':submit').click();
71 });
72 $('#groups').select2('val', '');
73 });
74 })(CRM.$);
75 {/literal}
76 </script>
77 </td>
78 </tr>
79 {/if}
80 </table>
81 </td>
82 </tr>
83 </table>
84 </div>
85 {/if}
86
87 {literal}
88 <script type="text/javascript">
89 var flashChartType = {/literal}{if $chartType}'{$chartType}'{else}''{/if}{literal};
90 function disablePrintPDFButtons( viewtype ) {
91 if (viewtype && flashChartType != viewtype) {
92 cj('#_qf_Summary_submit_pdf').prop('disabled', true).addClass('button-disabled');
93 cj('#_qf_Summary_submit_print').prop('disabled', true).addClass('button-disabled');
94 } else {
95 cj('#_qf_Summary_submit_pdf').prop('disabled', false).removeClass('button-disabled');
96 cj('#_qf_Summary_submit_print').prop('disabled', false).removeClass('button-disabled');
97 }
98 }
99 </script>
100 {/literal}
101 {/if} {* NO print section ends *}