commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / templates / CRM / Contribute / Form / ContributionPage / AddProduct.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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">
29 <div id="help">
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 }
52 {capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture}
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}
54 {else}
55 {$form.financial_type_id.html}{help id="id-financial_type-product"}
56 {/if}
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
75 <script type="text/javascript">
76 {literal}
77
78 CRM.$(function($) {
79
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);
92 }
93
94 }
95 });
96
97 }
98 getFinancialType();
99
100 $("#product_id").change(getFinancialType);
101 });
102 {/literal}
103 </script>