Change 'help' id to a class
[civicrm-core.git] / templates / CRM / Contribute / Form / ContributionPage / AddProduct.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
2c4c49ca 3 | CiviCRM version 4.7 |
6a488035 4 +--------------------------------------------------------------------+
e7112fa7 5 | Copyright CiviCRM LLC (c) 2004-2015 |
6a488035
TO
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{capture assign=managePremiumsURL}{crmURL p='civicrm/admin/contribute/managePremiums' q="reset=1"}{/capture}
27<h3>{if $action eq 2 }{ts}Add Products to This Page{/ts} {elseif $action eq 1024}{ts}Preview{/ts}{else} {ts}Remove Products from this Page{/ts}{/if}</h3>
28<div class="crm-block crm-form-block crm-contribution-add_product-form-block">
f6eedce7 29 <div class="help">
6a488035
TO
30 {if $action eq 1024}
31 {ts}This is a preview of this product as it will appear on your Contributions page(s).{/ts}
32 {else}
33 {ts}Use this form to select a premium to be offered on this Online Contribution Page.{/ts}
34 {/if}
35 </div>
36
37 {if $action eq 8}
38 <div class="messages status no-popup">
39 <div class="icon inform-icon"></div>
40 {ts}Are you sure you want to remove this premium product from this Contribution page?{/ts}
41 </div>
42 {elseif $action eq 1024}
43 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl"}
44 {else}
45 <table class="form-layout-compressed">
46 <tr class="crm-contribution-form-block-product_id"><td class="label">{$form.product_id.label}</td><td class="html-adjust">{$form.product_id.html}<br />
47 <span class="description">{ts 1=$managePremiumsURL}Pick a premium to include on this Contribution Page. Use <a href='%1'>Manage Premiums</a> to create or enable additional premium choices for your site.{/ts}</span></td></tr>
48 <tr class="crm-contribution-form-block-financial_type">
49 <td class="label">{$form.financial_type_id.label}</td>
50 <td>
51 {if !$financialType }
b2603e29 52 {capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture}
6a488035 53 {ts 1=$ftUrl}There are no financial types configured with linked 'Cost of Sales Premiums' and 'Premiums Inventory Account' accounts. If you want to generate accounting transactions which track the cost of premiums used <a href='%1'>click here</a> to configure financial types and accounts.{/ts}
b2603e29 54 {else}
6a488035 55 {$form.financial_type_id.html}{help id="id-financial_type-product"}
b2603e29 56 {/if}
6a488035
TO
57 </td>
58 </tr>
59 <tr class="crm-contribution-form-block-weight"><td class="label">{$form.weight.label}</td><td class="html-adjust">{$form.weight.html}<br />
60 <span class="description">{ts}Weight controls the order that premiums are displayed on the Contribution Page.{/ts}</span></td></tr>
61 </table>
62 {/if}
63
64{if $action ne 4}
65 <div class="crm-submit-buttons">
66 {include file="CRM/common/formButtons.tpl" location="bottom"}
67 </div>
68{else}
69 <div class="crm-done-button">
70 {include file="CRM/common/formButtons.tpl"}
71 </div>
72{/if} {* $action ne view *}
73</div>
74
ae8f569f 75<script type="text/javascript">
6a488035 76{literal}
b2603e29 77
ae8f569f 78 CRM.$(function($) {
6a488035 79
ae8f569f
CW
80 function getFinancialType() {
81 var callbackURL = CRM.url('civicrm/ajax/rest', {
82 className: 'CRM_Financial_Page_AJAX',
83 fnName: 'jqFinancialType',
84 _value: $("#product_id").val()
85 });
86 $.ajax({
87 url: callbackURL,
88 success: function( data, textStatus ){
89 data = eval(data);//get json array
90 if ( data != null ) {
91 $("#financial_type_id").val(data);
ae8f569f 92 }
7f7fa13a 93
ae8f569f
CW
94 }
95 });
7f7fa13a 96
ae8f569f 97 }
b2603e29 98 getFinancialType();
6a488035 99
ae8f569f 100 $("#product_id").change(getFinancialType);
b2603e29 101});
6a488035 102{/literal}
232624b1 103</script>