Ian province abbreviation patch - issue 724
[civicrm-core.git] / templates / CRM / Custom / Form / ChangeFieldType.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
2c4c49ca 3 | CiviCRM version 4.7 |
6a488035 4 +--------------------------------------------------------------------+
e7112fa7 5 | Copyright CiviCRM LLC (c) 2004-2015 |
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<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 &nbsp;{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">
6a488035 45 function checkCustomDataField( ) {
ae8f569f
CW
46 var srcHtmlType = '{/literal}{$srcHtmlType}{literal}';
47 var singleValOps = ['Text', 'Select', 'Radio', 'Autocomplete-Select'];
48 var multiValOps = ['CheckBox', 'Multi-Select', 'AdvMulti-Select'];
6a488035
TO
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