June 21, 2010

[筆記] Vtiger CRM 安裝

Vtiger 的 Windows 版安裝可以很簡單
下載  5.1.0 穩定版本 執行安裝即可
安裝檔會直接在系統內安裝 apache, php, mysql

若要手動安裝則可以參考 Install on Windows Using Source
也可以支援 IIS


中文化方面,可以參考

Update: >
後來找到比較完整的 5.1.0 中文化修改
回覆: vtiger CRM 使用問題
 http://twpug.net/modules/newbb/viewtopic.php?post_id=18297#forumpost18297


我用5.1.0 rc版,中文改的差不多,只剩webmail會亂碼
修改的部分如下,請大家自行參考吧!

修改config.inc.php,這部分如下:
$languages = Array('en_us'=>'US English','zh-tw'=>'Traditional Chinese',);
$default_language = 'en_us'; (要不要預設為中文,看個人,此處要中文login畫面,就改成'zh-tw')

4) 將login.php(located in ..htdocs\vtigerCRM\modules\users\)修改
這一段改成下面

5)不足的部分,將自行複製檔案並變更檔名為 Traditional Chinese
在5.1.0 rc 版下列目錄中增加中文對應檔
\modules\Emails\language\phpmailer.lang-zh-tw.php
\modules\com_vtiger_workflow\language
\modules\CustomerPortal\language
\modules\Documents\language
\modules\FieldFormulas\language
\modules\PBXManager\language
\modules\PickList\language
\modules\RecycleBin\language,有兩組要copy
\modules\ServiceContracts\language
\modules\Services\language
\modules\Tooltip\language
\modules\Utilities\language
\modules\Webforms\language
vtlib\ModuleDir\5.1.0\language

6) C:\vtigercrm51\apache\htdocs\vtigerCRM\include\js下的en_us.lang.js 

copy 一份成為中文的zh-tw.lang.js即可
7) 在webmail的設定中,增加以下
8) 'LBL_MAIL_CONNECT_ERROR'=>'Could not connect to the mail server. Please check the mail server details',
9) 'IN_REPLY_TO_THE_MESSAGE' => 'In reply to the message sent by ',
10) 'LBL_CLICK_HERE' => 'Click Here ',
11) 'LBL_GOTO_EMAILS_MODULE' => ' go to Email module',
12) 'LBL_NO_EMAILS'=>'No Email In This Folder',
13) 'LBL_MOVE_TO'=>'Move To...',
14) 'LBL_DEL'=>'Del ',
15) 'LABEL_FROM'=>'From',
16) 'LBL_INFO'=>'Info',
17) 'LABEL_DATE'=>'Date',
18) 'LBL_NO_IFRAMES_SUPPORTED'=>'No Iframes supported',
19) 'LBL_EMAIL_ATTACHMENTS'=>'Email Attachments:',
20) 'LBL_ALLMAILS'=>'Email',
21) 'LBL_TO_USERS'=>'To Users',
22) 'LBL_TO_GROUPS'=>'To Groups',
23) 'SUBJECT' => 'Subject',
24) 'BODY' => 'Body',
25) 'TO' => 'To:',
26) 'CC' => 'CC:',
27) 'BCC' => 'BCC:',
28) 'FROM' => 'From:',
29) 'IN'=>'in',
30) 'ADD_FOLDER' => 'Add Folder[X]',
31) //Added for 5.0.3
32) 'LBL_LOADING_IMAGE' => 'Loading Image',
33) 'LBL_ENABLE_IMAP_SUPPORT' => 'Please enable the IMAP support in php to run this module',
34)
35) // Added/Updated for vtiger CRM 5.0.4
36) 'LBL_CONFIGURE_MAIL_SETTINGS'=>'Please configure your mail settings',
37) 'LBL_PLEASE'=>'Please',
38) 'LBL_HERE'=>'Here',
39)
40) // Added after 5.0.4 GA
41) 'LBL_FULL_EMAIL_VIEW'=>'Full Email View',
42) 'LBL_MESSAGE'=>'Message',
43) 'LBL_MESSAGES'=>'Messages',
44)
45) 'LBL_NO_ATTACHMENTS'=>'No files to download',
46) 'LBL_THERE_ARE'=>'There are ',
47) 'LBL_ATTACHMENTS_TO_CHOOSE'=>' attachment(s) to choose from',
48) 'LBL_ATTACHMENTS'=>'Attachments',


vtigercrm 5.1.0 rc版中文化作法
解壓縮後將 fireflysung.ttf 上傳至 vtigercrm/Image/Canvas/Fonts/ 底下
並在 vtigercrm/Image/Canvas/Fonts/fontmap.txt 中新增
fireflysung,fireflysung.ttf
fireflysung,fireflysung.ttf
修改 include/utils/GraphUtils.php 第27行為
DEFINE(”FF_FONT1”,’fireflysung’);


pdf中文化
找到並下載fireflysung.gz檔案,解壓後,產生fireflysung.ttf檔,放入tcpdf\fonts\ttf2ufm目錄下
執行
ttf2ufm -a -F fireflysung.ttf
執行
php -q makefont.php fireflysung.ttf fireflysung.ufm
copy 產生出來的檔案到TCPDF\fonts目錄下
複製fireflysung.php 成為fireflysungb.php, fireflysungi.php, fireflysungbi.php
修改
Tcpdf.php 將$family字型修改為 $family = 'fireflysung';-2552行 /2545行
Ok


其他中文化問題解決如下
第一個,客戶郵寄匯出,匯出的Excel檔中中文顯示亂碼。
需要修改的檔:/modules/Accounts/MailerExport.php
改動非常簡單,第289行 修改成print iconv("UTF-8", "Big5", $content);
 

第二個,產品管理裡面匯出產品資訊,在匯出的Excel檔中中文同樣顯示亂碼。
需要修改的檔:/include/utils/export.php
207行,對輸出進行編碼轉換,修改為:echo iconv("UTF-8", "Big5", $header);
同樣230行,改為:echo iconv("UTF-8", "Big5", $line);
 

第三個,匯出報表為Excel檔,中文顯示亂碼。
需要修改的檔:/modules/Reports/CreateXL.php
51行,改為:$worksheet->write(0, $count, iconv("UTF-8", "Big5", $key) , $header);
62行,改為:$worksheet->write($key+1, $dcount, iconv("UTF-8", "Big5", $value));

Good Luck

(以下是原來找到的中文化安裝分享)
Vtiger CRM 客戶關係管理系統安裝實錄 (文章內容是 5.0.3 的 Linux 版安裝)
http://cha.homeip.net/blog/archives/2007/08/vtiger_crm.html

將語言包解壓縮至 /var/www/html/vtigercrm

vi /var/www/html/vtigercrm/config.inc.php

修改以下參數:
$languages = Array('en_us'=>'US English','zh-tw'=>'Traditional Chinese',);
$default_charset = 'UTF-8';
$default_language = 'zh-tw';

但若在 5.1.0 安裝 5.0.3RC2 的繁中語言包
會出現登入選單沒有中文選項的問題
解決方式如下:

[問題] 關於Vtiger504升級到510的問題
http://twpug.net/modules/newbb/viewtopic.php?topic_id=4688&forum=25

裡面提到:
「剛剛試了一下,新版本將語言設定放到資料庫了,只要執行下面 SQL 即可在下拉選單看到
INSERT INTO `demo_vtigercrm`.`vtiger_language` (
`id` ,`name` ,`prefix` ,`label` ,`lastupdated` ,`sequence` ,`isdefault` ,`active`
) VALUES (NULL , 'Chinese', 'zh-tw', 'Chinese', NULL , NULL , '0', '1');
目前沒看到管理介面,也許沒找到或是未來版本才會加入」

相關連結:
vtiger Open Source CRM
http://www.vtiger.com
客戶關係管理系統 vTigerCRM
http://leecocun.spaces.live.com/blog/cns!2457DF277E0B7A56!318.entry

3 意見:

積奇 said...

在使用Vtiger CRM 5.0.4版時,發現在使用者紀錄的部份,無法顯示正確的登入或操作時間,估計事時區設定問題(因為紀錄的時間與本地時間差了大約8小時)
此現象會對未來稽核產生問題,幸好在原廠討論區找到下列解決方案,分享給有需要的用戶參考

解決登入紀錄之時間問題
a.編輯 config.inc.php 最後一行增加指令
$default_timezone = 'Asia/Taipei';
b.編輯 index.php 在 set_default_config($default_config_values); 這一行下面加上下列語法
// Set the default timezone preferred by user
global $default_timezone;
if(isset($default_timezone) && function_exists('date_default_timezone_set')) {
@date_default_timezone_set($default_timezone);
}

儲存後再測試,即可解決時區問題

積奇 said...

時區解決方式資料來源:
http://twpug.net/modules/newbb/viewtopic.php?topic_id=3859&forum=25

Jaki said...

針對資料匯入時,即使 csv 檔轉為 utf-8 也會有中文字無法出現的問題,解決方式:
1. 不改程式:在所有中文資料欄位前加入一個英數字,待匯入後再手動修正。
2. 修改程式:
可以直接匯入 excel 編輯的 big5 csv 檔

參照 http://goo.gl/L7au 之 #10-12

解決方法:
修改 \modules\Import\下的parse_utils.php

尋找程式碼:
function parse_import($file_name,$delimiter,$max_lines,$has_header)

在這段之前加
程式碼:
function translateCharset($string, $fromCharset, $toCharset='UTF-8') {
if(function_exists('mb_convert_encoding')) {
return mb_convert_encoding($string, $toCharset, $fromCharset);
} elseif(function_exists('iconv')) { // iconv is flakey
return iconv($fromCharset, $toCharset, $string);
} else {
return $string;
} // end else clause
}


尋找程式碼:
// got no rows
if ( count($rows) == 0)
{
return -3;
}

接在後面加(共有2處都要加)
程式碼:
else
{
//// tw: bug 6712 - need to translate to UTF-8
foreach($rows as $rowKey => $row)
{
foreach($row as $k => $v) {
$row[$k] = translateCharset($v, 'BIG5');
}
$rows[$rowKey] = $row;
}
}