[Vtigercrm-commits] [vtiger-commits] r7552 - /vtigercrm/trunk/include/js/ListView.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Jun 27 04:08:24 EDT 2006


Author: richie
Date: Tue Jun 27 02:08:21 2006
New Revision: 7552

Log:
issue in massdelete has been fixed ,#fixes 1354

Modified:
    vtigercrm/trunk/include/js/ListView.js

Modified: vtigercrm/trunk/include/js/ListView.js
==============================================================================
--- vtigercrm/trunk/include/js/ListView.js (original)
+++ vtigercrm/trunk/include/js/ListView.js Tue Jun 27 02:08:21 2006
@@ -1,162 +1,133 @@
-/*********************************************************************************
-
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
- ********************************************************************************/
-function change(obj,divid)
-{
-	x = document.massdelete.selected_id.length;
-	var viewid = document.massdelete.viewname.value;
-
-	idstring = "";
-	if ( x == undefined)
-	{
-	
-		if (document.massdelete.selected_id.checked)
-		{
-			document.massdelete.idlist.value=document.massdelete.selected_id.value +";";
-		}
-		else 
-		{
-			alert("Please select atleast one entity ");
-			return false;
-		}
-	}
-	else
-	{
-		xx = 0;
-		for(i = 0; i < x ; i++)
-		{
-			if(document.massdelete.selected_id[i].checked)
-			{
-				idstring = document.massdelete.selected_id[i].value +";"+idstring
-			xx++	
-			}
-		}
-		if (xx != 0)
-		{
-			document.massdelete.idlist.value=idstring;
-		}
-		else
-		{
-			alert("Please select atleast one entity");
-			return false;
-		}
-	}
-	fnvshobj(obj,divid);
-}
-function massDelete(module)
-{
-        x = document.massdelete.selected_id.length;
-		var viewid = document.massdelete.viewname.value;
-        idstring = "";
-
-        if ( x == undefined)
-        {
-
-                if (document.massdelete.selected_id.checked)
-                {
-                        idstring = document.massdelete.selected_id.value+';';
-                		xx = 1;
-                }
-                else
-                {
-                        alert("Please select atleast one entity");
-                        return false;
-                }
-        }
-        else
-        {
-                xx = 0;
-                for(i = 0; i < x ; i++)
-                {
-                        if(document.massdelete.selected_id[i].checked)
-                        {
-                                idstring = document.massdelete.selected_id[i].value +";"+idstring
-                        xx++
-                        }
-                }
-                if (xx != 0)
-                {
-                        document.massdelete.idlist.value=idstring;
-                }
-               else
-                {
-                        alert("Please select atleast one entity");
-                        return false;
-                }
-        }
-		if(confirm("Are you sure you want to delete the selected "+xx+" records ?"))
-		{
-			
-			$("status").style.display="inline";
-			new Ajax.Request(
-          	  	      'index.php',
-			      	{queue: {position: 'end', scope: 'command'},
-		                        method: 'post',
-                		        postBody:"module=Users&action=massdelete&return_module="+module+"&viewname="+viewid+"&idlist="+idstring,
-		                        onComplete: function(response) {
-        	        	                $("status").style.display="none";
-                	        	        result = response.responseText.split('&#&#&#');
-                        	        	$("ListViewContents").innerHTML= result[2];
-	                        	        if(result[1] != '')
-                                        		alert(result[1]);
-		                        }
-              			 }
-       			);
-		}
-		else
-		{
-			return false;
-		}
-
-}
-
-function showDefaultCustomView(selectView,module)
-{
-	$("status").style.display="inline";
-	var viewName = selectView.options[selectView.options.selectedIndex].value;
-	new Ajax.Request(
-               	'index.php',
-                {queue: {position: 'end', scope: 'command'},
-                       	method: 'post',
-                        postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName,
-                        onComplete: function(response) {
-                        $("status").style.display="none";
-                        result = response.responseText.split('&#&#&#');
-                        $("ListViewContents").innerHTML= result[2];
-                        if(result[1] != '')
-                               	alert(result[1]);
-                        }
-                }
-	);
-}
-
-
-function getListViewEntries_js(module,url)
-{
-	$("status").style.display="inline";
-	if($('search_url').value!='')
-                urlstring = $('search_url').value;
-	else
-		urlstring = '';
-        new Ajax.Request(
-        	'index.php',
-                {queue: {position: 'end', scope: 'command'},
-                	method: 'post',
-                        postBody:"module="+module+"&action="+module+"Ajax&file=index&ajax=true&"+url+urlstring,
-			onComplete: function(response) {
-                        	$("status").style.display="none";
-                                result = response.responseText.split('&#&#&#');
-                                $("ListViewContents").innerHTML= result[2];
-                                if(result[1] != '')
-                                        alert(result[1]);
-                  	}
-                }
-        );
-}
-
+/*********************************************************************************
+
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+ ********************************************************************************/
+function change(obj,divid)
+{
+	var select_options  =  document.getElementsByName('selected_id');
+	var x = select_options.length;
+	var viewid = document.massdelete.viewname.value;
+	idstring = "";
+
+	xx = 0;
+	for(i = 0; i < x ; i++)
+	{
+		if(select_options[i].checked)
+		{
+			idstring = select_options[i].value +";"+idstring
+				xx++
+		}
+	}
+	if (xx != 0)
+	{
+		document.massdelete.idlist.value=idstring;
+	}
+	else
+	{
+		alert("Please select atleast one entity");
+		return false;
+	}
+	alert(document.massdelete.idlist.value)
+	fnvshobj(obj,divid);
+}
+function massDelete(module)
+{
+		var select_options  =  document.getElementsByName('selected_id');
+		var x = select_options.length;
+		var viewid = document.massdelete.viewname.value;
+        idstring = "";
+
+        xx = 0;
+        for(i = 0; i < x ; i++)
+        {
+        	if(select_options[i].checked)
+            {
+            	idstring = select_options[i].value +";"+idstring
+                xx++
+            }
+        }
+        if (xx != 0)
+        {
+            document.massdelete.idlist.value=idstring;
+        }
+        else
+        {
+            alert("Please select atleast one entity");
+            return false;
+        }
+		if(confirm("Are you sure you want to delete the selected "+xx+" records ?"))
+		{
+			
+			$("status").style.display="inline";
+			alert("module=Users&action=massdelete&return_module="+module+"&viewname="+viewid+"&idlist="+idstring)
+			new Ajax.Request(
+          	  	      'index.php',
+			      	{queue: {position: 'end', scope: 'command'},
+		                        method: 'post',
+                		        postBody:"module=Users&action=massdelete&return_module="+module+"&viewname="+viewid+"&idlist="+idstring,
+		                        onComplete: function(response) {
+        	        	                $("status").style.display="none";
+                	        	        result = response.responseText.split('&#&#&#');
+                        	        	$("ListViewContents").innerHTML= result[2];
+	                        	        if(result[1] != '')
+                                        		alert(result[1]);
+		                        }
+              			 }
+       			);
+		}
+		else
+		{
+			return false;
+		}
+
+}
+
+function showDefaultCustomView(selectView,module)
+{
+	$("status").style.display="inline";
+	var viewName = selectView.options[selectView.options.selectedIndex].value;
+	new Ajax.Request(
+               	'index.php',
+                {queue: {position: 'end', scope: 'command'},
+                       	method: 'post',
+                        postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName,
+                        onComplete: function(response) {
+                        $("status").style.display="none";
+                        result = response.responseText.split('&#&#&#');
+                        $("ListViewContents").innerHTML= result[2];
+                        if(result[1] != '')
+                               	alert(result[1]);
+                        }
+                }
+	);
+}
+
+
+function getListViewEntries_js(module,url)
+{
+	$("status").style.display="inline";
+	if($('search_url').value!='')
+                urlstring = $('search_url').value;
+	else
+		urlstring = '';
+        new Ajax.Request(
+        	'index.php',
+                {queue: {position: 'end', scope: 'command'},
+                	method: 'post',
+                        postBody:"module="+module+"&action="+module+"Ajax&file=index&ajax=true&"+url+urlstring,
+			onComplete: function(response) {
+                        	$("status").style.display="none";
+                                result = response.responseText.split('&#&#&#');
+                                $("ListViewContents").innerHTML= result[2];
+                                if(result[1] != '')
+                                        alert(result[1]);
+                  	}
+                }
+        );
+}
+





More information about the vtigercrm-commits mailing list