fix year in headers
[civicrm-core.git] / templates / CRM / Report / Form / Actions.tpl
index ef56ae60db85a159d4189fdd588f85deeb4dbdd8..a26ba82b0ece4c39fecdf51fcebff29fc486f5f1 100644 (file)
@@ -1,8 +1,8 @@
 {*
  +--------------------------------------------------------------------+
- | 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;">
@@ -38,9 +34,7 @@
           <td>
             <table class="form-layout-compressed">
               <tr>
-                <td>{$form.$print.html}&nbsp;&nbsp;</td>
-                <td>{$form.$pdf.html}&nbsp;&nbsp;</td>
-                <td>{$form.$csv.html}&nbsp;&nbsp;</td>
+                {include file="CRM/common/tasks.tpl" location="botton"}
                 {if $instanceUrl}
                   <td>&nbsp;&nbsp;&raquo;&nbsp;<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 *}