[Vtigercrm-commits] [vtiger-commits] r5296 - in /vtigercrm/trunk: Popup.php include/utils/ListViewUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 24 11:49:53 EDT 2006
Author: saraj
Date: Mon Apr 24 09:49:47 2006
New Revision: 5296
Log:
changes made to show non-selected records in the popup
Modified:
vtigercrm/trunk/Popup.php
vtigercrm/trunk/include/utils/ListViewUtils.php
Modified: vtigercrm/trunk/Popup.php
==============================================================================
--- vtigercrm/trunk/Popup.php (original)
+++ vtigercrm/trunk/Popup.php Mon Apr 24 09:49:47 2006
@@ -492,8 +492,11 @@
$query = 'select pricebook.*, pricebookproductrel.productid, pricebookproductrel.listprice, crmentity.crmid, crmentity.smownerid, crmentity.modifiedtime from pricebook inner join pricebookproductrel on pricebookproductrel.pricebookid = pricebook.pricebookid inner join crmentity on crmentity.crmid = pricebook.pricebookid where pricebookproductrel.productid='.$productid.' and crmentity.deleted=0';
}
else
- $query = getListQuery($currentModule);
-
+{
+ $where_relquery = getRelCheckquery($currentModule,$_REQUEST['return_module'],$_REQUEST['recordid']);
+ $query = getListQuery($currentModule,$where_relquery);
+}
+
if(isset($where) && $where != '')
{
$query .= ' and '.$where;
Modified: vtigercrm/trunk/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/ListViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/ListViewUtils.php Mon Apr 24 09:49:47 2006
@@ -1875,4 +1875,33 @@
return $output;
}
+/**This function return the entity ids that need to be excluded in popup listview for a given record
+Param $currentmodule - modulename of the entity to be selected
+Param $returnmodule - modulename for which the entity is assingned
+Param $recordid - the record id for which the entity is assigned
+Return tyep string.
+*/
+function getRelCheckquery($currentmodule,$returnmodule,$recordid)
+{
+ global $adb;
+ $skip_id = Array();
+ $where_relquery = "";
+
+ if($currentmodule=="Contacts" && $returnmodule == "Potentials")
+ {
+ $query = "select contactid from contpotentialrel where potentialid = ".$recordid;
+ $result = $adb->query($query);
+ if($adb->num_rows($result)!=0)
+ {
+ for($k=0;$k < $adb->num_rows($result);$k++)
+ {
+ $skip_id[]=$adb->query_result($result,$k,"contactid");
+ }
+ $skipids = constructList($skip_id,'INTEGER');
+ $where_relquery = "and contactdetails.contactid not in ".$skipids;
+ }
+ }
+ return $where_relquery;
+}
+
?>
More information about the vtigercrm-commits
mailing list