]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/modules/UpgradeWizard/upgradeWizard.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / modules / UpgradeWizard / upgradeWizard.js
1 /*********************************************************************************
2  * SugarCRM Community Edition is a customer relationship management program developed by
3  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
4  * 
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Affero General Public License version 3 as published by the
7  * Free Software Foundation with the addition of the following permission added
8  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
9  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
10  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
11  * 
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
15  * details.
16  * 
17  * You should have received a copy of the GNU Affero General Public License along with
18  * this program; if not, see http://www.gnu.org/licenses or write to the Free
19  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301 USA.
21  * 
22  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
23  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
24  * 
25  * The interactive user interfaces in modified source and object code versions
26  * of this program must display Appropriate Legal Notices, as required under
27  * Section 5 of the GNU Affero General Public License version 3.
28  * 
29  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
30  * these Appropriate Legal Notices must retain the display of the "Powered by
31  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
32  * technical reasons, the Appropriate Legal Notices must display the words
33  * "Powered by SugarCRM".
34  ********************************************************************************/
35
36
37
38 var req;
39 var uw_check_msg = "";
40 //var uw_check_type = '';
41 var find_done = false;
42
43 function loadXMLDoc(url) {
44         req = false;
45     // branch for native XMLHttpRequest object
46     if(window.XMLHttpRequest) {
47         try {
48                         req = new XMLHttpRequest();
49         } catch(e) {
50                         req = false;
51         }
52     // branch for IE/Windows ActiveX version
53     } else if(window.ActiveXObject) {
54         try {
55                 req = new ActiveXObject("Msxml2.XMLHTTP");
56         } catch(e) {
57                 try {
58                         req = new ActiveXObject("Microsoft.XMLHTTP");
59                 } catch(e) {
60                         req = false;
61                 }
62                 }
63     }
64     
65         if(req) {
66                 req.onreadystatechange = processReqChange;
67                 req.open("GET", url, true);
68                 req.send("");
69         }
70 }
71
72
73
74
75 ///// preflight scripts
76 function preflightToggleAll(cb) {
77         var checkAll = false;
78         var form = document.getElementById('diffs');
79         
80         if(cb.checked == true) {
81                 checkAll = true;
82         }
83         
84         for(i=0; i<form.elements.length; i++) {
85                 if(form.elements[i].type == 'checkbox') {
86                         form.elements[i].checked = checkAll;
87                 }
88         }
89         return;
90 }
91
92
93 function checkSqlStatus(done) {
94         var schemaSelect = document.getElementById('select_schema_change');
95         var hideShow = document.getElementById('show_sql_run');
96         var hideShowCB = document.getElementById('sql_run');
97         var nextButton = document.getElementById('next_button');
98         var schemaMethod = document.getElementById('schema');
99         document.getElementById('sql_run').checked = false;
100         
101         if(schemaSelect.options[schemaSelect.selectedIndex].value == 'manual' && done == false) {
102                 hideShow.style.display = 'block';
103                 nextButton.style.display = 'none';
104                 hideShowCB.disabled = false;
105                 schemaMethod.value = 'manual';
106         } else {
107                 if(done == true) {
108                         hideShowCB.checked = true;
109                         hideShowCB.disabled = true;
110                 } else {
111                         hideShow.style.display = 'none';
112                 }
113                 nextButton.style.display = 'inline';
114                 schemaMethod.value = 'sugar';
115         }
116 }
117
118
119 function toggleDisplay(targ) {
120         target = document.getElementById("targ");
121         if(target.style.display == 'none') {
122                 target.style.display = '';
123         } else {
124                 target.style.display = 'none';
125         }
126 }
127
128 function verifyMerge(cb) {
129         if(cb.value == 'sugar') {
130                 var challenge = "{$mod_strings['LBL_UW_OVERWRITE_DESC']}";
131                 var answer = confirm(challenge);
132                 
133                 if(!answer) {
134                         cb.options[0].selected = true;
135                 }
136         }
137 }