[Vtigercrm-commits] [vtiger-commits] r7905 - in /branches/VTIGERCRM-5.0.2-MMBRICH: include/js/objects/CommSystem.js modules/CommSystem/CommSystemAjax.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Jul 8 17:05:44 EDT 2006
Author: mmbrich
Date: Sat Jul 8 15:05:43 2006
New Revision: 7905
Log:
fix for newline issues
Modified:
branches/VTIGERCRM-5.0.2-MMBRICH/include/js/objects/CommSystem.js
branches/VTIGERCRM-5.0.2-MMBRICH/modules/CommSystem/CommSystemAjax.php
Modified: branches/VTIGERCRM-5.0.2-MMBRICH/include/js/objects/CommSystem.js
==============================================================================
--- branches/VTIGERCRM-5.0.2-MMBRICH/include/js/objects/CommSystem.js (original)
+++ branches/VTIGERCRM-5.0.2-MMBRICH/include/js/objects/CommSystem.js Sat Jul 8 15:05:43 2006
@@ -147,7 +147,7 @@
'index.php',
{queue: {position: 'end', scope: 'commsys'},
method: 'post',
- postBody: 'module=CommSystem&action=CommSystemAjax&command=sendChatMessage&receivers='+otheruser+'&msg='+msg+'&msg_type=P2PIM',
+ postBody: 'module=CommSystem&action=CommSystemAjax&command=sendChatMessage&receivers='+otheruser+'&msg='+msg.stripTags()+'&msg_type=P2PIM',
onComplete: function(response) {
if(response.responseText != "failed") {
globalCommSystem.ShowNewChatMessage(msgStruct,"");
@@ -380,12 +380,14 @@
UserTyping: function(evt) {
window.clearTimeout(this.keytimer);
var tname = "status_bar_"+Event.element(evt).name;
- if(evt.type === "keypress") {
+ if(evt.type === "keypress" && evt.keyCode != Event.KEY_RETURN) {
if(globalCommSystem.keycount == 0) {
globalCommSystem.SendStatusMessage('begin',Event.element(evt).name);
globalCommSystem.keycount++;
}
globalCommSystem.keytimer = window.setTimeout('globalCommSystem.UserStopTyping("'+Event.element(evt).name+'")',2000);
+ } else if (evt.keyCode == Event.KEY_RETURN) {
+ //globalCommSystem.SendMsg(evt);
}
},
Modified: branches/VTIGERCRM-5.0.2-MMBRICH/modules/CommSystem/CommSystemAjax.php
==============================================================================
--- branches/VTIGERCRM-5.0.2-MMBRICH/modules/CommSystem/CommSystemAjax.php (original)
+++ branches/VTIGERCRM-5.0.2-MMBRICH/modules/CommSystem/CommSystemAjax.php Sat Jul 8 15:05:43 2006
@@ -60,7 +60,7 @@
$ret .= '},';
}
}
- if($_SESSION["refresh_count"] >= 20) {
+ if($_SESSION["refresh_count"] >= 60) {
$_SESSION["refresh_count"] = 1;
$email_cnt = $commSys->CheckEmails();
@@ -94,10 +94,10 @@
if($_REQUEST["command"] == "sendChatMessage") {
require_once("modules/CommSystem/CommSystem.php");
$commSys = new CommSystem();
- if($commSys->SendAlert(nl2br($_REQUEST["msg"]),$_REQUEST["msg_type"],'0',$_SESSION["authenticated_user_id"],$_REQUEST["receivers"]) == "false")
+ if($commSys->SendAlert(str_replace("\n","<br>",trim($_REQUEST["msg"])),$_REQUEST["msg_type"],'0',$_SESSION["authenticated_user_id"],$_REQUEST["receivers"]) == "false")
echo "failed";
else
- echo nl2br($_REQUEST["msg"]);
+ echo str_replace("\n","<br>",$_REQUEST["msg"]);
}
if($_REQUEST["command"] == "sendStatusMessage") {
$ret = send_typing_message($_REQUEST["receivers"]);
More information about the vtigercrm-commits
mailing list