Changeset 12066
- Timestamp:
- 06/25/08 06:25:52 (2 years ago)
- Files:
-
- vtigercrm/branches/5.1/config.template.php (modified) (1 diff)
- vtigercrm/branches/5.1/index.php (modified) (1 diff)
- vtigercrm/branches/5.1/install/5createTables.php (modified) (1 diff)
- vtigercrm/branches/5.1/modules/Import/ImportStep3.php (modified) (1 diff)
- vtigercrm/branches/5.1/modules/Migration/DBChanges/42P2_to_50.php (modified) (1 diff)
- vtigercrm/branches/5.1/modules/Migration/HTMLtoUTF8Conversion.php (modified) (1 diff)
- vtigercrm/branches/5.1/modules/Migration/MigrationInfo.php (modified) (1 diff)
- vtigercrm/branches/5.1/modules/Migration/MigrationStep0.php (modified) (1 diff)
- vtigercrm/branches/5.1/modules/Migration/PatchApply.php (modified) (3 diffs)
- vtigercrm/branches/5.1/modules/Migration/index.php (modified) (2 diffs)
- vtigercrm/branches/5.1/modules/Reports/CreateXL.php (modified) (1 diff)
- vtigercrm/branches/5.1/modules/Reports/ReportRun.php (modified) (4 diffs)
- vtigercrm/branches/5.1/modules/Users/RecalculateSharingRules.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
vtigercrm/branches/5.1/config.template.php
r12031 r12066 194 194 $listview_max_textlength = 40; 195 195 196 // Maximum time limit for PHP script execution (in seconds) 197 $php_max_execution_time = 0; 198 196 199 ?> vtigercrm/branches/5.1/index.php
r12015 r12066 104 104 require_once('config_override.php'); 105 105 } 106 $default_config_values = Array( "allow_exports"=>"all","upload_maxsize"=>"3000000", "listview_max_textlength" => "40" );107 106 $default_config_values = Array( "allow_exports"=>"all","upload_maxsize"=>"3000000", "listview_max_textlength" => "40", "php_max_execution_time" => "0"); 107 108 108 set_default_config($default_config_values); 109 109 require_once('include/logging.php'); vtigercrm/branches/5.1/install/5createTables.php
r12064 r12066 17 17 * Description: Executes a step in the installation process. 18 18 ********************************************************************************/ 19 set_time_limit( 2000);19 set_time_limit(0); 20 20 21 21 if (isset($_REQUEST['db_name'])) $db_name = $_REQUEST['db_name']; vtigercrm/branches/5.1/modules/Import/ImportStep3.php
r11840 r12066 37 37 require_once('modules/Import/ImportSave.php'); 38 38 39 set_time_limit(0); 39 global $php_max_execution_time; 40 set_time_limit($php_max_execution_time); 40 41 ini_set("display_errors",'0'); 41 42 vtigercrm/branches/5.1/modules/Migration/DBChanges/42P2_to_50.php
r11968 r12066 11 11 12 12 ini_set("memory_limit","32M"); 13 set_time_limit(600); 13 global $php_max_execution_time; 14 set_time_limit($php_max_execution_time); 14 15 15 16 //This file is used to modify the database from 4.2Patch2 to 5.0 Alpha release vtigercrm/branches/5.1/modules/Migration/HTMLtoUTF8Conversion.php
r12064 r12066 10 10 11 11 ini_set("memory_limit","32M"); 12 set_time_limit(-1); 12 global $php_max_execution_time; 13 set_time_limit($php_max_execution_time); 13 14 14 15 echo '<div align = "center"><br><b>Started UTF8 Conversion</b><br></div>'; vtigercrm/branches/5.1/modules/Migration/MigrationInfo.php
r12064 r12066 283 283 <br /> 284 284 285 Note : Please copy and archive the failed queries log. This may help in future references.<br><br><?php 286 //Added to check database charset and $default_charset are set to UTF8. 287 //If both are not set to be UTF-8, Then we will show an alert message. 288 /*function check_db_utf8_support($conn) 289 { 290 $dbvarRS = &$conn->query("show variables like '%_database' "); 291 $db_character_set = null; 292 $db_collation_type = null; 293 while(!$dbvarRS->EOF) { 294 $arr = $dbvarRS->FetchRow(); 295 $arr = array_change_key_case($arr); 296 switch($arr['variable_name']) { 297 case 'character_set_database' : $db_character_set = $arr['value']; break; 298 case 'collation_database' : $db_collation_type = $arr['value']; break; 299 } 300 // If we have all the required information break the loop. 301 if($db_character_set != null && $db_collation_type != null) break; 302 } 303 return (stristr($db_character_set, 'utf8') && stristr($db_collation_type, 'utf8')); 304 } 305 306 global $adb,$default_charset; 307 $db_status=check_db_utf8_support($adb); 308 if(strtolower($default_charset) == 'utf-8') $config_status=1; 309 else $config_status=0; 310 311 if(!$db_status && !$config_status) 312 { 313 $msg='<font color="red"><b>Your database charset and $default_charset variable in config.inc.php are not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the above to UTF-8</b></font>'; 314 } 315 else if($db_status && !$config_status) 316 { 317 $msg='<font color="red"><b>Your database charset is set as UTF-8. But $default_charset variable in config.inc.php is not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the $default_charset variable to UTF-8</b></font>'; 318 319 } 320 else if(!$db_status && $config_status) 321 { 322 $msg='<font color="red"><b>Your $default_charset variable in config.inc.php is set as UTF-8. But your database charset is not set as UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set your database charset to UTF-8</b></font>'; 323 324 } 325 echo $msg; 326 327 */ 328 329 ?> 285 Note : Please copy and archive the failed queries log. This may help in future references.<br><br> 330 286 </td> 331 287 </tr> 332 288 <tr bgcolor="#FFFFFF"><td colspan="2"> </td></tr> 333 <!-- <tr bgcolor="#FFFFFF"><td colspan="2"> --> 334 <?php/* 335 if($continue_42P2) 336 { 337 echo '<br><table border="1" cellpadding="3" cellspacing="0" height="100%" width="80%" align="center"> 338 <tr> 339 <td colspan="2" align="center"><br>If you migrated from 503 or its below version the special characters like other language characters are stored as html values. These html values are not getting displayed properly in the latest version, it will display as html symbols without conversion. So that you need to change your html values into utf8 characters. If you are going to use ISO charset in config file and in DataBase, then you no need do this conversion. Click on the Convert Now button to convert your html characters into utf8 characters.<br><br> 340 <form name="ascii_to_utf" method="post" action="index.php"> 341 <input type="hidden" name="module" value="Migration"> 342 <input type="hidden" name="action" value="HTMLtoUTF8Conversion"> 343 <input type="submit" name="close" value=" Convert Now " class="crmbutton small cancel" /> 344 </form><br> 345 </td> 346 </tr> 347 </table> 348 <tr bgcolor="#FFFFFF"><td colspan="2"> </td></tr>'; 349 350 }*/ 351 ?> 352 <!-- </td></tr> --> 289 353 290 <tr> 354 291 <td colspan="2" align="center"> vtigercrm/branches/5.1/modules/Migration/MigrationStep0.php
r12064 r12066 59 59 header("Location: index.php?module=Migration&action=index&parenttab=Settings"); 60 60 } 61 /* Only for testing 62 $smarty->assign("DB_CHARSET", "latin1"); 63 $smarty->assign("DB_STATUS", 0); 64 $smarty->assign("CONFIG_CHARSET", "ISO"); 65 $smarty->assign("CONFIG_STATUS", 0); 66 $db_migration_status = 2; 67 */ 61 68 62 $smarty->assign("CONVERSION_MSG", $data_conversion_msg[$db_migration_status]); 69 63 vtigercrm/branches/5.1/modules/Migration/PatchApply.php
r12002 r12066 11 11 12 12 ini_set("memory_limit","32M"); 13 set_time_limit(-1); 13 global $php_max_execution_time; 14 set_time_limit($php_max_execution_time); 14 15 15 16 global $current_user; … … 135 136 } 136 137 137 //Added to check database charset and $default_charset are set to UTF8.138 //If both are not set to be UTF-8, Then we will show an alert message.139 /*140 function check_db_utf8_charset($conn)141 {142 $dbvarRS = &$conn->query("show variables like '%_database' ");143 $db_character_set = null;144 $db_collation_type = null;145 while(!$dbvarRS->EOF) {146 $arr = $dbvarRS->FetchRow();147 $arr = array_change_key_case($arr);148 switch($arr['variable_name']) {149 case 'character_set_database' : $db_character_set = $arr['value']; break;150 case 'collation_database' : $db_collation_type = $arr['value']; break;151 }152 // If we have all the required information break the loop.153 if($db_character_set != null && $db_collation_type != null) break;154 }155 return (stristr($db_character_set, 'utf8') && stristr($db_collation_type, 'utf8'));156 }157 158 /* global $adb,$default_charset;159 $db_status=check_db_utf8_charset($adb);160 if(strtolower($default_charset) == 'utf-8') $config_status=1;161 else $config_status=0;162 163 if(!$db_status && !$config_status)164 {165 $msg='<br><font color="red"><b>Your database charset and $default_charset variable in config.inc.php are not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the above to UTF-8</b></font>';166 }167 else if($db_status && !$config_status)168 {169 $msg='<br><font color="red"><b>Your database charset is set as UTF-8. But $default_charset variable in config.inc.php is not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the $default_charset variable to UTF-8</b></font>';170 171 }172 else if(!$db_status && $config_status)173 {174 $msg='<br><font color="red"><b>Your $default_charset variable in config.inc.php is set as UTF-8. But your database charset is not set as UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set your database charset to UTF-8</b></font>';175 176 }177 echo $msg;178 if(!$continue_42P2 && $db_change_conformation == true)179 {180 echo '<br><table border="1" cellpadding="3" cellspacing="0" height="100%" width="80%" align="center">181 <tr>182 <td colspan="2" align="center"><br>If you are migrating from 5.0.3 or earlier versions, which had partial unicode (UTF-8) support, the unicode characters got saved as HTML entities. <br>If you are going to use ISO charset in config file and in database, then you need not do conversion.<br> Click on "Convert Now" button to convert html entities into utf8 characters.<br><br>183 <form name="html_to_utf" method="post" action="index.php">184 <input type="hidden" name="module" value="Migration">185 <input type="hidden" name="action" value="HTMLtoUTF8Conversion">186 187 <input type="submit" name="close" value=" Convert Now " class="crmbutton small save" />188 </form><br>189 </td>190 </tr>191 </table><br><br>';192 193 }194 //if($db_change_conformation == true)195 //{ */196 138 echo '<table width="95%" border="0" align="center"> 197 139 <tr bgcolor="#FFFFFF"><td colspan="2"> </td></tr> … … 206 148 </tr> 207 149 </table><br><br>'; 208 //} 150 209 151 perform_post_migration_activities(); 210 152 vtigercrm/branches/5.1/modules/Migration/index.php
r12016 r12066 103 103 } 104 104 105 //Added to check database charset and $default_charset are set to UTF8.106 //If both are not set to be UTF-8, Then we will show an alert message.107 /*function check_db_utf8_support($conn)108 {109 $dbvarRS = &$conn->query("show variables like '%_database' ");110 $db_character_set = null;111 $db_collation_type = null;112 while(!$dbvarRS->EOF) {113 $arr = $dbvarRS->FetchRow();114 $arr = array_change_key_case($arr);115 switch($arr['variable_name']) {116 case 'character_set_database' : $db_character_set = $arr['value']; break;117 case 'collation_database' : $db_collation_type = $arr['value']; break;118 }119 // If we have all the required information break the loop.120 if($db_character_set != null && $db_collation_type != null) break;121 }122 return (stristr($db_character_set, 'utf8') && stristr($db_collation_type, 'utf8'));123 }124 global $adb,$default_charset;125 $db_status=check_db_utf8_support($adb);126 if(strtolower($default_charset) == 'utf-8') $config_status=1;127 else $config_status=0;128 105 129 $db_migration_status =true;130 131 if(!isset($db_character_set))132 {133 $result = $adb->query("show variables like 'character_set_database'");134 $row = $adb->fetch_array($result);135 $db_character_set = $row['value'];136 }137 if(!$db_status && !$config_status)138 {139 $db_migration_status = false;140 if($db_character_set =='latin1' && strtolower($default_charset) == 'iso-8859-1')141 $db_migration_status = true;142 $msg='<br/>';143 }144 else if($db_status && !$config_status)145 {146 $db_migration_status = false;147 $msg='<br> If you want to use UTF-8 charset for both vtigerCRM server and database , please change the $default_charset variable to UTF-8 in config.inc.php file and click on the "Continue" button.<br/><b> Otherwise ';148 149 }150 else if(!$db_status && $config_status)151 {152 $db_migration_status = false;153 $msg='<br> If you want to use UTF-8 charset for both vtigerCRM server and database , please click on the <b> "Use UTF-8 charset" </b> button. <br/><b> Otherwise ';154 155 }156 */157 106 $smarty = new vtigerCRM_Smarty(); 158 159 //$smarty->assign("CHARSET_CHECK", $msg);160 107 161 108 $smarty->assign("MIG_CHECK", $status); … … 182 129 global $vtiger_current_version; 183 130 $smarty->assign("CURRENT_VERSION", $vtiger_current_version); 184 /*185 if($db_migration_status == false)186 {187 echo '<br><br>188 <font color ="red"> <ul><li>Changes made to database during migration cannot be reverted back. So we highly recommend to take database dump of the current working database before migration.</ul></font><br/> <br/></table>';189 190 echo ' <table border="1" cellpadding ="2" cellspacing="0" height="100%" width="50%" align="center">191 <tr><td>vtigerCRM Database Characterset </td><td>';192 if(isset($db_character_set))193 echo $db_character_set;194 echo ' </td></tr>195 <tr><td>vtigerCRM Server Characterset </td><td>'.$default_charset.' </td></tr>196 </table>';197 echo '<br><br>198 <table border="1" cellpadding="3" cellspacing="0" height="100%" width="80%" align="center">199 <tr>200 <td colspan="2" align="center"><br>';201 echo '<font color ="red"> <br/> There is a conflict between the vtigerCRM server characterset and database characterset. ';202 echo $msg;203 echo '<b> Specify the same character set both in vtigerCRM server & database and click on the "Continue" button to proceed with Migration.</b> </font> ';204 echo '<br><br><form name="html_to_utf" method="post" action="index.php">205 <input type="hidden" name="module" value="Migration">206 <input type="hidden" name="action" value="index">207 <input type="hidden" name="dbconversionutf8" value = "">208 <input type="hidden" name="parenttab" value="Settings">';209 if(!$db_status && $config_status){210 echo '<input type="button" name="close" value=" Use UTF-8 Charset " onclick ="dbcovert();" class="crmbutton small save" />';211 }212 echo ' <input type="submit" name="close" value=" Continue " class="crmbutton small save" />213 </form>214 <script>function dbcovert(){getObj("dbconversionutf8").value="yes";document.html_to_utf.submit();}</script>215 <br>216 </td>217 </tr>218 </table><br><br>';219 131 220 //echo "<a href='index.php?action=index&module=".$_REQUEST['module']."&parenttab=".$_REQUEST['parenttab']."'>Continue</a>"; 221 exit; 222 } 223 else */ 224 $smarty->display("Migration.tpl"); 225 226 //include("modules/Migration/DBChanges/501_to_502.php"); 132 $smarty->display("Migration.tpl"); 227 133 228 134 ?> vtigercrm/branches/5.1/modules/Reports/CreateXL.php
r11648 r12066 9 9 * 10 10 ********************************************************************************/ 11 set_time_limit(10); 11 global $php_max_execution_time; 12 set_time_limit($php_max_execution_time); 12 13 13 14 require_once("include/php_writeexcel/class.writeexcel_workbook.inc.php"); vtigercrm/branches/5.1/modules/Reports/ReportRun.php
r11967 r12066 1802 1802 function GenerateReport($outputformat,$filterlist) 1803 1803 { 1804 global $adb,$current_user ;1804 global $adb,$current_user,$php_max_execution_time; 1805 1805 global $modules,$app_strings; 1806 1806 global $mod_strings,$current_language; … … 1961 1961 $thirdvalue = $tnewvalue; 1962 1962 $arr_val[] = $arraylists; 1963 set_time_limit( 0);1963 set_time_limit($php_max_execution_time); 1964 1964 }while($custom_field_values = $adb->fetch_array($result)); 1965 1965 … … 2052 2052 } 2053 2053 $arr_val[] = $arraylists; 2054 set_time_limit( 0);2054 set_time_limit($php_max_execution_time); 2055 2055 }while($custom_field_values = $adb->fetch_array($result)); 2056 2056 … … 2283 2283 $thirdvalue = $tnewvalue; 2284 2284 $arr_val[] = $arraylists; 2285 set_time_limit( 0);2285 set_time_limit($php_max_execution_time); 2286 2286 }while($custom_field_values = $adb->fetch_array($result)); 2287 2287 vtigercrm/branches/5.1/modules/Users/RecalculateSharingRules.php
r11954 r12066 9 9 * 10 10 ********************************************************************************/ 11 12 set_time_limit( -1);11 global $php_max_execution_time; 12 set_time_limit($php_max_execution_time); 13 13 RecalculateSharingRules(); 14 14
