Merge pull request #16008 from civicrm/5.20
[civicrm-core.git] / templates / CRM / Price / Form / Option.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10 <div class="crm-form-block">
11 {if $action eq 8}
12 <div class="messages status no-popup">
13 <div class="icon inform-icon"></div>
14 {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}
15 </div>
16 {else}
17 <table class="form-layout">
18 {if $showMember}
19 <tr class="crm-price-option-form-block-membership_type_id">
20 <td class="label">{$form.membership_type_id.label}</td>
21 <td>{$form.membership_type_id.html}
22 <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>
23 </tr>
24 <tr class="crm-price-option-form-block-membership_num_terms">
25 <td class="label">{$form.membership_num_terms.label}</td>
26 <td>{$form.membership_num_terms.html}
27 <br /> <span class="description">{ts}You can set this to a number other than one to allow multiple membership terms.{/ts}</span></td>
28 </tr>
29 {/if}
30 <tr class="crm-price-option-form-block-label">
31 <td class="label">{$form.label.label}</td>
32 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='label' id=$optionId}{/if}{$form.label.html}</td>
33 </tr>
34 <tr class="crm-price-option-form-block-amount">
35 <td class="label">{$form.amount.label}</td>
36 <td>{$form.amount.html}</td>
37 </tr>
38 <tr class="crm-price-option-form-block-non-deductible-amount">
39 <td class="label">{$form.non_deductible_amount.label}</td>
40 <td>{$form.non_deductible_amount.html}</td>
41 </tr>
42 <tr class="crm-price-option-form-block-description">
43 <td class="label">{$form.description.label}</td>
44 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='description' id=$optionId}{/if}{$form.description.html}</td>
45 </tr>
46 <tr class="crm-price-option-form-block-help-pre">
47 <td class="label">{$form.help_pre.label}</td>
48 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='help_pre' id=$optionId}{/if}{$form.help_pre.html}</td>
49 </tr>
50 <tr class="crm-price-option-form-block-help-post">
51 <td class="label">{$form.help_post.label}</td>
52 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='help_post' id=$optionId}{/if}{$form.help_post.html}</td>
53 </tr>
54 <tr class="crm-price-option-form-block-financial-type">
55 <td class="label">{$form.financial_type_id.label}</td>
56 <td>
57 {if !$financialType }
58 {capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture}
59 {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}
60 {else}
61 {$form.financial_type_id.html}
62 {/if}
63 </td>
64 </tr>
65 {* fix for CRM-10241 *}
66 {if $form.count.html}
67 <tr class="crm-price-option-form-block-count">
68 <td class="label">{$form.count.label}</td>
69 <td>{$form.count.html} {help id="id-participant-count" file="CRM/Price/Page/Field.hlp"}</td>
70 </tr>
71 {* 2 line fix for CRM-10241 *}
72 {/if}
73 {if $form.max_value.html}
74 <tr class="crm-price-option-form-block-max_value">
75 <td class="label">{$form.max_value.label}</td>
76 <td>{$form.max_value.html} {help id="id-participant-max" file="CRM/Price/Page/Field.hlp"}</td>
77 </tr>
78 {* fix for CRM-10241 *}
79 {/if}
80 <tr class="crm-price-option-form-block-weight">
81 <td class="label">{$form.weight.label}</td>
82 <td>{$form.weight.html}</td>
83 </tr>
84 <tr class="crm-price-option-form-block-is_active">
85 <td class="label">{$form.is_active.label}</td>
86 <td>{$form.is_active.html}</td>
87 {if !$hideDefaultOption}
88 <tr class="crm-price-option-form-block-is_default">
89 <td class="label">{$form.is_default.label}</td>
90 <td>{$form.is_default.html}</td>
91 </tr>
92 {/if}
93 <tr class="crm-price-field-form-block-visibility_id">
94 <td class="label">{$form.visibility_id.label}</td>
95 <td>&nbsp;{$form.visibility_id.html} {help id="id-visibility-options" file="CRM/Price/Page/Field.hlp"}</td>
96 </tr>
97 </table>
98
99 {literal}
100 <script type="text/javascript">
101
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 );
108
109 }, 'json');
110 }
111 {/literal}
112 </script>
113 {/if}
114
115
116 <div class="crm-submit-buttons">
117 {include file="CRM/common/formButtons.tpl"}
118 </div>
119
120 </div>