Merge pull request #4360 from christianwach/wordpress-hooks
[civicrm-core.git] / templates / CRM / Price / Form / Option.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
819d0d41 3 | CiviCRM version 4.5 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
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*}
6a488035 26<div class="crm-form-block">
e5e8ab99
CW
27 {if $action eq 8}
28 <div class="messages status no-popup">
29 <div class="icon inform-icon"></div>
30 {ts}WARNING: Deleting this option will result in the loss of all data.{/ts} {ts}This action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
31 </div>
32 {else}
33 <table class="form-layout">
6a488035 34 {if $showMember}
e5e8ab99
CW
35 <tr class="crm-price-option-form-block-membership_type_id">
36 <td class="label">{$form.membership_type_id.label}</td>
37 <td>{$form.membership_type_id.html}
38 <br /> <span class="description">{ts}If a membership type is selected, a membership will be created or renewed when users select this option. Leave this blank if you are using this for non-membership options (e.g. magazine subscription).{/ts} {help id="id-member-price-options" file="CRM/Price/Page/Field.hlp"}</span></td>
39 </tr>
40 <tr class="crm-price-option-form-block-membership_num_terms">
41 <td class="label">{$form.membership_num_terms.label}</td>
42 <td>{$form.membership_num_terms.html}
43 <br /> <span class="description">{ts}You can set this to a number other than one to allow multiple membership terms.{/ts}</span></td>
44 </tr>
6a488035
TO
45 {/if}
46 <tr class="crm-price-option-form-block-label">
e5e8ab99
CW
47 <td class="label">{$form.label.label}</td>
48 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='label' id=$sid}{/if}{$form.label.html}</td>
49 </tr>
50 <tr class="crm-price-option-form-block-amount">
51 <td class="label">{$form.amount.label}</td>
52 <td>{$form.amount.html}</td>
53 </tr>
54 <tr class="crm-price-option-form-block-description">
55 <td class="label">{$form.description.label}</td>
56 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='description' id=$sid}{/if}{$form.description.html}</td>
57 </tr>
152ff8b9 58 <tr class="crm-price-option-form-block-financial-type">
e5e8ab99
CW
59 <td class="label">{$form.financial_type_id.label}</td>
60 <td>
61 {if !$financialType }
62 {capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture}
63 {ts 1=$ftUrl}There are no financial types configured with a linked 'Revenue Account of' account. <a href='%1'>Click here</a> if you want to configure financial types for your site.{/ts}
152ff8b9 64 {else}
e5e8ab99
CW
65 {$form.financial_type_id.html}
66 {/if}
67 </td>
68 </tr>
69 {* fix for CRM-10241 *}
70 {if $form.count.html}
71 <tr class="crm-price-option-form-block-count">
72 <td class="label">{$form.count.label}</td>
73 <td>{$form.count.html} {help id="id-participant-count" file="CRM/Price/Page/Field.hlp"}</td>
74 </tr>
75 {* 2 line fix for CRM-10241 *}
76 {/if}
77 {if $form.max_value.html}
78 <tr class="crm-price-option-form-block-max_value">
79 <td class="label">{$form.max_value.label}</td>
80 <td>{$form.max_value.html} {help id="id-participant-max" file="CRM/Price/Page/Field.hlp"}</td>
81 </tr>
82 {* fix for CRM-10241 *}
83 {/if}
84 <tr class="crm-price-option-form-block-weight">
85 <td class="label">{$form.weight.label}</td>
86 <td>{$form.weight.html}</td>
87 </tr>
88 <tr class="crm-price-option-form-block-is_active">
89 <td class="label">{$form.is_active.label}</td>
90 <td>{$form.is_active.html}</td>
91 {if !$hideDefaultOption}
6a488035 92 <tr class="crm-price-option-form-block-is_default">
e5e8ab99
CW
93 <td class="label">{$form.is_default.label}</td>
94 <td>{$form.is_default.html}</td>
95 </tr>
6a488035 96 {/if}
e5e8ab99 97 </table>
6a488035 98
e5e8ab99
CW
99 {literal}
100 <script type="text/javascript">
6a488035 101
e5e8ab99
CW
102 function calculateRowValues( ) {
103 var mtype = cj("#membership_type_id").val();
104 var postUrl = "{/literal}{crmURL p='civicrm/ajax/memType' h=0}{literal}";
105 cj.post( postUrl, {mtype: mtype}, function( data ) {
106 cj("#amount").val( data.total_amount );
107 cj("#label").val( data.name );
6a488035 108
e5e8ab99
CW
109 }, 'json');
110 }
111 {/literal}
112 </script>
113 {/if}
6a488035 114
6a488035 115
e5e8ab99
CW
116 <div class="crm-submit-buttons">
117 {include file="CRM/common/formButtons.tpl"}
118 </div>
6a488035 119
e5e8ab99 120</div>
6a488035 121