[Vtigercrm-commits] [vtiger-commits] r10689 - in /vtigercrm/branches/5.0.3: include/utils/ modules/Contacts/ modules/CustomView/ modules/Invoice/ modules/Potentials/ modules/Quotes/ modules/SalesOrder/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sun Apr 15 13:17:03 EDT 2007


Author: saraj
Date: Sun Apr 15 11:16:51 2007
New Revision: 10689

Log:
Potential records could not be sort by Account Name - fixed. Fixes #3332

Modified:
    vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
    vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php
    vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php
    vtigercrm/branches/5.0.3/modules/CustomView/PopulateCustomView.php
    vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php
    vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php
    vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php
    vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php

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 Sun Apr 15 11:16:51 2007
@@ -692,6 +692,7 @@
 					}
 					elseif($name=='Account Name')
 					{
+					
 						//modified for vtiger_customview 27/5
 						if($module == 'Accounts')
 						{
@@ -699,7 +700,14 @@
 							$account_name = getAccountName($account_id);
 							// Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2
 							$value = '<a href="index.php?module=Accounts&action=DetailView&record='.$account_id.'&parenttab='.$tabname.'" style="'.$P_FONT_COLOR.'">'.$account_name.'</a>'; // Armando Lüscher 05.07.2005 -> §priority -> Desc: inserted style="$P_FONT_COLOR"
-						}else
+						}
+						elseif($module == 'Potentials' || $module == 'Contacts' || $module == 'Invoice' || $module == 'SalesOrder' || $module == 'Quotes')//Potential,Contacts,Invoice,SalesOrder & Quotes  records   sort by Account Name
+                                                {
+							$accountname = $adb->query_result($list_result,$i-1,"accountname");
+							$accountid = getAccountId($accountname);
+							$value = '<a href="index.php?module=Accounts&action=DetailView&record='.$accountid.'&parenttab='.$tabname.'" style="'.$P_FONT_COLOR.'">'.$accountname.'</a>'; 
+     				                }
+						else
 						{
 							$account_id = $adb->query_result($list_result,$i-1,"accountid");
 							$account_name = getAccountName($account_id);
@@ -3237,5 +3245,18 @@
 	
 	return $del_link;
 }
+ function getAccountId($account_name)
+        {
+                 global $log;
+                $log->info("in getAccountId ".$account_name);
+                global $adb;
+                if($account_name != '')
+                {
+                        $sql = "select accountid from vtiger_account where accountname='".$account_name."'";
+                        $result = $adb->query($sql);
+                        $accountid = $adb->query_result($result,0,"accountid");
+                }
+                return $accountid;
+        }
 
 ?>

Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Sun Apr 15 11:16:51 2007
@@ -47,7 +47,7 @@
 
 	var $column_fields = Array();
 	
-	var $sortby_fields = Array('lastname','firstname','title','email','phone','smownerid','accountid');
+	var $sortby_fields = Array('lastname','firstname','title','email','phone','smownerid','accountname');
 
 	var $list_link_field= 'lastname';
 

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 Sun Apr 15 11:16:51 2007
@@ -243,7 +243,10 @@
 
 			}
 			$fieldlabel1 = str_replace(" ","_",$fieldlabel);
-			$optionvalue = $fieldtablename.":".$fieldcolname.":".$fieldname.":".$module."_".$fieldlabel1.":".$fieldtypeofdata;
+			if($fieldname == 'account_id')//Potential,Contacts,Invoice,SalesOrder & Quotes  records   sort by Account Name 
+				$optionvalue = "vtiger_account:accountname:accountname:".$module."_".$fieldlabel1.":".$fieldtypeofdata;
+			else
+				$optionvalue = $fieldtablename.":".$fieldcolname.":".$fieldname.":".$module."_".$fieldlabel1.":".$fieldtypeofdata;
 			//added to escape attachments fields in customview as we have multiple attachments
 			if($module != 'HelpDesk' || $fieldname !='filename')
 				$module_columnlist[$optionvalue] = $fieldlabel;

Modified: vtigercrm/branches/5.0.3/modules/CustomView/PopulateCustomView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/CustomView/PopulateCustomView.php (original)
+++ vtigercrm/branches/5.0.3/modules/CustomView/PopulateCustomView.php Sun Apr 15 11:16:51 2007
@@ -203,7 +203,7 @@
 		   Array('vtiger_contactdetails:firstname:firstname:Contacts_First_Name:V',
                          'vtiger_contactdetails:lastname:lastname:Contacts_Last_Name:V',
                          'vtiger_contactdetails:title:title:Contacts_Title:V',
-                         'vtiger_contactdetails:accountid:account_id:Contacts_Account_Name:I',
+                         'vtiger_account:accountname:accountname:Contacts_Account_Name:V',
                          'vtiger_contactdetails:email:email:Contacts_Email:E',
                          'vtiger_contactdetails:phone:phone:Contacts_Office_Phone:V',
 			 'vtiger_crmentity:smownerid:assigned_user_id:Contacts_Assigned_To:V'),
@@ -219,7 +219,7 @@
 		   Array('vtiger_contactdetails:firstname:firstname:Contacts_First_Name:V',
                          'vtiger_contactdetails:lastname:lastname:Contacts_Last_Name:V',
                          'vtiger_contactdetails:title:title:Contacts_Title:V',
-                         'vtiger_contactdetails:accountid:account_id:Contacts_Account_Name:I',
+                         'vtiger_contactdetails:accountid:account_id:Contacts_Account_Name:V',
                          'vtiger_contactdetails:email:email:Contacts_Email:E',
 			 'vtiger_contactsubdetails:otherphone:otherphone:Contacts_Phone:V',
 			 'vtiger_crmentity:smownerid:assigned_user_id:Contacts_Assigned_To:V'),
@@ -267,20 +267,20 @@
 			 'vtiger_quotes:subject:subject:Quotes_Subject:V',
                          'vtiger_quotes:quotestage:quotestage:Quotes_Quote_Stage:V',
                          'vtiger_quotes:potentialid:potential_id:Quotes_Potential_Name:I',
-                         'vtiger_quotes:accountid:account_id:Quotes_Account_Name:I',
+                         'vtiger_account:accountname:accountname:Quotes_Account_Name:V',
                          'vtiger_quotes:total:hdnGrandTotal:Quotes_Total:I',
 			 'vtiger_crmentity:smownerid:assigned_user_id:Quotes_Assigned_To:V'),
 
 		   Array('vtiger_quotes:subject:subject:Quotes_Subject:V',
                          'vtiger_quotes:quotestage:quotestage:Quotes_Quote_Stage:V',
                          'vtiger_quotes:potentialid:potential_id:Quotes_Potential_Name:I',
-                         'vtiger_quotes:accountid:account_id:Quotes_Account_Name:I',
+			 'vtiger_account:accountname:accountname:Quotes_Account_Name:V'
                          'vtiger_quotes:validtill:validtill:Quotes_Valid_Till:D',
 			 'vtiger_crmentity:smownerid:assigned_user_id:Quotes_Assigned_To:V'),
 
 		   Array('vtiger_quotes:subject:subject:Quotes_Subject:V',
                          'vtiger_quotes:potentialid:potential_id:Quotes_Potential_Name:I',
-                         'vtiger_quotes:accountid:account_id:Quotes_Account_Name:I',
+			 'vtiger_account:accountname:accountname:Quotes_Account_Name:V'
                          'vtiger_quotes:validtill:validtill:Quotes_Valid_Till:D',
                          'vtiger_crmentity:smownerid:assigned_user_id:Quotes_Assigned_To:V'),
 			
@@ -327,7 +327,7 @@
 		  
 	          Array('vtiger_crmentity:crmid::SalesOrder_Order_Id:I',
                         'vtiger_salesorder:subject:subject:SalesOrder_Subject:V',
-                        'vtiger_account:accountid:account_id:SalesOrder_Account_Name:V',
+                       	'vtiger_account:accountname:accountname:SalesOrder_Account_Name:V',
                         'vtiger_quotes:quoteid:quote_id:SalesOrder_Quote_Name:I',
                         'vtiger_salesorder:total:hdnGrandTotal:SalesOrder_Total:V',
                         'vtiger_crmentity:smownerid:assigned_user_id:SalesOrder_Assigned_To:V'),
@@ -388,7 +388,7 @@
 		
 		 Array(  'vtiger_invoice:invoice_no:invoice_no:Invoice_invoice_no:V',
 		 	 'vtiger_invoice:subject:subject:Invoice_Subject:V',
-			 'vtiger_invoice:accountid:account_id:Invoice_Account_Name:I',
+			 'vtiger_account:accountname:accountname:Invoice_Account_Name:V',
 			 'vtiger_invoice:salesorderid:salesorder_id:Invoice_Sales_Order:I',
 			 'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V',
 			 'vtiger_crmentity:smownerid:assigned_user_id:Invoice_Assigned_To:V',
@@ -396,14 +396,14 @@
 		 
 		 Array(	 'vtiger_invoice:invoice_no:invoice_no:Invoice_invoice_no:V',
 			 'vtiger_invoice:subject:subject:Invoice_Subject:V',
-			 'vtiger_invoice:accountid:account_id:Invoice_Account_Name:I',
+			 'vtiger_account:accountname:accountname:Invoice_Account_Name:V',
 			 'vtiger_invoice:salesorderid:salesorder_id:Invoice_Sales_Order:I',
 			 'vtiger_invoice:invoicestatus:invoicestatus:Invoice_Status:V',
 			 'vtiger_invoiceshipads:ship_street:ship_street:Invoice_Shipping_Address:V',
 			 'vtiger_crmentity:smownerid:assigned_user_id:Invoice_Assigned_To:V'),
 
 		 Array(	 'vtiger_salesorder:subject:subject:SalesOrder_Subject:V',
-			 'vtiger_salesorder:accountid:account_id:SalesOrder_Account_Name:I',
+			 'vtiger_account:accountname:accountname:SalesOrder_Account_Name:V',
 			 'vtiger_salesorder:sostatus:sostatus:SalesOrder_Status:V',
 			 'vtiger_crmentity:smownerid:assigned_user_id:SalesOrder_Assigned_To:V',
 			 'vtiger_soshipads:ship_street:ship_street:SalesOrder_Shipping_Address:V',

Modified: vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php (original)
+++ vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Sun Apr 15 11:16:51 2007
@@ -41,7 +41,7 @@
 				
 	var $column_fields = Array();
 
-	var $sortby_fields = Array('subject','crmid','invoicestatus','smownerid');		
+	var $sortby_fields = Array('subject','crmid','invoicestatus','smownerid','accountname');		
 
 	// This is used to retrieve related vtiger_fields from form posts.
 	var $additional_column_fields = Array('assigned_user_name', 'smownerid', 'opportunity_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' );

Modified: vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php (original)
+++ vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Sun Apr 15 11:16:51 2007
@@ -45,7 +45,7 @@
 
 	var $column_fields = Array();
 
-	var $sortby_fields = Array('potentialname','amount','closingdate','smownerid');
+	var $sortby_fields = Array('potentialname','amount','closingdate','smownerid','accountname');
 
 
 	// This is the list of vtiger_fields that are in the lists.

Modified: vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php (original)
+++ vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Sun Apr 15 11:16:51 2007
@@ -51,7 +51,7 @@
 
 	var $column_fields = Array();
 
-	var $sortby_fields = Array('subject','crmid','smownerid');		
+	var $sortby_fields = Array('subject','crmid','smownerid','accountname');		
 
 	// This is used to retrieve related vtiger_fields from form posts.
 	var $additional_column_fields = Array('assigned_user_name', 'smownerid', 'opportunity_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' );

Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php (original)
+++ vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Sun Apr 15 11:16:51 2007
@@ -50,7 +50,7 @@
 
 	var $column_fields = Array();
 
-	var $sortby_fields = Array('subject','smownerid');		
+	var $sortby_fields = Array('subject','smownerid','accountname');		
 
 	// This is used to retrieve related vtiger_fields from form posts.
 	var $additional_column_fields = Array('assigned_user_name', 'smownerid', 'opportunity_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' );





More information about the vtigercrm-commits mailing list