[Vtigercrm-commits] [vtiger-commits] r6171 - in /vtigercrm/trunk/modules: CustomView/SendMailAction.php Products/addPbProductRelToDB.php Users/updateLeadDBStatus.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 18 18:42:09 EDT 2006
Author: allanbush
Date: Thu May 18 16:42:06 2006
New Revision: 6171
Log:
Filter out extra blank id generated when applying a mass change to multiple entries at a time.
Modified:
vtigercrm/trunk/modules/CustomView/SendMailAction.php
vtigercrm/trunk/modules/Products/addPbProductRelToDB.php
vtigercrm/trunk/modules/Users/updateLeadDBStatus.php
Modified: vtigercrm/trunk/modules/CustomView/SendMailAction.php
==============================================================================
--- vtigercrm/trunk/modules/CustomView/SendMailAction.php (original)
+++ vtigercrm/trunk/modules/CustomView/SendMailAction.php Thu May 18 16:42:06 2006
@@ -35,6 +35,7 @@
{
foreach($storearray as $id)
{
+ if($id == '') continue;
if($camodule == "Contacts")
{
$sql="select * from contactdetails inner join crmentity on crmentity.crmid = contactdetails.contactid where crmentity.deleted =0 and contactdetails.contactid='" .$id ."'";
Modified: vtigercrm/trunk/modules/Products/addPbProductRelToDB.php
==============================================================================
--- vtigercrm/trunk/modules/Products/addPbProductRelToDB.php (original)
+++ vtigercrm/trunk/modules/Products/addPbProductRelToDB.php Thu May 18 16:42:06 2006
@@ -24,12 +24,14 @@
$storearray = explode(";",$idlist);
foreach($storearray as $id)
{
- $lp_name = $id.'_listprice';
- $list_price = $_REQUEST[$lp_name];
- //Updating the pricebook product rel table
- $log->info("Products :: Inserting products to price book");
- $query= "insert into pricebookproductrel (pricebookid,productid,listprice) values(".$pricebook_id.",".$id.",".$list_price.")";
- $adb->query($query);
+ if($id != '') {
+ $lp_name = $id.'_listprice';
+ $list_price = $_REQUEST[$lp_name];
+ //Updating the pricebook product rel table
+ $log->info("Products :: Inserting products to price book");
+ $query= "insert into pricebookproductrel (pricebookid,productid,listprice) values(".$pricebook_id.",".$id.",".$list_price.")";
+ $adb->query($query);
+ }
}
header("Location: index.php?module=PriceBooks&action=CallRelatedList&record=".$pricebook_id);
}
@@ -39,12 +41,14 @@
$storearray = explode(";",$idlist);
foreach($storearray as $id)
{
- $lp_name = $id.'_listprice';
- $list_price = $_REQUEST[$lp_name];
- //Updating the pricebook product rel table
- $log->info("Products :: Inserting PriceBooks to Product");
- $query= "insert into pricebookproductrel (pricebookid,productid,listprice) values(".$id.",".$productid.",".$list_price.")";
- $adb->query($query);
+ if($id != '') {
+ $lp_name = $id.'_listprice';
+ $list_price = $_REQUEST[$lp_name];
+ //Updating the pricebook product rel table
+ $log->info("Products :: Inserting PriceBooks to Product");
+ $query= "insert into pricebookproductrel (pricebookid,productid,listprice) values(".$id.",".$productid.",".$list_price.")";
+ $adb->query($query);
+ }
}
header("Location: index.php?module=Products&action=CallRelatedList&record=".$productid);
}
Modified: vtigercrm/trunk/modules/Users/updateLeadDBStatus.php
==============================================================================
--- vtigercrm/trunk/modules/Users/updateLeadDBStatus.php (original)
+++ vtigercrm/trunk/modules/Users/updateLeadDBStatus.php Thu May 18 16:42:06 2006
@@ -27,18 +27,22 @@
{
foreach($storearray as $id)
{
- $sql = "update crmentity set modifiedby=".$current_user->id.",smownerid='" .$idval ."', modifiedtime=".$adb->formatString("crmentity","modifiedtime",$date_var)." where crmid='" .$id."'";
- $result = $adb->query($sql);
+ if($id != '') {
+ $sql = "update crmentity set modifiedby=".$current_user->id.",smownerid='" .$idval ."', modifiedtime=".$adb->formatString("crmentity","modifiedtime",$date_var)." where crmid='" .$id."'";
+ $result = $adb->query($sql);
+ }
}
}
elseif(isset($_REQUEST['leadval']) && $_REQUEST['leadval']!='')
{
foreach($storearray as $id)
{
- $sql = "update leaddetails set leadstatus='" .$leadstatusval ."' where leadid='" .$id."'";
- $result = $adb->query($sql);
- $query = "update crmentity set modifiedby=".$current_user->id.",modifiedtime=".$adb->formatString("crmentity","modifiedtime",$date_var)." where crmid=".$id;
- $result1 = $adb->query($query);
+ if($id != '') {
+ $sql = "update leaddetails set leadstatus='" .$leadstatusval ."' where leadid='" .$id."'";
+ $result = $adb->query($sql);
+ $query = "update crmentity set modifiedby=".$current_user->id.",modifiedtime=".$adb->formatString("crmentity","modifiedtime",$date_var)." where crmid=".$id;
+ $result1 = $adb->query($query);
+ }
}
}
header("Location: index.php?module=$return_module&action=".$return_module."Ajax&file=ListView&ajax=changestate&viewname=".$viewid);
More information about the vtigercrm-commits
mailing list