[Vtigercrm-commits] [vtiger-commits] r4292 - /vtigercrm/trunk/include/utils/UserInfoUtil.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Mar 18 05:58:54 EST 2006
Author: don
Date: Sat Mar 18 03:58:48 2006
New Revision: 4292
Log:
Delete Handling for Groups done
Modified:
vtigercrm/trunk/include/utils/UserInfoUtil.php
Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php
==============================================================================
--- vtigercrm/trunk/include/utils/UserInfoUtil.php (original)
+++ vtigercrm/trunk/include/utils/UserInfoUtil.php Sat Mar 18 03:58:48 2006
@@ -2367,6 +2367,40 @@
}
}
+/** Function to delete the group related sharing rules
+ * @param $roleid -- RoleId :: Type varchar
+ */
+function deleteGroupRelatedSharingRules($grpId)
+{
+
+ global $adb;
+ $dataShareTableColArr=Array('datashare_grp2grp'=>'share_groupid::to_groupid',
+ 'datashare_grp2role'=>'share_groupid',
+ 'datashare_grp2rs'=>'share_groupid',
+ 'datashare_role2group'=>'to_groupid',
+ 'datashare_rs2grp'=>'to_groupid');
+
+
+ foreach($dataShareTableColArr as $tablename=>$colname)
+ {
+ $colNameArr=explode('::',$colname);
+ $query="select shareid from ".$tablename." where ".$colNameArr[0]."=".$grpId;
+ if(sizeof($colNameArr) >1)
+ {
+ $query .=" or ".$colNameArr[1]."=".$grpId;
+ }
+
+
+ $result=$adb->query($query);
+ $num_rows=$adb->num_rows($result);
+ for($i=0;$i<$num_rows;$i++)
+ {
+ $shareid=$adb->query_result($result,$i,'shareid');
+ deleteSharingRule($shareid);
+ }
+
+ }
+}
/** Function to get userid and username of all users
@@ -2748,7 +2782,8 @@
deleteGroupRelatedGroups($groupId);
deleteGroupRelatedRoles($groupId);
deleteGroupRelatedRolesAndSubordinates($groupId);
- deleteGroupRelatedUsers($groupId);
+ deleteGroupRelatedUsers($groupId);
+ deleteGroupRelatedSharingRules($groupId);
}
More information about the vtigercrm-commits
mailing list