[Vtigercrm-commits] [vtiger-commits] r11117 - in /vtigercrm/branches/5.0.3/modules: CustomView/CustomView.php Reports/ReportRun.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue May 29 04:55:17 EDT 2007


Author: jerrydgeorge
Date: Tue May 29 02:55:05 2007
New Revision: 11117

Log:
Issues in CustomView and Reports has been fixed

Modified:
    vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php
    vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php

Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php (original)
+++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Tue May 29 02:55:05 2007
@@ -940,7 +940,7 @@
 			"vendor_id"=>"vtiger_vendor.vendorname",
 			"potentialid"=>"vtiger_potential.potentialname",
 
-			//"vtiger_account.parentid"=>"vtiger_account2.accountname",
+			"vtiger_account.parentid"=>"vtiger_account2.accountname",
 			"quoteid"=>"vtiger_quotes.subject",
 			"salesorderid"=>"vtiger_salesorder.subject",
 			"campaignid"=>"vtiger_campaign.campaignname",
@@ -962,13 +962,18 @@
 		}
 		elseif($change_table_field[$tablename.".".$fieldname] != '')//Added to handle special cases
 		{
-			$value = $change_table_field[$tablename.".".$fieldname].$this->getAdvComparator($comparator,$value,$datatype);
-		}
-		else if($fieldname == "handler")
+			$tmp_value = '';
+			if((($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($value) == '') || (($comparator == 'n' || $comparator == 'k') && trim($value) != ''))
+			{
+				$tmp_value = $change_table_field[$tablename.".".$fieldname].' IS NULL or ';
+			}
+			$value = $tmp_value.$change_table_field[$tablename.".".$fieldname].$this->getAdvComparator($comparator,$value,$datatype);
+		}
+		elseif($fieldname == "handler")
 		{
 			$value = "vtiger_users.user_name".$this->getAdvComparator($comparator,$value,$datatype);
 		}
-		else if($fieldname == "crmid" || $fieldname == "parent_id" || $fieldname == 'parentid')
+		elseif($fieldname == "crmid" || $fieldname == "parent_id" || $fieldname == 'parentid')
 		{
 				$value = $this->getSalesRelatedName($comparator,$value,$datatype,$tablename,$fieldname);
 		}
@@ -1010,27 +1015,12 @@
 			$modulename=$adb->query_result($res,$s,"setype");
 			if($modulename == 'Accounts')
 			{
-				if($this->customviewmodule == 'Accounts' || $this->customviewmodule == 'Calendar')
-				{
-					if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '')
-					{
-						$value .= 'vtiger_account2.accountname IS NULL or ';
-					}elseif($comparator == 'n' || $comparator == 'k' && trim($adv_chk_value) != '')
-					{
-						$value .= 'vtiger_account2.accountname IS NULL or ';
-					}
-					$value .= 'vtiger_account2.accountname';
-				}
-				else
-				{
-					if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '')
-					{
-						$value .= 'vtiger_account.accountname IS NULL or ';
-					}
-
-					
-					$value .= 'vtiger_account.accountname';
-				}
+				if(($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '')
+				{
+					$value .= 'vtiger_account.accountname IS NULL or ';
+				}
+
+				$value .= 'vtiger_account.accountname';
 			}
 			if($modulename == 'Leads')
 			{

Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Tue May 29 02:55:05 2007
@@ -377,9 +377,7 @@
 					{
                                 		if($selectedfields[0] == 'vtiger_crmentityRelHelpDesk' && $selectedfields[1]=='setype')
                                 		{
-							$advorsql[] = "(case vtiger_crmentityRelHelpDesk.setype when 'Accoun
-ts' then vtiger_accountRelHelpDesk.accountname else concat(vtiger_contactdetailsRelHelpDesk.lastname,' ',vtiger_contactdetai
-lsRelHelpDesk.firstname) end) ". $this->getAdvComparator($comparator,trim($valuearray[$n]),$datatype);
+							$advorsql[] = "(case vtiger_crmentityRelHelpDesk.setype when 'Accounts' then vtiger_accountRelHelpDesk.accountname else concat(vtiger_contactdetailsRelHelpDesk.lastname,' ',vtiger_contactdetailsRelHelpDesk.firstname) end) ". $this->getAdvComparator($comparator,trim($valuearray[$n]),$datatype);
 
 		                                }
                         		        elseif($selectedfields[0] == 'vtiger_crmentityRelCalendar' && $selectedfields[1]=='setype')
@@ -419,7 +417,6 @@
 					$fieldvalue = "(vtiger_accountRelHelpDesk.accountname ".$this->getAdvComparator($comparator,trim($value),$datatype)." or vtiger_contactdetailsRelHelpDesk.lastname ".$this->getAdvComparator($comparator,trim($value),$datatype)." or vtiger_contactdetailsRelHelpDesk.firstname ".$this->getAdvComparator($comparator,trim($value),$datatype).")";
 
                                 }
-
                                 elseif($selectedfields[0] == 'vtiger_crmentityRelCalendar' && $selectedfields[1]=='setype')
                                 {
 					$fieldvalue = "(vtiger_accountRelCalendar.accountname ".$this->getAdvComparator($comparator,trim($value),$datatype)." or concat(vtiger_leaddetailsRelCalendar.lastname,' ',vtiger_leaddetailsRelCalendar.firstname) ".$this->getAdvComparator($comparator,trim($value),$datatype)." or vtiger_potentialRelCalendar.potentialname ".$this->getAdvComparator($comparator,trim($value),$datatype).")";





More information about the vtigercrm-commits mailing list