2011年5月15日 星期日

EGroupware專案管理員甘特圖亂碼

OS: Debian 6
EGroupware Version: Community Version 1.8.001

Here's steps:
1. Comment the following line in {egwRoot}\projectmanager\inc\class.projectmanager_ganttchart.inc.php

if ($this->gantt_char_encode) $text = preg_replace('/[^\x00-\x7F]/e', '"&#".ord("$0").";"',$text);
and
$graph->scale->SetDateLocale(common::setlocale());
2. Comment the following line in /usr/share/jpgraph/src/jpgraph_ttf.inc.php
elseif( $aFF === FF_BIG5 ) {
if( !function_exists('iconv') ) {
JpGraphError::RaiseL(25006);
('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).');
}
return iconv('BIG5','UTF-8',$aTxt);
}
and alter
// FF_CHINESE => array(
// FS_NORMAL =>CHINESE_TTF_FONT,
// FS_BOLD =>' ',
// FS_ITALIC =>' ',
// FS_BOLDITALIC =>' ' ),
to
FF_CHINESE => array(
FS_NORMAL =>CHINESE_TTF_FONT,
FS_BOLD =>CHINESE_TTF_FONT,
FS_ITALIC =>CHINESE_TTF_FONT,
FS_BOLDITALIC =>CHINESE_TTF_FONT ),

and alter
define('CHINESE_TTF_FONT','bkai00mp.ttf');
to
define('CHINESE_TTF_FONT','uming.ttc');

and then
$ ln /usr/share/fonts/truetype/arphic/uming.ttc {egwRoot}/projectmanager/inc/ttf-bitstream-vera


References:
1.肝豆腐不多話 - eGroupWare 1.6.001 + JpGraph 2.3.4 甘特圖中文問題
2.4wei-diary - [ LOS ] Install eGroupware On CentOS Linux