[Vtigercrm-commits] [vtiger-commits] r7299 - /vtigercrm/trunk/modules/Activities/updateRelations.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Jun 20 09:08:06 EDT 2006


Author: saraj
Date: Tue Jun 20 07:08:02 2006
New Revision: 7299

Log:
changes made to have multiselect checkbox in users popup

Modified:
    vtigercrm/trunk/modules/Activities/updateRelations.php

Modified: vtigercrm/trunk/modules/Activities/updateRelations.php
==============================================================================
--- vtigercrm/trunk/modules/Activities/updateRelations.php (original)
+++ vtigercrm/trunk/modules/Activities/updateRelations.php Tue Jun 20 07:08:02 2006
@@ -13,7 +13,7 @@
 global $adb;
 $idlist = $_REQUEST['idlist'];
 
-if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '')
+if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '' && $_REQUEST['destination_module'] == 'Contacts')
 {
 	//split the string and store in an array
 	$storearray = explode (";",$idlist);
@@ -40,14 +40,29 @@
 
 
  
-//This if for adding the vtiger_users 
-if(isset($_REQUEST['user_id']) && $_REQUEST['user_id'] != '')
+//This if for adding the vtiger_users
+if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '' && $_REQUEST['destination_module'] == 'Users')
+{
+	//split the string and store in an array
+	$storearray = explode (";",$idlist);
+	foreach($storearray as $id)
+	{
+		if($id != '')
+		{
+			$record = $_REQUEST['parentid'];
+			$sql = "insert into vtiger_salesmanactivityrel values (".$id.",".$_REQUEST["parentid"].")";
+			$adb->query($sql);
+		}
+	}
+	header("Location: index.php?action=CallRelatedList&module=Activities&activity_mode=Events&record=".$record);
+}
+elseif(isset($_REQUEST['user_id']) && $_REQUEST['user_id'] != '')
 {
 	$record = $_REQUEST['record'];
 	$sql = "insert into vtiger_salesmanactivityrel values (". $_REQUEST["user_id"] .",".$_REQUEST["record"] .")";
 	$adb->query($sql);
 	header("Location: index.php?action=CallRelatedList&module=Activities&activity_mode=Events&record=".$record);
-
+	
 }
 
 





More information about the vtigercrm-commits mailing list