|
iTx Technologies offre gratuitement
|
||
[Vue sommaire] [Imprimer] [Vue textuelle]
1 <?php 2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 3 /********************************************************************************* 4 * SugarCRM is a customer relationship management program developed by 5 * SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc. 6 * 7 * This program is free software; you can redistribute it and/or modify it under 8 * the terms of the GNU 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. 13 * 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 General Public License for more 17 * details. 18 * 19 * You should have received a copy of the GNU 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 22 * 02110-1301 USA. 23 * 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. 26 * 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 General Public License version 3. 30 * 31 * In accordance with Section 7(b) of the GNU 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 ********************************************************************************/ 37 /********************************************************************************* 38 39 * Description: 40 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. All Rights 41 * Reserved. Contributor(s): ______________________________________.. 42 * *******************************************************************************/ 43 44 if( !isset( $install_script ) || !$install_script ){ 45 die($mod_strings['ERR_NO_DIRECT_SCRIPT']); 46 } 47 /////////////////////////////////////////////////////////////////////////////// 48 //// PREFILL $sugar_config VARS 49 if(empty($sugar_config['upload_dir'])) { 50 $sugar_config['upload_dir'] = 'cache/upload/'; 51 } 52 if(empty($sugar_config['upload_maxsize'])) { 53 $sugar_config['upload_maxsize'] = 8192000; 54 } 55 if(empty($sugar_config['upload_badext'])) { 56 $sugar_config['upload_badext'] = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm'); 57 } 58 if(empty($sugar_config['date_formats'])) { 59 $sugar_config['date_formats'] = array( 'Y-m-d'=>'2010-12-23', 60 'd-m-Y' => '23-12-2010', 61 'm-d-Y'=>'12-23-2010', 62 'Y/m/d'=>'2010/12/23', 63 'd/m/Y' => '23/12/2010', 64 'm/d/Y'=>'12/23/2010', 65 'Y.m.d' => '2010.12.23', 66 'd.m.Y' => '23.12.2010', 67 'm.d.Y' => '12.23.2010' 68 ); 69 } 70 if(empty($sugar_config['time_formats'])) { 71 $sugar_config['time_formats'] = array( 'H:i'=>'23:00', 'h:ia'=>'11:00pm', 'h:iA'=>'11:00PM', 72 'H.i'=>'23.00', 'h.ia'=>'11.00pm', 'h.iA'=>'11.00PM' ); 73 } 74 if(empty($sugar_config['languages'])) { 75 // language installation will add to this array 76 $sugar_config['languages'] = array('en_us' => 'US English'); 77 } 78 if(empty($sugar_config['default_currencies'])) { 79 $sugar_config['default_currencies'] = $locale->getDefaultCurrencies(); 80 } 81 82 //// END PREFILL $sugar_config VARS 83 /////////////////////////////////////////////////////////////////////////////// 84 require_once ('include/utils/zip_utils.php'); 85 86 require_once ('include/upload_file.php'); 87 88 89 /////////////////////////////////////////////////////////////////////////////// 90 //// PREP VARS FOR LANG PACK 91 $base_upgrade_dir = $sugar_config['upload_dir'] . "upgrades"; 92 $base_tmp_upgrade_dir = $base_upgrade_dir."/temp"; 93 /////////////////////////////////////////////////////////////////////////////// 94 95 /////////////////////////////////////////////////////////////////////////////// 96 //// HANDLE FILE UPLOAD AND PROCESSING 97 $errors = array(); 98 $uploadResult = ''; 99 if(isset($_REQUEST['languagePackAction']) && !empty($_REQUEST['languagePackAction'])) { 100 switch($_REQUEST['languagePackAction']) { 101 case 'upload': 102 $file = new UploadFile('language_pack'); 103 104 if($file->confirm_upload()) { // check for a real file 105 // cn: bug 9072 - apache sometimes detects zip as binary MIME type 106 if((strpos($file->mime_type, 'binary') && strtolower($file->file_ext) == 'zip') || (strpos($file->mime_type, 'zip') !== false)) { // only .zip files 107 if(langPackFinalMove($file)) { // move file to sugar upload_dir 108 $uploadResult = $mod_strings['LBL_LANG_SUCCESS']; 109 $result = langPackUnpack(); 110 } else { 111 $errors[] = $mod_strings['ERR_LANG_UPLOAD_3']; 112 } 113 } else { 114 $errors[] = $mod_strings['ERR_LANG_UPLOAD_2']; 115 } 116 } else { 117 $errors[] = $mod_strings['ERR_LANG_UPLOAD_1']; 118 } 119 120 if(count($errors) > 0) { 121 foreach($errors as $error) { 122 $uploadResult .= $error."<br />"; 123 } 124 } 125 126 break; // end 'validate' 127 case 'commit': 128 $sugar_config = commitLanguagePack(); 129 break; 130 case 'uninstall': // leaves zip file in "uploaded" state 131 $sugar_config = uninstallLanguagePack(); 132 break; 133 case 'remove': 134 removeLanguagePack(); 135 break; 136 default: 137 break; 138 } 139 } 140 //// END HANDLE FILE UPLOAD AND PROCESSING 141 /////////////////////////////////////////////////////////////////////////////// 142 143 144 /////////////////////////////////////////////////////////////////////////////// 145 //// PRELOAD DISPLAY DATA 146 147 $availableLanguagePacks = getLangPacks(); 148 $installedLanguagePacks = getInstalledLangPacks(); 149 $dateFormat = get_select_options_with_id($sugar_config['date_formats'], isset($_SESSION['default_date_format']) ? $_SESSION['default_date_format'] : 'm/d/Y'); 150 $timeFormat = get_select_options_with_id($sugar_config['time_formats'], isset($_SESSION['default_time_format']) ? $_SESSION['default_time_format'] : 'h:ia'); 151 $languages = get_select_options_with_id(get_languages(), isset($_SESSION['default_language']) ? $_SESSION['default_language'] : 'en_us'); 152 $nameFormat = isset($_SESSION['default_locale_name_format']) ? $_SESSION['default_locale_name_format'] : 's f l'; 153 $defaultCurrencyName = isset($_SESSION['default_currency_name']) ? $_SESSION['default_currency_name'] : 'US Dollar'; 154 $defaultCurrencySymbol = isset($_SESSION['default_currency_symbol']) ? $_SESSION['default_currency_symbol'] : '$'; 155 $defaultCurrencyIso = isset($_SESSION['default_currency_iso4217']) ? $_SESSION['default_currency_iso4217'] : 'USD'; 156 $separator = isset($_SESSION['default_number_grouping_seperator']) ? $_SESSION['default_number_grouping_seperator'] : ','; 157 $decimal = isset($_SESSION['default_decimal_seperator']) ? $_SESSION['default_decimal_seperator'] : '.'; 158 $getNameJs = $locale->getNameJs($mod_strings['LBL_LOCALE_NAME_FIRST'], $mod_strings['LBL_LOCALE_NAME_LAST'], $mod_strings['LBL_LOCALE_NAME_SALUTATION']); 159 $getNumberJs = $locale->getNumberJs(); 160 $charsets = get_select_options_with_id($locale->getCharsetSelect(), isset($_SESSION['default_export_charset']) ? $_SESSION['default_export_charset'] : 'CP1252'); 161 $charsetsEmail = get_select_options_with_id($locale->getCharsetSelect(), isset($_SESSION['default_email_charset']) ? $_SESSION['default_email_charset'] : 'ISO-8859-1'); 162 $exportDelimiter = (isset($_SESSION['export_delimiter'])) ? $_SESSION['export_delimiter'] : ','; 163 164 // default currencies 165 $currencySelect = ''; 166 $currencyDefs = "var currencyDefs = new Object;\r"; 167 foreach($sugar_config['default_currencies'] as $iso4217 => $currency) { 168 $currencyDefs .= "currencyDefs.{$iso4217} = new Object;\r"; 169 $currencyDefs .= "currencyDefs.{$iso4217}.name = '{$currency['name']}';\r"; 170 $currencyDefs .= "currencyDefs.{$iso4217}.symbol = '{$currency['symbol']}';\r"; 171 $currencyDefs .= "currencyDefs.{$iso4217}.iso4217 = '{$currency['iso4217']}';\r"; 172 173 $selected = ''; 174 if($iso4217 == $defaultCurrencyIso) { 175 $selected = ' SELECTED'; 176 } 177 $currencySelect .= "<option value='{$iso4217}'{$selected}> {$currency['name']} </option>"; 178 } 179 $signficantDigits = (isset($_SESSION['default_currency_significant_digits']) && !empty($_SESSION['default_currency_significant_digits'])) ? $_SESSION['default_currency_significant_digits'] : 2; 180 $sigDigits = ''; 181 for($i=0; $i<=6; $i++) { 182 $sigDigitsSelected = ($signficantDigits == $i) ? ' SELECTED' : ''; 183 $sigDigits .= "<option value='{$i}'{$sigDigitsSelected}>{$i}</option>"; 184 } 185 186 $errs = ''; 187 if(isset($validation_errors)) { 188 if(count($validation_errors) > 0) { 189 $errs = '<div id="errorMsgs">'; 190 $errs .= "<p>{$mod_strings['LBL_SYSOPTS_ERRS_TITLE']}</p>"; 191 $errs .= '<ul>'; 192 193 foreach($validation_errors as $error) { 194 $errs .= '<li>' . $error . '</li>'; 195 } 196 197 $errs .= '</ul>'; 198 $errs .= '</div>'; 199 } 200 } 201 202 //// PRELOAD DISPLAY DATA 203 /////////////////////////////////////////////////////////////////////////////// 204 205 206 /////////////////////////////////////////////////////////////////////////////// 207 //// BEING PAGE OUTPUT 208 $disabled = ""; 209 $result = ""; 210 $out =<<<EOQ 211 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 212 <html> 213 <head> 214 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 215 <meta http-equiv="Content-Script-Type" content="text/javascript"> 216 <meta http-equiv="Content-Style-Type" content="text/css"> 217 <title>{$mod_strings['LBL_WIZARD_TITLE']}{$mod_strings['LBL_LOCALE_TITLE']}</title> 218 <link REL="SHORTCUT ICON" HREF="$icon"> 219 <link rel="stylesheet" href="$css" type="text/css"> 220 <script type="text/javascript" src="$common"></script> 221 </head> 222 223 <body onLoad="document.getElementById('defaultFocus').focus();"> 224 <table cellspacing="0" width="100%" cellpadding="0" border="0" align="center" class="shell"> 225 <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr> 226 <tr> 227 <th width="500"> 228 <p><img src="$sugar_md" alt="SugarCRM" border="0"></p> 229 {$mod_strings['LBL_LOCALE_TITLE']}</th> 230 <th width="200" style="text-align: right;"><a href="http://www.sugarcrm.com" target= 231 "_blank"><IMG src="$loginImage" width="145" height="30" alt="SugarCRM" border="0"></a> 232 </th> 233 </tr> 234 235 <tr> 236 <td colspan="2"> 237 238 <table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" class="StyleDottedHr"> 239 <form action="install.php" method="post" name="theForm" id="theForm"> 240 <tr> 241 <th colspan="2" align="left">{$mod_strings['LBL_CUSTOMIZE_LOCALE']}</th> 242 </tr> 243 <tr> 244 <td colspan="2"> 245 {$mod_strings['LBL_LOCALE_DESC']} 246 {$errs} 247 </td> 248 </tr> 249 <tr> 250 <td colspan="2"> 251 <b>{$mod_strings['LBL_LOCALE_UI']}</b> 252 </td> 253 </tr> 254 <tr> 255 <td> 256 {$mod_strings['LBL_LOCALE_DATEF']}: 257 </td> 258 <td> 259 <select name="default_date_format">{$dateFormat}</select> 260 </td> 261 </tr> 262 <tr> 263 <td> 264 {$mod_strings['LBL_LOCALE_TIMEF']}: 265 </td> 266 <td> 267 <select name="default_time_format">{$timeFormat}</select> 268 </td> 269 </tr> 270 EOQ; 271 272 273 274 //hide this in typical mode 275 if(isset($_SESSION['install_type']) && !empty($_SESSION['install_type']) && strtolower($_SESSION['install_type'])=='custom'){ 276 $out .=<<<EOQ 277 <tr> 278 <td> 279 {$mod_strings['LBL_LOCALE_LANG']}: 280 </td> 281 <td> 282 <select name="default_language">{$languages}</select> 283 </td> 284 </tr> 285 <tr> 286 <td> 287 {$mod_strings['LBL_LOCALE_NAMEF']}: 288 </td> 289 <td> 290 <input onkeyup="setNamePreview();" onkeydown="setNamePreview();" id="default_locale_name_format" name="default_locale_name_format" value="{$nameFormat}"> <span id='nameTargetDiv'></span><input type='hidden' name="no_value" id="nameTarget" value="" disabled> 291 <br /> 292 {$mod_strings['LBL_LOCALE_NAMEF_DESC']} 293 </td> 294 </tr> 295 296 <tr> 297 <td colspan="2"> 298 <br><b>{$mod_strings['LBL_EMAIL_CHARSET_TITLE']}</b> 299 </td> 300 </tr> 301 <tr> 302 <td> 303 {$mod_strings['LBL_EMAIL_CHARSET_DESC']}: 304 </td> 305 <td> 306 <select name="default_email_charset">{$charsetsEmail}</select> 307 </td> 308 </tr> 309 310 311 <tr> 312 <td colspan="2"> 313 <br><b>{$mod_strings['LBL_LOCALE_EXPORT_TITLE']}</b> 314 </td> 315 </tr> 316 <tr> 317 <td> 318 {$mod_strings['LBL_LOCALE_EXPORT']}: 319 </td> 320 <td> 321 <select name="default_export_charset">{$charsets}</select> 322 </td> 323 </tr> 324 <tr> 325 <td> 326 {$mod_strings['LBL_LOCALE_EXPORT_DELIMITER']}: 327 </td> 328 <td> 329 <input type="text" name="export_delimiter" value="{$exportDelimiter}"> 330 </td> 331 </tr> 332 333 EOQ; 334 } 335 336 $out .=<<<EOQ 337 <tr> 338 <td colspan="2"> 339 <br><b>{$mod_strings['LBL_LOCALE_CURRENCY']}</b> 340 </td> 341 </tr> 342 <tr> 343 <td> 344 {$mod_strings['LBL_LOCALE_CURR_DEFAULT']}: 345 </td> 346 <td nowrap> 347 <select id='currency' onchange='fillCurrency(this.value,true); setDigits();' name='currency'>{$currencySelect}</select> 348 <span id="symbol_span" name="symbol">{$defaultCurrencySymbol}</span> 349 <span id="iso4217_span" name="iso4217">{$defaultCurrencyIso}</span> 350 351 <input type="hidden" disabled id="symbol" name="symbol" value="{$defaultCurrencySymbol}" size="2" style="text-align:center"> 352 <input type="hidden" disabled id="iso4217" name="iso4217" value="{$defaultCurrencyIso}" size="3" style="text-align:center"> 353 <input type="hidden" id="default_currency_name" name="default_currency_name" value="{$defaultCurrencyName}"> 354 <input type="hidden" id="default_currency_symbol" name="default_currency_symbol" value="{$defaultCurrencySymbol}"> 355 <input type="hidden" id="default_currency_iso4217" name="default_currency_iso4217" value="{$defaultCurrencyIso}"> 356 </td> 357 </tr> 358 <tr> 359 <td> 360 {$mod_strings['LBL_LOCALE_CURR_SIG_DIGITS']}: 361 </td> 362 <td> 363 <select id='sigDigits' onchange='setDigits(this.value);' name='default_currency_significant_digits'>{$sigDigits}</select> 364 </td> 365 </tr> 366 <tr> 367 <td> 368 {$mod_strings['LBL_LOCALE_CURR_1000S']}: 369 </td> 370 <td> 371 <input onkeyup="setDigits();" onkeydown="setDigits();" id="default_number_grouping_seperator" name="default_number_grouping_seperator" value="{$separator}"> 372 </td> 373 </tr> 374 <tr> 375 <td> 376 {$mod_strings['LBL_LOCALE_CURR_DECIMAL']}: 377 </td> 378 <td> 379 <input onkeyup="setDigits();" onkeydown="setDigits();" id="default_decimal_seperator" name="default_decimal_seperator" value="{$decimal}"> 380 </td> 381 </tr> 382 <tr> 383 <td> 384 <i>{$mod_strings['LBL_LOCALE_CURR_EXAMPLE']}</i>: 385 </td> 386 <td> 387 <input type="hidden" disabled id="sigDigitsExample" name="sigDigitsExample"> 388 <span id="sigDigitsSpan" ></span> 389 </td> 390 </tr> 391 </table> 392 </td> 393 </tr> 394 <tr> 395 <td align="right" colspan="2"> 396 <hr> 397 <input type="hidden" name="current_step" value="{$next_step}"> 398 <table cellspacing="0" cellpadding="0" border="0" class="stdTable"> 399 <tr> 400 <td> 401 <input class="button" type="button" name="Back" value="{$mod_strings['LBL_BACK']}" onclick="document.getElementById('theForm').submit();" /> 402 <input type="hidden" name="goto" value="{$mod_strings['LBL_BACK']}" /> 403 </td> 404 <td> 405 <input class="button" type="submit" name="goto" value="{$mod_strings['LBL_NEXT']}" id="defaultFocus" {$disabled} /> 406 </td> 407 </tr> 408 </table> 409 </form> 410 </td> 411 </tr> 412 </table> 413 <br> 414 415 <script language="Javascript" type="text/javascript"> 416 EOQ; 417 418 419 420 //hide this in typical mode 421 if(isset($_SESSION['install_type']) && !empty($_SESSION['install_type']) && strtolower($_SESSION['install_type'])=='custom'){ 422 $out .=<<<EOQ 423 {$getNameJs} 424 EOQ; 425 } 426 427 $out .=<<<EOQ 428 {$getNumberJs} 429 430 function fillCurrency(keyIso,resetDefaults) { 431 {$currencyDefs} 432 document.getElementById('symbol_span').innerHTML = ' '+currencyDefs[keyIso].symbol; 433 document.getElementById('iso4217_span').innerHTML = ' '+currencyDefs[keyIso].iso4217; 434 document.getElementById('symbol').value = currencyDefs[keyIso].symbol; 435 document.getElementById('iso4217').value= currencyDefs[keyIso].iso4217; 436 437 document.getElementById('default_currency_symbol').value = currencyDefs[keyIso].symbol; 438 document.getElementById('default_currency_iso4217').value = currencyDefs[keyIso].iso4217; 439 document.getElementById('default_currency_name').value = currencyDefs[keyIso].name; 440 //if defaults should be reset 441 if(resetDefaults){ 442 setCurrFromDD(); 443 } 444 } 445 446 fillCurrency('{$defaultCurrencyIso}',false); 447 448 function setDigits(){ 449 setSigDigits(); 450 document.getElementById('sigDigitsSpan').innerHTML = document.getElementById('sigDigitsExample').value; 451 } 452 setDigits(); 453 454 function setCurrFromDD(){ 455 ddVal = document.getElementById('currency').value; 456 if(ddVal == "CHF" || ddVal == "EUD" || ddVal == "BRL"){ 457 document.getElementById('sigDigits').value = '2'; 458 document.getElementById('default_number_grouping_seperator').value = '.'; 459 document.getElementById('default_decimal_seperator').value = ','; 460 }else{ 461 document.getElementById('sigDigits').value = '2'; 462 document.getElementById('default_number_grouping_seperator').value = ','; 463 document.getElementById('default_decimal_seperator').value = '.'; 464 } 465 466 467 468 } 469 EOQ; 470 471 472 473 //hide this in typical mode 474 if(isset($_SESSION['install_type']) && !empty($_SESSION['install_type']) && strtolower($_SESSION['install_type'])=='custom'){ 475 $out .=<<<EOQ 476 function setNamePreview(){ 477 setPreview(); 478 document.getElementById('nameTargetDiv').innerHTML = document.getElementById('nameTarget').value; 479 } 480 setNamePreview(); 481 EOQ; 482 } 483 484 $out .=<<<EOQ 485 </script> 486 487 </body> 488 </html> 489 EOQ; 490 491 echo $out; 492 493 unlinkTempFiles('',''); 494 //// END PAGEOUTPUT 495 /////////////////////////////////////////////////////////////////////////////// 496 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
|
|
|
|