[Vtigercrm-commits] [vtiger-commits] r10477 - in /vtigercrm/branches/5.0.3/include/utils: DeleteUtils.php ListViewUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Mar 19 09:14:17 EDT 2007
Author: saraj
Date: Mon Mar 19 07:14:12 2007
New Revision: 10477
Log:
fix for Accounts relationship when delete accounts. --Minnie
Modified:
vtigercrm/branches/5.0.3/include/utils/DeleteUtils.php
vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
Modified: vtigercrm/branches/5.0.3/include/utils/DeleteUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/DeleteUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/DeleteUtils.php Mon Mar 19 07:14:12 2007
@@ -389,14 +389,14 @@
$adb->query($sql);
}
//Deleting Account related Sales Orders.
- $so_q = "select vtiger_crmentity.crmid from vtiger_crmentity inner join vtiger_salesorder on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid inner join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid where vtiger_crmentity.deleted=0 and vtiger_salesorder.accountid=".$record;
+ /*$so_q = "select vtiger_crmentity.crmid from vtiger_crmentity inner join vtiger_salesorder on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid inner join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid where vtiger_crmentity.deleted=0 and vtiger_salesorder.accountid=".$record;
$so_res = $adb->query($so_q);
for($k=0;$k < $adb->num_rows($so_res);$k++)
{
$so_id = $adb->query_result($so_res,$k,"crmid");
$sql = 'update vtiger_crmentity set deleted = 1 where crmid = '.$so_id;
$adb->query($sql);
- }
+ }*/
//Deleting Account related Quotes.
$quo_q = "select vtiger_crmentity.crmid from vtiger_crmentity inner join vtiger_quotes on vtiger_crmentity.crmid=vtiger_quotes.quoteid inner join vtiger_account on vtiger_account.accountid=vtiger_quotes.accountid where vtiger_crmentity.deleted=0 and vtiger_quotes.accountid=".$record;
$quo_res = $adb->query($quo_q);
@@ -407,14 +407,14 @@
$adb->query($sql);
}
//Deleting Account related Invoices.
- $inv_q = "select vtiger_crmentity.crmid from vtiger_crmentity inner join vtiger_invoice on vtiger_crmentity.crmid=vtiger_invoice.invoiceid inner join vtiger_account on vtiger_account.accountid=vtiger_invoice.accountid where vtiger_crmentity.deleted=0 and vtiger_invoice.accountid=".$record;
+ /*$inv_q = "select vtiger_crmentity.crmid from vtiger_crmentity inner join vtiger_invoice on vtiger_crmentity.crmid=vtiger_invoice.invoiceid inner join vtiger_account on vtiger_account.accountid=vtiger_invoice.accountid where vtiger_crmentity.deleted=0 and vtiger_invoice.accountid=".$record;
$inv_res = $adb->query($inv_q);
for($k=0;$k < $adb->num_rows($inv_res);$k++)
{
$inv_id = $adb->query_result($inv_res,$k,"crmid");
$sql = 'update vtiger_crmentity set deleted = 1 where crmid = '.$inv_id;
$adb->query($sql);
- }
+ }*/
//Deleting Contact-Account Relation.
$con_q = "update vtiger_contactdetails set accountid = null where accountid = ".$record;
$con_res = $adb->query($con_q);
Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Mon Mar 19 07:14:12 2007
@@ -2782,13 +2782,14 @@
{
if($relmodule == 'Accounts')
{
- $pot_query = "select potentialid from vtiger_potential where accountid=".$relmod_recordid;
+ $pot_query = "select vtiger_crmentity.crmid,vtiger_account.accountid,vtiger_potential.potentialid from vtiger_potential inner join vtiger_account on vtiger_account.accountid=vtiger_potential.accountid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid where vtiger_crmentity.deleted=0 and vtiger_potential.accountid=".$relmod_recordid;
$pot_result = $result = $adb->query($pot_query);
$rows = $adb->num_rows($pot_result);
+ $potids_comma = "";
if($rows != 0)
{
$j = 0;
- $potids_comma = "(";
+ $potids_comma .= "(";
for($k=0; $k < $rows; $k++)
{
$potential_ids = $adb->query_result($pot_result,$k,'potentialid');
More information about the vtigercrm-commits
mailing list