Add.tpl 1.45 KB
Newer Older
1
{* HEADER *}
2
3
4
5
6
7
8
9
10
11
12
13
14
{foreach from=$fieldNames item=fieldName}
<div class="crm-section">
    <div class="label">{$form.$fieldName.label}</div>
    <div class="content">
      {if in_array($fieldName, array('unit_price', 'line_total', 'tax_amount'))}
        {$currency}
      {/if}
      <span>{$form.$fieldName.html}</span>
    </div>
    <div class="clear"></div>
</div>
{/foreach}

15
16
17
18
{* FOOTER *}
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

{literal}
  <script type="text/javascript">
    CRM.$(function($) {
      var $form = $('form.{/literal}{$form.formClass}{literal}');
      $('#price_field_value_id', $form).change(function() {
        var price_field_value_id = $(this).val();
        var priceFieldDataURL =  CRM.url('civicrm/ajax/get-pricefield-info', { pfv_id:  price_field_value_id });
        $.ajax({
          url         : priceFieldDataURL,
          dataType    : "json",
          timeout     : 5000, //Time in milliseconds
          success     : function(data, status) {
            for (var ele in data) {
              if (ele == 'financial_type_id') {
                $('#' + ele).select2('val', data[ele]);
              }
              else {
                $('#' + ele, $form).val(data[ele]);
              }
            }
          }
        });
      });
    });
  </script>
{/literal}
46

47
{include file="CRM/Lineitemedit/Form/CalculateLineItemFields.tpl"}
48
49

{include file="CRM/EFT/AddChapterFundCode.tpl"}