{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
{if !$printOnly} {* NO print section starts *}
{* build the print pdf buttons *}
- {if $rows}
<div class="crm-tasks">
- {assign var=print value="_qf_"|cat:$form.formName|cat:"_submit_print"}
- {assign var=pdf value="_qf_"|cat:$form.formName|cat:"_submit_pdf"}
- {assign var=csv value="_qf_"|cat:$form.formName|cat:"_submit_csv"}
{assign var=group value="_qf_"|cat:$form.formName|cat:"_submit_group"}
{assign var=chart value="_qf_"|cat:$form.formName|cat:"_submit_chart"}
<table style="border:0;">
<td>
<table class="form-layout-compressed">
<tr>
- <td>{$form.$print.html} </td>
- <td>{$form.$pdf.html} </td>
- <td>{$form.$csv.html} </td>
+ {include file="CRM/common/tasks.tpl" location="botton"}
{if $instanceUrl}
<td> » <a href="{$instanceUrl}">{ts}Existing report(s) from this template{/ts}</a></td>
{/if}
</tr>
</table>
</div>
- {/if}
{literal}
<script type="text/javascript">
- var flashChartType = {/literal}{if $chartType}'{$chartType}'{else}''{/if}{literal};
- function disablePrintPDFButtons( viewtype ) {
- if (viewtype && flashChartType != viewtype) {
- cj('#_qf_Summary_submit_pdf').prop('disabled', true).addClass('button-disabled');
- cj('#_qf_Summary_submit_print').prop('disabled', true).addClass('button-disabled');
- } else {
- cj('#_qf_Summary_submit_pdf').prop('disabled', false).removeClass('button-disabled');
- cj('#_qf_Summary_submit_print').prop('disabled', false).removeClass('button-disabled');
- }
- }
+ CRM.$(function($) {
+ // Disable print/pdf output of charts
+ $('select[name=charts]', 'form.crm-report-form').change(function() {
+ var viewType = $(this).val(),
+ flashChartType = '{/literal}{if $chartType}{$chartType}{else}{/if}{literal}';
+ $('#_qf_Summary_submit_pdf, #_qf_Summary_submit_print').prop('disabled', (viewType && flashChartType != viewType));
+ });
+ });
</script>
{/literal}
{/if} {* NO print section ends *}