[Vtigercrm-commits] [vtiger-commits] r10739 - in /vtigercrm/branches/5.0.3/include: Ajax/TagCloud.php js/dtlviewajax.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 19 12:08:43 EDT 2007


Author: richie
Date: Thu Apr 19 10:08:37 2007
New Revision: 10739

Log:
* Fixed the issue with umlaut characters, Fixed #3387

Modified:
    vtigercrm/branches/5.0.3/include/Ajax/TagCloud.php
    vtigercrm/branches/5.0.3/include/js/dtlviewajax.js

Modified: vtigercrm/branches/5.0.3/include/Ajax/TagCloud.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/Ajax/TagCloud.php (original)
+++ vtigercrm/branches/5.0.3/include/Ajax/TagCloud.php Thu Apr 19 10:08:37 2007
@@ -10,6 +10,8 @@
   ********************************************************************************/
 $ajaxaction = $_REQUEST['ajxaction'];
 global $current_user;
+global $default_charset;
+
 $crmid = $_REQUEST["recordid"];
 $module = $_REQUEST["module"];
 $userid = $current_user->id;
@@ -17,15 +19,22 @@
 {
 	
 	require_once('include/freetag/freetag.class.php');
-	$tagfields = $_REQUEST["tagfields"];
-    	$freetag = new freetag();
-	if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+	$tagfields=$_REQUEST['tagfields'];
+	$tagfields =str_replace(array("'",'"'),'',iconv("UTF-8",$default_charset,$_REQUEST['tagfields']));
+	if($tagfields != "")
 	{
-	      	$freetag->tag_object($userid,$crmid,$tagfields,$module);
-	  	$tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid);
-	  	echo $tagcloud;
+    		$freetag = new freetag();
+		if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "")
+		{
+			$freetag->tag_object($userid,$crmid,$tagfields,$module);
+			$tagcloud = $freetag->get_tag_cloud_html($module,$userid,$crmid);
+			echo $tagcloud;
+		}
 	}
-
+	else
+	{
+		echo ":#:FAILURE";
+	}
 }
 elseif($ajaxaction == 'GETTAGCLOUD')
 {

Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/dtlviewajax.js (original)
+++ vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Thu Apr 19 10:08:37 2007
@@ -414,11 +414,16 @@
 		'index.php',
                 {queue: {position: 'end', scope: 'command'},
                         method: 'post',
-                        postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +escape(tagValue),
-                        onComplete: function(response) {
-				        getObj('tagfields').innerHTML = response.responseText;
+                       postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue,
+                       onComplete: function(response) {
+					if(response.responseText.indexOf(":#:FAILURE") > -1)
+					{
+						alert(alert_arr.VALID_DATA)
+					}else{
+				        	getObj('tagfields').innerHTML = response.responseText;
+						$(tagfield).value = '';
+					}
 					$("vtbusy_info").style.display="none";
-					$(tagfield).value = '';
                         }
                 }
         );





More information about the vtigercrm-commits mailing list