[Vtigercrm-commits] [vtiger-commits] r6937 - /vtigercrm/trunk/Smarty/templates/ListRoles.tpl

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Jun 7 07:47:34 EDT 2006


Author: saraj
Date: Wed Jun  7 05:47:30 2006
New Revision: 6937

Log:
ajax functionality has been modified

Modified:
    vtigercrm/trunk/Smarty/templates/ListRoles.tpl

Modified: vtigercrm/trunk/Smarty/templates/ListRoles.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListRoles.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListRoles.tpl Wed Jun  7 05:47:30 2006
@@ -160,8 +160,8 @@
 	
 	function put_child_ID(currObj)
 	{ldelim}
-			var move_Element = document.getElementById('Drag_content');
-	 		parentName  = document.getElementById(currObj).innerHTML;
+			var move_Element = $('Drag_content');
+	 		parentName  = $(currObj).innerHTML;
 			parentId = currObj;
 			move_Element.style.display = 'none';
 			hideAll = false;	
@@ -175,29 +175,28 @@
 			{ldelim}
 				childId = childId.replace(/user_/gi,'');
 				parentId = parentId.replace(/user_/gi,'');
-        			var ajaxObj = new VtigerAjax(ajaxSaveResponse);
-				
-                		var urlstring ="module=Users&action=UsersAjax&file=RoleDragDrop&ajax=true&parentId="+parentId+"&childId="+childId;
-        			ajaxObj.process("index.php?",urlstring);
+				new Ajax.Request(
+  					'index.php',
+				        {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+					        method: 'post',
+					        postBody: 'module=Users&action=UsersAjax&file=RoleDragDrop&ajax=true&parentId='+parentId+'&childId='+childId,
+						onComplete: function(response) {ldelim}
+							if(response.responseText != 'You cannot move a Parent Node under a Child Node')
+							{ldelim}
+						                $('RoleTreeFull').innerHTML=response.responseText;
+						                hideAll = false;
+							        parentId = "";
+						                parentName = "";
+						                childId ="NULL";
+								childName = "NULL";
+						        {rdelim}
+						        else
+						                alert(response.responseText);
+			                        {rdelim}
+				        {rdelim}
+				);
 			{rdelim}
 	{rdelim}
-
-
-	function ajaxSaveResponse(response)
-	{ldelim}
-        if(response.responseText != 'You cannot move a Parent Node under a Child Node')
-	{ldelim}
-                document.getElementById('RoleTreeFull').innerHTML=response.responseText;
-		hideAll = false;
-		parentId = "";
-		parentName = "";
-		childId ="NULL";
-		childName = "NULL";
-	{rdelim}
-        else
-                alert(response.responseText);
-	{rdelim}
-
 
 	function fnVisible(Obj)
 	{ldelim}





More information about the vtigercrm-commits mailing list