Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
232624b1 | 3 | | CiviCRM version 4.4 | |
6a488035 TO |
4 | +--------------------------------------------------------------------+ |
5 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
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 | <div class="crm-block crm-form-block crm-custom-field-form-block"> | |
27 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> | |
28 | <div class='status'><div class="icon inform-icon"></div> | |
29 | {ts}Warning: This functionality is currently in beta stage. Consider backing up your database before using it. Click "Cancel" to return to the "edit custom field" form without making changes.{/ts} | |
30 | </div> | |
31 | <table class="form-layout"> | |
32 | <tr class="crm-custom-src-field-form-block-label"> | |
33 | <td class="label">{$form.src_html_type.label}</td> | |
34 | <td class="html-adjust">{$form.src_html_type.html}</td> | |
35 | </tr> | |
36 | <tr class="crm-custom-dst-field-form-block-label"> | |
37 | <td class="label">{$form.dst_html_type.label}</td> | |
38 | <td class="html-adjust">{$form.dst_html_type.html}</td> | |
39 | </tr> | |
40 | </table> | |
41 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> | |
42 | </div> | |
43 | {literal} | |
44 | <script type="text/Javascript"> | |
45 | var srcHtmlType = '{/literal}{$srcHtmlType}{literal}'; | |
46 | var singleValOps = new Array('Text', 'Select', 'Radio', 'Autocomplete-Select'); | |
47 | var multiValOps = new Array('CheckBox', 'Multi-Select', 'AdvMulti-Select'); | |
48 | function checkCustomDataField( ) { | |
49 | var dstHtmlType = cj('#dst_html_type').val( ); | |
50 | if ( !dstHtmlType ) { | |
51 | return true; | |
52 | } | |
53 | ||
54 | if ( ( cj.inArray(srcHtmlType, multiValOps) > -1 ) && | |
55 | ( cj.inArray(dstHtmlType, singleValOps) > -1 ) ) { | |
56 | return confirm( "{/literal}{ts escape='js'}Changing a 'multi option' html type to a 'single option' html type, might results in a data loss. Please consider to take db backup before change the html type. Click 'Ok' to continue.{/ts}{literal}" ); | |
57 | } | |
58 | return true; | |
59 | } | |
60 | </script> | |
61 | {/literal} | |
62 |