安装sugarcrm,如果你不安装imap,那么你就无法使用的他的邮件功能,他的邮件功能是通过imap去读远程的邮件。

为了这个模块,我可是研究了一个下午,终于搞定,以后还是要仔细看文档,本来我已经看到这个文档,不过不好好看,下面是步骤。

首先最好以源码方式配置LAMP环境

你需要通过yum来安装两个包

yum -y install openssl-devel.i386
yum install pam-devel

这个时候你就可以安装imap了,不然你会遇到无数的错误,而且你搜索也找不到答案的。

wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z
tar zxf imap.tar.Z
cd imap-2007a

如果系统是64位架构的,可能需要先

修改Makefile文件,在EXTRACFLAGS= 后加-fPIC

make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4

echo "set disable-plaintext nil" > /etc/c-client.cf
mkdir /usr/local/imap-2007a
mkdir /usr/local/imap-2007a/include/
mkdir /usr/local/imap-2007a/lib/
chmod -R 077 /usr/local/imap-2007a
rm -rf /usr/local/imap-2007a/include/*
rm -rf /usr/local/imap-2007a/lib/*
rm -rf /usr/sbin/imapd

cp imapd/imapd /usr/sbin/
cp c-client/*.h /usr/local/imap-2007a/include/
cp c-client/*.c /usr/local/imap-2007a/lib/
cp c-client/c-client.a /usr/local/imap-2007a/lib/libc-client.a

编译成功后,cd c-client
cp *.h /usr/local/include/
cp c-client.a  /usr/local/lib/

这个时候,你再编译php,就没有问题了

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/include/freetype2 --with-zlib --with-png-dir=usr/local/libpng12 --with-libxml-dir=/usr/local/libxml2 --with-gd --enable-ftp --enable-sockets -enable-mbstring=all- --with-mcrypt=/usr/local/libmcrypt --with-curl=/usr/local/curl \
--with-imap-ssl \
--with-imap=/usr/local/imap-2007a

 

#make

如果出现错误

make: *** [libphp5.la] Error 1

解决:重新下载php源码编译或者安装libtool与libtool-ltdl-devel

#make install

#mkdir /usr/local/php/etc

#cp php.ini-dist /usr/local/php/etc/php.ini

你把php的包删除掉,再解压,编译就可以了,我也出现这个错误,是因为我曾经编译过一次,

 

 

/安装crm

1.lamp环境安装过程

php安装按照上面步骤编译执行

然后执行如下脚本

#!/bin/bash

sed /etc/php.ini -r -ibackup -f - <

s/^safe_mode *=.*/safe_mode = Off/;

s/^display_errors *=.*/display_errors = On/;

s/^file_uploads *=.*/file_uploads = On/;

s/^register_globals *=.*/register_globals = Off/;

s/^max_execution_time *=.*/max_execution_time = 600/;

s/^output_buffering *=.*/output_buffering= On/;

s/^memory_limit *=.*/memory_limit =64M/;

s/^error_reporting *=.*/error_reporting = E_WARNING \& \~E_NOTICE/;

s/^allow_call_time_pass_reference *=.*/allow_call_time_pass_reference = On/;

s/^log_errors *=.*/log_errors = Off/;

s/^short_open_tag *=.*/short_open_tag = On/;

END_SED_SCRIPT

问题集锦

/How to resolve error "Cannot redeclare class DateTime"

This appears to be a conflict with PHP 5.2.0.

1. Edit modules/Calendar/Date.php to make these two changes:

a. Change
class DateTime
to
class com_vtiger_DateTime
b. Search and replace
new DateTime
with
new com_vtiger_DateTime
at about a dozen places in Date.php.

2. Edit modules/Calendar/Appointment.php -- search and replace as per "b" above, two occurrences.

  1. Edit include/utils/RecurringType.php -- same search and replace, several times.

  2.  

 

进入页面后的出错信息,参考资料

http://trac.vtiger.com/cgi-bin/trac.cgi/browser/vtigercrm/branches/5.1/include/utils?rev=12459

里面有所有配置文件的模板,提示哪行出错就改成跟网上一样的就好了

Object of class users could not be converted to

CommonUtils.php把这个页面里的
/include/utils/CommonUtils.php 

把第3637行: (ish) $log->debug("Entering is_admin(".$user.") method ..."); 
修改成:
$log->debug("Entering is_admin(".$user->username.") method ..."); 

在第654行左右是: 
$log->debug("Entering getURLstring(".$focus.") method ..."); 
把此行屏蔽:
//$log->debug("Entering getURLstring(".$focus.") method ...");  ,

但是可以以后会莫名错误,所以应该改成

$log->debug("Entering getURLstring(".get_class($focus).") method ...");


/出现include/utils/ListViewUtils.php on line 442然后修改:
/include/utils/ListViewUtils.php 

 

同样把第442行由: 
// $log->debug("Entering getListViewEntries(".$focus.",". $module." ,".$list_result.",".$navigation_array.",".$relatedlist.",".$returnset.", ".$edit_action.",".$del_action.",".$oCv.") method ...");

 

改为

$log->debug("Entering getListViewEntries(".get_class($focus).",". $module.",".$list_result.",".$navigation_array.",".$relatedlist.",".$returnset.",".$edit_action.",".$del_action.",".get_class($oCv).") method ...");

 

 

 

 

 

 

/出现/include/utils/SearchUtils.php on line 36

修改

include/utils/SearchUtils.php 36行左右,

// $log->debug("Entering getSearchListHeaderValues(".$focus.",". $m odule.",".$sort_qry.",".$sorder.",".$order_by.",".$relatedlist.",".$oCv. ") method ...");

 

改为


$log->debug("Entering getSearchListHeaderValues(".get_class($focus).",". $module.",".$sort_qry.",".$sorder.",".$order_by.",".$relatedlist.",".get_class($oCv).") method ...");

 

/出现include/utils/ListViewUtils.php on line 986

 

改为

$log->debug("Entering getValue(".$field_result.",". $list_result.",".$fieldname.",".get_class($focus).",".$module.",".$entity_id.",".$list_result_count.",".$mode.",".$popuptype.",".$returnset.",".$viewid.") method ...");

 

/出现include/utils/ListViewUtils.php on line 232

$log->debug("Entering getSearchListViewHeader(".$focus.",". $mod ule.",".$sort_qry.",".$sorder.",".$order_by.") method ...");

改为

$log->debug("Entering getSearchListViewHeader(".get_class($focus).",". $module.",".$sort_qry.",".$sorder.",".$order_by.") method ...");

 

八出现include/utils/ListViewUtils.php on line 795

$log->debug("Entering getSearchListViewEntries(".$focus.",". $mo dule.",".$list_result.",".$navigation_array.") method ...");

改为

$log->debug("Entering getSearchListViewEntries(".get_class($focus).",". $module.",".$list_result.",".$navigation_array.") method ...");

 

九出现include/utils/CommonUtils.php on line 1555

$log->debug("Entering setObjectValuesFromRequest(".$focus.") met hod ...");

改成

$log->debug("Entering setObjectValuesFromRequest(".get_class($focus).") method ...");

 

/出现include/utils/InventoryUtils.php on line 475

$log->debug("Entering into function saveInventoryProductDetails( $focus, $module).");

改成

$log->debug("Entering into function saveInventoryProductDetails($module).");

 

十一/出现include/utils/InventoryUtils.php on line 640

$log->debug("Exit from function saveInventoryProductDetails($foc us, $module).");

改成

$log->debug("Exit from function saveInventoryProductDetails($module).");

十二/出现/include/utils/DetailViewUtils.php on line 977

$log->debug("Entering getDetailAssociatedProducts(".$module.",". $focus.") method ...");

改为

$log->debug("Entering getDetailAssociatedProducts(".$module.",".get_class($focus).") method ...");

 

十三/出现include/utils/EditViewUtils.php on line 1386

$log->debug("Entering getAssociatedProducts($module,$focus,$seid ='') method ...");

改为

$log->debug("Entering getAssociatedProducts(".$module.",".get_class($focus).",".$seid."='') method ...");

 

十四/出现modules/Calendar/Calendar.php on line 35

 

modules/Calendar/Calendar.php. 35

 

Search and replace

new DateTime
with

new com_vtiger_DateTime

 

 

/汉化

把语言包里的includemodules拷贝到crm

 

切记,复制好了后权限改为777,所有者组为apacheapache

#chmod -R 777 include

#chown -R apache:apache include

chmod -R 777 modules

#chown -R apache:apache modules

有这些文件

include/language/zh_cn.lang.php

modules/Users/language/zh_cn.lang.php

modules/Home/language/zh_cn.lang.php

modules/Dashboard/language/zh_cn.lang.php

modules/SalesOrder/language/zh_cn.lang.php

 

统计图里面那的中文不显示。

找到config.inc.php
(大概)第172行:
$languages = Array('en_us'=>'US English',);
改为:
$languages = Array('zh_cn'=>'Simplized Chinese','en_us'=>'US English',);
(大概)第180行:
$default_charset = 'ISO8859-1';
改为:
$default_charset = 'UTF-8';
(大概)第184行:
$default_language = 'en_us';
改为:
$default_language = 'zh_cn';
注意 这个‘zh_cn’要与你语言包的前缀符合。否则也会出错。

 

统计图表中文字体的问题
vtiger CRMImage\Canvas\Fonts目录下添加中文字体,例如simsun.ttf,然后修改fontmap.txt,添加一行:
Simsun,simsun.ttf
然后修改include\utils\GraphUntils.php
42行:
case 'cn_zh':
改为
case 'zh_cn':

这里有几点必须要说明。比如我的机器xp系统simsun字体是TTC,也就是是混合字体,这没法用,要么你搞个工具去转换,要么换个字体,当然为了省事还是换字体,SIMHEI这个字体也可以使用,就把include/untils/GraphUtils.php这个文件里面的所有SIMSUN都替换成SIMHEI。然后这样就可以了。
汉化过程中还有可能出现没有gdimap等库,把ext文件夹拷贝到 windows下面重启现apache就可以了。

3
。登陆那里中文不显示。比如选择语言我要加 简体中文,改了config.ini.php的设置后 出现乱码,把index.php页面属性设置成utf-8

4
。图片里的字有时还是乱码,那就是页面缓存的问题了,清除缓存,然后把p_w_picpath/cache 目录下的东西都删了,然后再刷新,就可以正常显示了。

5
WEBmail无效,提示 请在PHP里开通IMAP模块。这个好改。在php.ini里面找到extension=php_imap.dll
去掉前面分号。

目前已经可以达到china-vtiger演示页的效果了,但中文包里还是有些字段翻译的不太明确。我会在接下来的学习中一一更改