commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / templates / CRM / Price / Form / OptionFields.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 <fieldset><legend>{if $useForMember}{ts}Membership Options{/ts}{else}{ts}Price Field Options{/ts}{/if}</legend>
27 <div class="description">
28 {if $useForMember}
29 {ts}Fill in a row for each membership type you want to offer as an option (click 'another choice' for each additional choice). Click the help icon for more info on membership price sets.{/ts} {help id="id-member-price-options"}
30 {else}
31 {ts}Enter up to fifteen (15) multiple choice options in this table (click 'another choice' for each additional choice). If you need more than ten options, you can create an unlimited number of additional choices using the Edit Price Options link after saving this new field. Enter a description of the option in the 'Label' column, and the associated price in the 'Amount' column. Click the 'Default' radio button to the left of an option if you want that to be selected by default.{/ts}
32 {/if}
33 </div>
34 {strip}
35 <table id='optionField'>
36 <tr>
37 <th>&nbsp;</th>
38 <th>{ts}Default{/ts}</th>
39 {if $useForMember}
40 <th>{ts}Membership Type{/ts} {help id="id-membership-type"}</th>
41 <th>{ts}Number of Terms{/ts}</th>
42 {/if}
43 <th>{ts}Label{/ts}</th>
44 <th>{ts}Amount{/ts} {if $useForEvent}{help id="id-negative-options"}{/if}</th>
45 <th>{ts}Financial Type{/ts}</th>
46 {if $useForEvent}
47 <th>{ts}Participant Count{/ts} {help id="id-participant-count"}</th>
48 <th>{ts}Max Participant{/ts} {help id="id-participant-max"}</th>
49 {/if}
50 <th>{ts}Order{/ts}</th>
51 <th>{ts}Active?{/ts}</th>
52 </tr>
53
54 {section name=rowLoop start=1 loop=16}
55 {assign var=index value=$smarty.section.rowLoop.index}
56 <tr id="optionField_{$index}" class="form-item {cycle values="odd-row,even-row"}">
57 <td>
58 {if $index GT 1}
59 <a onclick="showHideRow({$index}); return false;" name="optionField_{$index}" href="#" class="form-link"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}hide field or section{/ts}"/></a>
60 {/if}
61 </td>
62 <td>
63 <div id="radio{$index}" style="display:none">
64 {$form.default_option[$index].html}
65 </div>
66 <div id="checkbox{$index}" style="display:none">
67 {$form.default_checkbox_option.$index.html}
68 </div>
69 </td>
70 {if $useForMember}
71 <td>{$form.membership_type_id.$index.html}</td>
72 <td>{$form.membership_num_terms.$index.html}</td>
73 {/if}
74 <td> {$form.option_label.$index.html}</td>
75
76 <td> {$form.option_amount.$index.html}</td>
77 <td>{$form.option_financial_type_id.$index.html}</td>
78 {if $useForEvent}
79 <td>{$form.option_count.$index.html}</td>
80 <td>{$form.option_max_value.$index.html}</td>
81 {/if}
82 <td> {$form.option_weight.$index.html}</td>
83 <td> {$form.option_status.$index.html}</td>
84 </tr>
85 {/section}
86 </table>
87 <div id="optionFieldLink" class="add-remove-link">
88 <a onclick="showHideRow(); return false;" name="optionFieldLink" href="#" class="form-link"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}show field or section{/ts}"/>{ts}another choice{/ts}</a>
89 </div>
90 <div id="additionalOption" class="description">
91 {ts}If you need additional options - you can add them after you Save your current entries.{/ts}
92 </div>
93 {/strip}
94
95 </fieldset>
96 <script type="text/javascript">
97 var showRows = new Array({$showBlocks});
98 var hideBlocks = new Array({$hideBlocks});
99 var rowcounter = 0;
100 {literal}
101 if (navigator.appName == "Microsoft Internet Explorer") {
102 for ( var count = 0; count < hideBlocks.length; count++ ) {
103 var r = document.getElementById(hideBlocks[count]);
104 r.style.display = 'none';
105 }
106 }
107
108 cj('#optionField input').blur( function(){
109 var currentId = cj(this).attr('id');
110 var arrayID = currentId.split('_');
111 if ((arrayID[1] == 'label' || arrayID[1] == 'amount') && arrayID[2] > 1) {
112 var value = cj("#"+currentId).val();
113 if (value.length != 0 && cj("#option_financial_type_id_"+arrayID[2]).val() =='') {
114 var currentFtid = "#option_financial_type_id_"+arrayID[2];
115 var previousFtid = "#option_financial_type_id_"+ (arrayID[2]-1);
116 var financial_type = cj(previousFtid).val();
117 cj(currentFtid).val(financial_type);
118 }
119 if (cj("#option_label_"+arrayID[2]).val().length == 0 && cj("#option_amount_"+arrayID[2]).val().length == 0) {
120 cj("#option_financial_type_id_"+arrayID[2]).val('');
121 }
122 }
123
124 });
125
126 {/literal}
127 {* hide and display the appropriate blocks as directed by the php code *}
128 on_load_init_blocks( showRows, hideBlocks, '' );
129 </script>