Author Archives: 小f

squirrelmail汉化

[root@server ~]# cd /var/www/html/squirrelmail-1.4.22/config
[root@server config]# ./conf.pl
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q Quit
Command >> 10
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : en_US
2. Default Charset : iso-8859-1
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 1
SquirrelMail attempts to set the language in many ways. If it
can not figure it out in another way, it will default to this
language. Please use the code for the desired language.
[en_US]: zh_CN
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : iso-8859-1
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 2
This option controls what character set is used when sending
mail and when sending HTML to the browser.
This option is used only when default language is 'en_US'.
[iso-8859-1]: gb2312
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : gb2312
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> s
Data saved in config.php
Press enter to continue...
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : gb2312
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> q
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!

 

cd /var/www/html/squirrelmail/config
./conf.pl
选择10 设置语言为zh_CN
默认字符集为gb2312
保存退出,重新刷新webmail页面,就成中文了
但是登录进入后,左边的Drafts,sent,trash还是英文
修改/var/www/html/squirrelmail/local/zh_CN/LC_MESSAGES/squirrelmail.po,
增加msgid和msgstr,
修改完毕后,用 msgfmt -o squirrelmail.mo squirrelmail.po 来格式化一下。

vtiger CRM 5.3截取中文字符串出现乱码的解决方法

打开文件/include/utils/ListViewUtils.php

找到第4283行,红色部分为新增代码,修改如下:

}elseif(strlen($field_val) > $listview_max_textlength) {
 if($default_charset == 'UTF-8'){
 $temp_val = mb_substr($field_val, 0, $listview_max_textlength, $default_charset).'...';
 }else{
 $temp_val = substr(preg_replace("/(<\/?)(\w+)([^>]*>)/i","",$field_val),0,$listview_max_textlength).'...';
 }
 }
 } else {

注意:请确保php开启了mb_substr函数支持。

在php.ini中找到“;extension=php_mbstring.dll”去掉前面的分号“;”,然后重启服务即可

vtigercrm数据导出csv乱码修复

vtigerCRM 5.3 导入导出数据文件CSV中文乱码主要是vtigerCRM只支持UTF-8和ISO-8859-1编码,所以我们用Windows平台打开时就发生乱码,为了在Windows中不产生乱码必须将CSV文件的编码变成GBK或者使用excel的数据导入功能,选择utf-8编码打开即可。

 

导入数据文件CSV中文乱码修正

在Smarty/templates/ImportStep1.tpl中的第99行插入<option value=”GBK”>GBK</option>

<select name="format" class="small">
<!-- value must be a known format for mb_convert_encoding() -->
 <option value="GBK">GBK</option> // <<插入一行
 <option value="ISO-8859-1">ISO-8859-1</option>
 <option value="UTF-8">UTF-8</option>
</select>

导出数据文件CSV中文乱码修正

修改include/utils/export.php中的第208,232和240行

/** Output header information */
 echo iconv("UTF-8", "GBK", $header); //原来: echo $header;

 

/** Output each row information */
 echo iconv("UTF-8", "gbk", $line); //原来: echo $line;
 }
 $log->debug("Exiting export method ...");
 return true;
}

 

/** Send the output header and invoke function for contents output */
header("Content-Disposition:attachment;filename={$_REQUEST['module']}.csv");
header("Content-Type:text/csv;charset=gbk"); 
//原来: header("Content-Type:text/csv;charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header("Cache-Control: post-check=0, pre-check=0", false );

Vtigercrm统计图表乱码修复

vtigerCRM 5.3 没有自带中文字体所以造成统计图中文乱码现象

下载Simsun解压后,将Simsun.ttf文件复制到修改\Image\Canvas\Fonts\目录下
修改\Image\Canvas\Fonts\fontmap.txt,最后增加一行:
Simsun, Simsun.ttf
修改\include\utils\GraphUtils.php,在第22行插入以下代码:
DEFINE("FF_DROIDSANSFALLBACK",'Droid Sans Fallback');
将第43行的 case 'cn_zh': 修改为 case 'zh_cn':
保存即可。

vtigercrm中增加系统内置的字段

vtigercrm支持用户自定义字段,但不能调用系统内置的字段属性,例如在服务合同中调用销售订单。
可以通过直接修改数据库的方式实现:

1,修改 当前表插入字段
2,vtiger_field 增加记录
3,vtiger_def_org_field 增加记录 INSERT INTO `supportcrm`.`vtiger_def_org_field` (`tabid`, `fieldid`,`visible`, `readonly`) VALUES ('32', '621', '0', '1');
4,vtiger_fieldmodulerel 增加记录 INSERT INTO `supportcrm`.`vtiger_fieldmodulerel` (`fieldid`, `module`,`relmodule`, `status`, `sequence`) VALUES ('621', 'ServiceContracts', 'SalesOrder', '', '0');
5,vtiger_profile2field 增加记录(增加多条记录) INSERT INTO `supportcrm`.`vtiger_profile2field`(`profileid`, `tabid`, `fieldid`, `visible`, `readonly`) VALUES ('4', '32', '621', '0', '1');

此方面修改会导致以下问题:

1.通过系统新增自定义字段时,会导致id号重复,导致首次添加的自定义字段无效,再次添加一些即可,暂未发现使用异常(可以尝试第一步修改为通过自定义字段添加字段)

2.修改之前添加的服务合同记录无法修改保存,需要重新添加。