[Vtigercrm-commits] [vtiger-commits] r5102 - in /vtigercrm/trunk/modules: Accounts/ListView.php Leads/Lead.php Leads/ListView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 13 08:36:05 EDT 2006
Author: saraj
Date: Thu Apr 13 06:35:55 2006
New Revision: 5102
Log:
Changes made for Search
Modified:
vtigercrm/trunk/modules/Accounts/ListView.php
vtigercrm/trunk/modules/Leads/Lead.php
vtigercrm/trunk/modules/Leads/ListView.php
Modified: vtigercrm/trunk/modules/Accounts/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/ListView.php (original)
+++ vtigercrm/trunk/modules/Accounts/ListView.php Thu Apr 13 06:35:55 2006
@@ -63,34 +63,10 @@
if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
{
- $where=Search($currentModule);
+ $where = getWhereCondition($currentModule);
// we have a query
$url_string .="&query=true";
- //Added for Custom Field Search
- $sql="select * from field where tablename='accountscf' order by fieldlabel";
- $result=$adb->query($sql);
- for($i=0;$i<$adb->num_rows($result);$i++)
- {
- $column[$i]=$adb->query_result($result,$i,'columnname');
- $fieldlabel[$i]=$adb->query_result($result,$i,'fieldlabel');
- $uitype[$i]=$adb->query_result($result,$i,'uitype');
- if (isset($_REQUEST[$column[$i]])) $customfield[$i] = $_REQUEST[$column[$i]];
-
- if(isset($customfield[$i]) && $customfield[$i] != '')
- {
- if($uitype[$i] == 56)
- $str = " accountscf.".$column[$i]." = 1";
- elseif($uitype[$i] == 15)//Added to handle the picklist customfield - after 4.2 patch2
- $str = " accountscf.".$column[$i]." = '".$customfield[$i]."'";
- else
- $str = " accountscf.".$column[$i]." like '$customfield[$i]%'";
- array_push($where_clauses, $str);
- $url_string .="&".$column[$i]."=".$customfield[$i];
- }
- }
- //upto this added for Custom Field
$log->info("Here is the where clause for the list view: $where");
-
}
if($viewid != 0)
{
@@ -242,6 +218,10 @@
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string,"Accounts","index",$viewid);
$alphabetical = AlphabeticalSearch($currentModule,'index','accountname','true','basic',"","","","",$viewid);
+$fieldnames = getAdvSearchfields($module);
+$criteria = getcriteria_options();
+$smarty->assign("CRITERIA", $criteria);
+$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("RECORD_COUNTS", $record_string);
Modified: vtigercrm/trunk/modules/Leads/Lead.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/Lead.php (original)
+++ vtigercrm/trunk/modules/Leads/Lead.php Thu Apr 13 06:35:55 2006
@@ -150,7 +150,28 @@
$this->column_fields = getColumnFields('Leads');
}
-
+ // Mike Crowe Mod --------------------------------------------------------Default ordering for us
+ function getSortOrder()
+ {
+ if(isset($_REQUEST['sorder']))
+ $sorder = $_REQUEST['sorder'];
+ else
+ $sorder = (($_SESSION['LEADS_SORT_ORDER'] != '')?($_SESSION['LEADS_SORT_ORDER']):($this->default_sort_order));
+
+ return $sorder;
+ }
+
+ function getOrderBy()
+ {
+ if (isset($_REQUEST['order_by']))
+ $order_by = $_REQUEST['order_by'];
+ else
+ $order_by = (($_SESSION['LEADS_ORDER_BY'] != '')?($_SESSION['LEADS_ORDER_BY']):($this->default_order_by));
+
+ return $order_by;
+ }
+ // Mike Crowe Mod --------------------------------------------------------
+
function create_export_query(&$order_by, &$where)
Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Thu Apr 13 06:35:55 2006
@@ -50,15 +50,8 @@
$smarty = new vtigerCRM_Smarty;
$other_text=Array();
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
- $order_by = $_REQUEST['order_by'];
-else
- $order_by = (($_SESSION['LEADS_ORDER_BY'] != '')?($_SESSION['LEADS_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
- $sorder = $_REQUEST['sorder'];
-else
- $sorder = (($_SESSION['LEADS_SORT_ORDER'] != '')?($_SESSION['LEADS_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
$_SESSION['LEADS_ORDER_BY'] = $order_by;
$_SESSION['LEADS_SORT_ORDER'] = $sorder;
@@ -83,9 +76,7 @@
$where = getWhereCondition($currentModule);
// we have a query
$url_string .="&query=true";
-
$log->info("Here is the where clause for the list view: $where");
-
}
//<<<<cutomview>>>>>>>
More information about the vtigercrm-commits
mailing list