[Vtigercrm-developers] contributions invited for patches
ding jianting
dfar2008 at gmail.com
Wed Oct 4 06:40:59 PDT 2006
Hi,
To support UTF-8 in vtiger CRM, I have made some changes .
1.Ajax chat
I contacted with developer of Ajax chat. I got solution for UTF-8 problem.
vchat.php:
From:
<script type="text/javascript" src="modules/Contacts/js/ajax.js"></script>
<script type="text/javascript"
src="modules/Contacts/js/dom-drag_p.js"></script>
<script type="text/javascript"
src="modules/Contacts/js/css-window_p.js"></script>
<script type="text/javascript" src="modules/Contacts/js/chat.js"></script>
To:
<script type="text/javascript" charset="iso-8859-1"
src="modules/Contacts/js/ajax.js"></script>
<script type="text/javascript" charset="iso-8859-1"
src="modules/Contacts/js/dom-drag_p.js"></script>
<script type="text/javascript" charset="iso-8859-1"
src="modules/Contacts/js/css-window_p.js"></script>
<script type="text/javascript" charset="iso-8859-1"
src="modules/Contacts/js/chat.js"></script>
chat.php:
From:
function submit($msg, $to=0)
{
$msg = $this->msgParse($msg);
...
}
To:
function submit($msg, $to=0)
{
$msg = utf8RawUrlDecode($msg);
$msg = $this->msgParse($msg);
...
}
2.Add a function in PHP like unescape in javascript
utils.php:
/**
* the function is like unescape in javascript
* added by dingjianting on 2006-10-1 for picklist editor
*/
function utf8RawUrlDecode ($source) {
$decodedStr = "";
$pos = 0;
$len = strlen ($source);
while ($pos < $len) {
$charAt = substr ($source, $pos, 1);
if ($charAt == '%') {
$pos++;
$charAt = substr ($source, $pos, 1);
if ($charAt == 'u') {
// we got a unicode character
$pos++;
$unicodeHexVal = substr ($source, $pos, 4);
$unicode = hexdec ($unicodeHexVal);
$entity = "&#". $unicode . ';';
$decodedStr .= utf8_encode ($entity);
$pos += 4;
}
else {
// we have an escaped ascii character
$hexVal = substr ($source, $pos, 2);
$decodedStr .= chr (hexdec ($hexVal));
$pos += 2;
}
} else {
$decodedStr .= $charAt;
$pos++;
}
}
return $decodedStr;
}
3. Picklist Editor
UpdateComboValues.php:
From:
$fldPickList = $_REQUEST['listarea'];
To:
$fldPickList = $_REQUEST['listarea'];
//changed by dingjianting on 2006-10-1 for picklist editor
$fldPickList = utf8RawUrlDecode($fldPickList);
4.Ajax Edit
DetailViewAjax.php in each entity module:
From:
$fieldvalue = $_REQUEST["fieldValue"];
To:
$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]);
5.Custom Fields for Asia language
include/js/customview.js:
From:
var re1=/^[a-z\d\_ ]+$/i
if (!re1.test(str))
{
alert("Special characters are not allowed in Label field")
return false;
}
To:
/*
changed by dingjianting on 2006-10-1 for custom fields in setting
module
var re1=/^[a-z\d\_ ]+$/i
if (!re1.test(str))
{
alert("Special characters are not allowed in Label field")
return false;
}
*/
If any problems , Pls feel free to let me know.
Thanks and regards,
Tim Ding
On 10/4/06, Richie <richie at vtiger.com> wrote:
>
> Hi!
>
> We have our hands full here and we still have more bugs to fix.
> All contributions are invited for the bug-fixes/features.
> Do put a blurb here and post it in the trac.
>
> Thanks,
> Richie
>
> _______________________________________________
> Get started with Online collaboration office & productivity tools -
> http://zoho.com?vt
>
>
--
________________________________________
中国开源客户关系管理系统: http://www.c3crm.com
-----------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20061004/bbe07e3a/attachment-0004.html
More information about the vtigercrm-developers
mailing list