[Vtigercrm-commits] [vtiger-commits] r7058 - in /vtigercrm/trunk/modules: HelpDesk/ Invoice/ Potentials/ PriceBooks/ Products/ PurchaseOrder/ Quotes/ SalesOrder/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Jun 13 12:36:31 EDT 2006


Author: saraj
Date: Tue Jun 13 10:36:15 2006
New Revision: 7058

Log:
Issue in related list sorting fixed. Fixes #1283

Modified:
    vtigercrm/trunk/modules/HelpDesk/HelpDesk.php
    vtigercrm/trunk/modules/HelpDesk/ListView.php
    vtigercrm/trunk/modules/Invoice/Invoice.php
    vtigercrm/trunk/modules/Invoice/ListView.php
    vtigercrm/trunk/modules/Potentials/ListView.php
    vtigercrm/trunk/modules/Potentials/Opportunity.php
    vtigercrm/trunk/modules/PriceBooks/ListView.php
    vtigercrm/trunk/modules/PriceBooks/PriceBook.php
    vtigercrm/trunk/modules/Products/ListView.php
    vtigercrm/trunk/modules/Products/Product.php
    vtigercrm/trunk/modules/PurchaseOrder/ListView.php
    vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php
    vtigercrm/trunk/modules/Quotes/ListView.php
    vtigercrm/trunk/modules/Quotes/Quote.php
    vtigercrm/trunk/modules/SalesOrder/ListView.php
    vtigercrm/trunk/modules/SalesOrder/SalesOrder.php

Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Tue Jun 13 10:36:15 2006
@@ -80,6 +80,31 @@
 		$this->column_fields = getColumnFields('HelpDesk');
 		$this->log->debug("Exiting HelpDesk method ...");
 	}
+
+	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
+	function getSortOrder()
+	{
+		global $log;
+                $log->debug("Entering getSortOrder() method ...");	
+		if(isset($_REQUEST['sorder'])) 
+			$sorder = $_REQUEST['sorder'];
+		else
+			$sorder = (($_SESSION['HELPDESK_SORT_ORDER'] != '')?($_SESSION['HELPDESK_SORT_ORDER']):($this->default_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+                $log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by'])) 
+			$order_by = $_REQUEST['order_by'];
+		else
+			$order_by = (($_SESSION['HELPDESK_ORDER_BY'] != '')?($_SESSION['HELPDESK_ORDER_BY']):($this->default_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
+	}	
 
 	/**     Function to form the query to get the list of activities
          *      @param  int $id - ticket id

Modified: vtigercrm/trunk/modules/HelpDesk/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/ListView.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/ListView.php Tue Jun 13 10:36:15 2006
@@ -53,15 +53,8 @@
 $url_string = ''; // assigning http url string
 
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['HELPDESK_ORDER_BY'] != '')?($_SESSION['HELPDESK_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['HELPDESK_SORT_ORDER'] != '')?($_SESSION['HELPDESK_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['HELPDESK_ORDER_BY'] = $order_by;
 $_SESSION['HELPDESK_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/Invoice/Invoice.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/Invoice.php (original)
+++ vtigercrm/trunk/modules/Invoice/Invoice.php Tue Jun 13 10:36:15 2006
@@ -99,6 +99,31 @@
 		$this->column_fields = getColumnFields('Invoice');
 		$this->log->debug("Exiting Invoice method ...");
 	}
+
+	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
+	function getSortOrder()
+	{
+		global $log;
+                $log->debug("Entering getSortOrder() method ...");	
+		if(isset($_REQUEST['sorder'])) 
+			$sorder = $_REQUEST['sorder'];
+		else
+			$sorder = (($_SESSION['INVOICE_SORT_ORDER'] != '')?($_SESSION['INVOICE_SORT_ORDER']):($this->default_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+                $log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by'])) 
+			$order_by = $_REQUEST['order_by'];
+		else
+			$order_by = (($_SESSION['INVOICE_ORDER_BY'] != '')?($_SESSION['INVOICE_ORDER_BY']):($this->default_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
+	}	
 
 	function get_summary_text()
 	{

Modified: vtigercrm/trunk/modules/Invoice/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/ListView.php (original)
+++ vtigercrm/trunk/modules/Invoice/ListView.php Tue Jun 13 10:36:15 2006
@@ -55,15 +55,8 @@
         $smarty->assign("ERROR","");
 }
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['INVOICE_ORDER_BY'] != '')?($_SESSION['INVOICE_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['INVOICE_SORT_ORDER'] != '')?($_SESSION['INVOICE_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['INVOICE_ORDER_BY'] = $order_by;
 $_SESSION['INVOICE_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/Potentials/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/ListView.php (original)
+++ vtigercrm/trunk/modules/Potentials/ListView.php Tue Jun 13 10:36:15 2006
@@ -57,15 +57,8 @@
         $smarty->assign("ERROR","");
 }
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['POTENTIALS_ORDER_BY'] != '')?($_SESSION['POTENTIALS_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['POTENTIALS_SORT_ORDER'] != '')?($_SESSION['POTENTIALS_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['POTENTIALS_ORDER_BY'] = $order_by;
 $_SESSION['POTENTIALS_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/Potentials/Opportunity.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/Opportunity.php (original)
+++ vtigercrm/trunk/modules/Potentials/Opportunity.php Tue Jun 13 10:36:15 2006
@@ -102,6 +102,30 @@
 	}
 
 	var $new_schema = true;
+	
+	function getSortOrder()
+	{
+		global $log;
+                $log->debug("Entering getSortOrder() method ...");	
+		if(isset($_REQUEST['sorder'])) 
+			$sorder = $_REQUEST['sorder'];
+		else
+			$sorder = (($_SESSION['POTENTIALS_SORT_ORDER'] != '')?($_SESSION['POTENTIALS_SORT_ORDER']):($this->default_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+                $log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by'])) 
+			$order_by = $_REQUEST['order_by'];
+		else
+			$order_by = (($_SESSION['POTENTIALS_ORDER_BY'] != '')?($_SESSION['POTENTIALS_ORDER_BY']):($this->default_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
+	}	
 
 	function create_list_query($order_by, $where)
 	{

Modified: vtigercrm/trunk/modules/PriceBooks/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/ListView.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/ListView.php Tue Jun 13 10:36:15 2006
@@ -54,15 +54,8 @@
 if (!isset($where)) $where = "";
 
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['PRICEBOOK_ORDER_BY'] != '')?($_SESSION['PRICEBOOK_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['PRICEBOOK_SORT_ORDER'] != '')?($_SESSION['PRICEBOOK_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['PRICEBOOK_ORDER_BY'] = $order_by;
 $_SESSION['PRICEBOOK_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/PriceBooks/PriceBook.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/PriceBook.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/PriceBook.php Tue Jun 13 10:36:15 2006
@@ -57,6 +57,31 @@
 		$this->log->debug("Exiting PriceBook method ...");
 	}
 
+	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
+	function getSortOrder()
+	{
+		global $log;
+                $log->debug("Entering getSortOrder() method ...");	
+		if(isset($_REQUEST['sorder'])) 
+			$sorder = $_REQUEST['sorder'];
+		else
+			$sorder = (($_SESSION['PRICEBOOK_SORT_ORDER'] != '')?($_SESSION['PRICEBOOK_SORT_ORDER']):($this->default_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+                $log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by'])) 
+			$order_by = $_REQUEST['order_by'];
+		else
+			$order_by = (($_SESSION['PRICEBOOK_ORDER_BY'] != '')?($_SESSION['PRICEBOOK_ORDER_BY']):($this->default_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
+	}	
+
 	function get_pricebook_products($id)
 	{
 		global $log;

Modified: vtigercrm/trunk/modules/Products/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Products/ListView.php (original)
+++ vtigercrm/trunk/modules/Products/ListView.php Tue Jun 13 10:36:15 2006
@@ -59,15 +59,8 @@
 $focus = new Product();
 
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['PRODUCTS_ORDER_BY'] != '')?($_SESSION['PRODUCTS_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['PRODUCTS_SORT_ORDER'] != '')?($_SESSION['PRODUCTS_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['PRODUCTS_ORDER_BY'] = $order_by;
 $_SESSION['PRODUCTS_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/Products/Product.php
==============================================================================
--- vtigercrm/trunk/modules/Products/Product.php (original)
+++ vtigercrm/trunk/modules/Products/Product.php Tue Jun 13 10:36:15 2006
@@ -75,6 +75,32 @@
 		$this->db = new PearDatabase();
 		$this->column_fields = getColumnFields('Products');
 		$this->log->debug("Exiting Product method ...");
+	}
+	
+	function getSortOrder()
+	{
+		global $log;
+		$log->debug("Entering getSortOrder() method ...");
+		if(isset($_REQUEST['sorder']))
+		$sorder = $_REQUEST['sorder'];
+		else
+		$sorder = (($_SESSION['PRODUCTS_SORT_ORDER'] != '')?($_SESSION['PRODUCTS_SORT_ORDER']):($this->defa
+		ult_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+		$log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by']))
+		$order_by = $_REQUEST['order_by'];
+		else
+		$order_by = (($_SESSION['PRODUCTS_ORDER_BY'] != '')?($_SESSION['PRODUCTS_ORDER_BY']):($this->defaul
+		t_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
 	}
 
 	function get_attachments($id)

Modified: vtigercrm/trunk/modules/PurchaseOrder/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/ListView.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/ListView.php Tue Jun 13 10:36:15 2006
@@ -54,15 +54,8 @@
         $smarty->assign("ERROR","");
 }
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['PURCHASEORDER_ORDER_BY'] != '')?($_SESSION['PURCHASEORDER_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['PURCHASEORDER_SORT_ORDER'] != '')?($_SESSION['PURCHASEORDER_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['PURCHASEORDER_ORDER_BY'] = $order_by;
 $_SESSION['PURCHASEORDER_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php Tue Jun 13 10:36:15 2006
@@ -98,6 +98,31 @@
 		$this->db = new PearDatabase();
 		$this->column_fields = getColumnFields('PurchaseOrder');
 	}
+
+	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
+	function getSortOrder()
+	{
+		global $log;
+                $log->debug("Entering getSortOrder() method ...");	
+		if(isset($_REQUEST['sorder'])) 
+			$sorder = $_REQUEST['sorder'];
+		else
+			$sorder = (($_SESSION['PURCHASEORDER_SORT_ORDER'] != '')?($_SESSION['PURCHASEORDER_SORT_ORDER']):($this->default_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+                $log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by'])) 
+			$order_by = $_REQUEST['order_by'];
+		else
+			$order_by = (($_SESSION['PURCHASEORDER_ORDER_BY'] != '')?($_SESSION['PURCHASEORDER_ORDER_BY']):($this->default_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
+	}	
 
 /** Function to get activities associated with the id
  *  This function accepts the id as arguments and execute the MySQL query using the id

Modified: vtigercrm/trunk/modules/Quotes/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/ListView.php (original)
+++ vtigercrm/trunk/modules/Quotes/ListView.php Tue Jun 13 10:36:15 2006
@@ -55,15 +55,8 @@
         $smarty->assign("ERROR","");
 }
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['QUOTES_ORDER_BY'] != '')?($_SESSION['QUOTES_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['QUOTES_SORT_ORDER'] != '')?($_SESSION['QUOTES_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['QUOTES_ORDER_BY'] = $order_by;
 $_SESSION['QUOTES_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/Quotes/Quote.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/Quote.php (original)
+++ vtigercrm/trunk/modules/Quotes/Quote.php Tue Jun 13 10:36:15 2006
@@ -102,6 +102,32 @@
 		$this->db = new PearDatabase();
 		$this->column_fields = getColumnFields('Quotes');
 	}
+	
+	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
+	function getSortOrder()
+	{
+		global $log;
+                $log->debug("Entering getSortOrder() method ...");	
+		if(isset($_REQUEST['sorder'])) 
+			$sorder = $_REQUEST['sorder'];
+		else
+			$sorder = (($_SESSION['QUOTES_SORT_ORDER'] != '')?($_SESSION['QUOTES_SORT_ORDER']):($this->default_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+                $log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by'])) 
+			$order_by = $_REQUEST['order_by'];
+		else
+			$order_by = (($_SESSION['QUOTES_ORDER_BY'] != '')?($_SESSION['QUOTES_ORDER_BY']):($this->default_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
+	}	
+	// Mike Crowe Mod --------------------------------------------------------
 
 	function get_salesorder($id)
 	{

Modified: vtigercrm/trunk/modules/SalesOrder/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/ListView.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/ListView.php Tue Jun 13 10:36:15 2006
@@ -52,15 +52,8 @@
         $smarty->assign("ERROR","");
 }
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-else
-	$order_by = (($_SESSION['SALESORDER_ORDER_BY'] != '')?($_SESSION['SALESORDER_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
-	$sorder = $_REQUEST['sorder'];
-else
-	$sorder = (($_SESSION['SALESORDER_SORT_ORDER'] != '')?($_SESSION['SALESORDER_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
 
 $_SESSION['SALESORDER_ORDER_BY'] = $order_by;
 $_SESSION['SALESORDER_SORT_ORDER'] = $sorder;

Modified: vtigercrm/trunk/modules/SalesOrder/SalesOrder.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/SalesOrder.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/SalesOrder.php Tue Jun 13 10:36:15 2006
@@ -104,6 +104,32 @@
 		$this->db = new PearDatabase();
 		$this->column_fields = getColumnFields('SalesOrder');
 	}
+	
+	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
+	function getSortOrder()
+	{
+		global $log;
+                $log->debug("Entering getSortOrder() method ...");	
+		if(isset($_REQUEST['sorder'])) 
+			$sorder = $_REQUEST['sorder'];
+		else
+			$sorder = (($_SESSION['SALESORDER_SORT_ORDER'] != '')?($_SESSION['SALESORDER_SORT_ORDER']):($this->default_sort_order));
+		$log->debug("Exiting getSortOrder() method ...");
+		return $sorder;
+	}
+
+	function getOrderBy()
+	{
+		global $log;
+                $log->debug("Entering getOrderBy() method ...");
+		if (isset($_REQUEST['order_by'])) 
+			$order_by = $_REQUEST['order_by'];
+		else
+			$order_by = (($_SESSION['SALESORDER_ORDER_BY'] != '')?($_SESSION['SALESORDER_ORDER_BY']):($this->default_order_by));
+		$log->debug("Exiting getOrderBy method ...");
+		return $order_by;
+	}	
+	// Mike Crowe Mod --------------------------------------------------------
 
 /** Function to get activities associated with the id
  *  This function accepts the id as arguments and execute the MySQL query using the id





More information about the vtigercrm-commits mailing list