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-2012 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 ********************************************************************************/
38 global $sugar_version, $js_custom_version;
39 require_once('ModuleInstall/PackageManager/PackageManagerDisplay.php');
40 if( !isset( $install_script ) || !$install_script ){
41 die($mod_strings['ERR_NO_DIRECT_SCRIPT']);
43 ///////////////////////////////////////////////////////////////////////////////
44 //// PREFILL $sugar_config VARS
45 if(empty($sugar_config['upload_dir'])) {
46 $sugar_config['upload_dir'] = 'upload/';
48 if(empty($sugar_config['upload_maxsize'])) {
49 $sugar_config['upload_maxsize'] = 8192000;
51 if(empty($sugar_config['upload_badext'])) {
52 $sugar_config['upload_badext'] = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm');
54 //// END PREFILL $sugar_config VARS
55 ///////////////////////////////////////////////////////////////////////////////
56 require_once('include/utils/zip_utils.php');
58 require_once('include/upload_file.php');
61 ///////////////////////////////////////////////////////////////////////////////
62 //// PREP VARS FOR LANG PACK
63 $base_upgrade_dir = "upload://upgrades";
64 $base_tmp_upgrade_dir = sugar_cached("upgrades/temp");
65 ///////////////////////////////////////////////////////////////////////////////
67 ///////////////////////////////////////////////////////////////////////////////
68 //// HANDLE FILE UPLOAD AND PROCESSING
71 if(isset($_REQUEST['languagePackAction']) && !empty($_REQUEST['languagePackAction'])) {
72 switch($_REQUEST['languagePackAction']) {
76 if(isset($_REQUEST['release_id']) && $_REQUEST['release_id'] != ""){
77 require_once('ModuleInstall/PackageManager/PackageManager.php');
78 $pm = new PackageManager();
79 $tempFile = $pm->download('3', '3', $_REQUEST['release_id'], $sugar_config['upload_dir']);
81 //$base_filename = urldecode($tempFile);
83 $file = new UploadFile('language_pack');
84 if($file->confirm_upload())
86 if(strpos($file->mime_type, 'zip') !== false) { // only .zip files
87 if(langPackFinalMove($file)) {
91 $errors[] = $mod_strings['ERR_LANG_UPLOAD_3'];
94 $errors[] = $mod_strings['ERR_LANG_UPLOAD_2'];
99 if($perform) { // check for a real file
100 $uploadResult = $mod_strings['LBL_LANG_SUCCESS'];
101 $result = langPackUnpack('patch', $tempFile);
103 $errors[] = $mod_strings['ERR_LANG_UPLOAD_1'];
106 if(count($errors) > 0) {
107 foreach($errors as $error) {
108 $uploadResult .= $error."<br />";
111 break; // end 'validate'
113 $sugar_config = commitPatch();
116 removeLanguagePack();
122 //// END HANDLE FILE UPLOAD AND PROCESSING
123 ///////////////////////////////////////////////////////////////////////////////
126 ///////////////////////////////////////////////////////////////////////////////
127 //// PRELOAD DISPLAY DATA
128 $upload_max_filesize = ini_get('upload_max_filesize');
129 $upload_max_filesize_bytes = return_bytes($upload_max_filesize);
131 if(!defined('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')){
132 define('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES', 6 * 1024 * 1024);
134 if($upload_max_filesize_bytes < constant('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')) {
135 $GLOBALS['log']->debug("detected upload_max_filesize: $upload_max_filesize");
136 $fileMaxSize = '<p class="error">'.$mod_strings['ERR_UPLOAD_MAX_FILESIZE']."</p>\n";
138 $availablePatches = getLangPacks(false, array('patch'), $mod_strings['LBL_PATCH_READY']);
141 if(isset($validation_errors)) {
142 if(count($validation_errors) > 0) {
143 $errs = '<div id="errorMsgs">';
144 $errs .= "<p>{$mod_strings['LBL_SYSOPTS_ERRS_TITLE']}</p>";
147 foreach($validation_errors as $error) {
148 $errs .= '<li>' . $error . '</li>';
156 //// PRELOAD DISPLAY DATA
157 ///////////////////////////////////////////////////////////////////////////////
160 ///////////////////////////////////////////////////////////////////////////////
161 //// BEING PAGE OUTPUT
164 $langHeader = get_language_header();
166 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
169 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
170 <meta http-equiv="Content-Script-Type" content="text/javascript">
171 <meta http-equiv="Content-Style-Type" content="text/css">
172 <title>{$mod_strings['LBL_WIZARD_TITLE']} {$next_step}</title>
173 <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
174 <link rel="stylesheet" href="install/install.css" type="text/css">
175 <script type="text/javascript" src="install/installCommon.js"></script>
176 <link rel="stylesheet" type="text/css" media="all" href="jscalendar/calendar-win2k-cold-1.css?s={$sugar_version}&c={$js_custom_version}">
177 <script>jscal_today = 1161698116000; if(typeof app_strings == "undefined") app_strings = new Array();</script>
178 <script type="text/javascript" src="cache/include/javascript/sugar_grp1.js?s={$sugar_version}&c={$js_custom_version}"></script>
179 <script type="text/javascript" src="cache/include/javascript/sugar_grp1_yui.js?s={$sugar_version}&c={$js_custom_version}"></script>
180 <script type="text/javascript">
188 <body onLoad="document.getElementById('button_next2').focus();">
190 <table cellspacing="0" width="100%" cellpadding="0" border="0" align="center" class="shell">
191 <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
195 <img src="{$sugar_md}" alt="SugarCRM" border="0">
197 {$mod_strings['LBL_PATCHES_TITLE']}</th>
198 <th width="200" style="text-align: right;"><a href="http://www.sugarcrm.com" target=
199 "_blank"><IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a>
205 <p>{$mod_strings['LBL_PATCH_1']}</p>
206 <table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" class="StyleDottedHr">
208 <th colspan="2" align="left">{$mod_strings['LBL_PATCH_TITLE']}</th>
214 <form name="the_form" enctype="multipart/form-data"
215 action="install.php" method="post">
216 <input type="hidden" name="current_step" value="{$next_step}">
217 <input type="hidden" name="goto" value="{$mod_strings['LBL_CHECKSYS_RECHECK']}">
218 <input type="hidden" name="languagePackAction" value="upload">
220 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
223 <table width="450" border="0" cellspacing="0" cellpadding="0">
226 {$mod_strings['LBL_PATCH_UPLOAD']}:
231 <input type="file" name="language_pack" size="40" />
234 <input class='button' type=button value="{$mod_strings['LBL_LANG_BUTTON_UPLOAD']}" onClick="document.the_form.language_pack_escaped.value = escape( document.the_form.language_pack.value ); document.the_form.submit();"/>
235 <input type=hidden name="language_pack_escaped" value="" />
258 <!--// Available Upgrades //-->
260 <td align="left" colspan="2">
262 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
268 <td align="right" colspan="2">
270 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
271 <tr><td><form action='install.php' method='POST'>
272 <input type='hidden' name='current_step' value="{$next_step}">
273 <input type='hidden' name='goto' value="{$mod_strings['LBL_CHECKSYS_RECHECK']}">
274 <input type='hidden' name='languagePackAction' value='commit'>
275 <input type='submit' value="{$mod_strings['LBL_INSTALL']}" class='button'>
282 <td align="right" colspan="2">
284 <form name="the_form1" action="install.php" method="post">
285 <input type="hidden" name="current_step" value="{$next_step}">
286 <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
292 <input class="button" type="submit" name="goto" value="{$mod_strings['LBL_NEXT']}" id="button_next2" {$disabled} />
307 $hidden_fields = "<input type=\"hidden\" name=\"current_step\" value=\"{$next_step}\">";
308 $hidden_fields .= "<input type=\"hidden\" name=\"goto\" value=\"{$mod_strings['LBL_CHECKSYS_RECHECK']}\">";
309 $hidden_fields .= "<input type=\"hidden\" name=\"languagePackAction\" value=\"upload\">";
310 $form2 = PackageManagerDisplay::buildPatchDisplay($form, $hidden_fields, 'install.php', array('patch'));
312 echo $out.$form2.$out1;
314 //unlinkTempFiles('','');
316 ///////////////////////////////////////////////////////////////////////////////