[Vtigercrm-commits] [vtiger-commits] r7766 - /vtigercrm/trunk/include/js/general.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Jul 4 07:14:03 EDT 2006


Author: saraj
Date: Tue Jul  4 05:13:59 2006
New Revision: 7766

Log:
changes made to fix the issue in activity relatedlist

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

Modified: vtigercrm/trunk/include/js/general.js
==============================================================================
--- vtigercrm/trunk/include/js/general.js (original)
+++ vtigercrm/trunk/include/js/general.js Tue Jul  4 05:13:59 2006
@@ -1638,6 +1638,7 @@
 {
 
         x = document.selectall.selected_id.length;
+	var y=0;
         var entity_id = window.opener.document.getElementById('parent_id').value
         var module = window.opener.document.getElementById('return_module').value
         document.selectall.action.value='updateRelations'
@@ -1648,7 +1649,8 @@
 
                 if (document.selectall.selected_id.checked)
                 {
-                        document.selectall.idlist.value=document.selectall.selected_id.value;
+			idstring = document.selectall.selected_id.value;
+                        y=1;
                 }
                 else
 		{
@@ -1658,34 +1660,34 @@
         }
         else
         {
-                xx = 0;
+                y=0;
                 for(i = 0; i < x ; i++)
                 {
                         if(document.selectall.selected_id[i].checked)
                         {
-                                idstring = document.selectall.selected_id[i].value +";"+idstring
-                        xx++
+                                idstring = document.selectall.selected_id[i].value +";"+idstring;
+                  		y=y+1;
                         }
                 }
-                if (xx != 0)
-                {
-                        document.selectall.idlist.value=idstring;
-                }
-                 else
-                {
-                        alert("Please select at least one entity");
-                        return false;
-                }
+	}
+	if (y != 0)
+        {
+        	document.selectall.idlist.value=idstring;
         }
-                if(confirm("Are you sure you want to add the selected "+xx+" records ?"))
-                {
-                        opener.document.location.href="index.php?module="+module+"&parentid="+entity_id+"&action=updateRelations&destination_module="+mod+"&idlist="+idstring;
+        else
+        {
+                alert("Please select at least one entity");
+                return false;
+        }
+        if(confirm("Are you sure you want to add the selected "+y+" records ?"))
+        {
+                opener.document.location.href="index.php?module="+module+"&parentid="+entity_id+"&action=updateRelations&destination_module="+mod+"&idlist="+idstring;
                 self.close();
-                }
-		else
-                {
-                        return false;
-                }
+        }
+	else
+        {
+                return false;
+        }
 }
 function ShowEmail(id)
 {





More information about the vtigercrm-commits mailing list