[Vtigercrm-commits] [vtiger-commits] r6912 - /vtigercrm/trunk/Smarty/templates/GroupEditView.tpl

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Jun 7 02:05:42 EDT 2006


Author: saraj
Date: Wed Jun  7 00:05:38 2006
New Revision: 6912

Log:
ajax functionality has been modified

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

Modified: vtigercrm/trunk/Smarty/templates/GroupEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/GroupEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/GroupEditView.tpl Wed Jun  7 00:05:38 2006
@@ -15,23 +15,26 @@
 
 function dup_validation()
 {ldelim}
-        //show("status");
-        var ajaxObj = new VtigerAjax(ajaxSaveResponse);
-        var groupname = document.getElementById('groupName').value;
-        var mode = getObj('mode').value;
-        var groupid = getObj('groupId').value;
-        if(mode == 'edit')
-                var urlstring ="module=Users&action=UsersAjax&file=SaveGroup&ajax=true&dup_check=true&mode="+mode+"&groupName="+groupname+"&groupid="+groupid;
-        else
-                var urlstring ="module=Users&action=UsersAjax&file=SaveGroup&ajax=true&dup_check=true&groupName="+groupname;
-        ajaxObj.process("index.php?",urlstring);
-{rdelim}
-function ajaxSaveResponse(response)
-{ldelim}
-        if(response.responseText == 'SUCESS')
-                document.newGroupForm.submit();
-        else
-                alert(response.responseText);
+	var mode = getObj('mode').value;
+	var groupname = $('groupName').value;
+	var groupid = getObj('groupId').value;
+	if(mode == 'edit')
+		var reminstr = '&mode='+mode+'&groupName='+groupname+'&groupid='+groupid;
+	else
+		var reminstr = '&groupName='+groupname;
+	new Ajax.Request(
+		'index.php',
+		{ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+			method: 'post',
+			postBody: 'module=Users&action=UsersAjax&file=SaveGroup&ajax=true&dup_check=true'+reminstr,
+			onComplete: function(response) {ldelim}
+				if(response.responseText == 'SUCESS')
+					document.newGroupForm.submit();
+				else
+					alert(response.responseText);
+			{rdelim}
+		{rdelim}
+	);
 {rdelim}
 
 var constructedOptionValue;





More information about the vtigercrm-commits mailing list