<commit_before>{* We need this reference for the js injection below *}
{assign var=csv value="_qf_"|cat:$form.formName|cat:"_submit_csv"}

{* The nbps; are a mimic of what other buttons do in templates/CRM/Report/Form/Actions.tpl *}
{assign var=excel value="_qf_"|cat:$form.formName|cat:"_submit_excel"}
{$form.$excel.html}&nbsp;&nbsp;

{literal}
  <script>
    cj(function() {
      var form_id = '{/literal}{$form.$excel.id}{literal}';
      var $dest = cj('input#{/literal}{$form.$csv.id}{literal}').parent();
      cj('input#' + form_id).appendTo($dest);
    });<commit_msg>fixes #4: avoid JS errso in CiviCRM 4.7<commit_after>{* We need this reference for the js injection below *}
{assign var=csv value="_qf_"|cat:$form.formName|cat:"_submit_csv"}

{* The nbps; are a mimic of what other buttons do in templates/CRM/Report/Form/Actions.tpl *}
{assign var=excel value="_qf_"|cat:$form.formName|cat:"_submit_excel"}
{$form.$excel.html}&nbsp;&nbsp;

{literal}
  <script>
    CRM.$(function($) {
      var form_id = '{/literal}{$form.$excel.id}{literal}';

      {/literal}
        {* CiviCRM 4.6 *}
        {if $form.$csv.id}
          {literal}
            var $dest = $('input#{/literal}{$form.$csv.id}{literal}').parent();
            $('input#' + form_id).appendTo($dest);
          {/literal}
        {else}
          {* CiviCRM 4.7+ *}
          {literal}
            if ($('.crm-report-field-form-block .crm-submit-buttons').size() > 0) {
              $('input#' + form_id).appendTo('.crm-report-field-form-block .crm-submit-buttons');
            }
            else {
              // Do not show the button when running in a dashlet
              // FIXME: we should probably just not add the HTML in the first place.
              $('input#' + form_id).hide();
            }
          {/literal}
        {/if}
      {literal}
    });
{'fraction_non_alphanumeric': 0.18083378451543042, 'fraction_numerical': 0.004331348132106118, 'mean_word_length': 2.688622754491018, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5320998', 'n_tokens_mistral': 644, 'n_tokens_neox': 624, 'n_words': 134}