[Vtigercrm-commits] [vtiger-commits] r10354 - /vtigercrm/branches/5.0.3/modules/Leads/ListView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Mar 6 02:10:38 EST 2007
Author: richie
Date: Tue Mar 6 00:10:25 2007
New Revision: 10354
Log:
fixes #3118
Modified:
vtigercrm/branches/5.0.3/modules/Leads/ListView.php
Modified: vtigercrm/branches/5.0.3/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Leads/ListView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Leads/ListView.php Tue Mar 6 00:10:25 2007
@@ -166,7 +166,7 @@
$query .= ' and '.$where;
}
-
+/*
if(isset($order_by) && $order_by != '')
{
$tablename = getTableNameForField('Leads',$order_by);
@@ -177,7 +177,24 @@
$query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder;
}
-
+*/
+if(isset($order_by) && $order_by != '')
+{
+ if($order_by == 'smownerid')
+ {
+ $query .= ' ORDER BY user_name '.$sorder;
+ }
+ else
+ {
+ $tablename = getTableNameForField('Leads',$order_by);
+ $tablename = (($tablename != '')?($tablename."."):'');
+ if( $adb->dbType == "pgsql")
+ $query .= ' GROUP BY '.$tablename.$order_by;
+
+
+ $query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder;
+ }
+}
//Retreiving the no of rows
$count_result = $adb->query( mkCountQuery( $query));
$noofrows = $adb->query_result($count_result,0,"count");
More information about the vtigercrm-commits
mailing list