Commit | Line | Data |
---|---|---|
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 | *} | |
26 | {* Included in Custom/Form/Field.tpl - used for fields with multiple choice options. *} | |
27 | <tr> | |
28 | <td class="label">{$form.option_type.label}</td> | |
29 | <td class="html-adjust">{$form.option_type.html}<br /> | |
30 | <span class="description">{ts}You can create new multiple choice options for this field, or select an existing set of options which you've already created for another custom field.{/ts}</span> | |
31 | </td> | |
32 | </tr> | |
33 | ||
34 | <tr id="option_group" {if !$form.option_group_id}class="hiddenElement"{/if}> | |
35 | <td class="label">{$form.option_group_id.label}</td> | |
36 | <td class="html-adjust">{$form.option_group_id.html}</td> | |
37 | </tr> | |
38 | ||
39 | <tr id="multiple"> | |
40 | <td colspan="2" class="html-adjust"> | |
41 | <fieldset><legend>{ts}Multiple Choice Options{/ts}</legend> | |
42 | <span class="description"> | |
43 | {ts}Enter up to ten (10) 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 Multiple Choice Options link after saving this new field. If desired, you can mark one of the choices as the default choice. The option 'label' is displayed on the form, while the option 'value' is stored in the contact record. The label and value may be the same or different. Inactive options are hidden when the field is presented.{/ts} | |
44 | </span> | |
45 | {strip} | |
46 | <table id="optionField"> | |
47 | <tr> | |
48 | <th> </th> | |
49 | <th> {ts}Default{/ts}</th> | |
50 | <th> {ts}Label{/ts}</th> | |
51 | <th> {ts}Value{/ts}</th> | |
52 | <th> {ts}Weight{/ts}</th> | |
53 | <th> {ts}Active?{/ts}</th> | |
54 | </tr> | |
55 | ||
56 | {section name=rowLoop start=1 loop=12} | |
57 | {assign var=index value=$smarty.section.rowLoop.index} | |
58 | <tr id="optionField_{$index}" class="form-item {cycle values="odd-row,even-row"}"> | |
59 | <td> | |
60 | {if $index GT 1} | |
b7054e52 | 61 | <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> |
6a488035 TO |
62 | {/if} |
63 | </td> | |
64 | <td> | |
65 | <div id="radio{$index}" style="display:none"> | |
66 | {$form.default_option[$index].html} | |
67 | </div> | |
68 | <div id="checkbox{$index}" style="display:none"> | |
69 | {$form.default_checkbox_option.$index.html} | |
70 | </div> | |
71 | </td> | |
72 | <td> {$form.option_label.$index.html}</td> | |
73 | <td> {$form.option_value.$index.html}</td> | |
74 | <td> {$form.option_weight.$index.html}</td> | |
75 | <td> {$form.option_status.$index.html}</td> | |
76 | </tr> | |
77 | {/section} | |
78 | </table> | |
79 | <div id="optionFieldLink" class="add-remove-link"> | |
b7054e52 | 80 | <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> |
6a488035 TO |
81 | </div> |
82 | <span id="additionalOption" class="description"> | |
83 | {ts}If you need additional options - you can add them after you Save your current entries.{/ts} | |
84 | </span> | |
85 | {/strip} | |
86 | ||
87 | </fieldset> | |
88 | </td> | |
89 | </tr> | |
90 | <script type="text/javascript"> | |
91 | var showRows = new Array({$showBlocks}); | |
92 | var hideBlocks = new Array({$hideBlocks}); | |
93 | var rowcounter = 0; | |
94 | {literal} | |
95 | if (navigator.appName == "Microsoft Internet Explorer") { | |
96 | for ( var count = 0; count < hideBlocks.length; count++ ) { | |
97 | var r = document.getElementById(hideBlocks[count]); | |
98 | r.style.display = 'none'; | |
99 | } | |
100 | } | |
101 | {/literal} | |
102 | {* hide and display the appropriate blocks as directed by the php code *} | |
103 | on_load_init_blocks( showRows, hideBlocks, '' ); | |
104 | ||
105 | {if $form.option_group_id} | |
106 | {literal} | |
107 | function showOptionSelect( ) { | |
108 | if ( document.getElementsByName("option_type")[0].checked ) { | |
109 | cj('#multiple').show(); | |
110 | cj('#option_group').hide(); | |
111 | } else { | |
112 | cj('#multiple').hide(); | |
113 | cj('#option_group').show(); | |
114 | } | |
115 | } | |
116 | showOptionSelect( ); | |
117 | {/literal} | |
118 | {/if} | |
119 | </script> | |
120 | ||
121 |