2 //if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
40 global $sugar_version, $js_custom_version;
41 if( !isset( $install_script ) || !$install_script ){
42 die('Unable to process script directly.');
45 // setup session variables (and their defaults) if this page has not yet been submitted
46 if(!isset($_SESSION['license_submitted']) || !$_SESSION['license_submitted']){
47 $_SESSION['setup_license_accept'] = false;
50 $checked = (isset($_SESSION['setup_license_accept']) && !empty($_SESSION['setup_license_accept'])) ? 'checked="on"' : '';
52 require_once("install/install_utils.php");
53 $license_file = getLicenseContents("LICENSE.txt");
54 $langHeader = get_language_header();
56 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
59 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
60 <meta http-equiv="Content-Style-Type" content="text/css">
61 <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_LICENSE_ACCEPTANCE']}</title>
62 <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
63 <link rel="stylesheet" href="install/install.css" type="text/css">
64 <script src="cache/include/javascript/sugar_grp1_yui.js?s={$sugar_version}&c={$js_custom_version}"></script>
65 <script type="text/javascript">
71 <link rel='stylesheet' type='text/css' href='include/javascript/yui/build/container/assets/container.css' />
72 <script type="text/javascript" src="install/license.js"></script>
75 <body onload="javascript:toggleNextButton();document.getElementById('button_next2').focus();">
77 <form action="install.php" method="post" name="setConfig" id="form">
78 <form action="welcome.php" method="post" name="setLang" id="langForm">
79 <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
80 <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
84 <img src="{$sugar_md}" alt="SugarCRM" border="0">
86 {$mod_strings['LBL_LICENSE_ACCEPTANCE']}</th>
87 <th width="200" height="30" style="text-align: right;"><a href="http://www.sugarcrm.com" target="_blank">
88 <IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a>
93 <textarea cols="80" rows="20" readonly>{$license_file}</textarea>
99 <input type="checkbox" class="checkbox" name="setup_license_accept" id="button_next2" onClick='toggleNextButton();' {$checked} />
100 <a href='javascript:void(0)' onClick='toggleLicenseAccept();toggleNextButton();'>{$mod_strings['LBL_LICENSE_I_ACCEPT']}</a>
103 <input type="button" class="button" name="print_license" id="button_print_license" value="{$mod_strings['LBL_LICENSE_PRINTABLE']}"
104 onClick='window.open("install.php?page=licensePrint&language={$current_language}");' />
108 <td align="right" colspan="2">
110 <input type="hidden" name="current_step" value="{$next_step}">
111 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
114 <input class="acceptButton" type="button" name="goto" value="{$mod_strings['LBL_BACK']}" id="button_back_license" onclick="document.getElementById('form').submit();" />
115 <input class="acceptButton" type="button" name="goto" value="{$mod_strings['LBL_NEXT']}" id="button_next" disabled="disabled" onclick="callSysCheck();"/>
116 <input type="hidden" name="goto" id='hidden_goto' value="{$mod_strings['LBL_BACK']}" />
129 function callSysCheck(){
131 //begin main function that will be called
132 ajaxCall = function(msg_panel){
133 //create success function for callback
135 getPanel = function() {
136 var args = { width:"300px",
139 constraintoviewport: false,
144 effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:.5}
146 msg_panel = new YAHOO.widget.Panel('p_msg', args);
147 //If we haven't built our panel using existing markup,
148 //we can set its content via script:
149 msg_panel.setHeader("{$mod_strings['LBL_LICENSE_CHKENV_HEADER']}");
150 msg_panel.setBody(document.getElementById("checkingDiv").innerHTML);
151 msg_panel.render(document.body);
152 msgPanel = msg_panel;
156 passed = function(url){
157 document.setConfig.goto.value="{$mod_strings['LBL_NEXT']}";
158 document.getElementById('hidden_goto').value="{$mod_strings['LBL_NEXT']}";
159 document.setConfig.current_step.value="{$next_step}";
160 document.setConfig.submit();
163 success = function(o) {
164 if (o.responseText.indexOf('passed')>=0){
165 if ( YAHOO.util.Selector.query('button', 'p_msg', true) != null )
166 YAHOO.util.Selector.query('button', 'p_msg', true).style.display = 'none';
167 scsbody = "<table cellspacing='0' cellpadding='0' border='0' align='center'><tr><td>";
168 scsbody += "<p>{$mod_strings['LBL_LICENSE_CHECK_PASSED']}</p>";
169 scsbody += "<div id='cntDown'>{$mod_strings['LBL_THREE']}</div>";
170 scsbody += "</td></tr></table>";
171 scsbody += "<script>countdown(3);<\/script>";
172 msgPanel.setBody(scsbody);
175 window.setTimeout('passed("install.php?goto=next")', 2500);
178 //turn off loading message
180 document.getElementById('sysCheckMsg').style.display = '';
181 document.getElementById('licenseDiv').style.display = 'none';
182 document.getElementById('sysCheckMsg').innerHTML=o.responseText;
188 //set loading message and create url
189 postData = "checkInstallSystem=true&to_pdf=1&sugar_body_only=1";
191 //if this is a call already in progress, then just return
192 if(typeof ajxProgress != 'undefined'){
198 var ajxProgress = YAHOO.util.Connect.asyncRequest('POST','install.php', {success: success, failure: success}, postData);
201 };//end ajaxCall method
206 function countdown(num){
207 scsbody = "<table cellspacing='0' cellpadding='0' border='0' align='center'><tr><td>";
208 scsbody += "<p>{$mod_strings['LBL_LICENSE_CHECK_PASSED']}</p>";
209 scsbody += "<div id='cntDown'>{$mod_strings['LBL_LICENSE_REDIRECT']}"+num+"</div>";
210 scsbody += "</td></tr></table>";
211 msgPanel.setBody(scsbody);
215 setTimeout("countdown("+num+")",1000);
221 <div id="checkingDiv" style="display:none">
222 <table cellspacing="0" cellpadding="0" border="0">
224 <p><img src='install/processing.gif' alt="{$mod_strings['LBL_LICENSE_CHECKING']}"> <br>{$mod_strings['LBL_LICENSE_CHECKING']}</p>
229 <div id='sysCheckMsg'><div>